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