wrong-notebook 2026.10.26 → 2026.10.30-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +1 -0
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +8 -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 +4 -4
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +4 -4
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +3 -3
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +7 -7
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +11 -2
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +6 -6
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +5 -5
- 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 +5 -5
- 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 +4 -4
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +5 -5
- 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 +4 -4
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route/build-manifest.json +12 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +21 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.map +5 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +5 -5
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +5 -5
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +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 +8 -8
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +14 -13
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +12 -11
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +11 -10
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +5 -5
- 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 +10 -10
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +6 -6
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +11 -11
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +4 -4
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +4 -4
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +7 -7
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +4 -4
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +4 -4
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +14 -5
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +14 -4
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.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 +1 -0
- package/.next/server/chunks/1jng_app_api_error-items_[id]_svg-animation_narration_route_actions_0p9r8ebr7d00l.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0gql12o_mf7e8._.js → [root-of-the-server]__0-_fe0i5gihj2._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1hrdz_-5s3775._.js → [root-of-the-server]__0-mtuz1y2hrt_._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0lt6zgk4xq6fk._.js → [root-of-the-server]__01zmywofxv44d._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__067bnq3j3z-3_._.js → [root-of-the-server]__02w4yny5gt2b4._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0vqtidz1lisc6._.js → [root-of-the-server]__038gf2djjn0rg._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__04vkejt7399qm._.js → [root-of-the-server]__03_hg4dbjr6gm._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0f505ene-6a0j._.js → [root-of-the-server]__040kfzc4zv5ji._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__015ejcb8twm6c._.js → [root-of-the-server]__04r2yjj4knt9x._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__077qr39ck1pcs._.js → [root-of-the-server]__061x45fxd07dm._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__09944y8f_7dhf._.js → [root-of-the-server]__07k4_ion4ou6d._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__07ztt1wy26yvz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__08fwru7fkvvl6._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0uzkv_2-76muc._.js → [root-of-the-server]__0aos0p_8a5gky._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1930xo407ogqu._.js → [root-of-the-server]__0aq32mo414sro._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0c0x5d85vbcbv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0c4jdg0ga4zfe._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0dqbew6anw2kd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0e7_0-o90esy-._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1wjrhbs_gcrzx._.js → [root-of-the-server]__0f5t2o0i9tjar._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0fn8r9f73fzd3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0i_w6t6qj_061._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__05d1rfm7p02tv._.js → [root-of-the-server]__0ih72ek59msql._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1-9hu4j35d9ao._.js → [root-of-the-server]__0of1031_q21po._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0p-cdsmp78i6-._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0zjg773epx4r_._.js → [root-of-the-server]__0qo744v4hy8lp._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0rdo2-j-gxelt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0suoe7tm4396u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0tflseuizxpen._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ue14np4llg3a._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ufhocguvoxt4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0uwpcliduox5r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0uyibcf2mejgf._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__118rtr0shk1ii._.js → [root-of-the-server]__0v93i_mmy7uws._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1awckh2w31m-1._.js → [root-of-the-server]__0wbt3upu-nuk1._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0q_db5a74evdw._.js → [root-of-the-server]__0wm4qw5cu0956._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0zb48en2m8yk0._.js +7 -7
- package/.next/server/chunks/{[root-of-the-server]__17aiova74blq9._.js → [root-of-the-server]__0zvdl3gsgb2ll._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11l6a17qelkj9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13m9-20223lsw._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__041tflu88yv18._.js → [root-of-the-server]__15fllrli2pdl7._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__15t37vaiu6w-o._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0y48od_b_qxct._.js → [root-of-the-server]__169hdi7jji3vn._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__171ybavo0fgfi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__17_l38epg4gtn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18ok9-8819efr._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__03g_n15zojhn2._.js → [root-of-the-server]__19uj-sk5cp6hw._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1jhz19cuxjpmb._.js → [root-of-the-server]__1_8btngjew64q._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1_d4relv8gw0p._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1auvj24i6np5g._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1bvjyahgm4s-0._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1f1o5gbmw9gv7._.js → [root-of-the-server]__1dkb17rbhyexw._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1dnyhpafiwmyb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1euogp-jmbdbn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gg8lq2q9gzg2._.js +7 -7
- package/.next/server/chunks/[root-of-the-server]__1h2gs1l_ocut-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1k750v6l878d9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ks5l0ekcojb6._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1l-xwnx9zl7n6._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0a62guogezjl6._.js → [root-of-the-server]__1l5g6cixzgviv._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1o82fhau9qctf._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__035mztvplnh0_._.js → [root-of-the-server]__1qb-t64xfqxeo._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1sat028hivrbm._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1sfc4ds1btvga._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1stqxoanvvams._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0v0mt3v8gyonn._.js → [root-of-the-server]__1v3wvxwq41y9e._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1z6kziwgi04qw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1zu5sxvfb5vuo._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1pfiautl3zc2f._.js → [root-of-the-server]__213biwztbhh9-._.js} +2 -2
- package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
- package/.next/server/chunks/_08i9pskmlafnp._.js +3 -0
- package/.next/server/chunks/_0_rhee7wb6tcg._.js +1 -1
- package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
- package/.next/server/chunks/{_0geyrqrvyak26._.js → _0hkdm23o05kvp._.js} +6 -6
- package/.next/server/chunks/{_0kkvpy2s_y3-n._.js → _0lsw6_-5hpp0x._.js} +6 -6
- package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
- package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
- package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
- package/.next/server/chunks/{_0ne4rbj35w-io._.js → _1w_arlbn0o07b._.js} +6 -6
- package/.next/server/chunks/{src_lib_ai_prompts_ts_0z36zms4djibp._.js → src_lib_0es8upktx5_5c._.js} +77 -51
- package/.next/server/chunks/src_lib_15kwif87cuv22._.js +1 -1
- package/.next/server/chunks/src_lib_1k0xki4wmn54_._.js +1 -1
- package/.next/server/chunks/src_lib_1wm8ay-jqxakc._.js +1 -1
- package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +1 -1
- package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
- package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +1 -1
- package/.next/server/chunks/ssr/_0h6qsip9mphaq._.js +1 -1
- package/.next/server/chunks/ssr/_1g8mzz6qxv2mr._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_207wmjzllytiz._.js → _1gjb-bqi25yci._.js} +2 -2
- package/.next/server/chunks/ssr/{_1yaa5p1rk6i7c._.js → _1mw-oovvzrn8_._.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_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
- package/.next/server/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/0152ije6oxbik.js +1 -0
- package/.next/static/chunks/{45c1obyfb78ht.js → 0t58h5wfgi75w.js} +1 -1
- package/.next/static/chunks/{29ctahruklp-r.js → 0znojfm3iv2d7.js} +1 -1
- package/.next/static/chunks/{0hfox3n5lesf0.js → 1kx-lcqi4aref.js} +10 -10
- package/.next/static/chunks/22inup6g2i-7n.js +1 -0
- package/.next/static/chunks/{1zplgew-00wdz.js → 29cafv3hz5hzj.js} +1 -1
- package/.next/static/chunks/3zt-rwod7li6h.js +1 -0
- package/package.json +1 -1
- package/prisma/migrations/20261029000000_add_mastery_threshold/migration.sql +2 -0
- package/prisma/schema.prisma +1 -0
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00l2rz_disfkg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0aequ2pnoemzu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0msiy_bvtvaqo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ul_64h5yov45._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0vqoda1k-uvtz._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zxrtk19v5vnf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zxxkvf-ns40a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-i5zhzxr_18g._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10_vi76_sexvg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10lamgabz68ix._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11nevdba2vhtt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__17o-ysd_xsch6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__17pktht8hd051._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1a1fr6o2wf7qx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d39wr4nvawz9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1lbtlpnl59fx4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1n00d73k7_qf5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nos0_eby5gj4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1np0y-f3_9a11._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1q-qp9_6drnjc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1r0p8cbxayfm4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1uamx3r_5niri._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ubqs9ptth-gi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ve3j8ooyhjgv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wvpsikw739ko._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y4bactsi95qg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1yribihoxvucv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zt-23c4kv6ca._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zyka21s1ahtj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20al_f02-oyfd._.js +0 -3
- package/.next/server/chunks/_0qsjdkq-39qbo._.js +0 -11
- package/.next/server/chunks/_1lrt8e26anbnm._.js +0 -11
- package/.next/server/chunks/node_modules_zod_v4_classic_external_19886v847zvfd.js +0 -3
- package/.next/static/chunks/1cp-v-3d-80iz.js +0 -1
- package/.next/static/chunks/23v229-qd9o6o.js +0 -1
- package/.next/static/chunks/2ods71pgjc-e2.js +0 -1
- /package/.next/static/{RKk8t6MmArFLi1wGSWXua → KvipY98Rm0kvPB-UaObQu}/_buildManifest.js +0 -0
- /package/.next/static/{RKk8t6MmArFLi1wGSWXua → KvipY98Rm0kvPB-UaObQu}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{RKk8t6MmArFLi1wGSWXua → KvipY98Rm0kvPB-UaObQu}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,204573,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(522016),r=e.i(618566),n=e.i(871689),i=e.i(475254);let l=(0,i.f)("file-question-mark",[["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:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);var o=e.i(16715),c=e.i(727612),d=e.i(469937),u=e.i(72664),m=e.i(531278),g=e.i(3198),f=e.i(519455),h=e.i(111110),x=e.i(41931),p=e.i(303163),v=e.i(201276);function j({errorItemId:e,commands:s,onUpdate:r}){let{t:n}=(0,h.b)(),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),d=async()=>{l(!0),c(null);try{let t=await x.f.post(`/api/error-items/${e}/geogebra`,{});t.suitable&&t.commands.length>0?r({geogebraCommands:JSON.stringify(t.commands)}):c(t.description||n.geogebra.notSuitable)}catch(t){v.f.error("[ErrorDetail]","GeoGebra analysis failed",{error:t});let e=(0,p.d)(t)||(0,p.Z)(t);e.includes("AI_AUTH_ERROR")?c(n.geogebra.authFailed):e.includes("AI_CONNECTION")?c(n.geogebra.connectionFailed):c(n.geogebra.analyzeFailed)}finally{l(!1)}},y=async t=>{await x.f.put(`/api/error-items/${e}`,{geogebraCommands:t}),r({geogebraCommands:t})},b=async()=>{await x.f.delete(`/api/error-items/${e}/geogebra`),r({geogebraCommands:null})};return s?(0,t.jsx)(g.f,{commands:s,height:700,showToolBar:!0,showAlgebraInput:!1,showMenuBar:!1,onRegenerate:d,onSaveCommands:y,onDelete:b}):(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(u.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:n.geogebra.title})]}),(0,t.jsx)(f.f,{variant:"outline",size:"sm",onClick:d,disabled:i,children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4 animate-spin"}),n.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),n.geogebra.generate]})})]}),o&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:o}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:n.geogebra.hint})]})}function y({src:e,onClose:a}){let{t:s}=(0,h.b)();return e?(0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",onClick:a,children:(0,t.jsxs)("div",{className:"relative max-w-7xl max-h-full",children:[(0,t.jsx)("button",{className:"absolute -top-12 right-0 text-white hover:text-gray-300 text-lg font-semibold bg-black/50 px-4 py-2 rounded",onClick:a,children:s.detail?.close||"✕ Close"}),(0,t.jsx)("img",{src:e,alt:"Full size",className:"max-w-full max-h-[90vh] object-contain rounded-lg",onClick:e=>e.stopPropagation()}),(0,t.jsx)("p",{className:"text-center text-white/70 text-sm mt-4",children:s.detail?.clickOutside||"Click outside to close"})]})}):null}var b=e.i(141176),w=e.i(511445),N=e.i(515288);let k=(0,i.f)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var A=e.i(356909),S=e.i(37727);function C({onClick:e,label:a}){let{t:s}=(0,h.b)();return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:e,children:[(0,t.jsx)(k,{className:"h-4 w-4 mr-1"}),a||s.common?.edit||"Edit"]})}function I({onSave:e,onCancel:a,children:s}){let{t:r}=(0,h.b)();return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(f.f,{size:"sm",onClick:e,children:[(0,t.jsx)(A.f,{className:"h-4 w-4 mr-1"}),r.common?.save||"Save"]}),(0,t.jsxs)(f.f,{size:"sm",variant:"outline",onClick:a,children:[(0,t.jsx)(S.X,{className:"h-4 w-4 mr-1"}),r.common?.cancel||"Cancel"]}),s]})}function L({title:e,actions:a}){return(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[e,a]})}var F=e.i(294114);function M({read:e,save:t,logLabel:s,successMessage:r,failureMessage:n}){let{t:i}=(0,h.b)(),[l,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(e),u=async()=>{try{await t(c),o(!1),F.c.success(r||i.common?.messages?.saveSuccess||"Saved successfully")}catch(e){v.f.error("[ErrorDetail]",`Failed to save ${s}`,{error:e}),F.c.error(n||i.common?.messages?.saveFailed||"Save failed")}};return{editing:l,value:c,setValue:d,start:()=>{d(e()),o(!0)},cancel:()=>o(!1),submit:u}}function E({title:e,value:a,onSave:s,logLabel:r,rows:n,placeholder:i,editorLabel:l,emptyText:o,cardClassName:c,titleClassName:d,contentClassName:u,headerActions:m,children:g}){let f=M({read:()=>a||"",save:s,logLabel:r}),h=(0,t.jsx)(b.f,{value:f.value,onChange:f.setValue,placeholder:i,rows:n,className:"w-full font-mono text-sm"});return(0,t.jsxs)(N.N,{className:c,children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(L,{title:(0,t.jsx)(N.v,{className:d,children:e}),actions:!f.editing&&(0,t.jsxs)("div",{className:"flex flex-wrap justify-end",children:[m,(0,t.jsx)(C,{onClick:f.start})]})})}),(0,t.jsxs)(N.O,{className:"space-y-4",children:[f.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[l?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:l}),h]}):h,(0,t.jsx)(I,{onSave:f.submit,onCancel:f.cancel})]}):!a&&o?(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:o}):(0,t.jsx)(w.f,{content:a,className:u}),g]})]})}var T=e.i(624687);function z({item:e,onUpdate:a}){let{t:s}=(0,h.b)(),r=M({read:()=>e.userNotes||"",save:async t=>{await x.f.patch(`/api/error-items/${e.id}/notes`,{userNotes:t}),a({userNotes:t})},logLabel:"notes",successMessage:s.common?.messages?.noteSaveSuccess||"Notes saved successfully"});return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(L,{title:(0,t.jsx)(N.v,{children:s.detail.yourNotes}),actions:!r.editing&&(0,t.jsx)(C,{onClick:r.start,label:s.detail.editNotes})})}),(0,t.jsx)(N.O,{children:r.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(T.f,{value:r.value,onChange:e=>r.setValue(e.target.value),placeholder:s.detail.notesPlaceholder||"Enter your notes...",rows:5,className:"w-full"}),(0,t.jsx)(I,{onSave:r.submit,onCancel:r.cancel})]}):(0,t.jsx)("div",{className:"whitespace-pre-wrap",children:e.userNotes?(0,t.jsx)("p",{className:"text-foreground",children:e.userNotes}):(0,t.jsx)("p",{className:"text-muted-foreground italic",children:s.detail.noNotes})})})]})}var $=e.i(149704);let R=(0,i.f)("shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);function O({errorItemId:e,onDone:s}){let{t:r}=(0,h.b)(),[n,i]=(0,a.useState)(!1),l=async()=>{i(!0);try{let t=await x.f.post(`/api/error-items/${e}/figure`,{});s(t),t.figureSvg||F.c.warning(r.figure.noFigure)}catch(a){let e=a?.data?.message||"",t=r.errors[e];v.f.error("[RegenerateFigure]","Failed to regenerate figure",{code:e}),F.c.error("NO_ORIGINAL_IMAGE"===e?r.figure.noImage:"string"==typeof t?t:r.figure.failed)}finally{i(!1)}};return(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:l,disabled:n,className:"flex items-center gap-2",children:[n?(0,t.jsx)(m.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(R,{className:"h-4 w-4"}),n?r.figure.regenerating:r.figure.regenerate]})}let U=(0,i.f)("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);var q=e.i(12130),V=e.i(28928);function D({errorItemId:e,hasImage:s,onDone:r}){let{t:n}=(0,h.b)(),i=(0,a.useRef)(null),[l,o]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null);(0,a.useEffect)(()=>()=>{c&&URL.revokeObjectURL(c)},[c]);let u=async()=>{(!s||await (0,F.u)(n.replaceImage.confirm))&&i.current?.click()},g=async t=>{d(null),o(!0);try{let a=new File([t],"question-image.jpg",{type:t.type||"image/jpeg"}),s=await (0,V.f)(a),i=await x.f.put(`/api/error-items/${e}/image`,{imageDataUrl:s});r(i.originalImageUrl),F.c.success(n.replaceImage.done)}catch(t){let e=t?.data?.message||"";v.f.error("[ReplaceImage]","Failed to replace original image",{code:e}),F.c.error("INVALID_IMAGE"===e?n.replaceImage.invalid:n.replaceImage.failed)}finally{o(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:i,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",className:"hidden",onChange:e=>{(e=>{if(e){if(!e.type.startsWith("image/"))return F.c.error(n.replaceImage.invalid);d(URL.createObjectURL(e))}})(e.target.files?.[0]),e.target.value=""}}),c&&(0,t.jsx)(q.f,{imageSrc:c,open:!0,onClose:()=>d(null),onCropComplete:g}),(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:u,disabled:l,className:"flex items-center gap-2",children:[l?(0,t.jsx)(m.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(U,{className:"h-4 w-4"}),l?n.replaceImage.uploading:s?n.replaceImage.replace:n.replaceImage.add]})]})}var _=e.i(438465),P=e.i(793479),G=e.i(967489),H=e.i(943710);function B({item:e,onChanged:a}){let{t:s}=(0,h.b)(),r=s.common?.notSet||"Not set",n=M({read:()=>({subjectId:e.subjectId||null,gradeSemester:e.gradeSemester||"",paperLevel:e.paperLevel||(0,H.f)(e.difficultyStars)||"a"}),save:async t=>{await x.f.put(`/api/error-items/${e.id}`,{...t,subjectId:t.subjectId||null}),await a()},logLabel:"metadata",successMessage:s.common?.messages?.metaUpdateSuccess||"Metadata updated successfully!",failureMessage:s.common?.messages?.updateFailed||"Update failed"}),i=e=>n.setValue({...n.value,...e});return(0,t.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,t.jsx)(L,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:s.detail?.questionInfo||"Question Info"}),actions:!n.editing&&(0,t.jsx)(C,{onClick:n.start})}),n.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.notebooks?.title||"Notebook"}),(0,t.jsx)(_.f,{value:n.value.subjectId||void 0,onChange:e=>i({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.filter.grade}),(0,t.jsx)(P.f,{value:n.value.gradeSemester,onChange:e=>i({gradeSemester:e.target.value}),placeholder:s.notebook?.gradeSemesterPlaceholder||"e.g. Grade 7, Semester 1"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:s.filter.paperLevel}),(0,t.jsxs)(G.d,{value:n.value.paperLevel,onValueChange:e=>i({paperLevel:e}),children:[(0,t.jsx)(G.P,{children:(0,t.jsx)(G.U,{})}),(0,t.jsxs)(G.r,{children:[(0,t.jsx)(G.T,{value:"a",children:s.editor.paperLevels?.a||"Paper A"}),(0,t.jsx)(G.T,{value:"b",children:s.editor.paperLevels?.b||"Paper B"}),(0,t.jsx)(G.T,{value:"other",children:s.editor.paperLevels?.other||"Other"})]})]})]}),(0,t.jsx)(I,{onSave:n.submit,onCancel:n.cancel})]}):(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.notebooks?.title||"Notebook",":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.subject?.name||r})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.filter.grade,":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.gradeSemester||r})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[s.filter.paperLevel,":"]}),(0,t.jsx)("span",{className:"font-medium",children:e.paperLevel?s.editor.paperLevels?.[e.paperLevel]||e.paperLevel:r})]})]})]})}var W=e.i(487486),X=e.i(283086);function K({errorItemId:e,onDone:s,onSuggested:r}){let{t:n}=(0,h.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{l(!0);try{if(r){let t=await x.f.post(`/api/error-items/${e}/retag`,{preview:!0});r(t.tags)}else await x.f.post(`/api/error-items/${e}/retag`,{}),s?.()}catch(a){let e=a?.data?.message||"",t=n.errors[e];v.f.error("[RetagItem]","Failed to regenerate tags",{code:e}),F.c.error("NO_TAGS_SELECTED"===e?n.retag.noTags:"string"==typeof t?t:n.retag.itemFailed)}finally{l(!1)}};return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(m.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(X.f,{className:"h-4 w-4 mr-1"}),r?i?n.retag.suggestRunning:n.retag.suggestButton:i?n.retag.itemRunning:n.retag.itemButton]})}var Q=e.i(574041),Z=e.i(952122),Y=e.i(990745);function J({item:e,educationStage:a,onChanged:s}){let{t:r}=(0,h.b)(),n=(0,Y.f)(e),i=M({read:()=>(0,Y.f)(e),save:async t=>{await x.f.put(`/api/error-items/${e.id}`,{knowledgePoints:t}),await s()},logLabel:"tags",successMessage:r.common?.messages?.tagUpdateSuccess||"Tags updated successfully!",failureMessage:r.common?.messages?.updateFailed||"Update failed"});return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(L,{title:(0,t.jsx)("h4",{className:"text-sm font-semibold",children:r.editor?.tags||"Knowledge Tags"}),actions:!i.editing&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(K,{errorItemId:e.id,onDone:s}),(0,t.jsx)(C,{onClick:i.start})]})}),i.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(Q.f,{value:i.value,onChange:i.setValue,placeholder:r.editor?.tagsPlaceholder||"Enter or select knowledge tags...",subject:(0,Z.f)(e.subject?.name||null)||void 0,gradeStage:a}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r.editor?.tagsHint||"Select from standard or custom tags"}),(0,t.jsx)(I,{onSave:i.submit,onCancel:i.cancel,children:(0,t.jsx)(K,{errorItemId:e.id,onSuggested:i.setValue})})]}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(e=>(0,t.jsx)(W.f,{variant:"secondary",children:e},e))})]})}var ee=e.i(77705);let et=(0,i.f)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);function ea({src:e,alt:a,showLabel:s,hideLabel:r,visible:n,onVisibleChange:i,onEnlarge:l,variant:o="ghost",actions:c}){let{t:d}=(0,h.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e&&(0,t.jsx)(f.f,{variant:o,size:"sm",onClick:()=>i(!n),className:`flex items-center gap-2 ${"ghost"===o?"text-muted-foreground":""}`,children:n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.f,{className:"h-4 w-4"}),r]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(et,{className:"h-4 w-4"}),s]})}),c]}),e&&n&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("img",{src:e,alt:a,className:"w-full rounded-lg border cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>l(e)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1 text-center",children:d.detail?.clickToEnlarge||"Click to enlarge"})]})]})}function es({item:e,educationStage:s,saveFields:r,onUpdate:n,reload:i,onEnlarge:l}){let{t:o}=(0,h.b)(),[c,d]=(0,a.useState)(!1),u=M({read:()=>e.questionText,save:e=>r({questionText:e}),logLabel:"question"});return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(L,{title:(0,t.jsx)(N.v,{children:o.detail.question}),actions:!u.editing&&(0,t.jsx)(C,{onClick:u.start})})}),(0,t.jsxs)(N.O,{className:"space-y-4",children:[u.editing?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(b.f,{value:u.value,onChange:u.setValue,placeholder:"Enter question text...",rows:8,className:"w-full font-mono text-sm"}),(0,t.jsx)(I,{onSave:u.submit,onCancel:u.cancel})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.f,{content:e.questionText}),(0,t.jsx)($.f,{svg:e.figureSvg})]}),(0,t.jsx)(J,{item:e,educationStage:s,onChanged:i}),(0,t.jsx)(B,{item:e,onChanged:i}),(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(ea,{src:e.originalImageUrl,alt:o.detail.originalProblem||"Original Problem",showLabel:o.replaceImage?.view||"View original image",hideLabel:o.replaceImage?.hide||"Hide original image",variant:"outline",visible:c,onVisibleChange:d,onEnlarge:l,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D,{errorItemId:e.id,hasImage:!!e.originalImageUrl,onDone:e=>{n({originalImageUrl:e}),d(!0)}}),e.originalImageUrl&&(0,t.jsx)(O,{errorItemId:e.id,onDone:n})]})})})]})]})}var er=e.i(62825);function en({item:e,saveFields:s,onEnlarge:r}){let{t:n,language:i}=(0,h.b)(),[l,o]=(0,a.useState)(!1),c=M({read:()=>({text:e.wrongAnswerText||"",status:e.mistakeStatus||"unknown"}),save:({text:e,status:t})=>s({wrongAnswerText:e,mistakeStatus:(0,er.x)(t,e)}),logLabel:"wrong answer"});return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(L,{title:(0,t.jsx)(N.v,{children:n.editor?.wrongAnswerText||"Wrong Answer / Work"}),actions:!c.editing&&(0,t.jsx)(C,{onClick:c.start})})}),(0,t.jsx)(N.O,{className:"space-y-4",children:c.editing?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:n.editor?.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(G.d,{value:c.value.status,onValueChange:e=>c.setValue({...c.value,status:e}),children:[(0,t.jsx)(G.P,{children:(0,t.jsx)(G.U,{})}),(0,t.jsxs)(G.r,{children:[(0,t.jsx)(G.T,{value:"not_attempted",children:n.editor?.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(G.T,{value:"wrong_attempt",children:n.editor?.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(G.T,{value:"unknown",children:n.editor?.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{className:"text-sm text-muted-foreground",children:n.editor?.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(b.f,{value:c.value.text,onChange:e=>c.setValue({text:e,status:e.trim()?"wrong_attempt":c.value.status}),rows:5,className:"w-full font-mono text-sm"})]}),(0,t.jsx)(I,{onSave:c.submit,onCancel:c.cancel})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(W.f,{variant:"secondary",children:(0,er.i)(e.mistakeStatus,i)}),e.wrongAnswerText?(0,t.jsx)(w.f,{content:e.wrongAnswerText}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground italic",children:n.detail?.noMistakeAnalysis||"No mistake analysis yet."}),e.wrongAnswerImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(ea,{src:e.wrongAnswerImageUrl,alt:n.detail.wrongAnswerImageAlt,showLabel:n.detail.viewImage,hideLabel:n.detail.hideImage,visible:l,onVisibleChange:o,onEnlarge:r})})]})})]})}let ei=(0,i.f)("square-function",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]]);var el=e.i(716400),eo=e.i(369939);let ec=new Set(["ne","neq","nabla","nu","not","notin","ni","nexists","ngeq","nleq","nmid","nparallel","nsubseteq"]);function ed(e){return e.length>80?`${e.slice(0,80)}…`:e}let eu=["questionText","answerText","analysis","wrongAnswerText","mistakeAnalysis"];function em({errorItemId:e,fields:s,onDone:r}){let{t:n}=(0,h.b)(),[i,l]=(0,a.useState)(!1),o=(0,a.useMemo)(()=>Object.values(function(e){let t={};for(let a of eu){let s=function(e){if(!e?.trim())return[];let{masked:t,segments:a}=(0,eo.F)(e),s=[];for(let e of a)try{el.f.renderToString(e.tex,{displayMode:e.displayMode,throwOnError:!0,strict:"ignore"})}catch(a){let t=a instanceof Error?a.message.replace(/^KaTeX parse error:\s*/,""):String(a);s.push({snippet:ed(e.source),message:t})}let r=t.replace(/@@MATH\d+@@/g," "),n=r.replace(/\\\$/g,"").match(/\$/g);n&&s.push({snippet:"$",message:`有 ${n.length} 个未配对的 $ 定界符`});let i=r.match(/\\[()[\]]/g);i&&s.push({snippet:i.join(" "),message:"有未配对的 \\( \\) 或 \\[ \\] 定界符"});let l=[...new Set(r.match(/\\[a-zA-Z]{2,}/g)||[])].filter(e=>!e.startsWith("\\n")||ec.has(e.slice(1)));return l.length>0&&s.push({snippet:ed(l.join(" ")),message:"LaTeX 命令没有放在 $…$ 中,会原样显示"}),s}(e[a]);s.length>0&&(t[a]=s)}return t}(s)).reduce((e,t)=>e+(t?.length??0),0),[s]),c=async()=>{l(!0);try{let t=await x.f.post(`/api/error-items/${e}/fix-latex`,{},{timeout:3e5});r(t.updated);let a=t.fixedFields.map(e=>n.fixLatex.fields[e]).join("、");F.c.info(0===t.issuesBefore?n.fixLatex.noIssues:0===t.fixedFields.length?n.fixLatex.notFixed:0===t.issuesAfter?n.fixLatex.fixedAll.replace("{fields}",a):n.fixLatex.fixedPartly.replace("{fields}",a).replace("{count}",String(t.issuesAfter)))}catch(a){let e=a?.data?.message||"",t=n.errors[e];v.f.error("[FixLatex]","Failed to fix LaTeX",{code:e}),F.c.error("string"==typeof t?t:n.fixLatex.failed)}finally{l(!1)}};return 0!==o||i?(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:c,disabled:i,className:"border-amber-500 text-amber-700 dark:text-amber-400",title:n.fixLatex.issuesFound.replace("{count}",String(o)),children:[i?(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(ei,{className:"mr-2 h-4 w-4"}),i?n.fixLatex.running:n.fixLatex.button,!i&&o>0&&(0,t.jsxs)("span",{className:"ml-1",children:["(",o,")"]})]}):null}var eg=e.i(991686),ef=e.i(846968),eh=e.i(868983);function ex({errorItemId:e,onDone:s}){let{t:r,language:n}=(0,h.b)(),[i,l]=(0,a.useState)(!1),o=async()=>{if(await (0,F.u)(r.reanswerItem.confirm)){l(!0);try{let t=await x.f.post(`/api/error-items/${e}/reanswer`,{language:n},{timeout:6e5});s(t)}catch(a){let e=a?.data?.message||"",t=r.errors[e];v.f.error("[RegenerateAnswer]","Failed to regenerate answer",{code:e}),F.c.error("NO_QUESTION_TEXT"===e?r.reanswerItem.noQuestionText:"string"==typeof t?t:r.reanswerItem.failed)}finally{l(!1)}}};return(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:o,disabled:i,children:[i?(0,t.jsx)(m.f,{className:"h-4 w-4 mr-1 animate-spin"}):(0,t.jsx)(eh.f,{className:"h-4 w-4 mr-1"}),i?r.reanswerItem.running:r.reanswerItem.button]})}var ep=e.i(643531);let ev=(0,i.f)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function ej({shortId:e,className:s=""}){let{t:r}=(0,h.b)(),[n,i]=(0,a.useState)(!1);if(!e)return null;let l=async t=>{t.preventDefault(),t.stopPropagation();try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{window.prompt(r.shortId.copy,e)}};return(0,t.jsxs)("button",{type:"button",onClick:l,title:n?r.shortId.copied:r.shortId.copy,className:`inline-flex items-center gap-1 rounded-md border bg-muted/50 px-2 py-0.5 font-mono text-xs text-muted-foreground hover:text-foreground transition-colors ${s}`,children:[(0,t.jsx)("span",{children:r.shortId.label}),(0,t.jsx)("span",{className:"font-semibold text-foreground",children:e}),n?(0,t.jsx)(ep.f,{className:"h-3 w-3 text-green-600"}):(0,t.jsx)(ev,{className:"h-3 w-3"})]})}let ey=(0,i.f)("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]),eb=(0,i.f)("clapperboard",[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]]),ew=(0,i.f)("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),eN=(0,i.f)("minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]),ek=(0,i.f)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),eA=(0,i.f)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var eS=e.i(367240);let eC=(0,i.f)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),eI=(0,i.f)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var eL=e.i(975157);function eF({supported:e,enabled:a,rate:s,fullscreen:r,onToggle:n,onCycleRate:i}){let{t:l}=(0,h.b)(),o=(0,eL.f)("h-8 shrink-0",r&&"text-white hover:bg-white/20 hover:text-white"),c=e?a?l.svgAnimation.voiceOff:l.svgAnimation.voiceOn:l.svgAnimation.voiceUnsupported;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{title:c,className:"shrink-0",children:(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eL.f)(o,"w-8 p-0",a&&e&&!r&&"text-primary"),onClick:n,disabled:!e,"aria-label":c,"aria-pressed":a&&e,children:a&&e?(0,t.jsx)(eC,{className:"h-4 w-4"}):(0,t.jsx)(eI,{className:"h-4 w-4"})})}),a&&e&&(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:(0,eL.f)(o,"px-1.5 text-xs tabular-nums"),onClick:i,"aria-label":l.svgAnimation.voiceRate,title:l.svgAnimation.voiceRate,children:[s,"×"]})]})}let eM=/<metadata\b[^>]*\bid\s*=\s*["']narration["'][^>]*>([\s\S]*?)<\/metadata\s*>/gi,eE={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function eT(e){let t=e;if("string"==typeof t){let e=t.indexOf("["),a=t.lastIndexOf("]");if(-1===e||a<e)return null;try{t=JSON.parse(t.slice(e,a+1))}catch{return null}}if(!Array.isArray(t))return null;let a=[];for(let e of t){if(!e||"object"!=typeof e)continue;let{begin:t,text:s}=e,r="number"==typeof t?t:"string"==typeof t?eO(t):null;if(null===r||!Number.isFinite(r)||r<0||"string"!=typeof s)continue;let n=s.replace(/\s+/g," ").trim();n&&a.push({begin:Math.round(100*r)/100,text:n})}a.sort((e,t)=>e.begin-t.begin);let s=[];for(let e of a){let t=s[s.length-1];t&&t.begin===e.begin?t.text=`${t.text} ${e.text}`:s.push({...e})}let r=s.slice(0,20).map(e=>({...e,text:e.text.slice(0,300)}));return r.length>0?r:null}function ez(e){for(let t of e.matchAll(eM)){let e=eT(t[1].replace(/&(#x[0-9a-f]+|#\d+|lt|gt|amp|quot|apos);/gi,(e,t)=>{if("#"!==t[0])return eE[t.toLowerCase()];let a="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1));return Number.isFinite(a)&&a<=1114111?String.fromCodePoint(a):e}));if(e)return e}return null}let e$=/<(?:animate|animateTransform|animateMotion|set)\b[^>]*>/gi;function eR(e,t){let a=e.match(RegExp(`\\s${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i"));return a?(a[2]??a[3]??"").trim():null}function eO(e){if(!e)return null;let t=e.trim(),a=t.match(/^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/);if(a)return 3600*Number(a[1]??0)+60*Number(a[2])+Number(a[3]);let s=t.match(/^(\d+(?:\.\d+)?)(h|min|s|ms)?$/);if(!s)return null;let r={h:3600,min:60,s:1,ms:.001}[s[2]??"s"]??1;return Number(s[1])*r}let eU=new Set(["opacity","visibility","display","fill-opacity"]),eq=[1,1.25,1.5,.75],eV="svg-narration-enabled",eD="svg-narration-rate";function e_(e){try{return localStorage.getItem(e)}catch{return null}}function eP(e,t){try{localStorage.setItem(e,t)}catch{}}let eG={zh:["zh","cmn"],en:["en"]};function eH(){return"speechSynthesis"in window&&"u">typeof SpeechSynthesisUtterance?window.speechSynthesis:null}function eB(e,t){let a=-1;for(let s=0;s<e.length&&e[s].begin<=t+.05;s++)a=s;return a}function eW(e){let t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function eX({svg:e}){let{t:s,language:r}=(0,h.b)(),n=(0,a.useRef)(null),i=(0,a.useRef)(null),l=(0,a.useRef)(null),[o,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(0),[m,g]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),v=m||x,j=(0,a.useMemo)(()=>(function(e){let t=0;for(let a of e.match(e$)||[]){let e=eR(a,"begin"),s=null===e?0:eO(e.split(";")[0]);if(null===s)continue;let r=eR(a,"repeatCount");if("indefinite"!==r&&"indefinite"!==eR(a,"repeatDur"))t=Math.max(t,s+(eO(eR(a,"dur"))??0)*(r&&Number.isFinite(Number(r))?Number(r):1))}return t})(e),[e]),y=(0,a.useMemo)(()=>(function(e){let t=e.match(/<svg\b[^>]*>/i)?.[0]??"",a=eR(t,"viewBox")?.split(/[\s,]+/).map(Number);if(a?.length===4&&a[2]>0&&a[3]>0)return a[2]/a[3];let s=parseFloat(eR(t,"width")??""),r=parseFloat(eR(t,"height")??"");return s>0&&r>0?s/r:1.6})(e),[e]),b=(0,a.useMemo)(()=>`<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:"><style>html,body{margin:0;height:100%;background:#fff;overflow:hidden}svg{display:block;width:100%;height:100%}</style></head><body>${e}</body></html>`,[e]),w=(0,a.useMemo)(()=>ez(e),[e]),[N,k]=(0,a.useState)(null),A=w??N,S=(0,a.useCallback)(()=>{let e=i.current?.contentDocument;return"function"==typeof e?.getAnimations?e.getAnimations():[]},[]),C=function({segments:e,language:t,holdAnimation:s}){let[r,n]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(1),d=(0,a.useRef)(void 0),u=(0,a.useRef)(-1),m=(0,a.useRef)(!1),g=(0,a.useRef)(null),f=(0,a.useRef)(0),h=(0,a.useRef)(null),x=(0,a.useRef)(!1),p=(0,a.useRef)(1),v=(0,a.useRef)(s);(0,a.useEffect)(()=>{v.current=s},[s]),(0,a.useEffect)(()=>{x.current="1"===e_(eV),l(x.current);let e=Number(e_(eD));eq.includes(e)&&(p.current=e,c(e))},[]),(0,a.useEffect)(()=>{let e=eH();if(!e)return;let a=()=>{let a,s,r,i=e.getVoices();a=eG[t],s=i.filter(e=>a.some(t=>e.lang.toLowerCase().startsWith(t))),r="zh"===t?/^(zh|cmn)[-_](cn|hans)/i:/^en[-_]us/i,d.current=s.find(e=>r.test(e.lang)&&e.localService)??s.find(e=>r.test(e.lang))??s[0],n(0===i.length||!!d.current)};return a(),e.addEventListener?.("voiceschanged",a),()=>e.removeEventListener?.("voiceschanged",a)},[t]);let j=(0,a.useCallback)(a=>{let s=eH(),r=e?.[a];if(!s||!r)return;let n=f.current,i=new SpeechSynthesisUtterance(r.text);i.lang=d.current?.lang??("en"===t?"en-US":"zh-CN"),d.current&&(i.voice=d.current),i.rate=p.current;let l=()=>{n!==f.current||h.current!==i||(h.current=null,m.current=!1,null!==g.current&&(g.current=null,v.current(!1)))};i.onend=l,i.onerror=l,h.current=i,m.current=!0,s.speak(i)},[e,t]),y=(0,a.useCallback)(t=>{f.current++,h.current=null,m.current=!1,null!==g.current&&(g.current=null,v.current(!1)),u.current=e?eB(e,t)-1:-1,eH()?.cancel()},[e]),b=(0,a.useCallback)(t=>{if(!x.current||!e?.length||null!==g.current)return;let a=eB(e,t);if(!(a<=u.current)){if(m.current){g.current=a,v.current(!0);return}u.current=a,j(a)}},[e,j]),w=(0,a.useCallback)((e,t)=>{y(t),x.current=e,l(e),eP(eV,e?"1":"0")},[y]),N=(0,a.useCallback)(()=>{let e=eq[(eq.indexOf(p.current)+1)%eq.length];p.current=e,c(e),eP(eD,String(e))},[]);return(0,a.useEffect)(()=>()=>{f.current++,eH()?.cancel()},[e]),{supported:r,enabled:i,rate:o,setEnabled:w,cycleRate:N,update:b,stop:y}}({segments:A,language:r,holdAnimation:(0,a.useCallback)(e=>{e?l.current?.pauseAnimations():l.current?.unpauseAnimations(),S().forEach(t=>e?t.pause():t.play())},[S])}),{stop:I,update:L}=C,F=(0,a.useCallback)(()=>{l.current?.pauseAnimations(),S().forEach(e=>e.pause()),c(!1)},[S]),M=(0,a.useCallback)(()=>{I(l.current?.getCurrentTime()??0),F()},[F,I]),E=(0,a.useCallback)(e=>{l.current?.setCurrentTime(e),S().forEach(t=>{t.currentTime=1e3*e}),u(e),I(e)},[S,I]),T=(0,a.useCallback)(()=>{let e=l.current;e&&(j>0&&e.getCurrentTime()>=j&&E(0),e.unpauseAnimations(),S().forEach(e=>e.play()),c(!0))},[S,j,E]),z=async()=>{if(x)return void p(!1);if(document.fullscreenElement)return void await document.exitFullscreen().catch(()=>void 0);let e=n.current;if(e&&"function"==typeof e.requestFullscreen)try{await e.requestFullscreen();return}catch{}p(!0)};return(0,a.useEffect)(()=>{let e=()=>g(document.fullscreenElement===n.current);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,a.useEffect)(()=>{if(!x)return;let e=e=>{"Escape"===e.key&&p(!1)},t=document.body.style.overflow;return document.body.style.overflow="hidden",document.addEventListener("keydown",e),()=>{document.body.style.overflow=t,document.removeEventListener("keydown",e)}},[x]),(0,a.useEffect)(()=>{if(!o)return;let e=0,t=()=>{let a=l.current?.getCurrentTime()??0;if(L(a),j>0&&a>=j){l.current?.setCurrentTime(j),F(),u(j);return}u(a),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[o,j,F,L]),(0,t.jsxs)("div",{ref:n,className:(0,eL.f)("space-y-2",v&&"flex flex-col items-center justify-center bg-black p-4",x&&"fixed inset-0 z-50"),children:[(0,t.jsx)("iframe",{ref:i,srcDoc:b,sandbox:"allow-same-origin",title:s.svgAnimation.alt,onLoad:()=>{l.current=i.current?.contentDocument?.querySelector("svg")??null,k(l.current?function(e){let t=e.getAttribute("viewBox")?.split(/[\s,]+/).map(Number),a=t?.length===4&&t[3]>0?t[1]+t[3]:parseFloat(e.getAttribute("height")??"");if(!(a>0))return null;let s=t?.length===4?t[1]+.78*t[3]:.78*a,r=[];for(let t of Array.from(e.querySelectorAll("text"))){if(t.closest("defs, metadata"))continue;let a=parseFloat(t.getAttribute("y")??t.querySelector("tspan[y]")?.getAttribute("y")??"");if(!(a>=s))continue;let n=Array.from(t.querySelectorAll("tspan")),i=(n.length>0?n.map(e=>e.textContent??"").join(" "):t.textContent??"").replace(/\s+/g," ").trim(),l=function(e,t){for(let a=e;a&&a!==t;a=a.parentElement)for(let e of Array.from(a.children)){let t=e.localName;if("set"!==t&&"animate"!==t)continue;let a=e.getAttribute("attributeName")??"";if(eU.has(a)&&!function(e,t){if(null===t)return!1;let a=t.trim();return"visibility"===e?"hidden"===a:"display"===e?"none"===a:0===Number(a)}(a,e.getAttribute("to")??e.getAttribute("values")?.split(";").pop()??null))return eO((e.getAttribute("begin")??"0").split(";")[0])}return 0}(t,e);i&&null!==l&&r.push({begin:l,y:a,text:i})}return r.sort((e,t)=>e.begin-t.begin||e.y-t.y),eT(r.map(({begin:e,text:t})=>({begin:e,text:t})))}(l.current):null),I(0),u(0),c(!!l.current)},className:(0,eL.f)("mx-auto block rounded border bg-white",!v&&"w-full max-w-3xl"),style:v?{aspectRatio:y,width:`min(100%, calc((100dvh - 96px) * ${y}))`}:{aspectRatio:y}}),(0,t.jsxs)("div",{className:(0,eL.f)("mx-auto flex w-full items-center gap-2",v?"max-w-5xl text-white":"max-w-3xl"),children:[(0,t.jsx)(f.f,{variant:"outline",size:"sm",className:"h-8 w-8 shrink-0 p-0 text-foreground",onClick:o?M:T,"aria-label":o?s.svgAnimation.pause:s.svgAnimation.play,title:o?s.svgAnimation.pause:s.svgAnimation.play,children:o?(0,t.jsx)(ek,{className:"h-4 w-4"}):(0,t.jsx)(eA,{className:"h-4 w-4"})}),(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eL.f)("h-8 w-8 shrink-0 p-0",v&&"text-white hover:bg-white/20 hover:text-white"),onClick:()=>{E(0),T()},"aria-label":s.svgAnimation.replay,title:s.svgAnimation.replay,children:(0,t.jsx)(eS.f,{className:"h-4 w-4"})}),j>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"range",min:0,max:j,step:.1,value:Math.min(d,j),onChange:e=>E(Number(e.target.value)),"aria-label":s.svgAnimation.progress,className:"h-2 min-w-0 flex-1 cursor-pointer accent-primary"}),(0,t.jsxs)("span",{className:(0,eL.f)("shrink-0 text-xs tabular-nums",v?"text-white/80":"text-muted-foreground"),children:[eW(d)," / ",eW(j)]})]}),(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[!!A?.length&&(0,t.jsx)(eF,{supported:C.supported,enabled:C.enabled,rate:C.rate,fullscreen:v,onToggle:()=>C.setEnabled(!C.enabled,l.current?.getCurrentTime()??0),onCycleRate:C.cycleRate}),(0,t.jsx)(f.f,{variant:"ghost",size:"sm",className:(0,eL.f)("h-8 w-8 shrink-0 p-0",v&&"text-white hover:bg-white/20 hover:text-white"),onClick:z,"aria-label":v?s.svgAnimation.exitFullscreen:s.svgAnimation.fullscreen,title:v?s.svgAnimation.exitFullscreen:s.svgAnimation.fullscreen,children:v?(0,t.jsx)(eN,{className:"h-4 w-4"}):(0,t.jsx)(ew,{className:"h-4 w-4"})})]})]})]})}function eK({errorItemId:e,svgAnimation:s,hasOtherLanguage:r,onChange:n}){let{t:i,language:l}=(0,h.b)(),[d,u]=(0,a.useState)(!1),[g,p]=(0,a.useState)(!1),[j,y]=(0,a.useState)(!1),[b,w]=(0,a.useState)(null),N=(0,a.useMemo)(()=>!!s&&!!ez(s),[s]),k=(e,t)=>{let a=i.errors[e];return"string"==typeof a?a:t},A=async()=>{u(!0),w(null);try{let t=await x.f.post(`/api/error-items/${e}/svg-animation`,{language:l},{timeout:6e5});n(l,t.svgAnimation)}catch(t){let e=t?.data?.message||"";v.f.error("[SvgAnimation]","Failed to generate SVG animation",{code:e}),w("NO_QUESTION_TEXT"===e?i.svgAnimation.noQuestionText:"NO_VALID_ANIMATION"===e?i.svgAnimation.invalid:k(e,i.svgAnimation.failed))}finally{u(!1)}},S=async()=>{y(!0),w(null);try{let t=await x.f.post(`/api/error-items/${e}/svg-animation/narration`,{language:l},{timeout:3e5});n(l,t.svgAnimation),F.c.success(i.svgAnimation.narrationDone)}catch(t){let e=t?.data?.message||"";v.f.error("[SvgAnimation]","Failed to generate SVG narration",{code:e}),w("NO_VALID_NARRATION"===e?i.svgAnimation.narrationInvalid:k(e,i.svgAnimation.narrationFailed))}finally{y(!1)}},C=async()=>{if(await (0,F.u)(i.svgAnimation.confirmDelete,{destructive:!0})){p(!0);try{await x.f.delete(`/api/error-items/${e}/svg-animation?language=${l}`),n(l,null),w(null)}catch(e){v.f.error("[SvgAnimation]","Failed to delete SVG animation",{error:e instanceof Error?e.message:String(e)}),F.c.error(i.svgAnimation.deleteFailed)}finally{p(!1)}}};if(!s)return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(eb,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.svgAnimation.title})]}),(0,t.jsxs)(f.f,{variant:"outline",size:"sm",onClick:A,disabled:d,children:[d?(0,t.jsx)(m.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(eb,{className:"mr-2 h-4 w-4"}),d?i.svgAnimation.generating:i.svgAnimation.generate]})]}),b&&(0,t.jsx)("p",{className:"text-xs text-destructive mt-2",children:b}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:r?i.svgAnimation.otherLanguageAvailable:i.svgAnimation.hint})]});let I=d||g||j;return(0,t.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 border-b bg-muted/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i.svgAnimation.title}),I&&(0,t.jsx)(m.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:S,disabled:I,title:i.svgAnimation.narrationHint,children:[j?(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(ey,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:j?i.svgAnimation.narrationGenerating:N?i.svgAnimation.narrationRegenerate:i.svgAnimation.narrationGenerate})]}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:A,disabled:I,children:[d?(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:d?i.svgAnimation.generating:i.svgAnimation.regenerate})]}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:C,disabled:I,children:[(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i.svgAnimation.delete})]})]})]}),b&&(0,t.jsx)("p",{className:"px-3 pt-2 text-xs text-destructive",children:b}),(0,t.jsx)("div",{className:"p-2 sm:p-3",children:(0,t.jsx)(eX,{svg:s})})]})}var eQ=e.i(912505),eZ=e.i(86963),eY=e.i(35209);e.s(["default",0,function(){let e=(0,r.useParams)(),i=(0,r.useRouter)(),{t:u,language:m}=(0,h.b)(),[g,p]=(0,a.useState)(null);(0,eY.f)(u.detail.title,g?.subject?.name,g?.shortId);let[b,w]=(0,a.useState)(!0),[N,k]=(0,a.useState)(null),[A,S]=(0,a.useState)(!1),[C,I]=(0,a.useState)(void 0),[L,M]=(0,a.useState)(!1),[T,$]=(0,a.useState)(!0),[R,O]=(0,a.useState)(null),[U,q]=(0,a.useState)(!1),V=(0,a.useCallback)(async e=>{try{let t=await x.f.get(`/api/error-items/${e}`);p(t)}catch(e){v.f.error("[ErrorDetail]","Failed to fetch error item",{error:e}),F.c.error(u.common?.messages?.loadFailed||"Failed to load item"),i.push("/notebooks")}finally{w(!1)}},[i,u]);(0,a.useEffect)(()=>{x.f.get("/api/user").then(e=>{e&&e.educationStage&&I(e.educationStage),M(!!e?.enableGeogebra),$(e?.enableSvgAnimation!==!1)}).catch(e=>v.f.error("[ErrorDetail]","Failed to fetch user info",{error:e})),e.id&&V(e.id)},[e.id,V]);let D=(0,a.useCallback)(e=>{p(t=>t&&{...t,...e})},[]),_=async e=>{g&&(await x.f.put(`/api/error-items/${g.id}`,e),D(e))},P=async()=>{g&&await V(g.id)},G=async e=>{if(!g)return;let t=g.difficultyStars??null;D({difficultyStars:e}),q(!0);try{let t=await x.f.put(`/api/error-items/${g.id}`,{difficultyStars:e});D({paperLevel:t.paperLevel})}catch(e){D({difficultyStars:t}),v.f.error("[ErrorDetail]","Failed to save difficulty",{error:e}),F.c.error(u.difficulty.saveFailed)}finally{q(!1)}},H=(0,a.useCallback)((e,t)=>{D({["en"===e?"svgAnimationEn":"svgAnimation"]:t})},[D]),B=async()=>{if(g&&await (0,F.u)(u.common?.messages?.confirmDelete||"Are you sure you want to delete this error item?",{destructive:!0}))try{await x.f.delete(`/api/error-items/${g.id}/delete`),F.c.success(u.common?.messages?.deleteSuccess||"Deleted successfully"),i.push(g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks")}catch(e){v.f.error("[ErrorDetail]","Failed to delete error item",{error:e}),F.c.error(u.common?.messages?.deleteFailed||"Delete failed")}};return b?(0,t.jsx)(eZ.f,{label:u.common.loading}):g?(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsxs)("div",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[(0,t.jsx)(s.default,{href:g.subjectId?`/notebooks/${g.subjectId}`:"/notebooks",children:(0,t.jsx)(f.f,{variant:"ghost",size:"icon",className:"-ml-2",children:(0,t.jsx)(n.f,{className:"h-5 w-5"})})}),(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:u.detail.title}),(0,t.jsx)(ej,{shortId:g.shortId}),(0,t.jsx)(d.f,{size:"md",value:g.difficultyStars,onChange:G,disabled:U})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(em,{errorItemId:g.id,fields:g,onDone:D}),(0,t.jsx)(s.default,{href:`/practice?id=${g.id}`,children:(0,t.jsxs)(f.f,{variant:"outline",size:"sm",children:[(0,t.jsx)(o.f,{className:"mr-2 h-4 w-4"}),u.detail.practice]})}),R&&(0,t.jsx)(ef.x,{status:R,className:"h-8 self-center px-3"}),(0,t.jsxs)(f.f,{variant:"ghost",size:"sm",onClick:B,className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:[(0,t.jsx)(c.f,{className:"mr-2 h-4 w-4"}),u.detail.delete||"Delete"]})]})]}),(0,t.jsx)(es,{item:g,educationStage:C,saveFields:_,onUpdate:D,reload:P,onEnlarge:k}),(0,t.jsx)(eg.K,{errorItemId:g.id,onMasteryStatusChange:O}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(E,{title:u.detail.correctAnswer,value:g.answerText,onSave:e=>_({answerText:e}),logLabel:"answer",rows:5,placeholder:"Enter answer...",cardClassName:"border-primary/20",titleClassName:"text-primary",contentClassName:"font-semibold",headerActions:(0,t.jsx)(ex,{errorItemId:g.id,onDone:e=>D({answerText:e.answerText??"",analysis:e.analysis??""})}),children:g.referenceImageUrl&&(0,t.jsx)("div",{className:"pt-3",children:(0,t.jsx)(ea,{src:g.referenceImageUrl,alt:u.detail.referenceImageAlt,showLabel:u.detail.viewImage,hideLabel:u.detail.hideImage,visible:A,onVisibleChange:S,onEnlarge:k})})}),(0,t.jsx)(en,{item:g,saveFields:_,onEnlarge:k})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsx)(E,{title:u.detail.analysis,value:g.analysis,onSave:e=>_({analysis:e}),logLabel:"analysis",rows:12,placeholder:"Enter analysis..."}),(0,t.jsx)(E,{title:u.detail?.mistakeAnalysis||"Mistake Analysis",value:g.mistakeAnalysis,onSave:e=>_({mistakeAnalysis:e}),logLabel:"mistake analysis",rows:8,editorLabel:u.editor?.mistakeAnalysis||"Mistake Cause Analysis",emptyText:u.detail?.noMistakeAnalysis||"No mistake analysis yet."})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[T&&(0,t.jsx)(eK,{errorItemId:g.id,svgAnimation:"en"===m?g.svgAnimationEn:g.svgAnimation,hasOtherLanguage:!!("en"===m?g.svgAnimation:g.svgAnimationEn),onChange:H},m),L&&(0,t.jsx)(j,{errorItemId:g.id,commands:g.geogebraCommands,onUpdate:D}),(0,t.jsx)(z,{item:g,onUpdate:D})]})]}),(0,t.jsx)(y,{src:N,onClose:()=>k(null)})]}):(0,t.jsx)(eQ.f,{icon:l,title:u.detail.notFound||"Item not found",className:"m-4 md:m-8"})}],204573)}]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,842727,e=>{var t=e.i(271645),r=e.i(981140),n=e.i(75830),i=e.i(820783),o=e.i(30030),a=e.i(610772),l=e.i(248425),s=e.i(30207),u=e.i(369340),d=e.i(586318),c=e.i(934620),f=Object.defineProperty,p=(e,t)=>f(e,"name",{value:t,configurable:!0}),h=!1;function g(){let[e,r]=t.useState(h);return t.useEffect(()=>{h||(h=!0,r(!0))},[]),e}p(g,"useIsHydrated");var m=t[" useSyncExternalStore ".trim().toString()];function y(){return()=>{}}function v(){return m(y,()=>!0,()=>!1)}p(y,"subscribe"),p(v,"useIsHydratedModern");var b="function"==typeof m?v:g,w=e.i(843476),x=Object.defineProperty,j=(e,t)=>x(e,"name",{value:t,configurable:!0}),k="rovingFocusGroup.onEntryFocus",S={bubbles:!1,cancelable:!0},M="RovingFocusGroup",[P,_,C]=(0,n.f)(M),[E,I]=(0,o.f)(M,[C]),[R,O]=E(M),T=t.forwardRef(j(function(e,t){return(0,w.jsx)(P.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,w.jsx)(P.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,w.jsx)(F,{...e,ref:t})})})},"RovingFocusGroup")),F=t.forwardRef(j(function(e,n){let{__scopeRovingFocusGroup:o,orientation:a,loop:c=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:g,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...v}=e,b=t.useRef(null),x=(0,i.f)(n,b),j=(0,d.f)(f),[P,C]=(0,u.f)({prop:p,defaultProp:h??null,onChange:g,caller:M}),[E,I]=t.useState(!1),O=(0,s.f)(m),T=_(o),F=t.useRef(!1),[A,L]=t.useState(0);return t.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(k,O),()=>e.removeEventListener(k,O)},[O]),(0,w.jsx)(R,{scope:o,orientation:a,dir:j,loop:c,currentTabStopId:P,onItemFocus:t.useCallback(e=>C(e),[C]),onItemShiftTab:t.useCallback(()=>I(!0),[]),onFocusableItemAdd:t.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>L(e=>e-1),[]),children:(0,w.jsx)(l.V.div,{tabIndex:E||0===A?-1:0,"data-orientation":a,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,r.f)(e.onMouseDown,()=>{F.current=!0}),onFocus:(0,r.f)(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!E){let t=new CustomEvent(k,S);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);$([e.find(e=>e.active),e.find(e=>e.id===P),...e].filter(Boolean).map(e=>e.ref.current),y)}}F.current=!1}),onBlur:(0,r.f)(e.onBlur,()=>I(!1))})})},"RovingFocusGroupImpl")),A=t.forwardRef(j(function(e,n){let{__scopeRovingFocusGroup:i,focusable:o=!0,active:s=!1,tabStopId:u,children:d,...f}=e,p=(0,a.f)(),h=u||p,g=O("RovingFocusGroupItem",i),m=g.currentTabStopId===h,y=_(i),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:j}=g,k=b();return(0,c.f)(()=>{if(k&&o)return v(),()=>x()},[k,o,v,x]),t.useEffect(()=>{if(!k&&o)return v(),()=>x()},[k,o,v,x]),(0,w.jsx)(P.ItemSlot,{scope:i,id:h,focusable:o,active:s,children:(0,w.jsx)(l.V.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...f,ref:n,onMouseDown:(0,r.f)(e.onMouseDown,e=>{o?g.onItemFocus(h):e.preventDefault()}),onFocus:(0,r.f)(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:(0,r.f)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void g.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=D(e,g.orientation,g.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=y().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=g.loop?N(r,n+1):r.slice(n+1)}setTimeout(()=>$(r))}}),children:"function"==typeof d?d({isCurrentTabStop:m,hasTabStop:null!=j}):d})})},"RovingFocusGroupItem")),L={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function D(e,t,r){let n=z(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return L[n]}function $(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function N(e,t){return e.map((r,n)=>e[(t+n)%e.length])}j(z,"getDirectionAwareKey"),j(D,"getFocusIntent"),j($,"focusFirst"),j(N,"wrapArray"),e.s(["M",0,A,"F",0,T,"B",0,I],842727)},217923,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],217923)},664659,655900,e=>{var t=e.i(475254);let r=(0,t.f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,r],664659);let n=(0,t.f)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["f",0,n],655900)},269638,e=>{let t=(0,e.i(475254).f)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["f",0,t],269638)},373884,e=>{let t=(0,e.i(475254).f)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["f",0,t],373884)},440160,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],440160)},77705,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],77705)},178583,733060,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],178583);var r=e.i(908821);e.s(["f",()=>r.f],733060)},763639,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],763639)},107233,e=>{let t=(0,e.i(475254).f)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["f",0,t],107233)},16715,e=>{let t=(0,e.i(475254).f)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["f",0,t],16715)},367240,e=>{let t=(0,e.i(475254).f)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["f",0,t],367240)},727612,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],727612)},284614,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],284614)},908821,e=>{let t=(0,e.i(475254).f)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);e.s(["f",0,t])},522016,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(190809),a=e.r(843476),l=o._(e.r(271645)),s=e.r(195057),u=e.r(8372),d=e.r(818581),c=e.r(718967),f=e.r(405550),p=e.r(388540),h=e.r(91949),g=e.r(573668),m=e.r(509396);function y(t){var r;let n,i,o,[y,b]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,l.useRef)(null),{href:x,as:j,children:k,prefetch:S=null,passHref:M,replace:P,shallow:_,scroll:C,onClick:E,onMouseEnter:I,onTouchStart:R,legacyBehavior:O=!1,onNavigate:T,transitionTypes:F,ref:A,unstable_dynamicOnHover:L,...z}=t;n=k,O&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let D=l.default.useContext(u.AppRouterContext),$=!1!==S,N=!1===S?"none":!0===S?"full":"auto",U="none"!==N?"auto"===N?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,q="string"==typeof(r=j||x)?r:(0,s.formatUrl)(r);if(O){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");i=l.default.Children.only(n)}let B=O?i&&"object"==typeof i&&i.ref:A,V,K=l.default.useCallback(e=>(null!==D&&(w.current=(0,h.mountLinkInstance)(e,q,D,U,$,b,V)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[$,q,D,U,b,V]),G={ref:(0,d.useMergedRef)(K,B),onClick(t){O||"function"!=typeof E||E(t),O&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!D||t.defaultPrevented||function(t,r,n,i,o,a,l,s="none"){if("u">typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{navigate:c}=e.r(132916);c(r,i?"replace":"push",!1===o?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l,s)}}(t,q,w,P,C,T,F,N)},onMouseEnter(e){O||"function"!=typeof I||I(e),O&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),D&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)},onTouchStart:function(e){O||"function"!=typeof R||R(e),O&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),D&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===L)}};return(0,c.isAbsoluteUrl)(q)?G.href=q:O&&!M&&("a"!==i.type||"href"in i.props)||(G.href=(0,f.addBasePath)(q)),o=O?l.default.cloneElement(i,G):(0,a.jsx)("a",{...z,...G,children:n}),(0,a.jsx)(v.Provider,{value:y,children:o})}let v=(0,l.createContext)(h.IDLE_LINK_STATUS),b=()=>(0,l.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},605500,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return b}});let n=e.r(555682),i=e.r(190809),o=e.r(843476),a=i._(e.r(271645)),l=n._(e.r(174080)),s=n._(e.r(325633)),u=e.r(908927),d=e.r(65856),c=e.r(49381),f=n._(e.r(1948)),p=e.r(818581);function h(e,t,r,n,i,o,a){let l=e?.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,i=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}n?.current&&n.current(e)}}))}function g(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let m="u"<typeof window?a.useEffect:a.useLayoutEffect,y=(0,a.forwardRef)(({src:e,srcSet:t,sizes:r,height:n,width:i,decoding:l,className:s,style:u,fetchPriority:d,placeholder:c,loading:f,unoptimized:y,fill:v,onLoadRef:b,onLoadingCompleteRef:w,setBlurComplete:x,setShowAltText:j,sizesInput:k,onLoad:S,onError:M,...P},_)=>{let C=(0,a.useRef)(!1),E=(0,a.useRef)(null);m(()=>{let{current:e}=C,{current:t}=E;e||null===t||(M&&(t.src=t.src),t.complete&&h(t,c,b,w,x,y,k),C.current=!0)},[e,c,b,w,M,y,k]);let I=(0,p.useMergedRef)(_,E);return(0,o.jsx)("img",{...P,...g(d),loading:f,width:i,height:n,decoding:l,"data-nimg":v?"fill":"1",className:s,style:u,sizes:r,srcSet:t,src:e,ref:I,onLoad:e=>{h(e.currentTarget,c,b,w,x,y,k)},onError:e=>{j(!0),"empty"!==c&&x(!0),M&&M(e)}})});function v({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...g(t.fetchPriority)};return e&&l.default.preload?(l.default.preload(t.src,r),null):(0,o.jsx)(s.default,{children:(0,o.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let b=(0,a.forwardRef)((e,t)=>{let r=(0,a.useContext)(d.RouterContext),n=(0,c.useImageConfig)(),{onLoad:i,onLoadingComplete:l}=e,s=(0,a.useRef)(i);(0,a.useEffect)(()=>{s.current=i},[i]);let p=(0,a.useRef)(l);(0,a.useEffect)(()=>{p.current=l},[l]);let[h,g]=(0,a.useState)(!1),[m,b]=(0,a.useState)(!1),{props:w,meta:x}=(0,u.getImgProps)(e,{defaultLoader:f.default,imgConf:n,blurComplete:h,showAltText:m});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y,{...w,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:s,onLoadingCompleteRef:p,setBlurComplete:g,setShowAltText:b,sizesInput:e.sizes,ref:t}),x.preload?(0,o.jsx)(v,{isAppRouter:!r,imgAttributes:w}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},325164,e=>{var t=e.i(605500);e.s(["default",()=>t.Image])},49381,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useImageConfig",{enumerable:!0,get:function(){return l}});let n=e.r(271645),i=e.r(987690),o=e.r(918556),a={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function l(){let e=(0,n.useContext)(o.ImageConfigContext);return(0,i.prepareImageConfig)(a,e)}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},818581,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(271645);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=o(e,n)),t&&(i.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},670965,(e,t,r)=>{function n(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return n}})},908927,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return s}});let n=e.r(543369),i=e.r(488143),o=["-moz-initial","fill","none","scale-down",void 0];function a(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:0/0:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):0/0}function s({src:e,sizes:t,unoptimized:r=!1,priority:u=!1,preload:d=!1,loading:c,className:f,quality:p,width:h,height:g,fill:m=!1,style:y,overrideSrc:v,onLoad:b,onLoadingComplete:w,placeholder:x="empty",blurDataURL:j,fetchPriority:k,decoding:S="async",layout:M,objectFit:P,objectPosition:_,lazyBoundary:C,lazyRoot:E,...I},R){var O;let T,F,{imgConf:A,showAltText:L,blurComplete:z,defaultLoader:D}=R;if(void 0===D)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let $=I.loader||D;delete I.loader,delete I.srcSet;let N="__next_img_default"in $;if(N){if("custom"===A.loader)throw Error(`Image with src "${e}" is missing "loader" prop.
|
|
2
2
|
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`)}else{let e=$;$=t=>{let{config:r,...n}=t;return e(n)}}if(M){"fill"===M&&(m=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[M];e&&(y={...y,...e});let r={responsive:"100vw",fill:"100vw"}[M];r&&!t&&(t=r)}let U="",q=l(h),B=l(g);if((O=e)&&"object"==typeof O&&(a(O)||void 0!==O.src)){let t=a(e)?e.default:e;if(!t.src)throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`);if(!t.height||!t.width)throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`);if(T=t.blurWidth,F=t.blurHeight,j=j||t.blurDataURL,U=t.src,!m)if(q||B){if(q&&!B){let e=q/t.width;B=Math.round(t.height*e)}else if(!q&&B){let e=B/t.height;q=Math.round(t.width*e)}}else q=t.width,B=t.height}let V=!u&&!d&&("lazy"===c||void 0===c);(!(e="string"==typeof e?e:U)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,V=!1),A.unoptimized&&(r=!0),N&&!A.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let K=l(p),G=Object.assign(m?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:P,objectPosition:_}:{},L?{}:{color:"transparent"},y),H=z||"empty"===x?null:"blur"===x?`url("data:image/svg+xml;charset=utf-8,${(0,i.getImageBlurSvg)({widthInt:q,heightInt:B,blurWidth:T,blurHeight:F,blurDataURL:j||"",objectFit:G.objectFit})}")`:`url("${x}")`,W=o.includes(G.objectFit)?"fill"===G.objectFit?"100% 100%":"cover":G.objectFit,J=H?{backgroundSize:W,backgroundPosition:G.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:H}:{},Z=function({config:e,src:t,unoptimized:r,width:i,quality:o,sizes:a,loader:l}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,n.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,n.getAssetToken)())e=void 0;else if(e){let r=t.indexOf("?");if(-1!==r){let n=new URLSearchParams(t.slice(r+1));n.get("dpl")||(n.append("dpl",e),t=t.slice(0,r)+"?"+n.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:s,kind:u}=function({deviceSizes:e,allSizes:t},r,n){if(n){let r=/(^|\s)(1?\d?\d)vw/g,i=[];for(let e;e=r.exec(n);)i.push(parseInt(e[2]));if(i.length){let r=.01*Math.min(...i);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,i,a),d=s.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:s.map((r,n)=>`${l({config:e,src:t,quality:o,width:r})} ${"w"===u?r:n+1}${u}`).join(", "),src:l({config:e,src:t,quality:o,width:s[d]})}}({config:A,src:e,unoptimized:r,width:q,quality:K,sizes:t,loader:$}),Q=V?"lazy":c;return{props:{...I,loading:Q,fetchPriority:k,width:q,height:B,decoding:S,className:f,style:{...G,...J},sizes:Z.sizes,srcSet:Z.srcSet,src:v||Z.src},meta:{unoptimized:r,preload:d||u,placeholder:x,fill:m}}}},325633,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},defaultHead:function(){return c}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(555682),a=e.r(190809),l=e.r(843476),s=a._(e.r(271645)),u=o._(e.r(898879)),d=e.r(742732);function c(){return[(0,l.jsx)("meta",{charSet:"utf-8"},"charset"),(0,l.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let p=["name","httpEquiv","charSet","itemProp"];function h(e){let t,r,n,i;return e.reduce(f,[]).reverse().concat(c().reverse()).filter((t=new Set,r=new Set,n=new Set,i={},e=>{let o=!0,a=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){a=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?o=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?o=!1:r.add(e.type);break;case"meta":for(let t=0,r=p.length;t<r;t++){let r=p[t];if(e.props.hasOwnProperty(r))if("charSet"===r)n.has(r)?o=!1:n.add(r);else{let t=e.props[r],n=i[r]||new Set;("name"!==r||!a)&&n.has(t)?o=!1:(n.add(t),i[r]=n)}}}return o})).reverse().map((e,t)=>{let r=e.key||t;return s.default.cloneElement(e,{key:r})})}let g=function({children:e}){let t=(0,s.useContext)(d.HeadManagerContext);return(0,l.jsx)(u.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},488143,(e,t,r)=>{function n({widthInt:e,heightInt:t,blurWidth:r,blurHeight:i,blurDataURL:o,objectFit:a}){let l=r?40*r:e,s=i?40*i:t,u=l&&s?`viewBox='0 0 ${l} ${s}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${u}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${o}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},918556,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return o}});let n=e.r(555682)._(e.r(271645)),i=e.r(987690),o=n.default.createContext(i.imageConfigDefault)},987690,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={VALID_LOADERS:function(){return o},imageConfigDefault:function(){return u},prepareImageConfig:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=["default","imgix","cloudinary","akamai","custom"],a={},l=new WeakMap;function s(e,t){let r=e??a,n=t??a,i=l.get(r);if(i){let e=i.get(n);if(e)return e}let o=e||t||u,s=[...o.deviceSizes].sort((e,t)=>e-t),d=[...o.imageSizes],c={deviceSizes:s,imageSizes:d,allSizes:[...s,...d].sort((e,t)=>e-t),qualities:void 0===o.qualities?void 0:[...o.qualities].sort((e,t)=>e-t),path:o.path,loader:o.loader,dangerouslyAllowSVG:o.dangerouslyAllowSVG,unoptimized:o.unoptimized,domains:o.domains,remotePatterns:o.remotePatterns,localPatterns:"u"<typeof window&&void 0!==t?t.localPatterns:o.localPatterns,output:o.output};return i||(i=new WeakMap,l.set(r,i)),i.set(n,c),c}let u={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},1948,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return a}});let n=e.r(670965),i=e.r(543369);function o({config:e,src:t,width:r,quality:a}){let l=(0,i.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,i.getAssetToken)())l=void 0;else{let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),n=r.get("dpl");if(n){l=n,r.delete("dpl");let i=r.toString();t=t.slice(0,e)+(i?"?"+i:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
|
|
3
|
-
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`);let s=(0,n.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${s}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}o.__next_img_default=!0;let a=o},65856,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=(e.r(555682)._(e.r(271645))).default.createContext(null)},195057,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return u},urlObjectKeys:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(190809)._(e.r(998183)),a=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",l=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let d=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),i=i.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${u}${i}${d}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return l(e)}},573668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(718967),i=e.r(652817);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},898879,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(271645),i="u"<typeof window,o=i?()=>{}:n.useLayoutEffect,a=i?()=>{}:n.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return i&&(t?.mountedInstances?.add(e.children),l()),o(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),o(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},718967,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return x},MissingStaticPage:function(){return w},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return o},execOnce:function(){return a},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return d},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=["CLS","FCP","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class x extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(e){return JSON.stringify({message:e.message,stack:e.stack})}},307364,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(531278),i=e.i(519455),o=e.i(793479),a=e.i(110204),l=e.i(111110),s=e.i(41931),u=e.i(201276);e.s(["f",0,function({onSaved:e}){let{t:d}=(0,l.b)(),[c,f]=(0,r.useState)(String(90)),[p,h]=(0,r.useState)(null),[g,m]=(0,r.useState)(!0),[y,v]=(0,r.useState)(!1),[b,w]=(0,r.useState)(null),x=Number(c),j=""!==c.trim()&&Number.isFinite(x)&&x>=1&&x<=100&&1e-6>Math.abs(100*x-Math.round(100*x)),k=(0,r.useCallback)(async()=>{m(!0),w(null);try{let e=(await s.f.get("/api/user")).questionDuplicateThreshold??90;f(String(e)),h(e)}catch(e){w(d.importFlow.thresholdLoadFailed),u.f.error("[Settings]","加载判重阈值失败",{error:e instanceof Error?e.message:String(e)})}finally{m(!1)}},[d.importFlow.thresholdLoadFailed]);(0,r.useEffect)(()=>{k()},[k]);let S=async()=>{if(j&&null!==p){v(!0),w(null);try{let t=(await s.f.patch("/api/user",{questionDuplicateThreshold:x})).questionDuplicateThreshold??x;h(t),f(String(t)),w(d.importFlow.preferenceSaved),e?.(t)}catch(e){w(d.importFlow.preferenceSaveFailed),u.f.error("[Settings]","保存判重阈值失败",{error:e instanceof Error?e.message:String(e)})}finally{v(!1)}}};return(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsx)(a.f,{htmlFor:"question-duplicate-threshold",children:d.importFlow.thresholdLabel}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.f,{id:"question-duplicate-threshold",type:"number",min:1,max:100,step:.01,value:c,onChange:e=>{f(e.target.value),w(null)},disabled:g||y||null===p,className:"w-28","aria-describedby":"question-duplicate-threshold-hint"}),(0,t.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,t.jsxs)(i.f,{type:"button",size:"sm",variant:"outline",onClick:S,disabled:g||y||null===p||!j||x===p,children:[(g||y)&&(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}),d.importFlow.saveThreshold]}),!g&&null===p&&(0,t.jsx)(i.f,{type:"button",size:"sm",variant:"outline",onClick:k,children:d.importFlow.retryLoad})]}),(0,t.jsx)("p",{id:"question-duplicate-threshold-hint",className:"text-xs text-muted-foreground",children:d.importFlow.thresholdDescription}),null!==p&&!j&&(0,t.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:d.importFlow.thresholdInvalid}),b&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:b})]})}],307364)},487486,e=>{var t=e.i(843476),r=e.i(991918),n=e.i(225913),i=e.i(975157);let o=(0,n.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:n,asChild:a=!1,...l}){let s=a?r.M:"span";return(0,t.jsx)(s,{"data-slot":"badge",className:(0,i.f)(o({variant:n}),e),...l})}])},677572,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(981140),i=e.i(30030),o=e.i(842727),a=e.i(296626),l=e.i(248425),s=e.i(586318),u=e.i(369340),d=e.i(610772),c=Object.defineProperty,f=(e,t)=>c(e,"name",{value:t,configurable:!0}),p="Tabs",[h,g]=(0,i.f)(p,[o.B]),m=(0,o.B)(),[y,v]=h(p),b=r.forwardRef(f(function(e,r){let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:a,orientation:c="horizontal",dir:f,activationMode:h="automatic",...g}=e,m=(0,s.f)(f),[v,b]=(0,u.f)({prop:i,onChange:o,defaultProp:a??"",caller:p});return(0,t.jsx)(y,{scope:n,baseId:(0,d.f)(),value:v,onValueChange:b,orientation:c,dir:m,activationMode:h,children:(0,t.jsx)(l.V.div,{dir:m,"data-orientation":c,...g,ref:r})})},"Tabs")),w=r.forwardRef(f(function(e,r){let{__scopeTabs:n,loop:i=!0,...a}=e,s=v("TabsList",n),u=m(n);return(0,t.jsx)(o.F,{asChild:!0,...u,orientation:s.orientation,dir:s.dir,loop:i,children:(0,t.jsx)(l.V.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:r})})},"TabsList")),x=r.forwardRef(f(function(e,r){let{__scopeTabs:i,value:a,disabled:s=!1,...u}=e,d=v("TabsTrigger",i),c=m(i),f=k(d.baseId,a),p=S(d.baseId,a),h=a===d.value;return(0,t.jsx)(o.M,{asChild:!0,...c,focusable:!s,active:h,children:(0,t.jsx)(l.V.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":p,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...u,ref:r,onMouseDown:(0,n.f)(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():(e.currentTarget.focus(),d.onValueChange(a))}),onKeyDown:(0,n.f)(e.onKeyDown,e=>{!s&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&d.onValueChange(a)}),onFocus:(0,n.f)(e.onFocus,()=>{let e="manual"!==d.activationMode;h||s||!e||d.onValueChange(a)})})})},"TabsTrigger")),j=r.forwardRef(f(function(e,n){let{__scopeTabs:i,value:o,forceMount:s,children:u,...d}=e,c=v("TabsContent",i),f=k(c.baseId,o),p=S(c.baseId,o),h=o===c.value,g=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.f,{present:s||h,children:({present:r})=>(0,t.jsx)(l.V.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:p,tabIndex:0,...d,ref:n,style:{...e.style,animationDuration:g.current?"0s":void 0},children:r&&u})})},"TabsContent"));function k(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}f(k,"makeTriggerId"),f(S,"makeContentId");var M=e.i(975157);let P=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(w,{ref:n,className:(0,M.f)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...r}));P.displayName=w.displayName;let _=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(x,{ref:n,className:(0,M.f)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...r}));_.displayName=x.displayName;let C=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(j,{ref:n,className:(0,M.f)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r}));C.displayName=j.displayName,e.s(["i",0,b,"S",0,C,"U",0,P,"k",0,_],677572)},624687,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.f)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}])},215519,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(306831);let i=(0,r.createContext)({timeZone:n.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:o=n.J}){let[a,l]=(0,r.useState)(o);return(0,t.jsx)(i.Provider,{value:{timeZone:a,setTimeZone:l},children:e})},"M",0,function(){return(0,r.useContext)(i)}])}])})();
|
|
3
|
+
Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`);let s=(0,n.findClosestQuality)(a,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${s}${t.startsWith("/")&&l?`&dpl=${l}`:""}`}o.__next_img_default=!0;let a=o},65856,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return n}});let n=(e.r(555682)._(e.r(271645))).default.createContext(null)},195057,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return u},urlObjectKeys:function(){return s}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=e.r(190809)._(e.r(998183)),a=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",l=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(o.urlQueryToSearchParams(s)));let d=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),i&&"/"!==i[0]&&(i="/"+i)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),i=i.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${u}${i}${d}${l}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return l(e)}},573668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(718967),i=e.r(652817);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},898879,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return l}});let n=e.r(271645),i="u"<typeof window,o=i?()=>{}:n.useLayoutEffect,a=i?()=>{}:n.useEffect;function l(e){let{headManager:t,reduceComponentsToState:r}=e;function l(){if(t&&t.mountedInstances){let e=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return i&&(t?.mountedInstances?.add(e.children),l()),o(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),o(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},718967,(e,t,r)=>{e.i(247167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return x},MissingStaticPage:function(){return w},NormalizeError:function(){return v},PageNotFoundError:function(){return b},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return o},execOnce:function(){return a},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return d},isAbsoluteUrl:function(){return s},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return j}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let o=["CLS","FCP","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class v extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class x extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function j(e){return JSON.stringify({message:e.message,stack:e.stack})}},307364,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(531278),i=e.i(519455),o=e.i(793479),a=e.i(110204),l=e.i(111110),s=e.i(41931),u=e.i(201276);e.s(["f",0,function({onSaved:e}){let{t:d}=(0,l.b)(),[c,f]=(0,r.useState)(String(90)),[p,h]=(0,r.useState)(null),[g,m]=(0,r.useState)(!0),[y,v]=(0,r.useState)(!1),[b,w]=(0,r.useState)(null),x=Number(c),j=""!==c.trim()&&Number.isFinite(x)&&x>=1&&x<=100&&1e-6>Math.abs(100*x-Math.round(100*x)),k=(0,r.useCallback)(async()=>{m(!0),w(null);try{let e=(await s.f.get("/api/user")).questionDuplicateThreshold??90;f(String(e)),h(e)}catch(e){w(d.importFlow.thresholdLoadFailed),u.f.error("[Settings]","加载判重阈值失败",{error:e instanceof Error?e.message:String(e)})}finally{m(!1)}},[d.importFlow.thresholdLoadFailed]);(0,r.useEffect)(()=>{k()},[k]);let S=async()=>{if(j&&null!==p){v(!0),w(null);try{let t=(await s.f.patch("/api/user",{questionDuplicateThreshold:x})).questionDuplicateThreshold??x;h(t),f(String(t)),w(d.importFlow.preferenceSaved),e?.(t)}catch(e){w(d.importFlow.preferenceSaveFailed),u.f.error("[Settings]","保存判重阈值失败",{error:e instanceof Error?e.message:String(e)})}finally{v(!1)}}};return(0,t.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,t.jsx)(a.f,{htmlFor:"question-duplicate-threshold",children:d.importFlow.thresholdLabel}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.f,{id:"question-duplicate-threshold",type:"number",min:1,max:100,step:.01,value:c,onChange:e=>{f(e.target.value),w(null)},disabled:g||y||null===p,className:"w-28","aria-describedby":"question-duplicate-threshold-hint"}),(0,t.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,t.jsxs)(i.f,{type:"button",size:"sm",variant:"outline",onClick:S,disabled:g||y||null===p||!j||x===p,children:[(g||y)&&(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}),d.importFlow.saveThreshold]}),!g&&null===p&&(0,t.jsx)(i.f,{type:"button",size:"sm",variant:"outline",onClick:k,children:d.importFlow.retryLoad})]}),(0,t.jsx)("p",{id:"question-duplicate-threshold-hint",className:"text-xs text-muted-foreground",children:d.importFlow.thresholdDescription}),null!==p&&!j&&(0,t.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:d.importFlow.thresholdInvalid}),b&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:b})]})}],307364)},487486,e=>{var t=e.i(843476),r=e.i(991918),n=e.i(225913),i=e.i(975157);let o=(0,n.f)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});e.s(["f",0,function({className:e,variant:n,asChild:a=!1,...l}){let s=a?r.M:"span";return(0,t.jsx)(s,{"data-slot":"badge",className:(0,i.f)(o({variant:n}),e),...l})}])},677572,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(981140),i=e.i(30030),o=e.i(842727),a=e.i(296626),l=e.i(248425),s=e.i(586318),u=e.i(369340),d=e.i(610772),c=Object.defineProperty,f=(e,t)=>c(e,"name",{value:t,configurable:!0}),p="Tabs",[h,g]=(0,i.f)(p,[o.B]),m=(0,o.B)(),[y,v]=h(p),b=r.forwardRef(f(function(e,r){let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:a,orientation:c="horizontal",dir:f,activationMode:h="automatic",...g}=e,m=(0,s.f)(f),[v,b]=(0,u.f)({prop:i,onChange:o,defaultProp:a??"",caller:p});return(0,t.jsx)(y,{scope:n,baseId:(0,d.f)(),value:v,onValueChange:b,orientation:c,dir:m,activationMode:h,children:(0,t.jsx)(l.V.div,{dir:m,"data-orientation":c,...g,ref:r})})},"Tabs")),w=r.forwardRef(f(function(e,r){let{__scopeTabs:n,loop:i=!0,...a}=e,s=v("TabsList",n),u=m(n);return(0,t.jsx)(o.F,{asChild:!0,...u,orientation:s.orientation,dir:s.dir,loop:i,children:(0,t.jsx)(l.V.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:r})})},"TabsList")),x=r.forwardRef(f(function(e,r){let{__scopeTabs:i,value:a,disabled:s=!1,...u}=e,d=v("TabsTrigger",i),c=m(i),f=k(d.baseId,a),p=S(d.baseId,a),h=a===d.value;return(0,t.jsx)(o.M,{asChild:!0,...c,focusable:!s,active:h,children:(0,t.jsx)(l.V.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":p,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...u,ref:r,onMouseDown:(0,n.f)(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():(e.currentTarget.focus(),d.onValueChange(a))}),onKeyDown:(0,n.f)(e.onKeyDown,e=>{!s&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&d.onValueChange(a)}),onFocus:(0,n.f)(e.onFocus,()=>{let e="manual"!==d.activationMode;h||s||!e||d.onValueChange(a)})})})},"TabsTrigger")),j=r.forwardRef(f(function(e,n){let{__scopeTabs:i,value:o,forceMount:s,children:u,...d}=e,c=v("TabsContent",i),f=k(c.baseId,o),p=S(c.baseId,o),h=o===c.value,g=r.useRef(h);return r.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.f,{present:s||h,children:({present:r})=>(0,t.jsx)(l.V.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:p,tabIndex:0,...d,ref:n,style:{...e.style,animationDuration:g.current?"0s":void 0},children:r&&u})})},"TabsContent"));function k(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}f(k,"makeTriggerId"),f(S,"makeContentId");var M=e.i(975157);let P=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(w,{ref:n,className:(0,M.f)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...r}));P.displayName=w.displayName;let _=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(x,{ref:n,className:(0,M.f)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...r}));_.displayName=x.displayName;let C=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(j,{ref:n,className:(0,M.f)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r}));C.displayName=j.displayName,e.s(["i",0,b,"S",0,C,"U",0,P,"k",0,_],677572)},624687,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,r.f)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...n})}])},215519,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(306831);let i=(0,r.createContext)({timeZone:n.J,setTimeZone:()=>void 0});e.s(["n",0,function({children:e,initialTimeZone:o=n.J}){let[a,l]=(0,r.useState)(o);return(0,t.jsx)(i.Provider,{value:{timeZone:a,setTimeZone:l},children:e})},"M",0,function(){return(0,r.useContext)(i)}])},905110,e=>{e.s(["z",0,50,"o",0,100,"P",0,1,"m",0,function(e,t=50){return"number"==typeof e&&e>=t/100}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,3198,e=>{var t=e.i(475254);let r=(0,t.f)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["f",0,r],72664);var i=e.i(843476),n=e.i(271645),a=e.i(531278);let o=(0,t.f)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),s=(0,t.f)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var l=e.i(367240),h=e.i(16715),d=e.i(727612),c=e.i(519455),u=e.i(111110),m=e.i(294114),g=e.i(201276);let p=null,w=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function f(e,t,r){let i=e?.firstElementChild;i&&(i.style.width="100%",i.style.height=`${r}px`,t?.setSize(e?.offsetWidth||i.offsetWidth||800,r))}function x(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return w.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r),i=t?e[t.m]:void 0;t&&"function"==typeof i&&i.apply(e,t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):g.f.warn("[GGB]","Blocked potentially unsafe command",{command:r.substring(0,50)})}}catch(e){g.f.warn("[GGB]","Command failed",{command:r,error:e})}}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:w=!1,showMenuBar:y=!1,className:b="",onRegenerate:v,onDelete:C}){let{t:k}=(0,u.b)(),j=(0,n.useRef)(null),D=(0,n.useRef)(null),N=(0,n.useId)(),R=(0,n.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[M,E]=(0,n.useState)(!0),[S,I]=(0,n.useState)(null),[$,L]=(0,n.useState)(!0),[P,B]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(!1),_=(0,n.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,n.useEffect)(()=>{if(0===_.length)return;let e=!1,i=R.current,n=j.current;return(p||(p=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{p=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let a=window.GGBApplet;if(!a){I(k.geogebra.notLoaded),E(!1);return}if(n){n.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new a({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:w,showMenuBar:y,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(D.current=r,f(n,r,t),x(r,_),E(!1))}},!0).inject(i)}catch(t){g.f.error("[GGB]","Init failed",{error:t}),e||(I(k.geogebra.initFailed),E(!1))}}}).catch(t=>{g.f.error("[GGB]","Script load failed",{error:t}),e||(I(k.geogebra.scriptFailed),E(!1))}),()=>{e=!0;try{let e=D.current;e?.remove&&e.remove()}catch(e){g.f.warn("[GGB]","Cleanup failed",{error:e})}D.current=null,n&&(n.innerHTML="")}},[_,r,w,y]),(0,n.useEffect)(()=>{f(j.current,D.current,$?700:t)},[$,t]);let z=(0,n.useCallback)(()=>{let e=D.current;if(e)try{e.resetConstruction(),setTimeout(()=>{D.current&&x(D.current,_)},300)}catch(e){g.f.warn("[GGB]","Reset failed",{error:e})}},[_]),H=(0,n.useCallback)(async()=>{if(v&&!P){B(!0);try{await v()}finally{B(!1)}}},[v,P]),A=(0,n.useCallback)(async()=>{if(C&&!Y&&await (0,m.u)(k.geogebra.confirmDelete,{destructive:!0})){X(!0);try{await C()}catch{m.c.error(k.geogebra.deleteFailed)}finally{X(!1)}}},[C,Y,k]);return 0===_.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${b}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),M&&(0,i.jsx)(a.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[v&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:H,title:k.geogebra.regenerate,disabled:P||M,children:[P?(0,i.jsx)(a.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(h.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),C&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:A,title:k.geogebra.delete,disabled:Y||P,children:[Y?(0,i.jsx)(a.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:z,title:k.geogebra.reset,disabled:M,children:(0,i.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>L(e=>!e),title:$?k.geogebra.shrink:k.geogebra.enlarge,children:$?(0,i.jsx)(s,{className:"h-3.5 w-3.5"}):(0,i.jsx)(o,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:j,style:{width:"100%"}}),M&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(a.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),S&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:S})]})}],3198)},12130,e=>{var t=e.i(843476),r=e.i(271645),i=r,n={x:0,y:0,width:0,height:0,unit:"px"},a=(e,t,r)=>Math.min(Math.max(e,t),r),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,r){return"%"===e.unit?{...n,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function l(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...n,...e,unit:"px"}}function h(e,t,r,i,n,a=0,o=0,s=i,l=n){let d={...e},c=Math.min(a,i),u=Math.min(o,n),m=Math.min(s,i),g=Math.min(l,n);t&&(t>1?(u=(c=o?o*t:c)/t,m=s*t):(c=(u=a?a/t:u)*t,g=l/t)),d.y<0&&(d.height=Math.max(d.height+d.y,u),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,c),d.x=0);let p=i-(d.x+d.width);p<0&&(d.x=Math.min(d.x,i-c),d.width+=p);let w=n-(d.y+d.height);if(w<0&&(d.y=Math.min(d.y,n-u),d.height+=w),d.width<c&&(("sw"===r||"nw"==r)&&(d.x-=c-d.width),d.width=c),d.height<u&&(("nw"===r||"ne"==r)&&(d.y-=u-d.height),d.height=u),d.width>m&&(("sw"===r||"nw"==r)&&(d.x-=m-d.width),d.width=m),d.height>g&&(("nw"===r||"ne"==r)&&(d.y-=g-d.height),d.height=g),t){let e=d.width/d.height;if(e<t){let e=Math.max(d.width/t,u);("nw"===r||"ne"==r)&&(d.y-=e-d.height),d.height=e}else if(e>t){let e=Math.max(d.height*t,c);("sw"===r||"nw"==r)&&(d.x-=e-d.width),d.width=e}}return d}var d={capture:!0,passive:!1},c=0,u=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:n}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:n}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(l(t,e,i),s(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let n=l(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,s=e.clientY,h=n.x,d=n.y;if(a){let t=e.clientX-i.x,r=e.clientY-i.y,l=0,c=0;"ne"===a||"e"==a?(l=t-(n.x+n.width),c=r-n.y,h=n.x,d=n.y+n.height):"se"===a||"s"===a?(l=t-(n.x+n.width),c=r-(n.y+n.height),h=n.x,d=n.y):"sw"===a||"w"==a?(l=t-n.x,c=r-(n.y+n.height),h=n.x+n.width,d=n.y):("nw"===a||"n"==a)&&(l=t-n.x,c=r-n.y,h=n.x+n.width,d=n.y+n.height),o=h+i.x+l,s=d+i.y+c}this.evData={startClientX:o,startClientY:s,startCropX:h,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:i,keepSelection:n,onChange:a}=this.props,o=this.getBox();if(r||i||n&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let h=e.clientX-o.x,d=e.clientY-o.y,c={unit:"px",x:h,y:d,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(l(c,o.width,o.height),s(c,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:i,onChange:n,onDragStart:a}=this.props,h=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:d}=this;d.clientX=e.clientX,d.clientY=e.clientY,o(r,t=d.isResize?this.resizeCrop():this.dragCrop())||n(l(t,h.width,h.height),s(t,h.width,h.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:n,onComplete:o}=this.props;if(i)return;let h=t.key,d=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===h?(u.x-=m,d=!0):"ArrowRight"===h?(u.x+=m,d=!0):"ArrowUp"===h?(u.y-=m,d=!0):"ArrowDown"===h&&(u.y+=m,d=!0),d){t.cancelable&&t.preventDefault(),u.x=a(u.x,0,c.width-u.width),u.y=a(u.y,0,c.height-u.height);let e=l(u,c.width,c.height),r=s(u,c.width,c.height);n(e,r),o&&o(e,r)}};onHandlerKeyDown=(t,r)=>{var i,n;let a,{aspect:d=0,crop:c,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:f,onComplete:x}=this.props,y=this.getBox();if(u||!c||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=h((i=l(c,y.width,y.height),n=t.key,a={...i},"ArrowLeft"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===r?(a.x-=b,a.width+=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"e"===r?a.width-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowRight"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===r?(a.x+=b,a.width-=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"e"===r?a.width+=b:"se"===r&&(a.width+=b,a.height+=b)),"ArrowUp"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===r?(a.y-=b,a.height+=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"s"===r?a.height-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowDown"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===r?(a.y+=b,a.height-=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"s"===r?a.height+=b:"se"===r&&(a.width+=b,a.height+=b)),a),d,r,y.width,y.height,m,g,p,w);if(!o(c,v)){let e=s(v,y.width,y.height);f(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:n}=this.props,a=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(e),i&&i(l(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,n=e.clientY-e.startClientY;return r.x=a(e.startCropX+i,0,t.width-r.width),r.y=a(e.startCropY+n,0,t.height-r.height),r}getPointRegion(e,t,r,i){let{evData:n}=this,a=n.clientX-e.x,o=n.clientY-e.y,s;return s=i&&t?"nw"===t||"n"===t||"ne"===t:o<n.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:a<n.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let n=Math.min(r,e.width),a=Math.min(i,e.height);return t&&(n||a)?t>1?n?[n,n/t]:[a*t,a]:a?[a*t,a]:[n,n/t]:[n,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:n}=this.props,o=this.getBox(),[s,l]=this.resolveMinDimensions(o,r,this.props.minWidth,this.props.minHeight),d=this.makePixelCrop(o),c=this.getPointRegion(o,t.ord,s,l),u=t.ord||c,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-s)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===c?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===c&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let w=h(p,r,c,o.width,o.height,s,l,i,n);return r||e.xyOrds.indexOf(u)>-1?d=w:e.xOrds.indexOf(u)>-1?(d.x=w.x,d.width=w.width):e.yOrds.indexOf(u)>-1&&(d.y=w.y,d.height=w.height),d.x=a(d.x,0,o.width-d.width),d.y=a(d.y,0,o.height-d.height),d}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,l=this.getCropStyle();if(s)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...n,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:n,crop:a,disabled:o,locked:s,style:l,ruleOfThirds:h}=this.props,{cropIsActive:d,newCropIsBeingDrawn:c}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,d&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",c&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&r&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},m=e.i(519455),g=e.i(776639),p=e.i(37727),w=e.i(111110);async function f(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((n,a)=>{let o=document.createElement("canvas"),s=Math.round(t.x*r),l=Math.round(t.y*i);o.width=Math.max(1,Math.round(t.width*r)),o.height=Math.max(1,Math.round(t.height*i));let h=o.getContext("2d");h?(h.drawImage(e,s,l,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?n(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let x={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},y=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:n,imageStyle:a=x,onImageLoad:o},s){let{t:l}=(0,w.b)(),h=(0,r.useRef)(null),d=(0,r.useRef)(null),[c,u]=(0,r.useState)(null),m=e=>{let t=h.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},g=()=>{c&&c.width>=.02&&c.height>=.02&&n([...i,c]),d.current=null,u(null)},f=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:s,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:h,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(h.current?.setPointerCapture(e.pointerId),d.current=m(e),u(null))},onPointerMove:e=>{var t,r,i,n;let a,o,s;if(!d.current)return;let l=m(e);u((t=d.current.x,r=d.current.y,i=l.x,n=l.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),s=a(Math.min(r,n)),{x:o,y:s,width:a(Math.max(t,i))-o,height:a(Math.max(r,n))-s}))},onPointerUp:g,onPointerCancel:g,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:f(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":l.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>n(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(p.X,{className:"h-3 w-3"})})]},r)),c&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:f(c)})]})]})});var b=e.i(475254);let v=(0,b.f)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),C=(0,b.f)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function k({zoom:e,onZoomIn:r,onZoomOut:i,onReset:n}){let{t:a}=(0,w.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",s=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:s,onClick:i,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:n,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:s,onClick:r,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(v,{className:"h-4 w-4"})})]})}var j=e.i(201276);let D={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:i,onClose:n,onCropComplete:a,onMultiCropComplete:o}){let{t:s}=(0,w.b)(),[l,h]=(0,r.useState)(),d=(0,r.useRef)(null),[c,p]=(0,r.useState)("single"),{containerRef:x,zoom:b,imageStyle:v,measureImage:C,zoomIn:N,zoomOut:R,reset:M}=function(e){let[t,i]=(0,r.useState)(null),n=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{n.current=e,i(e)},[]),[o,s]=(0,r.useState)(1),l=(0,r.useRef)(1),[h,d]=(0,r.useState)(null),c=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let i=n.current,a=l.current,o=Math.min(5,Math.max(1,e));if(!i||o===a)return;if(1===a){let e=i.querySelector("img");e&&d(e.clientWidth)}let h=i.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(r??h.top+h.height/2)-h.top;c.current={viewX:u,viewY:m,contentX:i.scrollLeft+u,contentY:i.scrollTop+m,ratio:o/a},l.current=o,s(o)},[]);(0,r.useLayoutEffect)(()=>{let e=n.current,t=c.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,c.current=null)},[o]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(l.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},r=null,i=e=>{let[t,r]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY),centerX:(t.clientX+r.clientX)/2,centerY:(t.clientY+r.clientY)/2}},n=e=>{2===e.touches.length&&(r={distance:i(e.touches).distance,zoom:l.current},u.current=!0)},a=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:n,centerY:a}=i(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),n,a)},o=e=>{e.touches.length<2&&(r=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",n),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&d(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),w=(0,r.useCallback)(()=>m(l.current/1.25),[m]),f=(0,r.useCallback)(()=>{l.current=1,c.current=null,s(1)},[]),x=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:w,reset:f}}(D[c]);(0,r.useEffect)(()=>{M()},[e,M]);let[E,S]=(0,r.useState)({src:e,regions:[]}),I=E.src===e?E.regions:[],$=t=>S({src:e,regions:t}),L=(0,r.useRef)(null),P=async()=>{if(L.current&&0!==I.length&&o)try{o(await f(L.current,I)),$([])}catch(e){j.f.error("[ImageCropper]","Multi-image crop failed",{error:e})}},B=async()=>{if(!d.current)return;let e=l&&l.width>0&&l.height>0?{x:l.x/100,y:l.y/100,width:l.width/100,height:l.height/100}:{x:0,y:0,width:1,height:1};try{let[t]=await f(d.current,[e]);a(t)}catch(e){j.f.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(g.N,{open:i,onOpenChange:e=>!e&&n(),children:(0,t.jsxs)(g.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(g.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(g.F,{children:s.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:x,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===c?(0,t.jsx)(y,{ref:L,imageSrc:e,regions:I,onChange:$,imageStyle:v,onImageLoad:e=>C(e.currentTarget)}):(0,t.jsx)(u,{crop:l,onChange:(e,t)=>h(t),children:(0,t.jsx)("img",{ref:d,alt:"Crop me",src:e,onLoad:function(e){h({unit:"%",x:0,y:0,width:100,height:100}),C(e.currentTarget)},style:v})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(k,{zoom:b,onZoomIn:N,onZoomOut:R,onReset:M})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[o&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{M(),p(e)},className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${c===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?s.batchImport.singleMode:s.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===c?`${s.batchImport.hint} ${s.batchImport.regionCount.replace("{count}",String(I.length))}`:s.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===c&&I.length>0&&(0,t.jsx)(m.f,{variant:"ghost",onClick:()=>$([]),children:s.batchImport.clear}),(0,t.jsx)(m.f,{variant:"outline",onClick:n,children:s.common.cancel||"Cancel"}),"multi"===c?(0,t.jsx)(m.f,{onClick:P,disabled:0===I.length,children:s.batchImport.start.replace("{count}",String(I.length))}):(0,t.jsx)(m.f,{onClick:B,children:s.common.confirm||"Confirm"})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645);let i=(0,e.i(475254).f)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var n=e.i(286536),a=e.i(511445),o=e.i(624687),s=e.i(111110),l=e.i(975157);e.s(["f",0,function({value:e,onChange:h,className:d,...c}){let{t:u}=(0,s.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),w=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:w.map(({mode:e,label:r,icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,l.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(o.f,{value:e,onChange:e=>h(e.target.value),className:d,...c}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(a.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(967489),n=e.i(810980),a=e.i(41931),o=e.i(201276),s=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:h}){let[d,c]=(0,r.useState)([]),{t:u}=(0,s.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await a.f.get("/api/notebooks");c(e)}catch(e){o.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(i.d,{value:e,onValueChange:l,children:[(0,t.jsx)(i.P,{className:h,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(i.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(i.r,{children:0===d.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):d.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},28928,e=>{var t=e.i(201276);async function r(e,i=1,n=1920,a=.8){return new Promise((r,o)=>{let s=new FileReader;s.onload=s=>{let l=new Image;l.onload=()=>{let s=document.createElement("canvas"),h=s.getContext("2d");if(!h)return void o(Error("无法获取 Canvas 上下文"));let d=l.width,c=l.height;d>n&&(c=c*n/d,d=n),s.width=d,s.height=c,h.drawImage(l,0,0,d,c);let u=a,m=s.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>i&&u>.1;){u-=.1;let e=3*(m=s.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.f.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=i)break}t.f.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>o(Error("图片加载失败")),l.src=s.target?.result},s.onerror=()=>o(Error("文件读取失败")),s.readAsDataURL(e)})}async function i(e){let i=e.size/1024/1024;return(t.f.info("[ImageCompress]","File size checked",{sizeMB:Number(i.toFixed(2))},{sendToBackend:!1}),i>1)?(t.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["f",0,i])},943710,e=>{e.s(["f",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,3198,e=>{var t=e.i(475254);let r=(0,t.f)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["f",0,r],72664);var i=e.i(843476),n=e.i(271645),a=e.i(531278);let o=(0,t.f)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),s=(0,t.f)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var l=e.i(367240),h=e.i(16715),d=e.i(727612),c=e.i(519455),u=e.i(111110),m=e.i(294114),g=e.i(201276);let p=null,w=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function f(e,t,r){let i=e?.firstElementChild;i&&(i.style.width="100%",i.style.height=`${r}px`,t?.setSize(e?.offsetWidth||i.offsetWidth||800,r))}function x(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return w.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r),i=t?e[t.m]:void 0;t&&"function"==typeof i&&i.apply(e,t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):g.f.warn("[GGB]","Blocked potentially unsafe command",{command:r.substring(0,50)})}}catch(e){g.f.warn("[GGB]","Command failed",{command:r,error:e})}}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:w=!1,showMenuBar:y=!1,className:b="",onRegenerate:v,onDelete:C}){let{t:k}=(0,u.b)(),j=(0,n.useRef)(null),D=(0,n.useRef)(null),N=(0,n.useId)(),R=(0,n.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[M,E]=(0,n.useState)(!0),[S,I]=(0,n.useState)(null),[$,L]=(0,n.useState)(!0),[P,B]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(!1),_=(0,n.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,n.useEffect)(()=>{if(0===_.length)return;let e=!1,i=R.current,n=j.current;return(p||(p=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{p=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let a=window.GGBApplet;if(!a){I(k.geogebra.notLoaded),E(!1);return}if(n){n.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new a({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:w,showMenuBar:y,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(D.current=r,f(n,r,t),x(r,_),E(!1))}},!0).inject(i)}catch(t){g.f.error("[GGB]","Init failed",{error:t}),e||(I(k.geogebra.initFailed),E(!1))}}}).catch(t=>{g.f.error("[GGB]","Script load failed",{error:t}),e||(I(k.geogebra.scriptFailed),E(!1))}),()=>{e=!0;try{let e=D.current;e?.remove&&e.remove()}catch(e){g.f.warn("[GGB]","Cleanup failed",{error:e})}D.current=null,n&&(n.innerHTML="")}},[_,r,w,y]),(0,n.useEffect)(()=>{f(j.current,D.current,$?700:t)},[$,t]);let z=(0,n.useCallback)(()=>{let e=D.current;if(e)try{e.resetConstruction(),setTimeout(()=>{D.current&&x(D.current,_)},300)}catch(e){g.f.warn("[GGB]","Reset failed",{error:e})}},[_]),H=(0,n.useCallback)(async()=>{if(v&&!P){B(!0);try{await v()}finally{B(!1)}}},[v,P]),A=(0,n.useCallback)(async()=>{if(C&&!Y&&await (0,m.u)(k.geogebra.confirmDelete,{destructive:!0})){X(!0);try{await C()}catch{m.c.error(k.geogebra.deleteFailed)}finally{X(!1)}}},[C,Y,k]);return 0===_.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${b}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),M&&(0,i.jsx)(a.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[v&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:H,title:k.geogebra.regenerate,disabled:P||M,children:[P?(0,i.jsx)(a.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(h.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),C&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:A,title:k.geogebra.delete,disabled:Y||P,children:[Y?(0,i.jsx)(a.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:z,title:k.geogebra.reset,disabled:M,children:(0,i.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>L(e=>!e),title:$?k.geogebra.shrink:k.geogebra.enlarge,children:$?(0,i.jsx)(s,{className:"h-3.5 w-3.5"}):(0,i.jsx)(o,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:j,style:{width:"100%"}}),M&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(a.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),S&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:S})]})}],3198)},12130,e=>{var t=e.i(843476),r=e.i(271645),i=r,n={x:0,y:0,width:0,height:0,unit:"px"},a=(e,t,r)=>Math.min(Math.max(e,t),r),o=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function s(e,t,r){return"%"===e.unit?{...n,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function l(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...n,...e,unit:"px"}}function h(e,t,r,i,n,a=0,o=0,s=i,l=n){let d={...e},c=Math.min(a,i),u=Math.min(o,n),m=Math.min(s,i),g=Math.min(l,n);t&&(t>1?(u=(c=o?o*t:c)/t,m=s*t):(c=(u=a?a/t:u)*t,g=l/t)),d.y<0&&(d.height=Math.max(d.height+d.y,u),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,c),d.x=0);let p=i-(d.x+d.width);p<0&&(d.x=Math.min(d.x,i-c),d.width+=p);let w=n-(d.y+d.height);if(w<0&&(d.y=Math.min(d.y,n-u),d.height+=w),d.width<c&&(("sw"===r||"nw"==r)&&(d.x-=c-d.width),d.width=c),d.height<u&&(("nw"===r||"ne"==r)&&(d.y-=u-d.height),d.height=u),d.width>m&&(("sw"===r||"nw"==r)&&(d.x-=m-d.width),d.width=m),d.height>g&&(("nw"===r||"ne"==r)&&(d.y-=g-d.height),d.height=g),t){let e=d.width/d.height;if(e<t){let e=Math.max(d.width/t,u);("nw"===r||"ne"==r)&&(d.y-=e-d.height),d.height=e}else if(e>t){let e=Math.max(d.height*t,c);("sw"===r||"nw"==r)&&(d.x-=e-d.width),d.width=e}}return d}var d={capture:!0,passive:!1},c=0,u=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:n}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:n}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(l(t,e,i),s(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let n=l(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,s=e.clientY,h=n.x,d=n.y;if(a){let t=e.clientX-i.x,r=e.clientY-i.y,l=0,c=0;"ne"===a||"e"==a?(l=t-(n.x+n.width),c=r-n.y,h=n.x,d=n.y+n.height):"se"===a||"s"===a?(l=t-(n.x+n.width),c=r-(n.y+n.height),h=n.x,d=n.y):"sw"===a||"w"==a?(l=t-n.x,c=r-(n.y+n.height),h=n.x+n.width,d=n.y):("nw"===a||"n"==a)&&(l=t-n.x,c=r-n.y,h=n.x+n.width,d=n.y+n.height),o=h+i.x+l,s=d+i.y+c}this.evData={startClientX:o,startClientY:s,startCropX:h,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:i,keepSelection:n,onChange:a}=this.props,o=this.getBox();if(r||i||n&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let h=e.clientX-o.x,d=e.clientY-o.y,c={unit:"px",x:h,y:d,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(l(c,o.width,o.height),s(c,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:i,onChange:n,onDragStart:a}=this.props,h=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:d}=this;d.clientX=e.clientX,d.clientY=e.clientY,o(r,t=d.isResize?this.resizeCrop():this.dragCrop())||n(l(t,h.width,h.height),s(t,h.width,h.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:n,onComplete:o}=this.props;if(i)return;let h=t.key,d=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===h?(u.x-=m,d=!0):"ArrowRight"===h?(u.x+=m,d=!0):"ArrowUp"===h?(u.y-=m,d=!0):"ArrowDown"===h&&(u.y+=m,d=!0),d){t.cancelable&&t.preventDefault(),u.x=a(u.x,0,c.width-u.width),u.y=a(u.y,0,c.height-u.height);let e=l(u,c.width,c.height),r=s(u,c.width,c.height);n(e,r),o&&o(e,r)}};onHandlerKeyDown=(t,r)=>{var i,n;let a,{aspect:d=0,crop:c,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:f,onComplete:x}=this.props,y=this.getBox();if(u||!c||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=h((i=l(c,y.width,y.height),n=t.key,a={...i},"ArrowLeft"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===r?(a.x-=b,a.width+=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"e"===r?a.width-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowRight"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===r?(a.x+=b,a.width-=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"e"===r?a.width+=b:"se"===r&&(a.width+=b,a.height+=b)),"ArrowUp"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===r?(a.y-=b,a.height+=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"s"===r?a.height-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowDown"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===r?(a.y+=b,a.height-=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"s"===r?a.height+=b:"se"===r&&(a.width+=b,a.height+=b)),a),d,r,y.width,y.height,m,g,p,w);if(!o(c,v)){let e=s(v,y.width,y.height);f(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:n}=this.props,a=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(e),i&&i(l(t,a.width,a.height),s(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,n=e.clientY-e.startClientY;return r.x=a(e.startCropX+i,0,t.width-r.width),r.y=a(e.startCropY+n,0,t.height-r.height),r}getPointRegion(e,t,r,i){let{evData:n}=this,a=n.clientX-e.x,o=n.clientY-e.y,s;return s=i&&t?"nw"===t||"n"===t||"ne"===t:o<n.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:a<n.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let n=Math.min(r,e.width),a=Math.min(i,e.height);return t&&(n||a)?t>1?n?[n,n/t]:[a*t,a]:a?[a*t,a]:[n,n/t]:[n,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:n}=this.props,o=this.getBox(),[s,l]=this.resolveMinDimensions(o,r,this.props.minWidth,this.props.minHeight),d=this.makePixelCrop(o),c=this.getPointRegion(o,t.ord,s,l),u=t.ord||c,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-s)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===c?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===c&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let w=h(p,r,c,o.width,o.height,s,l,i,n);return r||e.xyOrds.indexOf(u)>-1?d=w:e.xOrds.indexOf(u)>-1?(d.x=w.x,d.width=w.width):e.yOrds.indexOf(u)>-1&&(d.y=w.y,d.height=w.height),d.x=a(d.x,0,o.width-d.width),d.y=a(d.y,0,o.height-d.height),d}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,l=this.getCropStyle();if(s)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...n,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:n,crop:a,disabled:o,locked:s,style:l,ruleOfThirds:h}=this.props,{cropIsActive:d,newCropIsBeingDrawn:c}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,d&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",c&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&r&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},m=e.i(519455),g=e.i(776639),p=e.i(37727),w=e.i(111110);async function f(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((n,a)=>{let o=document.createElement("canvas"),s=Math.round(t.x*r),l=Math.round(t.y*i);o.width=Math.max(1,Math.round(t.width*r)),o.height=Math.max(1,Math.round(t.height*i));let h=o.getContext("2d");h?(h.drawImage(e,s,l,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?n(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let x={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},y=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:n,imageStyle:a=x,onImageLoad:o},s){let{t:l}=(0,w.b)(),h=(0,r.useRef)(null),d=(0,r.useRef)(null),[c,u]=(0,r.useState)(null),m=e=>{let t=h.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},g=()=>{c&&c.width>=.02&&c.height>=.02&&n([...i,c]),d.current=null,u(null)},f=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:s,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:h,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(h.current?.setPointerCapture(e.pointerId),d.current=m(e),u(null))},onPointerMove:e=>{var t,r,i,n;let a,o,s;if(!d.current)return;let l=m(e);u((t=d.current.x,r=d.current.y,i=l.x,n=l.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),s=a(Math.min(r,n)),{x:o,y:s,width:a(Math.max(t,i))-o,height:a(Math.max(r,n))-s}))},onPointerUp:g,onPointerCancel:g,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:f(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":l.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>n(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(p.X,{className:"h-3 w-3"})})]},r)),c&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:f(c)})]})]})});var b=e.i(475254);let v=(0,b.f)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),C=(0,b.f)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function k({zoom:e,onZoomIn:r,onZoomOut:i,onReset:n}){let{t:a}=(0,w.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",s=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:s,onClick:i,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:n,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:s,onClick:r,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(v,{className:"h-4 w-4"})})]})}var j=e.i(201276);let D={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:i,onClose:n,onCropComplete:a,onMultiCropComplete:o}){let{t:s}=(0,w.b)(),l=/^(blob:|data:image\/)/i.test(e)?e:void 0,[h,d]=(0,r.useState)(),c=(0,r.useRef)(null),[p,x]=(0,r.useState)("single"),{containerRef:b,zoom:v,imageStyle:C,measureImage:N,zoomIn:R,zoomOut:M,reset:E}=function(e){let[t,i]=(0,r.useState)(null),n=(0,r.useRef)(null),a=(0,r.useCallback)(e=>{n.current=e,i(e)},[]),[o,s]=(0,r.useState)(1),l=(0,r.useRef)(1),[h,d]=(0,r.useState)(null),c=(0,r.useRef)(null),u=(0,r.useRef)(!1),m=(0,r.useCallback)((e,t,r)=>{let i=n.current,a=l.current,o=Math.min(5,Math.max(1,e));if(!i||o===a)return;if(1===a){let e=i.querySelector("img");e&&d(e.clientWidth)}let h=i.getBoundingClientRect(),u=(t??h.left+h.width/2)-h.left,m=(r??h.top+h.height/2)-h.top;c.current={viewX:u,viewY:m,contentX:i.scrollLeft+u,contentY:i.scrollTop+m,ratio:o/a},l.current=o,s(o)},[]);(0,r.useLayoutEffect)(()=>{let e=n.current,t=c.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,c.current=null)},[o]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(l.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},r=null,i=e=>{let[t,r]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-r.clientX,t.clientY-r.clientY),centerX:(t.clientX+r.clientX)/2,centerY:(t.clientY+r.clientY)/2}},n=e=>{2===e.touches.length&&(r={distance:i(e.touches).distance,zoom:l.current},u.current=!0)},a=e=>{if(!r||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:n,centerY:a}=i(e.touches);r.distance>0&&m(r.zoom*(t/r.distance),n,a)},o=e=>{e.touches.length<2&&(r=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",n),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,r.useCallback)(e=>{e&&1===l.current&&d(e.clientWidth)},[]),p=(0,r.useCallback)(()=>m(1.25*l.current),[m]),w=(0,r.useCallback)(()=>m(l.current/1.25),[m]),f=(0,r.useCallback)(()=>{l.current=1,c.current=null,s(1)},[]),x=1!==o&&h?{...e,width:h*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:w,reset:f}}(D[p]);(0,r.useEffect)(()=>{E()},[e,E]);let[S,I]=(0,r.useState)({src:e,regions:[]}),$=S.src===e?S.regions:[],L=t=>I({src:e,regions:t}),P=(0,r.useRef)(null),B=async()=>{if(P.current&&0!==$.length&&o)try{o(await f(P.current,$)),L([])}catch(e){j.f.error("[ImageCropper]","Multi-image crop failed",{error:e})}},Y=async()=>{if(!c.current)return;let e=h&&h.width>0&&h.height>0?{x:h.x/100,y:h.y/100,width:h.width/100,height:h.height/100}:{x:0,y:0,width:1,height:1};try{let[t]=await f(c.current,[e]);a(t)}catch(e){j.f.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(g.N,{open:i,onOpenChange:e=>!e&&n(),children:(0,t.jsxs)(g.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(g.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(g.F,{children:s.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:b,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===p?(0,t.jsx)(y,{ref:P,imageSrc:l,regions:$,onChange:L,imageStyle:C,onImageLoad:e=>N(e.currentTarget)}):(0,t.jsx)(u,{crop:h,onChange:(e,t)=>d(t),children:(0,t.jsx)("img",{ref:c,alt:"Crop me",src:l,onLoad:function(e){d({unit:"%",x:0,y:0,width:100,height:100}),N(e.currentTarget)},style:C})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(k,{zoom:v,onZoomIn:R,onZoomOut:M,onReset:E})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[o&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{E(),x(e)},className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${p===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?s.batchImport.singleMode:s.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===p?`${s.batchImport.hint} ${s.batchImport.regionCount.replace("{count}",String($.length))}`:s.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===p&&$.length>0&&(0,t.jsx)(m.f,{variant:"ghost",onClick:()=>L([]),children:s.batchImport.clear}),(0,t.jsx)(m.f,{variant:"outline",onClick:n,children:s.common.cancel||"Cancel"}),"multi"===p?(0,t.jsx)(m.f,{onClick:B,disabled:0===$.length,children:s.batchImport.start.replace("{count}",String($.length))}):(0,t.jsx)(m.f,{onClick:Y,children:s.common.confirm||"Confirm"})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645);let i=(0,e.i(475254).f)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var n=e.i(286536),a=e.i(511445),o=e.i(624687),s=e.i(111110),l=e.i(975157);e.s(["f",0,function({value:e,onChange:h,className:d,...c}){let{t:u}=(0,s.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),w=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:w.map(({mode:e,label:r,icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,l.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(o.f,{value:e,onChange:e=>h(e.target.value),className:d,...c}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(a.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(967489),n=e.i(810980),a=e.i(41931),o=e.i(201276),s=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:h}){let[d,c]=(0,r.useState)([]),{t:u}=(0,s.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await a.f.get("/api/notebooks");c(e)}catch(e){o.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(i.d,{value:e,onValueChange:l,children:[(0,t.jsx)(i.P,{className:h,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(i.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(i.r,{children:0===d.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):d.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},28928,e=>{var t=e.i(201276);async function r(e,i=1,n=1920,a=.8){return new Promise((r,o)=>{let s=new FileReader;s.onload=s=>{let l=new Image;l.onload=()=>{let s=document.createElement("canvas"),h=s.getContext("2d");if(!h)return void o(Error("无法获取 Canvas 上下文"));let d=l.width,c=l.height;d>n&&(c=c*n/d,d=n),s.width=d,s.height=c,h.drawImage(l,0,0,d,c);let u=a,m=s.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>i&&u>.1;){u-=.1;let e=3*(m=s.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.f.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=i)break}t.f.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>o(Error("图片加载失败")),l.src=s.target?.result},s.onerror=()=>o(Error("文件读取失败")),s.readAsDataURL(e)})}async function i(e){let i=e.size/1024/1024;return(t.f.info("[ImageCompress]","File size checked",{sizeMB:Number(i.toFixed(2))},{sendToBackend:!1}),i>1)?(t.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["f",0,i])},943710,e=>{e.s(["f",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}])})();
|