wrong-notebook 2026.10.30-2 → 2026.10.30-4
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 +4 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +26 -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 +13 -12
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +13 -12
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +9 -8
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +11 -10
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +12 -11
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +13 -12
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +12 -11
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js +14 -13
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js +10 -9
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +12 -11
- 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 +15 -14
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +12 -11
- 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 +12 -11
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js +1 -1
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +16 -15
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +14 -13
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js +13 -12
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +14 -13
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +13 -12
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +13 -12
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +7 -5
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +12 -11
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +16 -14
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js +2 -2
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js +2 -2
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +12 -11
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +15 -14
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +9 -8
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +11 -10
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +14 -13
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +13 -12
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +12 -11
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +2 -2
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +2 -2
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +13 -12
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +6 -6
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tts/[id]/route/build-manifest.json +12 -0
- package/.next/server/app/api/tts/[id]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tts/[id]/route.js +15 -0
- package/.next/server/app/api/tts/[id]/route.js.map +5 -0
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/tts/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tts/batch/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tts/batch/route/build-manifest.json +12 -0
- package/.next/server/app/api/tts/batch/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tts/batch/route.js +17 -0
- package/.next/server/app/api/tts/batch/route.js.map +5 -0
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -0
- package/.next/server/app/api/tts/batch/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tts/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tts/route/build-manifest.json +12 -0
- package/.next/server/app/api/tts/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tts/route.js +17 -0
- package/.next/server/app/api/tts/route.js.map +5 -0
- package/.next/server/app/api/tts/route.js.nft.json +1 -0
- package/.next/server/app/api/tts/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/tts/status/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/tts/status/route/build-manifest.json +12 -0
- package/.next/server/app/api/tts/status/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/tts/status/route.js +16 -0
- package/.next/server/app/api/tts/status/route.js.map +5 -0
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -0
- package/.next/server/app/api/tts/status/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/user/route.js +12 -11
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/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 +4 -0
- package/.next/server/chunks/[externals]_fs_1d5jh8vp8y6zt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1xhs0kkx6buw2._.js → [root-of-the-server]__0-b-yvjz48rkt._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0-t1auf1a8_or._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__003ii50e63ws5._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0q05h3d_kzdhv._.js → [root-of-the-server]__00tywaxi-8b1l._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__061x45fxd07dm._.js → [root-of-the-server]__024r-wywnoxyp._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__02bjw2uriv5fd._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0uyibcf2mejgf._.js → [root-of-the-server]__02v0ig608r6y0._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__03ru8t856rgvl._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0eu0cxcftsajx._.js → [root-of-the-server]__04q1m399dcul6._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__06j_-j4ftb5db._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ih72ek59msql._.js → [root-of-the-server]__06xho6u8le3e7._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__01zmywofxv44d._.js → [root-of-the-server]__07h2t-yzug3sg._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__04r2yjj4knt9x._.js → [root-of-the-server]__07ku06p8ztq1g._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__02diwny9l07g2._.js → [root-of-the-server]__08d7_pq6_q2gg._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__072txw4y-7b6q._.js → [root-of-the-server]__08thdsjzsvn6f._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0aganwocduyac._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0duevucfb62_h._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0zb48en2m8yk0._.js → [root-of-the-server]__0gvvuk0avtpy9._.js} +4 -4
- package/.next/server/chunks/[root-of-the-server]__0iq2agc-dlcyc._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1-511qnr-fg_q._.js → [root-of-the-server]__0j6f-2sb1zvv-._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0juklkqip-kat._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0kwkbvjwb6ms2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lgsw0kfw-jqc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0m257tbsmg_jc._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0mtgqo3_a6ft3._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ec346yss6x_e._.js → [root-of-the-server]__0odzrih6i03_7._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0-_fe0i5gihj2._.js → [root-of-the-server]__0orbb3gvf9h5l._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0nl_kgnqabv4e._.js → [root-of-the-server]__0rnwilu01f1tc._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1gg8lq2q9gzg2._.js → [root-of-the-server]__0rt84iswe-353._.js} +4 -4
- package/.next/server/chunks/[root-of-the-server]__0sg1yp-qgcx3j._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ssa-hz8b3v1i._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0uvuljzm78r8b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vn353txu1ok5._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1-t5hw-med-kv._.js → [root-of-the-server]__0w12wrduqkml_._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0wmczeyrx2y7f._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0xe-f_x7j4c7y._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xicme9m81rzt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0yx12uf2avp6d._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zq53ytq2jm_b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1-jk6umz3qs6r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10ffg2l-u0zof._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__08fwru7fkvvl6._.js → [root-of-the-server]__10s5jgr6l7shg._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11n5u21llw3hz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1222jdedtloy5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13ybp1up1_pp_._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0aq32mo414sro._.js → [root-of-the-server]__14-k7ayd3a8_l._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0wbt3upu-nuk1._.js → [root-of-the-server]__14hy-qeyktudc._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__15v_gsaqeo7q-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16h8j4mow34et._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18vii2hl-fo31._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__190oggsfw-98b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1_fxjdqa7fwwc._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0nei0h0dla9ks._.js → [root-of-the-server]__1ban_cu4u5ktr._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0-mtuz1y2hrt_._.js → [root-of-the-server]__1f8bfi9fgos0g._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1g038brpx-jta._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1qb-t64xfqxeo._.js → [root-of-the-server]__1gx-b_vxyk--4._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0byn0wv2ulvf1._.js → [root-of-the-server]__1h-b09z-j8jp8._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1h2nhu8op07o7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0tjdhrskz55su._.js → [root-of-the-server]__1h8y4ve4ddvy5._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ixfwffo1gqy1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jcp2-lix6if6._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kff0rbt3ym95._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1dkb17rbhyexw._.js → [root-of-the-server]__1krabeg6sihbm._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1mn88gcnj5c8i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1n2uvss8wfueo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1nsrbw9jntgo8._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1onv3pfwsqytl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1q9pzdlt18lp0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1sw3rkr-79ykm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1thdx6loe3xd4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ukn55clu33ii._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uz66pjshld-e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vbqkl7rn1dbm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wnku4diwmv6z._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1y7job8gfr7ww._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yaxekogcfb41._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1yhu07loxowr5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zp57dov6qagu._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1sat028hivrbm._.js → [root-of-the-server]__208t95lee6s99._.js} +2 -2
- package/.next/server/chunks/_076-jjzrfdsdk._.js +1 -1
- package/.next/server/chunks/_09o9zamz75n5d._.js +1 -1
- package/.next/server/chunks/{_0hkdm23o05kvp._.js → _0a7_sds_l6vgw._.js} +3 -3
- package/.next/server/chunks/{_0lsw6_-5hpp0x._.js → _0b7ljlcl6h_ro._.js} +3 -3
- package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
- package/.next/server/chunks/_0hk9z9rqga4x-._.js +3 -0
- package/.next/server/chunks/_0lob14xk0ko5z._.js +1 -1
- package/.next/server/chunks/_0p-sas2zxy3iv._.js +3 -0
- package/.next/server/chunks/_0z0zrluul2idw._.js +1 -1
- package/.next/server/chunks/_11_p1ahjjply_._.js +3 -0
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
- package/.next/server/chunks/_16jdov0rxh99d._.js +1 -1
- package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
- package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
- package/.next/server/chunks/_1ahi8466v1b3l._.js +3 -0
- package/.next/server/chunks/_1b7qjlv0nxovi._.js +1 -1
- package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
- package/.next/server/chunks/_1hp9mnz19v199._.js +1 -1
- package/.next/server/chunks/_1j8kqz21_i728._.js +3 -0
- package/.next/server/chunks/_1m-yyz-pl9-03._.js +1 -1
- package/.next/server/chunks/_next-internal_server_app_api_tts_[id]_route_actions_12l2oplt6y56y.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_tts_batch_route_actions_1jmuawkcgxmae.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_tts_route_actions_19kapfgudczow.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_tts_status_route_actions_1udk0hbf96zdl.js +3 -0
- package/.next/server/chunks/node_modules_zod_v4_classic_external_1h9u5hd8e7zk0.js +8 -8
- package/.next/server/chunks/src_lib_1csf8_0vpeenu._.js +3 -0
- package/.next/server/chunks/src_lib_1mno8g5cqmaet._.js +3 -0
- package/.next/server/chunks/src_lib_1p0k3ud1vrwmg._.js +3 -0
- package/.next/server/chunks/src_lib_1qy5aajgog9r2._.js +3 -0
- package/.next/server/chunks/{src_lib_0es8upktx5_5c._.js → src_lib_ai_prompts_ts_0z36zms4djibp._.js} +43 -43
- package/.next/server/chunks/src_lib_auth-utils_ts_20i7biv4dj8pm._.js +1 -1
- package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
- package/.next/server/chunks/src_lib_tts_19zri-v8-l_4u._.js +16 -0
- package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +1 -1
- package/.next/server/chunks/ssr/_08fq-uch-l1g6._.js +1 -1
- package/.next/server/chunks/ssr/_0n_xmfdlu07f9._.js +3 -0
- package/.next/server/chunks/ssr/_0xyykn-ar3ujn._.js +3 -0
- package/.next/server/chunks/ssr/_17edi6l2a0p76._.js +1 -1
- package/.next/server/chunks/ssr/{_1mw-oovvzrn8_._.js → _1yaa5p1rk6i7c._.js} +1 -1
- package/.next/server/chunks/ssr/_20-x85_onge5x._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_play_0upz8-7p5gttr.js +4 -0
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +1 -1
- package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_components_difficulty-stars_tsx_1af9qqfurq7_t._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +2 -2
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- 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/00n2-r3ac3dh5.js +2 -0
- package/.next/static/chunks/0kh-fx3tssh5w.js +1 -0
- package/.next/static/chunks/0p2fh98qaki45.js +1 -0
- package/.next/static/chunks/{314x1g250-zss.js → 1c46asvnosb8-.js} +1 -1
- package/.next/static/chunks/1cdwoh8b2ub-t.js +1 -0
- package/.next/static/chunks/1epmdj8kqwbz4.js +1 -0
- package/.next/static/chunks/1l46v858ieavc.js +1 -0
- package/.next/static/chunks/1r7yfcltcmwkh.js +1 -0
- package/.next/static/chunks/24gum0cmhhv7z.js +1 -0
- package/.next/static/chunks/26qq8907b9j3d.js +1 -0
- package/.next/static/chunks/2cf27aonkij9_.css +3 -0
- package/.next/static/chunks/2ctc1xbp8lz8e.js +191 -0
- package/.next/static/chunks/{2rgflf9-3s4ud.js → 2fr8ktozrvacg.js} +1 -1
- package/.next/static/chunks/{0oe2-jjx_8ol-.js → 2mawf08h1jfc8.js} +1 -1
- package/.next/static/chunks/2uobd1ff4vknn.js +33 -0
- package/.next/static/chunks/341etzsqr_b1v.js +6 -0
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00s2hc-f4f5gd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__099_6fekx8t5u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0auuq_0yerirb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0c0x5d85vbcbv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0c4jdg0ga4zfe._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dqbew6anw2kd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0e7_0-o90esy-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0i_w6t6qj_061._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0mmexlpsghj6s._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0n7bhn294-vlt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0p-cdsmp78i6-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qo744v4hy8lp._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0suoe7tm4396u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0tflseuizxpen._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ue14np4llg3a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0uwpcliduox5r._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0uz7-ix0696nv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0v93i_mmy7uws._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0wm4qw5cu0956._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zvdl3gsgb2ll._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11l6a17qelkj9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__12iwnvw4r0gus._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__15fllrli2pdl7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__15t37vaiu6w-o._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__18874ssgfq8hf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19uj-sk5cp6hw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_8btngjew64q._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1euogp-jmbdbn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1h2gs1l_ocut-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1k750v6l878d9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ks5l0ekcojb6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1lrmakvt35ktq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1o82fhau9qctf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ox-1hd5csbnf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1pkcickey-b8h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ptillth3o9z9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1q43lvwugn4yx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1s7d_mp0a6lzl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1sfc4ds1btvga._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t11647vnxh3m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yk2mvyhb_u32._.js +0 -3
- package/.next/server/chunks/_1pvqo-qnv-nqm._.js +0 -3
- package/.next/server/chunks/_1w_arlbn0o07b._.js +0 -11
- package/.next/server/chunks/src_lib_05svhzm9a162-._.js +0 -3
- package/.next/server/chunks/ssr/_04ziy8_ak_olr._.js +0 -3
- package/.next/server/chunks/ssr/_0oksf3a6pbj88._.js +0 -3
- package/.next/server/chunks/ssr/_1gjb-bqi25yci._.js +0 -3
- package/.next/static/chunks/0g5r7y3bbmc-b.js +0 -1
- package/.next/static/chunks/0h8aoqx7182md.js +0 -1
- package/.next/static/chunks/0pvlg-25ddo6e.js +0 -33
- package/.next/static/chunks/1kx-lcqi4aref.js +0 -191
- package/.next/static/chunks/1qa6rlj01hnl5.js +0 -1
- package/.next/static/chunks/22inup6g2i-7n.js +0 -1
- package/.next/static/chunks/2q9n-d4_9bhp2.js +0 -1
- package/.next/static/chunks/2x1y8v15sfol3.css +0 -3
- package/.next/static/chunks/31masz5ywwx8m.js +0 -1
- package/.next/static/chunks/37jrjuqt8f_ee.js +0 -1
- package/.next/static/chunks/3oygizhwo77gr.js +0 -6
- package/.next/static/chunks/3zt-rwod7li6h.js +0 -1
- package/.next/static/chunks/40a5neotpd0pu.js +0 -1
- /package/.next/static/{65W6wu_pTgcQldOtRe-13 → X3NzguYsDSEVWQKJ6r_e7}/_buildManifest.js +0 -0
- /package/.next/static/{65W6wu_pTgcQldOtRe-13 → X3NzguYsDSEVWQKJ6r_e7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{65W6wu_pTgcQldOtRe-13 → X3NzguYsDSEVWQKJ6r_e7}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";var s=e.i(843476),t=e.i(111110),a=e.i(217255),i=e.i(215519),r=e.i(325164),n=e.i(522016),l=e.i(618566),o=e.i(217923),c=e.i(810980),d=e.i(551804),m=e.i(178583),u=e.i(292270),p=e.i(475254);let h=(0,p.f)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),x=(0,p.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 g=e.i(271645);let f=(0,p.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"}]]),j=(0,p.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"}]]),v=(0,p.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 y=e.i(763639),b=e.i(531278);let w=(0,p.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"}]]),N=(0,p.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 k=e.i(284614),S=e.i(733060),C=e.i(519455),T=e.i(776639),A=e.i(677572),E=e.i(306831),_=e.i(487486),z=e.i(699375),D=e.i(793479),M=e.i(110204),F=e.i(975157);let R=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:a,className:(0,F.f)("w-full caption-bottom text-sm",e),...t})}));R.displayName="Table";let I=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("thead",{ref:a,className:(0,F.f)("[&_tr]:border-b",e),...t}));I.displayName="TableHeader";let L=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tbody",{ref:a,className:(0,F.f)("[&_tr:last-child]:border-0",e),...t}));L.displayName="TableBody",(g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tfoot",{ref:a,className:(0,F.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}))).displayName="TableFooter";let $=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tr",{ref:a,className:(0,F.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));$.displayName="TableRow";let U=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("th",{ref:a,className:(0,F.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));U.displayName="TableHead";let P=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("td",{ref:a,className:(0,F.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));P.displayName="TableCell",(g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("caption",{ref:a,className:(0,F.f)("mt-4 text-sm text-muted-foreground",e),...t}))).displayName="TableCaption";var q=e.i(727612);let O=(0,p.f)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var K=e.i(269638),B=e.i(41931),H=e.i(294114),V=e.i(201276),Y=e.i(303163);function W(){let{timeZone:e}=(0,i.M)(),{data:r}=(0,a.useSession)(),{t:n}=(0,t.b)(),[l,o]=(0,g.useState)([]),[c,d]=(0,g.useState)(!0),[m,u]=(0,g.useState)(!1),[p,h]=(0,g.useState)(!1),[x,f]=(0,g.useState)("0"),[j,v]=(0,g.useState)(!1),y=(0,g.useCallback)(async()=>{d(!0);try{let e=await B.f.get("/api/admin/users");o(e)}catch(e){V.f.error("[UserManagement]","Failed to fetch users",{error:e})}finally{d(!1)}},[]),w=(0,g.useCallback)(async()=>{try{let e=await B.f.get("/api/settings");u(!0===e.allowRegistration),f(String(e.aiDailyLimit??0))}catch(e){V.f.error("[UserManagement]","Failed to fetch config",{error:e})}},[]);(0,g.useEffect)(()=>{y(),w()},[y,w]);let N=async e=>{h(!0);try{await B.f.post("/api/settings",{allowRegistration:e}),u(e)}catch(e){V.f.error("[UserManagement]","Failed to update registration setting",{error:e}),H.c.error(n.common.error)}finally{h(!1)}},k=Number(x),S=""!==x.trim()&&Number.isInteger(k)&&k>=0,T=async()=>{if(S){v(!0);try{await B.f.post("/api/settings",{aiDailyLimit:k}),H.c.success(n.admin.aiDailyLimitSaved)}catch(e){V.f.error("[UserManagement]","Failed to update AI daily limit",{error:e}),H.c.error(n.common.error)}finally{v(!1)}}},A=async e=>{let s=e.isActive?n.admin.confirmDisable:n.admin.confirmEnable;if(await (0,H.u)(s))try{await B.f.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),y()}catch(e){V.f.error("[UserManagement]","Failed to update user status",{error:e}),H.c.error(n.common.error)}},F=async e=>{if(await (0,H.u)(n.admin.confirmDelete,{destructive:!0}))try{await B.f.delete(`/api/admin/users/${e.id}`),y()}catch(s){V.f.error("[UserManagement]","Failed to delete user",{error:s});let e=(0,Y.d)(s)||n.common.error;H.c.error(e)}};return c?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(b.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(M.f,{className:"text-base",children:n.admin?.allowRegistration||"Allow New Registrations"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:n.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,s.jsx)(b.f,{className:"h-4 w-4 animate-spin"}),(0,s.jsx)(z.f,{checked:m,onCheckedChange:N,disabled:p})]})]}),(0,s.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,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(M.f,{htmlFor:"ai-daily-limit",className:"text-base",children:n.admin.aiDailyLimit}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:n.admin.aiDailyLimitDesc})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)(D.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:x,onChange:e=>f(e.target.value),"aria-invalid":!S,className:"w-24"}),(0,s.jsxs)(C.f,{size:"sm",onClick:T,disabled:j||!S,children:[j&&(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.common.save]})]})]}),(0,s.jsx)("div",{className:"sm:hidden space-y-3",children:l.map(t=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium",children:t.name||"N/A"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:t.email})]}),(0,s.jsx)(_.f,{variant:"admin"===t.role?"default":"secondary",children:"admin"===t.role?n.admin.admin:n.admin.user})]}),(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsxs)("div",{className:"text-muted-foreground",children:[n.admin.errors,": ",t._count.errorItems," | ",n.admin.practiceCount,": ",t._count.practiceRecords," | ",n.admin.aiUsageToday,": ",t.aiUsageToday]}),(0,s.jsx)(_.f,{variant:t.isActive?"default":"destructive",className:"text-xs",children:t.isActive?n.admin.active:n.admin.disabled})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,E.r)(t.createdAt,"yyyy-MM-dd",e)}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(C.f,{variant:"ghost",size:"sm",onClick:()=>A(t),disabled:t.id===r?.user?.id,children:t.isActive?(0,s.jsx)(O,{className:"h-4 w-4 text-orange-500"}):(0,s.jsx)(K.f,{className:"h-4 w-4 text-green-500"})}),(0,s.jsx)(C.f,{variant:"ghost",size:"sm",onClick:()=>F(t),disabled:t.id===r?.user?.id,children:(0,s.jsx)(q.f,{className:"h-4 w-4 text-destructive"})})]})]})]},t.id))}),(0,s.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,s.jsxs)(R,{children:[(0,s.jsx)(I,{children:(0,s.jsxs)($,{children:[(0,s.jsx)(U,{children:n.admin.nameEmail}),(0,s.jsx)(U,{children:n.admin.role}),(0,s.jsx)(U,{children:n.admin.stats}),(0,s.jsx)(U,{children:n.admin.createdAt}),(0,s.jsx)(U,{children:n.admin.status}),(0,s.jsx)(U,{className:"text-right",children:n.admin.actions})]})}),(0,s.jsx)(L,{children:l.map(t=>(0,s.jsxs)($,{children:[(0,s.jsxs)(P,{children:[(0,s.jsx)("div",{className:"font-medium",children:t.name||"N/A"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:t.email})]}),(0,s.jsx)(P,{children:(0,s.jsx)(_.f,{variant:"admin"===t.role?"default":"secondary",children:"admin"===t.role?n.admin.admin:n.admin.user})}),(0,s.jsxs)(P,{children:[(0,s.jsxs)("div",{className:"text-sm",children:[n.admin.errors,": ",t._count.errorItems]}),(0,s.jsxs)("div",{className:"text-sm",children:[n.admin.practiceCount,": ",t._count.practiceRecords]}),(0,s.jsxs)("div",{className:"text-sm",children:[n.admin.aiUsageToday,": ",t.aiUsageToday]})]}),(0,s.jsx)(P,{children:(0,E.r)(t.createdAt,"yyyy-MM-dd",e)}),(0,s.jsx)(P,{children:(0,s.jsx)(_.f,{variant:t.isActive?"default":"destructive",children:t.isActive?n.admin.active:n.admin.disabled})}),(0,s.jsxs)(P,{className:"text-right space-x-2",children:[(0,s.jsx)(C.f,{variant:"ghost",size:"sm",onClick:()=>A(t),disabled:t.id===r?.user?.id,title:t.isActive?n.admin.disable:n.admin.enable,children:t.isActive?(0,s.jsx)(O,{className:"h-4 w-4 text-orange-500"}):(0,s.jsx)(K.f,{className:"h-4 w-4 text-green-500"})}),(0,s.jsx)(C.f,{variant:"ghost",size:"sm",onClick:()=>F(t),disabled:t.id===r?.user?.id,title:n.admin.delete,children:(0,s.jsx)(q.f,{className:"h-4 w-4 text-destructive"})})]})]},t.id))})]})})]})}var J=e.i(778917);let X=(0,p.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"}]]),G=(0,p.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"}]]),Z=(0,p.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 Q(){return window.WrongNotebookAndroid??null}let ee=()=>()=>void 0;function es(){let{t:e}=(0,t.b)(),a=(0,g.useSyncExternalStore)(ee,Q,()=>null);return a?a.isStandalone?.()?(0,s.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:e.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"break-all",children:[e.settings?.about?.androidServer||"Server",": ",a.getServerUrl()]}),(0,s.jsxs)(C.f,{variant:"outline",className:"gap-2",onClick:()=>a.changeServer(),children:[(0,s.jsx)(Z,{className:"h-4 w-4"}),e.settings?.about?.changeServer||"Change server"]})]}):null}let et="https://github.com/margrop/wrong-notebook";function ea(){let{t:e}=(0,t.b)(),[a,i]=(0,g.useState)("");(0,g.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>i(e.version)).catch(()=>{})},[]);let r=[{href:et,icon:X,label:e.settings?.about?.github||"GitHub Repository"},{href:`${et}/releases`,icon:G,label:e.settings?.about?.releaseNotes||"Release Notes"},{href:`${et}/issues`,icon:w,label:e.settings?.about?.feedback||"Feedback"}];return(0,s.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,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-2xl font-bold",children:e.app?.title||"Smart Error Notebook"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:e.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,s.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,s.jsx)(v,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[e.settings?.about?.version||"Version",": v",a||"unknown"]})]}),(0,s.jsx)(es,{}),(0,s.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:r.map(({href:e,icon:t,label:a})=>(0,s.jsx)(C.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,s.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(t,{className:"h-4 w-4"}),a,(0,s.jsx)(J.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:e.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var ei=e.i(37038),er=e.i(967489);let en={name:"",email:"",educationStage:"",enrollmentYear:"",password:""};function el(){let{t:e}=(0,t.b)(),[a,i]=(0,g.useState)(en),[r,n]=(0,g.useState)(""),[l,o]=(0,g.useState)(!0),[c,d]=(0,g.useState)(!1),m=(0,g.useCallback)(async()=>{try{let e=await B.f.get("/api/user");i({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",password:""})}catch(e){V.f.error("[AccountSettings]","Failed to fetch profile",{error:e})}finally{o(!1)}},[]);(0,g.useEffect)(()=>{m()},[m]);let u=async()=>{if(a.password&&a.password!==r)return void H.c.error(e.settings?.messages?.passwordMismatch||"Passwords do not match");d(!0);try{let s={name:a.name,email:a.email,educationStage:a.educationStage};a.enrollmentYear&&(s.enrollmentYear=parseInt(a.enrollmentYear.toString())),a.password&&(s.password=a.password),await B.f.patch("/api/user",s),H.c.success(e.settings?.messages?.profileUpdated||"Profile updated"),i(e=>({...e,password:""})),n(""),window.location.reload()}catch(s){V.f.error("[AccountSettings]","Failed to update profile",{error:(0,Y.d)(s)??(0,Y.Z)(s)}),H.c.error((0,Y.d)(s)||e.settings?.messages?.updateFailed||"Update failed")}finally{d(!1)}};return l?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(b.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.auth?.name||"Name"}),(0,s.jsx)(D.f,{value:a.name||"",onChange:e=>i({...a,name:e.target.value})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.auth?.email||"Email"}),(0,s.jsx)(D.f,{value:a.email||"",onChange:e=>i({...a,email:e.target.value}),type:"email"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.auth?.educationStage||"Education Stage"}),(0,s.jsxs)(er.d,{value:a.educationStage||"",onValueChange:e=>i({...a,educationStage:e}),children:[(0,s.jsx)(er.P,{children:(0,s.jsx)(er.U,{placeholder:e.auth?.selectStage||"Select Stage"})}),(0,s.jsxs)(er.r,{children:[(0,s.jsx)(er.T,{value:"primary",children:e.auth?.primary||"Primary School"}),(0,s.jsx)(er.T,{value:"junior_high",children:e.auth?.juniorHigh||"Junior High"}),(0,s.jsx)(er.T,{value:"senior_high",children:e.auth?.seniorHigh||"Senior High"}),(0,s.jsx)(er.T,{value:"university",children:e.auth?.university||"University"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.auth?.enrollmentYear||"Enrollment Year"}),(0,s.jsx)(D.f,{type:"number",value:a.enrollmentYear||"",onChange:e=>i({...a,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,s.jsx)(ei.f,{value:a.password,onChange:e=>i({...a,password:e.target.value}),placeholder:"******",minLength:6})]}),a.password&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:e.auth?.confirmPassword||"Confirm Password"}),(0,s.jsx)(ei.f,{value:r,onChange:e=>n(e.target.value),placeholder:"******",minLength:6})]})]}),(0,s.jsxs)(C.f,{onClick:u,disabled:c,className:"w-full",children:[c&&(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.settings?.account?.update||"Update Profile"]})]})}var eo=e.i(10038),ec=e.i(16715);let ed={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 em({title:e,description:t,tone:a,busy:i,icon:r,onClick:n}){let l=ed[a];return(0,s.jsxs)("div",{className:`p-4 border rounded-lg ${l.card}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:`text-sm flex items-center gap-2 ${l.title}`,children:e}),(0,s.jsx)(C.f,{variant:"info"===a?"outline":"destructive",size:"sm",onClick:n,disabled:i,className:l.button,children:i?(0,s.jsx)(b.f,{className:"h-4 w-4 animate-spin"}):r})]}),(0,s.jsx)("p",{className:`text-xs mt-2 ${l.desc}`,children:t})]})}function eu({isAdmin:e}){let{t:a}=(0,t.b)(),[i,r]=(0,g.useState)(null),n=async(e,s,t,a)=>{r(e);try{H.c.success(await s()),a&&window.location.reload()}catch(s){V.f.error("[DangerZoneSettings]",`${e} failed`,{error:s}),H.c.error(t)}finally{r(null)}},l=a.settings?.clearSuccess||"Success",o=a.settings?.clearError||"Failed",c=async()=>{await (0,H.u)(a.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await n("migrateTags",async()=>{let e=await B.f.post("/api/admin/migrate-tags",{});return`${l}: ${e.count||0} tags migrated.`},a.settings?.clearError||"Failed to migrate tags",!1)},d=async()=>{await (0,H.u)(a.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await n("clearPractice",async()=>(await B.f.delete("/api/stats/practice/clear"),l),o,!0)},m=async()=>{await (0,H.u)(a.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await n("clearErrors",async()=>(await B.f.delete("/api/error-items/clear"),l),o,!0)},u=async()=>{if(!await (0,H.u)(a.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(a.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&H.c.error(a.common?.error||"Confirmation failed");return}await n("systemReset",async()=>(await B.f.post("/api/admin/system-reset",{}),a.settings?.clearSuccess||"Success - System Reset Complete"),a.settings?.clearError||"Failed to reset system",!0)};return(0,s.jsxs)(s.Fragment,{children:[e&&(0,s.jsx)(em,{tone:"info",title:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.f,{className:"h-4 w-4"}),a.settings?.migrateTags||"Migrate Tags"]}),description:a.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===i,icon:(0,s.jsx)(ec.f,{className:"h-4 w-4"}),onClick:c}),(0,s.jsx)(em,{tone:"danger",title:a.settings?.clearData||"Clear Practice Data",description:a.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===i,icon:(0,s.jsx)(q.f,{className:"h-4 w-4"}),onClick:d}),(0,s.jsx)(em,{tone:"danger",title:a.settings?.clearErrorData||"Clear Error Data",description:a.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===i,icon:(0,s.jsx)(q.f,{className:"h-4 w-4"}),onClick:m}),e&&(0,s.jsx)(em,{tone:"critical",title:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f,{className:"h-4 w-4"}),a.settings?.systemReset||"System Initialization"]}),description:a.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===i,icon:(0,s.jsx)(q.f,{className:"h-4 w-4"}),onClick:u})]})}var ep=e.i(595468),eh=e.i(440160);let ex=(0,p.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 eg(e,s){let t=await fetch(e);if(!t.ok)throw Error((await t.json().catch(()=>({}))).message||"Export failed");let a=await t.blob(),i=window.URL.createObjectURL(a),r=document.createElement("a");r.href=i;let n=t.headers.get("Content-Disposition")?.match(/filename="(.+)"/);r.download=n?n[1]:s,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i)}function ef({isAdmin:e}){let{t:a}=(0,t.b)(),[i,r]=(0,g.useState)(!1),[n,l]=(0,g.useState)(!1),[o,c]=(0,g.useState)(null),d=async e=>{if(!e||await (0,H.u)(a.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){r(!0);try{await eg(e?"/api/export?all=true":"/api/export",e?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),H.c.success(a.settings?.exportSuccess||"Export successful")}catch(s){V.f.error("[DataBackupSettings]",e?"Export all failed":"Export failed",{error:s}),H.c.error(a.settings?.exportFailed||"Export failed")}finally{r(!1)}}},m=async e=>{if(!o)return;let s=e?a.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":a.settings?.importConfirm||"Are you sure you want to import?";if(await (0,H.u)(s)){l(!0);try{let s=JSON.parse(await o.text()),{stats:t}=await B.f.post(e?"/api/import?all=true":"/api/import",s);H.c.success((a.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(t.subjectsCreated)).replace("{tags}",String(t.tagsCreated)).replace("{items}",String(t.errorItemsCreated)).replace("{schedules}",String(t.reviewSchedulesCreated)).replace("{records}",String(t.practiceRecordsCreated)).replace("{papers}",String(t.examPapersCreated??0)).replace("{voices}",String(t.ttsSpeechesImported??0)).replace("{duplicates}",String(t.duplicateErrorItems??0))),c(null),window.location.reload()}catch(s){V.f.error("[DataBackupSettings]",e?"Import all failed":"Import failed",{error:s}),H.c.error(a.settings?.importFailed||"Import failed")}finally{l(!1)}}},u=(e,t)=>e?(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}):t;return(0,s.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,s.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:a.settings?.dataManagement||"Data Management"}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:a.settings?.exportData||"Export Data"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>d(!1),disabled:i,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[u(i,(0,s.jsx)(eh.f,{className:"mr-2 h-4 w-4"})),a.settings?.exportData||"Export"]}),e&&(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>d(!0),disabled:i,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[u(i,(0,s.jsx)(eh.f,{className:"mr-2 h-4 w-4"})),a.settings?.exportAllData||"Export All"]})]})]}),(0,s.jsx)("p",{className:"text-xs text-blue-700",children:a.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:a.settings?.importData||"Import Data"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"file",accept:".json",onChange:e=>c(e.target.files?.[0]??o),className:"hidden",id:"import-file-input",disabled:n}),(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:n,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[u(n,(0,s.jsx)(ex,{className:"mr-2 h-4 w-4"})),o?.name||a.settings?.selectFile||"Select File"]}),o&&(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>m(!1),disabled:n,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[u(n,(0,s.jsx)(ep.f,{className:"mr-2 h-4 w-4"})),a.settings?.importData||"Import"]}),o&&e&&(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>m(!0),disabled:n,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[u(n,(0,s.jsx)(ep.f,{className:"mr-2 h-4 w-4"})),a.settings?.importAllData||"Import All"]})]})]}),(0,s.jsx)("p",{className:"text-xs text-blue-700",children:a.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}var ej=e.i(307364);function ev({field:e,label:a,description:i}){let{t:r}=(0,t.b)(),[n,l]=(0,g.useState)(!1),[o,c]=(0,g.useState)(!1),[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)(null),h=`preference-${e}`;(0,g.useEffect)(()=>{B.f.get("/api/user").then(s=>l(!!s[e])).catch(()=>void 0).finally(()=>c(!0))},[e]);let x=async s=>{l(s),m(!0);try{await B.f.patch("/api/user",{[e]:s}),p(r.importFlow.preferenceSaved)}catch(t){l(!s),p(r.importFlow.preferenceSaveFailed),V.f.error("[Settings]","Failed to save user preference",{field:e,error:t instanceof Error?t.message:String(t)})}finally{m(!1)}};return(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)(M.f,{htmlFor:h,children:a}),(0,s.jsx)(z.f,{id:h,checked:n,onCheckedChange:x,disabled:!o||d})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:i}),u&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:u})]})}function ey(){let{t:e}=(0,t.b)();return(0,s.jsx)(ev,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function eb(){let{t:e}=(0,t.b)();return(0,s.jsx)(ev,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}var ew=e.i(905110);function eN(){let{t:e}=(0,t.b)(),[a,i]=(0,g.useState)(String(ew.z)),[r,n]=(0,g.useState)(null),[l,o]=(0,g.useState)(!0),[c,d]=(0,g.useState)(!1),[m,u]=(0,g.useState)(null),p=Number(a),h=""!==a.trim()&&Number.isInteger(p)&&p>=ew.P&&p<=ew.o,x=(0,g.useCallback)(async()=>{o(!0),u(null);try{let e=(await B.f.get("/api/user")).masteryThreshold??ew.z;i(String(e)),n(e)}catch(s){u(e.mastery.thresholdLoadFailed),V.f.error("[Settings]","加载已掌握阈值失败",{error:s instanceof Error?s.message:String(s)})}finally{o(!1)}},[e.mastery.thresholdLoadFailed]);(0,g.useEffect)(()=>{x()},[x]);let f=async()=>{if(h&&null!==r){d(!0),u(null);try{let s=(await B.f.patch("/api/user",{masteryThreshold:p})).masteryThreshold??p;n(s),i(String(s)),u(e.importFlow.preferenceSaved)}catch(s){u(e.importFlow.preferenceSaveFailed),V.f.error("[Settings]","保存已掌握阈值失败",{error:s instanceof Error?s.message:String(s)})}finally{d(!1)}}};return(0,s.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,s.jsx)(M.f,{htmlFor:"mastery-threshold",children:e.mastery.thresholdLabel}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(D.f,{id:"mastery-threshold",type:"number",min:ew.P,max:ew.o,step:1,value:a,onChange:e=>{i(e.target.value),u(null)},disabled:l||c||null===r,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,s.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,s.jsxs)(C.f,{type:"button",size:"sm",variant:"outline",onClick:f,disabled:l||c||null===r||!h||p===r,children:[(l||c)&&(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.importFlow.saveThreshold]}),!l&&null===r&&(0,s.jsx)(C.f,{type:"button",size:"sm",variant:"outline",onClick:x,children:e.importFlow.retryLoad})]}),(0,s.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:e.mastery.thresholdDescription}),null!==r&&!h&&(0,s.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:e.mastery.thresholdInvalid}),m&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:m})]})}function ek(){let{t:e}=(0,t.b)();return(0,s.jsx)(ev,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function eS({value:e,onChange:a,disabled:i}){let{t:r}=(0,t.b)();return(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsx)(M.f,{htmlFor:"app-time-zone",children:r.settings.general.timeZoneLabel}),(0,s.jsx)(D.f,{id:"app-time-zone",value:e,onChange:e=>a(e.target.value),disabled:i,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,s.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,s.jsx)("option",{value:e},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings.general.timeZoneDesc})]})}function eC({config:e,setConfig:a,isAdmin:r,disabled:n}){let{t:l,language:o,setLanguage:c}=(0,t.b)(),{timeZone:d}=(0,i.M)(),m=e=>a(s=>({...s,timeouts:{...s.timeouts,analyze:1e3*e}}));return(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:l.settings?.language||"Language"}),(0,s.jsxs)(er.d,{value:o,onValueChange:e=>c(e),children:[(0,s.jsx)(er.P,{children:(0,s.jsx)(er.U,{})}),(0,s.jsxs)(er.r,{children:[(0,s.jsx)(er.T,{value:"zh",children:"中文 (Chinese)"}),(0,s.jsx)(er.T,{value:"en",children:"English"})]})]})]}),(0,s.jsx)(eS,{value:e.timeZone??d,onChange:e=>a(s=>({...s,timeZone:e})),disabled:!r||n}),r&&(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsx)(M.f,{children:l.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,s.jsx)(D.f,{type:"number",value:e.timeouts?.analyze?e.timeouts.analyze/1e3:"",onChange:e=>{let s=""===e.target.value?0:parseInt(e.target.value);m(isNaN(s)?0:s)},onBlur:()=>{let s=(e.timeouts?.analyze||0)/1e3,t=Math.min(600,Math.max(120,s));t!==s&&m(t)},min:120,max:600}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,s.jsx)(eb,{}),(0,s.jsx)(ek,{}),(0,s.jsx)(ey,{}),(0,s.jsx)(ej.f,{}),(0,s.jsx)(eN,{})]})}var eT=e.i(624687),eA=e.i(247167);let eE={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function e_(e,s={}){let t,a=eE[e],i=(t=eA.default.env.LOG_LEVEL?.toLowerCase())&&void 0!==eE[t]?eE[t]:eE.info;return(t,r)=>{let n,l;if(a<i)return;let o=new Date;"string"==typeof t?(n={},l=t):(n=t,l=r||"");{let t=JSON.stringify({level:e,time:o.toISOString(),...s,...n,msg:l});switch(e){case"error":case"fatal":console.error(t);break;case"warn":console.warn(t);break;default:console.log(t)}}}}(function e(s={}){return s.module,{trace:e_("trace",s),debug:e_("debug",s),info:e_("info",s),warn:e_("warn",s),error:e_("error",s),fatal:e_("fatal",s),child:t=>e({...s,...t}),box:(e,t,a="📋")=>{console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...s,title:e,..."string"==typeof t?{content:t}:t||{},msg:e}))},divider:(e="-")=>{}}})({env:"production"}).child({module:"ai:prompts"});let ez=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
2
|
+
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
3
|
+
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
4
|
+
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
5
|
+
- 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
|
|
6
|
+
- 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
|
|
7
|
+
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,eD=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
|
|
8
|
+
- 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
|
|
9
|
+
- 按原图比例和相对位置绘制,保留所有标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18)。
|
|
10
|
+
- 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
|
|
11
|
+
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,eM=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
|
|
12
|
+
- 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
|
|
13
|
+
- 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
|
|
14
|
+
- 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
|
|
15
|
+
- 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
|
|
16
|
+
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,eF=`【角色与核心任务 (ROLE AND CORE TASK)】
|
|
17
|
+
你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
|
|
18
|
+
|
|
19
|
+
{{language_instruction}}
|
|
20
|
+
|
|
21
|
+
【核心输出要求 (OUTPUT REQUIREMENTS)】
|
|
22
|
+
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**对 LaTeX 公式中的反斜杠进行二次转义(如 "\\frac" 是错误的,必须是 "\frac")。
|
|
23
|
+
|
|
24
|
+
请严格按照以下结构输出内容:
|
|
25
|
+
|
|
26
|
+
<subject>
|
|
27
|
+
在此处填写学科,必须是以下之一:"数学", "物理", "化学", "生物", "英语", "语文", "历史", "地理", "政治", "其他"。
|
|
28
|
+
</subject>
|
|
29
|
+
|
|
30
|
+
<knowledge_points>
|
|
31
|
+
在此处填写知识点,使用逗号分隔,例如:知识点1, 知识点2, 知识点3
|
|
32
|
+
</knowledge_points>
|
|
33
|
+
|
|
34
|
+
<requires_image>
|
|
35
|
+
判断这道题是否需要依赖图片才能正确解答。如果题目包含几何图形、函数图像、实验装置图、电路图等必须看图才能理解的内容,填写 true;如果只需要文字描述即可理解(如英语题、纯文字数学题),填写 false。
|
|
36
|
+
</requires_image>
|
|
37
|
+
|
|
38
|
+
<has_figure>
|
|
39
|
+
判断题目本身是否带有配图(几何图形、函数图像、示意图、统计图、实验装置图、电路图等;不含学生的作答痕迹和纯文字表格)。有配图填 true,否则填 false。
|
|
40
|
+
</has_figure>
|
|
41
|
+
|
|
42
|
+
<figure_svg>
|
|
43
|
+
如果 has_figure 为 true,用 SVG 重新绘制题目配图:
|
|
44
|
+
${eD}
|
|
45
|
+
如果 has_figure 为 false,请留空。
|
|
46
|
+
</figure_svg>
|
|
47
|
+
|
|
48
|
+
<wrong_answer_text>
|
|
49
|
+
如果图片中包含学生已经写出的错误解答、错误步骤、草稿或错误答案,请尽量按原样摘录;如果没有看到学生错误解答,请留空。
|
|
50
|
+
</wrong_answer_text>
|
|
51
|
+
|
|
52
|
+
<mistake_status>
|
|
53
|
+
填写以下值之一:wrong_attempt(图片中有错误解答或错误步骤)、not_attempted(没有错误解答,像是完全不会做或未作答)、unknown(无法判断)。
|
|
54
|
+
</mistake_status>
|
|
55
|
+
|
|
56
|
+
<difficulty_stars>
|
|
57
|
+
只填写 1 到 5 之间的一个整数,表示题目难度星级。
|
|
58
|
+
${ez}
|
|
59
|
+
</difficulty_stars>
|
|
60
|
+
|
|
61
|
+
<mistake_analysis>
|
|
62
|
+
如果图片中包含错误解答,请分析错误可能发生在哪一步、为什么错、导致了什么后果;如果没有错误解答,请留空。
|
|
63
|
+
</mistake_analysis>
|
|
64
|
+
|
|
65
|
+
<question_text>
|
|
66
|
+
在此处填写题目的完整文本。使用 Markdown 格式。所有数学公式使用 LaTeX 符号(行内 $...$,块级 $$...$$)。
|
|
67
|
+
|
|
68
|
+
【题干转录规则】
|
|
69
|
+
1. **逐字照录**:按图片原文转录题干(含题号、分值和标点),不要改写、概括、增删字词或调整语序;看不清的字用 [?] 标注。
|
|
70
|
+
2. **填空统一**:所有填空处统一写作 ____(4 个下划线),不论原图横线长短。
|
|
71
|
+
3. **图形描述**:如果题目依赖图形,在题干原文之后空一行,单独写**一段**以「图示:」开头的图形描述;只能使用「图示:」这一种写法(不要写「图示信息」「图示说明」等),描述中不要重复题干已有的文字。题目不依赖图形时不要写图示段落。
|
|
72
|
+
|
|
73
|
+
【表格处理规则】
|
|
74
|
+
如果图片中包含表格,必须完整转录表格内容,遵循以下原则:
|
|
75
|
+
|
|
76
|
+
1. **标准表格**:使用 Markdown 表格语法
|
|
77
|
+
| 列标题1 | 列标题2 | 列标题3 |
|
|
78
|
+
|---------|---------|---------|
|
|
79
|
+
| 数据1 | 数据2 | 数据3 |
|
|
80
|
+
|
|
81
|
+
2. **复杂表格**(合并单元格/多级表头/不规则布局):
|
|
82
|
+
- 优先尝试用 Markdown 表格近似表示
|
|
83
|
+
- 如果 Markdown 无法准确表达,在表格前用文字说明结构,然后用简化的 Markdown 表格 + 注释
|
|
84
|
+
- 示例:
|
|
85
|
+
> 注:第1行为主标题,横跨3列;第2-3行为数据行
|
|
86
|
+
|
|
87
|
+
| 项目 | 数值A | 数值B |
|
|
88
|
+
|------|-------|-------|
|
|
89
|
+
| 测试1 | 10 | 20 |
|
|
90
|
+
| 测试2 | 15 | 25 |
|
|
91
|
+
|
|
92
|
+
3. **表格完整性要求**:
|
|
93
|
+
- 必须转录所有单元格内容(包括空单元格用 - 或空格表示)
|
|
94
|
+
- 保留表格标题、单位、注释
|
|
95
|
+
- 保留数据的对齐关系和分组信息
|
|
96
|
+
- 表格中的数学公式使用 LaTeX 语法
|
|
97
|
+
|
|
98
|
+
4. **表格上下文**:
|
|
99
|
+
- 如果表格有标题或编号(如"表1"),保留在表格前
|
|
100
|
+
- 如果表格后有注释或说明,保留在表格后
|
|
101
|
+
- 保持表格在题目中的位置关系
|
|
102
|
+
|
|
103
|
+
5. **特殊情况处理**:
|
|
104
|
+
- 图表混合:如果表格旁边有图形,用文字说明位置关系
|
|
105
|
+
- 手写表格:尽力识别手写内容,不确定的用 [?] 标注
|
|
106
|
+
- 模糊表格:如果表格不清晰,在表格前注明"(表格内容可能不完整)"
|
|
107
|
+
</question_text>
|
|
108
|
+
|
|
109
|
+
<answer_text>
|
|
110
|
+
在此处填写正确答案。使用 Markdown 和 LaTeX 符号。如果答案包含表格,遵循上述【表格处理规则】。
|
|
111
|
+
</answer_text>
|
|
112
|
+
|
|
113
|
+
<analysis>
|
|
114
|
+
在此处填写详细的步骤解析。
|
|
115
|
+
* 必须使用简体中文。
|
|
116
|
+
* **直接使用标准的 LaTeX 符号**(如 $\frac{1}{2}$),**不要**进行 JSON 转义(不要写成 \\frac)。
|
|
117
|
+
* 如果解析过程需要表格(如列表对比、分步计算表),遵循上述【表格处理规则】。
|
|
118
|
+
</analysis>
|
|
119
|
+
|
|
120
|
+
【知识点标签列表(KNOWLEDGE POINT LIST)】
|
|
121
|
+
{{knowledge_points_list}}
|
|
122
|
+
|
|
123
|
+
【标签使用规则 (TAG RULES)】
|
|
124
|
+
- 标签必须与题目实际考查的知识点精准匹配。
|
|
125
|
+
- 每题最多 5 个标签。
|
|
126
|
+
|
|
127
|
+
【!!! 关键格式与内容约束 (CRITICAL RULES) !!!】
|
|
128
|
+
1. **格式严格**:必须严格包含上述 12 个 XML 标签,除此之外不要输出任何其他“开场白”或“结束语”。
|
|
129
|
+
2. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
130
|
+
3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
|
|
131
|
+
4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
|
|
132
|
+
5. **LaTeX 规范**:
|
|
133
|
+
${eM}
|
|
134
|
+
|
|
135
|
+
{{grade_instruction}}
|
|
136
|
+
{{provider_hints}}`,eR=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
|
|
137
|
+
### 角色定义
|
|
138
|
+
1. **学科全能专家**
|
|
139
|
+
- 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
|
|
140
|
+
- 熟悉各年级课程标准与知识点分布
|
|
141
|
+
- 能准确识别题目考察的核心能力点(计算/推理/分析/应用/创新)
|
|
142
|
+
2. **题目变异大师**
|
|
143
|
+
- 掌握12种变式技法:条件替换/情境迁移/问题转化/数据重构/图形变形/角色反转/跨学科融合/难度阶梯/开放拓展/陷阱设计/逆向思维/生活应用
|
|
144
|
+
- 确保变式题目保持原题核心考点,改变题目表现形式
|
|
145
|
+
3. **学情分析师**
|
|
146
|
+
- 预判学生易错点(认知盲区/概念混淆/计算失误/审题偏差)
|
|
147
|
+
- 在变式题目中针对性强化易错点训练
|
|
148
|
+
### 执行流程
|
|
149
|
+
1. **接收任务**
|
|
150
|
+
原题: "{{original_question}}"
|
|
151
|
+
{{language_instruction}}
|
|
152
|
+
DIFFICULTY LEVEL: {{difficulty_level}}
|
|
153
|
+
{{difficulty_instruction}}
|
|
154
|
+
Knowledge Points: {{knowledge_points}}
|
|
155
|
+
2. **解构分析**
|
|
156
|
+
- 提取核心考点与能力要求
|
|
157
|
+
- 分析题目陷阱与解题路径
|
|
158
|
+
3. **质量管控**
|
|
159
|
+
- 确保每道题:
|
|
160
|
+
✓ 覆盖相同核心知识点
|
|
161
|
+
✓ 保持解题逻辑一致性
|
|
162
|
+
✓ 答案唯一且可验证
|
|
163
|
+
✓ 无知识性错误
|
|
164
|
+
### 输出规范
|
|
165
|
+
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**返回 \`\`\`json ... \`\`\`。
|
|
166
|
+
|
|
167
|
+
请严格按照以下结构输出内容(不要包含任何其他文字):
|
|
168
|
+
|
|
169
|
+
<question_text>
|
|
170
|
+
在此处填写新生成的填空题或解答题。不要包含题号、分值或选择题选项。
|
|
171
|
+
</question_text>
|
|
172
|
+
|
|
173
|
+
<answer_text>
|
|
174
|
+
在此处填写新题目的正确答案。
|
|
175
|
+
</answer_text>
|
|
176
|
+
|
|
177
|
+
<analysis>
|
|
178
|
+
在此处填写新题目的详细解析。
|
|
179
|
+
* 必须使用简体中文。
|
|
180
|
+
* **直接使用标准的 LaTeX 符号**(如 $\frac{1}{2}$),**不要**进行 JSON 转义。
|
|
181
|
+
</analysis>
|
|
182
|
+
|
|
183
|
+
{{figure_instruction}}
|
|
184
|
+
|
|
185
|
+
###关键格式与内容约束 (CRITICAL RULES) !!!
|
|
186
|
+
1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
187
|
+
2. **LaTeX 规范**:
|
|
188
|
+
${eM}
|
|
189
|
+
|
|
190
|
+
{{grade_instruction}}
|
|
191
|
+
{{provider_hints}}`;var eI=e.i(367240);function eL({name:e,description:t}){return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,s.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,s.jsx)("span",{className:"text-muted-foreground",children:t})]})}function e$(){let{t:e}=(0,t.b)();return(0,s.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-md p-3 flex items-start gap-3 text-amber-900 text-sm mb-4",children:[(0,s.jsx)(f,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"font-medium",children:e.settings?.prompts?.caution||"Modify with Caution"}),(0,s.jsx)("p",{className:"text-amber-800/90 text-xs",children:e.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]})}function eU({config:e,onUpdate:a}){let{t:i}=(0,t.b)(),r=e.prompts?.analyze||eF,n=e.prompts?.similar||eR,l=async e=>{await (0,H.u)(i.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0})&&a(e,"analyze"===e?eF:eR)},o=(e,s)=>{a(e,s)};return(0,s.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,s.jsxs)(A.i,{defaultValue:"analyze",className:"w-full",children:[(0,s.jsxs)(A.U,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(A.k,{value:"analyze",children:i.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,s.jsx)(A.k,{value:"similar",children:i.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,s.jsx)(A.S,{value:"analyze",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(M.f,{className:"text-base font-semibold",children:i.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>l("analyze"),children:[(0,s.jsx)(eI.f,{className:"w-4 h-4 mr-2"}),i.settings?.prompts?.reset||"Reset Default"]})]}),(0,s.jsx)(e$,{}),(0,s.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,s.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(v,{className:"h-3.5 w-3.5"}),i.settings?.prompts?.variables||"Available Variables"]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(eL,{name:"language_instruction",description:i.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,s.jsx)(eL,{name:"knowledge_points_list",description:i.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,s.jsx)(eL,{name:"provider_hints",description:i.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,s.jsx)(eT.f,{value:r,onChange:e=>o("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:eF})]})}),(0,s.jsx)(A.S,{value:"similar",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(M.f,{className:"text-base font-semibold",children:i.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,s.jsxs)(C.f,{variant:"outline",size:"sm",onClick:()=>l("similar"),children:[(0,s.jsx)(eI.f,{className:"w-4 h-4 mr-2"}),i.settings?.prompts?.reset||"Reset Default"]})]}),(0,s.jsx)(e$,{}),(0,s.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,s.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(v,{className:"h-3.5 w-3.5"}),i.settings?.prompts?.variables||"Available Variables"]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(eL,{name:"difficulty_level",description:i.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,s.jsx)(eL,{name:"difficulty_instruction",description:i.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,s.jsx)(eL,{name:"original_question",description:i.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,s.jsx)(eL,{name:"knowledge_points",description:i.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,s.jsx)(eL,{name:"language_instruction",description:i.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,s.jsx)(eT.f,{value:n,onChange:e=>o("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:eR})]})})]})})}var eP=e.i(431343),eq=e.i(434901),eO=e.i(753817),eK=e.i(128093),eB=e.i(79058);let eH=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];eH.filter(e=>"browser"!==e);let eV={minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},eY={minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}};function eW({config:e,setConfig:a,saving:i,onSave:r}){var n;let{t:l,language:o}=(0,t.b)(),c=l.settings.tts,[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)(null),h=e.tts?.mode??"browser",x="browser"!==h&&"string"==typeof(n=h)&&eH.includes(n)?h:null,f=x?e.tts?.[x]:void 0,j=(e,s)=>{x&&a(t=>({...t,tts:{...t.tts,[x]:{...t.tts?.[x],[e]:s}}}))},v=!!x&&("volcengine"===x||"openai"===x),y=x?function(e,s){if("openai"===s){let s=e.openai?.instances?.find(s=>s.id===e.openai?.activeInstanceId);return s?{apiKey:s.apiKey,baseUrl:s.baseUrl}:void 0}return e[s]}(e,x):void 0,w=v?f?.apiKey:y?.apiKey,N=async()=>{(0,eB.p)(),m(!0),p(null);try{await r();let{id:e,version:s}=await B.f.post("/api/tts",{text:c.previewText,language:o},{timeout:12e4,recoverable:!0}),t=(0,eB.l)();if(!t)return;t.src=`/api/tts/${e}?v=${s}`,t.playbackRate=1,await t.play()}catch(s){V.f.error("[TtsSettings]","Preview failed",{error:s});let e=(0,Y.d)(s);H.c.error("TTS_NOT_CONFIGURED"===e?c.notConfigured:"TTS_PROVIDER_ERROR"===e?c.providerError:c.previewFailed),p((0,Y.L)(s)??null)}finally{m(!1)}};return(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M.f,{children:c.title}),(0,s.jsxs)(er.d,{value:h,onValueChange:e=>a(s=>({...s,tts:{...s.tts,mode:e}})),children:[(0,s.jsx)(er.P,{children:(0,s.jsx)(er.U,{})}),(0,s.jsx)(er.r,{children:eH.map(e=>(0,s.jsx)(er.T,{value:e,children:c.modes[e]},e))})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:x?c.cloudHint:c.browserHint})]}),x&&(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(eq.f,{label:"openai"===x?"OpenAI API Key":v?c.speechApiKey:`${(0,eK.z)(x,o)} API Key`,href:eY[x].apiKey,linkText:l.settings.ai.docLinks.apiKey}),(0,s.jsx)(ei.f,{value:w||"",onChange:e=>{var s;return s=e.target.value,void(x&&(v?j("apiKey",s):a(e=>({...e,[x]:{...e[x],apiKey:s}}))))},placeholder:"qwen"===x?"sk-sp-...":v?"":"sk-..."}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:c.apiKeyHint[x]})]}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(eq.f,{label:c.model,href:eY[x].model,linkText:c.docs}),(0,s.jsx)(D.f,{value:f?.model||"",onChange:e=>j("model",e.target.value),placeholder:eV[x].model})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(eq.f,{label:c.voice,href:eY[x].voice,linkText:c.voiceList}),(0,s.jsx)(D.f,{value:f?.voice||"",onChange:e=>j("voice",e.target.value),placeholder:eV[x].voice})]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:c.voiceHint[x]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(eq.f,{label:c.endpoint,href:eY[x].endpoint,linkText:c.docs}),(0,s.jsx)(D.f,{value:f?.endpoint||"",onChange:e=>j("endpoint",e.target.value),placeholder:function(e,s){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(s?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:t}=(0,eK.k)(e,s);if("minimax"===e)return`${t.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${t.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(t).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}}(x,y)}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:c.endpointHint})]})]},x),(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[x&&(0,s.jsxs)(C.f,{variant:"outline",onClick:N,disabled:i||d,className:"sm:w-auto",children:[d?(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(eP.f,{className:"mr-2 h-4 w-4"}),c.preview]}),(0,s.jsxs)(C.f,{onClick:()=>void r(),disabled:i||d,className:"flex-1",children:[i&&(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}),c.save]})]}),x&&u&&(0,s.jsx)("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 dark:border-red-900 dark:bg-red-950/40",children:(0,s.jsx)(eO.f,{detail:u})})]})}var eJ=e.i(835467);function eX({value:e,icon:t,label:a}){return(0,s.jsxs)(A.k,{value:e,className:"px-2 sm:px-3",children:[t,(0,s.jsx)("span",{className:"hidden sm:inline",children:a})]})}function eG(){let{setTimeZone:e}=(0,i.M)(),{data:r}=(0,a.useSession)(),n=r?.user?.role==="admin",{t:c}=(0,t.b)(),d=(0,l.useRouter)(),[m,u]=(0,g.useState)(!1),p=(0,g.useRef)(null),[h,_]=(0,g.useState)(!1),[z,D]=(0,g.useState)(!1),[M,F]=(0,g.useState)({aiProvider:"minimax"}),R=(0,g.useCallback)(async()=>{D(!0);try{F(await B.f.get("/api/settings"))}catch(e){V.f.error("[SettingsDialog]","Failed to fetch settings",{error:e})}finally{D(!1)}},[]);(0,g.useEffect)(()=>{m&&R()},[m,R]);let I=async()=>{let s=(0,eJ.f)(M,c);if(s)return void H.c.error(s);_(!0);try{let s=await B.f.post("/api/settings",M);F(s),e(s.timeZone||E.J),H.c.success(c.settings?.messages?.saved||"Settings saved"),p.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){V.f.error("[SettingsDialog]","Failed to save settings",{error:e}),H.c.error(c.settings?.messages?.saveFailed||"Failed to save")}finally{_(!1)}},L=e=>(0,s.jsxs)(C.f,{onClick:I,disabled:h,className:"w-full",children:[h&&(0,s.jsx)(b.f,{className:"mr-2 h-4 w-4 animate-spin"}),e]});return(0,s.jsxs)(T.N,{open:m,onOpenChange:u,children:[(0,s.jsx)(T.a,{asChild:!0,children:(0,s.jsxs)(C.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,s.jsx)(N,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"sr-only",children:c.settings?.title||"Settings"})]})}),(0,s.jsxs)(T.d,{ref:p,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,s.jsxs)(T.s,{children:[(0,s.jsx)(T.F,{children:c.settings?.title||"Settings"}),(0,s.jsx)(T.C,{children:c.settings?.desc||"Manage your preferences and data."})]}),(0,s.jsxs)(A.i,{defaultValue:"general",className:"w-full",children:[(0,s.jsxs)(A.U,{className:`grid w-full grid-cols-4 ${n?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,s.jsx)(eX,{value:"general",icon:(0,s.jsx)(y.f,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.general||"General"}),(0,s.jsx)(eX,{value:"account",icon:(0,s.jsx)(k.f,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.account||"Account"}),n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX,{value:"ai",icon:(0,s.jsx)(j,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.ai||"AI Provider"}),(0,s.jsx)(eX,{value:"prompts",icon:(0,s.jsx)(w,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.prompts||"Prompts"}),(0,s.jsx)(eX,{value:"admin",icon:(0,s.jsx)(x,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.admin||"User Management"})]}),(0,s.jsx)(eX,{value:"danger",icon:(0,s.jsx)(f,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.danger||"Danger"}),(0,s.jsx)(eX,{value:"about",icon:(0,s.jsx)(v,{className:"h-4 w-4 sm:mr-2"}),label:c.settings?.tabs?.about||"About"})]}),(0,s.jsxs)(A.S,{value:"general",className:"space-y-4 py-4",children:[(0,s.jsx)(eC,{config:M,setConfig:F,isAdmin:n,disabled:z||h}),n&&L(c.settings?.save||"Save Settings")]}),(0,s.jsx)(A.S,{value:"account",className:"space-y-4 py-4",children:(0,s.jsx)(el,{})}),(0,s.jsxs)(A.S,{value:"ai",className:"space-y-4 py-4",children:[(0,s.jsx)(eo.f,{config:M,setConfig:F,loading:z,saving:h,onSave:I}),!z&&(0,s.jsx)(eW,{config:M,setConfig:F,saving:h,onSave:I})]}),(0,s.jsxs)(A.S,{value:"prompts",className:"space-y-4 py-4",children:[(0,s.jsx)(eU,{config:M,onUpdate:(e,s)=>F(t=>({...t,prompts:{...t.prompts,[e]:s}}))}),L(c.settings?.prompts?.save||"Save Prompt Settings")]}),n&&(0,s.jsxs)(A.S,{value:"admin",className:"space-y-4 py-4",children:[(0,s.jsxs)(C.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/admin")},children:[(0,s.jsx)(o.f,{className:"h-4 w-4"}),c.admin?.dashboard?.title||"Admin Dashboard"]}),(0,s.jsxs)(C.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{u(!1),d.push("/setup")},children:[(0,s.jsx)(S.f,{className:"h-4 w-4"}),c.setup.rerun]}),(0,s.jsx)("div",{className:"border-t pt-4",children:(0,s.jsx)(W,{})})]}),(0,s.jsx)(A.S,{value:"danger",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(ef,{isAdmin:n}),(0,s.jsx)(eu,{isAdmin:n})]})}),(0,s.jsx)(A.S,{value:"about",className:"space-y-4 py-4",children:(0,s.jsx)(ea,{})})]})]})]})}let eZ=[/^\/login/,/^\/register/,/^\/setup/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],eQ=[{key:"home",href:"/",icon:h,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:c.f,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"review",href:"/review",icon:d.f,match:e=>e.startsWith("/review")},{key:"stats",href:"/stats",icon:o.f,match:e=>e.startsWith("/stats")||e.startsWith("/tags")},{key:"exams",href:"/exams",icon:m.f,match:e=>e.startsWith("/exams")}];function e0({children:e}){var i;let o,c,d=(0,l.usePathname)()||"/",{t:m}=(0,t.b)(),{data:p,status:h}=(0,a.useSession)(),f=p?.user?.role==="admin",j=eZ.some(e=>e.test(d));if(i=f&&!j,o=(0,l.useRouter)(),c=(0,g.useRef)(!1),(0,g.useEffect)(()=>{i&&!c.current&&(c.current=!0,B.f.get("/api/setup").then(e=>{e.needsSetup&&o.replace("/setup")}).catch(e=>V.f.warn("[Setup]","Failed to check setup status",{error:e})))},[i,o]),j||"unauthenticated"===h)return(0,s.jsx)(s.Fragment,{children:e});let v=p?.user?.name||p?.user?.email||"";return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,s.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,s.jsxs)(n.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)(r.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,s.jsx)("span",{className:"text-base font-semibold tracking-tight",children:m.pageTitle.base})]}),(0,s.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:eQ.map(e=>{let t=e.match(d),a=e.icon;return(0,s.jsxs)(n.default,{href:e.href,className:(0,F.f)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":t?"page":void 0,children:[(0,s.jsx)(a,{className:"h-4 w-4"}),m.nav[e.key]]},e.key)})}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[v&&(0,s.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:v.slice(0,1).toUpperCase()}),(0,s.jsx)("span",{className:"truncate",children:v})]}),f&&(0,s.jsx)(n.default,{href:"/admin",title:m.nav.admin,children:(0,s.jsxs)(C.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,s.jsx)(x,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"sr-only",children:m.nav.admin})]})}),(0,s.jsx)(eG,{}),(0,s.jsx)(C.f,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,a.signOut)({callbackUrl:"/login"}),title:m.app.logout,children:(0,s.jsx)(u.f,{className:"h-5 w-5"})})]})]})}),(0,s.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,s.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,s.jsx)("div",{className:"grid h-16 grid-cols-5",children:eQ.map(e=>{let t=e.match(d),a=e.icon;return(0,s.jsxs)(n.default,{href:e.href,className:(0,F.f)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",t?"text-primary":"text-muted-foreground"),"aria-current":t?"page":void 0,children:[(0,s.jsx)("span",{className:(0,F.f)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",t&&"bg-accent"),children:(0,s.jsx)(a,{className:"h-5 w-5"})}),m.nav[e.key]]},e.key)})})})]})}let e1=(0,p.f)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var e2=e.i(373884);let e4=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function e3(){let{t:e}=(0,t.b)(),{timeZone:r}=(0,i.M)(),{status:o}=(0,a.useSession)(),c=(0,l.usePathname)(),[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)([]),[h,x]=(0,g.useState)(()=>Date.now()),f="authenticated"!==o||e4.some(e=>e.test(c||"")),j=(0,g.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await B.f.get("/api/tasks");p(e.tasks),x(Date.now())}catch{}},[]);if((0,g.useEffect)(()=>{if(f)return;let e=setTimeout(j,0),s=setInterval(j,d?2e3:15e3);return()=>{clearTimeout(e),clearInterval(s)}},[f,d,j]),f)return null;let v=u.filter(e=>"running"===e.status).length,y=u.some(e=>"running"!==e.status),w=async()=>{try{let e=await B.f.delete("/api/tasks");p(e.tasks)}catch{}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(C.f,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>m(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[v>0?(0,s.jsx)(b.f,{className:"h-5 w-5 animate-spin"}):(0,s.jsx)(e1,{className:"h-5 w-5"}),v>0&&(0,s.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:v})]}),(0,s.jsx)(T.N,{open:d,onOpenChange:m,children:(0,s.jsxs)(T.d,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,s.jsxs)(T.s,{children:[(0,s.jsx)(T.F,{children:e.backgroundTasks.title}),(0,s.jsx)(T.C,{children:e.backgroundTasks.description})]}),0===u.length?(0,s.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,s.jsx)("ul",{className:"space-y-2",children:u.map(t=>{var a,i;let l;return(0,s.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:["running"===t.status&&(0,s.jsx)(b.f,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===t.status&&(0,s.jsx)(ep.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===t.status&&(0,s.jsx)(e2.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[t.kind],(0,s.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[t.status]]})]}),t.subject&&(0,s.jsx)("div",{className:"break-words text-muted-foreground",children:t.subject}),t.progress&&t.progress.total>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,s.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(t.progress.done/t.progress.total*100)}%`}})}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(t.progress.done)).replace("{total}",String(t.progress.total)),t.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(t.progress.failed))}`]})]}),t.error&&(0,s.jsx)("div",{className:"text-xs text-destructive",children:(s=>{if(!s)return null;let t=e.backgroundTasks.errors[s]??e.errors[s];return"string"==typeof t?t:s})(t.error)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,E.r)(t.startedAt,"HH:mm:ss",r))}),(0,s.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(a=t.startedAt,i=t.finishedAt,l=Math.max(0,Math.round(((i?Date.parse(i):h)-Date.parse(a))/1e3)),`${Math.floor(l/60)}:${String(l%60).padStart(2,"0")}`))}),t.link&&(0,s.jsx)(n.default,{href:t.link,className:"text-primary hover:underline",onClick:()=>m(!1),children:e.backgroundTasks.view})]})]})]})},t.id)})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),y&&(0,s.jsx)(C.f,{variant:"ghost",size:"sm",onClick:w,children:e.backgroundTasks.clearFinished})]})]})})]})}var e5=e.i(37727);let e6={success:{icon:ep.f,className:"text-success"},error:{icon:e2.f,className:"text-destructive"},warning:{icon:f,className:"text-warning"},info:{icon:v,className:"text-primary"}};function e8(){let{t:e}=(0,t.b)(),[a,i]=(0,g.useState)([]),[r,n]=(0,g.useState)(null);return(0,g.useEffect)(()=>(0,H.M)(e=>{i(e.toasts),n(e.confirm)}),[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:a.map(t=>{let{icon:a,className:i}=e6[t.type];return(0,s.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,s.jsx)(a,{className:(0,F.f)("mt-0.5 h-4 w-4 shrink-0",i)}),(0,s.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:t.message}),(0,s.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,H.p)(t.id),"aria-label":e.common.close,children:(0,s.jsx)(e5.X,{className:"h-3.5 w-3.5"})})]},t.id)})}),(0,s.jsx)(T.N,{open:!!r,onOpenChange:e=>{e||r?.resolve(!1)},children:(0,s.jsxs)(T.d,{className:"sm:max-w-md",children:[(0,s.jsxs)(T.s,{children:[(0,s.jsxs)(T.F,{className:"flex items-center gap-2",children:[r?.destructive&&(0,s.jsx)(f,{className:"h-5 w-5 text-destructive"}),r?.title||e.common.confirmTitle]}),(0,s.jsx)(T.C,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:r?.message})]}),(0,s.jsxs)(T.c,{className:"gap-2",children:[(0,s.jsx)(C.f,{variant:"outline",onClick:()=>r?.resolve(!1),children:r?.cancelText||e.common.cancel}),(0,s.jsx)(C.f,{variant:r?.destructive?"destructive":"default",onClick:()=>r?.resolve(!0),autoFocus:!0,children:r?.confirmText||e.common.confirm})]})]})})]})}function e7(){return(0,g.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{V.f.warn("[PWA]","Service worker registration failed",{error:String(e)})})},[]),null}e.s(["Providers",0,function({children:e,timeZone:r}){return(0,s.jsx)(a.SessionProvider,{children:(0,s.jsx)(t.w,{children:(0,s.jsxs)(i.n,{initialTimeZone:r,children:[(0,s.jsx)(e0,{children:e}),(0,s.jsx)(e3,{}),(0,s.jsx)(e8,{}),(0,s.jsx)(e7,{})]})})})}],1661)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let s=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,s],871689)},666944,e=>{var s=e.i(843476),t=e.i(271645),r=e.i(618566),i=e.i(519455),a=e.i(590546),n=e.i(511445),l=e.i(149704),c=e.i(41931),o=e.i(111110),m=e.i(35209),d=e.i(469817),p=e.i(201276);function x(){var e,x,h,u;let g=(0,r.useSearchParams)(),{t:f}=(0,o.b)(),[w,b]=(0,t.useState)([]);(0,m.f)(f.printPreview.title);let[v,j]=(0,t.useState)(!0),[N,y]=(0,t.useState)(!1),[S,P]=(0,t.useState)(!1),[k,C]=(0,t.useState)(!1),[T,A]=(0,t.useState)(70),[$,I]=(0,t.useState)(!1),[U,q]=(0,t.useState)(new Set),z=(0,t.useCallback)(async()=>{try{let e=new URLSearchParams(g.toString());e.set("pageSize",String(d.A)),e.set("view","print");let s=await c.f.get(`/api/error-items/list?${e.toString()}`);b(s.items),q(new Set(s.items.map(e=>e.id)))}catch(e){p.f.error("[PrintPreview]","Failed to fetch items",{error:e})}finally{j(!1)}},[g]);(0,t.useEffect)(()=>{z()},[z]);let R=w.filter(e=>U.has(e.id)),L=!N&&!S,Q=(e=w.length,(x=R.length)===e?String(e):`${x}/${e}`),F=(h=w.length,u=R.length,0===h?"noItems":0===u?"noSelection":null);return v?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-muted-foreground",children:f.common.loading})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(a.f,{fallbackUrl:"/notebooks"}),(0,s.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[f.printPreview?.title||"Print Preview"," (",Q," ",f.notebooks?.items||"items",")"]}),(0,s.jsx)(i.f,{onClick:()=>{window.print()},size:"sm",className:"whitespace-nowrap",disabled:0===R.length,children:f.printPreview?.printButton||"Print / Save PDF"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,s.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[f.printPreview?.imageScale||"Image Scale",": ",T,"%"]}),(0,s.jsx)("input",{type:"range",min:"30",max:"100",value:T,onChange:e=>A(Number(e.target.value)),className:"w-16 sm:w-20 accent-primary"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:$,onChange:e=>I(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showQuestionText||"Question Text"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:N,onChange:e=>y(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showAnswers||"Show Answers"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:S,onChange:e=>P(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showAnalysis||"Show Analysis"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:k,onChange:e=>C(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showTags||"Show Tags"]})]})]}),(0,s.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[f.printPreview?.selectItems||"Select Items"," (",R.length,"/",w.length,")"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.f,{variant:"outline",size:"sm",onClick:()=>{q(new Set(w.map(e=>e.id)))},children:f.printPreview?.selectAll||"Select All"}),(0,s.jsx)(i.f,{variant:"outline",size:"sm",onClick:()=>{q(new Set)},children:f.printPreview?.clearSelection||"Clear Selection"})]})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-44 overflow-y-auto pr-1",children:w.map((e,t)=>(0,s.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,s.jsx)("input",{type:"checkbox",checked:U.has(e.id),onChange:()=>{var s;return s=e.id,void q(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,s.jsxs)("span",{className:"line-clamp-2",children:[(0,s.jsx)("span",{className:"font-semibold",children:f.printPreview?.questionNumber?.replace("{num}",String(t+1))||`Question ${t+1}`}),e.questionText
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let s=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,s],871689)},666944,e=>{var s=e.i(843476),t=e.i(271645),r=e.i(618566),i=e.i(519455),a=e.i(590546),n=e.i(511445),l=e.i(149704),c=e.i(41931),o=e.i(111110),m=e.i(35209),d=e.i(469817),p=e.i(201276);function x(){var e,x,h,u;let g=(0,r.useSearchParams)(),{t:f}=(0,o.b)(),[w,b]=(0,t.useState)([]);(0,m.f)(f.printPreview.title);let[v,j]=(0,t.useState)(!0),[N,y]=(0,t.useState)(!1),[S,P]=(0,t.useState)(!1),[k,C]=(0,t.useState)(!1),[T,A]=(0,t.useState)(70),[$,I]=(0,t.useState)(!1),[U,q]=(0,t.useState)(new Set),z=(0,t.useCallback)(async()=>{try{let e=new URLSearchParams(g.toString());e.set("pageSize",String(d.A)),e.set("view","print");let s=await c.f.get(`/api/error-items/list?${e.toString()}`);b(s.items),q(new Set(s.items.map(e=>e.id)))}catch(e){p.f.error("[PrintPreview]","Failed to fetch items",{error:e})}finally{j(!1)}},[g]);(0,t.useEffect)(()=>{z()},[z]);let R=w.filter(e=>U.has(e.id)),L=!N&&!S,Q=(e=w.length,(x=R.length)===e?String(e):`${x}/${e}`),F=(h=w.length,u=R.length,0===h?"noItems":0===u?"noSelection":null);return v?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-muted-foreground",children:f.common.loading})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(a.f,{fallbackUrl:"/notebooks"}),(0,s.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[f.printPreview?.title||"Print Preview"," (",Q," ",f.notebooks?.items||"items",")"]}),(0,s.jsx)(i.f,{onClick:()=>{window.print()},size:"sm",className:"whitespace-nowrap",disabled:0===R.length,children:f.printPreview?.printButton||"Print / Save PDF"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,s.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[f.printPreview?.imageScale||"Image Scale",": ",T,"%"]}),(0,s.jsx)("input",{type:"range",min:"30",max:"100",value:T,onChange:e=>A(Number(e.target.value)),className:"w-16 sm:w-20 accent-primary"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:$,onChange:e=>I(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showQuestionText||"Question Text"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:N,onChange:e=>y(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showAnswers||"Show Answers"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:S,onChange:e=>P(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showAnalysis||"Show Analysis"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:k,onChange:e=>C(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),f.printPreview?.showTags||"Show Tags"]})]})]}),(0,s.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[f.printPreview?.selectItems||"Select Items"," (",R.length,"/",w.length,")"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.f,{variant:"outline",size:"sm",onClick:()=>{q(new Set(w.map(e=>e.id)))},children:f.printPreview?.selectAll||"Select All"}),(0,s.jsx)(i.f,{variant:"outline",size:"sm",onClick:()=>{q(new Set)},children:f.printPreview?.clearSelection||"Clear Selection"})]})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-44 overflow-y-auto pr-1",children:w.map((e,t)=>(0,s.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,s.jsx)("input",{type:"checkbox",checked:U.has(e.id),onChange:()=>{var s;return s=e.id,void q(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,s.jsxs)("span",{className:"line-clamp-2",children:[(0,s.jsx)("span",{className:"font-semibold",children:f.printPreview?.questionNumber?.replace("{num}",String(t+1))||`Question ${t+1}`}),e.questionText?`${f.common.colon}${e.questionText}`:""]})]},e.id))})]})]})}),(0,s.jsxs)("div",{className:"max-w-4xl mx-auto p-8 print:p-0",children:[R.map((e,t)=>{let r=[];if(e.tags&&e.tags.length>0)r=e.tags.map(e=>e.name);else try{r=JSON.parse(e.knowledgePoints||"[]")}catch{r=[]}return(0,s.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid ${L?"pb-20 print:pb-16":"pb-6"}`,children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,s.jsx)("span",{className:"text-lg font-bold",children:f.printPreview?.questionNumber?.replace("{num}",String(t+1))||`Question ${t+1}`}),e.shortId&&(0,s.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:f.printPreview.source.replace("{id}",e.shortId)}),e.subject&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.subject.name}),e.gradeSemester&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.gradeSemester}),e.paperLevel&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:[f.printPreview?.paperLevel||"Paper Level",": ",e.paperLevel.toUpperCase()]}),k&&r.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"font-semibold",children:[f.printPreview?.knowledgePoints||"Knowledge Points",":"]}),r.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:e},`${e}-${t}`))]})]}),$&&e.questionText?(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(n.f,{content:e.questionText}),(0,s.jsx)(l.f,{svg:e.figureSvg})]}):e.originalImageUrl&&(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("img",{src:e.originalImageUrl,alt:f.detail?.originalProblem||"Question Image",className:"h-auto border rounded",style:{maxWidth:`${T}%`}})}),N&&e.answerText&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold mb-2",children:[f.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,s.jsx)(n.f,{content:e.answerText})]}),S&&e.analysis&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold mb-2",children:[f.printPreview?.analysis||"Analysis",":"]}),(0,s.jsx)(n.f,{content:e.analysis})]})]},e.id)}),F&&(0,s.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===F?f.printPreview?.noSelection||"No items selected":f.printPreview?.noItems||"No matching error items"})]})]})}e.s(["default",0,function(){let{t:e}=(0,o.b)();return(0,s.jsx)(t.Suspense,{fallback:(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:e.common.loading}),children:(0,s.jsx)(x,{})})}],666944)},149704,e=>{var s=e.i(843476),t=e.i(111110),r=e.i(975157);e.s(["f",0,function({svg:e,className:i}){let{t:a}=(0,t.b)();return e?(0,s.jsx)("figure",{className:(0,r.f)("question-figure my-3",i),children:(0,s.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:a.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},590546,e=>{var s=e.i(843476),t=e.i(618566),r=e.i(519455),i=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:a}){let n=(0,t.useRouter)();return(0,s.jsx)(r.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:a,children:(0,s.jsx)(i.f,{className:"h-5 w-5"})})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:r}=(0,t.b)(),i=[r.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=i},[i])}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0}),r=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return n(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function i(e){if(!r)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}n(o,"composeEventHandlers"),n(function(e){if(!r)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),n(i,"getOwnerDocument"),n(function e(t,n=!1){let{activeElement:r}=i(t);if(!r?.nodeName)return null;if(a(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=i(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),n(a,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),n=e.i(843476),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,r=[]){let s=[];function l(r,i){let a=t.createContext(i);a.displayName=r+"Context";let l=s.length;s=[...s,i];let u=o(r=>{let{scope:o,children:i,...s}=r,u=o?.[e]?.[l]||a,c=t.useMemo(()=>s,Object.values(s));return(0,n.jsx)(u.Provider,{value:c,children:i})},"Provider");function c(n,o,s={}){let{optional:u=!1}=s,f=o?.[e]?.[l]||a,d=t.useContext(f);if(d)return d;if(void 0!==i)return i;if(!u)throw Error(`\`${n}\` must be used within \`${r}\``)}return u.displayName=r+"Provider",o(c,"useContext"),[u,c]}o(l,"createContext");let u=o(()=>{let n=s.map(e=>t.createContext(e));return o(function(r){let o=r?.[e]||n;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])},"useScope")},"createScope");return u.scopeName=e,[l,a(u,...r)]}function a(...e){let n=e[0];if(1===e.length)return n;let r=o(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=r.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=n.scopeName,r}o(function(e,r){let i=t.createContext(r);i.displayName=e+"Context";let a=o(e=>{let{children:r,...o}=e,a=t.useMemo(()=>o,Object.values(o));return(0,n.jsx)(i.Provider,{value:a,children:r})},"Provider");function s(n,o={}){let{optional:a=!1}=o,l=t.useContext(i);if(l)return l;if(void 0!==r)return r;if(!a)throw Error(`\`${n}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",o(s,"useContext"),[a,s]},"createContext"),o(i,"createContextScope"),o(a,"composeContextScopes"),e.s(["f",0,i])},296626,e=>{var t=e.i(271645),n=e.i(934620),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,n){return t.useReducer((e,t)=>n[e][t]??e,e)}o(i,"useStateMachine");var a=o(e=>{let{present:n,children:r}=e,o=s(n),i="function"==typeof r?r({present:o.isPresent}):t.Children.only(r),a=u(o.ref,f(i));return"function"==typeof r||o.isPresent?t.cloneElement(i,{ref:a}):null},"Presence");function s(e){let[r,a]=t.useState(),s=t.useRef(null),l=t.useRef(e),u=t.useRef("none"),f=t.useRef(void 0),[d,m]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(u.current=f.current??c(s.current),f.current=void 0):u.current="none"},[d]),(0,n.f)(()=>{let t=s.current,n=l.current;if(n!==e){let r=u.current,o=c(t);e?(f.current=o,m("MOUNT")):"none"===o||t?.display==="none"?m("UNMOUNT"):n&&r!==o?m("ANIMATION_OUT"):m("UNMOUNT"),l.current=e}},[e,m]),(0,n.f)(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=o(n=>{let o=c(s.current).includes(CSS.escape(n.animationName));if(n.target===r&&o&&(m("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},"handleAnimationEnd"),i=o(e=>{e.target===r&&(u.current=c(s.current))},"handleAnimationStart");return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,f.current=c(t)}else s.current=null;a(e)},[])}}function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){let n=t.useRef(e);return n.current=e,t.useCallback(e=>{let t=n.current,r=!1,o=t.map(t=>{let n=l(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let n=o[e];"function"==typeof n?n():l(t[e],null)}}},[])}function c(e){return e?.animationName||"none"}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(s,"usePresence"),o(l,"setRef"),o(u,"useStableComposedRefs"),o(c,"getAnimationName"),o(f,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),n=e.i(174080),r=e.i(991918),o=e.i(843476),i=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let i=(0,r.B)(`Primitive.${n}`),a=t.forwardRef((e,t)=>{let{asChild:r,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(r?i:n,{...a,ref:t})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function s(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}i(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,s])},369340,e=>{var t=e.i(271645),n=e.i(705844),r=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof i)return i(e);let n=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{n.current=e}):(0,r.f)(()=>{n.current=e}),t.useMemo(()=>(...e)=>n.current?.(...e),[])}o(s,"name",{value:"useEffectEvent",configurable:!0});var l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0}),c=t[" useInsertionEffect ".trim().toString()]||r.f;function f({prop:e,defaultProp:r,onChange:o=u(()=>{},"onChange"),caller:i}){let[a,s,l]=d({defaultProp:r,onChange:o}),c=void 0!==e,p=c?e:a;if(n.f){let n=t.useRef(void 0!==e);t.useEffect(()=>{let e=n.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=c},[c,i])}return[p,t.useCallback(t=>{if(c){let n=m(t)?t(e):t;n!==e&&l.current?.(n)}else s(t)},[c,e,s,l])]}function d({defaultProp:e,onChange:n}){let[r,o]=t.useState(e),i=t.useRef(r),a=t.useRef(n);return c(()=>{a.current=n},[n]),t.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}function m(e){return"function"==typeof e}u(f,"useControllableState"),u(d,"useUncontrolledState"),u(m,"isFunction");var p=Symbol("RADIX:SYNC_STATE");u(function(e,r,o,i){let{prop:a,defaultProp:l,onChange:u,caller:c}=r,f=void 0!==a,d=s(u);if(n.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==f){let e=f?"controlled":"uncontrolled";console.warn(`${c} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=f},[f,c])}let m=[{...o,state:l}];i&&m.push(i);let[g,h]=t.useReducer((t,n)=>{if(n.type===p)return{...t,state:n.state};let r=e(t,n);return f&&!Object.is(r.state,t.state)&&d(r.state),r},...m),w=g.state,b=t.useRef(w);t.useEffect(()=>{b.current!==w&&(b.current=w,f||d(w))},[w,b,f]);let y=t.useMemo(()=>void 0!==a?{...g,state:a}:g,[g,a]);return t.useEffect(()=>{f&&!Object.is(a,g.state)&&h({type:p,state:a})},[a,g.state,f]),[y,h]},"useControllableStateReducer"),e.s(["f",0,f],369340)},934620,e=>{var t=e.i(271645),n=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,n])},635804,e=>{var t=e.i(271645),n=e.i(934620);function r(e){let[r,o]=t.useState(void 0);return(0,n.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,n=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let r=n[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,n;if("borderBoxSize"in r){let e=r.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,n=o.blockSize}else t=e.offsetWidth,n=e.offsetHeight;o({width:t,height:n})})});return n.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}o(void 0)},[e]),r}(0,Object.defineProperty)(r,"name",{value:"useSize",configurable:!0}),e.s(["f",0,r])},475254,e=>{var t=e.i(271645);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:l,iconNode:u,...c},f)=>(0,t.createElement)("svg",{ref:f,...o,width:n,height:n,stroke:e,strokeWidth:a?24*Number(i)/Number(n):i,className:r("lucide",s),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(l)?l:[l]]));e.s(["f",0,(e,o)=>{let a=(0,t.forwardRef)(({className:a,...s},l)=>(0,t.createElement)(i,{ref:l,iconNode:o,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...s}));return a.displayName=n(e),a}],475254)},643531,e=>{let t=(0,e.i(475254).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,t],643531)},531278,e=>{let t=(0,e.i(475254).f)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["f",0,t],531278)},37727,e=>{let t=(0,e.i(475254).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},776639,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(981140),o=e.i(820783),i=e.i(30030),a=e.i(610772),s=e.i(369340),l=e.i(726330),u=e.i(765491),c=e.i(774606),f=e.i(296626),d=e.i(248425),m=e.i(303536),p=e.i(934620),g=e.i(985369),h=e.i(186312),w=e.i(991918),b=Object.defineProperty,y=(e,t)=>b(e,"name",{value:t,configurable:!0}),v="Dialog",[x,D]=(0,i.f)(v),[E,N]=x(v),C=y(e=>{let{__scopeDialog:r,children:o,open:i,defaultOpen:l,onOpenChange:c,modal:f=!0}=e,d=n.useRef(null),m=n.useRef(null),{nodes:p,registry:g}=(0,u.D)(),[h,w]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:c,caller:v}),[b,y]=n.useState(0),[x,D]=n.useState(0);return(0,t.jsx)(E,{scope:r,triggerRef:d,contentRef:m,contentId:(0,a.f)(),titleId:(0,a.f)(),descriptionId:(0,a.f)(),titlePresent:b>0,descriptionPresent:x>0,setTitleCount:y,setDescriptionCount:D,open:h,onOpenChange:w,onOpenToggle:n.useCallback(()=>w(e=>!e),[w]),modal:f,branchNodes:p,branchRegistry:g,children:o})},"Dialog"),O=n.forwardRef(y(function(e,n){let{__scopeDialog:i,...a}=e,s=N("DialogTrigger",i),l=(0,o.f)(n,s.triggerRef);return(0,t.jsx)(d.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":W(s.open),...a,ref:l,onClick:(0,r.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),R="DialogPortal",[T,j]=x(R,{forceMount:void 0}),S=y(e=>{let{__scopeDialog:r,forceMount:o,children:i,container:a}=e,s=N(R,r);return(0,t.jsx)(T,{scope:r,forceMount:o,children:n.Children.map(i,e=>(0,t.jsx)(f.f,{present:o||s.open,children:(0,t.jsx)(c.f,{asChild:!0,container:a,children:e})}))})},"DialogPortal"),A="DialogOverlay",P=n.forwardRef(y(function(e,n){let r=j(A,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=N(A,e.__scopeDialog);return a.modal?(0,t.jsx)(f.f,{present:o||a.open,children:(0,t.jsx)(M,{...i,ref:n})}):null},"DialogOverlay")),I=(0,w.B)("DialogOverlay.RemoveScroll"),M=n.forwardRef(y(function(e,r){let{__scopeDialog:i,...a}=e,s=N(A,i),u=(0,l.y)(),c=(0,o.f)(r,u);return(0,t.jsx)(g.f,{as:I,allowPinchZoom:!0,shards:n.useMemo(()=>[s.contentRef,...s.branchNodes.map(e=>({current:e}))],[s.contentRef,s.branchNodes]),children:(0,t.jsx)(d.V.div,{"data-state":W(s.open),...a,ref:c,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),_="DialogContent",k=n.forwardRef(y(function(e,n){let r=j(_,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=N(_,e.__scopeDialog);return(0,t.jsx)(f.f,{present:o||a.open,children:a.modal?(0,t.jsx)($,{...i,ref:n}):(0,t.jsx)(F,{...i,ref:n})})},"DialogContent")),$=n.forwardRef(y(function(e,i){let a=N(_,e.__scopeDialog),s=n.useRef(null),l=(0,o.f)(i,a.contentRef,s);return n.useEffect(()=>{let e=s.current;if(e)return(0,h.f)(e)},[]),(0,t.jsx)(U,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:(0,r.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,r.f)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),F=n.forwardRef(y(function(e,r){let o=N(_,e.__scopeDialog),i=n.useRef(!1),a=n.useRef(!1);return(0,t.jsx)(U,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),U=n.forwardRef(y(function(e,n){let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":s,children:c,...f}=e,d=N(_,r);return(0,m.f)(),(0,t.jsx)(u.l,{registry:d.branchRegistry,children:(0,t.jsx)(u.v,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,t.jsx)(l.V,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?V(s,d.descriptionId):s,"data-state":W(d.open),...f,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),L=n.forwardRef(y(function(e,n){let{__scopeDialog:r,...o}=e,i=N("DialogTitle",r),{setTitleCount:a}=i;return(0,p.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.h2,{id:i.titleId,...o,ref:n})},"DialogTitle")),B=n.forwardRef(y(function(e,n){let{__scopeDialog:r,...o}=e,i=N("DialogDescription",r),{setDescriptionCount:a}=i;return(0,p.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.p,{id:i.descriptionId,...o,ref:n})},"DialogDescription")),z=n.forwardRef(y(function(e,n){let{__scopeDialog:o,...i}=e,a=N("DialogClose",o);return(0,t.jsx)(d.V.button,{type:"button",...i,ref:n,onClick:(0,r.f)(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function V(...e){let t=new Set;for(let n of e)if("string"==typeof n)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(" "):void 0}function W(e){return e?"open":"closed"}y(V,"concatAriaDescribedby"),y(W,"getState");var X=e.i(37727),q=e.i(975157);let H=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(P,{ref:r,className:(0,q.f)("fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));H.displayName=P.displayName;let J=n.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(S,{children:[(0,t.jsx)(H,{}),(0,t.jsxs)(k,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,q.f)("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border bg-card p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r,children:[n,(0,t.jsxs)(z,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(X.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));J.displayName=k.displayName;let Z=({className:e,...n})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Z.displayName="DialogHeader";let K=({className:e,...n})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});K.displayName="DialogFooter";let Y=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(L,{ref:r,className:(0,q.f)("text-lg font-semibold leading-none tracking-tight",e),...n}));Y.displayName=L.displayName;let G=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(B,{ref:r,className:(0,q.f)("text-sm text-muted-foreground",e),...n}));G.displayName=B.displayName,e.s(["N",0,C,"d",0,J,"C",0,G,"c",0,K,"s",0,Z,"F",0,Y,"a",0,O],776639)},793479,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({className:e,type:r,...o}){return(0,t.jsx)("input",{type:r,"data-slot":"input",className:(0,n.f)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}])},110204,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(248425),o=Object.defineProperty,i=n.forwardRef(o(function(e,n){return(0,t.jsx)(r.V.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),a=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)(i,{"data-slot":"label",className:(0,a.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}],110204)},41931,294114,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},n={toasts:[],confirm:null},r=1,o=new Set;function i(e){n=e,o.forEach(e=>e(n))}function a(e){i({...n,toasts:n.toasts.filter(t=>t.id!==e)})}function s(e,o){let s="string"==typeof o?o:String(o??"");if(!s)return;let l=r++;i({...n,toasts:[...n.toasts.slice(-3),{id:l,type:e,message:s}]}),setTimeout(()=>a(l),t[e])}let l={success:e=>s("success",e),error:e=>s("error",e),info:e=>s("info",e),warning:e=>s("warning",e)};e.s(["u",0,function(e,t={}){return 0===o.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(n.confirm?.resolve(!1),new Promise(o=>{let a=r++;i({...n,confirm:{...t,id:a,message:e,resolve:e=>{n.confirm?.id===a&&i({...n,confirm:null}),o(e)}}})}))},"p",0,a,"M",0,function(e){return o.add(e),e(n),()=>{o.delete(e)}},"c",0,l],294114);var u=e.i(869253);class c extends Error{status;statusText;data;constructor(e,t,n){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=n,this.name="ApiError"}}function f(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}l.warning(u.f[t].errors.AI_DAILY_LIMIT_EXCEEDED)}let d=e=>new Promise(t=>setTimeout(t,e));async function m(e,t,n){let r=Date.now();for(;Date.now()<t;){let t=null;try{t=await p(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof c&&404===e.status&&Date.now()-r>6e3)throw n}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&f(t.body),new c(t.status,"",t.body)}await d(3e3)}throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function p(e,t={}){let n,{params:r,headers:o,timeout:i=6e4,recoverable:a,...s}=t,l=a?(n=new Uint8Array(16),crypto.getRandomValues(n),Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")):null,u=Date.now(),d=e;if(r){let e=new URLSearchParams(r);d+=`?${e.toString()}`}let g=new AbortController,h=setTimeout(()=>g.abort(),i);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...l?{"X-Request-Id":l}:{},...o},signal:g.signal,...s});if(clearTimeout(h),!e.ok){let t;try{t=await e.json()}catch{t=await e.text()}throw 429===e.status&&f(t),new c(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(h),e instanceof Error&&"AbortError"===e.name)throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(l&&e instanceof TypeError)return m(l,u+i,e);throw e}}e.s(["f",0,{get:(e,t)=>p(e,{...t,method:"GET"}),post:(e,t,n)=>p(e,{...n,method:"POST",body:JSON.stringify(t)}),put:(e,t,n)=>p(e,{...n,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,n)=>p(e,{...n,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>p(e,{...t,method:"DELETE"})}],41931)},303163,e=>{e.s(["d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},201276,e=>{let t=new class{buffer=[];flushTimer=null;addToBuffer(e,t,n,r){let o={level:e,prefix:t,message:n,context:r?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t instanceof Error?{name:t.name,message:t.message}:t])):r,timestamp:new Date().toISOString(),url:window.location.href,userAgent:"u">typeof navigator?navigator.userAgent:""};(this.buffer.push(o),this.buffer.length>=20)?this.flush():this.scheduleFlush()}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},1e3))}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),0===this.buffer.length)return;let e=[...this.buffer];this.buffer=[],this.sendBatch(e)}async sendBatch(e){try{fetch("/api/logs/frontend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({logs:e})}).catch(e=>{console.warn("Failed to send logs to backend:",e)})}catch{}}info(e,t,n,r={}){console.log(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("info",e,t,n)}warn(e,t,n,r={}){console.warn(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("warn",e,t,n)}error(e,t,n,r={}){console.error(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("error",e,t,n)}forceFlush(){this.flush()}};e.s(["f",0,t])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,n=(e,n)=>t(e,"name",{value:n,configurable:!0}),r=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:r=!0}={}){return n(function(n){if(e?.(n),!1===r||!n||!n.defaultPrevented)return t?.(n)},"handleEvent")}function i(e){if(!r)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function a(e){return"IFRAME"===e.tagName}n(o,"composeEventHandlers"),n(function(e){if(!r)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),n(i,"getOwnerDocument"),n(function e(t,n=!1){let{activeElement:r}=i(t);if(!r?.nodeName)return null;if(a(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=i(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),n(a,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},30030,e=>{var t=e.i(271645),n=e.i(843476),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,r=[]){let s=[];function l(r,i){let a=t.createContext(i);a.displayName=r+"Context";let l=s.length;s=[...s,i];let u=o(r=>{let{scope:o,children:i,...s}=r,u=o?.[e]?.[l]||a,c=t.useMemo(()=>s,Object.values(s));return(0,n.jsx)(u.Provider,{value:c,children:i})},"Provider");function c(n,o,s={}){let{optional:u=!1}=s,f=o?.[e]?.[l]||a,d=t.useContext(f);if(d)return d;if(void 0!==i)return i;if(!u)throw Error(`\`${n}\` must be used within \`${r}\``)}return u.displayName=r+"Provider",o(c,"useContext"),[u,c]}o(l,"createContext");let u=o(()=>{let n=s.map(e=>t.createContext(e));return o(function(r){let o=r?.[e]||n;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])},"useScope")},"createScope");return u.scopeName=e,[l,a(u,...r)]}function a(...e){let n=e[0];if(1===e.length)return n;let r=o(()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=r.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=n.scopeName,r}o(function(e,r){let i=t.createContext(r);i.displayName=e+"Context";let a=o(e=>{let{children:r,...o}=e,a=t.useMemo(()=>o,Object.values(o));return(0,n.jsx)(i.Provider,{value:a,children:r})},"Provider");function s(n,o={}){let{optional:a=!1}=o,l=t.useContext(i);if(l)return l;if(void 0!==r)return r;if(!a)throw Error(`\`${n}\` must be used within \`${e}\``)}return a.displayName=e+"Provider",o(s,"useContext"),[a,s]},"createContext"),o(i,"createContextScope"),o(a,"composeContextScopes"),e.s(["f",0,i])},296626,e=>{var t=e.i(271645),n=e.i(934620),r=Object.defineProperty,o=(e,t)=>r(e,"name",{value:t,configurable:!0});function i(e,n){return t.useReducer((e,t)=>n[e][t]??e,e)}o(i,"useStateMachine");var a=o(e=>{let{present:n,children:r}=e,o=s(n),i="function"==typeof r?r({present:o.isPresent}):t.Children.only(r),a=u(o.ref,f(i));return"function"==typeof r||o.isPresent?t.cloneElement(i,{ref:a}):null},"Presence");function s(e){let[r,a]=t.useState(),s=t.useRef(null),l=t.useRef(e),u=t.useRef("none"),f=t.useRef(void 0),[d,m]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(u.current=f.current??c(s.current),f.current=void 0):u.current="none"},[d]),(0,n.f)(()=>{let t=s.current,n=l.current;if(n!==e){let r=u.current,o=c(t);e?(f.current=o,m("MOUNT")):"none"===o||t?.display==="none"?m("UNMOUNT"):n&&r!==o?m("ANIMATION_OUT"):m("UNMOUNT"),l.current=e}},[e,m]),(0,n.f)(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=o(n=>{let o=c(s.current).includes(CSS.escape(n.animationName));if(n.target===r&&o&&(m("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},"handleAnimationEnd"),i=o(e=>{e.target===r&&(u.current=c(s.current))},"handleAnimationStart");return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,f.current=c(t)}else s.current=null;a(e)},[])}}function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u(...e){let n=t.useRef(e);return n.current=e,t.useCallback(e=>{let t=n.current,r=!1,o=t.map(t=>{let n=l(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let n=o[e];"function"==typeof n?n():l(t[e],null)}}},[])}function c(e){return e?.animationName||"none"}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(s,"usePresence"),o(l,"setRef"),o(u,"useStableComposedRefs"),o(c,"getAnimationName"),o(f,"getElementRef"),e.s(["f",0,a])},248425,e=>{var t=e.i(271645),n=e.i(174080),r=e.i(991918),o=e.i(843476),i=Object.defineProperty,a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let i=(0,r.B)(`Primitive.${n}`),a=t.forwardRef((e,t)=>{let{asChild:r,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(r?i:n,{...a,ref:t})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function s(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}i(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,a,"u",0,s])},369340,e=>{var t=e.i(271645),n=e.i(705844),r=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],a=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof i)return i(e);let n=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof a?a(()=>{n.current=e}):(0,r.f)(()=>{n.current=e}),t.useMemo(()=>(...e)=>n.current?.(...e),[])}o(s,"name",{value:"useEffectEvent",configurable:!0});var l=Object.defineProperty,u=(e,t)=>l(e,"name",{value:t,configurable:!0}),c=t[" useInsertionEffect ".trim().toString()]||r.f;function f({prop:e,defaultProp:r,onChange:o=u(()=>{},"onChange"),caller:i}){let[a,s,l]=d({defaultProp:r,onChange:o}),c=void 0!==e,p=c?e:a;if(n.f){let n=t.useRef(void 0!==e);t.useEffect(()=>{let e=n.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=c},[c,i])}return[p,t.useCallback(t=>{if(c){let n=m(t)?t(e):t;n!==e&&l.current?.(n)}else s(t)},[c,e,s,l])]}function d({defaultProp:e,onChange:n}){let[r,o]=t.useState(e),i=t.useRef(r),a=t.useRef(n);return c(()=>{a.current=n},[n]),t.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}function m(e){return"function"==typeof e}u(f,"useControllableState"),u(d,"useUncontrolledState"),u(m,"isFunction");var p=Symbol("RADIX:SYNC_STATE");u(function(e,r,o,i){let{prop:a,defaultProp:l,onChange:u,caller:c}=r,f=void 0!==a,d=s(u);if(n.f){let e=t.useRef(void 0!==a);t.useEffect(()=>{let t=e.current;if(t!==f){let e=f?"controlled":"uncontrolled";console.warn(`${c} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=f},[f,c])}let m=[{...o,state:l}];i&&m.push(i);let[g,h]=t.useReducer((t,n)=>{if(n.type===p)return{...t,state:n.state};let r=e(t,n);return f&&!Object.is(r.state,t.state)&&d(r.state),r},...m),w=g.state,b=t.useRef(w);t.useEffect(()=>{b.current!==w&&(b.current=w,f||d(w))},[w,b,f]);let y=t.useMemo(()=>void 0!==a?{...g,state:a}:g,[g,a]);return t.useEffect(()=>{f&&!Object.is(a,g.state)&&h({type:p,state:a})},[a,g.state,f]),[y,h]},"useControllableStateReducer"),e.s(["f",0,f],369340)},934620,e=>{var t=e.i(271645),n=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,n])},635804,e=>{var t=e.i(271645),n=e.i(934620);function r(e){let[r,o]=t.useState(void 0);return(0,n.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,n=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let r=n[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,n;if("borderBoxSize"in r){let e=r.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,n=o.blockSize}else t=e.offsetWidth,n=e.offsetHeight;o({width:t,height:n})})});return n.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}o(void 0)},[e]),r}(0,Object.defineProperty)(r,"name",{value:"useSize",configurable:!0}),e.s(["f",0,r])},475254,e=>{var t=e.i(271645);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:l,iconNode:u,...c},f)=>(0,t.createElement)("svg",{ref:f,...o,width:n,height:n,stroke:e,strokeWidth:a?24*Number(i)/Number(n):i,className:r("lucide",s),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(l)?l:[l]]));e.s(["f",0,(e,o)=>{let a=(0,t.forwardRef)(({className:a,...s},l)=>(0,t.createElement)(i,{ref:l,iconNode:o,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...s}));return a.displayName=n(e),a}],475254)},643531,e=>{let t=(0,e.i(475254).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,t],643531)},531278,e=>{let t=(0,e.i(475254).f)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["f",0,t],531278)},37727,e=>{let t=(0,e.i(475254).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},776639,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(981140),o=e.i(820783),i=e.i(30030),a=e.i(610772),s=e.i(369340),l=e.i(726330),u=e.i(765491),c=e.i(774606),f=e.i(296626),d=e.i(248425),m=e.i(303536),p=e.i(934620),g=e.i(985369),h=e.i(186312),w=e.i(991918),b=Object.defineProperty,y=(e,t)=>b(e,"name",{value:t,configurable:!0}),v="Dialog",[x,D]=(0,i.f)(v),[E,N]=x(v),C=y(e=>{let{__scopeDialog:r,children:o,open:i,defaultOpen:l,onOpenChange:c,modal:f=!0}=e,d=n.useRef(null),m=n.useRef(null),{nodes:p,registry:g}=(0,u.D)(),[h,w]=(0,s.f)({prop:i,defaultProp:l??!1,onChange:c,caller:v}),[b,y]=n.useState(0),[x,D]=n.useState(0);return(0,t.jsx)(E,{scope:r,triggerRef:d,contentRef:m,contentId:(0,a.f)(),titleId:(0,a.f)(),descriptionId:(0,a.f)(),titlePresent:b>0,descriptionPresent:x>0,setTitleCount:y,setDescriptionCount:D,open:h,onOpenChange:w,onOpenToggle:n.useCallback(()=>w(e=>!e),[w]),modal:f,branchNodes:p,branchRegistry:g,children:o})},"Dialog"),O=n.forwardRef(y(function(e,n){let{__scopeDialog:i,...a}=e,s=N("DialogTrigger",i),l=(0,o.f)(n,s.triggerRef);return(0,t.jsx)(d.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":W(s.open),...a,ref:l,onClick:(0,r.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),j="DialogPortal",[R,T]=x(j,{forceMount:void 0}),S=y(e=>{let{__scopeDialog:r,forceMount:o,children:i,container:a}=e,s=N(j,r);return(0,t.jsx)(R,{scope:r,forceMount:o,children:n.Children.map(i,e=>(0,t.jsx)(f.f,{present:o||s.open,children:(0,t.jsx)(c.f,{asChild:!0,container:a,children:e})}))})},"DialogPortal"),A="DialogOverlay",P=n.forwardRef(y(function(e,n){let r=T(A,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=N(A,e.__scopeDialog);return a.modal?(0,t.jsx)(f.f,{present:o||a.open,children:(0,t.jsx)(M,{...i,ref:n})}):null},"DialogOverlay")),I=(0,w.B)("DialogOverlay.RemoveScroll"),M=n.forwardRef(y(function(e,r){let{__scopeDialog:i,...a}=e,s=N(A,i),u=(0,l.y)(),c=(0,o.f)(r,u);return(0,t.jsx)(g.f,{as:I,allowPinchZoom:!0,shards:n.useMemo(()=>[s.contentRef,...s.branchNodes.map(e=>({current:e}))],[s.contentRef,s.branchNodes]),children:(0,t.jsx)(d.V.div,{"data-state":W(s.open),...a,ref:c,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),_="DialogContent",k=n.forwardRef(y(function(e,n){let r=T(_,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,a=N(_,e.__scopeDialog);return(0,t.jsx)(f.f,{present:o||a.open,children:a.modal?(0,t.jsx)($,{...i,ref:n}):(0,t.jsx)(F,{...i,ref:n})})},"DialogContent")),$=n.forwardRef(y(function(e,i){let a=N(_,e.__scopeDialog),s=n.useRef(null),l=(0,o.f)(i,a.contentRef,s);return n.useEffect(()=>{let e=s.current;if(e)return(0,h.f)(e)},[]),(0,t.jsx)(U,{...e,ref:l,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:(0,r.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,r.f)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),F=n.forwardRef(y(function(e,r){let o=N(_,e.__scopeDialog),i=n.useRef(!1),a=n.useRef(!1);return(0,t.jsx)(U,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),U=n.forwardRef(y(function(e,n){let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":s,children:c,...f}=e,d=N(_,r);return(0,m.f)(),(0,t.jsx)(u.l,{registry:d.branchRegistry,children:(0,t.jsx)(u.v,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,t.jsx)(l.V,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?V(s,d.descriptionId):s,"data-state":W(d.open),...f,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),L=n.forwardRef(y(function(e,n){let{__scopeDialog:r,...o}=e,i=N("DialogTitle",r),{setTitleCount:a}=i;return(0,p.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.h2,{id:i.titleId,...o,ref:n})},"DialogTitle")),B=n.forwardRef(y(function(e,n){let{__scopeDialog:r,...o}=e,i=N("DialogDescription",r),{setDescriptionCount:a}=i;return(0,p.f)(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,t.jsx)(d.V.p,{id:i.descriptionId,...o,ref:n})},"DialogDescription")),z=n.forwardRef(y(function(e,n){let{__scopeDialog:o,...i}=e,a=N("DialogClose",o);return(0,t.jsx)(d.V.button,{type:"button",...i,ref:n,onClick:(0,r.f)(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function V(...e){let t=new Set;for(let n of e)if("string"==typeof n)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(" "):void 0}function W(e){return e?"open":"closed"}y(V,"concatAriaDescribedby"),y(W,"getState");var X=e.i(37727),q=e.i(975157);let H=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(P,{ref:r,className:(0,q.f)("fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));H.displayName=P.displayName;let J=n.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(S,{children:[(0,t.jsx)(H,{}),(0,t.jsxs)(k,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,q.f)("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border bg-card p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r,children:[n,(0,t.jsxs)(z,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(X.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));J.displayName=k.displayName;let Z=({className:e,...n})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Z.displayName="DialogHeader";let K=({className:e,...n})=>(0,t.jsx)("div",{className:(0,q.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});K.displayName="DialogFooter";let Y=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(L,{ref:r,className:(0,q.f)("text-lg font-semibold leading-none tracking-tight",e),...n}));Y.displayName=L.displayName;let G=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(B,{ref:r,className:(0,q.f)("text-sm text-muted-foreground",e),...n}));G.displayName=B.displayName,e.s(["N",0,C,"d",0,J,"C",0,G,"c",0,K,"s",0,Z,"F",0,Y,"a",0,O],776639)},793479,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({className:e,type:r,...o}){return(0,t.jsx)("input",{type:r,"data-slot":"input",className:(0,n.f)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}])},110204,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(248425),o=Object.defineProperty,i=n.forwardRef(o(function(e,n){return(0,t.jsx)(r.V.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),a=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)(i,{"data-slot":"label",className:(0,a.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}],110204)},41931,294114,e=>{let t={success:2500,info:3500,warning:4500,error:5e3},n={toasts:[],confirm:null},r=1,o=new Set;function i(e){n=e,o.forEach(e=>e(n))}function a(e){i({...n,toasts:n.toasts.filter(t=>t.id!==e)})}function s(e,o){let s="string"==typeof o?o:String(o??"");if(!s)return;let l=r++;i({...n,toasts:[...n.toasts.slice(-3),{id:l,type:e,message:s}]}),setTimeout(()=>a(l),t[e])}let l={success:e=>s("success",e),error:e=>s("error",e),info:e=>s("info",e),warning:e=>s("warning",e)};e.s(["u",0,function(e,t={}){return 0===o.size?Promise.resolve("function"==typeof window.confirm&&window.confirm(e)):(n.confirm?.resolve(!1),new Promise(o=>{let a=r++;i({...n,confirm:{...t,id:a,message:e,resolve:e=>{n.confirm?.id===a&&i({...n,confirm:null}),o(e)}}})}))},"p",0,a,"M",0,function(e){return o.add(e),e(n),()=>{o.delete(e)}},"c",0,l],294114);var u=e.i(869253);class c extends Error{status;statusText;data;constructor(e,t,n){super(`API Error: ${e} ${t}`),this.status=e,this.statusText=t,this.data=n,this.name="ApiError"}}function f(e){if("object"!=typeof e||null===e||!("code"in e)||"AI_DAILY_LIMIT_EXCEEDED"!==e.code)return;let t="zh";try{"en"===localStorage.getItem("app-language")&&(t="en")}catch{}l.warning(u.f[t].errors.AI_DAILY_LIMIT_EXCEEDED)}let d=e=>new Promise(t=>setTimeout(t,e));async function m(e,t,n){let r=Date.now();for(;Date.now()<t;){let t=null;try{t=await p(`/api/requests/${e}`,{method:"GET",timeout:15e3})}catch(e){if(e instanceof c&&404===e.status&&Date.now()-r>6e3)throw n}if(t?.state==="done"){if(t.status>=200&&t.status<300)return t.body??{};throw 429===t.status&&f(t.body),new c(t.status,"",t.body)}await d(3e3)}throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"})}async function p(e,t={}){let n,{params:r,headers:o,timeout:i=6e4,recoverable:a,...s}=t,l=a?(n=new Uint8Array(16),crypto.getRandomValues(n),Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")):null,u=Date.now(),d=e;if(r){let e=new URLSearchParams(r);d+=`?${e.toString()}`}let g=new AbortController,h=setTimeout(()=>g.abort(),i);try{let e=await fetch(d,{headers:{"Content-Type":"application/json",...l?{"X-Request-Id":l}:{},...o},signal:g.signal,...s});if(clearTimeout(h),!e.ok){let t;try{t=await e.json()}catch{t=await e.text()}throw 429===e.status&&f(t),new c(e.status,e.statusText,t)}if(204===e.status)return{};try{return await e.json()}catch{return{}}}catch(e){if(clearTimeout(h),e instanceof Error&&"AbortError"===e.name)throw new c(408,"Request Timeout",{message:"AI_TIMEOUT_ERROR"});if(l&&e instanceof TypeError)return m(l,u+i,e);throw e}}e.s(["f",0,{get:(e,t)=>p(e,{...t,method:"GET"}),post:(e,t,n)=>p(e,{...n,method:"POST",body:JSON.stringify(t)}),put:(e,t,n)=>p(e,{...n,method:"PUT",body:JSON.stringify(t)}),patch:(e,t,n)=>p(e,{...n,method:"PATCH",body:JSON.stringify(t)}),delete:(e,t)=>p(e,{...t,method:"DELETE"})}],41931)},303163,e=>{e.s(["L",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"details"in t)return"string"==typeof t.details&&t.details?t.details:void 0},"d",0,function(e){if("object"!=typeof e||null===e||!("data"in e))return;let{data:t}=e;if("object"==typeof t&&null!==t&&"message"in t)return"string"==typeof t.message?t.message:void 0},"Z",0,function(e){return e instanceof Error?e.message:String(e)}])},201276,e=>{let t=new class{buffer=[];flushTimer=null;addToBuffer(e,t,n,r){let o={level:e,prefix:t,message:n,context:r?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,t instanceof Error?{name:t.name,message:t.message}:t])):r,timestamp:new Date().toISOString(),url:window.location.href,userAgent:"u">typeof navigator?navigator.userAgent:""};(this.buffer.push(o),this.buffer.length>=20)?this.flush():this.scheduleFlush()}scheduleFlush(){this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},1e3))}flush(){if(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),0===this.buffer.length)return;let e=[...this.buffer];this.buffer=[],this.sendBatch(e)}async sendBatch(e){try{fetch("/api/logs/frontend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({logs:e})}).catch(e=>{console.warn("Failed to send logs to backend:",e)})}catch{}}info(e,t,n,r={}){console.log(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("info",e,t,n)}warn(e,t,n,r={}){console.warn(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("warn",e,t,n)}error(e,t,n,r={}){console.error(`${e} ${t}`,n||""),!1!==r.sendToBackend&&this.addToBuffer("error",e,t,n)}forceFlush(){this.flush()}};e.s(["f",0,t])}])})();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},303281,e=>{let t=(0,e.i(475254).f)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);e.s(["f",0,t],303281)},580685,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(440160),i=e.i(303281),r=e.i(519455),l=e.i(257428),o=e.i(590546),c=e.i(511445),d=e.i(149704),m=e.i(111110),x=e.i(35209),u=e.i(41931);let h=`
|
|
2
|
+
.exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
|
|
3
|
+
.exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
|
|
4
|
+
.exam-sheet .exam-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; font-size: 14px; margin-bottom: 20px; }
|
|
5
|
+
.exam-sheet .exam-meta span { min-width: 120px; }
|
|
6
|
+
.exam-sheet .exam-question { break-inside: avoid; page-break-inside: avoid; padding: 12px 0; border-bottom: 1px dashed #ccc; }
|
|
7
|
+
.exam-sheet .exam-question-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
|
|
8
|
+
.exam-sheet .exam-source { font-family: ui-monospace, Menlo, monospace; font-weight: 400; font-size: 12px; color: #666; white-space: nowrap; }
|
|
9
|
+
.exam-sheet .exam-answer-space { min-height: 120px; }
|
|
10
|
+
.exam-sheet .exam-answer-key { break-before: page; page-break-before: always; padding-top: 8px; }
|
|
11
|
+
.exam-sheet .exam-answer-key h2 { text-align: center; font-size: 18px; margin: 0 0 12px; }
|
|
12
|
+
.exam-sheet .exam-label { font-weight: 600; color: #444; }
|
|
13
|
+
.exam-sheet .markdown-content p { margin: 4px 0; }
|
|
14
|
+
.exam-sheet .markdown-content img { max-width: 100%; }
|
|
15
|
+
.exam-sheet .question-figure { margin: 8px 0; break-inside: avoid; page-break-inside: avoid; }
|
|
16
|
+
.exam-sheet .question-figure img { display: block; margin: 0 auto; max-width: 100%; max-height: 360px; background: #fff; }
|
|
17
|
+
.exam-sheet .markdown-content table { border-collapse: collapse; }
|
|
18
|
+
.exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
|
|
19
|
+
@media print { .exam-sheet { padding: 0; max-width: none; } @page { size: A4; margin: 15mm; } }
|
|
20
|
+
`;function f(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}e.s(["default",0,function(){let e=(0,n.useParams)(),{t:p,language:g}=(0,m.b)(),[b,k]=(0,a.useState)(null);(0,x.f)(p.exam.title,b?.title,p.pageTitle.examPrint);let[j,w]=(0,a.useState)(!0),y=(0,a.useRef)(null);if((0,a.useEffect)(()=>{u.f.get(`/api/exams/${e.id}`).then(k).catch(()=>k(null))},[e.id]),!b)return(0,t.jsx)("div",{className:"p-8 text-center",children:p.common.loading});let v=b.questions.filter(e=>"ready"===e.status&&e.questionText);return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:h}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(o.f,{fallbackUrl:`/exams/${b.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:p.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(l.f,{checked:j,onCheckedChange:e=>w(!0===e)}),p.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!y.current)return;let t=function(e,t,a="zh-CN"){return`<!doctype html>
|
|
21
|
+
<html lang="${f(a)}">
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="utf-8">
|
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
25
|
+
<title>${f(e)}</title>
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.1/dist/katex.min.css">
|
|
27
|
+
<style>body { margin: 0; background: #fff; }${h}</style>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
${t}
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
33
|
+
`}(b.title,y.current.outerHTML,"en"===g?"en":"zh-CN"),a=URL.createObjectURL(new Blob([t],{type:"text/html;charset=utf-8"})),n=document.createElement("a");n.href=a,e=b.title,n.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,n.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),p.exam.downloadHtml]}),(0,t.jsxs)(r.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),p.exam.printNow]})]}),v.length<b.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:p.exam.notReadyHint})]})}),(0,t.jsxs)("div",{ref:y,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:b.title}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[p.exam.nameLine,p.common.colon,"________"]}),(0,t.jsxs)("span",{children:[p.exam.dateLine,p.common.colon,"________"]}),(0,t.jsxs)("span",{children:[p.exam.scoreLine,p.common.colon,"________"]})]}),v.map((e,a)=>(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[p.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(c.f,{content:e.questionText}),(0,t.jsx)(d.f,{svg:e.figureSvg}),(0,t.jsx)("div",{className:"exam-answer-space"})]},e.id)),j&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:p.exam.answerKey}),v.map((e,a)=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[p.exam.sourceLabel,": ",e.sourceShortId]})]}),e.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[p.exam.answerLabel,p.common.colon]}),(0,t.jsx)(c.f,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[p.exam.analysisLabel,p.common.colon]}),(0,t.jsx)(c.f,{content:e.analysis})]})]},e.id))]})]})]})}],580685)},149704,e=>{var t=e.i(843476),a=e.i(111110),n=e.i(975157);e.s(["f",0,function({svg:e,className:s}){let{t:i}=(0,a.b)();return e?(0,t.jsx)("figure",{className:(0,n.f)("question-figure my-3",s),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:i.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},590546,e=>{var t=e.i(843476),a=e.i(618566),n=e.i(519455),s=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:i}){let r=(0,a.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(820783),s=e.i(30030),i=e.i(981140),r=e.i(369340),l=e.i(635804),o=e.i(296626),c=e.i(248425),d=Object.defineProperty,m=(e,t)=>d(e,"name",{value:t,configurable:!0}),x="Checkbox",[u,h]=(0,s.f)(x),[f,p]=u(x);function g(e){let{__scopeCheckbox:n,checked:s,children:i,defaultChecked:l,disabled:o,form:c,name:d,onCheckedChange:m,required:u,value:h="on",internal_do_not_use_render:p}=e,[g,b]=(0,r.f)({prop:s,defaultProp:l??!1,onChange:m,caller:x}),[k,j]=a.useState(null),[w,N]=a.useState(null),[C,_]=a.useState(null),R=!k||!!c||!!k.closest("form"),q={checked:g,disabled:o,setChecked:b,control:k,setControl:j,name:d,form:c,value:h,userClick:C,onUserClick:_,required:u,defaultChecked:!v(l)&&l,isFormControl:R,bubbleInput:w,setBubbleInput:N};return(0,t.jsx)(f,{scope:n,...q,children:y(p)?p(q):i})}m(g,"CheckboxProvider");var b=a.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:s,onClick:r,...l},o){let{control:d,value:x,disabled:u,checked:h,required:f,setControl:g,setChecked:b,onUserClick:k,isFormControl:j,bubbleInput:w}=p("CheckboxTrigger",e),y=(0,n.f)(o,g),C=a.useRef(h);return a.useEffect(()=>{let e=d?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":v(h)?"mixed":h,"aria-required":f,"data-state":N(h),"data-disabled":u?"":void 0,disabled:u,value:x,...l,ref:y,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(r,e=>{let t=e.isPropagationStopped();k({requestedChecked:!!v(h)||!h,hasConsumerStoppedPropagation:t}),b(e=>!!v(e)||!e),w&&j&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),k=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,name:s,checked:i,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...x}=e;return(0,t.jsx)(g,{__scopeCheckbox:n,checked:i,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...x,ref:a,__scopeCheckbox:n}),e&&(0,t.jsx)(w,{__scopeCheckbox:n})]})})},"Checkbox")),j=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,forceMount:s,...i}=e,r=p("CheckboxIndicator",n);return(0,t.jsx)(o.f,{present:s||v(r.checked)||!0===r.checked,children:(0,t.jsx)(c.V.span,{"data-state":N(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),w=a.forwardRef(m(function({__scopeCheckbox:e,onClick:s,...r},o){let{control:d,userClick:m,checked:x,defaultChecked:u,required:h,disabled:f,name:g,value:b,form:k,bubbleInput:j,setBubbleInput:w}=p("CheckboxBubbleInput",e),y=(0,n.f)(o,w),N=(0,l.f)(d),C=a.useRef(!1),_=a.useRef(x),R=a.useRef(m),q=a.useRef(null);a.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=_.current!==x;_.current=x;let a=null!==m&&m!==R.current;if(R.current=m,a)q.current=t?null:m,t&&(j.indeterminate=v(x),e.call(j,!v(x)&&x)),j.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=q.current;q.current=null;let a=t?.requestedChecked===x;C.current=!0,j.indeterminate=v(x),e.call(j,!v(x)&&x),j.dispatchEvent(new Event("click",{bubbles:!(a&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[j,x,m]);let E=a.useRef(!v(x)&&x);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??E.current,required:h,disabled:f,name:g,value:b,form:k,...r,tabIndex:-1,ref:y,onClick:(0,i.f)(s,e=>{C.current&&e.stopPropagation()}),style:{...r.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function v(e){return"indeterminate"===e}function N(e){return v(e)?"indeterminate":e?"checked":"unchecked"}m(y,"isFunction"),m(v,"isIndeterminate"),m(N,"getState");var C=e.i(643531),_=e.i(975157);let R=a.forwardRef(({className:e,...a},n)=>(0,t.jsx)(k,{ref:n,className:(0,_.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...a,children:(0,t.jsx)(j,{className:(0,_.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));R.displayName=k.displayName,e.s(["f",0,R],257428)},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,a.b)(),s=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])}])})();
|