@marimo-team/frontend 0.14.18-dev5 → 0.14.18-dev7

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 (97) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-s7RGpPDV.js → ConnectedDataExplorerComponent-BaIUQrIX.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CnrulJpr.js → ImageComparisonComponent-CxZdG2CC.js} +1 -1
  3. package/dist/assets/{VegaLite-C2fs5zc3.js → VegaLite-Z6SyB7W8.js} +1 -1
  4. package/dist/assets/{_baseEach-c_dyjc-O.js → _baseEach-7sRlJIgH.js} +1 -1
  5. package/dist/assets/_baseMap-BWr-cWt7.js +1 -0
  6. package/dist/assets/{_baseUniq-MHRYxaEh.js → _baseUniq-Dy351lYO.js} +1 -1
  7. package/dist/assets/{_createAggregator-BRrHJm-S.js → _createAggregator-tuCWwlfU.js} +1 -1
  8. package/dist/assets/{any-language-editor-BvO3QFMF.js → any-language-editor-BamaSKY2.js} +1 -1
  9. package/dist/assets/{architectureDiagram-SUXI7LT5-NdrSJuvB.js → architectureDiagram-SUXI7LT5-DyHBZ4NO.js} +1 -1
  10. package/dist/assets/{blockDiagram-6J76NXCF-ftx5RUcT.js → blockDiagram-6J76NXCF-P-kXumuw.js} +1 -1
  11. package/dist/assets/{c4Diagram-6F6E4RAY-BulMqa-Y.js → c4Diagram-6F6E4RAY-eOHn2Imb.js} +1 -1
  12. package/dist/assets/channel-DIjHgQnY.js +1 -0
  13. package/dist/assets/{chunk-353BL4L5-D5H2iwN7.js → chunk-353BL4L5-CFzyuLAq.js} +1 -1
  14. package/dist/assets/{chunk-67H74DCK-LK08G4lc.js → chunk-67H74DCK-CIWqUdmL.js} +1 -1
  15. package/dist/assets/{chunk-AACKK3MU-B9JAiO5u.js → chunk-AACKK3MU-CxGtIeNv.js} +1 -1
  16. package/dist/assets/{chunk-BFAMUDN2-CZKcG7Hk.js → chunk-BFAMUDN2-DkmobNj4.js} +1 -1
  17. package/dist/assets/{chunk-E2GYISFI-CIXtdUNn.js → chunk-E2GYISFI-WlMag73Q.js} +1 -1
  18. package/dist/assets/{chunk-OW32GOEJ-C4FCmwnP.js → chunk-OW32GOEJ-CC0tAzcX.js} +1 -1
  19. package/dist/assets/{chunk-SKB7J2MH-BaSlr3jl.js → chunk-SKB7J2MH-B0sWSuN_.js} +1 -1
  20. package/dist/assets/{chunk-SZ463SBG-BwDfdiOo.js → chunk-SZ463SBG-CyziA54m.js} +1 -1
  21. package/dist/assets/{circle-play-JsgbRX6G.js → circle-play-Dwg09kFs.js} +1 -1
  22. package/dist/assets/classDiagram-M3E45YP4-C4U43lIZ.js +1 -0
  23. package/dist/assets/classDiagram-v2-YAWTLIQI-C4U43lIZ.js +1 -0
  24. package/dist/assets/clone-ikcipny_.js +1 -0
  25. package/dist/assets/{compile-BGbhA30T.js → compile-BVDfJQ_9.js} +1 -1
  26. package/dist/assets/{dagre-JOIXM2OF-B8vUNw1G.js → dagre-JOIXM2OF-BRUYxN-i.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-5lo5J1Vt.js → data-grid-overlay-editor-DevNFsss.js} +1 -1
  28. package/dist/assets/{diagram-5UYTHUR4-PLDgwO4x.js → diagram-5UYTHUR4-D1ebkB7c.js} +1 -1
  29. package/dist/assets/{diagram-VMROVX33-B5-7SLna.js → diagram-VMROVX33-CMHIBUYK.js} +1 -1
  30. package/dist/assets/{diagram-ZTM2IBQH-BnKr5V6h.js → diagram-ZTM2IBQH-CQeNhQ3t.js} +1 -1
  31. package/dist/assets/{edit-page-CyEUf7VL.js → edit-page-51DFvYwH.js} +4 -4
  32. package/dist/assets/{erDiagram-3M52JZNH-Dk0Y_2Is.js → erDiagram-3M52JZNH-C6F3DP0R.js} +1 -1
  33. package/dist/assets/{flowDiagram-KYDEHFYC-DM8J3haJ.js → flowDiagram-KYDEHFYC-DQWcSkX7.js} +1 -1
  34. package/dist/assets/{ganttDiagram-EK5VF46D-B7MEeaeb.js → ganttDiagram-EK5VF46D-CNQfbuW1.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-GW3U2K7C-ciOWHdK1.js → gitGraphDiagram-GW3U2K7C-BZfR2Xfl.js} +1 -1
  36. package/dist/assets/{glide-data-editor-CeJNWkGL.js → glide-data-editor-DwzS3TXg.js} +4 -4
  37. package/dist/assets/{graph-IzuQV5TV.js → graph-Bq0vR64m.js} +1 -1
  38. package/dist/assets/{home-page-P0hOk_Lu.js → home-page-CJQ1VMV9.js} +1 -1
  39. package/dist/assets/{index-CvNa254z.js → index-B7GtZujm.js} +1 -1
  40. package/dist/assets/{index-DzcdkCgc.js → index-BR-cyQhp.js} +1 -1
  41. package/dist/assets/{index-BqqAIR7p.js → index-BZaudNa5.js} +1 -1
  42. package/dist/assets/{index-DzmGiDPv.js → index-BZpbzPMT.js} +1 -1
  43. package/dist/assets/{index-DyGhL8pb.js → index-BeZw0eoM.js} +1 -1
  44. package/dist/assets/{index-Bw4_53VL.js → index-BefWY6Ah.js} +143 -143
  45. package/dist/assets/{index-DVgehULr.js → index-C1UTEtg5.js} +1 -1
  46. package/dist/assets/{index-D86OE7I-.js → index-CXqV8V8P.js} +1 -1
  47. package/dist/assets/{index-CrnLkrsN.js → index-CjybibWu.js} +1 -1
  48. package/dist/assets/{index-ABc3l5O5.js → index-CsWPsy1S.js} +1 -1
  49. package/dist/assets/{index-DKlX9VbD.js → index-Cwzb6z71.js} +1 -1
  50. package/dist/assets/{index-ZMOxgO0o.js → index-DS7XqCVi.js} +1 -1
  51. package/dist/assets/{index-vOKQtqij.js → index-DaY4V8PZ.js} +1 -1
  52. package/dist/assets/{index-BtVdSmBr.js → index-DdtsvxKy.js} +1 -1
  53. package/dist/assets/{index-DWbP9NKv.js → index-DeUqVCzl.js} +1 -1
  54. package/dist/assets/{index-VEO6hI2a.js → index-Dfp21l4o.js} +1 -1
  55. package/dist/assets/{index-CTxIrFfM.js → index-HpWIL4KJ.js} +1 -1
  56. package/dist/assets/{index-DL31Tmv6.js → index-Wwj7K0Ee.js} +1 -1
  57. package/dist/assets/{index--eqo3Nr1.js → index-f0yOktee.js} +1 -1
  58. package/dist/assets/infoDiagram-LHK5PUON-CJFL3yFq.js +2 -0
  59. package/dist/assets/{journeyDiagram-EWQZEKCU-D-rWvB9c.js → journeyDiagram-EWQZEKCU-Kvt5RCTL.js} +1 -1
  60. package/dist/assets/{kanban-definition-ZSS6B67P-BPrv-lG3.js → kanban-definition-ZSS6B67P-DDnLQNJd.js} +1 -1
  61. package/dist/assets/{layout-C3NQCD38.js → layout-8KGiWycv.js} +1 -1
  62. package/dist/assets/{linear-Dcz3lyvf.js → linear-DMCrL16N.js} +1 -1
  63. package/dist/assets/links-C-BM-9mf.js +17 -0
  64. package/dist/assets/{mermaid-BjMqU7B7.js → mermaid-As26tMDi.js} +4 -4
  65. package/dist/assets/{min-DsZNGHWk.js → min-CLUKABrS.js} +1 -1
  66. package/dist/assets/{mindmap-definition-6CBA2TL7-BZsnMx2y.js → mindmap-definition-6CBA2TL7-BDzdyrL1.js} +1 -1
  67. package/dist/assets/{number-overlay-editor-CzX-JKBj.js → number-overlay-editor-BAKmMwQp.js} +1 -1
  68. package/dist/assets/{pieDiagram-NIOCPIFQ-BjbDT3_7.js → pieDiagram-NIOCPIFQ-C6Ov7bWT.js} +1 -1
  69. package/dist/assets/{quadrantDiagram-2OG54O6I-DwvUEn5y.js → quadrantDiagram-2OG54O6I-B-cbhhfv.js} +1 -1
  70. package/dist/assets/{react-plotly-DsUGZTQl.js → react-plotly-Bpp34INM.js} +1 -1
  71. package/dist/assets/{requirementDiagram-QOLK2EJ7-DnqQ02xB.js → requirementDiagram-QOLK2EJ7-Btb77dUe.js} +1 -1
  72. package/dist/assets/{run-page-Dh1_LBex.js → run-page-pWqG7b1Y.js} +1 -1
  73. package/dist/assets/{sankeyDiagram-4UZDY2LN-CGiEg-KK.js → sankeyDiagram-4UZDY2LN-BhR2psVm.js} +1 -1
  74. package/dist/assets/{sequenceDiagram-SKLFT4DO-Du_9Bhah.js → sequenceDiagram-SKLFT4DO-C_xr2yQx.js} +1 -1
  75. package/dist/assets/{slides-component-DbRb2vqt.js → slides-component-HN-Xdqlh.js} +1 -1
  76. package/dist/assets/{sortBy-DRXBnSF7.js → sortBy-BcgFdWkG.js} +1 -1
  77. package/dist/assets/{stateDiagram-MI5ZYTHO-x_vUiEQz.js → stateDiagram-MI5ZYTHO-Dv5riPA-.js} +1 -1
  78. package/dist/assets/stateDiagram-v2-5AN5P6BG-hUS9gcoI.js +1 -0
  79. package/dist/assets/{storage-C6lB9RSO.js → storage-Jq21wW_t.js} +3 -3
  80. package/dist/assets/{terminal-xOuxdYpY.js → terminal-D2VHCbrK.js} +1 -1
  81. package/dist/assets/{time-CjxeuzoW.js → time-CPWP6Rno.js} +1 -1
  82. package/dist/assets/{timeline-definition-MYPXXCX6-8Kv4fcyB.js → timeline-definition-MYPXXCX6-BRcGCjFD.js} +1 -1
  83. package/dist/assets/{tracing-BAj6E74_.js → tracing-DQ_UQfpK.js} +2 -2
  84. package/dist/assets/{trash-65Vbt3F6.js → trash-nR7lDHRj.js} +1 -1
  85. package/dist/assets/{treemap-75Q7IDZK-DtSMjk1Y.js → treemap-75Q7IDZK-DipLl6qz.js} +1 -1
  86. package/dist/assets/{vega-component-C3aywWbx.js → vega-component-DuBlubLU.js} +1 -1
  87. package/dist/assets/{xychartDiagram-H2YORKM3-D33F1MLE.js → xychartDiagram-H2YORKM3-DU8wjog4.js} +1 -1
  88. package/dist/index.html +1 -1
  89. package/package.json +2 -1
  90. package/dist/assets/_baseMap-CRSErap7.js +0 -1
  91. package/dist/assets/channel-DkujgbuA.js +0 -1
  92. package/dist/assets/classDiagram-M3E45YP4-C27KFaf-.js +0 -1
  93. package/dist/assets/classDiagram-v2-YAWTLIQI-C27KFaf-.js +0 -1
  94. package/dist/assets/clone-BcaRetEG.js +0 -1
  95. package/dist/assets/infoDiagram-LHK5PUON-DM8xmmD0.js +0 -2
  96. package/dist/assets/links-UdVi9TCH.js +0 -17
  97. package/dist/assets/stateDiagram-v2-5AN5P6BG-BmONtexb.js +0 -1
@@ -0,0 +1,17 @@
1
+ import{cd as ms,aO as vs,c as ie,U as S,b as Ke,j as s,fr as ys,fs as xs,a as U,cA as bs,ar as dt,ft as js,T as Fe,fu as Pn,f8 as ws,fv as An,fw as _,fx as Mn,fy as P,fz as D,fA as A,fB as ce,fC as M,bn as ke,fD as Rn,fE as z,fF as J,ac as ze,fG as se,bo as ee,fH as ut,e2 as Ln,fI as Fn,fJ as Is,fK as He,fL as xe,fM as zn,fN as Ss,fO as Hn,fP as ht,fQ as Un,fR as Os,fS as ft,L as G,fT as ne,fU as ks,dP as pt,fV as qn,eI as Cs,ds as Ft,fh as Ns,fW as zt,fX as Ds,fY as Ts,fZ as Bn,f_ as Vn,f$ as Es,al as $e,bd as Ye,eQ as Wn,V as gt,g0 as _s,g1 as Ps,g2 as Gn,g3 as Kn,g4 as As,a6 as ue,et as mt,g5 as $n,a4 as Ht,g6 as Ms,g7 as Rs,a7 as Yn,a8 as Ls,a9 as Fs,g8 as zs,g9 as Hs,ga as Us,b4 as qs,gb as Bs,gc as Vs,gd as Ws,ge as Gs,gf as Ks,gg as $s,cl as Ys,bp as vt,eq as Xs,dL as Xn,ad as Qs,ab as Zs,gh as Js,bl as yt,cg as Qn,gi as eo,gj as Zn,at as Xe,ag as Ne,gk as to,aJ as no,gl as Jn,gm as Ut,aw as ro,_ as er,E as io,gn as so,go as xt,gp as oo,gq as ao,ao as qt,ff as lo,gr as co,gs as uo,gt as ho,gu as fo,gv as po,eo as Qe,dC as bt,gw as go,gx as mo,gy as vo,gz as tr,a5 as yo,gA as xo,gB as bo,gC as jo,b9 as wo,bi as Io,b7 as So}from"./index-BefWY6Ah.js";import{e as Oo}from"./index-DaY4V8PZ.js";/**
2
+ * @license lucide-react v0.525.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ko=ie("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Co=ie("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),nr=ie("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),No=ie("brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]),rr=ie("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),ir=ie("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),Do=ie("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),sr=ie("folder-cog",[["path",{d:"M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3",key:"128dxu"}],["path",{d:"m14.305 19.53.923-.382",key:"3m78fa"}],["path",{d:"m15.228 16.852-.923-.383",key:"npixar"}],["path",{d:"m16.852 15.228-.383-.923",key:"5xggr7"}],["path",{d:"m16.852 20.772-.383.924",key:"dpfhf9"}],["path",{d:"m19.148 15.228.383-.923",key:"1reyyz"}],["path",{d:"m19.53 21.696-.382-.924",key:"1goivc"}],["path",{d:"m20.772 16.852.924-.383",key:"htqkph"}],["path",{d:"m20.772 19.148.924.383",key:"9w9pjp"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]]),To=ie("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),Eo=ie("grid-3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),_o=ie("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),Po=ie("messages-square",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]),Ao=ie("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),Mo=ie("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),Ro=ie("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Lo=ie("youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function Bt(t,e){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Bt(t,e)}function or(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const ar=S.createContext(null);function de(){const t=S.useContext(ar);if(t===null)throw new Error("No Tree Api Provided");return t}const lr=S.createContext(null),cr=S.createContext(null),dr=S.createContext(0);function ur(){S.useContext(dr)}function jt(t,e,n){return Math.max(Math.min(t,n),e)}function hr(t){return t&&t.isLeaf}function fr(t){return t&&t.isInternal&&!t.isOpen}function pr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const gr=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},mr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Vt(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Vt(n,e);if(r)return r}return null}function wt(t,e){if(e(t),t.children)for(let n of t.children)wt(n,e)}function vr(t){const e=xr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Fo(e,r);break}n==null||n.focus()}function yr(t){const e=xr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=zo(e,r);break}n==null||n.focus()}function Fo(t,e){return e+1<t.length?t[e+1]:t[0]}function zo(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function xr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function Ze(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function br(t){return t===null?null:De(t)}function De(t){return typeof t=="string"?t:t.id}function jr(t,...e){if(t)return t(...e)}function wr(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function Ir(t){var e,n;const r=t.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:(n=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}function Sr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const Ho=Object.freeze(Object.defineProperty({__proto__:null,access:Ze,bound:jt,dfs:Vt,focusNextElement:vr,focusPrevElement:yr,getInsertIndex:Ir,getInsertParentId:Sr,identify:De,identifyNull:br,indexOf:mr,isClosed:fr,isDescendant:gr,isItem:hr,isOpenWithEmptyChildren:pr,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:jr,waitFor:wr,walk:wt},Symbol.toStringTag,{value:"Module"})),Uo={display:"flex",alignItems:"center",zIndex:1},qo={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Bo={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Vo=Ke.memo(function({top:t,left:e,indent:n}){const r={position:"absolute",pointerEvents:"none",top:t-2+"px",left:e+"px",right:n+"px"};return s.jsxs("div",{style:Object.assign(Object.assign({},Uo),r),children:[s.jsx("div",{style:Object.assign({},Bo)}),s.jsx("div",{style:Object.assign({},qo)})]})});function Wo({node:t,attrs:e,innerRef:n,children:r}){return s.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function Go(t){return s.jsxs("div",{ref:t.dragHandle,style:t.style,children:[s.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"\u{1F333}":t.node.isOpen?"\u{1F5C1}":"\u{1F5C0}"})," ",t.node.isEditing?s.jsx($o,Object.assign({},t)):s.jsx(Ko,Object.assign({},t))]})}function Ko(t){return s.jsx(s.Fragment,{children:s.jsx("span",{children:t.node.data.name})})}function $o({node:t}){const e=S.useRef();return S.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),s.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:n=>{var r;n.key==="Escape"&&t.reset(),n.key==="Enter"&&t.submit(((r=e.current)===null||r===void 0?void 0:r.value)||"")}})}function Wt(t){return{type:"EDIT",id:t}}function Ue(t){return{type:"FOCUS",id:t}}class Rt{constructor(e){this.handleClick=n=>{n.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():n.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===Je}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,n;const r=this.childIndex;return(n=(e=this.parent)===null||e===void 0?void 0:e.children[r+1])!==null&&n!==void 0?n:null}isAncestorOf(e){if(!e)return!1;let n=e;for(;n;){if(n.id===this.id)return!0;n=n.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new Rt(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Je="__REACT_ARBORIST_INTERNAL_ROOT__";function Or(t){var e;function n(o,a,l){const c=t.accessId(o),d=new Rt({tree:t,data:o,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),u=t.accessChildren(o);return u&&(d.children=u.map(g=>n(g,a+1,d))),d}const r=new Rt({tree:t,id:Je,data:{id:Je},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return r.children=i.map(o=>n(o,0,r)),r}const Gt={open:(t,e)=>({type:"VISIBILITY_OPEN",id:t,filtered:e}),close:(t,e)=>({type:"VISIBILITY_CLOSE",id:t,filtered:e}),toggle:(t,e)=>({type:"VISIBILITY_TOGGLE",id:t,filtered:e}),clear:t=>({type:"VISIBILITY_CLEAR",filtered:t})};function kr(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const n=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!n})}return e.type==="VISIBILITY_CLEAR"?{}:t}const qe=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Yo=t=>({type:"SELECTION_ONLY",id:De(t)}),Cr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(De)}),Nr=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(De)}),Xo=t=>Object.assign({type:"SELECTION_SET"},t),Kt=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:De(t)}),Dr=t=>({type:"SELECTION_ANCHOR",id:t===null?null:De(t)}),Be={cursor:t=>({type:"DND_CURSOR",cursor:t}),dragStart:(t,e)=>({type:"DND_DRAG_START",id:t,dragIds:e}),dragEnd:()=>({type:"DND_DRAG_END"}),hovering:(t,e)=>({type:"DND_HOVERING",parentId:t,index:e})},Qo={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Zo=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Jo=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Tr({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return s.jsxs(ea,{isDragging:i,children:[s.jsx(ta,{offset:t,children:s.jsx(ra,{id:n,dragIds:r})}),s.jsx(na,{mouse:e,count:r.length})]})}const ea=S.memo(function(t){return t.isDragging?s.jsx("div",{style:Qo,children:t.children}):null});function ta(t){return s.jsx("div",{className:"row preview",style:Zo(t.offset),children:t.children})}function na(t){const{count:e,mouse:n}=t;return e>1?s.jsx("div",{className:"selected-count",style:Jo(n),children:e}):null}const ra=S.memo(function(t){const e=de(),n=e.get(t.id);return n?s.jsx(e.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var Er=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function ia(t,e){return t===e||!(!Er(t)||!Er(e))}function sa(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!ia(t[n],e[n]))return!1;return!0}function $t(t,e){var n;e===void 0&&(e=sa);var r,i=[],o=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&e(a,i)||(r=t.apply(this,a),o=!0,n=this,i=a),r}}var _r=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function Pr(t){cancelAnimationFrame(t.id)}var Yt=-1;function Ar(t){if(t===void 0&&(t=!1),Yt===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Yt=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Yt}var et=null;function Mr(t){if(t===void 0&&(t=!1),et===null||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?et="positive-descending":(e.scrollLeft=1,et=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),et}return et}var oa=function(t,e){return t};function aa(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,c=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,u=t.validateProps;return e=function(g){function p(h){var f;return(f=g.call(this,h)||this)._instanceProps=c(f.props,or(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:or(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=$t(function(v,x,b,j){return f.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:x,visibleStartIndex:b,visibleStopIndex:j})}),f._callOnScroll=void 0,f._callOnScroll=$t(function(v,x,b){return f.props.onScroll({scrollDirection:v,scrollOffset:x,scrollUpdateWasRequested:b})}),f._getItemStyle=void 0,f._getItemStyle=function(v){var x,b=f.props,j=b.direction,O=b.itemSize,w=b.layout,N=f._getItemStyleCache(d&&O,d&&w,d&&j);if(N.hasOwnProperty(v))x=N[v];else{var C=n(f.props,v,f._instanceProps),T=i(f.props,v,f._instanceProps),R=j==="horizontal"||w==="horizontal",F=j==="rtl",B=R?C:0;N[v]=x={position:"absolute",left:F?void 0:B,right:F?B:void 0,top:R?0:C,height:R?"100%":T,width:R?T:"100%"}}return x},f._getItemStyleCache=void 0,f._getItemStyleCache=$t(function(v,x,b){return{}}),f._onScrollHorizontal=function(v){var x=v.currentTarget,b=x.clientWidth,j=x.scrollLeft,O=x.scrollWidth;f.setState(function(w){if(w.scrollOffset===j)return null;var N=f.props.direction,C=j;if(N==="rtl")switch(Mr()){case"negative":C=-j;break;case"positive-descending":C=O-b-j}return C=Math.max(0,Math.min(C,O-b)),{isScrolling:!0,scrollDirection:w.scrollOffset<C?"forward":"backward",scrollOffset:C,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(v){var x=v.currentTarget,b=x.clientHeight,j=x.scrollHeight,O=x.scrollTop;f.setState(function(w){if(w.scrollOffset===O)return null;var N=Math.max(0,Math.min(O,j-b));return{isScrolling:!0,scrollDirection:w.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(v){var x=f.props.outerRef;f._outerRef=v,typeof x=="function"?x(v):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=v)},f._resetIsScrollingDebounced=function(){var v,x,b,j;f._resetIsScrollingTimeoutId!==null&&Pr(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=(v=f._resetIsScrolling,x=150,b=_r(),j={id:requestAnimationFrame(function O(){_r()-b>=x?v.call(null):j.id=requestAnimationFrame(O)})})},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}(function(h,f){h.prototype=Object.create(f.prototype),h.prototype.constructor=h,Bt(h,f)})(p,g),p.getDerivedStateFromProps=function(h,f){return la(h,f),u(h),null};var m=p.prototype;return m.scrollTo=function(h){h=Math.max(0,h),this.setState(function(f){return f.scrollOffset===h?null:{scrollDirection:f.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(h,f){f===void 0&&(f="auto");var v=this.props,x=v.itemCount,b=v.layout,j=this.state.scrollOffset;h=Math.max(0,Math.min(h,x-1));var O=0;if(this._outerRef){var w=this._outerRef;O=b==="vertical"?w.scrollWidth>w.clientWidth?Ar():0:w.scrollHeight>w.clientHeight?Ar():0}this.scrollTo(o(this.props,h,f,j,this._instanceProps,O))},m.componentDidMount=function(){var h=this.props,f=h.direction,v=h.initialScrollOffset,x=h.layout;if(typeof v=="number"&&this._outerRef!=null){var b=this._outerRef;f==="horizontal"||x==="horizontal"?b.scrollLeft=v:b.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,f=h.direction,v=h.layout,x=this.state,b=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var j=this._outerRef;if(f==="horizontal"||v==="horizontal")if(f==="rtl")switch(Mr()){case"negative":j.scrollLeft=-b;break;case"positive-ascending":j.scrollLeft=b;break;default:var O=j.clientWidth,w=j.scrollWidth;j.scrollLeft=w-O-b}else j.scrollLeft=b;else j.scrollTop=b}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Pr(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,f=h.children,v=h.className,x=h.direction,b=h.height,j=h.innerRef,O=h.innerElementType,w=h.innerTagName,N=h.itemCount,C=h.itemData,T=h.itemKey,R=T===void 0?oa:T,F=h.layout,B=h.outerElementType,Q=h.outerTagName,$=h.style,W=h.useIsScrolling,Y=h.width,V=this.state.isScrolling,K=x==="horizontal"||F==="horizontal",X=K?this._onScrollHorizontal:this._onScrollVertical,I=this._getRangeToRender(),y=I[0],k=I[1],we=[];if(N>0)for(var ye=y;ye<=k;ye++)we.push(S.createElement(f,{data:C,key:R(ye,C),index:ye,isScrolling:W?V:void 0,style:this._getItemStyle(ye)}));var Ie=r(this.props,this._instanceProps);return S.createElement(B||Q||"div",{className:v,onScroll:X,ref:this._outerRefSetter,style:ys({position:"relative",height:b,width:Y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},$)},S.createElement(O||w||"div",{children:we,ref:j,style:{height:K?"100%":Ie,pointerEvents:V?"none":void 0,width:K?Ie:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var h=this._getRangeToRender(),f=h[0],v=h[1],x=h[2],b=h[3];this._callOnItemsRendered(f,v,x,b)}if(typeof this.props.onScroll=="function"){var j=this.state,O=j.scrollDirection,w=j.scrollOffset,N=j.scrollUpdateWasRequested;this._callOnScroll(O,w,N)}},m._getRangeToRender=function(){var h=this.props,f=h.itemCount,v=h.overscanCount,x=this.state,b=x.isScrolling,j=x.scrollDirection,O=x.scrollOffset;if(f===0)return[0,0,0,0];var w=a(this.props,O,this._instanceProps),N=l(this.props,w,O,this._instanceProps),C=b&&j!=="backward"?1:Math.max(1,v),T=b&&j!=="forward"?1:Math.max(1,v);return[Math.max(0,w-C),Math.max(0,Math.min(f-1,N+T)),w,N]},p}(S.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var la=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},ca=aa({getItemOffset:function(t,e){return e*t.itemSize},getItemSize:function(t,e){return t.itemSize},getEstimatedTotalSize:function(t){var e=t.itemCount;return t.itemSize*e},getOffsetForIndexAndAlignment:function(t,e,n,r,i,o){var a=t.direction,l=t.height,c=t.itemCount,d=t.itemSize,u=t.layout,g=t.width,p=a==="horizontal"||u==="horizontal"?g:l,m=Math.max(0,c*d-p),h=Math.min(m,e*d),f=Math.max(0,e*d-p+d+o);switch(n==="smart"&&(n=r>=f-p&&r<=h+p?"auto":"center"),n){case"start":return h;case"end":return f;case"center":var v=Math.round(f+(h-f)/2);return v<Math.ceil(p/2)?0:v>m+Math.floor(p/2)?m:v;default:return r>=f&&r<=h?r:r<f?f:h}},getStartIndexForOffset:function(t,e){var n=t.itemCount,r=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(e/r)))},getStopIndexForStartIndex:function(t,e,n){var r=t.direction,i=t.height,o=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,d=e*a,u=r==="horizontal"||l==="horizontal"?c:i,g=Math.ceil((u+n-d)/a);return Math.max(0,Math.min(o-1,e+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function da(){var t,e;const n=de(),r=function(){const c=S.useContext(cr);if(c===null)throw new Error("Provide a DnDContext");return c}().cursor;if(!r||r.type!=="line")return null;const i=n.indent,o=n.rowHeight*r.index+((e=(t=n.props.padding)!==null&&t!==void 0?t:n.props.paddingTop)!==null&&e!==void 0?e:0),a=i*r.level,l=n.renderCursor;return s.jsx(l,{top:o,left:a,indent:i})}var ua=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const ha=S.forwardRef(function(t,e){const{children:n}=t,r=ua(t,["children"]),i=de();return s.jsxs("div",Object.assign({ref:e},r,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[s.jsx(fa,{}),n]}))}),fa=()=>{const t=de();return s.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:s.jsx(da,{})})};var pa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const ga=S.forwardRef(function(t,e){var n,r,i,o,{style:a}=t,l=pa(t,["style"]);const c=de(),d=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,u=(o=(i=c.props.padding)!==null&&i!==void 0?i:c.props.paddingBottom)!==null&&o!==void 0?o:0;return s.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+u}px`})},l))});var he,Rr=S.createContext({dragDropManager:void 0});function E(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(o=new Error(e.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw o.framesToPop=1,o}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(he||(he={}));var Xt="dnd-core/INIT_COORDS",Qt="dnd-core/BEGIN_DRAG",Lr="dnd-core/PUBLISH_DRAG_SOURCE",It="dnd-core/HOVER",Zt="dnd-core/DROP",Jt="dnd-core/END_DRAG";function Fr(t,e){return{type:Xt,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function en(t){return en=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en(t)}function zr(t){return en(t)==="object"}var ma={type:Xt,payload:{clientOffset:null,sourceClientOffset:null}};function va(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},r=n.publishSource,i=r===void 0||r,o=n.clientOffset,a=n.getSourceClientOffset,l=t.getMonitor(),c=t.getRegistry();t.dispatch(Fr(o)),function(m,h,f){E(!h.isDragging(),"Cannot call beginDrag while dragging."),m.forEach(function(v){E(f.getSource(v),"Expected sourceIds to be registered.")})}(e,l,c);var d=function(m,h){for(var f=null,v=m.length-1;v>=0;v--)if(h.canDragSource(m[v])){f=m[v];break}return f}(e,l);if(d!==null){var u=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");(function(m){E(typeof m=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),u=a(d)}t.dispatch(Fr(o,u));var g=c.getSource(d).beginDrag(l,d);if(g!=null){(function(m){E(zr(m),"Item must be an object.")})(g),c.pinSource(d);var p=c.getSourceType(d);return{type:Qt,payload:{itemType:p,item:g,sourceId:d,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else t.dispatch(ma)}}function ya(t){return function(){if(t.getMonitor().isDragging())return{type:Lr}}}function tn(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function xa(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){E(Array.isArray(a),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),o=t.getRegistry();return function(a,l,c){E(l.isDragging(),"Cannot call hover while not dragging."),E(!l.didDrop(),"Cannot call hover after drop.");for(var d=0;d<a.length;d++){var u=a[d];E(a.lastIndexOf(u)===d,"Expected targetIds to be unique in the passed array."),E(c.getTarget(u),"Expected targetIds to be registered.")}}(r,i,o),function(a,l,c){for(var d=a.length-1;d>=0;d--){var u=a[d];tn(l.getTargetType(u),c)||a.splice(d,1)}}(r,o,i.getItemType()),function(a,l,c){a.forEach(function(d){c.getTarget(d).hover(l,d)})}(r,i,o),{type:It,payload:{targetIds:r,clientOffset:n||null}}}}function Hr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ur(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(n),!0).forEach(function(r){ba(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ba(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ja(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(o){E(o.isDragging(),"Cannot call drop while not dragging."),E(!o.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(o){var a=o.getTargetIds().filter(o.canDropOnTarget,o);return a.reverse(),a}(n);i.forEach(function(o,a){var l=function(d,u,g,p){var m=g.getTarget(d),h=m?m.drop(p,d):void 0;return function(f){E(f===void 0||zr(f),"Drop result must either be an object or undefined.")}(h),h===void 0&&(h=u===0?{}:p.getDropResult()),h}(o,a,r,n),c={type:Zt,payload:{dropResult:Ur(Ur({},e),l)}};t.dispatch(c)})}}function wa(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){E(i.isDragging(),"Cannot call endDrag while not dragging.")})(e);var r=e.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(e,r),n.unpinSource()),{type:Jt}}}function Ia(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function tt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sa=function(){function t(e,n){var r=this;(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),tt(this,"store",void 0),tt(this,"monitor",void 0),tt(this,"backend",void 0),tt(this,"isSetUp",!1),tt(this,"handleRefCountChange",function(){var i=r.store.getState().refCount>0;r.backend&&(i&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!i&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}return Ia(t,[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,n=this.store.dispatch,r=function(i){return{beginDrag:va(i),publishDragSource:ya(i),hover:xa(i),drop:ja(i),endDrag:wa(i)}}(this);return Object.keys(r).reduce(function(i,o){var a,l=r[o];return i[o]=(a=l,function(){for(var c=arguments.length,d=new Array(c),u=0;u<c;u++)d[u]=arguments[u];var g=a.apply(e,d);g!==void 0&&n(g)}),i},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t}();function fe(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var qr=typeof Symbol=="function"&&Symbol.observable||"@@observable",Br=function(){return Math.random().toString(36).substring(7).split("").join(".")},Vr={INIT:"@@redux/INIT"+Br(),REPLACE:"@@redux/REPLACE"+Br()};function Wr(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(fe(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(fe(1));return n(Wr)(t,e)}if(typeof t!="function")throw new Error(fe(2));var i=t,o=e,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function u(){if(c)throw new Error(fe(3));return o}function g(m){if(typeof m!="function")throw new Error(fe(4));if(c)throw new Error(fe(5));var h=!0;return d(),l.push(m),function(){if(h){if(c)throw new Error(fe(6));h=!1,d();var f=l.indexOf(m);l.splice(f,1),a=null}}}function p(m){if(!function(v){if(typeof v!="object"||v===null)return!1;for(var x=v;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(v)===x}(m))throw new Error(fe(7));if(m.type===void 0)throw new Error(fe(8));if(c)throw new Error(fe(9));try{c=!0,o=i(o,m)}finally{c=!1}for(var h=a=l,f=0;f<h.length;f++)(0,h[f])();return m}return p({type:Vr.INIT}),(r={dispatch:p,subscribe:g,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(fe(10));i=m,p({type:Vr.REPLACE})}})[qr]=function(){var m,h=g;return(m={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(fe(11));function v(){f.next&&f.next(u())}return v(),{unsubscribe:h(v)}}})[qr]=function(){return this},m},r}var Oa=function(t,e){return t===e};function Gr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Kr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(n),!0).forEach(function(r){ka(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ka(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $r={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ca(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$r,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Xt:case Qt:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case It:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:Kr(Kr({},n),{},{clientOffset:i.clientOffset});case Jt:case Zt:return $r;default:return n}}var nn="dnd-core/ADD_SOURCE",rn="dnd-core/ADD_TARGET",sn="dnd-core/REMOVE_SOURCE",St="dnd-core/REMOVE_TARGET";function Yr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function pe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(n),!0).forEach(function(r){Na(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Na(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Da={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ta(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Da,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Qt:return pe(pe({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Lr:return pe(pe({},n),{},{isSourcePublic:!0});case It:return pe(pe({},n),{},{targetIds:i.targetIds});case St:return n.targetIds.indexOf(i.targetId)===-1?n:pe(pe({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(o){return o!==e}))});case Zt:return pe(pe({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Jt:return pe(pe({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Ea(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case nn:case rn:return t+1;case sn:case St:return t-1;default:return t}}var Ot=[],on=[];function _a(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case It:break;case nn:case rn:case St:case sn:return Ot;default:return on}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=function(u,g){var p=new Map,m=function(f){p.set(f,p.has(f)?p.get(f)+1:1)};u.forEach(m),g.forEach(m);var h=[];return p.forEach(function(f,v){f===1&&h.push(v)}),h}(r,o),l=a.length>0||!function(u,g){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oa;if(u.length!==g.length)return!1;for(var m=0;m<u.length;++m)if(!p(u[m],g[m]))return!1;return!0}(r,o);if(!l)return Ot;var c=o[o.length-1],d=r[r.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function Pa(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Xr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(n),!0).forEach(function(r){Aa(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Aa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ma(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:_a(r.dirtyHandlerIds,{type:i.type,payload:Qr(Qr({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(o,a){return o&&o[a]?o[a]:n||null},t))})}),dragOffset:Ca(r.dragOffset,i),refCount:Ea(r.refCount,i),dragOperation:Ta(r.dragOperation,i),stateId:Pa(r.stateId)}}function Zr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ra(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Jr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Ot.__IS_NONE__=!0,on.__IS_ALL__=!0;var La=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Jr(this,"store",void 0),Jr(this,"registry",void 0),this.store=e,this.registry=n}return Ra(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;E(typeof e=="function","listener must be a function."),E(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId;return this.store.subscribe(function(){var o=n.store.getState(),a=o.stateId;try{var l=a===i||a===i+1&&!function(c,d){if(c===Ot)return!1;if(c===on||d===void 0)return!0;var u,g=(u=c,d.filter(function(p){return u.indexOf(p)>-1}));return g.length>0}(o.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;E(typeof e=="function","listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe(function(){var i=n.store.getState().dragOffset;i!==r&&(r=i,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e);return E(n,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&n.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var n=this.registry.getTarget(e);return E(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&tn(this.registry.getTargetType(e),this.getItemType())&&n.canDrop(this,e)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var n=this.registry.getSource(e,!0);return E(n,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&n.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!tn(r,i))return!1;var o=this.getTargetIds();if(!o.length)return!1;var a=o.indexOf(e);return n?a===o.length-1:a>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return e=this.store.getState().dragOffset,i=e.clientOffset,o=e.initialClientOffset,a=e.initialSourceClientOffset,i&&o&&a?Zr((r=a,{x:(n=i).x+r.x,y:n.y+r.y}),o):null;var e,n,r,i,o,a}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,r=e.initialClientOffset,n&&r?Zr(n,r):null;var e,n,r}}]),t}(),Fa=0;function an(t){return an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},an(t)}function ln(t,e){e&&Array.isArray(t)?t.forEach(function(n){return ln(n,!1)}):E(typeof t=="string"||an(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const ei=typeof global<"u"?global:self,ti=ei.MutationObserver||ei.WebKitMutationObserver;function ni(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const za=typeof ti=="function"?function(t){let e=1;const n=new ti(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:ni;class Ha{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}const ri=new class{enqueueTask(t){const{queue:e,requestFlush:n}=this;e.length||(n(),this.flushing=!0),e[e.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const e=this.index;if(this.index++,t[e].call(),this.index>this.capacity){for(let n=0,r=t.length-this.index;n<r;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=za(this.flush),this.requestErrorThrow=ni(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Ua=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Ha(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(ri.registerPendingError);function qa(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ve(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ba(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ii(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ii(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ii(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Va(t){var e=(Fa++).toString();switch(t){case he.SOURCE:return"S".concat(e);case he.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function si(t){switch(t[0]){case"S":return he.SOURCE;case"T":return he.TARGET;default:E(!1,"Cannot parse handler ID: ".concat(t))}}function oi(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done;if(Ba(i.value,2)[1]===e)return!0;r=!!o}while(!r);return!1}var Wa=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ve(this,"types",new Map),Ve(this,"dragSources",new Map),Ve(this,"dropTargets",new Map),Ve(this,"pinnedSourceId",null),Ve(this,"pinnedSource",null),Ve(this,"store",void 0),this.store=e}return qa(t,[{key:"addSource",value:function(e,n){ln(e),function(i){E(typeof i.canDrag=="function","Expected canDrag to be a function."),E(typeof i.beginDrag=="function","Expected beginDrag to be a function."),E(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(he.SOURCE,e,n);return this.store.dispatch(function(i){return{type:nn,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){ln(e,!0),function(i){E(typeof i.canDrop=="function","Expected canDrop to be a function."),E(typeof i.hover=="function","Expected hover to be a function."),E(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(he.TARGET,e,n);return this.store.dispatch(function(i){return{type:rn,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return oi(this.dragSources,e)||oi(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return E(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return E(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return E(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return E(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return si(e)===he.SOURCE}},{key:"isTargetId",value:function(e){return si(e)===he.TARGET}},{key:"removeSource",value:function(e){var n,r=this;E(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:sn,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},ri.enqueueTask(Ua.create(n))}},{key:"removeTarget",value:function(e){E(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:St,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);E(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){E(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=Va(e);return this.types.set(i,n),e===he.SOURCE?this.dragSources.set(i,r):e===he.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function Ga(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=function(l){var c=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Wr(Ma,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new La(r,new Wa(r)),o=new Sa(r,i),a=t(o,e,n);return o.receiveBackend(a),o}var Ka=["children"];function $a(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ai(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ai(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ai(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ya(t,e){if(t==null)return{};var n,r,i=function(a,l){if(a==null)return{};var c,d,u={},g=Object.keys(a);for(d=0;d<g.length;d++)c=g[d],l.indexOf(c)>=0||(u[c]=a[c]);return u}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var li=0,kt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Xa=S.memo(function(t){var e=t.children,n=function(a){if("manager"in a)return[{dragDropManager:a.manager},!1];var l=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ci(),g=arguments.length>2?arguments[2]:void 0,p=arguments.length>3?arguments[3]:void 0,m=u;return m[kt]||(m[kt]={dragDropManager:Ga(d,u,g,p)}),m[kt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(Ya(t,Ka)),r=$a(n,2),i=r[0],o=r[1];return S.useEffect(function(){if(o){var a=ci();return++li,function(){--li===0&&(a[kt]=null)}}},[]),s.jsx(Rr.Provider,Object.assign({value:i},{children:e}),void 0)});function ci(){return typeof global<"u"?global:window}function Qa(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function di(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cn=!1,dn=!1,Za=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),di(this,"internalMonitor",void 0),di(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Qa(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){E(!cn,"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 cn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{cn=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;E(!dn,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return dn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{dn=!1}}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,n){return this.internalMonitor.isOverTarget(e,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function Ja(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function ui(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var un=!1,el=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),ui(this,"internalMonitor",void 0),ui(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Ja(t,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;E(!un,"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 un=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{un=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function tl(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!S.isValidElement(e)){var r=e;return t(r,n),r}var i=e;(function(a){if(typeof a.type!="string"){var l=a.type.displayName||a.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(l," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}})(i);var o=n?function(a){return t(a,n)}:t;return function(a,l){var c=a.ref;return E(typeof c!="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"),c?S.cloneElement(a,{ref:function(d){fi(c,d),fi(l,d)}}):S.cloneElement(a,{ref:l})}(i,o)}}function hi(t){var e={};return Object.keys(t).forEach(function(n){var r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{var i=tl(r);e[n]=function(){return i}}}),e}function fi(t,e){typeof t=="function"?t(e):t.current=e}function hn(t){return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hn(t)}function fn(t){return t!==null&&hn(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function pn(t,e,n,r){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),c=0;c<o.length;c++){var d=o[c];if(!l(d))return!1;var u=t[d],g=e[d];if((i=void 0)===!1||i===void 0&&u!==g)return!1}return!0}function nl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function oe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rl=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),oe(this,"hooks",hi({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,fn(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,fn(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),oe(this,"handlerId",null),oe(this,"dragSourceRef",null),oe(this,"dragSourceNode",void 0),oe(this,"dragSourceOptionsInternal",null),oe(this,"dragSourceUnsubscribe",void 0),oe(this,"dragPreviewRef",null),oe(this,"dragPreviewNode",void 0),oe(this,"dragPreviewOptionsInternal",null),oe(this,"dragPreviewUnsubscribe",void 0),oe(this,"lastConnectedHandlerId",null),oe(this,"lastConnectedDragSource",null),oe(this,"lastConnectedDragSourceOptions",null),oe(this,"lastConnectedDragPreview",null),oe(this,"lastConnectedDragPreviewOptions",null),oe(this,"backend",void 0),this.backend=e}return nl(t,[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();n&&this.disconnectDragSource(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(e?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!pn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!pn(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t}();function il(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function be(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var sl=function(){function t(e){var n=this;(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),be(this,"hooks",hi({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,fn(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),be(this,"handlerId",null),be(this,"dropTargetRef",null),be(this,"dropTargetNode",void 0),be(this,"dropTargetOptionsInternal",null),be(this,"unsubscribeDropTarget",void 0),be(this,"lastConnectedHandlerId",null),be(this,"lastConnectedDropTarget",null),be(this,"lastConnectedDropTargetOptions",null),be(this,"backend",void 0),this.backend=e}return il(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var n=this.dropTarget;this.handlerId&&(n?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions)):this.lastConnectedDropTarget=n)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!pn(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t}(),Te=typeof window<"u"?S.useLayoutEffect:S.useEffect;function gn(t){return gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gn(t)}function ol(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function mn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var al=function(){function t(e,n,r){(function(i,o){if(!(i instanceof o))throw new TypeError("Cannot call a class as a function")})(this,t),mn(this,"spec",void 0),mn(this,"monitor",void 0),mn(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return ol(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=gn(n.item)==="object"?n.item:typeof n.item=="function"?n.item(r):{})!==null&&e!==void 0?e:null}},{key:"canDrag",value:function(){var e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag!="function"||e.canDrag(n)}},{key:"isDragging",value:function(e,n){var r=this.spec,i=this.monitor,o=r.isDragging;return o?o(i):n===e.getSourceId()}},{key:"endDrag",value:function(){var e=this.spec,n=this.monitor,r=this.connector,i=e.end;i&&i(n.getItem(),n),r.reconnect()}}]),t}();function Ee(){var t=S.useContext(Rr).dragDropManager;return E(t!=null,"Expected drag drop context"),t}function ll(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return pi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return pi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function cl(t,e,n){var r=Ee(),i=function(a,l,c){var d=S.useMemo(function(){return new al(a,l,c)},[l,c]);return S.useEffect(function(){d.spec=a},[a]),d}(t,e,n),o=function(a){return S.useMemo(function(){var l=a.type;return E(l!=null,"spec.type must be defined"),l},[a])}(t);Te(function(){if(o!=null){var a=function(u,g,p){var m=p.getRegistry(),h=m.addSource(u,g);return[h,function(){return m.removeSource(h)}]}(o,i,r),l=ll(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,i,o])}function dl(t){return function(e){if(Array.isArray(e))return vn(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return vn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vn(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function vn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gi(t,e){var n=dl(e||[]);return e==null&&typeof t!="function"&&n.push(t),S.useMemo(function(){return typeof t=="function"?t():t},n)}function ul(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return mi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return mi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function mi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vi(t,e,n){var r=ul(S.useState(function(){return e(t)}),2),i=r[0],o=r[1],a=S.useCallback(function(){var l=e(t);Oo(i,l)||(o(l),n&&n())},[i,t,n]);return Te(a),[i,a]}function hl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return yi(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return yi(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function yi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xi(t,e,n){return function(r,i,o){var a=hl(vi(r,i,o),2),l=a[0],c=a[1];return Te(function(){var d=r.getHandlerId();if(d!=null)return r.subscribeToStateChange(c,{handlerIds:[d]})},[r,c]),l}(e,t||function(){return{}},function(){return n.reconnect()})}function fl(t){return S.useMemo(function(){return t.hooks.dragSource()},[t])}function pl(t){return S.useMemo(function(){return t.hooks.dragPreview()},[t])}function gl(t,e){var n=gi(t,e);E(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r,i=(r=Ee(),S.useMemo(function(){return new Za(r)},[r])),o=function(a,l){var c=Ee(),d=S.useMemo(function(){return new rl(c.getBackend())},[c]);return Te(function(){return d.dragSourceOptions=a||null,d.reconnect(),function(){return d.disconnectDragSource()}},[d,a]),Te(function(){return d.dragPreviewOptions=l||null,d.reconnect(),function(){return d.disconnectDragPreview()}},[d,l]),d}(n.options,n.previewOptions);return cl(n,i,o),[xi(n.collect,i,o),fl(o),pl(o)]}function ml(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function bi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vl=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),bi(this,"spec",void 0),bi(this,"monitor",void 0),this.spec=e,this.monitor=n}return ml(t,[{key:"canDrop",value:function(){var e=this.spec,n=this.monitor;return!e.canDrop||e.canDrop(n.getItem(),n)}},{key:"hover",value:function(){var e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}},{key:"drop",value:function(){var e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}}]),t}();function yl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ji(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ji(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ji(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xl(t,e,n){var r=Ee(),i=function(a,l){var c=S.useMemo(function(){return new vl(a,l)},[l]);return S.useEffect(function(){c.spec=a},[a]),c}(t,e),o=function(a){var l=a.accept;return S.useMemo(function(){return E(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Te(function(){var a=function(u,g,p){var m=p.getRegistry(),h=m.addTarget(u,g);return[h,function(){return m.removeTarget(h)}]}(o,i,r),l=yl(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,i,n,o.map(function(a){return a.toString()}).join("|")])}function bl(t){return S.useMemo(function(){return t.hooks.dropTarget()},[t])}function wi(t,e){var n,r=gi(t,e),i=(n=Ee(),S.useMemo(function(){return new el(n)},[n])),o=function(a){var l=Ee(),c=S.useMemo(function(){return new sl(l.getBackend())},[l]);return Te(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return xl(r,i,o),[xi(r.collect,i,o),bl(o)]}function jl(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(o=i.next()).done)&&(l.push(o.value),!r||l.length!==r);c=!0);}catch(u){d=!0,a=u}finally{try{c||i.return==null||i.return()}finally{if(d)throw a}}return l}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Ii(n,r);var i=Object.prototype.toString.call(n).slice(8,-1);if(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")return Array.from(n);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ii(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ii(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Si(t){var e=null;return function(){return e==null&&(e=t()),e}}function wl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Oi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Il=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Oi(this,"entered",[]),Oi(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return wl(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,o){var a=new Set,l=function(d){return a.add(d)};i.forEach(l),o.forEach(l);var c=[];return a.forEach(function(d){return c.push(d)}),c}(this.entered.filter(function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(e))}),[e]),r===0&&this.entered.length>0}},{key:"leave",value:function(e){var n,r,i=this.entered.length;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(function(o){return o!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),Sl=Si(function(){return/firefox/i.test(navigator.userAgent)}),ki=Si(function(){return!!window.safari});function Ol(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function nt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ci=function(){function t(e,n){(function(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")})(this,t),nt(this,"xs",void 0),nt(this,"ys",void 0),nt(this,"c1s",void 0),nt(this,"c2s",void 0),nt(this,"c3s",void 0);for(var r=e.length,i=[],o=0;o<r;o++)i.push(o);i.sort(function(T,R){return e[T]<e[R]?-1:1});for(var a,l,c=[],d=[],u=0;u<r-1;u++)a=e[u+1]-e[u],l=n[u+1]-n[u],c.push(a),d.push(l/a);for(var g=[d[0]],p=0;p<c.length-1;p++){var m=d[p],h=d[p+1];if(m*h<=0)g.push(0);else{a=c[p];var f=c[p+1],v=a+f;g.push(3*v/((v+f)/m+(v+a)/h))}}g.push(d[d.length-1]);for(var x,b=[],j=[],O=0;O<g.length-1;O++){x=d[O];var w=g[O],N=1/c[O],C=w+g[O+1]-x-x;b.push((x-w-C)*N),j.push(C*N*N)}this.xs=e,this.ys=n,this.c1s=g,this.c2s=b,this.c3s=j}return Ol(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,l=n.length-1;if(e===n[l])return r[l];for(var c,d=0,u=a.length-1;d<=u;){var g=n[c=Math.floor(.5*(d+u))];if(g<e)d=c+1;else{if(!(g>e))return r[c];u=c-1}}var p=e-n[l=Math.max(0,u)],m=p*p;return r[l]+i[l]*p+o[l]*m+a[l]*p*m}}]),t}();function Ni(t){var e=t.nodeType===1?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Ct(t){return{x:t.clientX,y:t.clientY}}function kl(t,e,n,r,i){var o,a,l,c=(o=e).nodeName==="IMG"&&(Sl()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(o))),d=Ni(c?t:e),u={x:n.x-d.x,y:n.y-d.y},g=t.offsetWidth,p=t.offsetHeight,m=r.anchorX,h=r.anchorY,f=function(w,N,C,T){var R=w?N.width:C,F=w?N.height:T;return ki()&&w&&(F/=window.devicePixelRatio,R/=window.devicePixelRatio),{dragPreviewWidth:R,dragPreviewHeight:F}}(c,e,g,p),v=f.dragPreviewWidth,x=f.dragPreviewHeight,b=i.offsetX,j=i.offsetY,O=j===0||j;return{x:b===0||b?b:new Ci([0,.5,1],[u.x,u.x/g*v,u.x+v-g]).interpolate(m),y:O?j:(l=new Ci([0,.5,1],[u.y,u.y/p*x,u.y+x-p]).interpolate(h),ki()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var Di="__NATIVE_FILE__",Ti="__NATIVE_URL__",Ei="__NATIVE_TEXT__",_i="__NATIVE_HTML__";const Pi=Object.freeze(Object.defineProperty({__proto__:null,FILE:Di,HTML:_i,TEXT:Ei,URL:Ti},Symbol.toStringTag,{value:"Module"}));function yn(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var rt;function Nt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xn=(Nt(rt={},Di,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Nt(rt,_i,{exposeProperties:{html:function(t,e){return yn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Nt(rt,Ti,{exposeProperties:{urls:function(t,e){return yn(t,e,"").split(`
15
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Nt(rt,Ei,{exposeProperties:{text:function(t,e){return yn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),rt);function Cl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function Ai(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Nl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ai(this,"item",void 0),Ai(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return Cl(t,[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(e.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var n=this;if(e){var r={};Object.keys(this.config.exposeProperties).forEach(function(i){r[i]={value:n.config.exposeProperties[i](e,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,r)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,n){return n===e.getSourceId()}},{key:"endDrag",value:function(){}}]),t}();function bn(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(xn).filter(function(n){return xn[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function Dl(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function jn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Tl=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),jn(this,"ownerDocument",null),jn(this,"globalContext",void 0),jn(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return Dl(t,[{key:"window",get:function(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}},{key:"document",get:function(){var e;return(e=this.globalContext)!==null&&e!==void 0&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}}]),t}();function Mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ri(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mi(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mi(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function El(t,e,n){return e&&function(r,i){for(var o=0;o<i.length;o++){var a=i[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}(t.prototype,e),t}function L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var wn,_l=function(){function t(e,n,r){var i=this;(function(o,a){if(!(o instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),L(this,"options",void 0),L(this,"actions",void 0),L(this,"monitor",void 0),L(this,"registry",void 0),L(this,"enterLeaveCounter",void 0),L(this,"sourcePreviewNodes",new Map),L(this,"sourcePreviewNodeOptions",new Map),L(this,"sourceNodes",new Map),L(this,"sourceNodeOptions",new Map),L(this,"dragStartSourceIds",null),L(this,"dropTargetIds",[]),L(this,"dragEnterTargetIds",[]),L(this,"currentNativeSource",null),L(this,"currentNativeHandle",null),L(this,"currentDragSourceNode",null),L(this,"altKeyPressed",!1),L(this,"mouseMoveTimeoutTimer",null),L(this,"asyncEndDragFrameId",null),L(this,"dragOverTargetIds",null),L(this,"lastClientOffset",null),L(this,"hoverRafId",null),L(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Ni(a)||null}),L(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),L(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),L(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),L(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),L(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=Ct(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=o.dataTransfer,d=bn(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=i.monitor.getSourceId(),g=i.sourceNodes.get(u),p=i.sourcePreviewNodes.get(u)||g;if(p){var m=i.getCurrentSourcePreviewNodeOptions(),h=kl(g,p,l,{anchorX:m.anchorX,anchorY:m.anchorY},{offsetX:m.offsetX,offsetY:m.offsetY});c.setDragImage(p,h.x,h.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target),i.getCurrentSourcePreviewNodeOptions().captureDraggingState?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(d)i.beginDragNativeItem(d);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),L(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),L(this,"handleTopDragEnterCapture",function(o){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(o.target)&&!i.monitor.isDragging()){var a=o.dataTransfer,l=bn(a);l&&i.beginDragNativeItem(l,a)}}),L(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:Ct(o)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),L(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),L(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return o.preventDefault(),void(o.dataTransfer&&(o.dataTransfer.dropEffect="none"));i.altKeyPressed=o.altKey,i.lastClientOffset=Ct(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null})),(a||[]).some(function(l){return i.monitor.canDropOnTarget(l)})?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),L(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault(),i.enterLeaveCounter.leave(o.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),L(this,"handleTopDropCapture",function(o){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)):bn(o.dataTransfer)&&o.preventDefault(),i.enterLeaveCounter.reset()}),L(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:Ct(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),L(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new Tl(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Il(this.isNodeInDocument)}return El(t,[{key:"profile",value:function(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,n=this.rootElement;n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,n,r){var i=this;return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),function(){i.sourcePreviewNodes.delete(e),i.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,n,r){var i=this;this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);var o=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,n){var r=this,i=function(l){return r.handleDragEnter(l,e)},o=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Ri({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Ri({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Pi).some(function(n){return Pi[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var o=new Nl(xn[r]);return o.loadDataTransfer(i),o}(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var r;return(r=n.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){var e;return this.currentDragSourceNode=null,this.rootElement&&((e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(e,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(e,n){this.dropTargetIds.unshift(n)}}]),t}(),Pl=function(t,e,n){return new _l(t,e,n)};function Al(t){const e=de(),n=e.selectedIds,[r,i,o]=gl(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(Be.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(Be.dragEnd())}}),[n,t]);return S.useEffect(()=>{o((wn||((wn=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),wn))},[o]),i}function Dt(t,e){return{parentId:t||null,index:e}}function We(t,e){return{type:"line",index:t,level:e}}function In(t,e){var n;let r=t;for(;r.parent&&r.level>e;)r=r.parent;return{parentId:((n=r.parent)===null||n===void 0?void 0:n.id)||null,index:mr(r)+1}}function Li(t){var e;const n=function(g,p){const m=g.getBoundingClientRect(),h=p.x-Math.round(m.x),f=p.y-Math.round(m.y),v=m.height,x=f<v/2,b=!x,j=v/4,O=f>j&&f<v-j;return{x:h,inTopHalf:x,inBottomHalf:b,inMiddle:O,atTop:!O&&x,atBottom:!O&&b}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:a,prevNode:l}=t,[c,d]=function(g,p,m,h){return g?g.isInternal?h.atTop?[p,g]:h.inMiddle?[g,g]:[g,m]:h.inTopHalf?[p,g]:[g,m]:[p,null]}(o,l,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:Dt(o.id,null),cursor:(u=o.id,{type:"highlight",id:u})};var u;if(!c)return{drop:Dt((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:We(0,0)};if(hr(c)){const g=jt(i,(d==null?void 0:d.level)||0,c.level);return{drop:In(c,g),cursor:We(c.rowIndex+1,g)}}if(fr(c)){const g=jt(i,(d==null?void 0:d.level)||0,c.level);return{drop:In(c,g),cursor:We(c.rowIndex+1,g)}}if(pr(c)){const g=jt(i,0,c.level+1);return g>c.level?{drop:Dt(c.id,0),cursor:We(c.rowIndex+1,g)}:{drop:In(c,g),cursor:We(c.rowIndex+1,g)}}return{drop:Dt(c==null?void 0:c.id,0),cursor:We(c.rowIndex+1,c.level+1)}}const Ml=Ke.memo(function({index:t,style:e}){ur(),function(){if(S.useContext(lr)===null)throw new Error("Provide a NodesContext")}();const n=de(),r=function(h){const f=de(),v=f.at(h);if(!v)throw new Error(`Could not find node for index: ${h}`);return S.useMemo(()=>{const x=v.clone();return f.visibleNodes[h]=x,x},[...Object.values(v.state),v])}(t),i=S.useRef(null),o=Al(r),a=function(h,f){const v=de(),[x,b]=wi(()=>({accept:"NODE",canDrop:()=>v.canDrop(),hover:(j,O)=>{const w=O.getClientOffset();if(!h.current||!w)return;const{cursor:N,drop:C}=Li({element:h.current,offset:w,indent:v.indent,node:f,prevNode:f.prev,nextNode:f.next});C&&v.dispatch(Be.hovering(C.parentId,C.index)),O.canDrop()?N&&v.showCursor(N):v.hideCursor()},drop:(j,O)=>{if(!O.canDrop())return null;let{parentId:w,index:N,dragIds:C}=v.state.dnd;jr(v.props.onMove,{dragIds:C,parentId:w===Je?null:w,index:N===null?0:N,dragNodes:v.dragNodes,parentNode:v.get(w)}),v.open(w)}}),[f,h.current,v.props]);return b}(i,r),l=S.useCallback(h=>{i.current=h,a(h)},[a]),c=n.indent*r.level,d=S.useMemo(()=>({paddingLeft:c}),[c]),u=S.useMemo(()=>{var h,f;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((f=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[e,n.props.padding,n.props.paddingTop]),g={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};S.useEffect(()=>{var h;!r.isEditing&&r.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const p=n.renderNode,m=n.renderRow;return s.jsx(m,{node:r,innerRef:l,attrs:g,children:s.jsx(p,{node:r,tree:n,style:d,dragHandle:o})})});let Sn="",Fi=null;function zi(){ur();const t=de();return s.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var n;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,l=o.parent;t.focus(a||l,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void vr(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void yr(e.currentTarget);if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey)return t.select(t.focusedNode),void t.activate(t.focusedNode);if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode))}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection)return void t.focus(i);{if(!i)return;const o=t.focusedNode;return void(o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode))}}if(e.key==="ArrowRight"){const i=t.focusedNode;return i?void(i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id)):void 0}if(e.key==="ArrowLeft"){const i=t.focusedNode;return!i||i.isRoot?void 0:void(i.isInternal&&i.isOpen?t.close(i.id):((n=i.parent)===null||n===void 0?void 0:n.isRoot)||t.focus(i.parent))}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection)return e.preventDefault(),void t.selectAll();if(e.key==="a"&&!e.metaKey&&t.props.onCreate)return void t.createLeaf();if(e.key==="A"&&!e.metaKey)return t.props.onCreate?void t.createInternal():void 0;if(e.key==="Home")return e.preventDefault(),void t.focus(t.firstNode);if(e.key==="End")return e.preventDefault(),void t.focus(t.lastNode);if(e.key==="Enter"){const i=t.focusedNode;return!i||!i.isEditable||!t.props.onRename?void 0:void setTimeout(()=>{i&&t.edit(i)})}if(e.key===" "){e.preventDefault();const i=t.focusedNode;return i?void(i.isLeaf?(i.select(),i.activate()):i.toggle()):void 0}if(e.key==="*"){const i=t.focusedNode;return i?void t.openSiblings(i):void 0}if(e.key==="PageUp")return e.preventDefault(),void t.pageUp();e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Fi),Sn+=e.key,Fi=setTimeout(()=>{Sn=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"&&o.toLowerCase().startsWith(Sn)});r&&t.focus(r.id)},children:s.jsx(ca,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var n;return((n=t.visibleNodes[e])===null||n===void 0?void 0:n.id)||e},outerElementType:ha,innerElementType:ga,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Ml})})}function Hi(t){return t.isFiltered?function(e,n){const r={},i=[];function o(l){if(!l.isRoot&&n(l)){r[l.id]=!0;let c=l.parent;for(;c;)r[c.id]=!0,c=c.parent}if(l.children)for(let c of l.children)o(c)}function a(l){var c;l.level>=0&&r[l.id]&&i.push(l),l.isOpen&&((c=l.children)===null||c===void 0||c.forEach(a))}return o(e),a(e),i.forEach(Ui),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var o;i.level>=0&&n.push(i),i.isOpen&&((o=i.children)===null||o===void 0||o.forEach(r))}return r(e),n.forEach(Ui),n}(t.root)}function Ui(t,e){t.rowIndex=e}const qi=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var On=function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){var u;d.done?i(d.value):(u=d.value,u instanceof n?u:new n(function(g){g(u)})).then(a,l)}c((r=r.apply(t,e||[])).next())})};const{safeRun:te,identify:Se,identifyNull:ve}=Ho;class at{constructor(e,n,r,i){this.store=e,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=Or(this),this.visibleNodes=Hi(this),this.idToIndex=qi(this.visibleNodes)}update(e){this.props=e,this.root=Or(this),this.visibleNodes=Hi(this),this.idToIndex=qi(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const n=(e=this.props.searchMatch)!==null&&e!==void 0?e:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(e){var n;return(n=Ze(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=Ze(e,this.props.idAccessor||"id");if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,n){var r;if(e===null||n===null)return[];const i=(r=this.indexOf(e))!==null&&r!==void 0?r:0,o=this.indexOf(n);if(o===null)return[];const a=Math.min(i,o),l=Math.max(i,o);return this.visibleNodes.slice(a,l+1)}indexOf(e){const n=br(e);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return On(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Sr(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:Ir(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield te(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return On(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Se),r=n.map(i=>this.get(i)).filter(i=>!!i);yield te(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Se(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Wt(n)),new Promise(r=>{at.editPromise=r})}submit(e,n){return On(this,void 0,void 0,function*(){if(!e)return;const r=Se(e);yield te(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Wt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Wt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(ve(e));n&&te(this.props.onActivate,n)}resolveEdit(e){const n=at.editPromise;n&&n(e),at.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&e.push(r)}return e}focus(e,n={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(Ue(Se(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&te(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let o=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;o=o>r?r:Math.max(r-i,0),this.focus(this.at(o))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,o=i-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a=a<i?i:Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Se(e);r&&this.dispatch(Ue(i)),this.dispatch(Yo(i)),this.dispatch(Dr(i)),this.dispatch(Kt(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&te(this.props.onFocus,this.focusedNode),te(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Se(e);this.dispatch(Nr(n)),te(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(ve(e));n&&(this.dispatch(Ue(n.id)),this.dispatch(Cr(n.id)),this.dispatch(Dr(n.id)),this.dispatch(Kt(n.id)),this.scrollTo(n),this.focusedNode&&te(this.props.onFocus,this.focusedNode),te(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Se(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Ue(n)),this.dispatch(Nr(this.nodesBetween(r,i))),this.dispatch(Cr(this.nodesBetween(r,ve(n)))),this.dispatch(Kt(n)),this.scrollTo(n),this.focusedNode&&te(this.props.onFocus,this.focusedNode),te(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),te(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Ue((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&te(this.props.onFocus,this.focusedNode),te(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Se)),i=ve(e.anchor),o=ve(e.mostRecent);this.dispatch(Xo({ids:r,anchor:i,mostRecent:o})),te(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;return e.type==="highlight"?e.id:null}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const n=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const o of r)if(!o||!n||o.isInternal&&gr(n,o))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i!="boolean"||!i}hideCursor(){this.dispatch(Be.cursor({type:"none"}))}showCursor(e){this.dispatch(Be.cursor(e))}open(e){const n=ve(e);n&&(this.isOpen(n)||(this.dispatch(Gt.open(n,this.isFiltered)),te(this.props.onToggle,n)))}close(e){const n=ve(e);n&&this.isOpen(n)&&(this.dispatch(Gt.close(n,this.isFiltered)),te(this.props.onToggle,n))}toggle(e){const n=ve(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=ve(e);if(!n)return;const r=Vt(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const n=e.parent;if(n){if(n.children){const r=e.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}else this.toggle(e.id)}openAll(){wt(this.root,e=>{e.isInternal&&e.open()})}closeAll(){wt(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Se(e);return this.openParents(r),wr(()=>r in this.idToIndex).then(()=>{var i;const o=this.idToIndex[r];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return!!e&&this.state.nodes.selection.ids.has(e)}isOpen(e){var n,r,i;if(!e)return!1;if(e===Je)return!0;const o=(n=this.props.openByDefault)===null||n===void 0||n;return this.isFiltered?(r=this.state.nodes.open.filtered[e])===null||r===void 0||r:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){return!Ze(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!Ze(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=ve(e);return!!n&&this.state.nodes.drag.id===n}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const n=ve(e);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(Ue(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||zi}get renderRow(){return this.props.renderRow||Wo}get renderNode(){return this.props.children||Go}get renderDragPreview(){return this.props.renderDragPreview||Tr}get renderCursor(){return this.props.renderCursor||Vo}}function ae(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Bi=typeof Symbol=="function"&&Symbol.observable||"@@observable",kn=()=>Math.random().toString(36).substring(7).split("").join("."),Tt={INIT:`@@redux/INIT${kn()}`,REPLACE:`@@redux/REPLACE${kn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${kn()}`};function Vi(t,e,n){if(typeof t!="function")throw new Error(ae(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(ae(1));return n(Vi)(t,e)}let r=t,i=e,o=new Map,a=o,l=0,c=!1;function d(){a===o&&(a=new Map,o.forEach((m,h)=>{a.set(h,m)}))}function u(){if(c)throw new Error(ae(3));return i}function g(m){if(typeof m!="function")throw new Error(ae(4));if(c)throw new Error(ae(5));let h=!0;d();const f=l++;return a.set(f,m),function(){if(h){if(c)throw new Error(ae(6));h=!1,d(),a.delete(f),o=null}}}function p(m){if(!function(h){if(typeof h!="object"||h===null)return!1;let f=h;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(h)===f||Object.getPrototypeOf(h)===null}(m))throw new Error(ae(7));if(m.type===void 0)throw new Error(ae(8));if(typeof m.type!="string")throw new Error(ae(17));if(c)throw new Error(ae(9));try{c=!0,i=r(i,m)}finally{c=!1}return(o=a).forEach(h=>{h()}),m}return p({type:Tt.INIT}),{dispatch:p,subscribe:g,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(ae(10));r=m,p({type:Tt.REPLACE})},[Bi]:function(){const m=g;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(ae(11));function f(){const v=h;v.next&&v.next(u())}return f(),{unsubscribe:m(f)}},[Bi](){return this}}}}}function Wi(t){const e=Object.keys(t),n={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(o){Object.keys(o).forEach(a=>{const l=o[a];if(l(void 0,{type:Tt.INIT})===void 0)throw new Error(ae(12));if(l(void 0,{type:Tt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(ae(13))})})(n)}catch(o){i=o}return function(o={},a){if(i)throw i;let l=!1;const c={};for(let d=0;d<r.length;d++){const u=r[d],g=n[u],p=o[u],m=g(p,a);if(m===void 0)throw a&&a.type,new Error(ae(14));c[u]=m,l=l||m!==p}return l=l||r.length!==Object.keys(o).length,l?c:o}}const Rl=Wi({nodes:Wi({focus:function(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t},edit:function(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t},open:function(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:kr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:kr(t.unfiltered,e)}):t},selection:function(t=qe().nodes.selection,e){const n=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}},drag:function(t=qe().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}}),dnd:function(t=qe().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return qe().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),Ll=qe();function Fl({treeProps:t,imperativeHandle:e,children:n}){const r=S.useRef(null),i=S.useRef(null),o=S.useRef(Vi(Rl,qe(t))),a=xs.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>Ll),l=S.useMemo(()=>new at(o.current,t,r,i),[]),c=S.useRef(0);return S.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),S.useImperativeHandle(e,()=>l),S.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),S.useEffect(()=>{l.props.searchTerm||o.current.dispatch(Gt.clear(!0))},[l.props.searchTerm]),s.jsx(ar.Provider,{value:l,children:s.jsx(dr.Provider,{value:c.current,children:s.jsx(lr.Provider,{value:a.nodes,children:s.jsx(cr.Provider,{value:a.dnd,children:s.jsx(Xa,Object.assign({backend:Pl,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function zl(t){return function(){const e=de(),[,n]=wi(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const o=i.getClientOffset();if(!e.listEl.current||!o)return;const{cursor:a,drop:l}=Li({element:e.listEl.current,offset:o,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch(Be.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Hl(){const t=de().props.renderContainer||zi;return s.jsx(s.Fragment,{children:s.jsx(t,{})})}function Ul(){const t=de(),{offset:e,mouse:n,item:r,isDragging:i}=(o=g=>({offset:g.getSourceClientOffset(),mouse:g.getClientOffset(),item:g.getItem(),isDragging:g.isDragging()}),a=Ee().getMonitor(),l=jl(vi(a,o),2),c=l[0],d=l[1],S.useEffect(function(){return a.subscribeToOffsetChange(d)}),S.useEffect(function(){return a.subscribeToStateChange(d)}),c);var o,a,l,c,d;const u=t.props.renderDragPreview||Tr;return s.jsx(u,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Gi{constructor(e){this.root=function(n){const r=new Ki({id:"ROOT"},null);return r.children=n.map(i=>Cn(i,r)),r}(e)}get data(){var e,n;return(n=(e=this.root.children)===null||e===void 0?void 0:e.map(r=>r.data))!==null&&n!==void 0?n:[]}create(e){const n=e.parentId?this.find(e.parentId):this.root;if(!n)return null;n.addChild(e.data,e.index)}move(e){const n=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;n&&r&&(r.addChild(n.data,e.index),n.drop())}update(e){const n=this.find(e.id);n&&n.update(e.changes)}drop(e){const n=this.find(e.id);n&&n.drop()}find(e,n=this.root){if(!n)return null;if(n.id===e)return n;if(n.children){for(let r of n.children){const i=this.find(e,r);if(i)return i}return null}return null}}function Cn(t,e){const n=new Ki(t,e);return t.children&&(n.children=t.children.map(r=>Cn(r,n))),n}class Ki{constructor(e,n){this.data=e,this.parent=n,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,n){var r,i;const o=Cn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,e)}removeChild(e){var n,r;(n=this.children)===null||n===void 0||n.splice(e,1),(r=this.data.children)===null||r===void 0||r.splice(e,1)}update(e){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let ql=0;function Bl(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
16
+ Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,o]=S.useState(r),a=S.useMemo(()=>new Gi(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});o(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),o(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+ql++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),o(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),o(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Vl=S.forwardRef(function(t,e){const n=Bl(t);return s.jsxs(Fl,{treeProps:n,imperativeHandle:e,children:[s.jsx(zl,{children:s.jsx(Hl,{})}),s.jsx(Ul,{})]})});function Wl(t,e){const n=U.c(11),{delayMs:r,whenVisible:i,disabled:o}=e,a=o!==void 0&&o,l=S.useRef(void 0);let c,d,u,g,p;return n[0]!==t?(c=()=>{l.current=t},d=[t],n[0]=t,n[1]=c,n[2]=d):(c=n[1],d=n[2]),S.useEffect(c,d),n[3]!==r||n[4]!==a||n[5]!==i?(u=()=>{if(r===null||a)return;const m=setInterval(()=>{var h;i&&document.visibilityState!=="visible"||((h=l.current)==null||h.call(l))},r);return()=>clearInterval(m)},g=[r,i,a],n[3]=r,n[4]=a,n[5]=i,n[6]=u,n[7]=g):(u=n[6],g=n[7]),S.useEffect(u,g),n[8]!==a||n[9]!==i?(p=()=>{var m;document.visibilityState==="visible"&&i&&!a&&((m=l.current)==null||m.call(l))},n[8]=a,n[9]=i,n[10]=p):p=n[10],bs(document,"visibilitychange",p),null}function Gl(){return["compact","medium","full","columns"]}const Kl=t=>{const e=U.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:n}),e[0]=n,e[1]=r):r=e[1],r},Nn=t=>{const e=U.c(10);let n,r,i,o,a;return e[0]!==t?({children:n,className:r,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]),e[4]!==r?(o=dt("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),e[4]=r,e[5]=o):o=e[5],e[6]!==n||e[7]!==i||e[8]!==o?(a=s.jsx("div",{...i,className:o,children:n}),e[6]=n,e[7]=i,e[8]=o,e[9]=a):a=e[9],a},$l=t=>{const e=U.c(2),{children:n}=t;let r;return e[0]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r},$i=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Yl=()=>{const t=U.c(31),[e,n]=js(),{saveAppConfig:r}=Fe();let i,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=Pn(ws),t[0]=i):i=t[0],t[1]!==e?(o={resolver:i,defaultValues:e},t[1]=e,t[2]=o):o=t[2];const a=An(o);let l;t[3]!==r||t[4]!==n?(l=async j=>{await r({config:j}).then(()=>{n(j)}).catch(()=>{n(j)})},t[3]=r,t[4]=n,t[5]=l):l=t[5];const c=l;let d,u,g,p,m,h,f,v,x,b;return t[6]!==e.width?(d=[e.width],t[6]=e.width,t[7]=d):d=t[7],S.useEffect(Xl,d),t[8]!==a||t[9]!==c?(u=a.handleSubmit(c),t[8]=a,t[9]=c,t[10]=u):u=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{children:[s.jsx(Kl,{children:"Notebook Settings"}),s.jsx($l,{children:"Configure how your notebook or application looks and behaves."})]}),t[11]=g):g=t[11],t[12]!==a.control?(p=s.jsxs(Et,{title:"Display",children:[s.jsx(_,{control:a.control,name:"width",render:Zl}),s.jsx(_,{control:a.control,name:"app_title",render:Jl})]}),t[12]=a.control,t[13]=p):p=t[13],t[14]!==a.control?(m=s.jsxs(Et,{title:"Custom Files",children:[s.jsx(_,{control:a.control,name:"css_file",render:ec}),s.jsx(_,{control:a.control,name:"html_head_file",render:tc})]}),t[14]=a.control,t[15]=m):m=t[15],t[16]!==a.control?(h=s.jsx(Et,{title:"Data",children:s.jsx(_,{control:a.control,name:"sql_output",render:rc})}),t[16]=a.control,t[17]=h):h=t[17],t[18]!==a.control?(f=s.jsx(Et,{title:"Exporting outputs",children:s.jsx(_,{control:a.control,name:"auto_download",render:ic})}),t[18]=a.control,t[19]=f):f=t[19],t[20]!==p||t[21]!==m||t[22]!==h||t[23]!==f?(v=s.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[p,m,h,f]}),t[20]=p,t[21]=m,t[22]=h,t[23]=f,t[24]=v):v=t[24],t[25]!==v||t[26]!==u?(x=s.jsxs("form",{onChange:u,className:"flex flex-col gap-6",children:[g,v]}),t[25]=v,t[26]=u,t[27]=x):x=t[27],t[28]!==a||t[29]!==x?(b=s.jsx(Mn,{...a,children:x}),t[28]=a,t[29]=x,t[30]=b):b=t[30],b},Et=t=>{const e=U.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx("h3",{className:"text-base font-semibold mb-1",children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o};function Xl(){window.dispatchEvent(new Event("resize"))}function Ql(t){return s.jsx("option",{value:t,children:t},t)}function Zl(t){const{field:e}=t;return s.jsxs(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(D,{children:"Width"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"app-width-select",onChange:n=>e.onChange(n.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Ql)})}),s.jsx(M,{})]})}function Jl(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(D,{children:"App title"}),s.jsx(A,{children:s.jsx(ke,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Rn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(M,{})]}),s.jsx(z,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function ec(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(D,{className:"shrink-0",children:"Custom CSS"}),s.jsx(A,{children:s.jsx(ke,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),Rn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),s.jsx(M,{})]}),s.jsx(z,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function tc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(D,{className:"shrink-0",children:"HTML Head"}),s.jsx(A,{children:s.jsx(ke,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),s.jsx(M,{})]}),s.jsxs(z,{children:["A filepath to an HTML file to be injected into the"," ",s.jsx(J,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function nc(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function rc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[s.jsx(D,{children:"SQL Output Type"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),ze({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:$i.map(nc)})}),s.jsx(M,{})]}),s.jsxs(z,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",s.jsx(J,{className:"inline",children:"native"}),". See the"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function ic(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:"flex flex-col gap-2",children:[s.jsx(A,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ee,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(ut(e.value,"html"))}}),s.jsx(D,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ee,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(ut(e.value,"ipynb"))}}),s.jsx(D,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(M,{})]}),s.jsxs(z,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(J,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const sc=Ln("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xs-solid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled active:shadow-xs-solid"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),oc=Ln("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-hidden text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),_t=Ke.forwardRef((t,e)=>{const n=U.c(15);let r,i,o,a,l,c,d;return n[0]!==t?({color:i,shape:a,size:l,className:r,...o}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=a,n[5]=l):(r=n[1],i=n[2],o=n[3],a=n[4],l=n[5]),n[6]!==r||n[7]!==i||n[8]!==a||n[9]!==l?(c=Fn(sc({color:i,shape:a,size:l}),r),n[6]=r,n[7]=i,n[8]=a,n[9]=l,n[10]=c):c=n[10],n[11]!==o||n[12]!==e||n[13]!==c?(d=s.jsx("button",{ref:e,className:c,...o,children:o.children}),n[11]=o,n[12]=e,n[13]=c,n[14]=d):d=n[14],d});_t.displayName="Button",Ke.forwardRef((t,e)=>{const n=U.c(9);let r,i,o,a;return n[0]!==t?({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i):(r=n[1],i=n[2]),n[3]!==r?(o=Fn(oc(),r),n[3]=r,n[4]=o):o=n[4],n[5]!==i||n[6]!==e||n[7]!==o?(a=s.jsx("input",{ref:e,className:o,...i}),n[5]=i,n[6]=e,n[7]=o,n[8]=a):a=n[8],a}).displayName="Input";let Pt=null;class ac{constructor(e){this.view=void 0,this.abortController=new AbortController,this.view=e.view,this.view.dom.addEventListener("focus",()=>{Pt=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){const e=this.view.dom.querySelector(".cm-vimCursorLayer");if(e instanceof HTMLElement)if(Is())e.style.display="none";else{const n=(Pt==null?void 0:Pt.deref())===this.view;e.style.display=n?"":"none"}}destroy(){this.abortController.abort()}}const Yi={map:{args:["lhs","rhs"]},nmap:{mode:"normal",args:["lhs","rhs"]},vmap:{mode:"visual",args:["lhs","rhs"]},imap:{mode:"insert",args:["lhs","rhs"]},noremap:{args:["lhs","rhs"]},nnoremap:{mode:"normal",args:["lhs","rhs"]},vnoremap:{mode:"visual",args:["lhs","rhs"]},inoremap:{mode:"insert",args:["lhs","rhs"]},unmap:{args:["lhs"]},nunmap:{mode:"normal",args:["lhs"]},vunmap:{mode:"visual",args:["lhs"]},iunmap:{mode:"insert",args:["lhs"]},mapclear:{},nmapclear:{mode:"normal"},vmapclear:{mode:"visual"},imapclear:{mode:"insert"}};function lc(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in Yi){const o=Yi[r],a={};for(const c of o.args||[]){if(i+=1,!(i<n.length))return void(e&&e(`Not enough arguments for "${r}" command: "${t}"`));a[c]=n[i]}const l={name:r};return"args"in o&&(l.args=a),"mode"in o&&(l.mode=o.mode),l}e&&e(`Unknown vimrc command: "${t}"`)}var Xi;const cc=He(()=>{ne.defineAction("goToDefinition",t=>{const e=t.cm6;return ks(e)}),ne.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),ne.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(ht).saveNotebook()})}),dc=He(async()=>{var n;const t=pt.get(qn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{G.log(`Loading vimrc from ${e}`);const r=(await Cs().sendFileDetails({path:e})).contents;if(!r)return void G.error(`Failed to load vimrc from ${e}`);const i=function(o,a){const l=[];for(const c of o.split(`
17
+ `)){if(c.startsWith('"')||c.trim()==="")continue;const d=lc(c,a);d&&l.push(d)}return l}(r,G.warn);(function(o){function a(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ne.map(u.args.lhs,u.args.rhs,u.mode):ne.map(u.args.lhs,u.args.rhs):G.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function l(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ne.noremap(u.args.lhs,u.args.rhs,u.mode):ne.noremap(u.args.lhs,u.args.rhs):G.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function c(u){u.args&&u.args.lhs?u.mode?ne.unmap(u.args.lhs,u.mode):ne.unmap(u.args.lhs):G.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function d(u){u.mode?ne.mapclear(u.mode):ne.mapclear()}for(const u of o)"map|nmap|vmap|imap".split("|").includes(u.name)?a(u):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(u.name)?l(u):"unmap|nunmap|vunmap|iunmap".split("|").includes(u.name)?c(u):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(u.name)?d(u):G.warn(`Could not execute vimrc command "${u.name}: unknown command"`)})(i)}catch(r){G.error("Failed to load vimrc:",r)}});class At{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=ft(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(Ft("mode"in r,'Expected event to have a "mode" property'),this.isBroadcasting=!0,i=()=>{this.broadcastModeChange(e,r.mode,r.subMode),this.isBroadcasting=!1},"scheduler"in window?window.scheduler.postTask(i,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,0))}):G.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){Ft("exitInsertMode"in ne,"Vim does not have an exitInsertMode method"),Ft("exitVisualMode"in ne,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const o=ft(i);if(!o){G.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=o.setSelections.bind(o);if(o.setSelections=()=>[],!Qi(o)){G.warn("Expected CodeMirror instance to have Vim state");continue}const l=o.state.vim;switch(n){case"normal":l.insertMode&&ne.exitInsertMode(o,!0),l.visualMode&&ne.exitVisualMode(o,!0);break;case"insert":l.insertMode||ne.handleKey(o,"i","")}o.setSelections=a}}}function Qi(t){return t.state.vim!==void 0}Xi=At,At.INSTANCES=new Xi;const uc=["default","vim"];function hc(t,e){switch(t.preset){case"default":return[xe.of(Zi()),xe.of(Ji(e)),zt.low(xe.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[xe.of(pc()),xe.of(Ji(e)),xe.of([{key:"Enter",run:n=>{var i;const r=ft(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Ts(n)}}]),zt.high(gc("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(ht).deleteCell(),!0):!1)),Ds({status:!1}),zt.high((cc(),dc(),[xe.of([{key:"j",run:n=>{if(Ss(n,!0)&&Hn(n)){const r=n.state.facet(ht),i=n.state.facet(Un);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),xe.of([{key:"k",run:n=>{if(Os(n)&&Hn(n)){const r=n.state.facet(ht),i=n.state.facet(Un);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),xe.of([{linux:"Ctrl-[",win:"Ctrl-[",run:n=>{const r=ft(n);return r?Qi(r)?!!r.state.vim.insertMode&&(ne.exitInsertMode(r,!0),!0):(G.warn("Expected CodeMirror instance to have Vim state"),!1):(G.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),zn.define(n=>(requestAnimationFrame(()=>{At.INSTANCES.addInstance(n)}),{destroy(){At.INSTANCES.removeInstance(n)}})),zn.define(n=>new ac({view:n}))]))];default:return Ns(t.preset),[]}}const fc=new Set([Bn,Vn]),Zi=He(()=>Es.filter(t=>!fc.has(t.run))),Ji=t=>[{key:t.getHotkey("cell.toggleComment").key,run:Bn},{key:t.getHotkey("cell.toggleBlockComment").key,run:Vn}],pc=He(()=>{const t=new Set(["Enter","Ctrl-v"]);return Zi().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function gc(t,e,n){let r="",i=0;return xe.of([{any:(o,a)=>{const l=a.key,c=a.timeStamp;return l!==t||!e(o)?(r="",i=0,!1):r===t&&c-i<500&&n(o)?(r="",i=0,!0):(r=l,i=c,!1)}}])}const Dn=$e(!1),mc=()=>{const t=U.c(82),[e,n]=Ye(Dn),[r,i]=S.useState(null);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[0]=o):o=t[0];const[a,l]=S.useState(o),[c,d]=Wn(),u=gt(_s),{saveUserConfig:g}=Fe();let p,m;t[1]!==n?(p=()=>n(vc),t[1]=n,t[2]=p):p=t[2],Ps("global.showHelp",p),t[3]!==c||t[4]!==g||t[5]!==d?(m=async Oe=>{const re={...c};d(Oe),await g({config:Oe}).catch(Z=>{throw d(re),Z})},t[3]=c,t[4]=g,t[5]=d,t[6]=m):m=t[6];const h=m;let f;t[7]!==c||t[8]!==r||t[9]!==h?(f=async Oe=>{if(!r)return;const re=Oe.join("-"),Z={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:re}}};i(null),l([]),await h(Z)},t[7]=c,t[8]=r,t[9]=h,t[10]=f):f=t[10];const v=f;let x,b,j;if(t[11]!==c||t[12]!==r||t[13]!==v||t[14]!==u||t[15]!==e||t[16]!==a||t[17]!==h){j=Symbol.for("react.early_return_sentinel");{const Oe=async()=>{if(!r)return;const Z={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete Z.keymap.overrides[r],i(null),l([]),await h(Z)};let re;t[21]!==c||t[22]!==h?(re=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const Z={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await h(Z)},t[21]=c,t[22]=h,t[23]=re):re=t[23],x=re,e?b=Z=>{const me=u.getHotkey(Z);if(r===Z){const ct=As(Z);return s.jsxs("div",{children:[s.jsx(ke,{defaultValue:a.join("+"),placeholder:me.name,onKeyDown:le=>{le.preventDefault();const Ce=[];if(le.key==="Meta"||le.key==="Control"||le.key==="Alt"||le.key==="Shift"||(le.metaKey&&Ce.push(Kn()?"Cmd":"Meta"),le.ctrlKey&&Ce.push("Ctrl"),le.altKey&&Ce.push("Alt"),le.shiftKey&&Ce.push("Shift"),le.key==="-"))return;if(le.key==="Escape"&&Ce.length===0)return i(null),void l([]);let _n=le.key.toLowerCase();le.key===" "&&(_n="Space"),Ce.push(_n),v(Ce)},autoFocus:!0,endAdornment:s.jsx(ue,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:s.jsx(mt,{className:"w-4 h-4"})})}),s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),ct.key!==me.key&&s.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:Oe,children:["Reset to default:"," ",s.jsx("span",{className:"font-mono",children:ct.key})]})]})]},Z)}return s.jsxs("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[u.isEditable(Z)?s.jsx($n,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(Z)}}):s.jsx("div",{className:"w-3 h-3"}),s.jsx(Gn,{className:"justify-end",shortcut:me.key}),s.jsx("span",{children:me.name.toLowerCase()})]},Z)}:j=null}t[11]=c,t[12]=r,t[13]=v,t[14]=u,t[15]=e,t[16]=a,t[17]=h,t[18]=x,t[19]=b,t[20]=j}else x=t[18],b=t[19],j=t[20];if(j!==Symbol.for("react.early_return_sentinel"))return j;const O=b;let w,N,C,T,R,F,B,Q,$,W,Y,V,K,X,I,y,k,we,ye,Ie,Ae,Me,Re,Le,lt;if(t[24]!==c.keymap.preset||t[25]!==u||t[26]!==e||t[27]!==O||t[28]!==n){const Oe=u.getHotkeyGroups(),re=(me,ct)=>{const le=Oe[me];return s.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium",children:me}),ct]}),le.map(O)]})},Z=me=>re(me,s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",c.keymap.preset==="vim"?s.jsxs(s.Fragment,{children:[s.jsx(Gn,{shortcut:Kn()?"Cmd":"Ctrl"}),s.jsx(J,{children:"Esc"})]}):s.jsx(J,{children:"Esc"})," ","in a cell to enter command mode"]}));C=Ht,K=e,t[47]!==n?(X=me=>n(me),t[47]=n,t[48]=X):X=t[48],N=Ms,Y="sm:items-center sm:top-0",t[49]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Rs,{}),t[49]=V):V=t[49],w=Yn,Q=!1,$="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[50]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ls,{children:s.jsx(Fs,{children:"Shortcuts"})}),t[50]=W):W=t[50],F="flex flex-row gap-3",B=s.jsxs("div",{className:"w-1/2",children:[re("Editing"),re("Markdown")]}),I="w-1/2",y=re("Navigation"),k=re("Running Cells"),we=re("Creation and Ordering"),T=Z("Command"),R=re("Other"),t[24]=c.keymap.preset,t[25]=u,t[26]=e,t[27]=O,t[28]=n,t[29]=w,t[30]=N,t[31]=C,t[32]=T,t[33]=R,t[34]=F,t[35]=B,t[36]=Q,t[37]=$,t[38]=W,t[39]=Y,t[40]=V,t[41]=K,t[42]=X,t[43]=I,t[44]=y,t[45]=k,t[46]=we}else w=t[29],N=t[30],C=t[31],T=t[32],R=t[33],F=t[34],B=t[35],Q=t[36],$=t[37],W=t[38],Y=t[39],V=t[40],K=t[41],X=t[42],I=t[43],y=t[44],k=t[45],we=t[46];return t[51]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[51]=ye):ye=t[51],t[52]!==x?(Ie=s.jsx(ue,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:x,tabIndex:-1,children:ye}),t[52]=x,t[53]=Ie):Ie=t[53],t[54]!==T||t[55]!==R||t[56]!==Ie||t[57]!==I||t[58]!==y||t[59]!==k||t[60]!==we?(Ae=s.jsxs("div",{className:I,children:[y,k,we,T,R,Ie]}),t[54]=T,t[55]=R,t[56]=Ie,t[57]=I,t[58]=y,t[59]=k,t[60]=we,t[61]=Ae):Ae=t[61],t[62]!==F||t[63]!==B||t[64]!==Ae?(Me=s.jsxs("div",{className:F,children:[B,Ae]}),t[62]=F,t[63]=B,t[64]=Ae,t[65]=Me):Me=t[65],t[66]!==w||t[67]!==Q||t[68]!==$||t[69]!==W||t[70]!==Me?(Re=s.jsxs(w,{usePortal:Q,className:$,children:[W,Me]}),t[66]=w,t[67]=Q,t[68]=$,t[69]=W,t[70]=Me,t[71]=Re):Re=t[71],t[72]!==N||t[73]!==Y||t[74]!==V||t[75]!==Re?(Le=s.jsxs(N,{className:Y,children:[V,Re]}),t[72]=N,t[73]=Y,t[74]=V,t[75]=Re,t[76]=Le):Le=t[76],t[77]!==C||t[78]!==K||t[79]!==X||t[80]!==Le?(lt=s.jsx(C,{open:K,onOpenChange:X,children:Le}),t[77]=C,t[78]=K,t[79]=X,t[80]=Le,t[81]=lt):lt=t[81],lt};function vc(t){return!t}var yc=zs();const es="marimo:copilot:signedIn",ts=qs(es,null,void 0,{getOnInit:!0}),ns=$e(null),Mt=$e(null);function rs(){const t=localStorage.getItem(es)==="true",e=Hs();return t&&e.completion.copilot==="github"}const ge=G.get("@github/copilot-language-server");class xc extends Bs{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("textDocument/inlineCompletion",{...n,textDocument:{...n.textDocument,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var o=!0,a=!0;if(typeof n!="function")throw new TypeError("Expected a function");return ms(i)&&(o="leading"in i?!!i.leading:o,a="trailing"in i?!!i.trailing:a),vs(n,r,{leading:o,maxWait:r,trailing:a})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw ge.error("#request: Error",r),r}}async notify(e,n){return ge.debug("#notify",e,n),super.notify(e,n)}getInitializationOptions(){const e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!rs()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});const n=e.contentChanges;n.length!==1&&ge.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&ge.warn("#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=Vs(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:Ws.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){ge.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return ge.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw ge.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){ge.log("#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return ge.log("#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw ge.warn("#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return ge.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw ge.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;const n=this.documentVersion;if(e.textDocument.version=n,n===0)return null;var r;r=n,pt.set(Mt,r);const i=await this.throttledGetCompletionInternal(e,n);var o;return o=n,pt.get(Mt)===o&&pt.set(Mt,null),n!==this.documentVersion?null:i??null}}const is="/__marimo_copilot__.py",ss=`file://${is}`,bc=He(()=>new jc);class jc extends yc.Transport{constructor(){super(),this.delegate=void 0,this.delegate=void 0}getWsUrl(){return Ks().getLSPURL("copilot").toString()}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new $s.WebSocketTransport(this.getWsUrl())),await this.delegate.connect(),void G.log("Copilot#connect: Connected successfully")}catch(i){if(G.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,ze({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(o=>setTimeout(o,n))}}async connect(){return await Us(qn,e=>e.completion.copilot==="github"),await Ys(),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0}async sendData(e,n){var r;return n=Math.min(n??5e3,5e3),(r=this.delegate)==null?void 0:r.sendData(e,n)}}const it=He(()=>new xc({rootUri:ss,workspaceFolders:null,transport:bc()}));function wc(){return Gs({documentUri:ss,client:it(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const os=S.memo(()=>{const[t,e]=Ye(ts),[n,r]=Ye(ns),[i,o]=S.useState(),[a,l]=S.useState(!1),c=async g=>{g.preventDefault(),l(!0);try{const{verificationUri:p,status:m,userCode:h}=await async function(){return await it().signInInitiate()}();cs(m)?e(!0):(r("signingIn"),o({url:p,code:h}))}finally{l(!1)}},d=async g=>{if(g.preventDefault(),i){l(!0);try{const p=await async function(m){const h=it();try{G.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:f}=await h.signInConfirm({userCode:m});return cs(f)?(G.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(G.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:f}),{success:!1})}catch(f){return ls(f)?(G.error("Copilot#tryFinishSignIn: Connection error during sign-in",f),{success:!1,error:"connection"}):await async function(v){for(let x=0;x<as;x++)try{if(await new Promise(b=>setTimeout(b,Ic)),await v.signedIn())return G.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(b){if(G.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:x+1,maxRetries:as}),ls(b))return{success:!1,error:"connection"}}return G.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}(h)}}(i.code);p.success?(e(!0),r("signedIn")):p.error==="connection"?(r("connectionError"),ze({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:s.jsx(ue,{onClick:c,children:"Retry"})})):r("signInFailed")}finally{l(!1)}}},u=async g=>{g.preventDefault(),await async function(){await it().signOut()}(),e(!1),r("signedOut")};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return s.jsx(vt,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return s.jsx(ue,{onClick:c,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return s.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[s.jsx("li",{children:s.jsxs("div",{className:"flex items-center",children:["Copy this code:",s.jsx("strong",{className:"ml-2",children:i==null?void 0:i.code}),s.jsx(Qs,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await Zs(i.code),ze({description:"Copied to clipboard"}))}})]})}),s.jsxs("li",{children:["Enter the code at this link:",s.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:Js({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),s.jsxs("li",{children:["Click here when done:",s.jsxs(ue,{size:"xs",onClick:d,className:"ml-1",children:[a&&s.jsx(Xn,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),a?s.jsx(Xn,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(ue,{onClick:c,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return s.jsxs("div",{className:"flex items-center gap-5",children:[s.jsxs(vt,{className:"font-normal flex items-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:s.jsx(Xs,{className:"h-3 w-3 text-white"})}),"Connected"]}),s.jsx(ue,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(vt,{className:"font-normal flex",children:[s.jsx(mt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),s.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),s.jsx(ue,{onClick:c,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(vt,{className:"font-normal flex",children:[s.jsx(mt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),s.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",s.jsx(se,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});os.displayName="CopilotConfig";const as=5,Ic=3e3;function ls(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function cs(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}const Sc={openai:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",anthropic:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",google:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%3c/title%3e%3cpath%20d='M12.48%2010.92v3.28h7.84c-.24%201.84-.853%203.187-1.787%204.133-1.147%201.147-2.933%202.4-6.053%202.4-4.827%200-8.6-3.893-8.6-8.72s3.773-8.72%208.6-8.72c2.6%200%204.507%201.027%205.907%202.347l2.307-2.307C18.747%201.44%2016.133%200%2012.48%200%205.867%200%20.307%205.387.307%2012s5.56%2012%2012.173%2012c3.573%200%206.267-1.173%208.373-3.36%202.16-2.16%202.84-5.213%202.84-7.667%200-.76-.053-1.467-.173-2.053H12.48z'/%3e%3c/svg%3e",ollama:"data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e"},Oc=t=>{const e=U.c(11);let n,r,i;e[0]!==t?({provider:r,className:i,...n}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);const o=i===void 0?"":i,a=Sc[r];if(!a)return null;let l,c;return e[4]!==o?(l=dt("h-4 w-4",o),e[4]=o,e[5]=l):l=e[5],e[6]!==a||e[7]!==n||e[8]!==r||e[9]!==l?(c=s.jsx("img",{src:a,alt:r,className:l,...n}),e[6]=a,e[7]=n,e[8]=r,e[9]=l,e[10]=c):c=e[10],c},ds=["anthropic/claude-opus-4-1-20250805","anthropic/claude-opus-4-20250514","anthropic/claude-sonnet-4-20250514","anthropic/claude-3-7-sonnet-latest","anthropic/claude-3-5-sonnet-latest","anthropic/claude-3-5-haiku-latest","deepseek/deepseek-v3","deepseek/deepseek-r1","google/gemini-2.5-flash-preview-05-20","google/gemini-2.5-pro-preview-06-05","google/gemini-2.0-flash","google/gemini-2.0-flash-lite","openai/o3","openai/o4-mini","openai/gpt-4.5-preview","openai/gpt-4.1","openai/gpt-4o","openai/gpt-3.5-turbo","bedrock/anthropic.claude-3-5-haiku-20241022-v1:0","bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0","bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0","bedrock/meta.llama3-3-70b-instruct-v1:0","bedrock/cohere.command-r-plus-v1"],kc=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"];class Lt{constructor(e,n){this.providerId=void 0,this.shortModelId=void 0,this.providerId=e,this.shortModelId=n}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/")){const i=function(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":"ollama"}(e);return new Lt(i,e)}const[n,...r]=e.split("/");return new Lt(n,r.join("/"))}}const Cc=t=>{const e=U.c(11),{value:n}=t;if(!n||n.includes("/"))return null;let r;e[0]!==n?(r=Lt.parse(n),e[0]=n,e[1]=r):r=e[1];const i=r.id;let o,a,l,c,d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("code",{className:"font-bold",children:"provider/model"}),e[2]=o):o=e[2],e[3]!==n?(a=s.jsxs("span",{children:["Model id should be in the form"," ",o,". ",n," is missing a provider."]}),e[3]=n,e[4]=a):a=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("br",{}),e[5]=l):l=e[5],e[6]!==i?(c=i&&s.jsxs("span",{children:["Did you mean ",s.jsx("code",{className:"font-bold",children:i}),"?"]}),e[6]=i,e[7]=c):c=e[7],e[8]!==a||e[9]!==c?(d=s.jsxs(yt,{kind:"danger",className:"mt-1",children:[a,l,c]}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d};function us(t,e){const n=U.c(10);let r;n[0]!==e||n[1]!==t?(r=Qn(t,e),n[0]=e,n[1]=t,n[2]=r):r=n[2];const i=r,o=gt(eo);let a;n[3]!==e||n[4]!==o?(a=Qn(o,e),n[3]=e,n[4]=o,n[5]=a):a=n[5];const l=a,c=l!=null&&i!==l;let d;return n[6]!==i||n[7]!==c||n[8]!==l?(d={isOverridden:c,currentValue:i,overriddenValue:l},n[6]=i,n[7]=c,n[8]=l,n[9]=d):d=n[9],d}const Nc=t=>{const e=U.c(3),{name:n,children:r}=t,[i]=Zn(),{isOverridden:o}=us(i,n);let a;return e[0]!==r||e[1]!==o?(a=o?s.jsx(Xe,{delayDuration:200,content:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{children:["This setting is overridden by the"," ",s.jsx(J,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),s.jsxs("p",{children:["To change it, edit the project config"," ",s.jsx(J,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:s.jsx("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:r})}):r,e[0]=r,e[1]=o,e[2]=a):a=e[2],a},H=t=>{const e=U.c(18),{userConfig:n,name:r}=t,{isOverridden:i,currentValue:o,overriddenValue:a}=us(n,r);if(!i)return null;let l,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("span",{children:["This setting is overridden by"," ",s.jsx(J,{className:"inline",children:"pyproject.toml"}),"."]}),c=s.jsx("br",{}),e[0]=l,e[1]=c):(l=e[0],c=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs("span",{children:["Edit the ",s.jsx(J,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),u=s.jsx("br",{}),e[2]=d,e[3]=u):(d=e[2],u=e[3]);const g=String(o);let p,m;e[4]!==g?(p=s.jsxs("span",{children:["User value: ",s.jsx("strong",{children:g})]}),e[4]=g,e[5]=p):p=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("br",{}),e[6]=m):m=e[6];const h=String(a);let f,v,x;e[7]!==h?(f=s.jsxs("span",{children:["Project value: ",s.jsx("strong",{children:h})]}),e[7]=h,e[8]=f):f=e[8],e[9]!==p||e[10]!==f?(v=s.jsxs(s.Fragment,{children:[l,c,d,u,p,m,f]}),e[9]=p,e[10]=f,e[11]=v):v=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(sr,{className:"w-3 h-3"}),e[12]=x):x=e[12];const b=String(a);let j,O;return e[13]!==b?(j=s.jsxs("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[x,"Overridden by pyproject.toml [",b,"]"]}),e[13]=b,e[14]=j):j=e[14],e[15]!==v||e[16]!==j?(O=s.jsx(Xe,{content:v,children:j}),e[15]=v,e[16]=j,e[17]=O):O=e[17],O},Ge="flex flex-row items-center space-x-1 space-y-0",_e=t=>{const e=U.c(5),{provider:n,children:r}=t;let i,o;return e[0]!==n?(i=n&&s.jsx(Oc,{provider:n,className:"mr-2"}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex items-center text-base font-semibold",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o},Pe=t=>{const e=U.c(10),{form:n,config:r,name:i,placeholder:o,testId:a,description:l}=t;let c,d;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==a?(c=u=>{const{field:g}=u;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"API Key"}),s.jsx(A,{children:s.jsx(ke,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:o,...g,value:st(g.value),onChange:p=>{const m=p.target.value;m.includes("*")||g.onChange(m)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:i})]}),l&&s.jsx(z,{children:l})]})},e[0]=r,e[1]=l,e[2]=i,e[3]=o,e[4]=a,e[5]=c):c=e[5],e[6]!==n.control||e[7]!==i||e[8]!==c?(d=s.jsx(_,{control:n.control,name:i,render:c}),e[6]=n.control,e[7]=i,e[8]=c,e[9]=d):d=e[9],d};function st(t){if(t!=null)return typeof t=="string"?t:String(t)}const ot=t=>{const e=U.c(12),{form:n,config:r,name:i,placeholder:o,testId:a,description:l,disabled:c,defaultValue:d}=t,u=c!==void 0&&c;let g,p;return e[0]!==r||e[1]!==d||e[2]!==l||e[3]!==i||e[4]!==o||e[5]!==a?(g=m=>{const{field:h}=m;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"Base URL"}),s.jsx(A,{children:s.jsx(ke,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:o,defaultValue:d,...h,value:st(h.value)})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:i})]}),l&&s.jsx(z,{children:l})]})},e[0]=r,e[1]=d,e[2]=l,e[3]=i,e[4]=o,e[5]=a,e[6]=g):g=e[6],e[7]!==u||e[8]!==n.control||e[9]!==i||e[10]!==g?(p=s.jsx(_,{control:n.control,name:i,disabled:u,render:g}),e[7]=u,e[8]=n.control,e[9]=i,e[10]=g,e[11]=p):p=e[11],p},hs=t=>{const e=U.c(11),{form:n,config:r,name:i,placeholder:o,testId:a,description:l,disabled:c}=t,d=c!==void 0&&c;let u,g;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==a?(u=p=>{const{field:m}=p;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"Model"}),s.jsx(A,{children:s.jsx(ke,{list:"ai-model-datalist","data-testid":a,className:"m-0 inline-flex",placeholder:o,...m,value:st(m.value)})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:i})]}),s.jsx("datalist",{id:"ai-model-datalist",children:ds.map(Ac)}),s.jsx(Cc,{value:st(m.value)}),l&&s.jsx(z,{children:l})]})},e[0]=r,e[1]=l,e[2]=i,e[3]=o,e[4]=a,e[5]=u):u=e[5],e[6]!==d||e[7]!==n.control||e[8]!==i||e[9]!==u?(g=s.jsx(_,{control:n.control,name:i,disabled:d,render:u}),e[6]=d,e[7]=n.control,e[8]=i,e[9]=u,e[10]=g):g=e[10],g},Dc=t=>{const e=U.c(10),{form:n,config:r,name:i,options:o,testId:a,disabled:l}=t,c=l!==void 0&&l;let d,u;return e[0]!==r||e[1]!==i||e[2]!==o||e[3]!==a?(d=g=>{const{field:p}=g;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"Provider"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":a,onChange:m=>{m.target.value==="none"?p.onChange(!1):p.onChange(m.target.value)},value:st(p.value===!0?"github":p.value===!1?"none":p.value),disabled:p.disabled,className:"inline-flex mr-2",children:o.map(Mc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:i})]})})},e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=d):d=e[4],e[5]!==c||e[6]!==n.control||e[7]!==i||e[8]!==d?(u=s.jsx(_,{control:n.control,name:i,disabled:c,render:d}),e[5]=c,e[6]=n.control,e[7]=i,e[8]=d,e[9]=u):u=e[9],u},Tn=t=>{const e=U.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx(Nn,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o},Tc=t=>{const e=U.c(9),{form:n,config:r}=t;let i,o,a,l,c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-muted-secondary",children:"You may use GitHub Copilot, Codeium, or a custom provider (e.g. Ollama) for AI code completion."}),e[0]=i):i=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(o=["none","github","codeium","custom"],e[1]=o):o=e[1],e[2]!==r||e[3]!==n?(a=s.jsx(Dc,{form:n,config:r,name:"completion.copilot",options:o,testId:"copilot-select"}),l=((d,u)=>{const g=d.getValues("completion.copilot");return g===!1?null:g==="codeium"?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),s.jsx(Pe,{form:d,config:u,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]}):g==="github"?s.jsx(os,{}):g==="custom"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),s.jsx(hs,{form:d,config:u,name:"completion.model",placeholder:"Qwen2.5-Coder-7B",testId:"custom-model-input"}),s.jsx(ot,{form:d,config:u,name:"completion.base_url",placeholder:"http://localhost:11434/v1",testId:"custom-base-url-input"}),s.jsx(Pe,{form:d,config:u,name:"completion.api_key",placeholder:"key",testId:"custom-api-key-input"})]}):void 0})(n,r),e[2]=r,e[3]=n,e[4]=a,e[5]=l):(a=e[4],l=e[5]),e[6]!==a||e[7]!==l?(c=s.jsxs(Tn,{title:"AI Code Completion",children:[i,a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c},Ec=t=>{const e=U.c(60),{form:n,config:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ne(),e[0]=i):i=e[0];const o=i;let a,l,c,d,u,g,p,m,h,f,v,x,b,j,O,w,N,C,T,R,F,B,Q,$,W,Y,V,K;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(_e,{provider:"openai",children:"OpenAI"}),e[1]=a):a=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(s.Fragment,{children:["Your OpenAI API key from"," ",s.jsx(se,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[2]=l):l=e[2],e[3]!==r||e[4]!==n?(c=s.jsx(Pe,{form:n,config:r,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:l}),d=s.jsx(ot,{form:n,config:r,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:o}),e[3]=r,e[4]=n,e[5]=c,e[6]=d):(c=e[5],d=e[6]),e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(_e,{provider:"anthropic",children:"Anthropic"}),e[7]=u):u=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(s.Fragment,{children:["Your Anthropic API key from"," ",s.jsx(se,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[8]=g):g=e[8],e[9]!==r||e[10]!==n?(p=s.jsx(Pe,{form:n,config:r,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:g}),e[9]=r,e[10]=n,e[11]=p):p=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_e,{provider:"google",children:"Google"}),e[12]=m):m=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(s.Fragment,{children:["Your Google AI API key from"," ",s.jsx(se,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[13]=h):h=e[13],e[14]!==r||e[15]!==n?(f=s.jsx(Pe,{form:n,config:r,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:h}),e[14]=r,e[15]=n,e[16]=f):f=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(_e,{provider:"ollama",children:"Ollama"}),e[17]=v):v=e[17],e[18]!==r||e[19]!==n?(x=s.jsx(ot,{form:n,config:r,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[18]=r,e[19]=n,e[20]=x):x=e[20],e[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_e,{children:"Azure"}),e[21]=b):b=e[21],e[22]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs(s.Fragment,{children:["Your Azure API key from"," ",s.jsx(se,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[22]=j):j=e[22],e[23]!==r||e[24]!==n?(O=s.jsx(Pe,{form:n,config:r,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:j}),w=s.jsx(ot,{form:n,config:r,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com",testId:"ai-azure-base-url-input"}),e[23]=r,e[24]=n,e[25]=O,e[26]=w):(O=e[25],w=e[26]),e[27]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(_e,{children:"AWS Bedrock"}),e[27]=N):N=e[27],e[28]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[28]=C):C=e[28],e[29]!==r?(T=X=>{const{field:I}=X;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"AWS Region"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"bedrock-region-select",onChange:y=>I.onChange(y.target.value),value:typeof I.value=="string"?I.value:"us-east-1",disabled:I.disabled,className:"inline-flex mr-2",children:kc.map(Rc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:"ai.bedrock.region_name"})]}),s.jsx(z,{children:"The AWS region where Bedrock service is available."})]})},e[29]=r,e[30]=T):T=e[30],e[31]!==n.control||e[32]!==T?(R=s.jsx(_,{control:n.control,disabled:o,name:"ai.bedrock.region_name",render:T}),e[31]=n.control,e[32]=T,e[33]=R):R=e[33],e[34]!==r?(F=X=>{const{field:I}=X;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:Ge,children:[s.jsx(D,{children:"AWS Profile Name (Optional)"}),s.jsx(A,{children:s.jsx(ke,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...I,value:I.value||""})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:"ai.bedrock.profile_name"})]}),s.jsx(z,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[34]=r,e[35]=F):F=e[35],e[36]!==n.control||e[37]!==F?(B=s.jsx(_,{control:n.control,disabled:o,name:"ai.bedrock.profile_name",render:F}),e[36]=n.control,e[37]=F,e[38]=B):B=e[38],e[39]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(_e,{children:"OpenAI-Compatible"}),e[39]=Q):Q=e[39],e[40]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(s.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[40]=$):$=e[40],e[41]!==r||e[42]!==n?(W=s.jsx(Pe,{form:n,config:r,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:$}),e[41]=r,e[42]=n,e[43]=W):W=e[43],e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(s.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[44]=Y):Y=e[44],e[45]!==r||e[46]!==n?(V=s.jsx(ot,{form:n,config:r,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:Y}),e[45]=r,e[46]=n,e[47]=V):V=e[47],e[48]!==f||e[49]!==x||e[50]!==O||e[51]!==w||e[52]!==R||e[53]!==B||e[54]!==W||e[55]!==V||e[56]!==c||e[57]!==d||e[58]!==p?(K=s.jsxs(Tn,{title:"AI Providers",children:[a,c,d,u,p,m,f,v,x,b,O,w,N,C,R,B,Q,W,V]}),e[48]=f,e[49]=x,e[50]=O,e[51]=w,e[52]=R,e[53]=B,e[54]=W,e[55]=V,e[56]=c,e[57]=d,e[58]=p,e[59]=K):K=e[59],K},_c=t=>{const e=U.c(15),{form:n,config:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ne(),e[0]=i):i=e[0];const o=i;let a,l,c,d,u,g,p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(J,{className:"inline",children:"marimo.toml"}),e[1]=a):a=e[1],e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key below or to ",a," to activate marimo's AI assistant for chat or edits; see"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/",children:"docs"})," ","for more info."]}),e[2]=l):l=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(s.Fragment,{children:[s.jsx("p",{children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-7-sonnet-latest" or "google/gemini-2.5-flash-preview-05-20".'}),s.jsx("p",{className:"pt-1",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[3]=c):c=e[3],e[4]!==r||e[5]!==n?(d=s.jsx(hs,{form:n,config:r,name:"ai.open_ai.model",placeholder:"gpt-4-turbo",testId:"ai-model-input",disabled:o,description:c}),e[4]=r,e[5]=n,e[6]=d):d=e[6],e[7]!==r?(u=m=>{const{field:h}=m;return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(P,{children:[s.jsx(D,{children:"Custom Rules"}),s.jsx(A,{children:s.jsx(to,{"data-testid":"ai-rules-input",className:"m-0 inline-flex w-full h-32 p-2 text-sm",placeholder:"e.g. Always use type hints; prefer polars over pandas",...h,value:h.value})}),s.jsx(M,{}),s.jsx(H,{userConfig:r,name:"ai.rules"})]}),s.jsx(z,{children:"Custom rules to include in all AI completion prompts."})]})},e[7]=r,e[8]=u):u=e[8],e[9]!==n.control||e[10]!==u?(g=s.jsx(_,{control:n.control,name:"ai.rules",render:u}),e[9]=n.control,e[10]=u,e[11]=g):g=e[11],e[12]!==d||e[13]!==g?(p=s.jsxs(Tn,{title:"AI Assist",children:[l,d,g]}),e[12]=d,e[13]=g,e[14]=p):p=e[14],p},Pc=t=>{const e=U.c(4),{form:n,config:r,onSubmit:i}=t;let o;return e[0]!==r||e[1]!==n||e[2]!==i?(o=s.jsxs(s.Fragment,{children:[s.jsx(Tc,{form:n,config:r,onSubmit:i}),s.jsx(_c,{form:n,config:r,onSubmit:i}),s.jsx(Ec,{form:n,config:r,onSubmit:i})]}),e[0]=r,e[1]=n,e[2]=i,e[3]=o):o=e[3],o};function Ac(t){return s.jsx("option",{value:t,children:t},t)}function Mc(t){return s.jsx("option",{value:t,children:t},t)}function Rc(t){return s.jsx("option",{value:t,children:t},t)}const fs=[{id:"sql",packagesRequired:[{name:"duckdb"},{name:"sqlglot"}],additionalPackageInstalls:[{name:"polars[pyarrow]"}],description:"SQL cells"},{id:"charts",packagesRequired:[{name:"altair"}],additionalPackageInstalls:[],description:"Charts in datasource viewer"},{id:"fast-charts",packagesRequired:[{name:"vegafusion"},{name:"vl-convert-python"}],additionalPackageInstalls:[],description:"Fast server-side charts"},{id:"formatting",packagesRequired:[Ne()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"ipy-export",packagesRequired:[{name:"nbformat"}],additionalPackageInstalls:[],description:"Export as IPYNB"},{id:"testing",packagesRequired:[{name:"pytest"}],additionalPackageInstalls:[],description:"Autorun unit tests"}];Ne()||fs.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const Lc=()=>{const t=U.c(23),[e]=Wn(),n=e.package_management.manager,{getPackageList:r}=Fe();let i,o;t[0]!==r?(i=()=>r(),t[0]=r,t[1]=i):i=t[1],t[2]!==n?(o=[n],t[2]=n,t[3]=o):o=t[3];const{data:a,error:l,refetch:c,isPending:d}=no(i,o);if(d){let w;return t[4]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(er,{size:"medium",centered:!0}),t[4]=w):w=t[4],w}if(l){let w;return t[5]!==l?(w=s.jsx(io,{error:l}),t[5]=l,t[6]=w):w=t[6],w}let u;t[7]!==(a==null?void 0:a.packages)?(u=(a==null?void 0:a.packages)||[],t[7]=a==null?void 0:a.packages,t[8]=u):u=t[8];const g=u;let p;t[9]!==g?(p=new Set(g.map(zc)),t[9]=g,t[10]=p):p=t[10];const m=p;let h,f,v,x,b,j,O;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Nn,{children:"Optional Features"}),t[11]=h):h=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",s.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[12]=f):f=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(so,{children:s.jsxs(Jn,{children:[s.jsx(xt,{children:"Dependency"}),s.jsx(xt,{children:"Feature"}),s.jsx(xt,{children:"Status"}),s.jsx(xt,{})]})}),t[13]=v):v=t[13],t[14]!==m||t[15]!==n||t[16]!==c?(x=fs.map(w=>{const N=w.packagesRequired.every(T=>m.has(T.name.split("[")[0])),C=w.packagesRequired.map(Hc).join(", ");return s.jsxs(Jn,{className:"text-sm",children:[s.jsx(Ut,{children:w.description}),s.jsx(Ut,{className:"font-mono text-xs",children:C}),s.jsx(Ut,{children:N?s.jsxs("div",{className:"flex items-center",children:[s.jsx(rr,{className:"h-4 w-4 text-(--grass-10) mr-2"}),s.jsx("span",{children:"Installed"})]}):s.jsxs("div",{className:"flex items-center",children:[s.jsx(ro,{className:"h-4 w-4 text-(--red-10) mr-2"}),s.jsx(Fc,{packageSpecs:[...w.packagesRequired,...w.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},w.id)}),t[14]=m,t[15]=n,t[16]=c,t[17]=x):x=t[17],t[18]!==x?(b=s.jsxs(oo,{children:[v,s.jsx(ao,{children:x})]}),t[18]=x,t[19]=b):b=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[20]=j):j=t[20],t[21]!==b?(O=s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[h,f,b,j]}),t[21]=b,t[22]=O):O=t[22],O},Fc=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=Ke.useState(!1),{addPackage:o}=Fe();return s.jsxs(ue,{size:"xs",variant:"outline",className:dt("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const a=t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),l=await o({package:a});l.success?(n(),ze({title:"Package installed",description:s.jsxs("span",{children:["The packages"," ",s.jsx(J,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):ze({title:"Failed to install package",description:l.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?s.jsx(er,{size:"small",className:"mr-2 h-3 w-3"}):s.jsx(nr,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function zc(t){return t.name}function Hc(t){return t.name}const q="flex flex-row items-center space-x-1 space-y-0",ps=[{id:"editor",label:"Editor",Icon:$n,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:Ao,className:"bg-(--grass-4)"},{id:"packageManagement",label:"Package Management",Icon:Mo,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:ir,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:No,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:sr,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:Do,className:"bg-(--slate-4)"}],gs=$e(ps[0].id),Uc=()=>{const t=U.c(45),[e,n]=Zn(),r=S.useRef(null),i=qt(Dn),[o,a]=Ye(gs),l=gt(lo),c=gt(co),{saveUserConfig:d}=Fe();let u,g;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=Pn(uo),t[0]=u):u=t[0],t[1]!==e?(g={resolver:u,defaultValues:e},t[1]=e,t[2]=g):g=t[2];const p=An(g);let m;t[3]!==d||t[4]!==n?(m=async I=>{await d({config:I}).then(()=>{n(I)})},t[3]=d,t[4]=n,t[5]=m):m=t[5];const h=m;let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=Ne(),t[6]=f):f=t[6];const v=f;let x;t[7]!==o||t[8]!==l||t[9]!==e||t[10]!==p||t[11]!==h||t[12]!==a||t[13]!==i?(x=()=>{switch(o){case"editor":return s.jsxs(s.Fragment,{children:[s.jsxs(je,{title:"Autosave",children:[s.jsx(_,{control:p.control,name:"save.autosave",render:I=>{const{field:y}=I;return s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Autosave enabled"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"autosave-checkbox",checked:y.value==="after_delay",disabled:y.disabled,onCheckedChange:k=>{y.onChange(k?"after_delay":"off")}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"save.autosave"})]})}}),s.jsx(_,{control:p.control,name:"save.autosave_delay",render:I=>{const{field:y}=I;return s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Autosave delay (seconds)"}),s.jsx(A,{children:s.jsx(Qe,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...y,value:y.value/1e3,minValue:1,onChange:k=>{y.onChange(1e3*k),Number.isNaN(k)||h(p.getValues())}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"save.autosave_delay"})]})}}),s.jsx(_,{control:p.control,name:"runtime.default_auto_download",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Save cell outputs as"}),s.jsx(A,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ee,{id:"html-checkbox",checked:Array.isArray(y.value)&&y.value.includes("html"),onCheckedChange:()=>{const k=Array.isArray(y.value)?y.value:[];y.onChange(ut(k,"html"))}}),s.jsx(D,{htmlFor:"html-checkbox",children:"HTML"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ee,{id:"ipynb-checkbox",checked:Array.isArray(y.value)&&y.value.includes("ipynb"),onCheckedChange:()=>{const k=Array.isArray(y.value)?y.value:[];y.onChange(ut(k,"ipynb"))}}),s.jsx(D,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"runtime.default_auto_download"})]}),s.jsxs(z,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",s.jsx(J,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),s.jsxs(je,{title:"Formatting",children:[s.jsx(_,{control:p.control,name:"save.format_on_save",render:I=>{const{field:y}=I;return s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Format on save"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"format-on-save-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"save.format_on_save"})]})}}),s.jsx(_,{control:p.control,name:"formatting.line_length",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Line length"}),s.jsx(A,{children:s.jsx(Qe,{"data-testid":"line-length-input",className:"m-0 w-24",...y,value:y.value,minValue:1,maxValue:1e3,onChange:k=>{y.onChange(k),Number.isNaN(k)||h(p.getValues())}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"formatting.line_length"})]}),s.jsx(z,{children:"Maximum line length when formatting code."})]})}})]}),s.jsx(je,{title:"Autocomplete",children:s.jsx(_,{control:p.control,name:"completion.activate_on_typing",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Autocomplete"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"autocomplete-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"completion.activate_on_typing"})]}),s.jsx(z,{children:"When unchecked, code completion is still available through a hotkey."}),s.jsx("div",{children:s.jsx(ue,{variant:"link",className:"mb-0 px-0",type:"button",onClick:k=>{k.preventDefault(),k.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),s.jsxs(je,{title:"Language Servers",children:[s.jsxs(z,{children:["See the"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),s.jsxs(z,{children:[s.jsx("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),s.jsx(_,{control:p.control,name:"language_servers.pylsp.enabled",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(P,{className:q,children:[s.jsxs(D,{children:[s.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",s.jsx(se,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"pylsp-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),y.value&&!l.pylsp&&s.jsxs(yt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",s.jsx(J,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),s.jsx(_,{control:p.control,name:"language_servers.basedpyright.enabled",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(P,{className:q,children:[s.jsxs(D,{children:[s.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",s.jsx(se,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"basedpyright-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),y.value&&!l.basedpyright&&s.jsxs(yt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",s.jsx(J,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),s.jsx(_,{control:p.control,name:"language_servers.ty.enabled",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs(P,{className:q,children:[s.jsxs(D,{children:[s.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",s.jsx(se,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"ty-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"language_servers.ty.enabled"})]}),y.value&&!l.ty&&s.jsxs(yt,{kind:"danger",children:["ty is not available in your current environment. Please install ",s.jsx(J,{className:"inline",children:"ty"})," in your environment."]})]})}}),s.jsx(_,{control:p.control,name:"diagnostics.enabled",render:I=>{const{field:y}=I;return s.jsxs(P,{className:q,children:[s.jsxs(D,{children:[s.jsx(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"diagnostics-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),s.jsxs(je,{title:"Keymap",children:[s.jsx(_,{control:p.control,name:"keymap.preset",render:I=>{const{field:y}=I;return s.jsx("div",{className:"flex flex-col space-y-1",children:s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Keymap"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"keymap-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:uc.map(qc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"keymap.preset"})]})})}}),s.jsx(_,{control:p.control,name:"keymap.destructive_delete",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Destructive delete"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"destructive-delete-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:k=>{y.onChange(!!k)}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"keymap.destructive_delete"})]}),s.jsxs(z,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",s.jsx(Xe,{content:s.jsxs("div",{className:"max-w-xs",children:[s.jsx("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:s.jsx(go,{className:"w-3 h-3 text-(--amber-11)"})})]}),s.jsx("div",{children:s.jsx(ue,{variant:"link",className:"mb-0 px-0",type:"button",onClick:k=>{k.preventDefault(),k.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return s.jsxs(s.Fragment,{children:[s.jsxs(je,{title:"Display",children:[s.jsx(_,{control:p.control,name:"display.default_width",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Default width"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"user-config-width-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Bc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.default_width"})]}),s.jsx(z,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),s.jsx(_,{control:p.control,name:"display.theme",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Theme"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"theme-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:po.map(Vc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.theme"})]}),s.jsx(z,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),s.jsx(_,{control:p.control,name:"display.code_editor_font_size",render:I=>{const{field:y}=I;return s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Code editor font size (px)"}),s.jsx(A,{children:s.jsx("span",{className:"inline-flex mr-2",children:s.jsx(Qe,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...y,value:y.value,minValue:8,maxValue:32,onChange:k=>{y.onChange(k),h(p.getValues())}})})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.code_editor_font_size"})]})}}),s.jsx(_,{control:p.control,name:"display.reference_highlighting",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Reference highlighting"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"reference-highlighting-checkbox",checked:y.value,onCheckedChange:y.onChange})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.reference_highlighting"})]}),s.jsx(z,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),s.jsxs(je,{title:"Outputs",children:[s.jsx(_,{control:p.control,name:"display.cell_output",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Cell output area"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"cell-output-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["above","below"].map(Wc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.cell_output"})]}),s.jsx(z,{children:"Where to display cell's output."})]})}}),s.jsx(_,{control:p.control,name:"display.dataframes",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Dataframe viewer"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"display-dataframes-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Gc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.dataframes"})]}),s.jsx(z,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),s.jsx(_,{control:p.control,name:"display.default_table_page_size",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Default table page size"}),s.jsx(A,{children:s.jsx(Qe,{"data-testid":"default-table-page-size-input",className:"m-0 w-24",...y,value:y.value,minValue:1,step:1,onChange:k=>{y.onChange(k),Number.isNaN(k)||h(p.getValues())}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.default_table_page_size"})]}),s.jsx(z,{children:"The default number of rows displayed in dataframes and SQL results."})]})}}),s.jsx(_,{control:p.control,name:"display.default_table_max_columns",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Default table max columns"}),s.jsx(A,{children:s.jsx(Qe,{"data-testid":"default-table-max-columns-input",className:"m-0 w-24",...y,value:y.value,minValue:1,step:1,onChange:k=>{y.onChange(k),Number.isNaN(k)||h(p.getValues())}})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"display.default_table_max_columns"})]}),s.jsx(z,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return s.jsx(je,{title:"Package Management",children:s.jsx(_,{control:p.control,disabled:v,name:"package_management.manager",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Manager"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"package-manager-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:fo.map(Kc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"package_management.manager"})]}),s.jsxs(z,{children:["When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",s.jsx("br",{}),s.jsx("br",{}),"Running marimo in a"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/editor_features/package_management.html#running-marimo-in-a-sandbox-environment-uv-only",children:"sandboxed environment"})," ","is only supported by ",s.jsx(J,{className:"inline",children:"uv"})]})]})}})});case"runtime":return s.jsxs(je,{title:"Runtime configuration",children:[s.jsx(_,{control:p.control,name:"runtime.auto_instantiate",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Autorun on startup"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"auto-instantiate-checkbox",disabled:y.disabled,checked:y.value,onCheckedChange:y.onChange})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"runtime.auto_instantiate"})]}),s.jsx(z,{children:"Whether to automatically run all cells on startup."})]})}}),s.jsx(_,{control:p.control,name:"runtime.on_cell_change",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"On cell change"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"on-cell-change-select",onChange:k=>y.onChange(k.target.value),value:y.value,className:"inline-flex mr-2",children:["lazy","autorun"].map($c)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"runtime.on_cell_change"})]}),s.jsx(z,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}}),s.jsx(_,{control:p.control,name:"runtime.auto_reload",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"On module change"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"auto-reload-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:v,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(Yc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"runtime.auto_reload"})]}),s.jsx(z,{children:'Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.'})]})}}),s.jsx(_,{control:p.control,name:"runtime.default_sql_output",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{children:"Default SQL output"}),s.jsx(A,{children:s.jsx(ce,{"data-testid":"user-config-sql-output-select",onChange:k=>y.onChange(k.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:$i.map(Xc)})}),s.jsx(M,{}),s.jsx(H,{userConfig:e,name:"runtime.default_sql_output"})]}),s.jsx(z,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}}),s.jsx(_,{control:p.control,name:"runtime.reactive_tests",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Autorun Unit Tests"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"reactive-test-checkbox",checked:y.value,onCheckedChange:y.onChange})})]}),s.jsx(H,{userConfig:e,name:"runtime.reactive_tests"}),s.jsx(M,{}),s.jsx(z,{children:"Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart)."})," "]})}}),s.jsxs(z,{children:["Learn more in the"," ",s.jsx(se,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return s.jsx(Pc,{form:p,config:e,onSubmit:h});case"optionalDeps":return s.jsx(Lc,{});case"labs":return s.jsxs(je,{title:"Experimental Features",children:[s.jsx("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),s.jsx(_,{control:p.control,name:"experimental.inline_ai_tooltip",render:Qc}),s.jsx(_,{control:p.control,name:"experimental.rtc_v2",render:Zc}),s.jsx(_,{control:p.control,name:"experimental.performant_table_charts",render:I=>{const{field:y}=I;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Performant Table Charts"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"performant-table-charts-checkbox",checked:y.value===!0,onCheckedChange:y.onChange})})]}),s.jsx(H,{userConfig:e,name:"experimental.performant_table_charts"}),s.jsx(z,{children:"Enable experimental table charts which are computed on the backend."})]})}})]})}},t[7]=o,t[8]=l,t[9]=e,t[10]=p,t[11]=h,t[12]=a,t[13]=i,t[14]=x):x=t[14];const b=x;let j,O,w;t[15]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(J,{className:"inline",children:"marimo.toml"}),O=s.jsx("br",{}),t[15]=j,t[16]=O):(j=t[15],O=t[16]),t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",j,O,"Run ",s.jsx(J,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[17]=w):w=t[17];const N=w;let C,T,R,F,B,Q,$,W,Y,V,K,X;return t[18]!==p||t[19]!==h?(C=p.handleSubmit(h),t[18]=p,t[19]=h,t[20]=C):C=t[20],t[21]!==a?(T=I=>a(I),t[21]=a,t[22]=T):T=t[22],t[23]===Symbol.for("react.memo_cache_sentinel")?(R=ps.map(Jc),t[23]=R):R=t[23],t[24]!==c?(F=s.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:s.jsxs("span",{children:["Version: ",c]})}),t[24]=c,t[25]=F):F=t[25],t[26]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"flex-1"}),Q=!Ne()&&N,t[26]=B,t[27]=Q):(B=t[26],Q=t[27]),t[28]!==F?($=s.jsxs(mo,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[R,F,B,Q]}),t[28]=F,t[29]=$):$=t[29],t[30]!==o||t[31]!==$||t[32]!==T?(W=s.jsx(vo,{value:o,onValueChange:T,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:$}),t[30]=o,t[31]=$,t[32]=T,t[33]=W):W=t[33],t[34]!==b?(Y=b(),t[34]=b,t[35]=Y):Y=t[35],t[36]!==Y?(V=s.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:Y}),t[36]=Y,t[37]=V):V=t[37],t[38]!==W||t[39]!==V||t[40]!==C?(K=s.jsxs("form",{ref:r,onChange:C,className:"flex text-pretty overflow-hidden",children:[W,V]}),t[38]=W,t[39]=V,t[40]=C,t[41]=K):K=t[41],t[42]!==p||t[43]!==K?(X=s.jsx(Mn,{...p,children:K}),t[42]=p,t[43]=K,t[44]=X):X=t[44],X},je=t=>{const e=U.c(5),{title:n,children:r}=t;let i,o;return e[0]!==n?(i=s.jsx(Nn,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=o):o=e[4],o};function qc(t){return s.jsx("option",{value:t,children:t},t)}function Bc(t){return s.jsx("option",{value:t,children:t},t)}function Vc(t){return s.jsx("option",{value:t,children:t},t)}function Wc(t){return s.jsx("option",{value:t,children:t},t)}function Gc(t){return s.jsx("option",{value:t,children:t},t)}function Kc(t){return s.jsx("option",{value:t,children:t},t)}function $c(t){return s.jsx("option",{value:t,children:t},t)}function Yc(t){return s.jsx("option",{value:t,children:t},t)}function Xc(t){return s.jsx("option",{value:t.value,children:t.label},t.value)}function Qc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"AI Edit Tooltip"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(z,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function Zc(t){const{field:e}=t;return s.jsxs("div",{className:"flex flex-col gap-y-1",children:[s.jsxs(P,{className:q,children:[s.jsx(D,{className:"font-normal",children:"Real-Time Collaboration"}),s.jsx(A,{children:s.jsx(ee,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),s.jsx(z,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function Jc(t){return s.jsx(ho,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:s.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[s.jsx("span",{className:dt(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:s.jsx(t.Icon,{className:"w-4 h-4"})}),s.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const En=$e(!1);function ed(){const t=U.c(5),e=qt(gs),n=qt(En);let r;t[0]!==e||t[1]!==n?(r=a=>{e(a),n(!0)},t[0]=e,t[1]=n,t[2]=r):r=t[2];const i=r;let o;return t[3]!==i?(o={handleClick:i},t[3]=i,t[4]=o):o=t[4],o}const td=t=>{const e=U.c(32),{showAppConfig:n,disabled:r,tooltip:i}=t,o=n===void 0||n,a=r!==void 0&&r,l=i===void 0?"Settings":i,[c,d]=Ye(En),u=a?"disabled":"hint-green";let g,p,m;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(tr,{strokeWidth:1.8}),e[0]=g):g=e[0],e[1]!==l?(p=s.jsx(Xe,{content:l,children:g}),e[1]=l,e[2]=p):p=e[2],e[3]!==a||e[4]!==u||e[5]!==p?(m=s.jsx(_t,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:a,color:u,children:p}),e[3]=a,e[4]=u,e[5]=p,e[6]=m):m=e[6];const h=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Yn,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:s.jsx(Uc,{})}),e[7]=f):f=e[7];const v=f;if(!o){let F,B;return e[8]!==h?(F=s.jsx(yo,{children:h}),e[8]=h,e[9]=F):F=e[9],e[10]!==d||e[11]!==c||e[12]!==F?(B=s.jsxs(Ht,{open:c,onOpenChange:d,children:[F,v]}),e[10]=d,e[11]=c,e[12]=F,e[13]=B):B=e[13],B}let x,b,j,O,w,N,C,T,R;return e[14]!==h?(x=s.jsx(xo,{asChild:!0,children:h}),e[14]=h,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Yl,{}),j=s.jsx("div",{className:"h-px bg-border my-2"}),e[16]=b,e[17]=j):(b=e[16],j=e[17]),e[18]!==d?(O=()=>d(!0),e[18]=d,e[19]=O):O=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(tr,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=w):w=e[20],e[21]!==O?(N=s.jsxs(bo,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:nd,children:[b,j,s.jsxs(ue,{onClick:O,variant:"link",className:"px-0",children:[w,"User settings"]})]}),e[21]=O,e[22]=N):N=e[22],e[23]!==N||e[24]!==x?(C=s.jsxs(jo,{children:[x,N]}),e[23]=N,e[24]=x,e[25]=C):C=e[25],e[26]!==d||e[27]!==c?(T=s.jsx(Ht,{open:c,onOpenChange:d,children:v}),e[26]=d,e[27]=c,e[28]=T):T=e[28],e[29]!==C||e[30]!==T?(R=s.jsxs(s.Fragment,{children:[C,T]}),e[29]=C,e[30]=T,e[31]=R):R=e[31],R};function nd(t){return t.preventDefault()}const rd=t=>{const e=U.c(15),{description:n,disabled:r,tooltip:i}=t,o=r!==void 0&&r,a=i===void 0?"Shutdown":i,{openConfirm:l,closeModal:c}=wo(),{sendShutdown:d}=Fe();let u;e[0]!==d?(u=()=>{d(),setTimeout(id,200)},e[0]=d,e[1]=u):u=e[1];const g=u;if(Ne())return null;const p=o?"disabled":"red";let m,h,f,v;return e[2]!==c||e[3]!==n||e[4]!==g||e[5]!==l?(m=x=>{x.stopPropagation(),l({title:"Shutdown",description:n,variant:"destructive",confirmAction:s.jsx(Io,{onClick:()=>{g(),c()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=c,e[3]=n,e[4]=g,e[5]=l,e[6]=m):m=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(mt,{strokeWidth:1}),e[7]=h):h=e[7],e[8]!==o||e[9]!==p||e[10]!==m?(f=s.jsx(_t,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:p,className:"h-[27px] w-[27px]",disabled:o,onClick:m,children:h}),e[8]=o,e[9]=p,e[10]=m,e[11]=f):f=e[11],e[12]!==f||e[13]!==a?(v=s.jsx(Xe,{content:a,children:f}),e[12]=f,e[13]=a,e[14]=v):v=e[14],v};function id(){window.close()}function sd(t){window.open(So(`?file=${t}`).toString(),"_blank")}export{ko as A,Co as B,td as C,Nc as D,Eo as G,mc as K,_o as L,Po as M,Ro as P,rd as S,Vl as T,Lo as Y,To as a,nr as b,_t as c,wc as d,it as e,is as f,Gl as g,hc as h,rs as i,ed as j,Dn as k,ts as l,Mt as m,ns as n,sd as o,ir as p,rr as q,ds as r,En as s,Gi as t,Wl as u};