@cgi-learning-hub/ui 1.4.0-dev.1741950408 → 1.4.0-dev.1741961819

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