@marimo-team/frontend 0.15.1-dev38 → 0.15.1

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 (114) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-D8km1NYJ.js → ConnectedDataExplorerComponent-BmuPnAsd.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-CERR01UB.js → ImageComparisonComponent-uf-9TFG8.js} +1 -1
  3. package/dist/assets/{VegaLite-DzZIYwlo.js → VegaLite-CQyOAWzz.js} +1 -1
  4. package/dist/assets/{_baseEach-DO-XcSIV.js → _baseEach-2yxz4QPK.js} +1 -1
  5. package/dist/assets/_baseMap-Uhjhm4ni.js +1 -0
  6. package/dist/assets/{_baseUniq-urG2vBXB.js → _baseUniq-kkBJp3jc.js} +1 -1
  7. package/dist/assets/{_createAggregator-DBxX1xI5.js → _createAggregator-ByV0zOLy.js} +1 -1
  8. package/dist/assets/{any-language-editor-BhBzti0Q.js → any-language-editor-B-cvHGmQ.js} +1 -1
  9. package/dist/assets/{architectureDiagram-KFL7JDKH-mgZE9P9E.js → architectureDiagram-KFL7JDKH-CrRiJlSM.js} +1 -1
  10. package/dist/assets/{blockDiagram-ZYB65J3Q-DhlvqBBN.js → blockDiagram-ZYB65J3Q-BARtxPtR.js} +1 -1
  11. package/dist/assets/{c4Diagram-AAMF2YG6-WgF7TmcX.js → c4Diagram-AAMF2YG6-C1rZ_aGX.js} +1 -1
  12. package/dist/assets/channel-BFLyOCHP.js +1 -0
  13. package/dist/assets/{chunk-ANTBXLJU-Cc0FLBv4.js → chunk-ANTBXLJU-CXz5OLFO.js} +1 -1
  14. package/dist/assets/{chunk-FHKO5MBM-TDVJkINs.js → chunk-FHKO5MBM-BIrdB1fE.js} +1 -1
  15. package/dist/assets/{chunk-GLLZNHP4-BFZQsgmM.js → chunk-GLLZNHP4-jO0hO6S-.js} +1 -1
  16. package/dist/assets/{chunk-JBRWN2VN-jewL7EcA.js → chunk-JBRWN2VN-CqtMDVwa.js} +1 -1
  17. package/dist/assets/{chunk-LXBSTHXV-DtMvensd.js → chunk-LXBSTHXV-68wVSxsz.js} +1 -1
  18. package/dist/assets/{chunk-NRVI72HA-B7LxIi5N.js → chunk-NRVI72HA-6jfSceAv.js} +1 -1
  19. package/dist/assets/{chunk-OMD6QJNC-D77lwHsv.js → chunk-OMD6QJNC-DItPiESC.js} +1 -1
  20. package/dist/assets/{chunk-WVR4S24B-BdzaJi_f.js → chunk-WVR4S24B-Dk_4BMrf.js} +1 -1
  21. package/dist/assets/{circle-play-DbLJhgWd.js → circle-play-DlcxXne6.js} +1 -1
  22. package/dist/assets/classDiagram-3BZAVTQC-DmaMTSt3.js +1 -0
  23. package/dist/assets/classDiagram-v2-QTMF73CY-DmaMTSt3.js +1 -0
  24. package/dist/assets/clone-D8_RSzqX.js +1 -0
  25. package/dist/assets/{compile-ittiAa-p.js → compile-rRtwsAuM.js} +1 -1
  26. package/dist/assets/{dagre-2BBEFEWP-woDg8Awj.js → dagre-2BBEFEWP-BRQiUAjN.js} +1 -1
  27. package/dist/assets/{data-grid-overlay-editor-ncLMoVIb.js → data-grid-overlay-editor-D69G4ntu.js} +1 -1
  28. package/dist/assets/{diagram-4IRLE6MV-PAN7AATi.js → diagram-4IRLE6MV-dbf1VDp2.js} +1 -1
  29. package/dist/assets/{diagram-GUPCWM2R-Ce2AHqMP.js → diagram-GUPCWM2R-03cBW_UX.js} +1 -1
  30. package/dist/assets/{diagram-RP2FKANI-2WiKea8D.js → diagram-RP2FKANI-izLn5JA6.js} +1 -1
  31. package/dist/assets/edit-page-KQGIuOho.css +1 -0
  32. package/dist/assets/{edit-page-CZn2bhY3.js → edit-page-zgOEBr1X.js} +48 -48
  33. package/dist/assets/{erDiagram-HZWUO2LU-D5yTZwmt.js → erDiagram-HZWUO2LU-DvzfndiW.js} +1 -1
  34. package/dist/assets/{flowDiagram-THRYKUMA-CgN86sZ8.js → flowDiagram-THRYKUMA-DvMVXvqb.js} +1 -1
  35. package/dist/assets/{ganttDiagram-WV7ZQ7D5-5skQ2H3l.js → ganttDiagram-WV7ZQ7D5-BzN8gykN.js} +1 -1
  36. package/dist/assets/{gitGraphDiagram-OJR772UL-C75De8fN.js → gitGraphDiagram-OJR772UL-wxIdjcsZ.js} +1 -1
  37. package/dist/assets/{glide-data-editor-x0d0Up5U.js → glide-data-editor-D6Yhpu80.js} +4 -4
  38. package/dist/assets/{graph-Die-6Bfl.js → graph-DLqrcAlu.js} +1 -1
  39. package/dist/assets/{home-page-XrEKfDMd.js → home-page-CDKRxIoa.js} +1 -1
  40. package/dist/assets/{index-D_ebOE-e.js → index-0xwlfUxT.js} +1 -1
  41. package/dist/assets/{index-CXwX4pUI.js → index-BB71mG_d.js} +182 -182
  42. package/dist/assets/{index-BfqMljbw.js → index-BZeyS4ec.js} +1 -1
  43. package/dist/assets/{index-CoAopzxc.js → index-Bs6OAQYb.js} +1 -1
  44. package/dist/assets/{index-Dlrab0dK.js → index-BsnxGFdv.js} +1 -1
  45. package/dist/assets/{index-Dh8C39yO.js → index-C0OGBvcf.js} +1 -1
  46. package/dist/assets/{index-BSJet7Zq.js → index-CK28dYOC.js} +1 -1
  47. package/dist/assets/{index-DmHX1Rlv.js → index-CQZ2Knp2.js} +1 -1
  48. package/dist/assets/{index-De7juNGF.js → index-Cdz_z5nt.js} +1 -1
  49. package/dist/assets/{index-BWBg8Lhk.js → index-ClD_znk5.js} +1 -1
  50. package/dist/assets/{index-kraNHKP1.js → index-D-b5sgmz.js} +1 -1
  51. package/dist/assets/{index-CCZkMG5j.js → index-D2UJqE4Q.js} +1 -1
  52. package/dist/assets/{index-v546YXgW.js → index-D2fV3sDg.js} +1 -1
  53. package/dist/assets/{index-UAPuSZUk.js → index-DUN68f-4.js} +1 -1
  54. package/dist/assets/{index-B3-zxsj0.js → index-DZKpeoa1.js} +1 -1
  55. package/dist/assets/{index-F531CohR.js → index-DgoUxLCo.js} +1 -1
  56. package/dist/assets/{index-B1-fG89N.js → index-Dh_3Mb5d.js} +1 -1
  57. package/dist/assets/{index-D9ot8WPl.js → index-DroyKRLH.js} +1 -1
  58. package/dist/assets/index-DryPQDfA.css +1 -0
  59. package/dist/assets/{index-jwhWh6uS.js → index-bUE-XbFV.js} +1 -1
  60. package/dist/assets/{index-B7JwzNrx.js → index-yz44yADt.js} +1 -1
  61. package/dist/assets/infoDiagram-6WOFNB3A-CvNjv0rh.js +2 -0
  62. package/dist/assets/{journeyDiagram-FFXJYRFH-CrWxkiXG.js → journeyDiagram-FFXJYRFH-BON6WB5Z.js} +1 -1
  63. package/dist/assets/{kanban-definition-KOZQBZVT-D5haTqpz.js → kanban-definition-KOZQBZVT-DENjuTrn.js} +1 -1
  64. package/dist/assets/{layout-BEc7rmra.js → layout-3QJH3hkO.js} +1 -1
  65. package/dist/assets/{linear-BLmy5c_P.js → linear-BFvzcy10.js} +1 -1
  66. package/dist/assets/links-B7kV7dQW.js +17 -0
  67. package/dist/assets/{mermaid-Bu2fp8N3.js → mermaid-0ClPHFIM.js} +4 -4
  68. package/dist/assets/{min-BF5a70Ha.js → min-CO20nzic.js} +1 -1
  69. package/dist/assets/{mindmap-definition-LNHGMQRG-jD2ylGBG.js → mindmap-definition-LNHGMQRG-0ssdD2sg.js} +1 -1
  70. package/dist/assets/{number-overlay-editor-BadGHMrr.js → number-overlay-editor-CVVXgCAp.js} +1 -1
  71. package/dist/assets/{pieDiagram-DBDJKBY4-B11UeqxS.js → pieDiagram-DBDJKBY4-DI0JNhUn.js} +1 -1
  72. package/dist/assets/{quadrantDiagram-YPSRARAO-DznrQXs-.js → quadrantDiagram-YPSRARAO-Bqg0IAoq.js} +1 -1
  73. package/dist/assets/{react-plotly-B6W1vV_l.js → react-plotly-yplDi2oo.js} +1 -1
  74. package/dist/assets/{requirementDiagram-EGVEC5DT-BuWp2ov9.js → requirementDiagram-EGVEC5DT-C_YIxDr_.js} +1 -1
  75. package/dist/assets/{run-page-BD4YehOu.js → run-page-Bv2C3uJ1.js} +1 -1
  76. package/dist/assets/{sankeyDiagram-HRAUVNP4-BmDCzHkG.js → sankeyDiagram-HRAUVNP4-Dm-w1V71.js} +1 -1
  77. package/dist/assets/{sequenceDiagram-WFGC7UMF-B6aCHwAd.js → sequenceDiagram-WFGC7UMF-uox9Aix1.js} +1 -1
  78. package/dist/assets/{slides-component-CkHAJhvv.js → slides-component-BBkS68D5.js} +1 -1
  79. package/dist/assets/{sortBy-BgSF6Z3p.js → sortBy-yoFvjOas.js} +1 -1
  80. package/dist/assets/{stateDiagram-UUKSUZ4H-DcGKoXUB.js → stateDiagram-UUKSUZ4H-DVHFynm4.js} +1 -1
  81. package/dist/assets/stateDiagram-v2-EYPG3UTE-_z_RwTAL.js +1 -0
  82. package/dist/assets/{storage-BX5GfYeC.js → storage-C__Jd9kD.js} +3 -3
  83. package/dist/assets/{terminal-CpmTRzDD.js → terminal-BpOKN-Gr.js} +1 -1
  84. package/dist/assets/{time-igUPFhda.js → time-q7el0-6s.js} +1 -1
  85. package/dist/assets/{timeline-definition-3HZDQTIS-7b4K28uW.js → timeline-definition-3HZDQTIS-K-bheyBf.js} +1 -1
  86. package/dist/assets/{tracing-BWeRyJmf.js → tracing-Cv9nIL_Y.js} +2 -2
  87. package/dist/assets/{trash-Bv9cD3VE.js → trash-Izx1PgIJ.js} +1 -1
  88. package/dist/assets/{treemap-75Q7IDZK-DPkOPTcz.js → treemap-75Q7IDZK-mGt3Vxl-.js} +1 -1
  89. package/dist/assets/{vega-component-CGVDFtwG.js → vega-component-B1UZ_5Pg.js} +1 -1
  90. package/dist/assets/{xychartDiagram-FDP5SA34-BbvKlNzf.js → xychartDiagram-FDP5SA34-DGx9I_mu.js} +1 -1
  91. package/dist/index.html +2 -2
  92. package/package.json +7 -7
  93. package/src/components/ai/ai-model-dropdown.tsx +3 -3
  94. package/src/components/app-config/ai-config.tsx +244 -8
  95. package/src/components/chat/markdown-renderer.css +15 -0
  96. package/src/components/chat/markdown-renderer.tsx +2 -1
  97. package/src/components/editor/ai/completion-utils.ts +6 -2
  98. package/src/components/editor/cell/cell-context-menu.tsx +35 -13
  99. package/src/core/ai/__tests__/model-registry.test.ts +28 -0
  100. package/src/core/ai/model-registry.ts +44 -8
  101. package/src/core/codemirror/language/languages/sql/utils.ts +6 -1
  102. package/src/plugins/impl/FileBrowserPlugin.tsx +14 -20
  103. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +19 -2
  104. package/src/plugins/impl/common/error-banner.tsx +3 -0
  105. package/dist/assets/_baseMap-Dg1mkEJY.js +0 -1
  106. package/dist/assets/channel-D1aHTD78.js +0 -1
  107. package/dist/assets/classDiagram-3BZAVTQC-C8Rjm-tQ.js +0 -1
  108. package/dist/assets/classDiagram-v2-QTMF73CY-C8Rjm-tQ.js +0 -1
  109. package/dist/assets/clone-BWlvmMhq.js +0 -1
  110. package/dist/assets/edit-page-jgH_jXgs.css +0 -1
  111. package/dist/assets/index-B6q_Qknx.css +0 -1
  112. package/dist/assets/infoDiagram-6WOFNB3A-mJ455ogl.js +0 -2
  113. package/dist/assets/links-BGVSWGyv.js +0 -17
  114. package/dist/assets/stateDiagram-v2-EYPG3UTE-BW5Lhcrb.js +0 -1
@@ -0,0 +1,17 @@
1
+ import{ce as cl,aP as dl,c as be,U as y,ft as dt,fu as Et,fv as Ve,fw as ul,fx as hl,fy as kr,fz as Cr,fA as pn,fB as Ir,dG as Oe,b as R,fC as fl,fD as Nr,fE as Dr,ay as Or,fF as Er,fG as Tt,fH as Tr,fI as ut,fJ as pl,fK as gn,fL as Pr,fM as Pt,fN as Pe,fO as gl,fP as ze,fQ as Kr,dF as _r,fR as ml,fS as Mr,fT as Ar,fU as Kt,fV as vl,fW as yl,fX as xl,dM as _t,fY as bl,fZ as wl,f_ as jl,f$ as Sl,dH as mn,dI as kl,dJ as vn,dL as ht,g0 as Cl,g1 as Rr,g2 as yn,g3 as xn,dK as Il,g4 as Nl,g5 as Dl,g6 as Ol,j as o,g7 as El,a as se,cB as Tl,ar as Be,g8 as Pl,T as Je,g9 as Fr,fa as Kl,ga as Lr,gb as zr,gc as q,gd as $r,ge as W,gf as U,gg as G,gh as Se,gi as Z,bo as Ke,gj as Vr,gk as ie,gl as he,ac as et,gm as me,bp as fe,gn as Mt,e4 as Br,go as Hr,gp as _l,gq as tt,gr as Fe,gs as Ur,o as Ml,gt as Al,gu as qr,gv as At,gw as Wr,gx as Rl,gy as Rt,L as ue,gz as ge,gA as Fl,dR as Ft,gB as Gr,eK as Ll,dt as bn,fj as zl,gC as Yr,gD as $l,gE as Vl,gF as Xr,gG as Qr,gH as Bl,al as ft,be as pt,eS as Zr,V as Lt,gI as Hl,gJ as Ul,gK as Jr,gL as ei,gM as ql,a6 as ve,ev as zt,gN as ti,a4 as wn,gO as Wl,gP as Gl,a7 as ni,a8 as Yl,a9 as ri,gQ as Xl,gR as Ql,gS as Zl,b5 as Jl,gT as ea,gU as ta,gV as na,gW as ra,gX as ia,gY as oa,cm as sa,bq as He,es as la,dN as ii,ad as aa,ab as ca,gZ as da,g_ as gt,bm as $t,ch as oi,g$ as ua,h0 as si,at as Ue,h1 as li,h2 as Vt,h3 as jn,h4 as ai,ag as qe,h5 as ci,h6 as di,aO as Bt,eJ as ha,h7 as mt,h8 as ui,dq as fa,dr as pa,h9 as ga,dm as hi,ha as ma,hb as va,hc as fi,hd as ya,aT as pi,he as xa,av as ba,dn as wa,ds as ja,hf as Sa,hg as ka,e_ as Ca,hh as Ia,hi as Na,er as Da,hj as Oa,hk as gi,hl as Ea,hm as Ta,hn as Pa,ho as Ka,aK as _a,hp as mi,hq as Sn,aw as Ma,_ as vi,E as Aa,hr as Ra,hs as Ht,ht as Fa,hu as La,ao as kn,fh as za,hv as $a,hw as Va,hx as Ba,hy as Ha,eq as vt,dD as Ut,hz as Ua,hA as yi,hB as qa,a5 as Wa,hC as Ga,hD as Ya,hE as Xa,ba as Qa,bj as Za,b8 as Ja}from"./index-BB71mG_d.js";import{e as ec}from"./index-ClD_znk5.js";/**
2
+ * @license lucide-react v0.525.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const tc=be("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"}]]),nc=be("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"}]]),xi=be("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"}]]),bi=be("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"}]]),wi=be("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"}]]),rc=be("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"}]]),ji=be("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"}]]),ic=be("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"}]]),oc=be("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"}]]),sc=be("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"}]]),lc=be("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"}]]),ac=be("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"}]]),cc=be("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"}]]),dc=be("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"}]]),uc=be("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 Si(t,e){const n=y.useRef(!0),r=y.useRef(null);dt(()=>(n.current=!0,()=>{n.current=!1}),[]),dt(()=>{n.current?n.current=!1:r.current&&!e.some((i,s)=>!Object.is(i,r[s]))||t(),r.current=e},e)}function hc(t){const e=y.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}function nt(t){return ul()?t.metaKey:t.ctrlKey}class wr{get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new wr(this.type,this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}constructor(e,n){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=e,this.key=n}}class jr{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),i=(r==null?void 0:r.firstChildKey)!=null?n.get(r.firstChildKey):null;for(;i;)yield i,i=i.nextKey!=null?n.get(i.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);var r;return(r=n==null?void 0:n.key)!==null&&r!==void 0?r:null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey==null)return null;n=this.keyMap.get(n.parentKey)}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(){throw new Error("Not implemented")}clone(){let e=new this.constructor;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,r=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!r}UNSTABLE_filter(e){let n=new jr,r=null;for(let i of this)if(i.type==="section"&&i.hasChildNodes){let s=i.clone(),l=null;for(let c of this.getChildren(i.key))if(ki(c,e,this,n)){let a=c.clone();l==null&&(s.firstChildKey=a.key),n.firstKey==null&&(n.firstKey=s.key),l&&l.parentKey===a.parentKey?(l.nextKey=a.key,a.prevKey=l.key):a.prevKey=null,a.nextKey=null,n.addNode(a),l=a}l&&(l.type!=="header"?(s.lastChildKey=l.key,r==null?s.prevKey=null:r.type!=="section"&&r.type!=="separator"||(r.nextKey=s.key,s.prevKey=r.key),s.nextKey=null,r=s,n.addNode(s)):(n.firstKey===s.key&&(n.firstKey=null),n.removeNode(l.key)))}else if(i.type==="separator"){let s=i.clone();s.nextKey=null,(r==null?void 0:r.type)==="section"&&(r.nextKey=s.key,s.prevKey=r.key,r=s,n.addNode(s))}else{let s=i.clone();ki(s,e,this,n)&&(n.firstKey==null&&(n.firstKey=s.key),r!=null&&r.type!=="section"&&r.type!=="separator"&&r.parentKey===s.parentKey?(r.nextKey=s.key,s.prevKey=r.key):s.prevKey=null,s.nextKey=null,n.addNode(s),r=s)}if((r==null?void 0:r.type)==="separator"&&r.nextKey===null){let i;r.prevKey!=null&&(i=n.getItem(r.prevKey),i.nextKey=null),n.removeNode(r.key),r=i}return n.lastKey=(r==null?void 0:r.key)||null,n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function ki(t,e,n,r){if(t.type==="subdialogtrigger"||t.type==="submenutrigger"){let i=[...n.getChildren(t.key)][0];if(i&&e(i.textValue)){let s=i.clone();return r.addNode(s),!0}return!1}return t.type==="header"||e(t.textValue)}class Ci{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild==null&&(this.firstChild=e),this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,n){if(n==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=n,e.previousSibling=n.previousSibling,e.index=n.index-1,this.firstChild===n?this.firstChild=e:n.previousSibling&&(n.previousSibling.nextSibling=e),n.previousSibling=e,e.parentNode=n.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&this.ownerDocument.isMounted&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}}class ct extends Ci{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof ct?this.parentNode.level+(this.node.type==="item"?1:0):0}getMutableNode(){return this.isMutated||(this.node=this.node.clone(),this.isMutated=!0),this.ownerDocument.markDirty(this),this.node}updateNode(){var e,n,r;let i=this.nextVisibleSibling,s=this.getMutableNode();var l,c,a,d;if(s.index=this.index,s.level=this.level,s.parentKey=this.parentNode instanceof ct?this.parentNode.node.key:null,s.prevKey=(l=(e=this.previousVisibleSibling)===null||e===void 0?void 0:e.node.key)!==null&&l!==void 0?l:null,s.nextKey=(c=i==null?void 0:i.node.key)!==null&&c!==void 0?c:null,s.hasChildNodes=!!this.firstChild,s.firstChildKey=(a=(n=this.firstVisibleChild)===null||n===void 0?void 0:n.node.key)!==null&&a!==void 0?a:null,s.lastChildKey=(d=(r=this.lastVisibleChild)===null||r===void 0?void 0:r.node.key)!==null&&d!==void 0?d:null,(s.colSpan!=null||s.colIndex!=null)&&i){var u,f;let p=((u=s.colIndex)!==null&&u!==void 0?u:s.index)+((f=s.colSpan)!==null&&f!==void 0?f:1);p!==i.node.colIndex&&(i.getMutableNode().colIndex=p)}}setProps(e,n,r,i){let s=this.getMutableNode(),{value:l,textValue:c,id:a,...d}=e;if(d.ref=n,s.props=d,s.rendered=r,s.render=i,s.value=l,s.textValue=c||(typeof d.children=="string"?d.children:"")||e["aria-label"]||"",a!=null&&a!==s.key){if(this.hasSetProps)throw new Error("Cannot change the id of an item");s.key=a}d.colSpan!=null&&(s.colSpan=d.colSpan),this.hasSetProps=!0,this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(n){let r=n==="none";if(e.isHidden!==r){var i,s;((i=e.parentNode)===null||i===void 0?void 0:i.firstVisibleChild)!==e&&((s=e.parentNode)===null||s===void 0?void 0:s.lastVisibleChild)!==e||e.ownerDocument.markDirty(e.parentNode);let l=e.previousVisibleSibling,c=e.nextVisibleSibling;l&&e.ownerDocument.markDirty(l),c&&e.ownerDocument.markDirty(c),e.isHidden=r,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,n){super(n),this.nodeType=8,this.isMutated=!0,this._index=0,this.hasSetProps=!1,this.isHidden=!1,this.node=new wr(e,"react-aria-"+ ++n.nodeId)}}class fc extends Ci{get isConnected(){return this.isMounted}createElement(e){return new ct(e,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden)return;let n=this.getMutableCollection();if(!n.getItem(e.node.key))for(let r of e)this.addNode(r);n.addNode(e.node)}removeNode(e){for(let n of e)this.removeNode(n);this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection.clone():(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let s of this.dirtyNodes)s instanceof ct&&(!s.isConnected||s.isHidden)?this.removeNode(s):s.updateChildIndices();for(let s of this.dirtyNodes)s instanceof ct&&(s.isConnected&&!s.isHidden&&(s.updateNode(),this.addNode(s)),s.isMutated=!1);var e,n,r,i;this.dirtyNodes.clear(),this.nextCollection&&(this.nextCollection.commit((r=(e=this.firstVisibleChild)===null||e===void 0?void 0:e.node.key)!==null&&r!==void 0?r:null,(i=(n=this.lastVisibleChild)===null||n===void 0?void 0:n.node.key)!==null&&i!==void 0?i:null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(this.dirtyNodes.size!==0&&!this.queuedRender){this.queuedRender=!0,this.inSubscription=!0;for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.isMounted=!0,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}}function Cn(t){let{children:e,items:n,idScope:r,addIdAndValue:i,dependencies:s=[]}=t,l=y.useMemo(()=>new WeakMap,s);return y.useMemo(()=>{if(n&&typeof e=="function"){let d=[];for(let u of n){let f=l.get(u);if(!f){var c,a;f=e(u);let p=(a=(c=f.props.id)!==null&&c!==void 0?c:u.key)!==null&&a!==void 0?a:u.id;if(p==null)throw new Error("Could not determine key for item");r&&(p=r+":"+p),f=y.cloneElement(f,i?{key:p,id:p,value:u}:{key:p}),l.set(u,f)}d.push(f)}return d}if(typeof e!="function")return e},[e,n,l,r,i])}const pc=500,Ii=y.createContext(!1),yt=y.createContext(null);function gc(t){if(y.useContext(yt))return t.content;let{collection:e,document:n}=function(r){let[i]=y.useState(()=>new fc((r==null?void 0:r())||new jr)),s=y.useCallback(d=>i.subscribe(d),[i]),l=y.useCallback(()=>{let d=i.getCollection();return i.isSSR&&i.resetAfterSSR(),d},[i]),c=y.useCallback(()=>(i.isSSR=!0,i.getCollection()),[i]),a=vc(s,l,c);return dt(()=>(i.isMounted=!0,()=>{i.isMounted=!1}),[i]),{collection:a,document:i}}(t.createCollection);return R.createElement(R.Fragment,null,R.createElement(fl,null,R.createElement(yt.Provider,{value:n},t.content)),R.createElement(mc,{render:t.children,collection:e}))}function mc({collection:t,render:e}){return e(t)}const vc=typeof R.useSyncExternalStore=="function"?R.useSyncExternalStore:function(t,e,n){let r=Nr(),i=y.useRef(r);i.current=r;let s=y.useCallback(()=>i.current?n():e(),[e,n]);return Dr.useSyncExternalStore(t,s)},In=y.createContext(null);function Ni(t,e,n,r,i,s){let l=y.useCallback(a=>{a==null||a.setProps(e,n,r,s)},[e,n,r,s]),c=y.useContext(In);if(c){let a=c.ownerDocument.nodesByProps.get(e);return a||(a=c.ownerDocument.createElement(t),a.setProps(e,n,r,s),c.appendChild(a),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,a)),i?R.createElement(In.Provider,{value:a},i):null}return R.createElement(t,{ref:l},i)}function Di(t,e){let n=({node:i})=>e(i.props,i.props.ref,i),r=y.forwardRef((i,s)=>{let l=y.useContext(Er);if(!y.useContext(Ii)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(i,s)}return Ni(t,i,s,"children"in i?i.children:null,null,c=>R.createElement(Er.Provider,{value:l},R.createElement(n,{node:c})))});return r.displayName=e.name,r}function yc(t,e,n=Oi){let r=({node:s})=>e(s.props,s.props.ref,s),i=y.forwardRef((s,l)=>{let c=n(s);var a;return(a=Ni(t,s,l,null,c,d=>R.createElement(r,{node:d})))!==null&&a!==void 0?a:R.createElement(R.Fragment,null)});return i.displayName=e.name,i}function Oi(t){return Cn({...t,addIdAndValue:!0})}const Ei=y.createContext(null);function xc(t){let e=y.useContext(Ei),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),i=Oi({...t,idScope:r,dependencies:n});return y.useContext(yt)&&(i=R.createElement(bc,null,i)),e=y.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),R.createElement(Ei.Provider,{value:e},i)}function bc({children:t}){let e=y.useContext(yt),n=y.useMemo(()=>R.createElement(yt.Provider,{value:null},R.createElement(Ii.Provider,{value:!0},t)),[t]);return Nr()?R.createElement(In.Provider,{value:e},n):Or.createPortal(n,e)}function Ti(t){let e=function(n){let r=Tr(n),i=r==null?void 0:r.getAttribute("aria-activedescendant");return i&&n.getElementById(i)||r}(Cr(t));e!==t&&(e&&function(n,r){n.dispatchEvent(new FocusEvent("blur",{relatedTarget:r})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:r}))}(e,t),t&&Pi(t,e))}function Pi(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function Nn(t){return pl()?t.altKey:t.ctrlKey}function qt(t,e){var n,r;let i=`[data-key="${CSS.escape(String(e))}"]`,s=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return s&&(i=`[data-collection="${CSS.escape(s)}"]${i}`),(r=t.current)===null||r===void 0?void 0:r.querySelector(i)}const Ki=new WeakMap;function wc(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:s=!1,disallowEmptySelection:l=!1,disallowSelectAll:c=!1,escapeKeyBehavior:a="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:f,allowsTabNavigation:p=!1,isVirtualized:m,scrollRef:h=r,linkBehavior:g="action"}=t,{direction:v}=gn(),x=Pr(),j=y.useRef({top:0,left:0});Pt(h,"scroll",m?void 0:()=>{var I,K,F,z;j.current={top:(F=(I=h.current)===null||I===void 0?void 0:I.scrollTop)!==null&&F!==void 0?F:0,left:(z=(K=h.current)===null||K===void 0?void 0:K.scrollLeft)!==null&&z!==void 0?z:0}});let S=y.useRef(!1);Pt(r,"react-aria-focus",f?I=>{let{detail:K}=I;I.stopPropagation(),e.setFocused(!0),(K==null?void 0:K.focusStrategy)==="first"&&(S.current=!0)}:void 0);let C=Et(()=>{var I,K;let F=(K=(I=n.getFirstKey)===null||I===void 0?void 0:I.call(n))!==null&&K!==void 0?K:null;if(F==null){let z=Tr();Ti(r.current),Pi(z,null),e.collection.size>0&&(S.current=!1)}else e.setFocusedKey(F),S.current=!1});Si(()=>{S.current&&C()},[e.collection,C]);let k=Et(()=>{e.collection.size>0&&(S.current=!1)});Si(()=>{k()},[e.focusedKey,k]),Pt(r,"react-aria-clear-focus",f?I=>{var K;I.stopPropagation(),e.setFocused(!1),!((K=I.detail)===null||K===void 0)&&K.clearFocusKey&&e.setFocusedKey(null)}:void 0);const D=y.useRef(i),N=y.useRef(!1);y.useEffect(()=>{if(D.current){var I,K;let $=null;var F,z;i==="first"&&($=(F=(I=n.getFirstKey)===null||I===void 0?void 0:I.call(n))!==null&&F!==void 0?F:null),i==="last"&&($=(z=(K=n.getLastKey)===null||K===void 0?void 0:K.call(n))!==null&&z!==void 0?z:null);let w=e.selectedKeys;if(w.size){for(let V of w)if(e.canSelectItem(V)){$=V;break}}e.setFocused(!0),e.setFocusedKey($),$==null&&!f&&r.current&&Pe(r.current),e.collection.size>0&&(D.current=!1,N.current=!0)}});let P=y.useRef(e.focusedKey),O=y.useRef(null);y.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==P.current||N.current)&&h.current&&r.current){let I=Kr(),K=qt(r,e.focusedKey);if(!(K instanceof HTMLElement))return;(I==="keyboard"||N.current)&&(O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{h.current&&(gl(h.current,K),I!=="virtual"&&ze(K,{containingElement:r.current}))}))}!f&&e.isFocused&&e.focusedKey==null&&P.current!=null&&r.current&&Pe(r.current),P.current=e.focusedKey,N.current=!1}),y.useEffect(()=>()=>{O.current&&cancelAnimationFrame(O.current)},[]),Pt(r,"react-aria-focus-scope-restore",I=>{I.preventDefault(),e.setFocused(!0)});let _,L={onKeyDown:I=>{var K;if(I.altKey&&I.key==="Tab"&&I.preventDefault(),!(!((K=r.current)===null||K===void 0)&&K.contains(I.target)))return;const F=(A,te)=>{if(A!=null){if(e.isLink(A)&&g==="selection"&&d&&!Nn(I)){Or.flushSync(()=>{e.setFocusedKey(A,te)});let H=qt(r,A),X=e.getItemProps(A);return void(H&&x.open(H,I,X.href,X.routerOptions))}if(e.setFocusedKey(A,te),e.isLink(A)&&g==="override")return;I.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&!Nn(I)&&e.replaceSelection(A)}};switch(I.key){case"ArrowDown":if(n.getKeyBelow){var z,$,w;let A=e.focusedKey!=null?(z=n.getKeyBelow)===null||z===void 0?void 0:z.call(n,e.focusedKey):($=n.getFirstKey)===null||$===void 0?void 0:$.call(n);A==null&&s&&(A=(w=n.getFirstKey)===null||w===void 0?void 0:w.call(n,e.focusedKey)),A!=null&&(I.preventDefault(),F(A))}break;case"ArrowUp":if(n.getKeyAbove){var V,E,b;let A=e.focusedKey!=null?(V=n.getKeyAbove)===null||V===void 0?void 0:V.call(n,e.focusedKey):(E=n.getLastKey)===null||E===void 0?void 0:E.call(n);A==null&&s&&(A=(b=n.getLastKey)===null||b===void 0?void 0:b.call(n,e.focusedKey)),A!=null&&(I.preventDefault(),F(A))}break;case"ArrowLeft":if(n.getKeyLeftOf){var T,ne,le;let A=e.focusedKey!=null?(T=n.getKeyLeftOf)===null||T===void 0?void 0:T.call(n,e.focusedKey):null;A==null&&s&&(A=v==="rtl"?(ne=n.getFirstKey)===null||ne===void 0?void 0:ne.call(n,e.focusedKey):(le=n.getLastKey)===null||le===void 0?void 0:le.call(n,e.focusedKey)),A!=null&&(I.preventDefault(),F(A,v==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var Q,J,re;let A=e.focusedKey!=null?(Q=n.getKeyRightOf)===null||Q===void 0?void 0:Q.call(n,e.focusedKey):null;A==null&&s&&(A=v==="rtl"?(J=n.getLastKey)===null||J===void 0?void 0:J.call(n,e.focusedKey):(re=n.getFirstKey)===null||re===void 0?void 0:re.call(n,e.focusedKey)),A!=null&&(I.preventDefault(),F(A,v==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&I.shiftKey)return;I.preventDefault();let A=n.getFirstKey(e.focusedKey,nt(I));e.setFocusedKey(A),A!=null&&(nt(I)&&I.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&I.shiftKey)return;I.preventDefault();let A=n.getLastKey(e.focusedKey,nt(I));e.setFocusedKey(A),A!=null&&(nt(I)&&I.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(A):d&&e.replaceSelection(A))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let A=n.getKeyPageBelow(e.focusedKey);A!=null&&(I.preventDefault(),F(A))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let A=n.getKeyPageAbove(e.focusedKey);A!=null&&(I.preventDefault(),F(A))}break;case"a":nt(I)&&e.selectionMode==="multiple"&&c!==!0&&(I.preventDefault(),e.selectAll());break;case"Escape":a!=="clearSelection"||l||e.selectedKeys.size===0||(I.stopPropagation(),I.preventDefault(),e.clearSelection());break;case"Tab":if(!p){if(I.shiftKey)r.current.focus();else{let A,te,H=Tt(r.current,{tabbable:!0});do te=H.lastChild(),te&&(A=te);while(te);A&&!A.contains(document.activeElement)&&pn(A)}break}}},onFocus:I=>{if(e.isFocused)I.currentTarget.contains(I.target)||e.setFocused(!1);else if(I.currentTarget.contains(I.target)){if(e.setFocused(!0),e.focusedKey==null){var K,F;let w=E=>{E!=null&&(e.setFocusedKey(E),d&&!e.isSelected(E)&&e.replaceSelection(E))},V=I.relatedTarget;var z,$;V&&I.currentTarget.compareDocumentPosition(V)&Node.DOCUMENT_POSITION_FOLLOWING?w((z=e.lastSelectedKey)!==null&&z!==void 0?z:(K=n.getLastKey)===null||K===void 0?void 0:K.call(n)):w(($=e.firstSelectedKey)!==null&&$!==void 0?$:(F=n.getFirstKey)===null||F===void 0?void 0:F.call(n))}else!m&&h.current&&(h.current.scrollTop=j.current.top,h.current.scrollLeft=j.current.left);if(e.focusedKey!=null&&h.current){let w=qt(r,e.focusedKey);w instanceof HTMLElement&&(w.contains(document.activeElement)||f||pn(w),Kr()==="keyboard"&&ze(w,{containingElement:r.current}))}}},onBlur:I=>{I.currentTarget.contains(I.relatedTarget)||e.setFocused(!1)},onMouseDown(I){h.current===I.target&&I.preventDefault()}},{typeSelectProps:M}=function(I){let{keyboardDelegate:K,selectionManager:F,onTypeSelect:z}=I,$=y.useRef({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:K.getKeyForSearch?w=>{let V=(E=w.key).length!==1&&/^[A-Z]/i.test(E)?"":E;var E;if(V&&!w.ctrlKey&&!w.metaKey&&w.currentTarget.contains(w.target)&&($.search.length!==0||V!==" ")){if(V===" "&&$.search.trim().length>0&&(w.preventDefault(),"continuePropagation"in w||w.stopPropagation()),$.search+=V,K.getKeyForSearch!=null){let b=K.getKeyForSearch($.search,F.focusedKey);b==null&&(b=K.getKeyForSearch($.search)),b!=null&&(F.setFocusedKey(b),z&&z(b))}clearTimeout($.timeout),$.timeout=setTimeout(()=>{$.search=""},1e3)}}:void 0}}}({keyboardDelegate:n,selectionManager:e});u||(L=Oe(M,L)),f||(_=e.focusedKey==null?0:-1);let B=function(I){let K=ut();return Ki.set(I,K),K}(e.collection);return{collectionProps:Oe(L,{tabIndex:_,"data-collection":B})}}function jc(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:s,shouldUseVirtualFocus:l,focus:c,isDisabled:a,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:f="action"}=t,p=Pr();e=ut(e);let m=w=>{if(w.pointerType==="keyboard"&&Nn(w))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(f==="selection"&&i.current){let V=n.getItemProps(r);return p.open(i.current,w,V.href,V.routerOptions),void n.setSelectedKeys(n.selectedKeys)}if(f==="override"||f==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):w&&w.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||w&&(nt(w)||w.pointerType==="touch"||w.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};y.useEffect(()=>{r===n.focusedKey&&n.isFocused&&(l?Ti(i.current):c?c():document.activeElement!==i.current&&i.current&&Pe(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,l]),a=a||n.isDisabled(r);let h={};l||a?a&&(h.onMouseDown=w=>{w.preventDefault()}):h={tabIndex:r===n.focusedKey?0:-1,onFocus(w){w.target===i.current&&n.setFocusedKey(r)}};let g=n.isLink(r)&&f==="override",v=n.isLink(r)&&f!=="selection"&&f!=="none",x=!a&&n.canSelectItem(r)&&!g,j=(d||v)&&!a,S=j&&(n.selectionBehavior==="replace"?!x:!x||n.isEmpty),C=j&&x&&n.selectionBehavior==="replace",k=S||C,D=y.useRef(null),N=k&&x,P=y.useRef(!1),O=y.useRef(!1),_=n.getItemProps(r),L=w=>{d&&d(),v&&i.current&&p.open(i.current,w,_.href,_.routerOptions)},M={ref:i};var B;if(s?(M.onPressStart=w=>{D.current=w.pointerType,P.current=N,w.pointerType!=="keyboard"||k&&!Mi()||m(w)},u?(M.onPressUp=S?void 0:w=>{w.pointerType==="mouse"&&x&&m(w)},M.onPress=S?L:w=>{w.pointerType!=="keyboard"&&w.pointerType!=="mouse"&&x&&m(w)}):M.onPress=w=>{if(S||C&&w.pointerType!=="mouse"){if(w.pointerType==="keyboard"&&!_i())return;L(w)}else w.pointerType!=="keyboard"&&x&&m(w)}):(M.onPressStart=w=>{D.current=w.pointerType,P.current=N,O.current=S,x&&(w.pointerType==="mouse"&&!S||w.pointerType==="keyboard"&&(!j||Mi()))&&m(w)},M.onPress=w=>{(w.pointerType==="touch"||w.pointerType==="pen"||w.pointerType==="virtual"||w.pointerType==="keyboard"&&k&&_i()||w.pointerType==="mouse"&&O.current)&&(k?L(w):x&&m(w))}),h["data-collection"]=(B=n.collection,Ki.get(B)),h["data-key"]=r,M.preventFocusOnPress=l,l&&(M=Oe(M,{onPressStart(w){w.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(w){w.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(r))}})),_)for(let w of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])_[w]&&(M[w]=_r(M[w],_[w]));let{pressProps:I,isPressed:K}=kr(M),F=C?w=>{D.current==="mouse"&&(w.stopPropagation(),w.preventDefault(),L(w))}:void 0,{longPressProps:z}=function(w){let{isDisabled:V,onLongPressStart:E,onLongPressEnd:b,onLongPress:T,threshold:ne=pc,accessibilityDescription:le}=w;const Q=y.useRef(void 0);let{addGlobalListener:J,removeGlobalListener:re}=hl(),{pressProps:A}=kr({isDisabled:V,onPressStart(H){if(H.continuePropagation(),(H.pointerType==="mouse"||H.pointerType==="touch")&&(E&&E({...H,type:"longpressstart"}),Q.current=setTimeout(()=>{H.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Cr(H.target).activeElement!==H.target&&pn(H.target),T&&T({...H,type:"longpress"}),Q.current=void 0},ne),H.pointerType==="touch")){let X=ce=>{ce.preventDefault()};J(H.target,"contextmenu",X,{once:!0}),J(window,"pointerup",()=>{setTimeout(()=>{re(H.target,"contextmenu",X)},30)},{once:!0})}},onPressEnd(H){Q.current&&clearTimeout(Q.current),!b||H.pointerType!=="mouse"&&H.pointerType!=="touch"||b({...H,type:"longpressend"})}}),te=Ir(T&&!V?le:void 0);return{longPressProps:Oe(A,te)}}({isDisabled:!N,onLongPress(w){w.pointerType==="touch"&&(m(w),n.setSelectionBehavior("toggle"))}}),$=f!=="none"&&n.isLink(r)?w=>{ml.isOpening||w.preventDefault()}:void 0;return{itemProps:Oe(h,x||S||l&&!a?I:{},N?z:{},{onDoubleClick:F,onDragStartCapture:w=>{D.current==="touch"&&P.current&&w.preventDefault()},onClick:$,id:e},l?{onMouseDown:w=>w.preventDefault()}:void 0),isPressed:K,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:a,allowsSelection:x,hasAction:k}}function _i(){let t=window.event;return(t==null?void 0:t.key)==="Enter"}function Mi(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}class Ai{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?qt(this.ref,e):null;if(!r)return null;let i=n.getBoundingClientRect(),s=r.getBoundingClientRect();return{x:s.left-i.left+n.scrollLeft,y:s.top-i.top+n.scrollTop,width:s.width,height:s.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e==null?void 0:e.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e==null?void 0:e.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,s;return{x:(n=e==null?void 0:e.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e==null?void 0:e.scrollTop)!==null&&r!==void 0?r:0,width:(i=e==null?void 0:e.offsetWidth)!==null&&i!==void 0?i:0,height:(s=e==null?void 0:e.offsetHeight)!==null&&s!==void 0?s:0}}constructor(e){this.ref=e}}class Ri{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if((i==null?void 0:i.type)==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,s=this.layoutDelegate.getItemRect(i);if(!s||i==null)return null;let l=s;do{if(i=n(i),i==null)break;s=this.layoutDelegate.getItemRect(i)}while(s&&r(l,s)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Mr(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let s=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Mr(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.x<s&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,r.y-r.height+this.layoutDelegate.getVisibleRect().height);for(;r&&r.y<s&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getLastKey()}getKeyForSearch(e,n){if(!this.collator)return null;let r=this.collection,i=n||this.getFirstKey();for(;i!=null;){let s=r.getItem(i);if(!s)return null;let l=s.textValue.slice(0,e.length);if(s.textValue&&this.collator.compare(l,e)===0)return i;i=this.getNextKey(i)}return null}constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new Ai(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Ai(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}class Sc{build(e,n){return this.context=n,Fi(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(R.isValidElement(n)&&n.type===R.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let s of r)yield*this.getFullNode({value:s,index:i},{renderer:n}),i++}else{let i=[];R.Children.forEach(n,l=>{l&&i.push(l)});let s=0;for(let l of i){let c=this.getFullNode({element:l,index:s},{});for(let a of c)s++,yield a}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let s=n.value;if(s!=null){var l;let c=(l=s.key)!==null&&l!==void 0?l:s.id;if(c==null)throw new Error("No key found for item");return c}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(R.isValidElement(e.element)&&e.element.type===R.Fragment){let v=[];var s;R.Children.forEach(e.element.props.children,j=>{v.push(j)});let x=(s=e.index)!==null&&s!==void 0?s:0;for(const j of v)yield*this.getFullNode({element:j,index:x++},n,r,i);return}let l=e.element;if(!l&&e.value&&n&&n.renderer){let v=this.cache.get(e.value);if(v&&(!v.shouldInvalidate||!v.shouldInvalidate(this.context)))return v.index=e.index,v.parentKey=i?i.key:null,void(yield v);l=n.renderer(e.value)}if(R.isValidElement(l)){let v=l.type;if(typeof v!="function"&&typeof v.getCollectionNode!="function"){let C=l.type;throw new Error(`Unknown element <${C}> in collection.`)}let x=v.getCollectionNode(l.props,this.context);var c;let j=(c=e.index)!==null&&c!==void 0?c:0,S=x.next();for(;!S.done&&S.value;){let C=S.value;var a;e.index=j;let k=(a=C.key)!==null&&a!==void 0?a:null;k==null&&(k=C.element?null:this.getKey(l,e,n,r));let D=[...this.getFullNode({...C,key:k,index:j,wrapper:kc(e.wrapper,C.wrapper)},this.getChildState(n,C),r?`${r}${l.key}`:l.key,i)];for(let N of D){var d,u,f;if(N.value=(u=(d=C.value)!==null&&d!==void 0?d:e.value)!==null&&u!==void 0?u:null,N.value&&this.cache.set(N.value,N),e.type&&N.type!==e.type)throw new Error(`Unsupported type <${Dn(N.type)}> in <${Dn((f=i==null?void 0:i.type)!==null&&f!==void 0?f:"unknown parent type")}>. Only <${Dn(e.type)}> is supported.`);j++,yield N}S=x.next(D)}return}if(e.key==null||e.type==null)return;let p=this;var m,h;let g={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(m=e.value)!==null&&m!==void 0?m:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(h=e.textValue)!==null&&h!==void 0?h:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Fi(function*(){if(!e.hasChildNodes||!e.childNodes)return;let v=0;for(let x of e.childNodes()){x.key!=null&&(x.key=`${g.key}${x.key}`);let j=p.getFullNode({...x,index:v},p.getChildState(n,x),g.key,g);for(let S of j)v++,yield S}})};yield g}constructor(){this.cache=new WeakMap}}function Fi(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function kc(t,e){return t&&e?n=>t(e(n)):t||e||void 0}function Dn(t){return t[0].toUpperCase()+t.slice(1)}function Cc(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ic(t){return function(e){for(let n of e)return n}(t)}function On(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Li(t,e),e],i=[...Li(t,n),n],s=r.slice(0,i.length).findIndex((l,c)=>l!==i[c]);return s!==-1?(e=r[s],n=i[s],e.index-n.index):r.findIndex(l=>l===n)>=0?1:(i.findIndex(l=>l===e),-1)}function Li(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}const En=new WeakMap;function Tn(t,e){var n;let{id:r}=(n=En.get(t))!==null&&n!==void 0?n:{};if(!r)throw new Error("Unknown list");return`${r}-${function(i){return typeof i=="string"?i.replace(/\s*/g,""):""+i}(e)}`}var Wt;function zi(t,e){let n=new Set;if(t==="all"||e==="all")return n;for(let r of t.keys())e.has(r)||n.add(r);return n}function Nc(t,e,n){let{isVirtualized:r,keyboardDelegate:i,layoutDelegate:s,onAction:l,disallowTypeAhead:c,linkBehavior:a="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:f}=t;t["aria-label"]||t["aria-labelledby"]||console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:p}=function(j){let{selectionManager:S,collection:C,disabledKeys:k,ref:D,keyboardDelegate:N,layoutDelegate:P}=j,O=Ar({usage:"search",sensitivity:"base"}),_=S.disabledBehavior,L=y.useMemo(()=>N||new Ri({collection:C,disabledKeys:k,disabledBehavior:_,ref:D,collator:O,layoutDelegate:P}),[N,P,C,k,D,O,_]),{collectionProps:M}=wc({...j,ref:D,selectionManager:S,keyboardDelegate:L});return{listProps:M}}({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:n,keyboardDelegate:i,layoutDelegate:s,isVirtualized:r,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:a,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:u}),m=ut(t.id);En.set(e,{id:m,onAction:l,linkBehavior:a,keyboardNavigationBehavior:d,shouldSelectOnPressUp:f});let h=function(j){let S=Kt((C=Wt)&&C.__esModule?C.default:C,"@react-aria/grid");var C;let k=xl(),D=(k==="pointer"||k==="virtual"||k==null)&&typeof window<"u"&&"ontouchstart"in window,N=y.useMemo(()=>{let P,O=j.selectionManager.selectionMode,_=j.selectionManager.selectionBehavior;return D&&(P=S.format("longPressToSelect")),_==="replace"&&O!=="none"&&j.hasItemActions?P:void 0},[j.selectionManager.selectionMode,j.selectionManager.selectionBehavior,j.hasItemActions,S,D]);return Ir(N)}({selectionManager:e.selectionManager,hasItemActions:!!l}),g=function(j,S){let C=S==null?void 0:S.isDisabled,[k,D]=y.useState(!1);return dt(()=>{if(j!=null&&j.current&&!C){let N=()=>{if(j.current){let O=Tt(j.current,{tabbable:!0});D(!!O.nextNode())}};N();let P=new MutationObserver(N);return P.observe(j.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{P.disconnect()}}}),!C&&k}(n,{isDisabled:e.collection.size!==0}),v=_t(t,{labelable:!0}),x=Oe(v,{role:"grid",id:m,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:g?-1:0}:p,h);return r&&(x["aria-rowcount"]=e.collection.size,x["aria-colcount"]=1),function(j,S){let{getRowText:C=_=>{var L,M,B,I;return(I=(L=(M=S.collection).getTextValue)===null||L===void 0?void 0:L.call(M,_))!==null&&I!==void 0?I:(B=S.collection.getItem(_))===null||B===void 0?void 0:B.textValue}}=j,k=Kt((D=Wt)&&D.__esModule?D.default:D,"@react-aria/grid");var D;let N=S.selectionManager.rawSelection,P=y.useRef(N),O=Et(()=>{var _;if(!S.selectionManager.isFocused||N===P.current)return void(P.current=N);let L=zi(N,P.current),M=zi(P.current,N),B=S.selectionManager.selectionBehavior==="replace",I=[];if(S.selectionManager.selectedKeys.size===1&&B){let K=S.selectionManager.selectedKeys.keys().next().value;if(K!=null&&S.collection.getItem(K)){let F=C(K);F&&I.push(k.format("selectedItem",{item:F}))}}else if(L.size===1&&M.size===0){let K=L.keys().next().value;if(K!=null){let F=C(K);F&&I.push(k.format("selectedItem",{item:F}))}}else if(M.size===1&&L.size===0){let K=M.keys().next().value;if(K!=null&&S.collection.getItem(K)){let F=C(K);F&&I.push(k.format("deselectedItem",{item:F}))}}S.selectionManager.selectionMode==="multiple"&&(I.length===0||N==="all"||N.size>1||P.current==="all"||((_=P.current)===null||_===void 0?void 0:_.size)>1)&&I.push(N==="all"?k.format("selectedAll"):k.format("selectedCount",{count:N.size})),I.length>0&&vl(I.join(" ")),P.current=N});yl(()=>{if(!S.selectionManager.isFocused){let _=requestAnimationFrame(O);return()=>cancelAnimationFrame(_)}O()},[N,S.selectionManager.isFocused])}({},e),{gridProps:x}}Wt={"ar-AE":{deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`},"bg-BG":{deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`},"cs-CZ":{deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`},"da-DK":{deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`},"de-DE":{deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`},"el-GR":{deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`},"en-US":{deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."},"es-ES":{deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`},"et-EE":{deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`},"fi-FI":{deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`},"fr-FR":{deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`},"he-IL":{deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`},"hr-HR":{deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`},"hu-HU":{deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`},"it-IT":{deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`},"ja-JP":{deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`},"ko-KR":{deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`},"lt-LT":{deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`},"lv-LV":{deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`},"nb-NO":{deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`},"nl-NL":{deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`},"pl-PL":{deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`},"pt-BR":{deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`},"pt-PT":{deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`},"ro-RO":{deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`},"ru-RU":{deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`},"sk-SK":{deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`},"sl-SI":{deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`},"sr-SP":{deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`},"sv-SE":{deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`},"tr-TR":{deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`},"uk-UA":{deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`},"zh-CN":{deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`},"zh-TW":{deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`}};const Dc={ltr:"ArrowRight",rtl:"ArrowLeft"},Oc={ltr:"ArrowLeft",rtl:"ArrowRight"};function $i(t){let e=null,n=null;do n=t.lastChild(),n&&(e=n);while(n);return e}function Ec(t,e){let{key:n}=t;const{checkboxProps:r}=function(i,s){let{key:l}=i,c=s.selectionManager,a=ut(),d=!s.selectionManager.canSelectItem(l),u=s.selectionManager.isSelected(l);var f;return{checkboxProps:{id:a,"aria-label":Kt((f=Wt)&&f.__esModule?f.default:f,"@react-aria/grid").format("select"),isSelected:u,isDisabled:d,onChange:()=>c.toggleSelection(l)}}}(t,e);return{checkboxProps:{...r,"aria-labelledby":`${r.id} ${Tn(e,n)}`}}}var Vi;function Bi(t,e,n){let{node:r}=t,i=function(d,u,f){var p,m;let{node:h,isVirtualized:g}=d,{direction:v}=gn(),{onAction:x,linkBehavior:j,keyboardNavigationBehavior:S,shouldSelectOnPressUp:C}=En.get(u),k=bl(),D=y.useRef(null),N={},P=d.hasChildItems,O=u.selectionManager.isLink(h.key);if(h!=null&&"expandedKeys"in u){var _,L;let w=(_=(L=u.collection).getChildren)===null||_===void 0?void 0:_.call(L,h.key);P=P||[...w??[]].length>1,x==null&&!O&&u.selectionManager.selectionMode==="none"&&P&&(x=()=>u.toggleKey(h.key));let V=P?u.expandedKeys.has(h.key):void 0,E=1;if(h.level>0&&(h==null?void 0:h.parentKey)!=null){let b=u.collection.getItem(h.parentKey);var M,B;b&&(E=[...(M=(B=u.collection).getChildren)===null||M===void 0?void 0:M.call(B,b.key)].filter(T=>T.type==="item").length)}else E=[...u.collection].filter(b=>b.level===0&&b.type==="item").length;N={"aria-expanded":V,"aria-level":h.level+1,"aria-posinset":(h==null?void 0:h.index)+1,"aria-setsize":E}}let{itemProps:I,...K}=jc({selectionManager:u.selectionManager,key:h.key,ref:f,isVirtualized:g,shouldSelectOnPressUp:d.shouldSelectOnPressUp||C,onAction:x||!((p=h.props)===null||p===void 0)&&p.onAction?_r((m=h.props)===null||m===void 0?void 0:m.onAction,x?()=>x(h.key):void 0):void 0,focus:()=>{var w;f.current===null||(D.current==null||h.key===D.current)&&(!((w=f.current)===null||w===void 0)&&w.contains(document.activeElement))||Pe(f.current)},linkBehavior:j}),F=wl(h.props),z=K.hasAction?F:{},$=Oe(I,z,{role:"row",onKeyDownCapture:w=>{if(!w.currentTarget.contains(w.target)||!f.current||!document.activeElement)return;let V=Tt(f.current);if(V.currentNode=document.activeElement,"expandedKeys"in u&&document.activeElement===f.current&&(w.key===Dc[v]&&u.selectionManager.focusedKey===h.key&&P&&!u.expandedKeys.has(h.key)||w.key===Oc[v]&&u.selectionManager.focusedKey===h.key&&P&&u.expandedKeys.has(h.key)))return u.toggleKey(h.key),void w.stopPropagation();switch(w.key){case"ArrowLeft":if(S==="arrow"){let b=v==="rtl"?V.nextNode():V.previousNode();if(b)w.preventDefault(),w.stopPropagation(),Pe(b),ze(b,{containingElement:Ve(f.current)});else if(w.preventDefault(),w.stopPropagation(),v==="rtl")Pe(f.current),ze(f.current,{containingElement:Ve(f.current)});else{V.currentNode=f.current;let T=$i(V);T&&(Pe(T),ze(T,{containingElement:Ve(f.current)}))}}break;case"ArrowRight":if(S==="arrow"){let b=v==="rtl"?V.previousNode():V.nextNode();if(b)w.preventDefault(),w.stopPropagation(),Pe(b),ze(b,{containingElement:Ve(f.current)});else if(w.preventDefault(),w.stopPropagation(),v==="ltr")Pe(f.current),ze(f.current,{containingElement:Ve(f.current)});else{V.currentNode=f.current;let T=$i(V);T&&(Pe(T),ze(T,{containingElement:Ve(f.current)}))}}break;case"ArrowUp":case"ArrowDown":var E;!w.altKey&&f.current.contains(w.target)&&(w.stopPropagation(),w.preventDefault(),(E=f.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(w.nativeEvent.type,w.nativeEvent)))}},onKeyDown:w=>{if(w.currentTarget.contains(w.target)&&f.current&&document.activeElement&&w.key==="Tab"&&S==="tab"){let V=Tt(f.current,{tabbable:!0});V.currentNode=document.activeElement,(w.shiftKey?V.previousNode():V.nextNode())&&w.stopPropagation()}},onFocus:w=>{D.current=h.key,w.target===f.current||jl()||u.selectionManager.setFocusedKey(h.key)},"aria-label":h.textValue||void 0,"aria-selected":u.selectionManager.canSelectItem(h.key)?u.selectionManager.isSelected(h.key):void 0,"aria-disabled":u.selectionManager.isDisabled(h.key)||void 0,"aria-labelledby":k&&h.textValue?`${Tn(u,h.key)} ${k}`:void 0,id:Tn(u,h.key)});return g&&($["aria-rowindex"]=h.index+1),{rowProps:{...Oe($,N)},gridCellProps:{role:"gridcell","aria-colindex":1},descriptionProps:{id:k},...K}}(t,e,n),s=i.rowProps["aria-expanded"]===!0,l=Kt((c=Vi)&&c.__esModule?c.default:c,"@react-aria/tree");var c;let a={onPress:()=>{i.isDisabled||(e.toggleKey(r.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(r.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...Sl({"aria-label":s?l.format("collapse"):l.format("expand"),"aria-labelledby":i.rowProps.id})};return{...i,expandButtonProps:a}}Vi={"ar-AE":{collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"},"bg-BG":{collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"},"cs-CZ":{collapse:"Sbalit",expand:"Rozt\xE1hnout"},"da-DK":{collapse:"Skjul",expand:"Udvid"},"de-DE":{collapse:"Reduzieren",expand:"Erweitern"},"el-GR":{collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"},"en-US":{expand:"Expand",collapse:"Collapse"},"es-ES":{collapse:"Contraer",expand:"Ampliar"},"et-EE":{collapse:"Ahenda",expand:"Laienda"},"fi-FI":{collapse:"Pienenn\xE4",expand:"Laajenna"},"fr-FR":{collapse:"R\xE9duire",expand:"D\xE9velopper"},"he-IL":{collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"},"hr-HR":{collapse:"Sa\u017Emi",expand:"Pro\u0161iri"},"hu-HU":{collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"},"it-IT":{collapse:"Comprimi",expand:"Espandi"},"ja-JP":{collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"},"ko-KR":{collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"},"lt-LT":{collapse:"Sutraukti",expand:"I\u0161skleisti"},"lv-LV":{collapse:"Sak\u013Caut",expand:"Izv\u0113rst"},"nb-NO":{collapse:"Skjul",expand:"Utvid"},"nl-NL":{collapse:"Samenvouwen",expand:"Uitvouwen"},"pl-PL":{collapse:"Zwi\u0144",expand:"Rozwi\u0144"},"pt-BR":{collapse:"Recolher",expand:"Expandir"},"pt-PT":{collapse:"Colapsar",expand:"Expandir"},"ro-RO":{collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"},"ru-RU":{collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"},"sk-SK":{collapse:"Zbali\u0165",expand:"Rozbali\u0165"},"sl-SI":{collapse:"Strni",expand:"Raz\u0161iri"},"sr-SP":{collapse:" Skupi",expand:"Pro\u0161iri"},"sv-SE":{collapse:"D\xF6lj",expand:"Expandera"},"tr-TR":{collapse:"Daralt",expand:"Geni\u015Flet"},"uk-UA":{collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"},"zh-CN":{collapse:"\u6298\u53E0",expand:"\u6269\u5C55"},"zh-TW":{collapse:"\u6536\u5408",expand:"\u5C55\u958B"}};class Te extends Set{constructor(e,n,r){super(e),e instanceof Te?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function Hi(t,e){return t?t==="all"?"all":new Te(t):e}class Sr{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n!=null&&(this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n))}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&On(this.collection,i,e)<0)&&(e=i)}var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&On(this.collection,i,e)>0)&&(e=i)}var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single")return void this.replaceSelection(e);let n,r=this.getKey(e);if(r!=null){if(this.state.selectedKeys==="all")n=new Te([r],r,r);else{let l=this.state.selectedKeys;var i;let c=(i=l.anchorKey)!==null&&i!==void 0?i:r;var s;n=new Te(l,c,r);for(let a of this.getKeyRange(c,(s=l.currentKey)!==null&&s!==void 0?s:r))n.delete(a);for(let a of this.getKeyRange(r,c))this.canSelectItem(a)&&n.add(a)}this.state.setSelectedKeys(n)}}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?On(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],s=e;for(;s!=null;){let l=this.collection.getItem(s);if(l&&(l.type==="item"||l.type==="cell"&&this.allowsCellSelection)&&i.push(s),s===n)return i;s=this.collection.getKeyAfter(s)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return n&&n.type==="item"?n.key:null}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e))return void this.replaceSelection(e);let n=this.getKey(e);if(n==null)return;let r=new Te(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),this.disallowEmptySelection&&r.size===0||this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Te([n],n,n):new Te;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Te;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let l=this.collection.getItem(r);var s;(l==null?void 0:l.type)==="item"&&e.push(r),l!=null&&l.hasChildNodes&&(this.allowsCellSelection||l.type!=="item")&&n((s=(i=Ic(Cc(l,this.collection)))===null||i===void 0?void 0:i.key)!==null&&s!==void 0?s:null)}r=this.collection.getKeyAfter(r)}};return n(this.collection.getFirstKey()),e}selectAll(){this.isSelectAll||this.selectionMode!=="multiple"||this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Te)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new Sr(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,r){var i;this.collection=e,this.state=n,this.allowsCellSelection=(i=r==null?void 0:r.allowsCellSelection)!==null&&i!==void 0&&i,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null}}class Tc{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}constructor(e,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,n=n||new Set;let r=c=>{if(this.keyMap.set(c.key,c),c.childNodes&&(c.type==="section"||n.has(c.key)))for(let a of c.childNodes)r(a)};for(let c of e)r(c);let i=null,s=0;for(let[c,a]of this.keyMap)i?(i.nextKey=c,a.prevKey=i.key):(this.firstKey=c,a.prevKey=void 0),a.type==="item"&&(a.index=s++),i=a,i.nextKey=void 0;var l;this.lastKey=(l=i==null?void 0:i.key)!==null&&l!==void 0?l:null}}function Pc(t){let{onExpandedChange:e}=t,[n,r]=mn(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),i=function(c){let{selectionMode:a="none",disallowEmptySelection:d=!1,allowDuplicateSelectionEvents:u,selectionBehavior:f="toggle",disabledBehavior:p="all"}=c,m=y.useRef(!1),[,h]=y.useState(!1),g=y.useRef(null),v=y.useRef(null),[,x]=y.useState(null),j=y.useMemo(()=>Hi(c.selectedKeys),[c.selectedKeys]),S=y.useMemo(()=>Hi(c.defaultSelectedKeys,new Te),[c.defaultSelectedKeys]),[C,k]=mn(j,S,c.onSelectionChange),D=y.useMemo(()=>c.disabledKeys?new Set(c.disabledKeys):new Set,[c.disabledKeys]),[N,P]=y.useState(f);f==="replace"&&N==="toggle"&&typeof C=="object"&&C.size===0&&P("replace");let O=y.useRef(f);return y.useEffect(()=>{f!==O.current&&(P(f),O.current=f)},[f]),{selectionMode:a,disallowEmptySelection:d,selectionBehavior:N,setSelectionBehavior:P,get isFocused(){return m.current},setFocused(_){m.current=_,h(_)},get focusedKey(){return g.current},get childFocusStrategy(){return v.current},setFocusedKey(_,L="first"){g.current=_,v.current=L,x(_)},selectedKeys:C,setSelectedKeys(_){!u&&function(L,M){if(L.size!==M.size)return!1;for(let B of L)if(!M.has(B))return!1;return!0}(_,C)||k(_)},disabledKeys:D,disabledBehavior:p}}(t),s=y.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),l=function(c,a,d){let u=y.useMemo(()=>new Sc,[]),{children:f,items:p,collection:m}=c;return y.useMemo(()=>{if(m)return m;let h=u.build({children:f,items:p},d);return a(h)},[u,f,p,m,d,a])}(t,y.useCallback(c=>new Tc(c,{expandedKeys:n}),[n]),null);return y.useEffect(()=>{i.focusedKey==null||l.getItem(i.focusedKey)||i.setFocusedKey(null)},[l,i.focusedKey]),{collection:l,expandedKeys:n,disabledKeys:s,toggleKey:c=>{r(function(a,d){let u=new Set(a);return u.has(d)?u.delete(d):u.add(d),u}(n,c))},setExpandedKeys:r,selectionManager:new Sr(l,i)}}const Ui={CollectionRoot:({collection:t,renderDropIndicator:e})=>qi(t,null,e),CollectionBranch:({collection:t,parent:e,renderDropIndicator:n})=>qi(t,e,n)};function qi(t,e,n){return Cn({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){let i=r.render(r);return n&&r.type==="item"?R.createElement(R.Fragment,null,n({type:"item",key:r.key,dropPosition:"before"}),i,function(s,l,c){let a=l.key,d=s.getKeyAfter(a),u=d!=null?s.getItem(d):null;for(;u!=null&&u.type!=="item";)d=s.getKeyAfter(u.key),u=d!=null?s.getItem(d):null;let f=l.nextKey!=null?s.getItem(l.nextKey):null;for(;f!=null&&f.type!=="item";)f=f.nextKey!=null?s.getItem(f.nextKey):null;let p=[];if(f==null){let m=l;for(;m&&(!u||m.parentKey!==u.parentKey&&u.level<m.level);){let h=c({type:"item",key:m.key,dropPosition:"after"});y.isValidElement(h)&&p.push(y.cloneElement(h,{key:`${m.key}-after`})),m=m.parentKey!=null?s.getItem(m.parentKey):null}}return p}(t,r,n)):i}})}const Pn=y.createContext(Ui),Gt=y.createContext({}),Wi=y.createContext(null),Kc=y.forwardRef(function(t,e){let{render:n}=y.useContext(Wi);return R.createElement(R.Fragment,null,n(t,e))});function _c(t,e){var n;let r=t==null?void 0:t.renderDropIndicator,i=t==null||(n=t.isVirtualDragging)===null||n===void 0?void 0:n.call(t),s=y.useCallback(l=>{if(i||e!=null&&e.isDropTarget(l))return r?r(l):R.createElement(Kc,{target:l})},[e==null?void 0:e.target,i,r]);return t!=null&&t.useDropIndicator?s:void 0}function Mc(t,e,n){var r,i;let s=t.focusedKey,l=null;if(!(e==null||(r=e.isVirtualDragging)===null||r===void 0)&&r.call(e)&&(n==null||(i=n.target)===null||i===void 0?void 0:i.type)==="item"&&(l=n.target.key,n.target.dropPosition==="after")){let f=n.collection.getKeyAfter(l),p=null;if(f!=null){var c,a;let m=(a=(c=n.collection.getItem(l))===null||c===void 0?void 0:c.level)!==null&&a!==void 0?a:0;for(;f;){let h=n.collection.getItem(f);if(!h)break;if(h.type==="item"){var d;if(((d=h.level)!==null&&d!==void 0?d:0)<=m)break;p=f,f=n.collection.getKeyAfter(f)}else f=n.collection.getKeyAfter(f)}}var u;l=(u=f??p)!==null&&u!==void 0?u:l}return y.useMemo(()=>new Set([s,l].filter(f=>f!=null)),[s,l])}class Ac{setup(e,n,r){this.delegate=e,this.state=n,this.direction=r}getDropTargetFromPoint(e,n,r){let i=this.delegate.getDropTargetFromPoint(e,n,r);return i&&i.type!=="root"?this.resolveDropTarget(i,e,n,r):i}resolveDropTarget(e,n,r,i){let s=this.pointerTracking,l=r-s.lastY,c=n-s.lastX,a=s.yDirection,d=s.xDirection;if(Math.abs(l)>5&&(a=l>0?"down":"up",s.yDirection=a,s.lastY=r),Math.abs(c)>10&&(d=c>0?"right":"left",s.xDirection=d,s.lastX=n),e.dropPosition==="before"){let p=this.state.collection.getKeyBefore(e.key);if(p!=null){let m={type:"item",key:p,dropPosition:"after"};i(m)&&(e=m)}}let u,f=this.getPotentialTargets(e,i);return f.length===0?{type:"root"}:(f.length>1?u=this.selectTarget(f,e,n,r,a,d):(u=f[0],s.boundaryContext=null),u)}getPotentialTargets(e,n){if(e.dropPosition==="on")return[e];let r=e,i=this.state.collection,s=i.getItem(r.key);for(;s&&(s==null?void 0:s.type)!=="item"&&s.nextKey!=null;)r.key=s.nextKey,s=i.getItem(s.nextKey);let l=[r];if(s&&s.hasChildNodes&&this.state.expandedKeys.has(s.key)&&i.getChildren&&r.dropPosition==="after"){let d=null;for(let u of i.getChildren(s.key))if(u.type==="item"){d=u;break}if(d){const u={type:"item",key:d.key,dropPosition:"before"};return n(u)?[u]:[]}}if((s==null?void 0:s.nextKey)!=null)return[e];let c=s==null?void 0:s.parentKey,a=[];for(;c;){let d=i.getItem(c),u=d!=null&&d.nextKey?i.getItem(d.nextKey):null;if(!u||u.parentKey!==c){let f={type:"item",key:c,dropPosition:"after"};if(n(f)&&a.push(f),u)break}c=d==null?void 0:d.parentKey}if(a.length>0&&l.push(...a),l.length===1){let d=i.getKeyAfter(r.key),u=d?i.getItem(d):null;if(d!=null&&u&&s&&u.level!=null&&s.level!=null&&u.level>s.level){let f={type:"item",key:d,dropPosition:"before"};if(n(f))return[f]}}return l.filter(n)}selectTarget(e,n,r,i,s,l){if(e.length<2)return e[0];let c=this.pointerTracking,a=this.state.collection.getItem(n.key),d=a==null?void 0:a.parentKey;if(!d)return e[0];if(!c.boundaryContext||c.boundaryContext.parentKey!==d){let p=c.yDirection==="up"?e.length-1:0;c.boundaryContext={parentKey:d,preferredTargetIndex:p,lastSwitchY:i,lastSwitchX:r}}let u=c.boundaryContext,f=Math.abs(r-u.lastSwitchX);if(Math.abs(i-u.lastSwitchY)>5&&s){let p=u.preferredTargetIndex||0;s==="down"&&p===0?u.preferredTargetIndex=e.length-1:s==="up"&&p===e.length-1&&(u.preferredTargetIndex=0),c.xDirection=null}if(f>10&&l){let p=u.preferredTargetIndex||0;l==="left"?this.direction==="ltr"?p<e.length-1&&(u.preferredTargetIndex=p+1,u.lastSwitchX=r):p>0&&(u.preferredTargetIndex=p-1,u.lastSwitchX=r):l==="right"&&(this.direction==="ltr"?p>0&&(u.preferredTargetIndex=p-1,u.lastSwitchX=r):p<e.length-1&&(u.preferredTargetIndex=p+1,u.lastSwitchX=r)),c.yDirection=null}return e[Math.max(0,Math.min(u.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}}class Rc{*[Symbol.iterator](){yield*this.flattenedRows}get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}getItem(e){return this.keyMap.get(e)||null}at(e){return this.flattenedRows[e]}getFirstKey(){var e;return(e=this.flattenedRows[0])===null||e===void 0?void 0:e.key}getLastKey(){var e;return(e=this.flattenedRows[this.flattenedRows.length-1])===null||e===void 0?void 0:e.key}getKeyAfter(e){var n;let r=this.flattenedRows.findIndex(i=>i.key===e);return(n=this.flattenedRows[r+1])===null||n===void 0?void 0:n.key}getKeyBefore(e){var n;let r=this.flattenedRows.findIndex(i=>i.key===e);return(n=this.flattenedRows[r-1])===null||n===void 0?void 0:n.key}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),i=(r==null?void 0:r.firstChildKey)!=null?n.get(r.firstChildKey):null;for(;i;)yield i,i=i.nextKey!=null?n.get(i.nextKey):void 0}}}getTextValue(e){let n=this.getItem(e);return n?n.textValue:""}constructor(e){this.keyMap=new Map,this.itemCount=0;let{collection:n,expandedKeys:r}=e,{flattenedRows:i,keyMap:s,itemCount:l}=function(c,a){let{expandedKeys:d=new Set}=a,u=new Map,f=[],p=0,m=h=>{if(h.type==="item"||h.type==="loader"){let g=h==null?void 0:h.parentKey,v={...h};g!=null?([...c.getChildren(g)][0].type!=="item"&&(v.index=(h==null?void 0:h.index)!=null?(h==null?void 0:h.index)-1:0),h.type==="loader"&&(v.level=h.level+1),u.set(v.key,v)):u.set(h.key,h);let x=u.get(h.key)||h;(x.level===0||x.parentKey!=null&&d.has(x.parentKey)&&f.find(j=>j.key===x.parentKey))&&(x.type==="item"&&p++,f.push(x))}else h.type!==null&&u.set(h.key,h);for(let g of c.getChildren(h.key))m(g)};for(let h of c)m(h);return{flattenedRows:f,keyMap:u,itemCount:p}}(n,{expandedKeys:r});this.flattenedRows=i,this.keyMap=s,this.itemCount=l}}const Fc=y.createContext(null),Kn=y.createContext(null),Lc=y.forwardRef(function(t,e){return[t,e]=kl(t,e,Fc),R.createElement(gc,{content:R.createElement(xc,t)},n=>R.createElement(zc,{props:t,collection:n,treeRef:e}))}),Gi={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function zc({props:t,collection:e,treeRef:n}){const{dragAndDropHooks:r}=t;let{direction:i}=gn(),s=Ar({usage:"search",sensitivity:"base"}),l=!!(r!=null&&r.useDraggableCollectionState),c=!!(r!=null&&r.useDroppableCollectionState),a=y.useRef(l),d=y.useRef(c);y.useEffect(()=>{a.current!==l&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[l,c]);let u,f,p,{selectionMode:m="none",expandedKeys:h,defaultExpandedKeys:g,onExpandedChange:v,disabledBehavior:x="all"}=t,{CollectionRoot:j,isVirtualized:S,layoutDelegate:C,dropTargetDelegate:k}=y.useContext(Pn),[D,N]=mn(h?Zi(h):void 0,g?Zi(g):new Set,v),P=y.useMemo(()=>new Rc({collection:e,expandedKeys:D}),[e,D]),O=Pc({...t,selectionMode:m,expandedKeys:D,onExpandedChange:N,collection:P,children:void 0,disabledBehavior:x}),{gridProps:_}=function(T,ne,le){let{gridProps:Q}=Nc(T,ne,le);return Q.role="treegrid",{gridProps:Q}}({...t,isVirtualized:S,layoutDelegate:C},O,n),L=!1,M=null,B=y.useRef(null);if(l&&r){u=r.useDraggableCollectionState({collection:O.collection,selectionManager:O.selectionManager,preview:r.renderDragPreview?B:void 0}),r.useDraggableCollection({},u,n);let T=r.DragPreview;M=r.renderDragPreview?R.createElement(T,{ref:B},r.renderDragPreview):null}let[I]=y.useState(()=>new Ac);if(c&&r){f=r.useDroppableCollectionState({collection:O.collection,selectionManager:O.selectionManager});let T=r.dropTargetDelegate||k||new r.ListDropTargetDelegate(O.collection,n,{direction:i});I.setup(T,O,i);let ne=new Ri({collection:O.collection,collator:s,ref:n,disabledKeys:O.selectionManager.disabledKeys,disabledBehavior:O.selectionManager.disabledBehavior,direction:i,layoutDelegate:C});p=r.useDroppableCollection({keyboardDelegate:ne,dropTargetDelegate:I,onDropActivate:Q=>{if(Q.target.type==="item"){var J;let re=Q.target.key,A=O.collection.getItem(re),te=D!=="all"&&D.has(re);A&&A.hasChildNodes&&(!te||!(r==null||(J=r.isVirtualDragging)===null||J===void 0)&&J.call(r))&&O.toggleKey(re)}},onKeyDown:Q=>{let J=f==null?void 0:f.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let re=O.collection.getItem(J.key);(Q.key===Gi.expand[i]&&(re!=null&&re.hasChildNodes)&&!O.expandedKeys.has(J.key)||Q.key===Gi.collapse[i]&&(re!=null&&re.hasChildNodes)&&O.expandedKeys.has(J.key))&&O.toggleKey(J.key)}}},f,n);let le=f.getDropOperation;f.getDropOperation=Q=>{let{target:J,isInternal:re}=Q;var A;let te=(A=u==null?void 0:u.draggingKeys)!==null&&A!==void 0?A:new Set;if(re&&J.type==="item"&&te.size>0){if(te.has(J.key)&&J.dropPosition==="on")return"cancel";let H=J.key;for(;H!=null;){let X=O.collection.getItem(H),ce=X==null?void 0:X.parentKey;if(ce!=null&&te.has(ce))return"cancel";H=ce??null}}return le(Q)},L=f.isDropTarget({type:"root"})}let K=!(!l||u!=null&&u.isDisabled),{focusProps:F,isFocused:z,isFocusVisible:$}=vn(),w={isEmpty:O.collection.size===0,isFocused:z,isFocusVisible:$,isDropTarget:L,selectionMode:O.selectionManager.selectionMode,allowsDragging:!!K,state:O},V=ht({className:t.className,style:t.style,defaultClassName:"react-aria-Tree",values:w}),E=null;if(O.collection.size===0&&t.renderEmptyState){let{isEmpty:T,...ne}=w,le=t.renderEmptyState({...ne}),Q={"aria-level":1};E=R.createElement("div",{role:"row",style:{display:"contents"},...Q},R.createElement("div",{role:"gridcell",style:{display:"contents"}},le))}let b=_t(t,{global:!0});return R.createElement(R.Fragment,null,R.createElement(Cl,null,R.createElement("div",{...Oe(b,V,_,F,p==null?void 0:p.collectionProps),ref:n,slot:t.slot||void 0,"data-empty":O.collection.size===0||void 0,"data-focused":z||void 0,"data-drop-target":L||void 0,"data-focus-visible":$||void 0,"data-selection-mode":O.selectionManager.selectionMode==="none"?void 0:O.selectionManager.selectionMode,"data-allows-dragging":!!K||void 0},R.createElement(Rr,{values:[[Kn,O],[Gt,{dragAndDropHooks:r,dragState:u,dropState:f}],[Wi,{render:$c}]]},c&&R.createElement(Hc,null),R.createElement(j,{collection:O.collection,persistedKeys:Mc(O.selectionManager,r,f),scrollRef:n,renderDropIndicator:_c(r,f)})),E)),M)}const Yi=Di("content",function(t){let e=y.useContext(Xi),n=ht({children:t.children,values:e});return R.createElement(Pn.Provider,{value:Ui},n.children)}),Xi=y.createContext(null),Qi=yc("item",(t,e,n)=>{var r;let i=y.useContext(Kn);e=yn(e);let{dragAndDropHooks:s,dragState:l,dropState:c}=y.useContext(Gt),{rowProps:a,gridCellProps:d,expandButtonProps:u,descriptionProps:f,...p}=Bi({node:n,shouldSelectOnPressUp:!!l},i,e),m=a["aria-expanded"]===!0,h=t.hasChildItems||((r=[...i.collection.getChildren(n.key)])===null||r===void 0?void 0:r.length)>1,g=a["aria-level"]||1,{hoverProps:v,isHovered:x}=Il({isDisabled:!p.allowsSelection&&!p.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:j,focusProps:S}=vn(),{isFocusVisible:C,focusProps:k}=vn({within:!0}),{checkboxProps:D}=Ec({key:n.key},i),N=null;l&&s&&(N=s.useDraggableItem({key:n.key,hasDragButton:!0},l));let P=null,O=y.useRef(null),_=y.useRef(null),L=y.useRef(null),{visuallyHiddenProps:M}=xn();c&&s&&(P=s.useDropIndicator({target:{type:"item",key:n.key,dropPosition:"on"},activateButtonRef:L},c,_));let B=l&&l.isDragging(n.key),I=P==null?void 0:P.isDropTarget,K=i.selectionManager.selectionMode,F=i.selectionManager.selectionBehavior,z=R.useMemo(()=>({...p,isHovered:x,isFocusVisible:j,isExpanded:m,hasChildItems:h,level:g,selectionMode:K,selectionBehavior:F,isFocusVisibleWithin:C,state:i,id:n.key,allowsDragging:!!l,isDragging:B,isDropTarget:I}),[p,x,j,m,h,g,C,i,n.key,l,B,I,F,K]),$=ht({...t,id:void 0,children:n.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":g},values:z});y.useEffect(()=>{n.textValue},[n.textValue]),y.useEffect(()=>{h&&O.current},[]);let w=y.useRef(null);y.useEffect(()=>{l&&w.current},[]);let V=Cn({items:i.collection.getChildren(n.key),children:T=>{switch(T.type){case"content":return T.render(T);case"loader":case"item":return R.createElement(R.Fragment,null);default:throw new Error("Unsupported element type in TreeRow: "+T.type)}}}),E=ut(),b=_t(t,{global:!0});return delete b.id,delete b.onClick,R.createElement(R.Fragment,null,P&&!P.isHidden&&R.createElement("div",{role:"row","aria-level":a["aria-level"],"aria-expanded":a["aria-expanded"],"aria-label":P.dropIndicatorProps["aria-label"]},R.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},R.createElement("div",{role:"button",...M,...P.dropIndicatorProps,ref:_}),a["aria-expanded"]!=null?R.createElement("div",{role:"button",...M,id:E,"aria-label":u["aria-label"],"aria-labelledby":`${E} ${a.id}`,tabIndex:-1,ref:L}):null)),R.createElement("div",{...Oe(b,a,S,v,k,N==null?void 0:N.dragProps),...$,ref:e,"data-expanded":h&&m||void 0,"data-has-child-items":h||void 0,"data-level":g,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":x||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":j||void 0,"data-pressed":p.isPressed||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-allows-dragging":!!l||void 0,"data-dragging":B||void 0,"data-drop-target":I||void 0},R.createElement("div",{...d,style:{display:"contents"}},R.createElement(Rr,{values:[[Nl,{slots:{selection:D}}],[Dl,{slots:{[Ol]:{},chevron:{...u,ref:O},drag:{...N==null?void 0:N.dragButtonProps,ref:w,style:{pointerEvents:"none"}}}}],[Xi,{...z}]]},V))))});function Zi(t){return t?t==="all"?"all":new Set(t):new Set}function $c(t,e){var n;e=yn(e);let{dragAndDropHooks:r,dropState:i}=y.useContext(Gt),s=y.useRef(null),{dropIndicatorProps:l,isHidden:c,isDropTarget:a}=r.useDropIndicator(t,i,s);if(c)return null;let d=i&&t.target.type==="item"?(((n=i.collection.getItem(t.target.key))===null||n===void 0?void 0:n.level)||0)+1:1;return R.createElement(Bc,{...t,dropIndicatorProps:l,isDropTarget:a,ref:e,buttonRef:s,level:d})}function Vc(t,e){let{dropIndicatorProps:n,isDropTarget:r,buttonRef:i,level:s,...l}=t,{visuallyHiddenProps:c}=xn(),a=ht({...l,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":s},values:{isDropTarget:r}});return R.createElement("div",{...a,role:"row","aria-level":s,ref:e,"data-drop-target":r||void 0},R.createElement("div",{role:"gridcell"},R.createElement("div",{...c,role:"button",...n,ref:i}),a.children))}Di("loader",function(t,e,n){let{isVirtualized:r}=y.useContext(Pn),i=y.useContext(Kn),{isLoading:s,onLoadMore:l,scrollOffset:c,...a}=t,d=y.useRef(null);(function(v,x){let{collection:j,onLoadMore:S,scrollOffset:C=1}=v,k=y.useRef(null),D=Et(N=>{for(let P of N)P.isIntersecting&&S&&S()});dt(()=>(x.current&&(k.current=new IntersectionObserver(D,{root:Ve(x==null?void 0:x.current),rootMargin:`0px ${100*C}% ${100*C}% ${100*C}%`}),k.current.observe(x.current)),()=>{k.current&&k.current.disconnect()}),[j,D,x,C])})(y.useMemo(()=>({onLoadMore:l,collection:i==null?void 0:i.collection,sentinelRef:d,scrollOffset:c}),[l,c,i==null?void 0:i.collection]),d),e=yn(e);let{rowProps:u,gridCellProps:f}=Bi({node:n},i,e),p=u["aria-level"]||1,m={role:"row","aria-level":u["aria-level"]},h=ht({...a,id:void 0,children:n.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:p}}),g={};return r&&(g={display:"contents"}),R.createElement(R.Fragment,null,R.createElement("div",{style:{position:"relative",width:0,height:0},inert:hc(!0)},R.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),s&&h.children&&R.createElement("div",{ref:e,...Oe(_t(t),m),...h,"data-level":p},R.createElement("div",{...f,style:g},h.children)))});const Bc=y.forwardRef(Vc);function Hc(){let{dragAndDropHooks:t,dropState:e}=y.useContext(Gt),n=y.useRef(null),{dropIndicatorProps:r}=t.useDropIndicator({target:{type:"root"}},e,n),i=e.isDropTarget({type:"root"}),{visuallyHiddenProps:s}=xn();return!i&&r["aria-hidden"]?null:R.createElement("div",{role:"row","aria-hidden":r["aria-hidden"],style:{position:"absolute"}},R.createElement("div",{role:"gridcell"},R.createElement("div",{role:"button",...s,...r,ref:n})))}function _n(t,e){return _n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_n(t,e)}function Ji(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}const eo=y.createContext(null);function ke(){const t=y.useContext(eo);if(t===null)throw new Error("No Tree Api Provided");return t}const to=y.createContext(null),no=y.createContext(null),ro=y.createContext(0);function io(){y.useContext(ro)}function Yt(t,e,n){return Math.max(Math.min(t,n),e)}function oo(t){return t&&t.isLeaf}function so(t){return t&&t.isInternal&&!t.isOpen}function lo(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const ao=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},co=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Mn(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Mn(n,e);if(r)return r}return null}function Xt(t,e){if(e(t),t.children)for(let n of t.children)Xt(n,e)}function uo(t){const e=fo(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=Uc(e,r);break}n==null||n.focus()}function ho(t){const e=fo(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=qc(e,r);break}n==null||n.focus()}function Uc(t,e){return e+1<t.length?t[e+1]:t[0]}function qc(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function fo(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 xt(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function po(t){return t===null?null:We(t)}function We(t){return typeof t=="string"?t:t.id}function go(t,...e){if(t)return t(...e)}function mo(t){return new Promise((e,n)=>{let r=0;(function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)})()})}function vo(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 yo(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const Wc=Object.freeze(Object.defineProperty({__proto__:null,access:xt,bound:Yt,dfs:Mn,focusNextElement:uo,focusPrevElement:ho,getInsertIndex:vo,getInsertParentId:yo,identify:We,identifyNull:po,indexOf:co,isClosed:so,isDescendant:ao,isItem:oo,isOpenWithEmptyChildren:lo,mergeRefs:function(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}},noop:function(){},safeRun:go,waitFor:mo,walk:Xt},Symbol.toStringTag,{value:"Module"})),Gc={display:"flex",alignItems:"center",zIndex:1},Yc={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Xc={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Qc=R.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({},Gc),r),children:[o.jsx("div",{style:Object.assign({},Xc)}),o.jsx("div",{style:Object.assign({},Yc)})]})});function Zc({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 Jc(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(td,Object.assign({},t)):o.jsx(ed,Object.assign({},t))]})}function ed(t){return o.jsx(o.Fragment,{children:o.jsx("span",{children:t.node.data.name})})}function td({node:t}){const e=y.useRef();return y.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 An(t){return{type:"EDIT",id:t}}function rt(t){return{type:"FOCUS",id:t}}class fn{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===bt}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 fn(Object.assign({},this))}edit(){return this.tree.edit(this)}}const bt="__REACT_ARBORIST_INTERNAL_ROOT__";function xo(t){var e;function n(s,l,c){const a=t.accessId(s),d=new fn({tree:t,data:s,level:l,parent:c,id:a,children:null,isDraggable:t.isDraggable(s),rowIndex:null}),u=t.accessChildren(s);return u&&(d.children=u.map(f=>n(f,l+1,d))),d}const r=new fn({tree:t,id:bt,data:{id:bt},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 Rn={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 bo(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 it=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}}},nd=t=>({type:"SELECTION_ONLY",id:We(t)}),wo=t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(We)}),jo=t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(We)}),rd=t=>Object.assign({type:"SELECTION_SET"},t),Fn=t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:We(t)}),So=t=>({type:"SELECTION_ANCHOR",id:t===null?null:We(t)}),ot={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})},id={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},od=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},sd=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function ko({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return o.jsxs(ld,{isDragging:i,children:[o.jsx(ad,{offset:t,children:o.jsx(dd,{id:n,dragIds:r})}),o.jsx(cd,{mouse:e,count:r.length})]})}const ld=y.memo(function(t){return t.isDragging?o.jsx("div",{style:id,children:t.children}):null});function ad(t){return o.jsx("div",{className:"row preview",style:od(t.offset),children:t.children})}function cd(t){const{count:e,mouse:n}=t;return e>1?o.jsx("div",{className:"selected-count",style:sd(n),children:e}):null}const dd=y.memo(function(t){const e=ke(),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 Co=Number.isNaN||function(t){return typeof t=="number"&&t!=t};function ud(t,e){return t===e||!(!Co(t)||!Co(e))}function hd(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!ud(t[n],e[n]))return!1;return!0}function Ln(t,e){var n;e===void 0&&(e=hd);var r,i=[],s=!1;return function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s&&n===this&&e(l,i)||(r=t.apply(this,l),s=!0,n=this,i=l),r}}var Io=typeof performance=="object"&&typeof performance.now=="function"?function(){return performance.now()}:function(){return Date.now()};function No(t){cancelAnimationFrame(t.id)}var zn=-1;function Do(t){if(t===void 0&&(t=!1),zn===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),zn=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return zn}var wt=null;function Oo(t){if(t===void 0&&(t=!1),wt===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?wt="positive-descending":(e.scrollLeft=1,wt=e.scrollLeft===0?"negative":"positive-ascending"),document.body.removeChild(e),wt}return wt}var fd=function(t,e){return t};function pd(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,s=t.getOffsetForIndexAndAlignment,l=t.getStartIndexForOffset,c=t.getStopIndexForStartIndex,a=t.initInstanceProps,d=t.shouldResetStyleCacheOnItemSizeChange,u=t.validateProps;return e=function(f){function p(h){var g;return(g=f.call(this,h)||this)._instanceProps=a(g.props,Ji(g)),g._outerRef=void 0,g._resetIsScrollingTimeoutId=null,g.state={instance:Ji(g),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof g.props.initialScrollOffset=="number"?g.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},g._callOnItemsRendered=void 0,g._callOnItemsRendered=Ln(function(v,x,j,S){return g.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:x,visibleStartIndex:j,visibleStopIndex:S})}),g._callOnScroll=void 0,g._callOnScroll=Ln(function(v,x,j){return g.props.onScroll({scrollDirection:v,scrollOffset:x,scrollUpdateWasRequested:j})}),g._getItemStyle=void 0,g._getItemStyle=function(v){var x,j=g.props,S=j.direction,C=j.itemSize,k=j.layout,D=g._getItemStyleCache(d&&C,d&&k,d&&S);if(D.hasOwnProperty(v))x=D[v];else{var N=n(g.props,v,g._instanceProps),P=i(g.props,v,g._instanceProps),O=S==="horizontal"||k==="horizontal",_=S==="rtl",L=O?N:0;D[v]=x={position:"absolute",left:_?void 0:L,right:_?L:void 0,top:O?0:N,height:O?"100%":P,width:O?P:"100%"}}return x},g._getItemStyleCache=void 0,g._getItemStyleCache=Ln(function(v,x,j){return{}}),g._onScrollHorizontal=function(v){var x=v.currentTarget,j=x.clientWidth,S=x.scrollLeft,C=x.scrollWidth;g.setState(function(k){if(k.scrollOffset===S)return null;var D=g.props.direction,N=S;if(D==="rtl")switch(Oo()){case"negative":N=-S;break;case"positive-descending":N=C-j-S}return N=Math.max(0,Math.min(N,C-j)),{isScrolling:!0,scrollDirection:k.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._onScrollVertical=function(v){var x=v.currentTarget,j=x.clientHeight,S=x.scrollHeight,C=x.scrollTop;g.setState(function(k){if(k.scrollOffset===C)return null;var D=Math.max(0,Math.min(C,S-j));return{isScrolling:!0,scrollDirection:k.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._outerRefSetter=function(v){var x=g.props.outerRef;g._outerRef=v,typeof x=="function"?x(v):x!=null&&typeof x=="object"&&x.hasOwnProperty("current")&&(x.current=v)},g._resetIsScrollingDebounced=function(){var v,x,j,S;g._resetIsScrollingTimeoutId!==null&&No(g._resetIsScrollingTimeoutId),g._resetIsScrollingTimeoutId=(v=g._resetIsScrolling,x=150,j=Io(),S={id:requestAnimationFrame(function C(){Io()-j>=x?v.call(null):S.id=requestAnimationFrame(C)})})},g._resetIsScrolling=function(){g._resetIsScrollingTimeoutId=null,g.setState({isScrolling:!1},function(){g._getItemStyleCache(-1,null)})},g}(function(h,g){h.prototype=Object.create(g.prototype),h.prototype.constructor=h,_n(h,g)})(p,f),p.getDerivedStateFromProps=function(h,g){return gd(h,g),u(h),null};var m=p.prototype;return m.scrollTo=function(h){h=Math.max(0,h),this.setState(function(g){return g.scrollOffset===h?null:{scrollDirection:g.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(h,g){g===void 0&&(g="auto");var v=this.props,x=v.itemCount,j=v.layout,S=this.state.scrollOffset;h=Math.max(0,Math.min(h,x-1));var C=0;if(this._outerRef){var k=this._outerRef;C=j==="vertical"?k.scrollWidth>k.clientWidth?Do():0:k.scrollHeight>k.clientHeight?Do():0}this.scrollTo(s(this.props,h,g,S,this._instanceProps,C))},m.componentDidMount=function(){var h=this.props,g=h.direction,v=h.initialScrollOffset,x=h.layout;if(typeof v=="number"&&this._outerRef!=null){var j=this._outerRef;g==="horizontal"||x==="horizontal"?j.scrollLeft=v:j.scrollTop=v}this._callPropsCallbacks()},m.componentDidUpdate=function(){var h=this.props,g=h.direction,v=h.layout,x=this.state,j=x.scrollOffset;if(x.scrollUpdateWasRequested&&this._outerRef!=null){var S=this._outerRef;if(g==="horizontal"||v==="horizontal")if(g==="rtl")switch(Oo()){case"negative":S.scrollLeft=-j;break;case"positive-ascending":S.scrollLeft=j;break;default:var C=S.clientWidth,k=S.scrollWidth;S.scrollLeft=k-C-j}else S.scrollLeft=j;else S.scrollTop=j}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&No(this._resetIsScrollingTimeoutId)},m.render=function(){var h=this.props,g=h.children,v=h.className,x=h.direction,j=h.height,S=h.innerRef,C=h.innerElementType,k=h.innerTagName,D=h.itemCount,N=h.itemData,P=h.itemKey,O=P===void 0?fd:P,_=h.layout,L=h.outerElementType,M=h.outerTagName,B=h.style,I=h.useIsScrolling,K=h.width,F=this.state.isScrolling,z=x==="horizontal"||_==="horizontal",$=z?this._onScrollHorizontal:this._onScrollVertical,w=this._getRangeToRender(),V=w[0],E=w[1],b=[];if(D>0)for(var T=V;T<=E;T++)b.push(y.createElement(g,{data:N,key:O(T,N),index:T,isScrolling:I?F:void 0,style:this._getItemStyle(T)}));var ne=r(this.props,this._instanceProps);return y.createElement(L||M||"div",{className:v,onScroll:$,ref:this._outerRefSetter,style:El({position:"relative",height:j,width:K,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},B)},y.createElement(C||k||"div",{children:b,ref:S,style:{height:z?"100%":ne,pointerEvents:F?"none":void 0,width:z?ne:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"&&this.props.itemCount>0){var h=this._getRangeToRender(),g=h[0],v=h[1],x=h[2],j=h[3];this._callOnItemsRendered(g,v,x,j)}if(typeof this.props.onScroll=="function"){var S=this.state,C=S.scrollDirection,k=S.scrollOffset,D=S.scrollUpdateWasRequested;this._callOnScroll(C,k,D)}},m._getRangeToRender=function(){var h=this.props,g=h.itemCount,v=h.overscanCount,x=this.state,j=x.isScrolling,S=x.scrollDirection,C=x.scrollOffset;if(g===0)return[0,0,0,0];var k=l(this.props,C,this._instanceProps),D=c(this.props,k,C,this._instanceProps),N=j&&S!=="backward"?1:Math.max(1,v),P=j&&S!=="forward"?1:Math.max(1,v);return[Math.max(0,k-N),Math.max(0,Math.min(g-1,D+P)),k,D]},p}(y.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var gd=function(t,e){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,e.instance},md=pd({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 l=t.direction,c=t.height,a=t.itemCount,d=t.itemSize,u=t.layout,f=t.width,p=l==="horizontal"||u==="horizontal"?f:c,m=Math.max(0,a*d-p),h=Math.min(m,e*d),g=Math.max(0,e*d-p+d+s);switch(n==="smart"&&(n=r>=g-p&&r<=h+p?"auto":"center"),n){case"start":return h;case"end":return g;case"center":var v=Math.round(g+(h-g)/2);return v<Math.ceil(p/2)?0:v>m+Math.floor(p/2)?m:v;default:return r>=g&&r<=h?r:r<g?g: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,l=t.itemSize,c=t.layout,a=t.width,d=e*l,u=r==="horizontal"||c==="horizontal"?a:i,f=Math.ceil((u+n-d)/l);return Math.max(0,Math.min(s-1,e+f-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function vd(){var t,e;const n=ke(),r=function(){const a=y.useContext(no);if(a===null)throw new Error("Provide a DnDContext");return a}().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),l=i*r.level,c=n.renderCursor;return o.jsx(c,{top:s,left:l,indent:i})}var yd=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 xd=y.forwardRef(function(t,e){const{children:n}=t,r=yd(t,["children"]),i=ke();return o.jsxs("div",Object.assign({ref:e},r,{onClick:s=>{s.currentTarget===s.target&&i.deselectAll()},children:[o.jsx(bd,{}),n]}))}),bd=()=>{const t=ke();return o.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:o.jsx(vd,{})})};var wd=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 jd=y.forwardRef(function(t,e){var n,r,i,s,{style:l}=t,c=wd(t,["style"]);const a=ke(),d=(r=(n=a.props.padding)!==null&&n!==void 0?n:a.props.paddingTop)!==null&&r!==void 0?r:0,u=(s=(i=a.props.padding)!==null&&i!==void 0?i:a.props.paddingBottom)!==null&&s!==void 0?s:0;return o.jsx("div",Object.assign({ref:e,style:Object.assign(Object.assign({},l),{height:`${parseFloat(l.height)+d+u}px`})},c))});var Ce,Eo=y.createContext({dragDropManager:void 0});function Y(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 l=0;(s=new Error(e.replace(/%s/g,function(){return r[l++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ce||(Ce={}));var $n="dnd-core/INIT_COORDS",Vn="dnd-core/BEGIN_DRAG",To="dnd-core/PUBLISH_DRAG_SOURCE",Qt="dnd-core/HOVER",Bn="dnd-core/DROP",Hn="dnd-core/END_DRAG";function Po(t,e){return{type:$n,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Un(t){return Un=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},Un(t)}function Ko(t){return Un(t)==="object"}var Sd={type:$n,payload:{clientOffset:null,sourceClientOffset:null}};function kd(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,l=n.getSourceClientOffset,c=t.getMonitor(),a=t.getRegistry();t.dispatch(Po(s)),function(m,h,g){Y(!h.isDragging(),"Cannot call beginDrag while dragging."),m.forEach(function(v){Y(g.getSource(v),"Expected sourceIds to be registered.")})}(e,c,a);var d=function(m,h){for(var g=null,v=m.length-1;v>=0;v--)if(h.canDragSource(m[v])){g=m[v];break}return g}(e,c);if(d!==null){var u=null;if(s){if(!l)throw new Error("getSourceClientOffset must be defined");(function(m){Y(typeof m=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(l),u=l(d)}t.dispatch(Po(s,u));var f=a.getSource(d).beginDrag(c,d);if(f!=null){(function(m){Y(Ko(m),"Item must be an object.")})(f),a.pinSource(d);var p=a.getSourceType(d);return{type:Vn,payload:{itemType:p,item:f,sourceId:d,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}else t.dispatch(Sd)}}function Cd(t){return function(){if(t.getMonitor().isDragging())return{type:To}}}function qn(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function Id(t){return function(e){var n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).clientOffset;(function(l){Y(Array.isArray(l),"Expected targetIds to be an array.")})(e);var r=e.slice(0),i=t.getMonitor(),s=t.getRegistry();return function(l,c,a){Y(c.isDragging(),"Cannot call hover while not dragging."),Y(!c.didDrop(),"Cannot call hover after drop.");for(var d=0;d<l.length;d++){var u=l[d];Y(l.lastIndexOf(u)===d,"Expected targetIds to be unique in the passed array."),Y(a.getTarget(u),"Expected targetIds to be registered.")}}(r,i,s),function(l,c,a){for(var d=l.length-1;d>=0;d--){var u=l[d];qn(c.getTargetType(u),a)||l.splice(d,1)}}(r,s,i.getItemType()),function(l,c,a){l.forEach(function(d){a.getTarget(d).hover(c,d)})}(r,i,s),{type:Qt,payload:{targetIds:r,clientOffset:n||null}}}}function _o(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 Mo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(n),!0).forEach(function(r){Nd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Nd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dd(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),r=t.getRegistry();(function(s){Y(s.isDragging(),"Cannot call drop while not dragging."),Y(!s.didDrop(),"Cannot call drop twice during one drag operation.")})(n);var i=function(s){var l=s.getTargetIds().filter(s.canDropOnTarget,s);return l.reverse(),l}(n);i.forEach(function(s,l){var c=function(d,u,f,p){var m=f.getTarget(d),h=m?m.drop(p,d):void 0;return function(g){Y(g===void 0||Ko(g),"Drop result must either be an object or undefined.")}(h),h===void 0&&(h=u===0?{}:p.getDropResult()),h}(s,l,r,n),a={type:Bn,payload:{dropResult:Mo(Mo({},e),c)}};t.dispatch(a)})}}function Od(t){return function(){var e=t.getMonitor(),n=t.getRegistry();(function(i){Y(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:Hn}}}function Ed(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function jt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Td=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),jt(this,"store",void 0),jt(this,"monitor",void 0),jt(this,"backend",void 0),jt(this,"isSetUp",!1),jt(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 Ed(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:kd(i),publishDragSource:Cd(i),hover:Id(i),drop:Dd(i),endDrag:Od(i)}}(this);return Object.keys(r).reduce(function(i,s){var l,c=r[s];return i[s]=(l=c,function(){for(var a=arguments.length,d=new Array(a),u=0;u<a;u++)d[u]=arguments[u];var f=l.apply(e,d);f!==void 0&&n(f)}),i},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}]),t}();function Ie(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 Ao=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ro=function(){return Math.random().toString(36).substring(7).split("").join(".")},Fo={INIT:"@@redux/INIT"+Ro(),REPLACE:"@@redux/REPLACE"+Ro()};function Lo(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ie(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(Ie(1));return n(Lo)(t,e)}if(typeof t!="function")throw new Error(Ie(2));var i=t,s=e,l=[],c=l,a=!1;function d(){c===l&&(c=l.slice())}function u(){if(a)throw new Error(Ie(3));return s}function f(m){if(typeof m!="function")throw new Error(Ie(4));if(a)throw new Error(Ie(5));var h=!0;return d(),c.push(m),function(){if(h){if(a)throw new Error(Ie(6));h=!1,d();var g=c.indexOf(m);c.splice(g,1),l=null}}}function p(m){if(!function(v){if(typeof v!="object"||v===null)return!1;for(var x=v;Object.getPrototypeOf(x)!==null;)x=Object.getPrototypeOf(x);return Object.getPrototypeOf(v)===x}(m))throw new Error(Ie(7));if(m.type===void 0)throw new Error(Ie(8));if(a)throw new Error(Ie(9));try{a=!0,s=i(s,m)}finally{a=!1}for(var h=l=c,g=0;g<h.length;g++)(0,h[g])();return m}return p({type:Fo.INIT}),(r={dispatch:p,subscribe:f,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(Ie(10));i=m,p({type:Fo.REPLACE})}})[Ao]=function(){var m,h=f;return(m={subscribe:function(g){if(typeof g!="object"||g===null)throw new Error(Ie(11));function v(){g.next&&g.next(u())}return v(),{unsubscribe:h(v)}}})[Ao]=function(){return this},m},r}var Pd=function(t,e){return t===e};function zo(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 $o(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zo(Object(n),!0).forEach(function(r){Kd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Kd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vo={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function _d(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vo,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case $n:case Vn:return{initialSourceClientOffset:i.sourceClientOffset,initialClientOffset:i.clientOffset,clientOffset:i.clientOffset};case Qt:return t=n.clientOffset,e=i.clientOffset,!t&&!e||t&&e&&t.x===e.x&&t.y===e.y?n:$o($o({},n),{},{clientOffset:i.clientOffset});case Hn:case Bn:return Vo;default:return n}}var Wn="dnd-core/ADD_SOURCE",Gn="dnd-core/ADD_TARGET",Yn="dnd-core/REMOVE_SOURCE",Zt="dnd-core/REMOVE_TARGET";function Bo(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 Ne(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Bo(Object(n),!0).forEach(function(r){Md(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Md(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ad={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Rd(){var t,e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ad,r=arguments.length>1?arguments[1]:void 0,i=r.payload;switch(r.type){case Vn:return Ne(Ne({},n),{},{itemType:i.itemType,item:i.item,sourceId:i.sourceId,isSourcePublic:i.isSourcePublic,dropResult:null,didDrop:!1});case To:return Ne(Ne({},n),{},{isSourcePublic:!0});case Qt:return Ne(Ne({},n),{},{targetIds:i.targetIds});case Zt:return n.targetIds.indexOf(i.targetId)===-1?n:Ne(Ne({},n),{},{targetIds:(t=n.targetIds,e=i.targetId,t.filter(function(s){return s!==e}))});case Bn:return Ne(Ne({},n),{},{dropResult:i.dropResult,didDrop:!0,targetIds:[]});case Hn:return Ne(Ne({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Fd(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Wn:case Gn:return t+1;case Yn:case Zt:return t-1;default:return t}}var Jt=[],Xn=[];function Ld(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Qt:break;case Wn:case Gn:case Zt:case Yn:return Jt;default:return Xn}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,s=i===void 0?[]:i,l=function(u,f){var p=new Map,m=function(g){p.set(g,p.has(g)?p.get(g)+1:1)};u.forEach(m),f.forEach(m);var h=[];return p.forEach(function(g,v){g===1&&h.push(v)}),h}(r,s),c=l.length>0||!function(u,f){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pd;if(u.length!==f.length)return!1;for(var m=0;m<u.length;++m)if(!p(u[m],f[m]))return!1;return!0}(r,s);if(!c)return Jt;var a=s[s.length-1],d=r[r.length-1];return a!==d&&(a&&l.push(a),d&&l.push(d)),l}function zd(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:0)+1}function Ho(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 Uo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ho(Object(n),!0).forEach(function(r){$d(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ho(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vd(){var t,e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Ld(r.dirtyHandlerIds,{type:i.type,payload:Uo(Uo({},i.payload),{},{prevTargetIds:(t=r,e="dragOperation.targetIds",n=[],e.split(".").reduce(function(s,l){return s&&s[l]?s[l]:n||null},t))})}),dragOffset:_d(r.dragOffset,i),refCount:Fd(r.refCount,i),dragOperation:Rd(r.dragOperation,i),stateId:zd(r.stateId)}}function qo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Bd(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function Wo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Jt.__IS_NONE__=!0,Xn.__IS_ALL__=!0;var Hd=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),Wo(this,"store",void 0),Wo(this,"registry",void 0),this.store=e,this.registry=n}return Bd(t,[{key:"subscribeToStateChange",value:function(e){var n=this,r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0}).handlerIds;Y(typeof e=="function","listener must be a function."),Y(r===void 0||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId;return this.store.subscribe(function(){var s=n.store.getState(),l=s.stateId;try{var c=l===i||l===i+1&&!function(a,d){if(a===Jt)return!1;if(a===Xn||d===void 0)return!0;var u,f=(u=a,d.filter(function(p){return u.indexOf(p)>-1}));return f.length>0}(s.dirtyHandlerIds,r);c||e()}finally{i=l}})}},{key:"subscribeToOffsetChange",value:function(e){var n=this;Y(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 Y(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 Y(n,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&qn(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 Y(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&&!qn(r,i))return!1;var s=this.getTargetIds();if(!s.length)return!1;var l=s.indexOf(e);return n?l===s.length-1:l>-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,l=e.initialSourceClientOffset,i&&s&&l?qo((r=l,{x:(n=i).x+r.x,y:n.y+r.y}),s):null;var e,n,r,i,s,l}},{key:"getDifferenceFromInitialOffset",value:function(){return e=this.store.getState().dragOffset,n=e.clientOffset,r=e.initialClientOffset,n&&r?qo(n,r):null;var e,n,r}}]),t}(),Ud=0;function Qn(t){return Qn=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},Qn(t)}function Zn(t,e){e&&Array.isArray(t)?t.forEach(function(n){return Zn(n,!1)}):Y(typeof t=="string"||Qn(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 Go=typeof global<"u"?global:self,Yo=Go.MutationObserver||Go.WebKitMutationObserver;function Xo(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}const qd=typeof Yo=="function"?function(t){let e=1;const n=new Yo(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}:Xo;class Wd{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 Qo=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=qd(this.flush),this.requestErrorThrow=Xo(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Gd=new class{create(t){const e=this.freeTasks,n=e.length?e.pop():new Wd(this.onError,r=>e[e.length]=r);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}(Qo.registerPendingError);function Yd(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xd(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Zo(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 Zo(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Zo(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 Qd(t){var e=(Ud++).toString();switch(t){case Ce.SOURCE:return"S".concat(e);case Ce.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function Jo(t){switch(t[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:Y(!1,"Cannot parse handler ID: ".concat(t))}}function es(t,e){var n=t.entries(),r=!1;do{var i=n.next(),s=i.done;if(Xd(i.value,2)[1]===e)return!0;r=!!s}while(!r);return!1}var Zd=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),st(this,"types",new Map),st(this,"dragSources",new Map),st(this,"dropTargets",new Map),st(this,"pinnedSourceId",null),st(this,"pinnedSource",null),st(this,"store",void 0),this.store=e}return Yd(t,[{key:"addSource",value:function(e,n){Zn(e),function(i){Y(typeof i.canDrag=="function","Expected canDrag to be a function."),Y(typeof i.beginDrag=="function","Expected beginDrag to be a function."),Y(typeof i.endDrag=="function","Expected endDrag to be a function.")}(n);var r=this.addHandler(Ce.SOURCE,e,n);return this.store.dispatch(function(i){return{type:Wn,payload:{sourceId:i}}}(r)),r}},{key:"addTarget",value:function(e,n){Zn(e,!0),function(i){Y(typeof i.canDrop=="function","Expected canDrop to be a function."),Y(typeof i.hover=="function","Expected hover to be a function."),Y(typeof i.drop=="function","Expected beginDrag to be a function.")}(n);var r=this.addHandler(Ce.TARGET,e,n);return this.store.dispatch(function(i){return{type:Gn,payload:{targetId:i}}}(r)),r}},{key:"containsHandler",value:function(e){return es(this.dragSources,e)||es(this.dropTargets,e)}},{key:"getSource",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Y(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Y(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Y(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Y(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Jo(e)===Ce.SOURCE}},{key:"isTargetId",value:function(e){return Jo(e)===Ce.TARGET}},{key:"removeSource",value:function(e){var n,r=this;Y(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(i){return{type:Yn,payload:{sourceId:i}}}(e)),n=function(){r.dragSources.delete(e),r.types.delete(e)},Qo.enqueueTask(Gd.create(n))}},{key:"removeTarget",value:function(e){Y(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(n){return{type:Zt,payload:{targetId:n}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var n=this.getSource(e);Y(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}},{key:"unpinSource",value:function(){Y(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,n,r){var i=Qd(e);return this.types.set(i,n),e===Ce.SOURCE?this.dragSources.set(i,r):e===Ce.TARGET&&this.dropTargets.set(i,r),i}}]),t}();function Jd(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(c){var a=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Lo(Vd,c&&a&&a({name:"dnd-core",instanceId:"dnd-core"}))}(arguments.length>3&&arguments[3]!==void 0&&arguments[3]),i=new Hd(r,new Zd(r)),s=new Td(r,i),l=t(s,e,n);return s.receiveBackend(l),s}var eu=["children"];function tu(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ts(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 ts(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 ts(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 nu(t,e){if(t==null)return{};var n,r,i=function(l,c){if(l==null)return{};var a,d,u={},f=Object.keys(l);for(d=0;d<f.length;d++)a=f[d],c.indexOf(a)>=0||(u[a]=l[a]);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 ns=0,en=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),ru=y.memo(function(t){var e=t.children,n=function(l){if("manager"in l)return[{dragDropManager:l.manager},!1];var c=function(d){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rs(),f=arguments.length>2?arguments[2]:void 0,p=arguments.length>3?arguments[3]:void 0,m=u;return m[en]||(m[en]={dragDropManager:Jd(d,u,f,p)}),m[en]}(l.backend,l.context,l.options,l.debugMode),a=!l.context;return[c,a]}(nu(t,eu)),r=tu(n,2),i=r[0],s=r[1];return y.useEffect(function(){if(s){var l=rs();return++ns,function(){--ns===0&&(l[en]=null)}}},[]),o.jsx(Eo.Provider,Object.assign({value:i},{children:e}),void 0)});function rs(){return typeof global<"u"?global:window}function iu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function is(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jn=!1,er=!1,ou=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),is(this,"internalMonitor",void 0),is(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return iu(t,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Y(!Jn,"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 Jn=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Jn=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Y(!er,"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 er=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{er=!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 su(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function os(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tr=!1,lu=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),os(this,"internalMonitor",void 0),os(this,"targetId",null),this.internalMonitor=e.getMonitor()}return su(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;Y(!tr,"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 tr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{tr=!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 au(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(!y.isValidElement(e)){var r=e;return t(r,n),r}var i=e;(function(l){if(typeof l.type!="string"){var c=l.type.displayName||l.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(c," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}})(i);var s=n?function(l){return t(l,n)}:t;return function(l,c){var a=l.ref;return Y(typeof a!="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"),a?y.cloneElement(l,{ref:function(d){ls(a,d),ls(c,d)}}):y.cloneElement(l,{ref:c})}(i,s)}}function ss(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=au(r);e[n]=function(){return i}}}),e}function ls(t,e){typeof t=="function"?t(e):t.current=e}function nr(t){return nr=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},nr(t)}function rr(t){return t!==null&&nr(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ir(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),l=Object.keys(e);if(s.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(e),a=0;a<s.length;a++){var d=s[a];if(!c(d))return!1;var u=t[d],f=e[d];if((i=void 0)===!1||i===void 0&&u!==f)return!1}return!0}function cu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(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 du=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),ye(this,"hooks",ss({dragSource:function(r,i){n.clearDragSource(),n.dragSourceOptions=i||null,rr(r)?n.dragSourceRef=r:n.dragSourceNode=r,n.reconnectDragSource()},dragPreview:function(r,i){n.clearDragPreview(),n.dragPreviewOptions=i||null,rr(r)?n.dragPreviewRef=r:n.dragPreviewNode=r,n.reconnectDragPreview()}})),ye(this,"handlerId",null),ye(this,"dragSourceRef",null),ye(this,"dragSourceNode",void 0),ye(this,"dragSourceOptionsInternal",null),ye(this,"dragSourceUnsubscribe",void 0),ye(this,"dragPreviewRef",null),ye(this,"dragPreviewNode",void 0),ye(this,"dragPreviewOptionsInternal",null),ye(this,"dragPreviewUnsubscribe",void 0),ye(this,"lastConnectedHandlerId",null),ye(this,"lastConnectedDragSource",null),ye(this,"lastConnectedDragSourceOptions",null),ye(this,"lastConnectedDragPreview",null),ye(this,"lastConnectedDragPreviewOptions",null),ye(this,"backend",void 0),this.backend=e}return cu(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!ir(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ir(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 uu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(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 hu=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),_e(this,"hooks",ss({dropTarget:function(r,i){n.clearDropTarget(),n.dropTargetOptions=i,rr(r)?n.dropTargetRef=r:n.dropTargetNode=r,n.reconnect()}})),_e(this,"handlerId",null),_e(this,"dropTargetRef",null),_e(this,"dropTargetNode",void 0),_e(this,"dropTargetOptionsInternal",null),_e(this,"unsubscribeDropTarget",void 0),_e(this,"lastConnectedHandlerId",null),_e(this,"lastConnectedDropTarget",null),_e(this,"lastConnectedDropTargetOptions",null),_e(this,"backend",void 0),this.backend=e}return uu(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!ir(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}(),Ge=typeof window<"u"?y.useLayoutEffect:y.useEffect;function or(t){return or=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},or(t)}function fu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function sr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var pu=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),sr(this,"spec",void 0),sr(this,"monitor",void 0),sr(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return fu(t,[{key:"beginDrag",value:function(){var e,n=this.spec,r=this.monitor;return(e=or(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 Ye(){var t=y.useContext(Eo).dragDropManager;return Y(t!=null,"Expected drag drop context"),t}function gu(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return as(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 as(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 as(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 mu(t,e,n){var r=Ye(),i=function(l,c,a){var d=y.useMemo(function(){return new pu(l,c,a)},[c,a]);return y.useEffect(function(){d.spec=l},[l]),d}(t,e,n),s=function(l){return y.useMemo(function(){var c=l.type;return Y(c!=null,"spec.type must be defined"),c},[l])}(t);Ge(function(){if(s!=null){var l=function(u,f,p){var m=p.getRegistry(),h=m.addSource(u,f);return[h,function(){return m.removeSource(h)}]}(s,i,r),c=gu(l,2),a=c[0],d=c[1];return e.receiveHandlerId(a),n.receiveHandlerId(a),d}},[r,e,n,i,s])}function vu(t){return function(e){if(Array.isArray(e))return lr(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 lr(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 lr(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function lr(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 cs(t,e){var n=vu(e||[]);return e==null&&typeof t!="function"&&n.push(t),y.useMemo(function(){return typeof t=="function"?t():t},n)}function yu(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return ds(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 ds(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ds(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 us(t,e,n){var r=yu(y.useState(function(){return e(t)}),2),i=r[0],s=r[1],l=y.useCallback(function(){var c=e(t);ec(i,c)||(s(c),n&&n())},[i,t,n]);return Ge(l),[i,l]}function xu(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return hs(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 hs(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 hs(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 fs(t,e,n){return function(r,i,s){var l=xu(us(r,i,s),2),c=l[0],a=l[1];return Ge(function(){var d=r.getHandlerId();if(d!=null)return r.subscribeToStateChange(a,{handlerIds:[d]})},[r,a]),c}(e,t||function(){return{}},function(){return n.reconnect()})}function bu(t){return y.useMemo(function(){return t.hooks.dragSource()},[t])}function wu(t){return y.useMemo(function(){return t.hooks.dragPreview()},[t])}function ju(t,e){var n=cs(t,e);Y(!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=Ye(),y.useMemo(function(){return new ou(r)},[r])),s=function(l,c){var a=Ye(),d=y.useMemo(function(){return new du(a.getBackend())},[a]);return Ge(function(){return d.dragSourceOptions=l||null,d.reconnect(),function(){return d.disconnectDragSource()}},[d,l]),Ge(function(){return d.dragPreviewOptions=c||null,d.reconnect(),function(){return d.disconnectDragPreview()}},[d,c]),d}(n.options,n.previewOptions);return mu(n,i,s),[fs(n.collect,i,s),bu(s),wu(s)]}function Su(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function ps(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ku=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ps(this,"spec",void 0),ps(this,"monitor",void 0),this.spec=e,this.monitor=n}return Su(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 Cu(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return gs(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 gs(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 gs(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 Iu(t,e,n){var r=Ye(),i=function(l,c){var a=y.useMemo(function(){return new ku(l,c)},[c]);return y.useEffect(function(){a.spec=l},[l]),a}(t,e),s=function(l){var c=l.accept;return y.useMemo(function(){return Y(l.accept!=null,"accept must be defined"),Array.isArray(c)?c:[c]},[c])}(t);Ge(function(){var l=function(u,f,p){var m=p.getRegistry(),h=m.addTarget(u,f);return[h,function(){return m.removeTarget(h)}]}(s,i,r),c=Cu(l,2),a=c[0],d=c[1];return e.receiveHandlerId(a),n.receiveHandlerId(a),d},[r,e,i,n,s.map(function(l){return l.toString()}).join("|")])}function Nu(t){return y.useMemo(function(){return t.hooks.dropTarget()},[t])}function ms(t,e){var n,r=cs(t,e),i=(n=Ye(),y.useMemo(function(){return new lu(n)},[n])),s=function(l){var c=Ye(),a=y.useMemo(function(){return new hu(c.getBackend())},[c]);return Ge(function(){return a.dropTargetOptions=l||null,a.reconnect(),function(){return a.disconnectDropTarget()}},[l]),a}(r.options);return Iu(r,i,s),[fs(r.collect,i,s),Nu(s)]}function Du(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,l,c=[],a=!0,d=!1;try{for(i=i.call(n);!(a=(s=i.next()).done)&&(c.push(s.value),!r||c.length!==r);a=!0);}catch(u){d=!0,l=u}finally{try{a||i.return==null||i.return()}finally{if(d)throw l}}return c}}(t,e)||function(n,r){if(n){if(typeof n=="string")return vs(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 vs(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 vs(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 ys(t){var e=null;return function(){return e==null&&(e=t()),e}}function Ou(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function xs(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Eu=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),xs(this,"entered",[]),xs(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return Ou(t,[{key:"enter",value:function(e){var n=this,r=this.entered.length;return this.entered=function(i,s){var l=new Set,c=function(d){return l.add(d)};i.forEach(c),s.forEach(c);var a=[];return l.forEach(function(d){return a.push(d)}),a}(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}(),Tu=ys(function(){return/firefox/i.test(navigator.userAgent)}),bs=ys(function(){return!!window.safari});function Pu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function St(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ws=function(){function t(e,n){(function(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")})(this,t),St(this,"xs",void 0),St(this,"ys",void 0),St(this,"c1s",void 0),St(this,"c2s",void 0),St(this,"c3s",void 0);for(var r=e.length,i=[],s=0;s<r;s++)i.push(s);i.sort(function(P,O){return e[P]<e[O]?-1:1});for(var l,c,a=[],d=[],u=0;u<r-1;u++)l=e[u+1]-e[u],c=n[u+1]-n[u],a.push(l),d.push(c/l);for(var f=[d[0]],p=0;p<a.length-1;p++){var m=d[p],h=d[p+1];if(m*h<=0)f.push(0);else{l=a[p];var g=a[p+1],v=l+g;f.push(3*v/((v+g)/m+(v+l)/h))}}f.push(d[d.length-1]);for(var x,j=[],S=[],C=0;C<f.length-1;C++){x=d[C];var k=f[C],D=1/a[C],N=k+f[C+1]-x-x;j.push((x-k-N)*D),S.push(N*D*D)}this.xs=e,this.ys=n,this.c1s=f,this.c2s=j,this.c3s=S}return Pu(t,[{key:"interpolate",value:function(e){var n=this.xs,r=this.ys,i=this.c1s,s=this.c2s,l=this.c3s,c=n.length-1;if(e===n[c])return r[c];for(var a,d=0,u=l.length-1;d<=u;){var f=n[a=Math.floor(.5*(d+u))];if(f<e)d=a+1;else{if(!(f>e))return r[a];u=a-1}}var p=e-n[c=Math.max(0,u)],m=p*p;return r[c]+i[c]*p+s[c]*m+l[c]*p*m}}]),t}();function js(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 tn(t){return{x:t.clientX,y:t.clientY}}function Ku(t,e,n,r,i){var s,l,c,a=(s=e).nodeName==="IMG"&&(Tu()||!((l=document.documentElement)!==null&&l!==void 0&&l.contains(s))),d=js(a?t:e),u={x:n.x-d.x,y:n.y-d.y},f=t.offsetWidth,p=t.offsetHeight,m=r.anchorX,h=r.anchorY,g=function(k,D,N,P){var O=k?D.width:N,_=k?D.height:P;return bs()&&k&&(_/=window.devicePixelRatio,O/=window.devicePixelRatio),{dragPreviewWidth:O,dragPreviewHeight:_}}(a,e,f,p),v=g.dragPreviewWidth,x=g.dragPreviewHeight,j=i.offsetX,S=i.offsetY,C=S===0||S;return{x:j===0||j?j:new ws([0,.5,1],[u.x,u.x/f*v,u.x+v-f]).interpolate(m),y:C?S:(c=new ws([0,.5,1],[u.y,u.y/p*x,u.y+x-p]).interpolate(h),bs()&&a&&(c+=(window.devicePixelRatio-1)*x),c)}}var Ss="__NATIVE_FILE__",ks="__NATIVE_URL__",Cs="__NATIVE_TEXT__",Is="__NATIVE_HTML__";const Ns=Object.freeze(Object.defineProperty({__proto__:null,FILE:Ss,HTML:Is,TEXT:Cs,URL:ks},Symbol.toStringTag,{value:"Module"}));function ar(t,e,n){var r=e.reduce(function(i,s){return i||t.getData(s)},"");return r??n}var kt;function nn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cr=(nn(kt={},Ss,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),nn(kt,Is,{exposeProperties:{html:function(t,e){return ar(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),nn(kt,ks,{exposeProperties:{urls:function(t,e){return ar(t,e,"").split(`
15
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),nn(kt,Cs,{exposeProperties:{text:function(t,e){return ar(t,e,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),kt);function _u(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function Ds(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Mu=function(){function t(e){(function(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Ds(this,"item",void 0),Ds(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return _u(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 dr(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(cr).filter(function(n){return cr[n].matchesTypes.some(function(r){return e.indexOf(r)>-1})})[0]||null}function Au(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function ur(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ru=function(){function t(e,n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,t),ur(this,"ownerDocument",null),ur(this,"globalContext",void 0),ur(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return Au(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 Os(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 Es(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Os(Object(n),!0).forEach(function(r){ee(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Os(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Fu(t,e,n){return e&&function(r,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}(t.prototype,e),t}function ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var hr,Lu=function(){function t(e,n,r){var i=this;(function(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")})(this,t),ee(this,"options",void 0),ee(this,"actions",void 0),ee(this,"monitor",void 0),ee(this,"registry",void 0),ee(this,"enterLeaveCounter",void 0),ee(this,"sourcePreviewNodes",new Map),ee(this,"sourcePreviewNodeOptions",new Map),ee(this,"sourceNodes",new Map),ee(this,"sourceNodeOptions",new Map),ee(this,"dragStartSourceIds",null),ee(this,"dropTargetIds",[]),ee(this,"dragEnterTargetIds",[]),ee(this,"currentNativeSource",null),ee(this,"currentNativeHandle",null),ee(this,"currentDragSourceNode",null),ee(this,"altKeyPressed",!1),ee(this,"mouseMoveTimeoutTimer",null),ee(this,"asyncEndDragFrameId",null),ee(this,"dragOverTargetIds",null),ee(this,"lastClientOffset",null),ee(this,"hoverRafId",null),ee(this,"getSourceClientOffset",function(s){var l=i.sourceNodes.get(s);return l&&js(l)||null}),ee(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),ee(this,"isNodeInDocument",function(s){return!!(s&&i.document&&i.document.body&&i.document.body.contains(s))}),ee(this,"endDragIfSourceWasRemovedFromDOM",function(){var s=i.currentDragSourceNode;s==null||i.isNodeInDocument(s)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),ee(this,"handleTopDragStart",function(s){if(!s.defaultPrevented){var l=i.dragStartSourceIds;i.dragStartSourceIds=null;var c=tn(s);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(l||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:c});var a=s.dataTransfer,d=dr(a);if(i.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){var u=i.monitor.getSourceId(),f=i.sourceNodes.get(u),p=i.sourcePreviewNodes.get(u)||f;if(p){var m=i.getCurrentSourcePreviewNodeOptions(),h=Ku(f,p,c,{anchorX:m.anchorX,anchorY:m.anchorY},{offsetX:m.offsetX,offsetY:m.offsetY});a.setDragImage(p,h.x,h.y)}}try{a==null||a.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(a&&!a.types&&(s.target&&!s.target.hasAttribute||!s.target.hasAttribute("draggable")))return;s.preventDefault()}}}),ee(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleTopDragEnterCapture",function(s){if(i.dragEnterTargetIds=[],i.enterLeaveCounter.enter(s.target)&&!i.monitor.isDragging()){var l=s.dataTransfer,c=dr(l);c&&i.beginDragNativeItem(c,l)}}),ee(this,"handleTopDragEnter",function(s){var l=i.dragEnterTargetIds;i.dragEnterTargetIds=[],i.monitor.isDragging()&&(i.altKeyPressed=s.altKey,l.length>0&&i.actions.hover(l,{clientOffset:tn(s)}),l.some(function(c){return i.monitor.canDropOnTarget(c)})&&(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())))}),ee(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),ee(this,"handleTopDragOver",function(s){var l=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging())return s.preventDefault(),void(s.dataTransfer&&(s.dataTransfer.dropEffect="none"));i.altKeyPressed=s.altKey,i.lastClientOffset=tn(s),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(l||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null})),(l||[]).some(function(c){return i.monitor.canDropOnTarget(c)})?(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?s.preventDefault():(s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="none"))}),ee(this,"handleTopDragLeaveCapture",function(s){i.isDraggingNativeItem()&&s.preventDefault(),i.enterLeaveCounter.leave(s.target)&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),ee(this,"handleTopDropCapture",function(s){var l;i.dropTargetIds=[],i.isDraggingNativeItem()?(s.preventDefault(),(l=i.currentNativeSource)===null||l===void 0||l.loadDataTransfer(s.dataTransfer)):dr(s.dataTransfer)&&s.preventDefault(),i.enterLeaveCounter.reset()}),ee(this,"handleTopDrop",function(s){var l=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(l,{clientOffset:tn(s)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleSelectStart",function(s){var l=s.target;typeof l.dragDrop=="function"&&(l.tagName==="INPUT"||l.tagName==="SELECT"||l.tagName==="TEXTAREA"||l.isContentEditable||(s.preventDefault(),l.dragDrop()))}),this.options=new Ru(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Eu(this.isNodeInDocument)}return Fu(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(c){return i.handleDragStart(c,e)},l=function(c){return i.handleSelectStart(c)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",s),n.addEventListener("selectstart",l),function(){i.sourceNodes.delete(e),i.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",s),n.removeEventListener("selectstart",l),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,n){var r=this,i=function(c){return r.handleDragEnter(c,e)},s=function(c){return r.handleDragOver(c,e)},l=function(c){return r.handleDrop(c,e)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",s),n.addEventListener("drop",l),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",s),n.removeEventListener("drop",l)}}},{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 Es({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 Es({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(Ns).some(function(n){return Ns[n]===e})}},{key:"beginDragNativeItem",value:function(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(r,i){var s=new Mu(cr[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}(),zu=function(t,e,n){return new Lu(t,e,n)};function $u(t){const e=ke(),n=e.selectedIds,[r,i,s]=ju(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const l=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(ot.dragStart(t.id,l)),{id:t.id,dragIds:l}},end:()=>{e.hideCursor(),e.dispatch(ot.dragEnd())}}),[n,t]);return y.useEffect(()=>{s((hr||((hr=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),hr))},[s]),i}function rn(t,e){return{parentId:t||null,index:e}}function lt(t,e){return{type:"line",index:t,level:e}}function fr(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:co(r)+1}}function Ts(t){var e;const n=function(f,p){const m=f.getBoundingClientRect(),h=p.x-Math.round(m.x),g=p.y-Math.round(m.y),v=m.height,x=g<v/2,j=!x,S=v/4,C=g>S&&g<v-S;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:l,prevNode:c}=t,[a,d]=function(f,p,m,h){return f?f.isInternal?h.atTop?[p,f]:h.inMiddle?[f,f]:[f,m]:h.inTopHalf?[p,f]:[f,m]:[p,null]}(s,c,l,n);if(s&&s.isInternal&&n.inMiddle)return{drop:rn(s.id,null),cursor:(u=s.id,{type:"highlight",id:u})};var u;if(!a)return{drop:rn((e=d==null?void 0:d.parent)===null||e===void 0?void 0:e.id,0),cursor:lt(0,0)};if(oo(a)){const f=Yt(i,(d==null?void 0:d.level)||0,a.level);return{drop:fr(a,f),cursor:lt(a.rowIndex+1,f)}}if(so(a)){const f=Yt(i,(d==null?void 0:d.level)||0,a.level);return{drop:fr(a,f),cursor:lt(a.rowIndex+1,f)}}if(lo(a)){const f=Yt(i,0,a.level+1);return f>a.level?{drop:rn(a.id,0),cursor:lt(a.rowIndex+1,f)}:{drop:fr(a,f),cursor:lt(a.rowIndex+1,f)}}return{drop:rn(a==null?void 0:a.id,0),cursor:lt(a.rowIndex+1,a.level+1)}}const Vu=R.memo(function({index:t,style:e}){io(),function(){if(y.useContext(to)===null)throw new Error("Provide a NodesContext")}();const n=ke(),r=function(h){const g=ke(),v=g.at(h);if(!v)throw new Error(`Could not find node for index: ${h}`);return y.useMemo(()=>{const x=v.clone();return g.visibleNodes[h]=x,x},[...Object.values(v.state),v])}(t),i=y.useRef(null),s=$u(r),l=function(h,g){const v=ke(),[x,j]=ms(()=>({accept:"NODE",canDrop:()=>v.canDrop(),hover:(S,C)=>{const k=C.getClientOffset();if(!h.current||!k)return;const{cursor:D,drop:N}=Ts({element:h.current,offset:k,indent:v.indent,node:g,prevNode:g.prev,nextNode:g.next});N&&v.dispatch(ot.hovering(N.parentId,N.index)),C.canDrop()?D&&v.showCursor(D):v.hideCursor()},drop:(S,C)=>{if(!C.canDrop())return null;let{parentId:k,index:D,dragIds:N}=v.state.dnd;go(v.props.onMove,{dragIds:N,parentId:k===bt?null:k,index:D===null?0:D,dragNodes:v.dragNodes,parentNode:v.get(k)}),v.open(k)}}),[g,h.current,v.props]);return j}(i,r),c=y.useCallback(h=>{i.current=h,l(h)},[l]),a=n.indent*r.level,d=y.useMemo(()=>({paddingLeft:a}),[a]),u=y.useMemo(()=>{var h,g;return Object.assign(Object.assign({},e),{top:parseFloat(e.top)+((g=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&g!==void 0?g:0)})},[e,n.props.padding,n.props.paddingTop]),f={role:"treeitem","aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};y.useEffect(()=>{var h;!r.isEditing&&r.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);const p=n.renderNode,m=n.renderRow;return o.jsx(m,{node:r,innerRef:c,attrs:f,children:o.jsx(p,{node:r,tree:n,style:d,dragHandle:s})})});let pr="",Ps=null;function Ks(){io();const t=ke();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 l=s.nextSibling,c=s.parent;t.focus(l||c,{scroll:!1}),t.delete(s)}}return}if(e.key==="Tab"&&!e.shiftKey)return e.preventDefault(),void uo(e.currentTarget);if(e.key==="Tab"&&e.shiftKey)return e.preventDefault(),void ho(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(Ps),pr+=e.key,Ps=setTimeout(()=>{pr=""},600);const r=t.visibleNodes.find(i=>{const s=i.data.name;return typeof s=="string"&&s.toLowerCase().startsWith(pr)});r&&t.focus(r.id)},children:o.jsx(md,{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:xd,innerElementType:jd,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Vu})})}function _s(t){return t.isFiltered?function(e,n){const r={},i=[];function s(c){if(!c.isRoot&&n(c)){r[c.id]=!0;let a=c.parent;for(;a;)r[a.id]=!0,a=a.parent}if(c.children)for(let a of c.children)s(a)}function l(c){var a;c.level>=0&&r[c.id]&&i.push(c),c.isOpen&&((a=c.children)===null||a===void 0||a.forEach(l))}return s(e),l(e),i.forEach(Ms),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(Ms),n}(t.root)}function Ms(t,e){t.rowIndex=e}const As=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var gr=function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function l(d){try{a(r.next(d))}catch(u){s(u)}}function c(d){try{a(r.throw(d))}catch(u){s(u)}}function a(d){var u;d.done?i(d.value):(u=d.value,u instanceof n?u:new n(function(f){f(u)})).then(l,c)}a((r=r.apply(t,e||[])).next())})};const{safeRun:pe,identify:Le,identifyNull:Ee}=Wc;class Dt{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=xo(this),this.visibleNodes=_s(this),this.idToIndex=As(this.visibleNodes)}update(e){this.props=e,this.root=xo(this),this.visibleNodes=_s(this),this.idToIndex=As(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=xt(e,this.props.childrenAccessor||"children"))!==null&&n!==void 0?n:null}accessId(e){const n=xt(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 l=Math.min(i,s),c=Math.max(i,s);return this.visibleNodes.slice(l,c+1)}indexOf(e){const n=po(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 gr(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?yo(this):e.parentId,s=(n=e.index)!==null&&n!==void 0?n:vo(this),l=(r=e.type)!==null&&r!==void 0?r:"leaf",c=yield pe(this.props.onCreate,{type:l,parentId:i,index:s,parentNode:this.get(i)});c&&(this.focus(c),setTimeout(()=>{this.edit(c).then(()=>{this.select(c),this.activate(c)})}))})}delete(e){return gr(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(Le),r=n.map(i=>this.get(i)).filter(i=>!!i);yield pe(this.props.onDelete,{nodes:r,ids:n})})}edit(e){const n=Le(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(An(n)),new Promise(r=>{Dt.editPromise=r})}submit(e,n){return gr(this,void 0,void 0,function*(){if(!e)return;const r=Le(e);yield pe(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(An(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(An(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(Ee(e));n&&pe(this.props.onActivate,n)}resolveEdit(e){const n=Dt.editPromise;n&&n(e),Dt.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(rt(Le(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&pe(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 l=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;l=l<i?i:Math.min(l+s,this.visibleNodes.length-1),this.focus(this.at(l))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=Le(e);r&&this.dispatch(rt(i)),this.dispatch(nd(i)),this.dispatch(So(i)),this.dispatch(Fn(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&pe(this.props.onFocus,this.focusedNode),pe(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=Le(e);this.dispatch(jo(n)),pe(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(Ee(e));n&&(this.dispatch(rt(n.id)),this.dispatch(wo(n.id)),this.dispatch(So(n.id)),this.dispatch(Fn(n.id)),this.scrollTo(n),this.focusedNode&&pe(this.props.onFocus,this.focusedNode),pe(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=Le(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(rt(n)),this.dispatch(jo(this.nodesBetween(r,i))),this.dispatch(wo(this.nodesBetween(r,Ee(n)))),this.dispatch(Fn(n)),this.scrollTo(n),this.focusedNode&&pe(this.props.onFocus,this.focusedNode),pe(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),pe(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(rt((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&pe(this.props.onFocus,this.focusedNode),pe(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(Le)),i=Ee(e.anchor),s=Ee(e.mostRecent);this.dispatch(rd({ids:r,anchor:i,mostRecent:s})),pe(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&&ao(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(ot.cursor({type:"none"}))}showCursor(e){this.dispatch(ot.cursor(e))}open(e){const n=Ee(e);n&&(this.isOpen(n)||(this.dispatch(Rn.open(n,this.isFiltered)),pe(this.props.onToggle,n)))}close(e){const n=Ee(e);n&&this.isOpen(n)&&(this.dispatch(Rn.close(n,this.isFiltered)),pe(this.props.onToggle,n))}toggle(e){const n=Ee(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=Ee(e);if(!n)return;const r=Mn(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(){Xt(this.root,e=>{e.isInternal&&e.open()})}closeAll(){Xt(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=Le(e);return this.openParents(r),mo(()=>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===bt)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!xt(e,this.props.disableEdit||(()=>!1))}isDraggable(e){return!xt(e,this.props.disableDrag||(()=>!1))}isDragging(e){const n=Ee(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=Ee(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(rt(e.id))}onBlur(){this.dispatch({type:"TREE_BLUR"})}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ks}get renderRow(){return this.props.renderRow||Zc}get renderNode(){return this.props.children||Jc}get renderDragPreview(){return this.props.renderDragPreview||ko}get renderCursor(){return this.props.renderCursor||Qc}}function xe(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 Rs=typeof Symbol=="function"&&Symbol.observable||"@@observable",mr=()=>Math.random().toString(36).substring(7).split("").join("."),on={INIT:`@@redux/INIT${mr()}`,REPLACE:`@@redux/REPLACE${mr()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${mr()}`};function Fs(t,e,n){if(typeof t!="function")throw new Error(xe(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(xe(0));if(typeof e=="function"&&n===void 0&&(n=e,e=void 0),n!==void 0){if(typeof n!="function")throw new Error(xe(1));return n(Fs)(t,e)}let r=t,i=e,s=new Map,l=s,c=0,a=!1;function d(){l===s&&(l=new Map,s.forEach((m,h)=>{l.set(h,m)}))}function u(){if(a)throw new Error(xe(3));return i}function f(m){if(typeof m!="function")throw new Error(xe(4));if(a)throw new Error(xe(5));let h=!0;d();const g=c++;return l.set(g,m),function(){if(h){if(a)throw new Error(xe(6));h=!1,d(),l.delete(g),s=null}}}function p(m){if(!function(h){if(typeof h!="object"||h===null)return!1;let g=h;for(;Object.getPrototypeOf(g)!==null;)g=Object.getPrototypeOf(g);return Object.getPrototypeOf(h)===g||Object.getPrototypeOf(h)===null}(m))throw new Error(xe(7));if(m.type===void 0)throw new Error(xe(8));if(typeof m.type!="string")throw new Error(xe(17));if(a)throw new Error(xe(9));try{a=!0,i=r(i,m)}finally{a=!1}return(s=l).forEach(h=>{h()}),m}return p({type:on.INIT}),{dispatch:p,subscribe:f,getState:u,replaceReducer:function(m){if(typeof m!="function")throw new Error(xe(10));r=m,p({type:on.REPLACE})},[Rs]:function(){const m=f;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(xe(11));function g(){const v=h;v.next&&v.next(u())}return g(),{unsubscribe:m(g)}},[Rs](){return this}}}}}function Ls(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const l=e[s];typeof t[l]=="function"&&(n[l]=t[l])}const r=Object.keys(n);let i;try{(function(s){Object.keys(s).forEach(l=>{const c=s[l];if(c(void 0,{type:on.INIT})===void 0)throw new Error(xe(12));if(c(void 0,{type:on.PROBE_UNKNOWN_ACTION()})===void 0)throw new Error(xe(13))})})(n)}catch(s){i=s}return function(s={},l){if(i)throw i;let c=!1;const a={};for(let d=0;d<r.length;d++){const u=r[d],f=n[u],p=s[u],m=f(p,l);if(m===void 0)throw l&&l.type,new Error(xe(14));a[u]=m,c=c||m!==p}return c=c||r.length!==Object.keys(s).length,c?a:s}}const Bu=Ls({nodes:Ls({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:bo(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:bo(t.unfiltered,e)}):t},selection:function(t=it().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=it().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=it().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 it().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}}),Hu=it();function Uu({treeProps:t,imperativeHandle:e,children:n}){const r=y.useRef(null),i=y.useRef(null),s=y.useRef(Fs(Bu,it(t))),l=Dr.useSyncExternalStore(s.current.subscribe,s.current.getState,()=>Hu),c=y.useMemo(()=>new Dt(s.current,t,r,i),[]),a=y.useRef(0);return y.useMemo(()=>{a.current+=1,c.update(t)},[...Object.values(t),l.nodes.open]),y.useImperativeHandle(e,()=>c),y.useEffect(()=>{c.props.selection?c.select(c.props.selection,{focus:!1}):c.deselectAll()},[c.props.selection]),y.useEffect(()=>{c.props.searchTerm||s.current.dispatch(Rn.clear(!0))},[c.props.searchTerm]),o.jsx(eo.Provider,{value:c,children:o.jsx(ro.Provider,{value:a.current,children:o.jsx(to.Provider,{value:l.nodes,children:o.jsx(no.Provider,{value:l.dnd,children:o.jsx(ru,Object.assign({backend:zu,options:{rootElement:c.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function qu(t){return function(){const e=ke(),[,n]=ms(()=>({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:l,drop:c}=Ts({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});c&&e.dispatch(ot.hovering(c.parentId,c.index)),i.canDrop()?l&&e.showCursor(l):e.hideCursor()}}),[e]);n(e.listEl)}(),t.children}function Wu(){const t=ke().props.renderContainer||Ks;return o.jsx(o.Fragment,{children:o.jsx(t,{})})}function Gu(){const t=ke(),{offset:e,mouse:n,item:r,isDragging:i}=(s=f=>({offset:f.getSourceClientOffset(),mouse:f.getClientOffset(),item:f.getItem(),isDragging:f.isDragging()}),l=Ye().getMonitor(),c=Du(us(l,s),2),a=c[0],d=c[1],y.useEffect(function(){return l.subscribeToOffsetChange(d)}),y.useEffect(function(){return l.subscribeToStateChange(d)}),a);var s,l,c,a,d;const u=t.props.renderDragPreview||ko;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 zs{constructor(e){this.root=function(n){const r=new $s({id:"ROOT"},null);return r.children=n.map(i=>vr(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 vr(t,e){const n=new $s(t,e);return t.children&&(n.children=t.children.map(r=>vr(r,n))),n}class $s{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=vr(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 Yu=0;function Xu(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
16
+ Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=function(r){const[i,s]=y.useState(r),l=y.useMemo(()=>new zs(i),[i]);return[i,{onMove:a=>{for(const d of a.dragIds)l.move({id:d,parentId:a.parentId,index:a.index});s(l.data)},onRename:({name:a,id:d})=>{l.update({id:d,changes:{name:a}}),s(l.data)},onCreate:({parentId:a,index:d,type:u})=>{const f={id:"simple-tree-id-"+Yu++,name:""};return u==="internal"&&(f.children=[]),l.create({parentId:a,index:d,data:f}),s(l.data),f},onDelete:a=>{a.ids.forEach(d=>l.drop({id:d})),s(l.data)}}]}(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}return t}const Qu=y.forwardRef(function(t,e){const n=Xu(t);return o.jsxs(Uu,{treeProps:n,imperativeHandle:e,children:[o.jsx(qu,{children:o.jsx(Wu,{})}),o.jsx(Gu,{})]})});function Zu(t,e){const n=se.c(11),{delayMs:r,whenVisible:i,disabled:s}=e,l=s!==void 0&&s,c=y.useRef(void 0);let a,d,u,f,p;return n[0]!==t?(a=()=>{c.current=t},d=[t],n[0]=t,n[1]=a,n[2]=d):(a=n[1],d=n[2]),y.useEffect(a,d),n[3]!==r||n[4]!==l||n[5]!==i?(u=()=>{if(r===null||l)return;const m=setInterval(()=>{var h;i&&document.visibilityState!=="visible"||((h=c.current)==null||h.call(c))},r);return()=>clearInterval(m)},f=[r,i,l],n[3]=r,n[4]=l,n[5]=i,n[6]=u,n[7]=f):(u=n[6],f=n[7]),y.useEffect(u,f),n[8]!==l||n[9]!==i?(p=()=>{var m;document.visibilityState==="visible"&&i&&!l&&((m=c.current)==null||m.call(c))},n[8]=l,n[9]=i,n[10]=p):p=n[10],Tl(document,"visibilitychange",p),null}function Ju(){return["compact","medium","full","columns"]}const eh=t=>{const e=se.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},sn=t=>{const e=se.c(10);let n,r,i,s,l;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=Be("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?(l=o.jsx("div",{...i,className:s,children:n}),e[6]=n,e[7]=i,e[8]=s,e[9]=l):l=e[9],l},th=t=>{const e=se.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},Vs=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],nh=()=>{const t=se.c(37),[e,n]=Pl(),{saveAppConfig:r}=Je(),i=y.useId(),s=y.useId();let l,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Fr(Kl),t[0]=l):l=t[0],t[1]!==e?(c={resolver:l,defaultValues:e},t[1]=e,t[2]=c):c=t[2];const a=Lr(c);let d;t[3]!==r||t[4]!==n?(d=async P=>{await r({config:P}).then(()=>{n(P)}).catch(()=>{n(P)})},t[3]=r,t[4]=n,t[5]=d):d=t[5];const u=d;let f;t[6]!==u?(f=P=>{u(P)},t[6]=u,t[7]=f):f=t[7];const p=zr(f,100);let m,h,g,v,x,j,S,C,k,D,N;return t[8]!==e.width?(m=[e.width],t[8]=e.width,t[9]=m):m=t[9],y.useEffect(rh,m),t[10]!==p||t[11]!==a?(h=a.handleSubmit(p),t[10]=p,t[11]=a,t[12]=h):h=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs("div",{children:[o.jsx(eh,{children:"Notebook Settings"}),o.jsx(th,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=g):g=t[13],t[14]!==a.control?(v=o.jsxs(ln,{title:"Display",children:[o.jsx(q,{control:a.control,name:"width",render:oh}),o.jsx(q,{control:a.control,name:"app_title",render:sh})]}),t[14]=a.control,t[15]=v):v=t[15],t[16]!==a.control?(x=o.jsxs(ln,{title:"Custom Files",children:[o.jsx(q,{control:a.control,name:"css_file",render:lh}),o.jsx(q,{control:a.control,name:"html_head_file",render:ah})]}),t[16]=a.control,t[17]=x):x=t[17],t[18]!==a.control?(j=o.jsx(ln,{title:"Data",children:o.jsx(q,{control:a.control,name:"sql_output",render:dh})}),t[18]=a.control,t[19]=j):j=t[19],t[20]!==i||t[21]!==s?(S=P=>{const{field:O}=P;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:"flex flex-col gap-2",children:[o.jsx(G,{children:o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(fe,{id:i,"data-testid":"html-checkbox",checked:O.value.includes("html"),onCheckedChange:()=>{O.onChange(Mt(O.value,"html"))}}),o.jsx(U,{htmlFor:i,children:"HTML"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(fe,{id:s,"data-testid":"ipynb-checkbox",checked:O.value.includes("ipynb"),onCheckedChange:()=>{O.onChange(Mt(O.value,"ipynb"))}}),o.jsx(U,{htmlFor:s,children:"IPYNB"})]})]})}),o.jsx(Z,{})]}),o.jsxs(ie,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",o.jsx(he,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=i,t[21]=s,t[22]=S):S=t[22],t[23]!==a.control||t[24]!==S?(C=o.jsx(ln,{title:"Exporting outputs",children:o.jsx(q,{control:a.control,name:"auto_download",render:S})}),t[23]=a.control,t[24]=S,t[25]=C):C=t[25],t[26]!==C||t[27]!==v||t[28]!==x||t[29]!==j?(k=o.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[v,x,j,C]}),t[26]=C,t[27]=v,t[28]=x,t[29]=j,t[30]=k):k=t[30],t[31]!==k||t[32]!==h?(D=o.jsxs("form",{onChange:h,className:"flex flex-col gap-6",children:[g,k]}),t[31]=k,t[32]=h,t[33]=D):D=t[33],t[34]!==a||t[35]!==D?(N=o.jsx($r,{...a,children:D}),t[34]=a,t[35]=D,t[36]=N):N=t[36],N},ln=t=>{const e=se.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 rh(){window.dispatchEvent(new Event("resize"))}function ih(t){return o.jsx("option",{value:t,children:t},t)}function oh(t){const{field:e}=t;return o.jsxs(W,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(U,{children:"Width"}),o.jsx(G,{children:o.jsx(Se,{"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(ih)})}),o.jsx(Z,{})]})}function sh(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(U,{children:"App title"}),o.jsx(G,{children:o.jsx(Ke,{...e,value:e.value??"",onChange:n=>{e.onChange(n.target.value),Vr.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),o.jsx(Z,{})]}),o.jsx(ie,{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 lh(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(U,{className:"shrink-0",children:"Custom CSS"}),o.jsx(G,{children:o.jsx(Ke,{...e,value:e.value??"",placeholder:"custom.css",onChange:n=>{e.onChange(n.target.value),Vr.safeParse(n.target.value).success&&(document.title=n.target.value)}})}),o.jsx(Z,{})]}),o.jsx(ie,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function ah(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(U,{className:"shrink-0",children:"HTML Head"}),o.jsx(G,{children:o.jsx(Ke,{...e,value:e.value??"",placeholder:"head.html",onChange:n=>{e.onChange(n.target.value)}})}),o.jsx(Z,{})]}),o.jsxs(ie,{children:["A filepath to an HTML file to be injected into the"," ",o.jsx(he,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function ch(t){return o.jsx("option",{value:t.value,children:t.label},t.value)}function dh(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:"flex flex-row items-center space-x-1 space-y-0",children:[o.jsx(U,{children:"SQL Output Type"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"sql-output-select",onChange:n=>{e.onChange(n.target.value),et({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:Vs.map(ch)})}),o.jsx(Z,{})]}),o.jsxs(ie,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",o.jsx(he,{className:"inline",children:"native"}),". See the"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}const uh=Br("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xs-solid hover:cursor-pointer active:shadow-none dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled active:shadow-xs-solid"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),hh=Br("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-hidden text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),an=R.forwardRef((t,e)=>{const n=se.c(15);let r,i,s,l,c,a,d;return n[0]!==t?({color:i,shape:l,size:c,className:r,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=s,n[4]=l,n[5]=c):(r=n[1],i=n[2],s=n[3],l=n[4],c=n[5]),n[6]!==r||n[7]!==i||n[8]!==l||n[9]!==c?(a=Hr(uh({color:i,shape:l,size:c}),r),n[6]=r,n[7]=i,n[8]=l,n[9]=c,n[10]=a):a=n[10],n[11]!==s||n[12]!==e||n[13]!==a?(d=o.jsx("button",{ref:e,className:a,...s,children:s.children}),n[11]=s,n[12]=e,n[13]=a,n[14]=d):d=n[14],d});an.displayName="Button",R.forwardRef((t,e)=>{const n=se.c(9);let r,i,s,l;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=Hr(hh(),r),n[3]=r,n[4]=s):s=n[4],n[5]!==i||n[6]!==e||n[7]!==s?(l=o.jsx("input",{ref:e,className:s,...i}),n[5]=i,n[6]=e,n[7]=s,n[8]=l):l=n[8],l}).displayName="Input";let cn=null;class fh{constructor(e){this.view=void 0,this.abortController=new AbortController,this.view=e.view,this.view.dom.addEventListener("focus",()=>{cn=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){const e=this.view.dom.querySelector(".cm-vimCursorLayer");if(e instanceof HTMLElement)if(_l())e.style.display="none";else{const n=(cn==null?void 0:cn.deref())===this.view;e.style.display=n?"":"none"}}destroy(){this.abortController.abort()}}const Bs={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 ph(t,e){const n=t.split(/\s+/),r=n[0];let i=0;if(r in Bs){const s=Bs[r],l={};for(const a of s.args||[]){if(i+=1,!(i<n.length))return void(e&&e(`Not enough arguments for "${r}" command: "${t}"`));l[a]=n[i]}const c={name:r};return"args"in s&&(c.args=l),"mode"in s&&(c.mode=s.mode),c}e&&e(`Unknown vimrc command: "${t}"`)}var Hs;const gh=tt(()=>{ge.defineAction("goToDefinition",t=>{const e=t.cm6;return Fl(e)}),ge.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),ge.defineEx("write","w",t=>{const e=t.cm6;e&&e.state.facet(At).saveNotebook()})}),mh=tt(async()=>{var n;const t=Ft.get(Gr),e=(n=t.keymap)==null?void 0:n.vimrc;if(e)try{ue.log(`Loading vimrc from ${e}`);const r=(await Ll().sendFileDetails({path:e})).contents;if(!r)return void ue.error(`Failed to load vimrc from ${e}`);const i=function(s,l){const c=[];for(const a of s.split(`
17
+ `)){if(a.startsWith('"')||a.trim()==="")continue;const d=ph(a,l);d&&c.push(d)}return c}(r,ue.warn);(function(s){function l(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ge.map(u.args.lhs,u.args.rhs,u.mode):ge.map(u.args.lhs,u.args.rhs):ue.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function c(u){u.args&&u.args.lhs&&u.args.rhs?u.mode?ge.noremap(u.args.lhs,u.args.rhs,u.mode):ge.noremap(u.args.lhs,u.args.rhs):ue.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function a(u){u.args&&u.args.lhs?u.mode?ge.unmap(u.args.lhs,u.mode):ge.unmap(u.args.lhs):ue.warn(`Could not execute vimrc command "${u.name}: expected arguments"`)}function d(u){u.mode?ge.mapclear(u.mode):ge.mapclear()}for(const u of s)"map|nmap|vmap|imap".split("|").includes(u.name)?l(u):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(u.name)?c(u):"unmap|nunmap|vunmap|iunmap".split("|").includes(u.name)?a(u):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(u.name)?d(u):ue.warn(`Could not execute vimrc command "${u.name}: unknown command"`)})(i)}catch(r){ue.error("Failed to load vimrc:",r)}});class dn{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||(bn("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))}):ue.warn("Expected CodeMirror instance to have CodeMirror instance state")}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,n,r){bn("exitInsertMode"in ge,"Vim does not have an exitInsertMode method"),bn("exitVisualMode"in ge,"Vim does not have an exitVisualMode method");for(const i of this.instances)if(i!==e){const s=Rt(i);if(!s){ue.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}const l=s.setSelections.bind(s);if(s.setSelections=()=>[],!Us(s)){ue.warn("Expected CodeMirror instance to have Vim state");continue}const c=s.state.vim;switch(n){case"normal":c.insertMode&&ge.exitInsertMode(s,!0),c.visualMode&&ge.exitVisualMode(s,!0);break;case"insert":c.insertMode||ge.handleKey(s,"i","")}s.setSelections=l}}}function Us(t){return t.state.vim!==void 0}Hs=dn,dn.INSTANCES=new Hs;const vh=["default","vim"];function yh(t,e){switch(t.preset){case"default":return[Fe.of(qs()),Fe.of(Ws(e))];case"vim":return[Fe.of(bh()),Fe.of(Ws(e)),Fe.of([{key:"Enter",run:n=>{var i;const r=Rt(n);return!!((i=r==null?void 0:r.state.vim)!=null&&i.insertMode)&&Vl(n)}}]),Yr.high(wh("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(n.state.facet(At).deleteCell(),!0):!1)),$l({status:!1}),Yr.high((gh(),mh(),[Fe.of([{key:"j",run:n=>{if(Al(n,!0)&&qr(n)){const r=n.state.facet(At),i=n.state.facet(Wr);return r.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Fe.of([{key:"k",run:n=>{if(Rl(n)&&qr(n)){const r=n.state.facet(At),i=n.state.facet(Wr);return r.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Fe.of([{linux:"Ctrl-[",win:"Ctrl-[",run:n=>{const r=Rt(n);return r?Us(r)?!!r.state.vim.insertMode&&(ge.exitInsertMode(r,!0),!0):(ue.warn("Expected CodeMirror instance to have Vim state"),!1):(ue.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),Ur.define(n=>(requestAnimationFrame(()=>{dn.INSTANCES.addInstance(n)}),{destroy(){dn.INSTANCES.removeInstance(n)}})),Ur.define(n=>new fh({view:n})),Ml.domEventHandlers({keydown:(n,r)=>!(!n.ctrlKey||n.key!=="Escape"||(r.dom.dispatchEvent(new KeyboardEvent(n.type,n)),0))})]))];default:return zl(t.preset),[]}}const xh=new Set([Xr,Qr]),qs=tt(()=>Bl.filter(t=>!xh.has(t.run))),Ws=t=>[{key:t.getHotkey("cell.toggleComment").key,run:Xr},{key:t.getHotkey("cell.toggleBlockComment").key,run:Qr}],bh=tt(()=>{const t=new Set(["Enter","Ctrl-v"]);return qs().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function wh(t,e,n){let r="",i=0;return Fe.of([{any:(s,l)=>{const c=l.key,a=l.timeStamp;return c!==t||!e(s)?(r="",i=0,!1):r===t&&a-i<500&&n(s)?(r="",i=0,!0):(r=c,i=a,!1)}}])}const yr=ft(!1),jh=()=>{const t=se.c(82),[e,n]=pt(yr),[r,i]=y.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];const[l,c]=y.useState(s),[a,d]=Zr(),u=Lt(Hl),{saveUserConfig:f}=Je();let p,m;t[1]!==n?(p=()=>n(Sh),t[1]=n,t[2]=p):p=t[2],Ul("global.showHelp",p),t[3]!==a||t[4]!==f||t[5]!==d?(m=async te=>{const H={...a};d(te),await f({config:te}).catch(X=>{throw d(H),X})},t[3]=a,t[4]=f,t[5]=d,t[6]=m):m=t[6];const h=m;let g;t[7]!==a||t[8]!==r||t[9]!==h?(g=async te=>{if(!r)return;const H=te.join("-"),X={...a,keymap:{...a.keymap,overrides:{...a.keymap.overrides,[r]:H}}};i(null),c([]),await h(X)},t[7]=a,t[8]=r,t[9]=h,t[10]=g):g=t[10];const v=g;let x,j,S;if(t[11]!==a||t[12]!==r||t[13]!==v||t[14]!==u||t[15]!==e||t[16]!==l||t[17]!==h){S=Symbol.for("react.early_return_sentinel");{const te=async()=>{if(!r)return;const X={...a,keymap:{...a.keymap,overrides:{...a.keymap.overrides}}};delete X.keymap.overrides[r],i(null),c([]),await h(X)};let H;t[21]!==a||t[22]!==h?(H=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;const X={...a,keymap:{...a.keymap,overrides:{}}};i(null),c([]),await h(X)},t[21]=a,t[22]=h,t[23]=H):H=t[23],x=H,e?j=X=>{const ce=u.getHotkey(X);if(r===X){const we=ql(X);return o.jsxs("div",{children:[o.jsx(Ke,{defaultValue:l.join("+"),placeholder:ce.name,onKeyDown:de=>{de.preventDefault();const je=[];if(de.key==="Meta"||de.key==="Control"||de.key==="Alt"||de.key==="Shift"||(de.metaKey&&je.push(ei()?"Cmd":"Meta"),de.ctrlKey&&je.push("Ctrl"),de.altKey&&je.push("Alt"),de.shiftKey&&je.push("Shift"),de.key==="-"))return;if(de.key==="Escape"&&je.length===0)return i(null),void c([]);let Ae=de.key.toLowerCase();de.key===" "&&(Ae="Space"),je.push(Ae),v(je)},autoFocus:!0,endAdornment:o.jsx(ve,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{i(null),c([])},children:o.jsx(zt,{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"}),we.key!==ce.key&&o.jsxs("span",{className:"text-xs cursor-pointer text-primary",onClick:te,children:["Reset to default:"," ",o.jsx("span",{className:"font-mono",children:we.key})]})]})]},X)}return o.jsxs("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[u.isEditable(X)?o.jsx(ti,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{c([]),i(X)}}):o.jsx("div",{className:"w-3 h-3"}),o.jsx(Jr,{className:"justify-end",shortcut:ce.key}),o.jsx("span",{children:ce.name.toLowerCase()})]},X)}:S=null}t[11]=a,t[12]=r,t[13]=v,t[14]=u,t[15]=e,t[16]=l,t[17]=h,t[18]=x,t[19]=j,t[20]=S}else x=t[18],j=t[19],S=t[20];if(S!==Symbol.for("react.early_return_sentinel"))return S;const C=j;let k,D,N,P,O,_,L,M,B,I,K,F,z,$,w,V,E,b,T,ne,le,Q,J,re,A;if(t[24]!==a.keymap.preset||t[25]!==u||t[26]!==e||t[27]!==C||t[28]!==n){const te=u.getHotkeyGroups(),H=(ce,we)=>{const de=te[ce];return o.jsxs("div",{className:"mb-[40px] gap-2 flex flex-col",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-medium",children:ce}),we]}),de.map(C)]})},X=ce=>H(ce,o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",a.keymap.preset==="vim"?o.jsxs(o.Fragment,{children:[o.jsx(Jr,{shortcut:ei()?"Cmd":"Ctrl"}),o.jsx(he,{children:"Esc"})]}):o.jsx(he,{children:"Esc"})," ","in a cell to enter command mode"]}));N=wn,z=e,t[47]!==n?($=ce=>n(ce),t[47]=n,t[48]=$):$=t[48],D=Wl,K="sm:items-center sm:top-0",t[49]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(Gl,{}),t[49]=F):F=t[49],k=ni,M=!1,B="max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",t[50]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(Yl,{children:o.jsx(ri,{children:"Shortcuts"})}),t[50]=I):I=t[50],_="flex flex-row gap-3",L=o.jsxs("div",{className:"w-1/2",children:[H("Editing"),H("Markdown")]}),w="w-1/2",V=H("Navigation"),E=H("Running Cells"),b=H("Creation and Ordering"),P=X("Command"),O=H("Other"),t[24]=a.keymap.preset,t[25]=u,t[26]=e,t[27]=C,t[28]=n,t[29]=k,t[30]=D,t[31]=N,t[32]=P,t[33]=O,t[34]=_,t[35]=L,t[36]=M,t[37]=B,t[38]=I,t[39]=K,t[40]=F,t[41]=z,t[42]=$,t[43]=w,t[44]=V,t[45]=E,t[46]=b}else k=t[29],D=t[30],N=t[31],P=t[32],O=t[33],_=t[34],L=t[35],M=t[36],B=t[37],I=t[38],K=t[39],F=t[40],z=t[41],$=t[42],w=t[43],V=t[44],E=t[45],b=t[46];return t[51]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx("span",{className:"text-destructive",children:"Reset all to default"}),t[51]=T):T=t[51],t[52]!==x?(ne=o.jsx(ve,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:x,tabIndex:-1,children:T}),t[52]=x,t[53]=ne):ne=t[53],t[54]!==P||t[55]!==O||t[56]!==ne||t[57]!==w||t[58]!==V||t[59]!==E||t[60]!==b?(le=o.jsxs("div",{className:w,children:[V,E,b,P,O,ne]}),t[54]=P,t[55]=O,t[56]=ne,t[57]=w,t[58]=V,t[59]=E,t[60]=b,t[61]=le):le=t[61],t[62]!==_||t[63]!==L||t[64]!==le?(Q=o.jsxs("div",{className:_,children:[L,le]}),t[62]=_,t[63]=L,t[64]=le,t[65]=Q):Q=t[65],t[66]!==k||t[67]!==M||t[68]!==B||t[69]!==I||t[70]!==Q?(J=o.jsxs(k,{usePortal:M,className:B,children:[I,Q]}),t[66]=k,t[67]=M,t[68]=B,t[69]=I,t[70]=Q,t[71]=J):J=t[71],t[72]!==D||t[73]!==K||t[74]!==F||t[75]!==J?(re=o.jsxs(D,{className:K,children:[F,J]}),t[72]=D,t[73]=K,t[74]=F,t[75]=J,t[76]=re):re=t[76],t[77]!==N||t[78]!==z||t[79]!==$||t[80]!==re?(A=o.jsx(N,{open:z,onOpenChange:$,children:re}),t[77]=N,t[78]=z,t[79]=$,t[80]=re,t[81]=A):A=t[81],A};function Sh(t){return!t}var kh=Xl();const Gs="marimo:copilot:signedIn",Ys=Jl(Gs,null,void 0,{getOnInit:!0}),Xs=ft(null),un=ft(null);function Qs(){const t=localStorage.getItem(Gs)==="true",e=Ql();return t&&e.completion.copilot==="github"}const De=ue.get("@github/copilot-language-server");class Ch extends ea{constructor(...e){super(...e),this.documentVersion=0,this.hasOpenedDocument=!1,this.getCompletionInternal=async(n,r)=>await this._request("textDocument/inlineCompletion",{...n,textDocument:{...n.textDocument,version:r}}),this.throttledGetCompletionInternal=function(n,r,i){var s=!0,l=!0;if(typeof n!="function")throw new TypeError("Expected a function");return cl(i)&&(s="leading"in i?!!i.leading:s,l="trailing"in i?!!i.trailing:l),dl(n,r,{leading:s,maxWait:r,trailing:l})}(this.getCompletionInternal,200)}async _request(e,n){try{return await this.request(e,n)}catch(r){throw De.error("#request: Error",r),r}}async notify(e,n){return De.debug("#notify",e,n),super.notify(e,n)}getInitializationOptions(){const e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!Qs()}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&&De.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",n);const r=n[0];"range"in r&&De.warn("#textDocumentDidChange: Copilot doesn't support range changes.",r);const i=ta(r.text);return super.textDocumentDidChange({...e,contentChanges:[{text:i}],textDocument:na.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){De.log("#signInInitiate: Starting sign-in flow");try{const e=await this._request("signIn",{});return De.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw De.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){De.log("#signInConfirm: Confirming sign-in");try{const n=await this._request("signInConfirm",e);return De.log("#signInConfirm: Sign-in confirmed successfully"),n}catch(n){throw De.warn("#signInConfirm: Failed to confirm sign-in",n),n}}async signedIn(){try{const{status:e}=await this._request("checkStatus",{});return De.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw De.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;const n=this.documentVersion;if(e.textDocument.version=n,n===0)return null;var r;r=n,Ft.set(un,r);const i=await this.throttledGetCompletionInternal(e,n);var s;return s=n,Ft.get(un)===s&&Ft.set(un,null),n!==this.documentVersion?null:i??null}}const Zs="/__marimo_copilot__.py",Js=`file://${Zs}`,Ih=tt(()=>new Nh);class Nh extends kh.Transport{constructor(){super(),this.delegate=void 0,this.delegate=void 0}getWsUrl(){return ia().getLSPURL("copilot").toString()}async tryConnect(e=3,n=1e3){for(let r=1;r<=e;r++)try{return this.delegate||(this.delegate=new oa.WebSocketTransport(this.getWsUrl())),await this.delegate.connect(),void ue.log("Copilot#connect: Connected successfully")}catch(i){if(ue.warn(`Copilot#connect: Connection attempt ${r}/${e} failed`,i),r===e)throw this.delegate=void 0,et({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 Zl(Gr,e=>e.completion.copilot==="github"),await sa(),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 Ct=tt(()=>new Ch({rootUri:Js,workspaceFolders:null,transport:Ih()}));function Dh(){return ra({documentUri:Js,client:Ct(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const el=y.memo(()=>{const[t,e]=pt(Ys),[n,r]=pt(Xs),[i,s]=y.useState(),[l,c]=y.useState(!1),a=async f=>{f.preventDefault(),c(!0);try{const{verificationUri:p,status:m,userCode:h}=await async function(){return await Ct().signInInitiate()}();rl(m)?e(!0):(r("signingIn"),s({url:p,code:h}))}finally{c(!1)}},d=async f=>{if(f.preventDefault(),i){c(!0);try{const p=await async function(m){const h=Ct();try{ue.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");const{status:g}=await h.signInConfirm({userCode:m});return rl(g)?(ue.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(ue.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:g}),{success:!1})}catch(g){return nl(g)?(ue.error("Copilot#tryFinishSignIn: Connection error during sign-in",g),{success:!1,error:"connection"}):await async function(v){for(let x=0;x<tl;x++)try{if(await new Promise(j=>setTimeout(j,Oh)),await v.signedIn())return ue.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(j){if(ue.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:x+1,maxRetries:tl}),nl(j))return{success:!1,error:"connection"}}return ue.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}(h)}}(i.code);p.success?(e(!0),r("signedIn")):p.error==="connection"?(r("connectionError"),et({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:o.jsx(ve,{onClick:a,children:"Retry"})})):r("signInFailed")}finally{c(!1)}}},u=async f=>{f.preventDefault(),await async function(){await Ct().signOut()}(),e(!1),r("signedOut")};return(()=>{switch(n??(t?"signedIn":"connecting")){case"connecting":return o.jsx(He,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return o.jsx(ve,{onClick:a,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:i==null?void 0:i.code}),o.jsx(aa,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{i&&(await ca(i.code),et({description:"Copied to clipboard"}))}})]})}),o.jsxs("li",{children:["Enter the code at this link:",o.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:da({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),o.jsxs("li",{children:["Click here when done:",o.jsxs(ve,{size:"xs",onClick:d,className:"ml-1",children:[l&&o.jsx(ii,{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(ii,{className:"h-3 w-3 mr-1 animate-spin"}):o.jsx(ve,{onClick:a,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsxs(He,{className:"font-normal flex items-center",children:[o.jsx("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:o.jsx(la,{className:"h-3 w-3 text-white"})}),"Connected"]}),o.jsx(ve,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(He,{className:"font-normal flex",children:[o.jsx(zt,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),o.jsx("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),o.jsx(ve,{onClick:a,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(He,{className:"font-normal flex",children:[o.jsx(zt,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),o.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",o.jsx(me,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});el.displayName="CopilotConfig";const tl=5,Oh=3e3;function nl(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function rl(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}const Eh=["us-east-1","us-east-2","us-west-2","eu-central-1","ap-northeast-1","ap-southeast-1"],il=t=>{const e=se.c(12),{value:n,includeSuggestion:r}=t,i=r===void 0||r;if(!n||n.includes("/"))return null;let s;e[0]!==n?(s=gt.parse(n),e[0]=n,e[1]=s):s=e[1];const l=s.id;let c,a,d,u,f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2],e[3]!==n?(a=o.jsxs("span",{children:["Model id should be in the form"," ",c,". ",n," is missing a provider."]}),e[3]=n,e[4]=a):a=e[4],e[5]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("br",{}),e[5]=d):d=e[5],e[6]!==i||e[7]!==l?(u=i&&l&&o.jsxs("span",{children:["Did you mean ",o.jsx("code",{className:"font-bold",children:l}),"?"]}),e[6]=i,e[7]=l,e[8]=u):u=e[8],e[9]!==a||e[10]!==u?(f=o.jsxs($t,{kind:"danger",className:"mt-1",children:[a,d,u]}),e[9]=a,e[10]=u,e[11]=f):f=e[11],f};function ol(t,e){const n=se.c(10);let r;n[0]!==e||n[1]!==t?(r=oi(t,e),n[0]=e,n[1]=t,n[2]=r):r=n[2];const i=r,s=Lt(ua);let l;n[3]!==e||n[4]!==s?(l=oi(s,e),n[3]=e,n[4]=s,n[5]=l):l=n[5];const c=l,a=c!=null&&i!==c;let d;return n[6]!==i||n[7]!==a||n[8]!==c?(d={isOverridden:a,currentValue:i,overriddenValue:c},n[6]=i,n[7]=a,n[8]=c,n[9]=d):d=n[9],d}const Th=t=>{const e=se.c(3),{name:n,children:r}=t,[i]=si(),{isOverridden:s}=ol(i,n);let l;return e[0]!==r||e[1]!==s?(l=s?o.jsx(Ue,{delayDuration:200,content:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("p",{children:["This setting is overridden by the"," ",o.jsx(he,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),o.jsxs("p",{children:["To change it, edit the project config"," ",o.jsx(he,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:o.jsx("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:r})}):r,e[0]=r,e[1]=s,e[2]=l):l=e[2],l},oe=t=>{const e=se.c(18),{userConfig:n,name:r}=t,{isOverridden:i,currentValue:s,overriddenValue:l}=ol(n,r);if(!i)return null;let c,a,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsxs("span",{children:["This setting is overridden by"," ",o.jsx(he,{className:"inline",children:"pyproject.toml"}),"."]}),a=o.jsx("br",{}),e[0]=c,e[1]=a):(c=e[0],a=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs("span",{children:["Edit the ",o.jsx(he,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),u=o.jsx("br",{}),e[2]=d,e[3]=u):(d=e[2],u=e[3]);const f=String(s);let p,m;e[4]!==f?(p=o.jsxs("span",{children:["User value: ",o.jsx("strong",{children:f})]}),e[4]=f,e[5]=p):p=e[5],e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("br",{}),e[6]=m):m=e[6];const h=String(l);let g,v,x;e[7]!==h?(g=o.jsxs("span",{children:["Project value: ",o.jsx("strong",{children:h})]}),e[7]=h,e[8]=g):g=e[8],e[9]!==p||e[10]!==g?(v=o.jsxs(o.Fragment,{children:[c,a,d,u,p,m,g]}),e[9]=p,e[10]=g,e[11]=v):v=e[11],e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(ji,{className:"w-3 h-3"}),e[12]=x):x=e[12];const j=String(l);let S,C;return e[13]!==j?(S=o.jsxs("span",{className:"text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1",children:[x,"Overridden by pyproject.toml [",j,"]"]}),e[13]=j,e[14]=S):S=e[14],e[15]!==v||e[16]!==S?(C=o.jsx(Ue,{content:v,children:S}),e[15]=v,e[16]=S,e[17]=C):C=e[17],C},at="flex flex-row items-center space-x-1 space-y-0",Ph=t=>{const e=se.c(5),{provider:n,children:r}=t;let i,s;return e[0]!==n?(i=n&&o.jsx(mt,{provider:n,className:"mr-2"}),e[0]=n,e[1]=i):i=e[1],e[2]!==r||e[3]!==i?(s=o.jsxs("div",{className:"flex items-center text-base font-semibold",children:[i,r]}),e[2]=r,e[3]=i,e[4]=s):s=e[4],s},Xe=t=>{const e=se.c(10),{form:n,config:r,name:i,placeholder:s,testId:l,description:c}=t;let a,d;return e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==s||e[4]!==l?(a=u=>{const{field:f}=u;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:at,children:[o.jsx(U,{children:"API Key"}),o.jsx(G,{children:o.jsx(Ke,{"data-testid":l,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,...f,value:It(f.value),onChange:p=>{const m=p.target.value;m.includes("*")||f.onChange(m)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:i})]}),c&&o.jsx(ie,{children:c})]})},e[0]=r,e[1]=c,e[2]=i,e[3]=s,e[4]=l,e[5]=a):a=e[5],e[6]!==n.control||e[7]!==i||e[8]!==a?(d=o.jsx(q,{control:n.control,name:i,render:a}),e[6]=n.control,e[7]=i,e[8]=a,e[9]=d):d=e[9],d};function It(t){if(t!=null)return typeof t=="string"?t:String(t)}const Nt=t=>{const e=se.c(12),{form:n,config:r,name:i,placeholder:s,testId:l,description:c,disabled:a,defaultValue:d}=t,u=a!==void 0&&a;let f,p;return e[0]!==r||e[1]!==d||e[2]!==c||e[3]!==i||e[4]!==s||e[5]!==l?(f=m=>{const{field:h}=m;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:at,children:[o.jsx(U,{children:"Base URL"}),o.jsx(G,{children:o.jsx(Ke,{"data-testid":l,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,defaultValue:d,...h,value:It(h.value)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:i})]}),c&&o.jsx(ie,{children:c})]})},e[0]=r,e[1]=d,e[2]=c,e[3]=i,e[4]=s,e[5]=l,e[6]=f):f=e[6],e[7]!==u||e[8]!==n.control||e[9]!==i||e[10]!==f?(p=o.jsx(q,{control:n.control,name:i,disabled:u,render:f}),e[7]=u,e[8]=n.control,e[9]=i,e[10]=f,e[11]=p):p=e[11],p},xr=t=>{const e=se.c(14),{form:n,config:r,name:i,placeholder:s,testId:l,description:c,disabled:a,label:d,onSubmit:u}=t,f=a!==void 0&&a;let p,m;return e[0]!==r||e[1]!==c||e[2]!==n||e[3]!==d||e[4]!==i||e[5]!==u||e[6]!==s||e[7]!==l?(p=h=>{const{field:g}=h,v=It(g.value),x=j=>{g.onChange(j),u(n.getValues())};return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:at,children:[o.jsx(U,{children:d}),o.jsx(G,{children:o.jsx(ka,{value:v,placeholder:s,onSelect:x,triggerClassName:"text-sm",customDropdownContent:o.jsxs(o.Fragment,{children:[o.jsx(Ca,{}),o.jsxs("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",o.jsx(Ue,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:o.jsx(Ia,{className:"h-3 w-3"})})]}),o.jsxs("div",{className:"px-2 py-1",children:[o.jsx(Ke,{"data-testid":l,className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:s,...g,value:It(g.value),onKeyDown:pi.stopPropagation()}),v&&o.jsx(il,{value:v,includeSuggestion:!1})]})]})})}),o.jsx(Z,{})]}),o.jsx(oe,{userConfig:r,name:i}),o.jsx(il,{value:v}),c&&o.jsx(ie,{children:c})]})},e[0]=r,e[1]=c,e[2]=n,e[3]=d,e[4]=i,e[5]=u,e[6]=s,e[7]=l,e[8]=p):p=e[8],e[9]!==f||e[10]!==n.control||e[11]!==i||e[12]!==p?(m=o.jsx(q,{control:n.control,name:i,disabled:f,render:p}),e[9]=f,e[10]=n.control,e[11]=i,e[12]=p,e[13]=m):m=e[13],m},Kh=t=>{const e=se.c(10),{form:n,config:r,name:i,options:s,testId:l,disabled:c}=t,a=c!==void 0&&c;let d,u;return e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==l?(d=f=>{const{field:p}=f;return o.jsx("div",{className:"flex flex-col space-y-1",children:o.jsxs(W,{className:at,children:[o.jsx(U,{children:"Provider"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":l,onChange:m=>{m.target.value==="none"?p.onChange(!1):p.onChange(m.target.value)},value:It(p.value===!0?"github":p.value===!1?"none":p.value),disabled:p.disabled,className:"inline-flex mr-2",children:s.map(Bh)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:i})]})})},e[0]=r,e[1]=i,e[2]=s,e[3]=l,e[4]=d):d=e[4],e[5]!==a||e[6]!==n.control||e[7]!==i||e[8]!==d?(u=o.jsx(q,{control:n.control,name:i,disabled:a,render:d}),e[5]=a,e[6]=n.control,e[7]=i,e[8]=d,e[9]=u):u=e[9],u},hn=t=>{const e=se.c(5),{children:n,className:r}=t;let i,s;return e[0]!==r?(i=Be("flex flex-col gap-4 pb-4",r),e[0]=r,e[1]=i):i=e[1],e[2]!==n||e[3]!==i?(s=o.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s},_h=t=>{const e=se.c(24),{qualifiedId:n,model:r,isEnabled:i,onToggle:s,onDelete:l}=t;let c;e[0]!==s||e[1]!==n?(c=()=>{s(n)},e[0]=s,e[1]=n,e[2]=c):c=e[2];const a=c;let d;e[3]!==l||e[4]!==n?(d=v=>{v.stopPropagation(),v.preventDefault(),l(n)},e[3]=l,e[4]=n,e[5]=d):d=e[5];const u=d;let f,p,m,h,g;return e[6]!==r||e[7]!==n?(f=o.jsx(Mh,{model:r,qualifiedId:n}),e[6]=r,e[7]=n,e[8]=f):f=e[8],e[9]!==u||e[10]!==r.custom?(p=r.custom&&o.jsx(ve,{variant:"ghost",size:"icon",onClick:u,className:"mr-2 hover:bg-transparent",children:o.jsx(Na,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[9]=u,e[10]=r.custom,e[11]=p):p=e[11],e[12]!==a||e[13]!==i?(m=o.jsx(Da,{checked:i,onClick:a,size:"sm"}),e[12]=a,e[13]=i,e[14]=m):m=e[14],e[15]!==f||e[16]!==p||e[17]!==m?(h=o.jsx(Yi,{children:o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b last:border-b-0 cursor-pointer outline-none",children:[f,p,m]})}),e[15]=f,e[16]=p,e[17]=m,e[18]=h):h=e[18],e[19]!==a||e[20]!==r.name||e[21]!==n||e[22]!==h?(g=o.jsx(Qi,{id:n,textValue:r.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:a,children:h}),e[19]=a,e[20]=r.name,e[21]=n,e[22]=h,e[23]=g):g=e[23],g},Mh=t=>{const e=se.c(21),{model:n,qualifiedId:r}=t;let i,s,l,c,a,d,u,f;return e[0]!==n.name?(i=o.jsx("h3",{className:"font-medium",children:n.name}),e[0]=n.name,e[1]=i):i=e[1],e[2]!==n.custom?(s=n.custom&&o.jsx(Oa,{className:"h-4 w-4"}),e[2]=n.custom,e[3]=s):s=e[3],e[4]!==s?(l=o.jsx(Ue,{content:"Custom model",children:s}),e[4]=s,e[5]=l):l=e[5],e[6]!==i||e[7]!==l?(c=o.jsxs("div",{className:"flex items-center gap-2",children:[i,l]}),e[6]=i,e[7]=l,e[8]=c):c=e[8],e[9]!==r?(a=o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:r}),e[9]=r,e[10]=a):a=e[10],e[11]!==n.custom||e[12]!==n.description?(d=n.description&&!n.custom&&o.jsx("p",{className:"text-sm text-muted-secondary mt-1 line-clamp-2",children:n.description}),e[11]=n.custom,e[12]=n.description,e[13]=d):d=e[13],e[14]!==n.thinking?(u=n.thinking&&o.jsxs("div",{className:Be("flex items-center gap-1 rounded px-1 py-0.5 w-fit mt-1.5",Ea("thinking")),children:[o.jsx(gi,{className:"h-3 w-3"}),o.jsx("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[14]=n.thinking,e[15]=u):u=e[15],e[16]!==c||e[17]!==a||e[18]!==d||e[19]!==u?(f=o.jsx("div",{className:"flex items-center gap-3 flex-1",children:o.jsxs("div",{className:"flex flex-col flex-1",children:[c,a,d,u]})}),e[16]=c,e[17]=a,e[18]=d,e[19]=u,e[20]=f):f=e[20],f},Ah=t=>{const e=se.c(13),{form:n,config:r,onSubmit:i}=t;let s,l,c,a,d,u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(sn,{children:"Code Completion"}),l=o.jsx("p",{className:"text-sm text-muted-secondary",children:"Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion."}),e[0]=s,e[1]=l):(s=e[0],l=e[1]),e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2],e[3]!==r||e[4]!==n?(a=o.jsx(Kh,{form:n,config:r,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=r,e[4]=n,e[5]=a):a=e[5],e[6]!==r||e[7]!==n||e[8]!==i?(d=(({form:f,config:p,onSubmit:m})=>{const h=f.getValues("completion.copilot");return h===!1?null:h==="codeium"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),o.jsx(Xe,{form:f,config:p,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]}):h==="github"?o.jsx(el,{}):h==="custom"?o.jsx(xr,{label:"Autocomplete Model",form:f,config:p,name:"ai.models.autocomplete_model",placeholder:"ollama/qwen2.5-coder:1.5b",testId:"custom-model-input",description:"Model to use for code completion when using a custom provider.",onSubmit:m}):void 0})({form:n,config:r,onSubmit:i}),e[6]=r,e[7]=n,e[8]=i,e[9]=d):d=e[9],e[10]!==a||e[11]!==d?(u=o.jsxs(hn,{children:[s,l,a,d]}),e[10]=a,e[11]=d,e[12]=u):u=e[12],u},$e=t=>{const e=se.c(15),{title:n,triggerClassName:r,provider:i,children:s,isConfigured:l}=t;let c,a,d,u,f;return e[0]!==l?(c=l&&o.jsx("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=l,e[1]=c):c=e[1],e[2]!==i||e[3]!==c||e[4]!==n?(a=o.jsxs(Ph,{provider:i,children:[n,c]}),e[2]=i,e[3]=c,e[4]=n,e[5]=a):a=e[5],e[6]!==a||e[7]!==r?(d=o.jsx(Ta,{className:r,children:a}),e[6]=a,e[7]=r,e[8]=d):d=e[8],e[9]!==s?(u=o.jsx(Pa,{wrapperClassName:"flex flex-col gap-4",children:s}),e[9]=s,e[10]=u):u=e[10],e[11]!==i||e[12]!==d||e[13]!==u?(f=o.jsxs(Ka,{value:i,children:[d,u]}),e[11]=i,e[12]=d,e[13]=u,e[14]=f):f=e[14],f},Rh=t=>{const e=se.c(88),{form:n,config:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=qe(),e[0]=i):i=e[0];const s=i;let l;e[1]!==n?(l=we=>!!n.getValues(we),e[1]=n,e[2]=l):l=e[2];const c=l;let a,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(he,{className:"inline",children:"marimo.toml"}),e[3]=a):a=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsxs("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",a," ","to set up a provider for the Code Completion and Assistant features; see"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=d):d=e[4];const u=c("ai.open_ai.api_key");let f,p,m,h;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsxs(o.Fragment,{children:["Your OpenAI API key from"," ",o.jsx(me,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=f):f=e[5],e[6]!==r||e[7]!==n?(p=o.jsx(Xe,{form:n,config:r,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:f}),m=o.jsx(Nt,{form:n,config:r,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:s}),e[6]=r,e[7]=n,e[8]=p,e[9]=m):(p=e[8],m=e[9]),e[10]!==u||e[11]!==p||e[12]!==m?(h=o.jsxs($e,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:u,children:[p,m]}),e[10]=u,e[11]=p,e[12]=m,e[13]=h):h=e[13];const g=c("ai.anthropic.api_key");let v,x,j;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsxs(o.Fragment,{children:["Your Anthropic API key from"," ",o.jsx(me,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=v):v=e[14],e[15]!==r||e[16]!==n?(x=o.jsx(Xe,{form:n,config:r,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:v}),e[15]=r,e[16]=n,e[17]=x):x=e[17],e[18]!==g||e[19]!==x?(j=o.jsx($e,{title:"Anthropic",provider:"anthropic",isConfigured:g,children:x}),e[18]=g,e[19]=x,e[20]=j):j=e[20];const S=c("ai.google.api_key");let C,k,D;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsxs(o.Fragment,{children:["Your Google AI API key from"," ",o.jsx(me,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=C):C=e[21],e[22]!==r||e[23]!==n?(k=o.jsx(Xe,{form:n,config:r,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:C}),e[22]=r,e[23]=n,e[24]=k):k=e[24],e[25]!==S||e[26]!==k?(D=o.jsx($e,{title:"Google",provider:"google",isConfigured:S,children:k}),e[25]=S,e[26]=k,e[27]=D):D=e[27];const N=c("ai.ollama.base_url");let P,O;e[28]!==r||e[29]!==n?(P=o.jsx(Nt,{form:n,config:r,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",defaultValue:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=r,e[29]=n,e[30]=P):P=e[30],e[31]!==N||e[32]!==P?(O=o.jsx($e,{title:"Ollama",provider:"ollama",isConfigured:N,children:P}),e[31]=N,e[32]=P,e[33]=O):O=e[33];const _=c("ai.github.api_key");let L,M,B,I;e[34]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsxs(o.Fragment,{children:["Your GitHub API token from"," ",o.jsx(he,{className:"inline",children:"gh auth token"}),"."]}),e[34]=L):L=e[34],e[35]!==r||e[36]!==n?(M=o.jsx(Xe,{form:n,config:r,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:L}),B=o.jsx(Nt,{form:n,config:r,name:"ai.github.base_url",placeholder:"https://api.githubcopilot.com/",testId:"ai-github-base-url-input"}),e[35]=r,e[36]=n,e[37]=M,e[38]=B):(M=e[37],B=e[38]),e[39]!==_||e[40]!==M||e[41]!==B?(I=o.jsxs($e,{title:"GitHub",provider:"github",isConfigured:_,children:[M,B]}),e[39]=_,e[40]=M,e[41]=B,e[42]=I):I=e[42];const K=c("ai.azure.api_key")&&c("ai.azure.base_url");let F,z,$,w;e[43]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsxs(o.Fragment,{children:["Your Azure API key from"," ",o.jsx(me,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[43]=F):F=e[43],e[44]!==r||e[45]!==n?(z=o.jsx(Xe,{form:n,config:r,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:F}),$=o.jsx(Nt,{form:n,config:r,name:"ai.azure.base_url",placeholder:"https://<your-resource-name>.openai.azure.com",testId:"ai-azure-base-url-input"}),e[44]=r,e[45]=n,e[46]=z,e[47]=$):(z=e[46],$=e[47]),e[48]!==K||e[49]!==z||e[50]!==$?(w=o.jsxs($e,{title:"Azure",provider:"azure",isConfigured:K,children:[z,$]}),e[48]=K,e[49]=z,e[50]=$,e[51]=w):w=e[51];const V=c("ai.bedrock.region_name");let E,b,T,ne,le,Q;e[52]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsxs("p",{className:"text-sm text-muted-secondary mb-2",children:["To use AWS Bedrock, you need to configure AWS credentials and region. See the"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[52]=E):E=e[52],e[53]!==r?(b=we=>{const{field:de}=we;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:at,children:[o.jsx(U,{children:"AWS Region"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"bedrock-region-select",onChange:je=>de.onChange(je.target.value),value:typeof de.value=="string"?de.value:"us-east-1",disabled:de.disabled,className:"inline-flex mr-2",children:Eh.map(Hh)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:"ai.bedrock.region_name"})]}),o.jsx(ie,{children:"The AWS region where Bedrock service is available."})]})},e[53]=r,e[54]=b):b=e[54],e[55]!==n.control||e[56]!==b?(T=o.jsx(q,{control:n.control,disabled:s,name:"ai.bedrock.region_name",render:b}),e[55]=n.control,e[56]=b,e[57]=T):T=e[57],e[58]!==r?(ne=we=>{const{field:de}=we;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:at,children:[o.jsx(U,{children:"AWS Profile Name (Optional)"}),o.jsx(G,{children:o.jsx(Ke,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...de,value:de.value||""})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:"ai.bedrock.profile_name"})]}),o.jsx(ie,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[58]=r,e[59]=ne):ne=e[59],e[60]!==n.control||e[61]!==ne?(le=o.jsx(q,{control:n.control,disabled:s,name:"ai.bedrock.profile_name",render:ne}),e[60]=n.control,e[61]=ne,e[62]=le):le=e[62],e[63]!==V||e[64]!==T||e[65]!==le?(Q=o.jsxs($e,{title:"AWS Bedrock",provider:"bedrock",isConfigured:V,children:[E,T,le]}),e[63]=V,e[64]=T,e[65]=le,e[66]=Q):Q=e[66];const J=c("ai.open_ai_compatible.api_key")&&c("ai.open_ai_compatible.base_url");let re,A,te,H,X,ce;return e[67]===Symbol.for("react.memo_cache_sentinel")?(re=o.jsx(o.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[67]=re):re=e[67],e[68]!==r||e[69]!==n?(A=o.jsx(Xe,{form:n,config:r,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:re}),e[68]=r,e[69]=n,e[70]=A):A=e[70],e[71]===Symbol.for("react.memo_cache_sentinel")?(te=o.jsx(o.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[71]=te):te=e[71],e[72]!==r||e[73]!==n?(H=o.jsx(Nt,{form:n,config:r,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:te}),e[72]=r,e[73]=n,e[74]=H):H=e[74],e[75]!==J||e[76]!==A||e[77]!==H?(X=o.jsxs($e,{title:"OpenAI-Compatible",provider:"openai-compatible",isConfigured:J,children:[A,H]}),e[75]=J,e[76]=A,e[77]=H,e[78]=X):X=e[78],e[79]!==j||e[80]!==D||e[81]!==O||e[82]!==I||e[83]!==w||e[84]!==Q||e[85]!==X||e[86]!==h?(ce=o.jsxs(hn,{children:[d,o.jsxs(ma,{type:"multiple",children:[h,j,D,O,I,w,Q,X]})]}),e[79]=j,e[80]=D,e[81]=O,e[82]=I,e[83]=w,e[84]=Q,e[85]=X,e[86]=h,e[87]=ce):ce=e[87],ce},Fh=t=>{const e=se.c(23),{form:n,config:r,onSubmit:i}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=qe(),e[0]=s):s=e[0];const l=s;let c,a,d,u,f,p,m,h,g,v;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(sn,{children:"AI Assistant"}),a=o.jsx(va,{}),e[1]=c,e[2]=a):(c=e[1],a=e[2]),e[3]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("span",{children:"Model to use for chat conversations in the Chat panel."}),e[3]=d):d=e[3],e[4]!==r||e[5]!==n||e[6]!==i?(u=o.jsx(xr,{label:"Chat Model",form:n,config:r,name:"ai.models.chat_model",placeholder:fi,testId:"ai-chat-model-input",disabled:l,description:d,onSubmit:i}),e[4]=r,e[5]=n,e[6]=i,e[7]=u):u=e[7],e[8]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsxs("span",{children:["Model to use for code editing with the"," ",o.jsx(he,{className:"inline",children:"Generate with AI"})," button."]}),e[8]=f):f=e[8],e[9]!==r||e[10]!==n||e[11]!==i?(p=o.jsx(xr,{label:"Edit Model",form:n,config:r,name:"ai.models.edit_model",placeholder:fi,testId:"ai-edit-model-input",disabled:l,description:f,onSubmit:i}),e[9]=r,e[10]=n,e[11]=i,e[12]=p):p=e[12],e[13]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsxs("ul",{className:"bg-muted p-2 rounded-md list-disc space-y-1 pl-6",children:[o.jsx("li",{className:"text-xs text-muted-secondary",children:'Models should include the provider name and model name separated by a slash. For example, "anthropic/claude-3-5-sonnet-latest" or "google/gemini-2.0-flash-exp"'}),o.jsx("li",{className:"text-xs text-muted-secondary",children:"Depending on the provider, we will use the respective API key and additional configuration."})]}),e[13]=m):m=e[13],e[14]!==r?(h=x=>{const{field:j}=x;return o.jsxs("div",{className:"flex flex-col",children:[o.jsxs(W,{children:[o.jsx(U,{children:"Custom Rules"}),o.jsx(G,{children:o.jsx(ya,{"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",...j,value:j.value})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:r,name:"ai.rules"})]}),o.jsx(ie,{children:"Custom rules to include in all AI completion prompts."})]})},e[14]=r,e[15]=h):h=e[15],e[16]!==n.control||e[17]!==h?(g=o.jsx(q,{control:n.control,name:"ai.rules",render:h}),e[16]=n.control,e[17]=h,e[18]=g):g=e[18],e[19]!==g||e[20]!==u||e[21]!==p?(v=o.jsxs(hn,{children:[c,a,u,p,m,g]}),e[19]=g,e[20]=u,e[21]=p,e[22]=v):v=e[22],v},Lh=t=>{const e=se.c(51),{providerId:n,models:r,enabledModels:i,onToggleModel:s,onToggleProvider:l,onDeleteModel:c}=t;let a;if(e[0]!==i||e[1]!==r||e[2]!==n){let M;e[4]!==i||e[5]!==n?(M=B=>i.has(new gt(n,B.model).id),e[4]=i,e[5]=n,e[6]=M):M=e[6],a=r.filter(M),e[0]=i,e[1]=r,e[2]=n,e[3]=a}else a=e[3];const d=a.length,u=r.length;let f;e[7]!==n?(f=di.getProviderInfo(n),e[7]=n,e[8]=f):f=e[8];const p=f;let m;e[9]!==(p==null?void 0:p.name)||e[10]!==n?(m=(p==null?void 0:p.name)||ha.startCase(n),e[9]=p==null?void 0:p.name,e[10]=n,e[11]=m):m=e[11];const h=m,g=d!==0&&(d===u||"indeterminate");let v;e[12]!==d||e[13]!==l||e[14]!==n||e[15]!==u?(v=()=>{l(n,d<u/2)},e[12]=d,e[13]=l,e[14]=n,e[15]=u,e[16]=v):v=e[16];const x=Bt(v);let j,S,C,k,D,N,P,O,_,L;if(e[17]===Symbol.for("react.memo_cache_sentinel")?(j=pi.stopPropagation(),e[17]=j):j=e[17],e[18]!==g||e[19]!==x?(S=o.jsx(fe,{checked:g,onCheckedChange:x,onClick:j}),e[18]=g,e[19]=x,e[20]=S):S=e[20],e[21]!==n?(C=o.jsx(mt,{provider:n,className:"h-5 w-5"}),e[21]=n,e[22]=C):C=e[22],e[23]!==h?(k=o.jsx("h2",{className:"font-semibold",children:h}),e[23]=h,e[24]=k):k=e[24],e[25]!==d||e[26]!==u?(D=o.jsxs("p",{className:"text-sm text-muted-secondary",children:[d,"/",u," models"]}),e[25]=d,e[26]=u,e[27]=D):D=e[27],e[28]!==k||e[29]!==D?(N=o.jsxs("div",{className:"flex items-center justify-between w-full",children:[k,D]}),e[28]=k,e[29]=D,e[30]=N):N=e[30],e[31]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(xa,{slot:"chevron",children:o.jsx(ba,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-[expanded]:rotate-90"})}),e[31]=P):P=e[31],e[32]!==N||e[33]!==S||e[34]!==C?(O=o.jsx(Yi,{children:o.jsxs("div",{className:"flex items-center gap-3 px-3 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none",children:[S,C,N,P]})}),e[32]=N,e[33]=S,e[34]=C,e[35]=O):O=e[35],e[36]!==i||e[37]!==r||e[38]!==c||e[39]!==s||e[40]!==n){let M;e[42]!==i||e[43]!==c||e[44]!==s||e[45]!==n?(M=B=>{const I=new gt(n,B.model).id;return o.jsx(_h,{qualifiedId:I,model:B,isEnabled:i.has(I),onToggle:s,onDelete:c},I)},e[42]=i,e[43]=c,e[44]=s,e[45]=n,e[46]=M):M=e[46],_=r.map(M),e[36]=i,e[37]=r,e[38]=c,e[39]=s,e[40]=n,e[41]=_}else _=e[41];return e[47]!==n||e[48]!==O||e[49]!==_?(L=o.jsxs(Qi,{id:n,hasChildItems:!0,textValue:n,className:"outline-none data-focused:bg-muted/50 group",children:[O,_]}),e[47]=n,e[48]=O,e[49]=_,e[50]=L):L=e[50],L},zh=({form:t,onSubmit:e})=>{const n=ci({control:t.control,name:"ai.models.custom_models"}),r=y.useMemo(()=>di.create({displayedModels:[],customModels:n}),[n]),i=ci({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),s=new Set(i),l=r.getGroupedModelsByProvider(),c=r.getListModelsByProvider(),a=Bt(f=>{const p=s.has(f)?i.filter(m=>m!==f):[...i,f];t.setValue("ai.models.displayed_models",p),e(t.getValues())}),d=Bt(async(f,p)=>{const m=l.get(f)||[],h=new Set(m.map(v=>new gt(f,v.model).id)),g=p?[...new Set([...i,...h])]:i.filter(v=>!h.has(v));t.setValue("ai.models.displayed_models",g),e(t.getValues())}),u=Bt(f=>{const p=n.filter(m=>m!==f);t.setValue("ai.models.custom_models",p),e(t.getValues())});return o.jsxs(hn,{className:"gap-2",children:[o.jsx("p",{className:"text-sm text-muted-secondary mb-6",children:"Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown."}),o.jsx("div",{className:"border rounded-md bg-background",children:o.jsx(Lc,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:c.map(([f,p])=>o.jsx(Lh,{providerId:f,models:p,enabledModels:s,onToggleModel:a,onToggleProvider:d,onDeleteModel:u},f))})}),o.jsx($h,{form:t,customModels:n})]})},$h=t=>{const e=se.c(69),{form:n,customModels:r}=t,[i,s]=y.useState(!1),[l,c]=y.useState(!1),[a,d]=y.useState(null),[u,f]=y.useState(""),[p,m]=y.useState(""),h=y.useId(),g=y.useId(),v=y.useId(),x=a==="custom",j=x?u:a;let S;e[0]!==p||e[1]!==j?(S=(j==null?void 0:j.trim())&&(p==null?void 0:p.trim()),e[0]=p,e[1]=j,e[2]=S):S=e[2];const C=S;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{d(null),f(""),m(""),s(!1)},e[3]=k):k=e[3];const D=k;let N;e[4]!==r||e[5]!==n||e[6]!==C||e[7]!==p||e[8]!==j?(N=()=>{if(!C)return;const Re=new gt(j,p);n.setValue("ai.models.custom_models",[Re.id,...r]),D(),c(!0),setTimeout(()=>c(!1),2e3)},e[4]=r,e[5]=n,e[6]=C,e[7]=p,e[8]=j,e[9]=N):N=e[9];const P=N;let O;e[10]!==h?(O=o.jsx(He,{htmlFor:h,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[10]=h,e[11]=O):O=e[11];const _=a||"";let L,M,B,I,K,F,z,$;e[12]===Symbol.for("react.memo_cache_sentinel")?(L=Re=>d(Re),e[12]=L):L=e[12],e[13]!==a?(M=a?o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(mt,{provider:a,className:"h-3.5 w-3.5"}),o.jsx("span",{children:ui(a)})]}):o.jsx("span",{className:"text-muted-foreground",children:"Select..."}),e[13]=a,e[14]=M):M=e[14],e[15]!==h||e[16]!==M?(B=o.jsx(wa,{id:h,className:"w-40 truncate",children:M}),e[15]=h,e[16]=M,e[17]=B):B=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(fa,{children:o.jsxs(pa,{children:[o.jsx(hi,{value:"custom",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(mt,{provider:"openai-compatible",className:"h-4 w-4"}),o.jsx("span",{children:"Custom"})]})}),ga.filter(Uh).map(qh)]})}),e[18]=I):I=e[18],e[19]!==_||e[20]!==B?(K=o.jsxs(ja,{value:_,onValueChange:L,children:[B,I]}),e[19]=_,e[20]=B,e[21]=K):K=e[21],e[22]!==K||e[23]!==O?(F=o.jsxs("div",{className:"flex items-center gap-2",children:[O,K]}),e[22]=K,e[23]=O,e[24]=F):F=e[24],e[25]!==g||e[26]!==u||e[27]!==x?(z=x&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(He,{htmlFor:g,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),o.jsx(Ke,{id:g,value:u,onChange:Re=>f(Re.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[25]=g,e[26]=u,e[27]=x,e[28]=z):z=e[28],e[29]!==F||e[30]!==z?($=o.jsxs("div",{className:"flex flex-col gap-2",children:[F,z]}),e[29]=F,e[30]=z,e[31]=$):$=e[31];const w=$,V=x&&"self-start";let E,b,T,ne,le;e[32]!==V?(E=Be("flex items-center gap-2",V),e[32]=V,e[33]=E):E=e[33],e[34]!==v?(b=o.jsx(He,{htmlFor:v,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[34]=v,e[35]=b):b=e[35],e[36]===Symbol.for("react.memo_cache_sentinel")?(T=Re=>m(Re.target.value),e[36]=T):T=e[36],e[37]!==p||e[38]!==v?(ne=o.jsx(Ke,{id:v,value:p,onChange:T,placeholder:"gpt-4",className:"text-xs mb-0"}),e[37]=p,e[38]=v,e[39]=ne):ne=e[39],e[40]!==E||e[41]!==b||e[42]!==ne?(le=o.jsxs("div",{className:E,children:[b,ne]}),e[40]=E,e[41]=b,e[42]=ne,e[43]=le):le=e[43];const Q=le,J=x&&"self-end";let re;e[44]!==J?(re=Be("flex gap-1.5 ml-auto",J),e[44]=J,e[45]=re):re=e[45];const A=!C;let te,H,X,ce;e[46]!==P||e[47]!==A?(te=o.jsx(ve,{onClick:P,disabled:A,size:"xs",children:"Add"}),e[46]=P,e[47]=A,e[48]=te):te=e[48],e[49]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(ve,{variant:"outline",onClick:D,size:"xs",children:"Cancel"}),e[49]=H):H=e[49],e[50]!==re||e[51]!==te?(X=o.jsxs("div",{className:re,children:[te,H]}),e[50]=re,e[51]=te,e[52]=X):X=e[52],e[53]!==Q||e[54]!==w||e[55]!==X?(ce=o.jsxs("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[w,Q,X]}),e[53]=Q,e[54]=w,e[55]=X,e[56]=ce):ce=e[56];const we=i&&ce;let de,je,Ae,Qe,Ze,Ot;return e[57]===Symbol.for("react.memo_cache_sentinel")?(de=Re=>{Re.preventDefault(),s(!0)},e[57]=de):de=e[57],e[58]===Symbol.for("react.memo_cache_sentinel")?(je=o.jsx(Sa,{className:"h-4 w-4 mr-2 mb-0.5"}),e[58]=je):je=e[58],e[59]!==i?(Ae=o.jsxs(ve,{onClick:de,variant:"link",disabled:i,children:[je,"Add Model"]}),e[59]=i,e[60]=Ae):Ae=e[60],e[61]!==l?(Qe=l&&o.jsx("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[61]=l,e[62]=Qe):Qe=e[62],e[63]!==Ae||e[64]!==Qe?(Ze=o.jsxs("div",{className:"flex flex-row text-sm",children:[Ae,Qe]}),e[63]=Ae,e[64]=Qe,e[65]=Ze):Ze=e[65],e[66]!==we||e[67]!==Ze?(Ot=o.jsxs("div",{children:[we,Ze]}),e[66]=we,e[67]=Ze,e[68]=Ot):Ot=e[68],Ot},Vh=t=>{const e=se.c(17),{form:n,config:r,onSubmit:i}=t;let s,l,c,a,d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsxs(li,{className:"mb-2",children:[o.jsx(Vt,{value:"ai-features",children:"AI Features"}),o.jsx(Vt,{value:"ai-providers",children:"AI Providers"}),o.jsx(Vt,{value:"ai-models",children:"AI Models"})]}),e[0]=s):s=e[0],e[1]!==r||e[2]!==n||e[3]!==i?(l=o.jsxs(jn,{value:"ai-features",children:[o.jsx(Ah,{form:n,config:r,onSubmit:i}),o.jsx(Fh,{form:n,config:r,onSubmit:i})]}),e[1]=r,e[2]=n,e[3]=i,e[4]=l):l=e[4],e[5]!==r||e[6]!==n||e[7]!==i?(c=o.jsx(jn,{value:"ai-providers",children:o.jsx(Rh,{form:n,config:r,onSubmit:i})}),e[5]=r,e[6]=n,e[7]=i,e[8]=c):c=e[8],e[9]!==r||e[10]!==n||e[11]!==i?(a=o.jsx(jn,{value:"ai-models",children:o.jsx(zh,{form:n,config:r,onSubmit:i})}),e[9]=r,e[10]=n,e[11]=i,e[12]=a):a=e[12],e[13]!==l||e[14]!==c||e[15]!==a?(d=o.jsxs(ai,{defaultValue:"ai-features",className:"flex-1",children:[s,l,c,a]}),e[13]=l,e[14]=c,e[15]=a,e[16]=d):d=e[16],d};function Bh(t){return o.jsx("option",{value:t,children:t},t)}function Hh(t){return o.jsx("option",{value:t,children:t},t)}function Uh(t){return t!=="marimo"}function qh(t){return o.jsx(hi,{value:t,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(mt,{provider:t,className:"h-4 w-4"}),o.jsx("span",{children:ui(t)})]})},t)}const sl=[{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:[qe()?{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"}];qe()||sl.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const Wh=()=>{const t=se.c(23),[e]=Zr(),n=e.package_management.manager,{getPackageList:r}=Je();let i,s;t[0]!==r?(i=()=>r(),t[0]=r,t[1]=i):i=t[1],t[2]!==n?(s=[n],t[2]=n,t[3]=s):s=t[3];const{data:l,error:c,refetch:a,isPending:d}=_a(i,s);if(d){let k;return t[4]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(vi,{size:"medium",centered:!0}),t[4]=k):k=t[4],k}if(c){let k;return t[5]!==c?(k=o.jsx(Aa,{error:c}),t[5]=c,t[6]=k):k=t[6],k}let u;t[7]!==(l==null?void 0:l.packages)?(u=(l==null?void 0:l.packages)||[],t[7]=l==null?void 0:l.packages,t[8]=u):u=t[8];const f=u;let p;t[9]!==f?(p=new Set(f.map(Yh)),t[9]=f,t[10]=p):p=t[10];const m=p;let h,g,v,x,j,S,C;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(sn,{children:"Optional Features"}),t[11]=h):h=t[11],t[12]===Symbol.for("react.memo_cache_sentinel")?(g=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[12]=g):g=t[12],t[13]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Ra,{children:o.jsxs(mi,{children:[o.jsx(Ht,{children:"Dependency"}),o.jsx(Ht,{children:"Feature"}),o.jsx(Ht,{children:"Status"}),o.jsx(Ht,{})]})}),t[13]=v):v=t[13],t[14]!==m||t[15]!==n||t[16]!==a?(x=sl.map(k=>{const D=k.packagesRequired.every(P=>m.has(P.name.split("[")[0])),N=k.packagesRequired.map(Xh).join(", ");return o.jsxs(mi,{className:"text-sm",children:[o.jsx(Sn,{children:k.description}),o.jsx(Sn,{className:"font-mono text-xs",children:N}),o.jsx(Sn,{children:D?o.jsxs("div",{className:"flex items-center",children:[o.jsx(bi,{className:"h-4 w-4 text-(--grass-10) mr-2"}),o.jsx("span",{children:"Installed"})]}):o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ma,{className:"h-4 w-4 text-(--red-10) mr-2"}),o.jsx(Gh,{packageSpecs:[...k.packagesRequired,...k.additionalPackageInstalls],packageManager:n,onSuccess:a})]})})]},k.id)}),t[14]=m,t[15]=n,t[16]=a,t[17]=x):x=t[17],t[18]!==x?(j=o.jsxs(Fa,{children:[v,o.jsx(La,{children:x})]}),t[18]=x,t[19]=j):j=t[19],t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[20]=S):S=t[20],t[21]!==j?(C=o.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[h,g,j,S]}),t[21]=j,t[22]=C):C=t[22],C},Gh=({packageSpecs:t,packageManager:e,onSuccess:n})=>{const[r,i]=R.useState(!1),{addPackage:s}=Je();return o.jsxs(ve,{size:"xs",variant:"outline",className:Be("text-xs",r&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{i(!0);const l=t.map(a=>a.minVersion?`${a.name}>=${a.minVersion}`:a.name).join(" "),c=await s({package:l});c.success?(n(),et({title:"Package installed",description:o.jsxs("span",{children:["The packages"," ",o.jsx(he,{className:"inline",children:t.map(a=>a.name).join(", ")})," ","have been added to your environment."]})})):et({title:"Failed to install package",description:c.error,variant:"danger"})}finally{i(!1)}},disabled:r,children:[r?o.jsx(vi,{size:"small",className:"mr-2 h-3 w-3"}):o.jsx(xi,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function Yh(t){return t.name}function Xh(t){return t.name}const ae="flex flex-row items-center space-x-1 space-y-0",ll=[{id:"editor",label:"Editor",Icon:ti,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:ac,className:"bg-(--grass-4)"},{id:"packageManagement",label:"Package Management",Icon:cc,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:wi,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:gi,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:ji,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:rc,className:"bg-(--slate-4)"}],al=ft(ll[0].id),Qh=()=>{const t=se.c(47),[e,n]=si(),r=y.useRef(null),i=kn(yr),[s,l]=pt(al),c=Lt(za),a=Lt($a),{saveUserConfig:d}=Je();let u,f;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=Fr(Va),t[0]=u):u=t[0],t[1]!==e?(f={resolver:u,defaultValues:e},t[1]=e,t[2]=f):f=t[2];const p=Lr(f);let m;t[3]!==d||t[4]!==n?(m=async E=>{await d({config:E}).then(()=>{n(E)})},t[3]=d,t[4]=n,t[5]=m):m=t[5];const h=zr(m,100);let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=qe(),t[6]=g):g=t[6];const v=g,x=y.useId(),j=y.useId();let S;t[7]!==s||t[8]!==c||t[9]!==e||t[10]!==p||t[11]!==x||t[12]!==j||t[13]!==h||t[14]!==l||t[15]!==i?(S=()=>{switch(s){case"editor":return o.jsxs(o.Fragment,{children:[o.jsxs(Me,{title:"Autosave",children:[o.jsx(q,{control:p.control,name:"save.autosave",render:E=>{const{field:b}=E;return o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Autosave enabled"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"autosave-checkbox",checked:b.value==="after_delay",disabled:b.disabled,onCheckedChange:T=>{b.onChange(T?"after_delay":"off")}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"save.autosave"})]})}}),o.jsx(q,{control:p.control,name:"save.autosave_delay",render:E=>{const{field:b}=E;return o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Autosave delay (seconds)"}),o.jsx(G,{children:o.jsx(vt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:p.getValues("save.autosave")!=="after_delay",...b,value:b.value/1e3,minValue:1,onChange:T=>{b.onChange(1e3*T),Number.isNaN(T)||h(p.getValues())}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"save.autosave_delay"})]})}}),o.jsx(q,{control:p.control,name:"runtime.default_auto_download",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Save cell outputs as"}),o.jsx(G,{children:o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(fe,{id:x,checked:Array.isArray(b.value)&&b.value.includes("html"),onCheckedChange:()=>{const T=Array.isArray(b.value)?b.value:[];b.onChange(Mt(T,"html"))}}),o.jsx(U,{htmlFor:x,children:"HTML"})]}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(fe,{id:j,checked:Array.isArray(b.value)&&b.value.includes("ipynb"),onCheckedChange:()=>{const T=Array.isArray(b.value)?b.value:[];b.onChange(Mt(T,"ipynb"))}}),o.jsx(U,{htmlFor:j,children:"IPYNB"})]})]})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"runtime.default_auto_download"})]}),o.jsxs(ie,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",o.jsx(he,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})}})]}),o.jsxs(Me,{title:"Formatting",children:[o.jsx(q,{control:p.control,name:"save.format_on_save",render:E=>{const{field:b}=E;return o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Format on save"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"format-on-save-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"save.format_on_save"})]})}}),o.jsx(q,{control:p.control,name:"formatting.line_length",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Line length"}),o.jsx(G,{children:o.jsx(vt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...b,value:b.value,minValue:1,maxValue:1e3,onChange:T=>{b.onChange(T),Number.isNaN(T)||h(p.getValues())}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"formatting.line_length"})]}),o.jsx(ie,{children:"Maximum line length when formatting code."})]})}})]}),o.jsx(Me,{title:"Autocomplete",children:o.jsx(q,{control:p.control,name:"completion.activate_on_typing",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Autocomplete"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"autocomplete-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"completion.activate_on_typing"})]}),o.jsx(ie,{children:"When unchecked, code completion is still available through a hotkey."}),o.jsx("div",{children:o.jsx(ve,{variant:"link",className:"mb-0 px-0",type:"button",onClick:T=>{T.preventDefault(),T.stopPropagation(),l("ai")},children:"Edit AI autocomplete"})})]})}})}),o.jsxs(Me,{title:"Language Servers",children:[o.jsxs(ie,{children:["See the"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),o.jsxs(ie,{children:[o.jsx("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),o.jsx(q,{control:p.control,name:"language_servers.pylsp.enabled",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(W,{className:ae,children:[o.jsxs(U,{children:[o.jsx(Ut,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",o.jsx(me,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"pylsp-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"language_servers.pylsp.enabled"})]}),b.value&&!c.pylsp&&o.jsxs($t,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",o.jsx(he,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}}),o.jsx(q,{control:p.control,name:"language_servers.basedpyright.enabled",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(W,{className:ae,children:[o.jsxs(U,{children:[o.jsx(Ut,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",o.jsx(me,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"basedpyright-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"language_servers.basedpyright.enabled"})]}),b.value&&!c.basedpyright&&o.jsxs($t,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",o.jsx(he,{className:"inline",children:"basedpyright"})," in your environment."]})]})}}),o.jsx(q,{control:p.control,name:"language_servers.ty.enabled",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs(W,{className:ae,children:[o.jsxs(U,{children:[o.jsx(Ut,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",o.jsx(me,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"ty-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"language_servers.ty.enabled"})]}),b.value&&!c.ty&&o.jsxs($t,{kind:"danger",children:["ty is not available in your current environment. Please install ",o.jsx(he,{className:"inline",children:"ty"})," in your environment."]})]})}}),o.jsx(q,{control:p.control,name:"diagnostics.enabled",render:E=>{const{field:b}=E;return o.jsxs(W,{className:ae,children:[o.jsxs(U,{children:[o.jsx(Ut,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"diagnostics-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"diagnostics.enabled"})]})}})]}),o.jsxs(Me,{title:"Keymap",children:[o.jsx(q,{control:p.control,name:"keymap.preset",render:E=>{const{field:b}=E;return o.jsx("div",{className:"flex flex-col space-y-1",children:o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Keymap"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"keymap-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:vh.map(Zh)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"keymap.preset"})]})})}}),o.jsx(q,{control:p.control,name:"keymap.destructive_delete",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Destructive delete"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"destructive-delete-checkbox",checked:b.value,disabled:b.disabled,onCheckedChange:T=>{b.onChange(!!T)}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"keymap.destructive_delete"})]}),o.jsxs(ie,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",o.jsx(Ue,{content:o.jsxs("div",{className:"max-w-xs",children:[o.jsx("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:o.jsx(Ua,{className:"w-3 h-3 text-(--amber-11)"})})]}),o.jsx("div",{children:o.jsx(ve,{variant:"link",className:"mb-0 px-0",type:"button",onClick:T=>{T.preventDefault(),T.stopPropagation(),i(!0)},children:"Edit Keyboard Shortcuts"})})]})}})]})]});case"display":return o.jsxs(o.Fragment,{children:[o.jsxs(Me,{title:"Display",children:[o.jsx(q,{control:p.control,name:"display.default_width",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Default width"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"user-config-width-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:["compact","medium","full","columns"].map(Jh)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.default_width"})]}),o.jsx(ie,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}}),o.jsx(q,{control:p.control,name:"display.theme",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Theme"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"theme-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:Ha.map(ef)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.theme"})]}),o.jsx(ie,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}}),o.jsx(q,{control:p.control,name:"display.code_editor_font_size",render:E=>{const{field:b}=E;return o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Code editor font size (px)"}),o.jsx(G,{children:o.jsx("span",{className:"inline-flex mr-2",children:o.jsx(vt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...b,value:b.value,minValue:8,maxValue:32,onChange:T=>{b.onChange(T),h(p.getValues())}})})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.code_editor_font_size"})]})}}),o.jsx(q,{control:p.control,name:"display.reference_highlighting",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Reference highlighting"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"reference-highlighting-checkbox",checked:b.value,onCheckedChange:b.onChange})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.reference_highlighting"})]}),o.jsx(ie,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})}})]}),o.jsxs(Me,{title:"Outputs",children:[o.jsx(q,{control:p.control,name:"display.cell_output",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Cell output area"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"cell-output-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:["above","below"].map(tf)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.cell_output"})]}),o.jsx(ie,{children:"Where to display cell's output."})]})}}),o.jsx(q,{control:p.control,name:"display.dataframes",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Dataframe viewer"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"display-dataframes-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(nf)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.dataframes"})]}),o.jsx(ie,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}}),o.jsx(q,{control:p.control,name:"display.default_table_page_size",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Default table page size"}),o.jsx(G,{children:o.jsx(vt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...b,value:b.value,minValue:1,step:1,onChange:T=>{b.onChange(T),Number.isNaN(T)||h(p.getValues())}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.default_table_page_size"})]}),o.jsx(ie,{children:"The default number of rows displayed in dataframes and SQL results."})]})}}),o.jsx(q,{control:p.control,name:"display.default_table_max_columns",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Default table max columns"}),o.jsx(G,{children:o.jsx(vt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...b,value:b.value,minValue:1,step:1,onChange:T=>{b.onChange(T),Number.isNaN(T)||h(p.getValues())}})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"display.default_table_max_columns"})]}),o.jsx(ie,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})}})]})]});case"packageManagement":return o.jsx(Me,{title:"Package Management",children:o.jsx(q,{control:p.control,disabled:v,name:"package_management.manager",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Manager"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"package-manager-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:Ba.map(rf)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"package_management.manager"})]}),o.jsxs(ie,{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(me,{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(me,{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(he,{className:"inline",children:"uv"})]})]})}})});case"runtime":return o.jsxs(Me,{title:"Runtime configuration",children:[o.jsx(q,{control:p.control,name:"runtime.auto_instantiate",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Autorun on startup"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"auto-instantiate-checkbox",disabled:b.disabled,checked:b.value,onCheckedChange:b.onChange})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"runtime.auto_instantiate"})]}),o.jsx(ie,{children:"Whether to automatically run all cells on startup."})]})}}),o.jsx(q,{control:p.control,name:"runtime.on_cell_change",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"On cell change"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"on-cell-change-select",onChange:T=>b.onChange(T.target.value),value:b.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(of)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"runtime.on_cell_change"})]}),o.jsx(ie,{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(q,{control:p.control,name:"runtime.auto_reload",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"On module change"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"auto-reload-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:v,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(sf)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"runtime.auto_reload"})]}),o.jsx(ie,{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(q,{control:p.control,name:"runtime.default_sql_output",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col space-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{children:"Default SQL output"}),o.jsx(G,{children:o.jsx(Se,{"data-testid":"user-config-sql-output-select",onChange:T=>b.onChange(T.target.value),value:b.value,disabled:b.disabled,className:"inline-flex mr-2",children:Vs.map(lf)})}),o.jsx(Z,{}),o.jsx(oe,{userConfig:e,name:"runtime.default_sql_output"})]}),o.jsx(ie,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}}),o.jsx(q,{control:p.control,name:"runtime.reactive_tests",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Autorun Unit Tests"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"reactive-test-checkbox",checked:b.value,onCheckedChange:b.onChange})})]}),o.jsx(oe,{userConfig:e,name:"runtime.reactive_tests"}),o.jsx(Z,{}),o.jsx(ie,{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(ie,{children:["Learn more in the"," ",o.jsx(me,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return o.jsx(Vh,{form:p,config:e,onSubmit:h});case"optionalDeps":return o.jsx(Wh,{});case"labs":return o.jsxs(Me,{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(q,{control:p.control,name:"experimental.inline_ai_tooltip",render:af}),o.jsx(q,{control:p.control,name:"experimental.rtc_v2",render:cf}),o.jsx(q,{control:p.control,name:"experimental.performant_table_charts",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Performant Table Charts"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"performant-table-charts-checkbox",checked:b.value===!0,onCheckedChange:b.onChange})})]}),o.jsx(oe,{userConfig:e,name:"experimental.performant_table_charts"}),o.jsx(ie,{children:"Enable experimental table charts which are computed on the backend."})]})}}),o.jsx(q,{control:p.control,name:"experimental.sql_linter",render:E=>{const{field:b}=E;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"SQL Linter"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"sql-linter-checkbox",checked:b.value===!0,onCheckedChange:b.onChange})})]}),o.jsx(oe,{userConfig:e,name:"experimental.sql_linter"}),o.jsx(ie,{children:"Enable experimental SQL linting and autocompletion."})]})}})]})}},t[7]=s,t[8]=c,t[9]=e,t[10]=p,t[11]=x,t[12]=j,t[13]=h,t[14]=l,t[15]=i,t[16]=S):S=t[16];const C=S;let k,D,N;t[17]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(he,{className:"inline",children:"marimo.toml"}),D=o.jsx("br",{}),t[17]=k,t[18]=D):(k=t[17],D=t[18]),t[19]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsxs("p",{className:"text-muted-secondary",children:["User configuration is stored in ",k,D,"Run ",o.jsx(he,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]}),t[19]=N):N=t[19];const P=N;let O,_,L,M,B,I,K,F,z,$,w,V;return t[20]!==p||t[21]!==h?(O=p.handleSubmit(h),t[20]=p,t[21]=h,t[22]=O):O=t[22],t[23]!==l?(_=E=>l(E),t[23]=l,t[24]=_):_=t[24],t[25]===Symbol.for("react.memo_cache_sentinel")?(L=ll.map(df),t[25]=L):L=t[25],t[26]!==a?(M=o.jsx("div",{className:"p-2 text-xs text-muted-foreground self-start",children:o.jsxs("span",{children:["Version: ",a]})}),t[26]=a,t[27]=M):M=t[27],t[28]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx("div",{className:"flex-1"}),I=!qe()&&P,t[28]=B,t[29]=I):(B=t[28],I=t[29]),t[30]!==M?(K=o.jsxs(li,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[L,M,B,I]}),t[30]=M,t[31]=K):K=t[31],t[32]!==s||t[33]!==K||t[34]!==_?(F=o.jsx(ai,{value:s,onValueChange:_,orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:K}),t[32]=s,t[33]=K,t[34]=_,t[35]=F):F=t[35],t[36]!==C?(z=C(),t[36]=C,t[37]=z):z=t[37],t[38]!==z?($=o.jsx("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:z}),t[38]=z,t[39]=$):$=t[39],t[40]!==F||t[41]!==$||t[42]!==O?(w=o.jsxs("form",{ref:r,onChange:O,className:"flex text-pretty overflow-hidden",children:[F,$]}),t[40]=F,t[41]=$,t[42]=O,t[43]=w):w=t[43],t[44]!==p||t[45]!==w?(V=o.jsx($r,{...p,children:w}),t[44]=p,t[45]=w,t[46]=V):V=t[46],V},Me=t=>{const e=se.c(5),{title:n,children:r}=t;let i,s;return e[0]!==n?(i=o.jsx(sn,{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};function Zh(t){return o.jsx("option",{value:t,children:t},t)}function Jh(t){return o.jsx("option",{value:t,children:t},t)}function ef(t){return o.jsx("option",{value:t,children:t},t)}function tf(t){return o.jsx("option",{value:t,children:t},t)}function nf(t){return o.jsx("option",{value:t,children:t},t)}function rf(t){return o.jsx("option",{value:t,children:t},t)}function of(t){return o.jsx("option",{value:t,children:t},t)}function sf(t){return o.jsx("option",{value:t,children:t},t)}function lf(t){return o.jsx("option",{value:t.value,children:t.label},t.value)}function af(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"AI Edit Tooltip"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(ie,{children:'Enable experimental "Edit with AI" tooltip when selecting code.'})]})}function cf(t){const{field:e}=t;return o.jsxs("div",{className:"flex flex-col gap-y-1",children:[o.jsxs(W,{className:ae,children:[o.jsx(U,{className:"font-normal",children:"Real-Time Collaboration"}),o.jsx(G,{children:o.jsx(fe,{"data-testid":"rtc-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),o.jsx(ie,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}function df(t){return o.jsx(Vt,{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:Be(t.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:o.jsx(t.Icon,{className:"w-4 h-4"})}),o.jsx("span",{className:"truncate",children:t.label})]})},t.id)}const br=ft(!1);function uf(){const t=se.c(5),e=kn(al),n=kn(br);let r;t[0]!==e||t[1]!==n?(r=l=>{e(l),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 hf=t=>{const e=se.c(32),{showAppConfig:n,disabled:r,tooltip:i}=t,s=n===void 0||n,l=r!==void 0&&r,c=i===void 0?"Settings":i,[a,d]=pt(br),u=l?"disabled":"hint-green";let f,p,m;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(yi,{strokeWidth:1.8}),e[0]=f):f=e[0],e[1]!==c?(p=o.jsx(Ue,{content:c,children:f}),e[1]=c,e[2]=p):p=e[2],e[3]!==l||e[4]!==u||e[5]!==p?(m=o.jsx(an,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:l,color:u,children:p}),e[3]=l,e[4]=u,e[5]=p,e[6]=m):m=e[6];const h=m;let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsxs(ni,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[o.jsx(qa,{children:o.jsx(ri,{children:"User settings"})}),o.jsx(Qh,{})]}),e[7]=g):g=e[7];const v=g;if(!s){let _,L;return e[8]!==h?(_=o.jsx(Wa,{children:h}),e[8]=h,e[9]=_):_=e[9],e[10]!==d||e[11]!==a||e[12]!==_?(L=o.jsxs(wn,{open:a,onOpenChange:d,children:[_,v]}),e[10]=d,e[11]=a,e[12]=_,e[13]=L):L=e[13],L}let x,j,S,C,k,D,N,P,O;return e[14]!==h?(x=o.jsx(Ga,{asChild:!0,children:h}),e[14]=h,e[15]=x):x=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(nh,{}),S=o.jsx("div",{className:"h-px bg-border my-2"}),e[16]=j,e[17]=S):(j=e[16],S=e[17]),e[18]!==d?(C=()=>d(!0),e[18]=d,e[19]=C):C=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(yi,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=k):k=e[20],e[21]!==C?(D=o.jsxs(Ya,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:ff,children:[j,S,o.jsxs(ve,{onClick:C,variant:"link",className:"px-0",children:[k,"User settings"]})]}),e[21]=C,e[22]=D):D=e[22],e[23]!==D||e[24]!==x?(N=o.jsxs(Xa,{children:[x,D]}),e[23]=D,e[24]=x,e[25]=N):N=e[25],e[26]!==d||e[27]!==a?(P=o.jsx(wn,{open:a,onOpenChange:d,children:v}),e[26]=d,e[27]=a,e[28]=P):P=e[28],e[29]!==N||e[30]!==P?(O=o.jsxs(o.Fragment,{children:[N,P]}),e[29]=N,e[30]=P,e[31]=O):O=e[31],O};function ff(t){return t.preventDefault()}const pf=t=>{const e=se.c(15),{description:n,disabled:r,tooltip:i}=t,s=r!==void 0&&r,l=i===void 0?"Shutdown":i,{openConfirm:c,closeModal:a}=Qa(),{sendShutdown:d}=Je();let u;e[0]!==d?(u=()=>{d(),setTimeout(gf,200)},e[0]=d,e[1]=u):u=e[1];const f=u;if(qe())return null;const p=s?"disabled":"red";let m,h,g,v;return e[2]!==a||e[3]!==n||e[4]!==f||e[5]!==c?(m=x=>{x.stopPropagation(),c({title:"Shutdown",description:n,variant:"destructive",confirmAction:o.jsx(Za,{onClick:()=>{f(),a()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=a,e[3]=n,e[4]=f,e[5]=c,e[6]=m):m=e[6],e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(zt,{strokeWidth:1}),e[7]=h):h=e[7],e[8]!==s||e[9]!==p||e[10]!==m?(g=o.jsx(an,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:p,className:"h-[27px] w-[27px]",disabled:s,onClick:m,children:h}),e[8]=s,e[9]=p,e[10]=m,e[11]=g):g=e[11],e[12]!==g||e[13]!==l?(v=o.jsx(Ue,{content:l,children:g}),e[12]=g,e[13]=l,e[14]=v):v=e[14],v};function gf(){window.close()}function mf(t){window.open(Ja(`?file=${t}`).toString(),"_blank")}export{tc as A,nc as B,hf as C,Th as D,oc as G,jh as K,sc as L,lc as M,dc as P,pf as S,Qu as T,uc as Y,ic as a,xi as b,an as c,Dh as d,Ct as e,Zs as f,Ju as g,yh as h,Qs as i,uf as j,yr as k,Ys as l,un as m,Xs as n,mf as o,wi as p,bi as q,zs as r,br as s,Zu as u};