wrong-notebook 2026.10.30 → 2026.10.31-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -0
- package/.next/build-manifest.json +14 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -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 +9 -9
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js +4 -4
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js +4 -4
- 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 +9 -9
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js +2 -2
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +3 -3
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +6 -6
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +9 -9
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +11 -11
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +10 -10
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js +2 -2
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js +4 -4
- 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 +10 -10
- 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 +11 -11
- 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 +12 -12
- 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 +4 -4
- 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 +4 -4
- package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +10 -10
- 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 +10 -10
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/route.js +2 -2
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +10 -10
- 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 +10 -10
- 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 +4 -4
- 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 +4 -4
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +3 -3
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +13 -13
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js +2 -2
- package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js +4 -4
- 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 +11 -11
- 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 +11 -11
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +11 -11
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +8 -8
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +12 -12
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +5 -5
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +9 -9
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +11 -11
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/initialize/route/build-manifest.json +12 -0
- package/.next/server/app/api/initialize/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/initialize/route.js +12 -0
- package/.next/server/app/api/initialize/route.js.map +5 -0
- package/.next/server/app/api/initialize/route.js.nft.json +1 -0
- package/.next/server/app/api/initialize/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/logs/frontend/route.js +3 -3
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +5 -5
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js +4 -4
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +6 -6
- 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 +4 -4
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js +5 -5
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +8 -8
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +12 -12
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +10 -10
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +12 -12
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +13 -13
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +11 -11
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +3 -3
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +4 -2
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js +3 -3
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +10 -10
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +4 -4
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +4 -4
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js +4 -4
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +5 -5
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js +2 -2
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js +3 -3
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js +3 -3
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js +3 -3
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js +5 -5
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +8 -8
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +8 -8
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +4 -4
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +12 -12
- 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/app-paths-manifest.json +3 -0
- package/.next/server/app/initialize/page/build-manifest.json +22 -0
- package/.next/server/app/initialize/page/next-font-manifest.json +11 -0
- package/.next/server/app/initialize/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/initialize/page/server-reference-manifest.json +4 -0
- package/.next/server/app/initialize/page.js +14 -0
- package/.next/server/app/initialize/page.js.map +5 -0
- package/.next/server/app/initialize/page.js.nft.json +1 -0
- package/.next/server/app/initialize/page_client-reference-manifest.js +3 -0
- 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/{[externals]__0jzwjtlwxxyw6._.js → [externals]__0bi7qit452ls5._.js} +1 -1
- package/.next/server/chunks/[externals]__0e2regkf5bw64._.js +3 -0
- package/.next/server/chunks/{[externals]__04n7qbralh87n._.js → [externals]__1_ij0r5wb4t30._.js} +1 -1
- package/.next/server/chunks/[externals]__1anmfgb7av8ou._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0-b-yvjz48rkt._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0-vjdr00bjnt0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__00tywaxi-8b1l._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__02p_j11itze6b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__02v0ig608r6y0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__02z_6dlwrbt2b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__04q1m399dcul6._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__06xho6u8le3e7._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__07h2t-yzug3sg._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0j6f-2sb1zvv-._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0juklkqip-kat._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0odzrih6i03_7._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0orbb3gvf9h5l._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0rnwilu01f1tc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0tzjz0h-2ga7m._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1_gkx5xy1-3em._.js → [root-of-the-server]__0v3y7_fc4q7mu._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0w12wrduqkml_._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0yx12uf2avp6d._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0yzgn93vnozqe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10s5jgr6l7shg._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__16c0c0-pt6gz4._.js → [root-of-the-server]__1383tmq2tf24f._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__14-k7ayd3a8_l._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__14hy-qeyktudc._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1_2qj9kvv5g-9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ban_cu4u5ktr._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1f8bfi9fgos0g._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1g038brpx-jta._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1gx-b_vxyk--4._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1h-b09z-j8jp8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1h8y4ve4ddvy5._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1kff0rbt3ym95._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1krabeg6sihbm._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1m1ntd1-_5l0g._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1q9pzdlt18lp0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1sm7cyumbieif._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1thdx6loe3xd4._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ukn55clu33ii._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1un3mj5mywmvu._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1onv3pfwsqytl._.js → [root-of-the-server]__1y_z8uh29gvhv._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1yaxekogcfb41._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__208t95lee6s99._.js +1 -1
- package/.next/server/chunks/{_0q-x4ftphyse4._.js → _0ekrwj-qx_6uh._.js} +2 -2
- package/.next/server/chunks/_0qaoat396e0_3._.js +1 -1
- package/.next/server/chunks/{_1btq785jvvco6._.js → _0x3ltk09eli_f._.js} +2 -2
- package/.next/server/chunks/_1m-yyz-pl9-03._.js +1 -1
- package/.next/server/chunks/_1muwmr6j76v3m._.js +3 -0
- package/.next/server/chunks/_1vtmdpk7p4al9._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_initialize_route_actions_1bd9rtmznpeiv.js +3 -0
- package/.next/server/chunks/src_0bhf345rd7jho._.js +3 -0
- package/.next/server/chunks/src_lib_02ktrqkdh6_xt._.js +3 -0
- package/.next/server/chunks/src_lib_1qy5aajgog9r2._.js +1 -1
- package/.next/server/chunks/src_lib_initialization_ts_0uk331d512nu-._.js +57 -0
- package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0ledcudde4ndy._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1l0iskzq890dd._.js +3 -0
- package/.next/server/chunks/ssr/_0kr8c1wugeoy2._.js +3 -0
- package/.next/server/chunks/ssr/_0por-ny_nx4hz._.js +3 -0
- package/.next/server/chunks/ssr/_13yctxl5n295y._.js +3 -0
- package/.next/server/chunks/ssr/_1hih-3rrcvd5r._.js +3 -0
- package/.next/server/chunks/ssr/_1ub-zn6ndb6im._.js +3 -0
- package/.next/server/chunks/ssr/_1y_a6k7q3vg2p._.js +32 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_initialize_page_actions_1nt69gawi6f37.js +3 -0
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_circle-alert_0inq903c66mh_.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0g591s5nyuj20.js +3 -0
- package/.next/server/chunks/ssr/{src_components_04xv7f-d7_fyc._.js → src_0hbb4l46hkkx0._.js} +2 -2
- package/.next/server/chunks/ssr/src_1-cqlnizwbrvz._.js +3 -0
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_app_initialize_page_tsx_0v79s64spkms8._.js +3 -0
- package/.next/server/chunks/ssr/src_app_login_page_tsx_0yrgg2z_juzv9._.js +1 -1
- package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +3 -0
- package/.next/server/edge/chunks/node_modules_0um8zwzayafzq._.js +1 -1
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/middleware-build-manifest.js +14 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +4 -0
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0-g2qiz5eregb.js +1 -0
- package/.next/static/chunks/06zpvgwws_flj.js +1 -0
- package/.next/static/chunks/0jut1vg7qtq0j.js +1 -0
- package/.next/static/chunks/1-0pbi32_0tiw.css +3 -0
- package/.next/static/chunks/1-6-wa_w1wy_c.js +1 -0
- package/.next/static/chunks/1xu_px8hpyqhm.js +1 -0
- package/.next/static/chunks/{00o1s_nir_tbc.js → 2nddfzlyynqiv.js} +1 -1
- package/.next/static/chunks/3_4ii4nyiyyj7.js +1 -0
- package/.next/static/chunks/3d86o-8o9e1_5.js +1 -0
- package/.next/static/chunks/3nrbakhvqod4r.js +1 -0
- package/.next/static/chunks/3t69fx29wlkt5.js +4 -0
- package/.next/static/chunks/44v1ecq31yy91.js +1 -0
- package/README.md +1 -1
- package/bin/wrong-notebook.js +1 -1
- package/launcher.js +2 -2
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[externals]__1242krpdwt3fy._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0an9s6-nn3kpq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0g-kb21pws7qu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ar95f9mysi15._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ixfwffo1gqy1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1n2uvss8wfueo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1pulvd2ac2agx._.js +0 -3
- package/.next/server/chunks/src_03_og0nynnyx2._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0s0807tegp2v8._.js +0 -3
- package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +0 -32
- package/.next/server/chunks/ssr/_0ms6yihjxbuy1._.js +0 -3
- package/.next/server/chunks/ssr/_0n_xmfdlu07f9._.js +0 -3
- package/.next/server/chunks/ssr/_1pnt2b76-xt6_._.js +0 -3
- package/.next/server/chunks/ssr/_1tg3c_6clbzhd._.js +0 -3
- package/.next/server/chunks/ssr/_20-x85_onge5x._.js +0 -3
- package/.next/server/chunks/ssr/src_components_practice-result-picker_tsx_06jytymet6adu._.js +0 -3
- package/.next/static/chunks/00n2-r3ac3dh5.js +0 -2
- package/.next/static/chunks/0a6399ins-4-q.js +0 -1
- package/.next/static/chunks/0p2fh98qaki45.js +0 -1
- package/.next/static/chunks/1r7yfcltcmwkh.js +0 -1
- package/.next/static/chunks/20x7-uv1sk708.js +0 -3
- package/.next/static/chunks/26qq8907b9j3d.js +0 -1
- package/.next/static/chunks/2cf27aonkij9_.css +0 -3
- package/.next/static/chunks/2mawf08h1jfc8.js +0 -1
- package/.next/static/chunks/2r4ddp7izc9sh.js +0 -1
- package/.next/static/chunks/2t6ygiu56xwkx.js +0 -1
- package/.next/static/chunks/2ucdm1a-llop_.js +0 -1
- /package/.next/static/{4KSCavDaw8kyhSyGiE86P → wVYX7jQw3pU0Nr-SIm3rW}/_buildManifest.js +0 -0
- /package/.next/static/{4KSCavDaw8kyhSyGiE86P → wVYX7jQw3pU0Nr-SIm3rW}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{4KSCavDaw8kyhSyGiE86P → wVYX7jQw3pU0Nr-SIm3rW}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[[827572,a=>{let b;var c,d,e=a.i(907997),f=a.i(423164);let g={className:f.default.className,style:{fontFamily:"'geistSans', 'geistSans Fallback'"}};null!=f.default.variable&&(g.variable=f.default.variable);var h=a.i(706111);let i={className:h.default.className,style:{fontFamily:"'geistMono', 'geistMono Fallback'"}};null!=h.default.variable&&(i.variable=h.default.variable);var j=a.i(547189),k=a.i(522734),l=a.i(814747);let m={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function n(a,b={}){let c,d=m[a],e=(c=process.env.LOG_LEVEL?.toLowerCase())&&void 0!==m[c]?m[c]:m.info;return(c,f)=>{let g,h;if(d<e)return;let i=new Date;"string"==typeof c?(g={},h=c):(g=c,h=f||"");{let c=JSON.stringify({level:a,time:i.toISOString(),...b,...g,msg:h});switch(a){case"error":case"fatal":console.error(c);break;case"warn":console.warn(c);break;default:console.log(c)}}}}let o=function a(b={}){return b.module,{trace:n("trace",b),debug:n("debug",b),info:n("info",b),warn:n("warn",b),error:n("error",b),fatal:n("fatal",b),child:c=>a({...b,...c}),box:(a,c,d="📋")=>{console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...b,title:a,..."string"==typeof c?{content:c}:c||{},msg:a}))},divider:(a="-")=>{}}}({env:"production"});new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));let p="Asia/Shanghai",q={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-2-1-lite-260915",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"ark-code-latest",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"ark-code-latest",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-2-1-lite-260915",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},r=Object.keys(q),s=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"],t=s.filter(a=>"browser"!==a),u=o.child({module:"config"}),v=l.default.join(process.env.CONFIG_DIR||l.default.join(process.cwd(),"config"),"app-config.json"),w={aiProvider:process.env.AI_PROVIDER||"minimax",allowRegistration:"true"===process.env.ALLOW_REGISTRATION,aiDailyLimit:Number.isInteger(b="number"==typeof(c=process.env.AI_DAILY_LIMIT)?c:Number(c))&&b>0?b:0,timeZone:p,openai:{instances:process.env.OPENAI_API_KEY?[{id:"env-default",name:"Default (ENV)",apiKey:process.env.OPENAI_API_KEY,baseUrl:process.env.OPENAI_BASE_URL||"https://api.openai.com/v1",model:process.env.OPENAI_MODEL||"gpt-6.1-sol"}]:[],activeInstanceId:process.env.OPENAI_API_KEY?"env-default":void 0},gemini:{apiKey:process.env.GOOGLE_API_KEY,baseUrl:process.env.GEMINI_BASE_URL,model:process.env.GEMINI_MODEL||"gemini-2.5-flash"},azure:{apiKey:process.env.AZURE_OPENAI_API_KEY,endpoint:process.env.AZURE_OPENAI_ENDPOINT,deploymentName:process.env.AZURE_OPENAI_DEPLOYMENT,apiVersion:process.env.AZURE_OPENAI_API_VERSION||"2024-02-15-preview",model:process.env.AZURE_OPENAI_MODEL||"gpt-4o"},anthropic:{apiKey:process.env.ANTHROPIC_API_KEY,baseUrl:process.env.ANTHROPIC_BASE_URL,model:process.env.ANTHROPIC_MODEL||"claude-sonnet-5-5"},minimaxCode:{model:process.env.MINIMAX_CODE_MODEL,autoCheckin:"false"!==process.env.MINIMAX_CODE_AUTO_CHECKIN},tts:{mode:"string"==typeof(d=process.env.TTS_MODE)&&s.includes(d)?process.env.TTS_MODE:"browser",volcengine:{apiKey:process.env.VOLCENGINE_TTS_API_KEY}},...Object.fromEntries(r.map(a=>{let b=q[a].envPrefix;return[a,{apiKey:process.env[`${b}_API_KEY`],baseUrl:process.env[`${b}_BASE_URL`],model:process.env[`${b}_MODEL`]}]})),prompts:{analyze:"",similar:""},timeouts:{analyze:18e4}};a.s(["default",0,function({children:a}){return(0,e.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,e.jsx)("head",{children:(0,e.jsx)("title",{children:"AI智能错题本"})}),(0,e.jsx)("body",{className:`${g.variable} ${i.variable} antialiased`,suppressHydrationWarning:!0,children:(0,e.jsx)(j.Providers,{timeZone:function(){let a;try{a=function(){try{return k.default.readFileSync(v,"utf-8")}catch(a){if(a?.code==="ENOENT")return null;throw a}}()}catch(a){return u.error({error:a},"Failed to read config file"),w}if(null!==a)try{var b,c,d,e;let f=JSON.parse(a),g=f.openai;if((b=f.openai)&&"object"==typeof b&&"apiKey"in b&&!("instances"in b)){let a;u.info("Detected legacy OpenAI config, migrating to multi-instance format..."),g=function(a){if(!a.apiKey)return{instances:[],activeInstanceId:void 0};let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:"Default",apiKey:a.apiKey,baseUrl:a.baseUrl||"https://api.openai.com/v1",model:a.model||"gpt-6.1-sol"};return{instances:[b],activeInstanceId:b.id}}(f.openai),c={...f,openai:g},a=`${v}.${process.pid}.tmp`,k.default.writeFileSync(a,JSON.stringify(c,null,2)),k.default.renameSync(a,v),u.info("Legacy OpenAI config migrated successfully")}return{...w,...f,timeZone:!function(a){if("string"!=typeof a||!a.trim())return!1;try{return new Intl.DateTimeFormat("en",{timeZone:a.trim()}).format(),!0}catch{return!1}}(f.timeZone)?p:f.timeZone.trim(),openai:{instances:g?.instances||w.openai?.instances||[],activeInstanceId:g?.activeInstanceId||w.openai?.activeInstanceId},gemini:{...w.gemini,...f.gemini},azure:{...w.azure,...f.azure},anthropic:{...w.anthropic,...f.anthropic},minimaxCode:{...w.minimaxCode,...f.minimaxCode},...Object.fromEntries(r.map(a=>[a,{...w[a],...f[a]}])),prompts:{...w.prompts,...f.prompts},timeouts:{...w.timeouts,...f.timeouts},tts:(d=w.tts,e=f.tts,{mode:e?.mode??d?.mode??"browser",...Object.fromEntries(t.map(a=>[a,{...d?.[a],...e?.[a]}]))})}}catch(a){u.error({error:a},"Failed to read config file")}return w}().timeZone||p,children:a})})]})},"dynamic",0,"force-dynamic","metadata",0,{description:"基于AI的智能错题管理系统,帮助学生高效整理、分析和复习错题",appleWebApp:{capable:!0,statusBarStyle:"default",title:"智能错题本"},formatDetection:{telephone:!1},icons:{icon:"/icons/icon.png",apple:"/icons/apple-touch-icon.png"}},"viewport",0,{themeColor:"#4f46e5",width:"device-width",initialScale:1,maximumScale:1,userScalable:!1}],827572)},207698,a=>{let b=(0,a.i(211857).registerClientReference)(function(){throw Error("Attempted to call Providers() from the server but Providers is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/components/providers.tsx","Providers");a.s(["Providers",0,b])},547189,a=>{var b=a.i(207698);a.n(b)}],706111,a=>{a.v({className:"ayGZiq_className",variable:"ayGZiq_variable"})},423164,a=>{a.v({className:"ckR-yq_className",variable:"ckR-yq_variable"})},650645,function(a){a.n(a.i(827572))}];
|
|
1
|
+
module.exports=[[827572,a=>{let b;var c,d,e=a.i(907997),f=a.i(423164);let g={className:f.default.className,style:{fontFamily:"'geistSans', 'geistSans Fallback'"}};null!=f.default.variable&&(g.variable=f.default.variable);var h=a.i(706111);let i={className:h.default.className,style:{fontFamily:"'geistMono', 'geistMono Fallback'"}};null!=h.default.variable&&(i.variable=h.default.variable);var j=a.i(547189),k=a.i(522734),l=a.i(814747);let m={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function n(a,b={}){let c,d=m[a],e=(c=process.env.LOG_LEVEL?.toLowerCase())&&void 0!==m[c]?m[c]:m.info;return(c,f)=>{let g,h;if(d<e)return;let i=new Date;"string"==typeof c?(g={},h=c):(g=c,h=f||"");{let c=JSON.stringify({level:a,time:i.toISOString(),...b,...g,msg:h});switch(a){case"error":case"fatal":console.error(c);break;case"warn":console.warn(c);break;default:console.log(c)}}}}let o=function a(b={}){return b.module,{trace:n("trace",b),debug:n("debug",b),info:n("info",b),warn:n("warn",b),error:n("error",b),fatal:n("fatal",b),child:c=>a({...b,...c}),box:(a,c,d="📋")=>{console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...b,title:a,..."string"==typeof c?{content:c}:c||{},msg:a}))},divider:(a="-")=>{}}}({env:"production"});new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));let p="Asia/Shanghai",q={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},r=Object.keys(q),s=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"],t=s.filter(a=>"browser"!==a),u=o.child({module:"config"}),v=l.default.join(process.env.CONFIG_DIR||l.default.join(process.cwd(),"config"),"app-config.json"),w={aiProvider:process.env.AI_PROVIDER||"minimax",allowRegistration:"true"===process.env.ALLOW_REGISTRATION,aiDailyLimit:Number.isInteger(b="number"==typeof(c=process.env.AI_DAILY_LIMIT)?c:Number(c))&&b>0?b:0,timeZone:p,openai:{instances:process.env.OPENAI_API_KEY?[{id:"env-default",name:"Default (ENV)",apiKey:process.env.OPENAI_API_KEY,baseUrl:process.env.OPENAI_BASE_URL||"https://api.openai.com/v1",model:process.env.OPENAI_MODEL||"gpt-6.1-sol"}]:[],activeInstanceId:process.env.OPENAI_API_KEY?"env-default":void 0},gemini:{apiKey:process.env.GOOGLE_API_KEY,baseUrl:process.env.GEMINI_BASE_URL,model:process.env.GEMINI_MODEL||"gemini-2.5-flash"},azure:{apiKey:process.env.AZURE_OPENAI_API_KEY,endpoint:process.env.AZURE_OPENAI_ENDPOINT,deploymentName:process.env.AZURE_OPENAI_DEPLOYMENT,apiVersion:process.env.AZURE_OPENAI_API_VERSION||"2024-02-15-preview",model:process.env.AZURE_OPENAI_MODEL||"gpt-4o"},anthropic:{apiKey:process.env.ANTHROPIC_API_KEY,baseUrl:process.env.ANTHROPIC_BASE_URL,model:process.env.ANTHROPIC_MODEL||"claude-sonnet-5-5"},minimaxCode:{model:process.env.MINIMAX_CODE_MODEL,autoCheckin:"false"!==process.env.MINIMAX_CODE_AUTO_CHECKIN},tts:{mode:"string"==typeof(d=process.env.TTS_MODE)&&s.includes(d)?process.env.TTS_MODE:"browser",volcengine:{apiKey:process.env.VOLCENGINE_TTS_API_KEY}},...Object.fromEntries(r.map(a=>{let b=q[a].envPrefix;return[a,{apiKey:process.env[`${b}_API_KEY`],baseUrl:process.env[`${b}_BASE_URL`],model:process.env[`${b}_MODEL`]}]})),prompts:{analyze:"",similar:""},timeouts:{analyze:18e4}};a.s(["default",0,function({children:a}){return(0,e.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,e.jsx)("head",{children:(0,e.jsx)("title",{children:"AI智能错题本"})}),(0,e.jsx)("body",{className:`${g.variable} ${i.variable} antialiased`,suppressHydrationWarning:!0,children:(0,e.jsx)(j.Providers,{timeZone:function(){let a;try{a=function(){try{return k.default.readFileSync(v,"utf-8")}catch(a){if(a?.code==="ENOENT")return null;throw a}}()}catch(a){return u.error({error:a},"Failed to read config file"),w}if(null!==a)try{var b,c,d,e;let f=JSON.parse(a),g=f.openai;if((b=f.openai)&&"object"==typeof b&&"apiKey"in b&&!("instances"in b)){let a;u.info("Detected legacy OpenAI config, migrating to multi-instance format..."),g=function(a){if(!a.apiKey)return{instances:[],activeInstanceId:void 0};let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:"Default",apiKey:a.apiKey,baseUrl:a.baseUrl||"https://api.openai.com/v1",model:a.model||"gpt-6.1-sol"};return{instances:[b],activeInstanceId:b.id}}(f.openai),c={...f,openai:g},a=`${v}.${process.pid}.tmp`,k.default.writeFileSync(a,JSON.stringify(c,null,2)),k.default.renameSync(a,v),u.info("Legacy OpenAI config migrated successfully")}return{...w,...f,timeZone:!function(a){if("string"!=typeof a||!a.trim())return!1;try{return new Intl.DateTimeFormat("en",{timeZone:a.trim()}).format(),!0}catch{return!1}}(f.timeZone)?p:f.timeZone.trim(),openai:{instances:g?.instances||w.openai?.instances||[],activeInstanceId:g?.activeInstanceId||w.openai?.activeInstanceId},gemini:{...w.gemini,...f.gemini},azure:{...w.azure,...f.azure},anthropic:{...w.anthropic,...f.anthropic},minimaxCode:{...w.minimaxCode,...f.minimaxCode},...Object.fromEntries(r.map(a=>[a,{...w[a],...f[a]}])),prompts:{...w.prompts,...f.prompts},timeouts:{...w.timeouts,...f.timeouts},tts:(d=w.tts,e=f.tts,{mode:e?.mode??d?.mode??"browser",...Object.fromEntries(t.map(a=>[a,{...d?.[a],...e?.[a]}]))})}}catch(a){u.error({error:a},"Failed to read config file")}return w}().timeZone||p,children:a})})]})},"dynamic",0,"force-dynamic","metadata",0,{description:"基于AI的智能错题管理系统,帮助学生高效整理、分析和复习错题",appleWebApp:{capable:!0,statusBarStyle:"default",title:"智能错题本"},formatDetection:{telephone:!1},icons:{icon:"/icons/icon.png",apple:"/icons/apple-touch-icon.png"}},"viewport",0,{themeColor:"#4f46e5",width:"device-width",initialScale:1,maximumScale:1,userScalable:!1}],827572)},207698,a=>{let b=(0,a.i(211857).registerClientReference)(function(){throw Error("Attempted to call Providers() from the server but Providers is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/components/providers.tsx","Providers");a.s(["Providers",0,b])},547189,a=>{var b=a.i(207698);a.n(b)}],706111,a=>{a.v({className:"ayGZiq_className",variable:"ayGZiq_variable"})},423164,a=>{a.v({className:"ckR-yq_className",variable:"ckR-yq_variable"})},650645,function(a){a.n(a.i(827572))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_1gayunqs8u2e2._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[364439,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246),e=a.i(50944),f=a.i(596221),g=a.i(293530),h=a.i(875003),i=a.i(699570),j=a.i(866718),k=a.i(550194),l=a.i(702930),m=a.i(630534);function n({token:a,onAlreadyInitialized:d}){let{t:g}=(0,k.b)(),o=g.auth.initialize,p=(0,e.useRouter)(),[q,r]=(0,c.useState)(o.defaultName),[s,t]=(0,c.useState)(l.J),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(""),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),C=async b=>{if(b.preventDefault(),z(""),u!==w)return void z(o.passwordMismatch);if(u.length<6||u===l.v)return void z(o.passwordHint);B(!0);try{let b=await fetch("/api/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a,name:q,email:s,password:u})});if(!b.ok){let a=await b.json().catch(()=>({}));409===b.status&&"ALREADY_EXISTS"===a.code?z(o.emailExists):409===b.status?d():403===b.status?z(o.invalidLink):z(o.failed);return}let c=await (0,h.signIn)("credentials",{redirect:!1,email:s.trim(),password:u});if(c?.error)return void z(o.signInFailed);p.replace("/setup"),p.refresh()}catch(a){m.f.error("[Initialize]","Failed to create admin",{error:a}),z(o.failed)}finally{B(!1)}};return(0,b.jsxs)("form",{onSubmit:C,className:"space-y-4",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:o.desc}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"name",className:"text-sm font-medium",children:o.name}),(0,b.jsx)(j.f,{id:"name",value:q,onChange:a=>r(a.target.value),maxLength:50,required:!0})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:g.auth.email}),(0,b.jsx)(j.f,{id:"email",type:"email",autoComplete:"username",value:s,onChange:a=>t(a.target.value),required:!0})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:g.auth.password}),(0,b.jsx)(j.f,{id:"password",type:"password",autoComplete:"new-password",value:u,onChange:a=>v(a.target.value),minLength:6,required:!0}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o.passwordHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"confirmPassword",className:"text-sm font-medium",children:g.auth.confirmPassword}),(0,b.jsx)(j.f,{id:"confirmPassword",type:"password",autoComplete:"new-password",value:w,onChange:a=>x(a.target.value),minLength:6,required:!0})]}),y&&(0,b.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-center text-sm text-destructive",children:y}),(0,b.jsxs)(i.f,{type:"submit",size:"lg",className:"w-full",disabled:A,children:[A&&(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}),A?o.submitting:o.submit]})]})}var o=a.i(69633),p=a.i(591119),q=a.i(557999);function r(){let{t:a}=(0,k.b)(),g=a.auth.initialize,h=(0,e.useSearchParams)().get("token")||"",[i,j]=(0,c.useState)(null);return((0,c.useEffect)(()=>{fetch("/api/register/status").then(a=>a.json()).then(a=>j(!0===a.initialized)).catch(a=>{m.f.error("[Initialize]","Failed to check initialization status",{error:a}),j(!1)})},[]),null===i)?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(f.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):i?(0,b.jsxs)("div",{className:"space-y-4 py-2 text-center",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:g.alreadyInitialized}),(0,b.jsx)(d.default,{href:"/login",className:"text-primary hover:underline",children:g.goLogin})]}):h?(0,b.jsx)(n,{token:h,onAlreadyInitialized:()=>j(!0)}):(0,b.jsx)(o.f,{})}a.s(["default",0,function(){let{t:a}=(0,k.b)();return(0,q.f)(a.auth.initialize.pageTitle),(0,b.jsx)(g.f,{children:(0,b.jsxs)(p.N,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,b.jsx)(p.Y,{children:(0,b.jsx)(p.v,{className:"text-2xl text-center",children:a.auth.initialize.title})}),(0,b.jsx)(p.O,{children:(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(f.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),children:(0,b.jsx)(r,{})})})]})})}],364439)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=src_app_initialize_page_tsx_0v79s64spkms8._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[793482,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(875003),e=a.i(50944),f=a.i(699570),g=a.i(866718),h=a.i(591119),i=a.i(
|
|
1
|
+
module.exports=[793482,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(875003),e=a.i(50944),f=a.i(699570),g=a.i(866718),h=a.i(591119),i=a.i(293530),j=a.i(69633),k=a.i(238246),l=a.i(452495),m=a.i(649447),n=a.i(550194),o=a.i(424235),p=a.i(702930);function q({allowRegistration:a}){let{t:c,language:d}=(0,n.b)(),e=c.auth.login,f=`${o.f}/wiki/${"en"===d?"FAQ-en":"FAQ"}`,[g,h]=e.firstUseAccount.split("{email}");return(0,b.jsxs)("div",{className:"space-y-3 text-sm text-muted-foreground",children:[!0===a&&(0,b.jsxs)("p",{className:"text-center",children:[e.noAccount,(0,b.jsx)(k.default,{href:"/register",className:"text-primary hover:underline",children:e.registerNow})]}),!1===a&&(0,b.jsx)("p",{className:"text-center",children:e.registrationClosed}),(0,b.jsxs)("details",{className:"group rounded-lg border bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-center gap-1.5 font-medium text-foreground",children:[(0,b.jsx)(m.f,{className:"h-4 w-4"}),e.firstUseTitle]}),(0,b.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,b.jsxs)("p",{children:[g,(0,b.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-foreground",children:p.J}),h]}),(0,b.jsx)("p",{children:e.firstUseNext}),(0,b.jsxs)("a",{href:f,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[e.firstUseDocs,(0,b.jsx)(l.f,{className:"h-3.5 w-3.5"})]})]})]})]})}var r=a.i(630534),s=a.i(557999);a.s(["default",0,function(){let a=(0,e.useRouter)(),{t:k}=(0,n.b)();(0,s.f)(k.pageTitle.login);let[l,m]=(0,c.useState)(""),[o,p]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(!0),B=(0,c.useCallback)(async()=>{try{let a=await fetch("/api/register/status"),b=await a.json();y(!0===b.allowRegistration),A(!1!==b.initialized)}catch(a){r.f.error("[Login]","Failed to check registration status",{error:a}),y(!1)}},[]);(0,c.useEffect)(()=>{B()},[B]);let C=async b=>{b.preventDefault(),w(!0),u("");try{let b=await (0,d.signIn)("credentials",{redirect:!1,email:l,password:o});b?.error?u(k.auth?.login?.failed||"Login failed"):(a.push("/"),a.refresh())}catch{u(k.auth?.login?.error||"An error occurred")}finally{w(!1)}};return(0,b.jsx)(i.f,{children:(0,b.jsxs)(h.N,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,b.jsx)(h.Y,{children:(0,b.jsx)(h.v,{className:"text-2xl text-center",children:k.auth?.login?.title||"Login"})}),(0,b.jsxs)(h.O,{className:"space-y-4",children:[!z&&(0,b.jsx)(j.f,{}),(0,b.jsxs)("form",{onSubmit:C,className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:k.auth?.email||"Email"}),(0,b.jsx)(g.f,{id:"email",name:"email",type:"email",value:l,onChange:a=>m(a.target.value),required:!0})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:k.auth?.password||"Password"}),(0,b.jsx)(g.f,{id:"password",name:"password",type:"password",value:o,onChange:a=>p(a.target.value),required:!0})]}),t&&(0,b.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-center text-sm text-destructive",children:t}),(0,b.jsx)(f.f,{type:"submit",size:"lg",className:"w-full",disabled:v,children:v?k.auth?.login?.loggingIn||"Logging in...":k.auth?.login?.action||"Login"}),(0,b.jsx)(q,{allowRegistration:x})]})]})]})})}],793482)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_login_page_tsx_0yrgg2z_juzv9._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[914546,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(875003),f=a.i(596221),g=a.i(293530),h=a.i(699570),i=a.i(550194),j=a.i(291938),k=a.i(710302),l=a.i(630534),m=a.i(151304),n=a.i(439830);function o({onSaved:a}){let{t:d}=(0,i.b)(),[e,f]=(0,c.useState)({aiProvider:"minimax"}),[g,h]=(0,c.useState)(!0),[p,q]=(0,c.useState)(!1);(0,c.useEffect)(()=>{j.f.get("/api/settings").then(a=>{f("minimax"!==a.aiProvider||a.minimax?.apiKey?a:{...a,aiProvider:"minimax-code"})}).catch(a=>l.f.error("[Setup]","Failed to fetch settings",{error:a})).finally(()=>h(!1))},[]);let r=async()=>{let b=(0,n.f)(e,d);if(b)return void k.c.error(b);q(!0);try{f(await j.f.post("/api/settings",e)),k.c.success(d.settings?.messages?.saved||"Settings saved"),a()}catch(a){l.f.error("[Setup]","Failed to save AI settings",{error:a}),k.c.error(d.settings?.messages?.saveFailed||"Failed to save")}finally{q(!1)}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:d.setup.ai.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d.setup.ai.desc})]}),(0,b.jsx)(m.f,{config:e,setConfig:f,loading:g,saving:p,onSave:r})]})}var p=a.i(953722),q=a.i(167453),r=a.i(74352),s=a.i(960927);function t(){let{t:a}=(0,i.b)(),[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)([]),m=async b=>{try{await j.f.post("/api/notebooks",b),g(a=>[...a,b.name])}catch(b){throw l.f.error("[Setup]","Failed to create notebook",{error:b}),k.c.error((0,s.d)(b)||a.notebooks?.createError||"Failed to create"),b}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a.setup.notebook.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a.setup.notebook.desc})]}),f.map(c=>(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-emerald-600 dark:text-emerald-400",children:[(0,b.jsx)(q.f,{className:"h-4 w-4 shrink-0"}),a.setup.notebook.created.replace("{name}",c)]},c)),(0,b.jsxs)(h.f,{type:"button",variant:"outline",className:"w-full",onClick:()=>e(!0),children:[(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),a.setup.notebook.create]}),(0,b.jsx)(r.f,{open:d,onOpenChange:e,onCreate:m})]})}var u=a.i(870430),v=a.i(152679);function
|
|
1
|
+
module.exports=[914546,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(875003),f=a.i(596221),g=a.i(293530),h=a.i(699570),i=a.i(550194),j=a.i(291938),k=a.i(710302),l=a.i(630534),m=a.i(151304),n=a.i(439830);function o({onSaved:a}){let{t:d}=(0,i.b)(),[e,f]=(0,c.useState)({aiProvider:"minimax"}),[g,h]=(0,c.useState)(!0),[p,q]=(0,c.useState)(!1);(0,c.useEffect)(()=>{j.f.get("/api/settings").then(a=>{f("minimax"!==a.aiProvider||a.minimax?.apiKey?a:{...a,aiProvider:"minimax-code"})}).catch(a=>l.f.error("[Setup]","Failed to fetch settings",{error:a})).finally(()=>h(!1))},[]);let r=async()=>{let b=(0,n.f)(e,d);if(b)return void k.c.error(b);q(!0);try{f(await j.f.post("/api/settings",e)),k.c.success(d.settings?.messages?.saved||"Settings saved"),a()}catch(a){l.f.error("[Setup]","Failed to save AI settings",{error:a}),k.c.error(d.settings?.messages?.saveFailed||"Failed to save")}finally{q(!1)}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:d.setup.ai.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d.setup.ai.desc})]}),(0,b.jsx)(m.f,{config:e,setConfig:f,loading:g,saving:p,onSave:r})]})}var p=a.i(953722),q=a.i(167453),r=a.i(74352),s=a.i(960927);function t(){let{t:a}=(0,i.b)(),[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)([]),m=async b=>{try{await j.f.post("/api/notebooks",b),g(a=>[...a,b.name])}catch(b){throw l.f.error("[Setup]","Failed to create notebook",{error:b}),k.c.error((0,s.d)(b)||a.notebooks?.createError||"Failed to create"),b}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a.setup.notebook.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a.setup.notebook.desc})]}),f.map(c=>(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-emerald-600 dark:text-emerald-400",children:[(0,b.jsx)(q.f,{className:"h-4 w-4 shrink-0"}),a.setup.notebook.created.replace("{name}",c)]},c)),(0,b.jsxs)(h.f,{type:"button",variant:"outline",className:"w-full",onClick:()=>e(!0),children:[(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),a.setup.notebook.create]}),(0,b.jsx)(r.f,{open:d,onOpenChange:e,onCreate:m})]})}var u=a.i(870430),v=a.i(152679),w=a.i(702930);function x({onDone:a}){let{t:d}=(0,i.b)(),{update:g}=(0,e.useSession)(),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(!1),t=async b=>{if(b.preventDefault(),m.length<6)return void k.c.error(d.setup.password.tooShort);if(m===w.v)return void k.c.error(d.setup.password.sameAsDefault);if(m!==o)return void k.c.error(d.setup.password.mismatch);r(!0);try{await j.f.patch("/api/user",{password:m}),await g(),k.c.success(d.setup.password.success),a()}catch(a){l.f.error("[Setup]","Failed to change default password",{error:a}),k.c.error((0,s.d)(a)||d.setup.password.failed)}finally{r(!1)}};return(0,b.jsxs)("form",{onSubmit:t,className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:d.setup.password.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d.setup.password.desc})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.f,{htmlFor:"setup-new-password",children:d.setup.password.newPassword}),(0,b.jsx)(v.f,{id:"setup-new-password",autoComplete:"new-password",value:m,onChange:a=>n(a.target.value)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.f,{htmlFor:"setup-confirm-password",children:d.setup.password.confirmPassword}),(0,b.jsx)(v.f,{id:"setup-confirm-password",autoComplete:"new-password",value:o,onChange:a=>p(a.target.value)})]}),(0,b.jsxs)(h.f,{type:"submit",className:"w-full",disabled:q,children:[q&&(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}),d.setup.password.submit]})]})}function y({mustChangePassword:a,setupCompleted:e}){let{t:g}=(0,i.b)(),m=(0,d.useRouter)(),[n]=(0,c.useState)(()=>a&&e?["password"]:a?["password","ai","notebook"]:["ai","notebook"]),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(!1),u=n[p],v=p===n.length-1,w=async()=>{s(!0);try{await j.f.post("/api/setup",{}),k.c.success(g.setup.finished),m.replace("/")}catch(a){l.f.error("[Setup]","Failed to complete setup",{error:a}),k.c.error(g.setup.completeFailed),s(!1)}},z=()=>{v?w():q(a=>a+1)};return(0,b.jsxs)("div",{className:"space-y-5",children:[n.length>1&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:g.setup.step.replace("{current}",String(p+1)).replace("{total}",String(n.length))}),(0,b.jsx)("div",{className:"flex gap-1.5",children:n.map((a,c)=>(0,b.jsx)("div",{className:`h-1.5 flex-1 rounded-full ${c<=p?"bg-primary":"bg-muted"}`},a))})]}),"password"===u&&(0,b.jsx)(x,{onDone:z}),"ai"===u&&(0,b.jsx)(o,{onSaved:z}),"notebook"===u&&(0,b.jsx)(t,{}),"password"!==u&&(v?(0,b.jsxs)(h.f,{type:"button",className:"w-full",onClick:w,disabled:r,children:[r&&(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}),g.setup.finish]}):(0,b.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-between",children:[(0,b.jsx)(h.f,{type:"button",variant:"ghost",onClick:w,disabled:r,children:g.setup.skipAll}),(0,b.jsx)(h.f,{type:"button",variant:"outline",onClick:z,disabled:r,children:g.setup.skip})]}))]})}var z=a.i(591119),A=a.i(557999);a.s(["default",0,function(){let{t:a}=(0,i.b)();(0,A.f)(a.setup.pageTitle);let h=(0,d.useRouter)(),{data:k,status:m}=(0,e.useSession)(),n=k?.user?.role==="admin",o=k?.user?.mustChangePassword===!0,[p,q]=(0,c.useState)(null);return(0,c.useEffect)(()=>{if("authenticated"===m&&!p){if(!n)return void h.replace("/");j.f.get("/api/setup").then(a=>q({mustChangePassword:o,setupCompleted:a.setupCompleted})).catch(a=>{l.f.error("[Setup]","Failed to fetch setup status",{error:a}),q({mustChangePassword:o,setupCompleted:!1})})}},[m,n,o,p,h]),(0,b.jsx)(g.f,{wide:!0,children:(0,b.jsx)(z.N,{children:(0,b.jsxs)(z.O,{className:"space-y-4",children:[p?(0,b.jsx)(y,{mustChangePassword:p.mustChangePassword,setupCompleted:p.setupCompleted}):(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(f.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),(0,b.jsx)("button",{type:"button",onClick:()=>(0,e.signOut)({callbackUrl:"/login"}),className:"w-full text-center text-sm text-muted-foreground hover:text-foreground",children:a.setup.logout})]})})})}],914546)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_setup_page_tsx_0szlnxow_9skp._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[418175,a=>{"use strict";var b=a.i(187924),c=a.i(550194),d=a.i(875003),e=a.i(529759),f=a.i(16644),g=a.i(238246),h=a.i(50944),i=a.i(839761),j=a.i(953722),k=a.i(327999),l=a.i(104720),m=a.i(220005),n=a.i(170106);let o=(0,n.f)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),p=(0,n.f)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var q=a.i(572131);let r=(0,n.f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),s=(0,n.f)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),t=(0,n.f)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var u=a.i(149625),v=a.i(596221);let w=(0,n.f)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]),x=(0,n.f)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var y=a.i(546842),z=a.i(154933),A=a.i(699570),B=a.i(814574),C=a.i(875083),D=a.i(986705),E=a.i(786304),F=a.i(563658),G=a.i(866718),H=a.i(870430),I=a.i(368114);let J=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("div",{className:"relative w-full overflow-auto",children:(0,b.jsx)("table",{ref:d,className:(0,I.f)("w-full caption-bottom text-sm",a),...c})}));J.displayName="Table";let K=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("thead",{ref:d,className:(0,I.f)("[&_tr]:border-b",a),...c}));K.displayName="TableHeader";let L=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tbody",{ref:d,className:(0,I.f)("[&_tr:last-child]:border-0",a),...c}));L.displayName="TableBody",(q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tfoot",{ref:d,className:(0,I.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...c}))).displayName="TableFooter";let M=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tr",{ref:d,className:(0,I.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...c}));M.displayName="TableRow";let N=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("th",{ref:d,className:(0,I.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...c}));N.displayName="TableHead";let O=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("td",{ref:d,className:(0,I.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...c}));O.displayName="TableCell",(q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("caption",{ref:d,className:(0,I.f)("mt-4 text-sm text-muted-foreground",a),...c}))).displayName="TableCaption";var P=a.i(781560);let Q=(0,n.f)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var R=a.i(816201),S=a.i(291938),T=a.i(710302),U=a.i(630534),V=a.i(960927);function W(){let{timeZone:a}=(0,e.M)(),{data:f}=(0,d.useSession)(),{t:g}=(0,c.b)(),[h,i]=(0,q.useState)([]),[j,k]=(0,q.useState)(!0),[l,m]=(0,q.useState)(!1),[n,o]=(0,q.useState)(!1),[p,r]=(0,q.useState)("0"),[s,t]=(0,q.useState)(!1),u=(0,q.useCallback)(async()=>{k(!0);try{let a=await S.f.get("/api/admin/users");i(a)}catch(a){U.f.error("[UserManagement]","Failed to fetch users",{error:a})}finally{k(!1)}},[]),w=(0,q.useCallback)(async()=>{try{let a=await S.f.get("/api/settings");m(!0===a.allowRegistration),r(String(a.aiDailyLimit??0))}catch(a){U.f.error("[UserManagement]","Failed to fetch config",{error:a})}},[]);(0,q.useEffect)(()=>{u(),w()},[u,w]);let x=async a=>{o(!0);try{await S.f.post("/api/settings",{allowRegistration:a}),m(a)}catch(a){U.f.error("[UserManagement]","Failed to update registration setting",{error:a}),T.c.error(g.common.error)}finally{o(!1)}},y=Number(p),z=""!==p.trim()&&Number.isInteger(y)&&y>=0,B=async()=>{if(z){t(!0);try{await S.f.post("/api/settings",{aiDailyLimit:y}),T.c.success(g.admin.aiDailyLimitSaved)}catch(a){U.f.error("[UserManagement]","Failed to update AI daily limit",{error:a}),T.c.error(g.common.error)}finally{t(!1)}}},C=async a=>{let b=a.isActive?g.admin.confirmDisable:g.admin.confirmEnable;if(await (0,T.u)(b))try{await S.f.patch(`/api/admin/users/${a.id}`,{isActive:!a.isActive}),u()}catch(a){U.f.error("[UserManagement]","Failed to update user status",{error:a}),T.c.error(g.common.error)}},I=async a=>{if(await (0,T.u)(g.admin.confirmDelete,{destructive:!0}))try{await S.f.delete(`/api/admin/users/${a.id}`),u()}catch(b){U.f.error("[UserManagement]","Failed to delete user",{error:b});let a=(0,V.d)(b)||g.common.error;T.c.error(a)}};return j?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(v.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(H.f,{className:"text-base",children:g.admin?.allowRegistration||"Allow New Registrations"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,b.jsx)(v.f,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)(F.f,{checked:l,onCheckedChange:x,disabled:n})]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(H.f,{htmlFor:"ai-daily-limit",className:"text-base",children:g.admin.aiDailyLimit}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin.aiDailyLimitDesc})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(G.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:p,onChange:a=>r(a.target.value),"aria-invalid":!z,className:"w-24"}),(0,b.jsxs)(A.f,{size:"sm",onClick:B,disabled:s||!z,children:[s&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),g.common.save]})]})]}),(0,b.jsx)("div",{className:"sm:hidden space-y-3",children:h.map(c=>(0,b.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(E.f,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})]}),(0,b.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[g.admin.errors,": ",c._count.errorItems," | ",g.admin.practiceCount,": ",c._count.practiceRecords," | ",g.admin.aiUsageToday,": ",c.aiUsageToday]}),(0,b.jsx)(E.f,{variant:c.isActive?"default":"destructive",className:"text-xs",children:c.isActive?g.admin.active:g.admin.disabled})]}),(0,b.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,D.r)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>C(c),disabled:c.id===f?.user?.id,children:c.isActive?(0,b.jsx)(Q,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(R.f,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>I(c),disabled:c.id===f?.user?.id,children:(0,b.jsx)(P.f,{className:"h-4 w-4 text-destructive"})})]})]})]},c.id))}),(0,b.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,b.jsxs)(J,{children:[(0,b.jsx)(K,{children:(0,b.jsxs)(M,{children:[(0,b.jsx)(N,{children:g.admin.nameEmail}),(0,b.jsx)(N,{children:g.admin.role}),(0,b.jsx)(N,{children:g.admin.stats}),(0,b.jsx)(N,{children:g.admin.createdAt}),(0,b.jsx)(N,{children:g.admin.status}),(0,b.jsx)(N,{className:"text-right",children:g.admin.actions})]})}),(0,b.jsx)(L,{children:h.map(c=>(0,b.jsxs)(M,{children:[(0,b.jsxs)(O,{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(O,{children:(0,b.jsx)(E.f,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})}),(0,b.jsxs)(O,{children:[(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.errors,": ",c._count.errorItems]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.practiceCount,": ",c._count.practiceRecords]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.aiUsageToday,": ",c.aiUsageToday]})]}),(0,b.jsx)(O,{children:(0,D.r)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsx)(O,{children:(0,b.jsx)(E.f,{variant:c.isActive?"default":"destructive",children:c.isActive?g.admin.active:g.admin.disabled})}),(0,b.jsxs)(O,{className:"text-right space-x-2",children:[(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>C(c),disabled:c.id===f?.user?.id,title:c.isActive?g.admin.disable:g.admin.enable,children:c.isActive?(0,b.jsx)(Q,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(R.f,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>I(c),disabled:c.id===f?.user?.id,title:g.admin.delete,children:(0,b.jsx)(P.f,{className:"h-4 w-4 text-destructive"})})]})]},c.id))})]})})]})}var X=a.i(452495);let Y=(0,n.f)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),Z=(0,n.f)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),$=(0,n.f)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function _(){return null}let aa=()=>()=>void 0;function ab(){let{t:a}=(0,c.b)(),d=(0,q.useSyncExternalStore)(aa,_,()=>null);return d?d.isStandalone?.()?(0,b.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:a.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"break-all",children:[a.settings?.about?.androidServer||"Server",": ",d.getServerUrl()]}),(0,b.jsxs)(A.f,{variant:"outline",className:"gap-2",onClick:()=>d.changeServer(),children:[(0,b.jsx)($,{className:"h-4 w-4"}),a.settings?.about?.changeServer||"Change server"]})]}):null}let ac="https://github.com/margrop/wrong-notebook";function ad(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)("");(0,q.useEffect)(()=>{fetch("/api/version").then(a=>a.json()).then(a=>e(a.version)).catch(()=>{})},[]);let f=[{href:ac,icon:Y,label:a.settings?.about?.github||"GitHub Repository"},{href:`${ac}/releases`,icon:Z,label:a.settings?.about?.releaseNotes||"Release Notes"},{href:`${ac}/issues`,icon:w,label:a.settings?.about?.feedback||"Feedback"}];return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:a.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:a.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,b.jsx)(t,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[a.settings?.about?.version||"Version",": v",d||"unknown"]})]}),(0,b.jsx)(ab,{}),(0,b.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:f.map(({href:a,icon:c,label:d})=>(0,b.jsx)(A.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(c,{className:"h-4 w-4"}),d,(0,b.jsx)(X.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:a.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var ae=a.i(152679),af=a.i(580701);let ag={name:"",email:"",educationStage:"",enrollmentYear:"",password:""};function ah(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)(ag),[f,g]=(0,q.useState)(""),[h,i]=(0,q.useState)(!0),[j,k]=(0,q.useState)(!1),l=(0,q.useCallback)(async()=>{try{let a=await S.f.get("/api/user");e({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){U.f.error("[AccountSettings]","Failed to fetch profile",{error:a})}finally{i(!1)}},[]);(0,q.useEffect)(()=>{l()},[l]);let m=async()=>{if(d.password&&d.password!==f)return void T.c.error(a.settings?.messages?.passwordMismatch||"Passwords do not match");k(!0);try{let b={name:d.name,email:d.email,educationStage:d.educationStage};d.enrollmentYear&&(b.enrollmentYear=parseInt(d.enrollmentYear.toString())),d.password&&(b.password=d.password),await S.f.patch("/api/user",b),T.c.success(a.settings?.messages?.profileUpdated||"Profile updated"),e(a=>({...a,password:""})),g(""),window.location.reload()}catch(b){U.f.error("[AccountSettings]","Failed to update profile",{error:(0,V.d)(b)??(0,V.Z)(b)}),T.c.error((0,V.d)(b)||a.settings?.messages?.updateFailed||"Update failed")}finally{k(!1)}};return h?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(v.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.name||"Name"}),(0,b.jsx)(G.f,{value:d.name||"",onChange:a=>e({...d,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.email||"Email"}),(0,b.jsx)(G.f,{value:d.email||"",onChange:a=>e({...d,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(af.d,{value:d.educationStage||"",onValueChange:a=>e({...d,educationStage:a}),children:[(0,b.jsx)(af.P,{children:(0,b.jsx)(af.U,{placeholder:a.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(af.r,{children:[(0,b.jsx)(af.T,{value:"primary",children:a.auth?.primary||"Primary School"}),(0,b.jsx)(af.T,{value:"junior_high",children:a.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(af.T,{value:"senior_high",children:a.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(af.T,{value:"university",children:a.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(G.f,{type:"number",value:d.enrollmentYear||"",onChange:a=>e({...d,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsx)(ae.f,{value:d.password,onChange:a=>e({...d,password:a.target.value}),placeholder:"******",minLength:6})]}),d.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.confirmPassword||"Confirm Password"}),(0,b.jsx)(ae.f,{value:f,onChange:a=>g(a.target.value),placeholder:"******",minLength:6})]})]}),(0,b.jsxs)(A.f,{onClick:m,disabled:j,className:"w-full",children:[j&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),a.settings?.account?.update||"Update Profile"]})]})}var ai=a.i(151304),aj=a.i(669520);let ak={info:{card:"border-blue-200 bg-blue-50",title:"text-blue-900 font-bold",desc:"text-blue-800 font-medium",button:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300"},danger:{card:"border-red-200 bg-red-50",title:"text-red-700 font-medium",desc:"text-red-600",button:""},critical:{card:"border-red-600/50 bg-red-100/50",title:"text-red-900 font-bold",desc:"text-red-800 font-medium",button:"bg-red-700 hover:bg-red-800"}};function al({title:a,description:c,tone:d,busy:e,icon:f,onClick:g}){let h=ak[d];return(0,b.jsxs)("div",{className:`p-4 border rounded-lg ${h.card}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:`text-sm flex items-center gap-2 ${h.title}`,children:a}),(0,b.jsx)(A.f,{variant:"info"===d?"outline":"destructive",size:"sm",onClick:g,disabled:e,className:h.button,children:e?(0,b.jsx)(v.f,{className:"h-4 w-4 animate-spin"}):f})]}),(0,b.jsx)("p",{className:`text-xs mt-2 ${h.desc}`,children:c})]})}function am({isAdmin:a}){let{t:d}=(0,c.b)(),[e,f]=(0,q.useState)(null),g=async(a,b,c,d)=>{f(a);try{T.c.success(await b()),d&&window.location.reload()}catch(b){U.f.error("[DangerZoneSettings]",`${a} failed`,{error:b}),T.c.error(c)}finally{f(null)}},h=d.settings?.clearSuccess||"Success",i=d.settings?.clearError||"Failed",j=async()=>{await (0,T.u)(d.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await g("migrateTags",async()=>{let a=await S.f.post("/api/admin/migrate-tags",{});return`${h}: ${a.count||0} tags migrated.`},d.settings?.clearError||"Failed to migrate tags",!1)},k=async()=>{await (0,T.u)(d.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await g("clearPractice",async()=>(await S.f.delete("/api/stats/practice/clear"),h),i,!0)},l=async()=>{await (0,T.u)(d.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await g("clearErrors",async()=>(await S.f.delete("/api/error-items/clear"),h),i,!0)},m=async()=>{if(!await (0,T.u)(d.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(d.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&T.c.error(d.common?.error||"Confirmation failed");return}await g("systemReset",async()=>(await S.f.post("/api/admin/system-reset",{}),d.settings?.clearSuccess||"Success - System Reset Complete"),d.settings?.clearError||"Failed to reset system",!0)};return(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsx)(al,{tone:"info",title:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aj.f,{className:"h-4 w-4"}),d.settings?.migrateTags||"Migrate Tags"]}),description:d.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===e,icon:(0,b.jsx)(aj.f,{className:"h-4 w-4"}),onClick:j}),(0,b.jsx)(al,{tone:"danger",title:d.settings?.clearData||"Clear Practice Data",description:d.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:k}),(0,b.jsx)(al,{tone:"danger",title:d.settings?.clearErrorData||"Clear Error Data",description:d.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:l}),a&&(0,b.jsx)(al,{tone:"critical",title:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r,{className:"h-4 w-4"}),d.settings?.systemReset||"System Initialization"]}),description:d.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:m})]})}var an=a.i(167453),ao=a.i(284505);let ap=(0,n.f)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);async function aq(a,b){let c=await fetch(a);if(!c.ok)throw Error((await c.json().catch(()=>({}))).message||"Export failed");let d=await c.blob(),e=window.URL.createObjectURL(d),f=document.createElement("a");f.href=e;let g=c.headers.get("Content-Disposition")?.match(/filename="(.+)"/);f.download=g?g[1]:b,document.body.appendChild(f),f.click(),document.body.removeChild(f),window.URL.revokeObjectURL(e)}function ar({isAdmin:a}){let{t:d}=(0,c.b)(),[e,f]=(0,q.useState)(!1),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(null),k=async a=>{if(!a||await (0,T.u)(d.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){f(!0);try{await aq(a?"/api/export?all=true":"/api/export",a?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),T.c.success(d.settings?.exportSuccess||"Export successful")}catch(b){U.f.error("[DataBackupSettings]",a?"Export all failed":"Export failed",{error:b}),T.c.error(d.settings?.exportFailed||"Export failed")}finally{f(!1)}}},l=async a=>{if(!i)return;let b=a?d.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":d.settings?.importConfirm||"Are you sure you want to import?";if(await (0,T.u)(b)){h(!0);try{let b=JSON.parse(await i.text()),{stats:c}=await S.f.post(a?"/api/import?all=true":"/api/import",b);T.c.success((d.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{papers}",String(c.examPapersCreated??0)).replace("{voices}",String(c.ttsSpeechesImported??0)).replace("{duplicates}",String(c.duplicateErrorItems??0))),j(null),window.location.reload()}catch(b){U.f.error("[DataBackupSettings]",a?"Import all failed":"Import failed",{error:b}),T.c.error(d.settings?.importFailed||"Import failed")}finally{h(!1)}}},m=(a,c)=>a?(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}):c;return(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:d.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>k(!1),disabled:e,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[m(e,(0,b.jsx)(ao.f,{className:"mr-2 h-4 w-4"})),d.settings?.exportData||"Export"]}),a&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>k(!0),disabled:e,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[m(e,(0,b.jsx)(ao.f,{className:"mr-2 h-4 w-4"})),d.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>j(a.target.files?.[0]??i),className:"hidden",id:"import-file-input",disabled:g}),(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:g,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[m(g,(0,b.jsx)(ap,{className:"mr-2 h-4 w-4"})),i?.name||d.settings?.selectFile||"Select File"]}),i&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:g,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[m(g,(0,b.jsx)(an.f,{className:"mr-2 h-4 w-4"})),d.settings?.importData||"Import"]}),i&&a&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:g,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[m(g,(0,b.jsx)(an.f,{className:"mr-2 h-4 w-4"})),d.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}var as=a.i(225949);function at({field:a,label:d,description:e}){let{t:f}=(0,c.b)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{S.f.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await S.f.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),U.f.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(H.f,{htmlFor:o,children:d}),(0,b.jsx)(F.f,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function au(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function av(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}var aw=a.i(249479);function ax(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)(String(aw.z)),[f,g]=(0,q.useState)(null),[h,i]=(0,q.useState)(!0),[j,k]=(0,q.useState)(!1),[l,m]=(0,q.useState)(null),n=Number(d),o=""!==d.trim()&&Number.isInteger(n)&&n>=aw.P&&n<=aw.o,p=(0,q.useCallback)(async()=>{i(!0),m(null);try{let a=(await S.f.get("/api/user")).masteryThreshold??aw.z;e(String(a)),g(a)}catch(b){m(a.mastery.thresholdLoadFailed),U.f.error("[Settings]","加载已掌握阈值失败",{error:b instanceof Error?b.message:String(b)})}finally{i(!1)}},[a.mastery.thresholdLoadFailed]);(0,q.useEffect)(()=>{p()},[p]);let r=async()=>{if(o&&null!==f){k(!0),m(null);try{let b=(await S.f.patch("/api/user",{masteryThreshold:n})).masteryThreshold??n;g(b),e(String(b)),m(a.importFlow.preferenceSaved)}catch(b){m(a.importFlow.preferenceSaveFailed),U.f.error("[Settings]","保存已掌握阈值失败",{error:b instanceof Error?b.message:String(b)})}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,b.jsx)(H.f,{htmlFor:"mastery-threshold",children:a.mastery.thresholdLabel}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(G.f,{id:"mastery-threshold",type:"number",min:aw.P,max:aw.o,step:1,value:d,onChange:a=>{e(a.target.value),m(null)},disabled:h||j||null===f,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,b.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,b.jsxs)(A.f,{type:"button",size:"sm",variant:"outline",onClick:r,disabled:h||j||null===f||!o||n===f,children:[(h||j)&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),a.importFlow.saveThreshold]}),!h&&null===f&&(0,b.jsx)(A.f,{type:"button",size:"sm",variant:"outline",onClick:p,children:a.importFlow.retryLoad})]}),(0,b.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:a.mastery.thresholdDescription}),null!==f&&!o&&(0,b.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:a.mastery.thresholdInvalid}),l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:l})]})}function ay(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function az({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.b)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(H.f,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(G.f,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}function aA({config:a,setConfig:d,isAdmin:f,disabled:g}){let{t:h,language:i,setLanguage:j}=(0,c.b)(),{timeZone:k}=(0,e.M)(),l=a=>d(b=>({...b,timeouts:{...b.timeouts,analyze:1e3*a}}));return(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:h.settings?.language||"Language"}),(0,b.jsxs)(af.d,{value:i,onValueChange:a=>j(a),children:[(0,b.jsx)(af.P,{children:(0,b.jsx)(af.U,{})}),(0,b.jsxs)(af.r,{children:[(0,b.jsx)(af.T,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(af.T,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(az,{value:a.timeZone??k,onChange:a=>d(b=>({...b,timeZone:a})),disabled:!f||g}),f&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(H.f,{children:h.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(G.f,{type:"number",value:a.timeouts?.analyze?a.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);l(isNaN(b)?0:b)},onBlur:()=>{let b=(a.timeouts?.analyze||0)/1e3,c=Math.min(600,Math.max(120,b));c!==b&&l(c)},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(av,{}),(0,b.jsx)(ay,{}),(0,b.jsx)(au,{}),(0,b.jsx)(as.f,{}),(0,b.jsx)(ax,{})]})}var aB=a.i(429246);let aC={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function aD(a,b={}){let c,d=aC[a],e=(c=process.env.LOG_LEVEL?.toLowerCase())&&void 0!==aC[c]?aC[c]:aC.info;return(c,f)=>{let g,h;if(d<e)return;let i=new Date;"string"==typeof c?(g={},h=c):(g=c,h=f||"");{let c=JSON.stringify({level:a,time:i.toISOString(),...b,...g,msg:h});switch(a){case"error":case"fatal":console.error(c);break;case"warn":console.warn(c);break;default:console.log(c)}}}}(function a(b={}){return b.module,{trace:aD("trace",b),debug:aD("debug",b),info:aD("info",b),warn:aD("warn",b),error:aD("error",b),fatal:aD("fatal",b),child:c=>a({...b,...c}),box:(a,c,d="📋")=>{console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...b,title:a,..."string"==typeof c?{content:c}:c||{},msg:a}))},divider:(a="-")=>{}}})({env:"production"}).child({module:"ai:prompts"});let aE=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
1
|
+
module.exports=[418175,a=>{"use strict";var b=a.i(187924),c=a.i(550194),d=a.i(875003),e=a.i(529759),f=a.i(16644),g=a.i(238246),h=a.i(50944),i=a.i(839761),j=a.i(953722),k=a.i(327999),l=a.i(104720),m=a.i(220005),n=a.i(170106);let o=(0,n.f)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),p=(0,n.f)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var q=a.i(572131);let r=(0,n.f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),s=(0,n.f)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),t=(0,n.f)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var u=a.i(149625),v=a.i(596221);let w=(0,n.f)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]),x=(0,n.f)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var y=a.i(546842),z=a.i(154933),A=a.i(699570),B=a.i(814574),C=a.i(875083),D=a.i(986705),E=a.i(786304),F=a.i(563658),G=a.i(866718),H=a.i(870430),I=a.i(368114);let J=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("div",{className:"relative w-full overflow-auto",children:(0,b.jsx)("table",{ref:d,className:(0,I.f)("w-full caption-bottom text-sm",a),...c})}));J.displayName="Table";let K=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("thead",{ref:d,className:(0,I.f)("[&_tr]:border-b",a),...c}));K.displayName="TableHeader";let L=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tbody",{ref:d,className:(0,I.f)("[&_tr:last-child]:border-0",a),...c}));L.displayName="TableBody",(q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tfoot",{ref:d,className:(0,I.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...c}))).displayName="TableFooter";let M=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tr",{ref:d,className:(0,I.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...c}));M.displayName="TableRow";let N=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("th",{ref:d,className:(0,I.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...c}));N.displayName="TableHead";let O=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("td",{ref:d,className:(0,I.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...c}));O.displayName="TableCell",(q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("caption",{ref:d,className:(0,I.f)("mt-4 text-sm text-muted-foreground",a),...c}))).displayName="TableCaption";var P=a.i(781560);let Q=(0,n.f)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var R=a.i(816201),S=a.i(291938),T=a.i(710302),U=a.i(630534),V=a.i(960927);function W(){let{timeZone:a}=(0,e.M)(),{data:f}=(0,d.useSession)(),{t:g}=(0,c.b)(),[h,i]=(0,q.useState)([]),[j,k]=(0,q.useState)(!0),[l,m]=(0,q.useState)(!1),[n,o]=(0,q.useState)(!1),[p,r]=(0,q.useState)("0"),[s,t]=(0,q.useState)(!1),u=(0,q.useCallback)(async()=>{k(!0);try{let a=await S.f.get("/api/admin/users");i(a)}catch(a){U.f.error("[UserManagement]","Failed to fetch users",{error:a})}finally{k(!1)}},[]),w=(0,q.useCallback)(async()=>{try{let a=await S.f.get("/api/settings");m(!0===a.allowRegistration),r(String(a.aiDailyLimit??0))}catch(a){U.f.error("[UserManagement]","Failed to fetch config",{error:a})}},[]);(0,q.useEffect)(()=>{u(),w()},[u,w]);let x=async a=>{o(!0);try{await S.f.post("/api/settings",{allowRegistration:a}),m(a)}catch(a){U.f.error("[UserManagement]","Failed to update registration setting",{error:a}),T.c.error(g.common.error)}finally{o(!1)}},y=Number(p),z=""!==p.trim()&&Number.isInteger(y)&&y>=0,B=async()=>{if(z){t(!0);try{await S.f.post("/api/settings",{aiDailyLimit:y}),T.c.success(g.admin.aiDailyLimitSaved)}catch(a){U.f.error("[UserManagement]","Failed to update AI daily limit",{error:a}),T.c.error(g.common.error)}finally{t(!1)}}},C=async a=>{let b=a.isActive?g.admin.confirmDisable:g.admin.confirmEnable;if(await (0,T.u)(b))try{await S.f.patch(`/api/admin/users/${a.id}`,{isActive:!a.isActive}),u()}catch(a){U.f.error("[UserManagement]","Failed to update user status",{error:a}),T.c.error(g.common.error)}},I=async a=>{if(await (0,T.u)(g.admin.confirmDelete,{destructive:!0}))try{await S.f.delete(`/api/admin/users/${a.id}`),u()}catch(b){U.f.error("[UserManagement]","Failed to delete user",{error:b});let a=(0,V.d)(b)||g.common.error;T.c.error(a)}};return j?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(v.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(H.f,{className:"text-base",children:g.admin?.allowRegistration||"Allow New Registrations"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[n&&(0,b.jsx)(v.f,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)(F.f,{checked:l,onCheckedChange:x,disabled:n})]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(H.f,{htmlFor:"ai-daily-limit",className:"text-base",children:g.admin.aiDailyLimit}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin.aiDailyLimitDesc})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(G.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:p,onChange:a=>r(a.target.value),"aria-invalid":!z,className:"w-24"}),(0,b.jsxs)(A.f,{size:"sm",onClick:B,disabled:s||!z,children:[s&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),g.common.save]})]})]}),(0,b.jsx)("div",{className:"sm:hidden space-y-3",children:h.map(c=>(0,b.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(E.f,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})]}),(0,b.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[g.admin.errors,": ",c._count.errorItems," | ",g.admin.practiceCount,": ",c._count.practiceRecords," | ",g.admin.aiUsageToday,": ",c.aiUsageToday]}),(0,b.jsx)(E.f,{variant:c.isActive?"default":"destructive",className:"text-xs",children:c.isActive?g.admin.active:g.admin.disabled})]}),(0,b.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,D.r)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>C(c),disabled:c.id===f?.user?.id,children:c.isActive?(0,b.jsx)(Q,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(R.f,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>I(c),disabled:c.id===f?.user?.id,children:(0,b.jsx)(P.f,{className:"h-4 w-4 text-destructive"})})]})]})]},c.id))}),(0,b.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,b.jsxs)(J,{children:[(0,b.jsx)(K,{children:(0,b.jsxs)(M,{children:[(0,b.jsx)(N,{children:g.admin.nameEmail}),(0,b.jsx)(N,{children:g.admin.role}),(0,b.jsx)(N,{children:g.admin.stats}),(0,b.jsx)(N,{children:g.admin.createdAt}),(0,b.jsx)(N,{children:g.admin.status}),(0,b.jsx)(N,{className:"text-right",children:g.admin.actions})]})}),(0,b.jsx)(L,{children:h.map(c=>(0,b.jsxs)(M,{children:[(0,b.jsxs)(O,{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(O,{children:(0,b.jsx)(E.f,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})}),(0,b.jsxs)(O,{children:[(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.errors,": ",c._count.errorItems]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.practiceCount,": ",c._count.practiceRecords]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.aiUsageToday,": ",c.aiUsageToday]})]}),(0,b.jsx)(O,{children:(0,D.r)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsx)(O,{children:(0,b.jsx)(E.f,{variant:c.isActive?"default":"destructive",children:c.isActive?g.admin.active:g.admin.disabled})}),(0,b.jsxs)(O,{className:"text-right space-x-2",children:[(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>C(c),disabled:c.id===f?.user?.id,title:c.isActive?g.admin.disable:g.admin.enable,children:c.isActive?(0,b.jsx)(Q,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(R.f,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(A.f,{variant:"ghost",size:"sm",onClick:()=>I(c),disabled:c.id===f?.user?.id,title:g.admin.delete,children:(0,b.jsx)(P.f,{className:"h-4 w-4 text-destructive"})})]})]},c.id))})]})})]})}var X=a.i(452495);let Y=(0,n.f)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),Z=(0,n.f)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),$=(0,n.f)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function _(){return null}let aa=()=>()=>void 0;function ab(){let{t:a}=(0,c.b)(),d=(0,q.useSyncExternalStore)(aa,_,()=>null);return d?d.isStandalone?.()?(0,b.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:a.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"break-all",children:[a.settings?.about?.androidServer||"Server",": ",d.getServerUrl()]}),(0,b.jsxs)(A.f,{variant:"outline",className:"gap-2",onClick:()=>d.changeServer(),children:[(0,b.jsx)($,{className:"h-4 w-4"}),a.settings?.about?.changeServer||"Change server"]})]}):null}var ac=a.i(424235);function ad(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)("");(0,q.useEffect)(()=>{fetch("/api/version").then(a=>a.json()).then(a=>e(a.version)).catch(()=>{})},[]);let f=[{href:ac.f,icon:Y,label:a.settings?.about?.github||"GitHub Repository"},{href:`${ac.f}/releases`,icon:Z,label:a.settings?.about?.releaseNotes||"Release Notes"},{href:`${ac.f}/issues`,icon:w,label:a.settings?.about?.feedback||"Feedback"}];return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:a.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:a.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,b.jsx)(t,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[a.settings?.about?.version||"Version",": v",d||"unknown"]})]}),(0,b.jsx)(ab,{}),(0,b.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:f.map(({href:a,icon:c,label:d})=>(0,b.jsx)(A.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(c,{className:"h-4 w-4"}),d,(0,b.jsx)(X.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:a.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var ae=a.i(152679),af=a.i(580701);let ag={name:"",email:"",educationStage:"",enrollmentYear:"",password:""};function ah(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)(ag),[f,g]=(0,q.useState)(""),[h,i]=(0,q.useState)(!0),[j,k]=(0,q.useState)(!1),l=(0,q.useCallback)(async()=>{try{let a=await S.f.get("/api/user");e({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){U.f.error("[AccountSettings]","Failed to fetch profile",{error:a})}finally{i(!1)}},[]);(0,q.useEffect)(()=>{l()},[l]);let m=async()=>{if(d.password&&d.password!==f)return void T.c.error(a.settings?.messages?.passwordMismatch||"Passwords do not match");k(!0);try{let b={name:d.name,email:d.email,educationStage:d.educationStage};d.enrollmentYear&&(b.enrollmentYear=parseInt(d.enrollmentYear.toString())),d.password&&(b.password=d.password),await S.f.patch("/api/user",b),T.c.success(a.settings?.messages?.profileUpdated||"Profile updated"),e(a=>({...a,password:""})),g(""),window.location.reload()}catch(b){U.f.error("[AccountSettings]","Failed to update profile",{error:(0,V.d)(b)??(0,V.Z)(b)}),T.c.error((0,V.d)(b)||a.settings?.messages?.updateFailed||"Update failed")}finally{k(!1)}};return h?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(v.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.name||"Name"}),(0,b.jsx)(G.f,{value:d.name||"",onChange:a=>e({...d,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.email||"Email"}),(0,b.jsx)(G.f,{value:d.email||"",onChange:a=>e({...d,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(af.d,{value:d.educationStage||"",onValueChange:a=>e({...d,educationStage:a}),children:[(0,b.jsx)(af.P,{children:(0,b.jsx)(af.U,{placeholder:a.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(af.r,{children:[(0,b.jsx)(af.T,{value:"primary",children:a.auth?.primary||"Primary School"}),(0,b.jsx)(af.T,{value:"junior_high",children:a.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(af.T,{value:"senior_high",children:a.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(af.T,{value:"university",children:a.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(G.f,{type:"number",value:d.enrollmentYear||"",onChange:a=>e({...d,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsx)(ae.f,{value:d.password,onChange:a=>e({...d,password:a.target.value}),placeholder:"******",minLength:6})]}),d.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:a.auth?.confirmPassword||"Confirm Password"}),(0,b.jsx)(ae.f,{value:f,onChange:a=>g(a.target.value),placeholder:"******",minLength:6})]})]}),(0,b.jsxs)(A.f,{onClick:m,disabled:j,className:"w-full",children:[j&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),a.settings?.account?.update||"Update Profile"]})]})}var ai=a.i(151304),aj=a.i(669520);let ak={info:{card:"border-blue-200 bg-blue-50",title:"text-blue-900 font-bold",desc:"text-blue-800 font-medium",button:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300"},danger:{card:"border-red-200 bg-red-50",title:"text-red-700 font-medium",desc:"text-red-600",button:""},critical:{card:"border-red-600/50 bg-red-100/50",title:"text-red-900 font-bold",desc:"text-red-800 font-medium",button:"bg-red-700 hover:bg-red-800"}};function al({title:a,description:c,tone:d,busy:e,icon:f,onClick:g}){let h=ak[d];return(0,b.jsxs)("div",{className:`p-4 border rounded-lg ${h.card}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:`text-sm flex items-center gap-2 ${h.title}`,children:a}),(0,b.jsx)(A.f,{variant:"info"===d?"outline":"destructive",size:"sm",onClick:g,disabled:e,className:h.button,children:e?(0,b.jsx)(v.f,{className:"h-4 w-4 animate-spin"}):f})]}),(0,b.jsx)("p",{className:`text-xs mt-2 ${h.desc}`,children:c})]})}function am({isAdmin:a}){let{t:d}=(0,c.b)(),[e,f]=(0,q.useState)(null),g=async(a,b,c,d)=>{f(a);try{T.c.success(await b()),d&&window.location.reload()}catch(b){U.f.error("[DangerZoneSettings]",`${a} failed`,{error:b}),T.c.error(c)}finally{f(null)}},h=d.settings?.clearSuccess||"Success",i=d.settings?.clearError||"Failed",j=async()=>{await (0,T.u)(d.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await g("migrateTags",async()=>{let a=await S.f.post("/api/admin/migrate-tags",{});return`${h}: ${a.count||0} tags migrated.`},d.settings?.clearError||"Failed to migrate tags",!1)},k=async()=>{await (0,T.u)(d.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await g("clearPractice",async()=>(await S.f.delete("/api/stats/practice/clear"),h),i,!0)},l=async()=>{await (0,T.u)(d.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await g("clearErrors",async()=>(await S.f.delete("/api/error-items/clear"),h),i,!0)},m=async()=>{if(!await (0,T.u)(d.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(d.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&T.c.error(d.common?.error||"Confirmation failed");return}await g("systemReset",async()=>(await S.f.post("/api/admin/system-reset",{}),d.settings?.clearSuccess||"Success - System Reset Complete"),d.settings?.clearError||"Failed to reset system",!0)};return(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsx)(al,{tone:"info",title:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aj.f,{className:"h-4 w-4"}),d.settings?.migrateTags||"Migrate Tags"]}),description:d.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===e,icon:(0,b.jsx)(aj.f,{className:"h-4 w-4"}),onClick:j}),(0,b.jsx)(al,{tone:"danger",title:d.settings?.clearData||"Clear Practice Data",description:d.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:k}),(0,b.jsx)(al,{tone:"danger",title:d.settings?.clearErrorData||"Clear Error Data",description:d.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:l}),a&&(0,b.jsx)(al,{tone:"critical",title:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r,{className:"h-4 w-4"}),d.settings?.systemReset||"System Initialization"]}),description:d.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===e,icon:(0,b.jsx)(P.f,{className:"h-4 w-4"}),onClick:m})]})}var an=a.i(167453),ao=a.i(284505);let ap=(0,n.f)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);async function aq(a,b){let c=await fetch(a);if(!c.ok)throw Error((await c.json().catch(()=>({}))).message||"Export failed");let d=await c.blob(),e=window.URL.createObjectURL(d),f=document.createElement("a");f.href=e;let g=c.headers.get("Content-Disposition")?.match(/filename="(.+)"/);f.download=g?g[1]:b,document.body.appendChild(f),f.click(),document.body.removeChild(f),window.URL.revokeObjectURL(e)}function ar({isAdmin:a}){let{t:d}=(0,c.b)(),[e,f]=(0,q.useState)(!1),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(null),k=async a=>{if(!a||await (0,T.u)(d.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){f(!0);try{await aq(a?"/api/export?all=true":"/api/export",a?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),T.c.success(d.settings?.exportSuccess||"Export successful")}catch(b){U.f.error("[DataBackupSettings]",a?"Export all failed":"Export failed",{error:b}),T.c.error(d.settings?.exportFailed||"Export failed")}finally{f(!1)}}},l=async a=>{if(!i)return;let b=a?d.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":d.settings?.importConfirm||"Are you sure you want to import?";if(await (0,T.u)(b)){h(!0);try{let b=JSON.parse(await i.text()),{stats:c}=await S.f.post(a?"/api/import?all=true":"/api/import",b);T.c.success((d.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{papers}",String(c.examPapersCreated??0)).replace("{voices}",String(c.ttsSpeechesImported??0)).replace("{duplicates}",String(c.duplicateErrorItems??0))),j(null),window.location.reload()}catch(b){U.f.error("[DataBackupSettings]",a?"Import all failed":"Import failed",{error:b}),T.c.error(d.settings?.importFailed||"Import failed")}finally{h(!1)}}},m=(a,c)=>a?(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}):c;return(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:d.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>k(!1),disabled:e,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[m(e,(0,b.jsx)(ao.f,{className:"mr-2 h-4 w-4"})),d.settings?.exportData||"Export"]}),a&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>k(!0),disabled:e,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[m(e,(0,b.jsx)(ao.f,{className:"mr-2 h-4 w-4"})),d.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>j(a.target.files?.[0]??i),className:"hidden",id:"import-file-input",disabled:g}),(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:g,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[m(g,(0,b.jsx)(ap,{className:"mr-2 h-4 w-4"})),i?.name||d.settings?.selectFile||"Select File"]}),i&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:g,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[m(g,(0,b.jsx)(an.f,{className:"mr-2 h-4 w-4"})),d.settings?.importData||"Import"]}),i&&a&&(0,b.jsxs)(A.f,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:g,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[m(g,(0,b.jsx)(an.f,{className:"mr-2 h-4 w-4"})),d.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}var as=a.i(225949);function at({field:a,label:d,description:e}){let{t:f}=(0,c.b)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{S.f.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await S.f.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),U.f.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(H.f,{htmlFor:o,children:d}),(0,b.jsx)(F.f,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function au(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function av(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}var aw=a.i(249479);function ax(){let{t:a}=(0,c.b)(),[d,e]=(0,q.useState)(String(aw.z)),[f,g]=(0,q.useState)(null),[h,i]=(0,q.useState)(!0),[j,k]=(0,q.useState)(!1),[l,m]=(0,q.useState)(null),n=Number(d),o=""!==d.trim()&&Number.isInteger(n)&&n>=aw.P&&n<=aw.o,p=(0,q.useCallback)(async()=>{i(!0),m(null);try{let a=(await S.f.get("/api/user")).masteryThreshold??aw.z;e(String(a)),g(a)}catch(b){m(a.mastery.thresholdLoadFailed),U.f.error("[Settings]","加载已掌握阈值失败",{error:b instanceof Error?b.message:String(b)})}finally{i(!1)}},[a.mastery.thresholdLoadFailed]);(0,q.useEffect)(()=>{p()},[p]);let r=async()=>{if(o&&null!==f){k(!0),m(null);try{let b=(await S.f.patch("/api/user",{masteryThreshold:n})).masteryThreshold??n;g(b),e(String(b)),m(a.importFlow.preferenceSaved)}catch(b){m(a.importFlow.preferenceSaveFailed),U.f.error("[Settings]","保存已掌握阈值失败",{error:b instanceof Error?b.message:String(b)})}finally{k(!1)}}};return(0,b.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,b.jsx)(H.f,{htmlFor:"mastery-threshold",children:a.mastery.thresholdLabel}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(G.f,{id:"mastery-threshold",type:"number",min:aw.P,max:aw.o,step:1,value:d,onChange:a=>{e(a.target.value),m(null)},disabled:h||j||null===f,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,b.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,b.jsxs)(A.f,{type:"button",size:"sm",variant:"outline",onClick:r,disabled:h||j||null===f||!o||n===f,children:[(h||j)&&(0,b.jsx)(v.f,{className:"mr-2 h-4 w-4 animate-spin"}),a.importFlow.saveThreshold]}),!h&&null===f&&(0,b.jsx)(A.f,{type:"button",size:"sm",variant:"outline",onClick:p,children:a.importFlow.retryLoad})]}),(0,b.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:a.mastery.thresholdDescription}),null!==f&&!o&&(0,b.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:a.mastery.thresholdInvalid}),l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:l})]})}function ay(){let{t:a}=(0,c.b)();return(0,b.jsx)(at,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function az({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.b)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(H.f,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(G.f,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}function aA({config:a,setConfig:d,isAdmin:f,disabled:g}){let{t:h,language:i,setLanguage:j}=(0,c.b)(),{timeZone:k}=(0,e.M)(),l=a=>d(b=>({...b,timeouts:{...b.timeouts,analyze:1e3*a}}));return(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(H.f,{children:h.settings?.language||"Language"}),(0,b.jsxs)(af.d,{value:i,onValueChange:a=>j(a),children:[(0,b.jsx)(af.P,{children:(0,b.jsx)(af.U,{})}),(0,b.jsxs)(af.r,{children:[(0,b.jsx)(af.T,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(af.T,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(az,{value:a.timeZone??k,onChange:a=>d(b=>({...b,timeZone:a})),disabled:!f||g}),f&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(H.f,{children:h.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(G.f,{type:"number",value:a.timeouts?.analyze?a.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);l(isNaN(b)?0:b)},onBlur:()=>{let b=(a.timeouts?.analyze||0)/1e3,c=Math.min(600,Math.max(120,b));c!==b&&l(c)},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(av,{}),(0,b.jsx)(ay,{}),(0,b.jsx)(au,{}),(0,b.jsx)(as.f,{}),(0,b.jsx)(ax,{})]})}var aB=a.i(429246);let aC={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function aD(a,b={}){let c,d=aC[a],e=(c=process.env.LOG_LEVEL?.toLowerCase())&&void 0!==aC[c]?aC[c]:aC.info;return(c,f)=>{let g,h;if(d<e)return;let i=new Date;"string"==typeof c?(g={},h=c):(g=c,h=f||"");{let c=JSON.stringify({level:a,time:i.toISOString(),...b,...g,msg:h});switch(a){case"error":case"fatal":console.error(c);break;case"warn":console.warn(c);break;default:console.log(c)}}}}(function a(b={}){return b.module,{trace:aD("trace",b),debug:aD("debug",b),info:aD("info",b),warn:aD("warn",b),error:aD("error",b),fatal:aD("fatal",b),child:c=>a({...b,...c}),box:(a,c,d="📋")=>{console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...b,title:a,..."string"==typeof c?{content:c}:c||{},msg:a}))},divider:(a="-")=>{}}})({env:"production"}).child({module:"ai:prompts"});let aE=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
2
2
|
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
3
3
|
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
4
4
|
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[291938,710302,a=>{"use strict";let b={success:2500,info:3500,warning:4500,error:5e3},c={toasts:[],confirm:null},d=1,e=new Set;function f(a){c=a,e.forEach(a=>a(c))}function g(a){f({...c,toasts:c.toasts.filter(b=>b.id!==a)})}function h(a,e){let h="string"==typeof e?e:String(e??"");if(!h)return;let i=d++;f({...c,toasts:[...c.toasts.slice(-3),{id:i,type:a,message:h}]}),setTimeout(()=>g(i),b[a])}let i={success:a=>h("success",a),error:a=>h("error",a),info:a=>h("info",a),warning:a=>h("warning",a)};a.s(["u",0,function(a,b={}){return 0===e.size?Promise.resolve(!1):(c.confirm?.resolve(!1),new Promise(e=>{let g=d++;f({...c,confirm:{...b,id:g,message:a,resolve:a=>{c.confirm?.id===g&&f({...c,confirm:null}),e(a)}}})}))},"p",0,g,"M",0,function(a){return e.add(a),a(c),()=>{e.delete(a)}},"c",0,i],710302);var j=a.i(931642);class k extends Error{status;statusText;data;constructor(a,b,c){super(`API Error: ${a} ${b}`),this.status=a,this.statusText=b,this.data=c,this.name="ApiError"}}function l(a){if("object"!=typeof a||null===a||!("code"in a)||"AI_DAILY_LIMIT_EXCEEDED"!==a.code)return;let b="zh";try{"en"===localStorage.getItem("app-language")&&(b="en")}catch{}i.warning(j.f[b].errors.AI_DAILY_LIMIT_EXCEEDED)}let m=a=>new Promise(b=>setTimeout(b,a));async function n(a,b,c){let d=Date.now();for(;Date.now()<b;){let b=null;try{b=await o(`/api/requests/${a}`,{method:"GET",timeout:15e3})}catch(a){if(a instanceof k&&404===a.status&&Date.now()-d>6e3)throw c}if(b?.state==="done"){if(b.status>=200&&b.status<300)return b.body??{};throw 429===b.status&&l(b.body),new k(b.status,"",b.body)}await m(3e3)}throw new k(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function o(a,b={}){let c,{params:d,headers:e,timeout:f=6e4,recoverable:g,...h}=b,i=g?(c=new Uint8Array(16),crypto.getRandomValues(c),Array.from(c,a=>a.toString(16).padStart(2,"0")).join("")):null,j=Date.now(),m=a;if(d){let a=new URLSearchParams(d);m+=`?${a.toString()}`}let p=new AbortController,q=setTimeout(()=>p.abort(),f);try{let a=await fetch(m,{headers:{"Content-Type":"application/json",...i?{"X-Request-Id":i}:{},...e},signal:p.signal,...h});if(clearTimeout(q),!a.ok){let b;try{b=await a.json()}catch{b=await a.text()}throw 429===a.status&&l(b),new k(a.status,a.statusText,b)}if(204===a.status)return{};try{return await a.json()}catch{return{}}}catch(a){if(clearTimeout(q),a instanceof Error&&"AbortError"===a.name)throw new k(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(i&&a instanceof TypeError)return n(i,j+f,a);throw a}}a.s(["f",0,{get:(a,b)=>o(a,{...b,method:"GET"}),post:(a,b,c)=>o(a,{...c,method:"POST",body:JSON.stringify(b)}),put:(a,b,c)=>o(a,{...c,method:"PUT",body:JSON.stringify(b)}),patch:(a,b,c)=>o(a,{...c,method:"PATCH",body:JSON.stringify(b)}),delete:(a,b)=>o(a,{...b,method:"DELETE"})}],291938)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=src_lib_api-client_ts_04r2_ex-gua5i._.js.map
|