wrong-notebook 2026.11.1 → 2026.11.2-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 +6 -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/cnm-tags/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/admin/cnm-tags/route/build-manifest.json +12 -0
- package/.next/server/app/api/admin/cnm-tags/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/admin/cnm-tags/route.js +12 -0
- package/.next/server/app/api/admin/cnm-tags/route.js.map +5 -0
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -0
- package/.next/server/app/api/admin/cnm-tags/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/admin/dashboard/route.js +10 -10
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +10 -10
- 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 +4 -4
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +8 -8
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +8 -8
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +4 -4
- 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 +10 -10
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js +7 -7
- 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 +13 -13
- 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 +10 -10
- package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/retag/route.js +9 -9
- 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.js +10 -10
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +10 -10
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js.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 +11 -11
- 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 +13 -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 +10 -10
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +9 -9
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +13 -13
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +12 -12
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +6 -6
- 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 +13 -13
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +12 -12
- 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 +8 -8
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +9 -9
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +6 -6
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +10 -10
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +10 -10
- 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/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +8 -8
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js +6 -6
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js +5 -5
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js +4 -4
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +9 -9
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/chunks/[root-of-the-server]__02dkbynj2vxld._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0z24ffpp1rsf3._.js → [root-of-the-server]__08t21dbk1cidn._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__09jqnx_673l93._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0tflqqgyujt1r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__18z_cczwqkonn._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0rpqerm37sl_v._.js → [root-of-the-server]__1f_lrxzw_n-6-._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ptzu7aqoga2n._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1r0s6pktkiqkf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1r_x7moz0opqt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1mfrik5p09lu9._.js → [root-of-the-server]__1sggr1m3ukvts._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__1v1p83o4ygnyt._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1wh65tfd7apxx._.js +3 -0
- package/.next/server/chunks/_0dicq393_0h3i._.js +3 -0
- package/.next/server/chunks/{_0jgk7kwvf4_6i._.js → _0x3jdlmx-bey5._.js} +1 -1
- package/.next/server/chunks/_10tpt8iizl4v3._.js +3 -3
- package/.next/server/chunks/_1dvka-waihfum._.js +3 -3
- package/.next/server/chunks/_1yujnc0thk8ab._.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_admin_cnm-tags_route_actions_1en5m631bmjfo.js +3 -0
- package/.next/server/chunks/src_lib_0r67kyyoh6ky6._.js +1 -1
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +46 -42
- package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +1 -1
- package/.next/server/chunks/src_lib_logger_ts_1a0ve505bb0y2._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0fy6mc47ccfce._.js +1 -1
- package/.next/server/chunks/ssr/_02zfjls23g-o4._.js +1 -1
- package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +1 -1
- package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
- package/.next/server/chunks/ssr/_0ltqx22v65imo._.js +1 -1
- package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
- package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_0tr-7klbcz1r7._.js +3 -0
- package/.next/server/chunks/ssr/_0xsd7dy2sxg53._.js +3 -0
- package/.next/server/chunks/ssr/_1-i5cy964i_s9._.js +3 -0
- package/.next/server/chunks/ssr/_12toteu0ut39i._.js +3 -0
- package/.next/server/chunks/ssr/_1cc3psc9rvrwn._.js +1 -1
- package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +2 -2
- package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +2 -2
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_play_mjs_1al5hft92dlrg._.js +1 -1
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_app_admin_page_tsx_0ublbd0w90cx_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_admin_user_[id]_page_tsx_0zidp-8hr5upa._.js +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
- package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +9 -9
- package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
- package/.next/server/chunks/ssr/src_app_practice_page_tsx_10gnx53v3kpzb._.js +1 -1
- package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
- package/.next/server/chunks/ssr/src_app_register_page_tsx_0l87b3754fa2j._.js +1 -1
- package/.next/server/chunks/ssr/src_app_review_page_tsx_1rq4ygvo_szv0._.js +1 -1
- package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_1od0rowgu8w6v._.js +1 -1
- package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
- package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +33 -0
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +73 -17
- package/.next/server/chunks/ssr/src_components_tag-input_tsx_0b9sxffna5c9i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{42p60iwe4ayfi.js → 06bfusm1eqhzt.js} +1 -1
- package/.next/static/chunks/{1oqx_8e83xfjr.js → 0fu1xttg42yzk.js} +1 -1
- package/.next/static/chunks/{1wq7na8axxyfd.js → 0nq5_ne_bugdp.js} +1 -1
- package/.next/static/chunks/0xuzdy0dn7jkp.js +63 -0
- package/.next/static/chunks/{1dyf1qqv2ckxs.js → 1-00icoq9w3_i.js} +1 -1
- package/.next/static/chunks/{2r4x8vhlmc092.js → 1b5jj8zk0mtzk.js} +1 -1
- package/.next/static/chunks/{3fohh6i-hrda9.js → 1d-3q230sjpsa.js} +1 -1
- package/.next/static/chunks/{1gvev34tv39bd.js → 1fa2xv93zl8oj.js} +1 -1
- package/.next/static/chunks/{370c45nip4mld.js → 1g13qcek7-0du.js} +1 -1
- package/.next/static/chunks/1iixgyplm7q17.js +247 -0
- package/.next/static/chunks/{10xs8eu3rd2lt.js → 1ou17klnb8gu_.js} +1 -1
- package/.next/static/chunks/{1sjf69friyuwh.js → 1pdlii0oox0-7.js} +1 -1
- package/.next/static/chunks/{26-0j9v7hswqr.js → 1rzk5q74nsv73.js} +1 -1
- package/.next/static/chunks/{25emavlvjqnb_.js → 1sisl9ld-ag-o.js} +2 -2
- package/.next/static/chunks/{2hihgd7vu8tw5.js → 1z_0hbg6kxv58.js} +1 -1
- package/.next/static/chunks/{41j6vve1unchm.js → 2cfz0fumc6ghe.js} +1 -1
- package/.next/static/chunks/2dml0yrklxocr.js +31 -0
- package/.next/static/chunks/{2p9s6dcxnj129.js → 2e0fqyqddz02g.js} +1 -1
- package/.next/static/chunks/{2qvnb2d_gv2o5.js → 2huy9i-dnxshq.js} +1 -1
- package/.next/static/chunks/{2h1-bjeib7r-u.js → 2mu8zu6zd59z2.js} +1 -1
- package/.next/static/chunks/{09z8ds-9g-ble.js → 2urhwgx3nt7lq.js} +1 -1
- package/.next/static/chunks/{1c36uw_9rc8oc.js → 2xibor-sxcc67.js} +1 -1
- package/.next/static/chunks/3-7dqhvzmyl4y.css +3 -0
- package/.next/static/chunks/{31pvc0nv10j93.js → 3-w46lg1a_qse.js} +1 -1
- package/.next/static/chunks/{0zj83pnid72u3.js → 34lp-hkkywd8r.js} +1 -1
- package/.next/static/chunks/37d6vrdascsro.js +1 -0
- package/.next/static/chunks/{0lwd5-772ng4i.js → 3difxy8vzqlxn.js} +1 -1
- package/.next/static/chunks/3zs0fu6zcu0lb.js +1 -0
- package/dist-scripts/src/lib/debug-log.js +6 -6
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/ssr/_037_l3ca0s_0m._.js +0 -3
- package/.next/server/chunks/ssr/_0_snnfou-vj50._.js +0 -3
- package/.next/server/chunks/ssr/_19-9r85m2zwkm._.js +0 -3
- package/.next/server/chunks/ssr/_1b5bo2mgv9_4a._.js +0 -3
- package/.next/static/chunks/0i1q2hqzk7ojc.css +0 -3
- package/.next/static/chunks/24mest-vas-bu.js +0 -33
- package/.next/static/chunks/2ju2bi0z49pn1.js +0 -1
- package/.next/static/chunks/2rx6yjo9suvmj.js +0 -1
- package/.next/static/chunks/2zgqd5dt_6z_7.js +0 -1
- package/.next/static/chunks/3cyz6w014ooxj.js +0 -191
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → RjcLZuifR9iENqJ77CSYI}/_buildManifest.js +0 -0
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → RjcLZuifR9iENqJ77CSYI}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{6sBeEDpD-TPpDMfiFpz9K → RjcLZuifR9iENqJ77CSYI}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";let t,r,n,i,s,a,o,l,c,d;e.s(["BIGINT_FORMAT_RANGES",()=>tO,"CONSTANT_CATCH",()=>rs,"Class",()=>t5,"NUMBER_FORMAT_RANGES",()=>tA,"aborted",()=>tM,"allowsEval",()=>tg,"assert",()=>eQ,"assertEqual",()=>eq,"assertIs",()=>eX,"assertNever",()=>eY,"assertNotEqual",()=>eW,"assignProp",()=>tt,"attachSchema",()=>tK,"base64ToUint8Array",()=>t0,"base64urlToUint8Array",()=>t2,"cached",()=>e3,"captureStackTrace",()=>tm,"cleanEnum",()=>tQ,"cleanRegex",()=>e5,"clone",()=>tk,"cloneDef",()=>tl,"codePointLength",()=>tW,"constantCatch",()=>ra,"createTransparentProxy",()=>tN,"defineLazy",()=>e7,"defineLazyInternal",()=>rn,"derived",()=>re,"esc",()=>tp,"escapeRegex",()=>tj,"explicitlyAborted",()=>tL,"extend",()=>tC,"finalizeIssue",()=>tB,"floatSafeRemainder",()=>e6,"getElementAtPath",()=>tc,"getEnumValues",()=>e0,"getLengthableOrigin",()=>tH,"getParsedType",()=>tb,"getSizableOrigin",()=>tJ,"hexToUint8Array",()=>t3,"hide",()=>t7,"installLazyProp",()=>ri,"isObject",()=>th,"isPlainObject",()=>tv,"issue",()=>tY,"joinValues",()=>e1,"jsonStringifyReplacer",()=>e2,"members",()=>t6,"merge",()=>tZ,"mergeDefs",()=>to,"normalizeParams",()=>tz,"nullish",()=>e9,"numKeys",()=>tx,"objectClone",()=>te,"omit",()=>tP,"optionalKeys",()=>t$,"own",()=>t8,"parsedType",()=>tX,"partial",()=>tF,"pick",()=>tE,"prefixIssues",()=>tU,"primitiveTypes",()=>t_,"promiseAllObject",()=>td,"propertyKeyTypes",()=>tw,"randomString",()=>tu,"rawShape",()=>tr,"required",()=>tR,"safeExtend",()=>tD,"shallowClone",()=>ty,"sizeCaps",()=>tV,"slugify",()=>tf,"stringifyPrimitive",()=>tS,"toZod",()=>eH,"uint8ArrayToBase64",()=>t1,"uint8ArrayToBase64url",()=>t4,"uint8ArrayToHex",()=>t9,"unwrapMessage",()=>tG],922143);var u,p,f=e.i(843476),m=e.i(271645),h=e.i(111110),g=e.i(217255),v=e.i(41931),y=e.i(303163),x=e.i(201276);let b=["system","light","dark"],w="system",_="app-theme";function j(e){return"string"==typeof e&&b.includes(e)}let k=(0,m.createContext)({preference:w,theme:"light",setPreference:()=>void 0}),z="(prefers-color-scheme: dark)",N=new Set;function S(e){return N.add(e),window.addEventListener("storage",e),()=>{N.delete(e),window.removeEventListener("storage",e)}}function $(){try{let e=localStorage.getItem(_);return j(e)?e:w}catch{return w}}function A(e){try{localStorage.setItem(_,e)}catch{}N.forEach(e=>e())}function O(e){let t=window.matchMedia(z);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}let E=()=>window.matchMedia(z).matches;function T({children:e}){let{data:t,status:r}=(0,g.useSession)(),n="authenticated"===r,i=t?.user?.email,s=(0,m.useSyncExternalStore)(S,$,()=>w),a=(0,m.useSyncExternalStore)(O,E,()=>!1),o="system"===s?a?"dark":"light":s;(0,m.useEffect)(()=>{let e=document.documentElement,t=t=>{e.classList.toggle("dark","dark"===t),e.style.colorScheme=t};t(o);let r=()=>t("light"),n=()=>t(o);return window.addEventListener("beforeprint",r),window.addEventListener("afterprint",n),()=>{window.removeEventListener("beforeprint",r),window.removeEventListener("afterprint",n)}},[o]),(0,m.useEffect)(()=>{if(!n||!i)return;let e=!1;return v.k.get("/api/user").then(t=>{!e&&j(t.themePreference)&&t.themePreference!==$()&&A(t.themePreference)}).catch(e=>{x.V.warn("[Theme]","Failed to load theme preference",{error:(0,y.Z)(e)})}),()=>{e=!0}},[n,i]);let l=(0,m.useCallback)(e=>{A(e),n&&v.k.patch("/api/user",{themePreference:e}).catch(e=>{x.V.warn("[Theme]","Failed to save theme preference",{error:(0,y.Z)(e)})})},[n]),c=(0,m.useMemo)(()=>({preference:s,theme:o,setPreference:l}),[s,o,l]);return(0,f.jsx)(k.Provider,{value:c,children:e})}var P=e.i(215519),C=e.i(325164),I=e.i(522016),D=e.i(618566),Z=e.i(749803),F=e.i(856423),R=e.i(975153),M=e.i(226091),L=e.i(367784),U=e.i(456420);let G={name:"circle-plus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],aliases:["plus-circle"]};G.node;let V=(0,U.f)(G),K={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};K.node;let B=(0,U.f)(K),J={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};J.node;let q=(0,U.f)(J),W={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};W.node;let H=(0,U.f)(W),X={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};X.node;let Y=(0,U.f)(X);var Q=e.i(999092),ee=e.i(632781);let et={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};et.node;let er=(0,U.f)(et),en={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};en.node;let ei=(0,U.f)(en);var es=e.i(901279),ea=e.i(994533),eo=e.i(519455),el=e.i(776639),ec=e.i(677572),ed=e.i(306831),eu=e.i(487486),ep=e.i(699375),ef=e.i(793479),em=e.i(110204),eh=e.i(975157);let eg=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("div",{className:"relative w-full overflow-auto",children:(0,f.jsx)("table",{ref:r,className:(0,eh.f)("w-full caption-bottom text-sm",e),...t})}));eg.displayName="Table";let ev=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("thead",{ref:r,className:(0,eh.f)("[&_tr]:border-b",e),...t}));ev.displayName="TableHeader";let ey=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tbody",{ref:r,className:(0,eh.f)("[&_tr:last-child]:border-0",e),...t}));ey.displayName="TableBody",(m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tfoot",{ref:r,className:(0,eh.f)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}))).displayName="TableFooter";let ex=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("tr",{ref:r,className:(0,eh.f)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ex.displayName="TableRow";let eb=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("th",{ref:r,className:(0,eh.f)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));eb.displayName="TableHead";let ew=m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("td",{ref:r,className:(0,eh.f)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ew.displayName="TableCell",(m.forwardRef(({className:e,...t},r)=>(0,f.jsx)("caption",{ref:r,className:(0,eh.f)("mt-4 text-sm text-muted-foreground",e),...t}))).displayName="TableCaption";var e_=e.i(759659);let ej={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};ej.node;let ek=(0,U.f)(ej);var ez=e.i(548161),eN=e.i(294114);function eS(){var e;let{t}=(0,h.b)(),[r,n]=(0,m.useState)(String(5)),[i,s]=(0,m.useState)(!1),a=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/settings");n(String(e.aiConcurrencyLimit??5))}catch(e){x.V.error("[AiConcurrencyLimitSetting]","Failed to fetch config",{error:e})}},[]);(0,m.useEffect)(()=>{a()},[a]);let o=Number(r),l=""!==r.trim()&&"number"==typeof(e=o)&&Number.isInteger(e)&&e>=1&&e<=100,c=async()=>{if(l){s(!0);try{await v.k.post("/api/settings",{aiConcurrencyLimit:o}),eN.c.success(t.admin.aiConcurrencyLimitSaved)}catch(e){x.V.error("[AiConcurrencyLimitSetting]","Failed to update AI concurrency limit",{error:e}),eN.c.error(t.common.error)}finally{s(!1)}}};return(0,f.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(em.f,{htmlFor:"ai-concurrency-limit",className:"text-base",children:t.admin.aiConcurrencyLimit}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:t.admin.aiConcurrencyLimitDesc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(ef.f,{id:"ai-concurrency-limit",type:"number",min:1,max:100,step:1,inputMode:"numeric",value:r,onChange:e=>n(e.target.value),"aria-invalid":!l,className:"w-24"}),(0,f.jsxs)(eo.f,{size:"sm",onClick:c,disabled:i||!l,children:[i&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),t.common.save]})]})]})}function e$(){let{timeZone:e}=(0,P.M)(),{data:t}=(0,g.useSession)(),{t:r}=(0,h.b)(),[n,i]=(0,m.useState)([]),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(!1),[u,p]=(0,m.useState)("0"),[b,w]=(0,m.useState)(!1),_=(0,m.useCallback)(async()=>{a(!0);try{let e=await v.k.get("/api/admin/users");i(e)}catch(e){x.V.error("[UserManagement]","Failed to fetch users",{error:e})}finally{a(!1)}},[]),j=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/settings");l(!0===e.allowRegistration),p(String(e.aiDailyLimit??0))}catch(e){x.V.error("[UserManagement]","Failed to fetch config",{error:e})}},[]);(0,m.useEffect)(()=>{_(),j()},[_,j]);let k=async e=>{d(!0);try{await v.k.post("/api/settings",{allowRegistration:e}),l(e)}catch(e){x.V.error("[UserManagement]","Failed to update registration setting",{error:e}),eN.c.error(r.common.error)}finally{d(!1)}},z=Number(u),N=""!==u.trim()&&Number.isInteger(z)&&z>=0,S=async()=>{if(N){w(!0);try{await v.k.post("/api/settings",{aiDailyLimit:z}),eN.c.success(r.admin.aiDailyLimitSaved)}catch(e){x.V.error("[UserManagement]","Failed to update AI daily limit",{error:e}),eN.c.error(r.common.error)}finally{w(!1)}}},$=async e=>{let t=e.isActive?r.admin.confirmDisable:r.admin.confirmEnable;if(await (0,eN.u)(t))try{await v.k.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),_()}catch(e){x.V.error("[UserManagement]","Failed to update user status",{error:e}),eN.c.error(r.common.error)}},A=async e=>{if(await (0,eN.u)(r.admin.confirmDelete,{destructive:!0}))try{await v.k.delete(`/api/admin/users/${e.id}`),_()}catch(t){x.V.error("[UserManagement]","Failed to delete user",{error:t});let e=(0,y.d)(t)||r.common.error;eN.c.error(e)}};return s?(0,f.jsx)("div",{className:"flex justify-center py-8",children:(0,f.jsx)(ee.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(em.f,{className:"text-base",children:r.admin?.allowRegistration||"Allow New Registrations"}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,f.jsx)(ee.f,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)(ep.f,{checked:o,onCheckedChange:k,disabled:c})]})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-3 p-4 border rounded-lg bg-muted/30 sm:flex-row sm:items-center sm:justify-between",children:[(0,f.jsxs)("div",{className:"space-y-0.5",children:[(0,f.jsx)(em.f,{htmlFor:"ai-daily-limit",className:"text-base",children:r.admin.aiDailyLimit}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:r.admin.aiDailyLimitDesc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(ef.f,{id:"ai-daily-limit",type:"number",min:0,step:1,inputMode:"numeric",value:u,onChange:e=>p(e.target.value),"aria-invalid":!N,className:"w-24"}),(0,f.jsxs)(eo.f,{size:"sm",onClick:S,disabled:b||!N,children:[b&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),r.common.save]})]})]}),(0,f.jsx)(eS,{}),(0,f.jsx)("div",{className:"sm:hidden space-y-3",children:n.map(n=>(0,f.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,f.jsxs)("div",{className:"flex justify-between items-start",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-medium",children:n.name||"N/A"}),(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:n.email})]}),(0,f.jsx)(eu.f,{variant:"admin"===n.role?"default":"secondary",children:"admin"===n.role?r.admin.admin:r.admin.user})]}),(0,f.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,f.jsxs)("div",{className:"text-muted-foreground",children:[r.admin.errors,": ",n._count.errorItems," | ",r.admin.practiceCount,": ",n._count.practiceRecords," | ",r.admin.aiUsageToday,": ",n.aiUsageToday]}),(0,f.jsx)(eu.f,{variant:n.isActive?"default":"destructive",className:"text-xs",children:n.isActive?r.admin.active:r.admin.disabled})]}),(0,f.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,f.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,ed.r)(n.createdAt,"yyyy-MM-dd",e)}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>$(n),disabled:n.id===t?.user?.id,children:n.isActive?(0,f.jsx)(ek,{className:"h-4 w-4 text-orange-500"}):(0,f.jsx)(ez.f,{className:"h-4 w-4 text-green-500"})}),(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>A(n),disabled:n.id===t?.user?.id,children:(0,f.jsx)(e_.f,{className:"h-4 w-4 text-destructive"})})]})]})]},n.id))}),(0,f.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,f.jsxs)(eg,{children:[(0,f.jsx)(ev,{children:(0,f.jsxs)(ex,{children:[(0,f.jsx)(eb,{children:r.admin.nameEmail}),(0,f.jsx)(eb,{children:r.admin.role}),(0,f.jsx)(eb,{children:r.admin.stats}),(0,f.jsx)(eb,{children:r.admin.createdAt}),(0,f.jsx)(eb,{children:r.admin.status}),(0,f.jsx)(eb,{className:"text-right",children:r.admin.actions})]})}),(0,f.jsx)(ey,{children:n.map(n=>(0,f.jsxs)(ex,{children:[(0,f.jsxs)(ew,{children:[(0,f.jsx)("div",{className:"font-medium",children:n.name||"N/A"}),(0,f.jsx)("div",{className:"text-sm text-muted-foreground",children:n.email})]}),(0,f.jsx)(ew,{children:(0,f.jsx)(eu.f,{variant:"admin"===n.role?"default":"secondary",children:"admin"===n.role?r.admin.admin:r.admin.user})}),(0,f.jsxs)(ew,{children:[(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.errors,": ",n._count.errorItems]}),(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.practiceCount,": ",n._count.practiceRecords]}),(0,f.jsxs)("div",{className:"text-sm",children:[r.admin.aiUsageToday,": ",n.aiUsageToday]})]}),(0,f.jsx)(ew,{children:(0,ed.r)(n.createdAt,"yyyy-MM-dd",e)}),(0,f.jsx)(ew,{children:(0,f.jsx)(eu.f,{variant:n.isActive?"default":"destructive",children:n.isActive?r.admin.active:r.admin.disabled})}),(0,f.jsxs)(ew,{className:"text-right space-x-2",children:[(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>$(n),disabled:n.id===t?.user?.id,title:n.isActive?r.admin.disable:r.admin.enable,children:n.isActive?(0,f.jsx)(ek,{className:"h-4 w-4 text-orange-500"}):(0,f.jsx)(ez.f,{className:"h-4 w-4 text-green-500"})}),(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>A(n),disabled:n.id===t?.user?.id,title:r.admin.delete,children:(0,f.jsx)(e_.f,{className:"h-4 w-4 text-destructive"})})]})]},n.id))})]})})]})}var eA=e.i(482022);let eO={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};eO.node;let eE=(0,U.f)(eO);function eT(e){return(0,f.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[(0,f.jsx)("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"}),(0,f.jsx)("path",{d:"M9 18c-4.51 2-5-2-7-2"})]})}let eP={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};eP.node;let eC=(0,U.f)(eP);function eI(){return window.WrongNotebookAndroid??null}let eD=()=>()=>void 0;function eZ(){let{t:e}=(0,h.b)(),t=(0,m.useSyncExternalStore)(eD,eI,()=>null);return t?t.isStandalone?.()?(0,f.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:e.settings?.about?.androidStandalone||"Running on this device. Data is stored only on this device."}):(0,f.jsxs)("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[(0,f.jsxs)("span",{className:"break-all",children:[e.settings?.about?.androidServer||"Server",": ",t.getServerUrl()]}),(0,f.jsxs)(eo.f,{variant:"outline",className:"gap-2",onClick:()=>t.changeServer(),children:[(0,f.jsx)(eC,{className:"h-4 w-4"}),e.settings?.about?.changeServer||"Change server"]})]}):null}var eF=e.i(637691);function eR(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)("");(0,m.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>r(e.version)).catch(()=>{})},[]);let n=[{href:eF.f,icon:eT,label:e.settings?.about?.github||"GitHub Repository"},{href:`${eF.f}/releases`,icon:eE,label:e.settings?.about?.releaseNotes||"Release Notes"},{href:`${eF.f}/issues`,icon:er,label:e.settings?.about?.feedback||"Feedback"}];return(0,f.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("h3",{className:"text-2xl font-bold",children:e.app?.title||"Smart Error Notebook"}),(0,f.jsx)("p",{className:"text-muted-foreground",children:e.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,f.jsx)(Y,{className:"h-4 w-4"}),(0,f.jsxs)("span",{children:[e.settings?.about?.version||"Version",": v",t||"unknown"]})]}),(0,f.jsx)(eZ,{}),(0,f.jsx)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:n.map(({href:e,icon:t,label:r})=>(0,f.jsx)(eo.f,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,f.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsx)(t,{className:"h-4 w-4"}),r,(0,f.jsx)(eA.f,{className:"h-3 w-3 ml-1 opacity-50"})]})},e))}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:e.settings?.about?.copyright||"© 2026 margrop · Based on wttwins/wrong-notebook · MIT License"})]})}var eM=e.i(37038),eL=e.i(967489),eU=e.i(676167);let eG={name:"",email:"",educationStage:"",enrollmentYear:"",currentGrade:"",currentSemester:"",password:""};function eV(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)(eG),[n,i]=(0,m.useState)(""),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),c=(0,m.useCallback)(async()=>{try{let e=await v.k.get("/api/user"),t=e.fixedGradeSemester?(0,eU.p)(e.fixedGradeSemester):null;r({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",currentGrade:t?.grade||"",currentSemester:t?.semester||"",password:""})}catch(e){x.V.error("[AccountSettings]","Failed to fetch profile",{error:e})}finally{a(!1)}},[]);(0,m.useEffect)(()=>{c()},[c]);let d=async()=>{if(t.password&&t.password!==n)return void eN.c.error(e.settings?.messages?.passwordMismatch||"Passwords do not match");l(!0);try{let n={name:t.name,email:t.email,educationStage:t.educationStage};t.enrollmentYear&&(n.enrollmentYear=parseInt(t.enrollmentYear.toString())),t.password&&(n.password=t.password),t.currentGrade&&t.currentSemester?n.fixedGradeSemester=`${t.currentGrade}${t.currentSemester}`:t.currentGrade||(n.fixedGradeSemester=null),await v.k.patch("/api/user",n),eN.c.success(e.settings?.messages?.profileUpdated||"Profile updated"),r(e=>({...e,password:""})),i(""),window.location.reload()}catch(t){x.V.error("[AccountSettings]","Failed to update profile",{error:(0,y.d)(t)??(0,y.Z)(t)}),eN.c.error((0,y.d)(t)||e.settings?.messages?.updateFailed||"Update failed")}finally{l(!1)}};return s?(0,f.jsx)("div",{className:"flex justify-center py-8",children:(0,f.jsx)(ee.f,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.auth?.name||"Name"}),(0,f.jsx)(ef.f,{value:t.name||"",onChange:e=>r({...t,name:e.target.value})})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.auth?.email||"Email"}),(0,f.jsx)(ef.f,{value:t.email||"",onChange:e=>r({...t,email:e.target.value}),type:"email"})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.auth?.educationStage||"Education Stage"}),(0,f.jsxs)(eL.d,{value:t.educationStage||"",onValueChange:e=>r({...t,educationStage:e,currentGrade:(0,eU.c)(e).includes(t.currentGrade)?t.currentGrade:"",currentSemester:(0,eU.c)(e).includes(t.currentGrade)?t.currentSemester:""}),children:[(0,f.jsx)(eL.P,{children:(0,f.jsx)(eL.U,{placeholder:e.auth?.selectStage||"Select Stage"})}),(0,f.jsxs)(eL.r,{children:[(0,f.jsx)(eL.T,{value:"primary",children:e.auth?.primary||"Primary School"}),(0,f.jsx)(eL.T,{value:"junior_high",children:e.auth?.juniorHigh||"Junior High"}),(0,f.jsx)(eL.T,{value:"senior_high",children:e.auth?.seniorHigh||"Senior High"}),(0,f.jsx)(eL.T,{value:"university",children:e.auth?.university||"University"})]})]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.auth?.enrollmentYear||"Enrollment Year"}),(0,f.jsx)(ef.f,{type:"number",value:t.enrollmentYear||"",onChange:e=>r({...t,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),t.educationStage&&(0,eU.c)(t.educationStage).length>0&&(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.settings?.account?.currentGrade||"Current Grade & Semester"}),(0,f.jsxs)(eL.d,{value:t.currentGrade||"",onValueChange:e=>r({...t,currentGrade:e,currentSemester:e?t.currentSemester||"上":""}),children:[(0,f.jsx)(eL.P,{children:(0,f.jsx)(eL.U,{placeholder:e.settings?.account?.selectGrade||"Select Grade"})}),(0,f.jsx)(eL.r,{children:(0,eU.c)(t.educationStage).map(e=>(0,f.jsx)(eL.T,{value:e,children:e},e))})]})]}),t.currentGrade&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.settings?.account?.selectSemester||"Select Semester"}),(0,f.jsxs)(eL.d,{value:t.currentSemester||"",onValueChange:e=>r({...t,currentSemester:e}),children:[(0,f.jsx)(eL.P,{children:(0,f.jsx)(eL.U,{placeholder:e.settings?.account?.selectSemester||"Select Semester"})}),(0,f.jsxs)(eL.r,{children:[(0,f.jsx)(eL.T,{value:"上",children:e.settings?.account?.firstSemester||"1st Semester"}),(0,f.jsx)(eL.T,{value:"下",children:e.settings?.account?.secondSemester||"2nd Semester"})]})]})]})]}),t.currentGrade&&t.currentSemester&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground -mt-2",children:e.settings?.account?.gradeAppliedHint||"New questions will default to this grade. You can also configure AI grade recognition in General Settings."}),(0,f.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,f.jsx)(eM.f,{value:t.password,onChange:e=>r({...t,password:e.target.value}),placeholder:"******",minLength:6})]}),t.password&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:e.auth?.confirmPassword||"Confirm Password"}),(0,f.jsx)(eM.f,{value:n,onChange:e=>i(e.target.value),placeholder:"******",minLength:6})]})]}),(0,f.jsxs)(eo.f,{onClick:d,disabled:o,className:"w-full",children:[o&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.settings?.account?.update||"Update Profile"]})]})}var eK=e.i(10038);let eB={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};eB.node;let eJ=(0,U.f)(eB);function eq(e){return e}function eW(e){return e}function eH(){return e=>e}function eX(e){}function eY(e){throw Error("Unexpected value in exhaustive check")}function eQ(e){}function e0(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function e1(e,t="|"){return e.map(e=>tS(e)).join(t)}function e2(e,t){return"bigint"==typeof t?t.toString():t}class e4{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function e3(e){return new e4(e)}function e9(e){return null==e}function e5(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function e6(e,t){let r=e/t,n=Math.round(r),i=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}let e8=Symbol("evaluating");function e7(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==e8)return void 0===n&&(n=e8,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function te(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function tt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function tn(e){return tr(e._zod.def)??e._zod.def.shape}function ti(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return tt(this,t,e),e},enumerable:!0,configurable:!0})}function ts(e,t,r){t in e?tt(e,t,r):e[t]=r}function ta(e,t,r,n){let i=tn(t);for(let s of r){let r=Object.getOwnPropertyDescriptor(i,s);r.enumerable&&(r.get?ti(e,s,()=>{let e=t._zod.def.shape[s];return n?n(e,s):e}):ts(e,s,n?n(r.value,s):r.value))}}function to(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function tl(e){return to(e._zod.def)}function tc(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function td(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function tu(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function tp(e){return JSON.stringify(e)}function tf(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let tm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function th(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let tg=e3(()=>{if(rp.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function tv(e){if(!1===th(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==th(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ty(e){return tv(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function tx(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let tb=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},tw=new Set(["string","number","symbol"]),t_=new Set(["string","number","bigint","boolean","symbol","undefined"]);function tj(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tk(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function tz(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function tN(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,s)=>(t??(t=e()),Reflect.set(t,n,i,s)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})}function tS(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function t$(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let tA={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tO={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tE(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return ta(i,e,tT(e,t)),tk(e,to(r,{shape:i,checks:[]}))}function tT(e,t){let r=tn(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function tP(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(tT(e,t)),s={};return ta(s,e,Reflect.ownKeys(tn(e)).filter(e=>!i.has(e))),tk(e,to(r,{shape:s,checks:[]}))}function tC(e,t){if(!tv(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=tn(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return tk(e,to(e._zod.def,{shape:tI(e,t)}))}function tI(e,t){let r={};ta(r,e,Reflect.ownKeys(tn(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?ti(r,e,()=>t[e]):ts(r,e,n.value))}return r}function tD(e,t){if(!tv(t))throw Error("Invalid input to safeExtend: expected a plain object");return tk(e,to(e._zod.def,{shape:tI(e,t)}))}function tZ(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ta(r,e,Reflect.ownKeys(tn(e))),ta(r,t,Reflect.ownKeys(tn(t)));let n=to(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return tk(e,n)}function tF(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let s=r?new Set(tT(t,r)):void 0,a={};return ta(a,t,Reflect.ownKeys(tn(t)),e&&((t,r)=>s&&!s.has(r)?t:new e({type:"optional",innerType:t}))),tk(t,to(t._zod.def,{shape:a,checks:[]}))}function tR(e,t,r){let n=r?new Set(tT(t,r)):void 0,i={};return ta(i,t,Reflect.ownKeys(tn(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),tk(t,to(t._zod.def,{shape:i}))}function tM(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function tL(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function tU(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function tG(e){return"string"==typeof e?e:e?.message}function tV(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function tK(e,t,r){var n;for(let i=t;i<e.length;i++)(n=e[i]).schema??(n.schema=r)}function tB(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:tG(e.inst?._zod.def?.error?.(e))??tG(i?.(e))??tG(t?.error?.(e))??tG(r.customError?.(e))??tG(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function tJ(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let tq=/[\uD800-\uDBFF]/;function tW(e){let t=e.length;if(!tq.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function tH(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function tX(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function tY(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function tQ(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function t0(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function t1(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function t2(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return t0(t+r)}function t4(e){return t1(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function t3(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function t9(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class t5{constructor(...e){}}function t6(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:t8(this,t,r.bind(this))},set(e){t8(this,t,e)}})}(e,r,n.value)}}function t8(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function t7(e,t,r){return t8(e,t,r,!1)}function re(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return t8(this,r,n(this))},set(e){t8(this,r,e)}})}return t}let rt=!1,rr={configurable:!0,get(){rt=!0}};function rn(e,r,n){let i=Object.getPrototypeOf(e._zod);if(r in i&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,rr);let e=rt;rt=!1;try{let t=n(this);return rt?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),rt=rt||e,t}catch(t){throw delete this[r],rt=rt||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function ri(e,t,r,n){let i,s=t in(i=Object.getPrototypeOf(e))?void 0:i;s&&Object.defineProperty(s,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let rs="~constantCatch";function ra(e){let t=()=>e;return t[rs]=!0,t}let ro={value:void 0,enumerable:!1},rl="captureStackTrace"in Error?Error:null;function rc(e,t,r,n){function i(e){this.def=e,this.constr=c,this.traits=new Set}i.prototype={};let s=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{ro.value=new i(a);try{Object.defineProperty(n,"_zod",ro)}finally{ro.value=void 0}}if(n._zod.traits.add(e),t(n,a),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;s.has(a)||(s.add(a),t6(a,r))}let o=c.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function c(e){let t=n?.Parent?function(e){let t=rl;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return rl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class rd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ru extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(u=globalThis).__zod_globalConfig??(u.__zod_globalConfig={});let rp=globalThis.__zod_globalConfig;function rf(e){return e&&Object.assign(rp,e),rp}class rm extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let rh="~memo",rg=[];function rv(e){return null!==e&&"object"==typeof e}function ry(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let rx=new WeakMap,rb=[],rw={alloc(e,t,n){let i=r;if(!i)return n;r=void 0;let s={value:n,issues:null};return i.set(t.value,s),rb.push(s),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,i;let s;if("backward"!==r.direction&&(n=r,i=e.value,void 0!==(s=n[rh]?.backEdges)&&rv(i)&&s.has(i)))throw new rm;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,i,s,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,c)=>{let d;if(void 0===n){let r=function e(t,r,n){var i,s;let a=rx.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let i=e(t,r,n);i>o&&(o=i)}},c=e=>{e>o&&(o=e)},d=t._zod.def;switch(d.type){case"object":{let t=tr(d);c(t?((t,i)=>{let s=0;for(let a of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,a);if(i&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>s&&(s=l)}return s})(t,!0):1),l(d.catchall);break}case"array":l(d.element);break;case"tuple":for(let e of d.items)l(e);l(d.rest);break;case"record":case"map":l(d.keyType),l(d.valueType);break;case"set":l(d.valueType);break;case"union":for(let e of d.options)l(e);break;case"intersection":l(d.left),l(d.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(d.innerType);break;case"pipe":l(d.in),l(d.out);break;case"function":l(d.input),l(d.output);break;case"lazy":{let i=d._cachedInner??(n?t._zod.innerType:void 0);c(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in d){let t=Object.getOwnPropertyDescriptor(d,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(s=o)&&rx.set(i,2===s),s}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,c);2===r||a?n=!0:a=!0}let u=l.value;if(!rv(u))return t(l,c);let p=c[rh];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[rh]=p),i===c)d=s;else{var f;let t;(t=(f=p).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),d=t,i=c,s=d}let m=d.get(u);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...ry(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;r=d;let h=rb.length,g=t(l,c);r=void 0;let v=rb.length>h?rb.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?ry(e.issues):rg),e)):(v&&(v.issues=g.issues.length?ry(g.issues):rg),g)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(p=globalThis).__zod_globalRegistry??(p.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let r_=globalThis.__zod_globalRegistry,rj=/^[cC][0-9a-z]{6,}$/,rk=/^[0-9a-z]+$/,rz=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,rN=/^[0-9a-vA-V]{20}$/,rS=/^[A-Za-z0-9]{27}$/,r$=/^[a-zA-Z0-9_-]{21}$/;function rA(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let rO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rE=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,rT=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rP=rT(4),rC=rT(6),rI=rT(7),rD=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rZ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function rF(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let rR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rL=e=>{let t=tj(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},rU=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,rG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rK=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,rB=/^https?$/,rJ=/^\+[1-9]\d{6,14}$/,rq=/^\d(?:[ -]?\d){11,18}$/,rW=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,rH="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rX=RegExp(`^${rH}$`);function rY(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rQ(e){return RegExp(`^${rY(e)}$`)}function r0(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${rY({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${rY({precision:e.precision})}`:r;return RegExp(`^${rH}T(?:${n})$`)}let r1=/^[\s\S]{0,}$/,r2=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},r4=/^-?\d+n?$/,r3=/^-?\d+$/,r9=/^-?\d+(?:\.\d+)?$/,r5=/^(?:true|false)$/i,r6=/^null$/i,r8=/^undefined$/i,r7=/^[^A-Z]*$/,ne=/^[^a-z]*$/;function nt(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function nr(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let nn=nt(22,"=="),ni=nr(22),ns=nt(27,"="),na=nr(27),no=nt(43,"="),nl=nr(43),nc=nt(64,""),nd=nr(64),nu=nt(86,"=="),np=nr(86);e.s(["anyString",0,r1,"base64",0,rV,"base64url",0,rK,"bigint",0,r4,"boolean",0,r5,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,rU,"cidrv6",0,rG,"creditCard",0,rq,"cuid",0,rj,"cuid2",0,rk,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,rX,"datetime",0,r0,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,rO,"e164",0,rJ,"email",0,rD,"emoji",0,rF,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,rE,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,rB,"iban",0,rW,"idnEmail",0,rZ,"integer",0,r3,"ipv4",0,rR,"ipv6",0,rM,"ksuid",0,rS,"lowercase",0,r7,"mac",0,rL,"md5_base64",0,nn,"md5_base64url",0,ni,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,r$,"nanoidOfLength",0,rA,"null",0,r6,"number",0,r9,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,ns,"sha1_base64url",0,na,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,no,"sha256_base64url",0,nl,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,nc,"sha384_base64url",0,nd,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,nu,"sha512_base64url",0,np,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,r2,"time",0,rQ,"ulid",0,rz,"undefined",0,r8,"unicodeEmail",0,rZ,"uppercase",0,ne,"uuid",0,rT,"uuid4",0,rP,"uuid6",0,rC,"uuid7",0,rI,"xid",0,rN],682358);let nf=rc("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nm=e=>{let t=e.value;return!e9(t)&&void 0!==t.size},nh=e=>{let t=e.value;return!e9(t)&&void 0!==t.length},ng={number:"number",bigint:"bigint",object:"date"},nv=rc("$ZodCheckLessThan",(e,t)=>{nf.init(e,t);let r=ng[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ng[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ny=rc("$ZodCheckGreaterThan",(e,t)=>{nf.init(e,t);let r=ng[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ng[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nx=rc("$ZodCheckMultipleOf",(e,t)=>{nf.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===e6(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),nb=rc("$ZodCheckNumberFormat",(e,t)=>{nf.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=tA[t.format];e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),nw=rc("$ZodCheckBigIntFormat",(e,t)=>{nf.init(e,t);let[r,n]=tO[t.format];e._zod.check=i=>{let s=i.value;s<r&&i.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>n&&i.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),n_=rc("$ZodCheckMaxSize",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:tJ(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nj=rc("$ZodCheckMinSize",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:tJ(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nk=rc("$ZodCheckSizeEquals",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nm),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:tJ(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nz=rc("$ZodCheckMaxLength",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nh),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>t.maximum?tW(n):i)<=t.maximum)return;let s=tH(n);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nN=rc("$ZodCheckMinLength",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nh),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>=t.minimum&&i<2*t.minimum?tW(n):i)>=t.minimum)return;let s=tH(n);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nS=rc("$ZodCheckLengthEquals",(e,t)=>{var r;nf.init(e,t),(r=e._zod.def).when??(r.when=nh),e._zod.check=r=>{let n=r.value,i=n.length,s="string"==typeof n&&i>=t.length&&i<=2*t.length?tW(n):i;if(s===t.length)return;let a=tH(n),o=s>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),n$=rc("$ZodCheckStringFormat",(e,t)=>{var r,n;nf.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),nA=rc("$ZodCheckRegex",(e,t)=>{n$.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nO=rc("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=r7),n$.init(e,t)}),nE=rc("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ne),n$.init(e,t)}),nT=rc("$ZodCheckIncludes",(e,t)=>{nf.init(e,t);let r=tj(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),nP=rc("$ZodCheckStartsWith",(e,t)=>{nf.init(e,t);let r=RegExp(`^${tj(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),nC=rc("$ZodCheckEndsWith",(e,t)=>{nf.init(e,t);let r=RegExp(`.*${tj(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function nI(e,t,r){e.issues.length&&t.issues.push(...tU(r,e.issues))}(e,t)=>{let r;nf.init(e,t),t7(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let i;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let s=n.value;for(let[e,t]of r){let r=t._zod.run({value:s[e],issues:[]},{});r instanceof Promise?(i??(i=[]),i.push(r.then(t=>nI(t,n,e)))):nI(r,n,e)}if(i)return Promise.all(i).then(()=>void 0)}},(e,t)=>{nf.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let nD=rc("$ZodCheckOverwrite",(e,t)=>{nf.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class nZ{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
|
+
${t.join("\n")}
|
|
3
|
+
};`)(...Object.values(this.closed))}}let nF={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,e2,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nR={value:void 0,enumerable:!1},nM=new WeakSet([Object.prototype,Error.prototype]),nL=(e,t)=>{e.name="$ZodError",nR.value=t,Object.defineProperty(e,"issues",nR),nR.value=void 0,Object.defineProperty(e,"message",nF);let r=Object.getPrototypeOf(e);nM.has(r)||(nM.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nU=rc("$ZodError",nL),nG=rc("$ZodError",nL,void 0,{Parent:Error});function nV(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nK=e=>{let t=(r,n,i,s)=>{let a=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new rd;if(o.issues.length){let r=new(s?.Err??e)(o.issues.map(e=>tB(e,a,rf())));throw tm(r,s?.callee??t),r}return o.value};return t},nB=nK(nG),nJ=e=>{let t=async(r,n,i,s)=>{let a=i?{...i,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let r=new(s?.Err??e)(o.issues.map(e=>tB(e,a,rf())));throw tm(r,s?.callee??t),r}return o.value};return t},nq=nJ(nG),nW=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new rd;return s.issues.length?nH(e,s.issues,i):{success:!0,data:s.value}};function nH(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>tB(e,r,rf()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let nX=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?nH(e,s.issues,i):{success:!0,data:s.value}},nY=Symbol.for("zod.compile.invalid"),nQ=Symbol.for("zod.compile.fallback"),n0=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},n);return i instanceof Promise&&(i=await i),0===i.issues.length},n1={major:4,minor:6,patch:7},n2=rc("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=n1;let n=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of i)for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let i;if(t.memo)return t;let s=tM(t);for(let a of r){if(a._zod.def.when){if(tL(t)||!a._zod.def.when(t))continue}else if(s)continue;let r=t.issues.length,o=a._zod.check(t);if(o instanceof Promise&&n?.async===!1)throw new rd;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,t.issues.length!==r&&(tK(t.issues,r,e),s||(s=tM(t,r)))});else{if(t.issues.length===r)continue;tK(t.issues,r,e),s||(s=tM(t,r))}}return i?i.then(()=>t):t},r=(r,n,s)=>{if(tM(r))return r.aborted=!0,r;let a=t(n,i,s);if(a instanceof Promise){if(!1===s.async)throw new rd;return a.then(t=>e._zod.parse(t,s))}return e._zod.parse(a,s)};e._zod.run=(n,s)=>{if(s.skipChecks)return e._zod.parse(n,s);if("backward"===s.direction){let t=e._zod.parse({value:n.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,s)):r(t,n,s)}let a=e._zod.parse(n,s);if(a instanceof Promise){if(!1===s.async)throw new rd;return a.then(e=>t(e,i,s))}return t(a,i,s)}}},{get"~standard"(){return t7(this,"~standard",n9(this))},set"~standard"(e){t8(this,"~standard",e)}}),n4=(e,t)=>e.issues.length?{issues:e.issues.map(e=>tB(e,t,rf()))}:{value:e.value};async function n3(e,t){let r={async:!0};return n4(await e._zod.run({value:t,issues:[]},r),r)}function n9(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return n4(n,r)}catch(e){}return n3(e,t)},vendor:"zod",version:1}}let n5=rc("$ZodString",(e,t)=>{n2.init(e,t),e._zod.pattern=t.pattern??r1,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),n6=rc("$ZodStringFormat",(e,t)=>{n$.init(e,t),n5.init(e,t)}),n8=rc("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rE),n6.init(e,t)}),n7=rc("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=rT(e))}else t.pattern??(t.pattern=rT());n6.init(e,t)}),ie=rc("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rD),n6.init(e,t)});function it(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let ir=/[\t\n\r]/g;function ii(e){return e.replace(ir,"")}let is=rc("$ZodURL",(e,t)=>{n6.init(e,t),e._zod.check=r=>{try{var n,i;let s=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===rB.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(s,t):it(s)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=ii(s);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:ii(s);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ia=rc("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=rF()),n6.init(e,t)}),io=rc("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?r$:rA(t.length)),n6.init(e,t)}),il=rc("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rj),n6.init(e,t)}),ic=rc("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rk),n6.init(e,t)}),id=rc("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rz),n6.init(e,t)}),iu=rc("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rN),n6.init(e,t)}),ip=rc("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rS),n6.init(e,t)}),im=rc("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=r0(t)),n6.init(e,t)}),ih=rc("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rX),n6.init(e,t)}),ig=rc("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rQ(t)),n6.init(e,t)}),iv=rc("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rO),n6.init(e,t)}),iy=rc("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rR),n6.init(e,t)}),ix=/^[0-9a-fA-F:.]+$/;function ib(e){return!!ix.test(e)&&it(`http://[${e}]`)}let iw=rc("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rM),n6.init(e,t),e._zod.check=r=>{ib(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),i_=((e,t)=>{t.pattern??(t.pattern=rL(t.delimiter)),n6.init(e,t)},rc("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rU),n6.init(e,t)})),ij=rc("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rG),n6.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let i=Number(n);return`${i}`===n&&!(i<0)&&!(i>128)&&ib(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function ik(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let iz=/^[0-9a-zA-Z+/]*={0,2}$/,iN=rc("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=iz),n6.init(e,t),e._zod.check=r=>{ik(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),iS=/^[A-Za-z0-9_-]*$/,i$=rc("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iS),n6.init(e,t),e._zod.check=r=>{!function(e){if(!iS.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ik(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),iA=rc("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rJ),n6.init(e,t)}),iO=/[- ]/g,iE=((e,t)=>{t.pattern??(t.pattern=rq),n6.init(e,t),e._zod.check=r=>{var n;n=r.value,rq.test(n)&&function(e){let t=e.length,r=1,n=0;for(;t;){let i=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][i]:i}return n%10==0}(n.replace(iO,""))||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}},rc("$ZodJWT",(e,t)=>{n6.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),iT=((e,t)=>{n6.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},rc("$ZodNumber",(e,t)=>{n2.init(e,t),e._zod.pattern=r9,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}})),iP=rc("$ZodNumberFormat",(e,t)=>{nb.init(e,t),iT.init(e,t)}),iC=((e,t)=>{n2.init(e,t),e._zod.pattern=r5,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}},rc("$ZodBigInt",(e,t)=>{n2.init(e,t),e._zod.pattern=r4,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}})),iI=((e,t)=>{nw.init(e,t),iC.init(e,t)},rc("$ZodUnknown",(e,t)=>{n2.init(e,t),e._zod.parse=e=>e})),iD=rc("$ZodNever",(e,t)=>{n2.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function iZ(e,t){let r=tV(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(r,s)=>{let a=t(r.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[t,n]of tV(e._zod.def.checks))if(a>t&&n._zod.def.when(r)){let t=r.issues.length;return n._zod.check(r),r.issues[t].continue=!1,tK(r.issues,t,e),r}}return i(r,s)}}(e,t)=>{n2.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},(e,t)=>{n2.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}};let iF=e=>Array.isArray(e)?e.length:-1,iR=e=>e instanceof Map?e.size:-1,iM=e=>e instanceof Set?e.size:-1;function iL(e,t,r){e.issues.length&&t.issues.push(...tU(r,e.issues)),t.value[r]=e.value}let iU=rc("$ZodArray",(e,t)=>{n2.init(e,t);let r=rp.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=r?r.alloc(e,n,Array(s.length),i):Array(s.length);let a=[],o=i?.abortEarly;for(let e=0;e<s.length;e++){let r=s[e],l=t.element._zod.run({value:r,issues:[]},i);if(l instanceof Promise)a.push(l.then(t=>iL(t,n,e)));else if(iL(l,n,e),o&&0!==l.issues.length&&tM(l))break}return a.length?Promise.all(a).then(()=>n):n},iZ(e,iF)});function iG(e,t,r,n,i,s){let a=r in n,o="optional"===s;if(a||!o||"optional"!==i){if(e.issues.length){if(void 0!==i&&o&&!a)return;t.issues.push(...tU(r,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===i&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}let iV=[];function iK(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:iV,i=n.length?[...t,...n]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let s=t$(e.shape);return{...e,allKeys:i,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function iB(e,t,r,n,i,s,a){let o=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,u=c.optin,p=c.optout,f=0;for(let i in t){if(a&&r.issues.length!==f){if(tM(r,f))break;f=r.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===d&&o.push(i);continue}if("never"===d){o.push(i);continue}let s=c.run({value:t[i],issues:[]},n);s instanceof Promise?e.push(s.then(e=>iG(e,r,i,t,u,p))):iG(s,r,i,t,u,p)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let iJ=rc("$ZodObject",(e,t)=>{let r;n2.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let e=()=>{let r={...i};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let s=e3(()=>iK(t));rn(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||tt(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,o=rp.memoizer;o?.attach(e),e._zod.parse=(t,n)=>{r??(r=s.value);let i=t.value;if(!th(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=o?o.alloc(e,t,{},n):{};let l=[],c=r.shape,d=n?.abortEarly,u=t.issues.length;for(let e of r.allKeys){if(d&&t.issues.length!==u){if(tM(t,u))break;u=t.issues.length}if("__proto__"===e)continue;let r=c[e],s=r._zod.optin,a=r._zod.optout,o=r._zod.run({value:i[e],issues:[]},n);o instanceof Promise?l.push(o.then(r=>iG(r,t,e,i,s,a))):iG(o,t,e,i,s,a)}return a?iB(l,i,t,n,s.value,e,!0===d):l.length?Promise.all(l).then(()=>t):t}}),iq=rc("$ZodObjectJIT",(e,t)=>{let r,n;iJ.init(e,t);let i=e._zod.parse,s=e3(()=>iK(t)),a=rp.memoizer,o=!rp.jitless,l=o&&tg.value,c=t.catchall;e._zod.parse=(d,u)=>{n??(n=s.value);let p=d.value;return th(p)?o&&l&&u?.async===!1&&!0!==u.jitless?(r||(r=(t=>{let r=s.value,n=r.symbolKeys,i=new nZ(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),o=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;i.write("const input = payload.value;");let c=Object.create(null),d=0;for(let e of r.allKeys)c[e]=`key_${d++}`;for(let e of(i.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),r.allKeys)){if("__proto__"===e)continue;let r=c[e],s="symbol"==typeof e?`syms[${n.indexOf(e)}]`:tp(e),a=`${s} in input`,d=t[e],u=d?._zod?.optin,p=void 0!==u,f=d?._zod?.optout==="optional";if(i.write(`const ${r} = ${o(s)};`),p&&f){let e="optional"===u?`${r}_present`:`${r}.value !== undefined || ${r}_present`;i.write(`
|
|
15
|
+
const ${r}_present = ${a};
|
|
16
|
+
if (!${r}.issues.length || ${r}_present) {
|
|
17
|
+
if (${r}.issues.length) {${l(r,s)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${s}] = ${r}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else p?(i.write(`
|
|
26
|
+
if (${r}.issues.length) {${l(r,s)}
|
|
27
|
+
}
|
|
28
|
+
`),"defaulted"===u?i.write(`newResult[${s}] = ${r}.value;`):i.write(`
|
|
29
|
+
if (${r}.value !== undefined || ${a}) {
|
|
30
|
+
newResult[${s}] = ${r}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):i.write(`
|
|
33
|
+
const ${r}_present = ${a};
|
|
34
|
+
if (${r}.issues.length) {${l(r,s)}
|
|
35
|
+
}
|
|
36
|
+
if (!${r}_present && !${r}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${s}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${r}_present) {
|
|
50
|
+
newResult[${s}] = ${r}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),d=r(d,u),c)?iB([],p,d,u,n,e,u?.abortEarly===!0):d:i(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function iW(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!tM(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>tB(e,n,rf())))}),t)}let iH=rc("$ZodUnion",(e,t)=>{n2.init(e,t),rn(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),rn(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),rn(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),rn(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>e5(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>iW(t,n,e,i)):iW(a,n,e,i)}});function iX(e,t,r,n){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>tB(e,n,rf())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{iH.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);t instanceof Promise?(a.push(t),s=!0):a.push(t)}return s?Promise.all(a).then(t=>iX(t,n,e,i)):iX(a,n,e,i)}},(e,t)=>{t.inclusive=!1,iH.init(e,t);let r=e._zod.parse;rn(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,s]of(i[e.def.discriminator]?.has(void 0)&&r++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||tt(t,n,new Set),s))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=tr(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=e3(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(i,s)=>{let a=i.value;if(!th(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let o=a?.[t.discriminator],l=n.value.get(o);return l&&(void 0!==o||"backward"!==s.direction)?l._zod.run(i,s):t.unionFallback||"backward"===s.direction?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}};let iY=rc("$ZodIntersection",(e,t)=>{n2.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,r])=>iQ(e,t,r)):iQ(e,i,s)}});function iQ(e,t,r){let n,i=new Map,s=new Map,a=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);s.has(t)||s.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let r of t.issues)a(r,"l")||e.issues.push(r);for(let t of r.issues)a(t,"r")||e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length){let t=n?o.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),o))!t.includes(r)&&s.has(r)&&e.issues.push(s.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(tv(t)&&tv(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),s={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,i)){if("__proto__"===n)continue;let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};s[n]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let s=e(t[i],r[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(tM(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let i0=rc("$ZodTuple",(e,t)=>{n2.init(e,t);let r=t.items,n=rp.memoizer;n?.attach(e),e._zod.parse=(i,s)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=n?n.alloc(e,i,[],s):[];let o=[],l=i1(r,"optin"),c=i1(r,"optout");if(!t.rest){if(a.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:a,inst:e,origin:"array"}),i;a.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let d=Array(r.length),u=t.rest?s?.abortEarly:void 0,p=!1;for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},s);t instanceof Promise?o.push(t.then(t=>{d[e]=t})):(d[e]=t,u&&!p&&t.issues.length&&(p=tM(t)))}if(t.rest&&!p){let e=r.length-1,n=a.slice(r.length),l=i.issues.length;for(let r of n){if(u&&i.issues.length!==l){if(tM(i,l))break;l=i.issues.length}e++;let n=t.rest._zod.run({value:r,issues:[]},s);n instanceof Promise?o.push(n.then(t=>i2(t,i,e))):i2(n,i,e)}}return o.length?Promise.all(o).then(()=>i4(d,i,r,a,c)):i4(d,i,r,a,c)}});function i1(e,t){for(let r=e.length-1;r>=0;r--)if(!("optin"===t?void 0!==e[r]._zod.optin:"optional"===e[r]._zod.optout))return r+1;return 0}function i2(e,t,r){e.issues.length&&t.issues.push(...tU(r,e.issues)),t.value[r]=e.value}function i4(e,t,r,n,i){for(let s=0;s<r.length;s++){let a=e[s],o=s<n.length;if(!o&&s>=i&&"optional"===r[s]._zod.optin){t.value.length=s;break}if(a.issues.length){if(!o&&s>=i){t.value.length=s;break}t.issues.push(...tU(s,a.issues))}t.value[s]=a.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function i3(e,t,r,n,i,s,a){e.issues.length&&(tw.has(typeof n)?r.issues.push(...tU(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:e.issues.map(e=>tB(e,a,rf()))})),t.issues.length&&(tw.has(typeof n)?r.issues.push(...tU(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:n,issues:t.issues.map(e=>tB(e,a,rf()))})),r.value.set(e.value,t.value)}function i9(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{n2.init(e,t);let r=rp.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!tv(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o&&!t.partial){let l;n.value=r?r.alloc(e,n,{},i):{};let c=new Set;for(let r of o)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(c.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let o=t.keyType._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>tB(e,i,rf())),input:r,path:[r],inst:e});continue}let l=o.value;if("__proto__"===l)continue;let d=t.valueType._zod.run({value:s[r],issues:[]},i);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(...tU(r,e.issues)),n.value[l]=e.value})):(d.issues.length&&n.issues.push(...tU(r,d.issues)),n.value[l]=d.value)}for(let e in s)if(!c.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=s[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}else{let l;for(let c of(n.value=r?r.alloc(e,n,{},i):{},Reflect.ownKeys(s))){if("__proto__"===c||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let r=t.keyType._zod.run({value:c,issues:[]},i);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof c&&r9.test(c)&&r.issues.length){let e=t.keyType._zod.run({value:Number(c),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[c]=s[c]:o?(l=l??[]).push(c):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>tB(e,i,rf())),input:c,path:[c],inst:e});continue}let d=r.value;if("__proto__"===d)continue;let u=t.valueType._zod.run({value:s[c],issues:[]},i);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...tU(c,e.issues)),n.value[d]=e.value})):(u.issues.length&&n.issues.push(...tU(c,u.issues)),n.value[d]=u.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}},(e,t)=>{n2.init(e,t);let r=rp.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];n.value=r?r.alloc(e,n,new Set,i):new Set;let o=i?.abortEarly,l=n.issues.length;for(let e of s){if(o&&n.issues.length!==l){if(tM(n,l))break;l=n.issues.length}let r=t.valueType._zod.run({value:e,issues:[]},i);r instanceof Promise?a.push(r.then(e=>i9(e,n))):i9(r,n)}return a.length?Promise.all(a).then(()=>n):n},iZ(e,iM)};let i5=rc("$ZodEnum",(e,t)=>{n2.init(e,t);let r=e0(t.entries),n=new Set(r);e._zod.values=n,rn(e,"pattern",e=>{let t=e0(e.def.entries).filter(e=>tw.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>tj(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),i6=((e,t)=>{n2.init(e,t);let r=new Set(t.values);e._zod.values=r,rn(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?tj(e):e?tj(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}},rc("$ZodTransform",(e,t)=>{n2.init(e,t),e._zod.optin="optional",rp.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ru(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r));if(i instanceof Promise)throw new rd;return r.value=i,r}}));function i8(e,t){return e.value=t.issues.length?void 0:t.value,e}let i7=rc("$ZodOptional",(e,t)=>{n2.init(e,t),rn(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",rn(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),rn(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${e5(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>i8(e,t)):i8(e,n)}return t.innerType._zod.run(e,r)}}),se=rc("$ZodExactOptional",(e,t)=>{i7.init(e,t),rn(e,"values",e=>e.def.innerType._zod.values),rn(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),st=rc("$ZodNullable",(e,t)=>{n2.init(e,t),rn(e,"optin",e=>e.def.innerType._zod.optin),rn(e,"optout",e=>e.def.innerType._zod.optout),rn(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${e5(t.source)}|null)$`):void 0}),rn(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),sr=rc("$ZodDefault",(e,t)=>{n2.init(e,t),e._zod.optin="defaulted",rn(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>sn(e,t)):sn(n,t)}});function sn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let si=rc("$ZodPrefault",(e,t)=>{n2.init(e,t),e._zod.optin="defaulted",rn(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),ss=rc("$ZodNonOptional",(e,t)=>{n2.init(e,t),rn(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>sa(t,e)):sa(i,e)}});function sa(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function so(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>tB(e,n,rf()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{n2.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new ru("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let sl=rc("$ZodCatch",(e,t)=>{n2.init(e,t),rn(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),rn(e,"optout",e=>e.def.innerType._zod.optout),rn(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>so(e,n,t,r)):so(e,n,t,r)}}),sc=((e,t)=>{n2.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},rc("$ZodPipe",(e,t)=>{n2.init(e,t),rn(e,"values",e=>e.def.in._zod.values),rn(e,"optin",e=>e.def.in._zod.optin),rn(e,"optout",e=>e.def.out._zod.optout),rn(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sd(e,t.in,r)):sd(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sd(e,t.out,r)):sd(n,t.out,r)}}));function sd(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function su(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>sp(e,n,t.out,r)):sp(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>sp(e,n,t.in,r)):sp(e,n,t.in,r)}}function sp(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{n2.init(e,t),rn(e,"values",e=>e.def.in._zod.values),rn(e,"optin",e=>e.def.in._zod.optin),rn(e,"optout",e=>e.def.out._zod.optout),rn(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>su(e,t,r)):su(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>su(e,t,r)):su(n,t,r)}}},(e,t)=>{sc.init(e,t)};let sf=rc("$ZodReadonly",(e,t)=>{n2.init(e,t),rn(e,"propValues",e=>e.def.innerType._zod.propValues),rn(e,"values",e=>e.def.innerType._zod.values),rn(e,"optin",e=>e.def.innerType?._zod?.optin),rn(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(sm):sm(n)}});function sm(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{n2.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let r=t._zod.def,n=t._zod.pattern?.source,i=r.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,r=e(i);return n&&t&&r&&r!==t?n.replace(e5(t),()=>e5(r)):n}if(r.options){let t=r.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>e5(e)).join("|")})$`}return function(e){let t,r,n=e._zod.def,i=n.pattern,s=!!n.format?.includes("int");for(let e of n.checks??[]){let n=e._zod.def;n.pattern&&(i=n.pattern),s||(s=!!n.format?.includes("int"));let a=n.minimum??n.length,o=n.maximum??n.length;void 0!==a&&(void 0===t||a>t)&&(t=a),void 0!==o&&(void 0===r||o<r)&&(r=o)}if(i)return i.source;if(void 0!==t&&void 0!==r&&t>r)return"(?!)";if(void 0!==t||void 0!==r)return r2({minimum:t,maximum:r}).source;let a=e._zod.pattern;return(s&&a===r9?r3:a)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);r.push(e5(t))}else if(null===e||t_.has(typeof e))r.push(tj(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{n2.init(e,t),e7(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),rn(e,"pattern",e=>e.innerType?._zod?.pattern),rn(e,"propValues",e=>e.innerType?._zod?.propValues),rn(e,"optin",e=>e.innerType?._zod?.optin??void 0),rn(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let sh=rc("$ZodCustom",(e,t)=>{nf.init(e,t),n2.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>sg(t,r,n,e));sg(i,r,n,e)}});function sg(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(tY(e))}}function sv(e){return e.checks&&(e.checks=[...e.checks]),e}function sy(e,t){return new nv({check:"less_than",...tz(t),value:e,inclusive:!1})}function sx(e,t){return new nv({check:"less_than",...tz(t),value:e,inclusive:!0})}function sb(e,t){return new ny({check:"greater_than",...tz(t),value:e,inclusive:!1})}function sw(e,t){return new ny({check:"greater_than",...tz(t),value:e,inclusive:!0})}function s_(e,t){return new nx({check:"multiple_of",...tz(t),value:e})}function sj(e,t){return new nz({check:"max_length",...tz(t),maximum:e})}function sk(e,t){return new nN({check:"min_length",...tz(t),minimum:e})}function sz(e,t){return new nS({check:"length_equals",...tz(t),length:e})}function sN(e){return new nD({check:"overwrite",tx:e})}e.i(682358);var sS=e.i(922143),sS=sS,s$=sS,sA=sS,sO=sS,sE=sS,sT=sS,sP=sS,sC=sS,sI=sS,sD=sS,sZ=sS,sF=sS,sR=sS,sM=sS,sL=sS,sU=sS,sG=e.i(247167);function sV(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&tt(e,t,r[t]);return e}function sK(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??r_,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function sB(e,t,r,n,i){let s="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:i}):t.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(i);return Object.assign(r,s),!0}function sJ(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,s=t.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,r,n)}let s=e._zod.parent;s&&(a.ref||(a.ref=s),sJ(s,t,n),t.seen.get(s).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&sV(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function sq(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sW(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:s}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let s=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${n}/${sq(s)}`}}let i=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:i+sq(s)}})(t);n.def={...n.schema},s&&(n.defId=s);let a=n.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){i(r);continue}n.count>1&&"ref"===e.reused&&i(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let sH=new Set(["type","properties","required","additionalProperties"]),sX=["oneOf","anyOf"];function sY(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function sQ(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!sH.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??sY(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}tt(r,n,1===e.length?e[0]:sQ(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let i={type:"object",properties:r};if(n.size&&(i.required=[...n]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let r of t){let t=sY(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function s0(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,s={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(o)):sV(i,o),sV(i,s),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(o.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let o=t._zod.parent;if(o&&o!==a){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sH)if(t in e)return;let r=t.filter(e=>sX.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],i=sX.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let s=t.filter(t=>t!==e),a=e[i].map(e=>sQ([...s,e]));if(a.some(e=>!e))return;n={[i]:a}}else n=sQ(t);n&&(delete e.allOf,sV(e,n))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}sV(i,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,tt(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:s1(t,"input",e.processors),output:s1(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let s1=(e,t,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},a=sK({...i??{},target:s,io:t,processors:r});return sJ(e,a),sW(a,e),s0(a,e)},s2=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},s4=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},s3=(e,t)=>{s2(e,"minimum",t),s4(e,"maximum",t)},s9=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},s5=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},s6=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},s8=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},s7=(e,t)=>s2(e,"minimum",t.minimum),ae=(e,t)=>s4(e,"maximum",t.maximum),at=e=>(t,r)=>{s8(t,r.format);let[n,i]=e[r.format];s2(t,"minimum",n),s4(t,"maximum",i)},ar={greater_than:(e,t)=>s2(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>s4(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>s9(e,t.value),number_format:at(tA),bigint_format:at(tO),min_length:s7,max_length:ae,length_equals:(e,t)=>s3(e,t.length),min_size:s7,max_size:ae,size_equals:(e,t)=>s3(e,t.size),string_format:(e,t)=>{s8(e,t.format),t.pattern&&s5(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>s6(e,t.mime)};function an(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])ar[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&s2(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&s2(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&s4(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&s4(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&s9(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&s6(t,n.mime),n.patterns??[]))s5(t,e);return t}let ai={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},as=new Map([[iz,rV],[iS,rK]]),aa=e=>as.get(e)??e;new WeakMap;let ao=Symbol();function al(e,t,r,n,i){let s=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(s=!0,null));return s?(sB(t,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),ao):JSON.parse(a)}let ac=(e,t,r,n)=>{let i=e._zod.def;sJ(i.innerType,t,n),t.seen.get(e).ref=i.innerType},ad=new WeakSet([Object.prototype,Error.prototype]);function au(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let ap=rc("ZodError",(e,t)=>{nU.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);ad.has(r)||(ad.add(r),au(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>n({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)n({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)n({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)r._errors.push(t(s));else{let n=r,i=0;for(;i<e.length;){let r=e[i],a=i===e.length-1;if("_errors"===r){a&&n._errors.push(t(s)),i++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let o=n[r];a&&o._errors.push(t(s)),n=o,i++}}}};return n(e),r})(e,t)),au(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let a of e.issues)if(a.path.length>0){var i,s;(i=a.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(r,i)&&("__proto__"===i?Object.defineProperty(r,i,{value:s(),writable:!0,enumerable:!0,configurable:!0}):r[i]=s()),r[i]).push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}})(e,t)),au(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,e2,2)}),au(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,e2,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,ap],789282);let af=nK(ap),am=nJ(ap),ah=nW(ap),ag=nX(ap),av=(n=nK(ap),i=(e,t,r,s)=>n(e,t,r?{...r,direction:"backward"}:{direction:"backward"},nV(i,s))),ay=(s=nK(ap),a=(e,t,r,n)=>s(e,t,r,nV(a,n))),ax=(o=nJ(ap),l=async(e,t,r,n)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return await o(e,t,i,nV(l,n))}),ab=(c=nJ(ap),d=async(e,t,r,n)=>await c(e,t,r,nV(d,n))),aw=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nW(ap)(e,t,n)},a_=(e,t,r)=>nW(ap)(e,t,r),aj=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nX(ap)(e,t,n)},ak=async(e,t,r)=>nX(ap)(e,t,r);function az(){rp.memoizer||rf({memoizer:rw})}let aN=rc("ZodType",(e,t)=>(rp.localeError||rf({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(tX(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${tS(r.values[0])}`;return`Invalid option: expected one of ${e1(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${e1(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),n2.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(s$.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return tk(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ov({type:"custom",check:"custom",fn:e,...tz(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(tY(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(tY(e)))},e(t.value,t)),(i=new nf({check:"custom",...tz(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(sN(e))},optional(){return oa(this)},exactOptional(){var e;return e=this,new oo({type:"optional",innerType:e})},nullable(){return oc(this)},nullish(){return oa(oc(this))},nonoptional(e){var t,r;return t=this,r=e,new op({type:"nonoptional",innerType:t,...sT.normalizeParams(r)})},array(){return a8(this)},or(e){return new ot({type:"union",options:[this,e],...sT.normalizeParams(void 0)})},and(e){var t;return t=this,new or({type:"intersection",left:t,right:e})},transform(e){return oh(this,new oi({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new od({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():sU.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new ou({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():sU.shallowClone(r)}})},catch(e){var t,r;return t=this,new of({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:sS.constantCatch(r)})},pipe(e){return oh(this,e)},readonly(){var e;return e=this,new og({type:"readonly",innerType:e})},describe(e){let t=this.clone();return r_.add(t,{description:e}),t},meta(...e){if(0===e.length)return r_.get(this);let t=this.clone();return r_.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return sA.hide(this,"~standard",{...n9(this),jsonSchema:{input:s1(this,"input"),output:s1(this,"output")}})},set"~standard"(e){sO.own(this,"~standard",e)},parse:function e(t,r){return af(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await am(this,t,r,{callee:e})},safeParse(e,t){return ah(this,e,t)},async safeParseAsync(e,t){return ag(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){sO.own(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==nY)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;if(s?(i[nQ]=!0,n=s({value:t,issues:[]},i)):n=e._zod.run({value:t,issues:[]},i),n instanceof Promise)throw new rd;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return n0(this,e,t)},encode:function e(t,r){return av(this,t,r,{callee:e})},decode:function e(t,r){return ay(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ax(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ab(this,t,r,{callee:e})},safeEncode(e,t){return aw(this,e,t)},safeDecode(e,t){return a_(this,e,t)},async safeEncodeAsync(e,t){return aj(this,e,t)},async safeDecodeAsync(e,t){return ak(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=sK({...r,processors:t});return sJ(e,n),sW(n,e),s0(n,e)})(this,{})(e)},get description(){return r_.get(this)?.description},get _def(){return this._zod.def}}),aS=rc("_ZodString",(e,t)=>{n5.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:i,format:s,patterns:a,contentEncoding:o,laxFormat:l}=an(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof i&&(r.maxLength=i),s&&(r.format=ai[s]??s,""===r.format&&delete r.format,("time"===s||l)&&delete r.format),o&&(r.contentEncoding=o),a&&a.size>0){let e=[...a].map(aa);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},sE.derived({format:e=>an(e).format??null,minLength:e=>an(e).minimum??null,maxLength:e=>an(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nA({check:"string_format",format:"regex",...tz(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new nT({check:"string_format",format:"includes",...tz(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new nP({check:"string_format",format:"starts_with",...tz(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new nC({check:"string_format",format:"ends_with",...tz(t),suffix:e})}(...e))},min(...e){return this.check(sk(...e))},max(...e){return this.check(sj(...e))},length(...e){return this.check(sz(...e))},nonempty(...e){return this.check(sk(1,...e))},lowercase(e){return this.check(new nO({check:"string_format",format:"lowercase",...tz(e)}))},uppercase(e){return this.check(new nE({check:"string_format",format:"uppercase",...tz(e)}))},trim(){return this.check(sN(e=>e.trim()))},normalize(...e){return this.check(function(e){return sN(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(sN(e=>e.toLowerCase()))},toUpperCase(){return this.check(sN(e=>e.toUpperCase()))},slugify(){return this.check(sN(e=>tf(e)))}})),a$=rc("ZodString",(e,t)=>{n5.init(e,t),aS.init(e,t)},{email(e){return this.check(new aI({type:"string",format:"email",check:"string_format",abort:!1,...tz(e)}))},url(e){return this.check(new aF({type:"string",format:"url",check:"string_format",abort:!1,...tz(e)}))},jwt(e){return this.check(new aQ({type:"string",format:"jwt",check:"string_format",abort:!1,...tz(e)}))},emoji(e){return this.check(new aR({type:"string",format:"emoji",check:"string_format",abort:!1,...tz(e)}))},guid(e){return this.check(new aD({type:"string",format:"guid",check:"string_format",abort:!1,...tz(e)}))},uuid(e){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,...tz(e)}))},uuidv4(e){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...tz(e)}))},uuidv6(e){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...tz(e)}))},uuidv7(e){return this.check(new aZ({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...tz(e)}))},nanoid(e){return this.check(new aM({type:"string",format:"nanoid",check:"string_format",abort:!1,...tz(e)}))},cuid(e){return this.check(new aL({type:"string",format:"cuid",check:"string_format",abort:!1,...tz(e)}))},cuid2(e){return this.check(new aU({type:"string",format:"cuid2",check:"string_format",abort:!1,...tz(e)}))},ulid(e){return this.check(new aG({type:"string",format:"ulid",check:"string_format",abort:!1,...tz(e)}))},base64(e){return this.check(new aH({type:"string",format:"base64",check:"string_format",abort:!1,...tz(e)}))},base64url(e){return this.check(new aX({type:"string",format:"base64url",check:"string_format",abort:!1,...tz(e)}))},xid(e){return this.check(new aV({type:"string",format:"xid",check:"string_format",abort:!1,...tz(e)}))},ksuid(e){return this.check(new aK({type:"string",format:"ksuid",check:"string_format",abort:!1,...tz(e)}))},ipv4(e){return this.check(new aB({type:"string",format:"ipv4",check:"string_format",abort:!1,...tz(e)}))},ipv6(e){return this.check(new aJ({type:"string",format:"ipv6",check:"string_format",abort:!1,...tz(e)}))},cidrv4(e){return this.check(new aq({type:"string",format:"cidrv4",check:"string_format",abort:!1,...tz(e)}))},cidrv6(e){return this.check(new aW({type:"string",format:"cidrv6",check:"string_format",abort:!1,...tz(e)}))},e164(e){return this.check(new aY({type:"string",format:"e164",check:"string_format",abort:!1,...tz(e)}))},datetime(e){return this.check(new aE({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...tz(e)}))},date(e){return this.check(new aT({type:"string",format:"date",check:"string_format",...tz(e)}))},time(e){return this.check(new aP({type:"string",format:"time",check:"string_format",precision:null,...tz(e)}))},duration(e){return this.check(new aC({type:"string",format:"duration",check:"string_format",...tz(e)}))}});function aA(e){return new a$(sv({type:"string",...tz(e)}))}let aO=rc("ZodStringFormat",(e,t)=>{n6.init(e,t),aS.init(e,t)}),aE=rc("ZodISODateTime",(e,t)=>{im.init(e,t),aO.init(e,t)}),aT=rc("ZodISODate",(e,t)=>{ih.init(e,t),aO.init(e,t)}),aP=rc("ZodISOTime",(e,t)=>{ig.init(e,t),aO.init(e,t)}),aC=rc("ZodISODuration",(e,t)=>{iv.init(e,t),aO.init(e,t)}),aI=rc("ZodEmail",(e,t)=>{ie.init(e,t),aO.init(e,t)}),aD=rc("ZodGUID",(e,t)=>{n8.init(e,t),aO.init(e,t)}),aZ=rc("ZodUUID",(e,t)=>{n7.init(e,t),aO.init(e,t)}),aF=rc("ZodURL",(e,t)=>{is.init(e,t),aO.init(e,t)}),aR=rc("ZodEmoji",(e,t)=>{ia.init(e,t),aO.init(e,t)}),aM=rc("ZodNanoID",(e,t)=>{io.init(e,t),aO.init(e,t)}),aL=rc("ZodCUID",(e,t)=>{il.init(e,t),aO.init(e,t)}),aU=rc("ZodCUID2",(e,t)=>{ic.init(e,t),aO.init(e,t)}),aG=rc("ZodULID",(e,t)=>{id.init(e,t),aO.init(e,t)}),aV=rc("ZodXID",(e,t)=>{iu.init(e,t),aO.init(e,t)}),aK=rc("ZodKSUID",(e,t)=>{ip.init(e,t),aO.init(e,t)}),aB=rc("ZodIPv4",(e,t)=>{iy.init(e,t),aO.init(e,t)}),aJ=rc("ZodIPv6",(e,t)=>{iw.init(e,t),aO.init(e,t)}),aq=rc("ZodCIDRv4",(e,t)=>{i_.init(e,t),aO.init(e,t)}),aW=rc("ZodCIDRv6",(e,t)=>{ij.init(e,t),aO.init(e,t)}),aH=rc("ZodBase64",(e,t)=>{iN.init(e,t),aO.init(e,t)}),aX=rc("ZodBase64URL",(e,t)=>{i$.init(e,t),aO.init(e,t)}),aY=rc("ZodE164",(e,t)=>{iA.init(e,t),aO.init(e,t)}),aQ=rc("ZodJWT",(e,t)=>{iE.init(e,t),aO.init(e,t)}),a0=rc("ZodNumber",(e,t)=>{iT.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:o,exclusiveMinimum:l,isInt:c}=an(e);r.type=c?"integer":"number";let d="number"==typeof l&&l>=(i??-1/0),u="number"==typeof o&&o<=(s??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;if(d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),u?p?(r.maximum=o,r.exclusiveMaximum=!0):r.exclusiveMaximum=o:"number"==typeof s&&(r.maximum=s),a){let i=new Set;for(let s of a)Number.isFinite(s)&&0!==s?i.add(Math.abs(s)):sB(e,t,r,n,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...o]=i;void 0!==s&&(r.multipleOf=s),o.length&&(r.allOf=[...r.allOf??[],...o.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},sE.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=an(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=an(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=an(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>an(e).format??null},{gt(e,t){return this.check(sb(e,t))},gte(e,t){return this.check(sw(e,t))},min(e,t){return this.check(sw(e,t))},lt(e,t){return this.check(sy(e,t))},lte(e,t){return this.check(sx(e,t))},max(e,t){return this.check(sx(e,t))},int(e){return this.check(a4(e))},safe(e){return this.check(a4(e))},positive(e){return this.check(sb(0,e))},nonnegative(e){return this.check(sw(0,e))},negative(e){return this.check(sy(0,e))},nonpositive(e){return this.check(sx(0,e))},multipleOf(e,t){return this.check(s_(e,t))},step(e,t){return this.check(s_(e,t))},finite(){return this}}));function a1(e){return new a0(sv({type:"number",checks:[],...tz(e)}))}let a2=rc("ZodNumberFormat",(e,t)=>{iP.init(e,t),a0.init(e,t)});function a4(e){return new a2({type:"number",check:"number_format",abort:!1,format:"safeint",...tz(e)})}(e,t)=>{iC.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"BigInt cannot be represented in JSON Schema")}};let a3=rc("ZodUnknown",(e,t)=>{iI.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function a9(){return new a3({type:"unknown"})}let a5=rc("ZodNever",(e,t)=>{iD.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),a6=rc("ZodArray",(e,t)=>{az(),iU.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:s,maximum:a}=an(e);"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=sJ(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(sk(e,t))},nonempty(e){return this.check(sk(1,e))},max(e,t){return this.check(sj(e,t))},length(e,t){return this.check(sz(e,t))},unwrap(){return this.element}});function a8(e,t){return new a6({type:"array",element:e,...tz(t)})}let a7=rc("ZodObject",(e,t)=>{az(),iq.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&sB(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},s)tt(r.properties,e,sJ(s[e],t,{...n,path:[...n.path,"properties",e]}));let a=[];for(let e of Object.keys(s)){let r=i.shape[e];("input"===t.io?void 0===function e(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?e(r.out):"catch"===r.type?e(r.innerType):t._zod.optin}(r):void 0===r._zod.optout)&&a.push(e)}a.length>0&&(r.required=a),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=sJ(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),sM.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){var e;return new on({type:"enum",entries:Array.isArray(e=Object.keys(this._zod.def.shape))?Object.fromEntries(e.map(e=>[e,e])):e,...sT.normalizeParams(void 0)})},catchall(e){return this.clone(s$.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(s$.mergeDefs(this._zod.def,{catchall:a9()}))},loose(){return this.clone(s$.mergeDefs(this._zod.def,{catchall:a9()}))},strict(){return this.clone(s$.mergeDefs(this._zod.def,{catchall:new a5({type:"never",...tz(void 0)})}))},strip(){return this.clone(s$.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return sP.extend(this,e)},safeExtend(e){return sC.safeExtend(this,e)},merge(e){return sI.merge(this,e)},pick(e){return sD.pick(this,e)},omit(e){return sZ.omit(this,e)},partial(...e){return sF.partial(os,this,e[0])},exactPartial(...e){return sF.partial(oo,this,e[0],"exactPartial")},required(...e){return sR.required(op,this,e[0])}});function oe(e,t){return new a7({type:"object",shape:e??{},...sT.normalizeParams(t)})}let ot=rc("ZodUnion",(e,t)=>{iH.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,s,a,o;let l,c,d;return i=e,s=t,a=r,o=n,c=!1===(l=i._zod.def).inclusive,d=l.options.map((e,t)=>sJ(e,s,{...o,path:[...o.path,c?"oneOf":"anyOf",t]})),void(c?a.oneOf=d:a.anyOf=d)},e.options=t.options}),or=rc("ZodIntersection",(e,t)=>{iY.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a,o,l;return s=sJ((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=sJ(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...o(a)?a.allOf:[a]],t.intersections.push(l))}}),on=rc("ZodEnum",(e,t)=>{i5.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=e0(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new on({...t,checks:[],...sT.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new on({...t,checks:[],...sT.normalizeParams(n),entries:i})}}),oi=rc("ZodTransform",(e,t)=>{az(),i6.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ru(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(sL.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(sL.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}}),os=rc("ZodOptional",(e,t)=>{i7.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ac(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function oa(e){return new os({type:"optional",innerType:e})}let oo=rc("ZodExactOptional",(e,t)=>{se.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ac(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),ol=rc("ZodNullable",(e,t)=>{st.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=sJ((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function oc(e){return new ol({type:"nullable",innerType:e})}let od=rc("ZodDefault",(e,t)=>{sr.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s;return sJ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,void((s=al(i.defaultValue,e,t,r,n))!==ao&&(r.default=s))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ou=rc("ZodPrefault",(e,t)=>{si.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(sJ(i.innerType,t,n),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let s=al(i.defaultValue,e,t,r,n);s!==ao&&(r._prefault=s)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),op=rc("ZodNonOptional",(e,t)=>{ss.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;sJ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),of=rc("ZodCatch",(e,t)=>{sl.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,s=e._zod.def;sJ(s.innerType,t,n),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{sB(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),om=rc("ZodPipe",(e,t)=>{sc.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(sJ(a="input"===t.io?s?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function oh(e,t){return new om({type:"pipe",in:e,out:t})}let og=rc("ZodReadonly",(e,t)=>{sf.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;sJ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ov=rc("ZodCustom",(e,t)=>{sh.init(e,t),aN.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,a8,"number",0,a1,"object",0,oe,"string",0,aA],362201),e.i(362201),e.s([],430421),e.i(430421),e.i(789282),e.s([],100364),e.i(100364),e.s([],458829),e.i(458829),e.s(["array",0,a8,"number",0,a1,"object",0,oe,"string",0,aA],722219);var oy=e.i(722219),oy=oy,ox=oy,ob=oy,ow=oy;let o_="https://github.com/xiaoyang111222/cn-math-taxonomy",oj="https://raw.githubusercontent.com/xiaoyang111222/cn-math-taxonomy/HEAD/data/topics.json",ok=oy.object({id:ox.string().optional(),name:ox.string().trim().min(1),subject:ox.string().nullish(),grade:ob.number().int(),semester:ox.string().nullish(),chapter:ox.string().nullish()}).passthrough();ow.array(ok).min(1);let oz="/api/admin/cnm-tags";function oN(){let{t:e}=(0,h.b)(),t=e.admin.cnmTags,[r,n]=(0,m.useState)(null),[i,s]=(0,m.useState)(!1),a=(0,m.useRef)(null),o=(0,m.useCallback)(async()=>{try{n(await v.k.get(oz))}catch(e){x.V.warn("[CnmTagImportSettings]","Failed to load status",{error:e})}},[]);(0,m.useEffect)(()=>{o()},[o]);let l=async e=>{if(e){s(!0);try{let r;try{r=JSON.parse(await e.text())}catch{eN.c.error(t.invalidFile);return}let i=await v.k.post(oz,{topics:r},{timeout:3e5});n(i.status),eN.c.success(t.imported.replace("{created}",String(i.result.created)).replace("{skipped}",String(i.result.skipped)))}catch(r){x.V.error("[CnmTagImportSettings]","Import failed",{error:r});let e=r instanceof v.a&&400===r.status;eN.c.error(e?t.invalidFile:t.failed)}finally{s(!1),a.current&&(a.current.value="")}}},c=r?.knowledgePoints??0;return(0,f.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,f.jsx)(F.f,{className:"h-4 w-4"}),t.title]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:t.desc})]}),(0,f.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-xs text-muted-foreground",children:[(0,f.jsx)("p",{children:t.downloadHint}),(0,f.jsx)("a",{href:oj,target:"_blank",rel:"noopener noreferrer",className:"block break-all text-primary underline",children:oj}),(0,f.jsxs)("p",{children:[t.sourceLabel," ",(0,f.jsx)("a",{href:o_,target:"_blank",rel:"noopener noreferrer",className:"break-all text-primary underline",children:o_})]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r?c>0?t.status.replace("{count}",String(c)):t.notImported:""}),(0,f.jsx)("input",{ref:a,type:"file",accept:".json,application/json",className:"hidden",onChange:e=>l(e.target.files?.[0]),disabled:i}),(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",className:"w-full sm:w-auto",onClick:()=>a.current?.click(),disabled:i,children:[i?(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(eJ,{className:"mr-2 h-4 w-4"}),i?t.importing:t.select]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:t.note})]})}var oS=e.i(741120);let o$={info:{card:"border-blue-200 dark:border-blue-900 bg-blue-50 dark:bg-blue-950/40",title:"text-blue-900 dark:text-blue-200 font-bold",desc:"text-blue-800 dark:text-blue-200 font-medium",button:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800"},danger:{card:"border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/40",title:"text-red-700 dark:text-red-300 font-medium",desc:"text-red-600 dark:text-red-400",button:""},critical:{card:"border-red-600/50 bg-red-100/50 dark:bg-red-900/40",title:"text-red-900 dark:text-red-200 font-bold",desc:"text-red-800 dark:text-red-200 font-medium",button:"bg-red-700 hover:bg-red-800"}};function oA({title:e,description:t,tone:r,busy:n,icon:i,onClick:s}){let a=o$[r];return(0,f.jsxs)("div",{className:`p-4 border rounded-lg ${a.card}`,children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:`text-sm flex items-center gap-2 ${a.title}`,children:e}),(0,f.jsx)(eo.f,{variant:"info"===r?"outline":"destructive",size:"sm",onClick:s,disabled:n,className:a.button,children:n?(0,f.jsx)(ee.f,{className:"h-4 w-4 animate-spin"}):i})]}),(0,f.jsx)("p",{className:`text-xs mt-2 ${a.desc}`,children:t})]})}function oO({isAdmin:e}){let{t}=(0,h.b)(),[r,n]=(0,m.useState)(null),i=async(e,t,r,i)=>{n(e);try{eN.c.success(await t()),i&&window.location.reload()}catch(t){x.V.error("[DangerZoneSettings]",`${e} failed`,{error:t}),eN.c.error(r)}finally{n(null)}},s=t.settings?.clearSuccess||"Success",a=t.settings?.clearError||"Failed",o=async()=>{await (0,eN.u)(t.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})&&await i("migrateTags",async()=>{let e=await v.k.post("/api/admin/migrate-tags",{});return`${s}: ${e.count||0} tags migrated.`},t.settings?.clearError||"Failed to migrate tags",!1)},l=async()=>{await (0,eN.u)(t.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})&&await i("clearPractice",async()=>(await v.k.delete("/api/stats/practice/clear"),s),a,!0)},c=async()=>{await (0,eN.u)(t.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})&&await i("clearErrors",async()=>(await v.k.delete("/api/error-items/clear"),s),a,!0)},d=async()=>{if(!await (0,eN.u)(t.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(t.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&eN.c.error(t.common?.error||"Confirmation failed");return}await i("systemReset",async()=>(await v.k.post("/api/admin/system-reset",{}),t.settings?.clearSuccess||"Success - System Reset Complete"),t.settings?.clearError||"Failed to reset system",!0)};return(0,f.jsxs)(f.Fragment,{children:[e&&(0,f.jsx)(oA,{tone:"info",title:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(oS.f,{className:"h-4 w-4"}),t.settings?.migrateTags||"Migrate Tags"]}),description:t.settings?.migrateTagsDesc||"Re-populates standard tags from file",busy:"migrateTags"===r,icon:(0,f.jsx)(oS.f,{className:"h-4 w-4"}),onClick:o}),(0,f.jsx)(oA,{tone:"danger",title:t.settings?.clearData||"Clear Practice Data",description:t.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible.",busy:"clearPractice"===r,icon:(0,f.jsx)(e_.f,{className:"h-4 w-4"}),onClick:l}),(0,f.jsx)(oA,{tone:"danger",title:t.settings?.clearErrorData||"Clear Error Data",description:t.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible.",busy:"clearErrors"===r,icon:(0,f.jsx)(e_.f,{className:"h-4 w-4"}),onClick:c}),e&&(0,f.jsx)(oA,{tone:"critical",title:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(q,{className:"h-4 w-4"}),t.settings?.systemReset||"System Initialization"]}),description:t.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data.",busy:"systemReset"===r,icon:(0,f.jsx)(e_.f,{className:"h-4 w-4"}),onClick:d})]})}var oE=e.i(551757),oT=e.i(762368);async function oP(e,t){let r=await fetch(e);if(!r.ok)throw Error((await r.json().catch(()=>({}))).message||"Download failed");let n=await r.blob(),i=window.URL.createObjectURL(n),s=document.createElement("a");s.href=i;let a=r.headers.get("Content-Disposition")?.match(/filename="(.+)"/);s.download=a?a[1]:t,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(i)}function oC({isAdmin:e}){let{t}=(0,h.b)(),[r,n]=(0,m.useState)(!1),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)(null),l=async e=>{if(!e||await (0,eN.u)(t.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){n(!0);try{await oP(e?"/api/export?all=true":"/api/export",e?"wrong-notebook-export-all.json":"wrong-notebook-export.json"),eN.c.success(t.settings?.exportSuccess||"Export successful")}catch(r){x.V.error("[DataBackupSettings]",e?"Export all failed":"Export failed",{error:r}),eN.c.error(t.settings?.exportFailed||"Export failed")}finally{n(!1)}}},c=async e=>{if(!a)return;let r=e?t.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.":t.settings?.importConfirm||"Are you sure you want to import?";if(await (0,eN.u)(r)){s(!0);try{let r=JSON.parse(await a.text()),{stats:n}=await v.k.post(e?"/api/import?all=true":"/api/import",r);eN.c.success((t.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records, {papers} exam papers and {voices} cloud voice clips.").replace("{subjects}",String(n.subjectsCreated)).replace("{tags}",String(n.tagsCreated)).replace("{items}",String(n.errorItemsCreated)).replace("{schedules}",String(n.reviewSchedulesCreated)).replace("{records}",String(n.practiceRecordsCreated)).replace("{papers}",String(n.examPapersCreated??0)).replace("{voices}",String(n.ttsSpeechesImported??0)).replace("{duplicates}",String(n.duplicateErrorItems??0))),o(null),window.location.reload()}catch(r){x.V.error("[DataBackupSettings]",e?"Import all failed":"Import failed",{error:r}),eN.c.error(t.settings?.importFailed||"Import failed")}finally{s(!1)}}},d=(e,t)=>e?(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}):t;return(0,f.jsxs)("div",{className:"p-4 border border-blue-200 dark:border-blue-900 rounded-lg bg-blue-50 dark:bg-blue-950/40",children:[(0,f.jsx)("h4",{className:"text-sm font-bold text-blue-900 dark:text-blue-200 mb-3",children:t.settings?.dataManagement||"Data Management"}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:t.settings?.exportData||"Export Data"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>l(!1),disabled:r,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[d(r,(0,f.jsx)(oT.f,{className:"mr-2 h-4 w-4"})),t.settings?.exportData||"Export"]}),e&&(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>l(!0),disabled:r,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[d(r,(0,f.jsx)(oT.f,{className:"mr-2 h-4 w-4"})),t.settings?.exportAllData||"Export All"]})]})]}),(0,f.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium",children:t.settings?.importData||"Import Data"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("input",{type:"file",accept:".json",onChange:e=>o(e.target.files?.[0]??a),className:"hidden",id:"import-file-input",disabled:i}),(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:i,className:"bg-blue-100 dark:bg-blue-900/40 hover:bg-blue-200 dark:hover:bg-blue-900/60 text-blue-900 dark:text-blue-200 border-blue-300 dark:border-blue-800",children:[d(i,(0,f.jsx)(eJ,{className:"mr-2 h-4 w-4"})),a?.name||t.settings?.selectFile||"Select File"]}),a&&(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>c(!1),disabled:i,className:"bg-green-100 dark:bg-green-900/40 hover:bg-green-200 dark:hover:bg-green-900/60 text-green-900 dark:text-green-200 border-green-300 dark:border-green-800",children:[d(i,(0,f.jsx)(oE.f,{className:"mr-2 h-4 w-4"})),t.settings?.importData||"Import"]}),a&&e&&(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>c(!0),disabled:i,className:"bg-orange-100 dark:bg-orange-900/40 hover:bg-orange-200 dark:hover:bg-orange-900/60 text-orange-900 dark:text-orange-200 border-orange-300 dark:border-orange-800",children:[d(i,(0,f.jsx)(oE.f,{className:"mr-2 h-4 w-4"})),t.settings?.importAllData||"Import All"]})]})]}),(0,f.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]})}let oI={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};oI.node;let oD=(0,U.f)(oI),oZ="/api/admin/debug-logs";function oF(){let{t:e}=(0,h.b)(),{timeZone:t}=(0,P.M)(),r=e.admin.debugLog,[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!1),o=(0,m.useCallback)(async()=>{try{i(await v.k.get(oZ))}catch(e){x.V.warn("[DebugLogSettings]","Failed to load debug status",{error:e})}},[]);(0,m.useEffect)(()=>{o()},[o]),(0,m.useEffect)(()=>{if(!n?.enabled)return;let e=setInterval(o,5e3);return()=>clearInterval(e)},[n?.enabled,o]);let l=async(e,t)=>{a(!0);try{await e(),eN.c.success(t)}catch(e){x.V.error("[DebugLogSettings]","Debug log action failed",{error:e}),eN.c.error(r.failed)}finally{a(!1)}},c=e=>e?(0,ed.r)(e,"yyyy-MM-dd HH:mm",t):"",d=n?.enabled?r.enabledHint.replace("{since}",c(n.enabledAt)).replace("{until}",c(n.expiresAt)):r.disabledHint,u=(n?.entryCount??0)>0;return(0,f.jsxs)("div",{className:"space-y-3 rounded-lg border p-4",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsxs)(em.f,{htmlFor:"debug-mode-switch",className:"flex items-center gap-2 font-medium",children:[(0,f.jsx)(oD,{className:"h-4 w-4"}),r.title]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r.desc})]}),(0,f.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)("span",{className:"text-sm text-muted-foreground",children:r.enable}),(0,f.jsx)(ep.f,{id:"debug-mode-switch",checked:!!n?.enabled,onCheckedChange:e=>l(async()=>{i(await v.k.post(oZ,{enabled:e}))},e?r.enabled:r.disabled),disabled:s||!n})]})]}),(0,f.jsxs)("p",{className:`text-xs ${n?.enabled?"text-orange-600":"text-muted-foreground"}`,children:[d,n&&(0,f.jsxs)(f.Fragment,{children:[" ",r.entries.replace("{count}",String(n.entryCount)),n.droppedCount>0&&r.dropped.replace("{count}",String(n.droppedCount))]})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>l(async()=>{await oP(`${oZ}/export`,"wrong-notebook-debug.json"),await o()},r.exported),disabled:s||!u,className:"sm:flex-1",children:[s?(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(oT.f,{className:"mr-2 h-4 w-4"}),r.export]}),(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>l(async()=>{i(await v.k.delete(oZ))},r.cleared),disabled:s||!u,children:[(0,f.jsx)(e_.f,{className:"mr-2 h-4 w-4"}),r.clear]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r.privacyNote})]})}var oR=e.i(307364);function oM({field:e,label:t,description:r}){let{t:n}=(0,h.b)(),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(null),p=`preference-${e}`;(0,m.useEffect)(()=>{v.k.get("/api/user").then(t=>s(!!t[e])).catch(()=>void 0).finally(()=>o(!0))},[e]);let g=async t=>{s(t),c(!0);try{await v.k.patch("/api/user",{[e]:t}),u(n.importFlow.preferenceSaved)}catch(r){s(!t),u(n.importFlow.preferenceSaveFailed),x.V.error("[Settings]","Failed to save user preference",{field:e,error:r instanceof Error?r.message:String(r)})}finally{c(!1)}};return(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,f.jsx)(em.f,{htmlFor:p,children:t}),(0,f.jsx)(ep.f,{id:p,checked:i,onCheckedChange:g,disabled:!a||l})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:r}),d&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:d})]})}function oL(){let{t:e}=(0,h.b)();return(0,f.jsx)(oM,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function oU(){let{t:e}=(0,h.b)();return(0,f.jsx)(oM,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}var oG=e.i(905110);function oV(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)(String(oG.z)),[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),u=Number(t),p=""!==t.trim()&&Number.isInteger(u)&&u>=oG.P&&u<=oG.o,g=(0,m.useCallback)(async()=>{a(!0),d(null);try{let e=(await v.k.get("/api/user")).masteryThreshold??oG.z;r(String(e)),i(e)}catch(t){d(e.mastery.thresholdLoadFailed),x.V.error("[Settings]","加载已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{a(!1)}},[e.mastery.thresholdLoadFailed]);(0,m.useEffect)(()=>{g()},[g]);let y=async()=>{if(p&&null!==n){l(!0),d(null);try{let t=(await v.k.patch("/api/user",{masteryThreshold:u})).masteryThreshold??u;i(t),r(String(t)),d(e.importFlow.preferenceSaved)}catch(t){d(e.importFlow.preferenceSaveFailed),x.V.error("[Settings]","保存已掌握阈值失败",{error:t instanceof Error?t.message:String(t)})}finally{l(!1)}}};return(0,f.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,f.jsx)(em.f,{htmlFor:"mastery-threshold",children:e.mastery.thresholdLabel}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,f.jsx)(ef.f,{id:"mastery-threshold",type:"number",min:oG.P,max:oG.o,step:1,value:t,onChange:e=>{r(e.target.value),d(null)},disabled:s||o||null===n,className:"w-28","aria-describedby":"mastery-threshold-hint"}),(0,f.jsx)("span",{"aria-hidden":"true",children:"%"}),(0,f.jsxs)(eo.f,{type:"button",size:"sm",variant:"outline",onClick:y,disabled:s||o||null===n||!p||u===n,children:[(s||o)&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.importFlow.saveThreshold]}),!s&&null===n&&(0,f.jsx)(eo.f,{type:"button",size:"sm",variant:"outline",onClick:g,children:e.importFlow.retryLoad})]}),(0,f.jsx)("p",{id:"mastery-threshold-hint",className:"text-xs text-muted-foreground",children:e.mastery.thresholdDescription}),null!==n&&!p&&(0,f.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:e.mastery.thresholdInvalid}),c&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:c})]})}var oK=e.i(28342);function oB(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)({gradeRecognitionMode:"fixed",fixedGradeSemester:null}),[n,i]=(0,m.useState)(null),[s,a]=(0,m.useState)(!0),[o,l]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),u=(0,m.useRef)(0),p=(0,m.useCallback)(async()=>{let t=++u.current;a(!0),d(null);try{let e=await v.k.get("/api/user");if(t!==u.current)return;let n={gradeRecognitionMode:e.gradeRecognitionMode??"fixed",fixedGradeSemester:e.fixedGradeSemester??null};r(n),i(n)}catch(r){if(t!==u.current)return;d(e.questionGrade.loadFailed),x.V.error("[QuestionGradeSetting]","加载录入年级规则失败",{error:(0,y.Z)(r)})}finally{t===u.current&&a(!1)}},[e.questionGrade.loadFailed]);(0,m.useEffect)(()=>{p()},[p]);let g=async()=>{l(!0),d(null);try{let n=await v.k.patch("/api/user",t),s={gradeRecognitionMode:n.gradeRecognitionMode??t.gradeRecognitionMode,fixedGradeSemester:n.fixedGradeSemester??null};r(s),i(s),d(e.importFlow.preferenceSaved)}catch(t){d(e.importFlow.preferenceSaveFailed),x.V.error("[QuestionGradeSetting]","保存录入年级规则失败",{error:(0,y.Z)(t)})}finally{l(!1)}},b=s||o||null===n,w=n?.gradeRecognitionMode===t.gradeRecognitionMode&&n?.fixedGradeSemester===t.fixedGradeSemester;return(0,f.jsxs)("div",{className:"space-y-3 border-t pt-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{htmlFor:"question-grade-mode",children:e.questionGrade.label}),(0,f.jsxs)("select",{id:"question-grade-mode",value:t.gradeRecognitionMode,disabled:b,onChange:e=>{r({...t,gradeRecognitionMode:e.target.value}),d(null)},className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",children:[(0,f.jsx)("option",{value:"fixed",children:e.questionGrade.fixed}),(0,f.jsx)("option",{value:"ai",children:e.questionGrade.ai})]})]}),"fixed"===t.gradeRecognitionMode&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{htmlFor:"question-fixed-grade",children:e.editor.gradeSemester}),(0,f.jsx)(oK.f,{id:"question-fixed-grade",value:t.fixedGradeSemester??"",disabled:b,onChange:e=>{r({...t,fixedGradeSemester:e||null}),d(null)}})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:"fixed"===t.gradeRecognitionMode?e.questionGrade.fixedDescription:e.questionGrade.aiDescription}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:e.questionGrade.description}),(0,f.jsxs)(eo.f,{type:"button",variant:"outline",size:"sm",disabled:b||w,onClick:g,children:[(s||o)&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),e.questionGrade.save]}),!s&&null===n&&(0,f.jsx)(eo.f,{type:"button",variant:"outline",size:"sm",onClick:p,children:e.importFlow.retryLoad}),c&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground",role:"status",children:c})]})}function oJ(){let{t:e}=(0,h.b)();return(0,f.jsx)(oM,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function oq({value:e,onChange:t,disabled:r}){let{t:n}=(0,h.b)();return(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsx)(em.f,{htmlFor:"app-time-zone",children:n.settings.general.timeZoneLabel}),(0,f.jsx)(ef.f,{id:"app-time-zone",value:e,onChange:e=>t(e.target.value),disabled:r,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,f.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,f.jsx)("option",{value:e},e))}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:n.settings.general.timeZoneDesc})]})}function oW({config:e,setConfig:t,isAdmin:r,disabled:n}){let{t:i,language:s,setLanguage:a}=(0,h.b)(),{timeZone:o}=(0,P.M)(),l=e=>t(t=>({...t,timeouts:{...t.timeouts,analyze:1e3*e}}));return(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:i.settings?.language||"Language"}),(0,f.jsxs)(eL.d,{value:s,onValueChange:e=>a(e),children:[(0,f.jsx)(eL.P,{children:(0,f.jsx)(eL.U,{})}),(0,f.jsxs)(eL.r,{children:[(0,f.jsx)(eL.T,{value:"zh",children:"中文 (Chinese)"}),(0,f.jsx)(eL.T,{value:"en",children:"English"})]})]})]}),(0,f.jsx)(oq,{value:e.timeZone??o,onChange:e=>t(t=>({...t,timeZone:e})),disabled:!r||n}),r&&(0,f.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,f.jsx)(em.f,{children:i.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,f.jsx)(ef.f,{type:"number",value:e.timeouts?.analyze?e.timeouts.analyze/1e3:"",onChange:e=>{let t=""===e.target.value?0:parseInt(e.target.value);l(isNaN(t)?0:t)},onBlur:()=>{let t=(e.timeouts?.analyze||0)/1e3,r=Math.min(600,Math.max(120,t));r!==t&&l(r)},min:120,max:600}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:i.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,f.jsx)(oU,{}),(0,f.jsx)(oB,{}),(0,f.jsx)(oJ,{}),(0,f.jsx)(oL,{}),(0,f.jsx)(oR.f,{}),(0,f.jsx)(oV,{})]})}var oH=e.i(77071),oX=e.i(515288),oY=e.i(664030);function oQ(){let{t:e}=(0,h.b)(),{groups:t,loading:r,refetch:n}=(0,oY.f)(),[i,s]=(0,m.useState)(""),[a,o]=(0,m.useState)(!1),l=async()=>{let t=i.trim();if(t){o(!0);try{await v.k.post("/api/paper-groups",{name:t}),s(""),eN.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to add group",{error:t}),eN.c.error(e.common?.messages?.saveFailed||"Failed to save")}finally{o(!1)}}},c=async(t,r)=>{let i=window.prompt(e.settings?.paperGroups?.renamePrompt||"Rename group",r);if(i&&i.trim()!==r)try{await v.k.patch(`/api/paper-groups/${t}`,{name:i.trim()}),eN.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to rename group",{error:t}),eN.c.error(e.common?.messages?.saveFailed||"Failed to save")}},d=async(t,r)=>{try{await v.k.patch(`/api/paper-groups/${t}`,{isActive:!r}),eN.c.success(e.common?.messages?.saveSuccess||"Saved"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to toggle group",{error:t}),eN.c.error(e.common?.messages?.saveFailed||"Failed to save")}},u=async(t,r,i)=>{if(i>0){let s=(e.settings?.paperGroups?.deleteConfirmWithItems||'Group "{name}" has {count} questions. Deleting will clear their group assignment. Continue?').replace("{name}",r).replace("{count}",String(i));if(!await (0,eN.u)(s,{destructive:!0}))return;try{await v.k.delete(`/api/paper-groups/${t}?clear=true`),eN.c.success(e.common?.messages?.deleteSuccess||"Deleted"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),eN.c.error(e.common?.messages?.deleteFailed||"Delete failed")}return}let s=(e.settings?.paperGroups?.deleteConfirm||'Delete group "{name}"?').replace("{name}",r);if(await (0,eN.u)(s,{destructive:!0}))try{await v.k.delete(`/api/paper-groups/${t}`),eN.c.success(e.common?.messages?.deleteSuccess||"Deleted"),n()}catch(t){x.V.error("[PaperGroupSettings]","Failed to delete group",{error:t}),eN.c.error(e.common?.messages?.deleteFailed||"Delete failed")}};return r?(0,f.jsx)(oX.N,{children:(0,f.jsx)(oX.O,{className:"py-12 flex items-center justify-center",children:(0,f.jsx)(ee.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):(0,f.jsxs)(oX.N,{children:[(0,f.jsxs)(oX.Y,{children:[(0,f.jsxs)(oX.v,{className:"flex items-center gap-2 text-lg",children:[(0,f.jsx)(M.f,{className:"h-5 w-5"}),e.settings?.paperGroups?.title||"Paper Groups"]}),(0,f.jsx)("p",{className:"text-sm text-muted-foreground",children:e.settings?.paperGroups?.desc||"Customize paper groups like Unit Test, Midterm, Final. Default groups A/B/Other can be renamed but not deleted."})]}),(0,f.jsxs)(oX.O,{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)(ef.f,{value:i,onChange:e=>s(e.target.value),placeholder:e.settings?.paperGroups?.addPlaceholder||"e.g. Unit Test",onKeyDown:e=>{"Enter"===e.key&&l()}}),(0,f.jsxs)(eo.f,{onClick:l,disabled:a||!i.trim(),children:[a?(0,f.jsx)(ee.f,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(oH.f,{className:"h-4 w-4 mr-1"}),e.common?.add||"Add"]})]}),(0,f.jsx)("div",{className:"space-y-2",children:t.map(t=>(0,f.jsxs)("div",{className:`flex items-center justify-between rounded-lg border p-3 ${!t.isActive?"opacity-50":""}`,children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("span",{className:"font-medium",children:t.name}),t.key&&(0,f.jsx)(eu.f,{variant:"secondary",className:"text-xs",children:e.settings?.paperGroups?.systemBadge||"Default"}),!t.isActive&&(0,f.jsx)(eu.f,{variant:"outline",className:"text-xs",children:e.common?.inactive||"Inactive"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-1",children:[(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>c(t.id,t.name),children:e.common?.rename||"Rename"}),(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:()=>d(t.id,t.isActive),children:t.isActive?e.common?.deactivate||"Deactivate":e.common?.activate||"Activate"}),!t.key&&(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>u(t.id,t.name,t._count?.errorItems||0),children:(0,f.jsx)(e_.f,{className:"h-4 w-4"})})]})]},t.id))})]})]})}var o0=e.i(624687);let o1="[REDACTED]",o2=/api[-_]?key|password|passwd|secret|authorization|cookie|credential|private[-_]?key|^(access|refresh|id|auth|api|bearer|session|csrf|setup)?[-_]?token$/i,o4=Symbol.for("wrong-notebook.debug-log");function o3(){let e=globalThis,t=e[o4];return t||(t={enabledAt:null,entries:[],totalSize:0,dropped:0},e[o4]=t),t}function o9(e){let t=e.replace(/data:([\w.+-]+\/[\w.+-]+);base64,[A-Za-z0-9+/=]+/g,(e,t)=>`[data:${t}, ${e.length} chars]`).replace(/(Bearer\s+)[\w\-.~+/]+=*/gi,`$1${o1}`).replace(/\bsk-[A-Za-z0-9_-]{8,}/g,o1).replace(/([?&](?:key|api_key|apikey|token|access_token)=)[^&\s"']+/gi,`$1${o1}`);return t.length>1e4&&(t=`${t.slice(0,1e4)}…[truncated ${t.length-1e4} chars]`),t}function o5(e,t,r,n=new Date){if(function(e=Date.now()){let t=o3();return null!==t.enabledAt&&(!(e-t.enabledAt>=864e5)||(t.enabledAt=null,!1))}(n.getTime()))try{let i={...function e(t,r=0,n=new WeakSet){if(null==t)return t;if("string"==typeof t)return o9(t);if("number"==typeof t||"boolean"==typeof t)return t;if("bigint"==typeof t)return t.toString();if("function"==typeof t||"symbol"==typeof t)return String(t);if(t instanceof Date)return t.toISOString();if(t instanceof Error){let i={name:t.name,message:o9(t.message)};return t.stack&&(i.stack=o9(t.stack)),void 0!==t.code&&(i.code=e(t.code,r+1,n)),void 0!==t.status&&(i.status=e(t.status,r+1,n)),void 0!==t.cause&&r<8&&(i.cause=e(t.cause,r+1,n)),i}if("object"!=typeof t)return String(t);if(n.has(t))return"[Circular]";if(r>=8)return"[Object]";if(n.add(t),Array.isArray(t)){let i=t.slice(0,100).map(t=>e(t,r+1,n));return t.length>100&&i.push(`…[${t.length-100} more items]`),i}return ArrayBuffer.isView(t)||t instanceof ArrayBuffer?`[Binary ${t.byteLength} bytes]`:Object.fromEntries(Object.entries(t).map(([t,i])=>[t,o2.test(t)&&null!=i&&""!==i?o1:e(i,r+1,n)]))}(t),time:n.toISOString(),level:e,msg:o9(r)},s=JSON.stringify(i).length,a=o3();for(a.entries.push({entry:i,size:s}),a.totalSize+=s;a.entries.length>5e3||a.totalSize>0x1400000&&a.entries.length>1;){let e=a.entries.shift();if(!e)break;a.totalSize-=e.size,a.dropped+=1}}catch{}}let o6={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function o8(e,t={}){let r,n=o6[e],i=(r=sG.default.env.LOG_LEVEL?.toLowerCase())&&void 0!==o6[r]?o6[r]:o6.info;return(r,s)=>{let a,o,l=new Date;if("string"==typeof r?(a={},o=r):(a=r,o=s||""),o5(e,{...t,...a},o,l),!(n<i)){let r=JSON.stringify({level:e,time:l.toISOString(),...t,...a,msg:o});switch(e){case"error":case"fatal":console.error(r);break;case"warn":console.warn(r);break;default:console.log(r)}}}}let o7=function e(t={}){return t.module,{trace:o8("trace",t),debug:o8("debug",t),info:o8("info",t),warn:o8("warn",t),error:o8("error",t),fatal:o8("fatal",t),child:r=>e({...t,...r}),box:(e,r,n="📋")=>{o5("info",{...t,..."string"==typeof r?{content:r}:r},e);{let n="string"==typeof r?{content:r}:r||{};console.log(JSON.stringify({level:"info",time:new Date().toISOString(),...t,title:e,...n,msg:e}));return}},divider:(e="-")=>{}}}({env:"production"});var le=e.i(113381);o7.child({module:"ai:prompts"});let lt=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
56
|
+
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
57
|
+
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
58
|
+
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
59
|
+
- 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
|
|
60
|
+
- 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
|
|
61
|
+
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,lr=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
|
|
62
|
+
- 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
|
|
63
|
+
- 按原图比例和相对位置绘制,保留原题印刷标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18);必须过滤掉人在图上手写的草稿、演算、思考批注、圈画和涂改痕迹。
|
|
64
|
+
- 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
|
|
65
|
+
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,ln=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
|
|
66
|
+
- 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
|
|
67
|
+
- 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
|
|
68
|
+
- 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
|
|
69
|
+
- 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
|
|
70
|
+
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,li=`【角色与核心任务 (ROLE AND CORE TASK)】
|
|
71
|
+
你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
|
|
72
|
+
|
|
73
|
+
{{language_instruction}}
|
|
74
|
+
|
|
75
|
+
【核心输出要求 (OUTPUT REQUIREMENTS)】
|
|
76
|
+
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**对 LaTeX 公式中的反斜杠进行二次转义(如 "\\\\frac" 是错误的,必须是 "\\frac")。
|
|
77
|
+
|
|
78
|
+
请严格按照以下结构输出内容:
|
|
79
|
+
|
|
80
|
+
<subject>
|
|
81
|
+
在此处填写学科,必须是以下之一:"数学", "物理", "化学", "生物", "英语", "语文", "历史", "地理", "政治", "其他"。
|
|
82
|
+
</subject>
|
|
83
|
+
|
|
84
|
+
<knowledge_points>
|
|
85
|
+
在此处填写知识点,使用逗号分隔,例如:知识点1, 知识点2, 知识点3
|
|
86
|
+
</knowledge_points>
|
|
87
|
+
|
|
88
|
+
<requires_image>
|
|
89
|
+
判断这道题是否需要依赖图片才能正确解答。如果题目包含几何图形、函数图像、实验装置图、电路图等必须看图才能理解的内容,填写 true;如果只需要文字描述即可理解(如英语题、纯文字数学题),填写 false。
|
|
90
|
+
</requires_image>
|
|
91
|
+
|
|
92
|
+
<has_figure>
|
|
93
|
+
判断题目本身是否带有配图(几何图形、函数图像、示意图、统计图、实验装置图、电路图等;不含学生的作答痕迹和纯文字表格)。有配图填 true,否则填 false。
|
|
94
|
+
</has_figure>
|
|
95
|
+
|
|
96
|
+
<figure_svg>
|
|
97
|
+
如果 has_figure 为 true,用 SVG 重新绘制题目配图:
|
|
98
|
+
${lr}
|
|
99
|
+
如果 has_figure 为 false,请留空。
|
|
100
|
+
</figure_svg>
|
|
101
|
+
|
|
102
|
+
<wrong_answer_text>
|
|
103
|
+
如果图片中包含学生针对本题提交的正式错误答案或正式解题步骤,请按原样摘录;必须过滤掉空白处或题干旁的草稿、竖式演算、试算数字、涂改痕迹、审题圈画以及人的思考过程批注。如果图片中只有草稿/思考痕迹或没有看到正式错误解答,请留空。
|
|
104
|
+
</wrong_answer_text>
|
|
105
|
+
|
|
106
|
+
<mistake_status>
|
|
107
|
+
填写以下值之一:wrong_attempt(图片中有明确的正式错误答案或正式错误步骤;仅有草稿、涂改或思考批注不算作答)、not_attempted(没有正式错误解答,像是不会做、未作答或仅有草稿/思考痕迹)、unknown(无法判断)。
|
|
108
|
+
</mistake_status>
|
|
109
|
+
|
|
110
|
+
<difficulty_stars>
|
|
111
|
+
只填写 1 到 5 之间的一个整数,表示题目难度星级。
|
|
112
|
+
${lt}
|
|
113
|
+
</difficulty_stars>
|
|
114
|
+
|
|
115
|
+
<mistake_analysis>
|
|
116
|
+
如果图片中包含学生的正式错误解答,请分析错误可能发生在哪一步、为什么错、导致了什么后果;必须忽略零散草稿和人的思考过程,如果没有正式错误解答,请留空。
|
|
117
|
+
</mistake_analysis>
|
|
118
|
+
|
|
119
|
+
<question_text>
|
|
120
|
+
在此处填写题目的完整文本。使用 Markdown 格式。所有数学公式使用 LaTeX 符号(行内 $...$,块级 $$...$$)。
|
|
121
|
+
|
|
122
|
+
【题干转录规则】
|
|
123
|
+
1. **逐字照录**:只按图片原题转录题干(含题号、分值和标点),不要改写、概括、增删字词或调整语序;看不清的字用 [?] 标注。
|
|
124
|
+
2. **过滤草稿与思考过程**:必须过滤掉图片中人的手写草稿、竖式演算、试算算式、思考过程批注、审题圈画、涂改痕迹以及学生在横线或括号中填入的答案,严禁将草稿或人的思考过程记录进 question_text。
|
|
125
|
+
3. **填空统一**:所有填空处(含已被学生手写填入答案的横线)统一还原写作 ____(4 个下划线),不论原图横线长短。
|
|
126
|
+
4. **选择题选项另起一行**:如果题目是选择题,题干与选项必须分行,选项必须在题干下方另起新行书写(不要将选项紧接在题干同一行后面)。
|
|
127
|
+
5. **图形描述**:如果题目依赖图形,在题干原文之后空一行,单独写**一段**以「图示:」开头的图形描述;只能使用「图示:」这一种写法(不要写「图示信息」「图示说明」等),描述中不要重复题干已有的文字,且不要包含学生的手写草稿或作答痕迹。题目不依赖图形时不要写图示段落。
|
|
128
|
+
|
|
129
|
+
【表格处理规则】
|
|
130
|
+
如果图片中包含表格,必须完整转录表格内容,遵循以下原则:
|
|
131
|
+
|
|
132
|
+
1. **标准表格**:使用 Markdown 表格语法
|
|
133
|
+
| 列标题1 | 列标题2 | 列标题3 |
|
|
134
|
+
|---------|---------|---------|
|
|
135
|
+
| 数据1 | 数据2 | 数据3 |
|
|
136
|
+
|
|
137
|
+
2. **复杂表格**(合并单元格/多级表头/不规则布局):
|
|
138
|
+
- 优先尝试用 Markdown 表格近似表示
|
|
139
|
+
- 如果 Markdown 无法准确表达,在表格前用文字说明结构,然后用简化的 Markdown 表格 + 注释
|
|
140
|
+
- 示例:
|
|
141
|
+
> 注:第1行为主标题,横跨3列;第2-3行为数据行
|
|
142
|
+
|
|
143
|
+
| 项目 | 数值A | 数值B |
|
|
144
|
+
|------|-------|-------|
|
|
145
|
+
| 测试1 | 10 | 20 |
|
|
146
|
+
| 测试2 | 15 | 25 |
|
|
147
|
+
|
|
148
|
+
3. **表格完整性要求**:
|
|
149
|
+
- 必须转录所有单元格内容(包括空单元格用 - 或空格表示)
|
|
150
|
+
- 保留表格标题、单位、注释
|
|
151
|
+
- 保留数据的对齐关系和分组信息
|
|
152
|
+
- 表格中的数学公式使用 LaTeX 语法
|
|
153
|
+
|
|
154
|
+
4. **表格上下文**:
|
|
155
|
+
- 如果表格有标题或编号(如"表1"),保留在表格前
|
|
156
|
+
- 如果表格后有注释或说明,保留在表格后
|
|
157
|
+
- 保持表格在题目中的位置关系
|
|
158
|
+
|
|
159
|
+
5. **特殊情况处理**:
|
|
160
|
+
- 图表混合:如果表格旁边有图形,用文字说明位置关系
|
|
161
|
+
- 手写表格:尽力识别手写内容,不确定的用 [?] 标注
|
|
162
|
+
- 模糊表格:如果表格不清晰,在表格前注明"(表格内容可能不完整)"
|
|
163
|
+
</question_text>
|
|
164
|
+
|
|
165
|
+
<answer_text>
|
|
166
|
+
在此处填写正确答案。使用 Markdown 和 LaTeX 符号。如果答案包含表格,遵循上述【表格处理规则】。
|
|
167
|
+
</answer_text>
|
|
168
|
+
|
|
169
|
+
<analysis>
|
|
170
|
+
在此处填写详细的步骤解析。
|
|
171
|
+
* 解析语言遵循字段语言规则。
|
|
172
|
+
* **直接使用标准的 LaTeX 符号**(如 $\\frac{1}{2}$),**不要**进行 JSON 转义(不要写成 \\\\frac)。
|
|
173
|
+
* 如果解析过程需要表格(如列表对比、分步计算表),遵循上述【表格处理规则】。
|
|
174
|
+
</analysis>
|
|
175
|
+
|
|
176
|
+
【知识点标签列表(KNOWLEDGE POINT LIST)】
|
|
177
|
+
{{knowledge_points_list}}
|
|
178
|
+
|
|
179
|
+
【标签使用规则 (TAG RULES)】
|
|
180
|
+
- 标签必须与题目实际考查的知识点精准匹配。
|
|
181
|
+
- 每题最多 5 个标签。
|
|
182
|
+
|
|
183
|
+
【!!! 关键格式与内容约束 (CRITICAL RULES) !!!】
|
|
184
|
+
1. **格式严格**:必须包含输出协议规定的全部 XML 标签,包括 grade_semester 年级标签,不要输出任何“开场白”或“结束语”。
|
|
185
|
+
2. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
186
|
+
3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
|
|
187
|
+
4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
|
|
188
|
+
5. **LaTeX 规范**:
|
|
189
|
+
${ln}
|
|
190
|
+
|
|
191
|
+
{{grade_instruction}}
|
|
192
|
+
{{provider_hints}}`,ls=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
|
|
193
|
+
### 角色定义
|
|
194
|
+
1. **学科全能专家**
|
|
195
|
+
- 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
|
|
196
|
+
- 熟悉各年级课程标准与知识点分布
|
|
197
|
+
- 能准确识别题目考察的核心能力点(计算/推理/分析/应用/创新)
|
|
198
|
+
2. **题目变异大师**
|
|
199
|
+
- 掌握12种变式技法:条件替换/情境迁移/问题转化/数据重构/图形变形/角色反转/跨学科融合/难度阶梯/开放拓展/陷阱设计/逆向思维/生活应用
|
|
200
|
+
- 确保变式题目保持原题核心考点,改变题目表现形式
|
|
201
|
+
3. **学情分析师**
|
|
202
|
+
- 预判学生易错点(认知盲区/概念混淆/计算失误/审题偏差)
|
|
203
|
+
- 在变式题目中针对性强化易错点训练
|
|
204
|
+
### 执行流程
|
|
205
|
+
1. **接收任务**
|
|
206
|
+
原题: "{{original_question}}"
|
|
207
|
+
{{language_instruction}}
|
|
208
|
+
DIFFICULTY LEVEL: {{difficulty_level}}
|
|
209
|
+
{{difficulty_instruction}}
|
|
210
|
+
Knowledge Points: {{knowledge_points}}
|
|
211
|
+
2. **解构分析**
|
|
212
|
+
- 提取核心考点与能力要求
|
|
213
|
+
- 分析题目陷阱与解题路径
|
|
214
|
+
3. **质量管控**
|
|
215
|
+
- 确保每道题:
|
|
216
|
+
✓ 覆盖相同核心知识点
|
|
217
|
+
✓ 保持解题逻辑一致性
|
|
218
|
+
✓ 答案唯一且可验证
|
|
219
|
+
✓ 无知识性错误
|
|
220
|
+
### 输出规范
|
|
221
|
+
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**返回 \`\`\`json ... \`\`\`。
|
|
222
|
+
|
|
223
|
+
请严格按照以下结构输出内容(不要包含任何其他文字):
|
|
224
|
+
|
|
225
|
+
<question_text>
|
|
226
|
+
在此处填写新生成的填空题或解答题。不要包含题号、分值或选择题选项。
|
|
227
|
+
</question_text>
|
|
228
|
+
|
|
229
|
+
<answer_text>
|
|
230
|
+
在此处填写新题目的正确答案。
|
|
231
|
+
</answer_text>
|
|
232
|
+
|
|
233
|
+
<analysis>
|
|
234
|
+
在此处填写新题目的详细解析。
|
|
235
|
+
* 解析语言遵循字段语言规则。
|
|
236
|
+
* **直接使用标准的 LaTeX 符号**(如 $\\frac{1}{2}$),**不要**进行 JSON 转义。
|
|
237
|
+
</analysis>
|
|
238
|
+
|
|
239
|
+
{{figure_instruction}}
|
|
240
|
+
|
|
241
|
+
###关键格式与内容约束 (CRITICAL RULES) !!!
|
|
242
|
+
1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
243
|
+
2. **LaTeX 规范**:
|
|
244
|
+
${ln}
|
|
245
|
+
|
|
246
|
+
{{grade_instruction}}
|
|
247
|
+
{{provider_hints}}`;le.I.join("、"),le.r.join("、");var la=e.i(395925);function lo({name:e,description:t}){return(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,f.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,f.jsx)("span",{className:"text-muted-foreground",children:t})]})}function ll(){let{t:e}=(0,h.b)();return(0,f.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900 rounded-md p-3 flex items-start gap-3 text-amber-900 dark:text-amber-200 text-sm mb-4",children:[(0,f.jsx)(q,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("p",{className:"font-medium",children:e.settings?.prompts?.caution||"Modify with Caution"}),(0,f.jsx)("p",{className:"text-amber-800/90 dark:text-amber-200 text-xs",children:e.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]})}function lc({config:e,onUpdate:t}){let{t:r}=(0,h.b)(),n=e.prompts?.analyze||li,i=e.prompts?.similar||ls,s=async e=>{await (0,eN.u)(r.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0})&&t(e,"analyze"===e?li:ls)},a=(e,r)=>{t(e,r)};return(0,f.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,f.jsxs)(ec.i,{defaultValue:"analyze",className:"w-full",children:[(0,f.jsxs)(ec.U,{className:"grid w-full grid-cols-2",children:[(0,f.jsx)(ec.k,{value:"analyze",children:r.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,f.jsx)(ec.k,{value:"similar",children:r.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,f.jsx)(ec.S,{value:"analyze",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)(em.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>s("analyze"),children:[(0,f.jsx)(la.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,f.jsx)(ll,{}),(0,f.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,f.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,f.jsx)(Y,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,f.jsxs)("div",{className:"space-y-1.5",children:[(0,f.jsx)(lo,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,f.jsx)(lo,{name:"knowledge_points_list",description:r.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,f.jsx)(lo,{name:"provider_hints",description:r.settings?.prompts?.vars?.providerHints||"Provider compatibility hints that follow the application output contract."})]})]}),(0,f.jsx)(o0.f,{value:n,onChange:e=>a("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:li})]})}),(0,f.jsx)(ec.S,{value:"similar",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)(em.f,{className:"text-base font-semibold",children:r.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,f.jsxs)(eo.f,{variant:"outline",size:"sm",onClick:()=>s("similar"),children:[(0,f.jsx)(la.f,{className:"w-4 h-4 mr-2"}),r.settings?.prompts?.reset||"Reset Default"]})]}),(0,f.jsx)(ll,{}),(0,f.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,f.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,f.jsx)(Y,{className:"h-3.5 w-3.5"}),r.settings?.prompts?.variables||"Available Variables"]}),(0,f.jsxs)("div",{className:"space-y-1.5",children:[(0,f.jsx)(lo,{name:"difficulty_level",description:r.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,f.jsx)(lo,{name:"difficulty_instruction",description:r.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,f.jsx)(lo,{name:"original_question",description:r.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,f.jsx)(lo,{name:"knowledge_points",description:r.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,f.jsx)(lo,{name:"language_instruction",description:r.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,f.jsx)(o0.f,{value:i,onChange:e=>a("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:ls})]})})]})})}var ld=e.i(21357),lu=e.i(434901),lp=e.i(753817),lf=e.i(128093),lm=e.i(79058);let lh=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];lh.filter(e=>"browser"!==e);let lg={minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},lv={minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},ly={volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"};function lx({config:e,setConfig:t,saving:r,onSave:n}){var i;let{t:s,language:a}=(0,h.b)(),o=s.settings.tts,[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(null),p=e.tts?.mode??"browser",g="browser"!==p&&"string"==typeof(i=p)&&lh.includes(i)?p:null,b=g?e.tts?.[g]:void 0,w=(e,r)=>{g&&t(t=>({...t,tts:{...t.tts,[g]:{...t.tts?.[g],[e]:r}}}))},_=!!g&&("volcengine"===g||"openai"===g),j=g?function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]}(e,g):void 0,k=_?b?.apiKey:j?.apiKey,z=async()=>{(0,lm.p)(),c(!0),u(null);try{await n();let{id:e,version:t}=await v.k.post("/api/tts",{text:o.previewText,language:a},{timeout:12e4,recoverable:!0}),r=(0,lm.l)();if(!r)return;r.src=`/api/tts/${e}?v=${t}`,r.playbackRate=1,await r.play()}catch(t){x.V.error("[TtsSettings]","Preview failed",{error:t});let e=(0,y.d)(t);eN.c.error("TTS_NOT_CONFIGURED"===e?o.notConfigured:"TTS_PROVIDER_ERROR"===e?o.providerError:o.previewFailed),u((0,y.L)(t)??null)}finally{c(!1)}};return(0,f.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(em.f,{children:o.title}),(0,f.jsxs)(eL.d,{value:p,onValueChange:e=>t(t=>({...t,tts:{...t.tts,mode:e}})),children:[(0,f.jsx)(eL.P,{children:(0,f.jsx)(eL.U,{})}),(0,f.jsx)(eL.r,{children:lh.map(e=>(0,f.jsx)(eL.T,{value:e,children:o.modes[e]},e))})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:g?o.cloudHint:o.browserHint})]}),g&&(0,f.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[ly[g]&&(0,f.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[o.freeTrial," ",(0,f.jsx)("a",{href:ly[g],target:"_blank",rel:"noopener noreferrer",className:"underline",children:o.freeTrialLink})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(lu.f,{label:"openai"===g?"OpenAI API Key":_?o.speechApiKey:`${(0,lf.z)(g,a)} API Key`,href:lv[g].apiKey,linkText:s.settings.ai.docLinks.apiKey}),(0,f.jsx)(eM.f,{value:k||"",onChange:e=>{var r;return r=e.target.value,void(g&&(_?w("apiKey",r):t(e=>({...e,[g]:{...e[g],apiKey:r}}))))},placeholder:"qwen"===g?"sk-sp-...":_?"":"sk-..."}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.apiKeyHint[g]})]}),(0,f.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(lu.f,{label:o.model,href:lv[g].model,linkText:o.docs}),(0,f.jsx)(ef.f,{value:b?.model||"",onChange:e=>w("model",e.target.value),placeholder:lg[g].model})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(lu.f,{label:o.voice,href:lv[g].voice,linkText:o.voiceList}),(0,f.jsx)(ef.f,{value:b?.voice||"",onChange:e=>w("voice",e.target.value),placeholder:lg[g].voice})]})]}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.voiceHint[g]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(lu.f,{label:o.endpoint,href:lv[g].endpoint,linkText:o.docs}),(0,f.jsx)(ef.f,{value:b?.endpoint||"",onChange:e=>w("endpoint",e.target.value),placeholder:function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:r}=(0,lf.k)(e,t);if("minimax"===e)return`${r.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${r.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(r).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}}(g,j)}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:o.endpointHint})]})]},g),(0,f.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[g&&(0,f.jsxs)(eo.f,{variant:"outline",onClick:z,disabled:r||l,className:"sm:w-auto",children:[l?(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,f.jsx)(ld.f,{className:"mr-2 h-4 w-4"}),o.preview]}),(0,f.jsxs)(eo.f,{onClick:()=>void n(),disabled:r||l,className:"flex-1",children:[r&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),o.save]})]}),g&&d&&(0,f.jsx)("div",{className:"rounded-md border border-red-200 bg-red-50 p-2 dark:border-red-900 dark:bg-red-950/40",children:(0,f.jsx)(lp.f,{detail:d})})]})}var lb=e.i(835467);function lw({value:e,icon:t,label:r}){return(0,f.jsxs)(ec.k,{value:e,className:"px-2 sm:px-3",children:[t,(0,f.jsx)("span",{className:"hidden sm:inline",children:r})]})}function l_(){let{setTimeZone:e}=(0,P.M)(),{data:t}=(0,g.useSession)(),r=t?.user?.role==="admin",{t:n}=(0,h.b)(),i=(0,D.useRouter)(),[s,a]=(0,m.useState)(!1),o=(0,m.useRef)(null),[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(!1),[p,y]=(0,m.useState)({aiProvider:"minimax"}),b=(0,m.useCallback)(async()=>{u(!0);try{y(await v.k.get("/api/settings"))}catch(e){x.V.error("[SettingsDialog]","Failed to fetch settings",{error:e})}finally{u(!1)}},[]);(0,m.useEffect)(()=>{s&&b()},[s,b]);let w=async()=>{let t=(0,lb.f)(p,n);if(t)return void eN.c.error(t);c(!0);try{let t=await v.k.post("/api/settings",p);y(t),e(t.timeZone||ed.J),eN.c.success(n.settings?.messages?.saved||"Settings saved"),o.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){x.V.error("[SettingsDialog]","Failed to save settings",{error:e}),eN.c.error(n.settings?.messages?.saveFailed||"Failed to save")}finally{c(!1)}},_=e=>(0,f.jsxs)(eo.f,{onClick:w,disabled:l,className:"w-full",children:[l&&(0,f.jsx)(ee.f,{className:"mr-2 h-4 w-4 animate-spin"}),e]});return(0,f.jsxs)(el.N,{open:s,onOpenChange:a,children:[(0,f.jsx)(el.a,{asChild:!0,children:(0,f.jsxs)(eo.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,f.jsx)(ei,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"sr-only",children:n.settings?.title||"Settings"})]})}),(0,f.jsxs)(el.d,{ref:o,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,f.jsxs)(el.s,{children:[(0,f.jsx)(el.F,{children:n.settings?.title||"Settings"}),(0,f.jsx)(el.C,{children:n.settings?.desc||"Manage your preferences and data."})]}),(0,f.jsxs)(ec.i,{defaultValue:"general",className:"w-full",children:[(0,f.jsxs)(ec.U,{className:`grid w-full grid-cols-4 ${r?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,f.jsx)(lw,{value:"general",icon:(0,f.jsx)(Q.f,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.general||"General"}),(0,f.jsx)(lw,{value:"account",icon:(0,f.jsx)(es.f,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.account||"Account"}),r&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(lw,{value:"ai",icon:(0,f.jsx)(H,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.ai||"AI Provider"}),(0,f.jsx)(lw,{value:"prompts",icon:(0,f.jsx)(er,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.prompts||"Prompts"}),(0,f.jsx)(lw,{value:"admin",icon:(0,f.jsx)(B,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.admin||"User Management"})]}),(0,f.jsx)(lw,{value:"danger",icon:(0,f.jsx)(q,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.danger||"Danger"}),(0,f.jsx)(lw,{value:"about",icon:(0,f.jsx)(Y,{className:"h-4 w-4 sm:mr-2"}),label:n.settings?.tabs?.about||"About"})]}),(0,f.jsxs)(ec.S,{value:"general",className:"space-y-4 py-4",children:[(0,f.jsx)(oW,{config:p,setConfig:y,isAdmin:r,disabled:d||l}),(0,f.jsx)(oQ,{}),r&&_(n.settings?.save||"Save Settings")]}),(0,f.jsx)(ec.S,{value:"account",className:"space-y-4 py-4",children:(0,f.jsx)(eV,{})}),(0,f.jsxs)(ec.S,{value:"ai",className:"space-y-4 py-4",children:[(0,f.jsx)(eK.f,{config:p,setConfig:y,loading:d,saving:l,onSave:w}),!d&&(0,f.jsx)(lx,{config:p,setConfig:y,saving:l,onSave:w})]}),(0,f.jsxs)(ec.S,{value:"prompts",className:"space-y-4 py-4",children:[(0,f.jsx)(lc,{config:p,onUpdate:(e,t)=>y(r=>({...r,prompts:{...r.prompts,[e]:t}}))}),_(n.settings?.prompts?.save||"Save Prompt Settings")]}),r&&(0,f.jsxs)(ec.S,{value:"admin",className:"space-y-4 py-4",children:[(0,f.jsxs)(eo.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{a(!1),i.push("/admin")},children:[(0,f.jsx)(Z.f,{className:"h-4 w-4"}),n.admin?.dashboard?.title||"Admin Dashboard"]}),(0,f.jsxs)(eo.f,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{a(!1),i.push("/setup")},children:[(0,f.jsx)(ea.f,{className:"h-4 w-4"}),n.setup.rerun]}),(0,f.jsx)(oF,{}),(0,f.jsx)(oN,{}),(0,f.jsx)("div",{className:"border-t pt-4",children:(0,f.jsx)(e$,{})})]}),(0,f.jsx)(ec.S,{value:"danger",className:"space-y-4 py-4",children:(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)(oC,{isAdmin:r}),(0,f.jsx)(oO,{isAdmin:r})]})}),(0,f.jsx)(ec.S,{value:"about",className:"space-y-4 py-4",children:(0,f.jsx)(eR,{})})]})]})]})}var lj=e.i(446513);let lk={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};lk.node;let lz=(0,U.f)(lk),lN={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};lN.node;let lS=(0,U.f)(lN);var l$=e.i(755146);let lA={system:lj.f,light:lS,dark:lz};function lO(){let{t:e}=(0,h.b)(),{preference:t,setPreference:r}=(0,m.useContext)(k),n=lA[t],i=`${e.theme.toggle}: ${e.theme[t]}`;return(0,f.jsxs)(l$.G,{children:[(0,f.jsx)(l$.X,{asChild:!0,children:(0,f.jsx)(eo.f,{variant:"ghost",size:"icon",className:"rounded-full",title:i,"aria-label":i,children:(0,f.jsx)(n,{className:"h-5 w-5"})})}),(0,f.jsx)(l$.L,{align:"end",children:(0,f.jsx)(l$.O,{value:t,onValueChange:e=>{j(e)&&r(e)},children:b.map(t=>{let r=lA[t];return(0,f.jsxs)(l$.T,{value:t,className:"gap-2",children:[(0,f.jsx)(r,{className:"h-4 w-4"}),e.theme[t]]},t)})})})]})}let lE=[/^\/login/,/^\/register/,/^\/setup/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],lT=[{key:"home",href:"/",icon:V,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:F.f,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"review",href:"/review",icon:R.f,match:e=>e.startsWith("/review")},{key:"stats",href:"/stats",icon:Z.f,match:e=>e.startsWith("/stats")||e.startsWith("/tags")},{key:"exams",href:"/exams",icon:M.f,match:e=>e.startsWith("/exams")}];function lP({children:e}){var t;let r,n,i=(0,D.usePathname)()||"/",{t:s}=(0,h.b)(),{data:a,status:o}=(0,g.useSession)(),l=a?.user?.role==="admin",c=lE.some(e=>e.test(i));if(t=l&&!c,r=(0,D.useRouter)(),n=(0,m.useRef)(!1),(0,m.useEffect)(()=>{t&&!n.current&&(n.current=!0,v.k.get("/api/setup").then(e=>{e.needsSetup&&r.replace("/setup")}).catch(e=>x.V.warn("[Setup]","Failed to check setup status",{error:e})))},[t,r]),c||"unauthenticated"===o)return(0,f.jsx)(f.Fragment,{children:e});let d=a?.user?.name||a?.user?.email||"";return(0,f.jsxs)("div",{className:"min-h-screen",children:[(0,f.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,f.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,f.jsxs)(I.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,f.jsx)(C.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,f.jsx)("span",{className:"text-base font-semibold tracking-tight",children:s.pageTitle.base})]}),(0,f.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:lT.map(e=>{let t=e.match(i),r=e.icon;return(0,f.jsxs)(I.default,{href:e.href,className:(0,eh.f)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":t?"page":void 0,children:[(0,f.jsx)(r,{className:"h-4 w-4"}),s.nav[e.key]]},e.key)})}),(0,f.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[d&&(0,f.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,f.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:d.slice(0,1).toUpperCase()}),(0,f.jsx)("span",{className:"truncate",children:d})]}),l&&(0,f.jsx)(I.default,{href:"/admin",title:s.nav.admin,children:(0,f.jsxs)(eo.f,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,f.jsx)(B,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"sr-only",children:s.nav.admin})]})}),(0,f.jsx)(lO,{}),(0,f.jsx)(l_,{}),(0,f.jsx)(eo.f,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,g.signOut)({callbackUrl:"/login"}),title:s.app.logout,children:(0,f.jsx)(L.f,{className:"h-5 w-5"})})]})]})}),(0,f.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,f.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,f.jsx)("div",{className:"grid h-16 grid-cols-5",children:lT.map(e=>{let t=e.match(i),r=e.icon;return(0,f.jsxs)(I.default,{href:e.href,className:(0,eh.f)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",t?"text-primary":"text-muted-foreground"),"aria-current":t?"page":void 0,children:[(0,f.jsx)("span",{className:(0,eh.f)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",t&&"bg-accent"),children:(0,f.jsx)(r,{className:"h-5 w-5"})}),s.nav[e.key]]},e.key)})})})]})}let lC={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};lC.node;let lI=(0,U.f)(lC);var lD=e.i(583967);let lZ=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function lF(){let{t:e}=(0,h.b)(),{timeZone:t}=(0,P.M)(),{status:r}=(0,g.useSession)(),n=(0,D.usePathname)(),[i,s]=(0,m.useState)(!1),[a,o]=(0,m.useState)([]),[l,c]=(0,m.useState)(()=>Date.now()),d="authenticated"!==r||lZ.some(e=>e.test(n||"")),u=(0,m.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await v.k.get("/api/tasks");o(e.tasks),c(Date.now())}catch{}},[]);if((0,m.useEffect)(()=>{if(d)return;let e=setTimeout(u,0),t=setInterval(u,i?2e3:15e3);return()=>{clearTimeout(e),clearInterval(t)}},[d,i,u]),d)return null;let p=a.filter(e=>"running"===e.status).length,y=a.some(e=>"running"!==e.status),x=async()=>{try{let e=await v.k.delete("/api/tasks");o(e.tasks)}catch{}};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(eo.f,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>s(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[p>0?(0,f.jsx)(ee.f,{className:"h-5 w-5 animate-spin"}):(0,f.jsx)(lI,{className:"h-5 w-5"}),p>0&&(0,f.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:p})]}),(0,f.jsx)(el.N,{open:i,onOpenChange:s,children:(0,f.jsxs)(el.d,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,f.jsxs)(el.s,{children:[(0,f.jsx)(el.F,{children:e.backgroundTasks.title}),(0,f.jsx)(el.C,{children:e.backgroundTasks.description})]}),0===a.length?(0,f.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,f.jsx)("ul",{className:"space-y-2",children:a.map(r=>{var n,i;let a;return(0,f.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,f.jsxs)("div",{className:"flex items-start gap-2",children:["running"===r.status&&(0,f.jsx)(ee.f,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===r.status&&(0,f.jsx)(oE.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===r.status&&(0,f.jsx)(lD.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,f.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,f.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[r.kind],(0,f.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[r.status]]})]}),r.subject&&(0,f.jsx)("div",{className:"break-words text-muted-foreground",children:r.subject}),r.progress&&r.progress.total>0&&(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,f.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(r.progress.done/r.progress.total*100)}%`}})}),(0,f.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(r.progress.done)).replace("{total}",String(r.progress.total)),r.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(r.progress.failed))}`]})]}),r.error&&(0,f.jsx)("div",{className:"text-xs text-destructive",children:(t=>{if(!t)return null;let r=e.backgroundTasks.errors[t]??e.errors[t];return"string"==typeof r?r:t})(r.error)}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,f.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,ed.r)(r.startedAt,"HH:mm:ss",t))}),(0,f.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(n=r.startedAt,i=r.finishedAt,a=Math.max(0,Math.round(((i?Date.parse(i):l)-Date.parse(n))/1e3)),`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`))}),r.link&&(0,f.jsx)(I.default,{href:r.link,className:"text-primary hover:underline",onClick:()=>s(!1),children:e.backgroundTasks.view})]})]})]})},r.id)})}),(0,f.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,f.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),y&&(0,f.jsx)(eo.f,{variant:"ghost",size:"sm",onClick:x,children:e.backgroundTasks.clearFinished})]})]})})]})}var lR=e.i(263676);let lM={success:{icon:oE.f,className:"text-success"},error:{icon:lD.f,className:"text-destructive"},warning:{icon:q,className:"text-warning"},info:{icon:Y,className:"text-primary"}};function lL(){let{t:e}=(0,h.b)(),[t,r]=(0,m.useState)([]),[n,i]=(0,m.useState)(null);return(0,m.useEffect)(()=>(0,eN.M)(e=>{r(e.toasts),i(e.confirm)}),[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:t.map(t=>{let{icon:r,className:n}=lM[t.type];return(0,f.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,f.jsx)(r,{className:(0,eh.f)("mt-0.5 h-4 w-4 shrink-0",n)}),(0,f.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:t.message}),(0,f.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,eN.p)(t.id),"aria-label":e.common.close,children:(0,f.jsx)(lR.X,{className:"h-3.5 w-3.5"})})]},t.id)})}),(0,f.jsx)(el.N,{open:!!n,onOpenChange:e=>{e||n?.resolve(!1)},children:(0,f.jsxs)(el.d,{className:"sm:max-w-md",children:[(0,f.jsxs)(el.s,{children:[(0,f.jsxs)(el.F,{className:"flex items-center gap-2",children:[n?.destructive&&(0,f.jsx)(q,{className:"h-5 w-5 text-destructive"}),n?.title||e.common.confirmTitle]}),(0,f.jsx)(el.C,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:n?.message})]}),(0,f.jsxs)(el.c,{className:"gap-2",children:[(0,f.jsx)(eo.f,{variant:"outline",onClick:()=>n?.resolve(!1),children:n?.cancelText||e.common.cancel}),(0,f.jsx)(eo.f,{variant:n?.destructive?"destructive":"default",onClick:()=>n?.resolve(!0),autoFocus:!0,children:n?.confirmText||e.common.confirm})]})]})})]})}function lU(){return(0,m.useEffect)(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{x.V.warn("[PWA]","Service worker registration failed",{error:String(e)})})},[]),null}e.s(["Providers",0,function({children:e,timeZone:t}){return(0,m.useEffect)(()=>(0,x.m)(),[]),(0,f.jsx)(g.SessionProvider,{children:(0,f.jsx)(T,{children:(0,f.jsx)(h.w,{children:(0,f.jsxs)(P.n,{initialTimeZone:t,children:[(0,f.jsx)(lP,{children:e}),(0,f.jsx)(lF,{}),(0,f.jsx)(lL,{}),(0,f.jsx)(lU,{})]})})})})}],1661)}]);
|