@marimo-team/frontend 0.19.8-dev21 → 0.19.8-dev24

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 (169) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-B098edeX.js → ConnectedDataExplorerComponent-C1BlkUlk.js} +1 -1
  2. package/dist/assets/{JsonOutput-DsO4felE.js → JsonOutput-BPSYj_Kn.js} +3 -3
  3. package/dist/assets/{LazyAnyLanguageCodeMirror-CQP8KZWO.js → LazyAnyLanguageCodeMirror-BqosdyZU.js} +2 -2
  4. package/dist/assets/{MarimoErrorOutput-DrTj9k_Z.js → MarimoErrorOutput-DVEiP1Ym.js} +1 -1
  5. package/dist/assets/{RenderHTML-D9vJ9neG.js → RenderHTML-Bj4DW3wy.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-CPu9tI-Q.js → add-cell-with-ai-dpMkH_5a.js} +5 -5
  7. package/dist/assets/{add-database-form-CvczP0Mq.js → add-database-form-Bn_w5TEI.js} +1 -1
  8. package/dist/assets/{agent-panel-Dbh-hMbm.js → agent-panel-BSykBSj4.js} +1 -1
  9. package/dist/assets/{ai-model-dropdown-CODXtvnr.js → ai-model-dropdown-D8AFYZjU.js} +1 -1
  10. package/dist/assets/{any-language-editor-B1WBkbF4.js → any-language-editor-DyXJSyeK.js} +1 -1
  11. package/dist/assets/{app-config-button-BGuwQV5R.js → app-config-button-Ds61zRnG.js} +1 -1
  12. package/dist/assets/{architectureDiagram-VXUJARFQ-BsTgqTsh.js → architectureDiagram-VXUJARFQ-B8zMpJcM.js} +1 -1
  13. package/dist/assets/blob-Bgnx1kuY.js +1 -0
  14. package/dist/assets/{blockDiagram-VD42YOAC-CeZonq9z.js → blockDiagram-VD42YOAC-CF1a-_t0.js} +1 -1
  15. package/dist/assets/{c4Diagram-YG6GDRKO-CDPGRzUd.js → c4Diagram-YG6GDRKO-YIsEsUdQ.js} +1 -1
  16. package/dist/assets/{cache-panel-gTIhwBeU.js → cache-panel-C_9WDApV.js} +1 -1
  17. package/dist/assets/{cell-editor-BpkNlmop.js → cell-editor-90blTXig.js} +1 -1
  18. package/dist/assets/channel-CXFsg7SH.js +1 -0
  19. package/dist/assets/{chat-display-BnUDaREA.js → chat-display-letMHFni.js} +1 -1
  20. package/dist/assets/{chat-panel-BpDjUlzW.js → chat-panel-0qUKLNYu.js} +1 -1
  21. package/dist/assets/{chunk-5FQGJX7Z-CwvgJCug.js → chunk-5FQGJX7Z-T2jyw7ZD.js} +2 -2
  22. package/dist/assets/{chunk-ABZYJK2D-CtRGq-db.js → chunk-ABZYJK2D-D1A06qKo.js} +3 -3
  23. package/dist/assets/{chunk-ATLVNIR6-CXEe2jMF.js → chunk-ATLVNIR6-C5FWd1qN.js} +1 -1
  24. package/dist/assets/{chunk-B4BG7PRW-BVqt-NSK.js → chunk-B4BG7PRW-BEayfxv_.js} +1 -1
  25. package/dist/assets/{chunk-DI55MBZ5-C_mlVJmb.js → chunk-DI55MBZ5-BSrtupT8.js} +1 -1
  26. package/dist/assets/{chunk-EXTU4WIE-CN3BqsR0.js → chunk-EXTU4WIE-wi_fHsHN.js} +1 -1
  27. package/dist/assets/{chunk-JA3XYJ7Z-B5-JYmoA.js → chunk-JA3XYJ7Z-tKDxhnhw.js} +1 -1
  28. package/dist/assets/{chunk-JZLCHNYA-UFlatyc1.js → chunk-JZLCHNYA-DtvI9B9X.js} +1 -1
  29. package/dist/assets/{chunk-N4CR4FBY-BFF_Z7sG.js → chunk-N4CR4FBY-BQcJpHO7.js} +2 -2
  30. package/dist/assets/{chunk-QN33PNHL-DOgXIePg.js → chunk-QN33PNHL-BboKw3W6.js} +1 -1
  31. package/dist/assets/{chunk-QXUST7PY-CbBaWlhv.js → chunk-QXUST7PY-C4Ihfbmy.js} +1 -1
  32. package/dist/assets/{chunk-S3R3BYOJ-CM-pQ0EF.js → chunk-S3R3BYOJ-D1UiABQX.js} +1 -1
  33. package/dist/assets/{chunk-TZMSLE5B-Bs5ERkTF.js → chunk-TZMSLE5B-BjrxQwUX.js} +1 -1
  34. package/dist/assets/classDiagram-2ON5EDUG-BHD5dOKT.js +1 -0
  35. package/dist/assets/classDiagram-v2-WZHVMYZB-VYd80hrd.js +1 -0
  36. package/dist/assets/{code-block-37QAKDTI-CT7W9knZ.js → code-block-37QAKDTI-FUPT3-7o.js} +1 -1
  37. package/dist/assets/{column-preview-Bz3KIcIX.js → column-preview-BEosUUWh.js} +1 -1
  38. package/dist/assets/{command-PbcrObnK.js → command-BpjkI15h.js} +1 -1
  39. package/dist/assets/{command-palette-D8q355Sm.js → command-palette-BymLo8Sb.js} +1 -1
  40. package/dist/assets/{common-DRWuidzm.js → common-RVtJOXao.js} +1 -1
  41. package/dist/assets/{copy-icon-B9w72gBC.js → copy-icon-C9v8EtBA.js} +1 -1
  42. package/dist/assets/{dagre-6UL2VRFP-UK8bracd.js → dagre-6UL2VRFP-CX3NGWnu.js} +1 -1
  43. package/dist/assets/{data-grid-overlay-editor-2vr_zUfM.js → data-grid-overlay-editor-BTyw6887.js} +1 -1
  44. package/dist/assets/{datasource-Dkywo3Kg.js → datasource-Bl1__6xJ.js} +1 -1
  45. package/dist/assets/{dependency-graph-panel-ZnsWxFY3.js → dependency-graph-panel-C33q1RVn.js} +1 -1
  46. package/dist/assets/{diagram-PSM6KHXK-7QiPU-26.js → diagram-PSM6KHXK-C0Sfgs1J.js} +1 -1
  47. package/dist/assets/{diagram-QEK2KX5R-BbZsWUC4.js → diagram-QEK2KX5R-DYSkW6Ju.js} +1 -1
  48. package/dist/assets/{diagram-S2PKOQOG-SZ-twU4B.js → diagram-S2PKOQOG-CfHqQVo3.js} +1 -1
  49. package/dist/assets/{dist-DY1C8dgM.js → dist-h1RhtzUB.js} +1 -1
  50. package/dist/assets/{documentation-panel-CZJavCAM.js → documentation-panel-BWViNAJ6.js} +1 -1
  51. package/dist/assets/{download-CmdFQXRz.js → download-s-BdZdTz.js} +1 -1
  52. package/dist/assets/{edit-page-e6xxDbUd.js → edit-page-nMTiqKOs.js} +3 -3
  53. package/dist/assets/{erDiagram-Q2GNP2WA-BSmVh3Kt.js → erDiagram-Q2GNP2WA-BfRyUS6D.js} +1 -1
  54. package/dist/assets/{error-panel-BMcWP1VH.js → error-panel-BhPek3dt.js} +1 -1
  55. package/dist/assets/{es-CerBf9Z6.js → es-GXAIFcot.js} +1 -1
  56. package/dist/assets/{esm-C-53tlK5.js → esm-BK6tLEHQ.js} +1 -1
  57. package/dist/assets/{file-explorer-panel-th-ny103.js → file-explorer-panel-BGF99P_O.js} +1 -1
  58. package/dist/assets/{flowDiagram-NV44I4VS-2nYUYKvI.js → flowDiagram-NV44I4VS-DKkZCUwG.js} +1 -1
  59. package/dist/assets/{form-94alAnRh.js → form-CNEyFLKK.js} +1 -1
  60. package/dist/assets/{formats-CobRswjh.js → formats-DGZwRUPy.js} +1 -1
  61. package/dist/assets/gallery-page-1AmSypJ6.js +1 -0
  62. package/dist/assets/{ganttDiagram-JELNMOA3-B77PnMPw.js → ganttDiagram-JELNMOA3-J8yLTqxn.js} +1 -1
  63. package/dist/assets/{gitGraphDiagram-NY62KEGX-B-3aRelz.js → gitGraphDiagram-NY62KEGX-DXw3a-uS.js} +1 -1
  64. package/dist/assets/{glide-data-editor-B5UMCoFz.js → glide-data-editor-Cw8eE9Xn.js} +4 -4
  65. package/dist/assets/{home-page-Bgzw3IP3.js → home-page-Cs46vLcH.js} +1 -1
  66. package/dist/assets/{hooks-B_N-kbrq.js → hooks-C13qkLoi.js} +1 -1
  67. package/dist/assets/index-3CaNzO41.css +2 -0
  68. package/dist/assets/{index-U7La6ZBB.js → index-CxrD-UyN.js} +22 -22
  69. package/dist/assets/{infoDiagram-WHAUD3N6-_vys04Gc.js → infoDiagram-WHAUD3N6-32du45zK.js} +1 -1
  70. package/dist/assets/{journeyDiagram-XKPGCS4Q-CkD6eopP.js → journeyDiagram-XKPGCS4Q-Bmx7dA25.js} +1 -1
  71. package/dist/assets/{kanban-definition-3W4ZIXB7-kX5aL9Ug.js → kanban-definition-3W4ZIXB7-DJzhLwsl.js} +1 -1
  72. package/dist/assets/katex-axIMlGRc.js +1 -0
  73. package/dist/assets/{label-C9wP7Kp2.js → label-C--1sWU6.js} +1 -1
  74. package/dist/assets/{layout-D7NLGhPa.js → layout-ZtHfLqYp.js} +3 -3
  75. package/dist/assets/{linear-BxhToEEF.js → linear-DWpCiijk.js} +1 -1
  76. package/dist/assets/{logs-panel-y2i-7VQF.js → logs-panel-z3Z9lCbV.js} +1 -1
  77. package/dist/assets/{markdown-renderer-D8AmLSIR.js → markdown-renderer-Md8pHWxP.js} +1 -1
  78. package/dist/assets/mermaid-4DMBBIKO-Dn0v3H8Z.js +1 -0
  79. package/dist/assets/{mermaid-Caj4ROsO.js → mermaid-dAaJQU1M.js} +3 -3
  80. package/dist/assets/{mhchem-CJmb5HsA.js → mhchem-2XRJK9de.js} +1 -1
  81. package/dist/assets/{mindmap-definition-VGOIOE7T-BJ9zWUqW.js → mindmap-definition-VGOIOE7T-whTFv8Zv.js} +1 -1
  82. package/dist/assets/{name-cell-input-BthamWJY.js → name-cell-input-BGxKE7pD.js} +1 -1
  83. package/dist/assets/{number-overlay-editor-DIy8e1ST.js → number-overlay-editor-65UcMR52.js} +1 -1
  84. package/dist/assets/{packages-panel-DsF1uf9X.js → packages-panel-BheI3Whw.js} +1 -1
  85. package/dist/assets/{panels-aWY9-L83.js → panels-5zIgiTjO.js} +1 -1
  86. package/dist/assets/{pieDiagram-ADFJNKIX-Mf2FMnt9.js → pieDiagram-ADFJNKIX-4n07I4VV.js} +1 -1
  87. package/dist/assets/{precisionRound-CU2C3Vxx.js → precisionRound-C3fmBb6j.js} +1 -1
  88. package/dist/assets/{quadrantDiagram-AYHSOK5B-B04U71uV.js → quadrantDiagram-AYHSOK5B-CNm24EC2.js} +1 -1
  89. package/dist/assets/{react-plotly-D4UaXGJL.js → react-plotly-OyYr93y7.js} +1 -1
  90. package/dist/assets/{react-vega-CqegDZRQ.js → react-vega-BEiHA2e9.js} +1 -1
  91. package/dist/assets/react-vega-BrNLU7si.js +1 -0
  92. package/dist/assets/{readonly-python-code-C_8a4fwz.js → readonly-python-code-q8H4JtWe.js} +1 -1
  93. package/dist/assets/{renderShortcut-B1jzzLJw.js → renderShortcut-Xr6z-RjZ.js} +1 -1
  94. package/dist/assets/{requirementDiagram-UZGBJVZJ-oJlPs172.js → requirementDiagram-UZGBJVZJ-B7BwuJGh.js} +1 -1
  95. package/dist/assets/{run-page-DQU-eaKQ.js → run-page-BtgxUxdD.js} +1 -1
  96. package/dist/assets/{sankeyDiagram-TZEHDZUN-aplEbaHE.js → sankeyDiagram-TZEHDZUN-C8KpmdhC.js} +1 -1
  97. package/dist/assets/{scratchpad-panel-N4QLTtHb.js → scratchpad-panel-BZn63vOx.js} +1 -1
  98. package/dist/assets/{secrets-panel-vKKBtc8G.js → secrets-panel-CEMSgQv5.js} +1 -1
  99. package/dist/assets/{sequenceDiagram-WL72ISMW-WAUwGkkd.js → sequenceDiagram-WL72ISMW-D0_AcPzd.js} +1 -1
  100. package/dist/assets/{session-panel-Cof-5_26.js → session-panel-iRBC1bk4.js} +1 -1
  101. package/dist/assets/{slides-component-CeMnlG8H.js → slides-component-C0UAH9QZ.js} +1 -1
  102. package/dist/assets/{snippets-panel-WBcYsSsb.js → snippets-panel-paMvhw49.js} +1 -1
  103. package/dist/assets/{stateDiagram-FKZM4ZOC-DUDhr_Gg.js → stateDiagram-FKZM4ZOC-Dz_iVJd6.js} +1 -1
  104. package/dist/assets/stateDiagram-v2-4FDKWEC3-CupainMB.js +1 -0
  105. package/dist/assets/{terminal-CF-esPMT.js → terminal-BLSSaFMR.js} +1 -1
  106. package/dist/assets/{textarea-8F9GOEGf.js → textarea-B9TY02t9.js} +1 -1
  107. package/dist/assets/{time-EL4bnqqQ.js → time-CSCsAxXS.js} +1 -1
  108. package/dist/assets/{timeline-definition-IT6M3QCI-D93LYpWp.js → timeline-definition-IT6M3QCI-DPXEeoSm.js} +1 -1
  109. package/dist/assets/{tooltip-DxKBXCGp.js → tooltip-DqsDDLgU.js} +1 -1
  110. package/dist/assets/{tracing-DGYwY__a.js → tracing-DVD0lR_-.js} +1 -1
  111. package/dist/assets/{tracing-panel-BHnlOWW9.js → tracing-panel-D0p98UnG.js} +2 -2
  112. package/dist/assets/{tree-B8r7cwRm.js → tree-Hg81oJmp.js} +1 -1
  113. package/dist/assets/{useAddCell-Cx99GRHQ.js → useAddCell-C0mjPsjt.js} +1 -1
  114. package/dist/assets/{useCellActionButton-VRGP_KkG.js → useCellActionButton-DR2cYGwm.js} +1 -1
  115. package/dist/assets/{useDeleteCell-DHPNhAtW.js → useDeleteCell-DyGTLzfg.js} +1 -1
  116. package/dist/assets/{useDependencyPanelTab-UoJrnugs.js → useDependencyPanelTab-Dd7aOXV0.js} +1 -1
  117. package/dist/assets/{useInstallPackage-xrG_Tm9T.js → useInstallPackage-Co79H1lQ.js} +1 -1
  118. package/dist/assets/{useNotebookActions-BEKXbrFJ.js → useNotebookActions-DMf9_Eai.js} +1 -1
  119. package/dist/assets/{useSplitCell-h8RpNtuv.js → useSplitCell-dutfMkv3.js} +1 -1
  120. package/dist/assets/{utilities.esm-AIy-_q0N.js → utilities.esm-BREvtThv.js} +1 -1
  121. package/dist/assets/{vega-component-D4ZTpyiq.js → vega-component-7jd4fFCJ.js} +1 -1
  122. package/dist/assets/{vega-loader.browser-DXARUlxo.js → vega-loader.browser-BegSZk0G.js} +1 -1
  123. package/dist/assets/{write-secret-modal-BodBOJkR.js → write-secret-modal-DO-EOoNO.js} +1 -1
  124. package/dist/assets/{xychartDiagram-PRI3JC2R-C8jV7uCC.js → xychartDiagram-PRI3JC2R-DINfGlOV.js} +1 -1
  125. package/dist/index.html +56 -56
  126. package/package.json +1 -1
  127. package/src/components/pages/gallery-page.tsx +37 -6
  128. package/src/core/ai/context/providers/file.ts +1 -1
  129. package/src/core/static/__tests__/files.test.ts +195 -1
  130. package/src/core/static/files.ts +39 -9
  131. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +7 -1
  132. package/src/utils/__tests__/blob.test.ts +3 -3
  133. package/src/utils/blob.ts +14 -27
  134. package/dist/assets/blob-t6qcPM7K.js +0 -1
  135. package/dist/assets/channel-CUmF6tDU.js +0 -1
  136. package/dist/assets/classDiagram-2ON5EDUG-DLI68D-F.js +0 -1
  137. package/dist/assets/classDiagram-v2-WZHVMYZB-yfw4NTdf.js +0 -1
  138. package/dist/assets/gallery-page-Yq7Go5FK.js +0 -1
  139. package/dist/assets/index-BTVKRPtt.css +0 -2
  140. package/dist/assets/katex-DF982Ty5.js +0 -1
  141. package/dist/assets/mermaid-4DMBBIKO-DQz_QvBC.js +0 -1
  142. package/dist/assets/react-vega-CP7NqbRQ.js +0 -1
  143. package/dist/assets/stateDiagram-v2-4FDKWEC3-yH9Rugj-.js +0 -1
  144. /package/dist/assets/{alert-BOoN6gJ1.js → alert-Cx8eFRUM.js} +0 -0
  145. /package/dist/assets/{cell-link-BoOn0OpK.js → cell-link-DfoJF6Bq.js} +0 -0
  146. /package/dist/assets/{copy-DHrHayPa.js → copy-BaRrAFL-.js} +0 -0
  147. /package/dist/assets/{defaultLocale-BLne0bXb.js → defaultLocale-B6z1Qyqt.js} +0 -0
  148. /package/dist/assets/{defaultLocale-JieDVWC_.js → defaultLocale-YteS-k_t.js} +0 -0
  149. /package/dist/assets/{dist-CDXJRSCj.js → dist-BMEHQAhk.js} +0 -0
  150. /package/dist/assets/{emotion-is-prop-valid.esm-C59xfSYt.js → emotion-is-prop-valid.esm-Dangy3Bv.js} +0 -0
  151. /package/dist/assets/{error-banner-Dlrzo_Ay.js → error-banner-w4pz2qUB.js} +0 -0
  152. /package/dist/assets/{extends-BiFDv3jB.js → extends-Dqvpuc10.js} +0 -0
  153. /package/dist/assets/{focus-BEf2RhRf.js → focus-RQ0afibT.js} +0 -0
  154. /package/dist/assets/{html-to-image-DrmKVKna.js → html-to-image-BIY1TtH0.js} +0 -0
  155. /package/dist/assets/{katex-CDLTCvjQ.js → katex-CbllUrnh.js} +0 -0
  156. /package/dist/assets/{kbd-Cm6Ba9qg.js → kbd-k3Sn_RwW.js} +0 -0
  157. /package/dist/assets/{links-7AQBmdyV.js → links-fh_IXIKE.js} +0 -0
  158. /package/dist/assets/{multi-map-t2yhdp8D.js → multi-map-A4XNra08.js} +0 -0
  159. /package/dist/assets/{objectWithoutPropertiesLoose-DfWeGRFv.js → objectWithoutPropertiesLoose-DoKw85w0.js} +0 -0
  160. /package/dist/assets/{ordinal-C93T4L8H.js → ordinal-DAqJmfoU.js} +0 -0
  161. /package/dist/assets/{process-output-OTqBNunj.js → process-output-C77tRi36.js} +0 -0
  162. /package/dist/assets/{prop-types-DaaA-ptl.js → prop-types-DVDiRdwc.js} +0 -0
  163. /package/dist/assets/{purify.es-DZrAQFIu.js → purify.es-B-nzWya6.js} +0 -0
  164. /package/dist/assets/{range-1DwpgXvM.js → range-7fnH_zLA.js} +0 -0
  165. /package/dist/assets/{table-DScsXgJW.js → table-BOsFCeLh.js} +0 -0
  166. /package/dist/assets/{useAsyncData-BMGLSTg8.js → useAsyncData-CgmD3hjw.js} +0 -0
  167. /package/dist/assets/{useDeepCompareMemoize-ChxLMT9E.js → useDeepCompareMemoize-CFtQU7An.js} +0 -0
  168. /package/dist/assets/{useIframeCapabilities-B_pQb20b.js → useIframeCapabilities-CC8VH6kZ.js} +0 -0
  169. /package/dist/assets/{useRunCells-BOowME8Z.js → useRunCells-BJznEpzj.js} +0 -0
@@ -1,3 +1,3 @@
1
- import{r as Ke,s as ue,t as Or}from"./chunk-LvLJmgfZ.js";import{t as Ir}from"./react-Bj1aDYRI.js";import{t as br}from"./jsx-runtime-ZmTK25f3.js";import{d as Sr}from"./popover-B-131r4d.js";import{t as Dr}from"./extends-BiFDv3jB.js";function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},he(e,t)}function Tr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,he(e,t)}function Ve(e){if(e===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Er=Or(((e,t)=>{t.exports=function r(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var s,o,a;if(Array.isArray(n)){if(s=n.length,s!=i.length)return!1;for(o=s;o--!==0;)if(!r(n[o],i[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(a=Object.keys(n),s=a.length,s!==Object.keys(i).length)return!1;for(o=s;o--!==0;)if(!Object.prototype.hasOwnProperty.call(i,a[o]))return!1;for(o=s;o--!==0;){var d=a[o];if(!r(n[d],i[d]))return!1}return!0}return n!==n&&i!==i}})),f=ue(Ir(),1);const Ye=(0,f.createContext)({dragDropManager:void 0});function R(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var qe=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),fe=function(){return Math.random().toString(36).substring(7).split("").join(".")},$e={INIT:"@@redux/INIT"+fe(),REPLACE:"@@redux/REPLACE"+fe(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+fe()}};function wr(e){if(typeof e!="object"||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xe(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw Error(R(0));if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),r!==void 0){if(typeof r!="function")throw Error(R(1));return r(Xe)(e,t)}if(typeof e!="function")throw Error(R(2));var i=e,s=t,o=[],a=o,d=!1;function h(){a===o&&(a=o.slice())}function p(){if(d)throw Error(R(3));return s}function b(l){if(typeof l!="function")throw Error(R(4));if(d)throw Error(R(5));var u=!0;return h(),a.push(l),function(){if(u){if(d)throw Error(R(6));u=!1,h();var g=a.indexOf(l);a.splice(g,1),o=null}}}function I(l){if(!wr(l))throw Error(R(7));if(l.type===void 0)throw Error(R(8));if(d)throw Error(R(9));try{d=!0,s=i(s,l)}finally{d=!1}for(var u=o=a,g=0;g<u.length;g++){var O=u[g];O()}return l}function v(l){if(typeof l!="function")throw Error(R(10));i=l,I({type:$e.REPLACE})}function c(){var l,u=b;return l={subscribe:function(g){if(typeof g!="object"||!g)throw Error(R(11));function O(){g.next&&g.next(p())}return O(),{unsubscribe:u(O)}}},l[qe]=function(){return this},l}return I({type:$e.INIT}),n={dispatch:I,subscribe:b,getState:p,replaceReducer:v},n[qe]=c,n}function y(e,t,...r){if(xr()&&t===void 0)throw Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;n=Error(t.replace(/%s/g,function(){return r[i++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function xr(){return typeof process<"u"&&!0}function Cr(e,t,r){return t.split(".").reduce((n,i)=>n&&n[i]?n[i]:r||null,e)}function Nr(e,t){return e.filter(r=>r!==t)}function Je(e){return typeof e=="object"}function Rr(e,t){let r=new Map,n=s=>{r.set(s,r.has(s)?r.get(s)+1:1)};e.forEach(n),t.forEach(n);let i=[];return r.forEach((s,o)=>{s===1&&i.push(o)}),i}function Pr(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ge="dnd-core/INIT_COORDS",J="dnd-core/BEGIN_DRAG",pe="dnd-core/PUBLISH_DRAG_SOURCE",Q="dnd-core/HOVER",Z="dnd-core/DROP",ee="dnd-core/END_DRAG";function Qe(e,t){return{type:ge,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var jr={type:ge,payload:{clientOffset:null,sourceClientOffset:null}};function _r(e){return function(t=[],r={publishSource:!0}){let{publishSource:n=!0,clientOffset:i,getSourceClientOffset:s}=r,o=e.getMonitor(),a=e.getRegistry();e.dispatch(Qe(i)),Mr(t,o,a);let d=kr(t,o);if(d==null){e.dispatch(jr);return}let h=null;if(i){if(!s)throw Error("getSourceClientOffset must be defined");Ar(s),h=s(d)}e.dispatch(Qe(i,h));let p=a.getSource(d).beginDrag(o,d);if(p!=null)return Lr(p),a.pinSource(d),{type:J,payload:{itemType:a.getSourceType(d),item:p,sourceId:d,clientOffset:i||null,sourceClientOffset:h||null,isSourcePublic:!!n}}}}function Mr(e,t,r){y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){y(r.getSource(n),"Expected sourceIds to be registered.")})}function Ar(e){y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Lr(e){y(Je(e),"Item must be an object.")}function kr(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Hr(e,i,r[i])})}return e}function Ur(e){return function(t={}){let r=e.getMonitor(),n=e.getRegistry();Br(r),Gr(r).forEach((i,s)=>{let o={type:Z,payload:{dropResult:Fr({},t,zr(i,s,n,r))}};e.dispatch(o)})}}function Br(e){y(e.isDragging(),"Cannot call drop while not dragging."),y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function zr(e,t,r,n){let i=r.getTarget(e),s=i?i.drop(n,e):void 0;return Wr(s),s===void 0&&(s=t===0?{}:n.getDropResult()),s}function Wr(e){y(e===void 0||Je(e),"Drop result must either be an object or undefined.")}function Gr(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Kr(e){return function(){let t=e.getMonitor(),r=e.getRegistry();Vr(t);let n=t.getSourceId();return n!=null&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:ee}}}function Vr(e){y(e.isDragging(),"Cannot call endDrag while not dragging.")}function ve(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Yr(e){return function(t,{clientOffset:r}={}){qr(t);let n=t.slice(0),i=e.getMonitor(),s=e.getRegistry();return Xr(n,s,i.getItemType()),$r(n,i,s),Jr(n,i,s),{type:Q,payload:{targetIds:n,clientOffset:r||null}}}}function qr(e){y(Array.isArray(e),"Expected targetIds to be an array.")}function $r(e,t,r){y(t.isDragging(),"Cannot call hover while not dragging."),y(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){let i=e[n];y(e.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array."),y(r.getTarget(i),"Expected targetIds to be registered.")}}function Xr(e,t,r){for(let n=e.length-1;n>=0;n--){let i=e[n];ve(t.getTargetType(i),r)||e.splice(n,1)}}function Jr(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Qr(e){return function(){if(e.getMonitor().isDragging())return{type:pe}}}function Zr(e){return{beginDrag:_r(e),publishDragSource:Qr(e),hover:Yr(e),drop:Ur(e),endDrag:Kr(e)}}var en=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function r(i){return(...s)=>{let o=i.apply(e,s);o!==void 0&&t(o)}}let n=Zr(this);return Object.keys(n).reduce((i,s)=>{let o=n[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function tn(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Ze(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rn(e){let{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Ze(tn(t,n),r)}function nn(e){let{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Ze(t,r)}const V=[],me=[];V.__IS_NONE__=!0,me.__IS_ALL__=!0;function sn(e,t){return e===V?!1:e===me||t===void 0?!0:Pr(t,e).length>0}var on=class{subscribeToStateChange(e,t={}){let{handlerIds:r}=t;y(typeof e=="function","listener must be a function."),y(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let n=this.store.getState().stateId;return this.store.subscribe(()=>{let i=this.store.getState(),s=i.stateId;try{s===n||s===n+1&&!sn(i.dirtyHandlerIds,r)||e()}finally{n=s}})}subscribeToOffsetChange(e){y(typeof e=="function","listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let r=this.store.getState().dragOffset;r!==t&&(t=r,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return y(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return y(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return y(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:r}=t;if(!this.isDragging())return!1;let n=this.registry.getTargetType(e),i=this.getItemType();if(i&&!ve(n,i))return!1;let s=this.getTargetIds();if(!s.length)return!1;let o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return rn(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return nn(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},et=typeof global<"u"?global:self,tt=et.MutationObserver||et.WebKitMutationObserver;function rt(e){return function(){let t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}function an(e){let t=1,r=new tt(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const ln=typeof tt=="function"?an:rt;var dn=class{enqueueTask(e){let{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let r=0,n=e.length-this.index;r<n;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ln(this.flush),this.requestErrorThrow=rt(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},cn=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},un=class{create(e){let t=this.freeTasks,r=t.length?t.pop():new cn(this.onError,n=>t[t.length]=n);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}},nt=new dn,hn=new un(nt.registerPendingError);function fn(e){nt.enqueueTask(hn.create(e))}const ye="dnd-core/ADD_SOURCE",Oe="dnd-core/ADD_TARGET",Ie="dnd-core/REMOVE_SOURCE",te="dnd-core/REMOVE_TARGET";function gn(e){return{type:ye,payload:{sourceId:e}}}function pn(e){return{type:Oe,payload:{targetId:e}}}function vn(e){return{type:Ie,payload:{sourceId:e}}}function mn(e){return{type:te,payload:{targetId:e}}}function yn(e){y(typeof e.canDrag=="function","Expected canDrag to be a function."),y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function On(e){y(typeof e.canDrop=="function","Expected canDrop to be a function."),y(typeof e.hover=="function","Expected hover to be a function."),y(typeof e.drop=="function","Expected beginDrag to be a function.")}function be(e,t){if(t&&Array.isArray(e)){e.forEach(r=>be(r,!1));return}y(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var P;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(P||(P={}));var In=0;function bn(){return In++}function Sn(e){let t=bn().toString();switch(e){case P.SOURCE:return`S${t}`;case P.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function it(e){switch(e[0]){case"S":return P.SOURCE;case"T":return P.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function st(e,t){let r=e.entries(),n=!1;do{let{done:i,value:[,s]}=r.next();if(s===t)return!0;n=!!i}while(!n);return!1}var Dn=class{addSource(e,t){be(e),yn(t);let r=this.addHandler(P.SOURCE,e,t);return this.store.dispatch(gn(r)),r}addTarget(e,t){be(e,!0),On(t);let r=this.addHandler(P.TARGET,e,t);return this.store.dispatch(pn(r)),r}containsHandler(e){return st(this.dragSources,e)||st(this.dropTargets,e)}getSource(e,t=!1){return y(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return y(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return y(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return y(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return it(e)===P.SOURCE}isTargetId(e){return it(e)===P.TARGET}removeSource(e){y(this.getSource(e),"Expected an existing source."),this.store.dispatch(vn(e)),fn(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){y(this.getTarget(e),"Expected an existing target."),this.store.dispatch(mn(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);y(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){let n=Sn(e);return this.types.set(n,t),e===P.SOURCE?this.dragSources.set(n,r):e===P.TARGET&&this.dropTargets.set(n,r),n}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}};const Tn=(e,t)=>e===t;function En(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function wn(e,t,r=Tn){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function xn(e=V,t){switch(t.type){case Q:break;case ye:case Oe:case te:case Ie:return V;case J:case pe:case ee:case Z:default:return me}let{targetIds:r=[],prevTargetIds:n=[]}=t.payload,i=Rr(r,n);if(!(i.length>0||!wn(r,n)))return V;let s=n[n.length-1],o=r[r.length-1];return s!==o&&(s&&i.push(s),o&&i.push(o)),i}function Cn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Cn(e,i,r[i])})}return e}var ot={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Rn(e=ot,t){let{payload:r}=t;switch(t.type){case ge:case J:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Q:return En(e.clientOffset,r.clientOffset)?e:Nn({},e,{clientOffset:r.clientOffset});case ee:case Z:return ot;default:return e}}function Pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Pn(e,i,r[i])})}return e}var jn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function _n(e=jn,t){let{payload:r}=t;switch(t.type){case J:return U({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case pe:return U({},e,{isSourcePublic:!0});case Q:return U({},e,{targetIds:r.targetIds});case te:return e.targetIds.indexOf(r.targetId)===-1?e:U({},e,{targetIds:Nr(e.targetIds,r.targetId)});case Z:return U({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ee:return U({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Mn(e=0,t){switch(t.type){case ye:case Oe:return e+1;case Ie:case te:return e-1;default:return e}}function An(e=0){return e+1}function Ln(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ln(e,i,r[i])})}return e}function Hn(e={},t){return{dirtyHandlerIds:xn(e.dirtyHandlerIds,{type:t.type,payload:kn({},t.payload,{prevTargetIds:Cr(e,"dragOperation.targetIds",[])})}),dragOffset:Rn(e.dragOffset,t),refCount:Mn(e.refCount,t),dragOperation:_n(e.dragOperation,t),stateId:An(e.stateId)}}function Fn(e,t=void 0,r={},n=!1){let i=Un(n),s=new en(i,new on(i,new Dn(i))),o=e(s,t,r);return s.receiveBackend(o),s}function Un(e){let t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Xe(Hn,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var m=ue(br(),1);function Bn(e,t){if(e==null)return{};var r=zn(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zn(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var at=0,re=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),lt=(0,f.memo)(function(e){var{children:t}=e;let[r,n]=Wn(Bn(e,["children"]));return(0,f.useEffect)(()=>{if(n){let i=dt();return++at,()=>{--at===0&&(i[re]=null)}}},[]),(0,m.jsx)(Ye.Provider,{value:r,children:t})});function Wn(e){return"manager"in e?[{dragDropManager:e.manager},!1]:[Gn(e.backend,e.context,e.options,e.debugMode),!e.context]}function Gn(e,t=dt(),r,n){let i=t;return i[re]||(i[re]={dragDropManager:Fn(e,t,r,n)}),i[re]}function dt(){return typeof global<"u"?global:window}const k=typeof window<"u"?f.useLayoutEffect:f.useEffect;var Kn=ue(Er(),1);function ct(e,t,r){let[n,i]=(0,f.useState)(()=>t(e)),s=(0,f.useCallback)(()=>{let o=t(e);(0,Kn.default)(n,o)||(i(o),r&&r())},[n,e,r]);return k(s),[n,s]}function Vn(e,t,r){let[n,i]=ct(e,t,r);return k(function(){let s=e.getHandlerId();if(s!=null)return e.subscribeToStateChange(i,{handlerIds:[s]})},[e,i]),n}function ut(e,t,r){return Vn(t,e||(()=>({})),()=>r.reconnect())}function ht(e,t){let r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),(0,f.useMemo)(()=>typeof e=="function"?e():e,r)}function Yn(e){return(0,f.useMemo)(()=>e.hooks.dragSource(),[e])}function qn(e){return(0,f.useMemo)(()=>e.hooks.dragPreview(),[e])}var Se=!1,De=!1,$n=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){y(!Se,"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 Se=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Se=!1}}isDragging(){if(!this.sourceId)return!1;y(!De,"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 De=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{De=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},Te=!1,Xn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;y(!Te,"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 Te=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Te=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function Jn(e,t,r){let n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function Qn(e,t,r){let n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function Ee(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;let s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;let a=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<s.length;d++){let h=s[d];if(!a(h))return!1;let p=e[h],b=t[h];if(i=r?r.call(n,p,b,h):void 0,i===!1||i===void 0&&p!==b)return!1}return!0}function we(e){return typeof e=="object"&&!!e&&Object.prototype.hasOwnProperty.call(e,"current")}function Zn(e){if(typeof e.type=="string")return;let t=e.type.displayName||e.type.name||"the component";throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function ei(e){return(t=null,r=null)=>{if(!(0,f.isValidElement)(t)){let i=t;return e(i,r),i}let n=t;return Zn(n),ti(n,r?i=>e(i,r):e)}}function ft(e){let t={};return Object.keys(e).forEach(r=>{let n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{let i=ei(n);t[r]=()=>i}}),t}function gt(e,t){typeof e=="function"?e(t):e.current=t}function ti(e,t){let r=e.ref;return y(typeof r!="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"),r?(0,f.cloneElement)(e,{ref:n=>{gt(r,n),gt(t,n)}}):(0,f.cloneElement)(e,{ref:t})}var ri=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Ee(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Ee(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe=(this.dragSourceUnsubscribe(),void 0))}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=ft({dragSource:(t,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,we(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,we(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},ni=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Ee(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget=(this.unsubscribeDropTarget(),void 0))}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=ft({dropTarget:(t,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,we(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function A(){let{dragDropManager:e}=(0,f.useContext)(Ye);return y(e!=null,"Expected drag drop context"),e}function ii(e,t){let r=A(),n=(0,f.useMemo)(()=>new ri(r.getBackend()),[r]);return k(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),k(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function si(){let e=A();return(0,f.useMemo)(()=>new $n(e),[e])}var oi=class{beginDrag(){let e=this.spec,t=this.monitor,r=null;return r=typeof e.item=="object"?e.item:typeof e.item=="function"?e.item(t):{},r??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){let r=this.spec,n=this.monitor,{isDragging:i}=r;return i?i(n):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,r=this.connector,{end:n}=e;n&&n(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}};function ai(e,t,r){let n=(0,f.useMemo)(()=>new oi(e,t,r),[t,r]);return(0,f.useEffect)(()=>{n.spec=e},[e]),n}function li(e){return(0,f.useMemo)(()=>{let t=e.type;return y(t!=null,"spec.type must be defined"),t},[e])}function di(e,t,r){let n=A(),i=ai(e,t,r),s=li(e);k(function(){if(s!=null){let[o,a]=Qn(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),a}},[n,t,r,i,s])}function ci(e,t){let r=ht(e,t);y(!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)");let n=si(),i=ii(r.options,r.previewOptions);return di(r,n,i),[ut(r.collect,n,i),Yn(i),qn(i)]}function ui(e){let t=A().getMonitor(),[r,n]=ct(t,e);return(0,f.useEffect)(()=>t.subscribeToOffsetChange(n)),(0,f.useEffect)(()=>t.subscribeToStateChange(n)),r}function hi(e){return(0,f.useMemo)(()=>e.hooks.dropTarget(),[e])}function fi(e){let t=A(),r=(0,f.useMemo)(()=>new ni(t.getBackend()),[t]);return k(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function gi(){let e=A();return(0,f.useMemo)(()=>new Xn(e),[e])}function pi(e){let{accept:t}=e;return(0,f.useMemo)(()=>(y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}var vi=class{canDrop(){let e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function mi(e,t){let r=(0,f.useMemo)(()=>new vi(e,t),[t]);return(0,f.useEffect)(()=>{r.spec=e},[e]),r}function yi(e,t,r){let n=A(),i=mi(e,t),s=pi(e);k(function(){let[o,a]=Jn(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),a},[n,t,i,r,s.map(o=>o.toString()).join("|")])}function pt(e,t){let r=ht(e,t),n=gi(),i=fi(r.options);return yi(r,n,i),[ut(r.collect,n,i),hi(i)]}function vt(e){let t=null;return()=>(t??(t=e()),t)}function Oi(e,t){return e.filter(r=>r!==t)}function Ii(e,t){let r=new Set,n=s=>r.add(s);e.forEach(n),t.forEach(n);let i=[];return r.forEach(s=>i.push(s)),i}var bi=class{enter(e){let t=this.entered.length;return this.entered=Ii(this.entered.filter(r=>this.isNodeInDocument(r)&&(!r.contains||r.contains(e))),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Oi(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},Si=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(r=>{let n=this.config.exposeProperties[r];n!=null&&(t[r]={value:n(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},mt=Ke({FILE:()=>yt,HTML:()=>bt,TEXT:()=>It,URL:()=>Ot},1);const yt="__NATIVE_FILE__",Ot="__NATIVE_URL__",It="__NATIVE_TEXT__",bt="__NATIVE_HTML__";function xe(e,t,r){return t.reduce((n,i)=>n||e.getData(i),"")??r}const Ce={[yt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[bt]:{exposeProperties:{html:(e,t)=>xe(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Ot]:{exposeProperties:{urls:(e,t)=>xe(e,t,"").split(`
1
+ import{r as Ke,s as ue,t as Or}from"./chunk-LvLJmgfZ.js";import{t as Ir}from"./react-Bj1aDYRI.js";import{t as br}from"./jsx-runtime-ZmTK25f3.js";import{d as Sr}from"./popover-B-131r4d.js";import{t as Dr}from"./extends-Dqvpuc10.js";function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},he(e,t)}function Tr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,he(e,t)}function Ve(e){if(e===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Er=Or(((e,t)=>{t.exports=function r(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var s,o,a;if(Array.isArray(n)){if(s=n.length,s!=i.length)return!1;for(o=s;o--!==0;)if(!r(n[o],i[o]))return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(a=Object.keys(n),s=a.length,s!==Object.keys(i).length)return!1;for(o=s;o--!==0;)if(!Object.prototype.hasOwnProperty.call(i,a[o]))return!1;for(o=s;o--!==0;){var d=a[o];if(!r(n[d],i[d]))return!1}return!0}return n!==n&&i!==i}})),f=ue(Ir(),1);const Ye=(0,f.createContext)({dragDropManager:void 0});function R(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var qe=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),fe=function(){return Math.random().toString(36).substring(7).split("").join(".")},$e={INIT:"@@redux/INIT"+fe(),REPLACE:"@@redux/REPLACE"+fe(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+fe()}};function wr(e){if(typeof e!="object"||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xe(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw Error(R(0));if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),r!==void 0){if(typeof r!="function")throw Error(R(1));return r(Xe)(e,t)}if(typeof e!="function")throw Error(R(2));var i=e,s=t,o=[],a=o,d=!1;function h(){a===o&&(a=o.slice())}function p(){if(d)throw Error(R(3));return s}function b(l){if(typeof l!="function")throw Error(R(4));if(d)throw Error(R(5));var u=!0;return h(),a.push(l),function(){if(u){if(d)throw Error(R(6));u=!1,h();var g=a.indexOf(l);a.splice(g,1),o=null}}}function I(l){if(!wr(l))throw Error(R(7));if(l.type===void 0)throw Error(R(8));if(d)throw Error(R(9));try{d=!0,s=i(s,l)}finally{d=!1}for(var u=o=a,g=0;g<u.length;g++){var O=u[g];O()}return l}function v(l){if(typeof l!="function")throw Error(R(10));i=l,I({type:$e.REPLACE})}function c(){var l,u=b;return l={subscribe:function(g){if(typeof g!="object"||!g)throw Error(R(11));function O(){g.next&&g.next(p())}return O(),{unsubscribe:u(O)}}},l[qe]=function(){return this},l}return I({type:$e.INIT}),n={dispatch:I,subscribe:b,getState:p,replaceReducer:v},n[qe]=c,n}function y(e,t,...r){if(xr()&&t===void 0)throw Error("invariant requires an error message argument");if(!e){let n;if(t===void 0)n=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;n=Error(t.replace(/%s/g,function(){return r[i++]})),n.name="Invariant Violation"}throw n.framesToPop=1,n}}function xr(){return typeof process<"u"&&!0}function Cr(e,t,r){return t.split(".").reduce((n,i)=>n&&n[i]?n[i]:r||null,e)}function Nr(e,t){return e.filter(r=>r!==t)}function Je(e){return typeof e=="object"}function Rr(e,t){let r=new Map,n=s=>{r.set(s,r.has(s)?r.get(s)+1:1)};e.forEach(n),t.forEach(n);let i=[];return r.forEach((s,o)=>{s===1&&i.push(o)}),i}function Pr(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ge="dnd-core/INIT_COORDS",J="dnd-core/BEGIN_DRAG",pe="dnd-core/PUBLISH_DRAG_SOURCE",Q="dnd-core/HOVER",Z="dnd-core/DROP",ee="dnd-core/END_DRAG";function Qe(e,t){return{type:ge,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var jr={type:ge,payload:{clientOffset:null,sourceClientOffset:null}};function _r(e){return function(t=[],r={publishSource:!0}){let{publishSource:n=!0,clientOffset:i,getSourceClientOffset:s}=r,o=e.getMonitor(),a=e.getRegistry();e.dispatch(Qe(i)),Mr(t,o,a);let d=kr(t,o);if(d==null){e.dispatch(jr);return}let h=null;if(i){if(!s)throw Error("getSourceClientOffset must be defined");Ar(s),h=s(d)}e.dispatch(Qe(i,h));let p=a.getSource(d).beginDrag(o,d);if(p!=null)return Lr(p),a.pinSource(d),{type:J,payload:{itemType:a.getSourceType(d),item:p,sourceId:d,clientOffset:i||null,sourceClientOffset:h||null,isSourcePublic:!!n}}}}function Mr(e,t,r){y(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){y(r.getSource(n),"Expected sourceIds to be registered.")})}function Ar(e){y(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Lr(e){y(Je(e),"Item must be an object.")}function kr(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Hr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Hr(e,i,r[i])})}return e}function Ur(e){return function(t={}){let r=e.getMonitor(),n=e.getRegistry();Br(r),Gr(r).forEach((i,s)=>{let o={type:Z,payload:{dropResult:Fr({},t,zr(i,s,n,r))}};e.dispatch(o)})}}function Br(e){y(e.isDragging(),"Cannot call drop while not dragging."),y(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function zr(e,t,r,n){let i=r.getTarget(e),s=i?i.drop(n,e):void 0;return Wr(s),s===void 0&&(s=t===0?{}:n.getDropResult()),s}function Wr(e){y(e===void 0||Je(e),"Drop result must either be an object or undefined.")}function Gr(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Kr(e){return function(){let t=e.getMonitor(),r=e.getRegistry();Vr(t);let n=t.getSourceId();return n!=null&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:ee}}}function Vr(e){y(e.isDragging(),"Cannot call endDrag while not dragging.")}function ve(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function Yr(e){return function(t,{clientOffset:r}={}){qr(t);let n=t.slice(0),i=e.getMonitor(),s=e.getRegistry();return Xr(n,s,i.getItemType()),$r(n,i,s),Jr(n,i,s),{type:Q,payload:{targetIds:n,clientOffset:r||null}}}}function qr(e){y(Array.isArray(e),"Expected targetIds to be an array.")}function $r(e,t,r){y(t.isDragging(),"Cannot call hover while not dragging."),y(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n<e.length;n++){let i=e[n];y(e.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array."),y(r.getTarget(i),"Expected targetIds to be registered.")}}function Xr(e,t,r){for(let n=e.length-1;n>=0;n--){let i=e[n];ve(t.getTargetType(i),r)||e.splice(n,1)}}function Jr(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function Qr(e){return function(){if(e.getMonitor().isDragging())return{type:pe}}}function Zr(e){return{beginDrag:_r(e),publishDragSource:Qr(e),hover:Yr(e),drop:Ur(e),endDrag:Kr(e)}}var en=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function r(i){return(...s)=>{let o=i.apply(e,s);o!==void 0&&t(o)}}let n=Zr(this);return Object.keys(n).reduce((i,s)=>{let o=n[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function tn(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Ze(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rn(e){let{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Ze(tn(t,n),r)}function nn(e){let{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Ze(t,r)}const V=[],me=[];V.__IS_NONE__=!0,me.__IS_ALL__=!0;function sn(e,t){return e===V?!1:e===me||t===void 0?!0:Pr(t,e).length>0}var on=class{subscribeToStateChange(e,t={}){let{handlerIds:r}=t;y(typeof e=="function","listener must be a function."),y(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let n=this.store.getState().stateId;return this.store.subscribe(()=>{let i=this.store.getState(),s=i.stateId;try{s===n||s===n+1&&!sn(i.dirtyHandlerIds,r)||e()}finally{n=s}})}subscribeToOffsetChange(e){y(typeof e=="function","listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let r=this.store.getState().dragOffset;r!==t&&(t=r,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return y(t,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return y(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return y(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:r}=t;if(!this.isDragging())return!1;let n=this.registry.getTargetType(e),i=this.getItemType();if(i&&!ve(n,i))return!1;let s=this.getTargetIds();if(!s.length)return!1;let o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return rn(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return nn(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},et=typeof global<"u"?global:self,tt=et.MutationObserver||et.WebKitMutationObserver;function rt(e){return function(){let t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}function an(e){let t=1,r=new tt(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const ln=typeof tt=="function"?an:rt;var dn=class{enqueueTask(e){let{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let r=0,n=e.length-this.index;r<n;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ln(this.flush),this.requestErrorThrow=rt(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},cn=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},un=class{create(e){let t=this.freeTasks,r=t.length?t.pop():new cn(this.onError,n=>t[t.length]=n);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}},nt=new dn,hn=new un(nt.registerPendingError);function fn(e){nt.enqueueTask(hn.create(e))}const ye="dnd-core/ADD_SOURCE",Oe="dnd-core/ADD_TARGET",Ie="dnd-core/REMOVE_SOURCE",te="dnd-core/REMOVE_TARGET";function gn(e){return{type:ye,payload:{sourceId:e}}}function pn(e){return{type:Oe,payload:{targetId:e}}}function vn(e){return{type:Ie,payload:{sourceId:e}}}function mn(e){return{type:te,payload:{targetId:e}}}function yn(e){y(typeof e.canDrag=="function","Expected canDrag to be a function."),y(typeof e.beginDrag=="function","Expected beginDrag to be a function."),y(typeof e.endDrag=="function","Expected endDrag to be a function.")}function On(e){y(typeof e.canDrop=="function","Expected canDrop to be a function."),y(typeof e.hover=="function","Expected hover to be a function."),y(typeof e.drop=="function","Expected beginDrag to be a function.")}function be(e,t){if(t&&Array.isArray(e)){e.forEach(r=>be(r,!1));return}y(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var P;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(P||(P={}));var In=0;function bn(){return In++}function Sn(e){let t=bn().toString();switch(e){case P.SOURCE:return`S${t}`;case P.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function it(e){switch(e[0]){case"S":return P.SOURCE;case"T":return P.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function st(e,t){let r=e.entries(),n=!1;do{let{done:i,value:[,s]}=r.next();if(s===t)return!0;n=!!i}while(!n);return!1}var Dn=class{addSource(e,t){be(e),yn(t);let r=this.addHandler(P.SOURCE,e,t);return this.store.dispatch(gn(r)),r}addTarget(e,t){be(e,!0),On(t);let r=this.addHandler(P.TARGET,e,t);return this.store.dispatch(pn(r)),r}containsHandler(e){return st(this.dragSources,e)||st(this.dropTargets,e)}getSource(e,t=!1){return y(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return y(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return y(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return y(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return it(e)===P.SOURCE}isTargetId(e){return it(e)===P.TARGET}removeSource(e){y(this.getSource(e),"Expected an existing source."),this.store.dispatch(vn(e)),fn(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){y(this.getTarget(e),"Expected an existing target."),this.store.dispatch(mn(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);y(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){let n=Sn(e);return this.types.set(n,t),e===P.SOURCE?this.dragSources.set(n,r):e===P.TARGET&&this.dropTargets.set(n,r),n}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}};const Tn=(e,t)=>e===t;function En(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function wn(e,t,r=Tn){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function xn(e=V,t){switch(t.type){case Q:break;case ye:case Oe:case te:case Ie:return V;case J:case pe:case ee:case Z:default:return me}let{targetIds:r=[],prevTargetIds:n=[]}=t.payload,i=Rr(r,n);if(!(i.length>0||!wn(r,n)))return V;let s=n[n.length-1],o=r[r.length-1];return s!==o&&(s&&i.push(s),o&&i.push(o)),i}function Cn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Cn(e,i,r[i])})}return e}var ot={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Rn(e=ot,t){let{payload:r}=t;switch(t.type){case ge:case J:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Q:return En(e.clientOffset,r.clientOffset)?e:Nn({},e,{clientOffset:r.clientOffset});case ee:case Z:return ot;default:return e}}function Pn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Pn(e,i,r[i])})}return e}var jn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function _n(e=jn,t){let{payload:r}=t;switch(t.type){case J:return U({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case pe:return U({},e,{isSourcePublic:!0});case Q:return U({},e,{targetIds:r.targetIds});case te:return e.targetIds.indexOf(r.targetId)===-1?e:U({},e,{targetIds:Nr(e.targetIds,r.targetId)});case Z:return U({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ee:return U({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Mn(e=0,t){switch(t.type){case ye:case Oe:return e+1;case Ie:case te:return e-1;default:return e}}function An(e=0){return e+1}function Ln(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ln(e,i,r[i])})}return e}function Hn(e={},t){return{dirtyHandlerIds:xn(e.dirtyHandlerIds,{type:t.type,payload:kn({},t.payload,{prevTargetIds:Cr(e,"dragOperation.targetIds",[])})}),dragOffset:Rn(e.dragOffset,t),refCount:Mn(e.refCount,t),dragOperation:_n(e.dragOperation,t),stateId:An(e.stateId)}}function Fn(e,t=void 0,r={},n=!1){let i=Un(n),s=new en(i,new on(i,new Dn(i))),o=e(s,t,r);return s.receiveBackend(o),s}function Un(e){let t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Xe(Hn,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var m=ue(br(),1);function Bn(e,t){if(e==null)return{};var r=zn(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zn(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var at=0,re=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),lt=(0,f.memo)(function(e){var{children:t}=e;let[r,n]=Wn(Bn(e,["children"]));return(0,f.useEffect)(()=>{if(n){let i=dt();return++at,()=>{--at===0&&(i[re]=null)}}},[]),(0,m.jsx)(Ye.Provider,{value:r,children:t})});function Wn(e){return"manager"in e?[{dragDropManager:e.manager},!1]:[Gn(e.backend,e.context,e.options,e.debugMode),!e.context]}function Gn(e,t=dt(),r,n){let i=t;return i[re]||(i[re]={dragDropManager:Fn(e,t,r,n)}),i[re]}function dt(){return typeof global<"u"?global:window}const k=typeof window<"u"?f.useLayoutEffect:f.useEffect;var Kn=ue(Er(),1);function ct(e,t,r){let[n,i]=(0,f.useState)(()=>t(e)),s=(0,f.useCallback)(()=>{let o=t(e);(0,Kn.default)(n,o)||(i(o),r&&r())},[n,e,r]);return k(s),[n,s]}function Vn(e,t,r){let[n,i]=ct(e,t,r);return k(function(){let s=e.getHandlerId();if(s!=null)return e.subscribeToStateChange(i,{handlerIds:[s]})},[e,i]),n}function ut(e,t,r){return Vn(t,e||(()=>({})),()=>r.reconnect())}function ht(e,t){let r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),(0,f.useMemo)(()=>typeof e=="function"?e():e,r)}function Yn(e){return(0,f.useMemo)(()=>e.hooks.dragSource(),[e])}function qn(e){return(0,f.useMemo)(()=>e.hooks.dragPreview(),[e])}var Se=!1,De=!1,$n=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){y(!Se,"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 Se=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Se=!1}}isDragging(){if(!this.sourceId)return!1;y(!De,"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 De=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{De=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},Te=!1,Xn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;y(!Te,"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 Te=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Te=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function Jn(e,t,r){let n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function Qn(e,t,r){let n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function Ee(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;let s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;let a=Object.prototype.hasOwnProperty.bind(t);for(let d=0;d<s.length;d++){let h=s[d];if(!a(h))return!1;let p=e[h],b=t[h];if(i=r?r.call(n,p,b,h):void 0,i===!1||i===void 0&&p!==b)return!1}return!0}function we(e){return typeof e=="object"&&!!e&&Object.prototype.hasOwnProperty.call(e,"current")}function Zn(e){if(typeof e.type=="string")return;let t=e.type.displayName||e.type.name||"the component";throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function ei(e){return(t=null,r=null)=>{if(!(0,f.isValidElement)(t)){let i=t;return e(i,r),i}let n=t;return Zn(n),ti(n,r?i=>e(i,r):e)}}function ft(e){let t={};return Object.keys(e).forEach(r=>{let n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{let i=ei(n);t[r]=()=>i}}),t}function gt(e,t){typeof e=="function"?e(t):e.current=t}function ti(e,t){let r=e.ref;return y(typeof r!="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"),r?(0,f.cloneElement)(e,{ref:n=>{gt(r,n),gt(t,n)}}):(0,f.cloneElement)(e,{ref:t})}var ri=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Ee(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Ee(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe=(this.dragSourceUnsubscribe(),void 0))}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=ft({dragSource:(t,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,we(t)?this.dragSourceRef=t:this.dragSourceNode=t,this.reconnectDragSource()},dragPreview:(t,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,we(t)?this.dragPreviewRef=t:this.dragPreviewNode=t,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},ni=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Ee(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget=(this.unsubscribeDropTarget(),void 0))}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=ft({dropTarget:(t,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,we(t)?this.dropTargetRef=t:this.dropTargetNode=t,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function A(){let{dragDropManager:e}=(0,f.useContext)(Ye);return y(e!=null,"Expected drag drop context"),e}function ii(e,t){let r=A(),n=(0,f.useMemo)(()=>new ri(r.getBackend()),[r]);return k(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),k(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function si(){let e=A();return(0,f.useMemo)(()=>new $n(e),[e])}var oi=class{beginDrag(){let e=this.spec,t=this.monitor,r=null;return r=typeof e.item=="object"?e.item:typeof e.item=="function"?e.item(t):{},r??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(t):!0}isDragging(e,t){let r=this.spec,n=this.monitor,{isDragging:i}=r;return i?i(n):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,r=this.connector,{end:n}=e;n&&n(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}};function ai(e,t,r){let n=(0,f.useMemo)(()=>new oi(e,t,r),[t,r]);return(0,f.useEffect)(()=>{n.spec=e},[e]),n}function li(e){return(0,f.useMemo)(()=>{let t=e.type;return y(t!=null,"spec.type must be defined"),t},[e])}function di(e,t,r){let n=A(),i=ai(e,t,r),s=li(e);k(function(){if(s!=null){let[o,a]=Qn(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),a}},[n,t,r,i,s])}function ci(e,t){let r=ht(e,t);y(!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)");let n=si(),i=ii(r.options,r.previewOptions);return di(r,n,i),[ut(r.collect,n,i),Yn(i),qn(i)]}function ui(e){let t=A().getMonitor(),[r,n]=ct(t,e);return(0,f.useEffect)(()=>t.subscribeToOffsetChange(n)),(0,f.useEffect)(()=>t.subscribeToStateChange(n)),r}function hi(e){return(0,f.useMemo)(()=>e.hooks.dropTarget(),[e])}function fi(e){let t=A(),r=(0,f.useMemo)(()=>new ni(t.getBackend()),[t]);return k(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function gi(){let e=A();return(0,f.useMemo)(()=>new Xn(e),[e])}function pi(e){let{accept:t}=e;return(0,f.useMemo)(()=>(y(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}var vi=class{canDrop(){let e=this.spec,t=this.monitor;return e.canDrop?e.canDrop(t.getItem(),t):!0}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function mi(e,t){let r=(0,f.useMemo)(()=>new vi(e,t),[t]);return(0,f.useEffect)(()=>{r.spec=e},[e]),r}function yi(e,t,r){let n=A(),i=mi(e,t),s=pi(e);k(function(){let[o,a]=Jn(s,i,n);return t.receiveHandlerId(o),r.receiveHandlerId(o),a},[n,t,i,r,s.map(o=>o.toString()).join("|")])}function pt(e,t){let r=ht(e,t),n=gi(),i=fi(r.options);return yi(r,n,i),[ut(r.collect,n,i),hi(i)]}function vt(e){let t=null;return()=>(t??(t=e()),t)}function Oi(e,t){return e.filter(r=>r!==t)}function Ii(e,t){let r=new Set,n=s=>r.add(s);e.forEach(n),t.forEach(n);let i=[];return r.forEach(s=>i.push(s)),i}var bi=class{enter(e){let t=this.entered.length;return this.entered=Ii(this.entered.filter(r=>this.isNodeInDocument(r)&&(!r.contains||r.contains(e))),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Oi(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},Si=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(r=>{let n=this.config.exposeProperties[r];n!=null&&(t[r]={value:n(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},mt=Ke({FILE:()=>yt,HTML:()=>bt,TEXT:()=>It,URL:()=>Ot},1);const yt="__NATIVE_FILE__",Ot="__NATIVE_URL__",It="__NATIVE_TEXT__",bt="__NATIVE_HTML__";function xe(e,t,r){return t.reduce((n,i)=>n||e.getData(i),"")??r}const Ce={[yt]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[bt]:{exposeProperties:{html:(e,t)=>xe(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[Ot]:{exposeProperties:{urls:(e,t)=>xe(e,t,"").split(`
2
2
  `),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[It]:{exposeProperties:{text:(e,t)=>xe(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Di(e,t){let r=Ce[e];if(!r)throw Error(`native type ${e} has no configuration`);let n=new Si(r);return n.loadDataTransfer(t),n}function Ne(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ce).filter(r=>{let n=Ce[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Ti=vt(()=>/firefox/i.test(navigator.userAgent)),St=vt(()=>!!window.safari);var Dt=class{interpolate(e){let{xs:t,ys:r,c1s:n,c2s:i,c3s:s}=this,o=t.length-1;if(e===t[o])return r[o];let a=0,d=s.length-1,h;for(;a<=d;){h=Math.floor(.5*(a+d));let I=t[h];if(I<e)a=h+1;else if(I>e)d=h-1;else return r[h]}o=Math.max(0,d);let p=e-t[o],b=p*p;return r[o]+n[o]*p+i[o]*b+s[o]*p*b}constructor(e,t){let{length:r}=e,n=[];for(let v=0;v<r;v++)n.push(v);n.sort((v,c)=>e[v]<e[c]?-1:1);let i=[],s=[],o=[],a,d;for(let v=0;v<r-1;v++)a=e[v+1]-e[v],d=t[v+1]-t[v],s.push(a),i.push(d),o.push(d/a);let h=[o[0]];for(let v=0;v<s.length-1;v++){let c=o[v],l=o[v+1];if(c*l<=0)h.push(0);else{a=s[v];let u=s[v+1],g=a+u;h.push(3*g/((g+u)/c+(g+a)/l))}}h.push(o[o.length-1]);let p=[],b=[],I;for(let v=0;v<h.length-1;v++){I=o[v];let c=h[v],l=1/s[v],u=c+h[v+1]-I-I;p.push((I-c-u)*l),b.push(u*l*l)}this.xs=e,this.ys=t,this.c1s=h,this.c2s=p,this.c3s=b}},Ei=1;function Tt(e){let t=e.nodeType===Ei?e:e.parentElement;if(!t)return null;let{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function ne(e){return{x:e.clientX,y:e.clientY}}function wi(e){var t;return e.nodeName==="IMG"&&(Ti()||!((t=document.documentElement)!=null&&t.contains(e)))}function xi(e,t,r,n){let i=e?t.width:r,s=e?t.height:n;return St()&&e&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function Ci(e,t,r,n,i){let s=wi(t),o=Tt(s?e:t),a={x:r.x-o.x,y:r.y-o.y},{offsetWidth:d,offsetHeight:h}=e,{anchorX:p,anchorY:b}=n,{dragPreviewWidth:I,dragPreviewHeight:v}=xi(s,t,d,h),c=()=>{let D=new Dt([0,.5,1],[a.y,a.y/h*v,a.y+v-h]).interpolate(b);return St()&&s&&(D+=(window.devicePixelRatio-1)*v),D},l=()=>new Dt([0,.5,1],[a.x,a.x/d*I,a.x+I-d]).interpolate(p),{offsetX:u,offsetY:g}=i,O=u===0||u,S=g===0||g;return{x:O?u:l(),y:S?g:c()}}var Ni=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;if((e=this.globalContext)!=null&&e.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.optionsArgs)==null?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function Ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t],n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable}))),n.forEach(function(i){Ri(e,i,r[i])})}return e}var Pi=class{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)==null?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((t=this.dragOverTargetIds)==null?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)==null||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);let n=s=>this.handleDragStart(s,e),i=s=>this.handleSelectStart(s);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",n),t.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",n),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}connectDropTarget(e,t){let r=s=>this.handleDragEnter(s,e),n=s=>this.handleDragOver(s,e),i=s=>this.handleDrop(s,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",n),t.addEventListener("drop",i),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",n),t.removeEventListener("drop",i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Et({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return Et({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(mt).some(t=>mt[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=Di(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>{var t;return(t=this.rootElement)==null?void 0:t.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=n=>{let i=this.sourceNodes.get(n);return i&&Tt(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=n=>!!(n&&this.document&&this.document.body&&this.document.body.contains(n)),this.endDragIfSourceWasRemovedFromDOM=()=>{let n=this.currentDragSourceNode;n==null||this.isNodeInDocument(n)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=n=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(n||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=n=>{if(n.defaultPrevented)return;let{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;let s=ne(n);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});let{dataTransfer:o}=n,a=Ne(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){let h=this.monitor.getSourceId(),p=this.sourceNodes.get(h),b=this.sourcePreviewNodes.get(h)||p;if(b){let{anchorX:I,anchorY:v,offsetX:c,offsetY:l}=this.getCurrentSourcePreviewNodeOptions(),u=Ci(p,b,s,{anchorX:I,anchorY:v},{offsetX:c,offsetY:l});o.setDragImage(b,u.x,u.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(n.target);let{captureDraggingState:d}=this.getCurrentSourcePreviewNodeOptions();d?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(a)this.beginDragNativeItem(a);else{if(o&&!o.types&&(n.target&&!n.target.hasAttribute||!n.target.hasAttribute("draggable")))return;n.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=n=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)==null||i.loadDataTransfer(n.dataTransfer)}if(!this.enterLeaveCounter.enter(n.target)||this.monitor.isDragging())return;let{dataTransfer:s}=n,o=Ne(s);o&&this.beginDragNativeItem(o,s)},this.handleTopDragEnter=n=>{let{dragEnterTargetIds:i}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=n.altKey,i.length>0&&this.actions.hover(i,{clientOffset:ne(n)}),i.some(s=>this.monitor.canDropOnTarget(s))&&(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=n=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)==null||i.loadDataTransfer(n.dataTransfer)}},this.handleTopDragOver=n=>{let{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none");return}this.altKeyPressed=n.altKey,this.lastClientOffset=ne(n),this.scheduleHover(i),(i||[]).some(s=>this.monitor.canDropOnTarget(s))?(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?n.preventDefault():(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=n=>{this.isDraggingNativeItem()&&n.preventDefault(),this.enterLeaveCounter.leave(n.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=n=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;n.preventDefault(),(i=this.currentNativeSource)==null||i.loadDataTransfer(n.dataTransfer)}else Ne(n.dataTransfer)&&n.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=n=>{let{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:ne(n)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=n=>{let i=n.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(n.preventDefault(),i.dragDrop()))},this.options=new Ni(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new bi(this.isNodeInDocument)}},ie;function ji(){return ie||(ie=new Image,ie.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ie}const wt=function(e,t,r){return new Pi(e,t,r)},xt=(0,f.createContext)(null);function N(){let e=(0,f.useContext)(xt);if(e===null)throw Error("No Tree Api Provided");return e}const Ct=(0,f.createContext)(null);function _i(){let e=(0,f.useContext)(Ct);if(e===null)throw Error("Provide a NodesContext");return e}const Nt=(0,f.createContext)(null);function Mi(){let e=(0,f.useContext)(Nt);if(e===null)throw Error("Provide a DnDContext");return e}const Rt=(0,f.createContext)(0);function Pt(){(0,f.useContext)(Rt)}var Ai=Ke({access:()=>Y,bound:()=>se,dfs:()=>Re,focusNextElement:()=>kt,focusPrevElement:()=>Ht,getInsertIndex:()=>Wt,getInsertParentId:()=>Gt,identify:()=>H,identifyNull:()=>Ut,indexOf:()=>Lt,isClosed:()=>_t,isDescendant:()=>At,isItem:()=>jt,isOpenWithEmptyChildren:()=>Mt,mergeRefs:()=>Fi,noop:()=>Li,safeRun:()=>Bt,waitFor:()=>zt,walk:()=>oe},1);function se(e,t,r){return Math.max(Math.min(e,r),t)}function jt(e){return e&&e.isLeaf}function _t(e){return e&&e.isInternal&&!e.isOpen}function Mt(e){var t;return e&&e.isOpen&&!((t=e.children)!=null&&t.length)}const At=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Lt=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Li(){}function Re(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){let n=Re(r,t);if(n)return n}return null}function oe(e,t){if(t(e),e.children)for(let r of e.children)oe(r,t)}function kt(e){let t=Ft(e),r;for(let n=0;n<t.length;++n)if(t[n]===e){r=ki(t,n);break}r==null||r.focus()}function Ht(e){let t=Ft(e),r;for(let n=0;n<t.length;++n)if(t[n]===e){r=Hi(t,n);break}r==null||r.focus()}function ki(e,t){return t+1<e.length?e[t+1]:e[0]}function Hi(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Ft(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function Y(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Ut(e){return e===null?null:H(e)}function H(e){return typeof e=="string"?e:e.id}function Fi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function Bt(e,...t){if(e)return e(...t)}function zt(e){return new Promise((t,r)=>{let n=0;function i(){n+=1,n===100&&r(),e()?t():setTimeout(i,10)}i()})}function Wt(e){var r;let t=e.focusedNode;return t?t.isOpen?0:t.parent?t.childIndex+1:0:((r=e.root.children)==null?void 0:r.length)??0}function Gt(e){let t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}var Ui={display:"flex",alignItems:"center",zIndex:1},Bi={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},zi={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"};const Wi=f.memo(function({top:e,left:t,indent:r}){let n={position:"absolute",pointerEvents:"none",top:e-2+"px",left:t+"px",right:r+"px"};return(0,m.jsxs)("div",{style:Object.assign(Object.assign({},Ui),n),children:[(0,m.jsx)("div",{style:Object.assign({},zi)}),(0,m.jsx)("div",{style:Object.assign({},Bi)})]})});function Gi({node:e,attrs:t,innerRef:r,children:n}){return(0,m.jsx)("div",Object.assign({},t,{ref:r,onFocus:i=>i.stopPropagation(),onClick:e.handleClick,children:n}))}function Ki(e){return(0,m.jsxs)("div",{ref:e.dragHandle,style:e.style,children:[(0,m.jsx)("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"\u{1F333}":e.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",e.node.isEditing?(0,m.jsx)(Yi,Object.assign({},e)):(0,m.jsx)(Vi,Object.assign({},e))]})}function Vi(e){return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("span",{children:e.node.data.name})})}function Yi({node:e}){let t=(0,f.useRef)();return(0,f.useEffect)(()=>{var r,n;(r=t.current)==null||r.focus(),(n=t.current)==null||n.select()},[]),(0,m.jsx)("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)==null?void 0:n.value)||"")}})}function Pe(e){return{type:"EDIT",id:e}}function qi(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function B(e){return{type:"FOCUS",id:e}}function $i(){return{type:"TREE_BLUR"}}function Xi(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}var Kt=class ur{constructor(t){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=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===je}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!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 t;return this.isSelected&&!((t=this.prev)!=null&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!((t=this.next)!=null&&t.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(t=>t.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 r;let t=this.childIndex;return((r=this.parent)==null?void 0:r.children[t+1])??null}isAncestorOf(t){if(!t)return!1;let r=t;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(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new ur(Object.assign({},this))}edit(){return this.tree.edit(this)}};const je="__REACT_ARBORIST_INTERNAL_ROOT__";function Vt(e){function t(n,i,s){let o=new Kt({tree:e,data:n,level:i,parent:s,id:e.accessId(n),children:null,isDraggable:e.isDraggable(n),rowIndex:null}),a=e.accessChildren(n);return a&&(o.children=a.map(d=>t(d,i+1,o))),o}let r=new Kt({tree:e,id:je,data:{id:je},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null});return r.children=(e.props.data??[]).map(n=>t(n,0,r)),r}const _e={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function Yt(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){let r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function Ji(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Yt(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Yt(e.unfiltered,t)}):e}const z=e=>({nodes:{open:{filtered:{},unfiltered:(e==null?void 0:e.initialOpenState)??{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}),j={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:H(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(H)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(H)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:H(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:H(e)})};function Qi(e=z().nodes.selection,t){let r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const W={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function Zi(e=z().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return z().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}var es={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},ts=e=>{if(!e)return{display:"none"};let{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},rs=e=>{if(!e)return{display:"none"};let{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function qt({offset:e,mouse:t,id:r,dragIds:n,isDragging:i}){return(0,m.jsxs)(ns,{isDragging:i,children:[(0,m.jsx)(is,{offset:e,children:(0,m.jsx)(os,{id:r,dragIds:n})}),(0,m.jsx)(ss,{mouse:t,count:n.length})]})}var ns=(0,f.memo)(function(e){return e.isDragging?(0,m.jsx)("div",{style:es,children:e.children}):null});function is(e){return(0,m.jsx)("div",{className:"row preview",style:ts(e.offset),children:e.children})}function ss(e){let{count:t,mouse:r}=e;return t>1?(0,m.jsx)("div",{className:"selected-count",style:rs(r),children:t}):null}var os=(0,f.memo)(function(e){let t=N(),r=t.get(e.id);return r?(0,m.jsx)(t.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*t.indent,opacity:.2,background:"transparent"},tree:t}):null}),$t=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function as(e,t){return!!(e===t||$t(e)&&$t(t))}function ls(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!as(e[r],t[r]))return!1;return!0}function ds(e,t){t===void 0&&(t=ls);var r,n=[],i,s=!1;function o(){var a=[...arguments];return s&&r===this&&t(a,n)||(i=e.apply(this,a),s=!0,r=this,n=a),i}return o}var Me=ds,Xt=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Jt(e){cancelAnimationFrame(e.id)}function cs(e,t){var r=Xt();function n(){Xt()-r>=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var Ae=-1;function Qt(e){if(e===void 0&&(e=!1),Ae===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ae=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ae}var q=null;function Zt(e){if(e===void 0&&(e=!1),q===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?q="positive-descending":(t.scrollLeft=1,q=t.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(t),q}return q}var us=150,hs=function(e,t){return e};function fs(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,d=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=(function(b){Tr(I,b);function I(c){var l=b.call(this,c)||this;return l._instanceProps=d(l.props,Ve(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:Ve(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=Me(function(u,g,O,S){return l.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:g,visibleStartIndex:O,visibleStopIndex:S})}),l._callOnScroll=void 0,l._callOnScroll=Me(function(u,g,O){return l.props.onScroll({scrollDirection:u,scrollOffset:g,scrollUpdateWasRequested:O})}),l._getItemStyle=void 0,l._getItemStyle=function(u){var g=l.props,O=g.direction,S=g.itemSize,D=g.layout,T=l._getItemStyleCache(h&&S,h&&D,h&&O),x;if(T.hasOwnProperty(u))x=T[u];else{var C=r(l.props,u,l._instanceProps),L=i(l.props,u,l._instanceProps),F=O==="horizontal"||D==="horizontal",$=O==="rtl",X=F?C:0;T[u]=x={position:"absolute",left:$?void 0:X,right:$?X:void 0,top:F?0:C,height:F?"100%":L,width:F?L:"100%"}}return x},l._getItemStyleCache=void 0,l._getItemStyleCache=Me(function(u,g,O){return{}}),l._onScrollHorizontal=function(u){var g=u.currentTarget,O=g.clientWidth,S=g.scrollLeft,D=g.scrollWidth;l.setState(function(T){if(T.scrollOffset===S)return null;var x=l.props.direction,C=S;if(x==="rtl")switch(Zt()){case"negative":C=-S;break;case"positive-descending":C=D-O-S;break}return C=Math.max(0,Math.min(C,D-O)),{isScrolling:!0,scrollDirection:T.scrollOffset<C?"forward":"backward",scrollOffset:C,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(u){var g=u.currentTarget,O=g.clientHeight,S=g.scrollHeight,D=g.scrollTop;l.setState(function(T){if(T.scrollOffset===D)return null;var x=Math.max(0,Math.min(D,S-O));return{isScrolling:!0,scrollDirection:T.scrollOffset<x?"forward":"backward",scrollOffset:x,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(u){var g=l.props.outerRef;l._outerRef=u,typeof g=="function"?g(u):typeof g=="object"&&g&&g.hasOwnProperty("current")&&(g.current=u)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&Jt(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=cs(l._resetIsScrolling,us)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}I.getDerivedStateFromProps=function(c,l){return gs(c,l),p(c),null};var v=I.prototype;return v.scrollTo=function(c){c=Math.max(0,c),this.setState(function(l){return l.scrollOffset===c?null:{scrollDirection:l.scrollOffset<c?"forward":"backward",scrollOffset:c,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(c,l){l===void 0&&(l="auto");var u=this.props,g=u.itemCount,O=u.layout,S=this.state.scrollOffset;c=Math.max(0,Math.min(c,g-1));var D=0;if(this._outerRef){var T=this._outerRef;D=O==="vertical"?T.scrollWidth>T.clientWidth?Qt():0:T.scrollHeight>T.clientHeight?Qt():0}this.scrollTo(s(this.props,c,l,S,this._instanceProps,D))},v.componentDidMount=function(){var c=this.props,l=c.direction,u=c.initialScrollOffset,g=c.layout;if(typeof u=="number"&&this._outerRef!=null){var O=this._outerRef;l==="horizontal"||g==="horizontal"?O.scrollLeft=u:O.scrollTop=u}this._callPropsCallbacks()},v.componentDidUpdate=function(){var c=this.props,l=c.direction,u=c.layout,g=this.state,O=g.scrollOffset;if(g.scrollUpdateWasRequested&&this._outerRef!=null){var S=this._outerRef;if(l==="horizontal"||u==="horizontal")if(l==="rtl")switch(Zt()){case"negative":S.scrollLeft=-O;break;case"positive-ascending":S.scrollLeft=O;break;default:var D=S.clientWidth;S.scrollLeft=S.scrollWidth-D-O;break}else S.scrollLeft=O;else S.scrollTop=O}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Jt(this._resetIsScrollingTimeoutId)},v.render=function(){var c=this.props,l=c.children,u=c.className,g=c.direction,O=c.height,S=c.innerRef,D=c.innerElementType,T=c.innerTagName,x=c.itemCount,C=c.itemData,L=c.itemKey,F=L===void 0?hs:L,$=c.layout,X=c.outerElementType,hr=c.outerTagName,fr=c.style,gr=c.useIsScrolling,pr=c.width,Be=this.state.isScrolling,ce=g==="horizontal"||$==="horizontal",vr=ce?this._onScrollHorizontal:this._onScrollVertical,ze=this._getRangeToRender(),mr=ze[0],yr=ze[1],We=[];if(x>0)for(var K=mr;K<=yr;K++)We.push((0,f.createElement)(l,{data:C,key:F(K,C),index:K,isScrolling:gr?Be:void 0,style:this._getItemStyle(K)}));var Ge=n(this.props,this._instanceProps);return(0,f.createElement)(X||hr||"div",{className:u,onScroll:vr,ref:this._outerRefSetter,style:Dr({position:"relative",height:O,width:pr,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:g},fr)},(0,f.createElement)(D||T||"div",{children:We,ref:S,style:{height:ce?"100%":Ge,pointerEvents:Be?"none":void 0,width:ce?Ge:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var c=this._getRangeToRender(),l=c[0],u=c[1],g=c[2],O=c[3];this._callOnItemsRendered(l,u,g,O)}if(typeof this.props.onScroll=="function"){var S=this.state,D=S.scrollDirection,T=S.scrollOffset,x=S.scrollUpdateWasRequested;this._callOnScroll(D,T,x)}},v._getRangeToRender=function(){var c=this.props,l=c.itemCount,u=c.overscanCount,g=this.state,O=g.isScrolling,S=g.scrollDirection,D=g.scrollOffset;if(l===0)return[0,0,0,0];var T=o(this.props,D,this._instanceProps),x=a(this.props,T,D,this._instanceProps),C=!O||S==="backward"?Math.max(1,u):1,L=!O||S==="forward"?Math.max(1,u):1;return[Math.max(0,T-C),Math.max(0,Math.min(l-1,x+L)),T,x]},I})(f.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var gs=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},ps=fs({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,r,n,i,s){var o=e.direction,a=e.height,d=e.itemCount,h=e.itemSize,p=e.layout,b=e.width,I=o==="horizontal"||p==="horizontal"?b:a,v=Math.max(0,d*h-I),c=Math.min(v,t*h),l=Math.max(0,t*h-I+h+s);switch(r==="smart"&&(r=n>=l-I&&n<=c+I?"auto":"center"),r){case"start":return c;case"end":return l;case"center":var u=Math.round(l+(c-l)/2);return u<Math.ceil(I/2)?0:u>v+Math.floor(I/2)?v:u;default:return n>=l&&n<=c?n:n<l?l:c}},getStartIndexForOffset:function(e,t){var r=e.itemCount,n=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(t/n)))},getStopIndexForStartIndex:function(e,t,r){var n=e.direction,i=e.height,s=e.itemCount,o=e.itemSize,a=e.layout,d=e.width,h=n==="horizontal"||a==="horizontal",p=t*o,b=h?d:i,I=Math.ceil((b+r-p)/o);return Math.max(0,Math.min(s-1,t+I-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function vs(){let e=N(),t=Mi().cursor;if(!t||t.type!=="line")return null;let r=e.indent,n=e.rowHeight*t.index+(e.props.padding??e.props.paddingTop??0),i=r*t.level,s=e.renderCursor;return(0,m.jsx)(s,{top:n,left:i,indent:r})}var ms=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const ys=(0,f.forwardRef)(function(e,t){let{children:r}=e,n=ms(e,["children"]),i=N();return(0,m.jsxs)("div",Object.assign({ref:t},n,{onClick:s=>{s.currentTarget===s.target&&i.deselectAll()},children:[(0,m.jsx)(Os,{}),r]}))});var Os=()=>{let e=N();return(0,m.jsx)("div",{style:{height:e.visibleNodes.length*e.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:(0,m.jsx)(vs,{})})},Is=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const bs=(0,f.forwardRef)(function(e,t){var{style:r}=e,n=Is(e,["style"]);let i=N(),s=i.props.padding??i.props.paddingTop??0,o=i.props.padding??i.props.paddingBottom??0;return(0,m.jsx)("div",Object.assign({ref:t,style:Object.assign(Object.assign({},r),{height:`${parseFloat(r.height)+s+o}px`})},n))});function Ss(e){let t=N(),r=t.selectedIds,[n,i,s]=ci(()=>({canDrag:()=>e.isDraggable,type:"NODE",item:()=>{let o=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(W.dragStart(e.id,o)),{id:e.id,dragIds:o}},end:()=>{t.hideCursor(),t.dispatch(W.dragEnd())}}),[r,e]);return(0,f.useEffect)(()=>{s(ji())},[s]),i}function Ds(e,t){let r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),i=t.y-Math.round(r.y),s=r.height,o=i<s/2,a=!o,d=s/4,h=i>d&&i<s-d;return{x:n,inTopHalf:o,inBottomHalf:a,inMiddle:h,atTop:!h&&o,atBottom:!h&&a}}function Ts(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function ae(e,t){return{parentId:e||null,index:t}}function G(e,t){return{type:"line",index:e,level:t}}function Es(e){return{type:"highlight",id:e}}function Le(e,t){var n;let r=e;for(;r.parent&&r.level>t;)r=r.parent;return{parentId:((n=r.parent)==null?void 0:n.id)||null,index:Lt(r)+1}}function er(e){var h;let t=Ds(e.element,e.offset),r=e.indent,n=Math.round(Math.max(0,t.x-r)/r),{node:i,nextNode:s,prevNode:o}=e,[a,d]=Ts(i,o,s,t);if(i&&i.isInternal&&t.inMiddle)return{drop:ae(i.id,null),cursor:Es(i.id)};if(!a)return{drop:ae((h=d==null?void 0:d.parent)==null?void 0:h.id,0),cursor:G(0,0)};if(jt(a)){let p=se(n,(d==null?void 0:d.level)||0,a.level);return{drop:Le(a,p),cursor:G(a.rowIndex+1,p)}}if(_t(a)){let p=se(n,(d==null?void 0:d.level)||0,a.level);return{drop:Le(a,p),cursor:G(a.rowIndex+1,p)}}if(Mt(a)){let p=se(n,0,a.level+1);return p>a.level?{drop:ae(a.id,0),cursor:G(a.rowIndex+1,p)}:{drop:Le(a,p),cursor:G(a.rowIndex+1,p)}}return{drop:ae(a==null?void 0:a.id,0),cursor:G(a.rowIndex+1,a.level+1)}}function ws(e,t){let r=N(),[n,i]=pt(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(s,o)=>{let a=o.getClientOffset();if(!e.current||!a)return;let{cursor:d,drop:h}=er({element:e.current,offset:a,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});h&&r.dispatch(W.hovering(h.parentId,h.index)),o.canDrop()?d&&r.showCursor(d):r.hideCursor()},drop:(s,o)=>{if(!o.canDrop())return null;let{parentId:a,index:d,dragIds:h}=r.state.dnd;Bt(r.props.onMove,{dragIds:h,parentId:a==="__REACT_ARBORIST_INTERNAL_ROOT__"?null:a,index:d===null?0:d,dragNodes:r.dragNodes,parentNode:r.get(a)}),r.open(a)}}),[t,e.current,r.props]);return i}function xs(e){let t=N(),r=t.at(e);if(!r)throw Error(`Could not find node for index: ${e}`);return(0,f.useMemo)(()=>{let n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Cs=f.memo(function({index:e,style:t}){Pt(),_i();let r=N(),n=xs(e),i=(0,f.useRef)(null),s=Ss(n),o=ws(i,n),a=(0,f.useCallback)(c=>{i.current=c,o(c)},[o]),d=r.indent*n.level,h=(0,f.useMemo)(()=>({paddingLeft:d}),[d]),p=(0,f.useMemo)(()=>Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(r.props.padding??r.props.paddingTop??0)}),[t,r.props.padding,r.props.paddingTop]),b={role:"treeitem","aria-level":n.level+1,"aria-selected":n.isSelected,"aria-expanded":n.isOpen,style:p,tabIndex:-1,className:r.props.rowClassName};(0,f.useEffect)(()=>{var c;!n.isEditing&&n.isFocused&&((c=i.current)==null||c.focus({preventScroll:!0}))},[n.isEditing,n.isFocused,i.current]);let I=r.renderNode,v=r.renderRow;return(0,m.jsx)(v,{node:n,innerRef:a,attrs:b,children:(0,m.jsx)(I,{node:n,tree:r,style:h,dragHandle:s})})});var ke="",tr=null;function rr(){Pt();let e=N();return(0,m.jsx)("div",{role:"tree",style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var n;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;let i=Array.from(e.selectedIds);if(i.length>1){let s=e.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=e.lastNode),e.focus(s,{scroll:!1}),e.delete(Array.from(i))}else{let s=e.focusedNode;if(s){let o=s.nextSibling,a=s.parent;e.focus(o||a,{scroll:!1}),e.delete(s)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),kt(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Ht(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();let i=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(i);return}else{if(!i)return;let s=e.focusedNode;s?s.isSelected?e.selectContiguous(i):e.selectMulti(i):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();let i=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(i);return}else{if(!i)return;let s=e.focusedNode;s?s.isSelected?e.selectContiguous(i):e.selectMulti(i):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){let i=e.focusedNode;if(!i)return;i.isInternal&&i.isOpen?e.focus(e.nextNode):i.isInternal&&e.open(i.id);return}if(t.key==="ArrowLeft"){let i=e.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?e.close(i.id):(n=i.parent)!=null&&n.isRoot||e.focus(i.parent);return}if(t.key==="a"&&t.metaKey&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){let i=e.focusedNode;if(!i||!i.isEditable||!e.props.onRename)return;setTimeout(()=>{i&&e.edit(i)});return}if(t.key===" "){t.preventDefault();let i=e.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(t.key==="*"){let i=e.focusedNode;if(!i)return;e.openSiblings(i);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(tr),ke+=t.key,tr=setTimeout(()=>{ke=""},600);let r=e.visibleNodes.find(i=>{let s=i.data.name;return typeof s=="string"?s.toLowerCase().startsWith(ke):!1});r&&e.focus(r.id)},children:(0,m.jsx)(ps,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>{var r;return((r=e.visibleNodes[t])==null?void 0:r.id)||t},outerElementType:ys,innerElementType:bs,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:Cs})})}function nr(e){return e.isFiltered?Rs(e.root,e.isMatch.bind(e)):Ns(e.root)}function Ns(e){let t=[];function r(n){var i;n.level>=0&&t.push(n),n.isOpen&&((i=n.children)==null||i.forEach(r))}return r(e),t.forEach(ir),t}function Rs(e,t){let r={},n=[];function i(o){if(!o.isRoot&&t(o)){r[o.id]=!0;let a=o.parent;for(;a;)r[a.id]=!0,a=a.parent}if(o.children)for(let a of o.children)i(a)}function s(o){var a;o.level>=0&&r[o.id]&&n.push(o),o.isOpen&&((a=o.children)==null||a.forEach(s))}return i(e),s(e),n.forEach(ir),n}function ir(e,t){e.rowIndex=t}const sr=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var He=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{h(n.next(p))}catch(b){o(b)}}function d(p){try{h(n.throw(p))}catch(b){o(b)}}function h(p){p.done?s(p.value):i(p.value).then(a,d)}h((n=n.apply(e,t||[])).next())})},{safeRun:E,identify:M,identifyNull:_}=Ai,Ps=class de{constructor(t,r,n,i){this.store=t,this.props=r,this.list=n,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Vt(this),this.visibleNodes=nr(this),this.idToIndex=sr(this.visibleNodes)}update(t){this.props=t,this.root=Vt(this),this.visibleNodes=nr(this),this.idToIndex=sr(this.visibleNodes)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){return this.props.width??300}get height(){return this.props.height??500}get indent(){return this.props.indent??24}get rowHeight(){return this.props.rowHeight??24}get overscanCount(){return this.props.overscanCount??1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){let t=this.props.searchMatch??((r,n)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(n.toLocaleLowerCase()));return r=>t(r,this.searchTerm)}accessChildren(t){return Y(t,this.props.childrenAccessor||"children")??null}accessId(t){let r=Y(t,this.props.idAccessor||"id");if(!r)throw Error("Data must contain an 'id' property or props.idAccessor must return a string");return r}get firstNode(){return this.visibleNodes[0]??null}get lastNode(){return this.visibleNodes[this.visibleNodes.length-1]??null}get focusedNode(){return this.get(this.state.nodes.focus.id)??null}get mostRecentNode(){return this.get(this.state.nodes.selection.mostRecent)??null}get nextNode(){let t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){let t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){if(t===null||r===null)return[];let n=this.indexOf(t)??0,i=this.indexOf(r);if(i===null)return[];let s=Math.min(n,i),o=Math.max(n,i);return this.visibleNodes.slice(s,o+1)}indexOf(t){let r=Ut(t);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 He(this,arguments,void 0,function*(t={}){let r=t.parentId===void 0?Gt(this):t.parentId,n=t.index??Wt(this),i=t.type??"leaf",s=yield E(this.props.onCreate,{type:i,parentId:r,index:n,parentNode:this.get(r)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(t){return He(this,void 0,void 0,function*(){if(!t)return;let r=(Array.isArray(t)?t:[t]).map(M),n=r.map(i=>this.get(i)).filter(i=>!!i);yield E(this.props.onDelete,{nodes:n,ids:r})})}edit(t){let r=M(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Pe(r)),new Promise(n=>{de.editPromise=n})}submit(t,r){return He(this,void 0,void 0,function*(){if(!t)return;let n=M(t);yield E(this.props.onRename,{id:n,name:r,node:this.get(n)}),this.dispatch(Pe(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Pe(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(t){let r=this.get(_(t));r&&E(this.props.onActivate,r)}resolveEdit(t){let r=de.editPromise;r&&r(t),de.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){let n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(B(M(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&E(this.props.onFocus,this.focusedNode)))}pageUp(){var i;let t=this.visibleStartIndex,r=this.visibleStopIndex-t,n=((i=this.focusedNode)==null?void 0:i.rowIndex)??0;n=n>t?t:Math.max(t-r,0),this.focus(this.at(n))}pageDown(){var s;let t=this.visibleStartIndex,r=this.visibleStopIndex,n=r-t,i=((s=this.focusedNode)==null?void 0:s.rowIndex)??0;i=i<r?r:Math.min(i+n,this.visibleNodes.length-1),this.focus(this.at(i))}select(t,r={}){if(!t)return;let n=r.focus!==!1,i=M(t);n&&this.dispatch(B(i)),this.dispatch(j.only(i)),this.dispatch(j.anchor(i)),this.dispatch(j.mostRecent(i)),this.scrollTo(i,r.align),this.focusedNode&&n&&E(this.props.onFocus,this.focusedNode),E(this.props.onSelect,this.selectedNodes)}deselect(t){if(!t)return;let r=M(t);this.dispatch(j.remove(r)),E(this.props.onSelect,this.selectedNodes)}selectMulti(t){let r=this.get(_(t));r&&(this.dispatch(B(r.id)),this.dispatch(j.add(r.id)),this.dispatch(j.anchor(r.id)),this.dispatch(j.mostRecent(r.id)),this.scrollTo(r),this.focusedNode&&E(this.props.onFocus,this.focusedNode),E(this.props.onSelect,this.selectedNodes))}selectContiguous(t){if(!t)return;let r=M(t),{anchor:n,mostRecent:i}=this.state.nodes.selection;this.dispatch(B(r)),this.dispatch(j.remove(this.nodesBetween(n,i))),this.dispatch(j.add(this.nodesBetween(n,_(r)))),this.dispatch(j.mostRecent(r)),this.scrollTo(r),this.focusedNode&&E(this.props.onFocus,this.focusedNode),E(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),E(this.props.onSelect,this.selectedNodes)}selectAll(){var t;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(B((t=this.lastNode)==null?void 0:t.id)),this.focusedNode&&E(this.props.onFocus,this.focusedNode),E(this.props.onSelect,this.selectedNodes)}setSelection(t){var s;let r=new Set((s=t.ids)==null?void 0:s.map(M)),n=_(t.anchor),i=_(t.mostRecent);this.dispatch(j.set({ids:r,anchor:n,mostRecent:i})),E(this.props.onSelect,this.selectedNodes)}get cursorParentId(){let{cursor:t}=this.state.dnd;return t.type==="highlight"?t.id:null}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){if(this.isFiltered)return!1;let t=this.get(this.state.dnd.parentId)??this.root,r=this.dragNodes,n=this.props.disableDrop;for(let i of r)if(!i||!t||i.isInternal&&At(t,i))return!1;return typeof n=="function"?!n({parentNode:t,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n=="string"?!t.data[n]:typeof n=="boolean"?!n:!0}hideCursor(){this.dispatch(W.cursor({type:"none"}))}showCursor(t){this.dispatch(W.cursor(t))}open(t){let r=_(t);r&&(this.isOpen(r)||(this.dispatch(_e.open(r,this.isFiltered)),E(this.props.onToggle,r)))}close(t){let r=_(t);r&&this.isOpen(r)&&(this.dispatch(_e.close(r,this.isFiltered)),E(this.props.onToggle,r))}toggle(t){let r=_(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){var i;let r=_(t);if(!r)return;let n=(i=Re(this.root,r))==null?void 0:i.parent;for(;n;)this.open(n.id),n=n.parent}openSiblings(t){let r=t.parent;if(!r)this.toggle(t.id);else if(r.children){let n=t.isOpen;for(let i of r.children)i.isInternal&&(n?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){oe(this.root,t=>{t.isInternal&&t.open()})}closeAll(){oe(this.root,t=>{t.isInternal&&t.close()})}scrollTo(t,r="smart"){if(!t)return;let n=M(t);return this.openParents(n),zt(()=>n in this.idToIndex).then(()=>{var i;let s=this.idToIndex[n];s!==void 0&&((i=this.list.current)==null||i.scrollToItem(s,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!((t=this.props.searchTerm)!=null&&t.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(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){if(!t)return!1;if(t==="__REACT_ARBORIST_INTERNAL_ROOT__")return!0;let r=this.props.openByDefault??!0;return this.isFiltered?this.state.nodes.open.filtered[t]??!0:this.state.nodes.open.unfiltered[t]??r}isEditable(t){return!Y(t,this.props.disableEdit||(()=>!1))}isDraggable(t){return!Y(t,this.props.disableDrag||(()=>!1))}isDragging(t){let r=_(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){let r=_(t);if(!r)return!1;let{destinationParentId:n,destinationIndex:i}=this.state.nodes.drag;return r===n&&i===null}onFocus(){let t=this.focusedNode||this.firstNode;t&&this.dispatch(B(t.id))}onBlur(){this.dispatch($i())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||rr}get renderRow(){return this.props.renderRow||Gi}get renderNode(){return this.props.children||Ki}get renderDragPreview(){return this.props.renderDragPreview||qt}get renderCursor(){return this.props.renderCursor||Wi}};function w(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var or=typeof Symbol=="function"&&Symbol.observable||"@@observable",Fe=()=>Math.random().toString(36).substring(7).split("").join("."),le={INIT:`@@redux/INIT${Fe()}`,REPLACE:`@@redux/REPLACE${Fe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Fe()}`};function js(e){if(typeof e!="object"||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ar(e,t,r){if(typeof e!="function")throw Error(w(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw Error(w(0));if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),r!==void 0){if(typeof r!="function")throw Error(w(1));return r(ar)(e,t)}let n=e,i=t,s=new Map,o=s,a=0,d=!1;function h(){o===s&&(o=new Map,s.forEach((l,u)=>{o.set(u,l)}))}function p(){if(d)throw Error(w(3));return i}function b(l){if(typeof l!="function")throw Error(w(4));if(d)throw Error(w(5));let u=!0;h();let g=a++;return o.set(g,l),function(){if(u){if(d)throw Error(w(6));u=!1,h(),o.delete(g),s=null}}}function I(l){if(!js(l))throw Error(w(7));if(l.type===void 0)throw Error(w(8));if(typeof l.type!="string")throw Error(w(17));if(d)throw Error(w(9));try{d=!0,i=n(i,l)}finally{d=!1}return(s=o).forEach(u=>{u()}),l}function v(l){if(typeof l!="function")throw Error(w(10));n=l,I({type:le.REPLACE})}function c(){let l=b;return{subscribe(u){if(typeof u!="object"||!u)throw Error(w(11));function g(){let O=u;O.next&&O.next(p())}return g(),{unsubscribe:l(g)}},[or](){return this}}}return I({type:le.INIT}),{dispatch:I,subscribe:b,getState:p,replaceReducer:v,[or]:c}}function _s(e){Object.keys(e).forEach(t=>{let r=e[t];if(r(void 0,{type:le.INIT})===void 0)throw Error(w(12));if(r(void 0,{type:le.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(w(13))})}function lr(e){let t=Object.keys(e),r={};for(let s=0;s<t.length;s++){let o=t[s];typeof e[o]=="function"&&(r[o]=e[o])}let n=Object.keys(r),i;try{_s(r)}catch(s){i=s}return function(s={},o){if(i)throw i;let a=!1,d={};for(let h=0;h<n.length;h++){let p=n[h],b=r[p],I=s[p],v=b(I,o);if(v===void 0)throw o&&o.type,Error(w(14));d[p]=v,a||(a=v!==I)}return a||(a=n.length!==Object.keys(s).length),a?d:s}}function Ms(e=z().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const As=lr({nodes:lr({focus:Xi,edit:qi,open:Ji,selection:Qi,drag:Ms}),dnd:Zi});var Ls=Sr(),ks=z();function Hs({treeProps:e,imperativeHandle:t,children:r}){let n=(0,f.useRef)(null),i=(0,f.useRef)(null),s=(0,f.useRef)(ar(As,z(e))),o=(0,Ls.useSyncExternalStore)(s.current.subscribe,s.current.getState,()=>ks),a=(0,f.useMemo)(()=>new Ps(s.current,e,n,i),[]),d=(0,f.useRef)(0);return(0,f.useMemo)(()=>{d.current+=1,a.update(e)},[...Object.values(e),o.nodes.open]),(0,f.useImperativeHandle)(t,()=>a),(0,f.useEffect)(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),(0,f.useEffect)(()=>{a.props.searchTerm||s.current.dispatch(_e.clear(!0))},[a.props.searchTerm]),(0,m.jsx)(xt.Provider,{value:a,children:(0,m.jsx)(Rt.Provider,{value:d.current,children:(0,m.jsx)(Ct.Provider,{value:o.nodes,children:(0,m.jsx)(Nt.Provider,{value:o.dnd,children:(0,m.jsx)(lt,Object.assign({backend:wt,options:{rootElement:a.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:r}))})})})})}function Fs(){let e=N(),[,t]=pt(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;let i=n.getClientOffset();if(!e.listEl.current||!i)return;let{cursor:s,drop:o}=er({element:e.listEl.current,offset:i,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(W.hovering(o.parentId,o.index)),n.canDrop()?s&&e.showCursor(s):e.hideCursor()}}),[e]);t(e.listEl)}function Us(e){return Fs(),e.children}function Bs(){return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(N().props.renderContainer||rr,{})})}function zs(){let e=N(),{offset:t,mouse:r,item:n,isDragging:i}=ui(s=>({offset:s.getSourceClientOffset(),mouse:s.getClientOffset(),item:s.getItem(),isDragging:s.isDragging()}));return(0,m.jsx)(e.props.renderDragPreview||qt,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:i})}var dr=class{constructor(e){this.root=Ws(e)}get data(){var e;return((e=this.root.children)==null?void 0:e.map(t=>t.data))??[]}create(e){let t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){let t=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;!t||!r||(r.addChild(t.data,e.index),t.drop())}update(e){let t=this.find(e.id);t&&t.update(e.changes)}drop(e){let t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let r of t.children){let n=this.find(e,r);if(n)return n}return null}return null}};function Ws(e){let t=new cr({id:"ROOT"},null);return t.children=e.map(r=>Ue(r,t)),t}function Ue(e,t){let r=new cr(e,t);return e.children&&(r.children=e.children.map(n=>Ue(n,r))),r}var cr=class{constructor(e,t){this.data=e,this.parent=t,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){let r=Ue(e,this);this.children=this.children??[],this.children.splice(t,0,r),this.data.children=this.data.children??[],this.data.children.splice(t,0,e)}removeChild(e){var t,r;(t=this.children)==null||t.splice(e,1),(r=this.data.children)==null||r.splice(e,1)}update(e){if(this.hasParent()){let t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}},Gs=0;function Ks(e){let[t,r]=(0,f.useState)(e),n=(0,f.useMemo)(()=>new dr(t),[t]);return[t,{onMove:i=>{for(let s of i.dragIds)n.move({id:s,parentId:i.parentId,index:i.index});r(n.data)},onRename:({name:i,id:s})=>{n.update({id:s,changes:{name:i}}),r(n.data)},onCreate:({parentId:i,index:s,type:o})=>{let a={id:`simple-tree-id-${Gs++}`,name:""};return o==="internal"&&(a.children=[]),n.create({parentId:i,index:s,data:a}),r(n.data),a},onDelete:i=>{i.ids.forEach(s=>n.drop({id:s})),r(n.data)}}]}function Vs(e){if(e.initialData&&e.data)throw Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
3
3
  Use the data prop if you want to provide your own handlers.`);if(e.initialData){let[t,r]=Ks(e.initialData);return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function Ys(e,t){return(0,m.jsxs)(Hs,{treeProps:Vs(e),imperativeHandle:t,children:[(0,m.jsx)(Us,{children:(0,m.jsx)(Bs,{})}),(0,m.jsx)(zs,{})]})}const qs=(0,f.forwardRef)(Ys);export{lt as a,A as i,dr as n,wt as r,qs as t};
@@ -1 +1 @@
1
- import{u as l}from"./useEvent-BhXAndur.js";import{w as s}from"./cells-DbD2lYze.js";import{t as i}from"./compiler-runtime-B3qBwwSJ.js";import{o as n}from"./utils-YqBXNpsM.js";import{n as f}from"./html-to-image-DrmKVKna.js";import{o as c}from"./focus-BEf2RhRf.js";var p=i();function u(){let o=(0,p.c)(4),a=l(n),r=c(),{createNewCell:t}=s(),e;return o[0]!==a||o[1]!==t||o[2]!==r?(e=m=>{m.includes("alt")&&f({autoInstantiate:a,createNewCell:t,fromCellId:r}),t({code:m,before:!1,cellId:r??"__end__"})},o[0]=a,o[1]=t,o[2]=r,o[3]=e):e=o[3],e}export{u as t};
1
+ import{u as l}from"./useEvent-BhXAndur.js";import{w as s}from"./cells-DbD2lYze.js";import{t as i}from"./compiler-runtime-B3qBwwSJ.js";import{o as n}from"./utils-YqBXNpsM.js";import{n as f}from"./html-to-image-BIY1TtH0.js";import{o as c}from"./focus-RQ0afibT.js";var p=i();function u(){let o=(0,p.c)(4),a=l(n),r=c(),{createNewCell:t}=s(),e;return o[0]!==a||o[1]!==t||o[2]!==r?(e=m=>{m.includes("alt")&&f({autoInstantiate:a,createNewCell:t,fromCellId:r}),t({code:m,before:!1,cellId:r??"__end__"})},o[0]=a,o[1]=t,o[2]=r,o[3]=e):e=o[3],e}export{u as t};
@@ -1 +1 @@
1
- import{s as oe}from"./chunk-LvLJmgfZ.js";import{d as ae,u as x}from"./useEvent-BhXAndur.js";import{Cn as ne,Gn as ie,Hn as de,Un as se,Vn as re,_ as ce,bn as he,dt as F,ii as me,w as pe}from"./cells-DbD2lYze.js";import{t as ke}from"./compiler-runtime-B3qBwwSJ.js";import{a as fe,o as ue,r as be}from"./utils-YqBXNpsM.js";import{t as ye}from"./jsx-runtime-ZmTK25f3.js";import{r as xe}from"./requests-B4FYHTZl.js";import{t as f}from"./createLucideIcon-BCdY6lG5.js";import{n as V,r as G}from"./x-ZP5cObgf.js";import{a as je,m as ve}from"./download-CmdFQXRz.js";import{t as Ce}from"./chevron-right--18M_6o9.js";import{t as K}from"./circle-plus-haI9GLDP.js";import{t as ge}from"./code-xml-CgN_Yig7.js";import{t as we}from"./eye-off-AK_9uodG.js";import{n as ze,t as Ie}from"./play-GLWQQs7F.js";import{t as We}from"./link-DxicfMbs.js";import{a as Me,n as _e}from"./state-DlF73owK.js";import{t as Se}from"./trash-2-B8SQYdQq.js";import{t as Te}from"./use-toast-T0_cQDma.js";import{r as Ae}from"./mode-CjmQoGEk.js";import{a as Ne,c as De,n as He}from"./dialog-tQELcltn.js";import{n as Re}from"./ImperativeModal-DZr52ffu.js";import{t as Be}from"./copy-DHrHayPa.js";import{i as Ee}from"./useRunCells-BOowME8Z.js";import{r as L}from"./html-to-image-DrmKVKna.js";import{t as Oe}from"./label-C9wP7Kp2.js";import{t as Pe}from"./useDeleteCell-DHPNhAtW.js";import{n as Ue,t as qe}from"./icons-DjR3qLG_.js";import{n as Q}from"./name-cell-input-BthamWJY.js";import{t as $}from"./multi-icon-BWLbAXq5.js";import{t as Le}from"./useSplitCell-h8RpNtuv.js";var J=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),X=f("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Y=f("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),Fe=f("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),Z=f("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ee=f("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ve(a){let e=new URL(window.location.href);return e.hash=`scrollTo=${encodeURIComponent(a)}`,e.toString()}function Ge(a){var s;let e=(s=a.match(/scrollTo=([^&]+)/))==null?void 0:s[1];return e?decodeURIComponent(e.split("&")[0]):null}function le(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var Ke=ke(),l=oe(ye(),1);function Qe(a){let e=(0,Ke.c)(44),{cell:s,closePopover:u}=a,{createNewCell:r,updateCellConfig:h,updateCellName:j,moveCell:m,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:S}=pe(),T=Le(),A=Ee(s==null?void 0:s.cellId),N=!x(ce),D=Pe(),{openModal:v}=Re(),H=ae(_e),R=x(be),b=x(ue),te=x(Ae),y=x(fe),{saveCellConfig:p}=xe();if(!s||te){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0],t}let{cellId:o,config:n,getEditorView:d,name:c,hasOutput:C,hasConsoleOutput:B,status:E}=s,g;e[1]!==o||e[2]!==n.disabled||e[3]!==p||e[4]!==h?(g=async()=>{let t={disabled:!n.disabled};await p({configs:{[o]:t}}),h({cellId:o,config:t})},e[1]=o,e[2]=n.disabled,e[3]=p,e[4]=h,e[5]=g):g=e[5];let O=g,w;e[6]!==o||e[7]!==n.hide_code||e[8]!==d||e[9]!==p||e[10]!==h?(w=async()=>{let t={hide_code:!n.hide_code};await p({configs:{[o]:t}}),h({cellId:o,config:t});let q=d();q&&(t.hide_code?q.contentDOM.blur():q.focus())},e[6]=o,e[7]=n.hide_code,e[8]=d,e[9]=p,e[10]=h,e[11]=w):w=e[11];let P=w,i=o===me,z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=(0,l.jsx)(Ie,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12];let U=E==="running"||E==="queued"||E==="disabled-transitively"||n.disabled,k;e[13]===A?k=e[14]:(k=()=>A(),e[13]=A,e[14]=k);let I;return e[15]!==_||e[16]!==R||e[17]!==y||e[18]!==b||e[19]!==N||e[20]!==o||e[21]!==S||e[22]!==u||e[23]!==n.disabled||e[24]!==n.hide_code||e[25]!==r||e[26]!==D||e[27]!==d||e[28]!==B||e[29]!==C||e[30]!==i||e[31]!==m||e[32]!==c||e[33]!==v||e[34]!==M||e[35]!==W||e[36]!==H||e[37]!==T||e[38]!==U||e[39]!==k||e[40]!==O||e[41]!==P||e[42]!==j?(I=[[{icon:z,label:"Run cell",hotkey:"cell.run",hidden:U,redundant:!0,handle:k},{icon:(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!R,handle:()=>{H(t=>(t==null?void 0:t.cellId)===o?null:{cellId:o})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>T({cellId:o})},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let t=d();t&&ne({[o]:t})}},{icon:n.hide_code?(0,l.jsx)(re,{size:13,strokeWidth:1.5}):(0,l.jsx)(we,{size:13,strokeWidth:1.5}),label:n.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:n.disabled?(0,l.jsx)(Z,{size:13,strokeWidth:1.5}):(0,l.jsx)(ee,{size:13,strokeWidth:1.5}),label:n.disabled?"Enable execution":"Disable execution",handle:O,hidden:i}],[{icon:(0,l.jsx)(qe,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),F(t,{language:"markdown",keepCodeAsIs:!1}))},hidden:i},{icon:(0,l.jsx)(de,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),F(t,{language:"sql",keepCodeAsIs:!1}))},hidden:i},{icon:(0,l.jsx)(Ue,{}),label:"Toggle as Python",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),he(t,"python",{force:!0}))},hidden:i}],[{icon:(0,l.jsxs)($,{children:[(0,l.jsx)(K,{size:13,strokeWidth:1.5}),(0,l.jsx)(V,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>r({cellId:o,before:!0}),hidden:i,redundant:!0},{icon:(0,l.jsxs)($,{children:[(0,l.jsx)(K,{size:13,strokeWidth:1.5}),(0,l.jsx)(G,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>r({cellId:o,before:!1}),redundant:!0},{icon:(0,l.jsx)(V,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>m({cellId:o,before:!0}),hidden:i},{icon:(0,l.jsx)(G,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>m({cellId:o,before:!1}),hidden:i},{icon:(0,l.jsx)(ve,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>m({cellId:o,direction:"left"}),hidden:y!=="columns"||i},{icon:(0,l.jsx)(Ce,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>m({cellId:o,direction:"right"}),hidden:y!=="columns"||i},{icon:(0,l.jsx)(X,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:o,scroll:!1}),hidden:i},{icon:(0,l.jsx)(J,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:o,scroll:!1}),hidden:i},{icon:(0,l.jsx)(se,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:o}),hidden:y!=="columns"||i}],[{icon:(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!C,handle:()=>je(o,"result")},{icon:(0,l.jsx)(ie,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(C||B),handle:()=>{S({cellId:o})}}],[{icon:(0,l.jsx)(Fe,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:Ye,handleHeadless:()=>{v((0,l.jsxs)(He,{children:[(0,l.jsx)(Ne,{children:(0,l.jsx)(De,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(Oe,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)(Q,{placeholder:"cell name",value:c,onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),t.stopPropagation(),v(null))},onChange:t=>j({cellId:o,name:t})})]})]}))},rightElement:(0,l.jsx)(Q,{placeholder:"cell name",value:c,onChange:t=>j({cellId:o,name:t}),onEnterKey:()=>u==null?void 0:u()}),hidden:i},{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!le(c),tooltip:le(c)?void 0:"Only named cells can be linked to",handle:async()=>{await Be(Ve(c)),Te({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!N,variant:"danger",icon:(0,l.jsx)(Se,{size:13,strokeWidth:1.5}),handle:()=>{D({cellId:o})}}]].map(Je).filter($e),e[15]=_,e[16]=R,e[17]=y,e[18]=b,e[19]=N,e[20]=o,e[21]=S,e[22]=u,e[23]=n.disabled,e[24]=n.hide_code,e[25]=r,e[26]=D,e[27]=d,e[28]=B,e[29]=C,e[30]=i,e[31]=m,e[32]=c,e[33]=v,e[34]=M,e[35]=W,e[36]=H,e[37]=T,e[38]=U,e[39]=k,e[40]=O,e[41]=P,e[42]=j,e[43]=I):I=e[43],I}function $e(a){return a.length>0}function Je(a){return a.filter(Xe)}function Xe(a){return!a.hidden}function Ye(a){a==null||a.stopPropagation(),a==null||a.preventDefault()}export{Y as a,Z as i,Ge as n,X as o,ee as r,J as s,Qe as t};
1
+ import{s as oe}from"./chunk-LvLJmgfZ.js";import{d as ae,u as x}from"./useEvent-BhXAndur.js";import{Cn as ne,Gn as ie,Hn as de,Un as se,Vn as re,_ as ce,bn as he,dt as F,ii as me,w as pe}from"./cells-DbD2lYze.js";import{t as ke}from"./compiler-runtime-B3qBwwSJ.js";import{a as fe,o as ue,r as be}from"./utils-YqBXNpsM.js";import{t as ye}from"./jsx-runtime-ZmTK25f3.js";import{r as xe}from"./requests-B4FYHTZl.js";import{t as f}from"./createLucideIcon-BCdY6lG5.js";import{n as V,r as G}from"./x-ZP5cObgf.js";import{a as je,m as ve}from"./download-s-BdZdTz.js";import{t as Ce}from"./chevron-right--18M_6o9.js";import{t as K}from"./circle-plus-haI9GLDP.js";import{t as ge}from"./code-xml-CgN_Yig7.js";import{t as we}from"./eye-off-AK_9uodG.js";import{n as ze,t as Ie}from"./play-GLWQQs7F.js";import{t as We}from"./link-DxicfMbs.js";import{a as Me,n as _e}from"./state-DlF73owK.js";import{t as Se}from"./trash-2-B8SQYdQq.js";import{t as Te}from"./use-toast-T0_cQDma.js";import{r as Ae}from"./mode-CjmQoGEk.js";import{a as Ne,c as De,n as He}from"./dialog-tQELcltn.js";import{n as Re}from"./ImperativeModal-DZr52ffu.js";import{t as Be}from"./copy-BaRrAFL-.js";import{i as Ee}from"./useRunCells-BJznEpzj.js";import{r as L}from"./html-to-image-BIY1TtH0.js";import{t as Oe}from"./label-C--1sWU6.js";import{t as Pe}from"./useDeleteCell-DyGTLzfg.js";import{n as Ue,t as qe}from"./icons-DjR3qLG_.js";import{n as Q}from"./name-cell-input-BGxKE7pD.js";import{t as $}from"./multi-icon-BWLbAXq5.js";import{t as Le}from"./useSplitCell-dutfMkv3.js";var J=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),X=f("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Y=f("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),Fe=f("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),Z=f("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ee=f("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Ve(a){let e=new URL(window.location.href);return e.hash=`scrollTo=${encodeURIComponent(a)}`,e.toString()}function Ge(a){var s;let e=(s=a.match(/scrollTo=([^&]+)/))==null?void 0:s[1];return e?decodeURIComponent(e.split("&")[0]):null}function le(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var Ke=ke(),l=oe(ye(),1);function Qe(a){let e=(0,Ke.c)(44),{cell:s,closePopover:u}=a,{createNewCell:r,updateCellConfig:h,updateCellName:j,moveCell:m,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:S}=pe(),T=Le(),A=Ee(s==null?void 0:s.cellId),N=!x(ce),D=Pe(),{openModal:v}=Re(),H=ae(_e),R=x(be),b=x(ue),te=x(Ae),y=x(fe),{saveCellConfig:p}=xe();if(!s||te){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0],t}let{cellId:o,config:n,getEditorView:d,name:c,hasOutput:C,hasConsoleOutput:B,status:E}=s,g;e[1]!==o||e[2]!==n.disabled||e[3]!==p||e[4]!==h?(g=async()=>{let t={disabled:!n.disabled};await p({configs:{[o]:t}}),h({cellId:o,config:t})},e[1]=o,e[2]=n.disabled,e[3]=p,e[4]=h,e[5]=g):g=e[5];let O=g,w;e[6]!==o||e[7]!==n.hide_code||e[8]!==d||e[9]!==p||e[10]!==h?(w=async()=>{let t={hide_code:!n.hide_code};await p({configs:{[o]:t}}),h({cellId:o,config:t});let q=d();q&&(t.hide_code?q.contentDOM.blur():q.focus())},e[6]=o,e[7]=n.hide_code,e[8]=d,e[9]=p,e[10]=h,e[11]=w):w=e[11];let P=w,i=o===me,z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=(0,l.jsx)(Ie,{size:13,strokeWidth:1.5}),e[12]=z):z=e[12];let U=E==="running"||E==="queued"||E==="disabled-transitively"||n.disabled,k;e[13]===A?k=e[14]:(k=()=>A(),e[13]=A,e[14]=k);let I;return e[15]!==_||e[16]!==R||e[17]!==y||e[18]!==b||e[19]!==N||e[20]!==o||e[21]!==S||e[22]!==u||e[23]!==n.disabled||e[24]!==n.hide_code||e[25]!==r||e[26]!==D||e[27]!==d||e[28]!==B||e[29]!==C||e[30]!==i||e[31]!==m||e[32]!==c||e[33]!==v||e[34]!==M||e[35]!==W||e[36]!==H||e[37]!==T||e[38]!==U||e[39]!==k||e[40]!==O||e[41]!==P||e[42]!==j?(I=[[{icon:z,label:"Run cell",hotkey:"cell.run",hidden:U,redundant:!0,handle:k},{icon:(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!R,handle:()=>{H(t=>(t==null?void 0:t.cellId)===o?null:{cellId:o})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>T({cellId:o})},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let t=d();t&&ne({[o]:t})}},{icon:n.hide_code?(0,l.jsx)(re,{size:13,strokeWidth:1.5}):(0,l.jsx)(we,{size:13,strokeWidth:1.5}),label:n.hide_code?"Show code":"Hide code",handle:P,hotkey:"cell.hideCode"},{icon:n.disabled?(0,l.jsx)(Z,{size:13,strokeWidth:1.5}):(0,l.jsx)(ee,{size:13,strokeWidth:1.5}),label:n.disabled?"Enable execution":"Disable execution",handle:O,hidden:i}],[{icon:(0,l.jsx)(qe,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),F(t,{language:"markdown",keepCodeAsIs:!1}))},hidden:i},{icon:(0,l.jsx)(de,{size:13,strokeWidth:1.5}),label:"Convert to SQL",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),F(t,{language:"sql",keepCodeAsIs:!1}))},hidden:i},{icon:(0,l.jsx)(Ue,{}),label:"Toggle as Python",handle:()=>{let t=d();t&&(L({autoInstantiate:b,createNewCell:r}),he(t,"python",{force:!0}))},hidden:i}],[{icon:(0,l.jsxs)($,{children:[(0,l.jsx)(K,{size:13,strokeWidth:1.5}),(0,l.jsx)(V,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>r({cellId:o,before:!0}),hidden:i,redundant:!0},{icon:(0,l.jsxs)($,{children:[(0,l.jsx)(K,{size:13,strokeWidth:1.5}),(0,l.jsx)(G,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>r({cellId:o,before:!1}),redundant:!0},{icon:(0,l.jsx)(V,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>m({cellId:o,before:!0}),hidden:i},{icon:(0,l.jsx)(G,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>m({cellId:o,before:!1}),hidden:i},{icon:(0,l.jsx)(ve,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>m({cellId:o,direction:"left"}),hidden:y!=="columns"||i},{icon:(0,l.jsx)(Ce,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>m({cellId:o,direction:"right"}),hidden:y!=="columns"||i},{icon:(0,l.jsx)(X,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:o,scroll:!1}),hidden:i},{icon:(0,l.jsx)(J,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:o,scroll:!1}),hidden:i},{icon:(0,l.jsx)(se,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:o}),hidden:y!=="columns"||i}],[{icon:(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!C,handle:()=>je(o,"result")},{icon:(0,l.jsx)(ie,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(C||B),handle:()=>{S({cellId:o})}}],[{icon:(0,l.jsx)(Fe,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:Ye,handleHeadless:()=>{v((0,l.jsxs)(He,{children:[(0,l.jsx)(Ne,{children:(0,l.jsx)(De,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(Oe,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)(Q,{placeholder:"cell name",value:c,onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),t.stopPropagation(),v(null))},onChange:t=>j({cellId:o,name:t})})]})]}))},rightElement:(0,l.jsx)(Q,{placeholder:"cell name",value:c,onChange:t=>j({cellId:o,name:t}),onEnterKey:()=>u==null?void 0:u()}),hidden:i},{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!le(c),tooltip:le(c)?void 0:"Only named cells can be linked to",handle:async()=>{await Be(Ve(c)),Te({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!N,variant:"danger",icon:(0,l.jsx)(Se,{size:13,strokeWidth:1.5}),handle:()=>{D({cellId:o})}}]].map(Je).filter($e),e[15]=_,e[16]=R,e[17]=y,e[18]=b,e[19]=N,e[20]=o,e[21]=S,e[22]=u,e[23]=n.disabled,e[24]=n.hide_code,e[25]=r,e[26]=D,e[27]=d,e[28]=B,e[29]=C,e[30]=i,e[31]=m,e[32]=c,e[33]=v,e[34]=M,e[35]=W,e[36]=H,e[37]=T,e[38]=U,e[39]=k,e[40]=O,e[41]=P,e[42]=j,e[43]=I):I=e[43],I}function $e(a){return a.length>0}function Je(a){return a.filter(Xe)}function Xe(a){return!a.hidden}function Ye(a){a==null||a.stopPropagation(),a==null||a.preventDefault()}export{Y as a,Z as i,Ge as n,X as o,ee as r,J as s,Qe as t};
@@ -1 +1 @@
1
- import{s as D}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-BhXAndur.js";import{_ as p,w as h,y as I}from"./cells-DbD2lYze.js";import{t as C}from"./compiler-runtime-B3qBwwSJ.js";import{t as _}from"./useEventListener-Cb-RVVEn.js";import{t as v}from"./jsx-runtime-ZmTK25f3.js";import{t as w}from"./button-CZ3Cs4qb.js";import{r as y}from"./requests-B4FYHTZl.js";import{t as b}from"./use-toast-T0_cQDma.js";import{n as x}from"./renderShortcut-B1jzzLJw.js";var j=C(),d=D(v(),1);const f=e=>{let t=(0,j.c)(7),l;t[0]===e?l=t[1]:(l=a=>{var s;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(s=e.onClick)==null||s.call(e,a))},t[0]=e,t[1]=l);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r={capture:!0},t[2]=r):r=t[2],_(window,"keydown",l,r);let o=e.children??"Undo",i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,d.jsx)(x,{className:"ml-2",shortcut:"cmd-z"}),t[3]=i):i=t[3];let n;return t[4]!==o||t[5]!==e?(n=(0,d.jsxs)(w,{"data-testid":"undo-button",size:"sm",variant:"outline",...e,children:[o," ",i]}),t[4]=o,t[5]=e,t[6]=n):n=t[6],n};var g=C();function z(){let e=(0,g.c)(4),{deleteCell:t,undoDeleteCell:l}=h(),{sendDeleteCell:r}=y(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=i=>{var s;if(m.get(p))return;let{cellId:n}=i,a=(((s=m.get(I).cellData[n])==null?void 0:s.code)??"").trim()==="";if(t({cellId:n}),r({cellId:n}).catch(()=>{l()}),!a){let{dismiss:c}=b({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{l(),k()}})}),k=c}},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}function K(){let e=(0,g.c)(4),{deleteCell:t,undoDeleteCell:l}=h(),{sendDeleteCell:r}=y(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=async i=>{if(m.get(p))return;let{cellIds:n}=i;for(let c of n)await r({cellId:c}).then(()=>{t({cellId:c})});let{dismiss:a}=b({title:"Cells deleted",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{for(let c of n)l();s()}})}),s=a},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}export{K as n,f as r,z as t};
1
+ import{s as D}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-BhXAndur.js";import{_ as p,w as h,y as I}from"./cells-DbD2lYze.js";import{t as C}from"./compiler-runtime-B3qBwwSJ.js";import{t as _}from"./useEventListener-Cb-RVVEn.js";import{t as v}from"./jsx-runtime-ZmTK25f3.js";import{t as w}from"./button-CZ3Cs4qb.js";import{r as y}from"./requests-B4FYHTZl.js";import{t as b}from"./use-toast-T0_cQDma.js";import{n as x}from"./renderShortcut-Xr6z-RjZ.js";var j=C(),d=D(v(),1);const f=e=>{let t=(0,j.c)(7),l;t[0]===e?l=t[1]:(l=a=>{var s;(a.ctrlKey||a.metaKey)&&a.key==="z"&&(a.preventDefault(),a.stopPropagation(),(s=e.onClick)==null||s.call(e,a))},t[0]=e,t[1]=l);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r={capture:!0},t[2]=r):r=t[2],_(window,"keydown",l,r);let o=e.children??"Undo",i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,d.jsx)(x,{className:"ml-2",shortcut:"cmd-z"}),t[3]=i):i=t[3];let n;return t[4]!==o||t[5]!==e?(n=(0,d.jsxs)(w,{"data-testid":"undo-button",size:"sm",variant:"outline",...e,children:[o," ",i]}),t[4]=o,t[5]=e,t[6]=n):n=t[6],n};var g=C();function z(){let e=(0,g.c)(4),{deleteCell:t,undoDeleteCell:l}=h(),{sendDeleteCell:r}=y(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=i=>{var s;if(m.get(p))return;let{cellId:n}=i,a=(((s=m.get(I).cellData[n])==null?void 0:s.code)??"").trim()==="";if(t({cellId:n}),r({cellId:n}).catch(()=>{l()}),!a){let{dismiss:c}=b({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{l(),k()}})}),k=c}},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}function K(){let e=(0,g.c)(4),{deleteCell:t,undoDeleteCell:l}=h(),{sendDeleteCell:r}=y(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=async i=>{if(m.get(p))return;let{cellIds:n}=i;for(let c of n)await r({cellId:c}).then(()=>{t({cellId:c})});let{dismiss:a}=b({title:"Cells deleted",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{for(let c of n)l();s()}})}),s=a},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}export{K as n,f as r,z as t};
@@ -1 +1 @@
1
- import{s as U}from"./chunk-LvLJmgfZ.js";import{d as Y,l as Z,n as V,p as $,u as ee}from"./useEvent-BhXAndur.js";import{t as te}from"./react-Bj1aDYRI.js";import{U as le,gt as re}from"./cells-DbD2lYze.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{t as se}from"./jsx-runtime-ZmTK25f3.js";import{t as ae}from"./cn-BKtXLv3a.js";import{t as ne}from"./createLucideIcon-BCdY6lG5.js";import{t as oe}from"./useCellActionButton-VRGP_KkG.js";import{a as ie,n as ce,o as me,t as de}from"./tooltip-C_WgOOcZ.js";import{d as he}from"./alert-dialog-Ctz24SMn.js";import{i as G,r as pe,t as J}from"./popover-B-131r4d.js";import{a as fe,c as ue,i as xe,o as je,r as be,t as ye,u as ve}from"./command-PbcrObnK.js";import{n as ge}from"./focus-BEf2RhRf.js";import{a as Ne,i as we}from"./renderShortcut-B1jzzLJw.js";var ke=ne("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),K=B(),p=U(te(),1),t=U(se(),1);const L=p.memo(p.forwardRef((n,l)=>{let e=(0,K.c)(46),{children:r,showTooltip:m,...d}=n,f=m===void 0?!0:m,[h,o]=(0,p.useState)(!1),k;e[0]===o?k=e[1]:(k=()=>o(!1),e[0]=o,e[1]=k);let X=k,A=(0,p.useRef)(null),u=oe({cell:d,closePopover:X}),F=he(),C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{le(()=>{A.current&&A.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[2]=C):C=e[2];let H=V(C),S;e[3]!==H||e[4]!==o?(S=s=>{o(c=>{let w=typeof s=="function"?s(c):s;return w&&H(),w})},e[3]=H,e[4]=o,e[5]=S):S=e[5];let i=V(S),_;e[6]===i?_=e[7]:(_=()=>({toggle:()=>i(Ce)}),e[6]=i,e[7]=_),(0,p.useImperativeHandle)(l,_);let M=pe,O=ye,R=fe,q=re(d.cellId),x;e[8]!==R||e[9]!==q?(x=(0,t.jsx)(R,{placeholder:"Search actions...",className:"h-6 m-1",...q}),e[8]=R,e[9]=q,e[10]=x):x=e[10];let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=(0,t.jsx)(be,{children:"No results"}),e[11]=I):I=e[11];let j;if(e[12]!==u||e[13]!==o){let s;e[15]!==u.length||e[16]!==o?(s=(c,w)=>(0,t.jsxs)(p.Fragment,{children:[(0,t.jsx)(xe,{children:c.map(a=>{if(a.redundant)return null;let E=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[a.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:a.icon}),(0,t.jsx)("div",{className:"flex-1",children:a.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[a.hotkey&&we(a.hotkey),a.rightElement]})]});return a.tooltip&&(E=(0,t.jsx)(de,{content:a.tooltip,delayDuration:100,children:E})),(0,t.jsx)(je,{className:ae(a.disabled&&"opacity-50!"),onSelect:()=>{a.disableClick||a.disabled||(a.handle(),o(!1))},variant:a.variant,children:E},a.label)})},w),w<u.length-1&&(0,t.jsx)(ue,{})]},w),e[15]=u.length,e[16]=o,e[17]=s):s=e[17],j=u.map(s),e[12]=u,e[13]=o,e[14]=j}else j=e[14];let b;e[18]===j?b=e[19]:(b=(0,t.jsxs)(ve,{children:[I,j]}),e[18]=j,e[19]=b);let y;e[20]!==O||e[21]!==x||e[22]!==b?(y=(0,t.jsxs)(O,{children:[x,b]}),e[20]=O,e[21]=x,e[22]=b,e[23]=y):y=e[23];let T;e[24]!==M||e[25]!==F||e[26]!==y?(T=(0,t.jsx)(M,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...F,children:y}),e[24]=M,e[25]=F,e[26]=y,e[27]=T):T=e[27];let v=T;if(!f){let s;e[28]===r?s=e[29]:(s=(0,t.jsx)(G,{asChild:!0,children:r}),e[28]=r,e[29]=s);let c;return e[30]!==v||e[31]!==i||e[32]!==h||e[33]!==s?(c=(0,t.jsxs)(J,{open:h,onOpenChange:i,children:[s,v]}),e[30]=v,e[31]=i,e[32]=h,e[33]=s,e[34]=c):c=e[34],c}let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=(0,t.jsx)(ce,{tabIndex:-1,children:Ne("cell.cellActions")}),e[35]=D):D=e[35];let z=!h&&D,g;e[36]===r?g=e[37]:(g=(0,t.jsx)(me,{ref:A,children:(0,t.jsx)(G,{className:"flex",children:r})}),e[36]=r,e[37]=g);let N;e[38]!==z||e[39]!==g?(N=(0,t.jsxs)(ie,{delayDuration:200,disableHoverableContent:!0,children:[z,g]}),e[38]=z,e[39]=g,e[40]=N):N=e[40];let P;return e[41]!==v||e[42]!==i||e[43]!==h||e[44]!==N?(P=(0,t.jsxs)(J,{open:h,onOpenChange:i,children:[N,v]}),e[41]=v,e[42]=i,e[43]=h,e[44]=N,e[45]=P):P=e[45],P})),Q=p.memo(n=>{let l=(0,K.c)(5),{children:e,cellId:r}=n,m;l[0]===r?m=l[1]:(m=ge(r),l[0]=r,l[1]=m);let d=ee(m);if(!d)return null;let f;return l[2]!==e||l[3]!==d?(f=(0,t.jsx)(L,{showTooltip:!1,...d,children:e}),l[2]=e,l[3]=d,l[4]=f):f=l[4],f});Q.displayName="ConnectionCellActionsDropdown";function Ce(n){return!n}var Se=B();const W=$("minimap");function _e(){let n=(0,Se.c)(3),[l,e]=Z(W),r;return n[0]!==l||n[1]!==e?(r={dependencyPanelTab:l,setDependencyPanelTab:e},n[0]=l,n[1]=e,n[2]=r):r=n[2],r}function Ie(){return Y(W)}export{ke as a,Q as i,Ie as n,L as r,_e as t};
1
+ import{s as U}from"./chunk-LvLJmgfZ.js";import{d as Y,l as Z,n as V,p as $,u as ee}from"./useEvent-BhXAndur.js";import{t as te}from"./react-Bj1aDYRI.js";import{U as le,gt as re}from"./cells-DbD2lYze.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{t as se}from"./jsx-runtime-ZmTK25f3.js";import{t as ae}from"./cn-BKtXLv3a.js";import{t as ne}from"./createLucideIcon-BCdY6lG5.js";import{t as oe}from"./useCellActionButton-DR2cYGwm.js";import{a as ie,n as ce,o as me,t as de}from"./tooltip-C_WgOOcZ.js";import{d as he}from"./alert-dialog-Ctz24SMn.js";import{i as G,r as pe,t as J}from"./popover-B-131r4d.js";import{a as fe,c as ue,i as xe,o as je,r as be,t as ye,u as ve}from"./command-BpjkI15h.js";import{n as ge}from"./focus-RQ0afibT.js";import{a as Ne,i as we}from"./renderShortcut-Xr6z-RjZ.js";var ke=ne("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),K=B(),p=U(te(),1),t=U(se(),1);const L=p.memo(p.forwardRef((n,l)=>{let e=(0,K.c)(46),{children:r,showTooltip:m,...d}=n,f=m===void 0?!0:m,[h,o]=(0,p.useState)(!1),k;e[0]===o?k=e[1]:(k=()=>o(!1),e[0]=o,e[1]=k);let X=k,A=(0,p.useRef)(null),u=oe({cell:d,closePopover:X}),F=he(),C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{le(()=>{A.current&&A.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[2]=C):C=e[2];let H=V(C),S;e[3]!==H||e[4]!==o?(S=s=>{o(c=>{let w=typeof s=="function"?s(c):s;return w&&H(),w})},e[3]=H,e[4]=o,e[5]=S):S=e[5];let i=V(S),_;e[6]===i?_=e[7]:(_=()=>({toggle:()=>i(Ce)}),e[6]=i,e[7]=_),(0,p.useImperativeHandle)(l,_);let M=pe,O=ye,R=fe,q=re(d.cellId),x;e[8]!==R||e[9]!==q?(x=(0,t.jsx)(R,{placeholder:"Search actions...",className:"h-6 m-1",...q}),e[8]=R,e[9]=q,e[10]=x):x=e[10];let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=(0,t.jsx)(be,{children:"No results"}),e[11]=I):I=e[11];let j;if(e[12]!==u||e[13]!==o){let s;e[15]!==u.length||e[16]!==o?(s=(c,w)=>(0,t.jsxs)(p.Fragment,{children:[(0,t.jsx)(xe,{children:c.map(a=>{if(a.redundant)return null;let E=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[a.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:a.icon}),(0,t.jsx)("div",{className:"flex-1",children:a.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[a.hotkey&&we(a.hotkey),a.rightElement]})]});return a.tooltip&&(E=(0,t.jsx)(de,{content:a.tooltip,delayDuration:100,children:E})),(0,t.jsx)(je,{className:ae(a.disabled&&"opacity-50!"),onSelect:()=>{a.disableClick||a.disabled||(a.handle(),o(!1))},variant:a.variant,children:E},a.label)})},w),w<u.length-1&&(0,t.jsx)(ue,{})]},w),e[15]=u.length,e[16]=o,e[17]=s):s=e[17],j=u.map(s),e[12]=u,e[13]=o,e[14]=j}else j=e[14];let b;e[18]===j?b=e[19]:(b=(0,t.jsxs)(ve,{children:[I,j]}),e[18]=j,e[19]=b);let y;e[20]!==O||e[21]!==x||e[22]!==b?(y=(0,t.jsxs)(O,{children:[x,b]}),e[20]=O,e[21]=x,e[22]=b,e[23]=y):y=e[23];let T;e[24]!==M||e[25]!==F||e[26]!==y?(T=(0,t.jsx)(M,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...F,children:y}),e[24]=M,e[25]=F,e[26]=y,e[27]=T):T=e[27];let v=T;if(!f){let s;e[28]===r?s=e[29]:(s=(0,t.jsx)(G,{asChild:!0,children:r}),e[28]=r,e[29]=s);let c;return e[30]!==v||e[31]!==i||e[32]!==h||e[33]!==s?(c=(0,t.jsxs)(J,{open:h,onOpenChange:i,children:[s,v]}),e[30]=v,e[31]=i,e[32]=h,e[33]=s,e[34]=c):c=e[34],c}let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=(0,t.jsx)(ce,{tabIndex:-1,children:Ne("cell.cellActions")}),e[35]=D):D=e[35];let z=!h&&D,g;e[36]===r?g=e[37]:(g=(0,t.jsx)(me,{ref:A,children:(0,t.jsx)(G,{className:"flex",children:r})}),e[36]=r,e[37]=g);let N;e[38]!==z||e[39]!==g?(N=(0,t.jsxs)(ie,{delayDuration:200,disableHoverableContent:!0,children:[z,g]}),e[38]=z,e[39]=g,e[40]=N):N=e[40];let P;return e[41]!==v||e[42]!==i||e[43]!==h||e[44]!==N?(P=(0,t.jsxs)(J,{open:h,onOpenChange:i,children:[N,v]}),e[41]=v,e[42]=i,e[43]=h,e[44]=N,e[45]=P):P=e[45],P})),Q=p.memo(n=>{let l=(0,K.c)(5),{children:e,cellId:r}=n,m;l[0]===r?m=l[1]:(m=ge(r),l[0]=r,l[1]=m);let d=ee(m);if(!d)return null;let f;return l[2]!==e||l[3]!==d?(f=(0,t.jsx)(L,{showTooltip:!1,...d,children:e}),l[2]=e,l[3]=d,l[4]=f):f=l[4],f});Q.displayName="ConnectionCellActionsDropdown";function Ce(n){return!n}var Se=B();const W=$("minimap");function _e(){let n=(0,Se.c)(3),[l,e]=Z(W),r;return n[0]!==l||n[1]!==e?(r={dependencyPanelTab:l,setDependencyPanelTab:e},n[0]=l,n[1]=e,n[2]=r):r=n[2],r}function Ie(){return Y(W)}export{ke as a,Q as i,Ie as n,L as r,_e as t};
@@ -1 +1 @@
1
- import{s as l}from"./chunk-LvLJmgfZ.js";import{p as x}from"./useEvent-BhXAndur.js";import{t as k}from"./react-Bj1aDYRI.js";import{d as v}from"./hotkeys-BHHWjLlp.js";import{t as f}from"./jsx-runtime-ZmTK25f3.js";import{r as j}from"./requests-B4FYHTZl.js";import{t as n}from"./use-toast-T0_cQDma.js";import{t as o}from"./kbd-Cm6Ba9qg.js";const y=x(null),m="packages-install-input",p=()=>{requestAnimationFrame(()=>{let e=document.getElementById(m);e&&e.focus()})},P=e=>{e.openApplication("packages"),p()};var a=l(f(),1);const g=(e,t)=>{n(t?{title:"Failed to add package",description:t,variant:"danger"}:{title:"Package added",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," and its dependencies has been added to your environment."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},N=(e,t)=>{n(t?{title:"Failed to upgrade package",description:t,variant:"danger"}:{title:"Package upgraded",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," has been upgraded."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},q=(e,t)=>{n(t?{title:"Failed to remove package",description:t,variant:"danger"}:{title:"Package removed",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," has been removed from your environment."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})};var F=l(k(),1);function S(){let[e,t]=(0,F.useState)(!1),{addPackage:h}=j();return{loading:e,handleInstallPackages:async(d,r)=>{t(!0);try{for(let[s,i]of d.entries()){let c=await h({package:i});c.success?g(i):g(i,c.error),s<d.length-1&&await new Promise(u=>setTimeout(u,1e3))}r==null||r()}catch(s){v.error(s)}finally{t(!1)}}}}export{p as a,m as i,q as n,P as o,N as r,y as s,S as t};
1
+ import{s as l}from"./chunk-LvLJmgfZ.js";import{p as x}from"./useEvent-BhXAndur.js";import{t as k}from"./react-Bj1aDYRI.js";import{d as v}from"./hotkeys-BHHWjLlp.js";import{t as f}from"./jsx-runtime-ZmTK25f3.js";import{r as j}from"./requests-B4FYHTZl.js";import{t as n}from"./use-toast-T0_cQDma.js";import{t as o}from"./kbd-k3Sn_RwW.js";const y=x(null),m="packages-install-input",p=()=>{requestAnimationFrame(()=>{let e=document.getElementById(m);e&&e.focus()})},P=e=>{e.openApplication("packages"),p()};var a=l(f(),1);const g=(e,t)=>{n(t?{title:"Failed to add package",description:t,variant:"danger"}:{title:"Package added",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," and its dependencies has been added to your environment."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},N=(e,t)=>{n(t?{title:"Failed to upgrade package",description:t,variant:"danger"}:{title:"Package upgraded",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," has been upgraded."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})},q=(e,t)=>{n(t?{title:"Failed to remove package",description:t,variant:"danger"}:{title:"Package removed",description:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["The package ",(0,a.jsx)(o,{className:"inline",children:e})," has been removed from your environment."]}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Some Python packages may require a kernel restart to see changes."})]})})};var F=l(k(),1);function S(){let[e,t]=(0,F.useState)(!1),{addPackage:h}=j();return{loading:e,handleInstallPackages:async(d,r)=>{t(!0);try{for(let[s,i]of d.entries()){let c=await h({package:i});c.success?g(i):g(i,c.error),s<d.length-1&&await new Promise(u=>setTimeout(u,1e3))}r==null||r()}catch(s){v.error(s)}finally{t(!1)}}}}export{p as a,m as i,q as n,P as o,N as r,y as s,S as t};
@@ -1 +1 @@
1
- import{s as de}from"./chunk-LvLJmgfZ.js";import{d as D,l as Ve,p as Be,u as ee}from"./useEvent-BhXAndur.js";import{t as Ue}from"./react-Bj1aDYRI.js";import{Bn as Ye,Gn as $e,Hn as Fe,Xn as Ge,cn as Ke,fn as ce,g as Je,gr as Xe,jt as Ze,ln as Qe,m as he,ni as te,sn as et,t as tt,w as pe}from"./cells-DbD2lYze.js";import{t as W}from"./compiler-runtime-B3qBwwSJ.js";import{n as at}from"./assertNever-CBU83Y6o.js";import{s as me}from"./useLifecycle-ClI_npeg.js";import{n as ot}from"./add-database-form-CvczP0Mq.js";import{n as nt,x as it}from"./ai-model-dropdown-CODXtvnr.js";import{a as ue,d as P}from"./hotkeys-BHHWjLlp.js";import{y as lt}from"./utils-YqBXNpsM.js";import{n as _,t as fe}from"./constants-B6Cb__3x.js";import{S as ye,h as st,x as rt}from"./config-D2-Bw6QC.js";import{t as dt}from"./jsx-runtime-ZmTK25f3.js";import{r as ct,t as ae}from"./button-CZ3Cs4qb.js";import{r as I}from"./requests-B4FYHTZl.js";import{t as h}from"./createLucideIcon-BCdY6lG5.js";import{a as be,f as ht,i as ke,m as pt,p as xe,u as we}from"./layout-D7NLGhPa.js";import{t as ge}from"./check-Dr3SxUsb.js";import{c as mt,d as je,n as ut,o as ft,r as ve,t as yt}from"./download-CmdFQXRz.js";import{f as bt}from"./maps-D2_Mq1pZ.js";import{r as kt}from"./useCellActionButton-VRGP_KkG.js";import{t as xt}from"./copy-D-8y6iMN.js";import{t as wt}from"./download-Dg7clfkc.js";import{t as gt}from"./eye-off-AK_9uodG.js";import{t as jt}from"./file-plus-corner-CvAy4H5W.js";import{t as vt}from"./file-Ch78NKWp.js";import{i as Ct,n as zt,r as Mt,t as Wt}from"./youtube--tNPNRy6.js";import{n as _t,t as St}from"./house-BI81AWSn.js";import{n as At}from"./play-GLWQQs7F.js";import{t as Nt}from"./link-DxicfMbs.js";import{r as Dt}from"./input-DHHmNa19.js";import{t as Pt}from"./settings-OBbrbhij.js";import{y as It}from"./textarea-8F9GOEGf.js";import{t as Et}from"./square-DPZjfUaq.js";import{t as C}from"./use-toast-T0_cQDma.js";import{n as Ce,t as Tt}from"./paths-Dfii2bN8.js";import{o as Ht}from"./session-fBtIbMpB.js";import{a as Lt,c as qt,i as Rt,n as Ot,r as Vt,s as Bt,t as Ut}from"./select-B7bfltkI.js";import{t as Yt}from"./tooltip-C_WgOOcZ.js";import{a as ze,i as $t,r as Ft}from"./mode-CjmQoGEk.js";import{o as Gt}from"./alert-dialog-Ctz24SMn.js";import{a as Kt,c as Jt,i as Xt,n as Zt,r as Qt}from"./dialog-tQELcltn.js";import{n as oe}from"./ImperativeModal-DZr52ffu.js";import{r as ea,t as ta}from"./share-rXkgGlhr.js";import{t as U}from"./copy-DHrHayPa.js";import{r as aa}from"./useRunCells-BOowME8Z.js";import{a as oa}from"./cell-link-BoOn0OpK.js";import{a as Me}from"./renderShortcut-B1jzzLJw.js";import{t as na}from"./icons-DjR3qLG_.js";import{t as ia}from"./links-DgZx-VxW.js";import{r as la,t as sa}from"./hooks-B_N-kbrq.js";import{t as We}from"./types-DZmRsGZN.js";var ra=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),da=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),_e=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Se=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Ae=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),ca=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),ha=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),pa=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Ne=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ma=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),ua=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),De=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),fa=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ya=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Pe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ie=W(),ne=de(Ue(),1),a=de(dt(),1),Y="https://static.marimo.app";const ba=e=>{let t=(0,Ie.c)(25),{onClose:n}=e,[o,l]=(0,ne.useState)(""),{exportAsHTML:r}=I(),s=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Y}/static/${s}`,d;t[0]!==r||t[1]!==n||t[2]!==s?(d=async v=>{v.preventDefault(),n();let S=await r({download:!1,includeCode:!0,files:ht.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Y}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:s})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:_.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=s,t[3]=d):d=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(Jt,{children:"Share static notebook"}),t[4]=p):p=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Kt,{children:[p,(0,a.jsxs)(Qt,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Y,target:"_blank",children:Y}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{l(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Dt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let u;t[9]===i?u=t[10]:(u=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ka,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=u);let f;t[11]!==m||t[12]!==u?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,u]}),t[11]=m,t[12]=u,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(ae,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(ae,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await U(i)},children:"Create"}),t[16]=i,t[17]=b);let k;t[18]!==y||t[19]!==b?(k=(0,a.jsxs)(Xt,{children:[y,b]}),t[18]=y,t[19]=b,t[20]=k):k=t[20];let j;return t[21]!==d||t[22]!==k||t[23]!==f?(j=(0,a.jsx)(Zt,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,f,k]})}),t[21]=d,t[22]=k,t[23]=f,t[24]=j):j=t[24],j};var ka=e=>{let t=(0,Ie.c)(8),[n,o]=ne.useState(!1),l;t[0]===e.text?l=t[1]:(l=ct.stopPropagation(async p=>{p.preventDefault(),await U(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=l);let r=l,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(xt,{size:14,strokeWidth:1.5}),t[2]=s):s=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(ae,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:s}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(Yt,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},xa=W();function wa(){let e=document.getElementsByClassName(fe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=te.findElement(t);if(!o){P.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:te.parse(o.id)}}}return P.warn("No visible output area found for scroll anchor"),null}function ga(e){if(!e){P.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(te.create(e.cellId));if(!t){P.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${fe.outputArea}`)){P.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ee(){let e=(0,xa.c)(2),t=D(ze),n;return e[0]===t?n=e[1]:(n=()=>{let o=wa();t(l=>({mode:$t(l.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ga(o)})})},e[0]=t,e[1]=n),n}const Te=Be(!1);var ja=W();const va=()=>{let e=(0,ja.c)(7),{selectedLayout:t}=be(),{setLayoutView:n}=ke();if(ye()&&!ce("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Bt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(qt,{placeholder:"Select a view"})}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Ot,{children:(0,a.jsxs)(Vt,{children:[(0,a.jsx)(Lt,{children:"View as"}),We.map(za)]})}),e[3]=r):r=e[3];let s;return e[4]!==t||e[5]!==o?(s=(0,a.jsxs)(Ut,{"data-testid":"layout-select",value:t,onValueChange:o,children:[l,r]}),e[4]=t,e[5]=o,e[6]=s):s=e[6],s};function Ca(e){return(0,a.jsx)(He(e),{className:"h-4 w-4"})}function He(e){switch(e){case"vertical":return ma;case"grid":return Mt;case"slides":return De;default:return at(e),Et}}function Le(e){return me(e)}function za(e){return(0,a.jsx)(Rt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ca(e),(0,a.jsx)("span",{children:Le(e)})]})},e)}var Ma=W();function Wa(e){let t=(0,Ma.c)(5),{openPrompt:n,closeModal:o}=oe(),{sendCopy:l}=I(),r;return t[0]!==o||t[1]!==n||t[2]!==l||t[3]!==e?(r=()=>{if(!e)return null;let s=Tt.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ce.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=s.join(Ce.dirname(e),i);l({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),ia(d)})}})},t[0]=o,t[1]=n,t[2]=l,t[3]=e,t[4]=r):r=t[4],r}const _a=()=>{let{updateCellConfig:e}=pe(),{saveCellConfig:t}=I();return(0,ne.useCallback)(async()=>{let n=new Ze,o=he(),l=o.cellIds.inOrderIds,r={};for(let i of l){if(o.cellData[i]===void 0)continue;let{code:d,config:p}=o.cellData[i];p.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let s=ue.entries(r);if(s.length!==0){await t({configs:r});for(let[i,d]of s)e({cellId:i,config:d})}},[e])};var Sa=W();function qe(){let e=(0,Sa.c)(4),{openConfirm:t}=oe(),n=D(st),{sendRestart:o}=I(),l;return e[0]!==t||e[1]!==o||e[2]!==n?(l=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Gt,{onClick:async()=>{n({state:rt.CLOSING}),await o(),ea()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=l):l=e[3],l}var Aa=W(),E=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Na(){var se,re;let e=(0,Aa.c)(40),t=oa(),{openModal:n,closeModal:o}=oe(),{toggleApplication:l}=et(),{selectedPanel:r}=Ke(),[s]=Ve(ze),i=ee(Ft),d=_a(),[p]=lt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:m,addSetupCellIfDoesntExist:u,collapseAllCells:f,expandAllCells:y}=pe(),b=qe(),k=aa(),j=Wa(t),v=D(Te),S=D(nt),z=D(it),{exportAsMarkdown:$,readCode:A,saveCellConfig:F,updateCellOutputs:G}=I(),K=ee(Je),J=ee(tt),{selectedLayout:X}=be(),{setLayoutView:Z}=ke(),T=Ee(),Q=la(),H=((se=p.sharing)==null?void 0:se.html)??!0,L=((re=p.sharing)==null?void 0:re.wasm)??!0,q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q=ce("server_side_pdf_export"),e[0]=q):q=e[0];let le=q,R=le||s.mode==="present",Re=Ga,O;e[1]===Symbol.for("react.memo_cache_sentinel")?(O=(0,a.jsx)(wt,{size:14,strokeWidth:1.5}),e[1]=O):O=e[1];let V;e[2]===Symbol.for("react.memo_cache_sentinel")?(V=(0,a.jsx)(xe,{size:14,strokeWidth:1.5}),e[2]=V):V=e[2];let M;e[3]===t?M=e[4]:(M=async()=>{if(!t){ie();return}await we({filename:t,includeCode:!0})},e[3]=t,e[4]=M);let B;return e[5]!==u||e[6]!==J||e[7]!==m||e[8]!==o||e[9]!==f||e[10]!==j||e[11]!==y||e[12]!==$||e[13]!==t||e[14]!==K||e[15]!==d||e[16]!==i||e[17]!==n||e[18]!==R||e[19]!==A||e[20]!==b||e[21]!==k||e[22]!==F||e[23]!==X||e[24]!==r||e[25]!==v||e[26]!==z||e[27]!==Z||e[28]!==S||e[29]!==H||e[30]!==L||e[31]!==M||e[32]!==Q||e[33]!==l||e[34]!==T||e[35]!==g||e[36]!==w||e[37]!==G||e[38]!==s.mode?(B=[{icon:O,label:"Download",handle:E,dropdown:[{icon:V,label:"Download as HTML",handle:M},{icon:(0,a.jsx)(xe,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){ie();return}await we({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(na,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await $({download:!1});ve(new Blob([c],{type:"text/plain"}),je.toMarkdown(document.title))}},{icon:(0,a.jsx)(pt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await A();ve(new Blob([c.contents],{type:"text/plain"}),je.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:s.mode!=="present",tooltip:s.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Me("global.hideCode",!1)]}),handle:Fa},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download as PDF",disabled:!R,tooltip:R?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Me("global.hideCode",!1)]}),handle:async()=>{if(le){if(!t){ie();return}await mt("Downloading PDF...",async N=>{await sa({takeScreenshots:()=>Q({progress:N}),updateCellOutputs:G}),await ut({filename:t,webpdf:!1})});return}let c=new Event("export-beforeprint"),x=new Event("export-afterprint");(function(){window.dispatchEvent(c),setTimeout($a,0),setTimeout(()=>window.dispatchEvent(x),0)})()}}]},{icon:(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),label:"Share",handle:E,hidden:!H&&!L,dropdown:[{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!H,handle:async()=>{n((0,a.jsx)(ba,{onClose:o}))}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!L,handle:async()=>{await U(ta({code:(await A()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:E,dropdown:Qe.flatMap(c=>{let{type:x,Icon:N,hidden:Oe}=c;return Oe?[]:{label:me(x),rightElement:Re(r===x),icon:(0,a.jsx)(N,{size:14,strokeWidth:1.5}),handle:()=>l(x)}})},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Present as",handle:E,dropdown:[{icon:s.mode==="present"?(0,a.jsx)(It,{size:14,strokeWidth:1.5}):(0,a.jsx)(Ne,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{T()}},...We.map((c,x)=>{let N=He(c);return{divider:x===0,label:Le(c),icon:(0,a.jsx)(N,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:X===c&&(0,a.jsx)(ge,{size:14})}),handle:()=>{Z(c),s.mode==="edit"&&T()}}})]},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ye(),handle:j},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await U((await A()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!K||i,handle:async()=>{let c=Xe(he());await F({configs:ue.fromEntries(c.map(Ya))});for(let x of c)w({cellId:x,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ot,{onClose:o}))}},{icon:(0,a.jsx)(Pe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!J||i,handle:()=>{g()}},{icon:(0,a.jsx)(ya,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)($e,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{m()}},{icon:(0,a.jsx)(gt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:f,redundant:!0},{icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:y,redundant:!0},{divider:!0,icon:(0,a.jsx)(Se,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(Ua)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(Ba)},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>S(Va),redundant:!0},{icon:(0,a.jsx)(bt,{size:14,strokeWidth:1.5}),label:"Resources",handle:E,dropdown:[{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Oa},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Ra},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:qa},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:La},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Ha}]},{divider:!0,icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ta},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ea}].filter(Ia).map(Da),e[5]=u,e[6]=J,e[7]=m,e[8]=o,e[9]=f,e[10]=j,e[11]=y,e[12]=$,e[13]=t,e[14]=K,e[15]=d,e[16]=i,e[17]=n,e[18]=R,e[19]=A,e[20]=b,e[21]=k,e[22]=F,e[23]=X,e[24]=r,e[25]=v,e[26]=z,e[27]=Z,e[28]=S,e[29]=H,e[30]=L,e[31]=M,e[32]=Q,e[33]=l,e[34]=T,e[35]=g,e[36]=w,e[37]=G,e[38]=s.mode,e[39]=B):B=e[39],B}function Da(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Pa)}:e}function Pa(e){return!e.hidden}function Ia(e){return!e.hidden}function Ea(){let e=Ht();window.open(e,"_blank")}function Ta(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function Ha(){window.open(_.releasesPage,"_blank")}function La(){window.open(_.youtube,"_blank")}function qa(){window.open(_.discordLink,"_blank")}function Ra(){window.open(_.githubPage,"_blank")}function Oa(){window.open(_.docsPage,"_blank")}function Va(e){return!e}function Ba(e){return!e}function Ua(e){return!e}function Ya(e){return[e,{disabled:!1}]}function $a(){return window.print()}async function Fa(){let e=document.getElementById("App");e&&await ft({element:e,filename:document.title,prepare:yt})}function Ga(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(ge,{size:14})})}function ie(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ee as a,Ae as c,Te as i,Se as l,qe as n,Pe as o,va as r,Ne as s,Na as t,_e as u};
1
+ import{s as de}from"./chunk-LvLJmgfZ.js";import{d as D,l as Ve,p as Be,u as ee}from"./useEvent-BhXAndur.js";import{t as Ue}from"./react-Bj1aDYRI.js";import{Bn as Ye,Gn as $e,Hn as Fe,Xn as Ge,cn as Ke,fn as ce,g as Je,gr as Xe,jt as Ze,ln as Qe,m as he,ni as te,sn as et,t as tt,w as pe}from"./cells-DbD2lYze.js";import{t as W}from"./compiler-runtime-B3qBwwSJ.js";import{n as at}from"./assertNever-CBU83Y6o.js";import{s as me}from"./useLifecycle-ClI_npeg.js";import{n as ot}from"./add-database-form-Bn_w5TEI.js";import{n as nt,x as it}from"./ai-model-dropdown-D8AFYZjU.js";import{a as ue,d as P}from"./hotkeys-BHHWjLlp.js";import{y as lt}from"./utils-YqBXNpsM.js";import{n as _,t as fe}from"./constants-B6Cb__3x.js";import{S as ye,h as st,x as rt}from"./config-D2-Bw6QC.js";import{t as dt}from"./jsx-runtime-ZmTK25f3.js";import{r as ct,t as ae}from"./button-CZ3Cs4qb.js";import{r as I}from"./requests-B4FYHTZl.js";import{t as h}from"./createLucideIcon-BCdY6lG5.js";import{a as be,f as ht,i as ke,m as pt,p as xe,u as we}from"./layout-ZtHfLqYp.js";import{t as ge}from"./check-Dr3SxUsb.js";import{c as mt,d as je,n as ut,o as ft,r as ve,t as yt}from"./download-s-BdZdTz.js";import{f as bt}from"./maps-D2_Mq1pZ.js";import{r as kt}from"./useCellActionButton-DR2cYGwm.js";import{t as xt}from"./copy-D-8y6iMN.js";import{t as wt}from"./download-Dg7clfkc.js";import{t as gt}from"./eye-off-AK_9uodG.js";import{t as jt}from"./file-plus-corner-CvAy4H5W.js";import{t as vt}from"./file-Ch78NKWp.js";import{i as Ct,n as zt,r as Mt,t as Wt}from"./youtube--tNPNRy6.js";import{n as _t,t as St}from"./house-BI81AWSn.js";import{n as At}from"./play-GLWQQs7F.js";import{t as Nt}from"./link-DxicfMbs.js";import{r as Dt}from"./input-DHHmNa19.js";import{t as Pt}from"./settings-OBbrbhij.js";import{y as It}from"./textarea-B9TY02t9.js";import{t as Et}from"./square-DPZjfUaq.js";import{t as C}from"./use-toast-T0_cQDma.js";import{n as Ce,t as Tt}from"./paths-Dfii2bN8.js";import{o as Ht}from"./session-fBtIbMpB.js";import{a as Lt,c as qt,i as Rt,n as Ot,r as Vt,s as Bt,t as Ut}from"./select-B7bfltkI.js";import{t as Yt}from"./tooltip-C_WgOOcZ.js";import{a as ze,i as $t,r as Ft}from"./mode-CjmQoGEk.js";import{o as Gt}from"./alert-dialog-Ctz24SMn.js";import{a as Kt,c as Jt,i as Xt,n as Zt,r as Qt}from"./dialog-tQELcltn.js";import{n as oe}from"./ImperativeModal-DZr52ffu.js";import{r as ea,t as ta}from"./share-rXkgGlhr.js";import{t as U}from"./copy-BaRrAFL-.js";import{r as aa}from"./useRunCells-BJznEpzj.js";import{a as oa}from"./cell-link-DfoJF6Bq.js";import{a as Me}from"./renderShortcut-Xr6z-RjZ.js";import{t as na}from"./icons-DjR3qLG_.js";import{t as ia}from"./links-DgZx-VxW.js";import{r as la,t as sa}from"./hooks-C13qkLoi.js";import{t as We}from"./types-DZmRsGZN.js";var ra=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),da=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),_e=h("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Se=h("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Ae=h("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),ca=h("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),ha=h("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),pa=h("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Ne=h("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),ma=h("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),ua=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),De=h("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),fa=h("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ya=h("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),Pe=h("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),Ie=W(),ne=de(Ue(),1),a=de(dt(),1),Y="https://static.marimo.app";const ba=e=>{let t=(0,Ie.c)(25),{onClose:n}=e,[o,l]=(0,ne.useState)(""),{exportAsHTML:r}=I(),s=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${Y}/static/${s}`,d;t[0]!==r||t[1]!==n||t[2]!==s?(d=async v=>{v.preventDefault(),n();let S=await r({download:!1,includeCode:!0,files:ht.INSTANCE.filenames()}),z=C({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${Y}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:S,path:s})}).catch(()=>{z.dismiss(),C({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:_.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),z.dismiss(),C({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=r,t[1]=n,t[2]=s,t[3]=d):d=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(Jt,{children:"Share static notebook"}),t[4]=p):p=t[4];let w;t[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Kt,{children:[p,(0,a.jsxs)(Qt,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:Y,target:"_blank",children:Y}),"."]})]}),t[5]=w):w=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=v=>{l(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=g):g=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Dt,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:g,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let u;t[9]===i?u=t[10]:(u=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ka,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=u);let f;t[11]!==m||t[12]!==u?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,u]}),t[11]=m,t[12]=u,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(ae,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let b;t[16]===i?b=t[17]:(b=(0,a.jsx)(ae,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await U(i)},children:"Create"}),t[16]=i,t[17]=b);let k;t[18]!==y||t[19]!==b?(k=(0,a.jsxs)(Xt,{children:[y,b]}),t[18]=y,t[19]=b,t[20]=k):k=t[20];let j;return t[21]!==d||t[22]!==k||t[23]!==f?(j=(0,a.jsx)(Zt,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[w,f,k]})}),t[21]=d,t[22]=k,t[23]=f,t[24]=j):j=t[24],j};var ka=e=>{let t=(0,Ie.c)(8),[n,o]=ne.useState(!1),l;t[0]===e.text?l=t[1]:(l=ct.stopPropagation(async p=>{p.preventDefault(),await U(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=l);let r=l,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(xt,{size:14,strokeWidth:1.5}),t[2]=s):s=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(ae,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:s}),t[3]=r,t[4]=i);let d;return t[5]!==n||t[6]!==i?(d=(0,a.jsx)(Yt,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=d):d=t[7],d},xa=W();function wa(){let e=document.getElementsByClassName(fe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=te.findElement(t);if(!o){P.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:te.parse(o.id)}}}return P.warn("No visible output area found for scroll anchor"),null}function ga(e){if(!e){P.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(te.create(e.cellId));if(!t){P.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${fe.outputArea}`)){P.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Ee(){let e=(0,xa.c)(2),t=D(ze),n;return e[0]===t?n=e[1]:(n=()=>{let o=wa();t(l=>({mode:$t(l.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ga(o)})})},e[0]=t,e[1]=n),n}const Te=Be(!1);var ja=W();const va=()=>{let e=(0,ja.c)(7),{selectedLayout:t}=be(),{setLayoutView:n}=ke();if(ye()&&!ce("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Bt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(qt,{placeholder:"Select a view"})}),e[2]=l):l=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Ot,{children:(0,a.jsxs)(Vt,{children:[(0,a.jsx)(Lt,{children:"View as"}),We.map(za)]})}),e[3]=r):r=e[3];let s;return e[4]!==t||e[5]!==o?(s=(0,a.jsxs)(Ut,{"data-testid":"layout-select",value:t,onValueChange:o,children:[l,r]}),e[4]=t,e[5]=o,e[6]=s):s=e[6],s};function Ca(e){return(0,a.jsx)(He(e),{className:"h-4 w-4"})}function He(e){switch(e){case"vertical":return ma;case"grid":return Mt;case"slides":return De;default:return at(e),Et}}function Le(e){return me(e)}function za(e){return(0,a.jsx)(Rt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Ca(e),(0,a.jsx)("span",{children:Le(e)})]})},e)}var Ma=W();function Wa(e){let t=(0,Ma.c)(5),{openPrompt:n,closeModal:o}=oe(),{sendCopy:l}=I(),r;return t[0]!==o||t[1]!==n||t[2]!==l||t[3]!==e?(r=()=>{if(!e)return null;let s=Tt.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Ce.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let d=s.join(Ce.dirname(e),i);l({source:e,destination:d}).then(()=>{o(),C({title:"Notebook copied",description:"A copy of the notebook has been created."}),ia(d)})}})},t[0]=o,t[1]=n,t[2]=l,t[3]=e,t[4]=r):r=t[4],r}const _a=()=>{let{updateCellConfig:e}=pe(),{saveCellConfig:t}=I();return(0,ne.useCallback)(async()=>{let n=new Ze,o=he(),l=o.cellIds.inOrderIds,r={};for(let i of l){if(o.cellData[i]===void 0)continue;let{code:d,config:p}=o.cellData[i];p.hide_code||n.isSupported(d)&&(r[i]={hide_code:!0})}let s=ue.entries(r);if(s.length!==0){await t({configs:r});for(let[i,d]of s)e({cellId:i,config:d})}},[e])};var Sa=W();function qe(){let e=(0,Sa.c)(4),{openConfirm:t}=oe(),n=D(st),{sendRestart:o}=I(),l;return e[0]!==t||e[1]!==o||e[2]!==n?(l=()=>{t({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Gt,{onClick:async()=>{n({state:rt.CLOSING}),await o(),ea()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=l):l=e[3],l}var Aa=W(),E=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Na(){var se,re;let e=(0,Aa.c)(40),t=oa(),{openModal:n,closeModal:o}=oe(),{toggleApplication:l}=et(),{selectedPanel:r}=Ke(),[s]=Ve(ze),i=ee(Ft),d=_a(),[p]=lt(),{updateCellConfig:w,undoDeleteCell:g,clearAllCellOutputs:m,addSetupCellIfDoesntExist:u,collapseAllCells:f,expandAllCells:y}=pe(),b=qe(),k=aa(),j=Wa(t),v=D(Te),S=D(nt),z=D(it),{exportAsMarkdown:$,readCode:A,saveCellConfig:F,updateCellOutputs:G}=I(),K=ee(Je),J=ee(tt),{selectedLayout:X}=be(),{setLayoutView:Z}=ke(),T=Ee(),Q=la(),H=((se=p.sharing)==null?void 0:se.html)??!0,L=((re=p.sharing)==null?void 0:re.wasm)??!0,q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q=ce("server_side_pdf_export"),e[0]=q):q=e[0];let le=q,R=le||s.mode==="present",Re=Ga,O;e[1]===Symbol.for("react.memo_cache_sentinel")?(O=(0,a.jsx)(wt,{size:14,strokeWidth:1.5}),e[1]=O):O=e[1];let V;e[2]===Symbol.for("react.memo_cache_sentinel")?(V=(0,a.jsx)(xe,{size:14,strokeWidth:1.5}),e[2]=V):V=e[2];let M;e[3]===t?M=e[4]:(M=async()=>{if(!t){ie();return}await we({filename:t,includeCode:!0})},e[3]=t,e[4]=M);let B;return e[5]!==u||e[6]!==J||e[7]!==m||e[8]!==o||e[9]!==f||e[10]!==j||e[11]!==y||e[12]!==$||e[13]!==t||e[14]!==K||e[15]!==d||e[16]!==i||e[17]!==n||e[18]!==R||e[19]!==A||e[20]!==b||e[21]!==k||e[22]!==F||e[23]!==X||e[24]!==r||e[25]!==v||e[26]!==z||e[27]!==Z||e[28]!==S||e[29]!==H||e[30]!==L||e[31]!==M||e[32]!==Q||e[33]!==l||e[34]!==T||e[35]!==g||e[36]!==w||e[37]!==G||e[38]!==s.mode?(B=[{icon:O,label:"Download",handle:E,dropdown:[{icon:V,label:"Download as HTML",handle:M},{icon:(0,a.jsx)(xe,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){ie();return}await we({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(na,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let c=await $({download:!1});ve(new Blob([c],{type:"text/plain"}),je.toMarkdown(document.title))}},{icon:(0,a.jsx)(pt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let c=await A();ve(new Blob([c.contents],{type:"text/plain"}),je.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(At,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:s.mode!=="present",tooltip:s.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Me("global.hideCode",!1)]}),handle:Fa},{icon:(0,a.jsx)(vt,{size:14,strokeWidth:1.5}),label:"Download as PDF",disabled:!R,tooltip:R?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Me("global.hideCode",!1)]}),handle:async()=>{if(le){if(!t){ie();return}await mt("Downloading PDF...",async N=>{await sa({takeScreenshots:()=>Q({progress:N}),updateCellOutputs:G}),await ut({filename:t,webpdf:!1})});return}let c=new Event("export-beforeprint"),x=new Event("export-afterprint");(function(){window.dispatchEvent(c),setTimeout($a,0),setTimeout(()=>window.dispatchEvent(x),0)})()}}]},{icon:(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),label:"Share",handle:E,hidden:!H&&!L,dropdown:[{icon:(0,a.jsx)(_t,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!H,handle:async()=>{n((0,a.jsx)(ba,{onClose:o}))}},{icon:(0,a.jsx)(Nt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!L,handle:async()=>{await U(ta({code:(await A()).contents})),C({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:E,dropdown:Qe.flatMap(c=>{let{type:x,Icon:N,hidden:Oe}=c;return Oe?[]:{label:me(x),rightElement:Re(r===x),icon:(0,a.jsx)(N,{size:14,strokeWidth:1.5}),handle:()=>l(x)}})},{icon:(0,a.jsx)(De,{size:14,strokeWidth:1.5}),label:"Present as",handle:E,dropdown:[{icon:s.mode==="present"?(0,a.jsx)(It,{size:14,strokeWidth:1.5}):(0,a.jsx)(Ne,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{T()}},...We.map((c,x)=>{let N=He(c);return{divider:x===0,label:Le(c),icon:(0,a.jsx)(N,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:X===c&&(0,a.jsx)(ge,{size:14})}),handle:()=>{Z(c),s.mode==="edit"&&T()}}})]},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ye(),handle:j},{icon:(0,a.jsx)(_e,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await U((await A()).contents),C({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!K||i,handle:async()=>{let c=Xe(he());await F({configs:ue.fromEntries(c.map(Ya))});for(let x of c)w({cellId:x,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(ot,{onClose:o}))}},{icon:(0,a.jsx)(Pe,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!J||i,handle:()=>{g()}},{icon:(0,a.jsx)(ya,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:b},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)($e,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{m()}},{icon:(0,a.jsx)(gt,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:f,redundant:!0},{icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:y,redundant:!0},{divider:!0,icon:(0,a.jsx)(Se,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>v(Ua)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>z(Ba)},{icon:(0,a.jsx)(Pt,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>S(Va),redundant:!0},{icon:(0,a.jsx)(bt,{size:14,strokeWidth:1.5}),label:"Resources",handle:E,dropdown:[{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Oa},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"GitHub",handle:Ra},{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:qa},{icon:(0,a.jsx)(Wt,{size:14,strokeWidth:1.5}),label:"YouTube",handle:La},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Ha}]},{divider:!0,icon:(0,a.jsx)(St,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:Ta},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:Ea}].filter(Ia).map(Da),e[5]=u,e[6]=J,e[7]=m,e[8]=o,e[9]=f,e[10]=j,e[11]=y,e[12]=$,e[13]=t,e[14]=K,e[15]=d,e[16]=i,e[17]=n,e[18]=R,e[19]=A,e[20]=b,e[21]=k,e[22]=F,e[23]=X,e[24]=r,e[25]=v,e[26]=z,e[27]=Z,e[28]=S,e[29]=H,e[30]=L,e[31]=M,e[32]=Q,e[33]=l,e[34]=T,e[35]=g,e[36]=w,e[37]=G,e[38]=s.mode,e[39]=B):B=e[39],B}function Da(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Pa)}:e}function Pa(e){return!e.hidden}function Ia(e){return!e.hidden}function Ea(){let e=Ht();window.open(e,"_blank")}function Ta(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function Ha(){window.open(_.releasesPage,"_blank")}function La(){window.open(_.youtube,"_blank")}function qa(){window.open(_.discordLink,"_blank")}function Ra(){window.open(_.githubPage,"_blank")}function Oa(){window.open(_.docsPage,"_blank")}function Va(e){return!e}function Ba(e){return!e}function Ua(e){return!e}function Ya(e){return[e,{disabled:!1}]}function $a(){return window.print()}async function Fa(){let e=document.getElementById("App");e&&await ft({element:e,filename:document.title,prepare:yt})}function Ga(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(ge,{size:14})})}function ie(){C({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Ee as a,Ae as c,Te as i,Se as l,qe as n,Pe as o,va as r,Ne as s,Na as t,_e as u};
@@ -1 +1 @@
1
- import{s as n}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-BhXAndur.js";import{f as d,it as f,w as u}from"./cells-DbD2lYze.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-ZmTK25f3.js";import{t as h}from"./use-toast-T0_cQDma.js";import{r as v}from"./useDeleteCell-DHPNhAtW.js";var x=c(),b=n(C(),1);function j(){let t=(0,x.c)(3),{splitCell:o,undoSplitCell:r}=u(),i;return t[0]!==o||t[1]!==r?(i=s=>{let l=d(s.cellId);if(!l)return;let a=f(l);o(s);let{dismiss:e}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),m()},children:"Undo"})}),m=e},t[0]=o,t[1]=r,t[2]=i):i=t[2],p(i)}export{j as t};
1
+ import{s as n}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-BhXAndur.js";import{f as d,it as f,w as u}from"./cells-DbD2lYze.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-ZmTK25f3.js";import{t as h}from"./use-toast-T0_cQDma.js";import{r as v}from"./useDeleteCell-DyGTLzfg.js";var x=c(),b=n(C(),1);function j(){let t=(0,x.c)(3),{splitCell:o,undoSplitCell:r}=u(),i;return t[0]!==o||t[1]!==r?(i=s=>{let l=d(s.cellId);if(!l)return;let a=f(l);o(s);let{dismiss:e}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),m()},children:"Undo"})}),m=e},t[0]=o,t[1]=r,t[2]=i):i=t[2],p(i)}export{j as t};