@vellumai/web 0.10.8 → 0.10.9-dev.202607152124.584d617
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/dist/assets/{AnimatePresence-s1Z1HHWx.js → AnimatePresence-TZWSGjkI.js} +1 -1
- package/dist/assets/{BundleConfirmPage-C6bP7QB3.js → BundleConfirmPage-DgcqY17E.js} +1 -1
- package/dist/assets/{Combination-Cd_aWAsj.js → Combination-BJXmG5wD.js} +1 -1
- package/dist/assets/{a2a-invite-B9cylfIO.js → a2a-invite-D6BlTVdg.js} +1 -1
- package/dist/assets/{about-page-XGv9RAQu.js → about-page-BXF1KCN9.js} +1 -1
- package/dist/assets/account-page-ChWZxENJ.js +1 -0
- package/dist/assets/{account-shell-CdhP9l8T.js → account-shell-BwgE_OG4.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-B1-zyOUe.js → acp-run-detail-panel-DeRzfMVO.js} +4 -4
- package/dist/assets/activity-steps-panel-DJOtL2fE.js +1 -0
- package/dist/assets/{add-credits-modal-PP1PX8Qv.js → add-credits-modal-aH7r16HB.js} +1 -1
- package/dist/assets/advanced-page-Ds2YB0cu.js +4 -0
- package/dist/assets/ai-page-3OYJK3Ko.js +1 -0
- package/dist/assets/animated-avatar-TpoBMWI-.js +1 -0
- package/dist/assets/{api-_7pKLlYA.js → api-BsCfy4XV.js} +1 -1
- package/dist/assets/{api-BsQZ81K5.js → api-Dj9Z-j-6.js} +1 -1
- package/dist/assets/{api-key-screen-DTSP_-Da.js → api-key-screen-C71s1VQp.js} +1 -1
- package/dist/assets/app-types-CTJGOi24.js +1 -0
- package/dist/assets/archive-redirect-page-DB3ULZhs.js +1 -0
- package/dist/assets/arrow-left-C2re-gYj.js +1 -0
- package/dist/assets/{assistant-feature-flag-store-DA8Oj9Mf.js → assistant-feature-flag-store-xCO0XexH.js} +1 -1
- package/dist/assets/assistant-identity-store-Bc4hbSCe.js +1 -0
- package/dist/assets/assistant-status-panel-BDnovwx0.js +1 -0
- package/dist/assets/auth-store-D3dDj0_K.js +2 -0
- package/dist/assets/background-task-detail-panel-BAIv9Cdn.js +1 -0
- package/dist/assets/ban-Ih5bAOHZ.js +1 -0
- package/dist/assets/{bell-BQLonLMp.js → bell-BbESwsZk.js} +1 -1
- package/dist/assets/billing-page-DIYB99ZX.js +3 -0
- package/dist/assets/{bookmark-CNrithFf.js → bookmark-Dzconbsv.js} +1 -1
- package/dist/assets/{bookmarks-page-CjcavZv8.js → bookmarks-page-X6_iY9Er.js} +1 -1
- package/dist/assets/{brain-BLDXGaUy.js → brain-CMiHVWFK.js} +1 -1
- package/dist/assets/browser-Cpuuu7D3.js +2 -0
- package/dist/assets/{build-state-PUXrUU4W.js → build-state-CnZBv4ri.js} +1 -1
- package/dist/assets/button-BQVYX8n_.js +1 -0
- package/dist/assets/{calendar-h-mv1itX.js → calendar-CPociZmV.js} +1 -1
- package/dist/assets/card-D8zyWtZh.js +1 -0
- package/dist/assets/channels-page-route-BFfv0XG4.js +9 -0
- package/dist/assets/chat-CPqIbgZQ.js +1 -0
- package/dist/assets/chat-markdown-message-DBQ57T29.js +2 -0
- package/dist/assets/check-CkQjevXL.js +1 -0
- package/dist/assets/checkbox-B6CHx3mp.js +1 -0
- package/dist/assets/{chevron-down-qD-re7AW.js → chevron-down-DwIPfcCg.js} +1 -1
- package/dist/assets/chevron-left-mpHv5ahd.js +1 -0
- package/dist/assets/chevron-right-DDgSinGu.js +1 -0
- package/dist/assets/{chevron-up-3jCod9LW.js → chevron-up-B8xt61zY.js} +1 -1
- package/dist/assets/{chunk-5KNZJZUH-DdS6bb-3.js → chunk-5KNZJZUH-SU6Q_tDT.js} +1 -1
- package/dist/assets/{circle-alert-zOqdmf25.js → circle-alert-_RJjkRGu.js} +1 -1
- package/dist/assets/circle-check-DWe3QGcN.js +1 -0
- package/dist/assets/{client-feature-flag-store-DkJl-g9A.js → client-feature-flag-store-CXG75X45.js} +1 -1
- package/dist/assets/{client-identity-CadrtY_b.js → client-identity-CAZa_1yb.js} +1 -1
- package/dist/assets/{clipboard-copy-DF6K1xc6.js → clipboard-copy-sWUyFbCT.js} +1 -1
- package/dist/assets/{cloud-off-Db1nySkc.js → cloud-off-Dw7xZNU9.js} +1 -1
- package/dist/assets/code-zJNgeRIE.js +1 -0
- package/dist/assets/{command-palette-6o4m7BM9.js → command-palette-DAZvarqX.js} +1 -1
- package/dist/assets/{command-palette-window-page-BsJlr5bh.js → command-palette-window-page-CGE7iejN.js} +1 -1
- package/dist/assets/community-page-BGGcRjdD.js +1 -0
- package/dist/assets/{confirm-dialog-CSkhRFRk.js → confirm-dialog-0S-O513X.js} +1 -1
- package/dist/assets/{connect-page-DZgU3jCf.js → connect-page-BTaiEXwf.js} +1 -1
- package/dist/assets/consent-Bg13wifR.js +1 -0
- package/dist/assets/{consent-controls-Cnr1DzCr.js → consent-controls-BMIQr05K.js} +1 -1
- package/dist/assets/{contacts-gateway-CW5CipBv.js → contacts-gateway-DsqzGIxS.js} +1 -1
- package/dist/assets/contacts-page-route-BrcgBf5T.js +1 -0
- package/dist/assets/{conversation-list-fetchers-DS9vmqfD.js → conversation-list-fetchers-CQ_dcy46.js} +1 -1
- package/dist/assets/{cpu-BJuB2Khn.js → cpu-EkFnhbQ3.js} +1 -1
- package/dist/assets/{credential-entry-page-9H2HOu88.js → credential-entry-page-BVPSGmAu.js} +1 -1
- package/dist/assets/credentials-page-dotN1CcZ.js +1 -0
- package/dist/assets/{credit-card-BuyWdO9t.js → credit-card-B31Pzbpr.js} +1 -1
- package/dist/assets/danger-zone-redirect-page-dUGjeC2l.js +1 -0
- package/dist/assets/{deploy-dialogs-paL_zcvG.js → deploy-dialogs-BWIsw9cZ.js} +1 -1
- package/dist/assets/detail-card-D-y4TcVy.js +1 -0
- package/dist/assets/{detail-panel-stop-button-y7O3HqJj.js → detail-panel-stop-button-BeOjxmLx.js} +1 -1
- package/dist/assets/developer-page-L5U4jBYx.js +1 -0
- package/dist/assets/device-settings-BBwtGKJb.js +1 -0
- package/dist/assets/devices-redirect-page-BmWYp-tu.js +1 -0
- package/dist/assets/{diagnostics-COsnZMe5.js → diagnostics-7o9KNB_-.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BkEBWrWm.js → dictation-overlay-page-500rUBA8.js} +1 -1
- package/dist/assets/{dist-CxHeCOEv.js → dist-Btg1osd6.js} +1 -1
- package/dist/assets/{dist-DqmYHxdg.js → dist-CxzJhU4a.js} +1 -1
- package/dist/assets/dist-Df9Kbc9v.js +1 -0
- package/dist/assets/{dist-HJ505Xnn.js → dist-URk13ITj.js} +1 -1
- package/dist/assets/document-viewer-page-BqOrO81e.js +1 -0
- package/dist/assets/{domain-field-C5a2iMot.js → domain-field-BHtsk64V.js} +1 -1
- package/dist/assets/{download-CAuK-nZ6.js → download-f_Ejoz-g.js} +1 -1
- package/dist/assets/dropdown-CuE5AuVj.js +1 -0
- package/dist/assets/edge-swipe-arbiter-store-CdpmheQU.js +1 -0
- package/dist/assets/effective-timezone-D6A5ISj1.js +1 -0
- package/dist/assets/{emails-page-7c9kVi_k.js → emails-page-Cmo3KUGu.js} +1 -1
- package/dist/assets/esm-BIBV_tQW.js +1 -0
- package/dist/assets/esm-BpVuRCaK.js +2 -0
- package/dist/assets/{esm-CT8NUp3h.js → esm-BtlRHesG.js} +2 -2
- package/dist/assets/esm-C0eM5us1.js +2 -0
- package/dist/assets/esm-Cjx6Josx.js +2 -0
- package/dist/assets/esm-_n61e_LE.js +2 -0
- package/dist/assets/esm-p7tDK3Q-.js +2 -0
- package/dist/assets/{external-link-Dqpx9nRm.js → external-link-uO0bZiVJ.js} +1 -1
- package/dist/assets/eye-nshRoUpm.js +1 -0
- package/dist/assets/eye-off-CG1f2Bnj.js +1 -0
- package/dist/assets/feature-flag-catalog-BkLG5Cht.js +1 -0
- package/dist/assets/{file-DsyJLS2u.js → file-CVpofSiM.js} +1 -1
- package/dist/assets/file-editor-3pKRcAMT.js +1 -0
- package/dist/assets/file-markdown-CxCN_Naz.js +2 -0
- package/dist/assets/{file-text-CYJz-GvF.js → file-text-Bk8A5Pzn.js} +1 -1
- package/dist/assets/folder-open-DbXidt0q.js +1 -0
- package/dist/assets/general-page-BhMVFYWA.js +1 -0
- package/dist/assets/{globe-4qSOWE2N.js → globe-DgKSh933.js} +1 -1
- package/dist/assets/haptics-DNNGE-Te.js +2 -0
- package/dist/assets/{hard-drive-rDxhoRUm.js → hard-drive-DVmyHlZR.js} +1 -1
- package/dist/assets/hatching-screen-DlYuKf90.js +1 -0
- package/dist/assets/home-page-route-C3dSfSQA.js +1 -0
- package/dist/assets/{hosting-screen-BZLZular.js → hosting-screen-CWIK8NJD.js} +1 -1
- package/dist/assets/identity-page-route-ByGyh7KV.js +7 -0
- package/dist/assets/index-BZVPYTjj.js +209 -0
- package/dist/assets/index-Bp6Atcow.css +2 -0
- package/dist/assets/{info-DsOyuMO9.js → info-CqgkBvyS.js} +1 -1
- package/dist/assets/ingest-C0SmJ-Zw.js +1 -0
- package/dist/assets/input-6HVXMszw.js +1 -0
- package/dist/assets/inspect-page-BkApg0Ye.js +9 -0
- package/dist/assets/integrations-page-CFeCGfhp.js +1 -0
- package/dist/assets/intelligence-layout-CadvtL42.js +1 -0
- package/dist/assets/{key-round-CD3JWrs1.js → key-round-CN4UKztQ.js} +1 -1
- package/dist/assets/keyboard-shortcuts-redirect-page-DtzLJIeO.js +1 -0
- package/dist/assets/latest-assistant-text-B12Sw3_u.js +24 -0
- package/dist/assets/library-detail-page-CIhAIDwk.js +1 -0
- package/dist/assets/library-page-DC4tyjw8.js +1 -0
- package/dist/assets/{link-2-4bMylQ5v.js → link-2-B9c5ZsFq.js} +1 -1
- package/dist/assets/list-row-BvLPXpTK.js +1 -0
- package/dist/assets/loader-circle-Ck8fq3yv.js +1 -0
- package/dist/assets/{local-mode-grqHUoNh.js → local-mode-Bskd5bsT.js} +1 -1
- package/dist/assets/{log-in--aqELu3z.js → log-in-khREn0DP.js} +1 -1
- package/dist/assets/{login-flow-B6q00uIW.js → login-flow-BV6myCbg.js} +1 -1
- package/dist/assets/login-page-AihwAnfC.js +1 -0
- package/dist/assets/{logout-page-BV0URcAd.js → logout-page-r-0LvcO6.js} +1 -1
- package/dist/assets/logs-layout-BRLi_qS-.js +1 -0
- package/dist/assets/memory-page-route-CB5I7RG9.js +1 -0
- package/dist/assets/{memory-router-playground-page-CQxX6mCn.js → memory-router-playground-page-BpPsu9YE.js} +1 -1
- package/dist/assets/menu-B672pBEP.js +1 -0
- package/dist/assets/{messages-Bl6a3LUN.js → messages-BQ1NfLEV.js} +2 -2
- package/dist/assets/{metric-card-DvXjHVCV.js → metric-card-rBMtfy-9.js} +1 -1
- package/dist/assets/mic-DEmgi4rh.js +1 -0
- package/dist/assets/{middleware-pbPQ0upo.js → middleware-DL-IveDQ.js} +1 -1
- package/dist/assets/{minimize-2-Clnet2W7.js → minimize-2-dsDfFPkN.js} +1 -1
- package/dist/assets/{misc-BYQPh7vS.js → misc-CS-Pktrv.js} +1 -1
- package/dist/assets/mobile-sidebar-drawer-BilS4-Bl.js +1 -0
- package/dist/assets/modal-bIQsMU63.js +1 -0
- package/dist/assets/{monitor-DfbL8_59.js → monitor-BFX2ySFb.js} +1 -1
- package/dist/assets/{moon-B8qiwjrW.js → moon-h3xmz34k.js} +1 -1
- package/dist/assets/mutation-error-BHT0MqVm.js +1 -0
- package/dist/assets/native-biometric-BogIGQG_.js +6 -0
- package/dist/assets/{native-file-DI99Emal.js → native-file-C6oXU5FE.js} +2 -2
- package/dist/assets/notice-BPud7_bD.js +1 -0
- package/dist/assets/notifications-page-Di4lEWP5.js +1 -0
- package/dist/assets/{oauth-complete-page-BlJm9tRJ.js → oauth-complete-page-D35qj-te.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BqUopTat.js → oauth-popup-complete-page-Cm1Gpz6v.js} +1 -1
- package/dist/assets/onboarding-store-tqBxGvkR.js +1 -0
- package/dist/assets/page-shell-lS5z70GY.js +1 -0
- package/dist/assets/{pairing-page-B5GrCx4C.js → pairing-page-BBRJALfE.js} +1 -1
- package/dist/assets/panel-item-CfuwAm7q.js +1 -0
- package/dist/assets/password-reset-page-CdUgxU3W.js +1 -0
- package/dist/assets/{pencil-CUIr0IFo.js → pencil-CsnkG5VN.js} +1 -1
- package/dist/assets/personality-page-7pzIG0fT.js +1 -0
- package/dist/assets/platform-detection-BaPcSHIf.js +1 -0
- package/dist/assets/platform-loopback-page-CgEqDh8t.js +1 -0
- package/dist/assets/{plugin-detail-page-Byuqbr1N.js → plugin-detail-page--tkbKLiM.js} +1 -1
- package/dist/assets/plugins-page-dPXWPUim.js +1 -0
- package/dist/assets/plugins-surface-B2vYGNIS.js +1 -0
- package/dist/assets/plus-DZZypDUF.js +1 -0
- package/dist/assets/popover-rW459udD.js +1 -0
- package/dist/assets/prechat-route-BSQ6CgxI.js +1 -0
- package/dist/assets/prefs-BhGkdtWC.js +1 -0
- package/dist/assets/privacy-page-kI3rWtdi.js +1 -0
- package/dist/assets/privacy-screen-DbTCbPrV.js +1 -0
- package/dist/assets/{usage-window-C6gWu5Qu.js → profile-metadata-CbcuGTHP.js} +1 -1
- package/dist/assets/progress-bar-Wa6qo8OT.js +1 -0
- package/dist/assets/provider-callback-page-BXllqtyV.js +1 -0
- package/dist/assets/{provider-key-3AHnKoz9.js → provider-key-BIMvWJCe.js} +1 -1
- package/dist/assets/provider-signup-page-C26qNyCx.js +1 -0
- package/dist/assets/puzzle-C894zd87.js +1 -0
- package/dist/assets/{quick-input-page-Cv_CzapK.js → quick-input-page-BVuiURib.js} +1 -1
- package/dist/assets/react-query.gen-DjmYXavs.js +1 -0
- package/dist/assets/react-query.gen-JxTd3SS8.js +1 -0
- package/dist/assets/{refresh-cw-DevIHL7J.js → refresh-cw-cau3ebz1.js} +1 -1
- package/dist/assets/{remote-gateway-session-CbBWrPZH.js → remote-gateway-session-CBKZhJak.js} +1 -1
- package/dist/assets/{repeat-C8Im6j--.js → repeat-BhXOPeQU.js} +1 -1
- package/dist/assets/research-mock-page-CgsKuUow.js +1 -0
- package/dist/assets/research-onboarding-route-DBWaQC6l.js +42 -0
- package/dist/assets/{resize-errors-DqIkO0UI.js → resize-errors-C7Otjjlt.js} +1 -1
- package/dist/assets/{resolved-assistants-store-BSZbT8Ju.js → resolved-assistants-store-DAzPZ1eV.js} +1 -1
- package/dist/assets/{return-to-BwxkOGDI.js → return-to-ugSGJ0dm.js} +1 -1
- package/dist/assets/review-terms-screen-B1l_RHOE.js +1 -0
- package/dist/assets/risk-BmdmlXrD.js +3 -0
- package/dist/assets/routes-CAkcxlmQ.js +1 -0
- package/dist/assets/schedules-oC-weaYP.js +1 -0
- package/dist/assets/{sdk.gen-BwnFjFcp.js → sdk.gen-CFgJ4K6f.js} +1 -1
- package/dist/assets/sdk.gen-Z7XkRg5O.js +1 -0
- package/dist/assets/security-redirect-page-BtwlikGy.js +1 -0
- package/dist/assets/select-assistant-screen-D0AJeybj.js +1 -0
- package/dist/assets/{setting-row-CUka7_L9.js → setting-row-f2idXB8B.js} +1 -1
- package/dist/assets/settings-DHqLQyx4.js +1 -0
- package/dist/assets/settings-divider-DfbvWaJf.js +1 -0
- package/dist/assets/settings-layout-j7Tny3R2.js +1 -0
- package/dist/assets/share-feedback-modal-EunusV5a.js +1 -0
- package/dist/assets/shield-check-kgUZeU9b.js +1 -0
- package/dist/assets/{sidebar-tree-C1_LiBB9.js → sidebar-tree-CXXymkyZ.js} +1 -1
- package/dist/assets/signup-page-BlXVHPoO.js +1 -0
- package/dist/assets/{signup-shell-DufHA5do.js → signup-shell-C2c8tEWo.js} +1 -1
- package/dist/assets/site-favicon-eiWubspF.js +1 -0
- package/dist/assets/skill-detail-page-239Q2KXu.js +1 -0
- package/dist/assets/{skill-detail-panel-BGoRUWNU.js → skill-detail-panel-1ContvoC.js} +1 -1
- package/dist/assets/{skills-AtSQBwXr.js → skills-CPSTIFwL.js} +1 -1
- package/dist/assets/skills-page-DqAy4DUl.js +1 -0
- package/dist/assets/{sound-manager-6UbdgQrj.js → sound-manager-DUFvLLrG.js} +1 -1
- package/dist/assets/sounds-redirect-page-Be71BPtz.js +1 -0
- package/dist/assets/{sparkles-PGiR5v1g.js → sparkles-BK3KXCjl.js} +1 -1
- package/dist/assets/{src-zsLiFPw3.js → src-CYX5MuYs.js} +39 -39
- package/dist/assets/{subagent-detail-panel-BGuVa8-m.js → subagent-detail-panel-hBlBqr4t.js} +2 -2
- package/dist/assets/{subagent-store-Bz4irJre.js → subagent-store-UK3sycHi.js} +1 -1
- package/dist/assets/system-events-page-B_hlJqmc.js +1 -0
- package/dist/assets/system-events-redirect-page-CjnkgTVB.js +1 -0
- package/dist/assets/tag-D0AE0-aA.js +1 -0
- package/dist/assets/theme-preferences-DW9WTu2f.js +1 -0
- package/dist/assets/theme-stage-page-CorMU3H-.js +1 -0
- package/dist/assets/{tiptap-document-editor-C-eOEBR_.js → tiptap-document-editor-CuLH4HM_.js} +2 -2
- package/dist/assets/toast-Ca-EEKyA.js +1 -0
- package/dist/assets/toggle-CWrJ2t4S.js +1 -0
- package/dist/assets/{tool-detail-panel-wAuQ7gi8.js → tool-detail-panel-BovwGDNh.js} +2 -2
- package/dist/assets/{triangle-alert-Z0Gq0IuB.js → triangle-alert-CnjNKhNx.js} +1 -1
- package/dist/assets/typography-Cqi8q9o7.js +1 -0
- package/dist/assets/{upgrade-cancel-page-BGgPmDmT.js → upgrade-cancel-page-zfGWw6gC.js} +1 -1
- package/dist/assets/{upgrade-success-page-TJBopZ0Z.js → upgrade-success-page-B6ga6hrm.js} +1 -1
- package/dist/assets/usage-redirect-page-idOBXPYI.js +1 -0
- package/dist/assets/{use-active-assistant-id-BWXi63qg.js → use-active-assistant-id-KipCgPNT.js} +1 -1
- package/dist/assets/use-assistant-identity-details-Ce92639h.js +1 -0
- package/dist/assets/{use-edge-swipe-back-B4XlZ1Iu.js → use-edge-swipe-back-BfWKkSiL.js} +1 -1
- package/dist/assets/use-invite-link-dialog-Bo8DNR9l.js +1 -0
- package/dist/assets/use-is-org-ready-Cf1j_pDw.js +1 -0
- package/dist/assets/use-onboarding-login-C76wUKaT.js +1 -0
- package/dist/assets/{use-reduced-motion-Cj0Z8KSf.js → use-reduced-motion-BPBlq9_a.js} +1 -1
- package/dist/assets/use-skill-actions-Cs1PmF42.js +1 -0
- package/dist/assets/use-skill-categories-BbTdimWQ.js +1 -0
- package/dist/assets/{use-skill-detail-files-Dpp521cY.js → use-skill-detail-files-BDZ7Js8l.js} +1 -1
- package/dist/assets/{user-plus-DMh4_UTz.js → user-plus-KuzSTM_D.js} +1 -1
- package/dist/assets/{utils-xg2dl_KJ.js → utils-CNB1P-cO.js} +1 -1
- package/dist/assets/{viewer-store-B8-Qnbx9.js → viewer-store-CFywMdJp.js} +1 -1
- package/dist/assets/voice-page--8XXDVIc.js +1 -0
- package/dist/assets/{weather-forecast-display-Bix8rpji.js → weather-forecast-display-SJUFsGxg.js} +1 -1
- package/dist/assets/{web-RhBklijR.js → web-BPvLuAGE.js} +1 -1
- package/dist/assets/{web-D8PpvYf_.js → web-BUVD1SEs.js} +1 -1
- package/dist/assets/{web-C1L-cpPj.js → web-Bf269a_Y.js} +1 -1
- package/dist/assets/{web-CJiP8Lg6.js → web-CELqsarU.js} +1 -1
- package/dist/assets/{web-O1LOb-o9.js → web-CFPJ_DoC.js} +1 -1
- package/dist/assets/{web-BD2N6zhd.js → web-DFW5YV0h.js} +1 -1
- package/dist/assets/{web-BaubW4Pp.js → web-DyY0a6OS.js} +1 -1
- package/dist/assets/{web-Duw5A2aP.js → web-KeVAvkzP.js} +1 -1
- package/dist/assets/{welcome-screen-CVI4Hjnt.js → welcome-screen-B6PC0dGC.js} +1 -1
- package/dist/assets/workflow-detail-panel-B5YCXMNo.js +1 -0
- package/dist/assets/{workflow-store-B7ofewCi.js → workflow-store-k8Si-dKc.js} +1 -1
- package/dist/assets/workspace-page-CAFamUOC.js +1 -0
- package/dist/assets/x-BYcSiJRX.js +1 -0
- package/dist/index.html +146 -142
- package/dist/skills/chat-complex-documents/assets/icon.svg +26 -0
- package/package.json +1 -1
- package/dist/assets/account-page-Dno1SeJN.js +0 -1
- package/dist/assets/activity-steps-panel-BGyfMCXK.js +0 -1
- package/dist/assets/advanced-page-vCbMVJsK.js +0 -1
- package/dist/assets/ai-page-BIYybKux.js +0 -1
- package/dist/assets/animated-avatar-Cqpzb8O4.js +0 -1
- package/dist/assets/archive-0aqysuyd.js +0 -1
- package/dist/assets/archive-page-RZ2VP63A.js +0 -1
- package/dist/assets/arrow-left-DI9551VI.js +0 -1
- package/dist/assets/assistant-identity-store-CX03CK8q.js +0 -1
- package/dist/assets/assistant-status-panel-BC0RTDls.js +0 -1
- package/dist/assets/auth-store-C09YAZEu.js +0 -2
- package/dist/assets/background-task-detail-panel-BfnsD-3B.js +0 -1
- package/dist/assets/ban-CVKGuUAQ.js +0 -1
- package/dist/assets/billing-page-1z_L2m6q.js +0 -3
- package/dist/assets/browser-C6a_nhhZ.js +0 -2
- package/dist/assets/bug-BsuQ5ciQ.js +0 -1
- package/dist/assets/button-amTXFI-2.js +0 -1
- package/dist/assets/card-Bv5O5juh.js +0 -1
- package/dist/assets/channels-page-route-WjNmd0sS.js +0 -9
- package/dist/assets/chat-B8mgARYR.js +0 -1
- package/dist/assets/chat-markdown-message-BnX6bhgs.js +0 -2
- package/dist/assets/check-DFNrQERi.js +0 -1
- package/dist/assets/checkbox-EdyezNqo.js +0 -1
- package/dist/assets/chevron-left-BMF1xNfR.js +0 -1
- package/dist/assets/chevron-right-DqqmezXC.js +0 -1
- package/dist/assets/circle-check-VSiny8yl.js +0 -1
- package/dist/assets/cn-C36Yvcac.js +0 -1
- package/dist/assets/code-Czx7d7SK.js +0 -1
- package/dist/assets/community-page-CJA4JfuC.js +0 -1
- package/dist/assets/contacts-page-route-P0neH-PV.js +0 -1
- package/dist/assets/copy-Cn1FKrEp.js +0 -1
- package/dist/assets/credentials-page-MkKE_19-.js +0 -1
- package/dist/assets/danger-zone-redirect-page-BWg7rn8D.js +0 -1
- package/dist/assets/debug-page-B88f4aDU.js +0 -4
- package/dist/assets/detail-card-xKZlkbz5.js +0 -1
- package/dist/assets/developer-page-BFMS6pwU.js +0 -1
- package/dist/assets/devices-page-B3D5iLhD.js +0 -1
- package/dist/assets/dist-BItmZQO6.js +0 -1
- package/dist/assets/document-viewer-page-B631L6-3.js +0 -1
- package/dist/assets/dropdown-ByHOpeOU.js +0 -1
- package/dist/assets/earn-credits-modal-CFla-iKl.js +0 -1
- package/dist/assets/edge-swipe-arbiter-store-BeOhrE7M.js +0 -1
- package/dist/assets/effective-timezone-C4nukIC4.js +0 -1
- package/dist/assets/esm-B54gzHCZ.js +0 -1
- package/dist/assets/esm-Bzs_witt.js +0 -2
- package/dist/assets/esm-C5J59K0j.js +0 -2
- package/dist/assets/esm-DEu9JbAE.js +0 -2
- package/dist/assets/esm-DZkj1VLJ.js +0 -2
- package/dist/assets/esm-DtJz1M8R.js +0 -2
- package/dist/assets/feature-flag-catalog-GgSNKkqP.js +0 -1
- package/dist/assets/file-editor-sT7eHxsw.js +0 -1
- package/dist/assets/file-markdown-Bq97tNxs.js +0 -2
- package/dist/assets/general-page-D-Gr2lkW.js +0 -1
- package/dist/assets/haptics-lMERs7us.js +0 -2
- package/dist/assets/hatching-screen-BlwicgIz.js +0 -1
- package/dist/assets/home-page-route-D24x4A0S.js +0 -1
- package/dist/assets/identity-page-route-BwOJeenx.js +0 -1
- package/dist/assets/index-C9GrLGul.css +0 -2
- package/dist/assets/index-yu6nDHvG.js +0 -113
- package/dist/assets/input-CoUmPnRU.js +0 -1
- package/dist/assets/inspect-page-1RejwSP_.js +0 -9
- package/dist/assets/integrations-page-BV5BiHPD.js +0 -1
- package/dist/assets/intelligence-layout-iQFO8in_.js +0 -1
- package/dist/assets/keyboard-shortcuts-page-jt13JtxS.js +0 -1
- package/dist/assets/library-detail-page-BAGWt1Lw.js +0 -1
- package/dist/assets/library-page-CqeoBhDY.js +0 -1
- package/dist/assets/list-row-D5MFdbkH.js +0 -1
- package/dist/assets/llm-dimension-DyYwG3mU.js +0 -1
- package/dist/assets/loader-circle-Cz7opInR.js +0 -1
- package/dist/assets/login-page-BQVTWuQc.js +0 -1
- package/dist/assets/logs-layout-DO3yfZqD.js +0 -1
- package/dist/assets/menu-Dy5QbnTj.js +0 -1
- package/dist/assets/mobile-sidebar-drawer-Epbt6p-k.js +0 -1
- package/dist/assets/modal-D5nLWNN9.js +0 -1
- package/dist/assets/mutation-error-DYv0eJ_i.js +0 -1
- package/dist/assets/native-biometric-Czaf9IqI.js +0 -6
- package/dist/assets/notice-DkcNAP8O.js +0 -1
- package/dist/assets/notifications-page-CXaZpD3s.js +0 -1
- package/dist/assets/page-shell-BUGBKCmv.js +0 -1
- package/dist/assets/panel-item-CouW2A55.js +0 -1
- package/dist/assets/password-reset-page-BCk9Si73.js +0 -1
- package/dist/assets/platform-detection-BrxvFUiR.js +0 -1
- package/dist/assets/platform-loopback-page-MZdCPXRI.js +0 -1
- package/dist/assets/plugins-page-Ci0CoSAN.js +0 -1
- package/dist/assets/plugins-surface-z3RTZS4H.js +0 -1
- package/dist/assets/plus-DItfr5ux.js +0 -1
- package/dist/assets/popover-CFL4WZTr.js +0 -1
- package/dist/assets/prechat-route-9JFn-w_1.js +0 -1
- package/dist/assets/prefs-B1Y3q3c8.js +0 -1
- package/dist/assets/privacy-page-BTpvj9ZP.js +0 -1
- package/dist/assets/privacy-screen-CUbVcDf_.js +0 -1
- package/dist/assets/progress-bar-Ca8gmE3B.js +0 -1
- package/dist/assets/provider-callback-page-fB2tIyqL.js +0 -1
- package/dist/assets/provider-signup-page-C4Dn-wtJ.js +0 -1
- package/dist/assets/react-query.gen-C6wVk6Rw.js +0 -1
- package/dist/assets/react-query.gen-DPzPS206.js +0 -1
- package/dist/assets/research-mock-page-1T92rXz3.js +0 -1
- package/dist/assets/research-onboarding-route-CmWgwOFk.js +0 -63
- package/dist/assets/review-terms-screen-DrD4vywk.js +0 -1
- package/dist/assets/risk-Dopd25rc.js +0 -3
- package/dist/assets/routes-BbeIx_F9.js +0 -1
- package/dist/assets/save-aD5JFIZf.js +0 -1
- package/dist/assets/schedules-BfKi12EZ.js +0 -1
- package/dist/assets/sdk.gen-CmKfVpgB.js +0 -1
- package/dist/assets/security-page-BYI7twYM.js +0 -1
- package/dist/assets/select-assistant-screen-Br-PNDO1.js +0 -1
- package/dist/assets/settings-layout-lddMUg7A.js +0 -1
- package/dist/assets/share-feedback-modal-DSwfhMsV.js +0 -1
- package/dist/assets/shortcut-keys-B2EE-634.js +0 -1
- package/dist/assets/signup-page-D6hAK-Us.js +0 -1
- package/dist/assets/site-favicon-fQHLTT6F.js +0 -1
- package/dist/assets/skill-detail-page-BlfgTyFC.js +0 -1
- package/dist/assets/skill-icon-cNkD2w1X.js +0 -1
- package/dist/assets/skills-page-DeIiyhVc.js +0 -1
- package/dist/assets/sounds-page-BgLLJ-o9.js +0 -1
- package/dist/assets/stat-square-CTHnQ1jc.js +0 -1
- package/dist/assets/system-events-page-C1hXOYmg.js +0 -1
- package/dist/assets/system-events-redirect-page-DbaFKRXH.js +0 -1
- package/dist/assets/tag-CV4v7fRF.js +0 -1
- package/dist/assets/toast-xTp-xwYL.js +0 -1
- package/dist/assets/toggle-CDfguvUz.js +0 -1
- package/dist/assets/typography-D5f7kt80.js +0 -1
- package/dist/assets/usage-page-DLWFk2P0.js +0 -1
- package/dist/assets/use-bus-subscription-C3H3CmM_.js +0 -1
- package/dist/assets/use-invite-link-dialog-BdnW1BHj.js +0 -1
- package/dist/assets/use-is-org-ready-jhEM-4rY.js +0 -1
- package/dist/assets/use-onboarding-login-B-1jrjFL.js +0 -1
- package/dist/assets/use-skill-actions-BpVxiQZY.js +0 -1
- package/dist/assets/use-skill-categories-CCxtjMC_.js +0 -1
- package/dist/assets/voice-page-BoCTB8Jx.js +0 -1
- package/dist/assets/workflow-detail-panel-CwZH3tDl.js +0 -1
- package/dist/assets/workspace-page-CwIsXk1j.js +0 -1
- package/dist/assets/x-CkSVp1Ok.js +0 -1
- /package/dist/assets/{debug-page-TdnZ7DQy.css → advanced-page-TdnZ7DQy.css} +0 -0
- /package/dist/assets/{app-info-Clwt3pCt.js → app-info-AJ6nA0RS.js} +0 -0
- /package/dist/assets/{avatar-bundled-components--1Wyhs4r.js → avatar-bundled-components-DgzHRe6Z.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-CnDf9Ibf.js → avatar-svg-compositor-C_lXkZLZ.js} +0 -0
- /package/dist/assets/{browser-timezone-2SnmKDjM.js → browser-timezone-DjbAts-Z.js} +0 -0
- /package/dist/assets/{build.umd-CxdKgGWo.js → build.umd-CVjrbvyL.js} +0 -0
- /package/dist/assets/{bundle-mjs-BZt35okJ.js → bundle-mjs-CK9sN9wG.js} +0 -0
- /package/dist/assets/{by-tool-use-id-index-BokzI3ZP.js → by-tool-use-id-index-CBaMK-eh.js} +0 -0
- /package/dist/assets/{composer-focus-BZr63Cvs.js → composer-focus-CpeV_gfi.js} +0 -0
- /package/dist/assets/{conversation-selection-BBHkzcfy.js → conversation-selection-DYJPsAjJ.js} +0 -0
- /package/dist/assets/{conversation-store-BljZWolF.js → conversation-store-CnRrUeSu.js} +0 -0
- /package/dist/assets/{createLucideIcon-IRfcSUxS.js → createLucideIcon-Bjb-Kuq7.js} +0 -0
- /package/dist/assets/{definitions-CaYcW4Yq.js → definitions-BaillmRO.js} +0 -0
- /package/dist/assets/{definitions-DScTW2c-.js → definitions-Ce8XXjMI.js} +0 -0
- /package/dist/assets/{dist-DS5iJwBJ2.js → dist-DyRKd0bN2.js} +0 -0
- /package/dist/assets/{domains-D3QF404Q.js → domains-CIIVdIa8.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-BNtUmdK0.js} +0 -0
- /package/dist/assets/{environment-store-C0f32873.js → environment-store-R_3zZFKL.js} +0 -0
- /package/dist/assets/{format-date-CghpPTDc.js → format-date-Cda44k2J.js} +0 -0
- /package/dist/assets/{format-file-size-DzVEncaw.js → format-file-size-BSrdQr7P.js} +0 -0
- /package/dist/assets/{native-deep-link-CJGNy9bj.js → native-deep-link-CbHUZ2h_.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-BfSOxqy3.js} +0 -0
- /package/dist/assets/{optimistic-lifecycle-BvfDBY8o.js → optimistic-lifecycle-CR11Vyrt.js} +0 -0
- /package/dist/assets/{pdf-C3Qukw-J.js → pdf-BjgNZTii.js} +0 -0
- /package/dist/assets/{pointer-Cdz7NGHe.js → pointer-CzC_8USk.js} +0 -0
- /package/dist/assets/{prechat-P1y7ZM6C.js → prechat-Ddpjms85.js} +0 -0
- /package/dist/assets/{prechat-names-clVy5Mee.js → prechat-names-DEWE0LUf.js} +0 -0
- /package/dist/assets/{proxy-o6cPThl2.js → proxy-Cadlowdl.js} +0 -0
- /package/dist/assets/{public-asset-GKv5zCfZ.js → public-asset-Budc22a_.js} +0 -0
- /package/dist/assets/{research-onboarding-persistence-DnuHyFyB.js → research-onboarding-persistence-BmACYjeE.js} +0 -0
- /package/dist/assets/{sdk.gen-BhtkuoSl.js → sdk.gen-C9oZyNeN.js} +0 -0
- /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-DQHLgr0r.js} +0 -0
- /package/dist/assets/{step-indicator-dots-D03TmFKG.js → step-indicator-dots-iS_Q2OX6.js} +0 -0
- /package/dist/assets/{three-dot-indicator-DNuHHwtA.js → three-dot-indicator-ByrGmGYU.js} +0 -0
- /package/dist/assets/{typed-storage-5IU6qVWg.js → typed-storage-BRvgA7pX.js} +0 -0
- /package/dist/assets/{use-copy-to-clipboard-BCTXSMa-.js → use-copy-to-clipboard-CtO2o7KE.js} +0 -0
- /package/dist/assets/{workflow-status-ZrbiLW5D.js → workflow-status-4RYJ-tdh.js} +0 -0
- /package/dist/assets/{xterm-CBmd_y-b.js → xterm-ChjrCiYv.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-THPW0uy0.js → xterm-addon-fit-D_4nBxep.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{P as n,t as r}from"./button-BQVYX8n_.js";import{m as i,t as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./typography-Cqi8q9o7.js";import{t as f}from"./card-D8zyWtZh.js";import{t as p}from"./chevron-down-DwIPfcCg.js";import{t as m}from"./list-row-BvLPXpTK.js";import{t as h}from"./notice-BPud7_bD.js";import{M as g,N as _,a as v,i as y,j as b}from"./src-CYX5MuYs.js";import{t as x}from"./tag-D0AE0-aA.js";import{t as S}from"./input-6HVXMszw.js";import{t as C}from"./panel-item-CfuwAm7q.js";import{t as w}from"./confirm-dialog-0S-O513X.js";import{t as T}from"./dropdown-CuE5AuVj.js";import{n as E,t as D}from"./create-selectors-8NePGNlX.js";import{t as O}from"./assistant-identity-store-Bc4hbSCe.js";import{n as k}from"./utils-CNB1P-cO.js";import{c as A}from"./routes-CAkcxlmQ.js";import{i as j,o as M,r as N}from"./sdk.gen-C9oZyNeN.js";import{t as P}from"./assistant-feature-flag-store-xCO0XexH.js";import{t as F}from"./public-asset-Budc22a_.js";import{Dt as I,Ji as ee,Mi as te,b as L,cn as R,cr as ne,d as re,ia as z,l as ie,lr as ae,sn as B,wr as oe,x as se,xa as V,y as ce}from"./index-BZVPYTjj.js";import{t as le}from"./use-active-assistant-id-KipCgPNT.js";import{a as ue,c as de,d as H,l as fe,n as pe,o as me,t as he,u as ge}from"./use-invite-link-dialog-Bo8DNR9l.js";import{t as _e}from"./detail-card-D-y4TcVy.js";import{n as ve,t as ye}from"./mobile-sidebar-drawer-BilS4-Bl.js";import{t as U}from"./mutation-error-BHT0MqVm.js";var W=e(t(),1),G=u();function K({icon:e,title:t,description:r,action:i,className:a}){return(0,G.jsxs)(`div`,{className:n(`flex flex-col items-center justify-center gap-3 px-4 py-12 text-center`,a),children:[e?(0,G.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl bg-[var(--surface-sunken)] text-[var(--content-tertiary)]`,children:e}):null,(0,G.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:t}),r?(0,G.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:r}):null,i?(0,G.jsx)(`div`,{className:`mt-1`,children:i}):null]})}var q=D(E()(e=>({selectedAdapter:`slack`,selectAdapter:t=>e({selectedAdapter:t})})));function J({channels:e,selectedKey:t,onSelect:n}){return(0,G.jsx)(f.Root,{className:`flex h-full flex-col overflow-hidden`,children:(0,G.jsxs)(f.Body,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:`Channels`}),(0,G.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,G.jsx)(be,{channel:e,selected:e.key===t,onClick:()=>n(e.key)},e.key))})]})})}function be({channel:e,selected:t,onClick:n}){let r=e.status===`ready`,i=R(e.key),a=r?`Connected`:`Not connected`;return(0,G.jsx)(C,{asChild:!0,active:t,label:`${i}, ${a}`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-auto w-full items-center gap-2 rounded-[6px] px-[8px] py-2 text-left`,children:[(0,G.jsx)(B,{channelId:e.key,className:`h-4 w-4 shrink-0 text-[color:var(--content-secondary)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default`,children:i}),(0,G.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,G.jsx)(x,{tone:r?`positive`:`neutral`,children:a})})]})})}function xe({children:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:`Slack setup`})]})}),(0,G.jsx)(f.Body,{children:e})]})}var Y=ce.map(e=>e.riskThreshold),X={none:{label:L(`none`).label,sublabel:`ask before every action`,tone:`negative`},low:{label:L(`low`).label,sublabel:`low-risk actions, ask for the rest`,tone:`warning`},medium:{label:L(`medium`).label,sublabel:`beyond its workspace too`,tone:`info`},high:{label:L(`high`).label,sublabel:`acts freely`,tone:`positive`}},Z=[`trusted_contact`,`unverified_contact`,`unknown`];function Se(e,t){let n={};for(let r of e){if(r.selector.scope!==`channel`||r.selector.adapter!==t)continue;let e=r.selector.channelExternalId;e&&(r.contactType===`trusted_contact`||!(e in n))&&(n[e]=r.threshold)}return n}function Ce(e){return{tier:e??null,overridden:e!==void 0}}function we({channelName:e,settings:t,defaultTier:n,loading:i=!1,error:a=!1,onTierChange:o,onReset:s}){let c=i||a,l=Y.map(e=>({value:e,label:X[e].label,sublabel:X[e].sublabel,disabled:c}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-2 pt-1 pb-4`,children:[t.overridden?(0,G.jsx)(h,{tone:`warning`,title:`Custom access.`,className:`border-dashed`,actions:(0,G.jsx)(r,{type:`button`,variant:`outlined`,onClick:s,disabled:c,children:`Reset to default`}),children:`This channel isn’t following your global Assistant Access setting.`}):null,(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Assistant Access`}),i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load — try reopening this page`}):t.overridden?(0,G.jsx)(x,{tone:`warning`,children:`overridden`}):(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`default`})]}),(0,G.jsx)(b,{items:l,value:t.tier??n,onChange:o,ariaLabel:`Assistant Access in ${e}`})]})}var Te={positive:`var(--system-positive-strong)`,negative:`var(--system-negative-strong)`,warning:`var(--system-mid-strong)`,info:`var(--system-info-strong)`,neutral:`var(--content-secondary)`};function Ee(e,t){switch(e){case`none`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies in this channel, but asks you before taking any action.`]});case`low`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies and runs safe, read-only actions on its own, like web searches and reading files in its workspace. Anything that writes, sends, or spends asks you first.`]});case`medium`:return(0,G.jsxs)(G.Fragment,{children:[t,` also handles medium-risk requests on its own, like network requests that use your connected accounts. Anything that writes, sends, or spends still asks you first.`]});case`high`:return(0,G.jsxs)(G.Fragment,{children:[t,` answers any request on its own without asking. Tools that take action — writing, sending, spending — still come to you first.`]})}}function De({assistantName:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:`Assistant Access levels`}),(0,G.jsx)(f.Body,{className:`grid gap-4 sm:grid-cols-2`,children:Y.map(t=>{let n=X[t];return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 rounded-full`,style:{backgroundColor:Te[n.tone]}}),(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,children:n.label})]}),(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:Ee(t,e)})]},t)})}),(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Your`,` `,(0,G.jsx)(a,{to:A.settings.privacy,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`Trust Rules`}),` `,`fine-tune these levels: a rule raises or lowers how risky a specific action is treated, which changes when it asks first.`]})})]})}function Q(e){return e.type===`dm`?`dm`:e.isPrivate?`private`:`public`}function Oe(e){return e.filter(e=>Q(e)!==`dm`)}function ke(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>(n===null||Q(e)===n)&&(r===``||e.name.toLowerCase().includes(r))).sort((e,t)=>e.name.localeCompare(t.name))}function Ae(e){let t={public:0,private:0,dm:0};for(let n of e)t[Q(n)]+=1;return t}function je(e){return e.memberCount==null?null:e.memberCount===1?`1 member`:`${e.memberCount} members`}var Me=[{value:null,label:`All`},{value:`public`,label:`Public`},{value:`private`,label:`Private`}],Ne={public:z,private:ee},Pe=100,Fe=new Set;function Ie({assistantDisplayName:e,slackHandle:t,channels:i,loading:a=!1,error:o=!1,tierOverrides:s,defaultTier:c=null,accessControlsSupported:l=!0,tierOverridesLoading:u=!1,tierOverridesError:p=!1,pendingChannelIds:m=Fe,onTierChange:h,onTierReset:g}){let[_,b]=(0,W.useState)(``),[x,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(new Set),[E,D]=(0,W.useState)(!1),O=e=>{T(t=>{if(E){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}return t.has(e)?new Set:new Set([e])})},k=()=>{E?(D(!1),T(new Set)):(D(!0),T(new Set(A.map(e=>e.id))))},A=(0,W.useMemo)(()=>Oe(i??[]),[i]),j=(0,W.useMemo)(()=>ke(A,_,x),[A,_,x]),M=(0,W.useMemo)(()=>Ae(A),[A]),N=t??`@${e}`,P=(0,G.jsxs)(G.Fragment,{children:[`To add `,e,` to a channel, type`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/invite `,N]}),` `,`inside that Slack channel.`]});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[`Where `,e,` is present`,(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:P})]})}),(0,G.jsx)(f.Body,{className:`flex flex-col gap-3`,children:a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):o?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load channels. Try reopening this page.`}):A.length===0?(0,G.jsx)(K,{icon:(0,G.jsx)(z,{className:`h-6 w-6`}),title:`No channels yet`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,G.jsx)(S,{type:`search`,value:_,onChange:e=>b(e.target.value),placeholder:`Search channels`,"aria-label":`Search channels`,leftIcon:(0,G.jsx)(te,{className:`h-4 w-4`}),fullWidth:!0})}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,role:`group`,"aria-label":`Filter channels by type`,children:Me.map(({value:e,label:t})=>{let r=x===e,i=e===null?A.length:M[e];return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>C(e),className:n(`inline-flex h-6 items-center rounded-full px-2.5 text-body-small-emphasised leading-none transition-colors`,r?`bg-[var(--content-default)] text-[var(--surface-base)]`:`bg-[var(--tag-bg-neutral)] text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)]`),children:[t,` `,i]},e??`all`)})}),(0,G.jsx)(r,{type:`button`,variant:`outlined`,onClick:k,children:E?`Collapse all`:`Expand all`})]}),j.length===0?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`py-4 text-center text-[color:var(--content-tertiary)]`,children:`No channels match.`}):(0,G.jsx)(y.Root,{type:`multiple`,value:[...w],children:j.length>Pe?(0,G.jsx)(`div`,{className:`h-96`,children:(0,G.jsx)(v,{items:j,computeItemKey:(e,t)=>t.id,itemContent:(e,t)=>(0,G.jsx)($,{channel:t,open:w.has(t.id),onToggle:()=>O(t.id),pending:m.has(t.id),overridesLoading:u,overridesError:p,defaultTier:c,accessControls:l,tierOverride:s?.[t.id],onTierChange:e=>h?.(t.id,e),onReset:()=>g?.(t.id)}),className:`h-full`})}):j.map(e=>(0,G.jsx)($,{channel:e,open:w.has(e.id),onToggle:()=>O(e.id),pending:m.has(e.id),overridesLoading:u,overridesError:p,defaultTier:c,accessControls:l,tierOverride:s?.[e.id],onTierChange:t=>h?.(e.id,t),onReset:()=>g?.(e.id)},e.id))})]})}),!a&&!o&&A.length>0?(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Only showing channels `,e,` is in. To remove`,` `,e,` from a channel, use`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/remove `,N]}),` `,`in that Slack channel.`]})}):null]}),l&&!a&&!o&&A.length>0?(0,G.jsx)(De,{assistantName:e}):null]})}function $({channel:e,open:t,pending:r,overridesLoading:i,overridesError:a,defaultTier:o,accessControls:s,tierOverride:c,onToggle:l,onTierChange:u,onReset:d}){let f=Q(e);if(f===`dm`)return null;let h=Ne[f],g=je(e),_=Ce(c),v=_.tier===null?null:X[_.tier],b=o===null?null:X[o];return s?(0,G.jsxs)(y.Item,{value:e.id,className:`[&+&]:border-t [&+&]:border-[var(--border-base)]`,children:[(0,G.jsx)(m,{leading:(0,G.jsx)(h,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,onClick:l,contentAriaLabel:`${e.name} — ${t?`collapse`:`expand`} channel settings`,showChevron:!1,selected:t,trailing:(0,G.jsxs)(G.Fragment,{children:[r?(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`Saving…`}):g==null?null:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:g}),v===null?(0,G.jsx)(x,{children:b===null?`Default`:`${b.label} • default`}):(0,G.jsxs)(x,{tone:v.tone,children:[v.label,` • custom`]}),(0,G.jsx)(p,{"aria-hidden":`true`,className:n(`h-4 w-4 text-[var(--content-tertiary)] transition-transform`,t&&`rotate-180`)})]})}),(0,G.jsx)(y.Content,{children:(0,G.jsx)(we,{channelName:e.name,settings:_,defaultTier:o,loading:i,error:a,onTierChange:u,onReset:d})})]}):(0,G.jsx)(m,{leading:(0,G.jsx)(h,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,trailing:g==null?void 0:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:g})})}var Le=`0.10.7`;function Re(){return k(Le)}function ze(e,t,n){return Z.map(r=>({selector:{scope:`channel`,adapter:e,channelExternalId:t},contactType:r,threshold:n}))}function Be(e,t,n){return e.selector.scope===`channel`&&e.selector.adapter===t&&e.selector.channelExternalId===n}function Ve({assistantId:e,adapter:t}){let n=s(),r=P.use.channelTrustFloors(),i=Re(),a=r&&i&&!!e,o=(0,W.useMemo)(()=>({path:{assistant_id:e}}),[e]),u=(0,W.useMemo)(()=>ae(o),[o]),d=c({...ne(o),enabled:a,select:e=>Se(e.cells,t)}),f=c({queryKey:[`channel-permission-resolve`,e,t],queryFn:async()=>{let{data:e}=await M({...o,body:{adapter:t,contactType:`trusted_contact`},throwOnError:!0});return e.resolved?.threshold??null},enabled:a,retry:!1,staleTime:3e4}),p=(e,r)=>{let i=n.getQueryData(u),a=Date.now();return n.setQueryData(u,n=>({cells:[...(n?.cells??[]).filter(n=>!Be(n,t,e)),...r.map(e=>({...e,updatedAt:a}))]})),{previous:i}},m=l({mutationFn:async({channelExternalId:e,tier:n})=>{await Promise.all(ze(t,e,n).map(e=>j({...o,body:e,throwOnError:!0})))},onMutate:({channelExternalId:e,tier:n})=>p(e,ze(t,e,n)),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to save channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),h=l({mutationFn:async({channelExternalId:e})=>{await Promise.all(Z.map(n=>N({...o,body:{selector:{scope:`channel`,adapter:t,channelExternalId:e},contactType:n},throwOnError:!0})))},onMutate:({channelExternalId:e})=>p(e,[]),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to reset channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),g=(0,W.useMemo)(()=>{let e=new Set;return m.isPending&&m.variables&&e.add(m.variables.channelExternalId),h.isPending&&h.variables&&e.add(h.variables.channelExternalId),e},[m.isPending,m.variables,h.isPending,h.variables]);return a?{supported:!0,tierOverrides:d.data,defaultCellTier:f.data,pendingChannelIds:g,isLoading:d.isPending,isError:d.isError,onTierChange:(e,t)=>m.mutate({channelExternalId:e,tier:t}),onTierReset:e=>{d.data?.[e]!==void 0&&h.mutate({channelExternalId:e})}}:{supported:!1,tierOverrides:void 0,defaultCellTier:void 0,pendingChannelIds:new Set,isLoading:!1,isError:!1,onTierChange:void 0,onTierReset:void 0}}function He({assistantId:e,assistantDisplayName:t,slackHandle:n}){let r=c({...ie(e),enabled:!!e,select:e=>e.channels}),i=Ve({assistantId:e,adapter:`slack`}),a=c({queryKey:[`thresholds`,e],queryFn:()=>se(e),enabled:i.supported&&!!e,staleTime:3e4}).data?.interactive??null,o=i.defaultCellTier===void 0?null:i.defaultCellTier??a;return(0,G.jsx)(Ie,{assistantDisplayName:t,slackHandle:n,accessControlsSupported:i.supported,defaultTier:o,channels:r.data,loading:r.isPending,error:r.isError,tierOverrides:i.tierOverrides,tierOverridesLoading:i.isLoading,tierOverridesError:i.isError,pendingChannelIds:i.pendingChannelIds,onTierChange:i.onTierChange,onTierReset:i.onTierReset})}function Ue({slackHandle:e,disconnectPending:t=!1,onDisconnect:n,children:i}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),e?(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:e}):null,(0,G.jsx)(x,{tone:`positive`,leftIcon:(0,G.jsx)(V,{}),children:`Connected`}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(r,{type:`button`,variant:`ghost`,onClick:n,disabled:!n||t,children:t?`Disconnecting…`:`Disconnect`})})]})}),(0,G.jsx)(f.Body,{children:i})]})}function We({threadMode:e,threadModePending:t=!1,onThreadModeChange:n}){return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Thread Behavior`}),(0,G.jsxs)(_,{value:e??`mention_then_thread`,onValueChange:e=>n?.(e),disabled:t||!n,"aria-label":`Slack thread behavior`,children:[(0,G.jsx)(g,{value:`mention_only`,label:`Mentions only`,helperText:`Bot only responds when @mentioned.`}),(0,G.jsx)(g,{value:`mention_then_thread`,label:`Follow threads after first mention`,helperText:`After an @mention in a thread, bot listens to all subsequent replies.`})]})]})}var Ge={no_one:{title:`Block all messages?`,message:`Setting this channel to “No one” hard-denies every inbound message — including messages from you.
|
|
2
|
+
|
|
3
|
+
You can reverse this at any time.`,confirmLabel:`Block all`,destructive:!0},any_contact:{title:`Allow any contact?`,message:`“Any contact” admits every matched contact in this channel — including pending, unverified ones — not just your verified contacts.
|
|
4
|
+
|
|
5
|
+
Best for channels consisting of only people you already trust.`,confirmLabel:`Allow any contact`},strangers:{title:`Allow strangers?`,message:`Are you sure you want to allow strangers to contact your assistant through this channel?
|
|
6
|
+
|
|
7
|
+
Doing so could cost you money and open you up to security and privacy vulnerabilities.
|
|
8
|
+
|
|
9
|
+
Enable with extreme caution.`,confirmLabel:`Allow strangers`,destructive:!0}},Ke={slack:{label:`Slack`,disconnectMessage:`This clears the stored Slack bot and app tokens for this assistant. You can reconnect later.`,hasTrustFloorControl:!1},telegram:{label:`Telegram`,disconnectMessage:`This clears the stored Telegram bot token for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect a Telegram bot so ${e} can send and receive messages on Telegram.`},phone:{label:`Phone Calling`,disconnectMessage:`This clears the stored Twilio credentials for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect your Twilio account so ${e} can make and answer phone calls.`}};function qe({assistantId:e,assistantName:t,channels:n,pendingChannelKey:r=null,slackThreadMode:i,slackThreadModePending:a=!1,channelPolicies:o,policySavingKey:s=null,policiesLoading:c=!1,policiesError:l=!1,onChannelPolicyChange:u,onSetup:d,onDisconnect:f,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,initialChannel:y=null}){let b=q.use.selectedAdapter(),x=q.use.selectAdapter(),[S,C]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[k]=(0,W.useState)(y);(0,W.useEffect)(()=>{k&&x(k)},[k,x]);let A=H(t),j=S?Ke[S]:null,M=T?Ge[T.policy]:null,N=(e,t)=>{if(Ge[t]){E({channelKey:e,policy:t});return}u?.(e,t)},P=e=>{x(e),O(!1)},F=n.find(e=>e.key===b)??n[0];if(!F)return null;let I=(0,G.jsx)(Je,{channel:F,assistantId:e,assistantName:t,assistantDisplayName:A,pending:r===F.key,initialManualEntry:k===F.key,onSetup:d?()=>d(F.key):void 0,onDisconnect:f?()=>C(F.key):void 0,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,slackThreadMode:i,slackThreadModePending:a,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,policy:o?.[F.key],policySaving:s===F.key,policyLoading:c,policyError:l,onPolicyChange:u?e=>N(F.key,e):void 0},F.key);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden sm:flex-row sm:gap-6`,children:[(0,G.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,G.jsx)(ve,{onClick:()=>O(!0)})}),(0,G.jsx)(ye,{open:D,onClose:()=>O(!1),title:`Channels`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`aside`,{className:`hidden min-h-0 w-[320px] shrink-0 overflow-y-auto self-stretch sm:block`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`section`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:F.key===`slack`?I:(0,G.jsx)(_e,{children:I})})]}),(0,G.jsx)(w,{open:S!==null,title:`Disconnect ${j?.label??``}?`,message:j?.disconnectMessage??``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{S&&f&&f(S),C(null)},onCancel:()=>C(null)}),(0,G.jsx)(w,{open:T!==null,title:M?.title??``,message:M?.message??``,confirmLabel:M?.confirmLabel??`Confirm`,destructive:M?.destructive??!1,onConfirm:()=>{T&&u?.(T.channelKey,T.policy),E(null)},onCancel:()=>E(null)})]})}function Je({channel:e,assistantId:t,assistantName:n,assistantDisplayName:i,pending:a,initialManualEntry:o=!1,onSetup:s,onDisconnect:c,onSaveTelegramToken:l,onSaveSlackConfig:u,slackSaveStatus:d,slackSaveError:f,slackThreadMode:p,slackThreadModePending:m=!1,onSlackThreadModeChange:h,onSaveTwilioCredentials:g,policy:_,policySaving:v=!1,policyLoading:y=!1,policyError:b=!1,onPolicyChange:S}){let C=Ke[e.key],w=e.status===`ready`,[T,E]=(0,W.useState)(o),D=w||T;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.key!==`slack`&&w?(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(x,{tone:`positive`,leftIcon:(0,G.jsx)(V,{}),children:`Connected`}),e.address?(0,G.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.address}):null,(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(r,{type:`button`,variant:`danger`,onClick:c,disabled:!c||a,children:a?`Disconnecting…`:`Disconnect`})})]}):e.key!==`slack`&&!T?(0,G.jsx)(K,{icon:(0,G.jsx)(B,{channelId:e.key,className:`h-6 w-6`}),title:`${R(e.key)} isn't connected`,description:C.disconnectedPitch?.(i),action:(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,G.jsx)(r,{type:`button`,variant:`outlined`,onClick:s,disabled:!s||a,children:a?`Opening…`:`Set up`}),(0,G.jsx)(r,{type:`button`,variant:`link`,onClick:()=>E(!0),children:`or connect manually`})]})}):null,w&&C.hasTrustFloorControl&&S?(0,G.jsx)(Ye,{assistantDisplayName:i,policy:_,saving:v,loading:y,error:b,onChange:S}):null,e.key===`telegram`&&D?(0,G.jsx)(Xe,{onSave:l}):null,e.key===`slack`?w?(0,G.jsx)(Ue,{slackHandle:e.address,disconnectPending:a,onDisconnect:c,children:(0,G.jsx)(We,{threadMode:p,threadModePending:m,onThreadModeChange:h})}):(0,G.jsx)(xe,{children:(0,G.jsx)(re,{assistantName:n,onSave:u,saveStatus:d,saveError:f})}):null,e.key===`slack`&&w?(0,G.jsx)(He,{assistantId:t,assistantDisplayName:i,slackHandle:e.address}):null,e.key===`phone`&&D?(0,G.jsx)(Ze,{onSave:g}):null]})}function Ye({assistantDisplayName:e,policy:t,saving:n=!1,loading:r=!1,error:i=!1,onChange:a}){let o=t??`trusted_contacts`,s=ge(e),c=de.map(e=>({value:e,label:fe[e],tooltip:s[e]}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:[`Who can message `,e]}),r?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load this setting. Try reopening this page.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{style:{maxWidth:280},children:(0,G.jsx)(T,{value:o,onChange:a,options:c,disabled:n,"aria-label":`Who can message ${e}`})}),(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:s[o]}),o===`trusted_contacts`?(0,G.jsxs)(h,{tone:`info`,className:`max-w-lg`,children:[`People you haven’t verified yet — even teammates in the same channel — can’t get through: `,e,` lets them know they need to be verified and notifies you. You can verify people ahead of time in Contacts.`]}):null]})]})}function Xe({onSave:e}){let[t,n]=(0,W.useState)(``),[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(null),c=t.trim().length>0&&!i;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(S,{label:`Bot Token`,type:`password`,value:t,onChange:e=>n(e.target.value),placeholder:`Paste your Telegram bot token`,disabled:i,fullWidth:!0}),o?(0,G.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:o}):null,(0,G.jsx)(`div`,{children:(0,G.jsx)(r,{type:`button`,onClick:async()=>{if(!(!e||!c)){a(!0),s(null);try{await e(t.trim()),n(``)}catch(e){s(e instanceof Error?e.message:`Failed to save`)}finally{a(!1)}}},disabled:!c,children:i?`Saving…`:`Save`})})]})}function Ze({onSave:e}){let[t,n]=(0,W.useState)(``),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),u=t.trim().length>0&&i.trim().length>0&&!o;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(S,{label:`Account SID`,type:`text`,value:t,onChange:e=>n(e.target.value),placeholder:`ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,disabled:o,fullWidth:!0}),(0,G.jsx)(S,{label:`Auth Token`,type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:`Twilio auth token`,disabled:o,fullWidth:!0}),c?(0,G.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:c}):null,(0,G.jsx)(`div`,{children:(0,G.jsx)(r,{type:`button`,onClick:async()=>{if(!(!e||!u)){s(!0),l(null);try{await e(t.trim(),i.trim()),n(``),a(``)}catch(e){l(e instanceof Error?e.message:`Failed to save`)}finally{s(!1)}}},disabled:!u,children:o?`Saving…`:`Save`})})]})}function Qe(){let[e,t]=i(),n=e.get(`setup`),r=n&&I(n)?n:null;return(0,W.useEffect)(()=>{r&&t(e=>(e.delete(`setup`),e),{replace:!0})},[r,t]),r}function $e({assistantId:e,onStartSetupConversation:t}){let n=P.use.a2aChannel(),r=O.use.name(),i=Qe(),a=he(e);return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 overflow-hidden`,children:[(0,G.jsx)(qe,{assistantId:e,assistantName:H(r),initialChannel:i,...pe({assistantId:e,onStartSetupConversation:t})}),n?(0,G.jsx)(ue,{onClick:a.open}):null,(0,G.jsx)(me,{open:a.isOpen,assistantId:e,onClose:a.close})]})}function et(){let e=o(),t=le();return(0,G.jsx)($e,{assistantId:t,onStartSetupConversation:t=>{oe(e,{prompt:t})}},t)}export{et as ChannelsPageRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.previewStartedAt??e.startedAt??void 0}function t(e){return!e.isError&&e.result===void 0&&e.completedAt==null}function n(e){return!e.isError&&!t(e)}function r(e){return e?.webUrl??e?.appUrl}var i=[`choice`,`oauth_connect`,`form`,`confirmation`,`file_upload`,`task_preferences`];function a(e){return e.completed?!1:Array.isArray(e.actions)&&e.actions.length>0||i.includes(e.surfaceType)}var o=new Set([`ui_show`,`ui_update`,`app_open`,`app_create`,`app_update`,`app_refresh`]);function s(e,t){if(e.toolCallId){let r=t?.find(t=>t.id===e.toolCallId);return r?n(r):!0}let r;for(let e of t??[])o.has(e.name)&&(r=e);return r?n(r):!0}function c(e){if(e.surfaceType===`dynamic_page`){let t=e.data;return t?.appId||t?.preview?`inline`:e.display}return`inline`}function l(e,t){if(!e.toolCalls?.length)return e;let n=!1,r=new Map,i=e.toolCalls.map(e=>{let i=t(e);return i!==e&&(n=!0),r.set(i.id,i),i});if(!n)return e;let a=e.contentBlocks?.map(e=>{if(e.type!==`tool_use`)return e;let t=e.toolCall.id;if(t===void 0)return e;let n=r.get(t);return n===void 0||n===e.toolCall?e:{...e,toolCall:n}});return{...e,toolCalls:i,contentBlocks:a}}var u={rate_limit_exceeded:`Too many requests. Please wait a moment and try again.`,invalid_api_key:`The API key for this provider is invalid or expired. Check your API key in Settings → Models & Services.`},d=new Set([`conversation_list_invalidated`,`conversation_title_updated`,`notification_intent`,`navigate_settings`,`open_conversation`,`identity_changed`,`avatar_updated`,`sync_changed`,`disk_pressure_status_changed`,`home_feed_updated`,`relationship_state_updated`,`contact_request`,`subagent_spawned`,`subagent_status_changed`,`subagent_event`,`acp_session_spawned`,`acp_session_update`,`acp_session_usage`,`acp_session_completed`,`acp_session_error`,`background_tool_started`,`background_tool_completed`]);function f(e){return!d.has(e.type)}function p(e){let t=-1;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.role===`assistant`)return t>n;r.role===`user`&&r.queueStatus!==`queued`&&(t=n)}return t!==-1}function m(e){for(let t of e)if(t.surfaces){for(let e of t.surfaces)if(a(e))return!0}return!1}function h(e){return!!e?.some(e=>e.role===`assistant`)}function g({previousConversationId:e,nextConversationId:t,onboardingDraftConversationId:n,autoGreetPending:r,assistantMessagePresent:i}){return e==null||t==null||e===t?!1:!(r&&!i&&e===n)}var _={"not-allowed":`Microphone access was blocked.`,"service-not-allowed":`Microphone access was blocked.`,"not-allowed-permanent":`Microphone access is blocked. Allow microphone access in system or browser settings, then try again.`,"audio-capture":`No microphone detected. Connect a microphone and try again.`,network:`Speech recognition couldn’t reach its service. Check your network and try again.`,aborted:`Recording was interrupted. Try again.`,"stt-not-configured":`Speech-to-text isn’t set up for this assistant. Open Settings → Voice to choose a provider.`,"stt-audio-rejected":`We couldn’t transcribe that recording. Try recording again or speaking more clearly.`,"stt-rate-limited":`Too many transcription requests. Please wait a moment and try again.`,"stt-auth-failed":`The speech-to-text provider rejected the assistant’s credentials. Update the API key in Settings → Voice.`,"stt-provider-error":`The speech-to-text provider is having trouble right now. Try again in a moment.`,"stt-unavailable":`Speech-to-text is temporarily unavailable. Try again in a moment.`,"stt-timeout":`Transcription took too long. Try a shorter recording.`,"native-stt-no-transcript":`macOS dictation didn’t return a transcript. Make sure Dictation is turned on in System Settings → Keyboard → Dictation, then try again.`,"dictation-automation-denied":`Dictation needs Automation permission to paste into other apps.`,"dictation-paste-blocked":`This app doesn't accept dictation; copy and paste manually.`};function v(e){return _[e]??`Voice input failed (${e}). Try again or type your message.`}var y=new Set([`not-allowed`,`service-not-allowed`]);function b(e){return e!==null&&y.has(e)}function x(e){return e===`not-allowed-permanent`}function S(e){return e===`dictation-automation-denied`}var C=new Set([`heartbeat`,`task`,`auto-analysis`]);function w(e){return e.source!==void 0&&C.has(e.source)}function T(e,t,n,r){let i=e[t],a=i.toolCalls[n],o=[...e];return o[t]=l(i,e=>e.id===a.id?{...e,pendingConfirmation:r}:e),{updatedMessages:o,attachedToolCallId:a.id}}function E(e,n){let{toolUseId:r,...i}=n,a=i;if(r)for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n?.toolCalls?.length)continue;let i=n.toolCalls.findIndex(e=>e.id===r);if(i!==-1)return T(e,t,i,a)}for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(r?.role!==`assistant`||!r.toolCalls?.length)){for(let i=r.toolCalls.length-1;i>=0;i--){let o=r.toolCalls[i];if(o&&t(o))return T(e,n,i,a)}break}}return{updatedMessages:e,attachedToolCallId:void 0}}function D(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.toolCalls?.length)for(let e=n.toolCalls.length-1;e>=0;e--){let t=n.toolCalls[e];if(t?.pendingConfirmation)return{...t.pendingConfirmation,toolUseId:t.id}}}return null}function O(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.toolCalls?.length)for(let e=n.toolCalls.length-1;e>=0;e--){let t=n.toolCalls[e];if(t?.pendingQuestion)return{requestId:t.pendingQuestion.requestId,entries:t.pendingQuestion.entries,toolUseId:t.id}}}return null}function k(e,t){if(!e)return t;for(let t of[`command`,`cmd`,`path`,`file`,`url`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.trim()}for(let t of Object.values(e))if(typeof t==`string`&&t.trim())return t.trim();try{let t=JSON.stringify(e);return t.length>120?t.slice(0,117)+`...`:t}catch{return t}}function A(e){return{toolName:e.name,riskLevel:e.riskLevel,riskReason:e.riskReason,input:e.input??{},allowlistOptions:e.riskAllowlistOptions??[],scopeOptions:e.scopeOptions??[],directoryScopeOptions:e.riskDirectoryScopeOptions??[],matchedTrustRuleId:e.matchedTrustRuleId}}var j=60,M=24,N=6e4;function P(e){let t=Math.floor((Date.now()-e)/N);if(t<1)return`just now`;if(t<j)return`${t}m ago`;let n=Math.floor(t/j);return n<M?`${n}h ago`:`${Math.floor(n/M)}d ago`}export{r as C,s as S,e as T,A as _,O as a,c as b,m as c,f as d,b as f,w as g,g as h,D as i,h as l,S as m,E as n,P as o,x as p,k as r,v as s,u as t,p as u,l as v,t as w,a as x,i as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-file-C6oXU5FE.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-BewR0kVT.js","assets/dist-DyRKd0bN2.js","assets/pdf-BjgNZTii.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r,z as i}from"./button-BQVYX8n_.js";import{t as a}from"./preload-helper-BewR0kVT.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-Cqi8q9o7.js";import{t as l}from"./check-CkQjevXL.js";import{t as u}from"./chevron-left-mpHv5ahd.js";import{t as d}from"./chevron-right-DDgSinGu.js";import{o as f}from"./list-row-BvLPXpTK.js";import{t as p}from"./download-f_Ejoz-g.js";import{t as m}from"./eye-off-CG1f2Bnj.js";import{t as h}from"./eye-nshRoUpm.js";import{t as g}from"./file-CVpofSiM.js";import{t as _}from"./key-round-CN4UKztQ.js";import{t as v}from"./loader-circle-Ck8fq3yv.js";import{t as y}from"./x-BYcSiJRX.js";import{g as b,s as x}from"./src-CYX5MuYs.js";import{n as S}from"./toast-Ca-EEKyA.js";import{n as C,t as w}from"./file-markdown-CxCN_Naz.js";import{n as T}from"./resolved-assistants-store-DAzPZ1eV.js";import{l as E,ut as ee}from"./sdk.gen-CFgJ4K6f.js";import{t as D}from"./dist-DyRKd0bN2.js";import{t as O}from"./browser-Cpuuu7D3.js";import{t as k}from"./haptics-DNNGE-Te.js";import{t as te}from"./edge-swipe-arbiter-store-CdpmheQU.js";var A=e(n(),1),ne=e(i(),1),j=s(),M=`width=500,height=600`;function N(e){if(!e)return null;let t;try{let n=typeof window>`u`?`http://localhost`:window.location.origin;t=new URL(e,n)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`?null:t}function P(e){let t=N(e);if(!t)return!1;let n=t.pathname.toLowerCase();return t.searchParams.get(`response_type`)===`code`&&t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)||t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)&&/oauth|authorize|auth/.test(n)}function re(e){if(typeof window>`u`)return null;let t=N(e);return!t||t.origin!==window.location.origin?null:`${t.pathname}${t.search}${t.hash}`}function F(e){return N(e)?.href??null}function I(e){if(!P(e))return!1;if(D.isNativePlatform()){let t=F(e);return t?(O(t),!0):!1}let t=window.open(e,`_blank`,M);return t===null?!1:(t.focus(),!0)}function L(e){return I(e)}function R(e){if(I(e))return!0;let t=window.open(e,`_blank`);return t===null?!1:(t.focus(),!0)}function ie(e,t){let n=re(e);if(n)return t.push(n),{kind:`routed`};let r=F(e);return r?t.isNative?(O(r),{kind:`opened`}):R(r)?{kind:`opened`}:{kind:`blocked`,url:r}:{kind:`invalid`}}async function z(e,t){if(!t||t.startsWith(`rehydrated:`))return null;try{let{data:n,error:r}=await E({path:{assistant_id:e,id:t},parseAs:`blob`,throwOnError:!1});return!r&&n instanceof Blob?n:null}catch{return null}}async function ae(e,t){let{saveFile:n}=await a(async()=>{let{saveFile:e}=await import(`./native-file-C6oXU5FE.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));if(t){let r=await z(t,e.id);if(r){await n(r,e.filename);return}}e.previewUrl&&await n(e.previewUrl,e.filename)}function B(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?Math.round(n).toString():n.toFixed(1)} ${t[r]}`}function oe(e,t){let n=(e||``).toLowerCase(),r=t.split(`.`).pop()?.toLowerCase()??``;return n.startsWith(`image/`)?`image`:n.startsWith(`video/`)?`video`:n.startsWith(`audio/`)?`audio`:n===`application/pdf`||r===`pdf`?`pdf`:n===`application/zip`||n===`application/x-tar`||n===`application/gzip`||[`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`].includes(r)?`archive`:n===`text/csv`||n===`application/vnd.ms-excel`||n===`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`||[`csv`,`xlsx`,`xls`,`numbers`].includes(r)?`spreadsheet`:`ts.tsx.js.jsx.py.rb.go.rs.java.kt.swift.c.cc.cpp.h.hpp.sh.bash.zsh.html.css.scss.json.yaml.yml.toml.xml`.split(`.`).includes(r)?`code`:n===`application/msword`||n===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||[`doc`,`docx`,`pages`].includes(r)?`document`:n.startsWith(`text/`)||[`txt`,`md`,`rtf`].includes(r)?`text`:`file`}function V(e){let t=e.replace(/\s/g,``),n=t.endsWith(`==`)?2:+!!t.endsWith(`=`);return Math.max(0,Math.floor(t.length*3/4)-n)}function H(e){let t=e.match(/;base64,(.*)$/);if(!t?.[1])return null;let n=atob(t[1]),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function U(e,t=28){if(e.length<=t)return e;let n=Math.max(4,Math.floor((t-1)/2));return`${e.slice(0,n)}…${e.slice(e.length-n)}`}var W=1.5,G=20,K=!1;async function q(){let e=await a(()=>import(`./pdf-BjgNZTii.js`),__vite__mapDeps([4,2]));return K||=(e.GlobalWorkerOptions.workerSrc=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${e.version}/legacy/build/pdf.worker.min.mjs`,!0),e}function se({url:e,className:t}){let n=(0,A.useRef)(null),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(0),[s,c]=(0,A.useState)(!0),[l,u]=(0,A.useState)(null),d=(0,A.useRef)(new Map),f=(0,A.useRef)(new Set);(0,A.useEffect)(()=>{let t=!1;async function n(){c(!0),u(null),i(null),o(0),f.current.clear();try{let n=await q(),r;if(e.startsWith(`data:`)){let t=H(e);r=t?{data:t}:e}else r=e;let a=await n.getDocument(r).promise;if(t){a.destroy();return}i(a),o(Math.min(a.numPages,G))}catch{t||u(`Failed to load PDF.`)}finally{t||c(!1)}}return n(),()=>{t=!0}},[e]),(0,A.useEffect)(()=>()=>{r&&r.destroy()},[r]);let p=(0,A.useCallback)(async e=>{if(!r||f.current.has(e))return;let t=d.current.get(e);if(t){f.current.add(e);try{let n=await r.getPage(e),i=n.getViewport({scale:W});t.width=i.width,t.height=i.height,await n.render({canvas:t,viewport:i}).promise}catch{f.current.delete(e)}}},[r]);(0,A.useEffect)(()=>{if(!r||a===0)return;let e=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=Number(t.target.dataset.page);e&&p(e)}},{root:n.current,rootMargin:`200px`});return d.current.forEach(t=>e.observe(t)),()=>e.disconnect()},[r,a,p]);let m=(0,A.useCallback)(e=>t=>{t?d.current.set(e,t):d.current.delete(e)},[]);return s?(0,j.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,j.jsx)(v,{className:`h-8 w-8 animate-spin text-white/70`})}):l?(0,j.jsx)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:l})}):(0,j.jsx)(`div`,{ref:n,className:`flex max-h-[80vh] flex-col items-center gap-2 overflow-y-auto rounded ${t??``}`,children:Array.from({length:a},(e,t)=>(0,j.jsx)(`canvas`,{ref:m(t+1),"data-page":t+1,className:`w-[90vw] max-w-[800px]`,style:{height:`auto`}},t+1))})}function ce({message:e,filename:t,onDownload:n,downloadDisabled:i=!1}){return(0,j.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:e}),(0,j.jsx)(r,{variant:`ghost`,leftIcon:(0,j.jsx)(p,{}),onClick:n,disabled:i,"aria-label":`Download ${t}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}var J=class extends Error{};async function le(e,t,n){if(t>204800)throw new J;if(e.startsWith(`data:`)){let t=H(e);if(!t)throw Error(`Malformed data URI`);return new TextDecoder().decode(t)}let r=await fetch(e,{signal:n});if(!r.ok)throw Error(`Failed to load file: ${r.status}`);let i=await r.blob();if(i.size>204800)throw new J;return i.text()}function ue({url:e,filename:n,mimeType:r,sizeBytes:i}){let[o,s]=(0,A.useState)({status:`loading`});return(0,A.useEffect)(()=>{let n=new AbortController;return s({status:`loading`}),le(e,i,n.signal).then(e=>{n.signal.aborted||s({status:`ready`,text:e})}).catch(e=>{if(n.signal.aborted)return;let r=e instanceof J;r||t(e,{context:`attachment-text-preview`,bestEffort:!0}),s({status:`error`,tooLarge:r})}),()=>n.abort()},[e,i]),o.status===`loading`?(0,j.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,j.jsx)(v,{className:`h-8 w-8 animate-spin text-white/70`})}):o.status===`error`?(0,j.jsx)(ce,{message:o.tooLarge?`File too large to preview inline.`:`Failed to load preview.`,filename:n,onDownload:async()=>{let{saveFile:t}=await a(async()=>{let{saveFile:e}=await import(`./native-file-C6oXU5FE.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await t(e,n)}}):(0,j.jsx)(`div`,{className:`max-h-[80vh] w-[min(90vw,800px)] overflow-auto rounded-lg p-6`,style:{backgroundColor:`var(--surface-overlay)`,color:`var(--content-default)`},children:(0,j.jsx)(de,{text:o.text,filename:n,mimeType:r})})}function de({text:e,filename:t,mimeType:n}){return C(t,n)?(0,j.jsx)(w,{content:e}):(0,j.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-body-small-default`,children:e})}var Y=60,fe=.8,pe=8,me=.35;function he({enabled:e,onPrev:t,onNext:n}){let[r,i]=(0,A.useState)(0),[a,o]=(0,A.useState)(!1),s=(0,A.useRef)(null),c=(0,A.useCallback)(()=>{s.current=null,i(0),o(!1)},[]);return{dragOffset:r,isDragging:a,onTouchStart:(0,A.useCallback)(t=>{if(!e)return;if(t.touches.length!==1){c();return}let n=t.touches[0];s.current={touchId:n.identifier,startX:n.clientX,startY:n.clientY,axis:`undecided`,lastDx:0}},[e,c]),onTouchMove:(0,A.useCallback)(e=>{let t=s.current;if(!t)return;if(e.touches.length!==1){c();return}let n=e.touches[0];if(n.identifier!==t.touchId)return;let r=n.clientX-t.startX,a=n.clientY-t.startY;if(t.lastDx=r,t.axis===`undecided`){if(Math.abs(r)<pe&&Math.abs(a)<pe)return;if(Math.abs(a)>Math.abs(r)*fe){s.current=null;return}t.axis=`horizontal`,o(!0)}if(t.axis!==`horizontal`)return;if(Math.abs(r)<Y&&Math.abs(a)>Math.abs(r)*fe){c();return}let l=Math.sign(r),u=Math.abs(r);i(l*(u<=Y?u:Y+(u-Y)*me))},[c]),onTouchEnd:(0,A.useCallback)(e=>{let r=s.current;if(!r||r.axis!==`horizontal`){c();return}if(e.touches.length>0){c();return}let i=Array.from(e.changedTouches).find(e=>e.identifier===r.touchId),a=i?i.clientX-r.startX:r.lastDx;a<=-Y?(k.light(),n()):a>=Y&&(k.light(),t()),c()},[n,t,c]),onTouchCancel:c}}var ge=new Set([`ts`,`tsx`,`js`,`jsx`,`py`,`json`,`md`,`sh`,`bash`,`html`,`css`,`yaml`,`yml`,`txt`]),_e=new Set([`application/json`,`application/javascript`,`application/xml`]),ve=e=>{let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?``:e.slice(t+1).toLowerCase()},ye=({open:e,onClose:t,attachment:n,assistantId:i,siblingAttachments:s,onNavigate:l})=>{let f=(0,A.useRef)(null);(0,A.useEffect)(()=>{e&&f.current?.focus()},[e]);let m=te.use.registerBackOwner(),h=te.use.unregisterBackOwner();(0,A.useEffect)(()=>{if(e)return m(),()=>h()},[e,m,h]);let _=!n.previewUrl&&n.id.startsWith(`rehydrated:`),b=e&&!n.previewUrl&&!!i&&!!n.id&&!_,{data:x,isError:S}=o({queryKey:[`attachmentContent`,i,n.id],queryFn:async()=>{let e=await z(i,n.id);if(!e)throw Error(`Failed to load file`);return e},enabled:b,staleTime:1/0,retry:!1}),[C,w]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(!x){w(null);return}let e=URL.createObjectURL(x);return w(e),()=>{URL.revokeObjectURL(e),w(null)}},[x]);let T=n.previewUrl??C,[E,ee]=(0,A.useState)(null),D=b&&!C&&!S,O=_?`Preview unavailable — file content was not preserved in chat history.`:S?`Failed to load preview.`:null,k=(0,A.useMemo)(()=>!s||s.length<=1?-1:s.findIndex(e=>e.id===n.id),[s,n.id]),M=k!==-1&&s!=null&&s.length>1,N=(0,A.useCallback)(()=>{!M||!s||!l||l(s[(k-1+s.length)%s.length])},[M,s,k,l]),P=(0,A.useCallback)(()=>{!M||!s||!l||l(s[(k+1)%s.length])},[M,s,k,l]),{dragOffset:re,isDragging:F,onTouchStart:I,onTouchMove:L,onTouchEnd:R,onTouchCancel:ie}=he({enabled:M,onPrev:N,onNext:P}),ae=(0,A.useCallback)(e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowLeft`&&M?(e.preventDefault(),N()):e.key===`ArrowRight`&&M&&(e.preventDefault(),P())},[t,N,P,M]),oe=(0,A.useCallback)(e=>{e.target===f.current&&t()},[t]),V=(0,A.useCallback)(async()=>{if(!T)return;let{saveFile:e}=await a(async()=>{let{saveFile:e}=await import(`./native-file-C6oXU5FE.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await e(T,n.filename)},[T,n.filename]);if(!e)return null;let H=n.mimeType.toLowerCase(),U=H.startsWith(`image/`),W=H.startsWith(`video/`),G=H===`application/pdf`||H===`application/octet-stream`&&n.filename.toLowerCase().endsWith(`.pdf`),K=ve(n.filename),q=H.startsWith(`text/`)||_e.has(H)||ge.has(K);return(0,ne.createPortal)((0,j.jsxs)(`div`,{ref:f,role:`dialog`,"aria-modal":`true`,"aria-label":`Preview of ${n.filename}`,tabIndex:-1,className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/80 outline-none [-webkit-app-region:no-drag]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},onKeyDown:ae,onClick:oe,children:[(0,j.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-center gap-3 px-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`},children:[(0,j.jsx)(c,{variant:`body-small-default`,className:`w-11 shrink-0 truncate text-white/50`,children:B(n.sizeBytes)}),(0,j.jsx)(c,{as:`div`,variant:`body-medium-lighter`,className:`min-w-0 flex-1 truncate text-center text-white/90`,children:n.filename}),(0,j.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,j.jsx)(r,{variant:`ghost`,iconOnly:(0,j.jsx)(p,{}),expandOnMobile:!1,onClick:V,disabled:!T,"aria-label":`Download ${n.filename}`,className:`h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,j.jsx)(r,{variant:`ghost`,iconOnly:(0,j.jsx)(y,{}),expandOnMobile:!1,onClick:t,"aria-label":`Close preview`,className:`h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]})]}),M&&(0,j.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-0 top-1/2 z-10 flex -translate-y-1/2 items-center justify-between px-4`,children:[(0,j.jsx)(r,{variant:`ghost`,iconOnly:(0,j.jsx)(u,{}),expandOnMobile:!1,onClick:N,"aria-label":`Previous attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,j.jsx)(r,{variant:`ghost`,iconOnly:(0,j.jsx)(d,{}),expandOnMobile:!1,onClick:P,"aria-label":`Next attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]}),(0,j.jsx)(`div`,{className:`flex items-center justify-center`,style:{transform:`translateX(${re}px)`,transition:F?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onClick:e=>e.stopPropagation(),onTouchStart:I,onTouchMove:L,onTouchEnd:R,onTouchCancel:ie,children:D?(0,j.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,j.jsx)(v,{className:`h-8 w-8 animate-spin text-white/70`})}):O?(0,j.jsx)(ce,{message:O,filename:n.filename,onDownload:V,downloadDisabled:!T}):G&&T?(0,j.jsx)(se,{url:T}):U&&T&&E!==T?(0,j.jsx)(`img`,{src:T,alt:n.filename,onError:()=>ee(T),className:`max-h-[80vh] max-w-[90vw] rounded object-contain`}):W&&T?(0,j.jsx)(`video`,{"data-testid":`video-preview`,src:T,poster:n.thumbnailUrl??void 0,controls:!0,className:`max-h-[80vh] max-w-[90vw] rounded`}):q&&T?(0,j.jsx)(ue,{url:T,filename:n.filename,mimeType:n.mimeType,sizeBytes:n.sizeBytes}):(0,j.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,j.jsx)(g,{className:`h-16 w-16 text-white/60`}),(0,j.jsx)(`p`,{className:`mt-4 text-body-medium-default text-white/90`,children:n.filename}),(0,j.jsx)(`p`,{className:`mt-1 text-body-small-default text-white/60`,children:B(n.sizeBytes)}),(0,j.jsx)(r,{variant:`ghost`,leftIcon:(0,j.jsx)(p,{}),onClick:V,disabled:!T,"aria-label":`Download ${n.filename}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}),M&&(0,j.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 z-10 flex justify-center`,style:{paddingBottom:`calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + 2rem)`},onClick:e=>e.stopPropagation(),children:(0,j.jsxs)(c,{variant:`body-small-default`,className:`text-white/50`,children:[k+1,` / `,s.length]})})]}),document.body)};function be(e,t){let[n,r]=(0,A.useState)(null),i=(0,A.useCallback)(e=>r(e),[]),a=(0,A.useCallback)(()=>r(null),[]),o=(0,A.useCallback)(e=>r(e),[]);return{openPreview:i,previewModal:n?(0,j.jsx)(ye,{open:!0,onClose:a,attachment:n,assistantId:e,siblingAttachments:t,onNavigate:o}):null}}var xe=1500,X=`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-lg bg-[var(--surface-overlay)] px-2 py-1 align-middle text-[0.85em] leading-tight text-[var(--content-secondary)]`,Z=`shrink-0 rounded-sm p-0.5 text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--border-focus)]`;function Se({type:e,service:t,field:n,assistantId:r,neutralized:i}){let a=T.use.activeAssistantId(),o=r===void 0?a:r,[s,c]=(0,A.useState)(null),[u,d]=(0,A.useState)(!1),[p,g]=(0,A.useState)(!1),y=(0,A.useRef)(null),b=(0,A.useRef)(0),x=e??`Secret`,C=t!==void 0&&n!==void 0&&o!=null,w=C?`${t}:${n}`:x,E=(0,A.useCallback)(()=>{b.current++,c(null),d(!1),g(!1),y.current&&=(clearTimeout(y.current),null)},[]),D=(0,A.useCallback)(async()=>{if(!C)return;let e=++b.current;d(!0);try{let{data:r}=await ee({path:{assistant_id:o},body:{service:t,field:n},throwOnError:!0});b.current===e&&c(r.value)}catch{b.current===e&&S.error(`Couldn't reveal ${w}.`)}finally{b.current===e&&d(!1)}},[C,o,t,n,w]),O=(0,A.useCallback)(()=>{s!=null&&navigator.clipboard.writeText(s).then(()=>{g(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>g(!1),xe)},()=>S.error(`Couldn't copy — reveal and copy manually.`))},[s]);if(i)return(0,j.jsxs)(`span`,{className:X,title:`Redaction marker — not verified by the assistant`,children:[(0,j.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,j.jsx)(`span`,{className:`truncate`,children:`Redacted`})]});if(!C)return(0,j.jsxs)(`span`,{className:X,title:`Redacted — this value is not linked to a stored credential`,children:[(0,j.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,j.jsx)(`span`,{className:`truncate`,children:x})]});let k=s!==null;return(0,j.jsxs)(`span`,{className:X,children:[(0,j.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),k?(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[var(--content-default)]`,children:s}):(0,j.jsx)(`button`,{type:`button`,onClick:()=>void D(),disabled:u,"aria-label":`Reveal value for ${w}`,title:`${x} · click to reveal`,className:`min-w-0 select-none truncate rounded-sm text-left blur-[3px] transition-[filter] hover:blur-[2px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--border-focus)]`,children:w}),u?(0,j.jsx)(v,{className:`h-3.5 w-3.5 shrink-0 animate-spin`,"aria-hidden":!0}):k?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,onClick:O,"aria-label":`Copy value for ${w}`,title:`Copy value`,className:Z,children:p?(0,j.jsx)(l,{className:`h-3.5 w-3.5`,"aria-hidden":!0}):(0,j.jsx)(f,{className:`h-3.5 w-3.5`,"aria-hidden":!0})}),(0,j.jsx)(`button`,{type:`button`,onClick:E,"aria-label":`Hide value for ${w}`,title:`Hide value`,className:Z,children:(0,j.jsx)(m,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]}):(0,j.jsx)(`button`,{type:`button`,onClick:()=>void D(),disabled:u,"aria-label":`Reveal value for ${w}`,title:`Click to reveal`,className:Z,children:(0,j.jsx)(h,{className:`h-3.5 w-3.5`,"aria-hidden":!0})})]})}var Ce=`redacted`;function we(e){try{return decodeURIComponent(e)}catch{return}}function Te(){return RegExp(`〔${Ce}:([^:\u3014\u3015]+?)(?::([A-Za-z0-9_.%-]+):([A-Za-z0-9_.%-]+))?〕`,`g`)}function Ee(){return RegExp(`〔\\u2060${Ce}:([^:\\u3014\\u3015]+?)(?::([A-Za-z0-9_.%-]+):([A-Za-z0-9_.%-]+))?〕`,`g`)}function De(e){let[,t,n,r]=e;if(n!==void 0&&r!==void 0){let e=we(n),i=we(r);if(e!==void 0&&i!==void 0)return{type:t,service:e,field:i}}return{type:t}}var Q=`redacted-credential`,Oe=new Set([`pre`,`code`,`style`,`script`,`a`]);function ke(e){return e.type===`element`}function Ae(e){let t=[],n=Te(),r;for(;(r=n.exec(e))!==null;){let e=De(r);t.push({index:r.index,length:r[0].length,element:{type:`element`,tagName:Q,properties:{type:e.type,...e.service!==void 0&&e.field!==void 0?{service:e.service,field:e.field}:{}},children:[]}})}let i=Ee();for(;(r=i.exec(e))!==null;)t.push({index:r.index,length:r[0].length,element:{type:`element`,tagName:Q,properties:{neutralized:!0},children:[]}});if(t.length===0)return;t.sort((e,t)=>e.index-t.index);let a=[],o=0;for(let n of t)n.index>o&&a.push({type:`text`,value:e.slice(o,n.index)}),a.push(n.element),o=n.index+n.length;return o<e.length&&a.push({type:`text`,value:e.slice(o)}),a}function je(e){if(ke(e)&&Oe.has(e.tagName))return;let t=e.children;if(t)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type!==`text`){je(n);continue}let r=n.value;if(!r.includes(`〔`))continue;let i=Ae(r);i&&t.splice(e,1,...i)}}function Me(){return e=>{je(e)}}var Ne=new Set([`pre`,`code`,`style`,`script`]),Pe=5,$=.4,Fe=`stream-word-fade`;function Ie(e){return e.type===`element`}function Le(e){if(Ie(e)&&Ne.has(e.tagName))return;let t=e.children;if(t)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type!==`text`){Le(n);continue}let r=n.value.match(/\S+|\s+/g);if(!r||r.length===1&&/^\s+$/.test(r[0]))continue;let i=r.map(e=>/^\s+$/.test(e)?{type:`text`,value:e}:{type:`element`,tagName:`span`,properties:{className:[Fe]},children:[{type:`text`,value:e}]});t.splice(e,1,...i)}}function Re(e,t){if(Ie(e)){let n=e.properties?.className;if(Array.isArray(n)&&n.includes(Fe)){t.push(e);return}}if(e.children)for(let n of e.children)Re(n,t)}function ze(e){let t=e?.caughtUp??!1;return e=>{if(Le(e),t)return;let n=[];Re(e,n);let r=Math.min(Pe,n.length);for(let e=0;e<r;e++){let t=n[n.length-1-e],r=($+(1-$)*((e+1)/(Pe+1))).toFixed(3);t.properties={...t.properties,style:`opacity:${r}`}}}}function Be(e){return e!=null&&(e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`))}function Ve(e){return e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`)?e:b(e)}function He({href:e,children:t}){return(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:P(e)?void 0:`noopener noreferrer`,onClick:t=>{L(e)&&t.preventDefault()},className:`text-[var(--system-positive-strong)] underline hover:opacity-80`,children:t})}var Ue=`my-2 max-w-full max-h-[400px] rounded-lg border border-[var(--border-default)] object-contain`;function We({alt:e}){return(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Image failed to load`,e?` (${e})`:``]})}function Ge({src:e,alt:t}){let[n,r]=(0,A.useState)(!1);return n?(0,j.jsx)(We,{alt:t}):(0,j.jsx)(`img`,{src:e,alt:t,onError:()=>r(!0),className:Ue})}function Ke(e){try{return decodeURIComponent(e)}catch{return e}}function qe({src:e,alt:n,attachments:r,assistantId:i,onOpenPreview:a}){let[o,s]=(0,A.useState)(null),[c,l]=(0,A.useState)(!1),u=Ke(e.split(`/`).pop()??``),d=r?.find(e=>e.filename===u);if((0,A.useEffect)(()=>{if(!d||!i||d.id.startsWith(`rehydrated:`))return;let e=!1;return(async()=>{try{let{data:t,error:n}=await E({path:{assistant_id:i,id:d.id},parseAs:`blob`,throwOnError:!1});if(e)return;if(n||!(t instanceof Blob)){l(!0);return}s(URL.createObjectURL(t))}catch(n){e||(l(!0),t(n,{context:`WorkspaceInlineImage`,bestEffort:!0}))}})(),()=>{e=!0,s(e=>(e&&URL.revokeObjectURL(e),null))}},[d,i]),c||!d&&!o)return(0,j.jsx)(We,{alt:n||u});if(!o)return(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Loading image…`,n?` (${n})`:``]});let f=(0,j.jsx)(`img`,{src:o,alt:n,className:Ue});return!d||!a?f:(0,j.jsx)(`button`,{type:`button`,onClick:()=>a(d),className:`cursor-zoom-in appearance-none border-0 bg-transparent p-0`,"aria-label":n?`Expand image: ${n}`:`Expand image`,children:f})}var Je=(0,A.memo)(function({content:e,className:t,hardLineBreaks:n,onVellumLinkClick:r,attachments:i,assistantId:a,streamWordFade:o,redactedCredentialChips:s}){let{openPreview:c,previewModal:l}=be(a,i),u=(0,A.useCallback)(({href:e,children:t})=>r&&Be(e)?(0,j.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),e&&r(e,t.currentTarget.textContent??``)},className:`text-[var(--system-positive-strong)] underline hover:opacity-80 cursor-pointer`,children:t}):(0,j.jsx)(He,{href:e,children:t}),[r]),d=(0,A.useMemo)(()=>[...s?[Me]:[],...o?[[ze,{caughtUp:o===`caughtUp`}]]:[]],[s,o]),f=(0,A.useMemo)(()=>({src:e,alt:t})=>Be(e)?(0,j.jsx)(qe,{src:e,alt:t,attachments:i,assistantId:a,onOpenPreview:c}):(0,j.jsx)(Ge,{src:e,alt:t}),[i,a,c]),p=(0,A.useMemo)(()=>({[Q]:e=>(0,j.jsx)(Se,{...e,assistantId:a},`${a??``}\u0000${e.service??``}\u0000${e.field??``}`)}),[a]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(x,{content:e,className:t,hardLineBreaks:n,linkComponent:u,imageComponent:f,urlTransform:Ve,extraRehypePlugins:d,extraComponents:s?p:void 0}),l]})});export{V as a,ae as c,R as d,oe as i,z as l,be as n,B as o,ye as r,U as s,Je as t,ie as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{P as n,R as r}from"./button-BQVYX8n_.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-Cqi8q9o7.js";import{t as o}from"./createLucideIcon-Bjb-Kuq7.js";import{t as s}from"./check-CkQjevXL.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-Df9Kbc9v.js";var m=o(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),h=e(t(),1);function g(e){let t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _(e){let[t,n]=h.useState(void 0);return c(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var v=i(),y=`Checkbox`,[b,x]=f(y),[S,C]=b(y);function w(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=l({prop:n,defaultProp:i??!1,onChange:c,caller:y}),[g,_]=h.useState(null),[b,x]=h.useState(null),C=h.useRef(!1),w=g?!!o||!!g.closest(`form`):!0,T={checked:p,disabled:a,setChecked:m,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:C,required:u,defaultChecked:N(i)?!1:i,isFormControl:w,bubbleInput:b,setBubbleInput:x};return(0,v.jsx)(S,{scope:t,...T,children:M(f)?f(T):r})}var T=`CheckboxTrigger`,E=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},a)=>{let{control:o,value:s,disabled:c,checked:l,required:d,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:_,bubbleInput:y}=C(T,e),b=r(a,f),x=h.useRef(l);return h.useEffect(()=>{let e=o?.form;if(e){let t=()=>m(x.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,m]),(0,v.jsx)(p.button,{type:`button`,role:`checkbox`,"aria-checked":N(l)?`mixed`:l,"aria-required":d,"data-state":P(l),"data-disabled":c?``:void 0,disabled:c,value:s,...i,ref:b,onKeyDown:u(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:u(n,e=>{m(e=>N(e)?!0:!e),y&&_&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})});E.displayName=T;var D=h.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(w,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(E,{...d,ref:t,__scopeCheckbox:n}),e&&(0,v.jsx)(j,{__scopeCheckbox:n})]})})});D.displayName=y;var O=`CheckboxIndicator`,k=h.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=C(O,n);return(0,v.jsx)(d,{present:r||N(a.checked)||a.checked===!0,children:(0,v.jsx)(p.span,{"data-state":P(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});k.displayName=O;var A=`CheckboxBubbleInput`,j=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:m,setBubbleInput:y}=C(A,e),b=r(n,y),x=g(o),S=_(i);h.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(x!==o&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=N(o),n.call(e,N(o)?!1:o),e.dispatchEvent(t)}},[m,x,o,a]);let w=h.useRef(N(o)?!1:o);return(0,v.jsx)(p.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??w.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:b,style:{...t.style,...S,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});j.displayName=A;function M(e){return typeof e==`function`}function N(e){return e===`indeterminate`}function P(e){return N(e)?`indeterminate`:e?`checked`:`unchecked`}function F({checked:e,onCheckedChange:t,label:r,helperText:i,disabled:o=!1,id:c,name:l,className:u,ref:d,"aria-label":f,...p}){let g=(0,h.useId)(),_=c??g,y=r?`${_}-label`:void 0,b=i?`${_}-helper`:void 0,x=e===`indeterminate`,S=n(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px]`,`border transition-colors outline-none cursor-pointer`,`keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)] keyboard-focus:ring-offset-0`,`bg-[var(--surface-lift)] border-[var(--border-base)]`,`data-[state=checked]:bg-[var(--system-positive-strong)] data-[state=checked]:border-transparent`,`data-[state=indeterminate]:bg-[var(--system-positive-strong)] data-[state=indeterminate]:border-transparent`,`disabled:cursor-not-allowed disabled:bg-[var(--surface-overlay)]`,`disabled:data-[state=checked]:bg-[var(--surface-overlay)]`,`disabled:data-[state=indeterminate]:bg-[var(--surface-overlay)]`,`disabled:border-[var(--border-base)]`),C=n(`h-3 w-3`,o?`text-[color:var(--content-disabled)]`:`text-[color:var(--aux-white)]`),w=(0,v.jsx)(D,{...p,ref:d,id:_,name:l,checked:e,disabled:o,onCheckedChange:t,"aria-label":r?void 0:f,"aria-labelledby":r?y:void 0,"aria-describedby":b,"data-slot":`checkbox`,className:S,children:(0,v.jsx)(k,{forceMount:!0,className:`flex items-center justify-center`,children:x?(0,v.jsx)(m,{className:C,strokeWidth:3,"aria-hidden":`true`}):e===!0?(0,v.jsx)(s,{className:C,strokeWidth:3,"aria-hidden":`true`}):null})});return!r&&!i?(0,v.jsx)(`span`,{"data-slot":`checkbox`,className:u,children:w}):(0,v.jsxs)(`div`,{"data-slot":`checkbox`,className:n(`flex gap-2.5`,i?`items-start`:`items-center`,u),children:[w,(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[r?(0,v.jsx)(a,{as:`label`,variant:`body-medium-default`,id:y,htmlFor:_,className:n(`cursor-pointer select-none`,o?`cursor-not-allowed text-[color:var(--content-disabled)]`:`text-[color:var(--content-default)]`),children:r}):null,i?(0,v.jsx)(`span`,{id:b,className:`text-body-small-default text-[color:var(--content-secondary)]`,children:i}):null]})]})}export{F as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./preload-helper-BewR0kVT.js";var r=e(t(),1),i=e=>{throw TypeError(e)},a=(e,t,n)=>t.has(e)||i(`Cannot `+n),o=(e,t,n)=>(a(e,t,`read from private field`),n?n.call(e):t.get(e)),s=(e,t,n)=>t.has(e)?i(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),c=(e,t,n,r)=>(a(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),l=`popstate`;function u(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function d(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return g(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:_(t)}return y(t,n,null,e)}function f(e,t){if(e===!1||e==null)throw Error(t)}function p(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function m(){return Math.random().toString(36).substring(2,10)}function h(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function g(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?v(t):t,state:n,key:t&&t.key||r||m(),mask:i}}function _({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function v(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function y(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-d;d=e,c&&c({action:s,location:y.location,delta:t})}function m(e,t){s=`PUSH`;let r=u(e)?e:g(y.location,e,t);n&&n(r,e),d=f()+1;let l=h(r,d),p=y.createHref(r.mask||r);try{o.pushState(l,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&c&&c({action:s,location:y.location,delta:1})}function _(e,t){s=`REPLACE`;let r=u(e)?e:g(y.location,e,t);n&&n(r,e),d=f();let i=h(r,d),l=y.createHref(r.mask||r);o.replaceState(i,``,l),a&&c&&c({action:s,location:y.location,delta:0})}function v(e){return b(e)}let y={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(l,p),c=e,()=>{i.removeEventListener(l,p),c=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:_,go(e){return o.go(e)}};return y}function b(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),f(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:_(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function x(e){return{defaultValue:e}}var S,C=class{constructor(e){if(s(this,S,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(o(this,S).has(e))return o(this,S).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){o(this,S).set(e,t)}};S=new WeakMap;var w=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function T(e){return w.has(e)}var E=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function D(e){return E.has(e)}function O(e){return e.index===!0}function k(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(f(e.index!==!0||!e.children,`Cannot specify children on an index route`),f(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),O(e)){let n={...e,id:s};return r[s]=A(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=A(n,t(n)),e.children&&(n.children=k(e.children,t,o,r,i)),n}})}function A(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function j(e,t,n=`/`){return M(e,t,n,!1)}function M(e,t,n,r,i){let a=z((typeof t==`string`?v(t):t).pathname||`/`,n);if(a==null)return null;let o=i??N(e),s=null,c=R(a);for(let e=0;s==null&&e<o.length;++e)s=L(o[e],c,r);return s}function ee(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N(e){let t=te(e);return ne(t),t}function te(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;f(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=H([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(f(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),te(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ce(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of P(e.path))a(e,t,!0,n)}),t}function P(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=P(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ne(e){e.sort((e,t)=>e.score===t.score?le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var re=/^:[\w-]+$/,F=3,ie=2,ae=1,oe=10,I=-2,se=e=>e===`*`;function ce(e,t){let n=e.split(`/`),r=n.length;return n.some(se)&&(r+=I),t&&(r+=ie),n.filter(e=>!se(e)).reduce((e,t)=>e+(re.test(t)?F:t===``?ae:oe),r)}function le(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function L(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:H([a,u.pathname]),pathnameBase:be(H([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=H([a,u.pathnameBase]))}return o}function ue(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=de(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function de(e,t=!1,n=!0){p(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function R(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return p(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function z(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function fe({basename:e,pathname:t}){return t===`/`?e:H([e,t])}var pe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,me=e=>pe.test(e);function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?v(e):e,a;return n?(n=ye(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:xe(r),hash:Se(i)}}function ge(e,t){let n=U(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function B(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function V(e,t,n,r=!1){let i;typeof e==`string`?i=v(e):(i={...e},f(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),f(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),f(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ye=e=>e.replace(/\/\/+/g,`/`),H=e=>ye(e.join(`/`)),U=e=>e.replace(/\/+$/,``),be=e=>U(e).replace(/^\/*/,`/`),xe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Se=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ce=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},we=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Te(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ee(e){return H(e.map(e=>e.route.path).filter(Boolean))||`/`}var De=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Oe(e,t){let n=e;if(typeof n!=`string`||!pe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(De)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=z(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{p(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var W=Symbol(`Uninstrumented`);function ke(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=je(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=je(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[W]??i,a=je(n[e],t,(...e)=>G(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[W]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[W]??e,r=je(n.middleware,t,(...e)=>G(e[0]));return r?(r[W]=t,r):e})),r}function Ae(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[W]??e.navigate,r=je(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?_(n):`.`,...K(e,r??{})}});r&&(r[W]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[W]??e.fetch,r=je(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...K(e,i??{})}});r&&(r[W]=t,e.fetch=r)}return e}function je(e,t,n){return e.length===0?null:async(...r)=>{let i=await Me(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Me(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Me(e,t,n,r-1),a=await o,f(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function G(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Ne(t),params:{...r},pattern:i,context:Pe(n)}}function K(e,t){return{currentUrl:_(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Ne(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Pe(e){if(Ie(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Fe=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ie(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Fe}var q=[`POST`,`PUT`,`PATCH`,`DELETE`],Le=new Set(q),Re=[`GET`,...q],ze=new Set(Re),Be=new Set([301,302,303,307,308]),Ve=new Set([307,308]),He={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},We={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Ge=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ke=`remix-router-transitions`,qe=Symbol(`ResetLoaderData`),Je,Ye,Xe,Ze,Qe=class{constructor(e){s(this,Je),s(this,Ye),s(this,Xe),s(this,Ze),c(this,Je,e),c(this,Ye,N(e))}get stableRoutes(){return o(this,Je)}get activeRoutes(){return o(this,Xe)??o(this,Je)}get branches(){return o(this,Ze)??o(this,Ye)}get hasHMRRoutes(){return o(this,Xe)!=null}setRoutes(e){c(this,Je,e),c(this,Ye,N(e))}setHmrRoutes(e){c(this,Xe,e),c(this,Ze,N(e))}commitHmrRoutes(){o(this,Xe)&&(c(this,Je,o(this,Xe)),c(this,Ye,o(this,Ze)),c(this,Xe,void 0),c(this,Ze,void 0))}};Je=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,Ze=new WeakMap;function $e(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;f(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Ge,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...ke(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Qe(k(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||gt,u={...e.future},d=null,m=new Set,h=null,_=null,y=null,x=e.hydrationData!=null,S=M(s.activeRoutes,e.history.location,c,!1,s.branches),w=!1,T=null,E,D;if(S==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=zt(s.activeRoutes);E=!0,D=!E,S=n,T={[r.id]:t}}else if(S&&!e.hydrationData&&ot(S,s.activeRoutes,e.history.location.pathname).active&&(S=null),!S){E=!1,D=!E,S=[];let t=ot(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(w=!0,S=t.matches)}else if(S.some(e=>e.route.lazy))E=!1,D=!E;else if(!S.some(e=>it(e.route)))E=!0,D=!E;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=S;if(n){let e=S.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}D=!1,E=!0,r.forEach(e=>{let r=at(e.route,t,n);D||=r.renderFallback,E&&=!r.shouldLoad})}let O,A={historyAction:e.history.action,location:e.history.location,matches:S,initialized:E,renderFallback:D,navigation:He,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},j=`POP`,N=null,te=!1,P,ne=!1,re=new Map,F=null,ie=!1,ae=!1,oe=new Set,I=new Map,se=0,ce=-1,le=new Map,L=new Set,ue=new Map,de=new Map,R=new Set,fe=new Map,pe,he=null;function ge(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}p(fe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Je({currentLocation:A.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),qe(i,{state:`blocked`,location:n,proceed(){qe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(A.blockers);e.set(i,We),B({blockers:e})}}),N?.resolve(),N=null;return}return U(t,n)}),n){cn(t,re);let e=()=>ln(t,re);t.addEventListener(`pagehide`,e),F=()=>t.removeEventListener(`pagehide`,e)}return A.initialized||U(`POP`,A.location,{initialHydration:!0}),O}function _e(){d&&d(),F&&F(),m.clear(),P&&P.abort(),A.fetchers.forEach((e,t)=>Fe(t)),A.blockers.forEach((e,t)=>Ke(t))}function ve(e){return m.add(e),()=>m.delete(e)}function B(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),A={...A,...e};let n=[],r=[];A.fetchers.forEach((e,t)=>{e.state===`idle`&&(R.has(t)?n.push(t):r.push(t))}),R.forEach(e=>{!A.fetchers.has(e)&&!I.has(e)&&n.push(e)}),[...m].forEach(r=>r(A,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Fe(e)),r.forEach(e=>A.fetchers.delete(e))}function V(t,n,{flushSync:r}={}){let i=A.actionData!=null&&A.navigation.formMethod!=null&&X(A.navigation.formMethod)&&A.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?A.actionData:null;let o=n.loaderData?It(A.loaderData,n.loaderData,n.matches||[],n.errors):A.loaderData,c=A.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,We)));let l=ie?!1:et(t,n.matches||A.matches),u=te===!0||A.navigation.formMethod!=null&&X(A.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ie||j===`POP`||(j===`PUSH`?e.history.push(t,t.state):j===`REPLACE`&&e.history.replace(t,t.state));let d;if(j===`POP`){let e=re.get(A.location.pathname);e&&e.has(t.pathname)?d={currentLocation:A.location,nextLocation:t}:re.has(t.pathname)&&(d={currentLocation:t,nextLocation:A.location})}else if(ne){let e=re.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),re.set(A.location.pathname,e)),d={currentLocation:A.location,nextLocation:t}}B({...n,actionData:a,loaderData:o,historyAction:j,location:t,initialized:!0,renderFallback:!1,navigation:He,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),j=`POP`,te=!1,ne=!1,ie=!1,ae=!1,N?.resolve(),N=null,he?.resolve(),he=null}async function ye(t,n){if(N?.resolve(),N=null,typeof t==`number`){N||=un();let n=N.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=nt(!1,tt(A.location,A.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?v(n.mask):{...A.location.mask,...n.mask}});let s=A.location,l=g(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&X(i.formMethod)&&i.formAction===A.location.pathname+A.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Je({currentLocation:s,nextLocation:l,historyAction:d});if(m){qe(m,{state:`blocked`,location:l,proceed(){qe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),ye(t,n)},reset(){let e=new Map(A.blockers);e.set(m,We),B({blockers:e})}});return}await U(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function H(){he||=un(),Me(),B({revalidation:`loading`});let e=he.promise;return A.navigation.state===`submitting`?e:A.navigation.state===`idle`?(U(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),e):(U(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:ne===!0}),e)}async function U(t,n,r){P&&P.abort(),P=null,j=t,ie=(r&&r.startUninterruptedRevalidation)===!0,$e(A.location,A.matches),te=(r&&r.preventScrollReset)===!0,ne=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r&&r.overrideNavigation,o=r?.initialHydration&&A.matches&&A.matches.length>0&&!w?A.matches:M(i,n,c,!1,s.branches),l=(r&&r.flushSync)===!0;if(o&&A.initialized&&!ae&&Ht(A.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){V(n,{matches:o},{flushSync:l});return}let u=ot(o,i,n.pathname);if(u.active&&u.matches&&(o=u.matches),!o){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);V(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:l});return}P=new AbortController;let d=At(e.history,n,P.signal,r&&r.submission),f=e.getContext?await e.getContext():new C,p;if(r&&r.pendingError)p=[Rt(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let t=await be(d,n,r.submission,o,f,u.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:l});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Y(r)&&Te(r.error)&&r.error.status===404){P=null,V(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,p=t.pendingActionResult,a=nn(n,r.submission),l=!1,u.active=!1,d=At(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_}=await xe(d,n,o,f,u.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,l,p,r&&r.callSiteDefaultShouldRevalidate);m||(P=null,V(n,{matches:h||o,...Lt(p),loaderData:g,errors:_}))}async function be(t,n,i,l,u,d,f,p={}){if(Me(),B({navigation:rn(n,i)},{flushSync:p.flushSync===!0}),d){let e=await st(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=zt(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Rt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ye(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=en(l,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:J(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await W(t,n,St(a,o,t,n,l,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of l)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(qt(m)){let n;return n=p&&p.replace!=null?p.replace:kt(m.response.headers.get(`Location`),new URL(t.url),c,e.history)===A.location.pathname+A.location.search,await Oe(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(m)){let e=Rt(l,h.route.id);return(p&&p.replace)!==!0&&(j=`PUSH`),{matches:l,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:l,pendingActionResult:[h.route.id,m]}}async function xe(t,n,i,l,u,d,f,p,m,h,g,_,v){let y=d||nn(n,f),b=f||p||tn(y),x=!ie&&!h;if(u){if(x){let e=Se(_);B({navigation:y,...e===void 0?{}:{actionData:e}},{flushSync:g})}let e=await st(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=zt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Rt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let S=s.activeRoutes,{dsMatches:C,revalidatingFetchers:w}=rt(t,l,a,o,e.history,A,i,b,n,h?[]:r,h===!0,ae,oe,R,ue,L,S,c,e.patchRoutesOnNavigation!=null,s.branches,_,v);if(ce=++se,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=Re();return V(n,{matches:i,loaderData:{},errors:_&&Y(_[1])?{[_[0]]:_[1].error}:null,...Lt(_),...e?{fetchers:new Map(A.fetchers)}:{}},{flushSync:g}),{shortCircuited:!0}}if(x){let e={};if(!u){e.navigation=y;let t=Se(_);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=Ce(w)),B(e,{flushSync:g})}w.forEach(e=>{q(e.key),e.controller&&I.set(e.key,e.controller)});let T=()=>w.forEach(e=>q(e.key));P&&P.signal.addEventListener(`abort`,T);let{loaderResults:E,fetcherResults:D}=await je(C,w,t,n,l);if(t.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener(`abort`,T),w.forEach(e=>I.delete(e.key));let O=Bt(E);if(O)return await Oe(t,O.result,!0,{replace:m}),{shortCircuited:!0};if(O=Bt(D),O)return L.add(O.key),await Oe(t,O.result,!0,{replace:m}),{shortCircuited:!0};let{loaderData:k,errors:j}=Ft(A,i,E,_,w,D);h&&A.errors&&(j={...A.errors,...j});let M=Re(),ee=ze(ce),N=M||ee||w.length>0;return{matches:i,loaderData:k,errors:j,...N?{fetchers:new Map(A.fetchers)}:{}}}function Se(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Ce(e){return e.forEach(e=>{let t=A.fetchers.get(e.key),n=an(void 0,t?t.data:void 0);A.fetchers.set(e.key,n)}),new Map(A.fetchers)}async function we(t,n,r,i){q(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=tt(A.location,A.matches,c,r,n,i?.relative),u=M(o,l,c,!1,s.branches),d=ot(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){K(t,n,J(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=nt(!0,l,i);if(m){K(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new C,g=(i&&i.preventScrollReset)===!0;if(p&&X(p.formMethod)){await Ee(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ue.set(t,{routeId:n,path:f}),await De(t,n,f,u,h,d.active,a,g,p)}async function Ee(t,n,i,l,u,d,p,m,h,g){Me(),ue.delete(t),G(t,on(h,A.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=At(e.history,i,_.signal,h);if(d){let e=await st(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:p});return}else if(e.matches)l=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:p});return}}let y=en(l,i);if(!y.route.action&&!y.route.lazy){K(t,n,J(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}I.set(t,_);let b=se,x=St(a,o,v,i,l,y,r,u),S=await W(v,i,x,u,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){I.get(t)===_&&I.delete(t);return}if(R.has(t)){if(qt(C)||Y(C)){G(t,sn(void 0));return}}else{if(qt(C))if(I.delete(t),ce>b){G(t,sn(void 0));return}else return L.add(t),G(t,an(h)),Oe(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(Y(C)){K(t,n,C.error);return}}let w=A.navigation.location||A.location,T=At(e.history,w,_.signal),E=s.activeRoutes,D=A.navigation.state===`idle`?A.matches:M(E,A.navigation.location,c,!1,s.branches);f(D,`Didn't find any matches after fetcher action`);let O=++se;le.set(t,O);let k=an(h,C.data);A.fetchers.set(t,k);let{dsMatches:ee,revalidatingFetchers:N}=rt(T,u,a,o,e.history,A,D,h,w,r,!1,ae,oe,R,ue,L,E,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g);N.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=A.fetchers.get(t),r=an(void 0,n?n.data:void 0);A.fetchers.set(t,r),q(t),e.controller&&I.set(t,e.controller)}),B({fetchers:new Map(A.fetchers)});let te=()=>N.forEach(e=>q(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:ne,fetcherResults:re}=await je(ee,N,T,w,u);if(_.signal.aborted)return;if(_.signal.removeEventListener(`abort`,te),le.delete(t),I.delete(t),N.forEach(e=>I.delete(e.key)),A.fetchers.has(t)){let e=sn(C.data);A.fetchers.set(t,e)}let F=Bt(ne);if(F)return Oe(T,F.result,!1,{preventScrollReset:m});if(F=Bt(re),F)return L.add(F.key),Oe(T,F.result,!1,{preventScrollReset:m});let{loaderData:ie,errors:de}=Ft(A,D,ne,void 0,N,re);ze(O),A.navigation.state===`loading`&&O>ce?(f(j,`Expected pending action`),P&&P.abort(),V(A.navigation.location,{matches:D,loaderData:ie,errors:de,fetchers:new Map(A.fetchers)})):(B({errors:de,loaderData:It(A.loaderData,ie,D,de),fetchers:new Map(A.fetchers)}),ae=!1)}async function De(t,n,i,s,c,l,u,d,f){let p=A.fetchers.get(t);G(t,an(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=At(e.history,i,m.signal);if(l){let e=await st(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{K(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=en(s,i);I.set(t,m);let _=se,v=await W(h,i,St(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(I.get(t)===m&&I.delete(t),!h.signal.aborted){if(R.has(t)){G(t,sn(void 0));return}if(qt(y))if(ce>_){G(t,sn(void 0));return}else{L.add(t),await Oe(h,y,!1,{preventScrollReset:d});return}if(Y(y)){K(t,n,y.error);return}G(t,sn(y.data))}}async function Oe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(N?.resolve(),N=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ae=!0);let d=i.response.headers.get(`Location`);f(d,`Expected a Location header on the redirect Response`),d=kt(d,new URL(r.url),c,e.history);let p=g(A.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(me(d)){let n=b(d,!0);e=n.origin!==t.location.origin||z(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}P=null;let m=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:h,formAction:_,formEncType:v}=A.navigation;!o&&!s&&h&&_&&v&&(o=tn(A.navigation));let y=o||s;Ve.has(i.response.status)&&y&&X(y.formMethod)?await U(m,p,{submission:{...y,formAction:d},preventScrollReset:l||te,enableViewTransition:a?ne:void 0}):await U(m,p,{overrideNavigation:nn(p,o),fetcherSubmission:s,preventScrollReset:l||te,enableViewTransition:a?ne:void 0})}async function W(e,t,n,r,i){let a,o={};try{a=await Ct(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!X(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!A.loaderData.hasOwnProperty(e.route.id)&&(!A.errors||!A.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Kt(r)){let i=r.result;o[t]={type:`redirect`,response:Dt(i,e,t,n,c)}}else o[t]=await Et(r);return o}async function je(e,t,n,r,i){let a=W(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await W(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Me(){ae=!0,ue.forEach((e,t)=>{I.has(t)&&oe.add(t),q(t)})}function G(e,t,n={}){A.fetchers.set(e,t),B({fetchers:new Map(A.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=Rt(A.matches,t);Fe(e),B({errors:{[i.route.id]:n},fetchers:new Map(A.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Ne(e){return de.set(e,(de.get(e)||0)+1),R.has(e)&&R.delete(e),A.fetchers.get(e)||Ue}function Pe(e,t){q(e,t?.reason),G(e,sn(null))}function Fe(e){let t=A.fetchers.get(e);I.has(e)&&!(t&&t.state===`loading`&&le.has(e))&&q(e),ue.delete(e),le.delete(e),L.delete(e),R.delete(e),oe.delete(e),A.fetchers.delete(e)}function Ie(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),R.add(e)):de.set(e,t),B({fetchers:new Map(A.fetchers)})}function q(e,t){let n=I.get(e);n&&(n.abort(t),I.delete(e))}function Le(e){for(let t of e){let e=sn(Ne(t).data);A.fetchers.set(t,e)}}function Re(){let e=[],t=!1;for(let n of L){let r=A.fetchers.get(n);f(r,`Expected fetcher: ${n}`),r.state===`loading`&&(L.delete(n),e.push(n),t=!0)}return Le(e),t}function ze(e){let t=[];for(let[n,r]of le)if(r<e){let e=A.fetchers.get(n);f(e,`Expected fetcher: ${n}`),e.state===`loading`&&(q(n),le.delete(n),t.push(n))}return Le(t),t.length>0}function Be(e,t){let n=A.blockers.get(e)||We;return fe.get(e)!==t&&fe.set(e,t),n}function Ke(e){A.blockers.delete(e),fe.delete(e)}function qe(e,t){let n=A.blockers.get(e)||We;f(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(A.blockers);r.set(e,t),B({blockers:r})}function Je({currentLocation:e,nextLocation:t,historyAction:n}){if(fe.size===0)return;fe.size>1&&p(!1,`A router only supports one blocker at a time`);let r=Array.from(fe.entries()),[i,a]=r[r.length-1],o=A.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ye(e){let t=J(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=zt(n);return{notFoundMatches:r,route:i,error:t}}function Xe(e,t,n){if(h=e,y=t,_=n||null,!x&&A.navigation===He){x=!0;let e=et(A.location,A.matches);e!=null&&B({restoreScrollPosition:e})}return()=>{h=null,y=null,_=null}}function Ze(e,t){return _&&_(e,t.map(e=>ee(e,A.loaderData)))||e.key}function $e(e,t){if(h&&y){let n=Ze(e,t);h[n]=y()}}function et(e,t){if(h){let n=Ze(e,t),r=h[n];if(typeof r==`number`)return r}return null}function ot(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:M(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:M(n,r,c,!0,e)}}return{active:!1,matches:null}}async function st(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||lt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=M(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=M(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&ct(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=M(s.activeRoutes,n,c,!0,u),!f||ct(l,f))return{type:`success`,matches:null};l=f}}function ct(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ut(e){o={},s.setHmrRoutes(k(e,a,void 0,o))}function dt(e,t,n=!1){lt(e,t,s,o,a,n),s.hasHMRRoutes||B({})}return O={get basename(){return c},get future(){return u},get state(){return A},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ge,subscribe:ve,enableScrollRestoration:Xe,navigate:ye,fetch:we,revalidate:H,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ne,resetFetcher:Pe,deleteFetcher:Ie,dispose:_e,getBlocker:Be,deleteBlocker:Ke,patchRoutes:dt,_internalFetchControllers:I,_internalSetRoutes:ut,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){B(e)}},e.instrumentations&&(O=Ae(O,e.instrumentations.map(e=>e.router).filter(Boolean))),O}function et(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function tt(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=V(r||`.`,B(o),z(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=$t(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=fe({basename:n,pathname:c.pathname})),_(c)}function nt(e,t,n){if(!n||!et(n))return{path:t};if(n.formMethod&&!Qt(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Vt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
2
2
|
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!X(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}f(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Mt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Mt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Nt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Nt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(X(c.formMethod))return{path:t,submission:c};let l=v(t);return e&&l.search&&$t(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:_(l),submission:c}}function rt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Y(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Y(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Ee(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!it(s))f=!1;else if(u){let{shouldLoad:e}=at(s,a.loaderData,a.errors);f=e}else ot(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return xt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?st(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return xt(n,r,e,c,k,i,l,t,ct(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=M(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=en(b,e.path),C=new AbortController,w=At(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=St(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=St(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:D?!1:d;let a={...O,defaultShouldRevalidate:i};ct(S,a)&&(T=St(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function it(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function at(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!it(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function ot(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function st(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function ct(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function lt(e,t,n,r,i,a){let o;if(e){let t=r[e];f(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>ut(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=k(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=k([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function ut(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>ut(e,t)))??!1:!1}var dt=new WeakMap,ft=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(f(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=dt.get(i);o||(o={},dt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=T(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)p(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)p(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},pt=new WeakMap;function mt(e,t,n,r,i){let a=n[e.id];if(f(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=pt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{f(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=D(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?p(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?p(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return pt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=ft({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function ht(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function gt(e){return e.matches.some(e=>e.route.middleware)?_t(e,()=>ht(e)):ht(e)}function _t(e,t){return vt(e,t,e=>{if(Zt(e))throw e;return e},Wt,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Rt(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function vt(e,t,n,r,i){let{matches:a,...o}=e;return await yt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function yt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await yt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function bt(e,t,n,r,i){let a=ft({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=mt(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function xt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=bt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?ct(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?ct(a,{...l,defaultShouldRevalidate:e}):ct(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!X(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(X(n.method)||!p)?wt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function St(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?xt(e,t,n,r,Ee(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:bt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ct(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:jt(t,n),pattern:Ee(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return _t(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function wt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=X(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:jt(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw J(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Tt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Et(e){let{result:t,type:n}=e;if(Yt(t)){let e;try{e=await Tt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new we(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Jt(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Ut(t),statusCode:Te(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Te(t)?t.status:void 0}:Jt(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Dt(e,t,n,r,i){let a=e.headers.get(`Location`);if(f(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!me(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=tt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Ot=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function kt(e,t,n,r){if(me(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Ot.includes(i.protocol))throw Error(`Invalid redirect location`);let a=z(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ye(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Ot.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function At(e,t,n,r){let i=e.createURL(Vt(t)).toString(),a={signal:n};if(r&&X(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Mt(r.formData):a.body=r.formData}return new Request(i,a)}function jt(e,t){let n=new URL(e.url),r=typeof t==`string`?v(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Mt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Nt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Pt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,p=t[d];if(f(!qt(p),`Cannot handle redirect results in processLoaderData`),Y(p)){let t=p.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Rt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=qe),c||(c=!0,s=Te(p.error)?p.error.status:500),p.headers&&(l[d]=p.headers)}else a[d]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[d]=p.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Ft(e,t,n,r,i,a){let{loaderData:o,errors:s}=Pt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(f(o,`Did not find corresponding fetcher result`),Y(o)){let t=Rt(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(qt(o))f(!1,`Unhandled fetcher revalidation redirect`);else{let t=sn(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function It(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==qe).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Lt(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Rt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function zt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function J(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new we(e||500,o,Error(s),!0)}function Bt(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(qt(r))return{key:n,result:r}}}function Vt(e){return _({...typeof e==`string`?v(e):e,hash:``})}function Ht(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function Ut(e){return new we(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Wt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Gt(t))}function Gt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Kt(e){return Yt(e.result)&&Be.has(e.result.status)}function Y(e){return e.type===`error`}function qt(e){return(e&&e.type)===`redirect`}function Jt(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Yt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Xt(e){return Be.has(e)}function Zt(e){return Yt(e)&&Xt(e.status)&&e.headers.has(`Location`)}function Qt(e){return ze.has(e.toUpperCase())}function X(e){return Le.has(e.toUpperCase())}function $t(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function en(e,t){let n=typeof t==`string`?v(t).search:t.search;if(e[e.length-1].route.index&&$t(n||``))return e[e.length-1];let r=ve(e);return r[r.length-1]}function tn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function nn(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function rn(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function an(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function on(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function sn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function cn(e,t){try{let n=e.sessionStorage.getItem(Ke);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function ln(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ke,JSON.stringify(n))}catch(e){p(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function un(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var dn=r.createContext(null);dn.displayName=`DataRouter`;var fn=r.createContext(null);fn.displayName=`DataRouterState`;var pn=r.createContext(!1);function mn(){return r.useContext(pn)}var hn=r.createContext({isTransitioning:!1});hn.displayName=`ViewTransition`;var gn=r.createContext(new Map);gn.displayName=`Fetchers`;var _n=r.createContext(null);_n.displayName=`Await`;var Z=r.createContext(null);Z.displayName=`Navigation`;var vn=r.createContext(null);vn.displayName=`Location`;var Q=r.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var yn=r.createContext(null);yn.displayName=`RouteError`;var bn=`REACT_ROUTER_ERROR`,xn=`REDIRECT`,Sn=`ROUTE_ERROR_RESPONSE`;function Cn(e){if(e.startsWith(`${bn}:${xn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function wn(e){if(e.startsWith(`${bn}:${Sn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new we(t.status,t.statusText,t.data)}catch{}}function Tn(e,{relative:t}={}){f(En(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(Z),{hash:a,pathname:o,search:s}=Fn(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:H([n,o])),i.createHref({pathname:c,search:s,hash:a})}function En(){return r.useContext(vn)!=null}function $(){return f(En(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(vn).location}function Dn(){return r.useContext(vn).navigationType}var On=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function kn(e){r.useContext(Z).static||r.useLayoutEffect(e)}function An(){let{isDataRoute:e}=r.useContext(Q);return e?$n():jn()}function jn(){f(En(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(dn),{basename:t,navigator:n}=r.useContext(Z),{matches:i}=r.useContext(Q),{pathname:a}=$(),o=JSON.stringify(B(i)),s=r.useRef(!1);return kn(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(p(s.current,On),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=V(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:H([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var Mn=r.createContext(null);function Nn(e){let t=r.useContext(Q).outlet;return r.useMemo(()=>t&&r.createElement(Mn.Provider,{value:e},t),[t,e])}function Pn(){let{matches:e}=r.useContext(Q);return e[e.length-1]?.params??{}}function Fn(e,{relative:t}={}){let{matches:n}=r.useContext(Q),{pathname:i}=$(),a=JSON.stringify(B(n));return r.useMemo(()=>V(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function In(e,t,n){f(En(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(Z),{matches:a}=r.useContext(Q),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;tr(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
3
|
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),m;if(t){let e=typeof t==`string`?v(t):t;f(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=d;let h=m.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):j(e,{pathname:g});p(u||_!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),p(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Un(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:H([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:H([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&y?r.createElement(vn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...m},navigationType:`POP`}},y):y}function Ln(){let e=Qn(),t=Te(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`💿 Hey developer 👋`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var Rn=r.createElement(Ln,null),zn=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=wn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(Q.Provider,{value:this.props.routeContext},r.createElement(yn.Provider,{value:e,children:this.props.component}));return this.context?r.createElement(Vn,{error:e},t):t}};zn.contextType=pn;var Bn=new WeakMap;function Vn({children:e,error:t}){let{basename:n}=r.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Cn(t.digest);if(e){let i=Bn.get(t);if(i)throw i;let a=Oe(e.location,n);if(De&&!Bn.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Bn.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Hn({routeContext:e,match:t,children:n}){let i=r.useContext(dn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(Q.Provider,{value:e},n)}function Un(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);f(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Ee(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Rn,s&&(c<0&&l===0?(tr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(Hn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Wn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gn(e){let t=r.useContext(dn);return f(t,Wn(e)),t}function Kn(e){let t=r.useContext(fn);return f(t,Wn(e)),t}function qn(e){let t=r.useContext(Q);return f(t,Wn(e)),t}function Jn(e){let t=qn(e),n=t.matches[t.matches.length-1];return f(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Yn(){return Jn(`useRouteId`)}function Xn(){return Kn(`useNavigation`).navigation}function Zn(){let{matches:e,loaderData:t}=Kn(`useMatches`);return r.useMemo(()=>e.map(e=>ee(e,t)),[e,t])}function Qn(){let e=r.useContext(yn),t=Kn(`useRouteError`),n=Jn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function $n(){let{router:e}=Gn(`useNavigate`),t=Jn(`useNavigate`),n=r.useRef(!1);return kn(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{p(n.current,On),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var er={};function tr(e,t,n){!t&&!er[e]&&(er[e]=!0,p(!1,n))}var nr={};function rr(e,t){!e&&!nr[t]&&(nr[t]=!0,console.warn(t))}var ir=r.useOptimistic,ar=()=>void 0;function or(e){return ir?ir(e):[e,ar]}function sr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&p(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&p(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:r.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&p(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var cr=[`HydrateFallback`,`hydrateFallbackElement`],lr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function ur({router:e,flushSync:t,onError:n,useTransitions:i}){i=mn()||i;let[a,o]=r.useState(e.state),[s,c]=or(a),[l,u]=r.useState(),[d,f]=r.useState({isTransitioning:!1}),[p,m]=r.useState(),[h,g]=r.useState(),[_,v]=r.useState(),y=r.useRef(new Map),b=r.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Ee(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),rr(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(rr(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):r.startTransition(()=>{i===!0&&c(e=>dr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,n]);r.useLayoutEffect(()=>e.subscribe(b),[e,b]);let x=s.initialized;r.useLayoutEffect(()=>{!x&&e.state.initialized&&b(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[x,b,e.state]),r.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new lr)},[d]),r.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):r.startTransition(()=>{i===!0&&c(e=>dr(e,t)),o(t)}),await n});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),r.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),r.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let S=r.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),C=e.basename||`/`,w=r.useMemo(()=>({router:e,navigator:S,static:!1,basename:C,onError:n}),[e,S,C,n]);return r.createElement(r.Fragment,null,r.createElement(dn.Provider,{value:w},r.createElement(fn.Provider,{value:s},r.createElement(gn.Provider,{value:y.current},r.createElement(hn.Provider,{value:d},r.createElement(gr,{basename:C,location:s.location,navigationType:s.historyAction,navigator:S,useTransitions:i},r.createElement(fr,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function dr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var fr=r.memo(pr);function pr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return In(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function mr({to:e,replace:t,state:n,relative:i}){f(En(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(Z);p(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(Q),{pathname:s}=$(),c=An(),l=V(e,B(o),s,i===`path`),u=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:i})},[c,u,i,t,n]),null}function hr(e){return Nn(e.context)}function gr({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){f(!En(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=v(n));let{pathname:u=`/`,search:d=``,hash:m=``,state:h=null,key:g=`default`,mask:_}=n,y=r.useMemo(()=>{let e=z(u,c);return e==null?null:{location:{pathname:e,search:d,hash:m,state:h,key:g,mask:_},navigationType:i}},[c,u,d,m,h,g,i,_]);return p(y!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(Z.Provider,{value:l},r.createElement(vn.Provider,{children:t,value:y}))}r.Component;var _r=`get`,vr=`application/x-www-form-urlencoded`;function yr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function br(e){return yr(e)&&e.tagName.toLowerCase()===`button`}function xr(e){return yr(e)&&e.tagName.toLowerCase()===`form`}function Sr(e){return yr(e)&&e.tagName.toLowerCase()===`input`}function Cr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wr(e,t){return e.button===0&&(!t||t===`_self`)&&!Cr(e)}function Tr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Er(e,t){let n=Tr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Dr=null;function Or(){if(Dr===null)try{new FormData(document.createElement(`form`),0),Dr=!1}catch{Dr=!0}return Dr}var kr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ar(e){return e!=null&&!kr.has(e)?(p(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vr}"`),null):e}function jr(e,t){let n,r,i,a,o;if(xr(e)){let o=e.getAttribute(`action`);r=o?z(o,t):null,n=e.getAttribute(`method`)||_r,i=Ar(e.getAttribute(`enctype`))||vr,a=new FormData(e)}else if(br(e)||Sr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?z(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||_r,i=Ar(e.getAttribute(`formenctype`))||Ar(o.getAttribute(`enctype`))||vr,a=new FormData(o,e),!Or()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(yr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=_r,r=null,i=vr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Mr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Nr=/[&><\u2028\u2029]/g;function Pr(e){return e.replace(Nr,e=>Mr[e])}function Fr(e,t){if(e===!1||e==null)throw Error(t)}function Ir(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&z(i.pathname,t)===`/`?i.pathname=`${U(t)}/_root.${r}`:i.pathname=`${U(i.pathname)}.${r}`,i}async function Lr(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rr(e){return e!=null&&typeof e.page==`string`}function zr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Br(e,t,n){return Gr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Lr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(zr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Vr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Hr(e,t,{includeHydrateFallback:n}={}){return Ur(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ur(e){return[...new Set(e)]}function Wr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Gr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Rr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Wr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Kr(){let e=r.useContext(dn);return Fr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function qr(){let e=r.useContext(fn);return Fr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Jr=r.createContext(void 0);Jr.displayName=`FrameworkContext`;function Yr(){let e=r.useContext(Jr);return Fr(e,`You must render this element inside a <HydratedRouter> element`),e}function Xr(e,t){let n=r.useContext(Jr),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:Zr(c,m),onBlur:Zr(l,h),onMouseEnter:Zr(u,m),onMouseLeave:Zr(d,h),onTouchStart:Zr(f,m)}]:[o,p,{}]:[!1,p,{}]}function Zr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qr({page:e,...t}){let n=mn(),{router:i}=Kr(),a=r.useMemo(()=>j(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?r.createElement(ei,{page:e,matches:a,...t}):r.createElement(ti,{page:e,matches:a,...t}):null}function $r(e){let{manifest:t,routeModules:n}=Yr(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Br(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function ei({page:e,matches:t,...n}){let i=$(),{future:a}=Yr(),{basename:o}=Kr(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Ir(e,o,a.unstable_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ti({page:e,matches:t,...n}){let i=$(),{future:a,manifest:o,routeModules:s}=Yr(),{basename:c}=Kr(),{loaderData:l,matches:u}=qr(),d=r.useMemo(()=>Vr(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Vr(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Ir(e,c,a.unstable_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.unstable_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Hr(f,o),[f,o]),h=$r(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ni(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}r.Component;var ri=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ri&&(window.__reactRouterVersion=`7.15.0`)}catch{}function ii(e,t){return $e({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:d({window:t?.window}),hydrationData:t?.hydrationData||ai(),routes:e,mapRouteProperties:sr,hydrationRouteProperties:cr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ai(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:oi(e.errors)}),e}function oi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new we(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function si({basename:e,children:t,history:n,useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(gr,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,useTransitions:i})}si.displayName=`unstable_HistoryRouter`;var ci=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,li=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=r.useContext(Z),y=typeof u==`string`&&ci.test(u),b=Oe(u,g);u=b.to;let x=Tn(u,{relative:i}),S=$(),C=null;if(s){let e=V(s,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:H([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Xr(n,m),D=gi(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||a),A=r.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:ni(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?r.createElement(r.Fragment,null,A,r.createElement(Qr,{page:x})):A});li.displayName=`Link`;var ui=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Fn(o,{relative:l.relative}),f=$(),p=r.useContext(fn),{navigator:m,basename:h}=r.useContext(Z),g=p!=null&&Di(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=z(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return r.createElement(li,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});ui.displayName=`NavLink`;var di=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=_r,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=r.useContext(Z),_=bi(),v=xi(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&ci.test(c);return r.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?r.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});di.displayName=`Form`;function fi({getKey:e,storageKey:t,...n}){let i=r.useContext(Jr),{basename:a}=r.useContext(Z),o=$(),s=Zn();Ti({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=wi(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Pr(JSON.stringify(t||Si))}, ${Pr(JSON.stringify(c))})`}})}fi.displayName=`ScrollRestoration`;function pi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mi(e){let t=r.useContext(dn);return f(t,pi(e)),t}function hi(e){let t=r.useContext(fn);return f(t,pi(e)),t}function gi(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=An(),f=$(),p=Fn(e,{relative:s});return r.useCallback(m=>{if(wr(m,t)){m.preventDefault();let t=n===void 0?_(f)===_(p):n,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>h()):h()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function _i(e){p(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=r.useRef(Tr(e)),n=r.useRef(!1),i=$(),a=r.useMemo(()=>Er(i.search,n.current?null:t.current),[i.search]),o=An();return[a,r.useCallback((e,t)=>{let r=Tr(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var vi=0,yi=()=>`__${String(++vi)}__`;function bi(){let{router:e}=mi(`useSubmit`),{basename:t}=r.useContext(Z),n=Yn(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=jr(e,t);r.navigate===!1?await i(r.fetcherKey||yi(),n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync}):await a(r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function xi(e,{relative:t}={}){let{basename:n}=r.useContext(Z),i=r.useContext(Q);f(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Fn(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:H([n,o.pathname])),_(o)}var Si=`react-router-scroll-positions`,Ci={};function wi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:z(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ti({getKey:e,storageKey:t}={}){let{router:n}=mi(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=hi(`useScrollRestoration`),{basename:o}=r.useContext(Z),s=$(),c=Zn(),l=Xn();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ei(r.useCallback(()=>{if(l.state===`idle`){let t=wi(s,c,o,e);Ci[t]=window.scrollY}try{sessionStorage.setItem(t||Si,JSON.stringify(Ci))}catch(e){p(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Si);e&&(Ci=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ci,()=>window.scrollY,e?(t,n)=>wi(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{p(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function Ei(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Di(e,{relative:t}={}){let n=r.useContext(hn);f(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=mi(`useViewTransitionState`),a=Fn(e,{relative:t});if(!n.isTransitioning)return!1;let o=z(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=z(n.nextLocation.pathname,i)||n.nextLocation.pathname;return ue(a.pathname,s)!=null||ue(a.pathname,o)!=null}export{ur as a,Te as c,An as d,Dn as f,_i as h,hr as i,Ce as l,Qn as m,ui as n,ii as o,Pn as p,mr as r,x as s,li as t,$ as u};
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=$(),m;if(t){let e=typeof t==`string`?v(t):t;f(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=d;let h=m.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):j(e,{pathname:g});p(u||_!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),p(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Un(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:H([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:H([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&y?r.createElement(vn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...m},navigationType:`POP`}},y):y}function Ln(){let e=Qn(),t=Te(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`💿 Hey developer 👋`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var Rn=r.createElement(Ln,null),zn=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=wn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(Q.Provider,{value:this.props.routeContext},r.createElement(yn.Provider,{value:e,children:this.props.component}));return this.context?r.createElement(Vn,{error:e},t):t}};zn.contextType=pn;var Bn=new WeakMap;function Vn({children:e,error:t}){let{basename:n}=r.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Cn(t.digest);if(e){let i=Bn.get(t);if(i)throw i;let a=Oe(e.location,n);if(De&&!Bn.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Bn.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Hn({routeContext:e,match:t,children:n}){let i=r.useContext(dn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(Q.Provider,{value:e},n)}function Un(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);f(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Ee(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||Rn,s&&(c<0&&l===0?(tr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(Hn,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Wn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gn(e){let t=r.useContext(dn);return f(t,Wn(e)),t}function Kn(e){let t=r.useContext(fn);return f(t,Wn(e)),t}function qn(e){let t=r.useContext(Q);return f(t,Wn(e)),t}function Jn(e){let t=qn(e),n=t.matches[t.matches.length-1];return f(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Yn(){return Jn(`useRouteId`)}function Xn(){return Kn(`useNavigation`).navigation}function Zn(){let{matches:e,loaderData:t}=Kn(`useMatches`);return r.useMemo(()=>e.map(e=>ee(e,t)),[e,t])}function Qn(){let e=r.useContext(yn),t=Kn(`useRouteError`),n=Jn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function $n(){let{router:e}=Gn(`useNavigate`),t=Jn(`useNavigate`),n=r.useRef(!1);return kn(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{p(n.current,On),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var er={};function tr(e,t,n){!t&&!er[e]&&(er[e]=!0,p(!1,n))}var nr={};function rr(e,t){!e&&!nr[t]&&(nr[t]=!0,console.warn(t))}var ir=r.useOptimistic,ar=()=>void 0;function or(e){return ir?ir(e):[e,ar]}function sr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&p(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&p(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:r.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&p(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var cr=[`HydrateFallback`,`hydrateFallbackElement`],lr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function ur({router:e,flushSync:t,onError:n,useTransitions:i}){i=mn()||i;let[a,o]=r.useState(e.state),[s,c]=or(a),[l,u]=r.useState(),[d,f]=r.useState({isTransitioning:!1}),[p,m]=r.useState(),[h,g]=r.useState(),[_,v]=r.useState(),y=r.useRef(new Map),b=r.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:a.location,params:a.matches[0]?.params??{},pattern:Ee(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),rr(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(rr(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):r.startTransition(()=>{i===!0&&c(e=>dr(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,n]);r.useLayoutEffect(()=>e.subscribe(b),[e,b]);let x=s.initialized;r.useLayoutEffect(()=>{!x&&e.state.initialized&&b(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[x,b,e.state]),r.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new lr)},[d]),r.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):r.startTransition(()=>{i===!0&&c(e=>dr(e,t)),o(t)}),await n});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),r.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),r.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let S=r.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),C=e.basename||`/`,w=r.useMemo(()=>({router:e,navigator:S,static:!1,basename:C,onError:n}),[e,S,C,n]);return r.createElement(r.Fragment,null,r.createElement(dn.Provider,{value:w},r.createElement(fn.Provider,{value:s},r.createElement(gn.Provider,{value:y.current},r.createElement(hn.Provider,{value:d},r.createElement(gr,{basename:C,location:s.location,navigationType:s.historyAction,navigator:S,useTransitions:i},r.createElement(fr,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function dr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var fr=r.memo(pr);function pr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return In(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function mr({to:e,replace:t,state:n,relative:i}){f(En(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(Z);p(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(Q),{pathname:s}=$(),c=An(),l=V(e,B(o),s,i===`path`),u=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:i})},[c,u,i,t,n]),null}function hr(e){return Nn(e.context)}function gr({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){f(!En(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=v(n));let{pathname:u=`/`,search:d=``,hash:m=``,state:h=null,key:g=`default`,mask:_}=n,y=r.useMemo(()=>{let e=z(u,c);return e==null?null:{location:{pathname:e,search:d,hash:m,state:h,key:g,mask:_},navigationType:i}},[c,u,d,m,h,g,i,_]);return p(y!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(Z.Provider,{value:l},r.createElement(vn.Provider,{children:t,value:y}))}r.Component;var _r=`get`,vr=`application/x-www-form-urlencoded`;function yr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function br(e){return yr(e)&&e.tagName.toLowerCase()===`button`}function xr(e){return yr(e)&&e.tagName.toLowerCase()===`form`}function Sr(e){return yr(e)&&e.tagName.toLowerCase()===`input`}function Cr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wr(e,t){return e.button===0&&(!t||t===`_self`)&&!Cr(e)}function Tr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Er(e,t){let n=Tr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Dr=null;function Or(){if(Dr===null)try{new FormData(document.createElement(`form`),0),Dr=!1}catch{Dr=!0}return Dr}var kr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ar(e){return e!=null&&!kr.has(e)?(p(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vr}"`),null):e}function jr(e,t){let n,r,i,a,o;if(xr(e)){let o=e.getAttribute(`action`);r=o?z(o,t):null,n=e.getAttribute(`method`)||_r,i=Ar(e.getAttribute(`enctype`))||vr,a=new FormData(e)}else if(br(e)||Sr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?z(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||_r,i=Ar(e.getAttribute(`formenctype`))||Ar(o.getAttribute(`enctype`))||vr,a=new FormData(o,e),!Or()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(yr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=_r,r=null,i=vr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Mr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Nr=/[&><\u2028\u2029]/g;function Pr(e){return e.replace(Nr,e=>Mr[e])}function Fr(e,t){if(e===!1||e==null)throw Error(t)}function Ir(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&z(i.pathname,t)===`/`?i.pathname=`${U(t)}/_root.${r}`:i.pathname=`${U(i.pathname)}.${r}`,i}async function Lr(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rr(e){return e!=null&&typeof e.page==`string`}function zr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Br(e,t,n){return Gr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Lr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(zr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Vr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Hr(e,t,{includeHydrateFallback:n}={}){return Ur(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ur(e){return[...new Set(e)]}function Wr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Gr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Rr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Wr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Kr(){let e=r.useContext(dn);return Fr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function qr(){let e=r.useContext(fn);return Fr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Jr=r.createContext(void 0);Jr.displayName=`FrameworkContext`;function Yr(){let e=r.useContext(Jr);return Fr(e,`You must render this element inside a <HydratedRouter> element`),e}function Xr(e,t){let n=r.useContext(Jr),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:Zr(c,m),onBlur:Zr(l,h),onMouseEnter:Zr(u,m),onMouseLeave:Zr(d,h),onTouchStart:Zr(f,m)}]:[o,p,{}]:[!1,p,{}]}function Zr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qr({page:e,...t}){let n=mn(),{router:i}=Kr(),a=r.useMemo(()=>j(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?n?r.createElement(ei,{page:e,matches:a,...t}):r.createElement(ti,{page:e,matches:a,...t}):null}function $r(e){let{manifest:t,routeModules:n}=Yr(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Br(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function ei({page:e,matches:t,...n}){let i=$(),{future:a}=Yr(),{basename:o}=Kr(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Ir(e,o,a.unstable_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ti({page:e,matches:t,...n}){let i=$(),{future:a,manifest:o,routeModules:s}=Yr(),{basename:c}=Kr(),{loaderData:l,matches:u}=qr(),d=r.useMemo(()=>Vr(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Vr(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=Ir(e,c,a.unstable_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.unstable_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Hr(f,o),[f,o]),h=$r(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ni(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}r.Component;var ri=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ri&&(window.__reactRouterVersion=`7.15.0`)}catch{}function ii(e,t){return $e({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:d({window:t?.window}),hydrationData:t?.hydrationData||ai(),routes:e,mapRouteProperties:sr,hydrationRouteProperties:cr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ai(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:oi(e.errors)}),e}function oi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new we(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function si({basename:e,children:t,history:n,useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(gr,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,useTransitions:i})}si.displayName=`unstable_HistoryRouter`;var ci=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,li=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=r.useContext(Z),y=typeof u==`string`&&ci.test(u),b=Oe(u,g);u=b.to;let x=Tn(u,{relative:i}),S=$(),C=null;if(s){let e=V(s,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:H([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Xr(n,m),D=gi(u,{replace:o,mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||a),A=r.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:ni(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?r.createElement(r.Fragment,null,A,r.createElement(Qr,{page:x})):A});li.displayName=`Link`;var ui=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Fn(o,{relative:l.relative}),f=$(),p=r.useContext(fn),{navigator:m,basename:h}=r.useContext(Z),g=p!=null&&Di(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=z(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof a==`function`?a(C):a;return r.createElement(li,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});ui.displayName=`NavLink`;var di=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=_r,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=r.useContext(Z),_=bi(),v=xi(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&ci.test(c);return r.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?r.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});di.displayName=`Form`;function fi({getKey:e,storageKey:t,...n}){let i=r.useContext(Jr),{basename:a}=r.useContext(Z),o=$(),s=Zn();Ti({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=wi(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Pr(JSON.stringify(t||Si))}, ${Pr(JSON.stringify(c))})`}})}fi.displayName=`ScrollRestoration`;function pi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mi(e){let t=r.useContext(dn);return f(t,pi(e)),t}function hi(e){let t=r.useContext(fn);return f(t,pi(e)),t}function gi(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=An(),f=$(),p=Fn(e,{relative:s});return r.useCallback(m=>{if(wr(m,t)){m.preventDefault();let t=n===void 0?_(f)===_(p):n,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>h()):h()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function _i(e){p(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=r.useRef(Tr(e)),n=r.useRef(!1),i=$(),a=r.useMemo(()=>Er(i.search,n.current?null:t.current),[i.search]),o=An();return[a,r.useCallback((e,t)=>{let r=Tr(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var vi=0,yi=()=>`__${String(++vi)}__`;function bi(){let{router:e}=mi(`useSubmit`),{basename:t}=r.useContext(Z),n=Yn(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=jr(e,t);r.navigate===!1?await i(r.fetcherKey||yi(),n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync}):await a(r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function xi(e,{relative:t}={}){let{basename:n}=r.useContext(Z),i=r.useContext(Q);f(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Fn(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:H([n,o.pathname])),_(o)}var Si=`react-router-scroll-positions`,Ci={};function wi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:z(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ti({getKey:e,storageKey:t}={}){let{router:n}=mi(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=hi(`useScrollRestoration`),{basename:o}=r.useContext(Z),s=$(),c=Zn(),l=Xn();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ei(r.useCallback(()=>{if(l.state===`idle`){let t=wi(s,c,o,e);Ci[t]=window.scrollY}try{sessionStorage.setItem(t||Si,JSON.stringify(Ci))}catch(e){p(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Si);e&&(Ci=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ci,()=>window.scrollY,e?(t,n)=>wi(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{p(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function Ei(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Di(e,{relative:t}={}){let n=r.useContext(hn);f(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=mi(`useViewTransitionState`),a=Fn(e,{relative:t});if(!n.isTransitioning)return!1;let o=z(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=z(n.nextLocation.pathname,i)||n.nextLocation.pathname;return ue(a.pathname,s)!=null||ue(a.pathname,o)!=null}export{ii as a,Ce as c,Dn as d,Pn as f,ur as i,$ as l,_i as m,mr as n,x as o,Qn as p,hr as r,Te as s,li as t,An as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
package/dist/assets/{client-feature-flag-store-DkJl-g9A.js → client-feature-flag-store-CXG75X45.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./create-selectors-8NePGNlX.js";import{i as n,r,s as i}from"./feature-flag-catalog-
|
|
1
|
+
import{n as e,t}from"./create-selectors-8NePGNlX.js";import{i as n,r,s as i}from"./feature-flag-catalog-BkLG5Cht.js";var a=`vellum:ff:`,o=`vellum:ff-str:`;function s(){if(typeof window>`u`)return{};let e={};try{for(let t of Object.keys(r)){let n=localStorage.getItem(a+t);n!==null&&(e[t]=n===`true`)}}catch{}return e}function c(){if(typeof window>`u`)return{};let e={};try{for(let t of Object.keys(n)){let n=localStorage.getItem(o+t);n!==null&&(e[t]=n)}}catch{}return e}var l=s(),u=c(),d=i(`client`),f=t(e()(e=>{let t=e;return{...r,...l,...d.bool,stringFlags:{...n,...u,...d.str},hydrated:!1,setFlags:t=>e(e=>{let n=s(),r={...t,...n,...d.bool};return Object.keys(r).some(t=>r[t]!==e[t])?{...r,hydrated:!0}:e.hydrated?e:{hydrated:!0}}),setFlag:(t,n)=>{try{localStorage.setItem(a+t,String(n))}catch{}e({[t]:d.bool[t]??n})},clearOverride:t=>{try{localStorage.removeItem(a+t)}catch{}let n=d.bool[t]??r[t];n!==void 0&&e({[t]:n})},setStringFlags:e=>t(t=>{let n=c(),r={...e,...n,...d.str},i=t.stringFlags;return Object.keys(r).some(e=>r[e]!==i[e])?{stringFlags:r}:t}),setStringFlag:(e,n)=>{try{localStorage.setItem(o+e,n)}catch{}t(t=>({stringFlags:{...t.stringFlags,[e]:d.str[e]??n}}))},clearStringOverride:e=>{try{localStorage.removeItem(o+e)}catch{}let r=d.str[e]??n[e];t(t=>({stringFlags:{...t.stringFlags,[e]:r??``}}))}}}));export{f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./platform-detection-
|
|
1
|
+
import{n as e,t}from"./platform-detection-BaPcSHIf.js";var n={browser_family:`x-vellum-browser-family`,browser_version:`x-vellum-browser-version`,os:`x-vellum-client-os`,interface_version:`x-vellum-interface-version`},r=/^[a-z0-9._-]{1,64}$/;function i(e){let t=e?.trim().toLowerCase();if(t)return r.test(t)?t:void 0}var a=null;function o(){return a||(a=crypto.randomUUID(),a)}var s=null;function c(){if(s)return s;let r=t(),a=[[n.browser_family,r.family],[n.browser_version,r.version],[n.os,e()],[n.interface_version,void 0]],o={};for(let[e,t]of a){let n=i(t);n&&(o[e]=n)}return s=o,o}function l(){return{"X-Vellum-Client-Id":o(),"X-Vellum-Interface-Id":`web`,...c()}}export{l as n,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n,z as r}from"./button-BQVYX8n_.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-Cqi8q9o7.js";import{t as o}from"./loader-circle-Ck8fq3yv.js";import{t as s}from"./x-BYcSiJRX.js";import"./src-CYX5MuYs.js";import{t as c}from"./panel-item-CfuwAm7q.js";import{Cr as l,Mi as u}from"./index-BZVPYTjj.js";var d=e(t(),1),f=e(r(),1),p=i();function m({icon:e,title:t,subtitle:n,shortcutHint:r,isSelected:i,onClick:a,surface:o=`overlay`}){let s=e;return o===`window`?(0,p.jsxs)(`button`,{type:`button`,role:`option`,"aria-current":i?`page`:void 0,"aria-selected":i,onClick:a,className:[`flex h-10 w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium outline-none transition-colors`,i?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`].join(` `),children:[s?(0,p.jsx)(s,{size:16,"aria-hidden":!0,className:i?`shrink-0 text-[var(--content-default)]`:`shrink-0 text-[var(--content-tertiary)]`}):null,(0,p.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`truncate`,children:t}),n?(0,p.jsx)(`span`,{className:`shrink-0 truncate text-xs text-[var(--content-tertiary)]`,children:n}):null,r?(0,p.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-[var(--content-tertiary)]`,children:r}):null]})]}):(0,p.jsx)(c,{icon:e,label:(0,p.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`truncate`,children:t}),n?(0,p.jsx)(`span`,{className:`shrink-0 truncate text-[var(--content-tertiary)] text-body-small-default`,children:n}):null,r?(0,p.jsx)(`span`,{className:`ml-auto shrink-0 text-[var(--content-tertiary)] text-body-small-default`,children:r}):null]}),active:i,onSelect:a,className:`px-3 py-2`})}var h=({isOpen:e,onClose:t,query:r,onQueryChange:i,selectedIndex:c,sections:h,isSearching:g=!1,onItemSelect:_,onKeyDown:v,surface:y=`overlay`})=>{let b=l(),x=(0,d.useRef)(null),S=(0,d.useRef)(null),C=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(e){let e=requestAnimationFrame(()=>{S.current?.focus()});return()=>cancelAnimationFrame(e)}},[e]),(0,d.useEffect)(()=>{if(!e||!C.current)return;let t=C.current.querySelector(`[aria-current='page']`);t&&t.scrollIntoView({block:`nearest`})},[e,c]);let w=(0,d.useCallback)(e=>{e.target===x.current&&t()},[t]);if(!e)return null;let T=0,E=y===`window`,D=b&&!E,O=(0,p.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-base)] px-4 py-3`,children:[g?(0,p.jsx)(o,{size:16,"aria-hidden":!0,className:`shrink-0 animate-spin text-[var(--content-tertiary)]`}):(0,p.jsx)(u,{size:16,"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,p.jsx)(`input`,{ref:S,type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`Search conversations, memories…`,className:E?`min-w-0 flex-1 bg-transparent text-sm font-medium text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`:`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`,"aria-label":`Search`}),r?D?(0,p.jsx)(`button`,{type:`button`,className:`shrink-0 text-body-medium-lighter text-[var(--content-tertiary)]`,onClick:()=>i(``),"aria-label":`Clear search`,children:`Clear`}):E?(0,p.jsx)(`button`,{type:`button`,className:`flex size-7 shrink-0 items-center justify-center rounded-md text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`,"aria-label":`Clear search`,onClick:()=>i(``),children:(0,p.jsx)(s,{size:16,"aria-hidden":!0})}):(0,p.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,p.jsx)(s,{}),"aria-label":`Clear search`,onClick:()=>i(``),tintColor:`var(--content-tertiary)`}):D?null:(0,p.jsx)(`kbd`,{className:E?`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-xs font-medium text-[var(--content-secondary)]`:`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-label-small-default text-[var(--content-tertiary)]`,children:`⌘K`}),D?(0,p.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,p.jsx)(s,{}),expandOnMobile:!1,"aria-label":`Close search`,onClick:t,tintColor:`var(--content-tertiary)`}):null]}),k=(0,p.jsx)(`div`,{ref:C,className:D?`flex-1 overflow-y-auto overscroll-contain p-2`:`max-h-[360px] overflow-y-auto overscroll-contain p-2`,role:`listbox`,children:h.length===0?(0,p.jsx)(`div`,{className:`px-3 py-6 text-center`,children:(0,p.jsx)(a,{variant:`body-medium-lighter`,className:`text-[var(--content-tertiary)]`,children:g?`Searching…`:`No results`})}):h.map(e=>(0,p.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[(0,p.jsx)(a,{variant:`label-small-default`,as:`div`,className:E?`px-3 pb-1 pt-2 text-xs font-semibold text-[var(--content-tertiary)]`:`px-3 pb-1 pt-2 text-[var(--content-tertiary)] max-md:text-body-small-default`,children:e.label}),e.items.map(e=>{let t=T++;return(0,p.jsx)(m,{icon:e.icon,title:e.title,subtitle:e.subtitle,shortcutHint:D?void 0:e.shortcutHint,isSelected:t===c,onClick:()=>_?.(e,t),surface:y},e.id)})]},e.id))});if(D)return(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-[var(--surface-lift)]`,role:`dialog`,"aria-modal":`true`,"aria-label":`Search`,onKeyDown:v,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},children:[O,k]});let A=(0,p.jsx)(`div`,{ref:x,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:y===`window`?`flex h-full w-full items-start justify-center bg-transparent p-3`:`fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[15vh]`,onClick:w,onKeyDown:v,children:(0,p.jsxs)(`div`,{className:`flex w-full max-w-[560px] flex-col overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] shadow-xl`,children:[O,k]})});return y===`window`?A:(0,f.createPortal)(A,document.body)};export{h as CommandPalette};
|