jcicl 0.0.28 → 0.0.30

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 (52) hide show
  1. package/.chunks/ButtonBase.js +1 -2
  2. package/.chunks/DefaultPropsProvider.js +8 -11
  3. package/.chunks/TransitionGroupContext.js +297 -69
  4. package/README.md +5 -1
  5. package/base/Button/Button.js +8 -8
  6. package/base/Input/Input.js +4695 -1605
  7. package/composite/List/List.d.ts +1 -0
  8. package/composite/List/List.js +23 -22
  9. package/composite/List/ListButton.d.ts +3 -0
  10. package/composite/List/ListButton.js +12 -17
  11. package/index.d.ts +1 -1
  12. package/index.js +20 -23
  13. package/package.json +23 -1
  14. package/supercomposite/AppHeader/AppHeader.js +17 -18
  15. package/supercomposite/index.d.ts +0 -1
  16. package/supercomposite/index.js +2 -4
  17. package/templates/index.d.ts +0 -1
  18. package/templates/index.js +1 -3
  19. package/.chunks/ListContext.js +0 -6
  20. package/.chunks/Menu.js +0 -3021
  21. package/.chunks/NavLink.js +0 -436
  22. package/.chunks/NavLinkButton.js +0 -259
  23. package/.chunks/emotion-react.browser.esm.js +0 -231
  24. package/.chunks/index.js +0 -131
  25. package/.chunks/isHostComponent.js +0 -17
  26. package/.chunks/jocologo.js +0 -4
  27. package/supercomposite/AppBar/AppBar.d.ts +0 -5
  28. package/supercomposite/AppBar/AppBar.js +0 -361
  29. package/supercomposite/AppBar/index.d.ts +0 -1
  30. package/supercomposite/AppBar/index.js +0 -4
  31. package/supercomposite/OldNav/Nav.d.ts +0 -13
  32. package/supercomposite/OldNav/Nav.js +0 -626
  33. package/supercomposite/OldNav/index.d.ts +0 -2
  34. package/supercomposite/OldNav/index.js +0 -4
  35. package/supercomposite/OldNav/subcomponents/NavItem/NavItem.d.ts +0 -3
  36. package/supercomposite/OldNav/subcomponents/NavItem/NavItem.js +0 -34
  37. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLink.d.ts +0 -3
  38. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLink.js +0 -8
  39. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLinkButton.d.ts +0 -19
  40. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLinkButton.js +0 -8
  41. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLinkText.d.ts +0 -8
  42. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavLinkText.js +0 -425
  43. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavMenu.d.ts +0 -20
  44. package/supercomposite/OldNav/subcomponents/NavItem/subcomponents/NavMenu.js +0 -432
  45. package/supercomposite/OldNav/subcomponents/NavItem/types.d.ts +0 -12
  46. package/supercomposite/OldNav/subcomponents/NavItem/types.js +0 -1
  47. package/supercomposite/OldNav/types.d.ts +0 -2
  48. package/supercomposite/OldNav/types.js +0 -1
  49. package/templates/BasicPage/BasicPage.d.ts +0 -9
  50. package/templates/BasicPage/BasicPage.js +0 -31
  51. package/templates/BasicPage/index.d.ts +0 -1
  52. package/templates/BasicPage/index.js +0 -4
package/.chunks/Menu.js DELETED
@@ -1,3021 +0,0 @@
1
- import * as p from "react";
2
- import ye from "react";
3
- import { P as e, c as z, T as St, l as Mt, g as ae, a as le, s as G, u as ce, b as ue, q as it, d as ze, t as We, r as kt } from "./DefaultPropsProvider.js";
4
- import { jsx as A, jsxs as _e } from "react/jsx-runtime";
5
- import { a as Dt } from "./isHostComponent.js";
6
- import { c as Ce, a as X, _ as It, f as Lt, T as at, u as je, b as Ft, s as Ge, g as Xe, r as jt, e as At } from "./TransitionGroupContext.js";
7
- import { m as lt } from "./memoTheme.js";
8
- import { u as $t } from "./index.js";
9
- import * as Vt from "react-dom";
10
- import Te from "react-dom";
11
- import { L as _t } from "./ListContext.js";
12
- function Ut(t) {
13
- const {
14
- prototype: n = {}
15
- } = t;
16
- return !!n.isReactComponent;
17
- }
18
- function ct(t, n, o, r, i) {
19
- const s = t[n], a = i || n;
20
- if (s == null || // When server-side rendering React doesn't warn either.
21
- // This is not an accurate check for SSR.
22
- // This is only in place for Emotion compat.
23
- // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
24
- typeof window > "u")
25
- return null;
26
- let l;
27
- const c = s.type;
28
- return typeof c == "function" && !Ut(c) && (l = "Did you accidentally use a plain function component for an element instead?"), l !== void 0 ? new Error(`Invalid ${r} \`${a}\` supplied to \`${o}\`. Expected an element that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
29
- }
30
- const ge = Ce(e.element, ct);
31
- ge.isRequired = Ce(e.element.isRequired, ct);
32
- const qt = "exact-prop: ​";
33
- function ut(t) {
34
- return process.env.NODE_ENV === "production" ? t : {
35
- ...t,
36
- [qt]: (n) => {
37
- const o = Object.keys(n).filter((r) => !t.hasOwnProperty(r));
38
- return o.length > 0 ? new Error(`The following props are not supported: ${o.map((r) => `\`${r}\``).join(", ")}. Please remove them.`) : null;
39
- }
40
- };
41
- }
42
- function Ee(t, n, o, r, i) {
43
- if (process.env.NODE_ENV === "production")
44
- return null;
45
- const s = t[n], a = i || n;
46
- return s == null ? null : s && s.nodeType !== 1 ? new Error(`Invalid ${r} \`${a}\` supplied to \`${o}\`. Expected an HTMLElement.`) : null;
47
- }
48
- function Ye(...t) {
49
- return t.reduce((n, o) => o == null ? n : function(...i) {
50
- n.apply(this, i), o.apply(this, i);
51
- }, () => {
52
- });
53
- }
54
- function Ht(t, n = 166) {
55
- let o;
56
- function r(...i) {
57
- const s = () => {
58
- t.apply(this, i);
59
- };
60
- clearTimeout(o), o = setTimeout(s, n);
61
- }
62
- return r.clear = () => {
63
- clearTimeout(o);
64
- }, r;
65
- }
66
- function W(t) {
67
- return t && t.ownerDocument || document;
68
- }
69
- function te(t) {
70
- return W(t).defaultView || window;
71
- }
72
- function pt(t = window) {
73
- const n = t.document.documentElement.clientWidth;
74
- return t.innerWidth - n;
75
- }
76
- function Bt(t) {
77
- const n = typeof t;
78
- switch (n) {
79
- case "number":
80
- return Number.isNaN(t) ? "NaN" : Number.isFinite(t) ? t !== Math.floor(t) ? "float" : "number" : "Infinity";
81
- case "object":
82
- return t === null ? "null" : t.constructor.name;
83
- default:
84
- return n;
85
- }
86
- }
87
- function dt(t, n, o, r) {
88
- const i = t[n];
89
- if (i == null || !Number.isInteger(i)) {
90
- const s = Bt(i);
91
- return new RangeError(`Invalid ${r} \`${n}\` of type \`${s}\` supplied to \`${o}\`, expected \`integer\`.`);
92
- }
93
- return null;
94
- }
95
- function ft(t, n, ...o) {
96
- return t[n] === void 0 ? null : dt(t, n, ...o);
97
- }
98
- function Ae() {
99
- return null;
100
- }
101
- ft.isRequired = dt;
102
- Ae.isRequired = Ae;
103
- const ht = process.env.NODE_ENV === "production" ? Ae : ft;
104
- function Kt(t) {
105
- return typeof t == "string";
106
- }
107
- function mt(t, n, o) {
108
- return t === void 0 || Kt(t) ? n : {
109
- ...n,
110
- ownerState: {
111
- ...n.ownerState,
112
- ...o
113
- }
114
- };
115
- }
116
- function bt(t, n = []) {
117
- if (t === void 0)
118
- return {};
119
- const o = {};
120
- return Object.keys(t).filter((r) => r.match(/^on[A-Z]/) && typeof t[r] == "function" && !n.includes(r)).forEach((r) => {
121
- o[r] = t[r];
122
- }), o;
123
- }
124
- function Ze(t) {
125
- if (t === void 0)
126
- return {};
127
- const n = {};
128
- return Object.keys(t).filter((o) => !(o.match(/^on[A-Z]/) && typeof t[o] == "function")).forEach((o) => {
129
- n[o] = t[o];
130
- }), n;
131
- }
132
- function Et(t) {
133
- const {
134
- getSlotProps: n,
135
- additionalProps: o,
136
- externalSlotProps: r,
137
- externalForwardedProps: i,
138
- className: s
139
- } = t;
140
- if (!n) {
141
- const f = z(o == null ? void 0 : o.className, s, i == null ? void 0 : i.className, r == null ? void 0 : r.className), b = {
142
- ...o == null ? void 0 : o.style,
143
- ...i == null ? void 0 : i.style,
144
- ...r == null ? void 0 : r.style
145
- }, N = {
146
- ...o,
147
- ...i,
148
- ...r
149
- };
150
- return f.length > 0 && (N.className = f), Object.keys(b).length > 0 && (N.style = b), {
151
- props: N,
152
- internalRef: void 0
153
- };
154
- }
155
- const a = bt({
156
- ...i,
157
- ...r
158
- }), l = Ze(r), c = Ze(i), d = n(a), g = z(d == null ? void 0 : d.className, o == null ? void 0 : o.className, s, i == null ? void 0 : i.className, r == null ? void 0 : r.className), v = {
159
- ...d == null ? void 0 : d.style,
160
- ...o == null ? void 0 : o.style,
161
- ...i == null ? void 0 : i.style,
162
- ...r == null ? void 0 : r.style
163
- }, x = {
164
- ...d,
165
- ...o,
166
- ...c,
167
- ...l
168
- };
169
- return g.length > 0 && (x.className = g), Object.keys(v).length > 0 && (x.style = v), {
170
- props: x,
171
- internalRef: d.ref
172
- };
173
- }
174
- function gt(t, n, o) {
175
- return typeof t == "function" ? t(n, o) : t;
176
- }
177
- function Je(t) {
178
- var v;
179
- const {
180
- elementType: n,
181
- externalSlotProps: o,
182
- ownerState: r,
183
- skipResolvingSlotProps: i = !1,
184
- ...s
185
- } = t, a = i ? {} : gt(o, r), {
186
- props: l,
187
- internalRef: c
188
- } = Et({
189
- ...s,
190
- externalSlotProps: a
191
- }), d = X(c, a == null ? void 0 : a.ref, (v = t.additionalProps) == null ? void 0 : v.ref);
192
- return mt(n, {
193
- ...l,
194
- ref: d
195
- }, r);
196
- }
197
- function Se(t) {
198
- var n;
199
- return parseInt(p.version, 10) >= 19 ? ((n = t == null ? void 0 : t.props) == null ? void 0 : n.ref) || null : (t == null ? void 0 : t.ref) || null;
200
- }
201
- const zt = /* @__PURE__ */ p.createContext();
202
- process.env.NODE_ENV !== "production" && (e.node, e.bool);
203
- const Wt = () => p.useContext(zt) ?? !1;
204
- function Ue() {
205
- const t = $t(Mt);
206
- return process.env.NODE_ENV !== "production" && p.useDebugValue(t), t[St] || t;
207
- }
208
- const Qe = {
209
- disabled: !1
210
- };
211
- var Gt = process.env.NODE_ENV !== "production" ? e.oneOfType([e.number, e.shape({
212
- enter: e.number,
213
- exit: e.number,
214
- appear: e.number
215
- }).isRequired]) : null;
216
- process.env.NODE_ENV !== "production" && e.oneOfType([e.string, e.shape({
217
- enter: e.string,
218
- exit: e.string,
219
- active: e.string
220
- }), e.shape({
221
- enter: e.string,
222
- enterDone: e.string,
223
- enterActive: e.string,
224
- exit: e.string,
225
- exitDone: e.string,
226
- exitActive: e.string
227
- })]);
228
- var Xt = function(n) {
229
- return n.scrollTop;
230
- }, me = "unmounted", Q = "exited", ee = "entering", se = "entered", $e = "exiting", Y = /* @__PURE__ */ function(t) {
231
- It(n, t);
232
- function n(r, i) {
233
- var s;
234
- s = t.call(this, r, i) || this;
235
- var a = i, l = a && !a.isMounting ? r.enter : r.appear, c;
236
- return s.appearStatus = null, r.in ? l ? (c = Q, s.appearStatus = ee) : c = se : r.unmountOnExit || r.mountOnEnter ? c = me : c = Q, s.state = {
237
- status: c
238
- }, s.nextCallback = null, s;
239
- }
240
- n.getDerivedStateFromProps = function(i, s) {
241
- var a = i.in;
242
- return a && s.status === me ? {
243
- status: Q
244
- } : null;
245
- };
246
- var o = n.prototype;
247
- return o.componentDidMount = function() {
248
- this.updateStatus(!0, this.appearStatus);
249
- }, o.componentDidUpdate = function(i) {
250
- var s = null;
251
- if (i !== this.props) {
252
- var a = this.state.status;
253
- this.props.in ? a !== ee && a !== se && (s = ee) : (a === ee || a === se) && (s = $e);
254
- }
255
- this.updateStatus(!1, s);
256
- }, o.componentWillUnmount = function() {
257
- this.cancelNextCallback();
258
- }, o.getTimeouts = function() {
259
- var i = this.props.timeout, s, a, l;
260
- return s = a = l = i, i != null && typeof i != "number" && (s = i.exit, a = i.enter, l = i.appear !== void 0 ? i.appear : a), {
261
- exit: s,
262
- enter: a,
263
- appear: l
264
- };
265
- }, o.updateStatus = function(i, s) {
266
- if (i === void 0 && (i = !1), s !== null)
267
- if (this.cancelNextCallback(), s === ee) {
268
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
269
- var a = this.props.nodeRef ? this.props.nodeRef.current : Te.findDOMNode(this);
270
- a && Xt(a);
271
- }
272
- this.performEnter(i);
273
- } else
274
- this.performExit();
275
- else this.props.unmountOnExit && this.state.status === Q && this.setState({
276
- status: me
277
- });
278
- }, o.performEnter = function(i) {
279
- var s = this, a = this.props.enter, l = this.context ? this.context.isMounting : i, c = this.props.nodeRef ? [l] : [Te.findDOMNode(this), l], d = c[0], g = c[1], v = this.getTimeouts(), x = l ? v.appear : v.enter;
280
- if (!i && !a || Qe.disabled) {
281
- this.safeSetState({
282
- status: se
283
- }, function() {
284
- s.props.onEntered(d);
285
- });
286
- return;
287
- }
288
- this.props.onEnter(d, g), this.safeSetState({
289
- status: ee
290
- }, function() {
291
- s.props.onEntering(d, g), s.onTransitionEnd(x, function() {
292
- s.safeSetState({
293
- status: se
294
- }, function() {
295
- s.props.onEntered(d, g);
296
- });
297
- });
298
- });
299
- }, o.performExit = function() {
300
- var i = this, s = this.props.exit, a = this.getTimeouts(), l = this.props.nodeRef ? void 0 : Te.findDOMNode(this);
301
- if (!s || Qe.disabled) {
302
- this.safeSetState({
303
- status: Q
304
- }, function() {
305
- i.props.onExited(l);
306
- });
307
- return;
308
- }
309
- this.props.onExit(l), this.safeSetState({
310
- status: $e
311
- }, function() {
312
- i.props.onExiting(l), i.onTransitionEnd(a.exit, function() {
313
- i.safeSetState({
314
- status: Q
315
- }, function() {
316
- i.props.onExited(l);
317
- });
318
- });
319
- });
320
- }, o.cancelNextCallback = function() {
321
- this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
322
- }, o.safeSetState = function(i, s) {
323
- s = this.setNextCallback(s), this.setState(i, s);
324
- }, o.setNextCallback = function(i) {
325
- var s = this, a = !0;
326
- return this.nextCallback = function(l) {
327
- a && (a = !1, s.nextCallback = null, i(l));
328
- }, this.nextCallback.cancel = function() {
329
- a = !1;
330
- }, this.nextCallback;
331
- }, o.onTransitionEnd = function(i, s) {
332
- this.setNextCallback(s);
333
- var a = this.props.nodeRef ? this.props.nodeRef.current : Te.findDOMNode(this), l = i == null && !this.props.addEndListener;
334
- if (!a || l) {
335
- setTimeout(this.nextCallback, 0);
336
- return;
337
- }
338
- if (this.props.addEndListener) {
339
- var c = this.props.nodeRef ? [this.nextCallback] : [a, this.nextCallback], d = c[0], g = c[1];
340
- this.props.addEndListener(d, g);
341
- }
342
- i != null && setTimeout(this.nextCallback, i);
343
- }, o.render = function() {
344
- var i = this.state.status;
345
- if (i === me)
346
- return null;
347
- var s = this.props, a = s.children;
348
- s.in, s.mountOnEnter, s.unmountOnExit, s.appear, s.enter, s.exit, s.timeout, s.addEndListener, s.onEnter, s.onEntering, s.onEntered, s.onExit, s.onExiting, s.onExited, s.nodeRef;
349
- var l = Lt(s, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
350
- return (
351
- // allows for nested Transitions
352
- /* @__PURE__ */ ye.createElement(at.Provider, {
353
- value: null
354
- }, typeof a == "function" ? a(i, l) : ye.cloneElement(ye.Children.only(a), l))
355
- );
356
- }, n;
357
- }(ye.Component);
358
- Y.contextType = at;
359
- Y.propTypes = process.env.NODE_ENV !== "production" ? {
360
- /**
361
- * A React reference to DOM element that need to transition:
362
- * https://stackoverflow.com/a/51127130/4671932
363
- *
364
- * - When `nodeRef` prop is used, `node` is not passed to callback functions
365
- * (e.g. `onEnter`) because user already has direct access to the node.
366
- * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
367
- * `nodeRef` need to be provided to `Transition` with changed `key` prop
368
- * (see
369
- * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
370
- */
371
- nodeRef: e.shape({
372
- current: typeof Element > "u" ? e.any : function(t, n, o, r, i, s) {
373
- var a = t[n];
374
- return e.instanceOf(a && "ownerDocument" in a ? a.ownerDocument.defaultView.Element : Element)(t, n, o, r, i, s);
375
- }
376
- }),
377
- /**
378
- * A `function` child can be used instead of a React element. This function is
379
- * called with the current transition status (`'entering'`, `'entered'`,
380
- * `'exiting'`, `'exited'`), which can be used to apply context
381
- * specific props to a component.
382
- *
383
- * ```jsx
384
- * <Transition in={this.state.in} timeout={150}>
385
- * {state => (
386
- * <MyComponent className={`fade fade-${state}`} />
387
- * )}
388
- * </Transition>
389
- * ```
390
- */
391
- children: e.oneOfType([e.func.isRequired, e.element.isRequired]).isRequired,
392
- /**
393
- * Show the component; triggers the enter or exit states
394
- */
395
- in: e.bool,
396
- /**
397
- * By default the child component is mounted immediately along with
398
- * the parent `Transition` component. If you want to "lazy mount" the component on the
399
- * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
400
- * mounted, even on "exited", unless you also specify `unmountOnExit`.
401
- */
402
- mountOnEnter: e.bool,
403
- /**
404
- * By default the child component stays mounted after it reaches the `'exited'` state.
405
- * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
406
- */
407
- unmountOnExit: e.bool,
408
- /**
409
- * By default the child component does not perform the enter transition when
410
- * it first mounts, regardless of the value of `in`. If you want this
411
- * behavior, set both `appear` and `in` to `true`.
412
- *
413
- * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
414
- * > only adds an additional enter transition. However, in the
415
- * > `<CSSTransition>` component that first enter transition does result in
416
- * > additional `.appear-*` classes, that way you can choose to style it
417
- * > differently.
418
- */
419
- appear: e.bool,
420
- /**
421
- * Enable or disable enter transitions.
422
- */
423
- enter: e.bool,
424
- /**
425
- * Enable or disable exit transitions.
426
- */
427
- exit: e.bool,
428
- /**
429
- * The duration of the transition, in milliseconds.
430
- * Required unless `addEndListener` is provided.
431
- *
432
- * You may specify a single timeout for all transitions:
433
- *
434
- * ```jsx
435
- * timeout={500}
436
- * ```
437
- *
438
- * or individually:
439
- *
440
- * ```jsx
441
- * timeout={{
442
- * appear: 500,
443
- * enter: 300,
444
- * exit: 500,
445
- * }}
446
- * ```
447
- *
448
- * - `appear` defaults to the value of `enter`
449
- * - `enter` defaults to `0`
450
- * - `exit` defaults to `0`
451
- *
452
- * @type {number | { enter?: number, exit?: number, appear?: number }}
453
- */
454
- timeout: function(n) {
455
- var o = Gt;
456
- n.addEndListener || (o = o.isRequired);
457
- for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
458
- i[s - 1] = arguments[s];
459
- return o.apply(void 0, [n].concat(i));
460
- },
461
- /**
462
- * Add a custom transition end trigger. Called with the transitioning
463
- * DOM node and a `done` callback. Allows for more fine grained transition end
464
- * logic. Timeouts are still used as a fallback if provided.
465
- *
466
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
467
- *
468
- * ```jsx
469
- * addEndListener={(node, done) => {
470
- * // use the css transitionend event to mark the finish of a transition
471
- * node.addEventListener('transitionend', done, false);
472
- * }}
473
- * ```
474
- */
475
- addEndListener: e.func,
476
- /**
477
- * Callback fired before the "entering" status is applied. An extra parameter
478
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
479
- *
480
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
481
- *
482
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
483
- */
484
- onEnter: e.func,
485
- /**
486
- * Callback fired after the "entering" status is applied. An extra parameter
487
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
488
- *
489
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
490
- *
491
- * @type Function(node: HtmlElement, isAppearing: bool)
492
- */
493
- onEntering: e.func,
494
- /**
495
- * Callback fired after the "entered" status is applied. An extra parameter
496
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
497
- *
498
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
499
- *
500
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
501
- */
502
- onEntered: e.func,
503
- /**
504
- * Callback fired before the "exiting" status is applied.
505
- *
506
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
507
- *
508
- * @type Function(node: HtmlElement) -> void
509
- */
510
- onExit: e.func,
511
- /**
512
- * Callback fired after the "exiting" status is applied.
513
- *
514
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
515
- *
516
- * @type Function(node: HtmlElement) -> void
517
- */
518
- onExiting: e.func,
519
- /**
520
- * Callback fired after the "exited" status is applied.
521
- *
522
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
523
- *
524
- * @type Function(node: HtmlElement) -> void
525
- */
526
- onExited: e.func
527
- } : {};
528
- function re() {
529
- }
530
- Y.defaultProps = {
531
- in: !1,
532
- mountOnEnter: !1,
533
- unmountOnExit: !1,
534
- appear: !1,
535
- enter: !0,
536
- exit: !0,
537
- onEnter: re,
538
- onEntering: re,
539
- onEntered: re,
540
- onExit: re,
541
- onExiting: re,
542
- onExited: re
543
- };
544
- Y.UNMOUNTED = me;
545
- Y.EXITED = Q;
546
- Y.ENTERING = ee;
547
- Y.ENTERED = se;
548
- Y.EXITING = $e;
549
- function Yt(t) {
550
- return le("MuiList", t);
551
- }
552
- ae("MuiList", ["root", "padding", "dense", "subheader"]);
553
- const Zt = (t) => {
554
- const {
555
- classes: n,
556
- disablePadding: o,
557
- dense: r,
558
- subheader: i
559
- } = t;
560
- return ue({
561
- root: ["root", !o && "padding", r && "dense", i && "subheader"]
562
- }, Yt, n);
563
- }, Jt = G("ul", {
564
- name: "MuiList",
565
- slot: "Root",
566
- overridesResolver: (t, n) => {
567
- const {
568
- ownerState: o
569
- } = t;
570
- return [n.root, !o.disablePadding && n.padding, o.dense && n.dense, o.subheader && n.subheader];
571
- }
572
- })({
573
- listStyle: "none",
574
- margin: 0,
575
- padding: 0,
576
- position: "relative",
577
- variants: [{
578
- props: ({
579
- ownerState: t
580
- }) => !t.disablePadding,
581
- style: {
582
- paddingTop: 8,
583
- paddingBottom: 8
584
- }
585
- }, {
586
- props: ({
587
- ownerState: t
588
- }) => t.subheader,
589
- style: {
590
- paddingTop: 0
591
- }
592
- }]
593
- }), vt = /* @__PURE__ */ p.forwardRef(function(n, o) {
594
- const r = ce({
595
- props: n,
596
- name: "MuiList"
597
- }), {
598
- children: i,
599
- className: s,
600
- component: a = "ul",
601
- dense: l = !1,
602
- disablePadding: c = !1,
603
- subheader: d,
604
- ...g
605
- } = r, v = p.useMemo(() => ({
606
- dense: l
607
- }), [l]), x = {
608
- ...r,
609
- component: a,
610
- dense: l,
611
- disablePadding: c
612
- }, f = Zt(x);
613
- return /* @__PURE__ */ A(_t.Provider, {
614
- value: v,
615
- children: /* @__PURE__ */ _e(Jt, {
616
- as: a,
617
- className: z(f.root, s),
618
- ref: o,
619
- ownerState: x,
620
- ...g,
621
- children: [d, i]
622
- })
623
- });
624
- });
625
- process.env.NODE_ENV !== "production" && (vt.propTypes = {
626
- // ┌────────────────────────────── Warning ──────────────────────────────┐
627
- // │ These PropTypes are generated from the TypeScript type definitions. │
628
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
629
- // └─────────────────────────────────────────────────────────────────────┘
630
- /**
631
- * The content of the component.
632
- */
633
- children: e.node,
634
- /**
635
- * Override or extend the styles applied to the component.
636
- */
637
- classes: e.object,
638
- /**
639
- * @ignore
640
- */
641
- className: e.string,
642
- /**
643
- * The component used for the root node.
644
- * Either a string to use a HTML element or a component.
645
- */
646
- component: e.elementType,
647
- /**
648
- * If `true`, compact vertical padding designed for keyboard and mouse input is used for
649
- * the list and list items.
650
- * The prop is available to descendant components as the `dense` context.
651
- * @default false
652
- */
653
- dense: e.bool,
654
- /**
655
- * If `true`, vertical padding is removed from the list.
656
- * @default false
657
- */
658
- disablePadding: e.bool,
659
- /**
660
- * The content of the subheader, normally `ListSubheader`.
661
- */
662
- subheader: e.node,
663
- /**
664
- * The system prop that allows defining system overrides as well as additional CSS styles.
665
- */
666
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
667
- });
668
- function Ie(t, n, o) {
669
- return t === n ? t.firstChild : n && n.nextElementSibling ? n.nextElementSibling : o ? null : t.firstChild;
670
- }
671
- function et(t, n, o) {
672
- return t === n ? o ? t.firstChild : t.lastChild : n && n.previousElementSibling ? n.previousElementSibling : o ? null : t.lastChild;
673
- }
674
- function yt(t, n) {
675
- if (n === void 0)
676
- return !0;
677
- let o = t.innerText;
678
- return o === void 0 && (o = t.textContent), o = o.trim().toLowerCase(), o.length === 0 ? !1 : n.repeating ? o[0] === n.keys[0] : o.startsWith(n.keys.join(""));
679
- }
680
- function he(t, n, o, r, i, s) {
681
- let a = !1, l = i(t, n, n ? o : !1);
682
- for (; l; ) {
683
- if (l === t.firstChild) {
684
- if (a)
685
- return !1;
686
- a = !0;
687
- }
688
- const c = r ? !1 : l.disabled || l.getAttribute("aria-disabled") === "true";
689
- if (!l.hasAttribute("tabindex") || !yt(l, s) || c)
690
- l = i(t, l, o);
691
- else
692
- return l.focus(), !0;
693
- }
694
- return !1;
695
- }
696
- const Tt = /* @__PURE__ */ p.forwardRef(function(n, o) {
697
- const {
698
- // private
699
- // eslint-disable-next-line react/prop-types
700
- actions: r,
701
- autoFocus: i = !1,
702
- autoFocusItem: s = !1,
703
- children: a,
704
- className: l,
705
- disabledItemsFocusable: c = !1,
706
- disableListWrap: d = !1,
707
- onKeyDown: g,
708
- variant: v = "selectedMenu",
709
- ...x
710
- } = n, f = p.useRef(null), b = p.useRef({
711
- keys: [],
712
- repeating: !0,
713
- previousKeyMatched: !0,
714
- lastTime: null
715
- });
716
- je(() => {
717
- i && f.current.focus();
718
- }, [i]), p.useImperativeHandle(r, () => ({
719
- adjustStyleForScrollbar: (u, {
720
- direction: m
721
- }) => {
722
- const y = !f.current.style.width;
723
- if (u.clientHeight < f.current.clientHeight && y) {
724
- const O = `${pt(te(u))}px`;
725
- f.current.style[m === "rtl" ? "paddingLeft" : "paddingRight"] = O, f.current.style.width = `calc(100% + ${O})`;
726
- }
727
- return f.current;
728
- }
729
- }), []);
730
- const N = (u) => {
731
- const m = f.current, y = u.key;
732
- if (u.ctrlKey || u.metaKey || u.altKey) {
733
- g && g(u);
734
- return;
735
- }
736
- const R = W(m).activeElement;
737
- if (y === "ArrowDown")
738
- u.preventDefault(), he(m, R, d, c, Ie);
739
- else if (y === "ArrowUp")
740
- u.preventDefault(), he(m, R, d, c, et);
741
- else if (y === "Home")
742
- u.preventDefault(), he(m, null, d, c, Ie);
743
- else if (y === "End")
744
- u.preventDefault(), he(m, null, d, c, et);
745
- else if (y.length === 1) {
746
- const P = b.current, S = y.toLowerCase(), F = performance.now();
747
- P.keys.length > 0 && (F - P.lastTime > 500 ? (P.keys = [], P.repeating = !0, P.previousKeyMatched = !0) : P.repeating && S !== P.keys[0] && (P.repeating = !1)), P.lastTime = F, P.keys.push(S);
748
- const j = R && !P.repeating && yt(R, P);
749
- P.previousKeyMatched && (j || he(m, R, !1, c, Ie, P)) ? u.preventDefault() : P.previousKeyMatched = !1;
750
- }
751
- g && g(u);
752
- }, w = X(f, o);
753
- let T = -1;
754
- p.Children.forEach(a, (u, m) => {
755
- if (!/* @__PURE__ */ p.isValidElement(u)) {
756
- T === m && (T += 1, T >= a.length && (T = -1));
757
- return;
758
- }
759
- process.env.NODE_ENV !== "production" && it.isFragment(u) && console.error(["MUI: The Menu component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join(`
760
- `)), u.props.disabled || (v === "selectedMenu" && u.props.selected || T === -1) && (T = m), T === m && (u.props.disabled || u.props.muiSkipListHighlight || u.type.muiSkipListHighlight) && (T += 1, T >= a.length && (T = -1));
761
- });
762
- const C = p.Children.map(a, (u, m) => {
763
- if (m === T) {
764
- const y = {};
765
- return s && (y.autoFocus = !0), u.props.tabIndex === void 0 && v === "selectedMenu" && (y.tabIndex = 0), /* @__PURE__ */ p.cloneElement(u, y);
766
- }
767
- return u;
768
- });
769
- return /* @__PURE__ */ A(vt, {
770
- role: "menu",
771
- ref: w,
772
- className: l,
773
- onKeyDown: N,
774
- tabIndex: i ? 0 : -1,
775
- ...x,
776
- children: C
777
- });
778
- });
779
- process.env.NODE_ENV !== "production" && (Tt.propTypes = {
780
- // ┌────────────────────────────── Warning ──────────────────────────────┐
781
- // │ These PropTypes are generated from the TypeScript type definitions. │
782
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
783
- // └─────────────────────────────────────────────────────────────────────┘
784
- /**
785
- * If `true`, will focus the `[role="menu"]` container and move into tab order.
786
- * @default false
787
- */
788
- autoFocus: e.bool,
789
- /**
790
- * If `true`, will focus the first menuitem if `variant="menu"` or selected item
791
- * if `variant="selectedMenu"`.
792
- * @default false
793
- */
794
- autoFocusItem: e.bool,
795
- /**
796
- * MenuList contents, normally `MenuItem`s.
797
- */
798
- children: e.node,
799
- /**
800
- * @ignore
801
- */
802
- className: e.string,
803
- /**
804
- * If `true`, will allow focus on disabled items.
805
- * @default false
806
- */
807
- disabledItemsFocusable: e.bool,
808
- /**
809
- * If `true`, the menu items will not wrap focus.
810
- * @default false
811
- */
812
- disableListWrap: e.bool,
813
- /**
814
- * @ignore
815
- */
816
- onKeyDown: e.func,
817
- /**
818
- * The variant to use. Use `menu` to prevent selected items from impacting the initial focus
819
- * and the vertical alignment relative to the anchor element.
820
- * @default 'selectedMenu'
821
- */
822
- variant: e.oneOf(["menu", "selectedMenu"])
823
- });
824
- const xt = (t) => t.scrollTop;
825
- function Pe(t, n) {
826
- const {
827
- timeout: o,
828
- easing: r,
829
- style: i = {}
830
- } = t;
831
- return {
832
- duration: i.transitionDuration ?? (typeof o == "number" ? o : o[n.mode] || 0),
833
- easing: i.transitionTimingFunction ?? (typeof r == "object" ? r[n.mode] : r),
834
- delay: i.transitionDelay
835
- };
836
- }
837
- function Ve(t) {
838
- return `scale(${t}, ${t ** 2})`;
839
- }
840
- const Qt = {
841
- entering: {
842
- opacity: 1,
843
- transform: Ve(1)
844
- },
845
- entered: {
846
- opacity: 1,
847
- transform: "none"
848
- }
849
- }, Le = typeof navigator < "u" && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent), Ne = /* @__PURE__ */ p.forwardRef(function(n, o) {
850
- const {
851
- addEndListener: r,
852
- appear: i = !0,
853
- children: s,
854
- easing: a,
855
- in: l,
856
- onEnter: c,
857
- onEntered: d,
858
- onEntering: g,
859
- onExit: v,
860
- onExited: x,
861
- onExiting: f,
862
- style: b,
863
- timeout: N = "auto",
864
- // eslint-disable-next-line react/prop-types
865
- TransitionComponent: w = Y,
866
- ...T
867
- } = n, C = Ft(), u = p.useRef(), m = Ue(), y = p.useRef(null), O = X(y, Se(s), o), R = (h) => (E) => {
868
- if (h) {
869
- const M = y.current;
870
- E === void 0 ? h(M) : h(M, E);
871
- }
872
- }, P = R(g), S = R((h, E) => {
873
- xt(h);
874
- const {
875
- duration: M,
876
- delay: $,
877
- easing: _
878
- } = Pe({
879
- style: b,
880
- timeout: N,
881
- easing: a
882
- }, {
883
- mode: "enter"
884
- });
885
- let K;
886
- N === "auto" ? (K = m.transitions.getAutoHeightDuration(h.clientHeight), u.current = K) : K = M, h.style.transition = [m.transitions.create("opacity", {
887
- duration: K,
888
- delay: $
889
- }), m.transitions.create("transform", {
890
- duration: Le ? K : K * 0.666,
891
- delay: $,
892
- easing: _
893
- })].join(","), c && c(h, E);
894
- }), F = R(d), j = R(f), V = R((h) => {
895
- const {
896
- duration: E,
897
- delay: M,
898
- easing: $
899
- } = Pe({
900
- style: b,
901
- timeout: N,
902
- easing: a
903
- }, {
904
- mode: "exit"
905
- });
906
- let _;
907
- N === "auto" ? (_ = m.transitions.getAutoHeightDuration(h.clientHeight), u.current = _) : _ = E, h.style.transition = [m.transitions.create("opacity", {
908
- duration: _,
909
- delay: M
910
- }), m.transitions.create("transform", {
911
- duration: Le ? _ : _ * 0.666,
912
- delay: Le ? M : M || _ * 0.333,
913
- easing: $
914
- })].join(","), h.style.opacity = 0, h.style.transform = Ve(0.75), v && v(h);
915
- }), U = R(x);
916
- return /* @__PURE__ */ A(w, {
917
- appear: i,
918
- in: l,
919
- nodeRef: y,
920
- onEnter: S,
921
- onEntered: F,
922
- onEntering: P,
923
- onExit: V,
924
- onExited: U,
925
- onExiting: j,
926
- addEndListener: (h) => {
927
- N === "auto" && C.start(u.current || 0, h), r && r(y.current, h);
928
- },
929
- timeout: N === "auto" ? null : N,
930
- ...T,
931
- children: (h, E) => /* @__PURE__ */ p.cloneElement(s, {
932
- style: {
933
- opacity: 0,
934
- transform: Ve(0.75),
935
- visibility: h === "exited" && !l ? "hidden" : void 0,
936
- ...Qt[h],
937
- ...b,
938
- ...s.props.style
939
- },
940
- ref: O,
941
- ...E
942
- })
943
- });
944
- });
945
- process.env.NODE_ENV !== "production" && (Ne.propTypes = {
946
- // ┌────────────────────────────── Warning ──────────────────────────────┐
947
- // │ These PropTypes are generated from the TypeScript type definitions. │
948
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
949
- // └─────────────────────────────────────────────────────────────────────┘
950
- /**
951
- * Add a custom transition end trigger. Called with the transitioning DOM
952
- * node and a done callback. Allows for more fine grained transition end
953
- * logic. Note: Timeouts are still used as a fallback if provided.
954
- */
955
- addEndListener: e.func,
956
- /**
957
- * Perform the enter transition when it first mounts if `in` is also `true`.
958
- * Set this to `false` to disable this behavior.
959
- * @default true
960
- */
961
- appear: e.bool,
962
- /**
963
- * A single child content element.
964
- */
965
- children: ge.isRequired,
966
- /**
967
- * The transition timing function.
968
- * You may specify a single easing or a object containing enter and exit values.
969
- */
970
- easing: e.oneOfType([e.shape({
971
- enter: e.string,
972
- exit: e.string
973
- }), e.string]),
974
- /**
975
- * If `true`, the component will transition in.
976
- */
977
- in: e.bool,
978
- /**
979
- * @ignore
980
- */
981
- onEnter: e.func,
982
- /**
983
- * @ignore
984
- */
985
- onEntered: e.func,
986
- /**
987
- * @ignore
988
- */
989
- onEntering: e.func,
990
- /**
991
- * @ignore
992
- */
993
- onExit: e.func,
994
- /**
995
- * @ignore
996
- */
997
- onExited: e.func,
998
- /**
999
- * @ignore
1000
- */
1001
- onExiting: e.func,
1002
- /**
1003
- * @ignore
1004
- */
1005
- style: e.object,
1006
- /**
1007
- * The duration for the transition, in milliseconds.
1008
- * You may specify a single timeout for all transitions, or individually with an object.
1009
- *
1010
- * Set to 'auto' to automatically calculate transition time based on height.
1011
- * @default 'auto'
1012
- */
1013
- timeout: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({
1014
- appear: e.number,
1015
- enter: e.number,
1016
- exit: e.number
1017
- })])
1018
- });
1019
- Ne && (Ne.muiSupportAuto = !0);
1020
- function en(t) {
1021
- const n = W(t);
1022
- return n.body === t ? te(t).innerWidth > n.documentElement.clientWidth : t.scrollHeight > t.clientHeight;
1023
- }
1024
- function be(t, n) {
1025
- n ? t.setAttribute("aria-hidden", "true") : t.removeAttribute("aria-hidden");
1026
- }
1027
- function tt(t) {
1028
- return parseInt(te(t).getComputedStyle(t).paddingRight, 10) || 0;
1029
- }
1030
- function tn(t) {
1031
- const o = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].includes(t.tagName), r = t.tagName === "INPUT" && t.getAttribute("type") === "hidden";
1032
- return o || r;
1033
- }
1034
- function nt(t, n, o, r, i) {
1035
- const s = [n, o, ...r];
1036
- [].forEach.call(t.children, (a) => {
1037
- const l = !s.includes(a), c = !tn(a);
1038
- l && c && be(a, i);
1039
- });
1040
- }
1041
- function Fe(t, n) {
1042
- let o = -1;
1043
- return t.some((r, i) => n(r) ? (o = i, !0) : !1), o;
1044
- }
1045
- function nn(t, n) {
1046
- const o = [], r = t.container;
1047
- if (!n.disableScrollLock) {
1048
- if (en(r)) {
1049
- const a = pt(te(r));
1050
- o.push({
1051
- value: r.style.paddingRight,
1052
- property: "padding-right",
1053
- el: r
1054
- }), r.style.paddingRight = `${tt(r) + a}px`;
1055
- const l = W(r).querySelectorAll(".mui-fixed");
1056
- [].forEach.call(l, (c) => {
1057
- o.push({
1058
- value: c.style.paddingRight,
1059
- property: "padding-right",
1060
- el: c
1061
- }), c.style.paddingRight = `${tt(c) + a}px`;
1062
- });
1063
- }
1064
- let s;
1065
- if (r.parentNode instanceof DocumentFragment)
1066
- s = W(r).body;
1067
- else {
1068
- const a = r.parentElement, l = te(r);
1069
- s = (a == null ? void 0 : a.nodeName) === "HTML" && l.getComputedStyle(a).overflowY === "scroll" ? a : r;
1070
- }
1071
- o.push({
1072
- value: s.style.overflow,
1073
- property: "overflow",
1074
- el: s
1075
- }, {
1076
- value: s.style.overflowX,
1077
- property: "overflow-x",
1078
- el: s
1079
- }, {
1080
- value: s.style.overflowY,
1081
- property: "overflow-y",
1082
- el: s
1083
- }), s.style.overflow = "hidden";
1084
- }
1085
- return () => {
1086
- o.forEach(({
1087
- value: s,
1088
- el: a,
1089
- property: l
1090
- }) => {
1091
- s ? a.style.setProperty(l, s) : a.style.removeProperty(l);
1092
- });
1093
- };
1094
- }
1095
- function on(t) {
1096
- const n = [];
1097
- return [].forEach.call(t.children, (o) => {
1098
- o.getAttribute("aria-hidden") === "true" && n.push(o);
1099
- }), n;
1100
- }
1101
- class rn {
1102
- constructor() {
1103
- this.modals = [], this.containers = [];
1104
- }
1105
- add(n, o) {
1106
- let r = this.modals.indexOf(n);
1107
- if (r !== -1)
1108
- return r;
1109
- r = this.modals.length, this.modals.push(n), n.modalRef && be(n.modalRef, !1);
1110
- const i = on(o);
1111
- nt(o, n.mount, n.modalRef, i, !0);
1112
- const s = Fe(this.containers, (a) => a.container === o);
1113
- return s !== -1 ? (this.containers[s].modals.push(n), r) : (this.containers.push({
1114
- modals: [n],
1115
- container: o,
1116
- restore: null,
1117
- hiddenSiblings: i
1118
- }), r);
1119
- }
1120
- mount(n, o) {
1121
- const r = Fe(this.containers, (s) => s.modals.includes(n)), i = this.containers[r];
1122
- i.restore || (i.restore = nn(i, o));
1123
- }
1124
- remove(n, o = !0) {
1125
- const r = this.modals.indexOf(n);
1126
- if (r === -1)
1127
- return r;
1128
- const i = Fe(this.containers, (a) => a.modals.includes(n)), s = this.containers[i];
1129
- if (s.modals.splice(s.modals.indexOf(n), 1), this.modals.splice(r, 1), s.modals.length === 0)
1130
- s.restore && s.restore(), n.modalRef && be(n.modalRef, o), nt(s.container, n.mount, n.modalRef, s.hiddenSiblings, !1), this.containers.splice(i, 1);
1131
- else {
1132
- const a = s.modals[s.modals.length - 1];
1133
- a.modalRef && be(a.modalRef, !1);
1134
- }
1135
- return r;
1136
- }
1137
- isTopModal(n) {
1138
- return this.modals.length > 0 && this.modals[this.modals.length - 1] === n;
1139
- }
1140
- }
1141
- const sn = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
1142
- function an(t) {
1143
- const n = parseInt(t.getAttribute("tabindex") || "", 10);
1144
- return Number.isNaN(n) ? t.contentEditable === "true" || (t.nodeName === "AUDIO" || t.nodeName === "VIDEO" || t.nodeName === "DETAILS") && t.getAttribute("tabindex") === null ? 0 : t.tabIndex : n;
1145
- }
1146
- function ln(t) {
1147
- if (t.tagName !== "INPUT" || t.type !== "radio" || !t.name)
1148
- return !1;
1149
- const n = (r) => t.ownerDocument.querySelector(`input[type="radio"]${r}`);
1150
- let o = n(`[name="${t.name}"]:checked`);
1151
- return o || (o = n(`[name="${t.name}"]`)), o !== t;
1152
- }
1153
- function cn(t) {
1154
- return !(t.disabled || t.tagName === "INPUT" && t.type === "hidden" || ln(t));
1155
- }
1156
- function un(t) {
1157
- const n = [], o = [];
1158
- return Array.from(t.querySelectorAll(sn)).forEach((r, i) => {
1159
- const s = an(r);
1160
- s === -1 || !cn(r) || (s === 0 ? n.push(r) : o.push({
1161
- documentOrder: i,
1162
- tabIndex: s,
1163
- node: r
1164
- }));
1165
- }), o.sort((r, i) => r.tabIndex === i.tabIndex ? r.documentOrder - i.documentOrder : r.tabIndex - i.tabIndex).map((r) => r.node).concat(n);
1166
- }
1167
- function pn() {
1168
- return !0;
1169
- }
1170
- function Oe(t) {
1171
- const {
1172
- children: n,
1173
- disableAutoFocus: o = !1,
1174
- disableEnforceFocus: r = !1,
1175
- disableRestoreFocus: i = !1,
1176
- getTabbable: s = un,
1177
- isEnabled: a = pn,
1178
- open: l
1179
- } = t, c = p.useRef(!1), d = p.useRef(null), g = p.useRef(null), v = p.useRef(null), x = p.useRef(null), f = p.useRef(!1), b = p.useRef(null), N = X(Se(n), b), w = p.useRef(null);
1180
- p.useEffect(() => {
1181
- !l || !b.current || (f.current = !o);
1182
- }, [o, l]), p.useEffect(() => {
1183
- if (!l || !b.current)
1184
- return;
1185
- const u = W(b.current);
1186
- return b.current.contains(u.activeElement) || (b.current.hasAttribute("tabIndex") || (process.env.NODE_ENV !== "production" && console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
1187
- `)), b.current.setAttribute("tabIndex", "-1")), f.current && b.current.focus()), () => {
1188
- i || (v.current && v.current.focus && (c.current = !0, v.current.focus()), v.current = null);
1189
- };
1190
- }, [l]), p.useEffect(() => {
1191
- if (!l || !b.current)
1192
- return;
1193
- const u = W(b.current), m = (R) => {
1194
- w.current = R, !(r || !a() || R.key !== "Tab") && u.activeElement === b.current && R.shiftKey && (c.current = !0, g.current && g.current.focus());
1195
- }, y = () => {
1196
- var S, F;
1197
- const R = b.current;
1198
- if (R === null)
1199
- return;
1200
- if (!u.hasFocus() || !a() || c.current) {
1201
- c.current = !1;
1202
- return;
1203
- }
1204
- if (R.contains(u.activeElement) || r && u.activeElement !== d.current && u.activeElement !== g.current)
1205
- return;
1206
- if (u.activeElement !== x.current)
1207
- x.current = null;
1208
- else if (x.current !== null)
1209
- return;
1210
- if (!f.current)
1211
- return;
1212
- let P = [];
1213
- if ((u.activeElement === d.current || u.activeElement === g.current) && (P = s(b.current)), P.length > 0) {
1214
- const j = !!((S = w.current) != null && S.shiftKey && ((F = w.current) == null ? void 0 : F.key) === "Tab"), V = P[0], U = P[P.length - 1];
1215
- typeof V != "string" && typeof U != "string" && (j ? U.focus() : V.focus());
1216
- } else
1217
- R.focus();
1218
- };
1219
- u.addEventListener("focusin", y), u.addEventListener("keydown", m, !0);
1220
- const O = setInterval(() => {
1221
- u.activeElement && u.activeElement.tagName === "BODY" && y();
1222
- }, 50);
1223
- return () => {
1224
- clearInterval(O), u.removeEventListener("focusin", y), u.removeEventListener("keydown", m, !0);
1225
- };
1226
- }, [o, r, i, a, l, s]);
1227
- const T = (u) => {
1228
- v.current === null && (v.current = u.relatedTarget), f.current = !0, x.current = u.target;
1229
- const m = n.props.onFocus;
1230
- m && m(u);
1231
- }, C = (u) => {
1232
- v.current === null && (v.current = u.relatedTarget), f.current = !0;
1233
- };
1234
- return /* @__PURE__ */ _e(p.Fragment, {
1235
- children: [/* @__PURE__ */ A("div", {
1236
- tabIndex: l ? 0 : -1,
1237
- onFocus: C,
1238
- ref: d,
1239
- "data-testid": "sentinelStart"
1240
- }), /* @__PURE__ */ p.cloneElement(n, {
1241
- ref: N,
1242
- onFocus: T
1243
- }), /* @__PURE__ */ A("div", {
1244
- tabIndex: l ? 0 : -1,
1245
- onFocus: C,
1246
- ref: g,
1247
- "data-testid": "sentinelEnd"
1248
- })]
1249
- });
1250
- }
1251
- process.env.NODE_ENV !== "production" && (Oe.propTypes = {
1252
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1253
- // │ These PropTypes are generated from the TypeScript type definitions. │
1254
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1255
- // └─────────────────────────────────────────────────────────────────────┘
1256
- /**
1257
- * A single child content element.
1258
- */
1259
- children: ge,
1260
- /**
1261
- * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
1262
- * replace it to the last focused element when it closes.
1263
- * This also works correctly with any focus trap children that have the `disableAutoFocus` prop.
1264
- *
1265
- * Generally this should never be set to `true` as it makes the focus trap less
1266
- * accessible to assistive technologies, like screen readers.
1267
- * @default false
1268
- */
1269
- disableAutoFocus: e.bool,
1270
- /**
1271
- * If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
1272
- *
1273
- * Generally this should never be set to `true` as it makes the focus trap less
1274
- * accessible to assistive technologies, like screen readers.
1275
- * @default false
1276
- */
1277
- disableEnforceFocus: e.bool,
1278
- /**
1279
- * If `true`, the focus trap will not restore focus to previously focused element once
1280
- * focus trap is hidden or unmounted.
1281
- * @default false
1282
- */
1283
- disableRestoreFocus: e.bool,
1284
- /**
1285
- * Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
1286
- * For instance, you can provide the "tabbable" npm dependency.
1287
- * @param {HTMLElement} root
1288
- */
1289
- getTabbable: e.func,
1290
- /**
1291
- * This prop extends the `open` prop.
1292
- * It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
1293
- * This prop should be memoized.
1294
- * It can be used to support multiple focus trap mounted at the same time.
1295
- * @default function defaultIsEnabled(): boolean {
1296
- * return true;
1297
- * }
1298
- */
1299
- isEnabled: e.func,
1300
- /**
1301
- * If `true`, focus is locked.
1302
- */
1303
- open: e.bool.isRequired
1304
- });
1305
- process.env.NODE_ENV !== "production" && (Oe.propTypes = ut(Oe.propTypes));
1306
- function dn(t) {
1307
- return typeof t == "function" ? t() : t;
1308
- }
1309
- const we = /* @__PURE__ */ p.forwardRef(function(n, o) {
1310
- const {
1311
- children: r,
1312
- container: i,
1313
- disablePortal: s = !1
1314
- } = n, [a, l] = p.useState(null), c = X(/* @__PURE__ */ p.isValidElement(r) ? Se(r) : null, o);
1315
- if (je(() => {
1316
- s || l(dn(i) || document.body);
1317
- }, [i, s]), je(() => {
1318
- if (a && !s)
1319
- return Ge(o, a), () => {
1320
- Ge(o, null);
1321
- };
1322
- }, [o, a, s]), s) {
1323
- if (/* @__PURE__ */ p.isValidElement(r)) {
1324
- const d = {
1325
- ref: c
1326
- };
1327
- return /* @__PURE__ */ p.cloneElement(r, d);
1328
- }
1329
- return /* @__PURE__ */ A(p.Fragment, {
1330
- children: r
1331
- });
1332
- }
1333
- return /* @__PURE__ */ A(p.Fragment, {
1334
- children: a && /* @__PURE__ */ Vt.createPortal(r, a)
1335
- });
1336
- });
1337
- process.env.NODE_ENV !== "production" && (we.propTypes = {
1338
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1339
- // │ These PropTypes are generated from the TypeScript type definitions. │
1340
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1341
- // └─────────────────────────────────────────────────────────────────────┘
1342
- /**
1343
- * The children to render into the `container`.
1344
- */
1345
- children: e.node,
1346
- /**
1347
- * An HTML element or function that returns one.
1348
- * The `container` will have the portal children appended to it.
1349
- *
1350
- * You can also provide a callback, which is called in a React layout effect.
1351
- * This lets you set the container from a ref, and also makes server-side rendering possible.
1352
- *
1353
- * By default, it uses the body of the top-level document object,
1354
- * so it's simply `document.body` most of the time.
1355
- */
1356
- container: e.oneOfType([Ee, e.func]),
1357
- /**
1358
- * The `children` will be under the DOM hierarchy of the parent component.
1359
- * @default false
1360
- */
1361
- disablePortal: e.bool
1362
- });
1363
- process.env.NODE_ENV !== "production" && (we.propTypes = ut(we.propTypes));
1364
- function ie(t, n) {
1365
- const {
1366
- className: o,
1367
- elementType: r,
1368
- ownerState: i,
1369
- externalForwardedProps: s,
1370
- getSlotOwnerState: a,
1371
- internalForwardedProps: l,
1372
- ...c
1373
- } = n, {
1374
- component: d,
1375
- slots: g = {
1376
- [t]: void 0
1377
- },
1378
- slotProps: v = {
1379
- [t]: void 0
1380
- },
1381
- ...x
1382
- } = s, f = g[t] || r, b = gt(v[t], i), {
1383
- props: {
1384
- component: N,
1385
- ...w
1386
- },
1387
- internalRef: T
1388
- } = Et({
1389
- className: o,
1390
- ...c,
1391
- externalForwardedProps: t === "root" ? x : void 0,
1392
- externalSlotProps: b
1393
- }), C = X(T, b == null ? void 0 : b.ref, n.ref), u = a ? a(w) : {}, m = {
1394
- ...i,
1395
- ...u
1396
- }, y = t === "root" ? N || d : N, O = mt(f, {
1397
- ...t === "root" && !d && !g[t] && l,
1398
- ...t !== "root" && !g[t] && l,
1399
- ...w,
1400
- ...y && {
1401
- as: y
1402
- },
1403
- ref: C
1404
- }, m);
1405
- return Object.keys(u).forEach((R) => {
1406
- delete O[R];
1407
- }), [f, O];
1408
- }
1409
- const fn = {
1410
- entering: {
1411
- opacity: 1
1412
- },
1413
- entered: {
1414
- opacity: 1
1415
- }
1416
- }, Rt = /* @__PURE__ */ p.forwardRef(function(n, o) {
1417
- const r = Ue(), i = {
1418
- enter: r.transitions.duration.enteringScreen,
1419
- exit: r.transitions.duration.leavingScreen
1420
- }, {
1421
- addEndListener: s,
1422
- appear: a = !0,
1423
- children: l,
1424
- easing: c,
1425
- in: d,
1426
- onEnter: g,
1427
- onEntered: v,
1428
- onEntering: x,
1429
- onExit: f,
1430
- onExited: b,
1431
- onExiting: N,
1432
- style: w,
1433
- timeout: T = i,
1434
- // eslint-disable-next-line react/prop-types
1435
- TransitionComponent: C = Y,
1436
- ...u
1437
- } = n, m = p.useRef(null), y = X(m, Se(l), o), O = (k) => (h) => {
1438
- if (k) {
1439
- const E = m.current;
1440
- h === void 0 ? k(E) : k(E, h);
1441
- }
1442
- }, R = O(x), P = O((k, h) => {
1443
- xt(k);
1444
- const E = Pe({
1445
- style: w,
1446
- timeout: T,
1447
- easing: c
1448
- }, {
1449
- mode: "enter"
1450
- });
1451
- k.style.webkitTransition = r.transitions.create("opacity", E), k.style.transition = r.transitions.create("opacity", E), g && g(k, h);
1452
- }), S = O(v), F = O(N), j = O((k) => {
1453
- const h = Pe({
1454
- style: w,
1455
- timeout: T,
1456
- easing: c
1457
- }, {
1458
- mode: "exit"
1459
- });
1460
- k.style.webkitTransition = r.transitions.create("opacity", h), k.style.transition = r.transitions.create("opacity", h), f && f(k);
1461
- }), V = O(b);
1462
- return /* @__PURE__ */ A(C, {
1463
- appear: a,
1464
- in: d,
1465
- nodeRef: m,
1466
- onEnter: P,
1467
- onEntered: S,
1468
- onEntering: R,
1469
- onExit: j,
1470
- onExited: V,
1471
- onExiting: F,
1472
- addEndListener: (k) => {
1473
- s && s(m.current, k);
1474
- },
1475
- timeout: T,
1476
- ...u,
1477
- children: (k, h) => /* @__PURE__ */ p.cloneElement(l, {
1478
- style: {
1479
- opacity: 0,
1480
- visibility: k === "exited" && !d ? "hidden" : void 0,
1481
- ...fn[k],
1482
- ...w,
1483
- ...l.props.style
1484
- },
1485
- ref: y,
1486
- ...h
1487
- })
1488
- });
1489
- });
1490
- process.env.NODE_ENV !== "production" && (Rt.propTypes = {
1491
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1492
- // │ These PropTypes are generated from the TypeScript type definitions. │
1493
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1494
- // └─────────────────────────────────────────────────────────────────────┘
1495
- /**
1496
- * Add a custom transition end trigger. Called with the transitioning DOM
1497
- * node and a done callback. Allows for more fine grained transition end
1498
- * logic. Note: Timeouts are still used as a fallback if provided.
1499
- */
1500
- addEndListener: e.func,
1501
- /**
1502
- * Perform the enter transition when it first mounts if `in` is also `true`.
1503
- * Set this to `false` to disable this behavior.
1504
- * @default true
1505
- */
1506
- appear: e.bool,
1507
- /**
1508
- * A single child content element.
1509
- */
1510
- children: ge.isRequired,
1511
- /**
1512
- * The transition timing function.
1513
- * You may specify a single easing or a object containing enter and exit values.
1514
- */
1515
- easing: e.oneOfType([e.shape({
1516
- enter: e.string,
1517
- exit: e.string
1518
- }), e.string]),
1519
- /**
1520
- * If `true`, the component will transition in.
1521
- */
1522
- in: e.bool,
1523
- /**
1524
- * @ignore
1525
- */
1526
- onEnter: e.func,
1527
- /**
1528
- * @ignore
1529
- */
1530
- onEntered: e.func,
1531
- /**
1532
- * @ignore
1533
- */
1534
- onEntering: e.func,
1535
- /**
1536
- * @ignore
1537
- */
1538
- onExit: e.func,
1539
- /**
1540
- * @ignore
1541
- */
1542
- onExited: e.func,
1543
- /**
1544
- * @ignore
1545
- */
1546
- onExiting: e.func,
1547
- /**
1548
- * @ignore
1549
- */
1550
- style: e.object,
1551
- /**
1552
- * The duration for the transition, in milliseconds.
1553
- * You may specify a single timeout for all transitions, or individually with an object.
1554
- * @default {
1555
- * enter: theme.transitions.duration.enteringScreen,
1556
- * exit: theme.transitions.duration.leavingScreen,
1557
- * }
1558
- */
1559
- timeout: e.oneOfType([e.number, e.shape({
1560
- appear: e.number,
1561
- enter: e.number,
1562
- exit: e.number
1563
- })])
1564
- });
1565
- function hn(t) {
1566
- return le("MuiBackdrop", t);
1567
- }
1568
- ae("MuiBackdrop", ["root", "invisible"]);
1569
- const mn = (t) => {
1570
- const {
1571
- ownerState: n,
1572
- ...o
1573
- } = t;
1574
- return o;
1575
- }, bn = (t) => {
1576
- const {
1577
- classes: n,
1578
- invisible: o
1579
- } = t;
1580
- return ue({
1581
- root: ["root", o && "invisible"]
1582
- }, hn, n);
1583
- }, En = G("div", {
1584
- name: "MuiBackdrop",
1585
- slot: "Root",
1586
- overridesResolver: (t, n) => {
1587
- const {
1588
- ownerState: o
1589
- } = t;
1590
- return [n.root, o.invisible && n.invisible];
1591
- }
1592
- })({
1593
- position: "fixed",
1594
- display: "flex",
1595
- alignItems: "center",
1596
- justifyContent: "center",
1597
- right: 0,
1598
- bottom: 0,
1599
- top: 0,
1600
- left: 0,
1601
- backgroundColor: "rgba(0, 0, 0, 0.5)",
1602
- WebkitTapHighlightColor: "transparent",
1603
- variants: [{
1604
- props: {
1605
- invisible: !0
1606
- },
1607
- style: {
1608
- backgroundColor: "transparent"
1609
- }
1610
- }]
1611
- }), Pt = /* @__PURE__ */ p.forwardRef(function(n, o) {
1612
- const r = ce({
1613
- props: n,
1614
- name: "MuiBackdrop"
1615
- }), {
1616
- children: i,
1617
- className: s,
1618
- component: a = "div",
1619
- invisible: l = !1,
1620
- open: c,
1621
- components: d = {},
1622
- componentsProps: g = {},
1623
- slotProps: v = {},
1624
- slots: x = {},
1625
- TransitionComponent: f,
1626
- transitionDuration: b,
1627
- ...N
1628
- } = r, w = {
1629
- ...r,
1630
- component: a,
1631
- invisible: l
1632
- }, T = bn(w), C = {
1633
- transition: f,
1634
- root: d.Root,
1635
- ...x
1636
- }, u = {
1637
- ...g,
1638
- ...v
1639
- }, m = {
1640
- slots: C,
1641
- slotProps: u
1642
- }, [y, O] = ie("root", {
1643
- elementType: En,
1644
- externalForwardedProps: m,
1645
- className: z(T.root, s),
1646
- ownerState: w
1647
- }), [R, P] = ie("transition", {
1648
- elementType: Rt,
1649
- externalForwardedProps: m,
1650
- ownerState: w
1651
- }), S = mn(P);
1652
- return /* @__PURE__ */ A(R, {
1653
- in: c,
1654
- timeout: b,
1655
- ...N,
1656
- ...S,
1657
- children: /* @__PURE__ */ A(y, {
1658
- "aria-hidden": !0,
1659
- ...O,
1660
- classes: T,
1661
- ref: o,
1662
- children: i
1663
- })
1664
- });
1665
- });
1666
- process.env.NODE_ENV !== "production" && (Pt.propTypes = {
1667
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1668
- // │ These PropTypes are generated from the TypeScript type definitions. │
1669
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1670
- // └─────────────────────────────────────────────────────────────────────┘
1671
- /**
1672
- * The content of the component.
1673
- */
1674
- children: e.node,
1675
- /**
1676
- * Override or extend the styles applied to the component.
1677
- */
1678
- classes: e.object,
1679
- /**
1680
- * @ignore
1681
- */
1682
- className: e.string,
1683
- /**
1684
- * The component used for the root node.
1685
- * Either a string to use a HTML element or a component.
1686
- */
1687
- component: e.elementType,
1688
- /**
1689
- * The components used for each slot inside.
1690
- *
1691
- * @deprecated Use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
1692
- *
1693
- * @default {}
1694
- */
1695
- components: e.shape({
1696
- Root: e.elementType
1697
- }),
1698
- /**
1699
- * The extra props for the slot components.
1700
- * You can override the existing props or add new ones.
1701
- *
1702
- * @deprecated Use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
1703
- *
1704
- * @default {}
1705
- */
1706
- componentsProps: e.shape({
1707
- root: e.object
1708
- }),
1709
- /**
1710
- * If `true`, the backdrop is invisible.
1711
- * It can be used when rendering a popover or a custom select component.
1712
- * @default false
1713
- */
1714
- invisible: e.bool,
1715
- /**
1716
- * If `true`, the component is shown.
1717
- */
1718
- open: e.bool.isRequired,
1719
- /**
1720
- * The props used for each slot inside.
1721
- * @default {}
1722
- */
1723
- slotProps: e.shape({
1724
- root: e.oneOfType([e.func, e.object]),
1725
- transition: e.oneOfType([e.func, e.object])
1726
- }),
1727
- /**
1728
- * The components used for each slot inside.
1729
- * @default {}
1730
- */
1731
- slots: e.shape({
1732
- root: e.elementType,
1733
- transition: e.elementType
1734
- }),
1735
- /**
1736
- * The system prop that allows defining system overrides as well as additional CSS styles.
1737
- */
1738
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1739
- /**
1740
- * The component used for the transition.
1741
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
1742
- * @default Fade
1743
- */
1744
- TransitionComponent: e.elementType,
1745
- /**
1746
- * The duration for the transition, in milliseconds.
1747
- * You may specify a single timeout for all transitions, or individually with an object.
1748
- */
1749
- transitionDuration: e.oneOfType([e.number, e.shape({
1750
- appear: e.number,
1751
- enter: e.number,
1752
- exit: e.number
1753
- })])
1754
- });
1755
- function gn(t) {
1756
- return typeof t == "function" ? t() : t;
1757
- }
1758
- function vn(t) {
1759
- return t ? t.props.hasOwnProperty("in") : !1;
1760
- }
1761
- const xe = new rn();
1762
- function yn(t) {
1763
- const {
1764
- container: n,
1765
- disableEscapeKeyDown: o = !1,
1766
- disableScrollLock: r = !1,
1767
- closeAfterTransition: i = !1,
1768
- onTransitionEnter: s,
1769
- onTransitionExited: a,
1770
- children: l,
1771
- onClose: c,
1772
- open: d,
1773
- rootRef: g
1774
- } = t, v = p.useRef({}), x = p.useRef(null), f = p.useRef(null), b = X(f, g), [N, w] = p.useState(!d), T = vn(l);
1775
- let C = !0;
1776
- (t["aria-hidden"] === "false" || t["aria-hidden"] === !1) && (C = !1);
1777
- const u = () => W(x.current), m = () => (v.current.modalRef = f.current, v.current.mount = x.current, v.current), y = () => {
1778
- xe.mount(m(), {
1779
- disableScrollLock: r
1780
- }), f.current && (f.current.scrollTop = 0);
1781
- }, O = Xe(() => {
1782
- const h = gn(n) || u().body;
1783
- xe.add(m(), h), f.current && y();
1784
- }), R = () => xe.isTopModal(m()), P = Xe((h) => {
1785
- x.current = h, h && (d && R() ? y() : f.current && be(f.current, C));
1786
- }), S = p.useCallback(() => {
1787
- xe.remove(m(), C);
1788
- }, [C]);
1789
- p.useEffect(() => () => {
1790
- S();
1791
- }, [S]), p.useEffect(() => {
1792
- d ? O() : (!T || !i) && S();
1793
- }, [d, S, T, i, O]);
1794
- const F = (h) => (E) => {
1795
- var M;
1796
- (M = h.onKeyDown) == null || M.call(h, E), !(E.key !== "Escape" || E.which === 229 || // Wait until IME is settled.
1797
- !R()) && (o || (E.stopPropagation(), c && c(E, "escapeKeyDown")));
1798
- }, j = (h) => (E) => {
1799
- var M;
1800
- (M = h.onClick) == null || M.call(h, E), E.target === E.currentTarget && c && c(E, "backdropClick");
1801
- };
1802
- return {
1803
- getRootProps: (h = {}) => {
1804
- const E = bt(t);
1805
- delete E.onTransitionEnter, delete E.onTransitionExited;
1806
- const M = {
1807
- ...E,
1808
- ...h
1809
- };
1810
- return {
1811
- /*
1812
- * Marking an element with the role presentation indicates to assistive technology
1813
- * that this element should be ignored; it exists to support the web application and
1814
- * is not meant for humans to interact with directly.
1815
- * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
1816
- */
1817
- role: "presentation",
1818
- ...M,
1819
- onKeyDown: F(M),
1820
- ref: b
1821
- };
1822
- },
1823
- getBackdropProps: (h = {}) => {
1824
- const E = h;
1825
- return {
1826
- "aria-hidden": !0,
1827
- ...E,
1828
- onClick: j(E),
1829
- open: d
1830
- };
1831
- },
1832
- getTransitionProps: () => {
1833
- const h = () => {
1834
- w(!1), s && s();
1835
- }, E = () => {
1836
- w(!0), a && a(), i && S();
1837
- };
1838
- return {
1839
- onEnter: Ye(h, l == null ? void 0 : l.props.onEnter),
1840
- onExited: Ye(E, l == null ? void 0 : l.props.onExited)
1841
- };
1842
- },
1843
- rootRef: b,
1844
- portalRef: P,
1845
- isTopModal: R,
1846
- exited: N,
1847
- hasTransition: T
1848
- };
1849
- }
1850
- function Tn(t) {
1851
- return le("MuiModal", t);
1852
- }
1853
- ae("MuiModal", ["root", "hidden", "backdrop"]);
1854
- const xn = (t) => {
1855
- const {
1856
- open: n,
1857
- exited: o,
1858
- classes: r
1859
- } = t;
1860
- return ue({
1861
- root: ["root", !n && o && "hidden"],
1862
- backdrop: ["backdrop"]
1863
- }, Tn, r);
1864
- }, Rn = G("div", {
1865
- name: "MuiModal",
1866
- slot: "Root",
1867
- overridesResolver: (t, n) => {
1868
- const {
1869
- ownerState: o
1870
- } = t;
1871
- return [n.root, !o.open && o.exited && n.hidden];
1872
- }
1873
- })(lt(({
1874
- theme: t
1875
- }) => ({
1876
- position: "fixed",
1877
- zIndex: (t.vars || t).zIndex.modal,
1878
- right: 0,
1879
- bottom: 0,
1880
- top: 0,
1881
- left: 0,
1882
- variants: [{
1883
- props: ({
1884
- ownerState: n
1885
- }) => !n.open && n.exited,
1886
- style: {
1887
- visibility: "hidden"
1888
- }
1889
- }]
1890
- }))), Pn = G(Pt, {
1891
- name: "MuiModal",
1892
- slot: "Backdrop",
1893
- overridesResolver: (t, n) => n.backdrop
1894
- })({
1895
- zIndex: -1
1896
- }), Nt = /* @__PURE__ */ p.forwardRef(function(n, o) {
1897
- const r = ce({
1898
- name: "MuiModal",
1899
- props: n
1900
- }), {
1901
- BackdropComponent: i = Pn,
1902
- BackdropProps: s,
1903
- classes: a,
1904
- className: l,
1905
- closeAfterTransition: c = !1,
1906
- children: d,
1907
- container: g,
1908
- component: v,
1909
- components: x = {},
1910
- componentsProps: f = {},
1911
- disableAutoFocus: b = !1,
1912
- disableEnforceFocus: N = !1,
1913
- disableEscapeKeyDown: w = !1,
1914
- disablePortal: T = !1,
1915
- disableRestoreFocus: C = !1,
1916
- disableScrollLock: u = !1,
1917
- hideBackdrop: m = !1,
1918
- keepMounted: y = !1,
1919
- onBackdropClick: O,
1920
- onClose: R,
1921
- onTransitionEnter: P,
1922
- onTransitionExited: S,
1923
- open: F,
1924
- slotProps: j = {},
1925
- slots: V = {},
1926
- // eslint-disable-next-line react/prop-types
1927
- theme: U,
1928
- ...k
1929
- } = r, h = {
1930
- ...r,
1931
- closeAfterTransition: c,
1932
- disableAutoFocus: b,
1933
- disableEnforceFocus: N,
1934
- disableEscapeKeyDown: w,
1935
- disablePortal: T,
1936
- disableRestoreFocus: C,
1937
- disableScrollLock: u,
1938
- hideBackdrop: m,
1939
- keepMounted: y
1940
- }, {
1941
- getRootProps: E,
1942
- getBackdropProps: M,
1943
- getTransitionProps: $,
1944
- portalRef: _,
1945
- isTopModal: K,
1946
- exited: pe,
1947
- hasTransition: ve
1948
- } = yn({
1949
- ...h,
1950
- rootRef: o
1951
- }), Z = {
1952
- ...h,
1953
- exited: pe
1954
- }, H = xn(Z), J = {};
1955
- if (d.props.tabIndex === void 0 && (J.tabIndex = "-1"), ve) {
1956
- const {
1957
- onEnter: L,
1958
- onExited: q
1959
- } = $();
1960
- J.onEnter = L, J.onExited = q;
1961
- }
1962
- const de = {
1963
- ...k,
1964
- slots: {
1965
- root: x.Root,
1966
- backdrop: x.Backdrop,
1967
- ...V
1968
- },
1969
- slotProps: {
1970
- ...f,
1971
- ...j
1972
- }
1973
- }, [Me, ke] = ie("root", {
1974
- elementType: Rn,
1975
- externalForwardedProps: de,
1976
- getSlotProps: E,
1977
- additionalProps: {
1978
- ref: o,
1979
- as: v
1980
- },
1981
- ownerState: Z,
1982
- className: z(l, H == null ? void 0 : H.root, !Z.open && Z.exited && (H == null ? void 0 : H.hidden))
1983
- }), [De, D] = ie("backdrop", {
1984
- elementType: i,
1985
- externalForwardedProps: de,
1986
- additionalProps: s,
1987
- getSlotProps: (L) => M({
1988
- ...L,
1989
- onClick: (q) => {
1990
- O && O(q), L != null && L.onClick && L.onClick(q);
1991
- }
1992
- }),
1993
- className: z(s == null ? void 0 : s.className, H == null ? void 0 : H.backdrop),
1994
- ownerState: Z
1995
- }), I = X(s == null ? void 0 : s.ref, D.ref);
1996
- return !y && !F && (!ve || pe) ? null : /* @__PURE__ */ A(we, {
1997
- ref: _,
1998
- container: g,
1999
- disablePortal: T,
2000
- children: /* @__PURE__ */ _e(Me, {
2001
- ...ke,
2002
- children: [!m && i ? /* @__PURE__ */ A(De, {
2003
- ...D,
2004
- ref: I
2005
- }) : null, /* @__PURE__ */ A(Oe, {
2006
- disableEnforceFocus: N,
2007
- disableAutoFocus: b,
2008
- disableRestoreFocus: C,
2009
- isEnabled: K,
2010
- open: F,
2011
- children: /* @__PURE__ */ p.cloneElement(d, J)
2012
- })]
2013
- })
2014
- });
2015
- });
2016
- process.env.NODE_ENV !== "production" && (Nt.propTypes = {
2017
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2018
- // │ These PropTypes are generated from the TypeScript type definitions. │
2019
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
2020
- // └─────────────────────────────────────────────────────────────────────┘
2021
- /**
2022
- * A backdrop component. This prop enables custom backdrop rendering.
2023
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
2024
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
2025
- * @default styled(Backdrop, {
2026
- * name: 'MuiModal',
2027
- * slot: 'Backdrop',
2028
- * overridesResolver: (props, styles) => {
2029
- * return styles.backdrop;
2030
- * },
2031
- * })({
2032
- * zIndex: -1,
2033
- * })
2034
- */
2035
- BackdropComponent: e.elementType,
2036
- /**
2037
- * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
2038
- * @deprecated Use `slotProps.backdrop` instead.
2039
- */
2040
- BackdropProps: e.object,
2041
- /**
2042
- * A single child content element.
2043
- */
2044
- children: ge.isRequired,
2045
- /**
2046
- * Override or extend the styles applied to the component.
2047
- */
2048
- classes: e.object,
2049
- /**
2050
- * @ignore
2051
- */
2052
- className: e.string,
2053
- /**
2054
- * When set to true the Modal waits until a nested Transition is completed before closing.
2055
- * @default false
2056
- */
2057
- closeAfterTransition: e.bool,
2058
- /**
2059
- * The component used for the root node.
2060
- * Either a string to use a HTML element or a component.
2061
- */
2062
- component: e.elementType,
2063
- /**
2064
- * The components used for each slot inside.
2065
- *
2066
- * @deprecated Use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
2067
- *
2068
- * @default {}
2069
- */
2070
- components: e.shape({
2071
- Backdrop: e.elementType,
2072
- Root: e.elementType
2073
- }),
2074
- /**
2075
- * The extra props for the slot components.
2076
- * You can override the existing props or add new ones.
2077
- *
2078
- * @deprecated Use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
2079
- *
2080
- * @default {}
2081
- */
2082
- componentsProps: e.shape({
2083
- backdrop: e.oneOfType([e.func, e.object]),
2084
- root: e.oneOfType([e.func, e.object])
2085
- }),
2086
- /**
2087
- * An HTML element or function that returns one.
2088
- * The `container` will have the portal children appended to it.
2089
- *
2090
- * You can also provide a callback, which is called in a React layout effect.
2091
- * This lets you set the container from a ref, and also makes server-side rendering possible.
2092
- *
2093
- * By default, it uses the body of the top-level document object,
2094
- * so it's simply `document.body` most of the time.
2095
- */
2096
- container: e.oneOfType([Ee, e.func]),
2097
- /**
2098
- * If `true`, the modal will not automatically shift focus to itself when it opens, and
2099
- * replace it to the last focused element when it closes.
2100
- * This also works correctly with any modal children that have the `disableAutoFocus` prop.
2101
- *
2102
- * Generally this should never be set to `true` as it makes the modal less
2103
- * accessible to assistive technologies, like screen readers.
2104
- * @default false
2105
- */
2106
- disableAutoFocus: e.bool,
2107
- /**
2108
- * If `true`, the modal will not prevent focus from leaving the modal while open.
2109
- *
2110
- * Generally this should never be set to `true` as it makes the modal less
2111
- * accessible to assistive technologies, like screen readers.
2112
- * @default false
2113
- */
2114
- disableEnforceFocus: e.bool,
2115
- /**
2116
- * If `true`, hitting escape will not fire the `onClose` callback.
2117
- * @default false
2118
- */
2119
- disableEscapeKeyDown: e.bool,
2120
- /**
2121
- * The `children` will be under the DOM hierarchy of the parent component.
2122
- * @default false
2123
- */
2124
- disablePortal: e.bool,
2125
- /**
2126
- * If `true`, the modal will not restore focus to previously focused element once
2127
- * modal is hidden or unmounted.
2128
- * @default false
2129
- */
2130
- disableRestoreFocus: e.bool,
2131
- /**
2132
- * Disable the scroll lock behavior.
2133
- * @default false
2134
- */
2135
- disableScrollLock: e.bool,
2136
- /**
2137
- * If `true`, the backdrop is not rendered.
2138
- * @default false
2139
- */
2140
- hideBackdrop: e.bool,
2141
- /**
2142
- * Always keep the children in the DOM.
2143
- * This prop can be useful in SEO situation or
2144
- * when you want to maximize the responsiveness of the Modal.
2145
- * @default false
2146
- */
2147
- keepMounted: e.bool,
2148
- /**
2149
- * Callback fired when the backdrop is clicked.
2150
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
2151
- */
2152
- onBackdropClick: e.func,
2153
- /**
2154
- * Callback fired when the component requests to be closed.
2155
- * The `reason` parameter can optionally be used to control the response to `onClose`.
2156
- *
2157
- * @param {object} event The event source of the callback.
2158
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
2159
- */
2160
- onClose: e.func,
2161
- /**
2162
- * A function called when a transition enters.
2163
- */
2164
- onTransitionEnter: e.func,
2165
- /**
2166
- * A function called when a transition has exited.
2167
- */
2168
- onTransitionExited: e.func,
2169
- /**
2170
- * If `true`, the component is shown.
2171
- */
2172
- open: e.bool.isRequired,
2173
- /**
2174
- * The props used for each slot inside the Modal.
2175
- * @default {}
2176
- */
2177
- slotProps: e.shape({
2178
- backdrop: e.oneOfType([e.func, e.object]),
2179
- root: e.oneOfType([e.func, e.object])
2180
- }),
2181
- /**
2182
- * The components used for each slot inside the Modal.
2183
- * Either a string to use a HTML element or a component.
2184
- * @default {}
2185
- */
2186
- slots: e.shape({
2187
- backdrop: e.elementType,
2188
- root: e.elementType
2189
- }),
2190
- /**
2191
- * The system prop that allows defining system overrides as well as additional CSS styles.
2192
- */
2193
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
2194
- });
2195
- function Nn(t) {
2196
- return le("MuiPaper", t);
2197
- }
2198
- ae("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
2199
- const On = (t) => {
2200
- const {
2201
- square: n,
2202
- elevation: o,
2203
- variant: r,
2204
- classes: i
2205
- } = t, s = {
2206
- root: ["root", r, !n && "rounded", r === "elevation" && `elevation${o}`]
2207
- };
2208
- return ue(s, Nn, i);
2209
- }, wn = G("div", {
2210
- name: "MuiPaper",
2211
- slot: "Root",
2212
- overridesResolver: (t, n) => {
2213
- const {
2214
- ownerState: o
2215
- } = t;
2216
- return [n.root, n[o.variant], !o.square && n.rounded, o.variant === "elevation" && n[`elevation${o.elevation}`]];
2217
- }
2218
- })(lt(({
2219
- theme: t
2220
- }) => ({
2221
- backgroundColor: (t.vars || t).palette.background.paper,
2222
- color: (t.vars || t).palette.text.primary,
2223
- transition: t.transitions.create("box-shadow"),
2224
- variants: [{
2225
- props: ({
2226
- ownerState: n
2227
- }) => !n.square,
2228
- style: {
2229
- borderRadius: t.shape.borderRadius
2230
- }
2231
- }, {
2232
- props: {
2233
- variant: "outlined"
2234
- },
2235
- style: {
2236
- border: `1px solid ${(t.vars || t).palette.divider}`
2237
- }
2238
- }, {
2239
- props: {
2240
- variant: "elevation"
2241
- },
2242
- style: {
2243
- boxShadow: "var(--Paper-shadow)",
2244
- backgroundImage: "var(--Paper-overlay)"
2245
- }
2246
- }]
2247
- }))), Ot = /* @__PURE__ */ p.forwardRef(function(n, o) {
2248
- var f;
2249
- const r = ce({
2250
- props: n,
2251
- name: "MuiPaper"
2252
- }), i = Ue(), {
2253
- className: s,
2254
- component: a = "div",
2255
- elevation: l = 1,
2256
- square: c = !1,
2257
- variant: d = "elevation",
2258
- ...g
2259
- } = r, v = {
2260
- ...r,
2261
- component: a,
2262
- elevation: l,
2263
- square: c,
2264
- variant: d
2265
- }, x = On(v);
2266
- return process.env.NODE_ENV !== "production" && i.shadows[l] === void 0 && console.error([`MUI: The elevation provided <Paper elevation={${l}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${l}]\` is defined.`].join(`
2267
- `)), /* @__PURE__ */ A(wn, {
2268
- as: a,
2269
- ownerState: v,
2270
- className: z(x.root, s),
2271
- ref: o,
2272
- ...g,
2273
- style: {
2274
- ...d === "elevation" && {
2275
- "--Paper-shadow": (i.vars || i).shadows[l],
2276
- ...i.vars && {
2277
- "--Paper-overlay": (f = i.vars.overlays) == null ? void 0 : f[l]
2278
- },
2279
- ...!i.vars && i.palette.mode === "dark" && {
2280
- "--Paper-overlay": `linear-gradient(${ze("#fff", We(l))}, ${ze("#fff", We(l))})`
2281
- }
2282
- },
2283
- ...g.style
2284
- }
2285
- });
2286
- });
2287
- process.env.NODE_ENV !== "production" && (Ot.propTypes = {
2288
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2289
- // │ These PropTypes are generated from the TypeScript type definitions. │
2290
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
2291
- // └─────────────────────────────────────────────────────────────────────┘
2292
- /**
2293
- * The content of the component.
2294
- */
2295
- children: e.node,
2296
- /**
2297
- * Override or extend the styles applied to the component.
2298
- */
2299
- classes: e.object,
2300
- /**
2301
- * @ignore
2302
- */
2303
- className: e.string,
2304
- /**
2305
- * The component used for the root node.
2306
- * Either a string to use a HTML element or a component.
2307
- */
2308
- component: e.elementType,
2309
- /**
2310
- * Shadow depth, corresponds to `dp` in the spec.
2311
- * It accepts values between 0 and 24 inclusive.
2312
- * @default 1
2313
- */
2314
- elevation: Ce(ht, (t) => {
2315
- const {
2316
- elevation: n,
2317
- variant: o
2318
- } = t;
2319
- return n > 0 && o === "outlined" ? new Error(`MUI: Combining \`elevation={${n}}\` with \`variant="${o}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`) : null;
2320
- }),
2321
- /**
2322
- * If `true`, rounded corners are disabled.
2323
- * @default false
2324
- */
2325
- square: e.bool,
2326
- /**
2327
- * @ignore
2328
- */
2329
- style: e.object,
2330
- /**
2331
- * The system prop that allows defining system overrides as well as additional CSS styles.
2332
- */
2333
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
2334
- /**
2335
- * The variant to use.
2336
- * @default 'elevation'
2337
- */
2338
- variant: e.oneOfType([e.oneOf(["elevation", "outlined"]), e.string])
2339
- });
2340
- function Cn(t) {
2341
- return le("MuiPopover", t);
2342
- }
2343
- ae("MuiPopover", ["root", "paper"]);
2344
- function ot(t, n) {
2345
- let o = 0;
2346
- return typeof n == "number" ? o = n : n === "center" ? o = t.height / 2 : n === "bottom" && (o = t.height), o;
2347
- }
2348
- function rt(t, n) {
2349
- let o = 0;
2350
- return typeof n == "number" ? o = n : n === "center" ? o = t.width / 2 : n === "right" && (o = t.width), o;
2351
- }
2352
- function st(t) {
2353
- return [t.horizontal, t.vertical].map((n) => typeof n == "number" ? `${n}px` : n).join(" ");
2354
- }
2355
- function Re(t) {
2356
- return typeof t == "function" ? t() : t;
2357
- }
2358
- const Sn = (t) => {
2359
- const {
2360
- classes: n
2361
- } = t;
2362
- return ue({
2363
- root: ["root"],
2364
- paper: ["paper"]
2365
- }, Cn, n);
2366
- }, Mn = G(Nt, {
2367
- name: "MuiPopover",
2368
- slot: "Root",
2369
- overridesResolver: (t, n) => n.root
2370
- })({}), wt = G(Ot, {
2371
- name: "MuiPopover",
2372
- slot: "Paper",
2373
- overridesResolver: (t, n) => n.paper
2374
- })({
2375
- position: "absolute",
2376
- overflowY: "auto",
2377
- overflowX: "hidden",
2378
- // So we see the popover when it's empty.
2379
- // It's most likely on issue on userland.
2380
- minWidth: 16,
2381
- minHeight: 16,
2382
- maxWidth: "calc(100% - 32px)",
2383
- maxHeight: "calc(100% - 32px)",
2384
- // We disable the focus ring for mouse, touch and keyboard users.
2385
- outline: 0
2386
- }), Ct = /* @__PURE__ */ p.forwardRef(function(n, o) {
2387
- const r = ce({
2388
- props: n,
2389
- name: "MuiPopover"
2390
- }), {
2391
- action: i,
2392
- anchorEl: s,
2393
- anchorOrigin: a = {
2394
- vertical: "top",
2395
- horizontal: "left"
2396
- },
2397
- anchorPosition: l,
2398
- anchorReference: c = "anchorEl",
2399
- children: d,
2400
- className: g,
2401
- container: v,
2402
- elevation: x = 8,
2403
- marginThreshold: f = 16,
2404
- open: b,
2405
- PaperProps: N = {},
2406
- slots: w = {},
2407
- slotProps: T = {},
2408
- transformOrigin: C = {
2409
- vertical: "top",
2410
- horizontal: "left"
2411
- },
2412
- TransitionComponent: u = Ne,
2413
- transitionDuration: m = "auto",
2414
- TransitionProps: {
2415
- onEntering: y,
2416
- ...O
2417
- } = {},
2418
- disableScrollLock: R = !1,
2419
- ...P
2420
- } = r, S = (T == null ? void 0 : T.paper) ?? N, F = p.useRef(), j = {
2421
- ...r,
2422
- anchorOrigin: a,
2423
- anchorReference: c,
2424
- elevation: x,
2425
- marginThreshold: f,
2426
- externalPaperSlotProps: S,
2427
- transformOrigin: C,
2428
- TransitionComponent: u,
2429
- transitionDuration: m,
2430
- TransitionProps: O
2431
- }, V = Sn(j), U = p.useCallback(() => {
2432
- if (c === "anchorPosition")
2433
- return process.env.NODE_ENV !== "production" && (l || console.error('MUI: You need to provide a `anchorPosition` prop when using <Popover anchorReference="anchorPosition" />.')), l;
2434
- const D = Re(s), I = D && D.nodeType === 1 ? D : W(F.current).body, L = I.getBoundingClientRect();
2435
- if (process.env.NODE_ENV !== "production") {
2436
- const q = I.getBoundingClientRect();
2437
- process.env.NODE_ENV !== "test" && q.top === 0 && q.left === 0 && q.right === 0 && q.bottom === 0 && console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
2438
- `));
2439
- }
2440
- return {
2441
- top: L.top + ot(L, a.vertical),
2442
- left: L.left + rt(L, a.horizontal)
2443
- };
2444
- }, [s, a.horizontal, a.vertical, l, c]), k = p.useCallback((D) => ({
2445
- vertical: ot(D, C.vertical),
2446
- horizontal: rt(D, C.horizontal)
2447
- }), [C.horizontal, C.vertical]), h = p.useCallback((D) => {
2448
- const I = {
2449
- width: D.offsetWidth,
2450
- height: D.offsetHeight
2451
- }, L = k(I);
2452
- if (c === "none")
2453
- return {
2454
- top: null,
2455
- left: null,
2456
- transformOrigin: st(L)
2457
- };
2458
- const q = U();
2459
- let ne = q.top - L.vertical, oe = q.left - L.horizontal;
2460
- const qe = ne + I.height, He = oe + I.width, Be = te(Re(s)), fe = Be.innerHeight - f, Ke = Be.innerWidth - f;
2461
- if (f !== null && ne < f) {
2462
- const B = ne - f;
2463
- ne -= B, L.vertical += B;
2464
- } else if (f !== null && qe > fe) {
2465
- const B = qe - fe;
2466
- ne -= B, L.vertical += B;
2467
- }
2468
- if (process.env.NODE_ENV !== "production" && I.height > fe && I.height && fe && console.error(["MUI: The popover component is too tall.", `Some part of it can not be seen on the screen (${I.height - fe}px).`, "Please consider adding a `max-height` to improve the user-experience."].join(`
2469
- `)), f !== null && oe < f) {
2470
- const B = oe - f;
2471
- oe -= B, L.horizontal += B;
2472
- } else if (He > Ke) {
2473
- const B = He - Ke;
2474
- oe -= B, L.horizontal += B;
2475
- }
2476
- return {
2477
- top: `${Math.round(ne)}px`,
2478
- left: `${Math.round(oe)}px`,
2479
- transformOrigin: st(L)
2480
- };
2481
- }, [s, c, U, k, f]), [E, M] = p.useState(b), $ = p.useCallback(() => {
2482
- const D = F.current;
2483
- if (!D)
2484
- return;
2485
- const I = h(D);
2486
- I.top !== null && D.style.setProperty("top", I.top), I.left !== null && (D.style.left = I.left), D.style.transformOrigin = I.transformOrigin, M(!0);
2487
- }, [h]);
2488
- p.useEffect(() => (R && window.addEventListener("scroll", $), () => window.removeEventListener("scroll", $)), [s, R, $]);
2489
- const _ = (D, I) => {
2490
- y && y(D, I), $();
2491
- }, K = () => {
2492
- M(!1);
2493
- };
2494
- p.useEffect(() => {
2495
- b && $();
2496
- }), p.useImperativeHandle(i, () => b ? {
2497
- updatePosition: () => {
2498
- $();
2499
- }
2500
- } : null, [b, $]), p.useEffect(() => {
2501
- if (!b)
2502
- return;
2503
- const D = Ht(() => {
2504
- $();
2505
- }), I = te(s);
2506
- return I.addEventListener("resize", D), () => {
2507
- D.clear(), I.removeEventListener("resize", D);
2508
- };
2509
- }, [s, b, $]);
2510
- let pe = m;
2511
- m === "auto" && !u.muiSupportAuto && (pe = void 0);
2512
- const ve = v || (s ? W(Re(s)).body : void 0), Z = {
2513
- slots: w,
2514
- slotProps: {
2515
- ...T,
2516
- paper: S
2517
- }
2518
- }, [H, J] = ie("paper", {
2519
- elementType: wt,
2520
- externalForwardedProps: Z,
2521
- additionalProps: {
2522
- elevation: x,
2523
- className: z(V.paper, S == null ? void 0 : S.className),
2524
- style: E ? S.style : {
2525
- ...S.style,
2526
- opacity: 0
2527
- }
2528
- },
2529
- ownerState: j
2530
- }), [de, {
2531
- slotProps: Me,
2532
- ...ke
2533
- }] = ie("root", {
2534
- elementType: Mn,
2535
- externalForwardedProps: Z,
2536
- additionalProps: {
2537
- slotProps: {
2538
- backdrop: {
2539
- invisible: !0
2540
- }
2541
- },
2542
- container: ve,
2543
- open: b
2544
- },
2545
- ownerState: j,
2546
- className: z(V.root, g)
2547
- }), De = X(F, J.ref);
2548
- return /* @__PURE__ */ A(de, {
2549
- ...ke,
2550
- ...!Dt(de) && {
2551
- slotProps: Me,
2552
- disableScrollLock: R
2553
- },
2554
- ...P,
2555
- ref: o,
2556
- children: /* @__PURE__ */ A(u, {
2557
- appear: !0,
2558
- in: b,
2559
- onEntering: _,
2560
- onExited: K,
2561
- timeout: pe,
2562
- ...O,
2563
- children: /* @__PURE__ */ A(H, {
2564
- ...J,
2565
- ref: De,
2566
- children: d
2567
- })
2568
- })
2569
- });
2570
- });
2571
- process.env.NODE_ENV !== "production" && (Ct.propTypes = {
2572
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2573
- // │ These PropTypes are generated from the TypeScript type definitions. │
2574
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
2575
- // └─────────────────────────────────────────────────────────────────────┘
2576
- /**
2577
- * A ref for imperative actions.
2578
- * It currently only supports updatePosition() action.
2579
- */
2580
- action: jt,
2581
- /**
2582
- * An HTML element, [PopoverVirtualElement](https://mui.com/material-ui/react-popover/#virtual-element),
2583
- * or a function that returns either.
2584
- * It's used to set the position of the popover.
2585
- */
2586
- anchorEl: Ce(e.oneOfType([Ee, e.func]), (t) => {
2587
- if (t.open && (!t.anchorReference || t.anchorReference === "anchorEl")) {
2588
- const n = Re(t.anchorEl);
2589
- if (n && n.nodeType === 1) {
2590
- const o = n.getBoundingClientRect();
2591
- if (process.env.NODE_ENV !== "test" && o.top === 0 && o.left === 0 && o.right === 0 && o.bottom === 0)
2592
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join(`
2593
- `));
2594
- } else
2595
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", `It should be an Element or PopoverVirtualElement instance but it's \`${n}\` instead.`].join(`
2596
- `));
2597
- }
2598
- return null;
2599
- }),
2600
- /**
2601
- * This is the point on the anchor where the popover's
2602
- * `anchorEl` will attach to. This is not used when the
2603
- * anchorReference is 'anchorPosition'.
2604
- *
2605
- * Options:
2606
- * vertical: [top, center, bottom];
2607
- * horizontal: [left, center, right].
2608
- * @default {
2609
- * vertical: 'top',
2610
- * horizontal: 'left',
2611
- * }
2612
- */
2613
- anchorOrigin: e.shape({
2614
- horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired,
2615
- vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired
2616
- }),
2617
- /**
2618
- * This is the position that may be used to set the position of the popover.
2619
- * The coordinates are relative to the application's client area.
2620
- */
2621
- anchorPosition: e.shape({
2622
- left: e.number.isRequired,
2623
- top: e.number.isRequired
2624
- }),
2625
- /**
2626
- * This determines which anchor prop to refer to when setting
2627
- * the position of the popover.
2628
- * @default 'anchorEl'
2629
- */
2630
- anchorReference: e.oneOf(["anchorEl", "anchorPosition", "none"]),
2631
- /**
2632
- * A backdrop component. This prop enables custom backdrop rendering.
2633
- * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
2634
- * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
2635
- * @default styled(Backdrop, {
2636
- * name: 'MuiModal',
2637
- * slot: 'Backdrop',
2638
- * overridesResolver: (props, styles) => {
2639
- * return styles.backdrop;
2640
- * },
2641
- * })({
2642
- * zIndex: -1,
2643
- * })
2644
- */
2645
- BackdropComponent: e.elementType,
2646
- /**
2647
- * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
2648
- * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
2649
- */
2650
- BackdropProps: e.object,
2651
- /**
2652
- * The content of the component.
2653
- */
2654
- children: e.node,
2655
- /**
2656
- * Override or extend the styles applied to the component.
2657
- */
2658
- classes: e.object,
2659
- /**
2660
- * @ignore
2661
- */
2662
- className: e.string,
2663
- /**
2664
- * An HTML element, component instance, or function that returns either.
2665
- * The `container` will passed to the Modal component.
2666
- *
2667
- * By default, it uses the body of the anchorEl's top-level document object,
2668
- * so it's simply `document.body` most of the time.
2669
- */
2670
- container: e.oneOfType([Ee, e.func]),
2671
- /**
2672
- * Disable the scroll lock behavior.
2673
- * @default false
2674
- */
2675
- disableScrollLock: e.bool,
2676
- /**
2677
- * The elevation of the popover.
2678
- * @default 8
2679
- */
2680
- elevation: ht,
2681
- /**
2682
- * Specifies how close to the edge of the window the popover can appear.
2683
- * If null, the popover will not be constrained by the window.
2684
- * @default 16
2685
- */
2686
- marginThreshold: e.number,
2687
- /**
2688
- * Callback fired when the component requests to be closed.
2689
- * The `reason` parameter can optionally be used to control the response to `onClose`.
2690
- */
2691
- onClose: e.func,
2692
- /**
2693
- * If `true`, the component is shown.
2694
- */
2695
- open: e.bool.isRequired,
2696
- /**
2697
- * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
2698
- *
2699
- * This prop is an alias for `slotProps.paper` and will be overriden by it if both are used.
2700
- * @deprecated Use `slotProps.paper` instead.
2701
- *
2702
- * @default {}
2703
- */
2704
- PaperProps: e.shape({
2705
- component: At
2706
- }),
2707
- /**
2708
- * The props used for each slot inside.
2709
- * @default {}
2710
- */
2711
- slotProps: e.shape({
2712
- paper: e.oneOfType([e.func, e.object]),
2713
- root: e.oneOfType([e.func, e.object])
2714
- }),
2715
- /**
2716
- * The components used for each slot inside.
2717
- * @default {}
2718
- */
2719
- slots: e.shape({
2720
- paper: e.elementType,
2721
- root: e.elementType
2722
- }),
2723
- /**
2724
- * The system prop that allows defining system overrides as well as additional CSS styles.
2725
- */
2726
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
2727
- /**
2728
- * This is the point on the popover which
2729
- * will attach to the anchor's origin.
2730
- *
2731
- * Options:
2732
- * vertical: [top, center, bottom, x(px)];
2733
- * horizontal: [left, center, right, x(px)].
2734
- * @default {
2735
- * vertical: 'top',
2736
- * horizontal: 'left',
2737
- * }
2738
- */
2739
- transformOrigin: e.shape({
2740
- horizontal: e.oneOfType([e.oneOf(["center", "left", "right"]), e.number]).isRequired,
2741
- vertical: e.oneOfType([e.oneOf(["bottom", "center", "top"]), e.number]).isRequired
2742
- }),
2743
- /**
2744
- * The component used for the transition.
2745
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
2746
- * @default Grow
2747
- */
2748
- TransitionComponent: e.elementType,
2749
- /**
2750
- * Set to 'auto' to automatically calculate transition time based on height.
2751
- * @default 'auto'
2752
- */
2753
- transitionDuration: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({
2754
- appear: e.number,
2755
- enter: e.number,
2756
- exit: e.number
2757
- })]),
2758
- /**
2759
- * Props applied to the transition element.
2760
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
2761
- * @default {}
2762
- */
2763
- TransitionProps: e.object
2764
- });
2765
- function kn(t) {
2766
- return le("MuiMenu", t);
2767
- }
2768
- ae("MuiMenu", ["root", "paper", "list"]);
2769
- const Dn = {
2770
- vertical: "top",
2771
- horizontal: "right"
2772
- }, In = {
2773
- vertical: "top",
2774
- horizontal: "left"
2775
- }, Ln = (t) => {
2776
- const {
2777
- classes: n
2778
- } = t;
2779
- return ue({
2780
- root: ["root"],
2781
- paper: ["paper"],
2782
- list: ["list"]
2783
- }, kn, n);
2784
- }, Fn = G(Ct, {
2785
- shouldForwardProp: (t) => kt(t) || t === "classes",
2786
- name: "MuiMenu",
2787
- slot: "Root",
2788
- overridesResolver: (t, n) => n.root
2789
- })({}), jn = G(wt, {
2790
- name: "MuiMenu",
2791
- slot: "Paper",
2792
- overridesResolver: (t, n) => n.paper
2793
- })({
2794
- // specZ: The maximum height of a simple menu should be one or more rows less than the view
2795
- // height. This ensures a tappable area outside of the simple menu with which to dismiss
2796
- // the menu.
2797
- maxHeight: "calc(100% - 96px)",
2798
- // Add iOS momentum scrolling for iOS < 13.0
2799
- WebkitOverflowScrolling: "touch"
2800
- }), An = G(Tt, {
2801
- name: "MuiMenu",
2802
- slot: "List",
2803
- overridesResolver: (t, n) => n.list
2804
- })({
2805
- // We disable the focus ring for mouse, touch and keyboard users.
2806
- outline: 0
2807
- }), $n = /* @__PURE__ */ p.forwardRef(function(n, o) {
2808
- const r = ce({
2809
- props: n,
2810
- name: "MuiMenu"
2811
- }), {
2812
- autoFocus: i = !0,
2813
- children: s,
2814
- className: a,
2815
- disableAutoFocusItem: l = !1,
2816
- MenuListProps: c = {},
2817
- onClose: d,
2818
- open: g,
2819
- PaperProps: v = {},
2820
- PopoverClasses: x,
2821
- transitionDuration: f = "auto",
2822
- TransitionProps: {
2823
- onEntering: b,
2824
- ...N
2825
- } = {},
2826
- variant: w = "selectedMenu",
2827
- slots: T = {},
2828
- slotProps: C = {},
2829
- ...u
2830
- } = r, m = Wt(), y = {
2831
- ...r,
2832
- autoFocus: i,
2833
- disableAutoFocusItem: l,
2834
- MenuListProps: c,
2835
- onEntering: b,
2836
- PaperProps: v,
2837
- transitionDuration: f,
2838
- TransitionProps: N,
2839
- variant: w
2840
- }, O = Ln(y), R = i && !l && g, P = p.useRef(null), S = (E, M) => {
2841
- P.current && P.current.adjustStyleForScrollbar(E, {
2842
- direction: m ? "rtl" : "ltr"
2843
- }), b && b(E, M);
2844
- }, F = (E) => {
2845
- E.key === "Tab" && (E.preventDefault(), d && d(E, "tabKeyDown"));
2846
- };
2847
- let j = -1;
2848
- p.Children.map(s, (E, M) => {
2849
- /* @__PURE__ */ p.isValidElement(E) && (process.env.NODE_ENV !== "production" && it.isFragment(E) && console.error(["MUI: The Menu component doesn't accept a Fragment as a child.", "Consider providing an array instead."].join(`
2850
- `)), E.props.disabled || (w === "selectedMenu" && E.props.selected || j === -1) && (j = M));
2851
- });
2852
- const V = T.paper ?? jn, U = C.paper ?? v, k = Je({
2853
- elementType: T.root,
2854
- externalSlotProps: C.root,
2855
- ownerState: y,
2856
- className: [O.root, a]
2857
- }), h = Je({
2858
- elementType: V,
2859
- externalSlotProps: U,
2860
- ownerState: y,
2861
- className: O.paper
2862
- });
2863
- return /* @__PURE__ */ A(Fn, {
2864
- onClose: d,
2865
- anchorOrigin: {
2866
- vertical: "bottom",
2867
- horizontal: m ? "right" : "left"
2868
- },
2869
- transformOrigin: m ? Dn : In,
2870
- slots: {
2871
- paper: V,
2872
- root: T.root
2873
- },
2874
- slotProps: {
2875
- root: k,
2876
- paper: h
2877
- },
2878
- open: g,
2879
- ref: o,
2880
- transitionDuration: f,
2881
- TransitionProps: {
2882
- onEntering: S,
2883
- ...N
2884
- },
2885
- ownerState: y,
2886
- ...u,
2887
- classes: x,
2888
- children: /* @__PURE__ */ A(An, {
2889
- onKeyDown: F,
2890
- actions: P,
2891
- autoFocus: i && (j === -1 || l),
2892
- autoFocusItem: R,
2893
- variant: w,
2894
- ...c,
2895
- className: z(O.list, c.className),
2896
- children: s
2897
- })
2898
- });
2899
- });
2900
- process.env.NODE_ENV !== "production" && ($n.propTypes = {
2901
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2902
- // │ These PropTypes are generated from the TypeScript type definitions. │
2903
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
2904
- // └─────────────────────────────────────────────────────────────────────┘
2905
- /**
2906
- * An HTML element, or a function that returns one.
2907
- * It's used to set the position of the menu.
2908
- */
2909
- anchorEl: e.oneOfType([Ee, e.func]),
2910
- /**
2911
- * If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
2912
- * children are not focusable. If you set this prop to `false` focus will be placed
2913
- * on the parent modal container. This has severe accessibility implications
2914
- * and should only be considered if you manage focus otherwise.
2915
- * @default true
2916
- */
2917
- autoFocus: e.bool,
2918
- /**
2919
- * Menu contents, normally `MenuItem`s.
2920
- */
2921
- children: e.node,
2922
- /**
2923
- * Override or extend the styles applied to the component.
2924
- */
2925
- classes: e.object,
2926
- /**
2927
- * @ignore
2928
- */
2929
- className: e.string,
2930
- /**
2931
- * When opening the menu will not focus the active item but the `[role="menu"]`
2932
- * unless `autoFocus` is also set to `false`. Not using the default means not
2933
- * following WAI-ARIA authoring practices. Please be considerate about possible
2934
- * accessibility implications.
2935
- * @default false
2936
- */
2937
- disableAutoFocusItem: e.bool,
2938
- /**
2939
- * Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
2940
- * @default {}
2941
- */
2942
- MenuListProps: e.object,
2943
- /**
2944
- * Callback fired when the component requests to be closed.
2945
- *
2946
- * @param {object} event The event source of the callback.
2947
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`, `"tabKeyDown"`.
2948
- */
2949
- onClose: e.func,
2950
- /**
2951
- * If `true`, the component is shown.
2952
- */
2953
- open: e.bool.isRequired,
2954
- /**
2955
- * @ignore
2956
- */
2957
- PaperProps: e.object,
2958
- /**
2959
- * `classes` prop applied to the [`Popover`](https://mui.com/material-ui/api/popover/) element.
2960
- */
2961
- PopoverClasses: e.object,
2962
- /**
2963
- * The props used for each slot inside.
2964
- * @default {}
2965
- */
2966
- slotProps: e.shape({
2967
- paper: e.oneOfType([e.func, e.object]),
2968
- root: e.oneOfType([e.func, e.object])
2969
- }),
2970
- /**
2971
- * The components used for each slot inside.
2972
- * @default {}
2973
- */
2974
- slots: e.shape({
2975
- paper: e.elementType,
2976
- root: e.elementType
2977
- }),
2978
- /**
2979
- * The system prop that allows defining system overrides as well as additional CSS styles.
2980
- */
2981
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
2982
- /**
2983
- * The length of the transition in `ms`, or 'auto'
2984
- * @default 'auto'
2985
- */
2986
- transitionDuration: e.oneOfType([e.oneOf(["auto"]), e.number, e.shape({
2987
- appear: e.number,
2988
- enter: e.number,
2989
- exit: e.number
2990
- })]),
2991
- /**
2992
- * Props applied to the transition element.
2993
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
2994
- * @default {}
2995
- */
2996
- TransitionProps: e.object,
2997
- /**
2998
- * The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
2999
- * @default 'selectedMenu'
3000
- */
3001
- variant: e.oneOf(["menu", "selectedMenu"])
3002
- });
3003
- export {
3004
- Ee as H,
3005
- vt as L,
3006
- $n as M,
3007
- Ot as P,
3008
- Y as T,
3009
- Se as a,
3010
- Nt as b,
3011
- Wt as c,
3012
- Ht as d,
3013
- ge as e,
3014
- W as f,
3015
- Pe as g,
3016
- ie as h,
3017
- ht as i,
3018
- te as o,
3019
- xt as r,
3020
- Ue as u
3021
- };