@marimo-team/frontend 0.25.2-dev101 → 0.25.2-dev102
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/{CellStatus-Bj7PvY_u.js → CellStatus-DEnVlt3u.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-C5UW0p9I.js → ConnectedDataExplorerComponent-DJz5EQpA.js} +1 -1
- package/dist/assets/{ErrorBoundary-CG6gtgym.js → ErrorBoundary-Do-5LLlk.js} +2 -2
- package/dist/assets/{I18nProvider-BFOBKCJB.js → I18nProvider-Cg2I_s1_.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-pCLPT6RA.js → ImageComparisonComponent-Bq-l26rq.js} +1 -1
- package/dist/assets/{Inputs-BlygJyl1.js → Inputs-BsQm29hD.js} +1 -1
- package/dist/assets/{JsonOutput-DCGUcLVV.js → JsonOutput-D6m0Rqdl.js} +6 -6
- package/dist/assets/{LazyAnyLanguageCodeMirror-CeTd_wFt.js → LazyAnyLanguageCodeMirror-CUdgB3pm.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-BEsxXqp6.js → MarimoErrorOutput-olGSMy4q.js} +1 -1
- package/dist/assets/{Plot-CNtRAZBG.js → Plot-B8w5_jU-.js} +1 -1
- package/dist/assets/{RenderHTML-C7QcdAgB.js → RenderHTML-BXeo3yt2.js} +1 -1
- package/dist/assets/{RunButton-A__3wcpF.js → RunButton-8Ejs4Lko.js} +1 -1
- package/dist/assets/__vite-browser-external-CYO_P3S8.js +1 -0
- package/dist/assets/__vite-browser-external-FeDVGZU8.js +1 -0
- package/dist/assets/{abnfDiagram-VCTEODGH-BuHNQB7l.js → abnfDiagram-VCTEODGH-3eD1PSvc.js} +1 -1
- package/dist/assets/add-cell-with-ai-BPQdPY5G.js +76 -0
- package/dist/assets/{add-connection-dialog-bl8dqCVs.js → add-connection-dialog-DI-Llgu0.js} +1 -1
- package/dist/assets/{agent-panel-BPLrf7mA.js → agent-panel-MfSWhk7J.js} +1 -1
- package/dist/assets/{ai-model-dropdown-CvJsRj9y.js → ai-model-dropdown-C_GdlhVG.js} +1 -1
- package/dist/assets/{alert-MrQXRIin.js → alert-DTaqCu_d.js} +1 -1
- package/dist/assets/{alert-dialog-DlL1c-bx.js → alert-dialog-BDikvA3p.js} +1 -1
- package/dist/assets/{any-language-editor-DtOWujZJ.js → any-language-editor-BKXUz0cR.js} +1 -1
- package/dist/assets/{api-DVLtXyp7.js → api-BbRClkEE.js} +1 -1
- package/dist/assets/{app-config-button-C7QrZbqr.js → app-config-button-B_5GomxX.js} +1 -1
- package/dist/assets/{architectureDiagram-5GKGNRK7-DvIXijdN.js → architectureDiagram-5GKGNRK7-Bx_zXJUH.js} +1 -1
- package/dist/assets/arrow-down-C9Bslqr3.js +1 -0
- package/dist/assets/arrow-left-BaPN-xbg.js +1 -0
- package/dist/assets/arrow-right-Cgit4Nk2.js +1 -0
- package/dist/assets/{badge-DFf033uX.js → badge-crT3E0Rm.js} +1 -1
- package/dist/assets/ban-YzvUro5I.js +1 -0
- package/dist/assets/{blob-Bx8A10xl.js → blob-eInu2PCR.js} +1 -1
- package/dist/assets/{blockDiagram-I7D4REHJ-DGAMO17L.js → blockDiagram-I7D4REHJ-CuwUGEGQ.js} +1 -1
- package/dist/assets/{bot-message-square-BfGaNy9r.js → bot-message-square-8xmbrehG.js} +1 -1
- package/dist/assets/{bundle.esm-CklCb9AD.js → bundle.esm-D3tw5rqW.js} +1 -1
- package/dist/assets/{button-M49xxKoi.js → button-DChj8EHR.js} +1 -1
- package/dist/assets/{c4Diagram-7LVT6UL2-qqO5IOnV.js → c4Diagram-7LVT6UL2-nj0NbEUh.js} +1 -1
- package/dist/assets/{cache-panel-BNPF4X5e.js → cache-panel-CEupBa9y.js} +1 -1
- package/dist/assets/{capabilities-BScjbYOK.js → capabilities-DbWz88Xr.js} +1 -1
- package/dist/assets/{card-BYZGhhhx.js → card-DOABds5l.js} +1 -1
- package/dist/assets/{cell-editor-C3818WlB.js → cell-editor-C-6P8s7p.js} +3 -3
- package/dist/assets/{cell-link-DC1UZQr_.js → cell-link-BdW6zSeW.js} +1 -1
- package/dist/assets/cells-Xw5dUhEN.js +220 -0
- package/dist/assets/channel-DtckUh1_.js +1 -0
- package/dist/assets/{chart-no-axes-column-B6FT5Xvu.js → chart-no-axes-column-C4_v6fQW.js} +1 -1
- package/dist/assets/{chat-display-YETh6yXV.js → chat-display-CUOpD-Fa.js} +1 -1
- package/dist/assets/{chat-panel-BZipGUZV.js → chat-panel-cm0Qz-fR.js} +1 -1
- package/dist/assets/{chat-ui-D_QL46qM.js → chat-ui-DyM7e_KQ.js} +1 -1
- package/dist/assets/check-BQNapYaf.js +1 -0
- package/dist/assets/chevron-right-eAtVhbNZ.js +1 -0
- package/dist/assets/{chunk-2E4U76K2-DqA2CBL0.js → chunk-2E4U76K2-dDf4JvCq.js} +1 -1
- package/dist/assets/{chunk-4HAMMTFA-DaFOJTOO.js → chunk-4HAMMTFA-Bhjs7H7G.js} +1 -1
- package/dist/assets/{chunk-75Z2AOVW-DEp7Wbaj.js → chunk-75Z2AOVW-DlSlUzCU.js} +1 -1
- package/dist/assets/{chunk-CLGD4ZFX-BxW11Imt.js → chunk-CLGD4ZFX-CvGMvSe-.js} +1 -1
- package/dist/assets/{chunk-DU6HZSFF-CDmPCRkr.js → chunk-DU6HZSFF-BxQd02hX.js} +2 -2
- package/dist/assets/{chunk-F27PBJKO-455JWNM3.js → chunk-F27PBJKO-DL9FG-iN.js} +1 -1
- package/dist/assets/{chunk-GMAD6QVW-ahdTJvh0.js → chunk-GMAD6QVW-B1Ai6qbk.js} +1 -1
- package/dist/assets/{chunk-GVQU2GXP-CPkYne1h.js → chunk-GVQU2GXP-a_N0QLD4.js} +1 -1
- package/dist/assets/{chunk-IMKFNOWR-fARccL86.js → chunk-IMKFNOWR-7KbFyW3C.js} +1 -1
- package/dist/assets/{chunk-L3NEJ4N5-BOK6HmaY.js → chunk-L3NEJ4N5-BcHj9aiN.js} +1 -1
- package/dist/assets/{chunk-OSK3NFVY-CEcyPnHo.js → chunk-OSK3NFVY-Dc7tMbN9.js} +1 -1
- package/dist/assets/{chunk-P2QGCYS3-Bw5LRT6S.js → chunk-P2QGCYS3-G6pmnA0z.js} +1 -1
- package/dist/assets/{chunk-POPQ4Y6H-C--NLIXc.js → chunk-POPQ4Y6H-C3iw1mOR.js} +1 -1
- package/dist/assets/{chunk-PWAF6VOD-B1mxlptQ.js → chunk-PWAF6VOD-Dy1Fp4eJ.js} +1 -1
- package/dist/assets/{chunk-SHT3W25Y-Diet96b1.js → chunk-SHT3W25Y-B3kFJuvo.js} +1 -1
- package/dist/assets/{chunk-SVP7TREG-BbcEGfNl.js → chunk-SVP7TREG-BNmfcKnL.js} +1 -1
- package/dist/assets/{chunk-TICWLB2K-BypOyFjf.js → chunk-TICWLB2K-CI3x9ENh.js} +1 -1
- package/dist/assets/{chunk-TLUHSLCS-DvvqZUl_.js → chunk-TLUHSLCS-Q72uYeUY.js} +2 -2
- package/dist/assets/{chunk-YOKDWASO-84E-_nIR.js → chunk-YOKDWASO-BIpRENEC.js} +4 -4
- package/dist/assets/{circle-Bb1IbBVn.js → circle-C2akb1qJ.js} +1 -1
- package/dist/assets/circle-check-BCurAHEb.js +1 -0
- package/dist/assets/{circle-play-X3K8DkEc.js → circle-play-CYIb0qT6.js} +1 -1
- package/dist/assets/classDiagram-ZZMXUADV-vm4wDTPy.js +1 -0
- package/dist/assets/classDiagram-v2-VYDZK3BY-vm4wDTPy.js +1 -0
- package/dist/assets/{clear-button-BGfeXcJ3.js → clear-button-p6YcvzLy.js} +1 -1
- package/dist/assets/{click-outside-container-CHoodRk9.js → click-outside-container-D_Dy5sZY.js} +1 -1
- package/dist/assets/{clipboard-paste-D0gau9Xw.js → clipboard-paste-HVpozQmt.js} +1 -1
- package/dist/assets/code-BEiQP4pS.js +1 -0
- package/dist/assets/{code-visibility-DNzJgrTz.js → code-visibility-BdQZoxDe.js} +1 -1
- package/dist/assets/{code-xml-CW65k2pN.js → code-xml-SQaZqvcO.js} +1 -1
- package/dist/assets/coerce-CpE6kUdX.js +1 -0
- package/dist/assets/{column-preview-fD3qW2B5.js → column-preview-DnfrOsz0.js} +1 -1
- package/dist/assets/{command-palette-BM9fUfEe.js → command-palette-zhHPBtSf.js} +1 -1
- package/dist/assets/{common-Cy3lJDvJ.js → common-D73JO0Wq.js} +1 -1
- package/dist/assets/{compiler-runtime-BQ9S8nyo.js → compiler-runtime-BrajqUja.js} +1 -1
- package/dist/assets/{components-D9ZIJGG8.js → components-CilFApub.js} +1 -1
- package/dist/assets/{components-ufN33X-R.js → components-DROCn9r7.js} +1 -1
- package/dist/assets/{components-M5WFQ0gs.js → components-cJdFKTNi.js} +1 -1
- package/dist/assets/{config-CR2d-XsP.js → config-BsMgc-Af.js} +1 -1
- package/dist/assets/{config-D_c_6ce1.js → config-Dg558tBx.js} +1 -1
- package/dist/assets/{config-Cyum2gRs.js → config-GC5ZXY4P.js} +1 -1
- package/dist/assets/{copy-RyCOE8jo.js → copy-Djr5m5ac.js} +1 -1
- package/dist/assets/{copy-D03Y7IMR.js → copy-JUJ9QA_Z.js} +1 -1
- package/dist/assets/{copy-icon-wfSGfX8v.js → copy-icon-Q9JyFzpC.js} +1 -1
- package/dist/assets/{createLucideIcon-rHn2EdoM.js → createLucideIcon-DfJ2oMlA.js} +1 -1
- package/dist/assets/{createReducer-W5dowuCe.js → createReducer-DrSwOnGP.js} +1 -1
- package/dist/assets/{cynefinDiagram-5FMLGOSQ-BW3uXbHa.js → cynefinDiagram-5FMLGOSQ-Cy86eSwK.js} +1 -1
- package/dist/assets/{dagre-GXQ25YYZ-DIV0whJf.js → dagre-GXQ25YYZ-CcWiU9Wf.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DuYKABwo.js → data-grid-overlay-editor-CMnBpfPb.js} +1 -1
- package/dist/assets/{database-zap-CrkOvbyN.js → database-zap-B_PMVg8T.js} +1 -1
- package/dist/assets/{datasource-Tst92Pzi.js → datasource-BYgITplH.js} +1 -1
- package/dist/assets/{dates-BgcKUsHb.js → dates-yRtWe_py.js} +1 -1
- package/dist/assets/{dependency-graph-panel-CLrAZrHA.js → dependency-graph-panel-CnTLgy5M.js} +1 -1
- package/dist/assets/{diagram-S7CK7UJ4-BzoPaaoH.js → diagram-S7CK7UJ4-hmuvh6TI.js} +1 -1
- package/dist/assets/{diagram-UQ7AKVKN-BnOSn29R.js → diagram-UQ7AKVKN-CM3XDKRP.js} +1 -1
- package/dist/assets/{diagram-VSXAHHWV-DAz8vger.js → diagram-VSXAHHWV-B8HedxR3.js} +1 -1
- package/dist/assets/{diagram-VX7I27RA-BQOZxgYE.js → diagram-VX7I27RA-D_5dmdWD.js} +1 -1
- package/dist/assets/{diagram-Z3DM3KII-B_OF69Ac.js → diagram-Z3DM3KII-DWHvDoOc.js} +1 -1
- package/dist/assets/{dist-Bqtq4wYM.js → dist-BA3i84Dc.js} +1 -1
- package/dist/assets/{dist-DoyTOIOd.js → dist-D6KQW558.js} +1 -1
- package/dist/assets/{dist-Cm7MoInu.js → dist-DR-Kwzb9.js} +1 -1
- package/dist/assets/{documentation-panel-OMUbXgKW.js → documentation-panel-BEbvRHVy.js} +1 -1
- package/dist/assets/{download-CPMAf7re.js → download-1T_TaHEn.js} +1 -1
- package/dist/assets/{dropdown-menu-B2JUUcK7.js → dropdown-menu-C7FDKIyN.js} +1 -1
- package/dist/assets/{ebnfDiagram-PWID7BFC-BbkBTazy.js → ebnfDiagram-PWID7BFC-2XbadxRe.js} +1 -1
- package/dist/assets/{edit-page-Ctwp3mZE.js → edit-page-BWiLzYCt.js} +4 -4
- package/dist/assets/{ellipsis-CLMWXUqY.js → ellipsis-63DyBLHQ.js} +1 -1
- package/dist/assets/{empty-state-CzxjZqGW.js → empty-state-BaCKb7o3.js} +1 -1
- package/dist/assets/{en-US-B4U3zuiu.js → en-US-BxZyFbza.js} +1 -1
- package/dist/assets/{erDiagram-RLTQ6QDP-DxDHwsU0.js → erDiagram-RLTQ6QDP-DbTcKdOV.js} +1 -1
- package/dist/assets/{error-banner-D1_bPN9u.js → error-banner-ByiBdwpq.js} +1 -1
- package/dist/assets/{error-entries-DBpwg0GC.js → error-entries-D0R8MKx0.js} +1 -1
- package/dist/assets/{error-panel-BgYJTJpA.js → error-panel-95y7pvyn.js} +1 -1
- package/dist/assets/{errors-D9vyuMar.js → errors-DCrsa1nH.js} +1 -1
- package/dist/assets/{es-KNLgCZL4.js → es-Cu2uFIWl.js} +1 -1
- package/dist/assets/{esm-3WkPrffD.js → esm-CI_o7NhW.js} +1 -1
- package/dist/assets/{external-link-D2lKwXyB.js → external-link-UrX9KO36.js} +1 -1
- package/dist/assets/{eye-off-CfkK-QS3.js → eye-off-CxVozGAC.js} +1 -1
- package/dist/assets/feedback-button-1oniNVeY.js +1 -0
- package/dist/assets/{feedback-button-7KY7nL-j.js → feedback-button-CKAXSfao.js} +1 -1
- package/dist/assets/{file-mCR_SMtq.js → file-BPBVl9pl.js} +1 -1
- package/dist/assets/{file-explorer-panel-HvVNt0Qs.js → file-explorer-panel-B-eNKePA.js} +1 -1
- package/dist/assets/{file-headphone-DKocX1z0.js → file-headphone-Dl35U6h3.js} +1 -1
- package/dist/assets/{file-icons-e7tmeyP-.js → file-icons-CdJgUy-I.js} +1 -1
- package/dist/assets/{file-name-input-DZehOHLA.js → file-name-input-D6lirGsV.js} +1 -1
- package/dist/assets/{fileToBase64-aqhlf6Jj.js → fileToBase64-BgBraYAr.js} +1 -1
- package/dist/assets/{floating-outline-K7cVdOlC.js → floating-outline-DMfGsFtH.js} +1 -1
- package/dist/assets/flowDiagram-HODETNUW-DR34jHUd.js +1 -0
- package/dist/assets/{formats-DkOlpVdf.js → formats-C9vPp5uk.js} +1 -1
- package/dist/assets/{formatting-Civx9FAg.js → formatting-4pz6lkuL.js} +1 -1
- package/dist/assets/{fullscreen-DEBblJKh.js → fullscreen-jiFUIqxs.js} +1 -1
- package/dist/assets/{gallery-page-DoriMrLH.js → gallery-page-DXroIvFR.js} +1 -1
- package/dist/assets/{ganttDiagram-EL5Y4UJY-BzkL5tY7.js → ganttDiagram-EL5Y4UJY-2n7Ig5Jm.js} +1 -1
- package/dist/assets/{gitGraphDiagram-WWUBYQGX-DqtmYSBS.js → gitGraphDiagram-WWUBYQGX-DxR7RNkL.js} +1 -1
- package/dist/assets/{github-khsXwCtv.js → github-DQZhN3La.js} +1 -1
- package/dist/assets/{glide-data-editor-DWyeHe3u.js → glide-data-editor-BUicmLEX.js} +4 -4
- package/dist/assets/{glide-utils-BzwA3q-e.js → glide-utils-BS0VnOoe.js} +1 -1
- package/dist/assets/{globe-CmFhHoL1.js → globe-UdPdIbF7.js} +1 -1
- package/dist/assets/{hat-glasses-DVgK5i5l.js → hat-glasses-C8RhSVii.js} +1 -1
- package/dist/assets/{highlighted-body-KPVGNVTW-DxcqwMAu.js → highlighted-body-KPVGNVTW-BBA_Oaqj.js} +1 -1
- package/dist/assets/{home-page-BcJJsD_Q.js → home-page-DOgHCPcu.js} +1 -1
- package/dist/assets/{hooks-Qxjt0Ypd.js → hooks-BIEmJNSy.js} +1 -1
- package/dist/assets/{house-CbkYoQ5W.js → house-CpsMWsLL.js} +1 -1
- package/dist/assets/{html-to-image-CFVIG1VZ.js → html-to-image-BTu9AOnj.js} +1 -1
- package/dist/assets/{icons-CVdkfEA3.js → icons-CiZ_8zS-.js} +1 -1
- package/dist/assets/{image-CTch9x2I.js → image-wZvTj8WY.js} +1 -1
- package/dist/assets/{index-CXX6l_22.css → index-Bcdzex-3.css} +1 -1
- package/dist/assets/{index-B3pNgH5o.js → index-szbIW0d7.js} +6 -6
- package/dist/assets/{infoDiagram-27XIBGKW-7rLCp1UQ.js → infoDiagram-27XIBGKW-U5Oqw16-.js} +1 -1
- package/dist/assets/{input-DPd57MDP.js → input-yy27ac_N.js} +1 -1
- package/dist/assets/{isValid-BEbe1fFs.js → isValid-BFmJHgM5.js} +1 -1
- package/dist/assets/{ishikawaDiagram-5VMMS53U-BH7XUtkN.js → ishikawaDiagram-5VMMS53U-Bob74yfq.js} +1 -1
- package/dist/assets/{journeyDiagram-3NMN7TZE-BOj0kV6v.js → journeyDiagram-3NMN7TZE-CO3wos0F.js} +1 -1
- package/dist/assets/{kanban-definition-UXKFOSKX-CPrudFOv.js → kanban-definition-UXKFOSKX-HnyRfUfJ.js} +1 -1
- package/dist/assets/katex-C9vVdkK0.js +1 -0
- package/dist/assets/{katex-DUp2KybH.js → katex-CF1UBJcr.js} +5 -5
- package/dist/assets/{kbd-BnUiViRu.js → kbd-pdKBv96t.js} +1 -1
- package/dist/assets/kiosk-mode-w1ttIhaj.js +1 -0
- package/dist/assets/{layout-CSLw6wGo.js → layout-BjyooGPM.js} +4 -4
- package/dist/assets/{link-BF4dGmOQ.js → link-NuFVR7G9.js} +1 -1
- package/dist/assets/links-DGdgjb3Z.js +1 -0
- package/dist/assets/{logs-panel-OkoO5mbN.js → logs-panel-DoU6Ytrb.js} +1 -1
- package/dist/assets/loro_wasm_bg-C2Fqi8D-.js +1 -0
- package/dist/assets/loro_wasm_bg-CSolyDSZ.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Ctp2cNI9.js +1 -0
- package/dist/assets/{marimo-icons-B_1oPpIE.js → marimo-icons-CqliHyTr.js} +1 -1
- package/dist/assets/{markdown-renderer-mDlWBE1M.js → markdown-renderer-DxC_F-8p.js} +2 -2
- package/dist/assets/{menu-items-DAaNKHJF.js → menu-items-CF54rXpT.js} +1 -1
- package/dist/assets/mermaid-HWGCJPDP-B7ByBG-a.js +1 -0
- package/dist/assets/{mermaid-CX6aTquk.js → mermaid-rlHAAuye.js} +3 -3
- package/dist/assets/{message-circle-OTHnVlxO.js → message-circle-C3rKm8_a.js} +1 -1
- package/dist/assets/{mhchem-hMh9XtQZ.js → mhchem-B6WrVrmp.js} +1 -1
- package/dist/assets/{mindmap-definition-YA3MSWOX-kWyI8sXl.js → mindmap-definition-YA3MSWOX-Tl5cqnHr.js} +1 -1
- package/dist/assets/{multi-icon-DWzZu-9u.js → multi-icon-DL465pPF.js} +1 -1
- package/dist/assets/{name-cell-input-D_Q2IhP9.js → name-cell-input-C1aKbjLf.js} +1 -1
- package/dist/assets/{number-overlay-editor-myrryj7o.js → number-overlay-editor-DS8xi0jE.js} +1 -1
- package/dist/assets/{numbers-BEfBaQtu.js → numbers-DZJTimMO.js} +1 -1
- package/dist/assets/{outline-panel-Dy2cmYDF.js → outline-panel-QDpdk6qa.js} +1 -1
- package/dist/assets/{package-BeYhVWvM.js → package-GSoSTiIK.js} +1 -1
- package/dist/assets/{package-data-BwaspaKJ.js → package-data-dv4FBHxR.js} +1 -1
- package/dist/assets/{packages-panel-CIvhx0hb.js → packages-panel-BRhXzYs7.js} +1 -1
- package/dist/assets/pair-CaQyK6En.js +1 -0
- package/dist/assets/{panel-accordion-state-BI4SU22L.js → panel-accordion-state-DDRWEHcb.js} +1 -1
- package/dist/assets/{panel-context-BPaQeOuV.js → panel-context-C2QXpKfx.js} +1 -1
- package/dist/assets/{panels-BdsXFz1w.js → panels-CQTeIpws.js} +1 -1
- package/dist/assets/{pathUtils-BKesuhdv.js → pathUtils-DPmlLd-r.js} +1 -1
- package/dist/assets/{paths-CzfpItSz.js → paths-bkIFVj8h.js} +1 -1
- package/dist/assets/{pegDiagram-XKGWAZYB-CiBJGPte.js → pegDiagram-XKGWAZYB-a0itOiYa.js} +1 -1
- package/dist/assets/{pieDiagram-E7YTZNPT-RpjpKhU6.js → pieDiagram-E7YTZNPT-DFve8H9P.js} +1 -1
- package/dist/assets/plus-C5silF6g.js +1 -0
- package/dist/assets/process-output-DpkQbJ94.js +1 -0
- package/dist/assets/{quadrantDiagram-AXDQQJYC-Ci_qzCqs.js → quadrantDiagram-AXDQQJYC-yBhCDI7E.js} +1 -1
- package/dist/assets/{railroadDiagram-O6MQD6OU-B2IWK3fJ.js → railroadDiagram-O6MQD6OU-CgwdYhrd.js} +1 -1
- package/dist/assets/react-DVplv7_D.js +1 -0
- package/dist/assets/react-dom-_LrxgvjW.js +1 -0
- package/dist/assets/{react-icons.esm-C6SMwKZH.js → react-icons.esm-D6tfmvq8.js} +1 -1
- package/dist/assets/{react-resizable-panels.browser.esm-BL2E7f5c.js → react-resizable-panels.browser.esm-Dbe0MrFr.js} +1 -1
- package/dist/assets/{react-vega-Jq3Jd7eX.js → react-vega-C3rYGtP6.js} +1 -1
- package/dist/assets/{readonly-code-display-CNbw6v1-.js → readonly-code-display-CSCZ_N15.js} +1 -1
- package/dist/assets/{readonly-python-code-DcYhdd1B.js → readonly-python-code-BBD9x9Wb.js} +1 -1
- package/dist/assets/{refresh-cw-CEGpOrzd.js → refresh-cw-Qw1f8Jhy.js} +1 -1
- package/dist/assets/{renderShortcut-BnRfkbwf.js → renderShortcut-DqWt7rin.js} +1 -1
- package/dist/assets/requests-CgSY1X4a.js +1 -0
- package/dist/assets/{requests-yTHMxhVa.js → requests-lt0JK8Jt.js} +1 -1
- package/dist/assets/{requirementDiagram-BXWQKSXE-B0_CyV0T.js → requirementDiagram-BXWQKSXE-BCDzS-aV.js} +1 -1
- package/dist/assets/reveal-component-C_-OTm_u.js +1069 -0
- package/dist/assets/{reveal-component-wEV_sB3u.css → reveal-component-DMRR6gKy.css} +1 -1
- package/dist/assets/{rotate-ccw-se3Oa1US.js → rotate-ccw-D8WCVWNE.js} +1 -1
- package/dist/assets/{rotate-cw-BcRERxHa.js → rotate-cw-CZ2syZTu.js} +1 -1
- package/dist/assets/{run-page-CVWospEP.js → run-page-Dvf3L-I6.js} +1 -1
- package/dist/assets/{runs-DyluVj69.js → runs-CxC4Npl4.js} +1 -1
- package/dist/assets/{runtime-details-state-lxXYwJcI.js → runtime-details-state-CBHzmgRd.js} +1 -1
- package/dist/assets/{sankeyDiagram-P5KCCOFB-BekzhMvv.js → sankeyDiagram-P5KCCOFB-byYeKbB2.js} +1 -1
- package/dist/assets/{save-D4cG4pP2.js → save-Dgoim6QF.js} +1 -1
- package/dist/assets/save-worker-BbUSwZRG.js +118 -0
- package/dist/assets/schemas-Dv42wLFq.js +56 -0
- package/dist/assets/{scratchpad-panel-B4qlmwP-.js → scratchpad-panel-BijBTGEY.js} +1 -1
- package/dist/assets/{scroll-to-bottom-button-Dmrd5bjQ.js → scroll-to-bottom-button-DqsGuQjT.js} +1 -1
- package/dist/assets/{secrets-panel-DT1Nansx.js → secrets-panel-CZOrUl1k.js} +1 -1
- package/dist/assets/{select-BwRFbZty.js → select-CzZDBjEw.js} +1 -1
- package/dist/assets/{sequenceDiagram-WJ2MYXX4-DELi1Kz5.js → sequenceDiagram-WJ2MYXX4-CLLPBM4B.js} +1 -1
- package/dist/assets/{session-BykGt6S3.js → session-BTcQqCNB.js} +1 -1
- package/dist/assets/{session-panel-Ch5jQNj0.js → session-panel-Cw84UtPa.js} +1 -1
- package/dist/assets/{settings-DlKTeV_0.js → settings-BpdQZRgT.js} +1 -1
- package/dist/assets/{shell-BSnvn9t7.js → shell-Fj8a65ii.js} +1 -1
- package/dist/assets/{shim-5li_pJY_.js → shim-CjjJUhDo.js} +1 -1
- package/dist/assets/{skeleton-CKpBjoLm.js → skeleton-Cqh4O9g1.js} +1 -1
- package/dist/assets/{snippets-panel-YttkYAW9.js → snippets-panel-VkVKbwvG.js} +1 -1
- package/dist/assets/{spec-D9d9nT0z.js → spec-CBbROlNQ.js} +1 -1
- package/dist/assets/{spinner-CGdRKCnw.js → spinner-DyNE-o8o.js} +1 -1
- package/dist/assets/square-BPmgQFnh.js +1 -0
- package/dist/assets/{square-function-DyFIOFp5.js → square-function-_W_Lo0P4.js} +1 -1
- package/dist/assets/{state-B2ZbImvm.js → state-6DcRdYQO.js} +1 -1
- package/dist/assets/{state-BxLm8vme.js → state-B8tH8dhU.js} +1 -1
- package/dist/assets/{state-sbCCk7ZP.js → state-CXB5HFtg.js} +2 -2
- package/dist/assets/{state-BI0fn_YF.js → state-Cd4sIrz6.js} +1 -1
- package/dist/assets/{state-ja7GWeCS.js → state-Dk6fQvT5.js} +1 -1
- package/dist/assets/state-SKZBEEH0.js +1 -0
- package/dist/assets/{stateDiagram-D77RDMKH-udui7EYS.js → stateDiagram-D77RDMKH-BeIsqkgQ.js} +1 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-YdOj4q4D.js +1 -0
- package/dist/assets/{strings-hlCLC-K1.js → strings-qs8UKdp4.js} +1 -1
- package/dist/assets/{swimlanes-42K2YHIH-C-iTrYJs.js → swimlanes-42K2YHIH-CIhaeNCx.js} +1 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-BLZbCKkx.js +8 -0
- package/dist/assets/{swiper-component-eXUBvFuA.js → swiper-component-CPwtfJ-K.js} +1 -1
- package/dist/assets/{switch-C-83e2fG.js → switch-Bjqg8S6f.js} +1 -1
- package/dist/assets/{table-B7KYyTxw.js → table-DG7Ap4H4.js} +1 -1
- package/dist/assets/{table-Dg1KxH-q.js → table-vrvqpuKJ.js} +1 -1
- package/dist/assets/{tabs-QRT1DYjj.js → tabs-GKfobU8o.js} +1 -1
- package/dist/assets/{terminal-3hxM6K9q.js → terminal-CU3vJwnx.js} +1 -1
- package/dist/assets/{timeline-definition-24CTP7MA-D2u0nOZp.js → timeline-definition-24CTP7MA-BSH7-Tss.js} +1 -1
- package/dist/assets/{toDate-BbJ1_N2T.js → toDate-DaZHg4Of.js} +1 -1
- package/dist/assets/{toast-BRwEbWb6.js → toast-Co8MsTka.js} +1 -1
- package/dist/assets/{tooltip-B5pI8o2n.js → tooltip-BE7PMp0A.js} +1 -1
- package/dist/assets/{tooltip-BeP4eX87.js → tooltip-BSH8ID1U.js} +1 -1
- package/dist/assets/{tracing-DZYfCw6p.js → tracing-CgXDV1KE.js} +1 -1
- package/dist/assets/tracing-panel-DcChLy1j.js +2 -0
- package/dist/assets/{trash-2-BJG-7Qob.js → trash-2-DcgaW8fn.js} +1 -1
- package/dist/assets/{trash-BKbZYRHl.js → trash-ChRHEGfM.js} +1 -1
- package/dist/assets/{tree-actions-D5clvgKl.js → tree-actions-BodA78qW.js} +1 -1
- package/dist/assets/{triangle-alert-BeRqoThc.js → triangle-alert-DmIqR8sY.js} +1 -1
- package/dist/assets/{use-restore-focus-GUh2Nd8Z.js → use-restore-focus-BrMXwd90.js} +1 -1
- package/dist/assets/{use-toast-CC89xOwH.js → use-toast-Wu434mLr.js} +1 -1
- package/dist/assets/{use-vega-container-remeasure-CS3c8wGN.js → use-vega-container-remeasure-BpmHehNK.js} +1 -1
- package/dist/assets/{useAddCell-Bhv6GT3m.js → useAddCell-qjWEyEcN.js} +1 -1
- package/dist/assets/{useAsyncData-DucTwMkf.js → useAsyncData-C7aJJz0Y.js} +1 -1
- package/dist/assets/{useBoolean-Co-_MyFz.js → useBoolean-Ba54lbUx.js} +1 -1
- package/dist/assets/{useCellActionButton-BTsPn8Dv.js → useCellActionButton-X2duul2K.js} +1 -1
- package/dist/assets/{useDateFormatter-CTYCgKB-.js → useDateFormatter-DA-62E-Y.js} +1 -1
- package/dist/assets/{useDebounce-DMbg9X18.js → useDebounce-B_ccBZTp.js} +1 -1
- package/dist/assets/useDeepCompareMemoize-DFIVN9dn.js +1 -0
- package/dist/assets/{useDeleteCell-BKN7t4DH.js → useDeleteCell-B_VW2kZL.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BTsnw2rN.js → useDependencyPanelTab-D19WNxWt.js} +1 -1
- package/dist/assets/{useEvent-Dc9HkKI2.js → useEvent-Dfcbgjhg.js} +1 -1
- package/dist/assets/{useEventListener-IRzG-0mH.js → useEventListener-D6VFA611.js} +1 -1
- package/dist/assets/useIframeCapabilities-LLEnCTQu.js +1 -0
- package/dist/assets/{useInstallPackage-HTUlGg0U.js → useInstallPackage-BUkJUBVF.js} +1 -1
- package/dist/assets/{useInterval-D1QGqQ_I.js → useInterval-BbBdNZZ3.js} +1 -1
- package/dist/assets/{useLifecycle-DKSBdWUf.js → useLifecycle-Mq4gc5kS.js} +1 -1
- package/dist/assets/{useNotebookActions-BzJtySGp.js → useNotebookActions-LmkoQVx8.js} +1 -1
- package/dist/assets/{useNumberFormatter-BP99Zbyy.js → useNumberFormatter-D7O_26UI.js} +1 -1
- package/dist/assets/{useRunCells-zMO43eNR.js → useRunCells-BqqsYDRD.js} +1 -1
- package/dist/assets/useSplitCell-Li1R8yWS.js +1 -0
- package/dist/assets/{useTheme-BkPLyRl9.js → useTheme-Cky-nQHA.js} +1 -1
- package/dist/assets/{vega-component-Chbfi__Q.js → vega-component-BLs4secb.js} +1 -1
- package/dist/assets/vega-embed-container-DJPNkHPb.js +1 -0
- package/dist/assets/{vennDiagram-4TSXK5OY-BKSHsv-w.js → vennDiagram-4TSXK5OY-DsmfChmC.js} +1 -1
- package/dist/assets/{wardleyDiagram-VM6X3IG4-CUDQDDoy.js → wardleyDiagram-VM6X3IG4-BDZlVpJI.js} +1 -1
- package/dist/assets/worker-DTQ7oH2A.js +158 -0
- package/dist/assets/{workflow-nBi9HGeO.js → workflow-cw-0b9g5.js} +1 -1
- package/dist/assets/{write-secret-modal-BcosCmZy.js → write-secret-modal-D1_0dXkm.js} +1 -1
- package/dist/assets/{xychartDiagram-S5SC5T6Z-BXDsTxGu.js → xychartDiagram-S5SC5T6Z-KbGzG6-u.js} +1 -1
- package/dist/assets/{youtube-2MBs34oQ.js → youtube-CbJhsgLy.js} +1 -1
- package/dist/index.html +123 -123
- package/package.json +19 -19
- package/src/components/editor/output/console/ConsoleOutput.tsx +5 -3
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +18 -0
- package/src/css/katex-css.test.ts +1 -1
- package/src/css/katex.min.css +6 -1
- package/dist/assets/__vite-browser-external-BgsHWynV.js +0 -1
- package/dist/assets/__vite-browser-external-DMJaCYJh.js +0 -1
- package/dist/assets/add-cell-with-ai-Wyt6GBhk.js +0 -76
- package/dist/assets/arrow-down-BFFrjzad.js +0 -1
- package/dist/assets/arrow-left-DzPJ79ZB.js +0 -1
- package/dist/assets/arrow-right-xoNT7eIQ.js +0 -1
- package/dist/assets/ban-3HAzm9Fj.js +0 -1
- package/dist/assets/cells-CxY8RSp7.js +0 -220
- package/dist/assets/channel-DXBvxHxq.js +0 -1
- package/dist/assets/check-Wea4hZ6R.js +0 -1
- package/dist/assets/chevron-right-DOPs2jx8.js +0 -1
- package/dist/assets/circle-check-BF80fXZd.js +0 -1
- package/dist/assets/classDiagram-ZZMXUADV--9ShP1h2.js +0 -1
- package/dist/assets/classDiagram-v2-VYDZK3BY--9ShP1h2.js +0 -1
- package/dist/assets/code-DW4kNwKG.js +0 -1
- package/dist/assets/coerce-CZiN7rQ_.js +0 -1
- package/dist/assets/feedback-button-DxjoRfo3.js +0 -1
- package/dist/assets/flowDiagram-HODETNUW-BGVnBaF-.js +0 -1
- package/dist/assets/katex-CQIbPNPT.js +0 -1
- package/dist/assets/kiosk-mode-DCHo0R3W.js +0 -1
- package/dist/assets/links-BJx6KCyC.js +0 -1
- package/dist/assets/loro_wasm_bg-PyJsS6iH.wasm +0 -0
- package/dist/assets/loro_wasm_bg-Vo2IoHaL.js +0 -1
- package/dist/assets/loro_wasm_bg-oTW3uoGB.js +0 -1
- package/dist/assets/mermaid-HWGCJPDP-Bk1fR60Q.js +0 -1
- package/dist/assets/pair-_FSgYVX4.js +0 -1
- package/dist/assets/plus-gbN72xHe.js +0 -1
- package/dist/assets/process-output-Crm0vqbi.js +0 -1
- package/dist/assets/react-CUdNIagt.js +0 -1
- package/dist/assets/react-dom-CKsE8sC1.js +0 -1
- package/dist/assets/requests-DFPPfagc.js +0 -1
- package/dist/assets/reveal-component-B5GUiD5Q.js +0 -1069
- package/dist/assets/save-worker-C880NC3o.js +0 -113
- package/dist/assets/schemas-BL-NsLlF.js +0 -51
- package/dist/assets/square-DvOKKLHZ.js +0 -1
- package/dist/assets/state-YaAkDV8S.js +0 -1
- package/dist/assets/stateDiagram-v2-MP3YSRHH-BhduIvF1.js +0 -1
- package/dist/assets/swimlanesDiagram-VR7AAH4N-WC2Zewqb.js +0 -8
- package/dist/assets/tracing-panel-BUPJ77jB.js +0 -2
- package/dist/assets/useDeepCompareMemoize-DSlTt6u_.js +0 -1
- package/dist/assets/useIframeCapabilities-yd8sMuIo.js +0 -1
- package/dist/assets/useSplitCell-xEtFLByO.js +0 -1
- package/dist/assets/vega-embed-container-CRZZ4FTx.js +0 -1
- package/dist/assets/worker-B5tVfGoh.js +0 -153
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{t as r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{t as a}from"./compiler-runtime-BQ9S8nyo.js";import{_ as o}from"./useEventListener-IRzG-0mH.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{o as c}from"./alert-dialog-DlL1c-bx.js";import{a as l,p as u,r as d,t as f}from"./dropdown-menu-B2JUUcK7.js";import{t as p}from"./createLucideIcon-rHn2EdoM.js";import{t as m}from"./paths-CzfpItSz.js";import{n as h,t as g}from"./tree-actions-D5clvgKl.js";import{t as _}from"./copy-RyCOE8jo.js";import{b as v}from"./write-secret-modal-BcosCmZy.js";import{t as ee}from"./trash-2-BJG-7Qob.js";import{t as y}from"./use-toast-CC89xOwH.js";import{r as te}from"./requests-yTHMxhVa.js";import{t as ne}from"./shim-5li_pJY_.js";import{a as re}from"./errors-D9vyuMar.js";import{t as ie}from"./extends-CvVTau-c.js";import{i as ae,n as oe,r as b}from"./pathUtils-BKesuhdv.js";import{n as se}from"./semaphore-BjoL5P0h.js";var ce=p(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),le=n(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),x=s(),S=e(i(),1),ue=(0,S.createContext)({dragDropManager:void 0});function C(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var de=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),fe=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},pe={INIT:`@@redux/INIT`+fe(),REPLACE:`@@redux/REPLACE`+fe(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+fe()}};function me(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function he(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(C(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(C(1));return n(he)(e,t)}if(typeof e!=`function`)throw Error(C(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(C(3));return a}function d(e){if(typeof e!=`function`)throw Error(C(4));if(c)throw Error(C(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(C(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!me(e))throw Error(C(7));if(e.type===void 0)throw Error(C(8));if(c)throw Error(C(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(C(10));i=e,f({type:pe.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(C(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[de]=function(){return this},e}return f({type:pe.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[de]=m,r}function w(e,t,...n){if(ge()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function ge(){return typeof process<`u`&&!0}function _e(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function ve(e,t){return e.filter(e=>e!==t)}function ye(e){return typeof e==`object`}function be(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function xe(e,t){return e.filter(e=>t.indexOf(e)>-1)}var Se=`dnd-core/INIT_COORDS`,Ce=`dnd-core/BEGIN_DRAG`,we=`dnd-core/PUBLISH_DRAG_SOURCE`,T=`dnd-core/HOVER`,E=`dnd-core/DROP`,D=`dnd-core/END_DRAG`;function Te(e,t){return{type:Se,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Ee={type:Se,payload:{clientOffset:null,sourceClientOffset:null}};function De(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Te(i)),Oe(t,o,s);let c=je(t,o);if(c==null){e.dispatch(Ee);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);ke(a),l=a(c)}e.dispatch(Te(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Ae(u),s.pinSource(c),{type:Ce,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Oe(e,t,n){w(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){w(n.getSource(e),`Expected sourceIds to be registered.`)})}function ke(e){w(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Ae(e){w(ye(e),`Item must be an object.`)}function je(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Me(e,t,n[t])})}return e}function Pe(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Fe(n),Re(n).forEach((i,a)=>{let o={type:E,payload:{dropResult:Ne({},t,Ie(i,a,r,n))}};e.dispatch(o)})}}function Fe(e){w(e.isDragging(),`Cannot call drop while not dragging.`),w(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Ie(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Le(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Le(e){w(e===void 0||ye(e),`Drop result must either be an object or undefined.`)}function Re(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ze(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Be(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:D}}}function Be(e){w(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Ve(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function He(e){return function(t,{clientOffset:n}={}){Ue(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return Ge(r,a,i.getItemType()),We(r,i,a),Ke(r,i,a),{type:T,payload:{targetIds:r,clientOffset:n||null}}}}function Ue(e){w(Array.isArray(e),`Expected targetIds to be an array.`)}function We(e,t,n){w(t.isDragging(),`Cannot call hover while not dragging.`),w(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];w(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),w(n.getTarget(r),`Expected targetIds to be registered.`)}}function Ge(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];Ve(t.getTargetType(i),n)||e.splice(r,1)}}function Ke(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function qe(e){return function(){if(e.getMonitor().isDragging())return{type:we}}}function Je(e){return{beginDrag:De(e),publishDragSource:qe(e),hover:He(e),drop:Pe(e),endDrag:ze(e)}}var Ye=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Je(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Xe(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Ze(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qe(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:Ze(Xe(t,r),n)}function $e(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Ze(t,n)}var O=[],et=[];O.__IS_NONE__=!0,et.__IS_ALL__=!0;function tt(e,t){return e===O?!1:e===et||t===void 0||xe(t,e).length>0}var nt=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;w(typeof e==`function`,`listener must be a function.`),w(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!tt(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){w(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return w(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return w(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return w(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Ve(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Qe(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return $e(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},rt=typeof global<`u`?global:self,it=rt.MutationObserver||rt.WebKitMutationObserver;function at(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ot(e){let t=1,n=new it(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var st=typeof it==`function`?ot:at,ct=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=st(this.flush),this.requestErrorThrow=at(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},lt=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},ut=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new lt(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},dt=new ct,ft=new ut(dt.registerPendingError);function pt(e){dt.enqueueTask(ft.create(e))}var mt=`dnd-core/ADD_SOURCE`,ht=`dnd-core/ADD_TARGET`,gt=`dnd-core/REMOVE_SOURCE`,k=`dnd-core/REMOVE_TARGET`;function _t(e){return{type:mt,payload:{sourceId:e}}}function vt(e){return{type:ht,payload:{targetId:e}}}function yt(e){return{type:gt,payload:{sourceId:e}}}function bt(e){return{type:k,payload:{targetId:e}}}function xt(e){w(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),w(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),w(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function St(e){w(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),w(typeof e.hover==`function`,`Expected hover to be a function.`),w(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Ct(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Ct(e,!1));return}w(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var A;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(A||={});var wt=0;function Tt(){return wt++}function Et(e){let t=Tt().toString();switch(e){case A.SOURCE:return`S${t}`;case A.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Dt(e){switch(e[0]){case`S`:return A.SOURCE;case`T`:return A.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function Ot(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var kt=class{addSource(e,t){Ct(e),xt(t);let n=this.addHandler(A.SOURCE,e,t);return this.store.dispatch(_t(n)),n}addTarget(e,t){Ct(e,!0),St(t);let n=this.addHandler(A.TARGET,e,t);return this.store.dispatch(vt(n)),n}containsHandler(e){return Ot(this.dragSources,e)||Ot(this.dropTargets,e)}getSource(e,t=!1){return w(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return w(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return w(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return w(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Dt(e)===A.SOURCE}isTargetId(e){return Dt(e)===A.TARGET}removeSource(e){w(this.getSource(e),`Expected an existing source.`),this.store.dispatch(yt(e)),pt(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){w(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(bt(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);w(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){w(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Et(e);return this.types.set(r,t),e===A.SOURCE?this.dragSources.set(r,n):e===A.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},At=(e,t)=>e===t;function jt(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Mt(e,t,n=At){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Nt(e=O,t){switch(t.type){case T:break;case mt:case ht:case k:case gt:return O;case Ce:case we:case D:case E:default:return et}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=be(n,r);if(!(i.length>0||!Mt(n,r)))return O;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Pt(e,t,n[t])})}return e}var It={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Lt(e=It,t){let{payload:n}=t;switch(t.type){case Se:case Ce:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case T:return jt(e.clientOffset,n.clientOffset)?e:Ft({},e,{clientOffset:n.clientOffset});case D:case E:return It;default:return e}}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Rt(e,t,n[t])})}return e}var zt={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Bt(e=zt,t){let{payload:n}=t;switch(t.type){case Ce:return j({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case we:return j({},e,{isSourcePublic:!0});case T:return j({},e,{targetIds:n.targetIds});case k:return e.targetIds.indexOf(n.targetId)===-1?e:j({},e,{targetIds:ve(e.targetIds,n.targetId)});case E:return j({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case D:return j({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Vt(e=0,t){switch(t.type){case mt:case ht:return e+1;case gt:case k:return e-1;default:return e}}function Ht(e=0){return e+1}function Ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Ut(e,t,n[t])})}return e}function Gt(e={},t){return{dirtyHandlerIds:Nt(e.dirtyHandlerIds,{type:t.type,payload:Wt({},t.payload,{prevTargetIds:_e(e,`dragOperation.targetIds`,[])})}),dragOffset:Lt(e.dragOffset,t),refCount:Vt(e.refCount,t),dragOperation:Bt(e.dragOperation,t),stateId:Ht(e.stateId)}}function Kt(e,t=void 0,n={},r=!1){let i=qt(r),a=new Ye(i,new nt(i,new kt(i))),o=e(a,t,n);return a.receiveBackend(o),a}function qt(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return he(Gt,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}function Jt(e,t){if(e==null)return{};var n=Yt(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Xt=0,Zt=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),Qt=(0,S.memo)(function(e){var{children:t}=e;let[n,r]=$t(Jt(e,[`children`]));return(0,S.useEffect)(()=>{if(r){let e=tn();return++Xt,()=>{--Xt===0&&(e[Zt]=null)}}},[]),(0,x.jsx)(ue.Provider,{value:n,children:t})});function $t(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[en(e.backend,e.context,e.options,e.debugMode),!e.context]}function en(e,t=tn(),n,r){let i=t;return i[Zt]||(i[Zt]={dragDropManager:Kt(e,t,n,r)}),i[Zt]}function tn(){return typeof global<`u`?global:window}var nn=e(le(),1),M=typeof window<`u`?S.useLayoutEffect:S.useEffect;function rn(e,t,n){let[r,i]=(0,S.useState)(()=>t(e)),a=(0,S.useCallback)(()=>{let a=t(e);(0,nn.default)(r,a)||(i(a),n&&n())},[r,e,n]);return M(a),[r,a]}function an(e,t,n){let[r,i]=rn(e,t,n);return M(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function on(e,t,n){return an(t,e||(()=>({})),()=>n.reconnect())}function sn(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),(0,S.useMemo)(()=>typeof e==`function`?e():e,n)}function cn(e){return(0,S.useMemo)(()=>e.hooks.dragSource(),[e])}function ln(e){return(0,S.useMemo)(()=>e.hooks.dragPreview(),[e])}var un=!1,dn=!1,fn=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){w(!un,`You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return un=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{un=!1}}isDragging(){if(!this.sourceId)return!1;w(!dn,`You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return dn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{dn=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},pn=!1,mn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;w(!pn,`You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor`);try{return pn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{pn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function hn(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function gn(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function _n(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o<a.length;o++){let c=a[o];if(!s(c))return!1;let l=e[c],u=t[c];if(i=n?n.call(r,l,u,c):void 0,i===!1||i===void 0&&l!==u)return!1}return!0}function vn(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`current`)}function yn(e){if(typeof e.type==`string`)return;let t=e.type.displayName||e.type.name||`the component`;throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function bn(e){return(t=null,n=null)=>{if(!(0,S.isValidElement)(t)){let r=t;return e(r,n),r}let r=t;return yn(r),Cn(r,n?t=>e(t,n):e)}}function xn(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=bn(r);t[n]=()=>e}}),t}function Sn(e,t){typeof e==`function`?e(t):e.current=t}function Cn(e,t){let n=e.ref;return w(typeof n!=`string`,`Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs`),n?(0,S.cloneElement)(e,{ref:e=>{Sn(n,e),Sn(t,e)}}):(0,S.cloneElement)(e,{ref:t})}var wn=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!_n(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!_n(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&=(this.dragSourceUnsubscribe(),void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=xn({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,vn(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,vn(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},Tn=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!_n(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=xn({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,vn(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function N(){let{dragDropManager:e}=(0,S.useContext)(ue);return w(e!=null,`Expected drag drop context`),e}function En(e,t){let n=N(),r=(0,S.useMemo)(()=>new wn(n.getBackend()),[n]);return M(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),M(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function Dn(){let e=N();return(0,S.useMemo)(()=>new fn(e),[e])}var On=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag!=`function`||e.canDrag(t)}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};function kn(e,t,n){let r=(0,S.useMemo)(()=>new On(e,t,n),[t,n]);return(0,S.useEffect)(()=>{r.spec=e},[e]),r}function An(e){return(0,S.useMemo)(()=>{let t=e.type;return w(t!=null,`spec.type must be defined`),t},[e])}function jn(e,t,n){let r=N(),i=kn(e,t,n),a=An(e);M(function(){if(a!=null){let[e,o]=gn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Mn(e,t){let n=sn(e,t);w(!n.begin,`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`);let r=Dn(),i=En(n.options,n.previewOptions);return jn(n,r,i),[on(n.collect,r,i),cn(i),ln(i)]}function Nn(e){let t=N().getMonitor(),[n,r]=rn(t,e);return(0,S.useEffect)(()=>t.subscribeToOffsetChange(r)),(0,S.useEffect)(()=>t.subscribeToStateChange(r)),n}function Pn(e){return(0,S.useMemo)(()=>e.hooks.dropTarget(),[e])}function Fn(e){let t=N(),n=(0,S.useMemo)(()=>new Tn(t.getBackend()),[t]);return M(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function In(){let e=N();return(0,S.useMemo)(()=>new mn(e),[e])}function Ln(e){let{accept:t}=e;return(0,S.useMemo)(()=>(w(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var Rn=class{canDrop(){let e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function zn(e,t){let n=(0,S.useMemo)(()=>new Rn(e,t),[t]);return(0,S.useEffect)(()=>{n.spec=e},[e]),n}function Bn(e,t,n){let r=N(),i=zn(e,t),a=Ln(e);M(function(){let[e,o]=hn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function Vn(e,t){let n=sn(e,t),r=In(),i=Fn(n.options);return Bn(n,r,i),[on(n.collect,r,i),Pn(i)]}var Hn=ne();function Un(e){let t=null;return()=>(t??=e(),t)}function Wn(e,t){return e.filter(e=>e!==t)}function Gn(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var Kn=class{enter(e){let t=this.entered.length,n=t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e));return this.entered=Gn(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Wn(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},qn=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},Jn=t({FILE:()=>Yn,HTML:()=>Qn,TEXT:()=>Zn,URL:()=>Xn}),Yn=`__NATIVE_FILE__`,Xn=`__NATIVE_URL__`,Zn=`__NATIVE_TEXT__`,Qn=`__NATIVE_HTML__`;function $n(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var er={[Yn]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[Qn]:{exposeProperties:{html:(e,t)=>$n(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[Xn]:{exposeProperties:{urls:(e,t)=>$n(e,t,``).split(`
|
|
1
|
+
import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{t as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{_ as o}from"./useEventListener-D6VFA611.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{o as c}from"./alert-dialog-BDikvA3p.js";import{a as l,p as u,r as d,t as f}from"./dropdown-menu-C7FDKIyN.js";import{t as p}from"./createLucideIcon-DfJ2oMlA.js";import{t as m}from"./paths-bkIFVj8h.js";import{n as h,t as g}from"./tree-actions-BodA78qW.js";import{t as _}from"./copy-Djr5m5ac.js";import{b as v}from"./write-secret-modal-D1_0dXkm.js";import{t as ee}from"./trash-2-DcgaW8fn.js";import{t as y}from"./use-toast-Wu434mLr.js";import{r as te}from"./requests-lt0JK8Jt.js";import{t as ne}from"./shim-CjjJUhDo.js";import{a as re}from"./errors-DCrsa1nH.js";import{t as ie}from"./extends-CvVTau-c.js";import{i as ae,n as oe,r as b}from"./pathUtils-DPmlLd-r.js";import{n as se}from"./semaphore-BjoL5P0h.js";var ce=p(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),le=n(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),x=s(),S=e(i(),1),ue=(0,S.createContext)({dragDropManager:void 0});function C(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var de=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),fe=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},pe={INIT:`@@redux/INIT`+fe(),REPLACE:`@@redux/REPLACE`+fe(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+fe()}};function me(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function he(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(C(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(C(1));return n(he)(e,t)}if(typeof e!=`function`)throw Error(C(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(C(3));return a}function d(e){if(typeof e!=`function`)throw Error(C(4));if(c)throw Error(C(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(C(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!me(e))throw Error(C(7));if(e.type===void 0)throw Error(C(8));if(c)throw Error(C(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(C(10));i=e,f({type:pe.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(C(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[de]=function(){return this},e}return f({type:pe.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[de]=m,r}function w(e,t,...n){if(ge()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function ge(){return typeof process<`u`&&!0}function _e(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function ve(e,t){return e.filter(e=>e!==t)}function ye(e){return typeof e==`object`}function be(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function xe(e,t){return e.filter(e=>t.indexOf(e)>-1)}var Se=`dnd-core/INIT_COORDS`,Ce=`dnd-core/BEGIN_DRAG`,we=`dnd-core/PUBLISH_DRAG_SOURCE`,T=`dnd-core/HOVER`,E=`dnd-core/DROP`,D=`dnd-core/END_DRAG`;function Te(e,t){return{type:Se,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Ee={type:Se,payload:{clientOffset:null,sourceClientOffset:null}};function De(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Te(i)),Oe(t,o,s);let c=je(t,o);if(c==null){e.dispatch(Ee);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);ke(a),l=a(c)}e.dispatch(Te(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Ae(u),s.pinSource(c),{type:Ce,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Oe(e,t,n){w(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){w(n.getSource(e),`Expected sourceIds to be registered.`)})}function ke(e){w(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Ae(e){w(ye(e),`Item must be an object.`)}function je(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Me(e,t,n[t])})}return e}function Pe(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Fe(n),Re(n).forEach((i,a)=>{let o={type:E,payload:{dropResult:Ne({},t,Ie(i,a,r,n))}};e.dispatch(o)})}}function Fe(e){w(e.isDragging(),`Cannot call drop while not dragging.`),w(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Ie(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Le(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Le(e){w(e===void 0||ye(e),`Drop result must either be an object or undefined.`)}function Re(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ze(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Be(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:D}}}function Be(e){w(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Ve(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function He(e){return function(t,{clientOffset:n}={}){Ue(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return Ge(r,a,i.getItemType()),We(r,i,a),Ke(r,i,a),{type:T,payload:{targetIds:r,clientOffset:n||null}}}}function Ue(e){w(Array.isArray(e),`Expected targetIds to be an array.`)}function We(e,t,n){w(t.isDragging(),`Cannot call hover while not dragging.`),w(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];w(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),w(n.getTarget(r),`Expected targetIds to be registered.`)}}function Ge(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];Ve(t.getTargetType(i),n)||e.splice(r,1)}}function Ke(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function qe(e){return function(){if(e.getMonitor().isDragging())return{type:we}}}function Je(e){return{beginDrag:De(e),publishDragSource:qe(e),hover:He(e),drop:Pe(e),endDrag:ze(e)}}var Ye=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Je(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Xe(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Ze(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qe(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:Ze(Xe(t,r),n)}function $e(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Ze(t,n)}var O=[],et=[];O.__IS_NONE__=!0,et.__IS_ALL__=!0;function tt(e,t){return e===O?!1:e===et||t===void 0||xe(t,e).length>0}var nt=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;w(typeof e==`function`,`listener must be a function.`),w(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!tt(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){w(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return w(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return w(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return w(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Ve(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Qe(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return $e(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},rt=typeof global<`u`?global:self,it=rt.MutationObserver||rt.WebKitMutationObserver;function at(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ot(e){let t=1,n=new it(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var st=typeof it==`function`?ot:at,ct=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=st(this.flush),this.requestErrorThrow=at(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},lt=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},ut=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new lt(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},dt=new ct,ft=new ut(dt.registerPendingError);function pt(e){dt.enqueueTask(ft.create(e))}var mt=`dnd-core/ADD_SOURCE`,ht=`dnd-core/ADD_TARGET`,gt=`dnd-core/REMOVE_SOURCE`,k=`dnd-core/REMOVE_TARGET`;function _t(e){return{type:mt,payload:{sourceId:e}}}function vt(e){return{type:ht,payload:{targetId:e}}}function yt(e){return{type:gt,payload:{sourceId:e}}}function bt(e){return{type:k,payload:{targetId:e}}}function xt(e){w(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),w(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),w(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function St(e){w(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),w(typeof e.hover==`function`,`Expected hover to be a function.`),w(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Ct(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Ct(e,!1));return}w(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var A;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(A||={});var wt=0;function Tt(){return wt++}function Et(e){let t=Tt().toString();switch(e){case A.SOURCE:return`S${t}`;case A.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Dt(e){switch(e[0]){case`S`:return A.SOURCE;case`T`:return A.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function Ot(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var kt=class{addSource(e,t){Ct(e),xt(t);let n=this.addHandler(A.SOURCE,e,t);return this.store.dispatch(_t(n)),n}addTarget(e,t){Ct(e,!0),St(t);let n=this.addHandler(A.TARGET,e,t);return this.store.dispatch(vt(n)),n}containsHandler(e){return Ot(this.dragSources,e)||Ot(this.dropTargets,e)}getSource(e,t=!1){return w(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return w(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return w(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return w(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Dt(e)===A.SOURCE}isTargetId(e){return Dt(e)===A.TARGET}removeSource(e){w(this.getSource(e),`Expected an existing source.`),this.store.dispatch(yt(e)),pt(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){w(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(bt(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);w(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){w(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Et(e);return this.types.set(r,t),e===A.SOURCE?this.dragSources.set(r,n):e===A.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},At=(e,t)=>e===t;function jt(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Mt(e,t,n=At){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Nt(e=O,t){switch(t.type){case T:break;case mt:case ht:case k:case gt:return O;case Ce:case we:case D:case E:default:return et}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=be(n,r);if(!(i.length>0||!Mt(n,r)))return O;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Pt(e,t,n[t])})}return e}var It={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Lt(e=It,t){let{payload:n}=t;switch(t.type){case Se:case Ce:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case T:return jt(e.clientOffset,n.clientOffset)?e:Ft({},e,{clientOffset:n.clientOffset});case D:case E:return It;default:return e}}function Rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Rt(e,t,n[t])})}return e}var zt={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Bt(e=zt,t){let{payload:n}=t;switch(t.type){case Ce:return j({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case we:return j({},e,{isSourcePublic:!0});case T:return j({},e,{targetIds:n.targetIds});case k:return e.targetIds.indexOf(n.targetId)===-1?e:j({},e,{targetIds:ve(e.targetIds,n.targetId)});case E:return j({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case D:return j({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Vt(e=0,t){switch(t.type){case mt:case ht:return e+1;case gt:case k:return e-1;default:return e}}function Ht(e=0){return e+1}function Ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Ut(e,t,n[t])})}return e}function Gt(e={},t){return{dirtyHandlerIds:Nt(e.dirtyHandlerIds,{type:t.type,payload:Wt({},t.payload,{prevTargetIds:_e(e,`dragOperation.targetIds`,[])})}),dragOffset:Lt(e.dragOffset,t),refCount:Vt(e.refCount,t),dragOperation:Bt(e.dragOperation,t),stateId:Ht(e.stateId)}}function Kt(e,t=void 0,n={},r=!1){let i=qt(r),a=new Ye(i,new nt(i,new kt(i))),o=e(a,t,n);return a.receiveBackend(o),a}function qt(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return he(Gt,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}function Jt(e,t){if(e==null)return{};var n=Yt(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Xt=0,Zt=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),Qt=(0,S.memo)(function(e){var{children:t}=e;let[n,r]=$t(Jt(e,[`children`]));return(0,S.useEffect)(()=>{if(r){let e=tn();return++Xt,()=>{--Xt===0&&(e[Zt]=null)}}},[]),(0,x.jsx)(ue.Provider,{value:n,children:t})});function $t(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[en(e.backend,e.context,e.options,e.debugMode),!e.context]}function en(e,t=tn(),n,r){let i=t;return i[Zt]||(i[Zt]={dragDropManager:Kt(e,t,n,r)}),i[Zt]}function tn(){return typeof global<`u`?global:window}var nn=e(le(),1),M=typeof window<`u`?S.useLayoutEffect:S.useEffect;function rn(e,t,n){let[r,i]=(0,S.useState)(()=>t(e)),a=(0,S.useCallback)(()=>{let a=t(e);(0,nn.default)(r,a)||(i(a),n&&n())},[r,e,n]);return M(a),[r,a]}function an(e,t,n){let[r,i]=rn(e,t,n);return M(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function on(e,t,n){return an(t,e||(()=>({})),()=>n.reconnect())}function sn(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),(0,S.useMemo)(()=>typeof e==`function`?e():e,n)}function cn(e){return(0,S.useMemo)(()=>e.hooks.dragSource(),[e])}function ln(e){return(0,S.useMemo)(()=>e.hooks.dragPreview(),[e])}var un=!1,dn=!1,fn=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){w(!un,`You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return un=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{un=!1}}isDragging(){if(!this.sourceId)return!1;w(!dn,`You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return dn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{dn=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},pn=!1,mn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;w(!pn,`You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor`);try{return pn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{pn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function hn(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function gn(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function _n(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o<a.length;o++){let c=a[o];if(!s(c))return!1;let l=e[c],u=t[c];if(i=n?n.call(r,l,u,c):void 0,i===!1||i===void 0&&l!==u)return!1}return!0}function vn(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`current`)}function yn(e){if(typeof e.type==`string`)return;let t=e.type.displayName||e.type.name||`the component`;throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function bn(e){return(t=null,n=null)=>{if(!(0,S.isValidElement)(t)){let r=t;return e(r,n),r}let r=t;return yn(r),Cn(r,n?t=>e(t,n):e)}}function xn(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=bn(r);t[n]=()=>e}}),t}function Sn(e,t){typeof e==`function`?e(t):e.current=t}function Cn(e,t){let n=e.ref;return w(typeof n!=`string`,`Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs`),n?(0,S.cloneElement)(e,{ref:e=>{Sn(n,e),Sn(t,e)}}):(0,S.cloneElement)(e,{ref:t})}var wn=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!_n(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!_n(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&=(this.dragSourceUnsubscribe(),void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=xn({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,vn(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,vn(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},Tn=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!_n(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=xn({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,vn(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function N(){let{dragDropManager:e}=(0,S.useContext)(ue);return w(e!=null,`Expected drag drop context`),e}function En(e,t){let n=N(),r=(0,S.useMemo)(()=>new wn(n.getBackend()),[n]);return M(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),M(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function Dn(){let e=N();return(0,S.useMemo)(()=>new fn(e),[e])}var On=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag!=`function`||e.canDrag(t)}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};function kn(e,t,n){let r=(0,S.useMemo)(()=>new On(e,t,n),[t,n]);return(0,S.useEffect)(()=>{r.spec=e},[e]),r}function An(e){return(0,S.useMemo)(()=>{let t=e.type;return w(t!=null,`spec.type must be defined`),t},[e])}function jn(e,t,n){let r=N(),i=kn(e,t,n),a=An(e);M(function(){if(a!=null){let[e,o]=gn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Mn(e,t){let n=sn(e,t);w(!n.begin,`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`);let r=Dn(),i=En(n.options,n.previewOptions);return jn(n,r,i),[on(n.collect,r,i),cn(i),ln(i)]}function Nn(e){let t=N().getMonitor(),[n,r]=rn(t,e);return(0,S.useEffect)(()=>t.subscribeToOffsetChange(r)),(0,S.useEffect)(()=>t.subscribeToStateChange(r)),n}function Pn(e){return(0,S.useMemo)(()=>e.hooks.dropTarget(),[e])}function Fn(e){let t=N(),n=(0,S.useMemo)(()=>new Tn(t.getBackend()),[t]);return M(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function In(){let e=N();return(0,S.useMemo)(()=>new mn(e),[e])}function Ln(e){let{accept:t}=e;return(0,S.useMemo)(()=>(w(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var Rn=class{canDrop(){let e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function zn(e,t){let n=(0,S.useMemo)(()=>new Rn(e,t),[t]);return(0,S.useEffect)(()=>{n.spec=e},[e]),n}function Bn(e,t,n){let r=N(),i=zn(e,t),a=Ln(e);M(function(){let[e,o]=hn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function Vn(e,t){let n=sn(e,t),r=In(),i=Fn(n.options);return Bn(n,r,i),[on(n.collect,r,i),Pn(i)]}var Hn=ne();function Un(e){let t=null;return()=>(t??=e(),t)}function Wn(e,t){return e.filter(e=>e!==t)}function Gn(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var Kn=class{enter(e){let t=this.entered.length,n=t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e));return this.entered=Gn(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Wn(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},qn=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},Jn=t({FILE:()=>Yn,HTML:()=>Qn,TEXT:()=>Zn,URL:()=>Xn}),Yn=`__NATIVE_FILE__`,Xn=`__NATIVE_URL__`,Zn=`__NATIVE_TEXT__`,Qn=`__NATIVE_HTML__`;function $n(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var er={[Yn]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[Qn]:{exposeProperties:{html:(e,t)=>$n(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[Xn]:{exposeProperties:{urls:(e,t)=>$n(e,t,``).split(`
|
|
2
2
|
`),dataTransfer:e=>e},matchesTypes:[`Url`,`text/uri-list`]},[Zn]:{exposeProperties:{text:(e,t)=>$n(e,t,``),dataTransfer:e=>e},matchesTypes:[`Text`,`text/plain`]}};function tr(e,t){let n=er[e];if(!n)throw Error(`native type ${e} has no configuration`);let r=new qn(n);return r.loadDataTransfer(t),r}function nr(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(er).filter(e=>{let n=er[e];return n?.matchesTypes?n.matchesTypes.some(e=>t.indexOf(e)>-1):!1})[0]||null}var rr=Un(()=>/firefox/i.test(navigator.userAgent)),ir=Un(()=>!!window.safari),ar=class{interpolate(e){let{xs:t,ys:n,c1s:r,c2s:i,c3s:a}=this,o=t.length-1;if(e===t[o])return n[o];let s=0,c=a.length-1,l;for(;s<=c;){l=Math.floor(.5*(s+c));let r=t[l];if(r<e)s=l+1;else if(r>e)c=l-1;else return n[l]}o=Math.max(0,c);let u=e-t[o],d=u*u;return n[o]+r[o]*u+i[o]*d+a[o]*u*d}constructor(e,t){let{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);let i=[],a=[],o=[],s,c;for(let r=0;r<n-1;r++)s=e[r+1]-e[r],c=t[r+1]-t[r],a.push(s),i.push(c),o.push(c/s);let l=[o[0]];for(let e=0;e<a.length-1;e++){let t=o[e],n=o[e+1];if(t*n<=0)l.push(0);else{s=a[e];let r=a[e+1],i=s+r;l.push(3*i/((i+r)/t+(i+s)/n))}}l.push(o[o.length-1]);let u=[],d=[],f;for(let e=0;e<l.length-1;e++){f=o[e];let t=l[e],n=1/a[e],r=t+l[e+1]-f-f;u.push((f-t-r)*n),d.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=d}},or=1;function sr(e){let t=e.nodeType===or?e:e.parentElement;if(!t)return null;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function P(e){return{x:e.clientX,y:e.clientY}}function cr(e){return e.nodeName===`IMG`&&(rr()||!document.documentElement?.contains(e))}function lr(e,t,n,r){let i=e?t.width:n,a=e?t.height:r;return ir()&&e&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function ur(e,t,n,r,i){let a=cr(t),o=sr(a?e:t),s={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:l}=e,{anchorX:u,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=lr(a,t,c,l),m=()=>{let e=new ar([0,.5,1],[s.y,s.y/l*p,s.y+p-l]).interpolate(d);return ir()&&a&&(e+=(window.devicePixelRatio-1)*p),e},h=()=>new ar([0,.5,1],[s.x,s.x/c*f,s.x+f-c]).interpolate(u),{offsetX:g,offsetY:_}=i,v=g===0||g,ee=_===0||_;return{x:v?g:h(),y:ee?_:m()}}var dr=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<`u`)return window}get document(){if(this.globalContext?.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){return this.optionsArgs?.rootElement||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){fr(e,t,n[t])})}return e}var mr=class{profile(){return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:this.dragStartSourceIds?.length||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:this.dragOverTargetIds?.length||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw Error(`Cannot have two HTML5 backends at the same time.`);e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)==null||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);let r=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute(`draggable`,`true`),t.addEventListener(`dragstart`,r),t.addEventListener(`selectstart`,i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener(`dragstart`,r),t.removeEventListener(`selectstart`,i),t.setAttribute(`draggable`,`false`)}}connectDropTarget(e,t){let n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener(`dragenter`,n),t.addEventListener(`dragover`,r),t.addEventListener(`drop`,i),()=>{t.removeEventListener(`dragenter`,n),t.removeEventListener(`dragover`,r),t.removeEventListener(`drop`,i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener(`dragstart`,this.handleTopDragStart),e.addEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.addEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.addEventListener(`dragenter`,this.handleTopDragEnter),e.addEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.addEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.addEventListener(`dragover`,this.handleTopDragOver),e.addEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.addEventListener(`drop`,this.handleTopDrop),e.addEventListener(`drop`,this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener(`dragstart`,this.handleTopDragStart),e.removeEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.removeEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.removeEventListener(`dragenter`,this.handleTopDragEnter),e.removeEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.removeEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.removeEventListener(`dragover`,this.handleTopDragOver),e.removeEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.removeEventListener(`drop`,this.handleTopDrop),e.removeEventListener(`drop`,this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return pr({dropEffect:this.altKeyPressed?`copy`:`move`},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?`copy`:this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return pr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(Jn).some(t=>Jn[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=tr(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>this.rootElement?.addEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0),1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||=[],this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&sr(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>!!(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{let e=this.currentDragSourceNode;e==null||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{this.hoverRafId===null&&typeof requestAnimationFrame<`u`&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<`u`&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;let{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;let n=P(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});let{dataTransfer:r}=e,i=nr(r);if(this.monitor.isDragging()){if(r&&typeof r.setDragImage==`function`){let e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){let{anchorX:e,anchorY:a,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),c=ur(t,i,n,{anchorX:e,anchorY:a},{offsetX:o,offsetY:s});r.setDragImage(i,c.x,c.y)}}try{r?.setData(`application/json`,{})}catch{}this.setCurrentDragSourceNode(e.target);let{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute(`draggable`)))return;else e.preventDefault()},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;let{dataTransfer:n}=e,r=nr(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{let{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:P(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}},this.handleTopDragOver=e=>{let{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}this.altKeyPressed=e.altKey,this.lastClientOffset=P(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var t;e.preventDefault(),(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}else nr(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{let{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:P(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{let t=e.target;typeof t.dragDrop==`function`&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new dr(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Kn(this.isNodeInDocument)}},F;function hr(){return F||(F=new Image,F.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),F}var gr=function(e,t,n){return new mr(e,t,n)},_r=(0,S.createContext)(null);function I(){let e=(0,S.useContext)(_r);if(e===null)throw Error(`No Tree Api Provided`);return e}var vr=(0,S.createContext)(null);function yr(){let e=(0,S.useContext)(vr);if(e===null)throw Error(`Provide a NodesContext`);return e}var br=(0,S.createContext)(null);function xr(){let e=(0,S.useContext)(br);if(e===null)throw Error(`Provide a DnDContext`);return e}var Sr=(0,S.createContext)(0);function Cr(){(0,S.useContext)(Sr)}var wr=t({access:()=>z,bound:()=>L,dfs:()=>jr,focusNextElement:()=>Mr,focusPrevElement:()=>Nr,getInsertIndex:()=>Br,getInsertParentId:()=>Ur,getTreeLinePrefix:()=>Hr,indexOf:()=>kr,isClosed:()=>Er,isDescendant:()=>Or,isItem:()=>Tr,isOpenWithEmptyChildren:()=>Dr,mergeRefs:()=>Lr,noop:()=>Ar,safeRun:()=>Rr,waitFor:()=>zr,walk:()=>R});function L(e,t,n){return Math.max(Math.min(e,n),t)}function Tr(e){return e&&e.isLeaf}function Er(e){return e&&e.isInternal&&!e.isOpen}function Dr(e){return e&&e.isOpen&&!e.children?.length}var Or=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},kr=e=>{if(!e.parent)throw Error(`Node does not have a parent`);return e.parent.children.findIndex(t=>t.id===e.id)};function Ar(){}function jr(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){let e=jr(n,t);if(e)return e}return null}function R(e,t){if(t(e),e.children)for(let n of e.children)R(n,t)}function Mr(e){let t=Ir(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=Pr(t,r);break}n?.focus()}function Nr(e){let t=Ir(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=Fr(t,r);break}n?.focus()}function Pr(e,t){return t+1<e.length?e[t+1]:e[0]}function Fr(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Ir(e){return Array.from(document.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)`)).filter(t=>t===e||!e.contains(t))}function z(e,t){return typeof t==`boolean`?t:typeof t==`string`?e[t]:t(e)}function Lr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function Rr(e,...t){if(e)return e(...t)}function zr(e){return new Promise((t,n)=>{let r=0;function i(){r+=1,r===100&&n(),e()?t():setTimeout(i,10)}i()})}function Br(e){let t=e.focusedNode;return t?t.isOpen?0:t.parent?t.childIndex+1:0:e.root.children?.length??0}var Vr={last:`└ `,middle:`├ `,pipe:`│ `,blank:` `};function Hr(e,t={}){let n=Object.assign(Object.assign({},Vr),t);if(e.level===0)return``;let r=e.nextSibling===null?n.last:n.middle,i=e.parent;for(;i&&i.level>0;)r=(i.nextSibling===null?n.blank:n.pipe)+r,i=i.parent;return r}function Ur(e){let t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}var Wr={display:`flex`,alignItems:`center`,zIndex:1},Gr={flex:1,height:`2px`,background:`#4B91E2`,borderRadius:`1px`},Kr={width:`4px`,height:`4px`,boxShadow:`0 0 0 3px #4B91E2`,borderRadius:`50%`},qr=S.memo(function({top:e,left:t,indent:n}){let r={position:`absolute`,pointerEvents:`none`,top:e-2+`px`,left:t+`px`,right:n+`px`};return(0,x.jsxs)(`div`,{style:Object.assign(Object.assign({},Wr),r),children:[(0,x.jsx)(`div`,{style:Object.assign({},Kr)}),(0,x.jsx)(`div`,{style:Object.assign({},Gr)})]})});function Jr({node:e,attrs:t,innerRef:n,children:r}){return(0,x.jsx)(`div`,Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function Yr(e){return(0,x.jsxs)(`div`,{ref:e.dragHandle,style:e.style,children:[(0,x.jsx)(`span`,{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?`🌳`:e.node.isOpen?`🗁`:`🗀`}),` `,e.node.isEditing?(0,x.jsx)(Zr,Object.assign({},e)):(0,x.jsx)(Xr,Object.assign({},e))]})}function Xr(e){return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(`span`,{children:e.node.data.name})})}function Zr({node:e}){let t=(0,S.useRef)();return(0,S.useEffect)(()=>{var e,n;(e=t.current)==null||e.focus(),(n=t.current)==null||n.select()},[]),(0,x.jsx)(`input`,{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{n.key===`Escape`&&e.reset(),n.key===`Enter`&&e.submit(t.current?.value||``)}})}var Qr=`__REACT_ARBORIST_INTERNAL_ROOT__`;function $r(e){function t(n,r,i){let a=new ei({tree:e,data:n,level:r,parent:i,id:e.accessId(n),children:null,isDraggable:e.isDraggable(n),rowIndex:null}),o=e.accessChildren(n);return o&&(a.children=o.map(e=>t(e,r+1,a))),a}let n=new ei({tree:e,id:Qr,data:{id:Qr},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null});return n.children=(e.props.data??[]).map(e=>t(e,0,n)),n}var ei=class e{constructor(e){this.handleClick=e=>{(e.metaKey||e.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex,this.select=this.select.bind(this),this.deselect=this.deselect.bind(this),this.selectMulti=this.selectMulti.bind(this),this.selectContiguous=this.selectContiguous.bind(this),this.activate=this.activate.bind(this),this.focus=this.focus.bind(this),this.toggle=this.toggle.bind(this),this.open=this.open.bind(this),this.openParents=this.openParents.bind(this),this.close=this.close.bind(this),this.submit=this.submit.bind(this),this.reset=this.reset.bind(this),this.edit=this.edit.bind(this)}get isRoot(){return this.id===Qr}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){return this.isSelected&&!this.prev?.isSelected}get isSelectedEnd(){return this.isSelected&&!this.next?.isSelected}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){let e=this.childIndex;return this.parent?.children[e+1]??null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new e(Object.assign({},this))}edit(){return this.tree.edit(this)}};function ti(e){return{type:`EDIT`,id:e}}function ni(e={id:null},t){return t.type===`EDIT`?Object.assign(Object.assign({},e),{id:t.id}):e}function B(e){return{type:`FOCUS`,id:e}}function ri(){return{type:`TREE_BLUR`}}function ii(e={id:null,treeFocused:!1},t){return t.type===`FOCUS`?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type===`TREE_BLUR`?Object.assign(Object.assign({},e),{treeFocused:!1}):e}var ai={open(e,t){return{type:`VISIBILITY_OPEN`,id:e,filtered:t}},close(e,t){return{type:`VISIBILITY_CLOSE`,id:e,filtered:t}},toggle(e,t){return{type:`VISIBILITY_TOGGLE`,id:e,filtered:t}},clear(e){return{type:`VISIBILITY_CLEAR`,filtered:e}}};function oi(e={},t){if(t.type===`VISIBILITY_OPEN`)return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type===`VISIBILITY_CLOSE`)return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type===`VISIBILITY_TOGGLE`){let n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return t.type===`VISIBILITY_CLEAR`?{}:e}function si(e={filtered:{},unfiltered:{}},t){return t.type.startsWith(`VISIBILITY`)?t.filtered?Object.assign(Object.assign({},e),{filtered:oi(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:oi(e.unfiltered,t)}):e}var V=e=>({nodes:{open:{filtered:{},unfiltered:e?.initialOpenState??{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:`none`},dragId:null,dragIds:[],parentId:null,index:-1}}),H={clear:()=>({type:`SELECTION_CLEAR`}),only:e=>({type:`SELECTION_ONLY`,id:e}),add:e=>({type:`SELECTION_ADD`,ids:Array.isArray(e)?e:[e]}),remove:e=>({type:`SELECTION_REMOVE`,ids:Array.isArray(e)?e:[e]}),set:e=>Object.assign({type:`SELECTION_SET`},e),mostRecent:e=>({type:`SELECTION_MOST_RECENT`,id:e}),anchor:e=>({type:`SELECTION_ANCHOR`,id:e})};function ci(e=V().nodes.selection,t){let n=e.ids;switch(t.type){case`SELECTION_CLEAR`:return Object.assign(Object.assign({},e),{ids:new Set});case`SELECTION_ONLY`:return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case`SELECTION_ADD`:return t.ids.length===0?e:(t.ids.forEach(e=>n.add(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_REMOVE`:return t.ids.length===0?e:(t.ids.forEach(e=>n.delete(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_SET`:return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case`SELECTION_MOST_RECENT`:return Object.assign(Object.assign({},e),{mostRecent:t.id});case`SELECTION_ANCHOR`:return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}var U={cursor(e){return{type:`DND_CURSOR`,cursor:e}},dragStart(e,t){return{type:`DND_DRAG_START`,id:e,dragIds:t}},dragEnd(){return{type:`DND_DRAG_END`}},hovering(e,t){return{type:`DND_HOVERING`,parentId:e,index:t}},setDestination(e,t){return{type:`DND_DESTINATION`,parentId:e,index:t}}};function li(e=V().dnd,t){switch(t.type){case`DND_CURSOR`:return Object.assign(Object.assign({},e),{cursor:t.cursor});case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case`DND_DRAG_END`:return V().dnd;case`DND_HOVERING`:return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}var ui={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},di=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},fi=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function pi({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return(0,x.jsxs)(mi,{isDragging:i,children:[(0,x.jsx)(hi,{offset:e,children:(0,x.jsx)(_i,{id:n,dragIds:r})}),(0,x.jsx)(gi,{mouse:t,count:r.length})]})}var mi=(0,S.memo)(function(e){return e.isDragging?(0,x.jsx)(`div`,{style:ui,children:e.children}):null});function hi(e){return(0,x.jsx)(`div`,{className:`row preview`,style:di(e.offset),children:e.children})}function gi(e){let{count:t,mouse:n}=e;return t>1?(0,x.jsx)(`div`,{className:`selected-count`,style:fi(n),children:t}):null}var _i=(0,S.memo)(function(e){let t=I(),n=t.get(e.id);return n?(0,x.jsx)(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:`transparent`},tree:t}):null});function vi(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function yi(e,t){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yi(e,t)}function bi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,yi(e,t)}var xi=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function Si(e,t){return!!(e===t||xi(e)&&xi(t))}function Ci(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Si(e[n],t[n]))return!1;return!0}function wi(e,t){t===void 0&&(t=Ci);var n,r=[],i,a=!1;function o(){var o=[...arguments];return a&&n===this&&t(o,r)?i:(i=e.apply(this,o),a=!0,n=this,r=o,i)}return o}var Ti=typeof performance==`object`&&typeof performance.now==`function`?function(){return performance.now()}:function(){return Date.now()};function Ei(e){cancelAnimationFrame(e.id)}function Di(e,t){var n=Ti();function r(){Ti()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var Oi=-1;function ki(e){if(e===void 0&&(e=!1),Oi===-1||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,document.body.appendChild(t),Oi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Oi}var W=null;function Ai(e){if(e===void 0&&(e=!1),W===null||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,n.direction=`rtl`;var r=document.createElement(`div`),i=r.style;return i.width=`100px`,i.height=`100px`,t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?W=`positive-descending`:(t.scrollLeft=1,W=t.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(t),W}return W}var ji=150,Mi=function(e,t){return e};function Ni(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){bi(t,e);function t(t){var r=e.call(this,t)||this;return r._instanceProps=c(r.props,vi(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:vi(r),isScrolling:!1,scrollDirection:`forward`,scrollOffset:typeof r.props.initialScrollOffset==`number`?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wi(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=wi(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t=r.props,a=t.direction,o=t.itemSize,s=t.layout,c=r._getItemStyleCache(l&&o,l&&s,l&&a),u;if(c.hasOwnProperty(e))u=c[e];else{var d=n(r.props,e,r._instanceProps),f=i(r.props,e,r._instanceProps),p=a===`horizontal`||s===`horizontal`,m=a===`rtl`,h=p?d:0;c[e]=u={position:`absolute`,left:m?void 0:h,right:m?h:void 0,top:p?0:d,height:p?`100%`:f,width:p?f:`100%`}}return u},r._getItemStyleCache=void 0,r._getItemStyleCache=wi(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,a=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,o=i;if(t===`rtl`)switch(Ai()){case`negative`:o=-i;break;case`positive-descending`:o=a-n-i}return o=Math.max(0,Math.min(o,a-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?`forward`:`backward`,scrollOffset:o,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,a=t.scrollTop;r.setState(function(e){if(e.scrollOffset===a)return null;var t=Math.max(0,Math.min(a,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?`forward`:`backward`,scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,typeof t==`function`?t(e):typeof t==`object`&&t&&t.hasOwnProperty(`current`)&&(t.current=e)},r._resetIsScrollingDebounced=function(){r._resetIsScrollingTimeoutId!==null&&Ei(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Di(r._resetIsScrolling,ji)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}t.getDerivedStateFromProps=function(e,t){return Pi(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?`forward`:`backward`,scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){t===void 0&&(t=`auto`);var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var c=this._outerRef;s=i===`vertical`?c.scrollWidth>c.clientWidth?ki():0:c.scrollHeight>c.clientHeight?ki():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if(typeof n==`number`&&this._outerRef!=null){var i=this._outerRef;t===`horizontal`||r===`horizontal`?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&this._outerRef!=null){var a=this._outerRef;if(t===`horizontal`||n===`horizontal`){if(t===`rtl`)switch(Ai()){case`negative`:a.scrollLeft=-i;break;case`positive-ascending`:a.scrollLeft=i;break;default:var o=a.clientWidth;a.scrollLeft=a.scrollWidth-o-i}else a.scrollLeft=i}else a.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ei(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,a=e.height,o=e.innerRef,s=e.innerElementType,c=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=d===void 0?Mi:d,p=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,_=e.useIsScrolling,v=e.width,ee=this.state.isScrolling,y=i===`horizontal`||p===`horizontal`,te=y?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),re=ne[0],ae=ne[1],oe=[];if(l>0)for(var b=re;b<=ae;b++)oe.push((0,S.createElement)(t,{data:u,key:f(b,u),index:b,isScrolling:_?ee:void 0,style:this._getItemStyle(b)}));var se=r(this.props,this._instanceProps);return(0,S.createElement)(m||h||`div`,{className:n,onScroll:te,ref:this._outerRefSetter,style:ie({position:`relative`,height:a,width:v,overflow:`auto`,WebkitOverflowScrolling:`touch`,willChange:`transform`,direction:i},g)},(0,S.createElement)(s||c||`div`,{children:oe,ref:o,style:{height:y?`100%`:se,pointerEvents:ee?`none`:void 0,width:y?se:`100%`}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered==`function`&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if(typeof this.props.onScroll==`function`){var a=this.state,o=a.scrollDirection,s=a.scrollOffset,c=a.scrollUpdateWasRequested;this._callOnScroll(o,s,c)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,a=r.scrollDirection,c=r.scrollOffset;if(t===0)return[0,0,0,0];var l=o(this.props,c,this._instanceProps),u=s(this.props,l,c,this._instanceProps),d=!i||a===`backward`?Math.max(1,n):1,f=!i||a===`forward`?Math.max(1,n):1;return[Math.max(0,l-d),Math.max(0,Math.min(t-1,u+f)),l,u]},t}(S.PureComponent),t.defaultProps={direction:`ltr`,itemData:void 0,layout:`vertical`,overscanCount:2,useIsScrolling:!1},t}var Pi=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Fi=50,G=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,a=n.lastMeasuredIndex;if(t>a){var o=0;if(a>=0){var s=i[a];o=s.offset+s.size}for(var c=a+1;c<=t;c++){var l=r(c);i[c]={offset:o,size:l},o+=l}n.lastMeasuredIndex=t}return i[t]},Ii=function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?Li(e,t,i,0,n):Ri(e,t,Math.max(0,i),n)},Li=function(e,t,n,r,i){for(;r<=n;){var a=r+Math.floor((n-r)/2),o=G(e,a,t).offset;if(o===i)return a;o<i?r=a+1:o>i&&(n=a-1)}return r>0?r-1:0},Ri=function(e,t,n,r){for(var i=e.itemCount,a=1;n<i&&G(e,n,t).offset<r;)n+=a,a*=2;return Li(e,t,Math.min(n,i-1),Math.floor(n/2),r)},zi=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,a=t.lastMeasuredIndex,o=0;if(a>=n&&(a=n-1),a>=0){var s=r[a];o=s.offset+s.size}var c=(n-a-1)*i;return o+c},Bi=Ni({getItemOffset:function(e,t,n){return G(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:zi,getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.layout,l=e.width,u=o===`horizontal`||c===`horizontal`?l:s,d=G(e,t,i),f=zi(e,i),p=Math.max(0,Math.min(f-u,d.offset)),m=Math.max(0,d.offset-u+d.size+a);switch(n===`smart`&&(n=r>=m-u&&r<=p+u?`auto`:`center`),n){case`start`:return p;case`end`:return m;case`center`:return Math.round(m+(p-m)/2);default:return r>=m&&r<=p?r:r<m?m:p}},getStartIndexForOffset:function(e,t,n){return Ii(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,a=e.height,o=e.itemCount,s=e.layout,c=e.width,l=i===`horizontal`||s===`horizontal`?c:a,u=G(e,t,r),d=n+l,f=u.offset+u.size,p=t;p<o-1&&f<d;)p++,f+=G(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||Fi,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){r===void 0&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),Vi=Ni({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.itemCount,l=e.itemSize,u=e.layout,d=e.width,f=o===`horizontal`||u===`horizontal`?d:s,p=Math.max(0,c*l-f),m=Math.min(p,t*l),h=Math.max(0,t*l-f+l+a);switch(n===`smart`&&(n=r>=h-f&&r<=m+f?`auto`:`center`),n){case`start`:return m;case`end`:return h;case`center`:var g=Math.round(h+(m-h)/2);return g<Math.ceil(f/2)?0:g>p+Math.floor(f/2)?p:g;default:return r>=h&&r<=m?r:r<h?h:m}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,a=e.itemCount,o=e.itemSize,s=e.layout,c=e.width,l=r===`horizontal`||s===`horizontal`,u=t*o,d=Math.ceil(((l?c:i)+n-u)/o);return Math.max(0,Math.min(a-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Hi(){let e=I(),t=xr().cursor;if(!t||t.type!==`line`)return null;let n=e.indent,r=e.rowTopPosition(t.index)+(e.props.padding??e.props.paddingTop??0),i=n*t.level,a=e.renderCursor;return(0,x.jsx)(a,{top:r,left:i,indent:n})}var Ui=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Wi=(0,S.forwardRef)(function(e,t){let{children:n}=e,r=Ui(e,[`children`]),i=I();return(0,x.jsxs)(`div`,Object.assign({ref:t},r,{onClick:e=>{i.props.disableDeselectOnClick||e.currentTarget===e.target&&i.deselectAll()},children:[(0,x.jsx)(Gi,{}),n]}))}),Gi=()=>{let e=I();return(0,x.jsx)(`div`,{style:{height:e.rowTopPosition(e.visibleNodes.length),width:`100%`,position:`absolute`,left:`0`,right:`0`},children:(0,x.jsx)(Hi,{})})},Ki=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},qi=(0,S.forwardRef)(function(e,t){var{style:n}=e,r=Ki(e,[`style`]);let i=I(),a=i.props.padding??i.props.paddingTop??0,o=i.props.padding??i.props.paddingBottom??0;return(0,x.jsx)(`div`,Object.assign({ref:t,style:Object.assign(Object.assign({},n),{height:`${parseFloat(n.height)+a+o}px`})},r))});function Ji(e,t){return typeof e==`function`?e(t):e??`NODE`}function Yi(e){return e.isDraggable&&!e.isEditing}function Xi(e){let t=I(),n=t.selectedIds,[r,i,a]=Mn(()=>({canDrag:()=>Yi(e),type:Ji(t.props.dragType,e),item:()=>{let r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(U.dragStart(e.id,r)),{id:e.id,dragIds:r,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(U.dragEnd())}}),[n,e,t.props.dragType]);return(0,S.useEffect)(()=>{a(hr())},[a]),i}function Zi(e,t){let n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),a=n.height,o=i<a/2,s=!o,c=a/4,l=i>c&&i<a-c;return{x:r,inTopHalf:o,inBottomHalf:s,inMiddle:l,atTop:!l&&o,atBottom:!l&&s}}function Qi(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}function $i(e,t){return{parentId:e||null,index:t}}function K(e,t){return{type:`line`,index:e,level:t}}function ea(e){return{type:`highlight`,id:e}}function ta(e,t){let n=e;for(;n.parent&&n.level>t;)n=n.parent;return{parentId:n.parent?.id||null,index:kr(n)+1}}function na(e){let t=Zi(e.element,e.offset),n=e.indent,r=Math.round(Math.max(0,t.x-n)/n),{node:i,nextNode:a,prevNode:o}=e,[s,c]=Qi(i,o,a,t);if(i&&i.isInternal&&t.inMiddle)return{drop:$i(i.id,null),cursor:ea(i.id)};if(!s)return{drop:$i(c?.parent?.id,0),cursor:K(0,0)};if(Tr(s)){let e=L(r,c?.level||0,s.level);return{drop:ta(s,e),cursor:K(s.rowIndex+1,e)}}if(Er(s)){let e=L(r,c?.level||0,s.level);return{drop:ta(s,e),cursor:K(s.rowIndex+1,e)}}let l=L(r,0,s.level+1);return l>s.level?{drop:$i(s.id,0),cursor:K(s.rowIndex+1,l)}:{drop:ta(s,l),cursor:K(s.rowIndex+1,l)}}function ra(e,t){let n=I(),[r,i]=Vn(()=>({accept:`NODE`,canDrop:()=>n.canDrop(),hover:(r,i)=>{let a=i.getClientOffset();if(!e.current||!a)return;let{cursor:o,drop:s}=na({element:e.current,offset:a,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});n.hover(s,o)},drop:(e,t)=>{if(!t.canDrop())return null;n.drop()}}),[t,e.current,n.props]);return i}function ia(e){let t=I(),n=t.at(e);if(!n)throw Error(`Could not find node for index: ${e}`);return(0,S.useMemo)(()=>{let r=n.clone();return t.visibleNodes[e]=r,r},[...Object.values(n.state),n])}var aa=S.memo(function({index:e,style:t}){Cr(),yr();let n=I(),r=ia(e),i=(0,S.useRef)(null),a=Xi(r),o=ra(i,r),s=(0,S.useCallback)(e=>{i.current=e,o(e)},[o]),c=n.indent*r.level,l=(0,S.useMemo)(()=>({paddingLeft:c}),[c]),u=(0,S.useMemo)(()=>Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(n.props.padding??n.props.paddingTop??0),minWidth:`max-content`}),[t,n.props.padding,n.props.paddingTop]),d={role:`treeitem`,"aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};(0,S.useEffect)(()=>{var e;!r.isEditing&&r.isFocused&&((e=i.current)==null||e.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);let f=n.renderNode,p=n.renderRow;return(0,x.jsx)(p,{node:r,innerRef:s,attrs:d,children:(0,x.jsx)(f,{node:r,tree:n,style:l,dragHandle:a})})}),oa=``,sa=null;function ca(){Cr();let e=I();return(0,x.jsx)(`div`,{role:`tree`,"aria-label":e.props[`aria-label`],"aria-labelledby":e.props[`aria-labelledby`],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{if(e.isEditing)return;let n=t.target;if(n instanceof Element&&n!==t.currentTarget&&n.closest(`input, textarea, select, [contenteditable]:not([contenteditable='false'])`))return;if(t.key===`Backspace`){if(!e.props.onDelete)return;let t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||=e.lastNode,e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{let t=e.focusedNode;if(t){let n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if(t.key===`Tab`&&!t.shiftKey){t.preventDefault(),Mr(t.currentTarget);return}if(t.key===`Tab`&&t.shiftKey){t.preventDefault(),Nr(t.currentTarget);return}if(t.key===`ArrowDown`){t.preventDefault();let n=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode);return}}if(t.key===`ArrowUp`){t.preventDefault();let n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode);return}}if(t.key===`ArrowRight`){let t=e.focusedNode;if(!t)return;t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id);return}if(t.key===`ArrowLeft`){let t=e.focusedNode;if(!t||t.isRoot)return;t.isInternal&&t.isOpen?e.close(t.id):t.parent?.isRoot||e.focus(t.parent);return}if(t.key===`a`&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key===`a`&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key===`A`&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key===`Home`){t.preventDefault(),e.focus(e.firstNode);return}if(t.key===`End`){t.preventDefault(),e.focus(e.lastNode);return}if(t.key===`Enter`){let t=e.focusedNode;if(!t||!t.isEditable||!e.props.onRename)return;setTimeout(()=>{t&&e.edit(t)});return}if(t.key===` `){t.preventDefault();let n=e.focusedNode;if(!n)return;n.isLeaf?(n.select(),n.activate()):n.toggle();return}if(t.key===`*`){let t=e.focusedNode;if(!t)return;e.openSiblings(t);return}if(t.key===`PageUp`){t.preventDefault(),e.pageUp();return}t.key===`PageDown`&&(t.preventDefault(),e.pageDown()),clearTimeout(sa),oa+=t.key,sa=setTimeout(()=>{oa=``},600);let r=e.visibleNodes.find(e=>{let t=e.data.name;return typeof t==`string`&&t.toLowerCase().startsWith(oa)});r&&e.focus(r.id)},children:(0,x.jsx)(la,{})})}function la(){let e=I(),t={className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,overscanCount:e.overscanCount,itemKey:t=>e.visibleNodes[t]?.id||t,outerElementType:e.props.outerElementType??Wi,innerElementType:e.props.innerElementType??qi,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e)};return typeof e.props.rowHeight==`function`?(0,x.jsx)(Bi,Object.assign({},t,{itemSize:e.rowHeightAt,ref:e.list,children:aa})):(0,x.jsx)(Vi,Object.assign({},t,{itemSize:e.rowHeight,ref:e.list,children:aa}))}function ua(e){return e.isFiltered?fa(e.root,e.isMatch.bind(e)):{list:da(e.root),matchCount:0}}function da(e){let t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&((r=e.children)==null||r.forEach(n))}return n(e),t.forEach(pa),t}function fa(e,t){let n={},r=[],i=0;function a(e){if(!e.isRoot&&t(e)){i++,n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)a(t)}function o(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&((t=e.children)==null||t.forEach(o))}return a(e),o(e),r.forEach(pa),{list:r,matchCount:i}}function pa(e,t){e.rowIndex=t}var ma=e=>e.reduce((e,t,n)=>(e[t.id]=n,e),{}),ha=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},{safeRun:q}=wr,ga=class e{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.matchCount=0,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=e=>{let t=this.props.rowHeight;if(typeof t==`function`){let n=this.at(e);return n?t(n):this.rowHeight}return t??24},this.rowTopPosition=e=>{if(typeof this.props.rowHeight!=`function`)return e*this.rowHeight;let t=this.getRowOffsets();return t[Math.max(0,Math.min(e,t.length-1))]},this.redrawList=(e=0)=>{this.rowOffsets=null;let t=this.list.current;t&&`resetAfterIndex`in t&&t.resetAfterIndex(Math.max(0,e))},this.root=$r(this);let{list:i,matchCount:a}=ua(this);this.visibleNodes=i,this.matchCount=a,this.idToIndex=ma(this.visibleNodes)}update(e){this.props=e,this.root=$r(this);let{list:t,matchCount:n}=ua(this);this.visibleNodes=t,this.matchCount=n,this.idToIndex=ma(this.visibleNodes),this.rowOffsets=null;let r=this.list.current;r&&`resetAfterIndex`in r&&r.resetAfterIndex(0,!1)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){return this.props.width??300}get height(){return this.props.height??500}get indent(){return this.props.indent??24}get rowHeight(){return typeof this.props.rowHeight==`number`?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;let e=[0];for(let t=0;t<this.visibleNodes.length;t++)e.push(e[t]+this.rowHeightAt(t));return this.rowOffsets=e,e}get overscanCount(){return this.props.overscanCount??1}get searchTerm(){return(this.props.searchTerm||``).trim()}get matchFn(){let e=this.props.searchMatch??((e,t)=>{let n=this.accessChildren(e.data),r=Object.values(e.data).filter(e=>n===null||e!==n);return JSON.stringify(r).toLocaleLowerCase().includes(t.toLocaleLowerCase())});return t=>e(t,this.searchTerm)}accessChildren(e){return z(e,this.props.childrenAccessor||`children`)??null}accessId(e){let t=z(e,this.props.idAccessor||`id`);if(!t)throw Error(`Data must contain an 'id' property or props.idAccessor must return a string`);return t}identify(e){return typeof e==`string`?e:e instanceof ei?e.id:z(e,this.props.idAccessor||`id`)}identifyNull(e){return e==null?null:this.identify(e)}get firstNode(){return this.visibleNodes[0]??null}get lastNode(){return this.visibleNodes[this.visibleNodes.length-1]??null}get focusedNode(){return this.get(this.state.nodes.focus.id)??null}get mostRecentNode(){return this.get(this.state.nodes.selection.mostRecent)??null}get nextNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,t){if(e===null||t===null)return[];let n=this.indexOf(e)??0,r=this.indexOf(t);if(r===null)return[];let i=Math.min(n,r),a=Math.max(n,r);return this.visibleNodes.slice(i,a+1)}indexOf(e){let t=this.identifyNull(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:`internal`})}createLeaf(){return this.create({type:`leaf`})}create(){return ha(this,arguments,void 0,function*(e={}){let t=e.parentId===void 0?Ur(this):e.parentId,n=e.index??Br(this),r=e.type??`leaf`,i=yield q(this.props.onCreate,{type:r,parentId:t,index:n,parentNode:this.get(t)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(e){return ha(this,void 0,void 0,function*(){if(!e)return;let t=(Array.isArray(e)?e:[e]).map(e=>this.identify(e)),n=t.map(e=>this.get(e)).filter(e=>!!e),r=n.length?Math.min(...n.map(e=>e.rowIndex??0)):0;yield q(this.props.onDelete,{nodes:n,ids:t}),this.redrawList(r)})}edit(t){let n=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(ti(n)),this.redrawList(this.get(n)?.rowIndex??0),new Promise(t=>{e.editPromise=t})}submit(e,t){return ha(this,void 0,void 0,function*(){if(!e)return;let n=this.identify(e);yield q(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(ti(null)),this.resolveEdit({cancelled:!1,value:t}),this.redrawList(this.get(n)?.rowIndex??0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(ti(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(e){let t=this.get(this.identifyNull(e));t&&q(this.props.onActivate,t)}resolveEdit(t){let n=e.editPromise;n&&n(t),e.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){let n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(B(this.identify(e))),t.scroll!==!1&&this.scrollTo(e),this.focusedNode&&q(this.props.onFocus,this.focusedNode)))}pageUp(){let e=this.visibleStartIndex,t=this.visibleStopIndex-e,n=this.focusedNode?.rowIndex??0;n=n>e?e:Math.max(e-t,0),this.focus(this.at(n))}pageDown(){let e=this.visibleStartIndex,t=this.visibleStopIndex,n=t-e,r=this.focusedNode?.rowIndex??0;r=r<t?t:Math.min(r+n,this.visibleNodes.length-1),this.focus(this.at(r))}select(e,t={}){if(!e)return;let n=t.focus!==!1,r=this.identify(e);n&&this.dispatch(B(r)),this.get(r)?.isSelectable&&this.setSelection({ids:[r],anchor:r,mostRecent:r}),this.scrollTo(r,t.align),this.focusedNode&&n&&q(this.props.onFocus,this.focusedNode)}deselect(e){if(!e)return;let t=this.identify(e);this.dispatch(H.remove(t)),q(this.props.onSelect,this.selectedNodes)}selectMulti(e,t={}){let n=this.get(this.identifyNull(e));if(!n)return;let r=t.focus!==!1;r&&this.dispatch(B(n.id)),n.isSelectable&&(this.dispatch(H.add(n.id)),this.dispatch(H.anchor(n.id)),this.dispatch(H.mostRecent(n.id))),this.scrollTo(n,t.align),this.focusedNode&&r&&q(this.props.onFocus,this.focusedNode),q(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;let t=this.identify(e);if(this.dispatch(B(t)),this.get(t)?.isSelectable){let{anchor:e,mostRecent:n}=this.state.nodes.selection,r=this.filterSelectableNodes(this.nodesBetween(e,this.identifyNull(t)));this.dispatch(H.remove(this.nodesBetween(e,n).map(e=>e.id))),this.dispatch(H.add(r.map(e=>e.id))),this.dispatch(H.mostRecent(t))}this.scrollTo(t),this.focusedNode&&q(this.props.onFocus,this.focusedNode),q(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){let e=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:e,anchor:e[0]??null,mostRecent:e[e.length-1]??null}),this.dispatch(B(this.lastNode?.id)),this.focusedNode&&q(this.props.onFocus,this.focusedNode)}filterSelectableNodes(e){return e.map(e=>this.get(this.identify(e))).filter(e=>!!e&&e.isSelectable)}setSelection(e){let t=new Set(e.ids?.map(e=>this.identify(e))),n=this.identifyNull(e.anchor),r=this.identifyNull(e.mostRecent);this.dispatch(H.set({ids:t,anchor:n,mostRecent:r})),q(this.props.onSelect,this.selectedNodes)}get cursorParentId(){let{cursor:e}=this.state.dnd;switch(e.type){case`highlight`:return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type===`highlight`}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){if(this.isFiltered)return!1;let e=this.get(this.state.dnd.parentId)??this.root,t=this.dragNodes,n=this.props.disableDrop;for(let n of t)if(!n||!e||n.isInternal&&Or(e,n))return!1;return typeof n==`function`?!n({parentNode:e,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n==`string`?!e.data[n]:typeof n!=`boolean`||!n}hover(e,t){e&&this.dispatch(U.hovering(e.parentId,e.index)),e&&this.canDrop()?(this.dispatch(U.setDestination(e.parentId,e.index)),t&&this.showCursor(t)):(this.dispatch(U.setDestination(null,null)),this.hideCursor())}drop(){let{parentId:e,index:t,dragIds:n}=this.state.dnd;q(this.props.onMove,{dragIds:n,parentId:e===`__REACT_ARBORIST_INTERNAL_ROOT__`?null:e,index:t===null?0:t,dragNodes:this.dragNodes,parentNode:this.get(e)}),this.open(e)}hideCursor(){this.dispatch(U.cursor({type:`none`}))}showCursor(e){this.dispatch(U.cursor(e))}open(e,t=!0){let n=this.identifyNull(e);n&&(this.isOpen(n)||(this.dispatch(ai.open(n,this.isFiltered)),t&&this.redrawList(this.get(n)?.rowIndex??0),q(this.props.onToggle,n)))}close(e,t=!0){let n=this.identifyNull(e);n&&this.isOpen(n)&&(this.dispatch(ai.close(n,this.isFiltered)),t&&this.redrawList(this.get(n)?.rowIndex??0),q(this.props.onToggle,n))}toggle(e){let t=this.identifyNull(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){let t=this.identifyNull(e);if(!t)return;let n=jr(this.root,t)?.parent;for(;n;)this.open(n.id,!1),n=n.parent;this.redrawList()}openSiblings(e){let t=e.parent;if(!t)this.toggle(e.id);else if(t.children){let n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id,!1):this.open(e.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){R(this.root,e=>{e.isInternal&&this.open(e.id,!1)}),this.redrawList()}closeAll(){R(this.root,e=>{e.isInternal&&this.close(e.id,!1)}),this.redrawList()}scrollTo(e,t=`smart`){if(!e)return;let n=this.identify(e);return this.openParents(n),zr(()=>n in this.idToIndex).then(()=>{var e;let r=this.idToIndex[n];r!==void 0&&((e=this.list.current)==null||e.scrollToItem(r,t),this.scrollToNodeHorizontally(this.get(n)))}).catch(()=>{})}scrollToNodeHorizontally(e){let t=this.listEl.current;if(!e||!t)return;let n=t.scrollWidth-t.clientWidth;if(n<=0)return;let r=e.level*this.indent,i=t.scrollLeft,a=t.scrollLeft+t.clientWidth;(r<i||r>=a)&&(t.scrollLeft=Math.max(0,Math.min(r,n)))}scrollToOffset(e){var t;let n=Number.isFinite(e)?Math.max(0,e):0;(t=this.list.current)==null||t.scrollTo(n)}get scrollOffset(){return this.listEl.current?.scrollTop??0}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){return!!this.props.searchTerm?.trim()}get filteredCount(){return this.matchCount}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){if(!e)return!1;if(e===`__REACT_ARBORIST_INTERNAL_ROOT__`)return!0;let t=this.props.openByDefault??!0;return this.isFiltered?this.state.nodes.open.filtered[e]??!0:this.state.nodes.open.unfiltered[e]??t}isEditable(e){return this.isActionPossible(e,this.props.disableEdit)}isDraggable(e){return this.isActionPossible(e,this.props.disableDrag)}isSelectable(e){return this.isActionPossible(e,this.props.disableSelect)}isActionPossible(e,t=()=>!1){return!z(e,t)}isDragging(e){let t=this.identifyNull(e);return t?this.state.nodes.drag.id===t:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){let t=this.identifyNull(e);if(!t)return!1;let{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&r===null}onFocus(){let e=this.focusedNode||this.firstNode;e&&this.dispatch(B(e.id))}onBlur(){this.dispatch(ri())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||ca}get renderRow(){return this.props.renderRow||Jr}get renderNode(){return this.props.children||Yr}get renderDragPreview(){return this.props.renderDragPreview||pi}get renderCursor(){return this.props.renderCursor||qr}};function J(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _a=typeof Symbol==`function`&&Symbol.observable||`@@observable`,va=()=>Math.random().toString(36).substring(7).split(``).join(`.`),ya={INIT:`@@redux/INIT${va()}`,REPLACE:`@@redux/REPLACE${va()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${va()}`};function ba(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function xa(e,t,n){if(typeof e!=`function`)throw Error(J(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(J(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(J(1));return n(xa)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(J(3));return i}function d(e){if(typeof e!=`function`)throw Error(J(4));if(c)throw Error(J(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(J(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!ba(e))throw Error(J(7));if(e.type===void 0)throw Error(J(8));if(typeof e.type!=`string`)throw Error(J(17));if(c)throw Error(J(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(J(10));r=e,f({type:ya.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(J(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[_a](){return this}}}return f({type:ya.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[_a]:m}}function Sa(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:ya.INIT})===void 0)throw Error(J(12));if(n(void 0,{type:ya.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(J(13))})}function Ca(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{Sa(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(J(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function wa(e=V().nodes.drag,t){switch(t.type){case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case`DND_DRAG_END`:return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case`DND_DESTINATION`:return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}var Ta=Ca({nodes:Ca({focus:ii,edit:ni,open:si,selection:ci,drag:wa}),dnd:li}),Ea=V();function Da({treeProps:e,imperativeHandle:t,children:n}){let r=(0,S.useRef)(null),i=(0,S.useRef)(null),a=(0,S.useRef)(xa(Ta,V(e))),o=(0,Hn.useSyncExternalStore)(a.current.subscribe,a.current.getState,()=>Ea),s=(0,S.useMemo)(()=>new ga(a.current,e,r,i),[]),c=(0,S.useRef)(0);return(0,S.useMemo)(()=>{c.current+=1,s.update(e)},Object.values(e)),(0,S.useMemo)(()=>{c.current+=1,s.update(s.props)},[o.nodes.open]),(0,S.useImperativeHandle)(t,()=>s),(0,S.useEffect)(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),(0,S.useEffect)(()=>{s.props.searchTerm||a.current.dispatch(ai.clear(!0))},[s.props.searchTerm]),(0,x.jsx)(_r.Provider,{value:s,children:(0,x.jsx)(Sr.Provider,{value:c.current,children:(0,x.jsx)(vr.Provider,{value:o.nodes,children:(0,x.jsx)(br.Provider,{value:o.dnd,children:(0,x.jsx)(Qt,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||gr,options:{rootElement:s.props.dndRootElement||void 0}},{children:n}))})})})})}function Oa(){let e=I(),[,t]=Vn(()=>({accept:`NODE`,canDrop:(t,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;let r=n.getClientOffset();if(!e.listEl.current||!r)return;let{cursor:i,drop:a}=na({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});e.hover(a,i)},drop:(t,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function ka(e){return Oa(),e.children}function Aa(){let e=I().props.renderContainer||ca;return(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(e,{})})}function ja(){let e=I(),{offset:t,mouse:n,item:r,isDragging:i}=Nn(e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()})),a=e.props.renderDragPreview||pi;return(0,x.jsx)(a,{offset:t,mouse:n,id:r?.id||null,dragIds:r?.dragIds||[],isDragging:i})}function Ma(e={}){let t=e.idAccessor??`id`,n=e.childrenAccessor??`children`;return{getId:typeof t==`function`?t:e=>e[t],getChildren:typeof n==`function`?n:e=>e[n],childrenKey:typeof n==`string`?n:`children`}}var Na=class{constructor(e,t={}){this.accessors=Ma(t),this.root=Pa(e,this.accessors)}get data(){return this.root.children?.map(e=>e.data)??[]}create(e){let t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){let t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!t||!n||(n.addChild(t.data,e.index),t.drop())}update(e){let t=this.find(e.id);t&&t.update(e.changes)}drop(e){let t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){let t=this.find(e,n);if(t)return t}return null}return null}};function Pa(e,t){let n=new Ia({},null,t,`ROOT`);return n.children=e.map(e=>Fa(e,n,t)),n}function Fa(e,t,n){let r=new Ia(e,t,n),i=n.getChildren(e);return i&&(r.children=i.map(e=>Fa(e,r,n))),r}var Ia=class{constructor(e,t,n,r){this.data=e,this.parent=t,this.accessors=n,this.id=r??n.getId(e)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){let n=Fa(e,this,this.accessors);this.children=this.children??[],this.children.splice(t,0,n);let r=this.accessors.childrenKey,i=this.data;i[r]=i[r]??[],i[r].splice(t,0,e)}removeChild(e){var t,n;(t=this.children)==null||t.splice(e,1),(n=this.data[this.accessors.childrenKey])==null||n.splice(e,1)}update(e){if(this.hasParent()){let t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}},La=0;function Ra(e,t={}){let[n,r]=(0,S.useState)(e),i=t.idAccessor,a=t.childrenAccessor,o=t.onChange,s=(0,S.useMemo)(()=>new Na(n,{idAccessor:i,childrenAccessor:a}),[n,i,a]),c=()=>{let e=s.data;r(e),o?.(e)},l=e=>{for(let t of e.dragIds)s.move({id:t,parentId:e.parentId,index:e.index});c()},u=({name:e,id:t})=>{s.update({id:t,changes:{name:e}}),c()},d=typeof i==`string`?i:`id`,f=typeof a==`string`?a:`children`;return[n,{onMove:l,onRename:u,onCreate:({parentId:e,index:t,type:n})=>{if(typeof i==`function`)throw Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(n===`internal`&&typeof a==`function`)throw Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");let r={[d]:`simple-tree-id-${La++}`,name:``};return n===`internal`&&(r[f]=[]),s.create({parentId:e,index:t,data:r}),c(),r},onDelete:e=>{e.ids.forEach(e=>s.drop({id:e})),c()}}]}function za(e){if(e.initialData&&e.data)throw Error(`React Arborist Tree => Provide either a data or initialData prop, but not both.`);if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
3
3
|
Use the data prop if you want to provide your own handlers.`);if(e.initialData){let[t,n]=Ra(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}function Ba(e,t){let n=za(e);return(0,x.jsxs)(Da,{treeProps:n,imperativeHandle:t,children:[(0,x.jsx)(ka,{children:(0,x.jsx)(Aa,{})}),(0,x.jsx)(ja,{})]})}var Va=(0,S.forwardRef)(Ba),Y=a(),Ha=5,Ua=/^[A-Za-z]:[/\\]/,Wa=/^\\\\/;function X(e){return e.success?e:(y({title:`Failed`,description:e.message}),null)}var Ga=class{delegate=new Na([]);callbacks;constructor(e){this.callbacks=e}roots=[];pendingExpansions=new Map;onChange=o.NOOP;path=new m(`/`);initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{let{roots:e}=await this.callbacks.getRoots(),t=e.find(e=>e.isPrimary);if(!t)throw Error(`File browser response is missing a primary root`);if(this.roots=e,this.path=m.guessDeliminator(t.path),this.delegate=new Na(e.map(Ja)),e.length===1){let e=await this.callbacks.listFiles({path:t.path});this.updateDirectory(this.getPrimaryRootId(),e.files)}}catch(e){y({title:`Failed`,description:re(e)})}this.emitChange()};expand(e){return this.requestDirectory(e)}requestDirectory(e,t=!1){let n=this.pendingExpansions.get(e);if(n)return n;let r=this.delegate.find(e);if(!r?.data.isDirectory)return Promise.resolve(!1);if(!t&&r.data.loadState===`loaded`)return Promise.resolve(!0);let i=this.loadDirectory(e,r.data).finally(()=>{this.pendingExpansions.delete(e)});return this.pendingExpansions.set(e,i),i}async loadDirectory(e,t){this.delegate.update({id:e,changes:{loadState:`loading`}}),this.emitChange();try{let n=await this.callbacks.listFiles({path:t.path});return this.updateDirectory(e,n.files),!0}catch(n){return this.delegate.update({id:e,changes:{loadState:`error`}}),y({title:`Could not load ${t.name}`,description:re(n)}),!1}finally{this.emitChange()}}getRoots(){return this.roots}async reveal(e){let t=Q(e.path,e.rootPath);if(t===null)return!1;let n=e.rootPath,r=t.split(Qa(e.rootPath)).filter(Boolean);e.isDirectory||r.pop();for(let t of[null,...r]){if(t!==null){let r=Z(e.rootPath,n);if(n=$(n,t),!this.delegate.find(Z(e.rootPath,n))&&!await this.requestDirectory(r,!0))return!1}let r=Z(e.rootPath,n);if(!this.delegate.find(r))return y({title:`Could not reveal folder`,description:`The folder may have moved or been deleted: ${n}`}),!1;if(!await this.expand(r))return!1}return!0}async copy(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=$(i,t);await this.callbacks.copyFileOrFolder({path:r,newPath:a}).then(X)&&await this.refreshPath(i)}async rename(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=$(i,t);await this.callbacks.renameFileOrFolder({path:r,newPath:a}).then(X)&&await this.refreshPath(i)}async move(e,t){let n=t??this.getPrimaryRootId(),r=this.delegate.find(n);if(!r?.data.isDirectory)return;let i=new Set;await se(e,Ha,async e=>{let t=this.getMutableNode(e,!1);if(!t)return;let n=t.data.path,a=this.getParentPath(t.data),o=$(r.data.path,this.path.basename(n));await this.callbacks.renameFileOrFolder({path:n,newPath:o}).then(X)&&(i.add(r.data.path),i.add(a))}),await this.refreshPaths([...i])}async createFile({name:e,parentId:t,type:n=`file`}){let r=this.getParentNode(t);r&&await this.callbacks.createFileOrFolder({path:r.data.path,type:n,name:e}).then(X)&&await this.refreshPath(r.data.path)}async createFolder(e,t){let n=this.getParentNode(t);n&&await this.callbacks.createFileOrFolder({path:n.data.path,type:`directory`,name:e}).then(X)&&await this.refreshPath(n.data.path)}async delete(e){let t=this.getMutableNode(e);if(!t)return;let n=this.getParentPath(t.data);await this.callbacks.deleteFileOrFolder({path:t.data.path}).then(X)&&await this.refreshPath(n)}refreshAll=async e=>{let t=[...this.roots.map(e=>e.path),...e.map(e=>this.delegate.find(e)?.data.path).filter(e=>!!e)];await this.refreshPaths(t,new Set([...this.roots.map(e=>Z(e.path,e.path)),...e]))};refreshPath=async e=>{await this.refreshPaths([e])};getPrimaryRelativePath=e=>{let t=this.getPrimaryRoot();return t?Q(e,t.path):null};getPrimaryRootPath=()=>this.getPrimaryRoot()?.path??``;getPrimaryRootId=()=>{let e=this.getPrimaryRoot()?.path??``;return Z(e,e)};isPrimaryNode=e=>e.isPrimaryRoot;getDisplayPath=e=>{let t=this.getRootForPath(e);if(!t)return e;let n=Q(e,t.path);return n?t.isPrimary?n:`${t.name}/${n}`:t.name};isRootPath=e=>this.roots.some(t=>Xa(e,t.path));getPrimaryRoot(){return this.roots.find(e=>e.isPrimary)}getRootForNode(e){return this.roots.find(t=>Xa(t.path,e.rootPath))??this.getPrimaryRoot()??{path:e.rootPath,name:e.rootPath,isPrimary:e.isPrimaryRoot}}getRootForPath(e){return this.roots.filter(t=>Q(e,t.path)!==null).toSorted((e,t)=>t.path.length-e.path.length)[0]}getParentNode(e){let t=e??this.getPrimaryRootId(),n=this.delegate.find(t);return n?.data.isDirectory?n:null}getParentPath(e){return(this.delegate.find(e.id)?.parent)?.data.path??e.rootPath}getMutableNode(e,t=!0){let n=this.delegate.find(e);return!n||n.data.isRoot?(t&&y({title:`Failed`,description:n?`File browser roots cannot be modified`:`Node with id ${e} not found in the tree`}),null):n}refreshPaths=async(e,t)=>{let n=[...new Set(e)].toSorted((e,t)=>e.length-t.length);if(n.length===0)return;let r=await se(n,Ha,e=>this.callbacks.listFiles({path:e}).catch(()=>null));for(let[e,i]of n.entries()){let n=r[e];if(n)for(let e of this.roots){let r=Z(e.path,i);(!t||t.has(r))&&this.updateDirectory(r,n.files,t)}}this.emitChange()};updateDirectory(e,t,n){let r=this.delegate.find(e)?.data;if(!r?.isDirectory)return;let i=Ka(Ya(t,this.getRootForNode(r)),r.children);this.delegate.update({id:e,changes:{children:n?qa(i,n):i,loadState:`loaded`}})}emitChange(){let e=this.delegate.data;this.onChange(this.roots.length===1?[...e[0]?.children??[]]:e)}};function Ka(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return!e.isDirectory||!t?.isDirectory?e:{...e,children:t.children,loadState:t.loadState}})}function qa(e,t){return e.map(e=>e.isDirectory?t.has(e.id)?{...e,children:qa(e.children,t)}:{...e,children:[],loadState:`unloaded`}:e)}function Ja(e){return{id:Z(e.path,e.path),path:e.path,name:e.name,isDirectory:!0,isMarimoFile:!1,children:[],isRoot:!0,rootPath:e.path,isPrimaryRoot:e.isPrimary,loadState:`unloaded`}}function Ya(e,t){return e.map(e=>({...e,id:Z(t.path,e.path),children:Ya(e.children??[],t),loadState:e.children?.length?`loaded`:`unloaded`,isRoot:!1,rootPath:t.path,isPrimaryRoot:t.isPrimary}))}function Z(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function Q(e,t){let n=Za(t),r=e=>n?e.toLowerCase():e,i=r(e);if(i===r(t))return``;let a=Qa(t),o=t.endsWith(a)?t:`${t}${a}`,s=r(o);return i.startsWith(s)?e.slice(o.length):null}function Xa(e,t){return Q(e,t)===``}function $(e,t){let n=Qa(e);return`${e}${e.endsWith(n)?``:n}${t}`}function Za(e){return Ua.test(e)||Wa.test(e)}function Qa(e){return Wa.test(e)||/^[A-Za-z]:\\/.test(e)?`\\`:`/`}function $a(e){let t=(0,Y.c)(13),{root:n}=e,{sendRenameFileOrFolder:r,sendCopyFileOrFolder:i,sendDeleteFileOrFolder:a}=te(),o;t[0]!==n||t[1]!==r?(o=async(e,t)=>{let{path:i,newPath:a}=b({path:e.path,name:t,root:n});return X(await r({path:i,newPath:a}))},t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]!==n||t[4]!==i?(c=async e=>{let{path:t,newPath:r}=b({path:e.path,name:oe(e.name),root:n});return X(await i({path:t,newPath:r}))},t[3]=n,t[4]=i,t[5]=c):c=t[5];let l=c,u;t[6]!==n||t[7]!==a?(u=async e=>X(await a({path:ae(e.path,n)})),t[6]=n,t[7]=a,t[8]=u):u=t[8];let d=u,f;return t[9]!==d||t[10]!==l||t[11]!==s?(f={renameFile:s,duplicateFile:l,deleteFile:d},t[9]=d,t[10]=l,t[11]=s,t[12]=f):f=t[12],f}var eo={file:`Delete file`,folder:`Delete folder`,notebook:`Delete notebook`};function to(){let e=(0,Y.c)(2),{openConfirm:t}=v(),n;return e[0]===t?n=e[1]:(n=(e,n)=>{let r=e.kind??`file`;t({title:eo[r],description:`Are you sure you want to delete ${e.name}?`,confirmAction:(0,x.jsx)(c,{onClick:async()=>{await n()},"aria-label":`Confirm`,children:`Delete`})})},e[0]=t,e[1]=n),n}function no(e){let t=(0,Y.c)(17),{node:n,root:i,onAfterChange:a}=e,o;t[0]===i?o=t[1]:(o={root:i},t[0]=i,t[1]=o);let{duplicateFile:s,deleteFile:c}=$a(o),l=to(),u;t[2]===n?u=t[3]:(u=()=>{n.edit()},t[2]=n,t[3]=u);let d=r(u),f;t[4]!==s||t[5]!==n.data||t[6]!==a?(f=async()=>{await s(n.data)&&a?.()},t[4]=s,t[5]=n.data,t[6]=a,t[7]=f):f=t[7];let p=r(f),m;t[8]!==l||t[9]!==c||t[10]!==n.data||t[11]!==a?(m=()=>{let e=n.data.isDirectory?`folder`:n.data.isMarimoFile?`notebook`:`file`;l({name:n.data.name,kind:e},async()=>{await c(n.data)&&a?.()})},t[8]=l,t[9]=c,t[10]=n.data,t[11]=a,t[12]=m):m=t[12];let h=r(m),g;return t[13]!==h||t[14]!==p||t[15]!==d?(g={handleRename:d,handleDuplicate:p,handleDelete:h},t[13]=h,t[14]=p,t[15]=d,t[16]=g):g=t[16],g}var ro=e=>{let t=(0,Y.c)(15),{testId:n,buttonClassName:r,iconClassName:i,contentClassName:a,preventDefaultOnTrigger:o,children:s}=e,c=o!==void 0&&o,l;t[0]===c?l=t[1]:(l=e=>{e.stopPropagation(),c&&e.preventDefault()},t[0]=c,t[1]=l);let p;t[2]!==r||t[3]!==i||t[4]!==n?(p=(0,x.jsx)(h,{"data-testid":n,className:r,iconClassName:i}),t[2]=r,t[3]=i,t[4]=n,t[5]=p):p=t[5];let m;t[6]!==l||t[7]!==p?(m=(0,x.jsx)(u,{asChild:!0,tabIndex:-1,onClick:l,children:p}),t[6]=l,t[7]=p,t[8]=m):m=t[8];let g=a??`print:hidden w-[240px]`,_;t[9]!==s||t[10]!==g?(_=(0,x.jsx)(d,{align:`end`,className:g,onClick:so,onCloseAutoFocus:co,children:s}),t[9]=s,t[10]=g,t[11]=_):_=t[11];let v;return t[12]!==m||t[13]!==_?(v=(0,x.jsxs)(f,{modal:!1,children:[m,_]}),t[12]=m,t[13]=_,t[14]=v):v=t[14],v},io=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,x.jsx)(ce,{className:g}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,x.jsxs)(l,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Rename`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},ao=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,x.jsx)(_,{className:g}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,x.jsxs)(l,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Duplicate`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},oo=e=>{let t=(0,Y.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,x.jsx)(ee,{className:g}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,x.jsxs)(l,{onSelect:n,variant:`danger`,disabled:r,title:i,"data-testid":a,children:[o,`Delete`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s};function so(e){return e.stopPropagation()}function co(e){return e.preventDefault()}var lo=e=>{let t=(0,Y.c)(10),{node:n}=e,r=(0,S.useRef)(null),i,a;t[0]===n.data.name?(i=t[1],a=t[2]):(i=()=>{r.current?.focus();let e=n.data.name,t=e.lastIndexOf(`.`),i=t>0?t:e.length;r.current?.setSelectionRange(0,i)},a=[n.data.name],t[0]=n.data.name,t[1]=i,t[2]=a),(0,S.useEffect)(i,a);let o,s;t[3]===n?(o=t[4],s=t[5]):(o=()=>n.reset(),s=e=>{e.key===`Escape`&&n.reset(),e.key===`Enter`&&n.submit(e.currentTarget.value)},t[3]=n,t[4]=o,t[5]=s);let c;return t[6]!==n.data.name||t[7]!==o||t[8]!==s?(c=(0,x.jsx)(`input`,{ref:r,className:`flex-1 bg-transparent border border-border text-muted-foreground`,defaultValue:n.data.name,onClick:uo,onBlur:o,onKeyDown:s}),t[6]=n.data.name,t[7]=o,t[8]=s,t[9]=c):c=t[9],c};function uo(e){return e.stopPropagation()}export{io as a,Ga as c,gr as d,Vn as f,ro as i,Z as l,Qt as m,oo as n,$a as o,N as p,ao as r,no as s,lo as t,Va as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DfJ2oMlA.js";import{n as t}from"./semaphore-BjoL5P0h.js";var n=e(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),r=5;function i(e,t){return new Promise(n=>{let r=new FileReader;r.readAsDataURL(e),r.onload=e=>{if(e.target?.result){let r=e.target.result;n(t===`base64`?r.slice(r.indexOf(`,`)+1):r)}}})}function a(e){return t(e,r,async e=>{let t=await i(e,`base64`);return[e.name,t]})}export{a as n,n as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{l as t}from"./useEvent-Dfcbgjhg.js";import{t as n}from"./react-DVplv7_D.js";import{S as r,ct as i}from"./cells-Xw5dUhEN.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{g as o}from"./useEventListener-D6VFA611.js";import{d as s}from"./session-BTcQqCNB.js";import{t as c}from"./cn-ldLVeaqm.js";import{t as l}from"./jsx-runtime-B74pBk57.js";var u=a(),d=e(n(),1);function f(){return s()===`edit`?document.getElementById(`App`):void 0}function p(e){let t=(0,u.c)(7),[n,r]=(0,d.useState)(void 0),[a,o]=(0,d.useState)(void 0),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[0]=l):l=t[0];let p=(0,d.useRef)(l),h,g;t[1]===e?(h=t[2],g=t[3]):(h=()=>e.length===0?void 0:(s.current=new IntersectionObserver(e=>{let t=!1;if(e.forEach(e=>{let n=e.target;e.isIntersecting?(!c.current||n.getBoundingClientRect().top<c.current.getBoundingClientRect().top)&&(c.current=n,t=!0):n===c.current&&(c.current=null,t=!0)}),t&&c.current){let e=i(c.current),t=`id`in e?e.id:e.path;r(t),o(p.current.get(c.current))}},{root:f(),rootMargin:`0px`,threshold:0}),e.forEach(t=>{if(t){let n=i(t[0]),r=e.map(m).filter(e=>`id`in n?e.id===n.id:e.textContent===t[0].textContent).indexOf(t[0]);p.current.set(t[0],r),s.current?.observe(t[0])}}),()=>{s.current&&s.current.disconnect(),c.current=null}),g=[e],t[1]=e,t[2]=h,t[3]=g),(0,d.useEffect)(h,g);let _;return t[4]!==n||t[5]!==a?(_={activeHeaderId:n,activeOccurrences:a},t[4]=n,t[5]=a,t[6]=_):_=t[6],_}function m(e){let[t]=e;return t}function h(e){if(e.length===0)return[];let t=new Map;return e.map(e=>{let n=`id`in e.by?e.by.id:e.by.path,r=t.get(n)??0;t.set(n,r+1);let i=_(e,r);return i?[i,n]:null}).filter(Boolean)}function g(e,t){let n=_(e,t);if(!n){o.warn(`Could not find element for outline item`,e);return}n.scrollIntoView({behavior:`smooth`,block:`start`}),n.classList.add(`outline-item-highlight`),setTimeout(()=>{n.classList.remove(`outline-item-highlight`)},3e3)}function _(e,t){return`id`in e.by?document.querySelectorAll(`[id="${CSS.escape(e.by.id)}"]`)[t]:document.evaluate(e.by.path,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}var v=l(),y=()=>{let e=(0,u.c)(19),{items:n}=t(r),i;e[0]===n?i=e[1]:(i=h(n),e[0]=n,e[1]=i);let{activeHeaderId:a,activeOccurrences:o}=p(i),[s,l]=d.useState(!1);if(n.length<2)return null;let f,m,g;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>l(!0),m=()=>l(!1),g=c(`fixed top-[25vh] right-8 z-10000 print:hidden`,`hidden md:block`),e[2]=f,e[3]=m,e[4]=g):(f=e[2],m=e[3],g=e[4]);let _=s?`left-[-280px] opacity-100`:`left-[300px] opacity-0`,y;e[5]===_?y=e[6]:(y=c(`-top-4 max-h-[70vh] bg-background rounded-lg shadow-lg absolute overflow-auto transition-all duration-300 w-[300px] border`,_),e[5]=_,e[6]=y);let S;e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==y?(S=(0,v.jsx)(x,{className:y,items:n,activeHeaderId:a,activeOccurrences:o}),e[7]=a,e[8]=o,e[9]=n,e[10]=y,e[11]=S):S=e[11];let C;e[12]!==a||e[13]!==o||e[14]!==n?(C=(0,v.jsx)(b,{items:n,activeHeaderId:a,activeOccurrences:o}),e[12]=a,e[13]=o,e[14]=n,e[15]=C):C=e[15];let w;return e[16]!==S||e[17]!==C?(w=(0,v.jsxs)(`div`,{onMouseEnter:f,onMouseLeave:m,className:g,children:[S,C]}),e[16]=S,e[17]=C,e[18]=w):w=e[18],w},b=e=>{let t=(0,u.c)(8),{items:n,activeHeaderId:r,activeOccurrences:i}=e,a,o;if(t[0]!==r||t[1]!==i||t[2]!==n){let e=new Map;a=`flex flex-col gap-4 items-end max-h-[70vh] overflow-hidden`,o=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;return e.set(a,o+1),(0,v.jsx)(`div`,{className:c(`h-[2px] bg-muted-foreground/60`,t.level===1&&`w-5`,t.level===2&&`w-4`,t.level===3&&`w-3`,t.level===4&&`w-2`,o===i&&r===a&&`bg-foreground`),onClick:()=>g(t,o)},`${a}-${n}`)}),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o}else a=t[3],o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,v.jsx)(`div`,{className:a,children:o}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s},x=e=>{let t=(0,u.c)(11),{items:n,activeHeaderId:r,activeOccurrences:i,className:a}=e,o,s;if(t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==n){let e=new Map;t[6]===a?o=t[7]:(o=c(`flex flex-col overflow-auto py-4 pl-2`,a),t[6]=a,t[7]=o),s=n.map((t,n)=>{let a=`id`in t.by?t.by.id:t.by.path,o=e.get(a)??0;e.set(a,o+1);let s=`${a}-${n}`,l={className:c(`px-2 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l`,t.level===1&&`font-semibold`,t.level===2&&`ml-3`,t.level===3&&`ml-6`,t.level===4&&`ml-9`,o===i&&r===a&&`text-accent-foreground`),onClick:()=>g(t,o)};return t.html?(0,v.jsx)(`div`,{...l,dangerouslySetInnerHTML:{__html:t.html}},s):(0,v.jsx)(`div`,{...l,children:t.name},s)}),t[0]=r,t[1]=i,t[2]=a,t[3]=n,t[4]=o,t[5]=s}else o=t[4],s=t[5];let l;return t[8]!==o||t[9]!==s?(l=(0,v.jsx)(`div`,{className:o,children:s}),t[8]=o,t[9]=s,t[10]=l):l=t[10],l};export{p as i,x as n,h as r,y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-75Z2AOVW-DlSlUzCU.js";import"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-BxQd02hX.js";import"./chunk-P2QGCYS3-G6pmnA0z.js";import"./chunk-PWAF6VOD-Dy1Fp4eJ.js";import"./chunk-GMAD6QVW-B1Ai6qbk.js";import"./chunk-4HAMMTFA-Bhjs7H7G.js";import"./chunk-GVQU2GXP-a_N0QLD4.js";import"./chunk-L3NEJ4N5-BcHj9aiN.js";import"./chunk-OSK3NFVY-Dc7tMbN9.js";import"./chunk-LNGE3PJU-DWpGwHrW.js";import"./chunk-TLUHSLCS-Q72uYeUY.js";import"./chunk-F27PBJKO-DL9FG-iN.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-C3iw1mOR.js";import{n as e}from"./chunk-SHT3W25Y-B3kFJuvo.js";export{e as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./tooltip-
|
|
1
|
+
import{o as e}from"./tooltip-BSH8ID1U.js";function t(e){function t(e){return!!e?.schema&&Array.isArray(e.schema.fields)&&typeof e.toArray==`function`}return(t(e)?e:n(e)).toArray()}t.responseType=`arrayBuffer`;function n(t,n){return e(t,n??{useProxy:!0})}export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./numbers-
|
|
1
|
+
import{i as e}from"./numbers-DZJTimMO.js";function t(t,n){if(t===0||t===-1)return`0 B`;let r=1024,i=[`B`,`KB`,`MB`,`GB`,`TB`],a=Math.floor(Math.log(t)/Math.log(r)),o=t/r**a;return`${e(o,n)} ${i[a]}`}function n(t,n){if(t===0)return`0s`;if(t<.001)return`${e(t*1e6,n)}µs`;if(t<1)return`${e(t*1e3,n)}ms`;if(t<60)return`${e(t,n)}s`;let r=Math.floor(t/60),i=t%60;if(r<60)return i>0?`${r}m ${e(i,n)}s`:`${r}m`;let a=Math.floor(r/60),o=r%60;return o>0?`${a}h ${o}m`:`${a}h`}export{n,t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{t as n}from"./react-dom-CKsE8sC1.js";import{t as r}from"./compiler-runtime-BQ9S8nyo.js";import{o as i,r as a,t as o}from"./useEventListener-IRzG-0mH.js";import{t as s}from"./jsx-runtime-B74pBk57.js";var c=e(t(),1),l=e(n(),1),u=s(),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0}),p=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function m(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}f(m,`dispatchDiscreteCustomEvent`);var h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e,t){let n=c.createContext(t);n.displayName=e+`Context`;let r=g(e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=c.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return g(i,`useContext`),[r,i]}g(_,`createContext`);function v(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=g(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,u.jsx)(s.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=o?.[e]?.[a]||i,d=c.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return g(s,`useContext`),[o,s]}g(r,`createContext`);let i=g(()=>{let t=n.map(e=>c.createContext(e));return g(function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,y(i,...t)]}g(v,`createContextScope`);function y(...e){let t=e[0];if(e.length===1)return t;let n=g(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return g(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}g(y,`composeContextScopes`);var b=Object.defineProperty,x=(e,t)=>b(e,`name`,{value:t,configurable:!0}),S=!!(typeof window<`u`&&window.document&&window.document.createElement);function C(e,t,{checkForDefaultPrevented:n=!0}={}){return x(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}x(C,`composeEventHandlers`);function w(e){if(!S)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}x(w,`getOwnerWindow`);function T(e){if(!S)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}x(T,`getOwnerDocument`);function E(e,t=!1){let{activeElement:n}=T(e);if(!n?.nodeName)return null;if(D(n)&&n.contentDocument)return E(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=T(n).getElementById(e);if(t)return t}}return n}x(E,`getActiveElement`);function D(e){return e.tagName===`IFRAME`}x(D,`isFrame`);var O=globalThis?.document?c.useLayoutEffect:()=>{},ee=Object.defineProperty,te=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),k=c.useEffectEvent,ne=c.useInsertionEffect;function re(e){if(typeof k==`function`)return k(e);let t=c.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ne==`function`?ne(()=>{t.current=e}):O(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}te(re,`useEffectEvent`);var ie=Object.defineProperty,A=(e,t)=>ie(e,`name`,{value:t,configurable:!0}),ae=c.useInsertionEffect||O;function oe({prop:e,defaultProp:t,onChange:n=A(()=>{},`onChange`),caller:r}){let[i,a,o]=se({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,c.useCallback(t=>{if(s){let n=ce(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}A(oe,`useControllableState`);function se({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return ae(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}A(se,`useUncontrolledState`);function ce(e){return typeof e==`function`}A(ce,`isFunction`);var le=Symbol(`RADIX:SYNC_STATE`);function ue(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,l=i!==void 0,u=re(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=c.useReducer((t,n)=>{if(n.type===le)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=c.useRef(m);c.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=c.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return c.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:le,state:i})},[i,f.state,l]),[g,p]}A(ue,`useControllableStateReducer`);var de=Object.defineProperty,j=(e,t)=>de(e,`name`,{value:t,configurable:!0});function fe(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}j(fe,`useStateMachine`);var pe=j(e=>{let{present:t,children:n}=e,r=me(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=ge(r.ref,_e(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null},`Presence`);function me(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=fe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??M(r.current),o.current=void 0):a.current=`none`},[s]),O(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=M(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),O(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=j(a=>{let o=M(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=j(e=>{e.target===t&&(a.current=M(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=M(t)}else r.current=null;n(e)},[])}}j(me,`usePresence`);function he(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}j(he,`setRef`);function ge(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=he(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():he(n[e],null)}}},[])}j(ge,`useStableComposedRefs`);function M(e){return e?.animationName||`none`}j(M,`getAnimationName`);function _e(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}j(_e,`getElementRef`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=c.useId||(()=>void 0),xe=0;function Se(e){let[t,n]=c.useState(be());return O(()=>{e||n(e=>e??String(xe++))},[e]),e||(t?`radix-${t}`:``)}ye(Se,`useId`);var Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0});function N(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}we(N,`useCallbackRef`);var Te=Object.defineProperty,P=(e,t)=>Te(e,`name`,{value:t,configurable:!0}),Ee=`dismissableLayer.update`,De=`dismissableLayer.pointerDownOutside`,Oe=`dismissableLayer.focusOutside`,ke,Ae=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),je=c.forwardRef(P(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:d,...f}=e,m=c.useContext(Ae),[h,g]=c.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=c.useState({}),y=i(t,g),b=Array.from(m.layers),[x]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=x?b.indexOf(x):-1,w=h?b.indexOf(h):-1,T=m.layersWithOutsidePointerEventsDisabled.size>0,E=w>=S,D=c.useRef(!1),O=Fe(e=>{o?.(e),l?.(e),e.defaultPrevented||d?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return E&&!t},[m.branches,E])}),ee=Ie(e=>{if(r&&D.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||d?.())},_),te=h?w===b.length-1:!1,k=N(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return c.useEffect(()=>{if(te)return _.addEventListener(`keydown`,k,{capture:!0}),()=>_.removeEventListener(`keydown`,k,{capture:!0})},[_,te,k]),c.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ke=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Le(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=ke))}},[h,_,n,m]),c.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Le())},[h,m]),c.useEffect(()=>{let e=P(()=>v({}),`handleUpdate`);return document.addEventListener(Ee,e),()=>document.removeEventListener(Ee,e)},[]),(0,u.jsx)(p.div,{...f,ref:y,style:{pointerEvents:T?E?`auto`:`none`:void 0,...e.style},onFocusCapture:C(e.onFocusCapture,ee.onFocusCapture),onBlurCapture:C(e.onBlurCapture,ee.onBlurCapture),onPointerDownCapture:C(e.onPointerDownCapture,O.onPointerDownCapture)})},`DismissableLayer`)),Me=c.forwardRef(P(function(e,t){let n=c.useContext(Ae),r=c.useRef(null),a=i(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(p.div,{...e,ref:a})},`DismissableLayerBranch`));function Ne(){let e=c.useContext(Ae),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}P(Ne,`useDismissableLayerSurface`);var Pe=P(()=>!0,`IS_TRUE`);function Fe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Pe}=t,s=N(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}P(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}P(t,`isOutsideInteractionIntercepted`);function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}P(c,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}P(p,`handleInteractionBubble`);let m=P(a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Re(De,s,p,{discrete:!0})};if(P(c,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:P(()=>l.current=!0,`onPointerDownCapture`)}}P(Fe,`usePointerDownOutside`);function Ie(e,t=globalThis?.document){let n=N(e),r=c.useRef(!1);return c.useEffect(()=>{let e=P(e=>{e.target&&!r.current&&Re(Oe,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:P(()=>r.current=!0,`onFocusCapture`),onBlurCapture:P(()=>r.current=!1,`onBlurCapture`)}}P(Ie,`useFocusOutside`);function Le(){let e=new CustomEvent(Ee);document.dispatchEvent(e)}P(Le,`dispatchUpdate`);function Re(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?m(i,a):i.dispatchEvent(a)}P(Re,`handleAndDispatchCustomEvent`);var ze=je,Be=Me,Ve=Object.defineProperty,F=(e,t)=>Ve(e,`name`,{value:t,configurable:!0}),He=`focusScope.autoFocusOnMount`,Ue=`focusScope.autoFocusOnUnmount`,We={bubbles:!1,cancelable:!0},Ge=c.forwardRef(F(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,d]=c.useState(null),f=N(a),m=N(o),h=c.useRef(null),g=i(t,d),_=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?h.current=t:I(h.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||I(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(l)};F(e,`handleFocusIn`),F(t,`handleFocusOut`),F(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),c.useEffect(()=>{if(l){Qe.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(He,We);l.addEventListener(He,f),l.dispatchEvent(t),t.defaultPrevented||(Ke(tt(Je(l)),{select:!0}),document.activeElement===e&&I(l))}return()=>{l.removeEventListener(He,f),setTimeout(()=>{let t=new CustomEvent(Ue,We);l.addEventListener(Ue,m),l.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),l.removeEventListener(Ue,m),Qe.remove(_)},0)}}},[l,f,m,_]);let v=c.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=qe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,u.jsx)(p.div,{tabIndex:-1,...s,ref:g,onKeyDown:v})},`FocusScope`));function Ke(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}F(Ke,`focusFirst`);function qe(e){let t=Je(e);return[Ye(t,e),Ye(t.reverse(),e)]}F(qe,`getTabbableEdges`);function Je(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:F(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}F(Je,`getTabbableCandidates`);function Ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Xe(r,{upTo:t})))return r}F(Ye,`findVisible`);function Xe(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}F(Xe,`isHidden`);function Ze(e){return e instanceof HTMLInputElement&&`select`in e}F(Ze,`isSelectableInput`);function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ze(e)&&t&&e.select()}}F(I,`focus`);var Qe=$e();function $e(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=et(e,t),e.unshift(t)},remove(t){e=et(e,t),e[0]?.resume()}}}F($e,`createFocusScopesStack`);function et(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}F(et,`arrayRemove`);function tt(e){return e.filter(e=>e.tagName!==`A`)}F(tt,`removeLinks`);var nt=Object.defineProperty,rt=c.forwardRef(((e,t)=>nt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=c.useState(!1);O(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?l.createPortal((0,u.jsx)(p.div,{...r,ref:t}),o):null},`Portal`)),it=Object.defineProperty,at=(e,t)=>it(e,`name`,{value:t,configurable:!0}),L=0,R=null;function ot(e){return st(),e.children}at(ot,`FocusGuards`);function st(){c.useEffect(()=>{R||={start:ct(),end:ct()};let{start:e,end:t}=R;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),L++,()=>{L===1&&(R?.start.remove(),R?.end.remove(),R=null),L=Math.max(0,L-1)}},[])}at(st,`useFocusGuards`);function ct(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}at(ct,`createFocusGuard`);var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function lt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ut(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,ft=`with-scroll-bars-hidden`,pt=`--removed-body-scroll-bar-size`;function mt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ht(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var gt=typeof window<`u`?c.useLayoutEffect:c.useEffect,_t=new WeakMap;function vt(e,t){var n=ht(t||null,function(t){return e.forEach(function(e){return mt(e,t)})});return gt(function(){var t=_t.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||mt(e,null)}),i.forEach(function(e){r.has(e)||mt(e,a)})}_t.set(n,e)},[e]),n}function yt(e){return e}function bt(e,t){t===void 0&&(t=yt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function xt(e){e===void 0&&(e={});var t=bt(null);return t.options=z({async:!0,ssr:!1},e),t}var St=function(e){var t=e.sideCar,n=lt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,z({},n))};St.isSideCarExport=!0;function Ct(e,t){return e.useMedium(t),St}var wt=xt(),Tt=function(){},H=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Tt,onWheelCapture:Tt,onTouchMoveCapture:Tt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=lt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=vt([n,t]),w=z(z({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:wt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),z(z({},w),{ref:C})):c.createElement(y,z({},w,{className:l,ref:C}),s))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:V,zeroRight:B};var Et=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Dt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Et();return t&&e.setAttribute(`nonce`,t),e}function Ot(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var At=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dt())&&(Ot(t,n),kt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jt=function(){var e=At();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mt=function(){var e=jt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Nt={left:0,top:0,right:0,gap:0},Pt=function(e){return parseInt(e||``,10)||0},Ft=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Pt(n),Pt(r),Pt(i)]},It=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Nt;var t=Ft(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lt=Mt(),U=`data-scroll-locked`,Rt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./react-dom-_LrxgvjW.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{o as i,r as a,t as o}from"./useEventListener-D6VFA611.js";import{t as s}from"./jsx-runtime-B74pBk57.js";var c=e(t(),1),l=e(n(),1),u=s(),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0}),p=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=a(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function m(e,t){e&&l.flushSync(()=>e.dispatchEvent(t))}f(m,`dispatchDiscreteCustomEvent`);var h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e,t){let n=c.createContext(t);n.displayName=e+`Context`;let r=g(e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=c.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return g(i,`useContext`),[r,i]}g(_,`createContext`);function v(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=g(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,u.jsx)(s.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=o?.[e]?.[a]||i,d=c.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return g(s,`useContext`),[o,s]}g(r,`createContext`);let i=g(()=>{let t=n.map(e=>c.createContext(e));return g(function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,y(i,...t)]}g(v,`createContextScope`);function y(...e){let t=e[0];if(e.length===1)return t;let n=g(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return g(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}g(y,`composeContextScopes`);var b=Object.defineProperty,x=(e,t)=>b(e,`name`,{value:t,configurable:!0}),S=!!(typeof window<`u`&&window.document&&window.document.createElement);function C(e,t,{checkForDefaultPrevented:n=!0}={}){return x(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}x(C,`composeEventHandlers`);function w(e){if(!S)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}x(w,`getOwnerWindow`);function T(e){if(!S)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}x(T,`getOwnerDocument`);function E(e,t=!1){let{activeElement:n}=T(e);if(!n?.nodeName)return null;if(D(n)&&n.contentDocument)return E(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=T(n).getElementById(e);if(t)return t}}return n}x(E,`getActiveElement`);function D(e){return e.tagName===`IFRAME`}x(D,`isFrame`);var O=globalThis?.document?c.useLayoutEffect:()=>{},ee=Object.defineProperty,te=(e,t)=>ee(e,`name`,{value:t,configurable:!0}),k=c.useEffectEvent,ne=c.useInsertionEffect;function re(e){if(typeof k==`function`)return k(e);let t=c.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ne==`function`?ne(()=>{t.current=e}):O(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}te(re,`useEffectEvent`);var ie=Object.defineProperty,A=(e,t)=>ie(e,`name`,{value:t,configurable:!0}),ae=c.useInsertionEffect||O;function oe({prop:e,defaultProp:t,onChange:n=A(()=>{},`onChange`),caller:r}){let[i,a,o]=se({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,c.useCallback(t=>{if(s){let n=ce(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}A(oe,`useControllableState`);function se({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return ae(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}A(se,`useUncontrolledState`);function ce(e){return typeof e==`function`}A(ce,`isFunction`);var le=Symbol(`RADIX:SYNC_STATE`);function ue(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,l=i!==void 0,u=re(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=c.useReducer((t,n)=>{if(n.type===le)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=c.useRef(m);c.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=c.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return c.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:le,state:i})},[i,f.state,l]),[g,p]}A(ue,`useControllableStateReducer`);var de=Object.defineProperty,j=(e,t)=>de(e,`name`,{value:t,configurable:!0});function fe(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}j(fe,`useStateMachine`);var pe=j(e=>{let{present:t,children:n}=e,r=me(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=ge(r.ref,_e(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null},`Presence`);function me(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=fe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??M(r.current),o.current=void 0):a.current=`none`},[s]),O(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=M(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),O(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=j(a=>{let o=M(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=j(e=>{e.target===t&&(a.current=M(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=M(t)}else r.current=null;n(e)},[])}}j(me,`usePresence`);function he(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}j(he,`setRef`);function ge(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=he(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():he(n[e],null)}}},[])}j(ge,`useStableComposedRefs`);function M(e){return e?.animationName||`none`}j(M,`getAnimationName`);function _e(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}j(_e,`getElementRef`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=c.useId||(()=>void 0),xe=0;function Se(e){let[t,n]=c.useState(be());return O(()=>{e||n(e=>e??String(xe++))},[e]),e||(t?`radix-${t}`:``)}ye(Se,`useId`);var Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0});function N(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}we(N,`useCallbackRef`);var Te=Object.defineProperty,P=(e,t)=>Te(e,`name`,{value:t,configurable:!0}),Ee=`dismissableLayer.update`,De=`dismissableLayer.pointerDownOutside`,Oe=`dismissableLayer.focusOutside`,ke,Ae=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),je=c.forwardRef(P(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:d,...f}=e,m=c.useContext(Ae),[h,g]=c.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=c.useState({}),y=i(t,g),b=Array.from(m.layers),[x]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=x?b.indexOf(x):-1,w=h?b.indexOf(h):-1,T=m.layersWithOutsidePointerEventsDisabled.size>0,E=w>=S,D=c.useRef(!1),O=Fe(e=>{o?.(e),l?.(e),e.defaultPrevented||d?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return E&&!t},[m.branches,E])}),ee=Ie(e=>{if(r&&D.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||d?.())},_),te=h?w===b.length-1:!1,k=N(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return c.useEffect(()=>{if(te)return _.addEventListener(`keydown`,k,{capture:!0}),()=>_.removeEventListener(`keydown`,k,{capture:!0})},[_,te,k]),c.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ke=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Le(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=ke))}},[h,_,n,m]),c.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Le())},[h,m]),c.useEffect(()=>{let e=P(()=>v({}),`handleUpdate`);return document.addEventListener(Ee,e),()=>document.removeEventListener(Ee,e)},[]),(0,u.jsx)(p.div,{...f,ref:y,style:{pointerEvents:T?E?`auto`:`none`:void 0,...e.style},onFocusCapture:C(e.onFocusCapture,ee.onFocusCapture),onBlurCapture:C(e.onBlurCapture,ee.onBlurCapture),onPointerDownCapture:C(e.onPointerDownCapture,O.onPointerDownCapture)})},`DismissableLayer`)),Me=c.forwardRef(P(function(e,t){let n=c.useContext(Ae),r=c.useRef(null),a=i(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(p.div,{...e,ref:a})},`DismissableLayerBranch`));function Ne(){let e=c.useContext(Ae),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}P(Ne,`useDismissableLayerSurface`);var Pe=P(()=>!0,`IS_TRUE`);function Fe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Pe}=t,s=N(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}P(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}P(t,`isOutsideInteractionIntercepted`);function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}P(c,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}P(p,`handleInteractionBubble`);let m=P(a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Re(De,s,p,{discrete:!0})};if(P(c,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:P(()=>l.current=!0,`onPointerDownCapture`)}}P(Fe,`usePointerDownOutside`);function Ie(e,t=globalThis?.document){let n=N(e),r=c.useRef(!1);return c.useEffect(()=>{let e=P(e=>{e.target&&!r.current&&Re(Oe,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:P(()=>r.current=!0,`onFocusCapture`),onBlurCapture:P(()=>r.current=!1,`onBlurCapture`)}}P(Ie,`useFocusOutside`);function Le(){let e=new CustomEvent(Ee);document.dispatchEvent(e)}P(Le,`dispatchUpdate`);function Re(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?m(i,a):i.dispatchEvent(a)}P(Re,`handleAndDispatchCustomEvent`);var ze=je,Be=Me,Ve=Object.defineProperty,F=(e,t)=>Ve(e,`name`,{value:t,configurable:!0}),He=`focusScope.autoFocusOnMount`,Ue=`focusScope.autoFocusOnUnmount`,We={bubbles:!1,cancelable:!0},Ge=c.forwardRef(F(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,d]=c.useState(null),f=N(a),m=N(o),h=c.useRef(null),g=i(t,d),_=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;l.contains(t)?h.current=t:I(h.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||I(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(l)};F(e,`handleFocusIn`),F(t,`handleFocusOut`),F(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused]),c.useEffect(()=>{if(l){Qe.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(He,We);l.addEventListener(He,f),l.dispatchEvent(t),t.defaultPrevented||(Ke(tt(Je(l)),{select:!0}),document.activeElement===e&&I(l))}return()=>{l.removeEventListener(He,f),setTimeout(()=>{let t=new CustomEvent(Ue,We);l.addEventListener(Ue,m),l.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),l.removeEventListener(Ue,m),Qe.remove(_)},0)}}},[l,f,m,_]);let v=c.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=qe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,u.jsx)(p.div,{tabIndex:-1,...s,ref:g,onKeyDown:v})},`FocusScope`));function Ke(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}F(Ke,`focusFirst`);function qe(e){let t=Je(e);return[Ye(t,e),Ye(t.reverse(),e)]}F(qe,`getTabbableEdges`);function Je(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:F(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}F(Je,`getTabbableCandidates`);function Ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Xe(r,{upTo:t})))return r}F(Ye,`findVisible`);function Xe(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}F(Xe,`isHidden`);function Ze(e){return e instanceof HTMLInputElement&&`select`in e}F(Ze,`isSelectableInput`);function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ze(e)&&t&&e.select()}}F(I,`focus`);var Qe=$e();function $e(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=et(e,t),e.unshift(t)},remove(t){e=et(e,t),e[0]?.resume()}}}F($e,`createFocusScopesStack`);function et(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}F(et,`arrayRemove`);function tt(e){return e.filter(e=>e.tagName!==`A`)}F(tt,`removeLinks`);var nt=Object.defineProperty,rt=c.forwardRef(((e,t)=>nt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=c.useState(!1);O(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?l.createPortal((0,u.jsx)(p.div,{...r,ref:t}),o):null},`Portal`)),it=Object.defineProperty,at=(e,t)=>it(e,`name`,{value:t,configurable:!0}),L=0,R=null;function ot(e){return st(),e.children}at(ot,`FocusGuards`);function st(){c.useEffect(()=>{R||={start:ct(),end:ct()};let{start:e,end:t}=R;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),L++,()=>{L===1&&(R?.start.remove(),R?.end.remove(),R=null),L=Math.max(0,L-1)}},[])}at(st,`useFocusGuards`);function ct(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}at(ct,`createFocusGuard`);var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function lt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ut(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var B=`right-scroll-bar-position`,V=`width-before-scroll-bar`,ft=`with-scroll-bars-hidden`,pt=`--removed-body-scroll-bar-size`;function mt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ht(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var gt=typeof window<`u`?c.useLayoutEffect:c.useEffect,_t=new WeakMap;function vt(e,t){var n=ht(t||null,function(t){return e.forEach(function(e){return mt(e,t)})});return gt(function(){var t=_t.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||mt(e,null)}),i.forEach(function(e){r.has(e)||mt(e,a)})}_t.set(n,e)},[e]),n}function yt(e){return e}function bt(e,t){t===void 0&&(t=yt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function xt(e){e===void 0&&(e={});var t=bt(null);return t.options=z({async:!0,ssr:!1},e),t}var St=function(e){var t=e.sideCar,n=lt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,z({},n))};St.isSideCarExport=!0;function Ct(e,t){return e.useMedium(t),St}var wt=xt(),Tt=function(){},H=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Tt,onWheelCapture:Tt,onTouchMoveCapture:Tt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=lt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=vt([n,t]),w=z(z({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:wt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),z(z({},w),{ref:C})):c.createElement(y,z({},w,{className:l,ref:C}),s))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:V,zeroRight:B};var Et=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Dt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Et();return t&&e.setAttribute(`nonce`,t),e}function Ot(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var At=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Dt())&&(Ot(t,n),kt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jt=function(){var e=At();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Mt=function(){var e=jt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Nt={left:0,top:0,right:0,gap:0},Pt=function(e){return parseInt(e||``,10)||0},Ft=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Pt(n),Pt(r),Pt(i)]},It=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Nt;var t=Ft(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Lt=Mt(),U=`data-scroll-locked`,Rt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${ft} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{l as r,t as i}from"./session-BTcQqCNB.js";import{t as a}from"./ErrorBoundary-Do-5LLlk.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{n as s,t as c}from"./paths-bkIFVj8h.js";import{i as l}from"./components-DROCn9r7.js";import{t as u}from"./spinner-DyNE-o8o.js";import{r as d,rn as f}from"./input-yy27ac_N.js";import{r as p}from"./requests-lt0JK8Jt.js";import{n as m}from"./useAsyncData-C7aJJz0Y.js";import{a as h}from"./errors-DCrsa1nH.js";import{t as g}from"./error-banner-ByiBdwpq.js";import{n as _,t as v}from"./card-DOABds5l.js";var y=n(),b=e(t(),1),x=o(),S=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),C=e=>{let t=c.guessDeliminator(e).deliminator;return e.replace(/\.[^./]+$/,``).split(t).filter(Boolean).map(e=>e.split(/[_-]/).map(S).join(` `)).join(` > `)},w=e=>`${i()}-${encodeURIComponent(e)}`,T=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},E=10,D=()=>{let e=(0,y.c)(32),{getWorkspaceFiles:t}=p(),[n,i]=(0,b.useState)(``),o;e[0]===t?o=e[1]:(o=()=>t({includeMarkdown:!1}),e[0]=t,e[1]=o);let c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],e[2]=c):c=e[2];let _=m(o,c),v=_.data;v?.files,v?.root;let S;e[3]===v?.files?S=e[4]:(S=v?.files??[],e[3]=v?.files,e[4]=S);let w=S,D=v?.root??``,j;if(e[5]!==w||e[6]!==D){let t;e[8]===D?t=e[9]:(t=e=>{let t=D&&s.isAbsolute(e.path)&&e.path.startsWith(D)?s.rest(e.path,D):e.path,n=e.opengraph?.title??C(s.basename(t)),i=C(s.dirname(t)),a=e.opengraph?.description??``,o=e.opengraph?.image,c=o&&T(o)?o:r(`og/thumbnail?file=${encodeURIComponent(t)}`).toString();return{...e,relativePath:t,title:n,subtitle:i,description:a,thumbnailUrl:c}},e[8]=D,e[9]=t),j=w.filter(O).map(t).toSorted(k),e[5]=w,e[6]=D,e[7]=j}else j=e[7];let M=j,N;bb0:{if(!n){N=M;break bb0}let t;if(e[10]!==M||e[11]!==n){let r=n.toLowerCase();t=M.filter(e=>e.title.toLowerCase().includes(r)),e[10]=M,e[11]=n,e[12]=t}else t=e[12];N=t}let P=N;if(_.isPending){let t;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(u,{centered:!0,size:`xlarge`,className:`mt-6`}),e[13]=t):t=e[13],t}if(_.error){let t;e[14]===_.error?t=e[15]:(t=h(_.error),e[14]=_.error,e[15]=t);let n;return e[16]===t?n=e[17]:(n=(0,x.jsx)(g,{kind:`danger`,className:`rounded p-4`,children:t}),e[16]=t,e[17]=n),n}if(!v){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(u,{centered:!0,size:`xlarge`,className:`mt-6`}),e[18]=t):t=e[18],t}let F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,x.jsx)(`img`,{src:`logo.png`,alt:`marimo logo`,className:`w-48 mb-2`}),e[19]=F):F=e[19];let I;e[20]!==v.fileCount||e[21]!==v.hasMore?(I=v.hasMore&&(0,x.jsx)(l,{fileCount:v.fileCount}),e[20]=v.fileCount,e[21]=v.hasMore,e[22]=I):I=e[22];let L;e[23]!==M.length||e[24]!==n?(L=M.length>E&&(0,x.jsx)(d,{id:`search`,value:n,icon:(0,x.jsx)(f,{className:`h-4 w-4`}),onChange:e=>i(e.target.value),placeholder:`Search`,rootClassName:`mb-3`,className:`mb-0 border-border`}),e[23]=M.length,e[24]=n,e[25]=L):L=e[25];let R;e[26]===P?R=e[27]:(R=P.length===0?(0,x.jsx)(g,{kind:`warn`,className:`rounded p-4`,children:`No marimo apps found.`}):(0,x.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:P.map(A)}),e[26]=P,e[27]=R);let z;return e[28]!==I||e[29]!==L||e[30]!==R?(z=(0,x.jsx)(b.Suspense,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10`,children:[F,(0,x.jsx)(a,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[I,L,R]})})]})}),e[28]=I,e[29]=L,e[30]=R,e[31]=z):z=e[31],z};function O(e){return!e.isDirectory}function k(e,t){return e.relativePath.localeCompare(t.relativePath)}function A(e){return(0,x.jsx)(`a`,{href:r(`?file=${encodeURIComponent(e.relativePath)}`).toString(),target:w(e.path),className:`no-underline`,children:(0,x.jsxs)(v,{className:`h-full overflow-hidden hover:bg-accent/20 transition-colors`,children:[(0,x.jsx)(`img`,{src:e.thumbnailUrl,alt:e.title,loading:`lazy`,className:`w-full aspect-1200/630 object-cover border-b border-border/60`}),(0,x.jsx)(_,{className:`p-6 pt-4`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.subtitle&&(0,x.jsx)(`div`,{className:`text-sm font-semibold text-muted-foreground`,children:e.subtitle}),(0,x.jsx)(`div`,{className:`text-lg font-medium`,children:e.title}),e.description&&(0,x.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-3 mt-1`,children:e.description})]})})]})},e.path)}export{D as default};
|