@marimo-team/frontend 0.13.8-dev18 → 0.13.8-dev2

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 (92) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-CsaQHK8l.js → ConnectedDataExplorerComponent-BgS49O2y.js} +1 -1
  2. package/dist/assets/{VegaLite-COlgJ7JY.js → VegaLite-CC_cyLqE.js} +1 -1
  3. package/dist/assets/{_baseEach-CAbN_Iyk.js → _baseEach-C1pHosxb.js} +1 -1
  4. package/dist/assets/_baseMap-QWVCP_aF.js +1 -0
  5. package/dist/assets/{_baseUniq-B8WngbV6.js → _baseUniq-DsRfRzA0.js} +1 -1
  6. package/dist/assets/{_createAggregator-DdTD3yWe.js → _createAggregator-6ir76sz5.js} +1 -1
  7. package/dist/assets/{any-language-editor-CGIMhL47.js → any-language-editor-D58GINCW.js} +1 -1
  8. package/dist/assets/{architectureDiagram-IEHRJDOE-CNIZYyK9.js → architectureDiagram-IEHRJDOE-DQVugvaM.js} +1 -1
  9. package/dist/assets/{blockDiagram-JOT3LUYC-CUPGruMv.js → blockDiagram-JOT3LUYC-p81uvhJJ.js} +1 -1
  10. package/dist/assets/{c4Diagram-VJAJSXHY-CG6iuIOu.js → c4Diagram-VJAJSXHY-B5DGGp-k.js} +1 -1
  11. package/dist/assets/channel-_67l8od_.js +1 -0
  12. package/dist/assets/{chunk-4BMEZGHF-DPaRVLL_.js → chunk-4BMEZGHF-BqmkMfQC.js} +1 -1
  13. package/dist/assets/{chunk-A2AXSNBT-B1-1ioZd.js → chunk-A2AXSNBT-Bjt-wnKZ.js} +1 -1
  14. package/dist/assets/{chunk-AEK57VVT-C26AgEmv.js → chunk-AEK57VVT-Cusl4CVO.js} +1 -1
  15. package/dist/assets/{chunk-D6G4REZN-I8UovxSZ.js → chunk-D6G4REZN-BTC2HwX0.js} +1 -1
  16. package/dist/assets/{chunk-RZ5BOZE2-C4NJELtv.js → chunk-RZ5BOZE2-ClaY-eM7.js} +1 -1
  17. package/dist/assets/{chunk-XZIHB7SX-NA-XjmK6.js → chunk-XZIHB7SX-CUF2L91s.js} +1 -1
  18. package/dist/assets/{circle-play-Dz-GSvhY.js → circle-play-DuqGOANw.js} +1 -1
  19. package/dist/assets/classDiagram-GIVACNV2-BkWaU-Sm.js +1 -0
  20. package/dist/assets/classDiagram-v2-COTLJTTW-BkWaU-Sm.js +1 -0
  21. package/dist/assets/clone-2u8IDR1y.js +1 -0
  22. package/dist/assets/{compile-Bd7nidNQ.js → compile-DTXAmajo.js} +1 -1
  23. package/dist/assets/{dagre-OKDRZEBW-RQXZRL2q.js → dagre-OKDRZEBW-CNiE0aB5.js} +1 -1
  24. package/dist/assets/{data-editor-D2pOHivU.js → data-editor-nSnrGITi.js} +1 -1
  25. package/dist/assets/{diagram-SSKATNLV-7PjeSio2.js → diagram-SSKATNLV-DWtZOT0J.js} +1 -1
  26. package/dist/assets/{diagram-VNBRO52H-DCtDOleW.js → diagram-VNBRO52H-CNHDg1kN.js} +1 -1
  27. package/dist/assets/{edit-page-ub4KH6-_.js → edit-page-E7V1v51p.js} +5 -5
  28. package/dist/assets/{erDiagram-Q7BY3M3F-B45z8rM5.js → erDiagram-Q7BY3M3F-ByHIS337.js} +1 -1
  29. package/dist/assets/{flowDiagram-4HSFHLVR-bOjKc8iR.js → flowDiagram-4HSFHLVR-CzQQk_9i.js} +1 -1
  30. package/dist/assets/{ganttDiagram-APWFNJXF-CzMpCOPa.js → ganttDiagram-APWFNJXF-UqXWF8P1.js} +1 -1
  31. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-B1Y93Lm8.js → gitGraphDiagram-7IBYFJ6S-CuNV9VlX.js} +1 -1
  32. package/dist/assets/{graph-DJKBhVP5.js → graph-CSd8xQQs.js} +1 -1
  33. package/dist/assets/{home-page-B3UwQTnX.js → home-page-CL009vUk.js} +1 -1
  34. package/dist/assets/{index-CDYd52tu.js → index-BGSbdbe_.js} +1 -1
  35. package/dist/assets/{index-DZiAMocd.js → index-BHuu2nGd.js} +1 -1
  36. package/dist/assets/{index-D3gEIzCR.js → index-BSVNgZco.js} +1 -1
  37. package/dist/assets/{index-BP7oTnyz.js → index-BWTL5HDy.js} +1 -1
  38. package/dist/assets/{index--JlHaT0Z.js → index-BaqeRO80.js} +1 -1
  39. package/dist/assets/{index-Bm-z3_UC.js → index-Be3B8HV1.js} +1 -1
  40. package/dist/assets/{index-DcT7BIYG.js → index-CC2MODRp.js} +1 -1
  41. package/dist/assets/{index-Ut0eF15-.js → index-CLFnc4a4.js} +1 -1
  42. package/dist/assets/{index-DVCtOY-B.js → index-CNTUY_Lc.js} +1 -1
  43. package/dist/assets/{index-CnJvEZs3.js → index-CP_5ielV.js} +1 -1
  44. package/dist/assets/{index-Cz1uGFto.js → index-Ca3Hp1vM.js} +1 -1
  45. package/dist/assets/{index-GCwO074E.js → index-CnQ_m_IG.js} +1 -1
  46. package/dist/assets/{index-ejDgkORf.js → index-D4LCkp9S.js} +1 -1
  47. package/dist/assets/{index-DdIbsXll.js → index-D94BJajX.js} +1 -1
  48. package/dist/assets/{index-BKugeQc6.js → index-DBcz4Ck6.js} +1 -1
  49. package/dist/assets/{index-Aeq17n38.js → index-DW9seDti.js} +1 -1
  50. package/dist/assets/{index-Q-3HTlbz.js → index-DhpCbssu.js} +161 -161
  51. package/dist/assets/{index-BtDnQOk_.css → index-DredxwTT.css} +1 -1
  52. package/dist/assets/{index-BrvFW-Xa.js → index-FqMO9FND.js} +1 -1
  53. package/dist/assets/{index-BzFWZ7dq.js → index-g2y61VXL.js} +1 -1
  54. package/dist/assets/infoDiagram-PH2N3AL5-DZIPEgUQ.js +2 -0
  55. package/dist/assets/{journeyDiagram-U35MCT3I-zlxm3Dzr.js → journeyDiagram-U35MCT3I-BasXqcjT.js} +1 -1
  56. package/dist/assets/{kanban-definition-NDS4AKOZ-CV_rqP5B.js → kanban-definition-NDS4AKOZ-BaGFKaQ7.js} +1 -1
  57. package/dist/assets/{layout-g66ZTd9k.js → layout-DW7cLgAk.js} +1 -1
  58. package/dist/assets/{linear-SthcoB8m.js → linear-CsGE5GZr.js} +1 -1
  59. package/dist/assets/{mermaid-BFoyikt1.js → mermaid-0EZvq4Jv.js} +4 -4
  60. package/dist/assets/{min-BAWhIFMd.js → min-VGFBFb_W.js} +1 -1
  61. package/dist/assets/{mindmap-definition-ALO5MXBD-9UH0txxL.js → mindmap-definition-ALO5MXBD-ky4_ec1C.js} +1 -1
  62. package/dist/assets/{pieDiagram-IB7DONF6-BOkZkFJR.js → pieDiagram-IB7DONF6-Cih7xKWn.js} +1 -1
  63. package/dist/assets/{quadrantDiagram-7GDLP6J5-XaBdvXZA.js → quadrantDiagram-7GDLP6J5-t83fM8Sw.js} +1 -1
  64. package/dist/assets/{radar-MK3ICKWK-B4Hiwhp8.js → radar-MK3ICKWK-5n60lTrG.js} +1 -1
  65. package/dist/assets/{react-plotly-Bbap08Qy.js → react-plotly-Dxr5w-Ys.js} +1 -1
  66. package/dist/assets/{requirementDiagram-KVF5MWMF-DKKZB_w2.js → requirementDiagram-KVF5MWMF-CFNkvOXw.js} +1 -1
  67. package/dist/assets/{run-page-BLgPpxbP.js → run-page-ClgZml7I.js} +1 -1
  68. package/dist/assets/{sankeyDiagram-QLVOVGJD-99Xpf5_I.js → sankeyDiagram-QLVOVGJD-C6PKMl0l.js} +1 -1
  69. package/dist/assets/{sequenceDiagram-X6HHIX6F-Dfl049oN.js → sequenceDiagram-X6HHIX6F-Chr3PzD1.js} +1 -1
  70. package/dist/assets/{slides-component-tq9kIUc5.js → slides-component-xhIQyG40.js} +1 -1
  71. package/dist/assets/{sortBy-CTvtTee1.js → sortBy-Ocs-MbbX.js} +1 -1
  72. package/dist/assets/{stateDiagram-DGXRK772-CNHADnnw.js → stateDiagram-DGXRK772-CLz__VCe.js} +1 -1
  73. package/dist/assets/stateDiagram-v2-YXO3MK2T-B0mm1b0E.js +1 -0
  74. package/dist/assets/{terminal-B6lbyfMN.js → terminal-bu-fhYWe.js} +1 -1
  75. package/dist/assets/{time-D0mcu86c.js → time-1xC9mPUE.js} +1 -1
  76. package/dist/assets/{timeline-definition-BDJGKUSR-DucrJysy.js → timeline-definition-BDJGKUSR-CoVjTsQU.js} +1 -1
  77. package/dist/assets/{tracing-C12rX7hk.js → tracing-D_xfhRs4.js} +2 -2
  78. package/dist/assets/tree-BmM-bd8f.js +17 -0
  79. package/dist/assets/{useMarimoWebSocket-D7RlsB3w.js → useMarimoWebSocket-BZ6yUxbu.js} +3 -3
  80. package/dist/assets/{vega-component-B4_-xEix.js → vega-component-Ce2HUTfU.js} +1 -1
  81. package/dist/assets/{worker-Dq7HyhFQ.js → worker-D-UG5-wL.js} +1 -1
  82. package/dist/assets/{xychartDiagram-VJFVF3MP-zzGREJcW.js → xychartDiagram-VJFVF3MP-ugyREHe3.js} +1 -1
  83. package/dist/index.html +2 -2
  84. package/package.json +1 -1
  85. package/dist/assets/_baseMap-DQoOwAu0.js +0 -1
  86. package/dist/assets/channel-BSYTZica.js +0 -1
  87. package/dist/assets/classDiagram-GIVACNV2-CVYKlZcL.js +0 -1
  88. package/dist/assets/classDiagram-v2-COTLJTTW-CVYKlZcL.js +0 -1
  89. package/dist/assets/clone-BfJWW1kE.js +0 -1
  90. package/dist/assets/infoDiagram-PH2N3AL5-nZq3kN0Z.js +0 -2
  91. package/dist/assets/stateDiagram-v2-YXO3MK2T-FuURO00-.js +0 -1
  92. package/dist/assets/tree-DUKH14QY.js +0 -17
@@ -0,0 +1,17 @@
1
+ import{c7 as $i,bl as Yi,u as Y,em as vn,R as ze,d as K,f7 as yn,j as o,aW as Xi,ac as Ue,b3 as Qi,dN as Je,ap as jt,f8 as Zi,S as w,cy as Ji,ag as wt,f9 as eo,ec as et,aj as qe,fa as to,fb as xn,aC as no,fc as ro,L as R,fd as io,fe as oo,ff as so,fg as ao,fh as Ae,ce as lo,fi as co,a8 as Ce,al as It,a_ as Ve,bc as tt,fj as le,a2 as ie,dJ as uo,eC as bn,a9 as ho,a7 as fo,fk as po,fl as ye,fm as go,fn as mo,fo as jn,fp as nt,fq as wn,fr as vo,fs as rt,ft as $,fu as yo,fv as xo,dj as St,f1 as bo,fw as Ot,fx as jo,fy as wo,fz as In,fA as Sn,fB as Io,e1 as On,T as Ct,fC as So,fD as Oo,fE as Cn,fF as Co,ba as oe,fG as ko,fH as kn,fI as No,a0 as kt,fJ as Do,fK as Eo,a3 as Nn,a4 as To,a5 as _o,aP as Po,fL as Dn,fM as Nt,as as Ao,fN as Mo,aX as En,fO as Ro,fP as pe,E as Lo,fQ as Fo,fR as it,fS as Ho,fT as zo,fU as Uo,e_ as qo,fV as Tn,fW as Vo,fX as _n,fY as Bo,fZ as Wo,f_ as Pn,f$ as Ko,g0 as T,g1 as _,g2 as D,g3 as P,g4 as M,g5 as ge,g6 as H,g7 as Go,bb as ce,g8 as $o,g9 as Yo,dH as ot,dA as An,b8 as Xo,ga as Qo,ca as Mn,gb as Zo,gc as Jo,eR as es,gd as Rn,ge as Ln,gf as ts,gg as Fn,a1 as ns,gh as rs,gi as is,gj as os,gk as ss,gl as as}from"./index-DhpCbssu.js";import{e as ls}from"./index-BSVNgZco.js";/**
2
+ * @license lucide-react v0.503.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 cs=Y("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"}]]),us=Y("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"}]]),Hn=Y("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"}]]),ds=Y("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"}]]),hs=Y("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"}]]),zn=Y("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"}]]),fs=Y("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"}]]),Un=Y("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"}]]),ps=Y("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"}]]),gs=Y("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"}]]),ms=Y("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"}]]),vs=Y("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"}]]),ys=Y("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"}]]),xs=Y("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"}]]),bs=Y("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"}]]),js=Y("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 Dt(t,e){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Dt(t,e)}function qn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const ws=vn("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid 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"},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"}}),Is=vn("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-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),st=ze.forwardRef((t,e)=>{const n=K.c(15);let r,i,s,a,l,c,d;return n[0]!==t?({color:i,shape:a,size:l,className:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=a,n[5]=l):(r=n[1],i=n[2],s=n[3],a=n[4],l=n[5]),n[6]!==r||n[7]!==i||n[8]!==a||n[9]!==l?(c=yn(ws({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]!==s||n[12]!==e||n[13]!==c?(d=o.jsx("button",{ref:e,className:c,...s,children:s.children}),n[11]=s,n[12]=e,n[13]=c,n[14]=d):d=n[14],d});st.displayName="Button",ze.forwardRef((t,e)=>{const n=K.c(9);let r,i,s,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?(s=yn(Is(),r),n[3]=r,n[4]=s):s=n[4],n[5]!==i||n[6]!==e||n[7]!==s?(a=o.jsx("input",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=a):a=n[8],a}).displayName="Input";const Ss=t=>{const e=K.c(7),{openConfirm:n,closeModal:r}=Xi(),i=Cs;if(Ue())return null;let s,a,l;return e[0]!==r||e[1]!==n||e[2]!==t.description?(s=c=>{c.stopPropagation(),n({title:"Shutdown",description:t.description,variant:"destructive",confirmAction:o.jsx(Qi,{onClick:d=>{i(),r()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[0]=r,e[1]=n,e[2]=t.description,e[3]=s):s=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(Je,{strokeWidth:1}),e[4]=a):a=e[4],e[5]!==s?(l=o.jsx(jt,{content:"Shutdown",children:o.jsx(st,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:s,children:a})}),e[5]=s,e[6]=l):l=e[6],l};function Os(){window.close()}function Cs(){Zi(),setTimeout(Os,200)}function ks(t,e){const n=K.c(11),{delayMs:r,whenVisible:i,disabled:s}=e,a=s!==void 0&&s,l=w.useRef();let c,d,u,g,v;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]),w.useEffect(c,d),n[3]!==r||n[4]!==a||n[5]!==i?(u=()=>{if(r===null||a)return;const p=setInterval(()=>{var h;i&&document.visibilityState!=="visible"||((h=l.current)==null||h.call(l))},r);return()=>clearInterval(p)},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]),w.useEffect(u,g),n[8]!==a||n[9]!==i?(v=()=>{var p;document.visibilityState==="visible"&&i&&!a&&((p=l.current)==null||p.call(l))},n[8]=a,n[9]=i,n[10]=v):v=n[10],Ji(document,"visibilitychange",v),null}const Ns=t=>{const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=o.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},Vn=t=>{const e=K.c(10);let n,r,i,s,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?(s=wt("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",r),e[4]=r,e[5]=s):s=e[5],e[6]!==n||e[7]!==i||e[8]!==s?(a=o.jsx("div",{...i,className:s,children:n}),e[6]=n,e[7]=i,e[8]=s,e[9]=a):a=e[9],a},Ds=t=>{const e=K.c(2),{children:n}=t;let r;return e[0]!==n?(r=o.jsx("p",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r},Bn="marimo:copilot:signedIn",Wn=no(Bn,null,void 0,{getOnInit:!0}),Kn=qe(null),at=qe(null);function Gn(){const t=localStorage.getItem(Bn)==="true",e=eo();return t&&e.completion.copilot==="github"}class Es extends ro{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("getCompletions",{doc:{...n.doc,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var s=!0,a=!0;if(typeof n!="function")throw new TypeError("Expected a function");return $i(i)&&(s="leading"in i?!!i.leading:s,a="trailing"in i?!!i.trailing:a),Yi(n,r,{leading:s,maxWait:r,trailing:a})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw R.error("CopilotLanguageServerClient#request: Error",r),r}}isDisabled(){return!Gn()}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&&R.warn("CopilotLanguageServerClient#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&R.warn("CopilotLanguageServerClient#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=io(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:oo.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){R.log("Copilot#signInInitiate: Starting sign-in flow");try{const e=await this._request("signInInitiate",{});return R.log("Copilot#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw R.warn("Copilot#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){R.log("Copilot#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return R.log("Copilot#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw R.warn("Copilot#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return R.log("Copilot#signedIn: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw R.warn("Copilot#signedIn: Failed to check sign-in status",e),e}}acceptCompletion(e){return this._request("notifyAccepted",e)}rejectCompletions(e){return this._request("notifyRejected",e)}async getCompletion(e){if(this.isDisabled())return{completions:[]};const n=this.documentVersion;if(e.doc.version=n,n===0)return{completions:[]};var r;r=n,et.set(at,r);const i=await this.throttledGetCompletionInternal(e,n);var s;return s=n,et.get(at)===s&&et.set(at,null),n!==this.documentVersion?{completions:[]}:i||{completions:[]}}}var Ts=so();async function _s(t){return new Promise((e,n)=>{const r=new WebSocket(t);r.onopen=()=>{r.close(),e(t)},r.onerror=i=>{r.close(),n(new Error(`Failed to connect to ${t}: ${i.type}`))}})}const $n="/__marimo_copilot__.py",Yn="copilot",Xn=`file://${$n}`,Ps=Ae(()=>new As);class As extends Ts.Transport{constructor(){super(),this.delegate=void 0,this.WS_URL=lo("lsp/copilot"),this.delegate=void 0}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new co.WebSocketTransport(this.WS_URL)),await this.delegate.connect(),void R.log("Copilot#connect: Connected successfully")}catch(i){if(R.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,Ce({variant:"danger",title:"GitHub Copilot Connection Error",description:"Failed to connect to GitHub Copilot. Please check settings and try again."}),i;await new Promise(s=>setTimeout(s,n))}}async connect(){return await to(xn,e=>e.completion.copilot==="github"),await async function(e,n=5){for(let r=0;r<n;r++)try{return await _s(e)}catch{await new Promise(i=>setTimeout(i,1e3*(r+1)))}throw new Error(`Failed to connect to ${e}`)}(this.WS_URL,3),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 Be=Ae(()=>new Es({rootUri:Xn,workspaceFolders:null,transport:Ps()}));function Ms(){return ao({documentUri:Xn,client:Be(),languageId:Yn,hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const Et=qe(!1);function Qn(){const t=K.c(5),e=It(sr),n=It(Et);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 s;return t[3]!==i?(s={handleClick:i},t[3]=i,t[4]=s):s=t[4],s}const Zn=w.memo(()=>{const[t,e]=Ve(Wn),[n,r]=Ve(Kn),{handleClick:i}=Qn(),[s,a]=w.useState(),[l,c]=w.useState(!1),d=async v=>{v.preventDefault(),c(!0);try{const p=Be(),{verificationUri:h,status:f,userCode:m}=await p.signInInitiate();f==="OK"||f==="AlreadySignedIn"?e(!0):(r("signingIn"),a({url:h,code:m}))}finally{c(!1)}},u=async v=>{if(v.preventDefault(),!s)return;const p=Be();try{c(!0),R.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:h}=await p.signInConfirm({userCode:s.code});h==="OK"||h==="AlreadySignedIn"?(R.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),e(!0),r("signedIn")):(R.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:h}),r("signInFailed"))}catch(h){if(R.warn("Copilot#tryFinishSignIn: Initial sign-in confirmation failed, attempting retries"),h instanceof Error&&(h.message.includes("ECONNREFUSED")||h.message.includes("WebSocket")||h.message.includes("network")))return R.error("Copilot#tryFinishSignIn: Connection error during sign-in",h),r("connectionError"),void Ce({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:o.jsx(ie,{onClick:d,children:"Retry"})});for(let f=0;f<3;f++)try{if(await new Promise(m=>setTimeout(m,1e3)),await p.signedIn())return R.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),e(!0),void r("signedIn")}catch(m){if(R.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:f+1,maxRetries:3}),m instanceof Error&&(m.message.includes("ECONNREFUSED")||m.message.includes("WebSocket")||m.message.includes("network")))return r("connectionError"),void Ce({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please check settings and try again.",variant:"danger",action:o.jsx(ie,{variant:"link",onClick:()=>i("ai"),children:"Settings"})})}R.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),r("signInFailed")}finally{c(!1)}},g=async v=>{v.preventDefault();const p=Be();e(!1),r("signedOut"),await p.signOut()};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return o.jsx(tt,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return o.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[o.jsx("li",{children:o.jsxs("div",{className:"flex items-center",children:["Copy this code:",o.jsx("strong",{className:"ml-2",children:s==null?void 0:s.code}),o.jsx(ho,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await fo(s.code),Ce({description:"Copied to clipboard"}))}})]})}),o.jsxs("li",{children:["Enter the code at this link:",o.jsx("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:po({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),o.jsxs("li",{children:["Click here when done:",o.jsxs(ie,{size:"xs",onClick:u,className:"ml-1",children:[l&&o.jsx(bn,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),l?o.jsx(bn,{className:"h-3 w-3 mr-1 animate-spin"}):o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsxs(tt,{className:"font-normal flex items-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center bg-[var(--grass-7)] rounded-full p-1 mr-2",children:o.jsx(uo,{className:"h-3 w-3 text-white"})}),"Connected"]}),o.jsx(ie,{onClick:g,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(tt,{className:"font-normal flex",children:[o.jsx(Je,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),o.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),o.jsx(ie,{onClick:d,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(tt,{className:"font-normal flex",children:[o.jsx(Je,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),o.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",o.jsx(le,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});Zn.displayName="CopilotConfig";const Jn={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 Rs(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in Jn){const s=Jn[r],a={};for(const c of s.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 s&&(l.args=a),"mode"in s&&(l.mode=s.mode),l}e&&e(`Unknown vimrc command: "${t}"`)}var er;const Ls=Ae(()=>{$.defineAction("goToDefinition",t=>{const e=t.cm6;return yo(e)}),$.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),$.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(nt).saveNotebook()})}),Fs=Ae(async()=>{var n;const t=et.get(xn),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{R.log(`Loading vimrc from ${e}`);const r=(await xo({path:e})).contents;if(!r)return void R.error(`Failed to load vimrc from ${e}`);const i=function(s,a){const l=[];for(const c of s.split(`
7
+ `)){if(c.startsWith('"')||c.trim()==="")continue;const d=Rs(c,a);d&&l.push(d)}return l}(r,R.warn);(function(s){function a(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?$.map(u.args.lhs,u.args.rhs,u.mode):$.map(u.args.lhs,u.args.rhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function l(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?$.noremap(u.args.lhs,u.args.rhs,u.mode):$.noremap(u.args.lhs,u.args.rhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function c(u){u.args&&u.args.lhs?u.mode?$.unmap(u.args.lhs,u.mode):$.unmap(u.args.lhs):R.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function d(u){u.mode?$.mapclear(u.mode):$.mapclear()}for(const u of s)"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):R.warn(`Could not execute vimrc command "${u.name}: unknown command"`)})(i)}catch(r){R.error("Failed to load vimrc:",r)}});class lt{constructor(){this.instances=new Set,this.isBroadcasting=!1}addInstance(e){this.instances.add(e);const n=rt(e);n?n.on("vim-mode-change",r=>{var i;this.isBroadcasting||(St("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))}):R.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){St("exitInsertMode"in $,"Vim does not have an exitInsertMode method"),St("exitVisualMode"in $,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const s=rt(i);if(!s){R.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const a=s.setSelections.bind(s);if(s.setSelections=()=>[],!tr(s)){R.warn("Expected CodeMirror instance to have Vim state");continue}const l=s.state.vim;switch(n){case"normal":l.insertMode&&$.exitInsertMode(s,!0),l.visualMode&&$.exitVisualMode(s,!0);break;case"insert":l.insertMode||$.handleKey(s,"i","")}s.setSelections=a}}}function tr(t){return t.state.vim!==void 0}er=lt,lt.INSTANCES=new er;const Hs=["default","vim"];function zs(t,e){switch(t.preset){case"default":return[ye.of(nr()),ye.of(rr(e)),Ot.low(ye.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}]))];case"vim":return[ye.of(qs()),ye.of(rr(e)),ye.of([{key:"Enter",run:n=>{var i;const r=rt(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&wo(n)}}]),Ot.high(Vs("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(nt).deleteCell(),!0):!1)),jo({status:!1}),Ot.high((Ls(),Fs(),[ye.of([{key:"j",run:n=>{if(mo(n,!0)&&jn(n)){const r=n.state.facet(nt),i=n.state.facet(wn);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),ye.of([{key:"k",run:n=>{if(vo(n)&&jn(n)){const r=n.state.facet(nt),i=n.state.facet(wn);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),ye.of([{linux:"Ctrl-[",run:n=>{const r=rt(n);return r?tr(r)?!!r.state.vim.insertMode&&($.exitInsertMode(r,!0),!0):(R.warn("Expected CodeMirror instance to have Vim state"),!1):(R.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),go.define(n=>(requestAnimationFrame(()=>{lt.INSTANCES.addInstance(n)}),{destroy(){lt.INSTANCES.removeInstance(n)}}))]))];default:return bo(t.preset),[]}}const Us=new Set([In,Sn]),nr=Ae(()=>Io.filter(t=>!Us.has(t.run))),rr=t=>[{key:t.getHotkey("cell.toggleComment").key,run:In},{key:t.getHotkey("cell.toggleBlockComment").key,run:Sn}],qs=Ae(()=>{const t=new Set(["Enter","Ctrl-v"]);return nr().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Vs(t,e,n){let r="",i=0;return ye.of([{any:(s,a)=>{const l=a.key,c=a.timeStamp;return l!==t||!e(s)?(r="",i=0,!1):r===t&&c-i<500&&n(s)?(r="",i=0,!0):(r=l,i=c,!1)}}])}function Bs(){return["compact","medium","full","columns"]}const Tt=qe(!1),Ws=()=>{const t=K.c(78),[e,n]=Ve(Tt),[r,i]=w.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];const[a,l]=w.useState(s),[c,d]=On(),u=Ct(So);let g,v;t[1]!==n?(g=()=>n(Ks),t[1]=n,t[2]=g):g=t[2],Oo("global.showHelp",g),t[3]!==c||t[4]!==d?(v=async B=>{const ne={...c};d(B),await Cn({config:B}).catch(fe=>{throw d(ne),fe})},t[3]=c,t[4]=d,t[5]=v):v=t[5];const p=v;let h;t[6]!==c||t[7]!==r||t[8]!==p?(h=async B=>{if(!r)return;const ne=B.join("-"),fe={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides,[r]:ne}}};i(null),l([]),await p(fe)},t[6]=c,t[7]=r,t[8]=p,t[9]=h):h=t[9];const f=h;let m;t[10]!==c||t[11]!==r||t[12]!==p?(m=async()=>{if(!r)return;const B={...c,keymap:{...c.keymap,overrides:{...c.keymap.overrides}}};delete B.keymap.overrides[r],i(null),l([]),await p(B)},t[10]=c,t[11]=r,t[12]=p,t[13]=m):m=t[13];const x=m;let j;t[14]!==c||t[15]!==p?(j=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const B={...c,keymap:{...c.keymap,overrides:{}}};i(null),l([]),await p(B)},t[14]=c,t[15]=p,t[16]=j):j=t[16];const b=j;if(!e)return null;let C;t[17]!==r||t[18]!==f||t[19]!==x||t[20]!==u||t[21]!==a?(C=B=>{const ne=u.getHotkey(B);if(r===B){const fe=Co(B);return o.jsxs("div",{children:[o.jsx(oe,{defaultValue:a.join("+"),placeholder:ne.name,onKeyDown:re=>{re.preventDefault();const we=[];if(re.key==="Meta"||re.key==="Control"||re.key==="Alt"||re.key==="Shift"||(re.metaKey&&we.push(ko()?"Cmd":"Meta"),re.ctrlKey&&we.push("Ctrl"),re.altKey&&we.push("Alt"),re.shiftKey&&we.push("Shift"),re.key==="-"))return;if(re.key==="Escape"&&we.length===0)return i(null),void l([]);let mn=re.key.toLowerCase();re.key===" "&&(mn="Space"),we.push(mn),f(we)},autoFocus:!0,endAdornment:o.jsx(ie,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),l([])},children:o.jsx(Je,{className:"w-4 h-4"})})}),o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),fe.key!==ne.key&&o.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:x,children:["Reset to default:"," ",o.jsx("span",{className:"font-mono",children:fe.key})]})]})]},B)}return o.jsxs("div",{className:"grid grid-cols-[auto,2fr,3fr] gap-2 items-center",children:[u.isEditable(B)?o.jsx(kn,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{l([]),i(B)}}):o.jsx("div",{className:"w-3 h-3"}),o.jsx(No,{className:"justify-end",shortcut:ne.key}),o.jsx("span",{children:ne.name.toLowerCase()})]},B)},t[17]=r,t[18]=f,t[19]=x,t[20]=u,t[21]=a,t[22]=C):C=t[22];const O=C;let k,E,z,U,V,W,Z,J,ee,te,S,y,I,q,Se,Oe,be,ve,je,Ee,Te,_e,Pe,Ze;if(t[23]!==u||t[24]!==e||t[25]!==O||t[26]!==n){const B=u.getHotkeyGroups(),ne=fe=>{const re=B[fe];return o.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[o.jsx("h3",{className:"text-lg font-medium",children:fe}),re.map(we=>O(we))]})};z=kt,I=e,t[44]!==n?(q=fe=>n(fe),t[44]=n,t[45]=q):q=t[45],E=Do,S="sm:items-center sm:top-0",t[46]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(Eo,{}),t[46]=y):y=t[46],k=Nn,J=!1,ee="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[47]===Symbol.for("react.memo_cache_sentinel")?(te=o.jsx(To,{children:o.jsx(_o,{children:"Shortcuts"})}),t[47]=te):te=t[47],W="flex flex-row gap-3",Z=o.jsxs("div",{className:"w-1/2",children:[ne("Editing"),ne("Markdown")]}),Se="w-1/2",Oe=ne("Navigation"),be=ne("Running Cells"),U=ne("Creation and Ordering"),V=ne("Other"),t[23]=u,t[24]=e,t[25]=O,t[26]=n,t[27]=k,t[28]=E,t[29]=z,t[30]=U,t[31]=V,t[32]=W,t[33]=Z,t[34]=J,t[35]=ee,t[36]=te,t[37]=S,t[38]=y,t[39]=I,t[40]=q,t[41]=Se,t[42]=Oe,t[43]=be}else k=t[27],E=t[28],z=t[29],U=t[30],V=t[31],W=t[32],Z=t[33],J=t[34],ee=t[35],te=t[36],S=t[37],y=t[38],I=t[39],q=t[40],Se=t[41],Oe=t[42],be=t[43];return t[48]===Symbol.for("react.memo_cache_sentinel")?(ve=o.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[48]=ve):ve=t[48],t[49]!==b?(je=o.jsx(ie,{className:"mt-4 hover:bg-destructive/10 hover:border-destructive",variant:"outline",size:"xs",onClick:b,tabIndex:-1,children:ve}),t[49]=b,t[50]=je):je=t[50],t[51]!==U||t[52]!==V||t[53]!==je||t[54]!==Se||t[55]!==Oe||t[56]!==be?(Ee=o.jsxs("div",{className:Se,children:[Oe,be,U,V,je]}),t[51]=U,t[52]=V,t[53]=je,t[54]=Se,t[55]=Oe,t[56]=be,t[57]=Ee):Ee=t[57],t[58]!==W||t[59]!==Z||t[60]!==Ee?(Te=o.jsxs("div",{className:W,children:[Z,Ee]}),t[58]=W,t[59]=Z,t[60]=Ee,t[61]=Te):Te=t[61],t[62]!==k||t[63]!==J||t[64]!==ee||t[65]!==te||t[66]!==Te?(_e=o.jsxs(k,{usePortal:J,className:ee,children:[te,Te]}),t[62]=k,t[63]=J,t[64]=ee,t[65]=te,t[66]=Te,t[67]=_e):_e=t[67],t[68]!==E||t[69]!==S||t[70]!==y||t[71]!==_e?(Pe=o.jsxs(E,{className:S,children:[y,_e]}),t[68]=E,t[69]=S,t[70]=y,t[71]=_e,t[72]=Pe):Pe=t[72],t[73]!==z||t[74]!==I||t[75]!==q||t[76]!==Pe?(Ze=o.jsx(z,{open:I,onOpenChange:q,children:Pe}),t[73]=z,t[74]=I,t[75]=q,t[76]=Pe,t[77]=Ze):Ze=t[77],Ze};function Ks(t){return!t}const Gs=["claude-3-7-sonnet-latest","claude-3-5-sonnet-latest","claude-3-5-haiku-latest)","claude-3-opus-latest","deepseek-v3","deepseek-r1","gemini-2.5-pro","gemini-2.5-flash","gemini-2.0-flash-lite","gemini-2.0-flash","gpt-3.5-turbo","gpt-4","gpt-4-turbo-2024-04-09","gpt-4o","gpt-4o-mini","gpt-4.5","o1","o1-mini","o1-preview","o3-mini"],ir=[{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:[Ue()?{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"}];Ue()||ir.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const $s=()=>{const t=K.c(21),[e]=On(),n=e.package_management.manager;let r;t[0]!==n?(r=[n],t[0]=n,t[1]=r):r=t[1];const{data:i,loading:s,error:a,reload:l}=Po(Xs,r);if(s&&!i){let b;return t[2]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(En,{size:"medium",centered:!0}),t[2]=b):b=t[2],b}if(a){let b;return t[3]!==a?(b=o.jsx(Lo,{error:a}),t[3]=a,t[4]=b):b=t[4],b}let c;t[5]!==(i==null?void 0:i.packages)?(c=(i==null?void 0:i.packages)||[],t[5]=i==null?void 0:i.packages,t[6]=c):c=t[6];const d=c;let u;t[7]!==d?(u=new Set(d.map(Qs)),t[7]=d,t[8]=u):u=t[8];const g=u;let v,p,h,f,m,x,j;return t[9]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Vn,{children:"Optional Features"}),t[9]=v):v=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",o.jsx("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=p):p=t[10],t[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Fo,{children:o.jsxs(Dn,{children:[o.jsx(it,{children:"Dependency"}),o.jsx(it,{children:"Feature"}),o.jsx(it,{children:"Status"}),o.jsx(it,{})]})}),t[11]=h):h=t[11],t[12]!==g||t[13]!==n||t[14]!==l?(f=ir.map(b=>{const C=b.packagesRequired.every(k=>g.has(k.name.split("[")[0])),O=b.packagesRequired.map(Zs).join(", ");return o.jsxs(Dn,{className:"text-sm",children:[o.jsx(Nt,{children:b.description}),o.jsx(Nt,{className:"font-mono text-xs",children:O}),o.jsx(Nt,{children:C?o.jsxs("div",{className:"flex items-center",children:[o.jsx(hs,{className:"h-4 w-4 text-[var(--grass-10)] mr-2"}),o.jsx("span",{children:"Installed"})]}):o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ao,{className:"h-4 w-4 text-[var(--red-10)] mr-2"}),o.jsx(Ys,{packageSpecs:[...b.packagesRequired,...b.additionalPackageInstalls],packageManager:n,onSuccess:l})]})})]},b.id)}),t[12]=g,t[13]=n,t[14]=l,t[15]=f):f=t[15],t[16]!==f?(m=o.jsxs(Ho,{children:[h,o.jsx(zo,{children:f})]}),t[16]=f,t[17]=m):m=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=x):x=t[18],t[19]!==m?(j=o.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[v,p,m,x]}),t[19]=m,t[20]=j):j=t[20],j},Ys=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=ze.useState(!1);return o.jsxs(ie,{size:"xs",variant:"outline",className:wt("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const s=t.map(l=>l.minVersion?`${l.name}>=${l.minVersion}`:l.name).join(" "),a=await Ro({package:s});a.success?(n(),Ce({title:"Package installed",description:o.jsxs("span",{children:["The packages"," ",o.jsx(pe,{className:"inline",children:t.map(l=>l.name).join(", ")})," ","have been added to your environment."]})})):Ce({title:"Failed to install package",description:a.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?o.jsx(En,{size:"small",className:"mr-2 h-3 w-3"}):o.jsx(Hn,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function Xs(){return Mo()}function Qs(t){return t.name}function Zs(t){return t.name}const L="flex flex-row items-center space-x-1 space-y-0",or=[{id:"editor",label:"Editor",Icon:kn,className:"bg-[var(--blue-4)]"},{id:"display",label:"Display",Icon:ys,className:"bg-[var(--grass-4)]"},{id:"packageManagement",label:"Package Management",Icon:xs,className:"bg-[var(--red-4)]"},{id:"runtime",label:"Runtime",Icon:zn,className:"bg-[var(--amber-4)]"},{id:"ai",label:"AI",Icon:ds,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Un,className:"bg-[var(--orange-4)]"},{id:"labs",label:"Labs",Icon:fs,className:"bg-[var(--slate-4)]"}],sr=qe(or[0].id),Js=()=>{const t=K.c(42),[e,n]=Uo(),r=w.useRef(null),i=It(Tt),[s,a]=Ve(sr),l=Ct(qo);let c,d;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=Tn(Vo),t[0]=c):c=t[0],t[1]!==e?(d={resolver:c,defaultValues:e},t[1]=e,t[2]=d):d=t[2];const u=_n(d);let g;t[3]!==n?(g=async S=>{await Cn({config:S}).then(()=>{n(S)})},t[3]=n,t[4]=g):g=t[4];const v=g;let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=Ue(),t[5]=p):p=t[5];const h=p;let f;t[6]!==e||t[7]!==u?(f=()=>{const S=u.getValues("completion.copilot");return S===!1?null:S==="codeium"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Codeium API key, follow"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#codeium-copilot",children:"these instructions"}),"."]}),o.jsx(T,{control:u.control,name:"completion.codeium_api_key",render:y=>{const{field:I}=y;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"API Key"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"codeium-api-key-input",className:"m-0 inline-flex",placeholder:"key",...I,value:I.value||""})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.codeium_api_key"})]})}})]}):S==="github"?o.jsx(Zn,{}):S==="custom"?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-sm text-muted-secondary",children:"Configure your custom AI completion provider with the following settings."}),o.jsx(T,{control:u.control,name:"completion.model",render:y=>{const{field:I}=y;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Model"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"custom-model-input",className:"m-0 inline-flex",placeholder:"Qwen2.5-Coder-7B",...I,value:I.value||""})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.model"})]})}}),o.jsx(T,{control:u.control,name:"completion.base_url",render:y=>{const{field:I}=y;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Base URL"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"custom-base-url-input",className:"m-0 inline-flex",placeholder:"http://localhost:11434/v1",...I,value:I.value||""})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.base_url"})]})}}),o.jsx(T,{control:u.control,name:"completion.api_key",render:y=>{const{field:I}=y;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"API Key"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"custom-api-key-input",className:"m-0 inline-flex",placeholder:"key",...I,value:I.value||""})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.api_key"})]})}})]}):void 0},t[6]=e,t[7]=u,t[8]=f):f=t[8];const m=f;let x;t[9]!==s||t[10]!==l||t[11]!==e||t[12]!==u||t[13]!==v||t[14]!==m||t[15]!==a||t[16]!==i?(x=()=>{switch(s){case"editor":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"Autosave",children:[o.jsx(T,{control:u.control,name:"save.autosave",render:S=>{const{field:y}=S;return o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autosave enabled"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"autosave-checkbox",checked:y.value==="after_delay",disabled:y.disabled,onCheckedChange:I=>{y.onChange(I?"after_delay":"off")}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"save.autosave"})]})}}),o.jsx(T,{control:u.control,name:"save.autosave_delay",render:S=>{const{field:y}=S;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Autosave delay (seconds)"}),o.jsx(P,{children:o.jsx(ot,{"data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:u.getValues("save.autosave")!=="after_delay",...y,value:y.value/1e3,minValue:1,onChange:I=>{y.onChange(1e3*I),Number.isNaN(I)||v(u.getValues())}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"save.autosave_delay"})]})}})]}),o.jsxs(se,{title:"Formatting",children:[o.jsx(T,{control:u.control,name:"save.format_on_save",render:S=>{const{field:y}=S;return o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Format on save"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"format-on-save-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(I)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"save.format_on_save"})]})}}),o.jsx(T,{control:u.control,name:"formatting.line_length",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Line length"}),o.jsx(P,{children:o.jsx(ot,{"data-testid":"line-length-input",className:"m-0 w-24",...y,value:y.value,minValue:1,maxValue:1e3,onChange:I=>{y.onChange(I),Number.isNaN(I)||v(u.getValues())}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"formatting.line_length"})]}),o.jsx(H,{children:"Maximum line length when formatting code."})]})}})]}),o.jsx(se,{title:"Autocomplete",children:o.jsx(T,{control:u.control,name:"completion.activate_on_typing",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autocomplete"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"autocomplete-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.activate_on_typing"})]}),o.jsx(H,{children:"When unchecked, code completion is still available through a hotkey."}),o.jsx("div",{children:o.jsx(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:I=>{I.preventDefault(),I.stopPropagation(),a("ai")},children:"Edit AI autocomplete"})})]})}})}),o.jsxs(se,{title:"Language Servers",children:[o.jsx(T,{control:u.control,name:"language_servers.pylsp.enabled",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(_,{className:L,children:[o.jsxs(D,{children:[o.jsx(An,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",o.jsx(le,{href:"https://github.com/python-lsp/python-lsp-server",children:"pylsp"}),")"]}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"pylsp-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),y.value&&!l.pylsp&&o.jsxs(Xo,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",o.jsx(pe,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),o.jsxs(H,{children:["See the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),o.jsx(T,{control:u.control,name:"diagnostics.enabled",render:S=>{const{field:y}=S;return o.jsxs(_,{className:L,children:[o.jsxs(D,{children:[o.jsx(An,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"diagnostics-checkbox",checked:y.value,disabled:y.disabled,onCheckedChange:I=>{y.onChange(!!I)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),o.jsx(se,{title:"Keymap",children:o.jsx(T,{control:u.control,name:"keymap.preset",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Keymap"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"keymap-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:Hs.map(ea)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"keymap.preset"})]}),o.jsx("div",{children:o.jsx(ie,{variant:"link",className:"mb-0 px-0",type:"button",onClick:I=>{I.preventDefault(),I.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})})]});case"display":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"Display",children:[o.jsx(T,{control:u.control,name:"display.default_width",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Default width"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"user-config-width-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(ta)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.default_width"})]}),o.jsx(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),o.jsx(T,{control:u.control,name:"display.theme",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Theme"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"theme-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:Yo.map(na)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.theme"})]}),o.jsx(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),o.jsx(T,{control:u.control,name:"display.code_editor_font_size",render:S=>{const{field:y}=S;return o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Code editor font size (px)"}),o.jsx(P,{children:o.jsx("span",{className:"inline-flex mr-2",children:o.jsx(ot,{"data-testid":"code-editor-font-size-input",className:"m-0 w-24",...y,value:y.value,minValue:8,maxValue:32,onChange:I=>{y.onChange(I),v(u.getValues())}})})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.code_editor_font_size"})]})}})]}),o.jsxs(se,{title:"Outputs",children:[o.jsx(T,{control:u.control,name:"display.cell_output",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Cell output area"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"cell-output-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["above","below"].map(ra)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.cell_output"})]}),o.jsx(H,{children:"Where to display cell's output."})]})}}),o.jsx(T,{control:u.control,name:"display.dataframes",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Dataframe viewer"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"display-dataframes-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(ia)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.dataframes"})]}),o.jsx(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),o.jsx(T,{control:u.control,name:"display.default_table_page_size",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Default table page size"}),o.jsx(P,{children:o.jsx(ot,{"data-testid":"default-table-page-size-input",className:"m-0 w-24",...y,value:y.value,minValue:1,step:1,onChange:I=>{y.onChange(I),Number.isNaN(I)||v(u.getValues())}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"display.default_table_page_size"})]}),o.jsx(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return o.jsx(se,{title:"Package Management",children:o.jsx(T,{control:u.control,disabled:h,name:"package_management.manager",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Manager"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"package-manager-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:y.disabled,className:"inline-flex mr-2",children:$o.map(oa)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"package_management.manager"})]}),o.jsxs(H,{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"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",o.jsx("br",{}),o.jsx("br",{}),"Running marimo in a"," ",o.jsx(le,{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 ",o.jsx(pe,{className:"inline",children:"uv"})]})]})}})});case"runtime":return o.jsxs(se,{title:"Runtime configuration",children:[o.jsx(T,{control:u.control,name:"runtime.auto_instantiate",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autorun on startup"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"auto-instantiate-checkbox",disabled:y.disabled,checked:y.value,onCheckedChange:y.onChange})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"runtime.auto_instantiate"})]}),o.jsx(H,{children:"Whether to automatically run all cells on startup."})]})}}),o.jsx(T,{control:u.control,name:"runtime.on_cell_change",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"On cell change"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"on-cell-change-select",onChange:I=>y.onChange(I.target.value),value:y.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(sa)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"runtime.on_cell_change"})]}),o.jsx(H,{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.`})]})}}),o.jsx(T,{control:u.control,name:"runtime.auto_reload",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"On module change"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"auto-reload-select",onChange:I=>y.onChange(I.target.value),value:y.value,disabled:h,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(aa)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"runtime.auto_reload"})]}),o.jsx(H,{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.'})]})}}),o.jsx(T,{control:u.control,name:"runtime.reactive_tests",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Autorun Unit Tests"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"reactive-test-checkbox",checked:y.value,onCheckedChange:y.onChange})})]}),o.jsx(F,{userConfig:e,name:"runtime.reactive_tests"}),o.jsx(M,{}),o.jsx(H,{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)."})," "]})}}),o.jsxs(H,{children:["Learn more in the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return o.jsxs(o.Fragment,{children:[o.jsxs(se,{title:"AI Code Completion",children:[o.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."}),o.jsx(T,{control:u.control,name:"completion.copilot",render:S=>{const{field:y}=S;return o.jsx("div",{className:"flex flex-col space-y-1",children:o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Provider"}),o.jsx(P,{children:o.jsx(ge,{"data-testid":"copilot-select",onChange:I=>{I.target.value==="none"?y.onChange(!1):y.onChange(I.target.value)},value:y.value===!0?"github":y.value===!1?"none":y.value,disabled:y.disabled,className:"inline-flex mr-2",children:["none","github","codeium","custom"].map(la)})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"completion.copilot"})]})})}}),m()]}),o.jsxs(se,{title:"AI Keys",children:[o.jsx(T,{control:u.control,name:"ai.open_ai.api_key",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"OpenAI API Key"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"ai-openai-api-key-input",className:"m-0 inline-flex",placeholder:"sk-proj...",...y,onChange:I=>{const q=I.target.value;q.includes("*")||y.onChange(q)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.api_key"})]}),o.jsxs(H,{children:["Your OpenAI API key from"," ",o.jsx(le,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]})]})}}),o.jsx(T,{control:u.control,name:"ai.anthropic.api_key",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Anthropic API Key"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"ai-anthropic-api-key-input",className:"m-0 inline-flex",placeholder:"sk-ant...",...y,onChange:I=>{const q=I.target.value;q.includes("*")||y.onChange(q)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.anthropic.api_key"})]}),o.jsxs(H,{children:["Your Anthropic API key from"," ",o.jsx(le,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]})]})}}),o.jsx(T,{control:u.control,name:"ai.google.api_key",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Google AI API Key"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"ai-google-api-key-input",className:"m-0 inline-flex",placeholder:"AI...",...y,onChange:I=>{const q=I.target.value;q.includes("*")||y.onChange(q)}})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.google.api_key"})]}),o.jsxs(H,{children:["Your Google AI API key from"," ",o.jsx(le,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]})]})}})]}),o.jsxs(se,{title:"AI Assist",children:[o.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add an API key to ",o.jsx(pe,{className:"inline",children:"marimo.toml"})," to activate marimo's AI assistant; see"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html",children:"docs"})," ","for more info."]}),o.jsx(T,{control:u.control,disabled:h,name:"ai.open_ai.base_url",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Base URL"}),o.jsx(P,{children:o.jsx(oe,{"data-testid":"ai-base-url-input",className:"m-0 inline-flex",placeholder:"https://api.openai.com/v1",...y})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.base_url"})]}),o.jsx(H,{children:"This URL can be any OpenAI-compatible API endpoint."})]})}}),o.jsx(T,{control:u.control,disabled:h,name:"ai.open_ai.model",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{children:"Model"}),o.jsx(P,{children:o.jsx(oe,{list:"ai-model-datalist","data-testid":"ai-model-input",className:"m-0 inline-flex",placeholder:"gpt-4-turbo",...y})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.open_ai.model"})]}),o.jsx("datalist",{id:"ai-model-datalist",children:Gs.map(ca)}),o.jsx(H,{children:'If the model starts with "claude-", we will use your Anthropic API key. If the model starts with "gemini-", we will use your Google AI API key. Otherwise, we will use your OpenAI API key.'})]})}}),o.jsx(T,{control:u.control,name:"ai.rules",render:S=>{const{field:y}=S;return o.jsxs("div",{className:"flex flex-col",children:[o.jsxs(_,{children:[o.jsx(D,{children:"Custom Rules"}),o.jsx(P,{children:o.jsx(Go,{"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",...y,value:y.value})}),o.jsx(M,{}),o.jsx(F,{userConfig:e,name:"ai.rules"})]}),o.jsx(H,{children:"Custom rules to include in all AI completion prompts."})]})}})]})]});case"optionalDeps":return o.jsx($s,{});case"labs":return o.jsxs(se,{title:"Experimental Features",children:[o.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."}),o.jsx(T,{control:u.control,name:"experimental.inline_ai_tooltip",render:ua}),o.jsx(T,{control:u.control,name:"experimental.table_charts",render:da}),o.jsx(T,{control:u.control,name:"experimental.rtc_v2",render:ha})]})}},t[9]=s,t[10]=l,t[11]=e,t[12]=u,t[13]=v,t[14]=m,t[15]=a,t[16]=i,t[17]=x):x=t[17];const j=x;let b,C,O;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(pe,{className:"inline",children:"marimo.toml"}),C=o.jsx("br",{}),t[18]=b,t[19]=C):(b=t[18],C=t[19]),t[20]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",b,C,"Run ",o.jsx(pe,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[20]=O):O=t[20];const k=O;let E,z,U,V,W,Z,J,ee,te;return t[21]!==u||t[22]!==v?(E=u.handleSubmit(v),t[21]=u,t[22]=v,t[23]=E):E=t[23],t[24]!==a?(z=S=>a(S),t[24]=a,t[25]=z):z=t[25],t[26]===Symbol.for("react.memo_cache_sentinel")?(U=or.map(fa),t[26]=U):U=t[26],t[27]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsxs(Bo,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[U,o.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:o.jsxs("span",{children:["Version: ",Wo()]})}),o.jsx("div",{className:"flex-1"}),!Ue()&&k]}),t[27]=V):V=t[27],t[28]!==s||t[29]!==z?(W=o.jsx(Qo,{value:s,onValueChange:z,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:V}),t[28]=s,t[29]=z,t[30]=W):W=t[30],t[31]!==j?(Z=j(),t[31]=j,t[32]=Z):Z=t[32],t[33]!==Z?(J=o.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:Z}),t[33]=Z,t[34]=J):J=t[34],t[35]!==W||t[36]!==J||t[37]!==E?(ee=o.jsxs("form",{ref:r,onChange:E,className:"flex text-pretty overflow-hidden",children:[W,J]}),t[35]=W,t[36]=J,t[37]=E,t[38]=ee):ee=t[38],t[39]!==u||t[40]!==ee?(te=o.jsx(Pn,{...u,children:ee}),t[39]=u,t[40]=ee,t[41]=te):te=t[41],te},se=t=>{const e=K.c(5),{title:n,children:r}=t;let i,s;return e[0]!==n?(i=o.jsx(Vn,{children:n}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(s=o.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[i,r]}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s},F=t=>{const e=K.c(24),{userConfig:n,name:r}=t;let i;e[0]!==r||e[1]!==n?(i=Mn(n,r),e[0]=r,e[1]=n,e[2]=i):i=e[2];const s=i,a=Ct(Zo);let l;e[3]!==r||e[4]!==a?(l=Mn(a,r),e[3]=r,e[4]=a,e[5]=l):l=e[5];const c=l;if(c==null||s===c)return null;let d,u,g,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs("span",{children:["This setting is overridden by"," ",o.jsx(pe,{className:"inline",children:"pyproject.toml"}),"."]}),u=o.jsx("br",{}),e[6]=d,e[7]=u):(d=e[6],u=e[7]),e[8]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs("span",{children:["Edit the ",o.jsx(pe,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),v=o.jsx("br",{}),e[8]=g,e[9]=v):(g=e[8],v=e[9]);const p=String(s);let h,f;e[10]!==p?(h=o.jsxs("span",{children:["User value: ",o.jsx("strong",{children:p})]}),e[10]=p,e[11]=h):h=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("br",{}),e[12]=f):f=e[12];const m=String(c);let x,j,b;e[13]!==m?(x=o.jsxs("span",{children:["Project value: ",o.jsx("strong",{children:m})]}),e[13]=m,e[14]=x):x=e[14],e[15]!==x||e[16]!==h?(j=o.jsxs(o.Fragment,{children:[d,u,g,v,h,f,x]}),e[15]=x,e[16]=h,e[17]=j):j=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Un,{className:"w-3 h-3"}),e[18]=b):b=e[18];const C=String(c);let O,k;return e[19]!==C?(O=o.jsxs("span",{className:"text-[var(--amber-12)] text-xs flex items-center gap-1 border rounded px-2 py-1 bg-[var(--amber-2)] border-[var(--amber-6)] ml-1",children:[b,"Overridden by pyproject.toml [",C,"]"]}),e[19]=C,e[20]=O):O=e[20],e[21]!==j||e[22]!==O?(k=o.jsx(jt,{content:j,children:O}),e[21]=j,e[22]=O,e[23]=k):k=e[23],k};function ea(t){return o.jsx("option",{value:t,children:t},t)}function ta(t){return o.jsx("option",{value:t,children:t},t)}function na(t){return o.jsx("option",{value:t,children:t},t)}function ra(t){return o.jsx("option",{value:t,children:t},t)}function ia(t){return o.jsx("option",{value:t,children:t},t)}function oa(t){return o.jsx("option",{value:t,children:t},t)}function sa(t){return o.jsx("option",{value:t,children:t},t)}function aa(t){return o.jsx("option",{value:t,children:t},t)}function la(t){return o.jsx("option",{value:t,children:t},t)}function ca(t){return o.jsx("option",{value:t,children:t},t)}function ua(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"AI Edit Tooltip"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function da(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Table Charts"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"data-table-plugin-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:"Enable experimental charting feature on tables. Data is saved in local storage. May not be performant."})]})}function ha(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:L,children:[o.jsx(D,{className:"font-normal",children:"Real-Time Collaboration"}),o.jsx(P,{children:o.jsx(ce,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function fa(t){return o.jsx(Ko,{value:t.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:o.jsxs("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[o.jsx("span",{className:wt(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground flex-shrink-0"),children:o.jsx(t.Icon,{className:"w-4 h-4"})}),o.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const pa=()=>{const t=K.c(30),[e,n]=Jo();let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=Tn(es),t[0]=r):r=t[0],t[1]!==e?(i={resolver:r,defaultValues:e},t[1]=e,t[2]=i):i=t[2];const s=_n(i);let a;t[3]!==n?(a=async j=>{await ts({config:j}).then(()=>{n(j)}).catch(()=>{n(j)})},t[3]=n,t[4]=a):a=t[4];const l=a;let c,d,u,g,v,p,h,f,m,x;return t[5]!==e.width?(c=[e.width],t[5]=e.width,t[6]=c):c=t[6],w.useEffect(ga,c),t[7]!==s||t[8]!==l?(d=s.handleSubmit(l),t[7]=s,t[8]=l,t[9]=d):d=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsxs("div",{children:[o.jsx(Ns,{children:"Notebook Settings"}),o.jsx(Ds,{children:"Configure how your notebook or application looks and behaves."})]}),t[10]=u):u=t[10],t[11]!==s.control?(g=o.jsxs(ct,{title:"Display",children:[o.jsx(T,{control:s.control,name:"width",render:va}),o.jsx(T,{control:s.control,name:"app_title",render:ya})]}),t[11]=s.control,t[12]=g):g=t[12],t[13]!==s.control?(v=o.jsxs(ct,{title:"Custom Files",children:[o.jsx(T,{control:s.control,name:"css_file",render:xa}),o.jsx(T,{control:s.control,name:"html_head_file",render:ba})]}),t[13]=s.control,t[14]=v):v=t[14],t[15]!==s.control?(p=o.jsx(ct,{title:"Data",children:o.jsx(T,{control:s.control,name:"sql_output",render:ja})}),t[15]=s.control,t[16]=p):p=t[16],t[17]!==s.control?(h=o.jsx(ct,{title:"Exporting outputs",children:o.jsx(T,{control:s.control,name:"auto_download",render:wa})}),t[17]=s.control,t[18]=h):h=t[18],t[19]!==g||t[20]!==v||t[21]!==p||t[22]!==h?(f=o.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[g,v,p,h]}),t[19]=g,t[20]=v,t[21]=p,t[22]=h,t[23]=f):f=t[23],t[24]!==f||t[25]!==d?(m=o.jsxs("form",{onChange:d,className:"flex flex-col gap-6",children:[u,f]}),t[24]=f,t[25]=d,t[26]=m):m=t[26],t[27]!==s||t[28]!==m?(x=o.jsx(Pn,{...s,children:m}),t[27]=s,t[28]=m,t[29]=x):x=t[29],x},ct=t=>{const e=K.c(5),{title:n,children:r}=t;let i,s;return e[0]!==n?(i=o.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?(s=o.jsxs("div",{className:"flex flex-col gap-y-2",children:[i,r]}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s};function ga(){window.dispatchEvent(new Event("resize"))}function ma(t){return o.jsx("option",{value:t,children:t},t)}function va(t){const{field:e}=t;return o.jsxs(_,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"Width"}),o.jsx(P,{children:o.jsx(ge,{"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(ma)})}),o.jsx(M,{})]})}function ya(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"App title"}),o.jsx(P,{children:o.jsx(oe,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Rn.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),o.jsx(M,{})]}),o.jsx(H,{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 xa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{className:"flex-shrink-0",children:"Custom CSS"}),o.jsx(P,{children:o.jsx(oe,{...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)}})}),o.jsx(M,{})]}),o.jsx(H,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function ba(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{className:"flex-shrink-0",children:"HTML Head"}),o.jsx(P,{children:o.jsx(oe,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),o.jsx(M,{})]}),o.jsxs(H,{children:["A filepath to an HTML file to be injected into the"," ",o.jsx(pe,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function ja(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(D,{children:"SQL Output Type"}),o.jsx(P,{children:o.jsxs(ge,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),Ce({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:[o.jsx("option",{value:"auto",children:"Auto (Default)"}),o.jsx("option",{value:"native",children:"Native"}),o.jsx("option",{value:"polars",children:"Polars"}),o.jsx("option",{value:"lazy-polars",children:"Lazy Polars"}),o.jsx("option",{value:"pandas",children:"Pandas"})]})}),o.jsx(M,{})]}),o.jsxs(H,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",o.jsx(pe,{className:"inline",children:"native"}),". See the"," ",o.jsx(le,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}function wa(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(_,{className:"flex flex-col gap-2",children:[o.jsx(P,{children:o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(ce,{id:"html-checkbox",checked:e.value.includes("html"),onCheckedChange:()=>{e.onChange(Ln(e.value,"html"))}}),o.jsx(D,{htmlFor:"html-checkbox",children:"HTML"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(ce,{id:"ipynb-checkbox",checked:e.value.includes("ipynb"),onCheckedChange:()=>{e.onChange(Ln(e.value,"ipynb"))}}),o.jsx(D,{htmlFor:"ipynb-checkbox",children:"IPYNB"})]})]})}),o.jsx(M,{})]}),o.jsxs(H,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",o.jsx(pe,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}const Ia=t=>{const e=K.c(20),{showAppConfig:n}=t,r=n===void 0||n,[i,s]=Ve(Et);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(st,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:o.jsx(jt,{content:"Settings",children:o.jsx(Fn,{strokeWidth:1.8})})}),e[0]=a):a=e[0];const l=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Nn,{className:"w-[80vw] h-[70vh] overflow-hidden sm:max-w-5xl top-[15vh] p-0",children:o.jsx(Js,{})}),e[1]=c):c=e[1];const d=c;if(!r){let j,b;return e[2]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(ns,{children:l}),e[2]=j):j=e[2],e[3]!==s||e[4]!==i?(b=o.jsxs(kt,{open:i,onOpenChange:s,children:[j,d]}),e[3]=s,e[4]=i,e[5]=b):b=e[5],b}let u,g,v,p,h,f,m,x;return e[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(rs,{asChild:!0,children:l}),e[6]=u):u=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(pa,{}),v=o.jsx("div",{className:"h-px bg-border my-2"}),e[7]=g,e[8]=v):(g=e[7],v=e[8]),e[9]!==s?(p=()=>s(!0),e[9]=s,e[10]=p):p=e[10],e[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(Fn,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[11]=h):h=e[11],e[12]!==p?(f=o.jsxs(is,{children:[u,o.jsxs(os,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Sa,children:[g,v,o.jsxs(ie,{onClick:p,variant:"link",className:"px-0",children:[h,"User settings"]})]})]}),e[12]=p,e[13]=f):f=e[13],e[14]!==s||e[15]!==i?(m=o.jsx(kt,{open:i,onOpenChange:s,children:d}),e[14]=s,e[15]=i,e[16]=m):m=e[16],e[17]!==m||e[18]!==f?(x=o.jsxs(o.Fragment,{children:[f,m]}),e[17]=m,e[18]=f,e[19]=x):x=e[19],x};function Sa(t){return t.preventDefault()}const Oa=t=>{const e=K.c(3);let n,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"}),e[0]=n):n=e[0],e[1]!==t?(r=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 448 512",...t,children:n}),e[1]=t,e[2]=r):r=e[2],r},Ca=t=>{const e=K.c(3);let n,r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"}),e[0]=n):n=e[0],e[1]!==t?(r=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",fill:"currentColor",...t,children:n}),e[1]=t,e[2]=r):r=e[2],r},ar=w.createContext(null);function ae(){const t=w.useContext(ar);if(t===null)throw new Error("No Tree Api Provided");return t}const lr=w.createContext(null),cr=w.createContext(null),ur=w.createContext(0);function dr(){w.useContext(ur)}function ut(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 _t(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=_t(n,e);if(r)return r}return null}function dt(t,e){if(e(t),t.children)for(let n of t.children)dt(n,e)}function vr(t){const e=xr(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=ka(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=Na(e,r);break}n==null||n.focus()}function ka(t,e){return e+1<t.length?t[e+1]:t[0]}function Na(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 We(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function br(t){return t===null?null:ke(t)}function ke(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 Da=Object.freeze(Object.defineProperty({__proto__:null,access:We,bound:ut,dfs:_t,focusNextElement:vr,focusPrevElement:yr,getInsertIndex:Ir,getInsertParentId:Sr,identify:ke,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:dt},Symbol.toStringTag,{value:"Module"})),Ea={display:"flex",alignItems:"center",zIndex:1},Ta={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},_a={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Pa=ze.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 o.jsxs("div",{style:Object.assign(Object.assign({},Ea),r),children:[o.jsx("div",{style:Object.assign({},_a)}),o.jsx("div",{style:Object.assign({},Ta)})]})});function Aa({node:t,attrs:e,innerRef:n,children:r}){return o.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function Ma(t){return o.jsxs("div",{ref:t.dragHandle,style:t.style,children:[o.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?o.jsx(La,Object.assign({},t)):o.jsx(Ra,Object.assign({},t))]})}function Ra(t){return o.jsx(o.Fragment,{children:o.jsx("span",{children:t.node.data.name})})}function La({node:t}){const e=w.useRef();return w.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),o.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 Pt(t){return{type:"EDIT",id:t}}function Me(t){return{type:"FOCUS",id:t}}class bt{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===Ke}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 bt(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Ke="__REACT_ARBORIST_INTERNAL_ROOT__";function Or(t){var e;function n(s,a,l){const c=t.accessId(s),d=new bt({tree:t,data:s,level:a,parent:l,id:c,children:null,isDraggable:t.isDraggable(s),rowIndex:null}),u=t.accessChildren(s);return u&&(d.children=u.map(g=>n(g,a+1,d))),d}const r=new bt({tree:t,id:Ke,data:{id:Ke},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(s=>n(s,0,r)),r}const At={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 Cr(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 Re=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}}},Fa=t=>({type:"SELECTION_ONLY",id:ke(t)}),kr=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(ke)}),Nr=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(ke)}),Ha=t=>Object.assign({type:"SELECTION_SET"},t),Mt=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:ke(t)}),Dr=t=>({type:"SELECTION_ANCHOR",id:t===null?null:ke(t)}),Le={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})},za={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Ua=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},qa=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Er({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return o.jsxs(Va,{isDragging:i,children:[o.jsx(Ba,{offset:t,children:o.jsx(Ka,{id:n,dragIds:r})}),o.jsx(Wa,{mouse:e,count:r.length})]})}const Va=w.memo(function(t){return t.isDragging?o.jsx("div",{style:za,children:t.children}):null});function Ba(t){return o.jsx("div",{className:"row preview",style:Ua(t.offset),children:t.children})}function Wa(t){const{count:e,mouse:n}=t;return e>1?o.jsx("div",{className:"selected-count",style:qa(n),children:e}):null}const Ka=w.memo(function(t){const e=ae(),n=e.get(t.id);return n?o.jsx(e.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*e.indent,opacity:.2,background:"transparent"},tree:e}):null});var Tr=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function Ga(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(r=t[n],i=e[n],!(r===i||Tr(r)&&Tr(i)))return!1;var r,i;return!0}function Rt(t,e){var n;e===void 0&&(e=Ga);var r,i=[],s=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return s&&n===this&&e(a,i)||(r=t.apply(this,a),s=!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 Lt=-1;function Ar(t){if(t===void 0&&(t=!1),Lt===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Lt=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Lt}var Ge=null;function Mr(t){if(t===void 0&&(t=!1),Ge===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?Ge="positive-descending":(e.scrollLeft=1,Ge=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),Ge}return Ge}var $a=function(t,e){return t};function Ya(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,s=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,l=t.getStopIndexForStartIndex,c=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,u=t.validateProps;return e=function(g){function v(h){var f;return(f=g.call(this,h)||this)._instanceProps=c(f.props,qn(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:qn(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=Rt(function(m,x,j,b){return f.props.onItemsRendered({overscanStartIndex:m,overscanStopIndex:x,visibleStartIndex:j,visibleStopIndex:b})}),f._callOnScroll=void 0,f._callOnScroll=Rt(function(m,x,j){return f.props.onScroll({scrollDirection:m,scrollOffset:x,scrollUpdateWasRequested:j})}),f._getItemStyle=void 0,f._getItemStyle=function(m){var x,j=f.props,b=j.direction,C=j.itemSize,O=j.layout,k=f._getItemStyleCache(d&&C,d&&O,d&&b);if(k.hasOwnProperty(m))x=k[m];else{var E=n(f.props,m,f._instanceProps),z=i(f.props,m,f._instanceProps),U=b==="horizontal"||O==="horizontal",V=b==="rtl",W=U?E:0;k[m]=x={position:"absolute",left:V?void 0:W,right:V?W:void 0,top:U?0:E,height:U?"100%":z,width:U?z:"100%"}}return x},f._getItemStyleCache=void 0,f._getItemStyleCache=Rt(function(m,x,j){return{}}),f._onScrollHorizontal=function(m){var x=m.currentTarget,j=x.clientWidth,b=x.scrollLeft,C=x.scrollWidth;f.setState(function(O){if(O.scrollOffset===b)return null;var k=f.props.direction,E=b;if(k==="rtl")switch(Mr()){case"negative":E=-b;break;case"positive-descending":E=C-j-b}return E=Math.max(0,Math.min(E,C-j)),{isScrolling:!0,scrollDirection:O.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(m){var x=m.currentTarget,j=x.clientHeight,b=x.scrollHeight,C=x.scrollTop;f.setState(function(O){if(O.scrollOffset===C)return null;var k=Math.max(0,Math.min(C,b-j));return{isScrolling:!0,scrollDirection:O.scrollOffset<k?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(m){var x=f.props.outerRef;f._outerRef=m,typeof x=="function"?x(m):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=m)},f._resetIsScrollingDebounced=function(){var m,x,j,b;f._resetIsScrollingTimeoutId!==null&&Pr(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=(m=f._resetIsScrolling,x=150,j=_r(),b={id:requestAnimationFrame(function C(){_r()-j>=x?m.call(null):b.id=requestAnimationFrame(C)})})},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,Dt(h,f)})(v,g),v.getDerivedStateFromProps=function(h,f){return Xa(h,f),u(h),null};var p=v.prototype;return p.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)},p.scrollToItem=function(h,f){f===void 0&&(f="auto");var m=this.props,x=m.itemCount,j=m.layout,b=this.state.scrollOffset;h=Math.max(0,Math.min(h,x-1));var C=0;if(this._outerRef){var O=this._outerRef;C=j==="vertical"?O.scrollWidth>O.clientWidth?Ar():0:O.scrollHeight>O.clientHeight?Ar():0}this.scrollTo(s(this.props,h,f,b,this._instanceProps,C))},p.componentDidMount=function(){var h=this.props,f=h.direction,m=h.initialScrollOffset,x=h.layout;if(typeof m=="number"&&this._outerRef!=null){var j=this._outerRef;f==="horizontal"||x==="horizontal"?j.scrollLeft=m:j.scrollTop=m}this._callPropsCallbacks()},p.componentDidUpdate=function(){var h=this.props,f=h.direction,m=h.layout,x=this.state,j=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var b=this._outerRef;if(f==="horizontal"||m==="horizontal")if(f==="rtl")switch(Mr()){case"negative":b.scrollLeft=-j;break;case"positive-ascending":b.scrollLeft=j;break;default:var C=b.clientWidth,O=b.scrollWidth;b.scrollLeft=O-C-j}else b.scrollLeft=j;else b.scrollTop=j}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Pr(this._resetIsScrollingTimeoutId)},p.render=function(){var h=this.props,f=h.children,m=h.className,x=h.direction,j=h.height,b=h.innerRef,C=h.innerElementType,O=h.innerTagName,k=h.itemCount,E=h.itemData,z=h.itemKey,U=z===void 0?$a:z,V=h.layout,W=h.outerElementType,Z=h.outerTagName,J=h.style,ee=h.useIsScrolling,te=h.width,S=this.state.isScrolling,y=x==="horizontal"||V==="horizontal",I=y?this._onScrollHorizontal:this._onScrollVertical,q=this._getRangeToRender(),Se=q[0],Oe=q[1],be=[];if(k>0)for(var ve=Se;ve<=Oe;ve++)be.push(w.createElement(f,{data:E,key:U(ve,E),index:ve,isScrolling:ee?S:void 0,style:this._getItemStyle(ve)}));var je=r(this.props,this._instanceProps);return w.createElement(W||Z||"div",{className:m,onScroll:I,ref:this._outerRefSetter,style:ss({position:"relative",height:j,width:te,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},J)},w.createElement(C||O||"div",{children:be,ref:b,style:{height:y?"100%":je,pointerEvents:S?"none":void 0,width:y?je:"100%"}}))},p._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var h=this._getRangeToRender(),f=h[0],m=h[1],x=h[2],j=h[3];this._callOnItemsRendered(f,m,x,j)}if(typeof this.props.onScroll=="function"){var b=this.state,C=b.scrollDirection,O=b.scrollOffset,k=b.scrollUpdateWasRequested;this._callOnScroll(C,O,k)}},p._getRangeToRender=function(){var h=this.props,f=h.itemCount,m=h.overscanCount,x=this.state,j=x.isScrolling,b=x.scrollDirection,C=x.scrollOffset;if(f===0)return[0,0,0,0];var O=a(this.props,C,this._instanceProps),k=l(this.props,O,C,this._instanceProps),E=j&&b!=="backward"?1:Math.max(1,m),z=j&&b!=="forward"?1:Math.max(1,m);return[Math.max(0,O-E),Math.max(0,Math.min(f-1,k+z)),O,k]},v}(w.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Xa=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},Qa=Ya({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,s){var a=t.direction,l=t.height,c=t.itemCount,d=t.itemSize,u=t.layout,g=t.width,v=a==="horizontal"||u==="horizontal"?g:l,p=Math.max(0,c*d-v),h=Math.min(p,e*d),f=Math.max(0,e*d-v+d+s);switch(n==="smart"&&(n=r>=f-v&&r<=h+v?"auto":"center"),n){case"start":return h;case"end":return f;case"center":var m=Math.round(f+(h-f)/2);return m<Math.ceil(v/2)?0:m>p+Math.floor(v/2)?p:m;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,s=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(s-1,e+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function Za(){var t,e;const n=ae(),r=function(){const c=w.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,s=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 o.jsx(l,{top:s,left:a,indent:i})}var Ja=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 el=w.forwardRef(function(t,e){const{children:n}=t,r=Ja(t,["children"]),i=ae();return o.jsxs("div",Object.assign({ref:e},r,{onClick:s=>{s.currentTarget===s.target&&i.deselectAll()},children:[o.jsx(tl,{}),n]}))}),tl=()=>{const t=ae();return o.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:o.jsx(Za,{})})};var nl=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 rl=w.forwardRef(function(t,e){var n,r,i,s,{style:a}=t,l=nl(t,["style"]);const c=ae(),d=(r=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&r!==void 0?r:0,u=(s=(i=c.props.padding)!==null&&i!==void 0?i:c.props.paddingBottom)!==null&&s!==void 0?s:0;return o.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+u}px`})},l))});var ue,Rr=w.createContext({dragDropManager:void 0});function N(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 s;if(e===void 0)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(s=new Error(e.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ue||(ue={}));var Ft="dnd-core/INIT_COORDS",Ht="dnd-core/BEGIN_DRAG",Lr="dnd-core/PUBLISH_DRAG_SOURCE",ht="dnd-core/HOVER",zt="dnd-core/DROP",Ut="dnd-core/END_DRAG";function Fr(t,e){return{type:Ft,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function qt(t){return qt=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},qt(t)}function Hr(t){return qt(t)==="object"}var il={type:Ft,payload:{clientOffset:null,sourceClientOffset:null}};function ol(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,s=n.clientOffset,a=n.getSourceClientOffset,l=t.getMonitor(),c=t.getRegistry();t.dispatch(Fr(s)),function(p,h,f){N(!h.isDragging(),"Cannot call beginDrag while dragging."),p.forEach(function(m){N(f.getSource(m),"Expected sourceIds to be registered.")})}(e,l,c);var d=function(p,h){for(var f=null,m=p.length-1;m>=0;m--)if(h.canDragSource(p[m])){f=p[m];break}return f}(e,l);if(d!==null){var u=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");(function(p){N(typeof p=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(a),u=a(d)}t.dispatch(Fr(s,u));var g=c.getSource(d).beginDrag(l,d);if(g!=null){(function(p){N(Hr(p),"Item must be an object.")})(g),c.pinSource(d);var v=c.getSourceType(d);return{type:Ht,payload:{itemType:v,item:g,sourceId:d,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else t.dispatch(il)}}function sl(t){return function(){if(t.getMonitor().isDragging())return{type:Lr}}}function Vt(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function al(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(a){N(Array.isArray(a),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),s=t.getRegistry();return function(a,l,c){N(l.isDragging(),"Cannot call hover while not dragging."),N(!l.didDrop(),"Cannot call hover after drop.");for(var d=0;d<a.length;d++){var u=a[d];N(a.lastIndexOf(u)===d,"Expected targetIds to be unique in the passed array."),N(c.getTarget(u),"Expected targetIds to be registered.")}}(r,i,s),function(a,l,c){for(var d=a.length-1;d>=0;d--){var u=a[d];Vt(l.getTargetType(u),c)||a.splice(d,1)}}(r,s,i.getItemType()),function(a,l,c){a.forEach(function(d){c.getTarget(d).hover(l,d)})}(r,i,s),{type:ht,payload:{targetIds:r,clientOffset:n||null}}}}function zr(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?zr(Object(n),!0).forEach(function(r){ll(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ll(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cl(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(s){N(s.isDragging(),"Cannot call drop while not dragging."),N(!s.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(s){var a=s.getTargetIds().filter(s.canDropOnTarget,s);return a.reverse(),a}(n);i.forEach(function(s,a){var l=function(d,u,g,v){var p=g.getTarget(d),h=p?p.drop(v,d):void 0;return function(f){N(f===void 0||Hr(f),"Drop result must either be an object or undefined.")}(h),h===void 0&&(h=u===0?{}:v.getDropResult()),h}(s,a,r,n),c={type:zt,payload:{dropResult:Ur(Ur({},e),l)}};t.dispatch(c)})}}function ul(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){N(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:Ut}}}function dl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 $e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hl=function(){function t(e,n){var r=this;(function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),$e(this,"store",void 0),$e(this,"monitor",void 0),$e(this,"backend",void 0),$e(this,"isSetUp",!1),$e(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 dl(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:ol(i),publishDragSource:sl(i),hover:al(i),drop:cl(i),endDrag:ul(i)}}(this);return Object.keys(r).reduce(function(i,s){var a,l=r[s];return i[s]=(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 de(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",Vr=function(){return Math.random().toString(36).substring(7).split("").join(".")},Br={INIT:"@@redux/INIT"+Vr(),REPLACE:"@@redux/REPLACE"+Vr()};function Wr(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(de(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(de(1));return n(Wr)(t,e)}if(typeof t!="function")throw new Error(de(2));var i=t,s=e,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function u(){if(c)throw new Error(de(3));return s}function g(p){if(typeof p!="function")throw new Error(de(4));if(c)throw new Error(de(5));var h=!0;return d(),l.push(p),function(){if(h){if(c)throw new Error(de(6));h=!1,d();var f=l.indexOf(p);l.splice(f,1),a=null}}}function v(p){if(!function(m){if(typeof m!="object"||m===null)return!1;for(var x=m;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(m)===x}(p))throw new Error(de(7));if(p.type===void 0)throw new Error(de(8));if(c)throw new Error(de(9));try{c=!0,s=i(s,p)}finally{c=!1}for(var h=a=l,f=0;f<h.length;f++)(0,h[f])();return p}return v({type:Br.INIT}),(r={dispatch:v,subscribe:g,getState:u,replaceReducer:function(p){if(typeof p!="function")throw new Error(de(10));i=p,v({type:Br.REPLACE})}})[qr]=function(){var p,h=g;return(p={subscribe:function(f){if(typeof f!="object"||f===null)throw new Error(de(11));function m(){f.next&&f.next(u())}return m(),{unsubscribe:h(m)}}})[qr]=function(){return this},p},r}var fl=function(t,e){return t===e};function Kr(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 Gr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(n),!0).forEach(function(r){pl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pl(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 gl(){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 Ft:case Ht:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case ht:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:Gr(Gr({},n),{},{clientOffset:i.clientOffset});case Ut:case zt:return $r;default:return n}}var Bt="dnd-core/ADD_SOURCE",Wt="dnd-core/ADD_TARGET",Kt="dnd-core/REMOVE_SOURCE",ft="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 he(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){ml(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 ml(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={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function yl(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vl,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Ht:return he(he({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case Lr:return he(he({},n),{},{isSourcePublic:!0});case ht:return he(he({},n),{},{targetIds:i.targetIds});case ft:return n.targetIds.indexOf(i.targetId)===-1?n:he(he({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(s){return s!==e}))});case zt:return he(he({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Ut:return he(he({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function xl(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Bt:case Wt:return t+1;case Kt:case ft:return t-1;default:return t}}var pt=[],Gt=[];function bl(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ht:break;case Bt:case Wt:case ft:case Kt:return pt;default:return Gt}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,s=i===void 0?[]:i,a=function(u,g){var v=new Map,p=function(f){v.set(f,v.has(f)?v.get(f)+1:1)};u.forEach(p),g.forEach(p);var h=[];return v.forEach(function(f,m){f===1&&h.push(m)}),h}(r,s),l=a.length>0||!function(u,g){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fl;if(u.length!==g.length)return!1;for(var p=0;p<u.length;++p)if(!v(u[p],g[p]))return!1;return!0}(r,s);if(!l)return pt;var c=s[s.length-1],d=r[r.length-1];return c!==d&&(c&&a.push(c),d&&a.push(d)),a}function jl(){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){wl(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 wl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Il(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:bl(r.dirtyHandlerIds,{type:i.type,payload:Qr(Qr({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(s,a){return s&&s[a]?s[a]:n||null},t))})}),dragOffset:gl(r.dragOffset,i),refCount:xl(r.refCount,i),dragOperation:yl(r.dragOperation,i),stateId:jl(r.stateId)}}function Zr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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}pt.__IS_NONE__=!0,Gt.__IS_ALL__=!0;var Ol=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 Sl(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;N(typeof e=="function","listener must be a function."),N(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 s=n.store.getState(),a=s.stateId;try{var l=a===i||a===i+1&&!function(c,d){if(c===pt)return!1;if(c===Gt||d===void 0)return!0;var u,g=(u=c,d.filter(function(v){return u.indexOf(v)>-1}));return g.length>0}(s.dirtyHandlerIds,r);l||e()}finally{i=a}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;N(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 N(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 N(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&Vt(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 N(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&&!Vt(r,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var a=s.indexOf(e);return n?a===s.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,s=e.initialClientOffset,a=e.initialSourceClientOffset,i&&s&&a?Zr((r=a,{x:(n=i).x+r.x,y:n.y+r.y}),s):null;var e,n,r,i,s,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}(),Cl=0;function $t(t){return $t=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},$t(t)}function Yt(t,e){e&&Array.isArray(t)?t.forEach(function(n){return Yt(n,!1)}):N(typeof t=="string"||$t(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 kl=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 Nl{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=kl(this.flush),this.requestErrorThrow=ni(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Dl=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Nl(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(ri.registerPendingError);function El(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 Fe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tl(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
8
+ 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 _l(t){var e=(Cl++).toString();switch(t){case ue.SOURCE:return"S".concat(e);case ue.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function oi(t){switch(t[0]){case"S":return ue.SOURCE;case"T":return ue.TARGET;default:N(!1,"Cannot parse handler ID: ".concat(t))}}function si(t,e){var n=t.entries(),r=!1;do{var i=n.next(),s=i.done;if(Tl(i.value,2)[1]===e)return!0;r=!!s}while(!r);return!1}var Pl=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Fe(this,"types",new Map),Fe(this,"dragSources",new Map),Fe(this,"dropTargets",new Map),Fe(this,"pinnedSourceId",null),Fe(this,"pinnedSource",null),Fe(this,"store",void 0),this.store=e}return El(t,[{key:"addSource",value:function(e,n){Yt(e),function(i){N(typeof i.canDrag=="function","Expected canDrag to be a function."),N(typeof i.beginDrag=="function","Expected beginDrag to be a function."),N(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(ue.SOURCE,e,n);return this.store.dispatch(function(i){return{type:Bt,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){Yt(e,!0),function(i){N(typeof i.canDrop=="function","Expected canDrop to be a function."),N(typeof i.hover=="function","Expected hover to be a function."),N(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(ue.TARGET,e,n);return this.store.dispatch(function(i){return{type:Wt,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return si(this.dragSources,e)||si(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return N(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return N(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return N(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return N(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return oi(e)===ue.SOURCE}},{key:"isTargetId",value:function(e){return oi(e)===ue.TARGET}},{key:"removeSource",value:function(e){var n,r=this;N(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:Kt,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},ri.enqueueTask(Dl.create(n))}},{key:"removeTarget",value:function(e){N(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:ft,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);N(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){N(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=_l(e);return this.types.set(i,n),e===ue.SOURCE?this.dragSources.set(i,r):e===ue.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function Al(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(Il,l&&c&&c({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new Ol(r,new Pl(r)),s=new hl(r,i),a=t(s,e,n);return s.receiveBackend(a),s}var Ml=["children"];function Rl(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
9
+ 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 Ll(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 s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var li=0,gt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),Fl=w.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,v=arguments.length>3?arguments[3]:void 0,p=u;return p[gt]||(p[gt]={dragDropManager:Al(d,u,g,v)}),p[gt]}(a.backend,a.context,a.options,a.debugMode),c=!a.context;return[l,c]}(Ll(t,Ml)),r=Rl(n,2),i=r[0],s=r[1];return w.useEffect(function(){if(s){var a=ci();return++li,function(){--li==0&&(a[gt]=null)}}},[]),o.jsx(Rr.Provider,Object.assign({value:i},{children:e}),void 0)});function ci(){return typeof global<"u"?global:window}function Hl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 Xt=!1,Qt=!1,zl=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,"sourceId",null),this.internalMonitor=e.getMonitor()}return Hl(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){N(!Xt,"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 Xt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Xt=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;N(!Qt,"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 Qt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qt=!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 Ul(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 Zt=!1,ql=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,"targetId",null),this.internalMonitor=e.getMonitor()}return Ul(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;N(!Zt,"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 Zt=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Zt=!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 Vl(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(!w.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 s=n?function(a){return t(a,n)}:t;return function(a,l){var c=a.ref;return N(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?w.cloneElement(a,{ref:function(d){fi(c,d),fi(l,d)}}):w.cloneElement(a,{ref:l})}(i,s)}}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=Vl(r);e[n]=function(){return i}}}),e}function fi(t,e){typeof t=="function"?t(e):t.current=e}function Jt(t){return Jt=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},Jt(t)}function en(t){return t!==null&&Jt(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function tn(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 s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(e),c=0;c<s.length;c++){var d=s[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 Bl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 X(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Wl=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),X(this,"hooks",hi({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,en(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,en(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),X(this,"handlerId",null),X(this,"dragSourceRef",null),X(this,"dragSourceNode",void 0),X(this,"dragSourceOptionsInternal",null),X(this,"dragSourceUnsubscribe",void 0),X(this,"dragPreviewRef",null),X(this,"dragPreviewNode",void 0),X(this,"dragPreviewOptionsInternal",null),X(this,"dragPreviewUnsubscribe",void 0),X(this,"lastConnectedHandlerId",null),X(this,"lastConnectedDragSource",null),X(this,"lastConnectedDragSourceOptions",null),X(this,"lastConnectedDragPreview",null),X(this,"lastConnectedDragPreviewOptions",null),X(this,"backend",void 0),this.backend=e}return Bl(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!tn(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!tn(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 Kl(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Gl=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),xe(this,"hooks",hi({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,en(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),xe(this,"handlerId",null),xe(this,"dropTargetRef",null),xe(this,"dropTargetNode",void 0),xe(this,"dropTargetOptionsInternal",null),xe(this,"unsubscribeDropTarget",void 0),xe(this,"lastConnectedHandlerId",null),xe(this,"lastConnectedDropTarget",null),xe(this,"lastConnectedDropTargetOptions",null),xe(this,"backend",void 0),this.backend=e}return Kl(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!tn(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}(),Ne=typeof window<"u"?w.useLayoutEffect:w.useEffect;function nn(t){return nn=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},nn(t)}function $l(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 rn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Yl=function(){function t(e,n,r){(function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")})(this,t),rn(this,"spec",void 0),rn(this,"monitor",void 0),rn(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return $l(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=nn(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,s=r.isDragging;return s?s(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 De(){var t=w.useContext(Rr).dragDropManager;return N(t!=null,"Expected drag drop context"),t}function Xl(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
10
+ 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 Ql(t,e,n){var r=De(),i=function(a,l,c){var d=w.useMemo(function(){return new Yl(a,l,c)},[l,c]);return w.useEffect(function(){d.spec=a},[a]),d}(t,e,n),s=function(a){return w.useMemo(function(){var l=a.type;return N(l!=null,"spec.type must be defined"),l},[a])}(t);Ne(function(){if(s!=null){var a=function(u,g,v){var p=v.getRegistry(),h=p.addSource(u,g);return[h,function(){return p.removeSource(h)}]}(s,i,r),l=Xl(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d}},[r,e,n,i,s])}function Zl(t){return function(e){if(Array.isArray(e))return on(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 on(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 on(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function on(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=Zl(e||[]);return e==null&&typeof t!="function"&&n.push(t),w.useMemo(function(){return typeof t=="function"?t():t},n)}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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
12
+ 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=Jl(w.useState(function(){return e(t)}),2),i=r[0],s=r[1],a=w.useCallback(function(){var l=e(t);ls(i,l)||(s(l),n&&n())},[i,t,n]);return Ne(a),[i,a]}function ec(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
13
+ 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,s){var a=ec(vi(r,i,s),2),l=a[0],c=a[1];return Ne(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 tc(t){return w.useMemo(function(){return t.hooks.dragSource()},[t])}function nc(t){return w.useMemo(function(){return t.hooks.dragPreview()},[t])}function rc(t,e){var n=gi(t,e);N(!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=De(),w.useMemo(function(){return new zl(r)},[r])),s=function(a,l){var c=De(),d=w.useMemo(function(){return new Wl(c.getBackend())},[c]);return Ne(function(){return d.dragSourceOptions=a||null,d.reconnect(),function(){return d.disconnectDragSource()}},[d,a]),Ne(function(){return d.dragPreviewOptions=l||null,d.reconnect(),function(){return d.disconnectDragPreview()}},[d,l]),d}(n.options,n.previewOptions);return Ql(n,i,s),[xi(n.collect,i,s),tc(s),nc(s)]}function ic(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 oc=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 ic(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 sc(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
14
+ 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 ac(t,e,n){var r=De(),i=function(a,l){var c=w.useMemo(function(){return new oc(a,l)},[l]);return w.useEffect(function(){c.spec=a},[a]),c}(t,e),s=function(a){var l=a.accept;return w.useMemo(function(){return N(a.accept!=null,"accept must be defined"),Array.isArray(l)?l:[l]},[l])}(t);Ne(function(){var a=function(u,g,v){var p=v.getRegistry(),h=p.addTarget(u,g);return[h,function(){return p.removeTarget(h)}]}(s,i,r),l=sc(a,2),c=l[0],d=l[1];return e.receiveHandlerId(c),n.receiveHandlerId(c),d},[r,e,i,n,s.map(function(a){return a.toString()}).join("|")])}function lc(t){return w.useMemo(function(){return t.hooks.dropTarget()},[t])}function wi(t,e){var n,r=gi(t,e),i=(n=De(),w.useMemo(function(){return new ql(n)},[n])),s=function(a){var l=De(),c=w.useMemo(function(){return new Gl(l.getBackend())},[l]);return Ne(function(){return c.dropTargetOptions=a||null,c.reconnect(),function(){return c.disconnectDropTarget()}},[a]),c}(r.options);return ac(r,i,s),[xi(r.collect,i,s),lc(s)]}function cc(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 s,a,l=[],c=!0,d=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(l.push(s.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.
15
+ 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 uc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 dc=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 uc(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,s){var a=new Set,l=function(d){return a.add(d)};i.forEach(l),s.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(s){return s!==r})),i>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),hc=Si(function(){return/firefox/i.test(navigator.userAgent)}),Ci=Si(function(){return!!window.safari});function fc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 Ye(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ki=function(){function t(e,n){(function(z,U){if(!(z instanceof U))throw new TypeError("Cannot call a class as a function")})(this,t),Ye(this,"xs",void 0),Ye(this,"ys",void 0),Ye(this,"c1s",void 0),Ye(this,"c2s",void 0),Ye(this,"c3s",void 0);for(var r=e.length,i=[],s=0;s<r;s++)i.push(s);i.sort(function(z,U){return e[z]<e[U]?-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]],v=0;v<c.length-1;v++){var p=d[v],h=d[v+1];if(p*h<=0)g.push(0);else{a=c[v];var f=c[v+1],m=a+f;g.push(3*m/((m+f)/p+(m+a)/h))}}g.push(d[d.length-1]);for(var x,j=[],b=[],C=0;C<g.length-1;C++){x=d[C];var O=g[C],k=1/c[C],E=O+g[C+1]-x-x;j.push((x-O-E)*k),b.push(E*k*k)}this.xs=e,this.ys=n,this.c1s=g,this.c2s=j,this.c3s=b}return fc(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,s=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 v=e-n[l=Math.max(0,u)],p=v*v;return r[l]+i[l]*v+s[l]*p+a[l]*v*p}}]),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 mt(t){return{x:t.clientX,y:t.clientY}}function pc(t,e,n,r,i){var s,a,l,c=(s=e).nodeName==="IMG"&&(hc()||!((a=document.documentElement)!==null&&a!==void 0&&a.contains(s))),d=Ni(c?t:e),u={x:n.x-d.x,y:n.y-d.y},g=t.offsetWidth,v=t.offsetHeight,p=r.anchorX,h=r.anchorY,f=function(O,k,E,z){var U=O?k.width:E,V=O?k.height:z;return Ci()&&O&&(V/=window.devicePixelRatio,U/=window.devicePixelRatio),{dragPreviewWidth:U,dragPreviewHeight:V}}(c,e,g,v),m=f.dragPreviewWidth,x=f.dragPreviewHeight,j=i.offsetX,b=i.offsetY,C=b===0||b;return{x:j===0||j?j:new ki([0,.5,1],[u.x,u.x/g*m,u.x+m-g]).interpolate(p),y:C?b:(l=new ki([0,.5,1],[u.y,u.y/v*x,u.y+x-v]).interpolate(h),Ci()&&c&&(l+=(window.devicePixelRatio-1)*x),l)}}var Di="__NATIVE_FILE__",Ei="__NATIVE_URL__",Ti="__NATIVE_TEXT__",_i="__NATIVE_HTML__";const Pi=Object.freeze(Object.defineProperty({__proto__:null,FILE:Di,HTML:_i,TEXT:Ti,URL:Ei},Symbol.toStringTag,{value:"Module"}));function sn(t,e,n){var r=e.reduce(function(i,s){return i||t.getData(s)},"");return r??n}var Xe;function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var an=(vt(Xe={},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"]}),vt(Xe,_i,{exposeProperties:{html:function(t,e){return sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),vt(Xe,Ei,{exposeProperties:{urls:function(t,e){return sn(t,e,"").split(`
16
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),vt(Xe,Ti,{exposeProperties:{text:function(t,e){return sn(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Xe);function gc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 mc=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 gc(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 ln(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(an).filter(function(n){return an[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function vc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 cn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yc=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),cn(this,"ownerDocument",null),cn(this,"globalContext",void 0),cn(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return vc(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){A(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 xc(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var a=i[s];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 A(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,bc=function(){function t(e,n,r){var i=this;(function(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")})(this,t),A(this,"options",void 0),A(this,"actions",void 0),A(this,"monitor",void 0),A(this,"registry",void 0),A(this,"enterLeaveCounter",void 0),A(this,"sourcePreviewNodes",new Map),A(this,"sourcePreviewNodeOptions",new Map),A(this,"sourceNodes",new Map),A(this,"sourceNodeOptions",new Map),A(this,"dragStartSourceIds",null),A(this,"dropTargetIds",[]),A(this,"dragEnterTargetIds",[]),A(this,"currentNativeSource",null),A(this,"currentNativeHandle",null),A(this,"currentDragSourceNode",null),A(this,"altKeyPressed",!1),A(this,"mouseMoveTimeoutTimer",null),A(this,"asyncEndDragFrameId",null),A(this,"dragOverTargetIds",null),A(this,"lastClientOffset",null),A(this,"hoverRafId",null),A(this,"getSourceClientOffset",function(s){var a=i.sourceNodes.get(s);return a&&Ni(a)||null}),A(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),A(this,"isNodeInDocument",function(s){return!!(s&&i.document&&i.document.body&&i.document.body.contains(s))}),A(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=i.currentDragSourceNode;s==null||i.isNodeInDocument(s)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),A(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var l=mt(s);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:l});var c=s.dataTransfer,d=ln(c);if(i.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var u=i.monitor.getSourceId(),g=i.sourceNodes.get(u),v=i.sourcePreviewNodes.get(u)||g;if(v){var p=i.getCurrentSourcePreviewNodeOptions(),h=pc(g,v,l,{anchorX:p.anchorX,anchorY:p.anchorY},{offsetX:p.offsetX,offsetY:p.offsetY});c.setDragImage(v,h.x,h.y)}}try{c==null||c.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(s.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&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),A(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleTopDragEnterCapture",function(s){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(s.target)&&!i.monitor.isDragging()){var a=s.dataTransfer,l=ln(a);l&&i.beginDragNativeItem(l,a)}}),A(this,"handleTopDragEnter",function(s){var a=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=s.altKey,a.length>0&&i.actions.hover(a,{clientOffset:mt(s)}),a.some(function(l){return i.monitor.canDropOnTarget(l)})&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),A(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),A(this,"handleTopDragOver",function(s){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return s.preventDefault(),void(s.dataTransfer&&(s.dataTransfer.dropEffect="none"));i.altKeyPressed=s.altKey,i.lastClientOffset=mt(s),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)})?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),A(this,"handleTopDragLeaveCapture",function(s){i.isDraggingNativeItem()&&s.preventDefault(),i.enterLeaveCounter.leave(s.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),A(this,"handleTopDropCapture",function(s){var a;i.dropTargetIds=[],i.isDraggingNativeItem()?(s.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(s.dataTransfer)):ln(s.dataTransfer)&&s.preventDefault(),i.enterLeaveCounter.reset()}),A(this,"handleTopDrop",function(s){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:mt(s)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),A(this,"handleSelectStart",function(s){var a=s.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(s.preventDefault(),a.dragDrop()))}),this.options=new yc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new dc(this.isNodeInDocument)}return xc(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 s=function(l){return i.handleDragStart(l,e)},a=function(l){return i.handleSelectStart(l)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",s),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",s),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)},s=function(l){return r.handleDragOver(l,e)},a=function(l){return r.handleDrop(l,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",s),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",s),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 s=new mc(an[r]);return s.loadDataTransfer(i),s}(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}(),jc=function(t,e,n){return new bc(t,e,n)};function wc(t){const e=ae(),n=e.selectedIds,[r,i,s]=rc(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(Le.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(Le.dragEnd())}}),[n,t]);return w.useEffect(()=>{s((un||((un=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),un))},[s]),i}function yt(t,e){return{parentId:t||null,index:e}}function He(t,e){return{type:"line",index:t,level:e}}function dn(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,v){const p=g.getBoundingClientRect(),h=v.x-Math.round(p.x),f=v.y-Math.round(p.y),m=p.height,x=f<m/2,j=!x,b=m/4,C=f>b&&f<m-b;return{x:h,inTopHalf:x,inBottomHalf:j,inMiddle:C,atTop:!C&&x,atBottom:!C&&j}}(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:s,nextNode:a,prevNode:l}=t,[c,d]=function(g,v,p,h){return g?g.isInternal?h.atTop?[v,g]:h.inMiddle?[g,g]:[g,p]:h.inTopHalf?[v,g]:[g,p]:[v,null]}(s,l,a,n);if(s&&s.isInternal&&n.inMiddle)return{drop:yt(s.id,null),cursor:(u=s.id,{type:"highlight",id:u})};var u;if(!c)return{drop:yt((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:He(0,0)};if(hr(c)){const g=ut(i,(d==null?void 0:d.level)||0,c.level);return{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}if(fr(c)){const g=ut(i,(d==null?void 0:d.level)||0,c.level);return{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}if(pr(c)){const g=ut(i,0,c.level+1);return g>c.level?{drop:yt(c.id,0),cursor:He(c.rowIndex+1,g)}:{drop:dn(c,g),cursor:He(c.rowIndex+1,g)}}return{drop:yt(c==null?void 0:c.id,0),cursor:He(c.rowIndex+1,c.level+1)}}const Ic=ze.memo(function({index:t,style:e}){dr(),function(){if(w.useContext(lr)===null)throw new Error("Provide a NodesContext")}();const n=ae(),r=function(h){const f=ae(),m=f.at(h);if(!m)throw new Error(`Could not find node for index: ${h}`);return w.useMemo(()=>{const x=m.clone();return f.visibleNodes[h]=x,x},[...Object.values(m.state),m])}(t),i=w.useRef(null),s=wc(r),a=function(h,f){const m=ae(),[x,j]=wi(()=>({accept:"NODE",canDrop:()=>m.canDrop(),hover:(b,C)=>{const O=C.getClientOffset();if(!h.current||!O)return;const{cursor:k,drop:E}=Li({element:h.current,offset:O,indent:m.indent,node:f,prevNode:f.prev,nextNode:f.next});E&&m.dispatch(Le.hovering(E.parentId,E.index)),C.canDrop()?k&&m.showCursor(k):m.hideCursor()},drop:(b,C)=>{if(!C.canDrop())return null;let{parentId:O,index:k,dragIds:E}=m.state.dnd;jr(m.props.onMove,{dragIds:E,parentId:O===Ke?null:O,index:k===null?0:k,dragNodes:m.dragNodes,parentNode:m.get(O)}),m.open(O)}}),[f,h.current,m.props]);return j}(i,r),l=w.useCallback(h=>{i.current=h,a(h)},[a]),c=n.indent*r.level,d=w.useMemo(()=>({paddingLeft:c}),[c]),u=w.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};w.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 v=n.renderNode,p=n.renderRow;return o.jsx(p,{node:r,innerRef:l,attrs:g,children:o.jsx(v,{node:r,tree:n,style:d,dragHandle:s})})});let hn="",Fi=null;function Hi(){dr();const t=ae();return o.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 s=t.mostRecentNode;for(;s&&s.isSelected;)s=s.nextSibling;s||(s=t.lastNode),t.focus(s,{scroll:!1}),t.delete(Array.from(i))}else{const s=t.focusedNode;if(s){const a=s.nextSibling,l=s.parent;t.focus(a||l,{scroll:!1}),t.delete(s)}}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 s=t.focusedNode;return void(s?s.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 s=t.focusedNode;return void(s?s.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),hn+=e.key,Fi=setTimeout(()=>{hn=""},600);const r=t.visibleNodes.find(i=>{const s=i.data.name;return typeof s=="string"&&s.toLowerCase().startsWith(hn)});r&&t.focus(r.id)},children:o.jsx(Qa,{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:el,innerElementType:rl,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Ic})})}function zi(t){return t.isFiltered?function(e,n){const r={},i=[];function s(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)s(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 s(e),a(e),i.forEach(Ui),i}(t.root,t.isMatch.bind(t)):function(e){const n=[];function r(i){var s;i.level>=0&&n.push(i),i.isOpen&&((s=i.children)===null||s===void 0||s.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 fn=function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(u){s(u)}}function l(d){try{c(r.throw(d))}catch(u){s(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:G,identify:Ie,identifyNull:me}=Da;class Qe{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=zi(this),this.idToIndex=qi(this.visibleNodes)}update(e){this.props=e,this.root=Or(this),this.visibleNodes=zi(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=We(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=We(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,s=this.indexOf(n);if(s===null)return[];const a=Math.min(i,s),l=Math.max(i,s);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 fn(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Sr(this):e.parentId,s=(n=e.index)!==null&&n!==void 0?n:Ir(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",l=yield G(this.props.onCreate,{type:a,parentId:i,index:s,parentNode:this.get(i)});l&&(this.focus(l),setTimeout(()=>{this.edit(l).then(()=>{this.select(l),this.activate(l)})}))})}delete(e){return fn(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Ie),r=n.map(i=>this.get(i)).filter(i=>!!i);yield G(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Ie(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(Pt(n)),new Promise(r=>{Qe.editPromise=r})}submit(e,n){return fn(this,void 0,void 0,function*(){if(!e)return;const r=Ie(e);yield G(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(Pt(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Pt(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(me(e));n&&G(this.props.onActivate,n)}resolveEdit(e){const n=Qe.editPromise;n&&n(e),Qe.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(Me(Ie(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&G(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex-r;let s=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;s=s>r?r:Math.max(r-i,0),this.focus(this.at(s))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,s=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+s,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Ie(e);r&&this.dispatch(Me(i)),this.dispatch(Fa(i)),this.dispatch(Dr(i)),this.dispatch(Mt(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Ie(e);this.dispatch(Nr(n)),G(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(me(e));n&&(this.dispatch(Me(n.id)),this.dispatch(kr(n.id)),this.dispatch(Dr(n.id)),this.dispatch(Mt(n.id)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Ie(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Me(n)),this.dispatch(Nr(this.nodesBetween(r,i))),this.dispatch(kr(this.nodesBetween(r,me(n)))),this.dispatch(Mt(n)),this.scrollTo(n),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),G(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Me((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&G(this.props.onFocus,this.focusedNode),G(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Ie)),i=me(e.anchor),s=me(e.mostRecent);this.dispatch(Ha({ids:r,anchor:i,mostRecent:s})),G(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 s of r)if(!s||!n||s.isInternal&&gr(n,s))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(Le.cursor({type:"none"}))}showCursor(e){this.dispatch(Le.cursor(e))}open(e){const n=me(e);n&&(this.isOpen(n)||(this.dispatch(At.open(n,this.isFiltered)),G(this.props.onToggle,n)))}close(e){const n=me(e);n&&this.isOpen(n)&&(this.dispatch(At.close(n,this.isFiltered)),G(this.props.onToggle,n))}toggle(e){const n=me(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=me(e);if(!n)return;const r=_t(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(){dt(this.root,e=>{e.isInternal&&e.open()})}closeAll(){dt(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Ie(e);return this.openParents(r),wr(()=>r in this.idToIndex).then(()=>{var i;const s=this.idToIndex[r];s!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(s,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===Ke)return!0;const s=(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:s}isEditable(e){return!We(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!We(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=me(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=me(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(Me(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Hi}get renderRow(){return this.props.renderRow||Aa}get renderNode(){return this.props.children||Ma}get renderDragPreview(){return this.props.renderDragPreview||Er}get renderCursor(){return this.props.renderCursor||Pa}}function Q(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 Vi=typeof Symbol=="function"&&Symbol.observable||"@@observable",pn=()=>Math.random().toString(36).substring(7).split("").join("."),xt={INIT:`@@redux/INIT${pn()}`,REPLACE:`@@redux/REPLACE${pn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${pn()}`};function Bi(t,e,n){if(typeof t!="function")throw new Error(Q(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Q(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(Q(1));return n(Bi)(t,e)}let r=t,i=e,s=new Map,a=s,l=0,c=!1;function d(){a===s&&(a=new Map,s.forEach((p,h)=>{a.set(h,p)}))}function u(){if(c)throw new Error(Q(3));return i}function g(p){if(typeof p!="function")throw new Error(Q(4));if(c)throw new Error(Q(5));let h=!0;d();const f=l++;return a.set(f,p),function(){if(h){if(c)throw new Error(Q(6));h=!1,d(),a.delete(f),s=null}}}function v(p){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}(p))throw new Error(Q(7));if(p.type===void 0)throw new Error(Q(8));if(typeof p.type!="string")throw new Error(Q(17));if(c)throw new Error(Q(9));try{c=!0,i=r(i,p)}finally{c=!1}return(s=a).forEach(h=>{h()}),p}return v({type:xt.INIT}),{dispatch:v,subscribe:g,getState:u,replaceReducer:function(p){if(typeof p!="function")throw new Error(Q(10));r=p,v({type:xt.REPLACE})},[Vi]:function(){const p=g;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(Q(11));function f(){const m=h;m.next&&m.next(u())}return f(),{unsubscribe:p(f)}},[Vi](){return this}}}}}function Wi(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const a=e[s];typeof t[a]=="function"&&(n[a]=t[a])}const r=Object.keys(n);let i;try{(function(s){Object.keys(s).forEach(a=>{const l=s[a];if(l(void 0,{type:xt.INIT})===void 0)throw new Error(Q(12));if(l(void 0,{type:xt.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(Q(13))})})(n)}catch(s){i=s}return function(s={},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],v=s[u],p=g(v,a);if(p===void 0)throw a&&a.type,new Error(Q(14));c[u]=p,l=l||p!==v}return l=l||r.length!==Object.keys(s).length,l?c:s}}const Sc=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:Cr(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:Cr(t.unfiltered,e)}):t},selection:function(t=Re().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=Re().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=Re().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 Re().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),Oc=Re();function Cc({treeProps:t,imperativeHandle:e,children:n}){const r=w.useRef(null),i=w.useRef(null),s=w.useRef(Bi(Sc,Re(t))),a=as.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>Oc),l=w.useMemo(()=>new Qe(s.current,t,r,i),[]),c=w.useRef(0);return w.useMemo(()=>{c.current+=1,l.update(t)},[...Object.values(t),a.nodes.open]),w.useImperativeHandle(e,()=>l),w.useEffect(()=>{l.props.selection?l.select(l.props.selection,{focus:!1}):l.deselectAll()},[l.props.selection]),w.useEffect(()=>{l.props.searchTerm||s.current.dispatch(At.clear(!0))},[l.props.searchTerm]),o.jsx(ar.Provider,{value:l,children:o.jsx(ur.Provider,{value:c.current,children:o.jsx(lr.Provider,{value:a.nodes,children:o.jsx(cr.Provider,{value:a.dnd,children:o.jsx(Fl,Object.assign({backend:jc,options:{rootElement:l.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function kc(t){return function(){const e=ae(),[,n]=wi(()=>({accept:"NODE",canDrop:(r,i)=>!!i.isOver({shallow:!0})&&e.canDrop(),hover:(r,i)=>{if(!i.isOver({shallow:!0}))return;const s=i.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:a,drop:l}=Li({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});l&&e.dispatch(Le.hovering(l.parentId,l.index)),i.canDrop()?a&&e.showCursor(a):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Nc(){const t=ae().props.renderContainer||Hi;return o.jsx(o.Fragment,{children:o.jsx(t,{})})}function Dc(){const t=ae(),{offset:e,mouse:n,item:r,isDragging:i}=(s=g=>({offset:g.getSourceClientOffset(),mouse:g.getClientOffset(),item:g.getItem(),isDragging:g.isDragging()}),a=De().getMonitor(),l=cc(vi(a,s),2),c=l[0],d=l[1],w.useEffect(function(){return a.subscribeToOffsetChange(d)}),w.useEffect(function(){return a.subscribeToStateChange(d)}),c);var s,a,l,c,d;const u=t.props.renderDragPreview||Er;return o.jsx(u,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class Ki{constructor(e){this.root=function(n){const r=new Gi({id:"ROOT"},null);return r.children=n.map(i=>gn(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 gn(t,e){const n=new Gi(t,e);return t.children&&(n.children=t.children.map(r=>gn(r,n))),n}class Gi{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 s=gn(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,s),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 Ec=0;function Tc(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.
17
+ Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,s]=w.useState(r),a=w.useMemo(()=>new Ki(i),[i]);return[i,{onMove:c=>{for(const d of c.dragIds)a.move({id:d,parentId:c.parentId,index:c.index});s(a.data)},onRename:({name:c,id:d})=>{a.update({id:d,changes:{name:c}}),s(a.data)},onCreate:({parentId:c,index:d,type:u})=>{const g={id:"simple-tree-id-"+Ec++,name:""};return u==="internal"&&(g.children=[]),a.create({parentId:c,index:d,data:g}),s(a.data),g},onDelete:c=>{c.ids.forEach(d=>a.drop({id:d})),s(a.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const _c=w.forwardRef(function(t,e){const n=Tc(t);return o.jsxs(Cc,{treeProps:n,imperativeHandle:e,children:[o.jsx(kc,{children:o.jsx(Nc,{})}),o.jsx(Dc,{})]})});export{cs as A,us as B,Ia as C,gs as G,Ws as K,ms as L,Ca as M,bs as P,Ss as S,_c as T,js as Y,ps as a,vs as b,Oa as c,Hn as d,st as e,Ms as f,Bs as g,Be as h,Gn as i,Yn as j,Tt as k,$n as l,zs as m,zn as n,Qn as o,Wn as p,at as q,Kn as r,Et as s,Ki as t,ks as u};