@marimo-team/frontend 0.16.2 → 0.16.3

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.
Files changed (293) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-B5cPvWoQ.js → ConnectedDataExplorerComponent-Brtw1DxF.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CqR26LSv.js → ImageComparisonComponent-Dxl-PbZX.js} +1 -1
  3. package/dist/assets/{VegaLite-DvQDATwI.js → VegaLite-BXQF0Cx_.js} +1 -1
  4. package/dist/assets/_baseEach-BjSm9ht3.js +1 -0
  5. package/dist/assets/_baseMap-CV4Ezmtf.js +1 -0
  6. package/dist/assets/_baseUniq-Ci9yZGxz.js +1 -0
  7. package/dist/assets/{_createAggregator-ZcHkHPNJ.js → _createAggregator-VFK9K2d9.js} +1 -1
  8. package/dist/assets/{agent-panel-B91RoLct.js → agent-panel-BoscVLCT.js} +7 -7
  9. package/dist/assets/{any-language-editor-CxfHcm5h.js → any-language-editor-ChaY_VUU.js} +1 -1
  10. package/dist/assets/{architectureDiagram-W76B3OCA-BQsvK8uR.js → architectureDiagram-W76B3OCA-CueUUFYd.js} +1 -1
  11. package/dist/assets/{between-horizontal-start-BmYToIaM.js → between-horizontal-start-DAHqmLYT.js} +1 -1
  12. package/dist/assets/{blockDiagram-QIGZ2CNN-r3HgCj4w.js → blockDiagram-QIGZ2CNN-BYYygyWn.js} +1 -1
  13. package/dist/assets/{c4Diagram-FPNF74CW-BJbPNt41.js → c4Diagram-FPNF74CW-DAz3xEh1.js} +1 -1
  14. package/dist/assets/channel-6SqQ2U_X.js +1 -0
  15. package/dist/assets/chat-panel-DJkOLrw9.js +3 -0
  16. package/dist/assets/{chunk-4BX2VUAB-Dv4MZ9Hj.js → chunk-4BX2VUAB-8g-RyHdt.js} +1 -1
  17. package/dist/assets/{chunk-55IACEB6-CM4AHquB.js → chunk-55IACEB6-iWZZ8Mt6.js} +1 -1
  18. package/dist/assets/{chunk-FMBD7UC4-C_Zz0ENB.js → chunk-FMBD7UC4-knjss4wk.js} +1 -1
  19. package/dist/assets/{chunk-K7UQS3LO-DYSmiXYq.js → chunk-K7UQS3LO-DVIwPBgZ.js} +1 -1
  20. package/dist/assets/{chunk-QN33PNHL-QM4OPuQP.js → chunk-QN33PNHL-CBU8pN6I.js} +1 -1
  21. package/dist/assets/{chunk-QZHKN3VN-CfAsGyeB.js → chunk-QZHKN3VN-5ljElUF4.js} +1 -1
  22. package/dist/assets/{chunk-TVAH2DTR-6j_Cpjsi.js → chunk-TVAH2DTR-DkIdGINc.js} +1 -1
  23. package/dist/assets/{chunk-TZMSLE5B-BHslFJQE.js → chunk-TZMSLE5B-CIFOSTqh.js} +1 -1
  24. package/dist/assets/{circle-play-CK3UZRYQ.js → circle-play-BOdsbq5u.js} +1 -1
  25. package/dist/assets/classDiagram-KNZD7YFC-DVqXcTYf.js +1 -0
  26. package/dist/assets/classDiagram-v2-RKCZMP56-DVqXcTYf.js +1 -0
  27. package/dist/assets/{clear-button-C4fDVSv8.js → clear-button-GAjXl0CQ.js} +1 -1
  28. package/dist/assets/clone-DSDb0xen.js +1 -0
  29. package/dist/assets/command-palette-BUXkqoLh.js +1 -0
  30. package/dist/assets/{common-D-lbuUwz.js → common-DahoYqdi.js} +1 -1
  31. package/dist/assets/{compile-DVQe1Mzk.js → compile-Bg8uJ7vm.js} +1 -1
  32. package/dist/assets/{cose-bilkent-S5V4N54A-D-IS7WC8.js → cose-bilkent-S5V4N54A-z_0gqD9K.js} +1 -1
  33. package/dist/assets/{dagre-5GWH7T2D-lYu-tEWT.js → dagre-5GWH7T2D-BMt7CNXL.js} +1 -1
  34. package/dist/assets/{data-grid-overlay-editor-C5peOCit.js → data-grid-overlay-editor-Ctn4XtXx.js} +1 -1
  35. package/dist/assets/{datasources-panel-D3NA20uZ.js → datasources-panel-C7sqRIHs.js} +1 -1
  36. package/dist/assets/{dependency-graph-panel-BGVYOfkV.js → dependency-graph-panel-DNajptzv.js} +4 -4
  37. package/dist/assets/{diagram-N5W7TBWH-BnvIuYUp.js → diagram-N5W7TBWH-BzwvLvAy.js} +1 -1
  38. package/dist/assets/{diagram-QEK2KX5R-DemedRK3.js → diagram-QEK2KX5R-DRLJ56FS.js} +1 -1
  39. package/dist/assets/{diagram-S2PKOQOG-iiY7AuyH.js → diagram-S2PKOQOG-Bf8x4KTU.js} +1 -1
  40. package/dist/assets/{documentation-panel-C3dSwOSQ.js → documentation-panel-Dm6Ozl67.js} +1 -1
  41. package/dist/assets/edit-page-CGc9EjuG.js +140 -0
  42. package/dist/assets/{ellipsis-vertical-CazJl8M7.js → ellipsis-vertical-Bj1YXvZe.js} +1 -1
  43. package/dist/assets/{empty-state-DW308mFO.js → empty-state-CYev-D31.js} +1 -1
  44. package/dist/assets/{erDiagram-AWTI2OKA-6wQ8Ugg0.js → erDiagram-AWTI2OKA-DmgzgN_I.js} +1 -1
  45. package/dist/assets/{error-panel-D1VnJ1yP.js → error-panel-BYG4twCa.js} +1 -1
  46. package/dist/assets/{file-explorer-panel-0oVd4t-D.js → file-explorer-panel-BSMiOApi.js} +1 -1
  47. package/dist/assets/{flowDiagram-PVAE7QVJ-C55IUWjm.js → flowDiagram-PVAE7QVJ-BdRKkajr.js} +1 -1
  48. package/dist/assets/{ganttDiagram-OWAHRB6G-DmqCM6ME.js → ganttDiagram-OWAHRB6G-lfRAMnq_.js} +5 -5
  49. package/dist/assets/{gitGraphDiagram-NY62KEGX-DBvhAeM_.js → gitGraphDiagram-NY62KEGX-CQVTIrHF.js} +1 -1
  50. package/dist/assets/{glide-data-editor-CHNuHidQ.js → glide-data-editor-D5A4pou7.js} +11 -11
  51. package/dist/assets/{graph-CG6BgUWQ.js → graph-CBNo279v.js} +1 -1
  52. package/dist/assets/{home-page-dgivXuSR.js → home-page-CmdznBJR.js} +3 -3
  53. package/dist/assets/{index-BTGpssVX.js → index-0dfGh-Gj.js} +1 -1
  54. package/dist/assets/{index-C7dtgr9A.js → index-BDYVSSzB.js} +1 -1
  55. package/dist/assets/{index-C02SqeRj.js → index-B_KyDZ94.js} +1 -1
  56. package/dist/assets/{index-mkubqy9-.js → index-Bfy-I_lW.js} +1 -1
  57. package/dist/assets/{index-BelfnXwL.js → index-Bh98Tp-z.js} +1 -1
  58. package/dist/assets/{index-CAQvMTzM.js → index-BhroIwBL.js} +1 -1
  59. package/dist/assets/{index-BneyUujp.js → index-BtQtesaI.js} +1 -1
  60. package/dist/assets/index-C0iXCvyY.css +1 -0
  61. package/dist/assets/index-C1SHFMCp.js +581 -0
  62. package/dist/assets/{index-Csd6QrCV.js → index-C6DWtSls.js} +1 -1
  63. package/dist/assets/{index-BYVZlBF8.js → index-C71cdkH-.js} +1 -1
  64. package/dist/assets/{index-z4krxQ4j.js → index-CT_FTqvK.js} +1 -1
  65. package/dist/assets/{index-Db36XTG_.js → index-CU5rRr66.js} +1 -1
  66. package/dist/assets/{index-CtPksxf0.js → index-Cb6duXQm.js} +1 -1
  67. package/dist/assets/{index-DAZ-9ri2.js → index-D23e9zQj.js} +1 -1
  68. package/dist/assets/index-DUGecC2Z.js +68 -0
  69. package/dist/assets/{index-M_pBKDSe.js → index-DcGIOAQi.js} +1 -1
  70. package/dist/assets/{index-DONRrmA2.js → index-PJfa9qXY.js} +1 -1
  71. package/dist/assets/{index-sbO9UaUU.js → index-SPslPC2B.js} +1 -1
  72. package/dist/assets/{index-DdIhdEVw.js → index-VPQlo4Uz.js} +1 -1
  73. package/dist/assets/{index-_luCZMLM.js → index-qbTLKWyG.js} +1 -1
  74. package/dist/assets/infoDiagram-STP46IZ2-DBu8p9gd.js +2 -0
  75. package/dist/assets/{isEmpty-CqX_YTIf.js → isEmpty-CnOLuQIv.js} +1 -1
  76. package/dist/assets/{journeyDiagram-BIP6EPQ6-Y5w_Tqe_.js → journeyDiagram-BIP6EPQ6-6U_vHJBH.js} +1 -1
  77. package/dist/assets/{kanban-definition-6OIFK2YF-DbXs5Rxi.js → kanban-definition-6OIFK2YF-DgnR14ys.js} +1 -1
  78. package/dist/assets/{layout-BCNPDACj.js → layout-RHmq4fP9.js} +1 -1
  79. package/dist/assets/{linear-uO6UVhXt.js → linear-CLdOVPGV.js} +1 -1
  80. package/dist/assets/links-Dd1icsEk.js +7 -0
  81. package/dist/assets/{logs-panel-BEQ1eRUp.js → logs-panel-CjbuhBLx.js} +1 -1
  82. package/dist/assets/{markdown-renderer-Dmzbb00W.js → markdown-renderer-X5YJvAZq.js} +3 -3
  83. package/dist/assets/{mermaid-qRc4MXIj.js → mermaid-Bl2T5oEC.js} +1 -1
  84. package/dist/assets/{mermaid.core-CvvJtCRj.js → mermaid.core-CfukBvGI.js} +4 -4
  85. package/dist/assets/min-BXIes1Za.js +1 -0
  86. package/dist/assets/{mindmap-definition-Q6HEUPPD-G5NognM-.js → mindmap-definition-Q6HEUPPD-BXCjP4Lu.js} +1 -1
  87. package/dist/assets/{number-overlay-editor-DPr5sHFu.js → number-overlay-editor-BUyqkSes.js} +1 -1
  88. package/dist/assets/{outline-panel-gxQXvVi4.js → outline-panel-BvGcPKdd.js} +1 -1
  89. package/dist/assets/{packages-panel-B1T0VPlg.js → packages-panel-BichDQWG.js} +1 -1
  90. package/dist/assets/{pieDiagram-ADFJNKIX-DK9SHkfc.js → pieDiagram-ADFJNKIX-CMzJFIJM.js} +1 -1
  91. package/dist/assets/{quadrantDiagram-LMRXKWRM-D1DdWF8C.js → quadrantDiagram-LMRXKWRM-CfGssUlO.js} +1 -1
  92. package/dist/assets/{react-plotly-CTwajqCb.js → react-plotly-DR3hV0HW.js} +1 -1
  93. package/dist/assets/{requirementDiagram-4UW4RH46-DnjDAypr.js → requirementDiagram-4UW4RH46-CfrFolth.js} +1 -1
  94. package/dist/assets/{run-page-CQY9im22.js → run-page-Bqd_4ePD.js} +1 -1
  95. package/dist/assets/{sankeyDiagram-GR3RE2ED-B67Va-ER.js → sankeyDiagram-GR3RE2ED-D_UttKU0.js} +1 -1
  96. package/dist/assets/scratchpad-panel-D5N15ji1.js +1 -0
  97. package/dist/assets/secrets-panel-BpbnAO4R.js +1 -0
  98. package/dist/assets/{sequenceDiagram-C3RYC4MD-DiWgZPtN.js → sequenceDiagram-C3RYC4MD-MdfQQApP.js} +1 -1
  99. package/dist/assets/{slides-component-DhpPRtQp.js → slides-component-C0z7rXmk.js} +1 -1
  100. package/dist/assets/{snippets-panel-CLkBXhJ2.js → snippets-panel-wlpZ_Wzx.js} +1 -1
  101. package/dist/assets/{sortBy-D4OG7w4O.js → sortBy-BW_zNHP6.js} +1 -1
  102. package/dist/assets/{state-Dz_3JyED.js → state-CDooX-dk.js} +1 -1
  103. package/dist/assets/{stateDiagram-KXAO66HF-ByF2AULw.js → stateDiagram-KXAO66HF-H7kfw3ot.js} +1 -1
  104. package/dist/assets/stateDiagram-v2-UMBNRL4Z-YMeb9qMR.js +1 -0
  105. package/dist/assets/{storage-Dr0CC44z.js → storage-b1QCapTq.js} +6 -6
  106. package/dist/assets/{terminal-BtdissBf.js → terminal-CPV44BXz.js} +1 -1
  107. package/dist/assets/{time-DKdOTnQg.js → time-DDy3xv5Y.js} +1 -1
  108. package/dist/assets/{timeline-definition-XQNQX7LJ-DzER9bf6.js → timeline-definition-XQNQX7LJ-J-cPRT2_.js} +1 -1
  109. package/dist/assets/{tracing-Dpx5M-u3.js → tracing-3eHHRUiJ.js} +2 -2
  110. package/dist/assets/{tracing-panel-hCjBkSER.js → tracing-panel-BMgy3D7d.js} +2 -2
  111. package/dist/assets/{trash-C6Ko-g5q.js → trash--tonOuDe.js} +1 -1
  112. package/dist/assets/{tree-BHN2gcCF.js → tree-ouIGEsVg.js} +6 -6
  113. package/dist/assets/{treemap-75Q7IDZK-DR79Mhzt.js → treemap-75Q7IDZK-CzJTJ_3R.js} +20 -20
  114. package/dist/assets/{variable-panel-PFBCFz36.js → variable-panel-sFTn4Oih.js} +1 -1
  115. package/dist/assets/{vega-component-Db6-uY4C.js → vega-component-BkPkzX9r.js} +1 -1
  116. package/dist/assets/{xychartDiagram-6GGTOJPD-DWzBP3tZ.js → xychartDiagram-6GGTOJPD-BZ8WOb_8.js} +1 -1
  117. package/dist/index.html +10 -3
  118. package/package.json +6 -6
  119. package/src/__mocks__/common.ts +5 -3
  120. package/src/__mocks__/notebook.ts +2 -2
  121. package/src/__tests__/main.test.tsx +2 -2
  122. package/src/components/ai/ai-provider-icon.tsx +2 -0
  123. package/src/components/app-config/ai-config.tsx +32 -1
  124. package/src/components/app-config/common.tsx +2 -2
  125. package/src/components/app-config/user-config-form.tsx +26 -0
  126. package/src/components/audio/audio-recorder.tsx +0 -1
  127. package/src/components/chat/acp/blocks.tsx +2 -2
  128. package/src/components/chat/acp/thread.tsx +3 -5
  129. package/src/components/chat/acp/utils.ts +5 -5
  130. package/src/components/chat/chat-panel.tsx +1 -1
  131. package/src/components/data-table/__tests__/data-table.test.tsx +2 -2
  132. package/src/components/data-table/charts/__tests__/altair-generator.test.ts +1 -1
  133. package/src/components/data-table/charts/chart-spec/tooltips.ts +3 -3
  134. package/src/components/data-table/charts/components/chart-items.tsx +1 -1
  135. package/src/components/data-table/charts/components/form-fields.tsx +2 -2
  136. package/src/components/data-table/charts/constants.ts +1 -1
  137. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  138. package/src/components/data-table/column-summary/chart-spec-model.tsx +2 -2
  139. package/src/components/data-table/columns.tsx +1 -1
  140. package/src/components/data-table/data-table.tsx +35 -3
  141. package/src/components/data-table/date-popover.tsx +1 -1
  142. package/src/components/data-table/download-actions.tsx +1 -1
  143. package/src/components/data-table/range-focus/__tests__/utils.test.ts +5 -5
  144. package/src/components/data-table/renderers.tsx +6 -5
  145. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +1 -1
  146. package/src/components/data-table/types.ts +4 -3
  147. package/src/components/datasources/column-preview.tsx +9 -6
  148. package/src/components/debugger/debugger-code.tsx +1 -1
  149. package/src/components/dependency-graph/custom-node.tsx +15 -6
  150. package/src/components/dependency-graph/dependency-graph-minimap.tsx +2 -2
  151. package/src/components/dependency-graph/dependency-graph-tree.tsx +2 -2
  152. package/src/components/dependency-graph/dependency-graph.tsx +1 -1
  153. package/src/components/dependency-graph/elements.ts +7 -7
  154. package/src/components/dependency-graph/utils/changes.ts +4 -4
  155. package/src/components/editor/Cell.tsx +6 -2
  156. package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
  157. package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +1 -1
  158. package/src/components/editor/chrome/panels/packages-panel.tsx +1 -1
  159. package/src/components/editor/columns/storage.ts +1 -1
  160. package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +36 -0
  161. package/src/components/editor/database/__tests__/as-code.test.ts +30 -7
  162. package/src/components/editor/database/add-database-form.tsx +11 -0
  163. package/src/components/editor/database/as-code.ts +104 -5
  164. package/src/components/editor/database/schemas.ts +36 -18
  165. package/src/components/editor/errors/auto-fix.tsx +12 -2
  166. package/src/components/editor/errors/sql-validation-errors.tsx +12 -6
  167. package/src/components/editor/navigation/clipboard.ts +2 -2
  168. package/src/components/editor/output/ConsoleOutput.tsx +1 -1
  169. package/src/components/editor/output/JsonOutput.tsx +1 -1
  170. package/src/components/editor/output/MarimoErrorOutput.tsx +25 -25
  171. package/src/components/editor/output/MarimoTracebackOutput.tsx +17 -2
  172. package/src/components/editor/renderers/grid-layout/types.ts +2 -2
  173. package/src/components/editor/renderers/plugins.ts +1 -1
  174. package/src/components/editor/renderers/types.ts +1 -1
  175. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +7 -7
  176. package/src/components/forms/form.tsx +5 -5
  177. package/src/components/ui/links.tsx +1 -0
  178. package/src/core/ai/__tests__/model-registry.test.ts +0 -10
  179. package/src/core/ai/context/providers/error.ts +2 -2
  180. package/src/core/ai/ids/ids.ts +1 -0
  181. package/src/core/ai/model-registry.ts +2 -1
  182. package/src/core/cells/cells.ts +5 -5
  183. package/src/core/cells/logs.ts +1 -1
  184. package/src/core/cells/types.ts +1 -1
  185. package/src/core/codemirror/__tests__/format.test.ts +6 -0
  186. package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
  187. package/src/core/codemirror/editing/commands.ts +2 -2
  188. package/src/core/codemirror/find-replace/navigate.ts +1 -1
  189. package/src/core/codemirror/language/__tests__/extension.test.ts +1 -1
  190. package/src/core/codemirror/language/__tests__/sql-validation.test.ts +1 -1
  191. package/src/core/codemirror/language/__tests__/sql.test.ts +764 -79
  192. package/src/core/codemirror/language/languages/markdown.ts +4 -1
  193. package/src/core/codemirror/language/languages/sql/{validation-errors.ts → banner-validation-errors.ts} +9 -3
  194. package/src/core/codemirror/language/languages/sql/completion-builder.ts +160 -0
  195. package/src/core/codemirror/language/languages/sql/completion-sources.tsx +9 -3
  196. package/src/core/codemirror/language/languages/sql/completion-store.ts +46 -50
  197. package/src/core/codemirror/language/languages/sql/renderers.tsx +485 -0
  198. package/src/core/codemirror/language/languages/sql/sql.ts +151 -24
  199. package/src/core/codemirror/language/languages/sql/utils.ts +4 -1
  200. package/src/core/codemirror/language/panel/sql.tsx +6 -1
  201. package/src/core/codemirror/language/utils/ast.ts +3 -3
  202. package/src/core/codemirror/lsp/federated-lsp.ts +4 -4
  203. package/src/core/codemirror/lsp/lens.ts +4 -4
  204. package/src/core/codemirror/lsp/notebook-lsp.ts +1 -1
  205. package/src/core/codemirror/lsp/types.ts +1 -1
  206. package/src/core/codemirror/markdown/completions.ts +1 -1
  207. package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
  208. package/src/core/codemirror/rtc/loro/awareness.ts +1 -1
  209. package/src/core/config/config-schema.ts +1 -0
  210. package/src/core/config/feature-flag.tsx +3 -1
  211. package/src/core/datasets/request-registry.ts +17 -10
  212. package/src/core/dom/events.ts +1 -1
  213. package/src/core/dom/outline.ts +2 -2
  214. package/src/core/dom/uiregistry.ts +2 -8
  215. package/src/core/errors/__tests__/errors.test.ts +22 -4
  216. package/src/core/errors/errors.ts +29 -1
  217. package/src/core/errors/state.ts +1 -1
  218. package/src/core/islands/main.ts +2 -2
  219. package/src/core/islands/parse.ts +1 -3
  220. package/src/core/kernel/messages.ts +1 -1
  221. package/src/core/network/CachingRequestRegistry.ts +74 -0
  222. package/src/core/network/DeferredRequestRegistry.ts +3 -1
  223. package/src/core/network/__tests__/CachingRequestRegistry.test.ts +73 -0
  224. package/src/core/network/types.ts +1 -1
  225. package/src/core/variables/state.ts +2 -2
  226. package/src/core/wasm/__tests__/state.test.ts +1 -1
  227. package/src/core/websocket/useMarimoWebSocket.tsx +5 -2
  228. package/src/custom.d.ts +1 -1
  229. package/src/hooks/useCellRenderCount.ts +1 -0
  230. package/src/hooks/useResizeHandle.ts +4 -1
  231. package/src/plugins/core/RenderHTML.tsx +1 -2
  232. package/src/plugins/impl/DataTablePlugin.tsx +7 -2
  233. package/src/plugins/impl/FileUploadPlugin.tsx +1 -1
  234. package/src/plugins/impl/RefreshPlugin.tsx +1 -1
  235. package/src/plugins/impl/SliderPlugin.tsx +4 -0
  236. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +27 -9
  237. package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +58 -2
  238. package/src/plugins/impl/anywidget/__tests__/model.test.ts +3 -4
  239. package/src/plugins/impl/anywidget/model.ts +2 -3
  240. package/src/plugins/impl/data-editor/types.ts +1 -1
  241. package/src/plugins/impl/data-explorer/components/query-form.tsx +1 -1
  242. package/src/plugins/impl/data-frames/types.ts +1 -1
  243. package/src/plugins/impl/panel/PanelPlugin.tsx +2 -2
  244. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
  245. package/src/plugins/impl/vega/__tests__/loader.test.ts +2 -2
  246. package/src/plugins/impl/vega/loader.ts +1 -1
  247. package/src/plugins/impl/vega/vega-component.tsx +1 -1
  248. package/src/plugins/impl/vega/vega-loader.ts +2 -2
  249. package/src/plugins/layout/NavigationMenuPlugin.tsx +1 -1
  250. package/src/plugins/layout/RoutesPlugin.tsx +1 -2
  251. package/src/plugins/plugins.ts +2 -2
  252. package/src/utils/Logger.ts +1 -1
  253. package/src/utils/__tests__/data-views.test.ts +30 -68
  254. package/src/utils/__tests__/dom.test.ts +10 -10
  255. package/src/utils/__tests__/id-tree.test.ts +49 -1
  256. package/src/utils/__tests__/storage.test.ts +1 -1
  257. package/src/utils/__tests__/traceback.test.ts +13 -2
  258. package/src/utils/arrays.ts +1 -1
  259. package/src/utils/createReducer.ts +1 -5
  260. package/src/utils/data-views.ts +6 -19
  261. package/src/utils/edit-distance.ts +1 -1
  262. package/src/utils/fileToBase64.ts +1 -1
  263. package/src/utils/id-tree.tsx +20 -18
  264. package/src/utils/json/base64.ts +13 -0
  265. package/src/utils/json/json-parser.ts +2 -2
  266. package/src/utils/lru.ts +4 -0
  267. package/src/utils/mergeRefs.ts +1 -1
  268. package/src/utils/objects.ts +3 -3
  269. package/src/utils/pluralize.ts +1 -1
  270. package/src/utils/routes.ts +2 -2
  271. package/src/utils/sets.ts +1 -1
  272. package/src/utils/traceback.ts +45 -15
  273. package/src/utils/tracer.ts +11 -9
  274. package/dist/assets/_baseEach--KDTwKbG.js +0 -1
  275. package/dist/assets/_baseMap-Cu3o-eyO.js +0 -1
  276. package/dist/assets/_baseUniq-y7ZXnMo1.js +0 -1
  277. package/dist/assets/channel-DFaEx1fu.js +0 -1
  278. package/dist/assets/chat-panel-IoPMv8e2.js +0 -3
  279. package/dist/assets/classDiagram-KNZD7YFC-BsZtvV5O.js +0 -1
  280. package/dist/assets/classDiagram-v2-RKCZMP56-BsZtvV5O.js +0 -1
  281. package/dist/assets/clone-YBEvPE-s.js +0 -1
  282. package/dist/assets/command-palette-D7hOfvf6.js +0 -1
  283. package/dist/assets/edit-page-C5TsEeSo.js +0 -129
  284. package/dist/assets/index-CGDMlQfO.css +0 -1
  285. package/dist/assets/index-CelXfcd8.js +0 -580
  286. package/dist/assets/index-Cxyk7pt-.js +0 -68
  287. package/dist/assets/infoDiagram-STP46IZ2-wTALjfPc.js +0 -2
  288. package/dist/assets/links-Drv7cJgN.js +0 -7
  289. package/dist/assets/min-DYUOb1RR.js +0 -1
  290. package/dist/assets/scratchpad-panel-DlDfcDtW.js +0 -1
  291. package/dist/assets/secrets-panel-BDGyuGZA.js +0 -1
  292. package/dist/assets/stateDiagram-v2-UMBNRL4Z-CtBJqosP.js +0 -1
  293. package/src/__tests__/lru.test.ts +0 -74
@@ -1,11 +1,11 @@
1
- import{r as m,d as st,j as w,gJ as rn,gK as nn}from"./index-CelXfcd8.js";import{e as on}from"./index-Db36XTG_.js";function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},me(t,e)}function at(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const ut=m.createContext(null);function R(){const t=m.useContext(ut);if(t===null)throw new Error("No Tree Api Provided");return t}const ct=m.createContext(null),lt=m.createContext(null),dt=m.createContext(0);function ft(){m.useContext(dt)}function se(t,e,r){return Math.max(Math.min(t,r),e)}function ht(t){return t&&t.isLeaf}function gt(t){return t&&t.isInternal&&!t.isOpen}function pt(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const vt=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},yt=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function be(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const i=be(r,e);if(i)return i}return null}function ae(t,e){if(e(t),t.children)for(let r of t.children)ae(r,e)}function mt(t){const e=Ot(t);let r;for(let i=0;i<e.length;++i)if(e[i]===t){r=sn(e,i);break}r==null||r.focus()}function bt(t){const e=Ot(t);let r;for(let i=0;i<e.length;++i)if(e[i]===t){r=an(e,i);break}r==null||r.focus()}function sn(t,e){return e+1<t.length?t[e+1]:t[0]}function an(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Ot(t){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(e=>e===t||!t.contains(e))}function J(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function It(t){return t===null?null:B(t)}function B(t){return typeof t=="string"?t:t.id}function St(t,...e){if(t)return t(...e)}function wt(t){return new Promise((e,r)=>{let i=0;(function n(){i+=1,i===100&&r(),t()?e():setTimeout(n,10)})()})}function Dt(t){var e,r;const i=t.focusedNode;return i?i.isOpen?0:i.parent?i.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Tt(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const un=Object.freeze(Object.defineProperty({__proto__:null,access:J,bound:se,dfs:be,focusNextElement:mt,focusPrevElement:bt,getInsertIndex:Dt,getInsertParentId:Tt,identify:B,identifyNull:It,indexOf:yt,isClosed:gt,isDescendant:vt,isItem:ht,isOpenWithEmptyChildren:pt,mergeRefs:function(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}},noop:function(){},safeRun:St,waitFor:wt,walk:ae},Symbol.toStringTag,{value:"Module"})),cn={display:"flex",alignItems:"center",zIndex:1},ln={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},dn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},fn=st.memo(function({top:t,left:e,indent:r}){const i={position:"absolute",pointerEvents:"none",top:t-2+"px",left:e+"px",right:r+"px"};return w.jsxs("div",{style:Object.assign(Object.assign({},cn),i),children:[w.jsx("div",{style:Object.assign({},dn)}),w.jsx("div",{style:Object.assign({},ln)})]})});function hn({node:t,attrs:e,innerRef:r,children:i}){return w.jsx("div",Object.assign({},e,{ref:r,onFocus:n=>n.stopPropagation(),onClick:t.handleClick,children:i}))}function gn(t){return w.jsxs("div",{ref:t.dragHandle,style:t.style,children:[w.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"\u{1F333}":t.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",t.node.isEditing?w.jsx(vn,Object.assign({},t)):w.jsx(pn,Object.assign({},t))]})}function pn(t){return w.jsx(w.Fragment,{children:w.jsx("span",{children:t.node.data.name})})}function vn({node:t}){const e=m.useRef();return m.useEffect(()=>{var r,i;(r=e.current)===null||r===void 0||r.focus(),(i=e.current)===null||i===void 0||i.select()},[]),w.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var i;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((i=e.current)===null||i===void 0?void 0:i.value)||"")}})}function Oe(t){return{type:"EDIT",id:t}}function K(t){return{type:"FOCUS",id:t}}class ve{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.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}get isRoot(){return this.id===Q}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 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(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.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(){var e,r;const i=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[i+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.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 ve(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Q="__REACT_ARBORIST_INTERNAL_ROOT__";function Et(t){var e;function r(o,s,a){const u=t.accessId(o),c=new ve({tree:t,data:o,level:s,parent:a,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),l=t.accessChildren(o);return l&&(c.children=l.map(f=>r(f,s+1,c))),c}const i=new ve({tree:t,id:Q,data:{id:Q},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),n=(e=t.props.data)!==null&&e!==void 0?e:[];return i.children=n.map(o=>r(o,0,i)),i}const Ie={open:(t,e)=>({type:"VISIBILITY_OPEN",id:t,filtered:e}),close:(t,e)=>({type:"VISIBILITY_CLOSE",id:t,filtered:e}),toggle:(t,e)=>({type:"VISIBILITY_TOGGLE",id:t,filtered:e}),clear:t=>({type:"VISIBILITY_CLEAR",filtered:t})};function Ct(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}return e.type==="VISIBILITY_CLEAR"?{}:t}const V=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},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}}},yn=t=>({type:"SELECTION_ONLY",id:B(t)}),xt=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(B)}),Nt=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(B)}),mn=t=>Object.assign({type:"SELECTION_SET"},t),Se=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:B(t)}),jt=t=>({type:"SELECTION_ANCHOR",id:t===null?null:B(t)}),Y={cursor:t=>({type:"DND_CURSOR",cursor:t}),dragStart:(t,e)=>({type:"DND_DRAG_START",id:t,dragIds:e}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(t,e)=>({type:"DND_HOVERING",parentId:t,index:e})},bn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},On=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},In=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Pt({offset:t,mouse:e,id:r,dragIds:i,isDragging:n}){return w.jsxs(Sn,{isDragging:n,children:[w.jsx(wn,{offset:t,children:w.jsx(Tn,{id:r,dragIds:i})}),w.jsx(Dn,{mouse:e,count:i.length})]})}const Sn=m.memo(function(t){return t.isDragging?w.jsx("div",{style:bn,children:t.children}):null});function wn(t){return w.jsx("div",{className:"row preview",style:On(t.offset),children:t.children})}function Dn(t){const{count:e,mouse:r}=t;return e>1?w.jsx("div",{className:"selected-count",style:In(r),children:e}):null}const Tn=m.memo(function(t){const e=R(),r=e.get(t.id);return r?w.jsx(e.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var kt=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function En(t,e){return t===e||!(!kt(t)||!kt(e))}function Cn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!En(t[r],e[r]))return!1;return!0}function we(t,e){var r;e===void 0&&(e=Cn);var i,n=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}}var Rt=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function At(t){cancelAnimationFrame(t.id)}var De=-1;function Mt(t){if(t===void 0&&(t=!1),De===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),De=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return De}var Z=null;function _t(t){if(t===void 0&&(t=!1),Z===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),n=i.style;return n.width="100px",n.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?Z="positive-descending":(e.scrollLeft=1,Z=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),Z}return Z}var xn=function(t,e){return t};function Nn(t){var e,r=t.getItemOffset,i=t.getEstimatedTotalSize,n=t.getItemSize,o=t.getOffsetForIndexAndAlignment,s=t.getStartIndexForOffset,a=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,l=t.validateProps;return(e=(function(f){var y,h;function p(d){var g;return(g=f.call(this,d)||this)._instanceProps=u(g.props,at(g)),g._outerRef=void 0,g._resetIsScrollingTimeoutId=null,g.state={instance:at(g),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof g.props.initialScrollOffset=="number"?g.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},g._callOnItemsRendered=void 0,g._callOnItemsRendered=we(function(I,b,O,S){return g.props.onItemsRendered({overscanStartIndex:I,overscanStopIndex:b,visibleStartIndex:O,visibleStopIndex:S})}),g._callOnScroll=void 0,g._callOnScroll=we(function(I,b,O){return g.props.onScroll({scrollDirection:I,scrollOffset:b,scrollUpdateWasRequested:O})}),g._getItemStyle=void 0,g._getItemStyle=function(I){var b,O=g.props,S=O.direction,E=O.itemSize,C=O.layout,x=g._getItemStyleCache(c&&E,c&&C,c&&S);if(x.hasOwnProperty(I))b=x[I];else{var N=r(g.props,I,g._instanceProps),H=n(g.props,I,g._instanceProps),G=S==="horizontal"||C==="horizontal",ie=S==="rtl",oe=G?N:0;x[I]=b={position:"absolute",left:ie?void 0:oe,right:ie?oe:void 0,top:G?0:N,height:G?"100%":H,width:G?H:"100%"}}return b},g._getItemStyleCache=void 0,g._getItemStyleCache=we(function(I,b,O){return{}}),g._onScrollHorizontal=function(I){var b=I.currentTarget,O=b.clientWidth,S=b.scrollLeft,E=b.scrollWidth;g.setState(function(C){if(C.scrollOffset===S)return null;var x=g.props.direction,N=S;if(x==="rtl")switch(_t()){case"negative":N=-S;break;case"positive-descending":N=E-O-S}return N=Math.max(0,Math.min(N,E-O)),{isScrolling:!0,scrollDirection:C.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._onScrollVertical=function(I){var b=I.currentTarget,O=b.clientHeight,S=b.scrollHeight,E=b.scrollTop;g.setState(function(C){if(C.scrollOffset===E)return null;var x=Math.max(0,Math.min(E,S-O));return{isScrolling:!0,scrollDirection:C.scrollOffset<x?"forward":"backward",scrollOffset:x,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._outerRefSetter=function(I){var b=g.props.outerRef;g._outerRef=I,typeof b=="function"?b(I):b!=null&&typeof b=="object"&&b.hasOwnProperty("current")&&(b.current=I)},g._resetIsScrollingDebounced=function(){var I,b,O,S;g._resetIsScrollingTimeoutId!==null&&At(g._resetIsScrollingTimeoutId),g._resetIsScrollingTimeoutId=(I=g._resetIsScrolling,b=150,O=Rt(),S={id:requestAnimationFrame(function E(){Rt()-O>=b?I.call(null):S.id=requestAnimationFrame(E)})})},g._resetIsScrolling=function(){g._resetIsScrollingTimeoutId=null,g.setState({isScrolling:!1},function(){g._getItemStyleCache(-1,null)})},g}h=f,(y=p).prototype=Object.create(h.prototype),y.prototype.constructor=y,me(y,h),p.getDerivedStateFromProps=function(d,g){return jn(d,g),l(d),null};var v=p.prototype;return v.scrollTo=function(d){d=Math.max(0,d),this.setState(function(g){return g.scrollOffset===d?null:{scrollDirection:g.scrollOffset<d?"forward":"backward",scrollOffset:d,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(d,g){g===void 0&&(g="auto");var I=this.props,b=I.itemCount,O=I.layout,S=this.state.scrollOffset;d=Math.max(0,Math.min(d,b-1));var E=0;if(this._outerRef){var C=this._outerRef;E=O==="vertical"?C.scrollWidth>C.clientWidth?Mt():0:C.scrollHeight>C.clientHeight?Mt():0}this.scrollTo(o(this.props,d,g,S,this._instanceProps,E))},v.componentDidMount=function(){var d=this.props,g=d.direction,I=d.initialScrollOffset,b=d.layout;if(typeof I=="number"&&this._outerRef!=null){var O=this._outerRef;g==="horizontal"||b==="horizontal"?O.scrollLeft=I:O.scrollTop=I}this._callPropsCallbacks()},v.componentDidUpdate=function(){var d=this.props,g=d.direction,I=d.layout,b=this.state,O=b.scrollOffset;if(b.scrollUpdateWasRequested&&this._outerRef!=null){var S=this._outerRef;if(g==="horizontal"||I==="horizontal")if(g==="rtl")switch(_t()){case"negative":S.scrollLeft=-O;break;case"positive-ascending":S.scrollLeft=O;break;default:var E=S.clientWidth,C=S.scrollWidth;S.scrollLeft=C-E-O}else S.scrollLeft=O;else S.scrollTop=O}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&At(this._resetIsScrollingTimeoutId)},v.render=function(){var d=this.props,g=d.children,I=d.className,b=d.direction,O=d.height,S=d.innerRef,E=d.innerElementType,C=d.innerTagName,x=d.itemCount,N=d.itemData,H=d.itemKey,G=H===void 0?xn:H,ie=d.layout,oe=d.outerElementType,$r=d.outerTagName,Xr=d.style,Jr=d.useIsScrolling,Qr=d.width,rt=this.state.isScrolling,ye=b==="horizontal"||ie==="horizontal",Zr=ye?this._onScrollHorizontal:this._onScrollVertical,nt=this._getRangeToRender(),en=nt[0],tn=nt[1],it=[];if(x>0)for(var X=en;X<=tn;X++)it.push(m.createElement(g,{data:N,key:G(X,N),index:X,isScrolling:Jr?rt:void 0,style:this._getItemStyle(X)}));var ot=i(this.props,this._instanceProps);return m.createElement(oe||$r||"div",{className:I,onScroll:Zr,ref:this._outerRefSetter,style:rn({position:"relative",height:O,width:Qr,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},Xr)},m.createElement(E||C||"div",{children:it,ref:S,style:{height:ye?"100%":ot,pointerEvents:rt?"none":void 0,width:ye?ot:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var d=this._getRangeToRender(),g=d[0],I=d[1],b=d[2],O=d[3];this._callOnItemsRendered(g,I,b,O)}if(typeof this.props.onScroll=="function"){var S=this.state,E=S.scrollDirection,C=S.scrollOffset,x=S.scrollUpdateWasRequested;this._callOnScroll(E,C,x)}},v._getRangeToRender=function(){var d=this.props,g=d.itemCount,I=d.overscanCount,b=this.state,O=b.isScrolling,S=b.scrollDirection,E=b.scrollOffset;if(g===0)return[0,0,0,0];var C=s(this.props,E,this._instanceProps),x=a(this.props,C,E,this._instanceProps),N=O&&S!=="backward"?1:Math.max(1,I),H=O&&S!=="forward"?1:Math.max(1,I);return[Math.max(0,C-N),Math.max(0,Math.min(g-1,x+H)),C,x]},p})(m.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var jn=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},Pn=Nn({getItemOffset:function(t,e){return e*t.itemSize},getItemSize:function(t,e){return t.itemSize},getEstimatedTotalSize:function(t){var e=t.itemCount;return t.itemSize*e},getOffsetForIndexAndAlignment:function(t,e,r,i,n,o){var s=t.direction,a=t.height,u=t.itemCount,c=t.itemSize,l=t.layout,f=t.width,y=s==="horizontal"||l==="horizontal"?f:a,h=Math.max(0,u*c-y),p=Math.min(h,e*c),v=Math.max(0,e*c-y+c+o);switch(r==="smart"&&(r=i>=v-y&&i<=p+y?"auto":"center"),r){case"start":return p;case"end":return v;case"center":var d=Math.round(v+(p-v)/2);return d<Math.ceil(y/2)?0:d>h+Math.floor(y/2)?h:d;default:return i>=v&&i<=p?i:i<v?v:p}},getStartIndexForOffset:function(t,e){var r=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(e/i)))},getStopIndexForStartIndex:function(t,e,r){var i=t.direction,n=t.height,o=t.itemCount,s=t.itemSize,a=t.layout,u=t.width,c=e*s,l=i==="horizontal"||a==="horizontal"?u:n,f=Math.ceil((l+r-c)/s);return Math.max(0,Math.min(o-1,e+f-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function kn(){var t,e;const r=R(),i=(function(){const u=m.useContext(lt);if(u===null)throw new Error("Provide a DnDContext");return u})().cursor;if(!i||i.type!=="line")return null;const n=r.indent,o=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=n*i.level,a=r.renderCursor;return w.jsx(a,{top:o,left:s,indent:n})}var Rn=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};const An=m.forwardRef(function(t,e){const{children:r}=t,i=Rn(t,["children"]),n=R();return w.jsxs("div",Object.assign({ref:e},i,{onClick:o=>{o.currentTarget===o.target&&n.deselectAll()},children:[w.jsx(Mn,{}),r]}))}),Mn=()=>{const t=R();return w.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:w.jsx(kn,{})})};var _n=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};const Ln=m.forwardRef(function(t,e){var r,i,n,o,{style:s}=t,a=_n(t,["style"]);const u=R(),c=(i=(r=u.props.padding)!==null&&r!==void 0?r:u.props.paddingTop)!==null&&i!==void 0?i:0,l=(o=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingBottom)!==null&&o!==void 0?o:0;return w.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+c+l}px`})},a))});var A,Lt=m.createContext({dragDropManager:void 0});function D(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;(o=new Error(e.replace(/%s/g,function(){return i[s++]}))).name="Invariant Violation"}throw o.framesToPop=1,o}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(A||(A={}));var Te="dnd-core/INIT_COORDS",Ee="dnd-core/BEGIN_DRAG",Ht="dnd-core/PUBLISH_DRAG_SOURCE",ue="dnd-core/HOVER",Ce="dnd-core/DROP",xe="dnd-core/END_DRAG";function Ft(t,e){return{type:Te,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Ne(t){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(t)}function Ut(t){return Ne(t)==="object"}var Hn={type:Te,payload:{clientOffset:null,sourceClientOffset:null}};function Fn(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=r.publishSource,n=i===void 0||i,o=r.clientOffset,s=r.getSourceClientOffset,a=t.getMonitor(),u=t.getRegistry();t.dispatch(Ft(o)),(function(h,p,v){D(!p.isDragging(),"Cannot call beginDrag while dragging."),h.forEach(function(d){D(v.getSource(d),"Expected sourceIds to be registered.")})})(e,a,u);var c=(function(h,p){for(var v=null,d=h.length-1;d>=0;d--)if(p.canDragSource(h[d])){v=h[d];break}return v})(e,a);if(c!==null){var l=null;if(o){if(!s)throw new Error("getSourceClientOffset must be defined");(function(h){D(typeof h=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(s),l=s(c)}t.dispatch(Ft(o,l));var f=u.getSource(c).beginDrag(a,c);if(f!=null){(function(h){D(Ut(h),"Item must be an object.")})(f),u.pinSource(c);var y=u.getSourceType(c);return{type:Ee,payload:{itemType:y,item:f,sourceId:c,clientOffset:o||null,sourceClientOffset:l||null,isSourcePublic:!!n}}}}else t.dispatch(Hn)}}function Un(t){return function(){if(t.getMonitor().isDragging())return{type:Ht}}}function je(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function Bn(t){return function(e){var r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(s){D(Array.isArray(s),"Expected targetIds to be an array.")})(e);var i=e.slice(0),n=t.getMonitor(),o=t.getRegistry();return(function(s,a,u){D(a.isDragging(),"Cannot call hover while not dragging."),D(!a.didDrop(),"Cannot call hover after drop.");for(var c=0;c<s.length;c++){var l=s[c];D(s.lastIndexOf(l)===c,"Expected targetIds to be unique in the passed array."),D(u.getTarget(l),"Expected targetIds to be registered.")}})(i,n,o),(function(s,a,u){for(var c=s.length-1;c>=0;c--){var l=s[c];je(a.getTargetType(l),u)||s.splice(c,1)}})(i,o,n.getItemType()),(function(s,a,u){s.forEach(function(c){u.getTarget(c).hover(a,c)})})(i,n,o),{type:ue,payload:{targetIds:i,clientOffset:r||null}}}}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function zt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Bt(Object(r),!0).forEach(function(i){zn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function zn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wn(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.getMonitor(),i=t.getRegistry();(function(o){D(o.isDragging(),"Cannot call drop while not dragging."),D(!o.didDrop(),"Cannot call drop twice during one drag operation.")})(r);var n=(function(o){var s=o.getTargetIds().filter(o.canDropOnTarget,o);return s.reverse(),s})(r);n.forEach(function(o,s){var a=(function(c,l,f,y){var h=f.getTarget(c),p=h?h.drop(y,c):void 0;return(function(v){D(v===void 0||Ut(v),"Drop result must either be an object or undefined.")})(p),p===void 0&&(p=l===0?{}:y.getDropResult()),p})(o,s,i,r),u={type:Ce,payload:{dropResult:zt(zt({},e),a)}};t.dispatch(u)})}}function Gn(t){return function(){var e=t.getMonitor(),r=t.getRegistry();(function(n){D(n.isDragging(),"Cannot call endDrag while not dragging.")})(e);var i=e.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(e,i),r.unpinSource()),{type:xe}}}function Kn(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function ee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vn=(function(){function t(e,r){var i=this;(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),ee(this,"store",void 0),ee(this,"monitor",void 0),ee(this,"backend",void 0),ee(this,"isSetUp",!1),ee(this,"handleRefCountChange",function(){var n=i.store.getState().refCount>0;i.backend&&(n&&!i.isSetUp?(i.backend.setup(),i.isSetUp=!0):!n&&i.isSetUp&&(i.backend.teardown(),i.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return Kn(t,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,r=this.store.dispatch,i=(function(n){return{beginDrag:Fn(n),publishDragSource:Un(n),hover:Bn(n),drop:Wn(n),endDrag:Gn(n)}})(this);return Object.keys(i).reduce(function(n,o){var s,a=i[o];return n[o]=(s=a,function(){for(var u=arguments.length,c=new Array(u),l=0;l<u;l++)c[l]=arguments[l];var f=s.apply(e,c);f!==void 0&&r(f)}),n},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t})();function M(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Wt=typeof Symbol=="function"&&Symbol.observable||"@@observable",Gt=function(){return Math.random().toString(36).substring(7).split("").join(".")},Kt={INIT:"@@redux/INIT"+Gt(),REPLACE:"@@redux/REPLACE"+Gt()};function Vt(t,e,r){var i;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),r!==void 0){if(typeof r!="function")throw new Error(M(1));return r(Vt)(t,e)}if(typeof t!="function")throw new Error(M(2));var n=t,o=e,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error(M(3));return o}function f(h){if(typeof h!="function")throw new Error(M(4));if(u)throw new Error(M(5));var p=!0;return c(),a.push(h),function(){if(p){if(u)throw new Error(M(6));p=!1,c();var v=a.indexOf(h);a.splice(v,1),s=null}}}function y(h){if(!(function(d){if(typeof d!="object"||d===null)return!1;for(var g=d;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(d)===g})(h))throw new Error(M(7));if(h.type===void 0)throw new Error(M(8));if(u)throw new Error(M(9));try{u=!0,o=n(o,h)}finally{u=!1}for(var p=s=a,v=0;v<p.length;v++)(0,p[v])();return h}return y({type:Kt.INIT}),(i={dispatch:y,subscribe:f,getState:l,replaceReducer:function(h){if(typeof h!="function")throw new Error(M(10));n=h,y({type:Kt.REPLACE})}})[Wt]=function(){var h,p=f;return(h={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(M(11));function d(){v.next&&v.next(l())}return d(),{unsubscribe:p(d)}}})[Wt]=function(){return this},h},i}var Yn=function(t,e){return t===e};function Yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yt(Object(r),!0).forEach(function(i){qn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function qn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $t={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $n(){var t,e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t,i=arguments.length>1?arguments[1]:void 0,n=i.payload;switch(i.type){case Te:case Ee:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case ue:return t=r.clientOffset,e=n.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?r:qt(qt({},r),{},{clientOffset:n.clientOffset});case xe:case Ce:return $t;default:return r}}var Pe="dnd-core/ADD_SOURCE",ke="dnd-core/ADD_TARGET",Re="dnd-core/REMOVE_SOURCE",ce="dnd-core/REMOVE_TARGET";function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(i){Xn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Xn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Jn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Qn(){var t,e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jn,i=arguments.length>1?arguments[1]:void 0,n=i.payload;switch(i.type){case Ee:return _(_({},r),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ht:return _(_({},r),{},{isSourcePublic:!0});case ue:return _(_({},r),{},{targetIds:n.targetIds});case ce:return r.targetIds.indexOf(n.targetId)===-1?r:_(_({},r),{},{targetIds:(t=r.targetIds,e=n.targetId,t.filter(function(o){return o!==e}))});case Ce:return _(_({},r),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case xe:return _(_({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function Zn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Pe:case ke:return t+1;case Re:case ce:return t-1;default:return t}}var le=[],Ae=[];function ei(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ue:break;case Pe:case ke:case ce:case Re:return le;default:return Ae}var e=t.payload,r=e.targetIds,i=r===void 0?[]:r,n=e.prevTargetIds,o=n===void 0?[]:n,s=(function(l,f){var y=new Map,h=function(v){y.set(v,y.has(v)?y.get(v)+1:1)};l.forEach(h),f.forEach(h);var p=[];return y.forEach(function(v,d){v===1&&p.push(d)}),p})(i,o),a=s.length>0||!(function(l,f){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yn;if(l.length!==f.length)return!1;for(var h=0;h<l.length;++h)if(!y(l[h],f[h]))return!1;return!0})(i,o);if(!a)return le;var u=o[o.length-1],c=i[i.length-1];return u!==c&&(u&&s.push(u),c&&s.push(c)),s}function ti(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jt(Object(r),!0).forEach(function(i){ri(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function ri(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ni(){var t,e,r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:ei(i.dirtyHandlerIds,{type:n.type,payload:Qt(Qt({},n.payload),{},{prevTargetIds:(t=i,e="dragOperation.targetIds",r=[],e.split(".").reduce(function(o,s){return o&&o[s]?o[s]:r||null},t))})}),dragOffset:$n(i.dragOffset,n),refCount:Zn(i.refCount,n),dragOperation:Qn(i.dragOperation,n),stateId:ti(i.stateId)}}function Zt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ii(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function er(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}le.__IS_NONE__=!0,Ae.__IS_ALL__=!0;var oi=(function(){function t(e,r){(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),er(this,"store",void 0),er(this,"registry",void 0),this.store=e,this.registry=r}return ii(t,[{key:"subscribeToStateChange",value:function(e){var r=this,i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;D(typeof e=="function","listener must be a function."),D(i===void 0||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe(function(){var o=r.store.getState(),s=o.stateId;try{var a=s===n||s===n+1&&!(function(u,c){return u!==le&&(u===Ae||c===void 0||(l=u,c.filter(function(f){return l.indexOf(f)>-1})).length>0);var l})(o.dirtyHandlerIds,i);a||e()}finally{n=s}})}},{key:"subscribeToOffsetChange",value:function(e){var r=this;D(typeof e=="function","listener must be a function.");var i=this.store.getState().dragOffset;return this.store.subscribe(function(){var n=r.store.getState().dragOffset;n!==i&&(i=n,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var r=this.registry.getSource(e);return D(r,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&r.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var r=this.registry.getTarget(e);return D(r,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&je(this.registry.getTargetType(e),this.getItemType())&&r.canDrop(this,e)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var r=this.registry.getSource(e,!0);return D(r,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&r.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),n=this.getItemType();if(n&&!je(i,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var s=o.indexOf(e);return r?s===o.length-1:s>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,o=e.initialClientOffset,s=e.initialSourceClientOffset,n&&o&&s?Zt((i=s,{x:(r=n).x+i.x,y:r.y+i.y}),o):null;var e,r,i,n,o,s}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,r=e.clientOffset,i=e.initialClientOffset,r&&i?Zt(r,i):null;var e,r,i}}]),t})(),si=0;function Me(t){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}function _e(t,e){e&&Array.isArray(t)?t.forEach(function(r){return _e(r,!1)}):D(typeof t=="string"||Me(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const tr=typeof global<"u"?global:self,rr=tr.MutationObserver||tr.WebKitMutationObserver;function nr(t){return function(){const e=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(e),clearInterval(r),t()}}}const ai=typeof rr=="function"?function(t){let e=1;const r=new rr(t),i=document.createTextNode("");return r.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}:nr;class ui{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}const ir=new class{enqueueTask(t){const{queue:e,requestFlush:r}=this;e.length||(r(),this.flushing=!0),e[e.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const e=this.index;if(this.index++,t[e].call(),this.index>this.capacity){for(let r=0,i=t.length-this.index;r<i;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=ai(this.flush),this.requestErrorThrow=nr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},ci=new class{create(t){const e=this.freeTasks,r=e.length?e.pop():new ui(this.onError,i=>e[e.length]=i);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}(ir.registerPendingError);function li(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return or(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return or(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function or(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function fi(t){var e=(si++).toString();switch(t){case A.SOURCE:return"S".concat(e);case A.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function sr(t){switch(t[0]){case"S":return A.SOURCE;case"T":return A.TARGET;default:D(!1,"Cannot parse handler ID: ".concat(t))}}function ar(t,e){var r=t.entries(),i=!1;do{var n=r.next(),o=n.done;if(di(n.value,2)[1]===e)return!0;i=!!o}while(!i);return!1}var hi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),q(this,"types",new Map),q(this,"dragSources",new Map),q(this,"dropTargets",new Map),q(this,"pinnedSourceId",null),q(this,"pinnedSource",null),q(this,"store",void 0),this.store=e}return li(t,[{key:"addSource",value:function(e,r){_e(e),(function(n){D(typeof n.canDrag=="function","Expected canDrag to be a function."),D(typeof n.beginDrag=="function","Expected beginDrag to be a function."),D(typeof n.endDrag=="function","Expected endDrag to be a function.")})(r);var i=this.addHandler(A.SOURCE,e,r);return this.store.dispatch((function(n){return{type:Pe,payload:{sourceId:n}}})(i)),i}},{key:"addTarget",value:function(e,r){_e(e,!0),(function(n){D(typeof n.canDrop=="function","Expected canDrop to be a function."),D(typeof n.hover=="function","Expected hover to be a function."),D(typeof n.drop=="function","Expected beginDrag to be a function.")})(r);var i=this.addHandler(A.TARGET,e,r);return this.store.dispatch((function(n){return{type:ke,payload:{targetId:n}}})(i)),i}},{key:"containsHandler",value:function(e){return ar(this.dragSources,e)||ar(this.dropTargets,e)}},{key:"getSource",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return D(this.isSourceId(e),"Expected a valid source ID."),r&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return D(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return sr(e)===A.SOURCE}},{key:"isTargetId",value:function(e){return sr(e)===A.TARGET}},{key:"removeSource",value:function(e){var r,i=this;D(this.getSource(e),"Expected an existing source."),this.store.dispatch((function(n){return{type:Re,payload:{sourceId:n}}})(e)),r=function(){i.dragSources.delete(e),i.types.delete(e)},ir.enqueueTask(ci.create(r))}},{key:"removeTarget",value:function(e){D(this.getTarget(e),"Expected an existing target."),this.store.dispatch((function(r){return{type:ce,payload:{targetId:r}}})(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var r=this.getSource(e);D(r,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=r}},{key:"unpinSource",value:function(){D(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,r,i){var n=fi(e);return this.types.set(n,r),e===A.SOURCE?this.dragSources.set(n,i):e===A.TARGET&&this.dropTargets.set(n,i),n}}]),t})();function gi(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=(function(a){var u=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Vt(ni,a&&u&&u({name:"dnd-core",instanceId:"dnd-core"}))})(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),n=new oi(i,new hi(i)),o=new Vn(i,n),s=t(o,e,r);return o.receiveBackend(s),o}var pi=["children"];function vi(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return ur(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ur(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as m,d as st,j as w,gM as rn,gN as nn}from"./index-C1SHFMCp.js";import{e as on}from"./index-CU5rRr66.js";function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},me(t,e)}function at(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const ut=m.createContext(null);function R(){const t=m.useContext(ut);if(t===null)throw new Error("No Tree Api Provided");return t}const ct=m.createContext(null),lt=m.createContext(null),dt=m.createContext(0);function ft(){m.useContext(dt)}function se(t,e,r){return Math.max(Math.min(t,r),e)}function ht(t){return t&&t.isLeaf}function gt(t){return t&&t.isInternal&&!t.isOpen}function pt(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const vt=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},yt=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function be(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const i=be(r,e);if(i)return i}return null}function ae(t,e){if(e(t),t.children)for(let r of t.children)ae(r,e)}function mt(t){const e=Ot(t);let r;for(let i=0;i<e.length;++i)if(e[i]===t){r=sn(e,i);break}r==null||r.focus()}function bt(t){const e=Ot(t);let r;for(let i=0;i<e.length;++i)if(e[i]===t){r=an(e,i);break}r==null||r.focus()}function sn(t,e){return e+1<t.length?t[e+1]:t[0]}function an(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Ot(t){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(e=>e===t||!t.contains(e))}function J(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function It(t){return t===null?null:B(t)}function B(t){return typeof t=="string"?t:t.id}function St(t,...e){if(t)return t(...e)}function wt(t){return new Promise((e,r)=>{let i=0;(function n(){i+=1,i===100&&r(),t()?e():setTimeout(n,10)})()})}function Dt(t){var e,r;const i=t.focusedNode;return i?i.isOpen?0:i.parent?i.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Tt(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const un=Object.freeze(Object.defineProperty({__proto__:null,access:J,bound:se,dfs:be,focusNextElement:mt,focusPrevElement:bt,getInsertIndex:Dt,getInsertParentId:Tt,identify:B,identifyNull:It,indexOf:yt,isClosed:gt,isDescendant:vt,isItem:ht,isOpenWithEmptyChildren:pt,mergeRefs:function(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}},noop:function(){},safeRun:St,waitFor:wt,walk:ae},Symbol.toStringTag,{value:"Module"})),cn={display:"flex",alignItems:"center",zIndex:1},ln={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},dn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},fn=st.memo(function({top:t,left:e,indent:r}){const i={position:"absolute",pointerEvents:"none",top:t-2+"px",left:e+"px",right:r+"px"};return w.jsxs("div",{style:Object.assign(Object.assign({},cn),i),children:[w.jsx("div",{style:Object.assign({},dn)}),w.jsx("div",{style:Object.assign({},ln)})]})});function hn({node:t,attrs:e,innerRef:r,children:i}){return w.jsx("div",Object.assign({},e,{ref:r,onFocus:n=>n.stopPropagation(),onClick:t.handleClick,children:i}))}function gn(t){return w.jsxs("div",{ref:t.dragHandle,style:t.style,children:[w.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"\u{1F333}":t.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",t.node.isEditing?w.jsx(vn,Object.assign({},t)):w.jsx(pn,Object.assign({},t))]})}function pn(t){return w.jsx(w.Fragment,{children:w.jsx("span",{children:t.node.data.name})})}function vn({node:t}){const e=m.useRef();return m.useEffect(()=>{var r,i;(r=e.current)===null||r===void 0||r.focus(),(i=e.current)===null||i===void 0||i.select()},[]),w.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var i;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((i=e.current)===null||i===void 0?void 0:i.value)||"")}})}function Oe(t){return{type:"EDIT",id:t}}function V(t){return{type:"FOCUS",id:t}}class ve{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.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}get isRoot(){return this.id===Q}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 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(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.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(){var e,r;const i=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[i+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.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 ve(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Q="__REACT_ARBORIST_INTERNAL_ROOT__";function Et(t){var e;function r(o,s,a){const u=t.accessId(o),c=new ve({tree:t,data:o,level:s,parent:a,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),l=t.accessChildren(o);return l&&(c.children=l.map(f=>r(f,s+1,c))),c}const i=new ve({tree:t,id:Q,data:{id:Q},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),n=(e=t.props.data)!==null&&e!==void 0?e:[];return i.children=n.map(o=>r(o,0,i)),i}const Ie={open:(t,e)=>({type:"VISIBILITY_OPEN",id:t,filtered:e}),close:(t,e)=>({type:"VISIBILITY_CLOSE",id:t,filtered:e}),toggle:(t,e)=>({type:"VISIBILITY_TOGGLE",id:t,filtered:e}),clear:t=>({type:"VISIBILITY_CLEAR",filtered:t})};function Ct(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}return e.type==="VISIBILITY_CLEAR"?{}:t}const K=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},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}}},yn=t=>({type:"SELECTION_ONLY",id:B(t)}),xt=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(B)}),Nt=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(B)}),mn=t=>Object.assign({type:"SELECTION_SET"},t),Se=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:B(t)}),jt=t=>({type:"SELECTION_ANCHOR",id:t===null?null:B(t)}),Y={cursor:t=>({type:"DND_CURSOR",cursor:t}),dragStart:(t,e)=>({type:"DND_DRAG_START",id:t,dragIds:e}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(t,e)=>({type:"DND_HOVERING",parentId:t,index:e})},bn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},On=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},In=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Pt({offset:t,mouse:e,id:r,dragIds:i,isDragging:n}){return w.jsxs(Sn,{isDragging:n,children:[w.jsx(wn,{offset:t,children:w.jsx(Tn,{id:r,dragIds:i})}),w.jsx(Dn,{mouse:e,count:i.length})]})}const Sn=m.memo(function(t){return t.isDragging?w.jsx("div",{style:bn,children:t.children}):null});function wn(t){return w.jsx("div",{className:"row preview",style:On(t.offset),children:t.children})}function Dn(t){const{count:e,mouse:r}=t;return e>1?w.jsx("div",{className:"selected-count",style:In(r),children:e}):null}const Tn=m.memo(function(t){const e=R(),r=e.get(t.id);return r?w.jsx(e.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var kt=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function En(t,e){return t===e||!(!kt(t)||!kt(e))}function Cn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!En(t[r],e[r]))return!1;return!0}function we(t,e){var r;e===void 0&&(e=Cn);var i,n=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}}var Rt=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function At(t){cancelAnimationFrame(t.id)}var De=-1;function Mt(t){if(t===void 0&&(t=!1),De===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),De=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return De}var Z=null;function _t(t){if(t===void 0&&(t=!1),Z===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),n=i.style;return n.width="100px",n.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?Z="positive-descending":(e.scrollLeft=1,Z=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),Z}return Z}var xn=function(t,e){return t};function Nn(t){var e,r=t.getItemOffset,i=t.getEstimatedTotalSize,n=t.getItemSize,o=t.getOffsetForIndexAndAlignment,s=t.getStartIndexForOffset,a=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,l=t.validateProps;return(e=(function(f){var y,h;function p(d){var g;return(g=f.call(this,d)||this)._instanceProps=u(g.props,at(g)),g._outerRef=void 0,g._resetIsScrollingTimeoutId=null,g.state={instance:at(g),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof g.props.initialScrollOffset=="number"?g.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},g._callOnItemsRendered=void 0,g._callOnItemsRendered=we(function(I,b,O,S){return g.props.onItemsRendered({overscanStartIndex:I,overscanStopIndex:b,visibleStartIndex:O,visibleStopIndex:S})}),g._callOnScroll=void 0,g._callOnScroll=we(function(I,b,O){return g.props.onScroll({scrollDirection:I,scrollOffset:b,scrollUpdateWasRequested:O})}),g._getItemStyle=void 0,g._getItemStyle=function(I){var b,O=g.props,S=O.direction,E=O.itemSize,C=O.layout,x=g._getItemStyleCache(c&&E,c&&C,c&&S);if(x.hasOwnProperty(I))b=x[I];else{var N=r(g.props,I,g._instanceProps),H=n(g.props,I,g._instanceProps),G=S==="horizontal"||C==="horizontal",ie=S==="rtl",oe=G?N:0;x[I]=b={position:"absolute",left:ie?void 0:oe,right:ie?oe:void 0,top:G?0:N,height:G?"100%":H,width:G?H:"100%"}}return b},g._getItemStyleCache=void 0,g._getItemStyleCache=we(function(I,b,O){return{}}),g._onScrollHorizontal=function(I){var b=I.currentTarget,O=b.clientWidth,S=b.scrollLeft,E=b.scrollWidth;g.setState(function(C){if(C.scrollOffset===S)return null;var x=g.props.direction,N=S;if(x==="rtl")switch(_t()){case"negative":N=-S;break;case"positive-descending":N=E-O-S}return N=Math.max(0,Math.min(N,E-O)),{isScrolling:!0,scrollDirection:C.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._onScrollVertical=function(I){var b=I.currentTarget,O=b.clientHeight,S=b.scrollHeight,E=b.scrollTop;g.setState(function(C){if(C.scrollOffset===E)return null;var x=Math.max(0,Math.min(E,S-O));return{isScrolling:!0,scrollDirection:C.scrollOffset<x?"forward":"backward",scrollOffset:x,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._outerRefSetter=function(I){var b=g.props.outerRef;g._outerRef=I,typeof b=="function"?b(I):b!=null&&typeof b=="object"&&b.hasOwnProperty("current")&&(b.current=I)},g._resetIsScrollingDebounced=function(){var I,b,O,S;g._resetIsScrollingTimeoutId!==null&&At(g._resetIsScrollingTimeoutId),g._resetIsScrollingTimeoutId=(I=g._resetIsScrolling,b=150,O=Rt(),S={id:requestAnimationFrame(function E(){Rt()-O>=b?I.call(null):S.id=requestAnimationFrame(E)})})},g._resetIsScrolling=function(){g._resetIsScrollingTimeoutId=null,g.setState({isScrolling:!1},function(){g._getItemStyleCache(-1,null)})},g}h=f,(y=p).prototype=Object.create(h.prototype),y.prototype.constructor=y,me(y,h),p.getDerivedStateFromProps=function(d,g){return jn(d,g),l(d),null};var v=p.prototype;return v.scrollTo=function(d){d=Math.max(0,d),this.setState(function(g){return g.scrollOffset===d?null:{scrollDirection:g.scrollOffset<d?"forward":"backward",scrollOffset:d,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(d,g){g===void 0&&(g="auto");var I=this.props,b=I.itemCount,O=I.layout,S=this.state.scrollOffset;d=Math.max(0,Math.min(d,b-1));var E=0;if(this._outerRef){var C=this._outerRef;E=O==="vertical"?C.scrollWidth>C.clientWidth?Mt():0:C.scrollHeight>C.clientHeight?Mt():0}this.scrollTo(o(this.props,d,g,S,this._instanceProps,E))},v.componentDidMount=function(){var d=this.props,g=d.direction,I=d.initialScrollOffset,b=d.layout;if(typeof I=="number"&&this._outerRef!=null){var O=this._outerRef;g==="horizontal"||b==="horizontal"?O.scrollLeft=I:O.scrollTop=I}this._callPropsCallbacks()},v.componentDidUpdate=function(){var d=this.props,g=d.direction,I=d.layout,b=this.state,O=b.scrollOffset;if(b.scrollUpdateWasRequested&&this._outerRef!=null){var S=this._outerRef;if(g==="horizontal"||I==="horizontal")if(g==="rtl")switch(_t()){case"negative":S.scrollLeft=-O;break;case"positive-ascending":S.scrollLeft=O;break;default:var E=S.clientWidth,C=S.scrollWidth;S.scrollLeft=C-E-O}else S.scrollLeft=O;else S.scrollTop=O}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&At(this._resetIsScrollingTimeoutId)},v.render=function(){var d=this.props,g=d.children,I=d.className,b=d.direction,O=d.height,S=d.innerRef,E=d.innerElementType,C=d.innerTagName,x=d.itemCount,N=d.itemData,H=d.itemKey,G=H===void 0?xn:H,ie=d.layout,oe=d.outerElementType,$r=d.outerTagName,Xr=d.style,Jr=d.useIsScrolling,Qr=d.width,rt=this.state.isScrolling,ye=b==="horizontal"||ie==="horizontal",Zr=ye?this._onScrollHorizontal:this._onScrollVertical,nt=this._getRangeToRender(),en=nt[0],tn=nt[1],it=[];if(x>0)for(var X=en;X<=tn;X++)it.push(m.createElement(g,{data:N,key:G(X,N),index:X,isScrolling:Jr?rt:void 0,style:this._getItemStyle(X)}));var ot=i(this.props,this._instanceProps);return m.createElement(oe||$r||"div",{className:I,onScroll:Zr,ref:this._outerRefSetter,style:rn({position:"relative",height:O,width:Qr,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:b},Xr)},m.createElement(E||C||"div",{children:it,ref:S,style:{height:ye?"100%":ot,pointerEvents:rt?"none":void 0,width:ye?ot:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var d=this._getRangeToRender(),g=d[0],I=d[1],b=d[2],O=d[3];this._callOnItemsRendered(g,I,b,O)}if(typeof this.props.onScroll=="function"){var S=this.state,E=S.scrollDirection,C=S.scrollOffset,x=S.scrollUpdateWasRequested;this._callOnScroll(E,C,x)}},v._getRangeToRender=function(){var d=this.props,g=d.itemCount,I=d.overscanCount,b=this.state,O=b.isScrolling,S=b.scrollDirection,E=b.scrollOffset;if(g===0)return[0,0,0,0];var C=s(this.props,E,this._instanceProps),x=a(this.props,C,E,this._instanceProps),N=O&&S!=="backward"?1:Math.max(1,I),H=O&&S!=="forward"?1:Math.max(1,I);return[Math.max(0,C-N),Math.max(0,Math.min(g-1,x+H)),C,x]},p})(m.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var jn=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},Pn=Nn({getItemOffset:function(t,e){return e*t.itemSize},getItemSize:function(t,e){return t.itemSize},getEstimatedTotalSize:function(t){var e=t.itemCount;return t.itemSize*e},getOffsetForIndexAndAlignment:function(t,e,r,i,n,o){var s=t.direction,a=t.height,u=t.itemCount,c=t.itemSize,l=t.layout,f=t.width,y=s==="horizontal"||l==="horizontal"?f:a,h=Math.max(0,u*c-y),p=Math.min(h,e*c),v=Math.max(0,e*c-y+c+o);switch(r==="smart"&&(r=i>=v-y&&i<=p+y?"auto":"center"),r){case"start":return p;case"end":return v;case"center":var d=Math.round(v+(p-v)/2);return d<Math.ceil(y/2)?0:d>h+Math.floor(y/2)?h:d;default:return i>=v&&i<=p?i:i<v?v:p}},getStartIndexForOffset:function(t,e){var r=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(e/i)))},getStopIndexForStartIndex:function(t,e,r){var i=t.direction,n=t.height,o=t.itemCount,s=t.itemSize,a=t.layout,u=t.width,c=e*s,l=i==="horizontal"||a==="horizontal"?u:n,f=Math.ceil((l+r-c)/s);return Math.max(0,Math.min(o-1,e+f-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function kn(){var t,e;const r=R(),i=(function(){const u=m.useContext(lt);if(u===null)throw new Error("Provide a DnDContext");return u})().cursor;if(!i||i.type!=="line")return null;const n=r.indent,o=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=n*i.level,a=r.renderCursor;return w.jsx(a,{top:o,left:s,indent:n})}var Rn=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};const An=m.forwardRef(function(t,e){const{children:r}=t,i=Rn(t,["children"]),n=R();return w.jsxs("div",Object.assign({ref:e},i,{onClick:o=>{o.currentTarget===o.target&&n.deselectAll()},children:[w.jsx(Mn,{}),r]}))}),Mn=()=>{const t=R();return w.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:w.jsx(kn,{})})};var _n=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};const Ln=m.forwardRef(function(t,e){var r,i,n,o,{style:s}=t,a=_n(t,["style"]);const u=R(),c=(i=(r=u.props.padding)!==null&&r!==void 0?r:u.props.paddingTop)!==null&&i!==void 0?i:0,l=(o=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingBottom)!==null&&o!==void 0?o:0;return w.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+c+l}px`})},a))});var A,Lt=m.createContext({dragDropManager:void 0});function D(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;(o=new Error(e.replace(/%s/g,function(){return i[s++]}))).name="Invariant Violation"}throw o.framesToPop=1,o}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(A||(A={}));var Te="dnd-core/INIT_COORDS",Ee="dnd-core/BEGIN_DRAG",Ht="dnd-core/PUBLISH_DRAG_SOURCE",ue="dnd-core/HOVER",Ce="dnd-core/DROP",xe="dnd-core/END_DRAG";function Ft(t,e){return{type:Te,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Ne(t){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(t)}function Ut(t){return Ne(t)==="object"}var Hn={type:Te,payload:{clientOffset:null,sourceClientOffset:null}};function Fn(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=r.publishSource,n=i===void 0||i,o=r.clientOffset,s=r.getSourceClientOffset,a=t.getMonitor(),u=t.getRegistry();t.dispatch(Ft(o)),(function(h,p,v){D(!p.isDragging(),"Cannot call beginDrag while dragging."),h.forEach(function(d){D(v.getSource(d),"Expected sourceIds to be registered.")})})(e,a,u);var c=(function(h,p){for(var v=null,d=h.length-1;d>=0;d--)if(p.canDragSource(h[d])){v=h[d];break}return v})(e,a);if(c!==null){var l=null;if(o){if(!s)throw new Error("getSourceClientOffset must be defined");(function(h){D(typeof h=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(s),l=s(c)}t.dispatch(Ft(o,l));var f=u.getSource(c).beginDrag(a,c);if(f!=null){(function(h){D(Ut(h),"Item must be an object.")})(f),u.pinSource(c);var y=u.getSourceType(c);return{type:Ee,payload:{itemType:y,item:f,sourceId:c,clientOffset:o||null,sourceClientOffset:l||null,isSourcePublic:!!n}}}}else t.dispatch(Hn)}}function Un(t){return function(){if(t.getMonitor().isDragging())return{type:Ht}}}function je(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function Bn(t){return function(e){var r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(s){D(Array.isArray(s),"Expected targetIds to be an array.")})(e);var i=e.slice(0),n=t.getMonitor(),o=t.getRegistry();return(function(s,a,u){D(a.isDragging(),"Cannot call hover while not dragging."),D(!a.didDrop(),"Cannot call hover after drop.");for(var c=0;c<s.length;c++){var l=s[c];D(s.lastIndexOf(l)===c,"Expected targetIds to be unique in the passed array."),D(u.getTarget(l),"Expected targetIds to be registered.")}})(i,n,o),(function(s,a,u){for(var c=s.length-1;c>=0;c--){var l=s[c];je(a.getTargetType(l),u)||s.splice(c,1)}})(i,o,n.getItemType()),(function(s,a,u){s.forEach(function(c){u.getTarget(c).hover(a,c)})})(i,n,o),{type:ue,payload:{targetIds:i,clientOffset:r||null}}}}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function zt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Bt(Object(r),!0).forEach(function(i){zn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function zn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wn(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.getMonitor(),i=t.getRegistry();(function(o){D(o.isDragging(),"Cannot call drop while not dragging."),D(!o.didDrop(),"Cannot call drop twice during one drag operation.")})(r);var n=(function(o){var s=o.getTargetIds().filter(o.canDropOnTarget,o);return s.reverse(),s})(r);n.forEach(function(o,s){var a=(function(c,l,f,y){var h=f.getTarget(c),p=h?h.drop(y,c):void 0;return(function(v){D(v===void 0||Ut(v),"Drop result must either be an object or undefined.")})(p),p===void 0&&(p=l===0?{}:y.getDropResult()),p})(o,s,i,r),u={type:Ce,payload:{dropResult:zt(zt({},e),a)}};t.dispatch(u)})}}function Gn(t){return function(){var e=t.getMonitor(),r=t.getRegistry();(function(n){D(n.isDragging(),"Cannot call endDrag while not dragging.")})(e);var i=e.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(e,i),r.unpinSource()),{type:xe}}}function Vn(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function ee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kn=(function(){function t(e,r){var i=this;(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),ee(this,"store",void 0),ee(this,"monitor",void 0),ee(this,"backend",void 0),ee(this,"isSetUp",!1),ee(this,"handleRefCountChange",function(){var n=i.store.getState().refCount>0;i.backend&&(n&&!i.isSetUp?(i.backend.setup(),i.isSetUp=!0):!n&&i.isSetUp&&(i.backend.teardown(),i.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return Vn(t,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,r=this.store.dispatch,i=(function(n){return{beginDrag:Fn(n),publishDragSource:Un(n),hover:Bn(n),drop:Wn(n),endDrag:Gn(n)}})(this);return Object.keys(i).reduce(function(n,o){var s,a=i[o];return n[o]=(s=a,function(){for(var u=arguments.length,c=new Array(u),l=0;l<u;l++)c[l]=arguments[l];var f=s.apply(e,c);f!==void 0&&r(f)}),n},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t})();function M(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Wt=typeof Symbol=="function"&&Symbol.observable||"@@observable",Gt=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vt={INIT:"@@redux/INIT"+Gt(),REPLACE:"@@redux/REPLACE"+Gt()};function Kt(t,e,r){var i;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),r!==void 0){if(typeof r!="function")throw new Error(M(1));return r(Kt)(t,e)}if(typeof t!="function")throw new Error(M(2));var n=t,o=e,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function l(){if(u)throw new Error(M(3));return o}function f(h){if(typeof h!="function")throw new Error(M(4));if(u)throw new Error(M(5));var p=!0;return c(),a.push(h),function(){if(p){if(u)throw new Error(M(6));p=!1,c();var v=a.indexOf(h);a.splice(v,1),s=null}}}function y(h){if(!(function(d){if(typeof d!="object"||d===null)return!1;for(var g=d;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(d)===g})(h))throw new Error(M(7));if(h.type===void 0)throw new Error(M(8));if(u)throw new Error(M(9));try{u=!0,o=n(o,h)}finally{u=!1}for(var p=s=a,v=0;v<p.length;v++)(0,p[v])();return h}return y({type:Vt.INIT}),(i={dispatch:y,subscribe:f,getState:l,replaceReducer:function(h){if(typeof h!="function")throw new Error(M(10));n=h,y({type:Vt.REPLACE})}})[Wt]=function(){var h,p=f;return(h={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(M(11));function d(){v.next&&v.next(l())}return d(),{unsubscribe:p(d)}}})[Wt]=function(){return this},h},i}var Yn=function(t,e){return t===e};function Yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yt(Object(r),!0).forEach(function(i){qn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function qn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $t={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function $n(){var t,e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$t,i=arguments.length>1?arguments[1]:void 0,n=i.payload;switch(i.type){case Te:case Ee:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case ue:return t=r.clientOffset,e=n.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?r:qt(qt({},r),{},{clientOffset:n.clientOffset});case xe:case Ce:return $t;default:return r}}var Pe="dnd-core/ADD_SOURCE",ke="dnd-core/ADD_TARGET",Re="dnd-core/REMOVE_SOURCE",ce="dnd-core/REMOVE_TARGET";function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(i){Xn(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Xn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Jn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Qn(){var t,e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jn,i=arguments.length>1?arguments[1]:void 0,n=i.payload;switch(i.type){case Ee:return _(_({},r),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ht:return _(_({},r),{},{isSourcePublic:!0});case ue:return _(_({},r),{},{targetIds:n.targetIds});case ce:return r.targetIds.indexOf(n.targetId)===-1?r:_(_({},r),{},{targetIds:(t=r.targetIds,e=n.targetId,t.filter(function(o){return o!==e}))});case Ce:return _(_({},r),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case xe:return _(_({},r),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}}function Zn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Pe:case ke:return t+1;case Re:case ce:return t-1;default:return t}}var le=[],Ae=[];function ei(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ue:break;case Pe:case ke:case ce:case Re:return le;default:return Ae}var e=t.payload,r=e.targetIds,i=r===void 0?[]:r,n=e.prevTargetIds,o=n===void 0?[]:n,s=(function(l,f){var y=new Map,h=function(v){y.set(v,y.has(v)?y.get(v)+1:1)};l.forEach(h),f.forEach(h);var p=[];return y.forEach(function(v,d){v===1&&p.push(d)}),p})(i,o),a=s.length>0||!(function(l,f){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yn;if(l.length!==f.length)return!1;for(var h=0;h<l.length;++h)if(!y(l[h],f[h]))return!1;return!0})(i,o);if(!a)return le;var u=o[o.length-1],c=i[i.length-1];return u!==c&&(u&&s.push(u),c&&s.push(c)),s}function ti(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jt(Object(r),!0).forEach(function(i){ri(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function ri(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ni(){var t,e,r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:ei(i.dirtyHandlerIds,{type:n.type,payload:Qt(Qt({},n.payload),{},{prevTargetIds:(t=i,e="dragOperation.targetIds",r=[],e.split(".").reduce(function(o,s){return o&&o[s]?o[s]:r||null},t))})}),dragOffset:$n(i.dragOffset,n),refCount:Zn(i.refCount,n),dragOperation:Qn(i.dragOperation,n),stateId:ti(i.stateId)}}function Zt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ii(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function er(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}le.__IS_NONE__=!0,Ae.__IS_ALL__=!0;var oi=(function(){function t(e,r){(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),er(this,"store",void 0),er(this,"registry",void 0),this.store=e,this.registry=r}return ii(t,[{key:"subscribeToStateChange",value:function(e){var r=this,i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;D(typeof e=="function","listener must be a function."),D(i===void 0||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var n=this.store.getState().stateId;return this.store.subscribe(function(){var o=r.store.getState(),s=o.stateId;try{var a=s===n||s===n+1&&!(function(u,c){return u!==le&&(u===Ae||c===void 0||(l=u,c.filter(function(f){return l.indexOf(f)>-1})).length>0);var l})(o.dirtyHandlerIds,i);a||e()}finally{n=s}})}},{key:"subscribeToOffsetChange",value:function(e){var r=this;D(typeof e=="function","listener must be a function.");var i=this.store.getState().dragOffset;return this.store.subscribe(function(){var n=r.store.getState().dragOffset;n!==i&&(i=n,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var r=this.registry.getSource(e);return D(r,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&r.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var r=this.registry.getTarget(e);return D(r,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&je(this.registry.getTargetType(e),this.getItemType())&&r.canDrop(this,e)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var r=this.registry.getSource(e,!0);return D(r,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&r.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),n=this.getItemType();if(n&&!je(i,n))return!1;var o=this.getTargetIds();if(!o.length)return!1;var s=o.indexOf(e);return r?s===o.length-1:s>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,o=e.initialClientOffset,s=e.initialSourceClientOffset,n&&o&&s?Zt((i=s,{x:(r=n).x+i.x,y:r.y+i.y}),o):null;var e,r,i,n,o,s}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,r=e.clientOffset,i=e.initialClientOffset,r&&i?Zt(r,i):null;var e,r,i}}]),t})(),si=0;function Me(t){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}function _e(t,e){e&&Array.isArray(t)?t.forEach(function(r){return _e(r,!1)}):D(typeof t=="string"||Me(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const tr=typeof global<"u"?global:self,rr=tr.MutationObserver||tr.WebKitMutationObserver;function nr(t){return function(){const e=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(e),clearInterval(r),t()}}}const ai=typeof rr=="function"?function(t){let e=1;const r=new rr(t),i=document.createTextNode("");return r.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}:nr;class ui{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}const ir=new class{enqueueTask(t){const{queue:e,requestFlush:r}=this;e.length||(r(),this.flushing=!0),e[e.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const e=this.index;if(this.index++,t[e].call(),this.index>this.capacity){for(let r=0,i=t.length-this.index;r<i;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=ai(this.flush),this.requestErrorThrow=nr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},ci=new class{create(t){const e=this.freeTasks,r=e.length?e.pop():new ui(this.onError,i=>e[e.length]=i);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}(ir.registerPendingError);function li(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function di(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return or(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return or(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function or(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function fi(t){var e=(si++).toString();switch(t){case A.SOURCE:return"S".concat(e);case A.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function sr(t){switch(t[0]){case"S":return A.SOURCE;case"T":return A.TARGET;default:D(!1,"Cannot parse handler ID: ".concat(t))}}function ar(t,e){var r=t.entries(),i=!1;do{var n=r.next(),o=n.done;if(di(n.value,2)[1]===e)return!0;i=!!o}while(!i);return!1}var hi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),q(this,"types",new Map),q(this,"dragSources",new Map),q(this,"dropTargets",new Map),q(this,"pinnedSourceId",null),q(this,"pinnedSource",null),q(this,"store",void 0),this.store=e}return li(t,[{key:"addSource",value:function(e,r){_e(e),(function(n){D(typeof n.canDrag=="function","Expected canDrag to be a function."),D(typeof n.beginDrag=="function","Expected beginDrag to be a function."),D(typeof n.endDrag=="function","Expected endDrag to be a function.")})(r);var i=this.addHandler(A.SOURCE,e,r);return this.store.dispatch((function(n){return{type:Pe,payload:{sourceId:n}}})(i)),i}},{key:"addTarget",value:function(e,r){_e(e,!0),(function(n){D(typeof n.canDrop=="function","Expected canDrop to be a function."),D(typeof n.hover=="function","Expected hover to be a function."),D(typeof n.drop=="function","Expected beginDrag to be a function.")})(r);var i=this.addHandler(A.TARGET,e,r);return this.store.dispatch((function(n){return{type:ke,payload:{targetId:n}}})(i)),i}},{key:"containsHandler",value:function(e){return ar(this.dragSources,e)||ar(this.dropTargets,e)}},{key:"getSource",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return D(this.isSourceId(e),"Expected a valid source ID."),r&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return D(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return D(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return sr(e)===A.SOURCE}},{key:"isTargetId",value:function(e){return sr(e)===A.TARGET}},{key:"removeSource",value:function(e){var r,i=this;D(this.getSource(e),"Expected an existing source."),this.store.dispatch((function(n){return{type:Re,payload:{sourceId:n}}})(e)),r=function(){i.dragSources.delete(e),i.types.delete(e)},ir.enqueueTask(ci.create(r))}},{key:"removeTarget",value:function(e){D(this.getTarget(e),"Expected an existing target."),this.store.dispatch((function(r){return{type:ce,payload:{targetId:r}}})(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var r=this.getSource(e);D(r,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=r}},{key:"unpinSource",value:function(){D(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,r,i){var n=fi(e);return this.types.set(n,r),e===A.SOURCE?this.dragSources.set(n,i):e===A.TARGET&&this.dropTargets.set(n,i),n}}]),t})();function gi(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=(function(a){var u=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Kt(ni,a&&u&&u({name:"dnd-core",instanceId:"dnd-core"}))})(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),n=new oi(i,new hi(i)),o=new Kn(i,n),s=t(o,e,r);return o.receiveBackend(s),o}var pi=["children"];function vi(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return ur(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ur(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ur(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function yi(t,e){if(t==null)return{};var r,i,n=(function(s,a){if(s==null)return{};var u,c,l={},f=Object.keys(s);for(c=0;c<f.length;c++)u=f[c],a.indexOf(u)>=0||(l[u]=s[u]);return l})(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var cr=0,de=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),mi=m.memo(function(t){var e=t.children,r=(function(s){if("manager"in s)return[{dragDropManager:s.manager},!1];var a=(function(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lr(),f=arguments.length>2?arguments[2]:void 0,y=arguments.length>3?arguments[3]:void 0,h=l;return h[de]||(h[de]={dragDropManager:gi(c,l,f,y)}),h[de]})(s.backend,s.context,s.options,s.debugMode),u=!s.context;return[a,u]})(yi(t,pi)),i=vi(r,2),n=i[0],o=i[1];return m.useEffect(function(){if(o){var s=lr();return++cr,function(){--cr===0&&(s[de]=null)}}},[]),w.jsx(Lt.Provider,Object.assign({value:n},{children:e}),void 0)});function lr(){return typeof global<"u"?global:window}function bi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function dr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Le=!1,He=!1,Oi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),dr(this,"internalMonitor",void 0),dr(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return bi(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){D(!Le,"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 Le=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Le=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;D(!He,"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 He=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{He=!1}}},{key:"subscribeToStateChange",value:function(e,r){return this.internalMonitor.subscribeToStateChange(e,r)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,r){return this.internalMonitor.isOverTarget(e,r)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Ii(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function fr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Fe=!1,Si=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),fr(this,"internalMonitor",void 0),fr(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Ii(t,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,r){return this.internalMonitor.subscribeToStateChange(e,r)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;D(!Fe,"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 Fe=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Fe=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function wi(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!m.isValidElement(e)){var i=e;return t(i,r),i}var n=e;(function(s){if(typeof s.type!="string"){var a=s.type.displayName||s.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(a," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}})(n);var o=r?function(s){return t(s,r)}:t;return(function(s,a){var u=s.ref;return D(typeof u!="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"),u?m.cloneElement(s,{ref:function(c){gr(u,c),gr(a,c)}}):m.cloneElement(s,{ref:a})})(n,o)}}function hr(t){var e={};return Object.keys(t).forEach(function(r){var i=t[r];if(r.endsWith("Ref"))e[r]=t[r];else{var n=wi(i);e[r]=function(){return n}}}),e}function gr(t,e){typeof t=="function"?t(e):t.current=e}function Ue(t){return Ue=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(t)}function Be(t){return t!==null&&Ue(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ze(t,e,r,i){var n=void 0;if(n!==void 0)return!!n;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!a(c))return!1;var l=t[c],f=e[c];if((n=void 0)===!1||n===void 0&&l!==f)return!1}return!0}function Di(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ti=(function(){function t(e){var r=this;(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),P(this,"hooks",hr({dragSource:function(i,n){r.clearDragSource(),r.dragSourceOptions=n||null,Be(i)?r.dragSourceRef=i:r.dragSourceNode=i,r.reconnectDragSource()},dragPreview:function(i,n){r.clearDragPreview(),r.dragPreviewOptions=n||null,Be(i)?r.dragPreviewRef=i:r.dragPreviewNode=i,r.reconnectDragPreview()}})),P(this,"handlerId",null),P(this,"dragSourceRef",null),P(this,"dragSourceNode",void 0),P(this,"dragSourceOptionsInternal",null),P(this,"dragSourceUnsubscribe",void 0),P(this,"dragPreviewRef",null),P(this,"dragPreviewNode",void 0),P(this,"dragPreviewOptionsInternal",null),P(this,"dragPreviewUnsubscribe",void 0),P(this,"lastConnectedHandlerId",null),P(this,"lastConnectedDragSource",null),P(this,"lastConnectedDragSourceOptions",null),P(this,"lastConnectedDragPreview",null),P(this,"lastConnectedDragPreviewOptions",null),P(this,"backend",void 0),this.backend=e}return Di(t,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();r&&this.disconnectDragSource(),this.handlerId&&(e?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,r=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(e?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!ze(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ze(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t})();function Ei(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function F(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ci=(function(){function t(e){var r=this;(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),F(this,"hooks",hr({dropTarget:function(i,n){r.clearDropTarget(),r.dropTargetOptions=n,Be(i)?r.dropTargetRef=i:r.dropTargetNode=i,r.reconnect()}})),F(this,"handlerId",null),F(this,"dropTargetRef",null),F(this,"dropTargetNode",void 0),F(this,"dropTargetOptionsInternal",null),F(this,"unsubscribeDropTarget",void 0),F(this,"lastConnectedHandlerId",null),F(this,"lastConnectedDropTarget",null),F(this,"lastConnectedDropTargetOptions",null),F(this,"backend",void 0),this.backend=e}return Ei(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var r=this.dropTarget;this.handlerId&&(r?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions)):this.lastConnectedDropTarget=r)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!ze(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t})(),z=typeof window<"u"?m.useLayoutEffect:m.useEffect;function We(t){return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(t)}function xi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Ge(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ni=(function(){function t(e,r,i){(function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),Ge(this,"spec",void 0),Ge(this,"monitor",void 0),Ge(this,"connector",void 0),this.spec=e,this.monitor=r,this.connector=i}return xi(t,[{key:"beginDrag",value:function(){var e,r=this.spec,i=this.monitor;return(e=We(r.item)==="object"?r.item:typeof r.item=="function"?r.item(i):{})!==null&&e!==void 0?e:null}},{key:"canDrag",value:function(){var e=this.spec,r=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag!="function"||e.canDrag(r)}},{key:"isDragging",value:function(e,r){var i=this.spec,n=this.monitor,o=i.isDragging;return o?o(n):r===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,r=this.monitor,i=this.connector,n=e.end;n&&n(r.getItem(),r),i.reconnect()}}]),t})();function W(){var t=m.useContext(Lt).dragDropManager;return D(t!=null,"Expected drag drop context"),t}function ji(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return pr(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Pi(t,e,r){var i=W(),n=(function(s,a,u){var c=m.useMemo(function(){return new Ni(s,a,u)},[a,u]);return m.useEffect(function(){c.spec=s},[s]),c})(t,e,r),o=(function(s){return m.useMemo(function(){var a=s.type;return D(a!=null,"spec.type must be defined"),a},[s])})(t);z(function(){if(o!=null){var s=(function(l,f,y){var h=y.getRegistry(),p=h.addSource(l,f);return[p,function(){return h.removeSource(p)}]})(o,n,i),a=ji(s,2),u=a[0],c=a[1];return e.receiveHandlerId(u),r.receiveHandlerId(u),c}},[i,e,r,n,o])}function ki(t){return(function(e){if(Array.isArray(e))return Ke(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,r){if(e){if(typeof e=="string")return Ke(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ke(e,r)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ke(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function vr(t,e){var r=ki(e||[]);return e==null&&typeof t!="function"&&r.push(t),m.useMemo(function(){return typeof t=="function"?t():t},r)}function Ri(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return yr(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yr(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Pi(t,e,r){var i=W(),n=(function(s,a,u){var c=m.useMemo(function(){return new Ni(s,a,u)},[a,u]);return m.useEffect(function(){c.spec=s},[s]),c})(t,e,r),o=(function(s){return m.useMemo(function(){var a=s.type;return D(a!=null,"spec.type must be defined"),a},[s])})(t);z(function(){if(o!=null){var s=(function(l,f,y){var h=y.getRegistry(),p=h.addSource(l,f);return[p,function(){return h.removeSource(p)}]})(o,n,i),a=ji(s,2),u=a[0],c=a[1];return e.receiveHandlerId(u),r.receiveHandlerId(u),c}},[i,e,r,n,o])}function ki(t){return(function(e){if(Array.isArray(e))return Ve(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,r){if(e){if(typeof e=="string")return Ve(e,r);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ve(e,r)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ve(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function vr(t,e){var r=ki(e||[]);return e==null&&typeof t!="function"&&r.push(t),m.useMemo(function(){return typeof t=="function"?t():t},r)}function Ri(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return yr(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yr(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
6
6
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function yr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function mr(t,e,r){var i=Ri(m.useState(function(){return e(t)}),2),n=i[0],o=i[1],s=m.useCallback(function(){var a=e(t);on(n,a)||(o(a),r&&r())},[n,t,r]);return z(s),[n,s]}function Ai(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return br(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
7
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function br(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Or(t,e,r){return(function(i,n,o){var s=Ai(mr(i,n,o),2),a=s[0],u=s[1];return z(function(){var c=i.getHandlerId();if(c!=null)return i.subscribeToStateChange(u,{handlerIds:[c]})},[i,u]),a})(e,t||function(){return{}},function(){return r.reconnect()})}function Mi(t){return m.useMemo(function(){return t.hooks.dragSource()},[t])}function _i(t){return m.useMemo(function(){return t.hooks.dragPreview()},[t])}function Li(t,e){var r=vr(t,e);D(!r.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)");var i,n=(i=W(),m.useMemo(function(){return new Oi(i)},[i])),o=(function(s,a){var u=W(),c=m.useMemo(function(){return new Ti(u.getBackend())},[u]);return z(function(){return c.dragSourceOptions=s||null,c.reconnect(),function(){return c.disconnectDragSource()}},[c,s]),z(function(){return c.dragPreviewOptions=a||null,c.reconnect(),function(){return c.disconnectDragPreview()}},[c,a]),c})(r.options,r.previewOptions);return Pi(r,n,o),[Or(r.collect,n,o),Mi(o),_i(o)]}function Hi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Ir(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Fi=(function(){function t(e,r){(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),Ir(this,"spec",void 0),Ir(this,"monitor",void 0),this.spec=e,this.monitor=r}return Hi(t,[{key:"canDrop",value:function(){var e=this.spec,r=this.monitor;return!e.canDrop||e.canDrop(r.getItem(),r)}},{key:"hover",value:function(){var e=this.spec,r=this.monitor;e.hover&&e.hover(r.getItem(),r)}},{key:"drop",value:function(){var e=this.spec,r=this.monitor;if(e.drop)return e.drop(r.getItem(),r)}}]),t})();function Ui(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return Sr(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Sr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Bi(t,e,r){var i=W(),n=(function(s,a){var u=m.useMemo(function(){return new Fi(s,a)},[a]);return m.useEffect(function(){u.spec=s},[s]),u})(t,e),o=(function(s){var a=s.accept;return m.useMemo(function(){return D(s.accept!=null,"accept must be defined"),Array.isArray(a)?a:[a]},[a])})(t);z(function(){var s=(function(l,f,y){var h=y.getRegistry(),p=h.addTarget(l,f);return[p,function(){return h.removeTarget(p)}]})(o,n,i),a=Ui(s,2),u=a[0],c=a[1];return e.receiveHandlerId(u),r.receiveHandlerId(u),c},[i,e,n,r,o.map(function(s){return s.toString()}).join("|")])}function zi(t){return m.useMemo(function(){return t.hooks.dropTarget()},[t])}function wr(t,e){var r,i=vr(t,e),n=(r=W(),m.useMemo(function(){return new Si(r)},[r])),o=(function(s){var a=W(),u=m.useMemo(function(){return new Ci(a.getBackend())},[a]);return z(function(){return u.dropTargetOptions=s||null,u.reconnect(),function(){return u.disconnectDropTarget()}},[s]),u})(i.options);return Bi(i,n,o),[Or(i.collect,n,o),zi(o)]}function Wi(t,e){return(function(r){if(Array.isArray(r))return r})(t)||(function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var o,s,a=[],u=!0,c=!1;try{for(n=n.call(r);!(u=(o=n.next()).done)&&(a.push(o.value),!i||a.length!==i);u=!0);}catch(l){c=!0,s=l}finally{try{u||n.return==null||n.return()}finally{if(c)throw s}}return a}})(t,e)||(function(r,i){if(r){if(typeof r=="string")return Dr(r,i);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dr(r,i)}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Tr(t){var e=null;return function(){return e==null&&(e=t()),e}}function Gi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Er(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ki=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Er(this,"entered",[]),Er(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return Gi(t,[{key:"enter",value:function(e){var r=this,i=this.entered.length;return this.entered=(function(n,o){var s=new Set,a=function(c){return s.add(c)};n.forEach(a),o.forEach(a);var u=[];return s.forEach(function(c){return u.push(c)}),u})(this.entered.filter(function(n){return r.isNodeInDocument(n)&&(!n.contains||n.contains(e))}),[e]),i===0&&this.entered.length>0}},{key:"leave",value:function(e){var r,i,n=this.entered.length;return this.entered=(r=this.entered.filter(this.isNodeInDocument),i=e,r.filter(function(o){return o!==i})),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),Vi=Tr(function(){return/firefox/i.test(navigator.userAgent)}),Cr=Tr(function(){return!!window.safari});function Yi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var xr=(function(){function t(e,r){(function(x,N){if(!(x instanceof N))throw new TypeError("Cannot call a class as a function")})(this,t),te(this,"xs",void 0),te(this,"ys",void 0),te(this,"c1s",void 0),te(this,"c2s",void 0),te(this,"c3s",void 0);for(var i=e.length,n=[],o=0;o<i;o++)n.push(o);n.sort(function(x,N){return e[x]<e[N]?-1:1});for(var s,a,u=[],c=[],l=0;l<i-1;l++)s=e[l+1]-e[l],a=r[l+1]-r[l],u.push(s),c.push(a/s);for(var f=[c[0]],y=0;y<u.length-1;y++){var h=c[y],p=c[y+1];if(h*p<=0)f.push(0);else{s=u[y];var v=u[y+1],d=s+v;f.push(3*d/((d+v)/h+(d+s)/p))}}f.push(c[c.length-1]);for(var g,I=[],b=[],O=0;O<f.length-1;O++){g=c[O];var S=f[O],E=1/u[O],C=S+f[O+1]-g-g;I.push((g-S-C)*E),b.push(C*E*E)}this.xs=e,this.ys=r,this.c1s=f,this.c2s=I,this.c3s=b}return Yi(t,[{key:"interpolate",value:function(e){var r=this.xs,i=this.ys,n=this.c1s,o=this.c2s,s=this.c3s,a=r.length-1;if(e===r[a])return i[a];for(var u,c=0,l=s.length-1;c<=l;){var f=r[u=Math.floor(.5*(c+l))];if(f<e)c=u+1;else{if(!(f>e))return i[u];l=u-1}}var y=e-r[a=Math.max(0,l)],h=y*y;return i[a]+n[a]*y+o[a]*h+s[a]*y*h}}]),t})();function Nr(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),i=r.top;return{x:r.left,y:i}}function fe(t){return{x:t.clientX,y:t.clientY}}function qi(t,e,r,i,n){var o,s,a,u=(o=e).nodeName==="IMG"&&(Vi()||!((s=document.documentElement)!==null&&s!==void 0&&s.contains(o))),c=Nr(u?t:e),l={x:r.x-c.x,y:r.y-c.y},f=t.offsetWidth,y=t.offsetHeight,h=i.anchorX,p=i.anchorY,v=(function(S,E,C,x){var N=S?E.width:C,H=S?E.height:x;return Cr()&&S&&(H/=window.devicePixelRatio,N/=window.devicePixelRatio),{dragPreviewWidth:N,dragPreviewHeight:H}})(u,e,f,y),d=v.dragPreviewWidth,g=v.dragPreviewHeight,I=n.offsetX,b=n.offsetY,O=b===0||b;return{x:I===0||I?I:new xr([0,.5,1],[l.x,l.x/f*d,l.x+d-f]).interpolate(h),y:O?b:(a=new xr([0,.5,1],[l.y,l.y/y*g,l.y+g-y]).interpolate(p),Cr()&&u&&(a+=(window.devicePixelRatio-1)*g),a)}}var jr="__NATIVE_FILE__",Pr="__NATIVE_URL__",kr="__NATIVE_TEXT__",Rr="__NATIVE_HTML__";const Ar=Object.freeze(Object.defineProperty({__proto__:null,FILE:jr,HTML:Rr,TEXT:kr,URL:Pr},Symbol.toStringTag,{value:"Module"}));function Ve(t,e,r){var i=e.reduce(function(n,o){return n||t.getData(o)},"");return i??r}var re;function he(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ye=(he(re={},jr,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),he(re,Rr,{exposeProperties:{html:function(t,e){return Ve(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),he(re,Pr,{exposeProperties:{urls:function(t,e){return Ve(t,e,"").split(`
10
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),he(re,kr,{exposeProperties:{text:function(t,e){return Ve(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),re);function $i(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Mr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Mr(this,"item",void 0),Mr(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return $i(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(r){Object.defineProperty(e.item,r,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(r,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var r=this;if(e){var i={};Object.keys(this.config.exposeProperties).forEach(function(n){i[n]={value:r.config.exposeProperties[n](e,r.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,r){return r===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function qe(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ye).filter(function(r){return Ye[r].matchesTypes.some(function(i){return e.indexOf(i)>-1})})[0]||null}function Ji(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function $e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qi=(function(){function t(e,r){(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),$e(this,"ownerDocument",null),$e(this,"globalContext",void 0),$e(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Ji(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t})();function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Lr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(r),!0).forEach(function(i){T(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Zi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xe,eo=(function(){function t(e,r,i){var n=this;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),T(this,"options",void 0),T(this,"actions",void 0),T(this,"monitor",void 0),T(this,"registry",void 0),T(this,"enterLeaveCounter",void 0),T(this,"sourcePreviewNodes",new Map),T(this,"sourcePreviewNodeOptions",new Map),T(this,"sourceNodes",new Map),T(this,"sourceNodeOptions",new Map),T(this,"dragStartSourceIds",null),T(this,"dropTargetIds",[]),T(this,"dragEnterTargetIds",[]),T(this,"currentNativeSource",null),T(this,"currentNativeHandle",null),T(this,"currentDragSourceNode",null),T(this,"altKeyPressed",!1),T(this,"mouseMoveTimeoutTimer",null),T(this,"asyncEndDragFrameId",null),T(this,"dragOverTargetIds",null),T(this,"lastClientOffset",null),T(this,"hoverRafId",null),T(this,"getSourceClientOffset",function(o){var s=n.sourceNodes.get(o);return s&&Nr(s)||null}),T(this,"endDragNativeItem",function(){n.isDraggingNativeItem()&&(n.actions.endDrag(),n.currentNativeHandle&&n.registry.removeSource(n.currentNativeHandle),n.currentNativeHandle=null,n.currentNativeSource=null)}),T(this,"isNodeInDocument",function(o){return!!(o&&n.document&&n.document.body&&n.document.body.contains(o))}),T(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=n.currentDragSourceNode;o==null||n.isNodeInDocument(o)||n.clearCurrentDragSourceNode()&&n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleTopDragStartCapture",function(){n.clearCurrentDragSourceNode(),n.dragStartSourceIds=[]}),T(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var s=n.dragStartSourceIds;n.dragStartSourceIds=null;var a=fe(o);n.monitor.isDragging()&&n.actions.endDrag(),n.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:n.getSourceClientOffset,clientOffset:a});var u=o.dataTransfer,c=qe(u);if(n.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var l=n.monitor.getSourceId(),f=n.sourceNodes.get(l),y=n.sourcePreviewNodes.get(l)||f;if(y){var h=n.getCurrentSourcePreviewNodeOptions(),p=qi(f,y,a,{anchorX:h.anchorX,anchorY:h.anchorY},{offsetX:h.offsetX,offsetY:h.offsetY});u.setDragImage(y,p.x,p.y)}}try{u==null||u.setData("application/json",{})}catch{}n.setCurrentDragSourceNode(o.target),n.getCurrentSourcePreviewNodeOptions().captureDraggingState?n.actions.publishDragSource():setTimeout(function(){return n.actions.publishDragSource()},0)}else if(c)n.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),T(this,"handleTopDragEndCapture",function(){n.clearCurrentDragSourceNode()&&n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleTopDragEnterCapture",function(o){if(n.dragEnterTargetIds=[],n.enterLeaveCounter.enter(o.target)&&!n.monitor.isDragging()){var s=o.dataTransfer,a=qe(s);a&&n.beginDragNativeItem(a,s)}}),T(this,"handleTopDragEnter",function(o){var s=n.dragEnterTargetIds;n.dragEnterTargetIds=[],n.monitor.isDragging()&&(n.altKeyPressed=o.altKey,s.length>0&&n.actions.hover(s,{clientOffset:fe(o)}),s.some(function(a){return n.monitor.canDropOnTarget(a)})&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=n.getCurrentDropEffect())))}),T(this,"handleTopDragOverCapture",function(){n.dragOverTargetIds=[]}),T(this,"handleTopDragOver",function(o){var s=n.dragOverTargetIds;if(n.dragOverTargetIds=[],!n.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));n.altKeyPressed=o.altKey,n.lastClientOffset=fe(o),n.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(n.hoverRafId=requestAnimationFrame(function(){n.monitor.isDragging()&&n.actions.hover(s||[],{clientOffset:n.lastClientOffset}),n.hoverRafId=null})),(s||[]).some(function(a){return n.monitor.canDropOnTarget(a)})?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=n.getCurrentDropEffect())):n.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),T(this,"handleTopDragLeaveCapture",function(o){n.isDraggingNativeItem()&&o.preventDefault(),n.enterLeaveCounter.leave(o.target)&&n.isDraggingNativeItem()&&setTimeout(function(){return n.endDragNativeItem()},0)}),T(this,"handleTopDropCapture",function(o){var s;n.dropTargetIds=[],n.isDraggingNativeItem()?(o.preventDefault(),(s=n.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)):qe(o.dataTransfer)&&o.preventDefault(),n.enterLeaveCounter.reset()}),T(this,"handleTopDrop",function(o){var s=n.dropTargetIds;n.dropTargetIds=[],n.actions.hover(s,{clientOffset:fe(o)}),n.actions.drop({dropEffect:n.getCurrentDropEffect()}),n.isDraggingNativeItem()?n.endDragNativeItem():n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleSelectStart",function(o){var s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))}),this.options=new Qi(r,i),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Ki(this.isNodeInDocument)}return Zi(t,[{key:"profile",value:function(){var e,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,r=this.rootElement;r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,r,i){var n=this;return this.sourcePreviewNodeOptions.set(e,i),this.sourcePreviewNodes.set(e,r),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,r,i){var n=this;this.sourceNodes.set(e,r),this.sourceNodeOptions.set(e,i);var o=function(a){return n.handleDragStart(a,e)},s=function(a){return n.handleSelectStart(a)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",o),r.addEventListener("selectstart",s),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),r.removeEventListener("dragstart",o),r.removeEventListener("selectstart",s),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,r){var i=this,n=function(a){return i.handleDragEnter(a,e)},o=function(a){return i.handleDragOver(a,e)},s=function(a){return i.handleDrop(a,e)};return r.addEventListener("dragenter",n),r.addEventListener("dragover",o),r.addEventListener("drop",s),function(){r.removeEventListener("dragenter",n),r.removeEventListener("dragover",o),r.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(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))}},{key:"removeEventListeners",value:function(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))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(e);return Lr({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Lr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ar).some(function(r){return Ar[r]===e})}},{key:"beginDragNativeItem",value:function(e,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=(function(i,n){var o=new Xi(Ye[i]);return o.loadDataTransfer(n),o})(e,r),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var i;return(i=r.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,r){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(e,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(e,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(e,r){this.dropTargetIds.unshift(r)}}]),t})(),to=function(t,e,r){return new eo(t,e,r)};function ro(t){const e=R(),r=e.selectedIds,[i,n,o]=Li(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const s=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(Y.dragStart(t.id,s)),{id:t.id,dragIds:s}},end:()=>{e.hideCursor(),e.dispatch(Y.dragEnd())}}),[r,t]);return m.useEffect(()=>{o((Xe||((Xe=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Xe))},[o]),n}function ge(t,e){return{parentId:t||null,index:e}}function $(t,e){return{type:"line",index:t,level:e}}function Je(t,e){var r;let i=t;for(;i.parent&&i.level>e;)i=i.parent;return{parentId:((r=i.parent)===null||r===void 0?void 0:r.id)||null,index:yt(i)+1}}function Hr(t){var e;const r=(function(f,y){const h=f.getBoundingClientRect(),p=y.x-Math.round(h.x),v=y.y-Math.round(h.y),d=h.height,g=v<d/2,I=!g,b=d/4,O=v>b&&v<d-b;return{x:p,inTopHalf:g,inBottomHalf:I,inMiddle:O,atTop:!O&&g,atBottom:!O&&I}})(t.element,t.offset),i=t.indent,n=Math.round(Math.max(0,r.x-i)/i),{node:o,nextNode:s,prevNode:a}=t,[u,c]=(function(f,y,h,p){return f?f.isInternal?p.atTop?[y,f]:p.inMiddle?[f,f]:[f,h]:p.inTopHalf?[y,f]:[f,h]:[y,null]})(o,a,s,r);if(o&&o.isInternal&&r.inMiddle)return{drop:ge(o.id,null),cursor:(l=o.id,{type:"highlight",id:l})};var l;if(!u)return{drop:ge((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:$(0,0)};if(ht(u)){const f=se(n,(c==null?void 0:c.level)||0,u.level);return{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}if(gt(u)){const f=se(n,(c==null?void 0:c.level)||0,u.level);return{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}if(pt(u)){const f=se(n,0,u.level+1);return f>u.level?{drop:ge(u.id,0),cursor:$(u.rowIndex+1,f)}:{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}return{drop:ge(u==null?void 0:u.id,0),cursor:$(u.rowIndex+1,u.level+1)}}const no=st.memo(function({index:t,style:e}){ft(),(function(){if(m.useContext(ct)===null)throw new Error("Provide a NodesContext")})();const r=R(),i=(function(p){const v=R(),d=v.at(p);if(!d)throw new Error(`Could not find node for index: ${p}`);return m.useMemo(()=>{const g=d.clone();return v.visibleNodes[p]=g,g},[...Object.values(d.state),d])})(t),n=m.useRef(null),o=ro(i),s=(function(p,v){const d=R(),[g,I]=wr(()=>({accept:"NODE",canDrop:()=>d.canDrop(),hover:(b,O)=>{const S=O.getClientOffset();if(!p.current||!S)return;const{cursor:E,drop:C}=Hr({element:p.current,offset:S,indent:d.indent,node:v,prevNode:v.prev,nextNode:v.next});C&&d.dispatch(Y.hovering(C.parentId,C.index)),O.canDrop()?E&&d.showCursor(E):d.hideCursor()},drop:(b,O)=>{if(!O.canDrop())return null;let{parentId:S,index:E,dragIds:C}=d.state.dnd;St(d.props.onMove,{dragIds:C,parentId:S===Q?null:S,index:E===null?0:E,dragNodes:d.dragNodes,parentNode:d.get(S)}),d.open(S)}}),[v,p.current,d.props]);return I})(n,i),a=m.useCallback(p=>{n.current=p,s(p)},[s]),u=r.indent*i.level,c=m.useMemo(()=>({paddingLeft:u}),[u]),l=m.useMemo(()=>{var p,v;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((v=(p=r.props.padding)!==null&&p!==void 0?p:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[e,r.props.padding,r.props.paddingTop]),f={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:l,tabIndex:-1,className:r.props.rowClassName};m.useEffect(()=>{var p;!i.isEditing&&i.isFocused&&((p=n.current)===null||p===void 0||p.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,n.current]);const y=r.renderNode,h=r.renderRow;return w.jsx(h,{node:i,innerRef:a,attrs:f,children:w.jsx(y,{node:i,tree:r,style:c,dragHandle:o})})});let Qe="",Fr=null;function Ur(){ft();const t=R();return w.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const n=Array.from(t.selectedIds);if(n.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(n))}else{const o=t.focusedNode;if(o){const s=o.nextSibling,a=o.parent;t.focus(s||a,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void mt(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void bt(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const n=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(n);{if(!n)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(n):t.selectMulti(n):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const n=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(n);{if(!n)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(n):t.selectMulti(n):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const n=t.focusedNode;return n?void(n.isInternal&&n.isOpen?t.focus(t.nextNode):n.isInternal&&t.open(n.id)):void 0}if(e.key==="ArrowLeft"){const n=t.focusedNode;return!n||n.isRoot?void 0:void(n.isInternal&&n.isOpen?t.close(n.id):((r=n.parent)===null||r===void 0?void 0:r.isRoot)||t.focus(n.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const n=t.focusedNode;return!n||!n.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{n&&t.edit(n)})}if(e.key===" "){e.preventDefault();const n=t.focusedNode;return n?void(n.isLeaf?(n.select(),n.activate()):n.toggle()):void 0}if(e.key==="*"){const n=t.focusedNode;return n?void t.openSiblings(n):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Fr),Qe+=e.key,Fr=setTimeout(()=>{Qe=""},600);const i=t.visibleNodes.find(n=>{const o=n.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(Qe)});i&&t.focus(i.id)},children:w.jsx(Pn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:An,innerElementType:Ln,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:no})})}function Br(t){return t.isFiltered?(function(e,r){const i={},n=[];function o(a){if(!a.isRoot&&r(a)){i[a.id]=!0;let u=a.parent;for(;u;)i[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)o(u)}function s(a){var u;a.level>=0&&i[a.id]&&n.push(a),a.isOpen&&((u=a.children)===null||u===void 0||u.forEach(s))}return o(e),s(e),n.forEach(zr),n})(t.root,t.isMatch.bind(t)):(function(e){const r=[];function i(n){var o;n.level>=0&&r.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(i))}return i(e),r.forEach(zr),r})(t.root)}function zr(t,e){t.rowIndex=e}const Wr=t=>t.reduce((e,r,i)=>(e[r.id]=i,e),{});var Ze=function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(c){try{u(i.next(c))}catch(l){o(l)}}function a(c){try{u(i.throw(c))}catch(l){o(l)}}function u(c){var l;c.done?n(c.value):(l=c.value,l instanceof r?l:new r(function(f){f(l)})).then(s,a)}u((i=i.apply(t,e||[])).next())})};const{safeRun:j,identify:U,identifyNull:L}=un;class ne{constructor(e,r,i,n){this.store=e,this.props=r,this.list=i,this.listEl=n,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Et(this),this.visibleNodes=Br(this),this.idToIndex=Wr(this.visibleNodes)}update(e){this.props=e,this.root=Et(this),this.visibleNodes=Br(this),this.idToIndex=Wr(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:(i,n)=>JSON.stringify(Object.values(i.data)).toLocaleLowerCase().includes(n.toLocaleLowerCase());return i=>r(i,this.searchTerm)}accessChildren(e){var r;return(r=J(e,this.props.childrenAccessor||"children"))!==null&&r!==void 0?r:null}accessId(e){const r=J(e,this.props.idAccessor||"id");if(!r)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return r}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const 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,r){var i;if(e===null||r===null)return[];const n=(i=this.indexOf(e))!==null&&i!==void 0?i:0,o=this.indexOf(r);if(o===null)return[];const s=Math.min(n,o),a=Math.max(n,o);return this.visibleNodes.slice(s,a+1)}indexOf(e){const r=It(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Ze(this,arguments,void 0,function*(e={}){var r,i;const n=e.parentId===void 0?Tt(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Dt(this),s=(i=e.type)!==null&&i!==void 0?i:"leaf",a=yield j(this.props.onCreate,{type:s,parentId:n,index:o,parentNode:this.get(n)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(e){return Ze(this,void 0,void 0,function*(){if(!e)return;const r=(Array.isArray(e)?e:[e]).map(U),i=r.map(n=>this.get(n)).filter(n=>!!n);yield j(this.props.onDelete,{nodes:i,ids:r})})}edit(e){const r=U(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Oe(r)),new Promise(i=>{ne.editPromise=i})}submit(e,r){return Ze(this,void 0,void 0,function*(){if(!e)return;const i=U(e);yield j(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(Oe(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Oe(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get(L(e));r&&j(this.props.onActivate,r)}resolveEdit(e){const r=ne.editPromise;r&&r(e),ne.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const i=this.get(r);i&&e.push(i)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(K(U(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&j(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const i=this.visibleStartIndex,n=this.visibleStopIndex-i;let o=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;o=o>i?i:Math.max(i-n,0),this.focus(this.at(o))}pageDown(){var e,r;const i=this.visibleStartIndex,n=this.visibleStopIndex,o=n-i;let s=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;s=s<n?n:Math.min(s+o,this.visibleNodes.length-1),this.focus(this.at(s))}select(e,r={}){if(!e)return;const i=r.focus!==!1,n=U(e);i&&this.dispatch(K(n)),this.dispatch(yn(n)),this.dispatch(jt(n)),this.dispatch(Se(n)),this.scrollTo(n,r.align),this.focusedNode&&i&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=U(e);this.dispatch(Nt(r)),j(this.props.onSelect,this.selectedNodes)}selectMulti(e){const r=this.get(L(e));r&&(this.dispatch(K(r.id)),this.dispatch(xt(r.id)),this.dispatch(jt(r.id)),this.dispatch(Se(r.id)),this.scrollTo(r),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const r=U(e),{anchor:i,mostRecent:n}=this.state.nodes.selection;this.dispatch(K(r)),this.dispatch(Nt(this.nodesBetween(i,n))),this.dispatch(xt(this.nodesBetween(i,L(r)))),this.dispatch(Se(r)),this.scrollTo(r),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),j(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(K((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const i=new Set((r=e.ids)===null||r===void 0?void 0:r.map(U)),n=L(e.anchor),o=L(e.mostRecent);this.dispatch(mn({ids:i,anchor:n,mostRecent:o})),j(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id: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(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,i=this.dragNodes,n=this.props.disableDrop;for(const o of i)if(!o||!r||o.isInternal&&vt(r,o))return!1;return typeof n=="function"?!n({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n=="string"?!r.data[n]:typeof n!="boolean"||!n}hideCursor(){this.dispatch(Y.cursor({type:"none"}))}showCursor(e){this.dispatch(Y.cursor(e))}open(e){const r=L(e);r&&(this.isOpen(r)||(this.dispatch(Ie.open(r,this.isFiltered)),j(this.props.onToggle,r)))}close(e){const r=L(e);r&&this.isOpen(r)&&(this.dispatch(Ie.close(r,this.isFiltered)),j(this.props.onToggle,r))}toggle(e){const r=L(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=L(e);if(!r)return;const i=be(this.root,r);let n=i==null?void 0:i.parent;for(;n;)this.open(n.id),n=n.parent}openSiblings(e){const r=e.parent;if(r){if(r.children){const i=e.isOpen;for(let n of r.children)n.isInternal&&(i?this.close(n.id):this.open(n.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){ae(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ae(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const i=U(e);return this.openParents(i),wt(()=>i in this.idToIndex).then(()=>{var n;const o=this.idToIndex[i];o!==void 0&&((n=this.list.current)===null||n===void 0||n.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}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)}isOpen(e){var r,i,n;if(!e)return!1;if(e===Q)return!0;const o=(r=this.props.openByDefault)===null||r===void 0||r;return this.isFiltered?(i=this.state.nodes.open.filtered[e])===null||i===void 0||i:(n=this.state.nodes.open.unfiltered[e])!==null&&n!==void 0?n:o}isEditable(e){return!J(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!J(e,this.props.disableDrag||(()=>!1))}isDragging(e){const r=L(e);return!!r&&this.state.nodes.drag.id===r}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=L(e);if(!r)return!1;const{destinationParentId:i,destinationIndex:n}=this.state.nodes.drag;return r===i&&n===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(K(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ur}get renderRow(){return this.props.renderRow||hn}get renderNode(){return this.props.children||gn}get renderDragPreview(){return this.props.renderDragPreview||Pt}get renderCursor(){return this.props.renderCursor||fn}}function k(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Gr=typeof Symbol=="function"&&Symbol.observable||"@@observable",et=()=>Math.random().toString(36).substring(7).split("").join("."),pe={INIT:`@@redux/INIT${et()}`,REPLACE:`@@redux/REPLACE${et()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${et()}`};function Kr(t,e,r){if(typeof t!="function")throw new Error(k(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(k(0));if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),r!==void 0){if(typeof r!="function")throw new Error(k(1));return r(Kr)(t,e)}let i=t,n=e,o=new Map,s=o,a=0,u=!1;function c(){s===o&&(s=new Map,o.forEach((h,p)=>{s.set(p,h)}))}function l(){if(u)throw new Error(k(3));return n}function f(h){if(typeof h!="function")throw new Error(k(4));if(u)throw new Error(k(5));let p=!0;c();const v=a++;return s.set(v,h),function(){if(p){if(u)throw new Error(k(6));p=!1,c(),s.delete(v),o=null}}}function y(h){if(!(function(p){if(typeof p!="object"||p===null)return!1;let v=p;for(;Object.getPrototypeOf(v)!==null;)v=Object.getPrototypeOf(v);return Object.getPrototypeOf(p)===v||Object.getPrototypeOf(p)===null})(h))throw new Error(k(7));if(h.type===void 0)throw new Error(k(8));if(typeof h.type!="string")throw new Error(k(17));if(u)throw new Error(k(9));try{u=!0,n=i(n,h)}finally{u=!1}return(o=s).forEach(p=>{p()}),h}return y({type:pe.INIT}),{dispatch:y,subscribe:f,getState:l,replaceReducer:function(h){if(typeof h!="function")throw new Error(k(10));i=h,y({type:pe.REPLACE})},[Gr]:function(){const h=f;return{subscribe(p){if(typeof p!="object"||p===null)throw new Error(k(11));function v(){const d=p;d.next&&d.next(l())}return v(),{unsubscribe:h(v)}},[Gr](){return this}}}}}function Vr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}const i=Object.keys(r);let n;try{(function(o){Object.keys(o).forEach(s=>{const a=o[s];if(a(void 0,{type:pe.INIT})===void 0)throw new Error(k(12));if(a(void 0,{type:pe.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(k(13))})})(r)}catch(o){n=o}return function(o={},s){if(n)throw n;let a=!1;const u={};for(let c=0;c<i.length;c++){const l=i[c],f=r[l],y=o[l],h=f(y,s);if(h===void 0)throw s&&s.type,new Error(k(14));u[l]=h,a=a||h!==y}return a=a||i.length!==Object.keys(o).length,a?u:o}}const io=Vr({nodes:Vr({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:Ct(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Ct(t.unfiltered,e)}):t},selection:function(t=V().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(i=>r.add(i)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(i=>r.delete(i)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=V().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=V().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return V().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),oo=V();function so({treeProps:t,imperativeHandle:e,children:r}){const i=m.useRef(null),n=m.useRef(null),o=m.useRef(Kr(io,V(t))),s=nn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>oo),a=m.useMemo(()=>new ne(o.current,t,i,n),[]),u=m.useRef(0);return m.useMemo(()=>{u.current+=1,a.update(t)},[...Object.values(t),s.nodes.open]),m.useImperativeHandle(e,()=>a),m.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),m.useEffect(()=>{a.props.searchTerm||o.current.dispatch(Ie.clear(!0))},[a.props.searchTerm]),w.jsx(ut.Provider,{value:a,children:w.jsx(dt.Provider,{value:u.current,children:w.jsx(ct.Provider,{value:s.nodes,children:w.jsx(lt.Provider,{value:s.dnd,children:w.jsx(mi,Object.assign({backend:to,options:{rootElement:a.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:r}))})})})})}function ao(t){return(function(){const e=R(),[,r]=wr(()=>({accept:"NODE",canDrop:(i,n)=>!!n.isOver({shallow:!0})&&e.canDrop(),hover:(i,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:s,drop:a}=Hr({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(Y.hovering(a.parentId,a.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()}}),[e]);r(e.listEl)})(),t.children}function uo(){const t=R().props.renderContainer||Ur;return w.jsx(w.Fragment,{children:w.jsx(t,{})})}function co(){const t=R(),{offset:e,mouse:r,item:i,isDragging:n}=(o=f=>({offset:f.getSourceClientOffset(),mouse:f.getClientOffset(),item:f.getItem(),isDragging:f.isDragging()}),s=W().getMonitor(),a=Wi(mr(s,o),2),u=a[0],c=a[1],m.useEffect(function(){return s.subscribeToOffsetChange(c)}),m.useEffect(function(){return s.subscribeToStateChange(c)}),u);var o,s,a,u,c;const l=t.props.renderDragPreview||Pt;return w.jsx(l,{offset:e,mouse:r,id:(i==null?void 0:i.id)||null,dragIds:(i==null?void 0:i.dragIds)||[],isDragging:n})}class Yr{constructor(e){this.root=(function(r){const i=new qr({id:"ROOT"},null);return i.children=r.map(n=>tt(n,i)),i})(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(i=>i.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),i=e.parentId?this.find(e.parentId):this.root;r&&i&&(i.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let i of r.children){const n=this.find(e,i);if(n)return n}return null}return null}}function tt(t,e){const r=new qr(t,e);return t.children&&(r.children=t.children.map(i=>tt(i,r))),r}class qr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var i,n;const o=tt(e,this);this.children=(i=this.children)!==null&&i!==void 0?i:[],this.children.splice(r,0,o),this.data.children=(n=this.data.children)!==null&&n!==void 0?n:[],this.data.children.splice(r,0,e)}removeChild(e){var r,i;(r=this.children)===null||r===void 0||r.splice(e,1),(i=this.data.children)===null||i===void 0||i.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let lo=0;function fo(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Tr(t){var e=null;return function(){return e==null&&(e=t()),e}}function Gi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Er(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Er(this,"entered",[]),Er(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return Gi(t,[{key:"enter",value:function(e){var r=this,i=this.entered.length;return this.entered=(function(n,o){var s=new Set,a=function(c){return s.add(c)};n.forEach(a),o.forEach(a);var u=[];return s.forEach(function(c){return u.push(c)}),u})(this.entered.filter(function(n){return r.isNodeInDocument(n)&&(!n.contains||n.contains(e))}),[e]),i===0&&this.entered.length>0}},{key:"leave",value:function(e){var r,i,n=this.entered.length;return this.entered=(r=this.entered.filter(this.isNodeInDocument),i=e,r.filter(function(o){return o!==i})),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),Ki=Tr(function(){return/firefox/i.test(navigator.userAgent)}),Cr=Tr(function(){return!!window.safari});function Yi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var xr=(function(){function t(e,r){(function(x,N){if(!(x instanceof N))throw new TypeError("Cannot call a class as a function")})(this,t),te(this,"xs",void 0),te(this,"ys",void 0),te(this,"c1s",void 0),te(this,"c2s",void 0),te(this,"c3s",void 0);for(var i=e.length,n=[],o=0;o<i;o++)n.push(o);n.sort(function(x,N){return e[x]<e[N]?-1:1});for(var s,a,u=[],c=[],l=0;l<i-1;l++)s=e[l+1]-e[l],a=r[l+1]-r[l],u.push(s),c.push(a/s);for(var f=[c[0]],y=0;y<u.length-1;y++){var h=c[y],p=c[y+1];if(h*p<=0)f.push(0);else{s=u[y];var v=u[y+1],d=s+v;f.push(3*d/((d+v)/h+(d+s)/p))}}f.push(c[c.length-1]);for(var g,I=[],b=[],O=0;O<f.length-1;O++){g=c[O];var S=f[O],E=1/u[O],C=S+f[O+1]-g-g;I.push((g-S-C)*E),b.push(C*E*E)}this.xs=e,this.ys=r,this.c1s=f,this.c2s=I,this.c3s=b}return Yi(t,[{key:"interpolate",value:function(e){var r=this.xs,i=this.ys,n=this.c1s,o=this.c2s,s=this.c3s,a=r.length-1;if(e===r[a])return i[a];for(var u,c=0,l=s.length-1;c<=l;){var f=r[u=Math.floor(.5*(c+l))];if(f<e)c=u+1;else{if(!(f>e))return i[u];l=u-1}}var y=e-r[a=Math.max(0,l)],h=y*y;return i[a]+n[a]*y+o[a]*h+s[a]*y*h}}]),t})();function Nr(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),i=r.top;return{x:r.left,y:i}}function fe(t){return{x:t.clientX,y:t.clientY}}function qi(t,e,r,i,n){var o,s,a,u=(o=e).nodeName==="IMG"&&(Ki()||!((s=document.documentElement)!==null&&s!==void 0&&s.contains(o))),c=Nr(u?t:e),l={x:r.x-c.x,y:r.y-c.y},f=t.offsetWidth,y=t.offsetHeight,h=i.anchorX,p=i.anchorY,v=(function(S,E,C,x){var N=S?E.width:C,H=S?E.height:x;return Cr()&&S&&(H/=window.devicePixelRatio,N/=window.devicePixelRatio),{dragPreviewWidth:N,dragPreviewHeight:H}})(u,e,f,y),d=v.dragPreviewWidth,g=v.dragPreviewHeight,I=n.offsetX,b=n.offsetY,O=b===0||b;return{x:I===0||I?I:new xr([0,.5,1],[l.x,l.x/f*d,l.x+d-f]).interpolate(h),y:O?b:(a=new xr([0,.5,1],[l.y,l.y/y*g,l.y+g-y]).interpolate(p),Cr()&&u&&(a+=(window.devicePixelRatio-1)*g),a)}}var jr="__NATIVE_FILE__",Pr="__NATIVE_URL__",kr="__NATIVE_TEXT__",Rr="__NATIVE_HTML__";const Ar=Object.freeze(Object.defineProperty({__proto__:null,FILE:jr,HTML:Rr,TEXT:kr,URL:Pr},Symbol.toStringTag,{value:"Module"}));function Ke(t,e,r){var i=e.reduce(function(n,o){return n||t.getData(o)},"");return i??r}var re;function he(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ye=(he(re={},jr,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),he(re,Rr,{exposeProperties:{html:function(t,e){return Ke(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),he(re,Pr,{exposeProperties:{urls:function(t,e){return Ke(t,e,"").split(`
10
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),he(re,kr,{exposeProperties:{text:function(t,e){return Ke(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),re);function $i(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function Mr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xi=(function(){function t(e){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Mr(this,"item",void 0),Mr(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return $i(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(r){Object.defineProperty(e.item,r,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(r,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var r=this;if(e){var i={};Object.keys(this.config.exposeProperties).forEach(function(n){i[n]={value:r.config.exposeProperties[n](e,r.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,r){return r===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function qe(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ye).filter(function(r){return Ye[r].matchesTypes.some(function(i){return e.indexOf(i)>-1})})[0]||null}function Ji(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function $e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qi=(function(){function t(e,r){(function(i,n){if(!(i instanceof n))throw new TypeError("Cannot call a class as a function")})(this,t),$e(this,"ownerDocument",null),$e(this,"globalContext",void 0),$e(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Ji(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t})();function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Lr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(r),!0).forEach(function(i){T(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Zi(t,e,r){return e&&(function(i,n){for(var o=0;o<n.length;o++){var s=n[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}})(t.prototype,e),t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xe,eo=(function(){function t(e,r,i){var n=this;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),T(this,"options",void 0),T(this,"actions",void 0),T(this,"monitor",void 0),T(this,"registry",void 0),T(this,"enterLeaveCounter",void 0),T(this,"sourcePreviewNodes",new Map),T(this,"sourcePreviewNodeOptions",new Map),T(this,"sourceNodes",new Map),T(this,"sourceNodeOptions",new Map),T(this,"dragStartSourceIds",null),T(this,"dropTargetIds",[]),T(this,"dragEnterTargetIds",[]),T(this,"currentNativeSource",null),T(this,"currentNativeHandle",null),T(this,"currentDragSourceNode",null),T(this,"altKeyPressed",!1),T(this,"mouseMoveTimeoutTimer",null),T(this,"asyncEndDragFrameId",null),T(this,"dragOverTargetIds",null),T(this,"lastClientOffset",null),T(this,"hoverRafId",null),T(this,"getSourceClientOffset",function(o){var s=n.sourceNodes.get(o);return s&&Nr(s)||null}),T(this,"endDragNativeItem",function(){n.isDraggingNativeItem()&&(n.actions.endDrag(),n.currentNativeHandle&&n.registry.removeSource(n.currentNativeHandle),n.currentNativeHandle=null,n.currentNativeSource=null)}),T(this,"isNodeInDocument",function(o){return!!(o&&n.document&&n.document.body&&n.document.body.contains(o))}),T(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=n.currentDragSourceNode;o==null||n.isNodeInDocument(o)||n.clearCurrentDragSourceNode()&&n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleTopDragStartCapture",function(){n.clearCurrentDragSourceNode(),n.dragStartSourceIds=[]}),T(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var s=n.dragStartSourceIds;n.dragStartSourceIds=null;var a=fe(o);n.monitor.isDragging()&&n.actions.endDrag(),n.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:n.getSourceClientOffset,clientOffset:a});var u=o.dataTransfer,c=qe(u);if(n.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var l=n.monitor.getSourceId(),f=n.sourceNodes.get(l),y=n.sourcePreviewNodes.get(l)||f;if(y){var h=n.getCurrentSourcePreviewNodeOptions(),p=qi(f,y,a,{anchorX:h.anchorX,anchorY:h.anchorY},{offsetX:h.offsetX,offsetY:h.offsetY});u.setDragImage(y,p.x,p.y)}}try{u==null||u.setData("application/json",{})}catch{}n.setCurrentDragSourceNode(o.target),n.getCurrentSourcePreviewNodeOptions().captureDraggingState?n.actions.publishDragSource():setTimeout(function(){return n.actions.publishDragSource()},0)}else if(c)n.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),T(this,"handleTopDragEndCapture",function(){n.clearCurrentDragSourceNode()&&n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleTopDragEnterCapture",function(o){if(n.dragEnterTargetIds=[],n.enterLeaveCounter.enter(o.target)&&!n.monitor.isDragging()){var s=o.dataTransfer,a=qe(s);a&&n.beginDragNativeItem(a,s)}}),T(this,"handleTopDragEnter",function(o){var s=n.dragEnterTargetIds;n.dragEnterTargetIds=[],n.monitor.isDragging()&&(n.altKeyPressed=o.altKey,s.length>0&&n.actions.hover(s,{clientOffset:fe(o)}),s.some(function(a){return n.monitor.canDropOnTarget(a)})&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=n.getCurrentDropEffect())))}),T(this,"handleTopDragOverCapture",function(){n.dragOverTargetIds=[]}),T(this,"handleTopDragOver",function(o){var s=n.dragOverTargetIds;if(n.dragOverTargetIds=[],!n.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));n.altKeyPressed=o.altKey,n.lastClientOffset=fe(o),n.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(n.hoverRafId=requestAnimationFrame(function(){n.monitor.isDragging()&&n.actions.hover(s||[],{clientOffset:n.lastClientOffset}),n.hoverRafId=null})),(s||[]).some(function(a){return n.monitor.canDropOnTarget(a)})?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=n.getCurrentDropEffect())):n.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),T(this,"handleTopDragLeaveCapture",function(o){n.isDraggingNativeItem()&&o.preventDefault(),n.enterLeaveCounter.leave(o.target)&&n.isDraggingNativeItem()&&setTimeout(function(){return n.endDragNativeItem()},0)}),T(this,"handleTopDropCapture",function(o){var s;n.dropTargetIds=[],n.isDraggingNativeItem()?(o.preventDefault(),(s=n.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)):qe(o.dataTransfer)&&o.preventDefault(),n.enterLeaveCounter.reset()}),T(this,"handleTopDrop",function(o){var s=n.dropTargetIds;n.dropTargetIds=[],n.actions.hover(s,{clientOffset:fe(o)}),n.actions.drop({dropEffect:n.getCurrentDropEffect()}),n.isDraggingNativeItem()?n.endDragNativeItem():n.monitor.isDragging()&&n.actions.endDrag()}),T(this,"handleSelectStart",function(o){var s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))}),this.options=new Qi(r,i),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Vi(this.isNodeInDocument)}return Zi(t,[{key:"profile",value:function(){var e,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,r=this.rootElement;r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,r,i){var n=this;return this.sourcePreviewNodeOptions.set(e,i),this.sourcePreviewNodes.set(e,r),function(){n.sourcePreviewNodes.delete(e),n.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,r,i){var n=this;this.sourceNodes.set(e,r),this.sourceNodeOptions.set(e,i);var o=function(a){return n.handleDragStart(a,e)},s=function(a){return n.handleSelectStart(a)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",o),r.addEventListener("selectstart",s),function(){n.sourceNodes.delete(e),n.sourceNodeOptions.delete(e),r.removeEventListener("dragstart",o),r.removeEventListener("selectstart",s),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,r){var i=this,n=function(a){return i.handleDragEnter(a,e)},o=function(a){return i.handleDragOver(a,e)},s=function(a){return i.handleDrop(a,e)};return r.addEventListener("dragenter",n),r.addEventListener("dragover",o),r.addEventListener("drop",s),function(){r.removeEventListener("dragenter",n),r.removeEventListener("dragover",o),r.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(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))}},{key:"removeEventListeners",value:function(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))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(e);return Lr({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Lr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ar).some(function(r){return Ar[r]===e})}},{key:"beginDragNativeItem",value:function(e,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=(function(i,n){var o=new Xi(Ye[i]);return o.loadDataTransfer(n),o})(e,r),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var i;return(i=r.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,r){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(e,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(e,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(e,r){this.dropTargetIds.unshift(r)}}]),t})(),to=function(t,e,r){return new eo(t,e,r)};function ro(t){const e=R(),r=e.selectedIds,[i,n,o]=Li(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const s=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(Y.dragStart(t.id,s)),{id:t.id,dragIds:s}},end:()=>{e.hideCursor(),e.dispatch(Y.dragEnd())}}),[r,t]);return m.useEffect(()=>{o((Xe||((Xe=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Xe))},[o]),n}function ge(t,e){return{parentId:t||null,index:e}}function $(t,e){return{type:"line",index:t,level:e}}function Je(t,e){var r;let i=t;for(;i.parent&&i.level>e;)i=i.parent;return{parentId:((r=i.parent)===null||r===void 0?void 0:r.id)||null,index:yt(i)+1}}function Hr(t){var e;const r=(function(f,y){const h=f.getBoundingClientRect(),p=y.x-Math.round(h.x),v=y.y-Math.round(h.y),d=h.height,g=v<d/2,I=!g,b=d/4,O=v>b&&v<d-b;return{x:p,inTopHalf:g,inBottomHalf:I,inMiddle:O,atTop:!O&&g,atBottom:!O&&I}})(t.element,t.offset),i=t.indent,n=Math.round(Math.max(0,r.x-i)/i),{node:o,nextNode:s,prevNode:a}=t,[u,c]=(function(f,y,h,p){return f?f.isInternal?p.atTop?[y,f]:p.inMiddle?[f,f]:[f,h]:p.inTopHalf?[y,f]:[f,h]:[y,null]})(o,a,s,r);if(o&&o.isInternal&&r.inMiddle)return{drop:ge(o.id,null),cursor:(l=o.id,{type:"highlight",id:l})};var l;if(!u)return{drop:ge((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:$(0,0)};if(ht(u)){const f=se(n,(c==null?void 0:c.level)||0,u.level);return{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}if(gt(u)){const f=se(n,(c==null?void 0:c.level)||0,u.level);return{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}if(pt(u)){const f=se(n,0,u.level+1);return f>u.level?{drop:ge(u.id,0),cursor:$(u.rowIndex+1,f)}:{drop:Je(u,f),cursor:$(u.rowIndex+1,f)}}return{drop:ge(u==null?void 0:u.id,0),cursor:$(u.rowIndex+1,u.level+1)}}const no=st.memo(function({index:t,style:e}){ft(),(function(){if(m.useContext(ct)===null)throw new Error("Provide a NodesContext")})();const r=R(),i=(function(p){const v=R(),d=v.at(p);if(!d)throw new Error(`Could not find node for index: ${p}`);return m.useMemo(()=>{const g=d.clone();return v.visibleNodes[p]=g,g},[...Object.values(d.state),d])})(t),n=m.useRef(null),o=ro(i),s=(function(p,v){const d=R(),[g,I]=wr(()=>({accept:"NODE",canDrop:()=>d.canDrop(),hover:(b,O)=>{const S=O.getClientOffset();if(!p.current||!S)return;const{cursor:E,drop:C}=Hr({element:p.current,offset:S,indent:d.indent,node:v,prevNode:v.prev,nextNode:v.next});C&&d.dispatch(Y.hovering(C.parentId,C.index)),O.canDrop()?E&&d.showCursor(E):d.hideCursor()},drop:(b,O)=>{if(!O.canDrop())return null;let{parentId:S,index:E,dragIds:C}=d.state.dnd;St(d.props.onMove,{dragIds:C,parentId:S===Q?null:S,index:E===null?0:E,dragNodes:d.dragNodes,parentNode:d.get(S)}),d.open(S)}}),[v,p.current,d.props]);return I})(n,i),a=m.useCallback(p=>{n.current=p,s(p)},[s]),u=r.indent*i.level,c=m.useMemo(()=>({paddingLeft:u}),[u]),l=m.useMemo(()=>{var p,v;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((v=(p=r.props.padding)!==null&&p!==void 0?p:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[e,r.props.padding,r.props.paddingTop]),f={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:l,tabIndex:-1,className:r.props.rowClassName};m.useEffect(()=>{var p;!i.isEditing&&i.isFocused&&((p=n.current)===null||p===void 0||p.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,n.current]);const y=r.renderNode,h=r.renderRow;return w.jsx(h,{node:i,innerRef:a,attrs:f,children:w.jsx(y,{node:i,tree:r,style:c,dragHandle:o})})});let Qe="",Fr=null;function Ur(){ft();const t=R();return w.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const n=Array.from(t.selectedIds);if(n.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(n))}else{const o=t.focusedNode;if(o){const s=o.nextSibling,a=o.parent;t.focus(s||a,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void mt(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void bt(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const n=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(n);{if(!n)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(n):t.selectMulti(n):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const n=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(n);{if(!n)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(n):t.selectMulti(n):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const n=t.focusedNode;return n?void(n.isInternal&&n.isOpen?t.focus(t.nextNode):n.isInternal&&t.open(n.id)):void 0}if(e.key==="ArrowLeft"){const n=t.focusedNode;return!n||n.isRoot?void 0:void(n.isInternal&&n.isOpen?t.close(n.id):((r=n.parent)===null||r===void 0?void 0:r.isRoot)||t.focus(n.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const n=t.focusedNode;return!n||!n.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{n&&t.edit(n)})}if(e.key===" "){e.preventDefault();const n=t.focusedNode;return n?void(n.isLeaf?(n.select(),n.activate()):n.toggle()):void 0}if(e.key==="*"){const n=t.focusedNode;return n?void t.openSiblings(n):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Fr),Qe+=e.key,Fr=setTimeout(()=>{Qe=""},600);const i=t.visibleNodes.find(n=>{const o=n.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(Qe)});i&&t.focus(i.id)},children:w.jsx(Pn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:An,innerElementType:Ln,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:no})})}function Br(t){return t.isFiltered?(function(e,r){const i={},n=[];function o(a){if(!a.isRoot&&r(a)){i[a.id]=!0;let u=a.parent;for(;u;)i[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)o(u)}function s(a){var u;a.level>=0&&i[a.id]&&n.push(a),a.isOpen&&((u=a.children)===null||u===void 0||u.forEach(s))}return o(e),s(e),n.forEach(zr),n})(t.root,t.isMatch.bind(t)):(function(e){const r=[];function i(n){var o;n.level>=0&&r.push(n),n.isOpen&&((o=n.children)===null||o===void 0||o.forEach(i))}return i(e),r.forEach(zr),r})(t.root)}function zr(t,e){t.rowIndex=e}const Wr=t=>t.reduce((e,r,i)=>(e[r.id]=i,e),{});var Ze=function(t,e,r,i){return new(r||(r=Promise))(function(n,o){function s(c){try{u(i.next(c))}catch(l){o(l)}}function a(c){try{u(i.throw(c))}catch(l){o(l)}}function u(c){var l;c.done?n(c.value):(l=c.value,l instanceof r?l:new r(function(f){f(l)})).then(s,a)}u((i=i.apply(t,e||[])).next())})};const{safeRun:j,identify:U,identifyNull:L}=un;class ne{constructor(e,r,i,n){this.store=e,this.props=r,this.list=i,this.listEl=n,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Et(this),this.visibleNodes=Br(this),this.idToIndex=Wr(this.visibleNodes)}update(e){this.props=e,this.root=Et(this),this.visibleNodes=Br(this),this.idToIndex=Wr(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:(i,n)=>JSON.stringify(Object.values(i.data)).toLocaleLowerCase().includes(n.toLocaleLowerCase());return i=>r(i,this.searchTerm)}accessChildren(e){var r;return(r=J(e,this.props.childrenAccessor||"children"))!==null&&r!==void 0?r:null}accessId(e){const r=J(e,this.props.idAccessor||"id");if(!r)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return r}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const 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,r){var i;if(e===null||r===null)return[];const n=(i=this.indexOf(e))!==null&&i!==void 0?i:0,o=this.indexOf(r);if(o===null)return[];const s=Math.min(n,o),a=Math.max(n,o);return this.visibleNodes.slice(s,a+1)}indexOf(e){const r=It(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Ze(this,arguments,void 0,function*(e={}){var r,i;const n=e.parentId===void 0?Tt(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Dt(this),s=(i=e.type)!==null&&i!==void 0?i:"leaf",a=yield j(this.props.onCreate,{type:s,parentId:n,index:o,parentNode:this.get(n)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(e){return Ze(this,void 0,void 0,function*(){if(!e)return;const r=(Array.isArray(e)?e:[e]).map(U),i=r.map(n=>this.get(n)).filter(n=>!!n);yield j(this.props.onDelete,{nodes:i,ids:r})})}edit(e){const r=U(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Oe(r)),new Promise(i=>{ne.editPromise=i})}submit(e,r){return Ze(this,void 0,void 0,function*(){if(!e)return;const i=U(e);yield j(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(Oe(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Oe(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get(L(e));r&&j(this.props.onActivate,r)}resolveEdit(e){const r=ne.editPromise;r&&r(e),ne.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const i=this.get(r);i&&e.push(i)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(V(U(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&j(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const i=this.visibleStartIndex,n=this.visibleStopIndex-i;let o=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;o=o>i?i:Math.max(i-n,0),this.focus(this.at(o))}pageDown(){var e,r;const i=this.visibleStartIndex,n=this.visibleStopIndex,o=n-i;let s=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;s=s<n?n:Math.min(s+o,this.visibleNodes.length-1),this.focus(this.at(s))}select(e,r={}){if(!e)return;const i=r.focus!==!1,n=U(e);i&&this.dispatch(V(n)),this.dispatch(yn(n)),this.dispatch(jt(n)),this.dispatch(Se(n)),this.scrollTo(n,r.align),this.focusedNode&&i&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=U(e);this.dispatch(Nt(r)),j(this.props.onSelect,this.selectedNodes)}selectMulti(e){const r=this.get(L(e));r&&(this.dispatch(V(r.id)),this.dispatch(xt(r.id)),this.dispatch(jt(r.id)),this.dispatch(Se(r.id)),this.scrollTo(r),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const r=U(e),{anchor:i,mostRecent:n}=this.state.nodes.selection;this.dispatch(V(r)),this.dispatch(Nt(this.nodesBetween(i,n))),this.dispatch(xt(this.nodesBetween(i,L(r)))),this.dispatch(Se(r)),this.scrollTo(r),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),j(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(V((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&j(this.props.onFocus,this.focusedNode),j(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const i=new Set((r=e.ids)===null||r===void 0?void 0:r.map(U)),n=L(e.anchor),o=L(e.mostRecent);this.dispatch(mn({ids:i,anchor:n,mostRecent:o})),j(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id: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(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,i=this.dragNodes,n=this.props.disableDrop;for(const o of i)if(!o||!r||o.isInternal&&vt(r,o))return!1;return typeof n=="function"?!n({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n=="string"?!r.data[n]:typeof n!="boolean"||!n}hideCursor(){this.dispatch(Y.cursor({type:"none"}))}showCursor(e){this.dispatch(Y.cursor(e))}open(e){const r=L(e);r&&(this.isOpen(r)||(this.dispatch(Ie.open(r,this.isFiltered)),j(this.props.onToggle,r)))}close(e){const r=L(e);r&&this.isOpen(r)&&(this.dispatch(Ie.close(r,this.isFiltered)),j(this.props.onToggle,r))}toggle(e){const r=L(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=L(e);if(!r)return;const i=be(this.root,r);let n=i==null?void 0:i.parent;for(;n;)this.open(n.id),n=n.parent}openSiblings(e){const r=e.parent;if(r){if(r.children){const i=e.isOpen;for(let n of r.children)n.isInternal&&(i?this.close(n.id):this.open(n.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){ae(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ae(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const i=U(e);return this.openParents(i),wt(()=>i in this.idToIndex).then(()=>{var n;const o=this.idToIndex[i];o!==void 0&&((n=this.list.current)===null||n===void 0||n.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}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)}isOpen(e){var r,i,n;if(!e)return!1;if(e===Q)return!0;const o=(r=this.props.openByDefault)===null||r===void 0||r;return this.isFiltered?(i=this.state.nodes.open.filtered[e])===null||i===void 0||i:(n=this.state.nodes.open.unfiltered[e])!==null&&n!==void 0?n:o}isEditable(e){return!J(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!J(e,this.props.disableDrag||(()=>!1))}isDragging(e){const r=L(e);return!!r&&this.state.nodes.drag.id===r}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=L(e);if(!r)return!1;const{destinationParentId:i,destinationIndex:n}=this.state.nodes.drag;return r===i&&n===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(V(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ur}get renderRow(){return this.props.renderRow||hn}get renderNode(){return this.props.children||gn}get renderDragPreview(){return this.props.renderDragPreview||Pt}get renderCursor(){return this.props.renderCursor||fn}}function k(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Gr=typeof Symbol=="function"&&Symbol.observable||"@@observable",et=()=>Math.random().toString(36).substring(7).split("").join("."),pe={INIT:`@@redux/INIT${et()}`,REPLACE:`@@redux/REPLACE${et()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${et()}`};function Vr(t,e,r){if(typeof t!="function")throw new Error(k(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(k(0));if(typeof e=="function"&&r===void 0&&(r=e,e=void 0),r!==void 0){if(typeof r!="function")throw new Error(k(1));return r(Vr)(t,e)}let i=t,n=e,o=new Map,s=o,a=0,u=!1;function c(){s===o&&(s=new Map,o.forEach((h,p)=>{s.set(p,h)}))}function l(){if(u)throw new Error(k(3));return n}function f(h){if(typeof h!="function")throw new Error(k(4));if(u)throw new Error(k(5));let p=!0;c();const v=a++;return s.set(v,h),function(){if(p){if(u)throw new Error(k(6));p=!1,c(),s.delete(v),o=null}}}function y(h){if(!(function(p){if(typeof p!="object"||p===null)return!1;let v=p;for(;Object.getPrototypeOf(v)!==null;)v=Object.getPrototypeOf(v);return Object.getPrototypeOf(p)===v||Object.getPrototypeOf(p)===null})(h))throw new Error(k(7));if(h.type===void 0)throw new Error(k(8));if(typeof h.type!="string")throw new Error(k(17));if(u)throw new Error(k(9));try{u=!0,n=i(n,h)}finally{u=!1}return(o=s).forEach(p=>{p()}),h}return y({type:pe.INIT}),{dispatch:y,subscribe:f,getState:l,replaceReducer:function(h){if(typeof h!="function")throw new Error(k(10));i=h,y({type:pe.REPLACE})},[Gr]:function(){const h=f;return{subscribe(p){if(typeof p!="object"||p===null)throw new Error(k(11));function v(){const d=p;d.next&&d.next(l())}return v(),{unsubscribe:h(v)}},[Gr](){return this}}}}}function Kr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}const i=Object.keys(r);let n;try{(function(o){Object.keys(o).forEach(s=>{const a=o[s];if(a(void 0,{type:pe.INIT})===void 0)throw new Error(k(12));if(a(void 0,{type:pe.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(k(13))})})(r)}catch(o){n=o}return function(o={},s){if(n)throw n;let a=!1;const u={};for(let c=0;c<i.length;c++){const l=i[c],f=r[l],y=o[l],h=f(y,s);if(h===void 0)throw s&&s.type,new Error(k(14));u[l]=h,a=a||h!==y}return a=a||i.length!==Object.keys(o).length,a?u:o}}const io=Kr({nodes:Kr({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:Ct(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Ct(t.unfiltered,e)}):t},selection:function(t=K().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(i=>r.add(i)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(i=>r.delete(i)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=K().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=K().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return K().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),oo=K();function so({treeProps:t,imperativeHandle:e,children:r}){const i=m.useRef(null),n=m.useRef(null),o=m.useRef(Vr(io,K(t))),s=nn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>oo),a=m.useMemo(()=>new ne(o.current,t,i,n),[]),u=m.useRef(0);return m.useMemo(()=>{u.current+=1,a.update(t)},[...Object.values(t),s.nodes.open]),m.useImperativeHandle(e,()=>a),m.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),m.useEffect(()=>{a.props.searchTerm||o.current.dispatch(Ie.clear(!0))},[a.props.searchTerm]),w.jsx(ut.Provider,{value:a,children:w.jsx(dt.Provider,{value:u.current,children:w.jsx(ct.Provider,{value:s.nodes,children:w.jsx(lt.Provider,{value:s.dnd,children:w.jsx(mi,Object.assign({backend:to,options:{rootElement:a.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:r}))})})})})}function ao(t){return(function(){const e=R(),[,r]=wr(()=>({accept:"NODE",canDrop:(i,n)=>!!n.isOver({shallow:!0})&&e.canDrop(),hover:(i,n)=>{if(!n.isOver({shallow:!0}))return;const o=n.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:s,drop:a}=Hr({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(Y.hovering(a.parentId,a.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()}}),[e]);r(e.listEl)})(),t.children}function uo(){const t=R().props.renderContainer||Ur;return w.jsx(w.Fragment,{children:w.jsx(t,{})})}function co(){const t=R(),{offset:e,mouse:r,item:i,isDragging:n}=(o=f=>({offset:f.getSourceClientOffset(),mouse:f.getClientOffset(),item:f.getItem(),isDragging:f.isDragging()}),s=W().getMonitor(),a=Wi(mr(s,o),2),u=a[0],c=a[1],m.useEffect(function(){return s.subscribeToOffsetChange(c)}),m.useEffect(function(){return s.subscribeToStateChange(c)}),u);var o,s,a,u,c;const l=t.props.renderDragPreview||Pt;return w.jsx(l,{offset:e,mouse:r,id:(i==null?void 0:i.id)||null,dragIds:(i==null?void 0:i.dragIds)||[],isDragging:n})}class Yr{constructor(e){this.root=(function(r){const i=new qr({id:"ROOT"},null);return i.children=r.map(n=>tt(n,i)),i})(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(i=>i.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),i=e.parentId?this.find(e.parentId):this.root;r&&i&&(i.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let i of r.children){const n=this.find(e,i);if(n)return n}return null}return null}}function tt(t,e){const r=new qr(t,e);return t.children&&(r.children=t.children.map(i=>tt(i,r))),r}class qr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var i,n;const o=tt(e,this);this.children=(i=this.children)!==null&&i!==void 0?i:[],this.children.splice(r,0,o),this.data.children=(n=this.data.children)!==null&&n!==void 0?n:[],this.data.children.splice(r,0,e)}removeChild(e){var r,i;(r=this.children)===null||r===void 0||r.splice(e,1),(i=this.data.children)===null||i===void 0||i.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let lo=0;function fo(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
11
11
  Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,r]=(function(i){const[n,o]=m.useState(i),s=m.useMemo(()=>new Yr(n),[n]);return[n,{onMove:u=>{for(const c of u.dragIds)s.move({id:c,parentId:u.parentId,index:u.index});o(s.data)},onRename:({name:u,id:c})=>{s.update({id:c,changes:{name:u}}),o(s.data)},onCreate:({parentId:u,index:c,type:l})=>{const f={id:"simple-tree-id-"+lo++,name:""};return l==="internal"&&(f.children=[]),s.create({parentId:u,index:c,data:f}),o(s.data),f},onDelete:u=>{u.ids.forEach(c=>s.drop({id:c})),o(s.data)}}]})(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}return t}const ho=m.forwardRef(function(t,e){const r=fo(t);return w.jsxs(so,{treeProps:r,imperativeHandle:e,children:[w.jsx(ao,{children:w.jsx(uo,{})}),w.jsx(co,{})]})});export{Yr as S,ho as T};