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
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[298876,e=>{let n={minimax:{name:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn"},glm:{name:"智谱 GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn"},deepseek:{name:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com"},kimi:{name:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com"}},i=Object.keys(n);e.s(["$",0,n,"U",0,i,"j",0,function(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(n,e)},"k",0,function(e,i){let t=n[e];return{apiKey:i?.apiKey||"",baseUrl:i?.baseUrl||t.baseUrl,model:i?.model||t.model}}])},798003,e=>{let n;var i,t=e.i(522734),o=e.i(814747),r=e.i(50377),a=e.i(376025),s=e.i(298876);let c=(0,r.f)("config"),p=o.default.join(process.env.CONFIG_DIR||o.default.join(process.cwd(),"config"),"app-config.json"),m={aiProvider:process.env.AI_PROVIDER||"minimax",allowRegistration:"true"===process.env.ALLOW_REGISTRATION,aiDailyLimit:Number.isInteger(n="number"==typeof(i=process.env.AI_DAILY_LIMIT)?i:Number(i))&&n>0?n:0,timeZone:a.J,openai:{instances:process.env.OPENAI_API_KEY?[{id:"env-default",name:"Default (ENV)",apiKey:process.env.OPENAI_API_KEY,baseUrl:process.env.OPENAI_BASE_URL||"https://api.openai.com/v1",model:process.env.OPENAI_MODEL||"gpt-6.1-sol"}]:[],activeInstanceId:process.env.OPENAI_API_KEY?"env-default":void 0},gemini:{apiKey:process.env.GOOGLE_API_KEY,baseUrl:process.env.GEMINI_BASE_URL,model:process.env.GEMINI_MODEL||"gemini-2.5-flash"},azure:{apiKey:process.env.AZURE_OPENAI_API_KEY,endpoint:process.env.AZURE_OPENAI_ENDPOINT,deploymentName:process.env.AZURE_OPENAI_DEPLOYMENT,apiVersion:process.env.AZURE_OPENAI_API_VERSION||"2024-02-15-preview",model:process.env.AZURE_OPENAI_MODEL||"gpt-4o"},anthropic:{apiKey:process.env.ANTHROPIC_API_KEY,baseUrl:process.env.ANTHROPIC_BASE_URL,model:process.env.ANTHROPIC_MODEL||"claude-sonnet-5-5"},minimaxCode:{model:process.env.MINIMAX_CODE_MODEL,autoCheckin:"false"!==process.env.MINIMAX_CODE_AUTO_CHECKIN},...Object.fromEntries(s.U.map(e=>{let n=s.$[e].envPrefix;return[e,{apiKey:process.env[`${n}_API_KEY`],baseUrl:process.env[`${n}_BASE_URL`],model:process.env[`${n}_MODEL`]}]})),prompts:{analyze:"",similar:""},timeouts:{analyze:18e4}};function l(e,n){return Object.fromEntries(s.U.map(i=>[i,{...e[i],...n[i]}]))}function I(e){let n=`${p}.${process.pid}.tmp`;t.default.writeFileSync(n,JSON.stringify(e,null,2)),t.default.renameSync(n,p)}function d(){let e;try{e=function(){try{return t.default.readFileSync(p,"utf-8")}catch(e){if(e?.code==="ENOENT")return null;throw e}}()}catch(e){return c.error({error:e},"Failed to read config file"),m}if(null!==e)try{var n;let i=JSON.parse(e),t=i.openai;if((n=i.openai)&&"object"==typeof n&&"apiKey"in n&&!("instances"in n)){c.info("Detected legacy OpenAI config, migrating to multi-instance format..."),t=function(e){if(!e.apiKey)return{instances:[],activeInstanceId:void 0};let n={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)}),name:"Default",apiKey:e.apiKey,baseUrl:e.baseUrl||"https://api.openai.com/v1",model:e.model||"gpt-6.1-sol"};return{instances:[n],activeInstanceId:n.id}}(i.openai);let e={...i,openai:t};I(e),c.info("Legacy OpenAI config migrated successfully")}return{...m,...i,timeZone:(0,a.L)(i.timeZone)?i.timeZone.trim():a.J,openai:{instances:t?.instances||m.openai?.instances||[],activeInstanceId:t?.activeInstanceId||m.openai?.activeInstanceId},gemini:{...m.gemini,...i.gemini},azure:{...m.azure,...i.azure},anthropic:{...m.anthropic,...i.anthropic},minimaxCode:{...m.minimaxCode,...i.minimaxCode},...l(m,i),prompts:{...m.prompts,...i.prompts},timeouts:{...m.timeouts,...i.timeouts}}}catch(e){c.error({error:e},"Failed to read config file")}return m}e.s(["z",0,function(){let e=d(),n=e.openai?.instances||[],i=e.openai?.activeInstanceId;if(i&&0!==n.length)return n.find(e=>e.id===i)},"b",0,d,"c",0,function(){return d().timeZone||a.J},"r",0,function(e){if(void 0!==e.timeZone&&!(0,a.L)(e.timeZone))throw Error("INVALID_TIME_ZONE");let n=d(),i={...n,...e,timeZone:e.timeZone?.trim()??n.timeZone??a.J,openai:{instances:e.openai?.instances??n.openai?.instances??[],activeInstanceId:e.openai?.activeInstanceId??n.openai?.activeInstanceId},gemini:{...n.gemini,...e.gemini},azure:{...n.azure,...e.azure},anthropic:{...n.anthropic,...e.anthropic},minimaxCode:{...n.minimaxCode,...e.minimaxCode},...l(n,e),prompts:{...n.prompts,...e.prompts},timeouts:{...n.timeouts,...e.timeouts}};try{return I(i),i}catch(e){throw c.error({error:e},"Failed to write config file"),e}}])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=src_lib_05svhzm9a162-._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[452495,a=>{let b=(0,a.i(170106).f)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);a.s(["f",0,b],452495)},431067,a=>{let b=(0,a.i(170106).f)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);a.s(["f",0,b],431067)},220005,563658,a=>{let b=(0,a.i(170106).f)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);a.s(["f",0,b],220005);var c=a.i(187924),d=a.i(572131),e=a.i(507554),f=a.i(470121),g=a.i(750104),h=a.i(225152),i=a.i(3688),j=a.i(30553),k=Object.defineProperty,l=(a,b)=>k(a,"name",{value:b,configurable:!0}),m="Switch",[n,o]=(0,g.f)(m),[p,q]=n(m);function r(a){let{__scopeSwitch:b,checked:e,children:f,defaultChecked:g,disabled:i,form:j,name:k,onCheckedChange:l,required:n,value:o="on",internal_do_not_use_render:q}=a,[r,s]=(0,h.f)({prop:e,defaultProp:g??!1,onChange:l,caller:m}),[t,u]=d.useState(null),[v,x]=d.useState(null),[y,z]=d.useState(null),A=!t||!!j||!!t.closest("form"),B={checked:r,setChecked:s,disabled:i,control:t,setControl:u,name:k,form:j,value:o,userClick:y,onUserClick:z,required:n,defaultChecked:g,isFormControl:A,bubbleInput:v,setBubbleInput:x};return(0,c.jsx)(p,{scope:b,...B,children:w(q)?q(B):f})}l(r,"SwitchProvider");var s=d.forwardRef(l(function({__scopeSwitch:a,onClick:b,...g},h){let{control:i,form:k,value:m,disabled:n,checked:o,required:p,setControl:r,setChecked:s,onUserClick:t,isFormControl:u,bubbleInput:v}=q("SwitchTrigger",a),w=(0,f.f)(h,r),y=d.useRef(o);return d.useEffect(()=>{let a=k?i?.ownerDocument.getElementById(k):i?.form;if(a instanceof HTMLFormElement){let b=l(()=>s(y.current),"reset");return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[i,k,s]),(0,c.jsx)(j.V.button,{type:"button",role:"switch","aria-checked":o,"aria-required":p,"data-state":x(o),"data-disabled":n?"":void 0,disabled:n,value:m,...g,ref:w,onClick:(0,e.f)(b,a=>{let b=a.isPropagationStopped();t({requestedChecked:!o,hasConsumerStoppedPropagation:b}),s(a=>!a),v&&u&&!b&&a.stopPropagation()})})},"SwitchTrigger")),t=d.forwardRef(l(function(a,b){let{__scopeSwitch:d,name:e,checked:f,defaultChecked:g,required:h,disabled:i,value:j,onCheckedChange:k,form:l,...m}=a;return(0,c.jsx)(r,{__scopeSwitch:d,checked:f,defaultChecked:g,disabled:i,required:h,onCheckedChange:k,name:e,form:l,value:j,internal_do_not_use_render:({isFormControl:a})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s,{...m,ref:b,__scopeSwitch:d}),a&&(0,c.jsx)(v,{__scopeSwitch:d})]})})},"Switch")),u=d.forwardRef(l(function(a,b){let{__scopeSwitch:d,...e}=a,f=q("SwitchThumb",d);return(0,c.jsx)(j.V.span,{"data-state":x(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b})},"SwitchThumb")),v=d.forwardRef(l(function({__scopeSwitch:a,onClick:b,...g},h){let{control:k,userClick:l,checked:m,defaultChecked:n,required:o,disabled:p,name:r,value:s,form:t,bubbleInput:u,setBubbleInput:v}=q("SwitchBubbleInput",a),w=(0,f.f)(h,v),x=(0,i.f)(k),y=d.useRef(!1),z=d.useRef(m),A=d.useRef(l),B=d.useRef(null);d.useEffect(()=>{if(!u)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!a)return;let b=z.current!==m;z.current=m;let c=null!==l&&l!==A.current;if(A.current=l,c)B.current=b?null:l,b&&a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!l.hasConsumerStoppedPropagation}));else if(b){let b=B.current;B.current=null;let c=b?.requestedChecked===m;y.current=!0,a.call(u,m),u.dispatchEvent(new Event("click",{bubbles:!(c&&b.hasConsumerStoppedPropagation)})),y.current=!1}},[u,m,l]);let C=d.useRef(m);return(0,c.jsx)(j.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:n??C.current,required:o,disabled:p,name:r,value:s,form:t,...g,tabIndex:-1,ref:w,onClick:(0,e.f)(b,a=>{y.current&&a.stopPropagation()}),style:{...g.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w(a){return"function"==typeof a}function x(a){return a?"checked":"unchecked"}l(w,"isFunction"),l(x,"getState");var y=a.i(368114);let z=d.forwardRef(({className:a,...b},d)=>(0,c.jsx)(t,{className:(0,y.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...b,ref:d,children:(0,c.jsx)(u,{className:(0,y.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));z.displayName=t.displayName,a.s(["f",0,z],563658)},144952,167453,190622,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(170106);let e=(0,d.f)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.s(["f",0,e],167453);var f=a.i(596221),g=a.i(862722);let h=(0,d.f)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var i=a.i(699570),j=a.i(550194);let k={minimax:{name:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn"},glm:{name:"智谱 GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn"},deepseek:{name:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com"},kimi:{name:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com"}},l=Object.keys(k);function m(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(k,a)}a.s(["$",0,k,"U",0,l,"j",0,m],190622);var n=a.i(291938),o=a.i(960927),p=a.i(630534);a.s(["f",0,function({config:a,saving:d,saveButton:k}){let{t:l,language:q}=(0,j.b)(),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=a=>l.settings?.ai?.errors?.[a]||a.replace("UNKNOWN:",""),w=async()=>{let b=function(a,b){let c=a.aiProvider;if("openai"===c){let d=a.openai?.instances?.find(b=>b.id===a.openai?.activeInstanceId);return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===c){let d=a.azure;return d?.apiKey&&d.endpoint&&d.deploymentName?{ok:!0,body:{provider:c,apiKey:d.apiKey,endpoint:d.endpoint,deploymentName:d.deploymentName,apiVersion:d.apiVersion,model:d.model,language:b}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===c)return{ok:!0,body:{provider:c,model:a.minimaxCode?.model,language:b}};if("gemini"===c||"anthropic"===c||m(c)){let d=a[c];return d?.apiKey?{ok:!0,body:{provider:c,apiKey:d.apiKey,baseUrl:d.baseUrl,model:d.model,language:b}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(a,q);if(!b.ok){if("UNSUPPORTED_PROVIDER"===b.error)return;u({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===b.error?l.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":l.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}s(!0),u(null);try{u(await n.f.post("/api/ai/test",b.body))}catch(a){p.f.error("[AiConnectionTest]","AI connection test failed",{error:a}),u({success:!1,textSupport:!1,visionSupport:!1,textError:(0,o.Z)(a)})}finally{s(!1)}};return(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(i.f,{type:"button",variant:"outline",onClick:w,disabled:r||d,className:"flex-1",children:[r?(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(h,{className:"mr-2 h-4 w-4"}),r?l.settings?.ai?.testing||"Testing...":l.settings?.ai?.testConnection||"Test Connection"]}),k]}),t&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${t.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:t.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:l.settings?.ai?.testSuccess||"Connection Successful"}),t.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",t.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.f,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:l.settings?.ai?.testFailed||"Connection Failed"})]})}),t.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[l.settings?.ai?.textSupport||"Text Generation",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",l.settings?.ai?.supported||"Supported"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[l.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),t.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",l.settings?.ai?.supported||"Supported"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",t.visionError?v(t.visionError):l.settings?.ai?.notSupported||"Not Supported"]})]}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:l.settings?.ai?.testNetworkNote})]}),!t.success&&t.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:v(t.textError)})]})]})}],144952)},151304,439830,a=>{var b=a.i(187924),c=a.i(596221),d=a.i(699570),e=a.i(870430),f=a.i(580701),g=a.i(144952),h=a.i(492710),i=a.i(612416),j=a.i(340898),k=a.i(452495),l=a.i(431067),m=a.i(220005),n=a.i(669520),o=a.i(786304),p=a.i(866718),q=a.i(327999),r=a.i(563658),s=a.i(550194),t=a.i(529759),u=a.i(986705);function v({checkin:a,autoCheckin:f,onAutoCheckinChange:g,busy:h,onCheckin:i}){let j,{t:k}=(0,s.b)(),{timeZone:l}=(0,t.M)(),m=k.settings?.ai?.minimaxCode,{today:n,last:p}=a,w=p&&"failed"!==p.status?p:null,x=!!(n?.checkedToday||w),y=String(w?.points??(n?n.points+n.bonusPoints:0)),z=String(w?.streakDays??n?.streakDays??0);return j=w?.trigger==="auto"&&"checked-in"===w.status?(m?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,u.r)(w.at,"HH:mm",l)).replace("{points}",y).replace("{days}",z):x?(m?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",y).replace("{days}",z):p?.status==="failed"?(m?.checkinFailed||"Check-in failed: {error}").replace("{error}",p.error||""):a.autoCheckin?m?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":m?.checkinNotYet||"Not checked in yet today",(0,b.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:m?.checkinToday||"Today's check-in"}),(0,b.jsxs)(o.f,{variant:x?"default":p?.status==="failed"?"destructive":"secondary",children:[(0,b.jsx)(q.f,{className:"mr-1 h-3 w-3"}),x?m?.checkinSuccess||"Checked in":m?.checkinNotYet||"Not yet"]})]}),!x&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:i,disabled:h,children:[h&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),m?.checkinNow||"Check in now"]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:j}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-auto-checkin",children:m?.autoCheckin||"Daily auto check-in"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m?.autoCheckinHint})]}),(0,b.jsx)(r.f,{id:"minimax-code-auto-checkin",checked:f,onCheckedChange:g})]})]})}let w=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var x=a.i(572131),y=a.i(291938),z=a.i(960927),A=a.i(710302),B=a.i(630534);function C({value:a,onChange:f}){let{t:g}=(0,s.b)(),h=g.settings?.ai?.minimaxCode,{status:i,loading:j,pending:q,busy:r,refresh:t,login:u,logout:D,checkin:E}=function(){let{t:a}=(0,s.b)(),b=a.settings?.ai?.minimaxCode,[c,d]=(0,x.useState)(null),[e,f]=(0,x.useState)(!0),[g,h]=(0,x.useState)(null),[i,j]=(0,x.useState)(!1),k=(0,x.useRef)(null),l=(0,x.useCallback)(async()=>{f(!0);try{let a=await y.f.get("/api/minimax-code");d(a),a.pendingLogin&&h(a.pendingLogin)}catch(a){B.f.error("[MiniMaxCode]","Failed to load status",{error:a})}finally{f(!1)}},[]);(0,x.useEffect)(()=>{l()},[l]),(0,x.useEffect)(()=>{if(!g)return;let a=!1,c=async()=>{try{let d=await y.f.get("/api/minimax-code/login");if(a)return;if("pending"===d.status){k.current=setTimeout(c,g.intervalMs);return}h(null),"ok"===d.status?A.c.success(b?.loginSuccess||"Signed in"):"expired"===d.status?A.c.error(b?.loginExpired||"Authorization timed out"):"denied"===d.status&&A.c.error(b?.loginDenied||"Authorization declined"),l()}catch(c){if(a)return;h(null),A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(c)}`)}};return k.current=setTimeout(c,g.intervalMs),()=>{a=!0,k.current&&clearTimeout(k.current)}},[g,l,b]);let m=async()=>{j(!0);try{await y.f.delete("/api/minimax-code"),h(null),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}},n=async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/checkin",{});"failed"===a.status?A.c.error((b?.checkinFailed||"Check-in failed: {error}").replace("{error}",a.error||"")):A.c.success(b?.checkinSuccess||"Checked in"),await l()}catch(a){A.c.error((0,z.Z)(a))}finally{j(!1)}};return{status:c,loading:e,pending:g,busy:i,refresh:l,login:async()=>{j(!0);try{let a=await y.f.post("/api/minimax-code/login",{});h(a),window.open(a.url,"_blank","noopener,noreferrer")}catch(a){A.c.error(`${b?.loginFailed||"Sign-in failed"}: ${(0,z.Z)(a)}`)}finally{j(!1)}},logout:m,checkin:n}}(),F=i?.login??"none",G=i?.account,H=i?.credits,I={none:h?.statusNone||"Not signed in",active:h?.statusActive||"Signed in",expired:h?.statusExpired||"Login expired"}[F];return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.intro}),(0,b.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":h?.title||"MiniMax Code account",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium",children:h?.title||"MiniMax Code account"}),(0,b.jsx)(d.f,{variant:"ghost",size:"sm",onClick:()=>void t(),disabled:j,"aria-label":h?.refresh||"Refresh",children:(0,b.jsx)(n.f,{className:`h-4 w-4 ${j?"animate-spin":""}`})})]}),(0,b.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.loginStatus||"Login status"}),(0,b.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,b.jsx)(o.f,{variant:"active"===F?"default":"expired"===F?"destructive":"secondary",children:I}),G&&(0,b.jsx)("span",{className:"truncate text-muted-foreground",children:G.name||G.email||G.userId})]}),"active"===F&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("dt",{className:"text-muted-foreground",children:h?.credits||"Remaining credits"}),(0,b.jsx)("dd",{children:H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"font-medium tabular-nums",children:H.total}),(0,b.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(h?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(H.free)).replace("{purchased}",String(H.purchased))})]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:h?.creditsUnavailable||"Unavailable"})})]})]}),"active"===F&&i&&(0,b.jsx)(v,{checkin:i.checkin,autoCheckin:a?.autoCheckin!==!1,onAutoCheckinChange:b=>f({...a,autoCheckin:b}),busy:r,onCheckin:()=>void E()}),q?(0,b.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2",children:[(0,b.jsx)(c.f,{className:"h-4 w-4 animate-spin"}),h?.waiting]}),q.userCode&&(0,b.jsxs)("p",{children:[h?.userCode||"Verification code",": ",(0,b.jsx)("span",{className:"font-mono font-medium",children:q.userCode})]}),(0,b.jsxs)("a",{href:q.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[h?.openLink||"Open the authorization page"," ",(0,b.jsx)(k.f,{className:"h-3 w-3"})]})]}):(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)(d.f,{size:"sm",onClick:()=>void u(),disabled:r,children:[r?(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(l.f,{className:"mr-2 h-4 w-4"}),"none"===F?h?.login||"Sign in with browser":h?.relogin||"Sign in again"]}),"none"!==F&&(0,b.jsxs)(d.f,{size:"sm",variant:"outline",onClick:()=>void D(),disabled:r,children:[(0,b.jsx)(m.f,{className:"mr-2 h-4 w-4"}),h?.logout||"Sign out"]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{htmlFor:"minimax-code-model",children:h?.model||"Model"}),(0,b.jsx)(p.f,{id:"minimax-code-model",list:"minimax-code-models",value:a?.model||"",onChange:b=>f({...a,model:b.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,b.jsx)("datalist",{id:"minimax-code-models",children:w.map(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.modelHint})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h?.risk})]})}var D=a.i(915618),E=a.i(781560),F=a.i(175592),G=a.i(152679);function H({value:a,onChange:c}){let{t:g}=(0,s.b)(),h=a?.instances||[],i=a?.activeInstanceId,j=h.find(a=>a.id===i),k=(b,d)=>{c({...a,instances:h.map(a=>a.id===i?{...a,[b]:d}:a)})},l=async()=>{if(!i||!await (0,A.u)(g.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let a=h.filter(a=>a.id!==i);c({instances:a,activeInstanceId:a[0]?.id})};return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(d.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(h.length>=10)return;let a={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${h.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};c({instances:[...h,a],activeInstanceId:a.id})},disabled:h.length>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(D.f,{className:"h-3 w-3 mr-1"}),g.settings?.ai?.addInstance||"Add"]})]}),h.length>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(f.d,{value:i||"",onValueChange:b=>c({...a,activeInstanceId:b}),children:[(0,b.jsx)(f.P,{className:"flex-1",children:(0,b.jsx)(f.U,{placeholder:g.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(f.r,{children:h.map(a=>(0,b.jsx)(f.T,{value:a.id,children:a.name},a.id))})]}),h.length>1&&(0,b.jsx)(d.f,{type:"button",variant:"outline",size:"icon",onClick:l,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),h.length>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:g.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),j&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:j.name||"",onChange:a=>k("name",a.target.value),placeholder:"e.g. 智谱 GLM-4V",className:j.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(G.f,{value:j.apiKey||"",onChange:a=>k("apiKey",a.target.value),placeholder:"sk-...",className:j.apiKey?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(e.f,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(p.f,{value:j.baseUrl||"",onChange:a=>k("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:j.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(F.f,{provider:"openai",apiKey:j.apiKey,baseUrl:j.baseUrl,currentModel:j.model,onModelChange:a=>k("model",a)})]})]})}var I=a.i(190622);function J({provider:a,value:c,onChange:d}){let{t:f}=(0,s.b)(),g=I.$[a],h=(a,b)=>d({...c,[a]:b});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"API Key"}),(0,b.jsx)(G.f,{value:c?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-..."}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:g.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:g.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(p.f,{value:c?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:g.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(F.f,{provider:a,apiKey:c?.apiKey,baseUrl:c?.baseUrl,currentModel:c?.model||g.model,onModelChange:a=>h("model",a)})]})}a.s(["f",0,function({config:a,setConfig:k,loading:l,saving:m,onSave:n}){let{t:o}=(0,s.b)();return l?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(c.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:o.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(f.d,{value:a.aiProvider,onValueChange:a=>k(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(f.P,{children:(0,b.jsx)(f.U,{})}),(0,b.jsxs)(f.r,{children:[(0,b.jsx)(f.T,{value:"minimax",children:I.$.minimax.name}),(0,b.jsx)(f.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),I.U.filter(a=>"minimax"!==a).map(a=>(0,b.jsx)(f.T,{value:a,children:I.$[a].name},a)),(0,b.jsx)(f.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(f.T,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(f.T,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(f.T,{value:"gemini",children:"Google Gemini"})]})]})]}),"openai"===a.aiProvider&&(0,b.jsx)(H,{value:a.openai,onChange:a=>k(b=>({...b,openai:a}))}),"gemini"===a.aiProvider&&(0,b.jsx)(j.f,{value:a.gemini,onChange:a=>k(b=>({...b,gemini:a}))}),"minimax-code"===a.aiProvider&&(0,b.jsx)(C,{value:a.minimaxCode,onChange:a=>k(b=>({...b,minimaxCode:a}))}),"anthropic"===a.aiProvider&&(0,b.jsx)(h.f,{value:a.anthropic,onChange:a=>k(b=>({...b,anthropic:a}))}),(0,I.j)(a.aiProvider)&&(0,b.jsx)(J,{provider:a.aiProvider,value:a[a.aiProvider],onChange:a=>k(b=>({...b,[b.aiProvider]:a}))},a.aiProvider),"azure"===a.aiProvider&&(0,b.jsx)(i.f,{value:a.azure,onChange:a=>k(b=>({...b,azure:a}))}),(0,b.jsx)(g.f,{config:a,saving:m,saveButton:(0,b.jsxs)(d.f,{onClick:n,disabled:m,className:"flex-1",children:[m&&(0,b.jsx)(c.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.settings?.ai?.save||"Save AI Settings"]})})]})}],151304),a.s(["f",0,function(a,b){if(!(0,u.L)(a.timeZone??u.J))return b.settings.general.invalidTimeZone;if("openai"===a.aiProvider)for(let c of a.openai?.instances||[]){if(!c.name?.trim())return b.settings?.ai?.validationNameRequired||"Instance name is required";if(!c.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!c.baseUrl?.trim())return b.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!c.model?.trim())return b.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===a.aiProvider){if(!a.azure?.endpoint?.trim())return b.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!a.azure?.deploymentName?.trim())return b.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!a.azure?.apiKey?.trim())return b.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],439830)},492710,175592,612416,340898,a=>{var b=a.i(187924),c=a.i(866718),d=a.i(152679),e=a.i(870430),f=a.i(572131),g=a.i(699570),h=a.i(580701),i=a.i(669520),j=a.i(596221),k=a.i(291938),l=a.i(550194),m=a.i(190622),n=a.i(630534);function o({provider:a,apiKey:d,baseUrl:p,currentModel:q,onModelChange:r}){let{t:s}=(0,l.b)(),[t,u]=(0,f.useState)([]),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(null),[z,A]=(0,f.useState)(q||""),[B,C]=(0,f.useState)(!1),[D,E]=(0,f.useState)(q);q!==D&&(E(q),A(q||""));let F=async()=>{if(!d)return void y(s.modelSelector?.enterApiKeyFirst||"Please enter API Key first");w(!0),y(null);try{let b=await k.f.post("/api/ai/models",{provider:a,apiKey:d,...p&&{baseUrl:p}});if("error"in b&&"string"==typeof b.error){y(b.error),C(!0),u([]);return}u(b.models),0===b.models.length&&(y(s.modelSelector?.noVisionModel||"No vision model found, please enter manually"),C(!0))}catch(b){n.f.error("[ModelSelector]","Failed to fetch models",{error:b});let a=b instanceof Error&&b.message||s.modelSelector?.fetchFailed||"Failed to fetch models";y(a+(s.modelSelector?.enterManually||", please enter manually")),C(!0)}finally{w(!1)}};return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(e.f,{className:"flex-1",children:s.modelSelector?.modelName||"Model Name"}),(0,b.jsx)(g.f,{type:"button",variant:"outline",size:"sm",onClick:F,disabled:v||!d,children:v?(0,b.jsx)(j.f,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(i.f,{className:"h-3 w-3"})})]}),x&&(0,b.jsx)("p",{className:"text-xs text-yellow-600",children:x}),B||0===t.length?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(c.f,{value:z,onChange:a=>{var b;A(b=a.target.value),r(b)},placeholder:(0,m.j)(a)?m.$[a].model:"openai"===a?"gpt-6.1-sol":"gemini-1.5-flash"}),t.length>0&&(0,b.jsx)(g.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>C(!1),children:s.modelSelector?.selectFromList||"Select from List"})]}):(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsxs)(h.d,{value:q,onValueChange:a=>{"_custom"===a?C(!0):(C(!1),A(a),r(a))},children:[(0,b.jsx)(h.P,{children:(0,b.jsx)(h.U,{placeholder:s.modelSelector?.selectModel||"Select Model"})}),(0,b.jsxs)(h.r,{children:[t.map(a=>(0,b.jsxs)(h.T,{value:a.id,children:[a.name,a.owned_by&&` (${a.owned_by})`]},a.id)),(0,b.jsx)(h.T,{value:"_custom",children:s.modelSelector?.customInput||"Custom Input..."})]})]})})]})}a.s(["f",0,o],175592),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,l.b)(),h=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"API Key"}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-ant-..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(o,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>h("model",a)})]})}],492710),a.s(["f",0,function({value:a,onChange:f}){let{t:g}=(0,l.b)(),h=(b,c)=>f({...a,[b]:c}),i=a=>a?.trim()?"":"border-destructive";return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(c.f,{value:a?.endpoint||"",onChange:a=>h("endpoint",a.target.value),placeholder:g.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:i(a?.endpoint)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:[g.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(c.f,{value:a?.deploymentName||"",onChange:a=>h("deploymentName",a.target.value),placeholder:g.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:i(a?.deploymentName)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(e.f,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:i(a?.apiKey)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(c.f,{value:a?.apiVersion||"",onChange:a=>h("apiVersion",a.target.value),placeholder:g.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:g.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(c.f,{value:a?.model||"",onChange:a=>h("model",a.target.value),placeholder:"gpt-4o"})]})]})}],612416),a.s(["f",0,function({value:a,onChange:f}){let g=(b,c)=>f({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"API Key"}),(0,b.jsx)(d.f,{value:a?.apiKey||"",onChange:a=>g("apiKey",a.target.value),placeholder:"AIza..."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(e.f,{children:"Base URL (Optional)"}),(0,b.jsx)(c.f,{value:a?.baseUrl||"",onChange:a=>g("baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(o,{provider:"gemini",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>g("model",a)})]})}],340898)},152679,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(177156),e=a.i(141379),f=a.i(699570),g=a.i(866718),h=a.i(550194),i=a.i(368114);a.s(["f",0,function({className:a,...j}){let{t:k}=(0,h.b)(),[l,m]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(g.f,{type:l?"text":"password",className:(0,i.f)("pr-10",a),...j}),(0,b.jsx)(f.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>m(!l),"aria-label":l?k.common.hidePassword:k.common.showPassword,tabIndex:-1,children:l?(0,b.jsx)(e.f,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(d.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_04ziy8_ak_olr._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[327999,a=>{let b=(0,a.i(170106).f)("calendar-check",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);a.s(["f",0,b],327999)},405784,767552,a=>{var b=a.i(170106);let c=(0,b.f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);a.s(["f",0,c],405784);let d=(0,b.f)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);a.s(["f",0,d],767552)},781560,a=>{let b=(0,a.i(170106).f)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);a.s(["f",0,b],781560)},633508,a=>{let b=(0,a.i(170106).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);a.s(["X",0,b],633508)},870430,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(30553),e=Object.defineProperty,f=c.forwardRef(e(function(a,c){return(0,b.jsx)(d.V.label,{...a,ref:c,onMouseDown:b=>{b.target.closest("button, input, select, textarea")||(a.onMouseDown?.(b),!b.defaultPrevented&&b.detail>1&&b.preventDefault())}})},"name",{value:"Label",configurable:!0})),g=a.i(368114);a.s(["f",0,function({className:a,...c}){return(0,b.jsx)(f,{"data-slot":"label",className:(0,g.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",a),...c})}],870430)},960927,a=>{a.s(["d",0,function(a){if("object"!=typeof a||null===a||!("data"in a))return;let{data:b}=a;if("object"==typeof b&&null!==b&&"message"in b)return"string"==typeof b.message?b.message:void 0},"Z",0,function(a){return a instanceof Error?a.message:String(a)}])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0oksf3a6pbj88._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";module.exports=[833354,(a,b,c)=>{c._=function(a){return a&&a.__esModule?a:{default:a}}},839761,a=>{let b=(0,a.i(170106).f)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);a.s(["f",0,b],839761)},284505,a=>{let b=(0,a.i(170106).f)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);a.s(["f",0,b],284505)},141379,a=>{let b=(0,a.i(170106).f)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);a.s(["f",0,b],141379)},104720,154933,a=>{let b=(0,a.i(170106).f)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);a.s(["f",0,b],104720);var c=a.i(367295);a.s(["f",()=>c.f],154933)},149625,a=>{let b=(0,a.i(170106).f)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);a.s(["f",0,b],149625)},915618,a=>{let b=(0,a.i(170106).f)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);a.s(["f",0,b],915618)},546842,a=>{let b=(0,a.i(170106).f)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);a.s(["f",0,b],546842)},367295,a=>{let b=(0,a.i(170106).f)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);a.s(["f",0,b])},249479,a=>{a.s(["z",0,50,"o",0,100,"P",0,1,"m",0,function(a,b=50){return"number"==typeof a&&a>=b/100}])}]})();
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_1gjb-bqi25yci._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,778917,e=>{let i=(0,e.i(475254).f)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["f",0,i],778917)},204997,e=>{let i=(0,e.i(475254).f)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);e.s(["f",0,i],204997)},292270,699375,e=>{let i=(0,e.i(475254).f)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["f",0,i],292270);var s=e.i(843476),a=e.i(271645),t=e.i(981140),n=e.i(820783),r=e.i(30030),l=e.i(369340),o=e.i(635804),c=e.i(248425),d=Object.defineProperty,m=(e,i)=>d(e,"name",{value:i,configurable:!0}),u="Switch",[x,p]=(0,r.f)(u),[h,f]=x(u);function g(e){let{__scopeSwitch:i,checked:t,children:n,defaultChecked:r,disabled:o,form:c,name:d,onCheckedChange:m,required:x,value:p="on",internal_do_not_use_render:f}=e,[g,v]=(0,l.f)({prop:t,defaultProp:r??!1,onChange:m,caller:u}),[j,y]=a.useState(null),[N,k]=a.useState(null),[C,w]=a.useState(null),S=!j||!!c||!!j.closest("form"),M={checked:g,setChecked:v,disabled:o,control:j,setControl:y,name:d,form:c,value:p,userClick:C,onUserClick:w,required:x,defaultChecked:r,isFormControl:S,bubbleInput:N,setBubbleInput:k};return(0,s.jsx)(h,{scope:i,...M,children:b(f)?f(M):n})}m(g,"SwitchProvider");var v=a.forwardRef(m(function({__scopeSwitch:e,onClick:i,...r},l){let{control:o,form:d,value:u,disabled:x,checked:p,required:h,setControl:g,setChecked:v,onUserClick:j,isFormControl:y,bubbleInput:N}=f("SwitchTrigger",e),b=(0,n.f)(l,g),C=a.useRef(p);return a.useEffect(()=>{let e=d?o?.ownerDocument.getElementById(d):o?.form;if(e instanceof HTMLFormElement){let i=m(()=>v(C.current),"reset");return e.addEventListener("reset",i),()=>e.removeEventListener("reset",i)}},[o,d,v]),(0,s.jsx)(c.V.button,{type:"button",role:"switch","aria-checked":p,"aria-required":h,"data-state":k(p),"data-disabled":x?"":void 0,disabled:x,value:u,...r,ref:b,onClick:(0,t.f)(i,e=>{let i=e.isPropagationStopped();j({requestedChecked:!p,hasConsumerStoppedPropagation:i}),v(e=>!e),N&&y&&!i&&e.stopPropagation()})})},"SwitchTrigger")),j=a.forwardRef(m(function(e,i){let{__scopeSwitch:a,name:t,checked:n,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...u}=e;return(0,s.jsx)(g,{__scopeSwitch:a,checked:n,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:t,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v,{...u,ref:i,__scopeSwitch:a}),e&&(0,s.jsx)(N,{__scopeSwitch:a})]})})},"Switch")),y=a.forwardRef(m(function(e,i){let{__scopeSwitch:a,...t}=e,n=f("SwitchThumb",a);return(0,s.jsx)(c.V.span,{"data-state":k(n.checked),"data-disabled":n.disabled?"":void 0,...t,ref:i})},"SwitchThumb")),N=a.forwardRef(m(function({__scopeSwitch:e,onClick:i,...r},l){let{control:d,userClick:m,checked:u,defaultChecked:x,required:p,disabled:h,name:g,value:v,form:j,bubbleInput:y,setBubbleInput:N}=f("SwitchBubbleInput",e),b=(0,n.f)(l,N),k=(0,o.f)(d),C=a.useRef(!1),w=a.useRef(u),S=a.useRef(m),M=a.useRef(null);a.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let i=w.current!==u;w.current=u;let s=null!==m&&m!==S.current;if(S.current=m,s)M.current=i?null:m,i&&e.call(y,u),y.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(i){let i=M.current;M.current=null;let s=i?.requestedChecked===u;C.current=!0,e.call(y,u),y.dispatchEvent(new Event("click",{bubbles:!(s&&i.hasConsumerStoppedPropagation)})),C.current=!1}},[y,u,m]);let P=a.useRef(u);return(0,s.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??P.current,required:p,disabled:h,name:g,value:v,form:j,...r,tabIndex:-1,ref:b,onClick:(0,t.f)(i,e=>{C.current&&e.stopPropagation()}),style:{...r.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function b(e){return"function"==typeof e}function k(e){return e?"checked":"unchecked"}m(b,"isFunction"),m(k,"getState");var C=e.i(975157);let w=a.forwardRef(({className:e,...i},a)=>(0,s.jsx)(j,{className:(0,C.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...i,ref:a,children:(0,s.jsx)(y,{className:(0,C.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));w.displayName=j.displayName,e.s(["f",0,w],699375)},713452,595468,128093,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(475254);let t=(0,a.f)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["f",0,t],595468);var n=e.i(531278),r=e.i(373884);let l=(0,a.f)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var o=e.i(519455),c=e.i(111110);let d={minimax:{name:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn"},glm:{name:"智谱 GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn"},deepseek:{name:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com"},kimi:{name:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com"}},m=Object.keys(d);function u(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(d,e)}e.s(["$",0,d,"U",0,m,"j",0,u],128093);var x=e.i(41931),p=e.i(303163),h=e.i(201276);e.s(["f",0,function({config:e,saving:a,saveButton:d}){let{t:m,language:f}=(0,c.b)(),[g,v]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),N=e=>m.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),b=async()=>{let i=function(e,i){let s=e.aiProvider;if("openai"===s){let a=e.openai?.instances?.find(i=>i.id===e.openai?.activeInstanceId);return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===s){let a=e.azure;return a?.apiKey&&a.endpoint&&a.deploymentName?{ok:!0,body:{provider:s,apiKey:a.apiKey,endpoint:a.endpoint,deploymentName:a.deploymentName,apiVersion:a.apiVersion,model:a.model,language:i}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===s)return{ok:!0,body:{provider:s,model:e.minimaxCode?.model,language:i}};if("gemini"===s||"anthropic"===s||u(s)){let a=e[s];return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,f);if(!i.ok){if("UNSUPPORTED_PROVIDER"===i.error)return;y({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===i.error?m.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":m.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}v(!0),y(null);try{y(await x.f.post("/api/ai/test",i.body))}catch(e){h.f.error("[AiConnectionTest]","AI connection test failed",{error:e}),y({success:!1,textSupport:!1,visionSupport:!1,textError:(0,p.Z)(e)})}finally{v(!1)}};return(0,i.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(o.f,{type:"button",variant:"outline",onClick:b,disabled:g||a,className:"flex-1",children:[g?(0,i.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(l,{className:"mr-2 h-4 w-4"}),g?m.settings?.ai?.testing||"Testing...":m.settings?.ai?.testConnection||"Test Connection"]}),d]}),j&&(0,i.jsxs)("div",{className:`p-3 rounded-md text-sm ${j.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,i.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:j.success?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{className:"h-4 w-4 text-green-600"}),(0,i.jsx)("span",{className:"text-green-700",children:m.settings?.ai?.testSuccess||"Connection Successful"}),j.modelInfo&&(0,i.jsxs)("span",{className:"text-green-600 text-xs",children:["(",j.modelInfo,")"]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.f,{className:"h-4 w-4 text-red-600"}),(0,i.jsx)("span",{className:"text-red-700",children:m.settings?.ai?.testFailed||"Connection Failed"})]})}),j.success&&(0,i.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[m.settings?.ai?.textSupport||"Text Generation",":"]}),(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",m.settings?.ai?.supported||"Supported"]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[m.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),j.visionSupport?(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",m.settings?.ai?.supported||"Supported"]}):(0,i.jsxs)("span",{className:"text-amber-600",children:["✗ ",j.visionError?N(j.visionError):m.settings?.ai?.notSupported||"Not Supported"]})]}),(0,i.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:m.settings?.ai?.testNetworkNote})]}),!j.success&&j.textError&&(0,i.jsx)("p",{className:"text-red-600 text-xs mt-1",children:N(j.textError)})]})]})}],713452)},10038,835467,e=>{var i=e.i(843476),s=e.i(531278),a=e.i(519455),t=e.i(110204),n=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),c=e.i(75977),d=e.i(778917),m=e.i(204997),u=e.i(292270),x=e.i(16715),p=e.i(487486),h=e.i(793479),f=e.i(551804),g=e.i(699375),v=e.i(111110),j=e.i(215519),y=e.i(306831);function N({checkin:e,autoCheckin:n,onAutoCheckinChange:r,busy:l,onCheckin:o}){let c,{t:d}=(0,v.b)(),{timeZone:m}=(0,j.M)(),u=d.settings?.ai?.minimaxCode,{today:x,last:h}=e,b=h&&"failed"!==h.status?h:null,k=!!(x?.checkedToday||b),C=String(b?.points??(x?x.points+x.bonusPoints:0)),w=String(b?.streakDays??x?.streakDays??0);return c=b?.trigger==="auto"&&"checked-in"===b.status?(u?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(b.at,"HH:mm",m)).replace("{points}",C).replace("{days}",w):k?(u?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",C).replace("{days}",w):h?.status==="failed"?(u?.checkinFailed||"Check-in failed: {error}").replace("{error}",h.error||""):e.autoCheckin?u?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":u?.checkinNotYet||"Not checked in yet today",(0,i.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"text-muted-foreground",children:u?.checkinToday||"Today's check-in"}),(0,i.jsxs)(p.f,{variant:k?"default":h?.status==="failed"?"destructive":"secondary",children:[(0,i.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?u?.checkinSuccess||"Checked in":u?.checkinNotYet||"Not yet"]})]}),!k&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),u?.checkinNow||"Check in now"]})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c}),(0,i.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-auto-checkin",children:u?.autoCheckin||"Daily auto check-in"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:u?.autoCheckinHint})]}),(0,i.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:n,onCheckedChange:r})]})]})}let b=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),C=e.i(41931),w=e.i(303163),S=e.i(294114),M=e.i(201276);function P({value:e,onChange:n}){let{t:r}=(0,v.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:c,pending:f,busy:g,refresh:j,login:y,logout:I,checkin:U}=function(){let{t:e}=(0,v.b)(),i=e.settings?.ai?.minimaxCode,[s,a]=(0,k.useState)(null),[t,n]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,c]=(0,k.useState)(!1),d=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{n(!0);try{let e=await C.f.get("/api/minimax-code");a(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){M.f.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{n(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,s=async()=>{try{let a=await C.f.get("/api/minimax-code/login");if(e)return;if("pending"===a.status){d.current=setTimeout(s,r.intervalMs);return}l(null),"ok"===a.status?S.c.success(i?.loginSuccess||"Signed in"):"expired"===a.status?S.c.error(i?.loginExpired||"Authorization timed out"):"denied"===a.status&&S.c.error(i?.loginDenied||"Authorization declined"),m()}catch(s){if(e)return;l(null),S.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(s)}`)}};return d.current=setTimeout(s,r.intervalMs),()=>{e=!0,d.current&&clearTimeout(d.current)}},[r,m,i]);let u=async()=>{c(!0);try{await C.f.delete("/api/minimax-code"),l(null),await m()}catch(e){S.c.error((0,w.Z)(e))}finally{c(!1)}},x=async()=>{c(!0);try{let e=await C.f.post("/api/minimax-code/checkin",{});"failed"===e.status?S.c.error((i?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):S.c.success(i?.checkinSuccess||"Checked in"),await m()}catch(e){S.c.error((0,w.Z)(e))}finally{c(!1)}};return{status:s,loading:t,pending:r,busy:o,refresh:m,login:async()=>{c(!0);try{let e=await C.f.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){S.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(e)}`)}finally{c(!1)}},logout:u,checkin:x}}(),K=o?.login??"none",A=o?.account,E=o?.credits,R={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[K];return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,i.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,i.jsx)(a.f,{variant:"ghost",size:"sm",onClick:()=>void j(),disabled:c,"aria-label":l?.refresh||"Refresh",children:(0,i.jsx)(x.f,{className:`h-4 w-4 ${c?"animate-spin":""}`})})]}),(0,i.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,i.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,i.jsx)(p.f,{variant:"active"===K?"default":"expired"===K?"destructive":"secondary",children:R}),A&&(0,i.jsx)("span",{className:"truncate text-muted-foreground",children:A.name||A.email||A.userId})]}),"active"===K&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,i.jsx)("dd",{children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"font-medium tabular-nums",children:E.total}),(0,i.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(E.free)).replace("{purchased}",String(E.purchased))})]}):(0,i.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===K&&o&&(0,i.jsx)(N,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:i=>n({...e,autoCheckin:i}),busy:g,onCheckin:()=>void U()}),f?(0,i.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,i.jsxs)("p",{className:"flex items-center gap-2",children:[(0,i.jsx)(s.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,i.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,i.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,i.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,i.jsx)(d.f,{className:"h-3 w-3"})]})]}):(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsxs)(a.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===K?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==K&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:()=>void I(),disabled:g,children:[(0,i.jsx)(u.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,i.jsx)(h.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:i=>n({...e,model:i.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,i.jsx)("datalist",{id:"minimax-code-models",children:b.map(e=>(0,i.jsx)("option",{value:e},e))}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var I=e.i(107233),U=e.i(727612),K=e.i(464034),A=e.i(37038);function E({value:e,onChange:s}){let{t:r}=(0,v.b)(),l=e?.instances||[],o=e?.activeInstanceId,c=l.find(e=>e.id===o),d=(i,a)=>{s({...e,instances:l.map(e=>e.id===o?{...e,[i]:a}:e)})},m=async()=>{if(!o||!await (0,S.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=l.filter(e=>e.id!==o);s({instances:e,activeInstanceId:e[0]?.id})};return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.instances||"Instance"}),(0,i.jsxs)(a.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(l.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let i=16*Math.random()|0;return("x"===e?i:3&i|8).toString(16)}),name:`Instance ${l.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};s({instances:[...l,e],activeInstanceId:e.id})},disabled:l.length>=10,className:"h-7 px-2 text-xs",children:[(0,i.jsx)(I.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),l.length>0?(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(n.d,{value:o||"",onValueChange:i=>s({...e,activeInstanceId:i}),children:[(0,i.jsx)(n.P,{className:"flex-1",children:(0,i.jsx)(n.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,i.jsx)(n.r,{children:l.map(e=>(0,i.jsx)(n.T,{value:e.id,children:e.name},e.id))})]}),l.length>1&&(0,i.jsx)(a.f,{type:"button",variant:"outline",size:"icon",onClick:m,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,i.jsx)(U.f,{className:"h-4 w-4"})})]}):(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),l.length>=10&&(0,i.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),c&&(0,i.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.name||"",onChange:e=>d("name",e.target.value),placeholder:"e.g. 智谱 GLM-4V",className:c.name?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(A.f,{value:c.apiKey||"",onChange:e=>d("apiKey",e.target.value),placeholder:"sk-...",className:c.apiKey?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,i.jsxs)(t.f,{children:["Base URL ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.baseUrl||"",onChange:e=>d("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:c.baseUrl?.trim()?"":"border-destructive"})]}),(0,i.jsx)(K.f,{provider:"openai",apiKey:c.apiKey,baseUrl:c.baseUrl,currentModel:c.model,onModelChange:e=>d("model",e)})]})]})}var R=e.i(128093);function z({provider:e,value:s,onChange:a}){let{t:n}=(0,v.b)(),r=R.$[e],l=(e,i)=>a({...s,[e]:i});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"API Key"}),(0,i.jsx)(A.f,{value:s?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,i.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,i.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(h.f,{value:s?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:n.settings?.ai?.vendorBaseUrlHint})]}),(0,i.jsx)(K.f,{provider:e,apiKey:s?.apiKey,baseUrl:s?.baseUrl,currentModel:s?.model||r.model,onModelChange:e=>l("model",e)})]})}e.s(["f",0,function({config:e,setConfig:d,loading:m,saving:u,onSave:x}){let{t:p}=(0,v.b)();return m?(0,i.jsx)("div",{className:"flex justify-center py-4",children:(0,i.jsx)(s.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,i.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:p.settings?.tabs?.ai||"AI Provider"}),(0,i.jsxs)(n.d,{value:e.aiProvider,onValueChange:e=>d(i=>({...i,aiProvider:e})),children:[(0,i.jsx)(n.P,{children:(0,i.jsx)(n.U,{})}),(0,i.jsxs)(n.r,{children:[(0,i.jsx)(n.T,{value:"minimax",children:R.$.minimax.name}),(0,i.jsx)(n.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),R.U.filter(e=>"minimax"!==e).map(e=>(0,i.jsx)(n.T,{value:e,children:R.$[e].name},e)),(0,i.jsx)(n.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,i.jsx)(n.T,{value:"azure",children:"Azure OpenAI"}),(0,i.jsx)(n.T,{value:"openai",children:"OpenAI / Compatible"}),(0,i.jsx)(n.T,{value:"gemini",children:"Google Gemini"})]})]})]}),"openai"===e.aiProvider&&(0,i.jsx)(E,{value:e.openai,onChange:e=>d(i=>({...i,openai:e}))}),"gemini"===e.aiProvider&&(0,i.jsx)(c.f,{value:e.gemini,onChange:e=>d(i=>({...i,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,i.jsx)(P,{value:e.minimaxCode,onChange:e=>d(i=>({...i,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,i.jsx)(l.f,{value:e.anthropic,onChange:e=>d(i=>({...i,anthropic:e}))}),(0,R.j)(e.aiProvider)&&(0,i.jsx)(z,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>d(i=>({...i,[i.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,i.jsx)(o.f,{value:e.azure,onChange:e=>d(i=>({...i,azure:e}))}),(0,i.jsx)(r.f,{config:e,saving:u,saveButton:(0,i.jsxs)(a.f,{onClick:x,disabled:u,className:"flex-1",children:[u&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),p.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,i){if(!(0,y.L)(e.timeZone??y.J))return i.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let s of e.openai?.instances||[]){if(!s.name?.trim())return i.settings?.ai?.validationNameRequired||"Instance name is required";if(!s.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!s.baseUrl?.trim())return i.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!s.model?.trim())return i.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return i.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return i.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,118585,75977,e=>{var i=e.i(843476),s=e.i(793479),a=e.i(37038),t=e.i(110204),n=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(16715),c=e.i(531278),d=e.i(41931),m=e.i(111110),u=e.i(128093),x=e.i(201276);function p({provider:e,apiKey:a,baseUrl:h,currentModel:f,onModelChange:g}){let{t:v}=(0,m.b)(),[j,y]=(0,n.useState)([]),[N,b]=(0,n.useState)(!1),[k,C]=(0,n.useState)(null),[w,S]=(0,n.useState)(f||""),[M,P]=(0,n.useState)(!1),[I,U]=(0,n.useState)(f);f!==I&&(U(f),S(f||""));let K=async()=>{if(!a)return void C(v.modelSelector?.enterApiKeyFirst||"Please enter API Key first");b(!0),C(null);try{let i=await d.f.post("/api/ai/models",{provider:e,apiKey:a,...h&&{baseUrl:h}});if("error"in i&&"string"==typeof i.error){C(i.error),P(!0),y([]);return}y(i.models),0===i.models.length&&(C(v.modelSelector?.noVisionModel||"No vision model found, please enter manually"),P(!0))}catch(i){x.f.error("[ModelSelector]","Failed to fetch models",{error:i});let e=i instanceof Error&&i.message||v.modelSelector?.fetchFailed||"Failed to fetch models";C(e+(v.modelSelector?.enterManually||", please enter manually")),P(!0)}finally{b(!1)}};return(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(t.f,{className:"flex-1",children:v.modelSelector?.modelName||"Model Name"}),(0,i.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:K,disabled:N||!a,children:N?(0,i.jsx)(c.f,{className:"h-3 w-3 animate-spin"}):(0,i.jsx)(o.f,{className:"h-3 w-3"})})]}),k&&(0,i.jsx)("p",{className:"text-xs text-yellow-600",children:k}),M||0===j.length?(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(s.f,{value:w,onChange:e=>{var i;S(i=e.target.value),g(i)},placeholder:(0,u.j)(e)?u.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),j.length>0&&(0,i.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>P(!1),children:v.modelSelector?.selectFromList||"Select from List"})]}):(0,i.jsx)("div",{className:"space-y-2",children:(0,i.jsxs)(l.d,{value:f,onValueChange:e=>{"_custom"===e?P(!0):(P(!1),S(e),g(e))},children:[(0,i.jsx)(l.P,{children:(0,i.jsx)(l.U,{placeholder:v.modelSelector?.selectModel||"Select Model"})}),(0,i.jsxs)(l.r,{children:[j.map(e=>(0,i.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,i.jsx)(l.T,{value:"_custom",children:v.modelSelector?.customInput||"Custom Input..."})]})]})})]})}e.s(["f",0,p],464034),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,m.b)(),l=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"API Key"}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,i.jsx)(p,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>l("model",e)})]})}],459649),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,m.b)(),l=(i,s)=>n({...e,[i]:s}),o=e=>e?.trim()?"":"border-destructive";return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(s.f,{value:e?.endpoint||"",onChange:e=>l("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:o(e?.endpoint)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(s.f,{value:e?.deploymentName||"",onChange:e=>l("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:o(e?.deploymentName)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:o(e?.apiKey)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,i.jsx)(s.f,{value:e?.apiVersion||"",onChange:e=>l("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,i.jsx)(s.f,{value:e?.model||"",onChange:e=>l("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:n}){let r=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"API Key"}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>r("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>r("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,i.jsx)(p,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>r("model",e)})]})}],75977)},37038,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(286536),t=e.i(77705),n=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...c}){let{t:d}=(0,l.b)(),[m,u]=(0,s.useState)(!1);return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...c}),(0,i.jsx)(n.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>u(!m),"aria-label":m?d.common.hidePassword:d.common.showPassword,tabIndex:-1,children:m?(0,i.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"}):(0,i.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},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)},356909,e=>{let t=(0,e.i(475254).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],356909)},283086,e=>{let t=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,t],283086)},591124,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(522016),r=e.i(618566),i=e.i(215519),l=e.i(306831);let n=(0,e.i(475254).f)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);var d=e.i(531278),c=e.i(303281),m=e.i(367240),o=e.i(356909),x=e.i(727612),u=e.i(519455),f=e.i(793479),h=e.i(590546),p=e.i(86963),g=e.i(664659),y=e.i(655900),j=e.i(37727),b=e.i(487486),v=e.i(515288),N=e.i(511445),w=e.i(991686),k=e.i(393733),S=e.i(149704),C=e.i(16715),q=e.i(868983),M=e.i(111110),T=e.i(41931),R=e.i(201276),$=e.i(294114);function A({paperId:e,question:a,onDone:r}){let{t:i,language:l}=(0,M.b)(),[n,c]=(0,s.useState)(null),m=0===a.attempts.length&&!!a.errorItemId&&"pending"!==a.status,o="ready"===a.status&&!!a.questionText?.trim();if(!m&&!o)return null;let x=async t=>{let s="question"===t?i.exam.regenerateQuestionConfirm:i.exam.regenerateAnswerConfirm;if(await (0,$.u)(s)){c(t);try{let s=await T.f.post(`/api/exams/${e}/questions/${a.id}/regenerate`,{mode:t,language:l},{timeout:6e5,recoverable:!0});r(s)}catch(a){let e=a?.data?.message||"",s=i.errors[e];R.f.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:t,code:e}),$.c.error("HAS_RESULTS"===e?i.exam.regenerateHasResults:"string"==typeof s?s:i.exam.regenerateFailed)}finally{c(null)}}};return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m&&(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>x("question"),disabled:null!==n,children:["question"===n?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(C.f,{className:"mr-1 h-4 w-4"}),"question"===n?i.exam.regenerating:i.exam.regenerateQuestion]}),o&&(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>x("answer"),disabled:null!==n,children:["answer"===n?(0,t.jsx)(d.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(q.f,{className:"mr-1 h-4 w-4"}),"answer"===n?i.exam.regenerating:i.exam.regenerateAnswer]})]})}function I({paperId:e,question:r,editingResult:n,onResultChange:c,onDeleteAttempt:m,onRegenerated:o}){let{t:x}=(0,M.b)(),{timeZone:u}=(0,i.M)(),[f,h]=(0,s.useState)(!1),p=void 0!==n,C=(()=>{if(!r.error)return"";if("SOURCE_DELETED"===r.error)return x.exam.sourceDeleted;let e=r.error.split(":")[0].trim(),t=x.errors[e];return"string"==typeof t?t:r.error})();return(0,t.jsx)(v.N,{children:(0,t.jsxs)(v.O,{className:"space-y-3 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-semibold",children:[r.order,"."]}),r.errorItemId?(0,t.jsxs)(a.default,{href:`/error-items/${r.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[x.exam.source," ",r.sourceShortId]}):(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[r.sourceShortId," · ",x.exam.sourceDeleted]}),r.notebookName&&(0,t.jsx)(b.f,{variant:"secondary",children:r.notebookName})]}),r.attempts.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:r.attempts.map((e,s)=>(0,t.jsxs)(b.f,{variant:"outline",className:`gap-1 font-normal ${w.x[e.result]||""}`,children:[(0,t.jsx)("span",{children:x.exam.attemptLabel.replace("{n}",String(s+1))}),(0,t.jsx)("span",{className:"tabular-nums",children:(0,l.r)(e.createdAt,"MM-dd",u)}),(0,t.jsx)("span",{className:"font-semibold",children:x.mastery.results[e.result]}),p&&m&&(0,t.jsx)("button",{type:"button","aria-label":x.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>m(e.id),children:(0,t.jsx)(j.X,{className:"h-3 w-3"})})]},e.id))}),"pending"===r.status&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),x.exam.questionPending]}),"failed"===r.status&&(0,t.jsxs)("p",{className:"text-sm text-destructive",children:[x.exam.questionFailed,C?`:${C}`:""]}),"ready"===r.status&&r.questionText&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.f,{content:r.questionText}),(0,t.jsx)(S.f,{svg:r.figureSvg}),(0,t.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>h(!f),children:[f?(0,t.jsx)(y.f,{className:"h-3 w-3"}):(0,t.jsx)(g.f,{className:"h-3 w-3"}),x.exam.showAnswer]}),f&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[r.answerText&&(0,t.jsx)(N.f,{content:r.answerText,className:"font-semibold"}),r.analysis&&(0,t.jsx)(N.f,{content:r.analysis})]})]}),!p&&o&&(0,t.jsx)(A,{paperId:e,question:r,onDone:o}),p&&"ready"===r.status&&r.errorItemId&&c&&(0,t.jsx)(k.f,{value:n,onChange:c,size:"sm"})]})})}var z=e.i(663661),E=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,i.M)(),g=(0,r.useParams)(),y=(0,r.useRouter)(),{t:j,language:b}=(0,M.b)(),v=g.id,[N,w]=(0,s.useState)(null);(0,E.f)(j.exam.title,N?.title);let[k,S]=(0,s.useState)(!1),[C,q]=(0,s.useState)(null),[R,A]=(0,s.useState)((0,l.r)(new Date,"yyyy-MM-dd",e)),[H,D]=(0,s.useState)(!1),[F,U]=(0,s.useState)(null),O=(0,s.useCallback)(async()=>{try{w(await T.f.get(`/api/exams/${v}`))}catch{S(!0)}},[v]);if((0,s.useEffect)(()=>{O()},[O]),(0,s.useEffect)(()=>{if(N?.status!=="generating")return;let e=setTimeout(O,3e3);return()=>clearTimeout(e)},[N,O]),k)return(0,t.jsx)("div",{className:"p-8 text-center",children:j.exam.notFound});if(!N)return(0,t.jsx)(p.f,{label:j.common.loading});let _=N.questions.filter(e=>"ready"===e.status).length,P=N.questions.some(e=>e.attempts.length>0),V=N.questions.some(e=>"failed"===e.status),K=N.questions.filter(e=>"ready"===e.status&&e.errorItemId),L=C?K.filter(e=>C[e.id]).length:0,B=async()=>{if(C&&0!==L){D(!0),U(null);try{await T.f.post(`/api/exams/${N.id}/results`,{takenAt:(0,l.$)(R,e),results:K.filter(e=>C[e.id]).map(e=>({questionId:e.id,result:C[e.id]}))}),q(null),U(j.exam.resultsSaved),await O()}catch{U(j.exam.resultsSaveFailed)}finally{D(!1)}}},Q=async e=>{if(await (0,$.u)(j.mastery.deleteRecordConfirm,{destructive:!0}))try{await T.f.delete(`/api/practice/record/${e}`),await O()}catch{U(j.mastery.deleteRecordFailed)}},Y=async()=>{await T.f.post(`/api/exams/${N.id}/retry`,{language:b}),await O()},X=async()=>{await (0,$.u)(j.exam.deleteConfirm,{destructive:!0})&&(await T.f.delete(`/api/exams/${N.id}`),y.push("/exams"))};return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(h.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:N.title}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(z.f,{status:N.status,recorded:P}),(0,t.jsx)("span",{children:j.exam.progress.replace("{ready}",String(_)).replace("{total}",String(N.questions.length))}),(0,t.jsx)("span",{children:(0,l.r)(N.createdAt,"yyyy-MM-dd HH:mm",e)})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(a.default,{href:`/exams/${N.id}/print`,children:(0,t.jsxs)(u.f,{variant:"outline",size:"sm",disabled:0===_,children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),j.exam.print]})}),!C&&K.length>0&&(0,t.jsxs)(u.f,{size:"sm",onClick:()=>{U(null),q({}),A((0,l.r)(new Date,"yyyy-MM-dd",e))},children:[(0,t.jsx)(n,{className:"mr-2 h-4 w-4"}),j.exam.recordResults]}),V&&"generating"!==N.status&&(0,t.jsxs)(u.f,{variant:"outline",size:"sm",onClick:Y,children:[(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4"}),j.exam.retryFailed]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:X,className:"text-red-600 hover:text-red-700 hover:bg-red-50 sm:ml-auto",children:[(0,t.jsx)(x.f,{className:"mr-2 h-4 w-4"}),j.exam.delete]})]}),N.questions.length<N.requestedCount&&(0,t.jsx)("p",{className:"rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:j.exam.fewerThanRequested.replaceAll("{actual}",String(N.questions.length))}),F&&(0,t.jsx)("p",{className:"rounded-md border p-3 text-sm",children:F}),C&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:j.exam.takenAt}),(0,t.jsx)(f.f,{id:"exam-taken-at",type:"date",value:R,onChange:e=>A(e.target.value),className:"sm:w-48"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:j.exam.recordHint})]}),(0,t.jsx)("div",{className:"space-y-3",children:N.questions.map(e=>(0,t.jsx)(I,{paperId:N.id,question:e,editingResult:C?C[e.id]??null:void 0,onResultChange:t=>q(s=>s?{...s,[e.id]:t}:s),onDeleteAttempt:Q,onRegenerated:O},e.id))}),C&&(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===L&&(0,t.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:j.exam.noResultSelected}),(0,t.jsx)(u.f,{variant:"outline",onClick:()=>q(null),disabled:H,children:j.exam.cancel}),(0,t.jsxs)(u.f,{onClick:B,disabled:H||!R||0===L,children:[H?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4"}),j.exam.saveResults]})]})})]})})}],591124)},663661,e=>{var t=e.i(843476),s=e.i(487486),a=e.i(111110);let r={generating:"bg-blue-100 text-blue-700 border-blue-200",ready:"bg-indigo-100 text-indigo-700 border-indigo-200",partial:"bg-amber-100 text-amber-700 border-amber-200",failed:"bg-red-100 text-red-700 border-red-200",completed:"bg-green-100 text-green-700 border-green-200"};e.s(["f",0,function({status:e,recorded:i}){let{t:l}=(0,a.b)(),n=i&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(s.f,{variant:"outline",className:r[n],children:l.exam.status[n]})}])},991686,868983,e=>{var t=e.i(843476),s=e.i(271645),a=e.i(522016),r=e.i(215519),i=e.i(306831),l=e.i(664659),n=e.i(655900),d=e.i(531278),c=e.i(107233),m=e.i(283086),o=e.i(727612),x=e.i(487486),u=e.i(519455),f=e.i(515288),h=e.i(511445),p=e.i(356909),g=e.i(793479),y=e.i(393733),j=e.i(111110),b=e.i(41931);function v({errorItemId:e,onSaved:a,onCancel:l}){let{t:n}=(0,j.b)(),{timeZone:c}=(0,r.M)(),m=(0,i.r)(new Date,"yyyy-MM-dd",c),[o,x]=(0,s.useState)(null),[f,h]=(0,s.useState)(m),[N,w]=(0,s.useState)(!1),[k,S]=(0,s.useState)(null),C=async()=>{if(o&&f){w(!0),S(null);try{await b.f.post("/api/practice/record",{errorItemId:e,result:o,source:"manual",takenAt:(0,i.$)(f,c)}),a()}catch{S(n.mastery.resultSaveFailed)}finally{w(!1)}}};return(0,t.jsxs)("div",{className:"space-y-3 rounded-md border bg-muted/30 p-3",children:[(0,t.jsx)(y.f,{value:o,onChange:x,disabled:N}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,t.jsx)("label",{htmlFor:`practice-date-${e}`,className:"text-sm font-medium",children:n.mastery.recordDate}),(0,t.jsx)(g.f,{id:`practice-date-${e}`,type:"date",value:f,max:m,onChange:e=>h(e.target.value),className:"sm:w-48"}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsx)(u.f,{variant:"outline",size:"sm",onClick:l,disabled:N,className:"flex-1 sm:flex-none",children:n.exam.cancel}),(0,t.jsxs)(u.f,{size:"sm",onClick:C,disabled:N||!o||!f,className:"flex-1 sm:flex-none",children:[N?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(p.f,{className:"mr-2 h-4 w-4"}),n.mastery.saveResult]})]})]}),k&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:k})]})}var N=e.i(149704),w=e.i(294114),k=e.i(905110);let S={correct:"bg-green-100 text-green-700 border-green-200",wrong:"bg-red-100 text-red-700 border-red-200",not_attempted:"bg-amber-100 text-amber-700 border-amber-200"};e.s(["K",0,function({errorItemId:e,onMasteryStatusChange:p}){let{timeZone:g}=(0,r.M)(),{t:y}=(0,j.b)(),[C,q]=(0,s.useState)(null),[M,T]=(0,s.useState)(null),[R,$]=(0,s.useState)(0),[A,I]=(0,s.useState)(!1),z=(0,s.useCallback)(()=>{b.f.get(`/api/error-items/${e}/practice-records`).then(e=>{q(e),p?.(e.masteryStatus)}).catch(()=>void 0)},[e,p]);(0,s.useEffect)(z,[z]);let E=()=>{$(0),z()},H=async e=>{if(await (0,w.u)(y.mastery.deleteRecordConfirm,{destructive:!0}))try{await b.f.delete(`/api/practice/record/${e}`),E()}catch{w.c.error(y.mastery.deleteRecordFailed)}},D=C?.records[0],F=!!D&&(!C?.masteryEvaluatedAt||new Date(D.createdAt)>new Date(C.masteryEvaluatedAt));if((0,s.useEffect)(()=>{if(!F||R>=20)return;let e=setTimeout(()=>{$(e=>e+1),z()},4e3);return()=>clearTimeout(e)},[F,R,z]),!C)return null;let U=C.masteryProbability,O=null===U?null:Math.round(100*U),_=null===O?"":(0,k.m)(U,C.masteryThreshold)?"bg-green-500":O>=30?"bg-amber-500":"bg-red-500",P=y.practice.difficulty;return(0,t.jsxs)(f.N,{children:[(0,t.jsx)(f.Y,{children:(0,t.jsxs)(f.v,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(m.f,{className:"h-4 w-4 text-primary"}),y.mastery.probability]})}),(0,t.jsxs)(f.O,{className:"space-y-4",children:[null===O?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:F?y.mastery.pending:y.mastery.notEvaluated}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-3xl font-bold",children:[O,"%"]}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[F&&(0,t.jsx)(d.f,{className:"h-3 w-3 animate-spin"}),(0,t.jsx)(x.f,{variant:"outline",children:"ai"===C.masterySource?y.mastery.aiEvaluated:y.mastery.estimated})]})]}),(0,t.jsx)("div",{className:"h-2 w-full rounded-full bg-muted overflow-hidden",children:(0,t.jsx)("div",{className:`h-full ${_} transition-all`,style:{width:`${O}%`}})}),C.masteryReason&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:C.masteryReason}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y.mastery.thresholdHint.replace("{threshold}",String(C.masteryThreshold))})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold",children:y.mastery.history}),!A&&(0,t.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>I(!0),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),y.mastery.addRecord]})]}),A&&(0,t.jsx)(v,{errorItemId:e,onCancel:()=>I(!1),onSaved:()=>{I(!1),E()}}),0===C.records.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:y.mastery.noHistory}):(0,t.jsx)("ul",{className:"divide-y rounded-md border",children:C.records.map(e=>(0,t.jsxs)("li",{className:"p-3 text-sm space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-left",onClick:()=>T(M===e.id?null:e.id),children:[(0,t.jsx)("span",{className:"text-muted-foreground tabular-nums",children:(0,i.r)(e.createdAt,"yyyy-MM-dd HH:mm",g)}),(0,t.jsx)(x.f,{variant:"outline",className:S[e.result]||"",children:y.mastery.results[e.result]||e.result}),e.difficulty&&(0,t.jsx)(x.f,{variant:"secondary",children:P[e.difficulty]||e.difficulty}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.exam?`${y.mastery.sources.exam} \xb7 ${e.exam.title}`:y.mastery.sources[e.source]||y.mastery.sources.practice}),e.questionText&&(0,t.jsx)("span",{className:"ml-auto text-muted-foreground",children:M===e.id?(0,t.jsx)(n.f,{className:"h-4 w-4"}):(0,t.jsx)(l.f,{className:"h-4 w-4"})})]}),(0,t.jsx)("button",{type:"button","aria-label":y.mastery.deleteRecord,title:y.mastery.deleteRecord,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-red-50 hover:text-red-600",onClick:()=>H(e.id),children:(0,t.jsx)(o.f,{className:"h-4 w-4"})})]}),M===e.id&&e.questionText&&(0,t.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[(0,t.jsx)(h.f,{content:e.questionText}),(0,t.jsx)(N.f,{svg:e.figureSvg}),e.wrongAnswerText&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:y.editor.wrongAnswerText}),(0,t.jsx)(h.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{className:"border-t pt-2",children:[(0,t.jsx)("p",{className:"mb-1 font-medium",children:y.editor.mistakeAnalysis}),(0,t.jsx)(h.f,{content:e.mistakeAnalysis})]}),e.originalImageUrl&&(0,t.jsx)("img",{src:e.originalImageUrl,alt:y.editor.wrongAnswerText,className:"max-h-96 max-w-full rounded object-contain"}),e.answerText&&(0,t.jsx)("div",{className:"border-t pt-2",children:(0,t.jsx)(h.f,{content:e.answerText,className:"font-semibold"})}),e.exam&&(0,t.jsx)(a.default,{href:`/exams/${e.exam.paperId}`,className:"text-xs text-primary hover:underline",children:e.exam.title})]})]},e.id))})]})]})]})},"x",0,S],991686);var C=e.i(908821);e.s(["f",()=>C.f],868983)},393733,e=>{var t=e.i(843476),s=e.i(269638);let a=(0,e.i(475254).f)("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var r=e.i(373884),i=e.i(111110);let l=[{value:"correct",icon:s.f,active:"border-green-600 bg-green-50 text-green-700"},{value:"wrong",icon:r.f,active:"border-red-600 bg-red-50 text-red-700"},{value:"not_attempted",icon:a,active:"border-amber-600 bg-amber-50 text-amber-700"}];e.s(["f",0,function({value:e,onChange:s,disabled:a,size:r="md"}){let{t:n}=(0,i.b)(),d="sm"===r?"px-2 py-1 text-xs":"px-3 py-2 text-sm";return(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",role:"radiogroup",children:l.map(({value:i,icon:l,active:c})=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":e===i,disabled:a,onClick:()=>s(i),className:`flex items-center justify-center gap-1 rounded-md border font-medium transition-colors disabled:opacity-60 ${d} ${e===i?c:"border-input hover:bg-muted"}`,children:[(0,t.jsx)(l,{className:"sm"===r?"h-3 w-3":"h-4 w-4"}),n.mastery.results[i]]},i))})}],393733)},149704,e=>{var t=e.i(843476),s=e.i(111110),a=e.i(975157);e.s(["f",0,function({svg:e,className:r}){let{t:i}=(0,s.b)();return e?(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",r),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:i.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},590546,e=>{var t=e.i(843476),s=e.i(618566),a=e.i(519455),r=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:i}){let l=(0,s.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{l.push(e)},className:i,children:(0,t.jsx)(r.f,{className:"h-5 w-5"})})}])},515288,e=>{var t=e.i(843476),s=e.i(975157);e.s(["N",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,s.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})},"O",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.f)("px-6",e),...a})},"u",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.f)("text-muted-foreground text-sm",e),...a})},"Y",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"v",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.f)("leading-none font-semibold",e),...a})}])},86963,e=>{var t=e.i(843476),s=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),s=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,s.b)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}])})();
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},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),c=e.i(590546),o=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)(c.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,":________"]}),(0,t.jsxs)("span",{children:[p.exam.dateLine,":________"]}),(0,t.jsxs)("span",{children:[p.exam.scoreLine,":________"]})]}),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)(o.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,":"]}),(0,t.jsx)(o.f,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[p.exam.analysisLabel,":"]}),(0,t.jsx)(o.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),c=e.i(296626),o=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:c,form:o,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||!!o||!!k.closest("form"),q={checked:g,disabled:c,setChecked:b,control:k,setControl:j,name:d,form:o,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},c){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)(c,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)(o.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:c,value:o,onCheckedChange:d,form:m,...x}=e;return(0,t.jsx)(g,{__scopeCheckbox:n,checked:i,defaultChecked:r,disabled:c,required:l,onCheckedChange:d,name:s,form:m,value:o,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)(c.f,{present:s||v(r.checked)||!0===r.checked,children:(0,t.jsx)(o.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},c){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)(c,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)(o.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])}])}])})();
|