@cgi-learning-hub/ui 1.4.0-dev.1741982096 → 1.4.0-dev.1741985772

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/{Alert-Bdy5B5l-.js → Alert-BCd1tHk0.js} +9 -9
  2. package/dist/{Backdrop-2gYaM9j-.js → Backdrop-CjDitjBW.js} +6 -6
  3. package/dist/{Box-DgqaLb7j.js → Box-GMNejc_m.js} +7 -7
  4. package/dist/{Button-B7kOjNW1.js → Button-x5rtZxJN.js} +6 -6
  5. package/dist/{ButtonBase-IZ_QjbpE.js → ButtonBase-CU1npQuI.js} +4 -4
  6. package/dist/{CardContent-F4-KcZH8.js → CardContent-CL_61cm-.js} +3 -3
  7. package/dist/{Checkbox-DgU-0k3O.js → Checkbox-CtRSDqOe.js} +7 -7
  8. package/dist/{Chip-B8sdMltW.js → Chip-ZIBpWC4I.js} +6 -6
  9. package/dist/{CircularProgress-CQxzJquv.js → CircularProgress-B28FKeiH.js} +4 -4
  10. package/dist/{CloseRounded-CYS1vEvm.js → CloseRounded-pP8asZiP.js} +1 -1
  11. package/dist/{Collapse-CLl0D4CI.js → Collapse-wS8A5zc5.js} +6 -6
  12. package/dist/CustomTreeItem-CyfVhVMC.js +1002 -0
  13. package/dist/CustomTreeItem-GHUeoYTN.cjs +3 -0
  14. package/dist/DatePicker-64gpvkmk.cjs +13 -0
  15. package/dist/{DatePicker-CHNHFeLy.js → DatePicker-XdCuICxv.js} +2117 -2529
  16. package/dist/{DefaultPropsProvider-Cqcb4sws.js → DefaultPropsProvider-CQixa6JQ.js} +7 -7
  17. package/dist/{Delete-CbtdIdDB.js → Delete-BQA9--_t.js} +1 -1
  18. package/dist/{Dialog-vSSARfm5.js → Dialog-C-Ptqtq-.js} +9 -9
  19. package/dist/{DialogContent-BzPaz5G8.js → DialogContent-1sjO2rQK.js} +3 -3
  20. package/dist/{DialogTitle-BNGMQ2Px.js → DialogTitle-CGpa_QH9.js} +5 -5
  21. package/dist/{Divider-D-pZeQTm.js → Divider-CNGfzZqD.js} +8 -8
  22. package/dist/{FormLabel-3-CC-ZGw.js → FormLabel-BlaPVlwX.js} +67 -76
  23. package/dist/FormLabel-XpwTqbs8.cjs +2 -0
  24. package/dist/{Grow-DewB1oh4.js → Grow-D5UIC41W.js} +4 -4
  25. package/dist/{IconButton-CCNUMz2l.js → IconButton-CFUIddNg.js} +6 -6
  26. package/dist/{InputAdornment-DL8XIM8r.js → InputAdornment-GcbiriFv.js} +5 -5
  27. package/dist/{InputBase-By7jMrFP.js → InputBase-DJuF09Rf.js} +7 -7
  28. package/dist/{Link-C_GPIs0q.js → Link-DtsZ0d_s.js} +7 -7
  29. package/dist/List-BTPrBGqY.js +130 -0
  30. package/dist/List-Bo4pzQqG.cjs +1 -0
  31. package/dist/ListItem-C9OfYRAP.js +423 -0
  32. package/dist/ListItem-CB4JyjSb.cjs +1 -0
  33. package/dist/ListItemText-B_hEVsaT.js +928 -0
  34. package/dist/ListItemText-Bjd08uk4.cjs +1 -0
  35. package/dist/{Menu-DTOOgx49.js → Menu-DD_bqi6q.js} +306 -428
  36. package/dist/Menu-XypIRgTl.cjs +7 -0
  37. package/dist/{MenuItem-rnMlnHRT.js → MenuItem-Byj-2QQd.js} +72 -77
  38. package/dist/MenuItem-vb36Ljmd.cjs +1 -0
  39. package/dist/{Modal-CjMKpo95.js → Modal-S2P14Nsp.js} +8 -8
  40. package/dist/{Paper-BiZq6EF2.js → Paper-BrsaeLlu.js} +4 -4
  41. package/dist/{Popper-Cx071JBT.js → Popper-BNftxeQ5.js} +31 -30
  42. package/dist/Popper-BaxEpkdE.cjs +4 -0
  43. package/dist/{Portal-iCPDPYlY.js → Portal-BLEnzj1v.js} +2 -2
  44. package/dist/{Radio-YTlcDTxU.js → Radio-CRTKwNe5.js} +9 -9
  45. package/dist/{RadioGroup-d9PIO9nR.js → RadioGroup-NjI5PlIb.js} +3 -3
  46. package/dist/{Select-CHq7l5LD.cjs → Select-8kBUq_SZ.cjs} +1 -1
  47. package/dist/{Select-bVUll7Rd.js → Select-C0jrZLRg.js} +30 -30
  48. package/dist/{Stack-hbAJHQhq.js → Stack-Bm7M81n8.js} +22 -22
  49. package/dist/{Switch-B9uT9-d0.js → Switch-D5FnE7HW.js} +6 -6
  50. package/dist/{SwitchBase-CDkmnGAP.js → SwitchBase-91Mand9t.js} +5 -5
  51. package/dist/{Tabs-Cl4eoKT1.js → Tabs-C5VIdTSp.js} +25 -24
  52. package/dist/Tabs-Csp29aqN.cjs +4 -0
  53. package/dist/{TextField-DQ2FvwDM.cjs → TextField-BzqflYRV.cjs} +1 -1
  54. package/dist/{TextField-VHCImaQP.js → TextField-D5jS5WjF.js} +8 -8
  55. package/dist/ToggleButtonGroup-Bpi3kmko.cjs +140 -0
  56. package/dist/{ToggleButtonGroup--eIRTlqD.js → ToggleButtonGroup-CipWZLXf.js} +2366 -3278
  57. package/dist/Tooltip-DJmbLjU6.cjs +4 -0
  58. package/dist/{Tooltip-BM3r5yvP.js → Tooltip-DgTrUaHJ.js} +10 -10
  59. package/dist/{Typography-SIQ6eleU.js → Typography-Ct2Sc9KM.js} +5 -5
  60. package/dist/{capitalize-3KLkrEtk.js → capitalize-BJ0FEsU7.js} +1 -1
  61. package/dist/components/Alert/Alert.es.js +1 -1
  62. package/dist/components/Alert/index.es.js +1 -1
  63. package/dist/components/Button/Button.es.js +2 -2
  64. package/dist/components/DatePicker/DatePicker.cjs.js +1 -1
  65. package/dist/components/DatePicker/DatePicker.es.js +1 -1
  66. package/dist/components/DatePicker/index.cjs.js +1 -1
  67. package/dist/components/DatePicker/index.es.js +1 -1
  68. package/dist/components/Dialog/Dialog.es.js +2 -2
  69. package/dist/components/Dropzone/Dropzone.es.js +4 -4
  70. package/dist/components/EmptyState/EmptyState.es.js +3 -3
  71. package/dist/components/FileList/FileIcon.es.js +1 -1
  72. package/dist/components/FileList/FileListItem.es.js +4 -4
  73. package/dist/components/Heading/Heading.es.js +2 -2
  74. package/dist/components/ImagePicker/ImagePicker.es.js +5 -5
  75. package/dist/components/Loader/Loader.es.js +1 -1
  76. package/dist/components/LoaderBackdrop/LoaderBackdrop.es.js +2 -2
  77. package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
  78. package/dist/components/PasswordInput/PasswordInput.es.js +4 -4
  79. package/dist/components/ResourceCard/ResourceCard.es.js +1 -1
  80. package/dist/components/SearchInput/SearchInput.es.js +4 -4
  81. package/dist/components/TreeView/TreeView.cjs.js +7 -9
  82. package/dist/components/TreeView/TreeView.d.ts +1 -29
  83. package/dist/components/TreeView/TreeView.es.js +949 -1950
  84. package/dist/components/TreeView/components/CustomTreeItem.cjs.js +1 -0
  85. package/dist/components/TreeView/components/CustomTreeItem.d.ts +4 -0
  86. package/dist/components/TreeView/components/CustomTreeItem.es.js +9 -0
  87. package/dist/components/TreeView/index.cjs.js +1 -1
  88. package/dist/components/TreeView/index.d.ts +1 -1
  89. package/dist/components/TreeView/index.es.js +4 -3
  90. package/dist/components/TreeView/style.cjs.js +1 -0
  91. package/dist/components/TreeView/style.d.ts +11 -0
  92. package/dist/components/TreeView/style.es.js +23 -0
  93. package/dist/components/TreeView/types.cjs.js +1 -0
  94. package/dist/components/TreeView/types.d.ts +37 -0
  95. package/dist/components/TreeView/types.es.js +4 -0
  96. package/dist/components/TreeView/utils.cjs.js +1 -0
  97. package/dist/components/TreeView/utils.d.ts +6 -0
  98. package/dist/components/TreeView/utils.es.js +51 -0
  99. package/dist/components/index.cjs.js +1 -1
  100. package/dist/components/index.es.js +344 -340
  101. package/dist/components/stories/Alert.stories.es.js +1 -1
  102. package/dist/components/stories/Button.stories.es.js +1 -1
  103. package/dist/components/stories/Card.stories.es.js +2 -2
  104. package/dist/components/stories/Checkbox.stories.es.js +1 -1
  105. package/dist/components/stories/Chip.stories.es.js +1 -1
  106. package/dist/components/stories/DatePicker.stories.cjs.js +1 -1
  107. package/dist/components/stories/DatePicker.stories.es.js +1 -1
  108. package/dist/components/stories/Dialog.stories.es.js +2 -2
  109. package/dist/components/stories/Divider.stories.es.js +1 -1
  110. package/dist/components/stories/FormControlLabel.stories.es.js +3 -3
  111. package/dist/components/stories/Heading.stories.es.js +2 -2
  112. package/dist/components/stories/IconButton.stories.es.js +2 -2
  113. package/dist/components/stories/Link.stories.es.js +1 -1
  114. package/dist/components/stories/Menu.stories.cjs.js +1 -1
  115. package/dist/components/stories/Menu.stories.es.js +2 -2
  116. package/dist/components/stories/Paper.stories.es.js +1 -1
  117. package/dist/components/stories/RadioGroup.stories.cjs.js +1 -1
  118. package/dist/components/stories/RadioGroup.stories.es.js +3 -3
  119. package/dist/components/stories/ResourceCard.stories.es.js +1 -1
  120. package/dist/components/stories/Select.stories.cjs.js +1 -1
  121. package/dist/components/stories/Select.stories.es.js +3 -3
  122. package/dist/components/stories/TabList.stories.cjs.js +1 -1
  123. package/dist/components/stories/TabList.stories.es.js +4 -4
  124. package/dist/components/stories/TextField.stories.cjs.js +1 -1
  125. package/dist/components/stories/TextField.stories.es.js +1 -1
  126. package/dist/components/stories/Tooltip.stories.cjs.js +1 -1
  127. package/dist/components/stories/Tooltip.stories.es.js +2 -2
  128. package/dist/components/stories/TreeView.stories.cjs.js +2 -2
  129. package/dist/components/stories/TreeView.stories.d.ts +3 -1
  130. package/dist/components/stories/TreeView.stories.es.js +288 -107
  131. package/dist/components/stories/Typography.stories.es.js +1 -1
  132. package/dist/{createSvgIcon-K1Hd8ryN.js → createSvgIcon-B62eln-G.js} +4 -4
  133. package/dist/{dividerClasses-afsB3Yy1.js → dividerClasses-DjJZQ2Lt.js} +1 -1
  134. package/dist/{elementTypeAcceptingRef-5ESWTE79.js → elementTypeAcceptingRef-B04tk6ag.js} +1 -1
  135. package/dist/{extendSxProp-dlShX1xL.js → extendSxProp-CgS-3O19.js} +1 -1
  136. package/dist/{generateUtilityClasses-DotvgSDH.js → generateUtilityClasses-EXBFO7eY.js} +9 -9
  137. package/dist/{getReactElementRef-CQNNHBNW.js → getReactElementRef-DjLvttrJ.js} +1 -1
  138. package/dist/{index-DTTmpNYg.js → index-BZ7ldAwE.js} +4 -4
  139. package/dist/index-Cr54V0sz.cjs +1 -0
  140. package/dist/index-D_xl88AE.js +22 -0
  141. package/dist/{index-B1u7G33_.js → index-DcwdJ8a_.js} +1 -1
  142. package/dist/index.cjs.js +1 -1
  143. package/dist/index.es.js +344 -340
  144. package/dist/isMuiElement-BzDAj3yJ.cjs +1 -0
  145. package/dist/isMuiElement-DnSE4qG4.js +13 -0
  146. package/dist/listItemTextClasses-BCuJjsDp.cjs +1 -0
  147. package/dist/listItemTextClasses-Kxu3VILo.js +9 -0
  148. package/dist/{memoTheme-CqmIydD-.js → memoTheme-DJWQ754x.js} +1 -1
  149. package/dist/{refType-C210ipRY.js → refType-Bpj8bod6.js} +1 -1
  150. package/dist/{resolveComponentProps-CPmhKPdH.js → resolveComponentProps-CIdMNno4.js} +1 -1
  151. package/dist/{useSlot-GZu0V5wJ.js → useSlot-RbAtahZu.js} +1 -1
  152. package/dist/useSlotProps-BTRhbYwP.cjs +1 -0
  153. package/dist/useSlotProps-U2Iu6E0j.js +25 -0
  154. package/dist/{useTheme-tdgDVH1p.js → useTheme-CUKf8NYA.js} +1 -1
  155. package/dist/useTheme-Czi7oO55.js +11 -0
  156. package/dist/{useThemeProps-BQlPXzo3.js → useThemeProps-Bxjrhw9q.js} +2 -2
  157. package/dist/useThemeProps-v-SfXuGn.js +17 -0
  158. package/dist/{utils-Df4KKPfT.js → utils-B2jSugkj.js} +1 -1
  159. package/package.json +1 -1
  160. package/dist/DatePicker-BZ6G6Mxd.cjs +0 -13
  161. package/dist/FormLabel-BV7-a0i5.cjs +0 -2
  162. package/dist/Menu-CGrqZ9-7.cjs +0 -7
  163. package/dist/MenuItem-CCjOFEgY.cjs +0 -1
  164. package/dist/Popper-AHwSSh80.cjs +0 -4
  165. package/dist/Tabs-AyJ_tKtV.cjs +0 -4
  166. package/dist/ToggleButtonGroup-BGZ43Mpb.cjs +0 -140
  167. package/dist/Tooltip-BLQHNepC.cjs +0 -4
  168. package/dist/useSlotProps-C9tsxDNg.js +0 -45
  169. package/dist/useSlotProps-CvOxvhyy.cjs +0 -1
  170. package/dist/useTheme-BA7tMglY.js +0 -11
  171. package/dist/useThemeProps-BTfGtNci.js +0 -17
@@ -1,89 +1,78 @@
1
- import { jsx as v, jsxs as de } from "react/jsx-runtime";
2
- import { D as Qt } from "../../Delete-CbtdIdDB.js";
3
- import { c as ue } from "../../createSvgIcon-K1Hd8ryN.js";
4
- import { B as rt } from "../../Box-DgqaLb7j.js";
5
- import { _ as C } from "../../ButtonBase-IZ_QjbpE.js";
6
- import * as w from "react";
7
- import { forwardRef as Yt, useState as Zt, useMemo as Ht, useEffect as en } from "react";
8
- import { w as ve } from "../../warning-C8W811fV.js";
9
- import { u as Ie } from "../../useForkRef-C_4o__cU.js";
10
- import { r as H, e as U } from "../../resolveComponentProps-CPmhKPdH.js";
11
- import { I as it, H as st, n as J, P as d, G as $e } from "../../generateUtilityClasses-DotvgSDH.js";
12
- import { a as G } from "../../TransitionGroupContext-DbLioz_6.js";
13
- import { u as tn } from "../../useThemeProps-BTfGtNci.js";
14
- import { s as _, f as pe, c as Ne } from "../../DefaultPropsProvider-Cqcb4sws.js";
15
- import { C as lt } from "../../Collapse-CLl0D4CI.js";
16
- import { C as at } from "../../Checkbox-DgU-0k3O.js";
17
- import { u as ct } from "../../unsupportedProp-BuVD30Gh.js";
18
- import { u as nn, a as V } from "../../useSlotProps-C9tsxDNg.js";
19
- import { u as ce } from "../../useEventCallback-BAQJJ3ye.js";
20
- import { o as on } from "../../ownerDocument-CUrv0DIK.js";
21
- import { e as rn } from "../../elementTypeAcceptingRef-5ESWTE79.js";
22
- const Ve = ue(/* @__PURE__ */ v("path", {
23
- d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"
24
- }), "Folder"), sn = ue(/* @__PURE__ */ v("path", {
25
- d: "M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"
26
- }), "KeyboardArrowDown"), ln = ue(/* @__PURE__ */ v("path", {
27
- d: "M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"
28
- }), "KeyboardArrowRight"), an = ue(/* @__PURE__ */ v("path", {
29
- d: "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"
30
- }), "Share");
31
- function cn(e) {
32
- return it("MuiRichTreeView", e);
1
+ import { jsx as S, jsxs as je } from "react/jsx-runtime";
2
+ import { B as yt } from "../../Box-GMNejc_m.js";
3
+ import * as E from "react";
4
+ import { useState as Ct, useMemo as wt, useEffect as Rt } from "react";
5
+ import { buildItemDataMap as St, findItemPath as Pt, getItemId as vt } from "./utils.es.js";
6
+ import { treeContainerStyle as kt } from "./style.es.js";
7
+ import { c as Mt, T as Dt, g as $e, a as _e, b as Ne, d as se, f as Ot, e as Vt, h as At, i as he, j as ge, k as Ft, l as oe, u as H, m as Ke, n as Lt, o as jt, p as Ue, q as $t, r as _t, s as Nt, t as Kt, v as O, C as Ut } from "../../CustomTreeItem-CyfVhVMC.js";
8
+ import { _ as C } from "../../ButtonBase-CU1npQuI.js";
9
+ import { H as Bt, G as zt, I as Be, P as a, n as ne } from "../../generateUtilityClasses-EXBFO7eY.js";
10
+ import { a as A } from "../../TransitionGroupContext-DbLioz_6.js";
11
+ import { u as U } from "../../useEventCallback-BAQJJ3ye.js";
12
+ import { o as qt } from "../../ownerDocument-CUrv0DIK.js";
13
+ import { u as Ht } from "../../index-D_xl88AE.js";
14
+ import { C as Xt } from "../../Checkbox-CtRSDqOe.js";
15
+ import { w as xe } from "../../warning-C8W811fV.js";
16
+ import { u as Ee } from "../../useForkRef-C_4o__cU.js";
17
+ import { u as N } from "../../useSlotProps-U2Iu6E0j.js";
18
+ import { r as _, e as Fe } from "../../resolveComponentProps-CIdMNno4.js";
19
+ import { s as ie, c as ze, f as qe } from "../../DefaultPropsProvider-CQixa6JQ.js";
20
+ import { C as Wt } from "../../Collapse-wS8A5zc5.js";
21
+ import { u as Gt } from "../../unsupportedProp-BuVD30Gh.js";
22
+ import { e as Jt } from "../../elementTypeAcceptingRef-B04tk6ag.js";
23
+ function Yt(e) {
24
+ return Bt("MuiRichTreeView", e);
33
25
  }
34
- st("MuiRichTreeView", ["root"]);
35
- function je(e) {
36
- return tn;
37
- }
38
- const dn = (e, t) => {
39
- const n = w.useRef({}), [o, i] = w.useState(() => {
40
- const m = {};
41
- return e.forEach((a) => {
42
- a.models && Object.entries(a.models).forEach(([u, c]) => {
43
- n.current[u] = {
44
- isControlled: t[u] !== void 0,
45
- getDefaultValue: c.getDefaultValue
46
- }, m[u] = c.getDefaultValue(t);
26
+ zt("MuiRichTreeView", ["root"]);
27
+ const Qt = (e, t) => {
28
+ const n = E.useRef({}), [r, l] = E.useState(() => {
29
+ const g = {};
30
+ return e.forEach((p) => {
31
+ p.models && Object.entries(p.models).forEach(([m, f]) => {
32
+ n.current[m] = {
33
+ isControlled: t[m] !== void 0,
34
+ getDefaultValue: f.getDefaultValue
35
+ }, g[m] = f.getDefaultValue(t);
47
36
  });
48
- }), m;
49
- }), g = Object.fromEntries(Object.entries(n.current).map(([m, a]) => {
50
- const u = t[m] ?? o[m];
51
- return [m, {
52
- value: u,
53
- setControlledValue: (c) => {
54
- a.isControlled || i((r) => C({}, r, {
55
- [m]: c
37
+ }), g;
38
+ }), h = Object.fromEntries(Object.entries(n.current).map(([g, p]) => {
39
+ const m = t[g] ?? r[g];
40
+ return [g, {
41
+ value: m,
42
+ setControlledValue: (f) => {
43
+ p.isControlled || l((o) => C({}, o, {
44
+ [g]: f
56
45
  }));
57
46
  }
58
47
  }];
59
48
  }));
60
- return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([m, a]) => {
61
- const u = t[m], c = a.getDefaultValue(t);
62
- w.useEffect(() => {
63
- a.isControlled !== (u !== void 0) && console.error([`MUI X: A component is changing the ${a.isControlled ? "" : "un"}controlled ${m} state of TreeView to be ${a.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${m} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
49
+ return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([g, p]) => {
50
+ const m = t[g], f = p.getDefaultValue(t);
51
+ E.useEffect(() => {
52
+ p.isControlled !== (m !== void 0) && console.error([`MUI X: A component is changing the ${p.isControlled ? "" : "un"}controlled ${g} state of TreeView to be ${p.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${g} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
64
53
  `));
65
- }, [u]);
54
+ }, [m]);
66
55
  const {
67
- current: r
68
- } = w.useRef(c);
69
- w.useEffect(() => {
70
- !a.isControlled && r !== c && console.error([`MUI X: A component is changing the default ${m} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
56
+ current: o
57
+ } = E.useRef(f);
58
+ E.useEffect(() => {
59
+ !p.isControlled && o !== f && console.error([`MUI X: A component is changing the default ${g} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
71
60
  `));
72
- }, [JSON.stringify(c)]);
73
- }), g;
61
+ }, [JSON.stringify(f)]);
62
+ }), h;
74
63
  };
75
- class un {
64
+ class Zt {
76
65
  constructor() {
77
66
  this.maxListeners = 20, this.warnOnce = !1, this.events = {};
78
67
  }
79
- on(t, n, o = {}) {
80
- let i = this.events[t];
81
- if (i || (i = {
68
+ on(t, n, r = {}) {
69
+ let l = this.events[t];
70
+ if (l || (l = {
82
71
  highPriority: /* @__PURE__ */ new Map(),
83
72
  regular: /* @__PURE__ */ new Map()
84
- }, this.events[t] = i), o.isFirst ? i.highPriority.set(n, !0) : i.regular.set(n, !0), process.env.NODE_ENV !== "production") {
85
- const g = i.highPriority.size + i.regular.size;
86
- g > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${g} ${t} listeners added.`].join(`
73
+ }, this.events[t] = l), r.isFirst ? l.highPriority.set(n, !0) : l.regular.set(n, !0), process.env.NODE_ENV !== "production") {
74
+ const h = l.highPriority.size + l.regular.size;
75
+ h > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${h} ${t} listeners added.`].join(`
87
76
  `)));
88
77
  }
89
78
  }
@@ -94,32 +83,32 @@ class un {
94
83
  this.events = {};
95
84
  }
96
85
  emit(t, ...n) {
97
- const o = this.events[t];
98
- if (!o)
86
+ const r = this.events[t];
87
+ if (!r)
99
88
  return;
100
- const i = Array.from(o.highPriority.keys()), g = Array.from(o.regular.keys());
101
- for (let m = i.length - 1; m >= 0; m -= 1) {
102
- const a = i[m];
103
- o.highPriority.has(a) && a.apply(this, n);
89
+ const l = Array.from(r.highPriority.keys()), h = Array.from(r.regular.keys());
90
+ for (let g = l.length - 1; g >= 0; g -= 1) {
91
+ const p = l[g];
92
+ r.highPriority.has(p) && p.apply(this, n);
104
93
  }
105
- for (let m = 0; m < g.length; m += 1) {
106
- const a = g[m];
107
- o.regular.has(a) && a.apply(this, n);
94
+ for (let g = 0; g < h.length; g += 1) {
95
+ const p = h[g];
96
+ r.regular.has(p) && p.apply(this, n);
108
97
  }
109
98
  }
110
99
  once(t, n) {
111
- const o = this;
112
- this.on(t, function i(...g) {
113
- o.removeListener(t, i), n.apply(o, g);
100
+ const r = this;
101
+ this.on(t, function l(...h) {
102
+ r.removeListener(t, l), n.apply(r, h);
114
103
  });
115
104
  }
116
105
  }
117
- const pn = (e) => e.isPropagationStopped !== void 0, dt = () => {
118
- const [e] = w.useState(() => new un()), t = w.useCallback((...o) => {
119
- const [i, g, m = {}] = o;
120
- m.defaultMuiPrevented = !1, !(pn(m) && m.isPropagationStopped()) && e.emit(i, g, m);
121
- }, [e]), n = w.useCallback((o, i) => (e.on(o, i), () => {
122
- e.removeListener(o, i);
106
+ const en = (e) => e.isPropagationStopped !== void 0, He = () => {
107
+ const [e] = E.useState(() => new Zt()), t = E.useCallback((...r) => {
108
+ const [l, h, g = {}] = r;
109
+ g.defaultMuiPrevented = !1, !(en(g) && g.isPropagationStopped()) && e.emit(l, h, g);
110
+ }, [e]), n = E.useCallback((r, l) => (e.on(r, l), () => {
111
+ e.removeListener(r, l);
123
112
  }), [e]);
124
113
  return {
125
114
  instance: {
@@ -128,8 +117,8 @@ const pn = (e) => e.isPropagationStopped !== void 0, dt = () => {
128
117
  }
129
118
  };
130
119
  };
131
- dt.params = {};
132
- const ut = ({
120
+ He.params = {};
121
+ const Xe = ({
133
122
  plugins: e
134
123
  }) => {
135
124
  const t = new Set(e);
@@ -139,208 +128,202 @@ const ut = ({
139
128
  }
140
129
  };
141
130
  };
142
- ut.params = {};
143
- let nt = 0;
144
- const fn = () => (nt += 1, `mui-tree-view-${nt}`), Ke = ({
145
- id: e,
146
- treeId: t = "",
147
- itemId: n
148
- }) => e ?? `${t}-${n}`, _e = ({
131
+ Xe.params = {};
132
+ const Te = ({
149
133
  params: e,
150
134
  state: t,
151
135
  setState: n
152
136
  }) => {
153
- w.useEffect(() => {
154
- n((i) => i.id.treeId === e.id && i.id.treeId !== void 0 ? i : C({}, i, {
155
- id: C({}, i.id, {
156
- treeId: e.id ?? fn()
137
+ E.useEffect(() => {
138
+ n((l) => l.id.treeId === e.id && l.id.treeId !== void 0 ? l : C({}, l, {
139
+ id: C({}, l.id, {
140
+ treeId: e.id ?? Mt()
157
141
  })
158
142
  }));
159
143
  }, [n, e.id]);
160
- const o = e.id ?? t.id.treeId;
144
+ const r = e.id ?? t.id.treeId;
161
145
  return {
162
146
  getRootProps: () => ({
163
- id: o
147
+ id: r
164
148
  }),
165
149
  contextValue: {
166
- treeId: o
150
+ treeId: r
167
151
  }
168
152
  };
169
153
  };
170
- _e.params = {
154
+ Te.params = {
171
155
  id: !0
172
156
  };
173
- _e.getInitialState = ({
157
+ Te.getInitialState = ({
174
158
  id: e
175
159
  }) => ({
176
160
  id: {
177
161
  treeId: e ?? void 0
178
162
  }
179
163
  });
180
- const mn = [dt, ut, _e], In = ["slots", "slotProps", "apiRef", "experimentalFeatures"], gn = (e) => {
164
+ const tn = [He, Xe, Te], nn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], on = (e) => {
181
165
  let {
182
166
  props: {
183
167
  slots: t,
184
168
  slotProps: n,
185
- apiRef: o,
186
- experimentalFeatures: i
169
+ apiRef: r,
170
+ experimentalFeatures: l
187
171
  },
188
- plugins: g
189
- } = e, m = G(e.props, In);
190
- const a = {};
191
- g.forEach((f) => {
192
- Object.assign(a, f.params);
172
+ plugins: h
173
+ } = e, g = A(e.props, nn);
174
+ const p = {};
175
+ h.forEach((u) => {
176
+ Object.assign(p, u.params);
193
177
  });
194
- const u = {}, c = {};
195
- Object.keys(m).forEach((f) => {
196
- const l = m[f];
197
- a[f] ? u[f] = l : c[f] = l;
178
+ const m = {}, f = {};
179
+ Object.keys(g).forEach((u) => {
180
+ const b = g[u];
181
+ p[u] ? m[u] = b : f[u] = b;
198
182
  });
199
- const r = i ?? {}, s = g.reduce((f, l) => l.getDefaultizedParams ? l.getDefaultizedParams({
200
- params: f,
201
- experimentalFeatures: r
202
- }) : f, u);
183
+ const o = l ?? {}, s = h.reduce((u, b) => b.getDefaultizedParams ? b.getDefaultizedParams({
184
+ params: u,
185
+ experimentalFeatures: o
186
+ }) : u, m);
203
187
  return {
204
- apiRef: o,
205
- forwardedProps: c,
188
+ apiRef: r,
189
+ forwardedProps: f,
206
190
  pluginParams: s,
207
191
  slots: t ?? {},
208
192
  slotProps: n ?? {},
209
- experimentalFeatures: r
193
+ experimentalFeatures: o
210
194
  };
211
- }, bn = ({
195
+ }, rn = ({
212
196
  plugins: e,
213
197
  instance: t,
214
198
  publicAPI: n,
215
- rootRef: o
199
+ rootRef: r
216
200
  }) => ({
217
- runItemPlugins: (a) => {
218
- let u = null, c = null;
219
- const r = [], s = {};
220
- e.forEach((h) => {
221
- if (!h.itemPlugin)
201
+ runItemPlugins: (p) => {
202
+ let m = null, f = null;
203
+ const o = [], s = {};
204
+ e.forEach((x) => {
205
+ if (!x.itemPlugin)
222
206
  return;
223
- const I = h.itemPlugin({
224
- props: a,
225
- rootRef: u,
226
- contentRef: c
207
+ const c = x.itemPlugin({
208
+ props: p,
209
+ rootRef: m,
210
+ contentRef: f
227
211
  });
228
- I != null && I.rootRef && (u = I.rootRef), I != null && I.contentRef && (c = I.contentRef), I != null && I.propsEnhancers && (r.push(I.propsEnhancers), Object.keys(I.propsEnhancers).forEach((p) => {
229
- s[p] = !0;
212
+ c != null && c.rootRef && (m = c.rootRef), c != null && c.contentRef && (f = c.contentRef), c != null && c.propsEnhancers && (o.push(c.propsEnhancers), Object.keys(c.propsEnhancers).forEach((i) => {
213
+ s[i] = !0;
230
214
  }));
231
215
  });
232
- const f = (h) => (I) => {
233
- const p = {};
234
- return r.forEach((b) => {
235
- const x = b[h];
236
- x != null && Object.assign(p, x(I));
237
- }), p;
238
- }, l = Object.fromEntries(Object.keys(s).map((h) => [h, f(h)]));
216
+ const u = (x) => (c) => {
217
+ const i = {};
218
+ return o.forEach((d) => {
219
+ const I = d[x];
220
+ I != null && Object.assign(i, I(c));
221
+ }), i;
222
+ }, b = Object.fromEntries(Object.keys(s).map((x) => [x, u(x)]));
239
223
  return {
240
- contentRef: c,
241
- rootRef: u,
242
- propsEnhancers: l
224
+ contentRef: f,
225
+ rootRef: m,
226
+ propsEnhancers: b
243
227
  };
244
228
  },
245
229
  wrapItem: ({
246
- itemId: a,
247
- children: u
230
+ itemId: p,
231
+ children: m
248
232
  }) => {
249
- let c = u;
250
- for (let r = e.length - 1; r >= 0; r -= 1) {
251
- const s = e[r];
252
- s.wrapItem && (c = s.wrapItem({
253
- itemId: a,
254
- children: c,
233
+ let f = m;
234
+ for (let o = e.length - 1; o >= 0; o -= 1) {
235
+ const s = e[o];
236
+ s.wrapItem && (f = s.wrapItem({
237
+ itemId: p,
238
+ children: f,
255
239
  instance: t
256
240
  }));
257
241
  }
258
- return c;
242
+ return f;
259
243
  },
260
244
  wrapRoot: ({
261
- children: a
245
+ children: p
262
246
  }) => {
263
- let u = a;
264
- for (let c = e.length - 1; c >= 0; c -= 1) {
265
- const r = e[c];
266
- r.wrapRoot && (u = r.wrapRoot({
267
- children: u,
247
+ let m = p;
248
+ for (let f = e.length - 1; f >= 0; f -= 1) {
249
+ const o = e[f];
250
+ o.wrapRoot && (m = o.wrapRoot({
251
+ children: m,
268
252
  instance: t
269
253
  }));
270
254
  }
271
- return u;
255
+ return m;
272
256
  },
273
257
  instance: t,
274
- rootRef: o,
258
+ rootRef: r,
275
259
  publicAPI: n
276
260
  });
277
- function hn(e) {
278
- const t = w.useRef({});
261
+ function sn(e) {
262
+ const t = E.useRef({});
279
263
  return e ? (e.current == null && (e.current = {}), e.current) : t.current;
280
264
  }
281
- const xn = ({
265
+ const ln = ({
282
266
  plugins: e,
283
267
  rootRef: t,
284
268
  props: n
285
269
  }) => {
286
- const o = [...mn, ...e], {
287
- pluginParams: i,
288
- forwardedProps: g,
289
- apiRef: m,
290
- experimentalFeatures: a,
291
- slots: u,
292
- slotProps: c
293
- } = gn({
294
- plugins: o,
270
+ const r = [...tn, ...e], {
271
+ pluginParams: l,
272
+ forwardedProps: h,
273
+ apiRef: g,
274
+ experimentalFeatures: p,
275
+ slots: m,
276
+ slotProps: f
277
+ } = on({
278
+ plugins: r,
295
279
  props: n
296
- }), r = dn(o, i), f = w.useRef({}).current, l = hn(m), h = w.useRef(null), I = Ie(h, t), p = bn({
297
- plugins: o,
298
- instance: f,
299
- publicAPI: l,
300
- rootRef: h
301
- }), [b, x] = w.useState(() => {
302
- const P = {};
303
- return o.forEach((D) => {
304
- D.getInitialState && Object.assign(P, D.getInitialState(i));
305
- }), P;
306
- }), R = [], M = (P) => {
307
- const D = P({
308
- instance: f,
309
- params: i,
310
- slots: u,
311
- slotProps: c,
312
- experimentalFeatures: a,
313
- state: b,
314
- setState: x,
315
- rootRef: h,
316
- models: r,
317
- plugins: o
280
+ }), o = Qt(r, l), u = E.useRef({}).current, b = sn(g), x = E.useRef(null), c = Ee(x, t), i = rn({
281
+ plugins: r,
282
+ instance: u,
283
+ publicAPI: b,
284
+ rootRef: x
285
+ }), [d, I] = E.useState(() => {
286
+ const R = {};
287
+ return r.forEach((v) => {
288
+ v.getInitialState && Object.assign(R, v.getInitialState(l));
289
+ }), R;
290
+ }), T = [], P = (R) => {
291
+ const v = R({
292
+ instance: u,
293
+ params: l,
294
+ slots: m,
295
+ slotProps: f,
296
+ experimentalFeatures: p,
297
+ state: d,
298
+ setState: I,
299
+ rootRef: x,
300
+ models: o,
301
+ plugins: r
318
302
  });
319
- D.getRootProps && R.push(D.getRootProps), D.publicAPI && Object.assign(l, D.publicAPI), D.instance && Object.assign(f, D.instance), D.contextValue && Object.assign(p, D.contextValue);
303
+ v.getRootProps && T.push(v.getRootProps), v.publicAPI && Object.assign(b, v.publicAPI), v.instance && Object.assign(u, v.instance), v.contextValue && Object.assign(i, v.contextValue);
320
304
  };
321
- return o.forEach(M), {
322
- getRootProps: (P = {}) => {
323
- const D = C({
305
+ return r.forEach(P), {
306
+ getRootProps: (R = {}) => {
307
+ const v = C({
324
308
  role: "tree"
325
- }, g, P, {
326
- ref: I
309
+ }, h, R, {
310
+ ref: c
327
311
  });
328
- return R.forEach((N) => {
329
- Object.assign(D, N(P));
330
- }), D;
312
+ return T.forEach((F) => {
313
+ Object.assign(v, F(R));
314
+ }), v;
331
315
  },
332
- rootRef: I,
333
- contextValue: p,
334
- instance: f
316
+ rootRef: c,
317
+ contextValue: i,
318
+ instance: u
335
319
  };
336
- }, Be = /* @__PURE__ */ w.createContext(null);
337
- process.env.NODE_ENV !== "production" && (Be.displayName = "TreeViewContext");
338
- function yn(e) {
320
+ };
321
+ function an(e) {
339
322
  const {
340
323
  value: t,
341
324
  children: n
342
325
  } = e;
343
- return /* @__PURE__ */ v(Be.Provider, {
326
+ return /* @__PURE__ */ S(Dt.Provider, {
344
327
  value: t,
345
328
  children: t.wrapRoot({
346
329
  children: n,
@@ -348,189 +331,181 @@ function yn(e) {
348
331
  })
349
332
  });
350
333
  }
351
- const ie = () => {
352
- const e = w.useContext(Be);
353
- if (e == null)
354
- throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
355
- `));
356
- return e;
357
- }, Tn = (e, t, n) => {
334
+ const cn = (e, t, n) => {
358
335
  e.$$publishEvent(t, n);
359
- }, ae = "__TREE_VIEW_ROOT_PARENT_ID__", Cn = (e) => {
336
+ }, K = "__TREE_VIEW_ROOT_PARENT_ID__", un = (e) => {
360
337
  const t = {};
361
- return e.forEach((n, o) => {
362
- t[n] = o;
338
+ return e.forEach((n, r) => {
339
+ t[n] = r;
363
340
  }), t;
364
- }, Pe = /* @__PURE__ */ w.createContext(() => -1);
365
- process.env.NODE_ENV !== "production" && (Pe.displayName = "TreeViewItemDepthContext");
366
- const En = ["children"], pt = ({
341
+ }, dn = ["children"], We = ({
367
342
  items: e,
368
343
  isItemDisabled: t,
369
344
  getItemLabel: n,
370
- getItemId: o
345
+ getItemId: r
371
346
  }) => {
372
- const i = {}, g = {}, m = {
373
- [ae]: []
374
- }, a = (c, r, s) => {
375
- var I, p;
376
- const f = o ? o(c) : c.id;
377
- if (f == null)
378
- throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(c)].join(`
347
+ const l = {}, h = {}, g = {
348
+ [K]: []
349
+ }, p = (f, o, s) => {
350
+ var c, i;
351
+ const u = r ? r(f) : f.id;
352
+ if (u == null)
353
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(f)].join(`
379
354
  `));
380
- if (i[f] != null)
381
- throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${f}"`].join(`
355
+ if (l[u] != null)
356
+ throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${u}"`].join(`
382
357
  `));
383
- const l = n ? n(c) : c.label;
384
- if (l == null)
385
- throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(c)].join(`
358
+ const b = n ? n(f) : f.label;
359
+ if (b == null)
360
+ throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(f)].join(`
386
361
  `));
387
- i[f] = {
388
- id: f,
389
- label: l,
362
+ l[u] = {
363
+ id: u,
364
+ label: b,
390
365
  parentId: s,
391
366
  idAttribute: void 0,
392
- expandable: !!((I = c.children) != null && I.length),
393
- disabled: t ? t(c) : !1,
394
- depth: r
395
- }, g[f] = c;
396
- const h = s ?? ae;
397
- m[h] || (m[h] = []), m[h].push(f), (p = c.children) == null || p.forEach((b) => a(b, r + 1, f));
367
+ expandable: !!((c = f.children) != null && c.length),
368
+ disabled: t ? t(f) : !1,
369
+ depth: o
370
+ }, h[u] = f;
371
+ const x = s ?? K;
372
+ g[x] || (g[x] = []), g[x].push(u), (i = f.children) == null || i.forEach((d) => p(d, o + 1, u));
398
373
  };
399
- e.forEach((c) => a(c, 0, null));
400
- const u = {};
401
- return Object.keys(m).forEach((c) => {
402
- u[c] = Cn(m[c]);
374
+ e.forEach((f) => p(f, 0, null));
375
+ const m = {};
376
+ return Object.keys(g).forEach((f) => {
377
+ m[f] = un(g[f]);
403
378
  }), {
404
- itemMetaMap: i,
405
- itemMap: g,
406
- itemOrderedChildrenIds: m,
407
- itemChildrenIndexes: u
379
+ itemMetaMap: l,
380
+ itemMap: h,
381
+ itemOrderedChildrenIds: g,
382
+ itemChildrenIndexes: m
408
383
  };
409
- }, he = ({
384
+ }, X = ({
410
385
  instance: e,
411
386
  params: t,
412
387
  state: n,
413
- setState: o,
414
- experimentalFeatures: i
388
+ setState: r,
389
+ experimentalFeatures: l
415
390
  }) => {
416
- const g = w.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]), m = w.useCallback((b) => n.items.itemMap[b], [n.items.itemMap]), a = w.useCallback(() => {
417
- const b = (x) => {
418
- const R = n.items.itemMap[x], M = G(R, En), E = n.items.itemOrderedChildrenIds[x];
419
- return E && (M.children = E.map(b)), M;
391
+ const h = E.useCallback((d) => n.items.itemMetaMap[d], [n.items.itemMetaMap]), g = E.useCallback((d) => n.items.itemMap[d], [n.items.itemMap]), p = E.useCallback(() => {
392
+ const d = (I) => {
393
+ const T = n.items.itemMap[I], P = A(T, dn), y = n.items.itemOrderedChildrenIds[I];
394
+ return y && (P.children = y.map(d)), P;
420
395
  };
421
- return n.items.itemOrderedChildrenIds[ae].map(b);
422
- }, [n.items.itemMap, n.items.itemOrderedChildrenIds]), u = w.useCallback((b) => {
423
- if (b == null)
396
+ return n.items.itemOrderedChildrenIds[K].map(d);
397
+ }, [n.items.itemMap, n.items.itemOrderedChildrenIds]), m = E.useCallback((d) => {
398
+ if (d == null)
424
399
  return !1;
425
- let x = e.getItemMeta(b);
426
- if (!x)
400
+ let I = e.getItemMeta(d);
401
+ if (!I)
427
402
  return !1;
428
- if (x.disabled)
403
+ if (I.disabled)
429
404
  return !0;
430
- for (; x.parentId != null; )
431
- if (x = e.getItemMeta(x.parentId), x.disabled)
405
+ for (; I.parentId != null; )
406
+ if (I = e.getItemMeta(I.parentId), I.disabled)
432
407
  return !0;
433
408
  return !1;
434
- }, [e]), c = w.useCallback((b) => {
435
- const x = e.getItemMeta(b).parentId ?? ae;
436
- return n.items.itemChildrenIndexes[x][b];
437
- }, [e, n.items.itemChildrenIndexes]), r = w.useCallback((b) => n.items.itemOrderedChildrenIds[b ?? ae] ?? [], [n.items.itemOrderedChildrenIds]), s = (b) => {
438
- const x = e.getItemMeta(b);
439
- return x == null ? null : document.getElementById(Ke({
409
+ }, [e]), f = E.useCallback((d) => {
410
+ const I = e.getItemMeta(d).parentId ?? K;
411
+ return n.items.itemChildrenIndexes[I][d];
412
+ }, [e, n.items.itemChildrenIndexes]), o = E.useCallback((d) => n.items.itemOrderedChildrenIds[d ?? K] ?? [], [n.items.itemOrderedChildrenIds]), s = (d) => {
413
+ const I = e.getItemMeta(d);
414
+ return I == null ? null : document.getElementById($e({
440
415
  treeId: n.id.treeId,
441
- itemId: b,
442
- id: x.idAttribute
416
+ itemId: d,
417
+ id: I.idAttribute
443
418
  }));
444
- }, f = (b) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(b), l = w.useRef(!1), h = w.useCallback(() => {
445
- l.current = !0;
446
- }, []), I = w.useCallback(() => l.current, []);
447
- return w.useEffect(() => {
448
- e.areItemUpdatesPrevented() || o((b) => {
449
- const x = pt({
419
+ }, u = (d) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(d), b = E.useRef(!1), x = E.useCallback(() => {
420
+ b.current = !0;
421
+ }, []), c = E.useCallback(() => b.current, []);
422
+ return E.useEffect(() => {
423
+ e.areItemUpdatesPrevented() || r((d) => {
424
+ const I = We({
450
425
  items: t.items,
451
426
  isItemDisabled: t.isItemDisabled,
452
427
  getItemId: t.getItemId,
453
428
  getItemLabel: t.getItemLabel
454
429
  });
455
- return Object.values(b.items.itemMetaMap).forEach((R) => {
456
- x.itemMetaMap[R.id] || Tn(e, "removeItem", {
457
- id: R.id
430
+ return Object.values(d.items.itemMetaMap).forEach((T) => {
431
+ I.itemMetaMap[T.id] || cn(e, "removeItem", {
432
+ id: T.id
458
433
  });
459
- }), C({}, b, {
460
- items: x
434
+ }), C({}, d, {
435
+ items: I
461
436
  });
462
437
  });
463
- }, [e, o, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
438
+ }, [e, r, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
464
439
  getRootProps: () => ({
465
440
  style: {
466
441
  "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
467
442
  }
468
443
  }),
469
444
  publicAPI: {
470
- getItem: m,
445
+ getItem: g,
471
446
  getItemDOMElement: s,
472
- getItemTree: a,
473
- getItemOrderedChildrenIds: r
447
+ getItemTree: p,
448
+ getItemOrderedChildrenIds: o
474
449
  },
475
450
  instance: {
476
- getItemMeta: g,
477
- getItem: m,
478
- getItemTree: a,
451
+ getItemMeta: h,
452
+ getItem: g,
453
+ getItemTree: p,
479
454
  getItemsToRender: () => {
480
- const b = (x) => {
481
- var M;
482
- const R = n.items.itemMetaMap[x];
455
+ const d = (I) => {
456
+ var P;
457
+ const T = n.items.itemMetaMap[I];
483
458
  return {
484
- label: R.label,
485
- itemId: R.id,
486
- id: R.idAttribute,
487
- children: (M = n.items.itemOrderedChildrenIds[x]) == null ? void 0 : M.map(b)
459
+ label: T.label,
460
+ itemId: T.id,
461
+ id: T.idAttribute,
462
+ children: (P = n.items.itemOrderedChildrenIds[I]) == null ? void 0 : P.map(d)
488
463
  };
489
464
  };
490
- return n.items.itemOrderedChildrenIds[ae].map(b);
465
+ return n.items.itemOrderedChildrenIds[K].map(d);
491
466
  },
492
- getItemIndex: c,
467
+ getItemIndex: f,
493
468
  getItemDOMElement: s,
494
- getItemOrderedChildrenIds: r,
495
- isItemDisabled: u,
496
- isItemNavigable: f,
497
- preventItemUpdates: h,
498
- areItemUpdatesPrevented: I
469
+ getItemOrderedChildrenIds: o,
470
+ isItemDisabled: m,
471
+ isItemNavigable: u,
472
+ preventItemUpdates: x,
473
+ areItemUpdatesPrevented: c
499
474
  },
500
475
  contextValue: {
501
476
  items: {
502
477
  onItemClick: t.onItemClick,
503
478
  disabledItemsFocusable: t.disabledItemsFocusable,
504
- indentationAtItemLevel: i.indentationAtItemLevel ?? !1
479
+ indentationAtItemLevel: l.indentationAtItemLevel ?? !1
505
480
  }
506
481
  }
507
482
  };
508
483
  };
509
- he.getInitialState = (e) => ({
510
- items: pt({
484
+ X.getInitialState = (e) => ({
485
+ items: We({
511
486
  items: e.items,
512
487
  isItemDisabled: e.isItemDisabled,
513
488
  getItemId: e.getItemId,
514
489
  getItemLabel: e.getItemLabel
515
490
  })
516
491
  });
517
- he.getDefaultizedParams = ({
492
+ X.getDefaultizedParams = ({
518
493
  params: e
519
494
  }) => C({}, e, {
520
495
  disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
521
496
  itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
522
497
  });
523
- he.wrapRoot = ({
498
+ X.wrapRoot = ({
524
499
  children: e,
525
500
  instance: t
526
- }) => /* @__PURE__ */ v(Pe.Provider, {
501
+ }) => /* @__PURE__ */ S(_e.Provider, {
527
502
  value: (n) => {
528
- var o;
529
- return ((o = t.getItemMeta(n)) == null ? void 0 : o.depth) ?? 0;
503
+ var r;
504
+ return ((r = t.getItemMeta(n)) == null ? void 0 : r.depth) ?? 0;
530
505
  },
531
506
  children: e
532
507
  });
533
- he.params = {
508
+ X.params = {
534
509
  disabledItemsFocusable: !0,
535
510
  items: !0,
536
511
  isItemDisabled: !0,
@@ -539,239 +514,157 @@ he.params = {
539
514
  onItemClick: !0,
540
515
  itemChildrenIndentation: !0
541
516
  };
542
- const Se = ({
517
+ const le = ({
543
518
  instance: e,
544
519
  params: t,
545
520
  models: n
546
521
  }) => {
547
- const o = w.useMemo(() => {
522
+ const r = E.useMemo(() => {
548
523
  const s = /* @__PURE__ */ new Map();
549
- return n.expandedItems.value.forEach((f) => {
550
- s.set(f, !0);
524
+ return n.expandedItems.value.forEach((u) => {
525
+ s.set(u, !0);
551
526
  }), s;
552
- }, [n.expandedItems.value]), i = (s, f) => {
553
- var l;
554
- (l = t.onExpandedItemsChange) == null || l.call(t, s, f), n.expandedItems.setControlledValue(f);
555
- }, g = w.useCallback((s) => o.has(s), [o]), m = w.useCallback((s) => {
556
- var f;
557
- return !!((f = e.getItemMeta(s)) != null && f.expandable);
558
- }, [e]), a = ce((s, f) => {
559
- const l = e.isItemExpanded(f);
560
- e.setItemExpansion(s, f, !l);
561
- }), u = ce((s, f, l) => {
562
- if (e.isItemExpanded(f) === l)
527
+ }, [n.expandedItems.value]), l = (s, u) => {
528
+ var b;
529
+ (b = t.onExpandedItemsChange) == null || b.call(t, s, u), n.expandedItems.setControlledValue(u);
530
+ }, h = E.useCallback((s) => r.has(s), [r]), g = E.useCallback((s) => {
531
+ var u;
532
+ return !!((u = e.getItemMeta(s)) != null && u.expandable);
533
+ }, [e]), p = U((s, u) => {
534
+ const b = e.isItemExpanded(u);
535
+ e.setItemExpansion(s, u, !b);
536
+ }), m = U((s, u, b) => {
537
+ if (e.isItemExpanded(u) === b)
563
538
  return;
564
- let I;
565
- l ? I = [f].concat(n.expandedItems.value) : I = n.expandedItems.value.filter((p) => p !== f), t.onItemExpansionToggle && t.onItemExpansionToggle(s, f, l), i(s, I);
566
- }), c = (s, f) => {
567
- const l = e.getItemMeta(f), I = e.getItemOrderedChildrenIds(l.parentId).filter((b) => e.isItemExpandable(b) && !e.isItemExpanded(b)), p = n.expandedItems.value.concat(I);
568
- I.length > 0 && (t.onItemExpansionToggle && I.forEach((b) => {
569
- t.onItemExpansionToggle(s, b, !0);
570
- }), i(s, p));
571
- }, r = w.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
539
+ let c;
540
+ b ? c = [u].concat(n.expandedItems.value) : c = n.expandedItems.value.filter((i) => i !== u), t.onItemExpansionToggle && t.onItemExpansionToggle(s, u, b), l(s, c);
541
+ }), f = (s, u) => {
542
+ const b = e.getItemMeta(u), c = e.getItemOrderedChildrenIds(b.parentId).filter((d) => e.isItemExpandable(d) && !e.isItemExpanded(d)), i = n.expandedItems.value.concat(c);
543
+ c.length > 0 && (t.onItemExpansionToggle && c.forEach((d) => {
544
+ t.onItemExpansionToggle(s, d, !0);
545
+ }), l(s, i));
546
+ }, o = E.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
572
547
  return {
573
548
  publicAPI: {
574
- setItemExpansion: u
549
+ setItemExpansion: m
575
550
  },
576
551
  instance: {
577
- isItemExpanded: g,
578
- isItemExpandable: m,
579
- setItemExpansion: u,
580
- toggleItemExpansion: a,
581
- expandAllSiblings: c
552
+ isItemExpanded: h,
553
+ isItemExpandable: g,
554
+ setItemExpansion: m,
555
+ toggleItemExpansion: p,
556
+ expandAllSiblings: f
582
557
  },
583
558
  contextValue: {
584
559
  expansion: {
585
- expansionTrigger: r
560
+ expansionTrigger: o
586
561
  }
587
562
  }
588
563
  };
589
564
  };
590
- Se.models = {
565
+ le.models = {
591
566
  expandedItems: {
592
567
  getDefaultValue: (e) => e.defaultExpandedItems
593
568
  }
594
569
  };
595
- const wn = [];
596
- Se.getDefaultizedParams = ({
570
+ const fn = [];
571
+ le.getDefaultizedParams = ({
597
572
  params: e
598
573
  }) => C({}, e, {
599
- defaultExpandedItems: e.defaultExpandedItems ?? wn
574
+ defaultExpandedItems: e.defaultExpandedItems ?? fn
600
575
  });
601
- Se.params = {
576
+ le.params = {
602
577
  expandedItems: !0,
603
578
  defaultExpandedItems: !0,
604
579
  onExpandedItemsChange: !0,
605
580
  onItemExpansionToggle: !0,
606
581
  expansionTrigger: !0
607
582
  };
608
- const ft = (e, t) => {
609
- let n = t.length - 1;
610
- for (; n >= 0 && !e.isItemNavigable(t[n]); )
611
- n -= 1;
612
- if (n !== -1)
613
- return t[n];
614
- }, mt = (e, t) => {
615
- const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(t);
616
- if (i === 0)
617
- return n.parentId;
618
- let g = i - 1;
619
- for (; !e.isItemNavigable(o[g]) && g >= 0; )
620
- g -= 1;
621
- if (g === -1)
622
- return n.parentId == null ? null : mt(e, n.parentId);
623
- let m = o[g], a = ft(e, e.getItemOrderedChildrenIds(m));
624
- for (; e.isItemExpanded(m) && a != null; )
625
- m = a, a = e.getItemOrderedChildrenIds(m).find(e.isItemNavigable);
626
- return m;
627
- }, we = (e, t) => {
628
- if (e.isItemExpanded(t)) {
629
- const o = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
630
- if (o != null)
631
- return o;
632
- }
633
- let n = e.getItemMeta(t);
634
- for (; n != null; ) {
635
- const o = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(n.id);
636
- if (i < o.length - 1) {
637
- let g = i + 1;
638
- for (; !e.isItemNavigable(o[g]) && g < o.length - 1; )
639
- g += 1;
640
- if (e.isItemNavigable(o[g]))
641
- return o[g];
642
- }
643
- n = e.getItemMeta(n.parentId);
644
- }
645
- return null;
646
- }, It = (e) => {
647
- let t = null;
648
- for (; t == null || e.isItemExpanded(t); ) {
649
- const n = e.getItemOrderedChildrenIds(t), o = ft(e, n);
650
- if (o == null)
651
- return t;
652
- t = o;
653
- }
654
- return t;
655
- }, ge = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), gt = (e, t, n) => {
656
- if (t === n)
657
- return [t, n];
658
- const o = e.getItemMeta(t), i = e.getItemMeta(n);
659
- if (o.parentId === i.id || i.parentId === o.id)
660
- return i.parentId === o.id ? [o.id, i.id] : [i.id, o.id];
661
- const g = [o.id], m = [i.id];
662
- let a = o.parentId, u = i.parentId, c = m.indexOf(a) !== -1, r = g.indexOf(u) !== -1, s = !0, f = !0;
663
- for (; !r && !c; )
664
- s && (g.push(a), c = m.indexOf(a) !== -1, s = a !== null, !c && s && (a = e.getItemMeta(a).parentId)), f && !c && (m.push(u), r = g.indexOf(u) !== -1, f = u !== null, !r && f && (u = e.getItemMeta(u).parentId));
665
- const l = c ? a : u, h = e.getItemOrderedChildrenIds(l), I = g[g.indexOf(l) - 1], p = m[m.indexOf(l) - 1];
666
- return h.indexOf(I) < h.indexOf(p) ? [t, n] : [n, t];
667
- }, Rn = (e, t, n) => {
668
- const o = (u) => {
669
- if (e.isItemExpandable(u) && e.isItemExpanded(u))
670
- return e.getItemOrderedChildrenIds(u)[0];
671
- let c = e.getItemMeta(u);
672
- for (; c != null; ) {
673
- const r = e.getItemOrderedChildrenIds(c.parentId), s = e.getItemIndex(c.id);
674
- if (s < r.length - 1)
675
- return r[s + 1];
676
- c = e.getItemMeta(c.parentId);
677
- }
678
- throw new Error("Invalid range");
679
- }, [i, g] = gt(e, t, n), m = [i];
680
- let a = i;
681
- for (; a !== g; )
682
- a = o(a), e.isItemDisabled(a) || m.push(a);
683
- return m;
684
- }, vn = (e) => {
685
- let t = ge(e);
686
- const n = [];
687
- for (; t != null; )
688
- n.push(t), t = we(e, t);
689
- return n;
690
- }, be = (e, t) => t !== e.closest('*[role="treeitem"]'), Re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], Fe = (e) => {
583
+ const re = (e) => Array.isArray(e) ? e : e != null ? [e] : [], be = (e) => {
691
584
  const t = {};
692
585
  return e.forEach((n) => {
693
586
  t[n] = !0;
694
587
  }), t;
695
- }, Me = ({
588
+ }, ae = ({
696
589
  instance: e,
697
590
  params: t,
698
591
  models: n
699
592
  }) => {
700
- const o = w.useRef(null), i = w.useRef({}), g = w.useMemo(() => {
701
- const I = /* @__PURE__ */ new Map();
702
- return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((p) => {
703
- I.set(p, !0);
704
- }) : n.selectedItems.value != null && I.set(n.selectedItems.value, !0), I;
705
- }, [n.selectedItems.value]), m = (I, p) => {
593
+ const r = E.useRef(null), l = E.useRef({}), h = E.useMemo(() => {
594
+ const c = /* @__PURE__ */ new Map();
595
+ return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((i) => {
596
+ c.set(i, !0);
597
+ }) : n.selectedItems.value != null && c.set(n.selectedItems.value, !0), c;
598
+ }, [n.selectedItems.value]), g = (c, i) => {
706
599
  if (t.onItemSelectionToggle)
707
600
  if (t.multiSelect) {
708
- const b = p.filter((R) => !e.isItemSelected(R)), x = n.selectedItems.value.filter((R) => !p.includes(R));
709
- b.forEach((R) => {
710
- t.onItemSelectionToggle(I, R, !0);
711
- }), x.forEach((R) => {
712
- t.onItemSelectionToggle(I, R, !1);
601
+ const d = i.filter((T) => !e.isItemSelected(T)), I = n.selectedItems.value.filter((T) => !i.includes(T));
602
+ d.forEach((T) => {
603
+ t.onItemSelectionToggle(c, T, !0);
604
+ }), I.forEach((T) => {
605
+ t.onItemSelectionToggle(c, T, !1);
713
606
  });
714
- } else p !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(I, n.selectedItems.value, !1), p != null && t.onItemSelectionToggle(I, p, !0));
715
- t.onSelectedItemsChange && t.onSelectedItemsChange(I, p), n.selectedItems.setControlledValue(p);
716
- }, a = (I) => g.has(I), u = ({
717
- event: I,
718
- itemId: p,
719
- keepExistingSelection: b = !1,
720
- shouldBeSelected: x
607
+ } else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(c, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(c, i, !0));
608
+ t.onSelectedItemsChange && t.onSelectedItemsChange(c, i), n.selectedItems.setControlledValue(i);
609
+ }, p = (c) => h.has(c), m = ({
610
+ event: c,
611
+ itemId: i,
612
+ keepExistingSelection: d = !1,
613
+ shouldBeSelected: I
721
614
  }) => {
722
615
  if (t.disableSelection)
723
616
  return;
724
- let R;
725
- if (b) {
726
- const M = Re(n.selectedItems.value), E = e.isItemSelected(p);
727
- E && (x === !1 || x == null) ? R = M.filter((P) => P !== p) : !E && (x === !0 || x == null) ? R = [p].concat(M) : R = M;
617
+ let T;
618
+ if (d) {
619
+ const P = re(n.selectedItems.value), y = e.isItemSelected(i);
620
+ y && (I === !1 || I == null) ? T = P.filter((R) => R !== i) : !y && (I === !0 || I == null) ? T = [i].concat(P) : T = P;
728
621
  } else
729
- x === !1 || x == null && e.isItemSelected(p) ? R = t.multiSelect ? [] : null : R = t.multiSelect ? [p] : p;
730
- m(I, R), o.current = p, i.current = {};
731
- }, c = (I, [p, b]) => {
622
+ I === !1 || I == null && e.isItemSelected(i) ? T = t.multiSelect ? [] : null : T = t.multiSelect ? [i] : i;
623
+ g(c, T), r.current = i, l.current = {};
624
+ }, f = (c, [i, d]) => {
732
625
  if (t.disableSelection || !t.multiSelect)
733
626
  return;
734
- let x = Re(n.selectedItems.value).slice();
735
- Object.keys(i.current).length > 0 && (x = x.filter((P) => !i.current[P]));
736
- const R = Fe(x), M = Rn(e, p, b), E = M.filter((P) => !R[P]);
737
- x = x.concat(E), m(I, x), i.current = Fe(M);
627
+ let I = re(n.selectedItems.value).slice();
628
+ Object.keys(l.current).length > 0 && (I = I.filter((R) => !l.current[R]));
629
+ const T = be(I), P = At(e, i, d), y = P.filter((R) => !T[R]);
630
+ I = I.concat(y), g(c, I), l.current = be(P);
738
631
  };
739
632
  return {
740
633
  getRootProps: () => ({
741
634
  "aria-multiselectable": t.multiSelect
742
635
  }),
743
636
  publicAPI: {
744
- selectItem: u
637
+ selectItem: m
745
638
  },
746
639
  instance: {
747
- isItemSelected: a,
748
- selectItem: u,
749
- selectAllNavigableItems: (I) => {
640
+ isItemSelected: p,
641
+ selectItem: m,
642
+ selectAllNavigableItems: (c) => {
750
643
  if (t.disableSelection || !t.multiSelect)
751
644
  return;
752
- const p = vn(e);
753
- m(I, p), i.current = Fe(p);
645
+ const i = Vt(e);
646
+ g(c, i), l.current = be(i);
754
647
  },
755
- expandSelectionRange: (I, p) => {
756
- if (o.current != null) {
757
- const [b, x] = gt(e, p, o.current);
758
- c(I, [b, x]);
648
+ expandSelectionRange: (c, i) => {
649
+ if (r.current != null) {
650
+ const [d, I] = Ot(e, i, r.current);
651
+ f(c, [d, I]);
759
652
  }
760
653
  },
761
- selectRangeFromStartToItem: (I, p) => {
762
- c(I, [ge(e), p]);
654
+ selectRangeFromStartToItem: (c, i) => {
655
+ f(c, [se(e), i]);
763
656
  },
764
- selectRangeFromItemToEnd: (I, p) => {
765
- c(I, [p, It(e)]);
657
+ selectRangeFromItemToEnd: (c, i) => {
658
+ f(c, [i, Ne(e)]);
766
659
  },
767
- selectItemFromArrowNavigation: (I, p, b) => {
660
+ selectItemFromArrowNavigation: (c, i, d) => {
768
661
  if (t.disableSelection || !t.multiSelect)
769
662
  return;
770
- let x = Re(n.selectedItems.value).slice();
771
- Object.keys(i.current).length === 0 ? (x.push(b), i.current = {
772
- [p]: !0,
773
- [b]: !0
774
- }) : (i.current[p] || (i.current = {}), i.current[b] ? (x = x.filter((R) => R !== p), delete i.current[p]) : (x.push(b), i.current[b] = !0)), m(I, x);
663
+ let I = re(n.selectedItems.value).slice();
664
+ Object.keys(l.current).length === 0 ? (I.push(d), l.current = {
665
+ [i]: !0,
666
+ [d]: !0
667
+ }) : (l.current[i] || (l.current = {}), l.current[d] ? (I = I.filter((T) => T !== i), delete l.current[i]) : (I.push(d), l.current[d] = !0)), g(c, I);
775
668
  }
776
669
  },
777
670
  contextValue: {
@@ -783,21 +676,21 @@ const ft = (e, t) => {
783
676
  }
784
677
  };
785
678
  };
786
- Me.models = {
679
+ ae.models = {
787
680
  selectedItems: {
788
681
  getDefaultValue: (e) => e.defaultSelectedItems
789
682
  }
790
683
  };
791
- const Pn = [];
792
- Me.getDefaultizedParams = ({
684
+ const pn = [];
685
+ ae.getDefaultizedParams = ({
793
686
  params: e
794
687
  }) => C({}, e, {
795
688
  disableSelection: e.disableSelection ?? !1,
796
689
  multiSelect: e.multiSelect ?? !1,
797
690
  checkboxSelection: e.checkboxSelection ?? !1,
798
- defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? Pn : null)
691
+ defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? pn : null)
799
692
  });
800
- Me.params = {
693
+ ae.params = {
801
694
  disableSelection: !0,
802
695
  multiSelect: !0,
803
696
  checkboxSelection: !0,
@@ -806,17 +699,17 @@ Me.params = {
806
699
  onSelectedItemsChange: !0,
807
700
  onItemSelectionToggle: !0
808
701
  };
809
- const ot = 1e3;
810
- class Sn {
811
- constructor(t = ot) {
812
- this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = ot, this.cleanupTimeout = t;
702
+ const Le = 1e3;
703
+ class mn {
704
+ constructor(t = Le) {
705
+ this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = Le, this.cleanupTimeout = t;
813
706
  }
814
- register(t, n, o) {
707
+ register(t, n, r) {
815
708
  this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
816
- const i = setTimeout(() => {
817
- typeof n == "function" && n(), this.timeouts.delete(o.cleanupToken);
709
+ const l = setTimeout(() => {
710
+ typeof n == "function" && n(), this.timeouts.delete(r.cleanupToken);
818
711
  }, this.cleanupTimeout);
819
- this.timeouts.set(o.cleanupToken, i);
712
+ this.timeouts.set(r.cleanupToken, l);
820
713
  }
821
714
  unregister(t) {
822
715
  const n = this.timeouts.get(t.cleanupToken);
@@ -830,14 +723,14 @@ class Sn {
830
723
  }), this.timeouts = void 0);
831
724
  }
832
725
  }
833
- class Mn {
726
+ class In {
834
727
  constructor() {
835
728
  this.registry = new FinalizationRegistry((t) => {
836
729
  typeof t == "function" && t();
837
730
  });
838
731
  }
839
- register(t, n, o) {
840
- this.registry.register(t, n, o);
732
+ register(t, n, r) {
733
+ this.registry.register(t, n, r);
841
734
  }
842
735
  unregister(t) {
843
736
  this.registry.unregister(t);
@@ -846,264 +739,162 @@ class Mn {
846
739
  reset() {
847
740
  }
848
741
  }
849
- class kn {
742
+ class gn {
850
743
  }
851
- function Dn(e) {
744
+ function bn(e) {
852
745
  let t = 0;
853
- return function(o, i, g) {
854
- e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new Mn() : new Sn());
855
- const [m] = w.useState(new kn()), a = w.useRef(null), u = w.useRef(void 0);
856
- u.current = g;
857
- const c = w.useRef(null);
858
- if (!a.current && u.current) {
859
- const r = (s, f) => {
860
- var l;
861
- f.defaultMuiPrevented || (l = u.current) == null || l.call(u, s, f);
746
+ return function(r, l, h) {
747
+ e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new In() : new mn());
748
+ const [g] = E.useState(new gn()), p = E.useRef(null), m = E.useRef(void 0);
749
+ m.current = h;
750
+ const f = E.useRef(null);
751
+ if (!p.current && m.current) {
752
+ const o = (s, u) => {
753
+ var b;
754
+ u.defaultMuiPrevented || (b = m.current) == null || b.call(m, s, u);
862
755
  };
863
- a.current = o.$$subscribeEvent(i, r), t += 1, c.current = {
756
+ p.current = r.$$subscribeEvent(l, o), t += 1, f.current = {
864
757
  cleanupToken: t
865
758
  }, e.registry.register(
866
- m,
759
+ g,
867
760
  // The callback below will be called once this reference stops being retained
868
761
  () => {
869
762
  var s;
870
- (s = a.current) == null || s.call(a), a.current = null, c.current = null;
763
+ (s = p.current) == null || s.call(p), p.current = null, f.current = null;
871
764
  },
872
- c.current
765
+ f.current
873
766
  );
874
- } else !u.current && a.current && (a.current(), a.current = null, c.current && (e.registry.unregister(c.current), c.current = null));
875
- w.useEffect(() => {
876
- if (!a.current && u.current) {
877
- const r = (s, f) => {
878
- var l;
879
- f.defaultMuiPrevented || (l = u.current) == null || l.call(u, s, f);
767
+ } else !m.current && p.current && (p.current(), p.current = null, f.current && (e.registry.unregister(f.current), f.current = null));
768
+ E.useEffect(() => {
769
+ if (!p.current && m.current) {
770
+ const o = (s, u) => {
771
+ var b;
772
+ u.defaultMuiPrevented || (b = m.current) == null || b.call(m, s, u);
880
773
  };
881
- a.current = o.$$subscribeEvent(i, r);
774
+ p.current = r.$$subscribeEvent(l, o);
882
775
  }
883
- return c.current && e.registry && (e.registry.unregister(c.current), c.current = null), () => {
884
- var r;
885
- (r = a.current) == null || r.call(a), a.current = null;
776
+ return f.current && e.registry && (e.registry.unregister(f.current), f.current = null), () => {
777
+ var o;
778
+ (o = p.current) == null || o.call(p), p.current = null;
886
779
  };
887
- }, [o, i]);
780
+ }, [r, l]);
888
781
  };
889
782
  }
890
- const On = {
783
+ const hn = {
891
784
  registry: null
892
- }, An = Dn(On), bt = (e = document) => {
785
+ }, xn = bn(hn), Ge = (e = document) => {
893
786
  const t = e.activeElement;
894
- return t ? t.shadowRoot ? bt(t.shadowRoot) : t : null;
895
- }, Ln = (e, t) => {
896
- let n = Re(t).find((o) => {
897
- if (!e.isItemNavigable(o))
787
+ return t ? t.shadowRoot ? Ge(t.shadowRoot) : t : null;
788
+ }, En = (e, t) => {
789
+ let n = re(t).find((r) => {
790
+ if (!e.isItemNavigable(r))
898
791
  return !1;
899
- const i = e.getItemMeta(o);
900
- return i && (i.parentId == null || e.isItemExpanded(i.parentId));
792
+ const l = e.getItemMeta(r);
793
+ return l && (l.parentId == null || e.isItemExpanded(l.parentId));
901
794
  });
902
- return n == null && (n = ge(e)), n;
903
- }, Ue = ({
795
+ return n == null && (n = se(e)), n;
796
+ }, ye = ({
904
797
  instance: e,
905
798
  params: t,
906
799
  state: n,
907
- setState: o,
908
- models: i,
909
- rootRef: g
800
+ setState: r,
801
+ models: l,
802
+ rootRef: h
910
803
  }) => {
911
- const m = Ln(e, i.selectedItems.value), a = ce((p) => {
912
- const b = typeof p == "function" ? p(n.focusedItemId) : p;
913
- n.focusedItemId !== b && o((x) => C({}, x, {
914
- focusedItemId: b
804
+ const g = En(e, l.selectedItems.value), p = U((i) => {
805
+ const d = typeof i == "function" ? i(n.focusedItemId) : i;
806
+ n.focusedItemId !== d && r((I) => C({}, I, {
807
+ focusedItemId: d
915
808
  }));
916
- }), u = w.useCallback(() => !!g.current && g.current.contains(bt(on(g.current))), [g]), c = w.useCallback((p) => n.focusedItemId === p && u(), [n.focusedItemId, u]), r = (p) => {
917
- const b = e.getItemMeta(p);
918
- return b && (b.parentId == null || e.isItemExpanded(b.parentId));
919
- }, s = (p, b) => {
920
- const x = e.getItemDOMElement(b);
921
- x && x.focus(), a(b), t.onItemFocus && t.onItemFocus(p, b);
922
- }, f = ce((p, b) => {
923
- r(b) && s(p, b);
924
- }), l = ce(() => {
809
+ }), m = E.useCallback(() => !!h.current && h.current.contains(Ge(qt(h.current))), [h]), f = E.useCallback((i) => n.focusedItemId === i && m(), [n.focusedItemId, m]), o = (i) => {
810
+ const d = e.getItemMeta(i);
811
+ return d && (d.parentId == null || e.isItemExpanded(d.parentId));
812
+ }, s = (i, d) => {
813
+ const I = e.getItemDOMElement(d);
814
+ I && I.focus(), p(d), t.onItemFocus && t.onItemFocus(i, d);
815
+ }, u = U((i, d) => {
816
+ o(d) && s(i, d);
817
+ }), b = U(() => {
925
818
  if (n.focusedItemId == null)
926
819
  return;
927
820
  if (e.getItemMeta(n.focusedItemId)) {
928
- const b = e.getItemDOMElement(n.focusedItemId);
929
- b && b.blur();
821
+ const d = e.getItemDOMElement(n.focusedItemId);
822
+ d && d.blur();
930
823
  }
931
- a(null);
932
- }), h = (p) => p === m;
933
- An(e, "removeItem", ({
934
- id: p
824
+ p(null);
825
+ }), x = (i) => i === g;
826
+ xn(e, "removeItem", ({
827
+ id: i
935
828
  }) => {
936
- n.focusedItemId === p && s(null, m);
829
+ n.focusedItemId === i && s(null, g);
937
830
  });
938
- const I = (p) => (b) => {
939
- var x;
940
- (x = p.onFocus) == null || x.call(p, b), !b.defaultMuiPrevented && b.target === b.currentTarget && s(b, m);
831
+ const c = (i) => (d) => {
832
+ var I;
833
+ (I = i.onFocus) == null || I.call(i, d), !d.defaultMuiPrevented && d.target === d.currentTarget && s(d, g);
941
834
  };
942
835
  return {
943
- getRootProps: (p) => ({
944
- onFocus: I(p)
836
+ getRootProps: (i) => ({
837
+ onFocus: c(i)
945
838
  }),
946
839
  publicAPI: {
947
- focusItem: f
840
+ focusItem: u
948
841
  },
949
842
  instance: {
950
- isItemFocused: c,
951
- canItemBeTabbed: h,
952
- focusItem: f,
953
- removeFocusedItem: l
843
+ isItemFocused: f,
844
+ canItemBeTabbed: x,
845
+ focusItem: u,
846
+ removeFocusedItem: b
954
847
  }
955
848
  };
956
849
  };
957
- Ue.getInitialState = () => ({
850
+ ye.getInitialState = () => ({
958
851
  focusedItemId: null
959
852
  });
960
- Ue.params = {
853
+ ye.params = {
961
854
  onItemFocus: !0
962
855
  };
963
- const re = (e, t) => e.getAvailablePlugins().has(t), Vn = ({
964
- props: e
965
- }) => {
966
- const {
967
- instance: t
968
- } = ie(), {
969
- label: n,
970
- itemId: o
971
- } = e, [i, g] = w.useState(n), m = t.isItemBeingEdited(o);
972
- return w.useEffect(() => {
973
- m || g(n);
974
- }, [m, n]), {
975
- propsEnhancers: {
976
- labelInput: ({
977
- externalEventHandlers: a,
978
- interactions: u
979
- }) => t.isItemEditable(o) ? {
980
- value: i ?? "",
981
- "data-element": "labelInput",
982
- onChange: (l) => {
983
- var h;
984
- (h = a.onChange) == null || h.call(a, l), g(l.target.value);
985
- },
986
- onKeyDown: (l) => {
987
- var I;
988
- if ((I = a.onKeyDown) == null || I.call(a, l), l.defaultMuiPrevented)
989
- return;
990
- const h = l.target;
991
- l.key === "Enter" && h.value ? u.handleSaveItemLabel(l, h.value) : l.key === "Escape" && u.handleCancelItemLabelEditing(l);
992
- },
993
- onBlur: (l) => {
994
- var h;
995
- (h = a.onBlur) == null || h.call(a, l), !l.defaultMuiPrevented && l.target.value && u.handleSaveItemLabel(l, l.target.value);
996
- },
997
- autoFocus: !0,
998
- type: "text"
999
- } : {}
1000
- }
1001
- };
1002
- }, K = ({
1003
- instance: e,
1004
- state: t,
1005
- setState: n,
1006
- params: o
1007
- }) => {
1008
- const i = w.useRef(t.editedItemId), g = (s) => i.current === s, m = (s) => {
1009
- n((f) => C({}, f, {
1010
- editedItemId: s
1011
- })), i.current = s;
1012
- }, a = (s) => s === t.editedItemId, u = !!o.isItemEditable, c = (s) => {
1013
- if (s == null || !u)
1014
- return !1;
1015
- const f = e.getItem(s);
1016
- return f ? typeof o.isItemEditable == "function" ? o.isItemEditable(f) : !!o.isItemEditable : !1;
1017
- }, r = (s, f) => {
1018
- if (!f)
1019
- throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", s].join(`
1020
- `));
1021
- n((l) => {
1022
- const h = l.items.itemMetaMap[s];
1023
- return h.label !== f ? C({}, l, {
1024
- items: C({}, l.items, {
1025
- itemMetaMap: C({}, l.items.itemMetaMap, {
1026
- [s]: C({}, h, {
1027
- label: f
1028
- })
1029
- })
1030
- })
1031
- }) : l;
1032
- }), o.onItemLabelChange && o.onItemLabelChange(s, f);
1033
- };
1034
- return {
1035
- instance: {
1036
- setEditedItemId: m,
1037
- isItemBeingEdited: a,
1038
- updateItemLabel: r,
1039
- isItemEditable: c,
1040
- isTreeViewEditable: u,
1041
- isItemBeingEditedRef: g
1042
- },
1043
- publicAPI: {
1044
- updateItemLabel: r
1045
- }
1046
- };
1047
- };
1048
- K.itemPlugin = Vn;
1049
- K.getDefaultizedParams = ({
1050
- params: e,
1051
- experimentalFeatures: t
1052
- }) => {
1053
- const n = t == null ? void 0 : t.labelEditing;
1054
- return process.env.NODE_ENV !== "production" && e.isItemEditable && !n && ve(["MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.", "You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/"]), C({}, e, {
1055
- isItemEditable: n ? e.isItemEditable ?? !1 : !1
1056
- });
1057
- };
1058
- K.getInitialState = () => ({
1059
- editedItemId: null
1060
- });
1061
- K.params = {
1062
- onItemLabelChange: !0,
1063
- isItemEditable: !0
1064
- };
1065
- function Fn(e) {
856
+ function Tn(e) {
1066
857
  return !!e && e.length === 1 && !!e.match(/\S/);
1067
858
  }
1068
- const ht = ({
859
+ const Je = ({
1069
860
  instance: e,
1070
861
  params: t,
1071
862
  state: n
1072
863
  }) => {
1073
- const o = nn(), i = w.useRef({}), g = ce((r) => {
1074
- i.current = r(i.current);
864
+ const r = Ht(), l = E.useRef({}), h = U((o) => {
865
+ l.current = o(l.current);
1075
866
  });
1076
- w.useEffect(() => {
867
+ E.useEffect(() => {
1077
868
  if (e.areItemUpdatesPrevented())
1078
869
  return;
1079
- const r = {}, s = (f) => {
1080
- r[f.id] = f.label.substring(0, 1).toLowerCase();
870
+ const o = {}, s = (u) => {
871
+ o[u.id] = u.label.substring(0, 1).toLowerCase();
1081
872
  };
1082
- Object.values(n.items.itemMetaMap).forEach(s), i.current = r;
873
+ Object.values(n.items.itemMetaMap).forEach(s), l.current = o;
1083
874
  }, [n.items.itemMetaMap, t.getItemId, e]);
1084
- const m = (r, s) => {
1085
- const f = s.toLowerCase(), l = (b) => {
1086
- const x = we(e, b);
1087
- return x === null ? ge(e) : x;
875
+ const g = (o, s) => {
876
+ const u = s.toLowerCase(), b = (d) => {
877
+ const I = ge(e, d);
878
+ return I === null ? se(e) : I;
1088
879
  };
1089
- let h = null, I = l(r);
1090
- const p = {};
1091
- for (; h == null && !p[I]; )
1092
- i.current[I] === f ? h = I : (p[I] = !0, I = l(I));
1093
- return h;
1094
- }, a = (r) => !t.disableSelection && !e.isItemDisabled(r), u = (r) => !e.isItemDisabled(r) && e.isItemExpandable(r);
880
+ let x = null, c = b(o);
881
+ const i = {};
882
+ for (; x == null && !i[c]; )
883
+ l.current[c] === u ? x = c : (i[c] = !0, c = b(c));
884
+ return x;
885
+ }, p = (o) => !t.disableSelection && !e.isItemDisabled(o), m = (o) => !e.isItemDisabled(o) && e.isItemExpandable(o);
1095
886
  return {
1096
887
  instance: {
1097
- updateFirstCharMap: g,
1098
- handleItemKeyDown: (r, s) => {
1099
- if (r.defaultMuiPrevented || r.altKey || be(r.target, r.currentTarget))
888
+ updateFirstCharMap: h,
889
+ handleItemKeyDown: (o, s) => {
890
+ if (o.defaultMuiPrevented || o.altKey || he(o.target, o.currentTarget))
1100
891
  return;
1101
- const f = r.ctrlKey || r.metaKey, l = r.key;
892
+ const u = o.ctrlKey || o.metaKey, b = o.key;
1102
893
  switch (!0) {
1103
894
  // Select the item when pressing "Space"
1104
- case (l === " " && a(s)): {
1105
- r.preventDefault(), t.multiSelect && r.shiftKey ? e.expandSelectionRange(r, s) : e.selectItem({
1106
- event: r,
895
+ case (b === " " && p(s)): {
896
+ o.preventDefault(), t.multiSelect && o.shiftKey ? e.expandSelectionRange(o, s) : e.selectItem({
897
+ event: o,
1107
898
  itemId: s,
1108
899
  keepExistingSelection: t.multiSelect,
1109
900
  shouldBeSelected: t.multiSelect ? void 0 : !0
@@ -1112,79 +903,79 @@ const ht = ({
1112
903
  }
1113
904
  // If the focused item has children, we expand it.
1114
905
  // If the focused item has no children, we select it.
1115
- case l === "Enter": {
1116
- re(e, K) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : u(s) ? (e.toggleItemExpansion(r, s), r.preventDefault()) : a(s) && (t.multiSelect ? (r.preventDefault(), e.selectItem({
1117
- event: r,
906
+ case b === "Enter": {
907
+ oe(e, H) && e.isItemEditable(s) && !e.isItemBeingEdited(s) ? e.setEditedItemId(s) : m(s) ? (e.toggleItemExpansion(o, s), o.preventDefault()) : p(s) && (t.multiSelect ? (o.preventDefault(), e.selectItem({
908
+ event: o,
1118
909
  itemId: s,
1119
910
  keepExistingSelection: !0
1120
911
  })) : e.isItemSelected(s) || (e.selectItem({
1121
- event: r,
912
+ event: o,
1122
913
  itemId: s
1123
- }), r.preventDefault()));
914
+ }), o.preventDefault()));
1124
915
  break;
1125
916
  }
1126
917
  // Focus the next focusable item
1127
- case l === "ArrowDown": {
1128
- const h = we(e, s);
1129
- h && (r.preventDefault(), e.focusItem(r, h), t.multiSelect && r.shiftKey && a(h) && e.selectItemFromArrowNavigation(r, s, h));
918
+ case b === "ArrowDown": {
919
+ const x = ge(e, s);
920
+ x && (o.preventDefault(), e.focusItem(o, x), t.multiSelect && o.shiftKey && p(x) && e.selectItemFromArrowNavigation(o, s, x));
1130
921
  break;
1131
922
  }
1132
923
  // Focuses the previous focusable item
1133
- case l === "ArrowUp": {
1134
- const h = mt(e, s);
1135
- h && (r.preventDefault(), e.focusItem(r, h), t.multiSelect && r.shiftKey && a(h) && e.selectItemFromArrowNavigation(r, s, h));
924
+ case b === "ArrowUp": {
925
+ const x = Ft(e, s);
926
+ x && (o.preventDefault(), e.focusItem(o, x), t.multiSelect && o.shiftKey && p(x) && e.selectItemFromArrowNavigation(o, s, x));
1136
927
  break;
1137
928
  }
1138
929
  // If the focused item is expanded, we move the focus to its first child
1139
930
  // If the focused item is collapsed and has children, we expand it
1140
- case (l === "ArrowRight" && !o || l === "ArrowLeft" && o): {
1141
- if (f)
931
+ case (b === "ArrowRight" && !r || b === "ArrowLeft" && r): {
932
+ if (u)
1142
933
  return;
1143
934
  if (e.isItemExpanded(s)) {
1144
- const h = we(e, s);
1145
- h && (e.focusItem(r, h), r.preventDefault());
1146
- } else u(s) && (e.toggleItemExpansion(r, s), r.preventDefault());
935
+ const x = ge(e, s);
936
+ x && (e.focusItem(o, x), o.preventDefault());
937
+ } else m(s) && (e.toggleItemExpansion(o, s), o.preventDefault());
1147
938
  break;
1148
939
  }
1149
940
  // If the focused item is expanded, we collapse it
1150
941
  // If the focused item is collapsed and has a parent, we move the focus to this parent
1151
- case (l === "ArrowLeft" && !o || l === "ArrowRight" && o): {
1152
- if (f)
942
+ case (b === "ArrowLeft" && !r || b === "ArrowRight" && r): {
943
+ if (u)
1153
944
  return;
1154
- if (u(s) && e.isItemExpanded(s))
1155
- e.toggleItemExpansion(r, s), r.preventDefault();
945
+ if (m(s) && e.isItemExpanded(s))
946
+ e.toggleItemExpansion(o, s), o.preventDefault();
1156
947
  else {
1157
- const h = e.getItemMeta(s).parentId;
1158
- h && (e.focusItem(r, h), r.preventDefault());
948
+ const x = e.getItemMeta(s).parentId;
949
+ x && (e.focusItem(o, x), o.preventDefault());
1159
950
  }
1160
951
  break;
1161
952
  }
1162
953
  // Focuses the first item in the tree
1163
- case l === "Home": {
1164
- a(s) && t.multiSelect && f && r.shiftKey ? e.selectRangeFromStartToItem(r, s) : e.focusItem(r, ge(e)), r.preventDefault();
954
+ case b === "Home": {
955
+ p(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromStartToItem(o, s) : e.focusItem(o, se(e)), o.preventDefault();
1165
956
  break;
1166
957
  }
1167
958
  // Focuses the last item in the tree
1168
- case l === "End": {
1169
- a(s) && t.multiSelect && f && r.shiftKey ? e.selectRangeFromItemToEnd(r, s) : e.focusItem(r, It(e)), r.preventDefault();
959
+ case b === "End": {
960
+ p(s) && t.multiSelect && u && o.shiftKey ? e.selectRangeFromItemToEnd(o, s) : e.focusItem(o, Ne(e)), o.preventDefault();
1170
961
  break;
1171
962
  }
1172
963
  // Expand all siblings that are at the same level as the focused item
1173
- case l === "*": {
1174
- e.expandAllSiblings(r, s), r.preventDefault();
964
+ case b === "*": {
965
+ e.expandAllSiblings(o, s), o.preventDefault();
1175
966
  break;
1176
967
  }
1177
968
  // Multi select behavior when pressing Ctrl + a
1178
969
  // Selects all the items
1179
- case (String.fromCharCode(r.keyCode) === "A" && f && t.multiSelect && !t.disableSelection): {
1180
- e.selectAllNavigableItems(r), r.preventDefault();
970
+ case (String.fromCharCode(o.keyCode) === "A" && u && t.multiSelect && !t.disableSelection): {
971
+ e.selectAllNavigableItems(o), o.preventDefault();
1181
972
  break;
1182
973
  }
1183
974
  // Type-ahead
1184
975
  // TODO: Support typing multiple characters
1185
- case (!f && !r.shiftKey && Fn(l)): {
1186
- const h = m(s, l);
1187
- h != null && (e.focusItem(r, h), r.preventDefault());
976
+ case (!u && !o.shiftKey && Tn(b)): {
977
+ const x = g(s, b);
978
+ x != null && (e.focusItem(o, x), o.preventDefault());
1188
979
  break;
1189
980
  }
1190
981
  }
@@ -1192,8 +983,8 @@ const ht = ({
1192
983
  }
1193
984
  };
1194
985
  };
1195
- ht.params = {};
1196
- const xt = ({
986
+ Je.params = {};
987
+ const Ye = ({
1197
988
  slots: e,
1198
989
  slotProps: t
1199
990
  }) => ({
@@ -1212,221 +1003,144 @@ const xt = ({
1212
1003
  }
1213
1004
  }
1214
1005
  });
1215
- xt.params = {};
1216
- const $n = [he, Se, Me, Ue, ht, xt, K];
1217
- function yt(e) {
1006
+ Ye.params = {};
1007
+ const yn = [X, le, ae, ye, Je, Ye, H];
1008
+ function Qe(e) {
1218
1009
  const {
1219
1010
  instance: t,
1220
1011
  items: {
1221
1012
  onItemClick: n
1222
1013
  },
1223
1014
  selection: {
1224
- multiSelect: o,
1225
- checkboxSelection: i,
1226
- disableSelection: g
1015
+ multiSelect: r,
1016
+ checkboxSelection: l,
1017
+ disableSelection: h
1227
1018
  },
1228
1019
  expansion: {
1229
- expansionTrigger: m
1020
+ expansionTrigger: g
1230
1021
  }
1231
- } = ie(), a = t.isItemExpandable(e), u = t.isItemExpanded(e), c = t.isItemFocused(e), r = t.isItemSelected(e), s = t.isItemDisabled(e), f = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, l = t.isItemEditable ? t.isItemEditable(e) : !1, h = (E) => {
1022
+ } = Ke(), p = t.isItemExpandable(e), m = t.isItemExpanded(e), f = t.isItemFocused(e), o = t.isItemSelected(e), s = t.isItemDisabled(e), u = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, b = t.isItemEditable ? t.isItemEditable(e) : !1, x = (y) => {
1232
1023
  if (!s) {
1233
- c || t.focusItem(E, e);
1234
- const P = o && (E.shiftKey || E.ctrlKey || E.metaKey);
1235
- a && !(P && t.isItemExpanded(e)) && t.toggleItemExpansion(E, e);
1024
+ f || t.focusItem(y, e);
1025
+ const R = r && (y.shiftKey || y.ctrlKey || y.metaKey);
1026
+ p && !(R && t.isItemExpanded(e)) && t.toggleItemExpansion(y, e);
1236
1027
  }
1237
- }, I = (E) => {
1238
- s || (c || t.focusItem(E, e), o && (E.shiftKey || E.ctrlKey || E.metaKey) ? E.shiftKey ? t.expandSelectionRange(E, e) : t.selectItem({
1239
- event: E,
1028
+ }, c = (y) => {
1029
+ s || (f || t.focusItem(y, e), r && (y.shiftKey || y.ctrlKey || y.metaKey) ? y.shiftKey ? t.expandSelectionRange(y, e) : t.selectItem({
1030
+ event: y,
1240
1031
  itemId: e,
1241
1032
  keepExistingSelection: !0
1242
1033
  }) : t.selectItem({
1243
- event: E,
1034
+ event: y,
1244
1035
  itemId: e,
1245
1036
  shouldBeSelected: !0
1246
1037
  }));
1247
- }, p = (E) => {
1248
- if (g || s)
1038
+ }, i = (y) => {
1039
+ if (h || s)
1249
1040
  return;
1250
- const P = E.nativeEvent.shiftKey;
1251
- o && P ? t.expandSelectionRange(E, e) : t.selectItem({
1252
- event: E,
1041
+ const R = y.nativeEvent.shiftKey;
1042
+ r && R ? t.expandSelectionRange(y, e) : t.selectItem({
1043
+ event: y,
1253
1044
  itemId: e,
1254
- keepExistingSelection: o,
1255
- shouldBeSelected: E.target.checked
1045
+ keepExistingSelection: r,
1046
+ shouldBeSelected: y.target.checked
1256
1047
  });
1257
- }, b = (E) => {
1258
- (E.shiftKey || E.ctrlKey || E.metaKey || s) && E.preventDefault();
1259
- }, x = () => {
1260
- re(t, K) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
1048
+ }, d = (y) => {
1049
+ (y.shiftKey || y.ctrlKey || y.metaKey || s) && y.preventDefault();
1050
+ }, I = () => {
1051
+ oe(t, H) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
1261
1052
  };
1262
1053
  return {
1263
1054
  disabled: s,
1264
- expanded: u,
1265
- selected: r,
1266
- focused: c,
1267
- editable: l,
1268
- editing: f,
1269
- disableSelection: g,
1270
- checkboxSelection: i,
1271
- handleExpansion: h,
1272
- handleSelection: I,
1273
- handleCheckboxSelection: p,
1055
+ expanded: m,
1056
+ selected: o,
1057
+ focused: f,
1058
+ editable: b,
1059
+ editing: u,
1060
+ disableSelection: h,
1061
+ checkboxSelection: l,
1062
+ handleExpansion: x,
1063
+ handleSelection: c,
1064
+ handleCheckboxSelection: i,
1274
1065
  handleContentClick: n,
1275
- preventSelection: b,
1276
- expansionTrigger: m,
1277
- toggleItemEditing: x,
1278
- handleSaveItemLabel: (E, P) => {
1279
- re(t, K) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, P), x(), t.focusItem(E, e));
1066
+ preventSelection: d,
1067
+ expansionTrigger: g,
1068
+ toggleItemEditing: I,
1069
+ handleSaveItemLabel: (y, R) => {
1070
+ oe(t, H) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, R), I(), t.focusItem(y, e));
1280
1071
  },
1281
- handleCancelItemLabelEditing: (E) => {
1282
- re(t, K) && t.isItemBeingEditedRef(e) && (x(), t.focusItem(E, e));
1072
+ handleCancelItemLabelEditing: (y) => {
1073
+ oe(t, H) && t.isItemBeingEditedRef(e) && (I(), t.focusItem(y, e));
1283
1074
  }
1284
1075
  };
1285
1076
  }
1286
- const Nn = _("div", {
1287
- name: "MuiTreeItem2DragAndDropOverlay",
1288
- slot: "Root",
1289
- overridesResolver: (e, t) => t.root,
1290
- shouldForwardProp: (e) => pe(e) && e !== "action"
1291
- })(({
1292
- theme: e
1293
- }) => ({
1294
- position: "absolute",
1295
- left: 0,
1296
- display: "flex",
1297
- top: 0,
1298
- bottom: 0,
1299
- right: 0,
1300
- pointerEvents: "none",
1301
- variants: [{
1302
- props: {
1303
- action: "make-child"
1304
- },
1305
- style: {
1306
- marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
1307
- borderRadius: e.shape.borderRadius,
1308
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : J(e.palette.primary.dark, e.palette.action.focusOpacity)
1309
- }
1310
- }, {
1311
- props: {
1312
- action: "reorder-above"
1313
- },
1314
- style: {
1315
- marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
1316
- borderTop: `1px solid ${(e.vars || e).palette.action.active}`
1317
- }
1318
- }, {
1319
- props: {
1320
- action: "reorder-below"
1321
- },
1322
- style: {
1323
- marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
1324
- borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
1325
- }
1326
- }, {
1327
- props: {
1328
- action: "move-to-parent"
1329
- },
1330
- style: {
1331
- marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
1332
- borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
1333
- }
1334
- }]
1335
- }));
1336
- function ze(e) {
1337
- return e.action == null ? null : /* @__PURE__ */ v(Nn, C({}, e));
1338
- }
1339
- process.env.NODE_ENV !== "production" && (ze.propTypes = {
1340
- // ----------------------------- Warning --------------------------------
1341
- // | These PropTypes are generated from the TypeScript type definitions |
1342
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
1343
- // ----------------------------------------------------------------------
1344
- action: d.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
1345
- style: d.object
1346
- });
1347
- const Tt = _("input", {
1348
- name: "MuiTreeItem2",
1349
- slot: "LabelInput",
1350
- overridesResolver: (e, t) => t.labelInput
1351
- })(({
1352
- theme: e
1353
- }) => C({}, e.typography.body1, {
1354
- width: "100%",
1355
- backgroundColor: e.palette.background.paper,
1356
- borderRadius: e.shape.borderRadius,
1357
- border: "none",
1358
- padding: "0 2px",
1359
- boxSizing: "border-box",
1360
- "&:focus": {
1361
- outline: `1px solid ${e.palette.primary.main}`
1362
- }
1363
- })), jn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], qe = /* @__PURE__ */ w.forwardRef(function(t, n) {
1077
+ const Cn = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ce = /* @__PURE__ */ E.forwardRef(function(t, n) {
1364
1078
  const {
1365
- classes: o,
1366
- className: i,
1367
- displayIcon: g,
1368
- expansionIcon: m,
1369
- icon: a,
1370
- label: u,
1371
- itemId: c,
1372
- onClick: r,
1079
+ classes: r,
1080
+ className: l,
1081
+ displayIcon: h,
1082
+ expansionIcon: g,
1083
+ icon: p,
1084
+ label: m,
1085
+ itemId: f,
1086
+ onClick: o,
1373
1087
  onMouseDown: s,
1374
- dragAndDropOverlayProps: f,
1375
- labelInputProps: l
1376
- } = t, h = G(t, jn), {
1377
- disabled: I,
1378
- expanded: p,
1379
- selected: b,
1380
- focused: x,
1381
- editing: R,
1382
- editable: M,
1383
- disableSelection: E,
1384
- checkboxSelection: P,
1385
- handleExpansion: D,
1386
- handleSelection: N,
1387
- handleCheckboxSelection: z,
1388
- handleContentClick: $,
1389
- preventSelection: j,
1390
- expansionTrigger: Q,
1391
- toggleItemEditing: B
1392
- } = yt(c), q = a || m || g, X = w.useRef(null), ee = (A) => {
1393
- j(A), s && s(A);
1394
- }, Y = (A) => {
1395
- var Z;
1396
- $ == null || $(A, c), !((Z = X.current) != null && Z.contains(A.target)) && (Q === "content" && D(A), P || N(A), r && r(A));
1397
- }, te = (A) => {
1398
- A.defaultMuiPrevented || B();
1088
+ dragAndDropOverlayProps: u,
1089
+ labelInputProps: b
1090
+ } = t, x = A(t, Cn), {
1091
+ disabled: c,
1092
+ expanded: i,
1093
+ selected: d,
1094
+ focused: I,
1095
+ editing: T,
1096
+ editable: P,
1097
+ disableSelection: y,
1098
+ checkboxSelection: R,
1099
+ handleExpansion: v,
1100
+ handleSelection: F,
1101
+ handleCheckboxSelection: B,
1102
+ handleContentClick: V,
1103
+ preventSelection: L,
1104
+ expansionTrigger: W,
1105
+ toggleItemEditing: G
1106
+ } = Qe(f), j = p || g || h, J = E.useRef(null), ce = (M) => {
1107
+ L(M), s && s(M);
1108
+ }, ue = (M) => {
1109
+ var Y;
1110
+ V == null || V(M, f), !((Y = J.current) != null && Y.contains(M.target)) && (W === "content" && v(M), R || F(M), o && o(M));
1111
+ }, de = (M) => {
1112
+ M.defaultMuiPrevented || G();
1399
1113
  };
1400
1114
  return (
1401
1115
  /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
1402
- /* @__PURE__ */ de("div", C({}, h, {
1403
- className: $e(o.root, i, p && o.expanded, b && o.selected, x && o.focused, I && o.disabled, R && o.editing, M && o.editable),
1404
- onClick: Y,
1405
- onMouseDown: ee,
1116
+ /* @__PURE__ */ je("div", C({}, x, {
1117
+ className: Be(r.root, l, i && r.expanded, d && r.selected, I && r.focused, c && r.disabled, T && r.editing, P && r.editable),
1118
+ onClick: ue,
1119
+ onMouseDown: ce,
1406
1120
  ref: n,
1407
- children: [/* @__PURE__ */ v("div", {
1408
- className: o.iconContainer,
1409
- children: q
1410
- }), P && /* @__PURE__ */ v(at, {
1411
- className: o.checkbox,
1412
- checked: b,
1413
- onChange: z,
1414
- disabled: I || E,
1415
- ref: X,
1121
+ children: [/* @__PURE__ */ S("div", {
1122
+ className: r.iconContainer,
1123
+ children: j
1124
+ }), R && /* @__PURE__ */ S(Xt, {
1125
+ className: r.checkbox,
1126
+ checked: d,
1127
+ onChange: B,
1128
+ disabled: c || y,
1129
+ ref: J,
1416
1130
  tabIndex: -1
1417
- }), R ? /* @__PURE__ */ v(Tt, C({}, l, {
1418
- className: o.labelInput
1419
- })) : /* @__PURE__ */ v("div", C({
1420
- className: o.label
1421
- }, M && {
1422
- onDoubleClick: te
1131
+ }), T ? /* @__PURE__ */ S(Lt, C({}, b, {
1132
+ className: r.labelInput
1133
+ })) : /* @__PURE__ */ S("div", C({
1134
+ className: r.label
1135
+ }, P && {
1136
+ onDoubleClick: de
1423
1137
  }, {
1424
- children: u
1425
- })), f && /* @__PURE__ */ v(ze, C({}, f))]
1138
+ children: m
1139
+ })), u && /* @__PURE__ */ S(jt, C({}, u))]
1426
1140
  }))
1427
1141
  );
1428
1142
  });
1429
- process.env.NODE_ENV !== "production" && (qe.propTypes = {
1143
+ process.env.NODE_ENV !== "production" && (Ce.propTypes = {
1430
1144
  // ----------------------------- Warning --------------------------------
1431
1145
  // | These PropTypes are generated from the TypeScript type definitions |
1432
1146
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -1434,77 +1148,47 @@ process.env.NODE_ENV !== "production" && (qe.propTypes = {
1434
1148
  /**
1435
1149
  * Override or extend the styles applied to the component.
1436
1150
  */
1437
- classes: d.object.isRequired,
1438
- className: d.string,
1151
+ classes: a.object.isRequired,
1152
+ className: a.string,
1439
1153
  /**
1440
1154
  * The icon to display next to the Tree Item's label. Either a parent or end icon.
1441
1155
  */
1442
- displayIcon: d.node,
1443
- dragAndDropOverlayProps: d.shape({
1444
- action: d.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
1445
- style: d.object
1156
+ displayIcon: a.node,
1157
+ dragAndDropOverlayProps: a.shape({
1158
+ action: a.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
1159
+ style: a.object
1446
1160
  }),
1447
1161
  /**
1448
1162
  * The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
1449
1163
  */
1450
- expansionIcon: d.node,
1164
+ expansionIcon: a.node,
1451
1165
  /**
1452
1166
  * The icon to display next to the Tree Item's label.
1453
1167
  */
1454
- icon: d.node,
1168
+ icon: a.node,
1455
1169
  /**
1456
1170
  * The id of the item.
1457
1171
  */
1458
- itemId: d.string.isRequired,
1172
+ itemId: a.string.isRequired,
1459
1173
  /**
1460
1174
  * The Tree Item label.
1461
1175
  */
1462
- label: d.node,
1463
- labelInputProps: d.shape({
1464
- autoFocus: d.oneOf([!0]),
1465
- "data-element": d.oneOf(["labelInput"]),
1466
- onBlur: d.func,
1467
- onChange: d.func,
1468
- onKeyDown: d.func,
1469
- type: d.oneOf(["text"]),
1470
- value: d.string
1176
+ label: a.node,
1177
+ labelInputProps: a.shape({
1178
+ autoFocus: a.oneOf([!0]),
1179
+ "data-element": a.oneOf(["labelInput"]),
1180
+ onBlur: a.func,
1181
+ onChange: a.func,
1182
+ onKeyDown: a.func,
1183
+ type: a.oneOf(["text"]),
1184
+ value: a.string
1471
1185
  })
1472
1186
  });
1473
- function Ct(e) {
1474
- return it("MuiTreeItem", e);
1475
- }
1476
- const W = st("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), Et = ue(/* @__PURE__ */ v("path", {
1477
- d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
1478
- }), "TreeViewExpandIcon"), wt = ue(/* @__PURE__ */ v("path", {
1479
- d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
1480
- }), "TreeViewCollapseIcon");
1481
- function ke(e) {
1482
- const {
1483
- children: t,
1484
- itemId: n
1485
- } = e, {
1486
- wrapItem: o,
1487
- instance: i
1488
- } = ie();
1489
- return o({
1490
- children: t,
1491
- itemId: n,
1492
- instance: i
1493
- });
1494
- }
1495
- ke.propTypes = {
1496
- // ----------------------------- Warning --------------------------------
1497
- // | These PropTypes are generated from the TypeScript type definitions |
1498
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
1499
- // ----------------------------------------------------------------------
1500
- children: d.node,
1501
- itemId: d.string.isRequired
1502
- };
1503
- const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], _n = ["ownerState"], Bn = ["ownerState"], Un = ["ownerState"], zn = je(), qn = (e) => {
1187
+ const wn = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], Rn = ["ownerState"], Sn = ["ownerState"], Pn = ["ownerState"], vn = Ue(), kn = (e) => {
1504
1188
  const {
1505
1189
  classes: t
1506
1190
  } = e;
1507
- return Ne({
1191
+ return ze({
1508
1192
  root: ["root"],
1509
1193
  content: ["content"],
1510
1194
  expanded: ["expanded"],
@@ -1518,8 +1202,8 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1518
1202
  editing: ["editing"],
1519
1203
  editable: ["editable"],
1520
1204
  groupTransition: ["groupTransition"]
1521
- }, Ct, t);
1522
- }, Gn = _("li", {
1205
+ }, Kt, t);
1206
+ }, Mn = ie("li", {
1523
1207
  name: "MuiTreeItem",
1524
1208
  slot: "Root",
1525
1209
  overridesResolver: (e, t) => t.root
@@ -1528,15 +1212,15 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1528
1212
  margin: 0,
1529
1213
  padding: 0,
1530
1214
  outline: 0
1531
- }), Xn = _(qe, {
1215
+ }), Dn = ie(Ce, {
1532
1216
  name: "MuiTreeItem",
1533
1217
  slot: "Content",
1534
1218
  overridesResolver: (e, t) => [t.content, t.iconContainer && {
1535
- [`& .${W.iconContainer}`]: t.iconContainer
1219
+ [`& .${O.iconContainer}`]: t.iconContainer
1536
1220
  }, t.label && {
1537
- [`& .${W.label}`]: t.label
1221
+ [`& .${O.label}`]: t.label
1538
1222
  }],
1539
- shouldForwardProp: (e) => pe(e) && e !== "indentationAtItemLevel"
1223
+ shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
1540
1224
  })(({
1541
1225
  theme: e
1542
1226
  }) => ({
@@ -1558,27 +1242,27 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1558
1242
  backgroundColor: "transparent"
1559
1243
  }
1560
1244
  },
1561
- [`&.${W.disabled}`]: {
1245
+ [`&.${O.disabled}`]: {
1562
1246
  opacity: (e.vars || e).palette.action.disabledOpacity,
1563
1247
  backgroundColor: "transparent"
1564
1248
  },
1565
- [`&.${W.focused}`]: {
1249
+ [`&.${O.focused}`]: {
1566
1250
  backgroundColor: (e.vars || e).palette.action.focus
1567
1251
  },
1568
- [`&.${W.selected}`]: {
1569
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity),
1252
+ [`&.${O.selected}`]: {
1253
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity),
1570
1254
  "&:hover": {
1571
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
1255
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
1572
1256
  // Reset on touch devices, it doesn't add specificity
1573
1257
  "@media (hover: none)": {
1574
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity)
1258
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : ne(e.palette.primary.main, e.palette.action.selectedOpacity)
1575
1259
  }
1576
1260
  },
1577
- [`&.${W.focused}`]: {
1578
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
1261
+ [`&.${O.focused}`]: {
1262
+ backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : ne(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
1579
1263
  }
1580
1264
  },
1581
- [`& .${W.iconContainer}`]: {
1265
+ [`& .${O.iconContainer}`]: {
1582
1266
  width: 16,
1583
1267
  display: "flex",
1584
1268
  flexShrink: 0,
@@ -1587,7 +1271,7 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1587
1271
  fontSize: 18
1588
1272
  }
1589
1273
  },
1590
- [`& .${W.label}`]: C({
1274
+ [`& .${O.label}`]: C({
1591
1275
  width: "100%",
1592
1276
  boxSizing: "border-box",
1593
1277
  // prevent width + padding to overflow
@@ -1595,7 +1279,7 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1595
1279
  minWidth: 0,
1596
1280
  position: "relative"
1597
1281
  }, e.typography.body1),
1598
- [`& .${W.checkbox}`]: {
1282
+ [`& .${O.checkbox}`]: {
1599
1283
  padding: 0
1600
1284
  },
1601
1285
  variants: [{
@@ -1606,11 +1290,11 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1606
1290
  paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
1607
1291
  }
1608
1292
  }]
1609
- })), Wn = _(lt, {
1293
+ })), On = ie(Wt, {
1610
1294
  name: "MuiTreeItem",
1611
1295
  slot: "GroupTransition",
1612
1296
  overridesResolver: (e, t) => t.groupTransition,
1613
- shouldForwardProp: (e) => pe(e) && e !== "indentationAtItemLevel"
1297
+ shouldForwardProp: (e) => qe(e) && e !== "indentationAtItemLevel"
1614
1298
  })({
1615
1299
  margin: 0,
1616
1300
  padding: 0,
@@ -1623,190 +1307,190 @@ const Kn = ["children", "className", "slots", "slotProps", "ContentComponent", "
1623
1307
  paddingLeft: 0
1624
1308
  }
1625
1309
  }]
1626
- }), Rt = /* @__PURE__ */ w.forwardRef(function(t, n) {
1627
- var Qe, Ye, Ze, He;
1310
+ }), Ze = /* @__PURE__ */ E.forwardRef(function(t, n) {
1311
+ var ke, Me, De, Oe;
1628
1312
  const {
1629
- icons: o,
1630
- runItemPlugins: i,
1313
+ icons: r,
1314
+ runItemPlugins: l,
1631
1315
  items: {
1632
- disabledItemsFocusable: g,
1633
- indentationAtItemLevel: m
1316
+ disabledItemsFocusable: h,
1317
+ indentationAtItemLevel: g
1634
1318
  },
1635
1319
  selection: {
1636
- disableSelection: a
1320
+ disableSelection: p
1637
1321
  },
1638
1322
  expansion: {
1639
- expansionTrigger: u
1323
+ expansionTrigger: m
1640
1324
  },
1641
- treeId: c,
1642
- instance: r
1643
- } = ie(), s = w.useContext(Pe), f = zn({
1325
+ treeId: f,
1326
+ instance: o
1327
+ } = Ke(), s = E.useContext(_e), u = vn({
1644
1328
  props: t,
1645
1329
  name: "MuiTreeItem"
1646
1330
  }), {
1647
- children: l,
1648
- className: h,
1649
- slots: I,
1650
- slotProps: p,
1651
- ContentComponent: b = qe,
1652
- ContentProps: x,
1653
- itemId: R,
1654
- id: M,
1655
- label: E,
1656
- onClick: P,
1657
- onMouseDown: D,
1658
- onBlur: N,
1659
- onKeyDown: z
1660
- } = f, $ = G(f, Kn), {
1661
- expanded: j,
1662
- focused: Q,
1663
- selected: B,
1664
- disabled: q,
1665
- editing: X,
1666
- handleExpansion: ee,
1667
- handleCancelItemLabelEditing: Y,
1668
- handleSaveItemLabel: te
1669
- } = yt(R);
1670
- process.env.NODE_ENV !== "production" && (f.ContentComponent && ve(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), f.ContentProps && ve(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
1331
+ children: b,
1332
+ className: x,
1333
+ slots: c,
1334
+ slotProps: i,
1335
+ ContentComponent: d = Ce,
1336
+ ContentProps: I,
1337
+ itemId: T,
1338
+ id: P,
1339
+ label: y,
1340
+ onClick: R,
1341
+ onMouseDown: v,
1342
+ onBlur: F,
1343
+ onKeyDown: B
1344
+ } = u, V = A(u, wn), {
1345
+ expanded: L,
1346
+ focused: W,
1347
+ selected: G,
1348
+ disabled: j,
1349
+ editing: J,
1350
+ handleExpansion: ce,
1351
+ handleCancelItemLabelEditing: ue,
1352
+ handleSaveItemLabel: de
1353
+ } = Qe(T);
1354
+ process.env.NODE_ENV !== "production" && (u.ContentComponent && xe(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), u.ContentProps && xe(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
1671
1355
  const {
1672
- contentRef: A,
1673
- rootRef: Z,
1674
- propsEnhancers: L
1675
- } = i(f), ne = w.useRef(null), De = w.useRef(null), Ge = Ie(n, Z, ne), Xe = Ie(x == null ? void 0 : x.ref, A, De), se = {
1676
- expandIcon: (I == null ? void 0 : I.expandIcon) ?? o.slots.expandIcon ?? Et,
1677
- collapseIcon: (I == null ? void 0 : I.collapseIcon) ?? o.slots.collapseIcon ?? wt,
1678
- endIcon: (I == null ? void 0 : I.endIcon) ?? o.slots.endIcon,
1679
- icon: I == null ? void 0 : I.icon,
1680
- groupTransition: I == null ? void 0 : I.groupTransition
1681
- }, Oe = (k) => Array.isArray(k) ? k.length > 0 && k.some(Oe) : !!k, fe = Oe(l), xe = C({}, f, {
1682
- expanded: j,
1683
- focused: Q,
1684
- selected: B,
1685
- disabled: q,
1686
- indentationAtItemLevel: m
1687
- }), T = qn(xe), y = se.groupTransition ?? void 0, S = V({
1688
- elementType: y,
1356
+ contentRef: M,
1357
+ rootRef: Y,
1358
+ propsEnhancers: D
1359
+ } = l(u), Q = E.useRef(null), we = E.useRef(null), nt = Ee(n, Y, Q), ot = Ee(I == null ? void 0 : I.ref, M, we), z = {
1360
+ expandIcon: (c == null ? void 0 : c.expandIcon) ?? r.slots.expandIcon ?? _t,
1361
+ collapseIcon: (c == null ? void 0 : c.collapseIcon) ?? r.slots.collapseIcon ?? $t,
1362
+ endIcon: (c == null ? void 0 : c.endIcon) ?? r.slots.endIcon,
1363
+ icon: c == null ? void 0 : c.icon,
1364
+ groupTransition: c == null ? void 0 : c.groupTransition
1365
+ }, Re = (w) => Array.isArray(w) ? w.length > 0 && w.some(Re) : !!w, Z = Re(b), fe = C({}, u, {
1366
+ expanded: L,
1367
+ focused: W,
1368
+ selected: G,
1369
+ disabled: j,
1370
+ indentationAtItemLevel: g
1371
+ }), k = kn(fe), Se = z.groupTransition ?? void 0, rt = N({
1372
+ elementType: Se,
1689
1373
  ownerState: {},
1690
- externalSlotProps: p == null ? void 0 : p.groupTransition,
1374
+ externalSlotProps: i == null ? void 0 : i.groupTransition,
1691
1375
  additionalProps: C({
1692
1376
  unmountOnExit: !0,
1693
- in: j,
1377
+ in: L,
1694
1378
  component: "ul",
1695
1379
  role: "group"
1696
- }, m ? {
1380
+ }, g ? {
1697
1381
  indentationAtItemLevel: !0
1698
1382
  } : {}),
1699
- className: T.groupTransition
1700
- }), O = (k) => {
1701
- u === "iconContainer" && ee(k);
1702
- }, F = j ? se.collapseIcon : se.expandIcon, oe = V({
1703
- elementType: F,
1383
+ className: k.groupTransition
1384
+ }), st = (w) => {
1385
+ m === "iconContainer" && ce(w);
1386
+ }, pe = L ? z.collapseIcon : z.expandIcon, it = N({
1387
+ elementType: pe,
1704
1388
  ownerState: {},
1705
- externalSlotProps: (k) => j ? C({}, H(o.slotProps.collapseIcon, k), H(p == null ? void 0 : p.collapseIcon, k)) : C({}, H(o.slotProps.expandIcon, k), H(p == null ? void 0 : p.expandIcon, k)),
1389
+ externalSlotProps: (w) => L ? C({}, _(r.slotProps.collapseIcon, w), _(i == null ? void 0 : i.collapseIcon, w)) : C({}, _(r.slotProps.expandIcon, w), _(i == null ? void 0 : i.expandIcon, w)),
1706
1390
  additionalProps: {
1707
- onClick: O
1391
+ onClick: st
1708
1392
  }
1709
- }), ye = G(oe, _n), Te = fe && F ? /* @__PURE__ */ v(F, C({}, ye)) : null, Ae = fe ? void 0 : se.endIcon, $t = V({
1710
- elementType: Ae,
1393
+ }), lt = A(it, Rn), at = Z && pe ? /* @__PURE__ */ S(pe, C({}, lt)) : null, me = Z ? void 0 : z.endIcon, ct = N({
1394
+ elementType: me,
1711
1395
  ownerState: {},
1712
- externalSlotProps: (k) => fe ? {} : C({}, H(o.slotProps.endIcon, k), H(p == null ? void 0 : p.endIcon, k))
1713
- }), Nt = G($t, Bn), jt = Ae ? /* @__PURE__ */ v(Ae, C({}, Nt)) : null, Le = se.icon, Kt = V({
1714
- elementType: Le,
1396
+ externalSlotProps: (w) => Z ? {} : C({}, _(r.slotProps.endIcon, w), _(i == null ? void 0 : i.endIcon, w))
1397
+ }), ut = A(ct, Sn), dt = me ? /* @__PURE__ */ S(me, C({}, ut)) : null, Ie = z.icon, ft = N({
1398
+ elementType: Ie,
1715
1399
  ownerState: {},
1716
- externalSlotProps: p == null ? void 0 : p.icon
1717
- }), _t = G(Kt, Un), Bt = Le ? /* @__PURE__ */ v(Le, C({}, _t)) : null;
1718
- let Ce;
1719
- B ? Ce = !0 : a || q ? Ce = void 0 : Ce = !1;
1720
- function Ut(k) {
1721
- !Q && (!q || g) && k.currentTarget === k.target && r.focusItem(k, R);
1400
+ externalSlotProps: i == null ? void 0 : i.icon
1401
+ }), pt = A(ft, Pn), mt = Ie ? /* @__PURE__ */ S(Ie, C({}, pt)) : null;
1402
+ let ee;
1403
+ G ? ee = !0 : p || j ? ee = void 0 : ee = !1;
1404
+ function It(w) {
1405
+ !W && (!j || h) && w.currentTarget === w.target && o.focusItem(w, T);
1722
1406
  }
1723
- function zt(k) {
1724
- var le, me, et, tt;
1725
- N == null || N(k), !(X || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
1407
+ function gt(w) {
1408
+ var $, q, Ve, Ae;
1409
+ F == null || F(w), !(J || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
1726
1410
  // we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
1727
- k.relatedTarget && be(k.relatedTarget, ne.current) && (k.target && ((me = (le = k.target) == null ? void 0 : le.dataset) == null ? void 0 : me.element) === "labelInput" && be(k.target, ne.current) || ((tt = (et = k.relatedTarget) == null ? void 0 : et.dataset) == null ? void 0 : tt.element) === "labelInput")) && r.removeFocusedItem();
1411
+ w.relatedTarget && he(w.relatedTarget, Q.current) && (w.target && ((q = ($ = w.target) == null ? void 0 : $.dataset) == null ? void 0 : q.element) === "labelInput" && he(w.target, Q.current) || ((Ae = (Ve = w.relatedTarget) == null ? void 0 : Ve.dataset) == null ? void 0 : Ae.element) === "labelInput")) && o.removeFocusedItem();
1728
1412
  }
1729
- const qt = (k) => {
1730
- var le, me;
1731
- z == null || z(k), ((me = (le = k.target) == null ? void 0 : le.dataset) == null ? void 0 : me.element) !== "labelInput" && r.handleItemKeyDown(k, R);
1732
- }, Gt = Ke({
1733
- itemId: R,
1734
- treeId: c,
1735
- id: M
1736
- }), Xt = r.canItemBeTabbed(R) ? 0 : -1, Ee = {
1737
- rootRefObject: ne,
1738
- contentRefObject: De,
1413
+ const bt = (w) => {
1414
+ var $, q;
1415
+ B == null || B(w), ((q = ($ = w.target) == null ? void 0 : $.dataset) == null ? void 0 : q.element) !== "labelInput" && o.handleItemKeyDown(w, T);
1416
+ }, ht = $e({
1417
+ itemId: T,
1418
+ treeId: f,
1419
+ id: P
1420
+ }), xt = o.canItemBeTabbed(T) ? 0 : -1, te = {
1421
+ rootRefObject: Q,
1422
+ contentRefObject: we,
1739
1423
  interactions: {
1740
- handleSaveItemLabel: te,
1741
- handleCancelItemLabelEditing: Y
1424
+ handleSaveItemLabel: de,
1425
+ handleCancelItemLabelEditing: ue
1742
1426
  }
1743
- }, Wt = ((Qe = L.root) == null ? void 0 : Qe.call(L, C({}, Ee, {
1744
- externalEventHandlers: U($)
1745
- }))) ?? {}, Jt = ((Ye = L.content) == null ? void 0 : Ye.call(L, C({}, Ee, {
1746
- externalEventHandlers: U(x)
1747
- }))) ?? {}, We = ((Ze = L.dragAndDropOverlay) == null ? void 0 : Ze.call(L, C({}, Ee, {
1427
+ }, Et = ((ke = D.root) == null ? void 0 : ke.call(D, C({}, te, {
1428
+ externalEventHandlers: Fe(V)
1429
+ }))) ?? {}, Tt = ((Me = D.content) == null ? void 0 : Me.call(D, C({}, te, {
1430
+ externalEventHandlers: Fe(I)
1431
+ }))) ?? {}, Pe = ((De = D.dragAndDropOverlay) == null ? void 0 : De.call(D, C({}, te, {
1748
1432
  externalEventHandlers: {}
1749
- }))) ?? {}, Je = ((He = L.labelInput) == null ? void 0 : He.call(L, C({}, Ee, {
1433
+ }))) ?? {}, ve = ((Oe = D.labelInput) == null ? void 0 : Oe.call(D, C({}, te, {
1750
1434
  externalEventHandlers: {}
1751
1435
  }))) ?? {};
1752
- return /* @__PURE__ */ v(ke, {
1753
- itemId: R,
1754
- children: /* @__PURE__ */ de(Gn, C({
1755
- className: $e(T.root, h),
1436
+ return /* @__PURE__ */ S(Nt, {
1437
+ itemId: T,
1438
+ children: /* @__PURE__ */ je(Mn, C({
1439
+ className: Be(k.root, x),
1756
1440
  role: "treeitem",
1757
- "aria-expanded": fe ? j : void 0,
1758
- "aria-selected": Ce,
1759
- "aria-disabled": q || void 0,
1760
- id: Gt,
1761
- tabIndex: Xt
1762
- }, $, {
1763
- ownerState: xe,
1764
- onFocus: Ut,
1765
- onBlur: zt,
1766
- onKeyDown: qt,
1767
- ref: Ge,
1768
- style: m ? C({}, $.style, {
1769
- "--TreeView-itemDepth": typeof s == "function" ? s(R) : s
1770
- }) : $.style
1771
- }, Wt, {
1772
- children: [/* @__PURE__ */ v(Xn, C({
1773
- as: b,
1441
+ "aria-expanded": Z ? L : void 0,
1442
+ "aria-selected": ee,
1443
+ "aria-disabled": j || void 0,
1444
+ id: ht,
1445
+ tabIndex: xt
1446
+ }, V, {
1447
+ ownerState: fe,
1448
+ onFocus: It,
1449
+ onBlur: gt,
1450
+ onKeyDown: bt,
1451
+ ref: nt,
1452
+ style: g ? C({}, V.style, {
1453
+ "--TreeView-itemDepth": typeof s == "function" ? s(T) : s
1454
+ }) : V.style
1455
+ }, Et, {
1456
+ children: [/* @__PURE__ */ S(Dn, C({
1457
+ as: d,
1774
1458
  classes: {
1775
- root: T.content,
1776
- expanded: T.expanded,
1777
- selected: T.selected,
1778
- focused: T.focused,
1779
- disabled: T.disabled,
1780
- editable: T.editable,
1781
- editing: T.editing,
1782
- iconContainer: T.iconContainer,
1783
- label: T.label,
1784
- labelInput: T.labelInput,
1785
- checkbox: T.checkbox
1459
+ root: k.content,
1460
+ expanded: k.expanded,
1461
+ selected: k.selected,
1462
+ focused: k.focused,
1463
+ disabled: k.disabled,
1464
+ editable: k.editable,
1465
+ editing: k.editing,
1466
+ iconContainer: k.iconContainer,
1467
+ label: k.label,
1468
+ labelInput: k.labelInput,
1469
+ checkbox: k.checkbox
1786
1470
  },
1787
- label: E,
1788
- itemId: R,
1789
- onClick: P,
1790
- onMouseDown: D,
1791
- icon: Bt,
1792
- expansionIcon: Te,
1793
- displayIcon: jt,
1794
- ownerState: xe
1795
- }, x, Jt, We.action == null ? {} : {
1796
- dragAndDropOverlayProps: We
1797
- }, Je.value == null ? {} : {
1798
- labelInputProps: Je
1471
+ label: y,
1472
+ itemId: T,
1473
+ onClick: R,
1474
+ onMouseDown: v,
1475
+ icon: mt,
1476
+ expansionIcon: at,
1477
+ displayIcon: dt,
1478
+ ownerState: fe
1479
+ }, I, Tt, Pe.action == null ? {} : {
1480
+ dragAndDropOverlayProps: Pe
1481
+ }, ve.value == null ? {} : {
1482
+ labelInputProps: ve
1799
1483
  }, {
1800
- ref: Xe
1801
- })), l && /* @__PURE__ */ v(Wn, C({
1802
- as: y
1803
- }, S, {
1804
- children: l
1484
+ ref: ot
1485
+ })), b && /* @__PURE__ */ S(On, C({
1486
+ as: Se
1487
+ }, rt, {
1488
+ children: b
1805
1489
  }))]
1806
1490
  }))
1807
1491
  });
1808
1492
  });
1809
- process.env.NODE_ENV !== "production" && (Rt.propTypes = {
1493
+ process.env.NODE_ENV !== "production" && (Ze.propTypes = {
1810
1494
  // ----------------------------- Warning --------------------------------
1811
1495
  // | These PropTypes are generated from the TypeScript type definitions |
1812
1496
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -1814,115 +1498,115 @@ process.env.NODE_ENV !== "production" && (Rt.propTypes = {
1814
1498
  /**
1815
1499
  * The content of the component.
1816
1500
  */
1817
- children: d.node,
1501
+ children: a.node,
1818
1502
  /**
1819
1503
  * Override or extend the styles applied to the component.
1820
1504
  */
1821
- classes: d.object,
1822
- className: d.string,
1505
+ classes: a.object,
1506
+ className: a.string,
1823
1507
  /**
1824
1508
  * The component used to render the content of the item.
1825
1509
  * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
1826
1510
  * @default TreeItemContent
1827
1511
  */
1828
- ContentComponent: rn,
1512
+ ContentComponent: Jt,
1829
1513
  /**
1830
1514
  * Props applied to ContentComponent.
1831
1515
  * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
1832
1516
  */
1833
- ContentProps: d.object,
1517
+ ContentProps: a.object,
1834
1518
  /**
1835
1519
  * If `true`, the item is disabled.
1836
1520
  * @default false
1837
1521
  */
1838
- disabled: d.bool,
1522
+ disabled: a.bool,
1839
1523
  /**
1840
1524
  * The id of the item.
1841
1525
  */
1842
- itemId: d.string.isRequired,
1526
+ itemId: a.string.isRequired,
1843
1527
  /**
1844
1528
  * The Tree Item label.
1845
1529
  */
1846
- label: d.node,
1530
+ label: a.node,
1847
1531
  /**
1848
1532
  * This prop isn't supported.
1849
1533
  * Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
1850
1534
  */
1851
- onFocus: ct,
1535
+ onFocus: Gt,
1852
1536
  /**
1853
1537
  * Callback fired when a key of the keyboard is pressed on the item.
1854
1538
  */
1855
- onKeyDown: d.func,
1539
+ onKeyDown: a.func,
1856
1540
  /**
1857
1541
  * The props used for each component slot.
1858
1542
  * @default {}
1859
1543
  */
1860
- slotProps: d.object,
1544
+ slotProps: a.object,
1861
1545
  /**
1862
1546
  * Overridable component slots.
1863
1547
  * @default {}
1864
1548
  */
1865
- slots: d.object,
1549
+ slots: a.object,
1866
1550
  /**
1867
1551
  * The system prop that allows defining system overrides as well as additional CSS styles.
1868
1552
  */
1869
- sx: d.oneOfType([d.arrayOf(d.oneOfType([d.func, d.object, d.bool])), d.func, d.object])
1553
+ sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
1870
1554
  });
1871
- const Jn = ["ownerState"];
1872
- function Qn({
1555
+ const Vn = ["ownerState"];
1556
+ function An({
1873
1557
  slots: e,
1874
1558
  slotProps: t,
1875
1559
  label: n,
1876
- id: o,
1877
- itemId: i,
1878
- itemsToRender: g
1560
+ id: r,
1561
+ itemId: l,
1562
+ itemsToRender: h
1879
1563
  }) {
1880
- const m = (e == null ? void 0 : e.item) ?? Rt, a = V({
1881
- elementType: m,
1564
+ const g = (e == null ? void 0 : e.item) ?? Ze, p = N({
1565
+ elementType: g,
1882
1566
  externalSlotProps: t == null ? void 0 : t.item,
1883
1567
  additionalProps: {
1884
- itemId: i,
1885
- id: o,
1568
+ itemId: l,
1569
+ id: r,
1886
1570
  label: n
1887
1571
  },
1888
1572
  ownerState: {
1889
- itemId: i,
1573
+ itemId: l,
1890
1574
  label: n
1891
1575
  }
1892
- }), u = G(a, Jn), c = w.useMemo(() => g ? /* @__PURE__ */ v(vt, {
1893
- itemsToRender: g,
1576
+ }), m = A(p, Vn), f = E.useMemo(() => h ? /* @__PURE__ */ S(et, {
1577
+ itemsToRender: h,
1894
1578
  slots: e,
1895
1579
  slotProps: t
1896
- }) : null, [g, e, t]);
1897
- return /* @__PURE__ */ v(m, C({}, u, {
1898
- children: c
1580
+ }) : null, [h, e, t]);
1581
+ return /* @__PURE__ */ S(g, C({}, m, {
1582
+ children: f
1899
1583
  }));
1900
1584
  }
1901
- function vt(e) {
1585
+ function et(e) {
1902
1586
  const {
1903
1587
  itemsToRender: t,
1904
1588
  slots: n,
1905
- slotProps: o
1589
+ slotProps: r
1906
1590
  } = e;
1907
- return /* @__PURE__ */ v(w.Fragment, {
1908
- children: t.map((i) => /* @__PURE__ */ v(Qn, {
1591
+ return /* @__PURE__ */ S(E.Fragment, {
1592
+ children: t.map((l) => /* @__PURE__ */ S(An, {
1909
1593
  slots: n,
1910
- slotProps: o,
1911
- label: i.label,
1912
- id: i.id,
1913
- itemId: i.itemId,
1914
- itemsToRender: i.children
1915
- }, i.itemId))
1594
+ slotProps: r,
1595
+ label: l.label,
1596
+ id: l.id,
1597
+ itemId: l.itemId,
1598
+ itemsToRender: l.children
1599
+ }, l.itemId))
1916
1600
  });
1917
1601
  }
1918
- const Yn = je(), Zn = (e) => {
1602
+ const Fn = Ue(), Ln = (e) => {
1919
1603
  const {
1920
1604
  classes: t
1921
1605
  } = e;
1922
- return Ne({
1606
+ return ze({
1923
1607
  root: ["root"]
1924
- }, cn, t);
1925
- }, Hn = _("ul", {
1608
+ }, Yt, t);
1609
+ }, jn = ie("ul", {
1926
1610
  name: "MuiRichTreeView",
1927
1611
  slot: "Root",
1928
1612
  overridesResolver: (e, t) => t.root
@@ -1932,42 +1616,42 @@ const Yn = je(), Zn = (e) => {
1932
1616
  listStyle: "none",
1933
1617
  outline: 0,
1934
1618
  position: "relative"
1935
- }), Pt = /* @__PURE__ */ w.forwardRef(function(t, n) {
1936
- const o = Yn({
1619
+ }), tt = /* @__PURE__ */ E.forwardRef(function(t, n) {
1620
+ const r = Fn({
1937
1621
  props: t,
1938
1622
  name: "MuiRichTreeView"
1939
1623
  });
1940
- process.env.NODE_ENV !== "production" && o.children != null && ve(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
1624
+ process.env.NODE_ENV !== "production" && r.children != null && xe(["MUI X: The Rich Tree View component does not support JSX children.", "If you want to add items, you need to use the `items` prop.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/items/."]);
1941
1625
  const {
1942
- getRootProps: i,
1943
- contextValue: g,
1944
- instance: m
1945
- } = xn({
1946
- plugins: $n,
1626
+ getRootProps: l,
1627
+ contextValue: h,
1628
+ instance: g
1629
+ } = ln({
1630
+ plugins: yn,
1947
1631
  rootRef: n,
1948
- props: o
1632
+ props: r
1949
1633
  }), {
1950
- slots: a,
1951
- slotProps: u
1952
- } = o, c = Zn(o), r = (a == null ? void 0 : a.root) ?? Hn, s = V({
1953
- elementType: r,
1954
- externalSlotProps: u == null ? void 0 : u.root,
1955
- className: c.root,
1956
- getSlotProps: i,
1957
- ownerState: o
1634
+ slots: p,
1635
+ slotProps: m
1636
+ } = r, f = Ln(r), o = (p == null ? void 0 : p.root) ?? jn, s = N({
1637
+ elementType: o,
1638
+ externalSlotProps: m == null ? void 0 : m.root,
1639
+ className: f.root,
1640
+ getSlotProps: l,
1641
+ ownerState: r
1958
1642
  });
1959
- return /* @__PURE__ */ v(yn, {
1960
- value: g,
1961
- children: /* @__PURE__ */ v(r, C({}, s, {
1962
- children: /* @__PURE__ */ v(vt, {
1963
- slots: a,
1964
- slotProps: u,
1965
- itemsToRender: m.getItemsToRender()
1643
+ return /* @__PURE__ */ S(an, {
1644
+ value: h,
1645
+ children: /* @__PURE__ */ S(o, C({}, s, {
1646
+ children: /* @__PURE__ */ S(et, {
1647
+ slots: p,
1648
+ slotProps: m,
1649
+ itemsToRender: g.getItemsToRender()
1966
1650
  })
1967
1651
  }))
1968
1652
  });
1969
1653
  });
1970
- process.env.NODE_ENV !== "production" && (Pt.propTypes = {
1654
+ process.env.NODE_ENV !== "production" && (tt.propTypes = {
1971
1655
  // ----------------------------- Warning --------------------------------
1972
1656
  // | These PropTypes are generated from the TypeScript type definitions |
1973
1657
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
@@ -1975,68 +1659,68 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
1975
1659
  /**
1976
1660
  * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
1977
1661
  */
1978
- apiRef: d.shape({
1979
- current: d.shape({
1980
- focusItem: d.func.isRequired,
1981
- getItem: d.func.isRequired,
1982
- getItemDOMElement: d.func.isRequired,
1983
- getItemOrderedChildrenIds: d.func.isRequired,
1984
- getItemTree: d.func.isRequired,
1985
- selectItem: d.func.isRequired,
1986
- setItemExpansion: d.func.isRequired,
1987
- updateItemLabel: d.func.isRequired
1662
+ apiRef: a.shape({
1663
+ current: a.shape({
1664
+ focusItem: a.func.isRequired,
1665
+ getItem: a.func.isRequired,
1666
+ getItemDOMElement: a.func.isRequired,
1667
+ getItemOrderedChildrenIds: a.func.isRequired,
1668
+ getItemTree: a.func.isRequired,
1669
+ selectItem: a.func.isRequired,
1670
+ setItemExpansion: a.func.isRequired,
1671
+ updateItemLabel: a.func.isRequired
1988
1672
  })
1989
1673
  }),
1990
1674
  /**
1991
1675
  * If `true`, the Tree View renders a checkbox at the left of its label that allows selecting it.
1992
1676
  * @default false
1993
1677
  */
1994
- checkboxSelection: d.bool,
1678
+ checkboxSelection: a.bool,
1995
1679
  /**
1996
1680
  * Override or extend the styles applied to the component.
1997
1681
  */
1998
- classes: d.object,
1999
- className: d.string,
1682
+ classes: a.object,
1683
+ className: a.string,
2000
1684
  /**
2001
1685
  * Expanded item ids.
2002
1686
  * Used when the item's expansion is not controlled.
2003
1687
  * @default []
2004
1688
  */
2005
- defaultExpandedItems: d.arrayOf(d.string),
1689
+ defaultExpandedItems: a.arrayOf(a.string),
2006
1690
  /**
2007
1691
  * Selected item ids. (Uncontrolled)
2008
1692
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
2009
1693
  * @default []
2010
1694
  */
2011
- defaultSelectedItems: d.any,
1695
+ defaultSelectedItems: a.any,
2012
1696
  /**
2013
1697
  * If `true`, will allow focus on disabled items.
2014
1698
  * @default false
2015
1699
  */
2016
- disabledItemsFocusable: d.bool,
1700
+ disabledItemsFocusable: a.bool,
2017
1701
  /**
2018
1702
  * If `true` selection is disabled.
2019
1703
  * @default false
2020
1704
  */
2021
- disableSelection: d.bool,
1705
+ disableSelection: a.bool,
2022
1706
  /**
2023
1707
  * Expanded item ids.
2024
1708
  * Used when the item's expansion is controlled.
2025
1709
  */
2026
- expandedItems: d.arrayOf(d.string),
1710
+ expandedItems: a.arrayOf(a.string),
2027
1711
  /**
2028
1712
  * The slot that triggers the item's expansion when clicked.
2029
1713
  * @default 'content'
2030
1714
  */
2031
- expansionTrigger: d.oneOf(["content", "iconContainer"]),
1715
+ expansionTrigger: a.oneOf(["content", "iconContainer"]),
2032
1716
  /**
2033
1717
  * Unstable features, breaking changes might be introduced.
2034
1718
  * For each feature, if the flag is not explicitly set to `true`,
2035
1719
  * the feature will be fully disabled and any property / method call will not have any effect.
2036
1720
  */
2037
- experimentalFeatures: d.shape({
2038
- indentationAtItemLevel: d.bool,
2039
- labelEditing: d.bool
1721
+ experimentalFeatures: a.shape({
1722
+ indentationAtItemLevel: a.bool,
1723
+ labelEditing: a.bool
2040
1724
  }),
2041
1725
  /**
2042
1726
  * Used to determine the id of a given item.
@@ -2046,7 +1730,7 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
2046
1730
  * @returns {string} The id of the item.
2047
1731
  * @default (item) => item.id
2048
1732
  */
2049
- getItemId: d.func,
1733
+ getItemId: a.func,
2050
1734
  /**
2051
1735
  * Used to determine the string label for a given item.
2052
1736
  *
@@ -2055,19 +1739,19 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
2055
1739
  * @returns {string} The label of the item.
2056
1740
  * @default (item) => item.label
2057
1741
  */
2058
- getItemLabel: d.func,
1742
+ getItemLabel: a.func,
2059
1743
  /**
2060
1744
  * This prop is used to help implement the accessibility logic.
2061
1745
  * If you don't provide this prop. It falls back to a randomly generated id.
2062
1746
  */
2063
- id: d.string,
1747
+ id: a.string,
2064
1748
  /**
2065
1749
  * Used to determine if a given item should be disabled.
2066
1750
  * @template R
2067
1751
  * @param {R} item The item to check.
2068
1752
  * @returns {boolean} `true` if the item should be disabled.
2069
1753
  */
2070
- isItemDisabled: d.func,
1754
+ isItemDisabled: a.func,
2071
1755
  /**
2072
1756
  * Determines if a given item is editable or not.
2073
1757
  * Make sure to also enable the `labelEditing` experimental feature:
@@ -2077,810 +1761,126 @@ process.env.NODE_ENV !== "production" && (Pt.propTypes = {
2077
1761
  * @param {R} item The item to check.
2078
1762
  * @returns {boolean} `true` if the item is editable.
2079
1763
  */
2080
- isItemEditable: d.oneOfType([d.func, d.bool]),
1764
+ isItemEditable: a.oneOfType([a.func, a.bool]),
2081
1765
  /**
2082
1766
  * Horizontal indentation between an item and its children.
2083
1767
  * Examples: 24, "24px", "2rem", "2em".
2084
1768
  * @default 12px
2085
1769
  */
2086
- itemChildrenIndentation: d.oneOfType([d.number, d.string]),
2087
- items: d.array.isRequired,
1770
+ itemChildrenIndentation: a.oneOfType([a.number, a.string]),
1771
+ items: a.array.isRequired,
2088
1772
  /**
2089
1773
  * If `true`, `ctrl` and `shift` will trigger multiselect.
2090
1774
  * @default false
2091
1775
  */
2092
- multiSelect: d.bool,
1776
+ multiSelect: a.bool,
2093
1777
  /**
2094
1778
  * Callback fired when Tree Items are expanded/collapsed.
2095
1779
  * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2096
1780
  * @param {array} itemIds The ids of the expanded items.
2097
1781
  */
2098
- onExpandedItemsChange: d.func,
1782
+ onExpandedItemsChange: a.func,
2099
1783
  /**
2100
1784
  * Callback fired when the `content` slot of a given Tree Item is clicked.
2101
1785
  * @param {React.MouseEvent} event The DOM event that triggered the change.
2102
1786
  * @param {string} itemId The id of the focused item.
2103
1787
  */
2104
- onItemClick: d.func,
1788
+ onItemClick: a.func,
2105
1789
  /**
2106
1790
  * Callback fired when a Tree Item is expanded or collapsed.
2107
1791
  * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2108
1792
  * @param {array} itemId The itemId of the modified item.
2109
1793
  * @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
2110
1794
  */
2111
- onItemExpansionToggle: d.func,
1795
+ onItemExpansionToggle: a.func,
2112
1796
  /**
2113
1797
  * Callback fired when a given Tree Item is focused.
2114
1798
  * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
2115
1799
  * @param {string} itemId The id of the focused item.
2116
1800
  */
2117
- onItemFocus: d.func,
1801
+ onItemFocus: a.func,
2118
1802
  /**
2119
1803
  * Callback fired when the label of an item changes.
2120
1804
  * @param {TreeViewItemId} itemId The id of the item that was edited.
2121
1805
  * @param {string} newLabel The new label of the items.
2122
1806
  */
2123
- onItemLabelChange: d.func,
1807
+ onItemLabelChange: a.func,
2124
1808
  /**
2125
1809
  * Callback fired when a Tree Item is selected or deselected.
2126
1810
  * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2127
1811
  * @param {array} itemId The itemId of the modified item.
2128
1812
  * @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
2129
1813
  */
2130
- onItemSelectionToggle: d.func,
1814
+ onItemSelectionToggle: a.func,
2131
1815
  /**
2132
1816
  * Callback fired when Tree Items are selected/deselected.
2133
1817
  * @param {React.SyntheticEvent} event The DOM event that triggered the change.
2134
1818
  * @param {string[] | string} itemIds The ids of the selected items.
2135
1819
  * When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
2136
1820
  */
2137
- onSelectedItemsChange: d.func,
1821
+ onSelectedItemsChange: a.func,
2138
1822
  /**
2139
1823
  * Selected item ids. (Controlled)
2140
1824
  * When `multiSelect` is true this takes an array of strings; when false (default) a string.
2141
1825
  */
2142
- selectedItems: d.any,
1826
+ selectedItems: a.any,
2143
1827
  /**
2144
1828
  * The props used for each component slot.
2145
1829
  * @default {}
2146
1830
  */
2147
- slotProps: d.object,
1831
+ slotProps: a.object,
2148
1832
  /**
2149
1833
  * Overridable component slots.
2150
1834
  * @default {}
2151
1835
  */
2152
- slots: d.object,
1836
+ slots: a.object,
2153
1837
  /**
2154
1838
  * The system prop that allows defining system overrides as well as additional CSS styles.
2155
1839
  */
2156
- sx: d.oneOfType([d.arrayOf(d.oneOfType([d.func, d.object, d.bool])), d.func, d.object])
2157
- });
2158
- const St = (e) => Array.isArray(e) ? e.length > 0 && e.some(St) : !!e, eo = ({
2159
- itemId: e,
2160
- children: t
2161
- }) => {
2162
- const {
2163
- instance: n,
2164
- selection: {
2165
- multiSelect: o
2166
- },
2167
- publicAPI: i
2168
- } = ie(), g = {
2169
- expandable: St(t),
2170
- expanded: n.isItemExpanded(e),
2171
- focused: n.isItemFocused(e),
2172
- selected: n.isItemSelected(e),
2173
- disabled: n.isItemDisabled(e),
2174
- editing: n != null && n.isItemBeingEdited ? n == null ? void 0 : n.isItemBeingEdited(e) : !1,
2175
- editable: n.isItemEditable ? n.isItemEditable(e) : !1
2176
- }, m = (l) => {
2177
- if (g.disabled)
2178
- return;
2179
- g.focused || n.focusItem(l, e);
2180
- const h = o && (l.shiftKey || l.ctrlKey || l.metaKey);
2181
- g.expandable && !(h && n.isItemExpanded(e)) && n.toggleItemExpansion(l, e);
2182
- }, a = (l) => {
2183
- if (g.disabled)
2184
- return;
2185
- g.focused || n.focusItem(l, e), o && (l.shiftKey || l.ctrlKey || l.metaKey) ? l.shiftKey ? n.expandSelectionRange(l, e) : n.selectItem({
2186
- event: l,
2187
- itemId: e,
2188
- keepExistingSelection: !0
2189
- }) : n.selectItem({
2190
- event: l,
2191
- itemId: e,
2192
- shouldBeSelected: !0
2193
- });
2194
- }, u = (l) => {
2195
- const h = l.nativeEvent.shiftKey;
2196
- o && h ? n.expandSelectionRange(l, e) : n.selectItem({
2197
- event: l,
2198
- itemId: e,
2199
- keepExistingSelection: o,
2200
- shouldBeSelected: l.target.checked
2201
- });
2202
- }, c = () => {
2203
- re(n, K) && n.isItemEditable(e) && (n.isItemBeingEdited(e) ? n.setEditedItemId(null) : n.setEditedItemId(e));
2204
- };
2205
- return {
2206
- interactions: {
2207
- handleExpansion: m,
2208
- handleSelection: a,
2209
- handleCheckboxSelection: u,
2210
- toggleItemEditing: c,
2211
- handleSaveItemLabel: (l, h) => {
2212
- re(n, K) && n.isItemBeingEditedRef(e) && (n.updateItemLabel(e, h), c(), n.focusItem(l, e));
2213
- },
2214
- handleCancelItemLabelEditing: (l) => {
2215
- re(n, K) && n.isItemBeingEditedRef(e) && (c(), n.focusItem(l, e));
2216
- }
2217
- },
2218
- status: g,
2219
- publicAPI: i
2220
- };
2221
- }, to = (e) => {
2222
- const {
2223
- runItemPlugins: t,
2224
- items: {
2225
- onItemClick: n,
2226
- disabledItemsFocusable: o,
2227
- indentationAtItemLevel: i
2228
- },
2229
- selection: {
2230
- disableSelection: g,
2231
- checkboxSelection: m
2232
- },
2233
- expansion: {
2234
- expansionTrigger: a
2235
- },
2236
- treeId: u,
2237
- instance: c,
2238
- publicAPI: r
2239
- } = ie(), s = w.useContext(Pe), {
2240
- id: f,
2241
- itemId: l,
2242
- label: h,
2243
- children: I,
2244
- rootRef: p
2245
- } = e, {
2246
- rootRef: b,
2247
- contentRef: x,
2248
- propsEnhancers: R
2249
- } = t(e), {
2250
- interactions: M,
2251
- status: E
2252
- } = eo({
2253
- itemId: l,
2254
- children: I
2255
- }), P = w.useRef(null), D = w.useRef(null), N = Ie(p, b, P), z = Ie(x, D), $ = w.useRef(null), j = Ke({
2256
- itemId: l,
2257
- treeId: u,
2258
- id: f
2259
- }), Q = c.canItemBeTabbed(l) ? 0 : -1, B = {
2260
- rootRefObject: P,
2261
- contentRefObject: D,
2262
- interactions: M
2263
- }, q = (T) => (y) => {
2264
- var O;
2265
- if ((O = T.onFocus) == null || O.call(T, y), y.defaultMuiPrevented)
2266
- return;
2267
- const S = !E.disabled || o;
2268
- !E.focused && S && y.currentTarget === y.target && c.focusItem(y, l);
2269
- }, X = (T) => (y) => {
2270
- var O, F, oe, ye, Te;
2271
- if ((O = T.onBlur) == null || O.call(T, y), y.defaultMuiPrevented)
2272
- return;
2273
- const S = c.getItemDOMElement(l);
2274
- E.editing || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
2275
- // we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
2276
- y.relatedTarget && be(y.relatedTarget, S) && (y.target && ((oe = (F = y.target) == null ? void 0 : F.dataset) == null ? void 0 : oe.element) === "labelInput" && be(y.target, S) || ((Te = (ye = y.relatedTarget) == null ? void 0 : ye.dataset) == null ? void 0 : Te.element) === "labelInput") || c.removeFocusedItem();
2277
- }, ee = (T) => (y) => {
2278
- var S, O, F;
2279
- (S = T.onKeyDown) == null || S.call(T, y), !(y.defaultMuiPrevented || ((F = (O = y.target) == null ? void 0 : O.dataset) == null ? void 0 : F.element) === "labelInput") && c.handleItemKeyDown(y, l);
2280
- }, Y = (T) => (y) => {
2281
- var S;
2282
- (S = T.onDoubleClick) == null || S.call(T, y), !y.defaultMuiPrevented && M.toggleItemEditing();
2283
- }, te = (T) => (y) => {
2284
- var S, O;
2285
- (S = T.onClick) == null || S.call(T, y), n == null || n(y, l), !(y.defaultMuiPrevented || (O = $.current) != null && O.contains(y.target)) && (a === "content" && M.handleExpansion(y), m || M.handleSelection(y));
2286
- }, A = (T) => (y) => {
2287
- var S;
2288
- (S = T.onMouseDown) == null || S.call(T, y), !y.defaultMuiPrevented && (y.shiftKey || y.ctrlKey || y.metaKey || E.disabled) && y.preventDefault();
2289
- }, Z = (T) => (y) => {
2290
- var S;
2291
- (S = T.onChange) == null || S.call(T, y), !y.defaultMuiPrevented && (g || E.disabled || M.handleCheckboxSelection(y));
2292
- }, L = (T) => (y) => {
2293
- var S;
2294
- (S = T.onClick) == null || S.call(T, y), !y.defaultMuiPrevented && a === "iconContainer" && M.handleExpansion(y);
2295
- };
2296
- return {
2297
- getRootProps: (T = {}) => {
2298
- var oe;
2299
- const y = C({}, U(e), U(T));
2300
- let S;
2301
- E.selected ? S = !0 : g || E.disabled ? S = void 0 : S = !1;
2302
- const O = C({}, y, {
2303
- ref: N,
2304
- role: "treeitem",
2305
- tabIndex: Q,
2306
- id: j,
2307
- "aria-expanded": E.expandable ? E.expanded : void 0,
2308
- "aria-selected": S,
2309
- "aria-disabled": E.disabled || void 0
2310
- }, T, {
2311
- onFocus: q(y),
2312
- onBlur: X(y),
2313
- onKeyDown: ee(y)
2314
- });
2315
- i && (O.style = {
2316
- "--TreeView-itemDepth": typeof s == "function" ? s(l) : s
2317
- });
2318
- const F = ((oe = R.root) == null ? void 0 : oe.call(R, C({}, B, {
2319
- externalEventHandlers: y
2320
- }))) ?? {};
2321
- return C({}, O, F);
2322
- },
2323
- getContentProps: (T = {}) => {
2324
- var F;
2325
- const y = U(T), S = C({}, y, T, {
2326
- ref: z,
2327
- onClick: te(y),
2328
- onMouseDown: A(y),
2329
- status: E
2330
- });
2331
- i && (S.indentationAtItemLevel = !0);
2332
- const O = ((F = R.content) == null ? void 0 : F.call(R, C({}, B, {
2333
- externalEventHandlers: y
2334
- }))) ?? {};
2335
- return C({}, S, O);
2336
- },
2337
- getGroupTransitionProps: (T = {}) => {
2338
- const y = U(T), S = C({}, y, {
2339
- unmountOnExit: !0,
2340
- component: "ul",
2341
- role: "group",
2342
- in: E.expanded,
2343
- children: I
2344
- }, T);
2345
- return i && (S.indentationAtItemLevel = !0), S;
2346
- },
2347
- getIconContainerProps: (T = {}) => {
2348
- const y = U(T);
2349
- return C({}, y, T, {
2350
- onClick: L(y)
2351
- });
2352
- },
2353
- getCheckboxProps: (T = {}) => {
2354
- const y = U(T);
2355
- return C({}, y, {
2356
- visible: m,
2357
- ref: $,
2358
- checked: E.selected,
2359
- disabled: g || E.disabled,
2360
- tabIndex: -1
2361
- }, T, {
2362
- onChange: Z(y)
2363
- });
2364
- },
2365
- getLabelProps: (T = {}) => {
2366
- const y = C({}, U(T)), S = C({}, y, {
2367
- children: h
2368
- }, T, {
2369
- onDoubleClick: Y(y)
2370
- });
2371
- return c.isTreeViewEditable && (S.editable = E.editable), S;
2372
- },
2373
- getLabelInputProps: (T = {}) => {
2374
- var O;
2375
- const y = U(T), S = ((O = R.labelInput) == null ? void 0 : O.call(R, {
2376
- rootRefObject: P,
2377
- contentRefObject: D,
2378
- externalEventHandlers: y,
2379
- interactions: M
2380
- })) ?? {};
2381
- return C({}, T, S);
2382
- },
2383
- getDragAndDropOverlayProps: (T = {}) => {
2384
- var O;
2385
- const y = U(T), S = ((O = R.dragAndDropOverlay) == null ? void 0 : O.call(R, C({}, B, {
2386
- externalEventHandlers: y
2387
- }))) ?? {};
2388
- return C({}, T, S);
2389
- },
2390
- rootRef: N,
2391
- status: E,
2392
- publicAPI: r
2393
- };
2394
- }, Mt = to;
2395
- function kt(e) {
2396
- const {
2397
- slots: t,
2398
- slotProps: n,
2399
- status: o
2400
- } = e, i = ie(), g = C({}, i.icons.slots, {
2401
- expandIcon: i.icons.slots.expandIcon ?? Et,
2402
- collapseIcon: i.icons.slots.collapseIcon ?? wt
2403
- }), m = i.icons.slotProps;
2404
- let a;
2405
- t != null && t.icon ? a = "icon" : o.expandable ? o.expanded ? a = "collapseIcon" : a = "expandIcon" : a = "endIcon";
2406
- const u = (t == null ? void 0 : t[a]) ?? g[a], c = V({
2407
- elementType: u,
2408
- externalSlotProps: (r) => C({}, H(m[a], r), H(n == null ? void 0 : n[a], r)),
2409
- // TODO: Add proper ownerState
2410
- ownerState: {}
2411
- });
2412
- return u ? /* @__PURE__ */ v(u, C({}, c)) : null;
2413
- }
2414
- process.env.NODE_ENV !== "production" && (kt.propTypes = {
2415
- // ----------------------------- Warning --------------------------------
2416
- // | These PropTypes are generated from the TypeScript type definitions |
2417
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
2418
- // ----------------------------------------------------------------------
2419
- /**
2420
- * The props used for each component slot.
2421
- * @default {}
2422
- */
2423
- slotProps: d.object,
2424
- /**
2425
- * Overridable component slots.
2426
- * @default {}
2427
- */
2428
- slots: d.object,
2429
- status: d.shape({
2430
- disabled: d.bool.isRequired,
2431
- editable: d.bool.isRequired,
2432
- editing: d.bool.isRequired,
2433
- expandable: d.bool.isRequired,
2434
- expanded: d.bool.isRequired,
2435
- focused: d.bool.isRequired,
2436
- selected: d.bool.isRequired
2437
- }).isRequired
2438
- });
2439
- const no = ["visible"], oo = ["id", "itemId", "label", "disabled", "children", "slots", "slotProps"], ro = je(), Dt = _("li", {
2440
- name: "MuiTreeItem2",
2441
- slot: "Root",
2442
- overridesResolver: (e, t) => t.root
2443
- })({
2444
- listStyle: "none",
2445
- margin: 0,
2446
- padding: 0,
2447
- outline: 0
2448
- }), Ot = _("div", {
2449
- name: "MuiTreeItem2",
2450
- slot: "Content",
2451
- overridesResolver: (e, t) => t.content,
2452
- shouldForwardProp: (e) => pe(e) && e !== "status" && e !== "indentationAtItemLevel"
2453
- })(({
2454
- theme: e
2455
- }) => ({
2456
- padding: e.spacing(0.5, 1),
2457
- borderRadius: e.shape.borderRadius,
2458
- width: "100%",
2459
- boxSizing: "border-box",
2460
- // prevent width + padding to overflow
2461
- position: "relative",
2462
- display: "flex",
2463
- alignItems: "center",
2464
- gap: e.spacing(1),
2465
- cursor: "pointer",
2466
- WebkitTapHighlightColor: "transparent",
2467
- "&:hover": {
2468
- backgroundColor: (e.vars || e).palette.action.hover,
2469
- // Reset on touch devices, it doesn't add specificity
2470
- "@media (hover: none)": {
2471
- backgroundColor: "transparent"
2472
- }
2473
- },
2474
- variants: [{
2475
- props: {
2476
- indentationAtItemLevel: !0
2477
- },
2478
- style: {
2479
- paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
2480
- }
2481
- }, {
2482
- props: ({
2483
- status: t
2484
- }) => t.disabled,
2485
- style: {
2486
- opacity: (e.vars || e).palette.action.disabledOpacity,
2487
- backgroundColor: "transparent"
2488
- }
2489
- }, {
2490
- props: ({
2491
- status: t
2492
- }) => t.focused,
2493
- style: {
2494
- backgroundColor: (e.vars || e).palette.action.focus
2495
- }
2496
- }, {
2497
- props: ({
2498
- status: t
2499
- }) => t.selected,
2500
- style: {
2501
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity),
2502
- "&:hover": {
2503
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
2504
- // Reset on touch devices, it doesn't add specificity
2505
- "@media (hover: none)": {
2506
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : J(e.palette.primary.main, e.palette.action.selectedOpacity)
2507
- }
2508
- }
2509
- }
2510
- }, {
2511
- props: ({
2512
- status: t
2513
- }) => t.selected && t.focused,
2514
- style: {
2515
- backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : J(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
2516
- }
2517
- }]
2518
- })), At = _("div", {
2519
- name: "MuiTreeItem2",
2520
- slot: "Label",
2521
- overridesResolver: (e, t) => t.label,
2522
- shouldForwardProp: (e) => pe(e) && e !== "editable"
2523
- })(({
2524
- theme: e
2525
- }) => C({
2526
- width: "100%",
2527
- boxSizing: "border-box",
2528
- // prevent width + padding to overflow
2529
- // fixes overflow - see https://github.com/mui/material-ui/issues/27372
2530
- minWidth: 0,
2531
- position: "relative",
2532
- overflow: "hidden"
2533
- }, e.typography.body1, {
2534
- variants: [{
2535
- props: ({
2536
- editable: t
2537
- }) => t,
2538
- style: {
2539
- paddingLeft: "2px"
2540
- }
2541
- }]
2542
- })), Lt = _("div", {
2543
- name: "MuiTreeItem2",
2544
- slot: "IconContainer",
2545
- overridesResolver: (e, t) => t.iconContainer
2546
- })({
2547
- width: 16,
2548
- display: "flex",
2549
- flexShrink: 0,
2550
- justifyContent: "center",
2551
- "& svg": {
2552
- fontSize: 18
2553
- }
2554
- }), Vt = _(lt, {
2555
- name: "MuiTreeItem2",
2556
- slot: "GroupTransition",
2557
- overridesResolver: (e, t) => t.groupTransition,
2558
- shouldForwardProp: (e) => pe(e) && e !== "indentationAtItemLevel"
2559
- })({
2560
- margin: 0,
2561
- padding: 0,
2562
- paddingLeft: "var(--TreeView-itemChildrenIndentation)",
2563
- variants: [{
2564
- props: {
2565
- indentationAtItemLevel: !0
2566
- },
2567
- style: {
2568
- paddingLeft: 0
2569
- }
2570
- }]
2571
- }), io = _(/* @__PURE__ */ w.forwardRef((e, t) => {
2572
- const {
2573
- visible: n
2574
- } = e, o = G(e, no);
2575
- return n ? /* @__PURE__ */ v(at, C({}, o, {
2576
- ref: t
2577
- })) : null;
2578
- }), {
2579
- name: "MuiTreeItem2",
2580
- slot: "Checkbox",
2581
- overridesResolver: (e, t) => t.checkbox
2582
- })({
2583
- padding: 0
2584
- }), so = (e) => {
2585
- const {
2586
- classes: t
2587
- } = e;
2588
- return Ne({
2589
- root: ["root"],
2590
- content: ["content"],
2591
- expanded: ["expanded"],
2592
- editing: ["editing"],
2593
- editable: ["editable"],
2594
- selected: ["selected"],
2595
- focused: ["focused"],
2596
- disabled: ["disabled"],
2597
- iconContainer: ["iconContainer"],
2598
- checkbox: ["checkbox"],
2599
- label: ["label"],
2600
- groupTransition: ["groupTransition"],
2601
- labelInput: ["labelInput"],
2602
- dragAndDropOverlay: ["dragAndDropOverlay"]
2603
- }, Ct, t);
2604
- }, lo = /* @__PURE__ */ w.forwardRef(function(t, n) {
2605
- const o = ro({
2606
- props: t,
2607
- name: "MuiTreeItem2"
2608
- }), {
2609
- id: i,
2610
- itemId: g,
2611
- label: m,
2612
- disabled: a,
2613
- children: u,
2614
- slots: c = {},
2615
- slotProps: r = {}
2616
- } = o, s = G(o, oo), {
2617
- getRootProps: f,
2618
- getContentProps: l,
2619
- getIconContainerProps: h,
2620
- getCheckboxProps: I,
2621
- getLabelProps: p,
2622
- getGroupTransitionProps: b,
2623
- getLabelInputProps: x,
2624
- getDragAndDropOverlayProps: R,
2625
- status: M
2626
- } = Mt({
2627
- id: i,
2628
- itemId: g,
2629
- children: u,
2630
- label: m,
2631
- disabled: a
2632
- }), E = C({}, o, M), P = so(E), D = c.root ?? Dt, N = V({
2633
- elementType: D,
2634
- getSlotProps: f,
2635
- externalForwardedProps: s,
2636
- externalSlotProps: r.root,
2637
- additionalProps: {
2638
- ref: n
2639
- },
2640
- ownerState: {},
2641
- className: P.root
2642
- }), z = c.content ?? Ot, $ = V({
2643
- elementType: z,
2644
- getSlotProps: l,
2645
- externalSlotProps: r.content,
2646
- ownerState: {},
2647
- className: $e(P.content, M.expanded && P.expanded, M.selected && P.selected, M.focused && P.focused, M.disabled && P.disabled, M.editing && P.editing, M.editable && P.editable)
2648
- }), j = c.iconContainer ?? Lt, Q = V({
2649
- elementType: j,
2650
- getSlotProps: h,
2651
- externalSlotProps: r.iconContainer,
2652
- ownerState: {},
2653
- className: P.iconContainer
2654
- }), B = c.label ?? At, q = V({
2655
- elementType: B,
2656
- getSlotProps: p,
2657
- externalSlotProps: r.label,
2658
- ownerState: {},
2659
- className: P.label
2660
- }), X = c.checkbox ?? io, ee = V({
2661
- elementType: X,
2662
- getSlotProps: I,
2663
- externalSlotProps: r.checkbox,
2664
- ownerState: {},
2665
- className: P.checkbox
2666
- }), Y = c.groupTransition ?? void 0, te = V({
2667
- elementType: Y,
2668
- getSlotProps: b,
2669
- externalSlotProps: r.groupTransition,
2670
- ownerState: {},
2671
- className: P.groupTransition
2672
- }), A = c.labelInput ?? Tt, Z = V({
2673
- elementType: A,
2674
- getSlotProps: x,
2675
- externalSlotProps: r.labelInput,
2676
- ownerState: {},
2677
- className: P.labelInput
2678
- }), L = c.dragAndDropOverlay ?? ze, ne = V({
2679
- elementType: L,
2680
- getSlotProps: R,
2681
- externalSlotProps: r.dragAndDropOverlay,
2682
- ownerState: {},
2683
- className: P.dragAndDropOverlay
2684
- });
2685
- return /* @__PURE__ */ v(ke, {
2686
- itemId: g,
2687
- children: /* @__PURE__ */ de(D, C({}, N, {
2688
- children: [/* @__PURE__ */ de(z, C({}, $, {
2689
- children: [/* @__PURE__ */ v(j, C({}, Q, {
2690
- children: /* @__PURE__ */ v(kt, {
2691
- status: M,
2692
- slots: c,
2693
- slotProps: r
2694
- })
2695
- })), /* @__PURE__ */ v(X, C({}, ee)), M.editing ? /* @__PURE__ */ v(A, C({}, Z)) : /* @__PURE__ */ v(B, C({}, q)), /* @__PURE__ */ v(L, C({}, ne))]
2696
- })), u && /* @__PURE__ */ v(Vt, C({
2697
- as: Y
2698
- }, te))]
2699
- }))
2700
- });
2701
- });
2702
- process.env.NODE_ENV !== "production" && (lo.propTypes = {
2703
- // ----------------------------- Warning --------------------------------
2704
- // | These PropTypes are generated from the TypeScript type definitions |
2705
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
2706
- // ----------------------------------------------------------------------
2707
- /**
2708
- * The content of the component.
2709
- */
2710
- children: d.node,
2711
- /**
2712
- * Override or extend the styles applied to the component.
2713
- */
2714
- classes: d.object,
2715
- className: d.string,
2716
- /**
2717
- * If `true`, the item is disabled.
2718
- * @default false
2719
- */
2720
- disabled: d.bool,
2721
- /**
2722
- * The id attribute of the item. If not provided, it will be generated.
2723
- */
2724
- id: d.string,
2725
- /**
2726
- * The id of the item.
2727
- * Must be unique.
2728
- */
2729
- itemId: d.string.isRequired,
2730
- /**
2731
- * The label of the item.
2732
- */
2733
- label: d.node,
2734
- /**
2735
- * Callback fired when the item root is blurred.
2736
- */
2737
- onBlur: d.func,
2738
- /**
2739
- * This prop isn't supported.
2740
- * Use the `onItemFocus` callback on the tree if you need to monitor an item's focus.
2741
- */
2742
- onFocus: ct,
2743
- /**
2744
- * Callback fired when a key is pressed on the keyboard and the tree is in focus.
2745
- */
2746
- onKeyDown: d.func,
2747
- /**
2748
- * The props used for each component slot.
2749
- * @default {}
2750
- */
2751
- slotProps: d.object,
2752
- /**
2753
- * Overridable component slots.
2754
- * @default {}
2755
- */
2756
- slots: d.object
1840
+ sx: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object])
2757
1841
  });
2758
- var ao = /* @__PURE__ */ ((e) => (e.FOLDER = "FOLDER", e.SHARE = "SHARE", e.TRASH = "TRASH", e.CUSTOM = "CUSTOM", e))(ao || {});
2759
- const co = (e, t) => {
2760
- if (!e) return Ve;
2761
- if (typeof e != "string") return e;
2762
- switch (e) {
2763
- case "SHARE":
2764
- return an;
2765
- case "TRASH":
2766
- return Qt;
2767
- case "CUSTOM":
2768
- return t || Ve;
2769
- case "FOLDER":
2770
- default:
2771
- return Ve;
2772
- }
2773
- }, uo = Yt(function(t, n) {
2774
- const {
2775
- id: o,
2776
- itemId: i,
2777
- label: g,
2778
- disabled: m,
2779
- children: a,
2780
- itemData: u,
2781
- iconColor: c = "primary"
2782
- } = t, r = co(
2783
- u == null ? void 0 : u.iconType,
2784
- u == null ? void 0 : u.customIcon
2785
- ), {
2786
- getRootProps: s,
2787
- getContentProps: f,
2788
- getLabelProps: l,
2789
- getGroupTransitionProps: h,
2790
- getIconContainerProps: I,
2791
- status: p
2792
- } = Mt({ id: o, itemId: i, label: g, disabled: m, children: a, rootRef: n });
2793
- return /* @__PURE__ */ v(ke, { itemId: i, children: /* @__PURE__ */ de(Dt, { ...s(), children: [
2794
- /* @__PURE__ */ de(
2795
- Ot,
2796
- {
2797
- ...f(),
2798
- style: { display: "flex", alignItems: "center", width: "100%" },
2799
- children: [
2800
- /* @__PURE__ */ v(Lt, { ...I(), children: /* @__PURE__ */ v(r, { fontSize: "small", color: c }) }),
2801
- /* @__PURE__ */ v(At, { ...l() }),
2802
- /* @__PURE__ */ v(rt, { sx: { display: "flex", marginLeft: "auto" }, children: p.expandable && (p.expanded ? /* @__PURE__ */ v(sn, { fontSize: "small" }) : /* @__PURE__ */ v(ln, { fontSize: "small" })) })
2803
- ]
2804
- }
2805
- ),
2806
- a && /* @__PURE__ */ v(
2807
- Vt,
2808
- {
2809
- ...h(),
2810
- style: p.expanded ? {
2811
- borderLeft: "1px solid #bdbdbd",
2812
- paddingLeft: "12px",
2813
- marginLeft: "15px",
2814
- marginTop: "4px",
2815
- marginBottom: "4px"
2816
- } : void 0
2817
- }
2818
- )
2819
- ] }) });
2820
- }), po = (e) => e.internalId, Ft = (e, t, n = []) => {
2821
- for (const o of e) {
2822
- const i = [...n, o.internalId];
2823
- if (o.internalId === t)
2824
- return i;
2825
- if (o.children && o.children.length > 0) {
2826
- const g = Ft(
2827
- o.children,
2828
- t,
2829
- i
2830
- );
2831
- if (g)
2832
- return g;
2833
- }
2834
- }
2835
- return null;
2836
- }, fo = (e) => {
2837
- const t = {}, n = (o) => {
2838
- var i;
2839
- t[o.internalId] = o, (i = o.children) != null && i.length && o.children.forEach(n);
2840
- };
2841
- return e.forEach(n), t;
2842
- }, Lo = ({
1842
+ const so = ({
2843
1843
  items: e,
2844
1844
  selectedItemId: t,
2845
1845
  handleSelectedItemChange: n,
2846
- iconColor: o = "primary"
1846
+ iconColor: r = "primary"
2847
1847
  }) => {
2848
- const [i, g] = Zt([]), m = Ht(() => fo(e), [e]);
2849
- return en(() => {
1848
+ const [l, h] = Ct([]), g = wt(() => St(e), [e]);
1849
+ return Rt(() => {
2850
1850
  if (t) {
2851
- const u = Ft(e, t);
2852
- if (u) {
2853
- const c = u.slice(0, -1);
2854
- g((r) => {
2855
- const s = [...r];
2856
- let f = !1;
2857
- return c.forEach((l) => {
2858
- s.includes(l) || (s.push(l), f = !0);
2859
- }), f ? s : r;
1851
+ const m = Pt(e, t);
1852
+ if (m) {
1853
+ const f = m.slice(0, -1);
1854
+ h((o) => {
1855
+ const s = [...o];
1856
+ let u = !1;
1857
+ return f.forEach((b) => {
1858
+ s.includes(b) || (s.push(b), u = !0);
1859
+ }), u ? s : o;
2860
1860
  });
2861
1861
  }
2862
1862
  }
2863
- }, [t, e]), /* @__PURE__ */ v(rt, { sx: { minHeight: 200, minWidth: 200 }, children: /* @__PURE__ */ v(
2864
- Pt,
1863
+ }, [t, e]), /* @__PURE__ */ S(yt, { sx: kt, children: /* @__PURE__ */ S(
1864
+ tt,
2865
1865
  {
2866
1866
  items: e,
2867
1867
  selectedItems: t,
2868
- expandedItems: i,
2869
- onExpandedItemsChange: (u, c) => {
2870
- g(c);
1868
+ expandedItems: l,
1869
+ onExpandedItemsChange: (m, f) => {
1870
+ h(f);
2871
1871
  },
2872
1872
  itemChildrenIndentation: "50px",
2873
1873
  onSelectedItemsChange: n,
2874
- getItemId: po,
1874
+ getItemId: vt,
2875
1875
  slots: {
2876
- item: (u) => {
2877
- const c = u.itemId ? m[u.itemId] : void 0;
2878
- return /* @__PURE__ */ v(
2879
- uo,
1876
+ item: (m) => {
1877
+ const f = m.itemId ? g[m.itemId] : void 0;
1878
+ return /* @__PURE__ */ S(
1879
+ Ut,
2880
1880
  {
2881
- ...u,
2882
- itemData: c,
2883
- iconColor: o
1881
+ ...m,
1882
+ itemData: f,
1883
+ iconColor: r
2884
1884
  }
2885
1885
  );
2886
1886
  }
@@ -2889,6 +1889,5 @@ const co = (e, t) => {
2889
1889
  ) });
2890
1890
  };
2891
1891
  export {
2892
- ao as ICON_TYPE,
2893
- Lo as default
1892
+ so as default
2894
1893
  };