@notificationapi/react 1.4.1 → 1.5.0

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 (44) hide show
  1. package/dist/assets/Badge.js +1 -1
  2. package/dist/assets/Box.js +13 -13
  3. package/dist/assets/Button.js +781 -0
  4. package/dist/assets/ButtonBase.js +409 -622
  5. package/dist/assets/DefaultPropsProvider.js +220 -215
  6. package/dist/assets/Divider.js +105 -154
  7. package/dist/assets/Grow.js +201 -0
  8. package/dist/assets/IconButton.js +1 -1
  9. package/dist/assets/List.js +142 -0
  10. package/dist/assets/Modal.js +1094 -0
  11. package/dist/assets/Notification.js +71 -71
  12. package/dist/assets/Paper.js +1 -1
  13. package/dist/assets/Popover.js +8 -6
  14. package/dist/assets/Portal.js +2 -2
  15. package/dist/assets/Stack.js +216 -0
  16. package/dist/assets/Typography.js +193 -117
  17. package/dist/assets/WebPushOptInMessage.js +40 -814
  18. package/dist/assets/createSvgIcon.js +5 -5
  19. package/dist/assets/dividerClasses.js +56 -0
  20. package/dist/assets/index.js +151 -0
  21. package/dist/assets/useTheme2.js +253 -11
  22. package/dist/assets/utils.js +4 -4
  23. package/dist/components/Notifications/Inbox.js +2927 -9
  24. package/dist/components/Notifications/InboxHeader.js +2146 -7
  25. package/dist/components/Notifications/NotificationFeed.js +13 -13
  26. package/dist/components/Notifications/NotificationLauncher.js +2 -2
  27. package/dist/components/Notifications/NotificationPopup.js +7 -7
  28. package/dist/components/Preferences/NotificationPreferencesPopup.js +608 -7
  29. package/dist/components/Preferences/PreferenceInput.js +1451 -6
  30. package/dist/components/Preferences/Preferences.js +368 -515
  31. package/dist/components/Preferences/index.js +1 -1
  32. package/dist/components/Provider/index.js +226 -202
  33. package/dist/components/Slack/SlackConnect.d.ts +12 -0
  34. package/dist/components/Slack/SlackConnect.js +4826 -0
  35. package/dist/components/Slack/index.d.ts +1 -0
  36. package/dist/components/Slack/index.js +4 -0
  37. package/dist/components/WebPush/WebPushOptInMessage.js +3 -2
  38. package/dist/main.d.ts +1 -0
  39. package/dist/main.js +5 -3
  40. package/package.json +4 -4
  41. package/dist/assets/Inbox.js +0 -3061
  42. package/dist/assets/InboxHeader.js +0 -2338
  43. package/dist/assets/NotificationPreferencesPopup.js +0 -1694
  44. package/dist/assets/PreferenceInput.js +0 -1657
@@ -0,0 +1,1094 @@
1
+ import * as f from "react";
2
+ import { P as e, g as le, e as de, s as J, u as ue, c as X, b as fe, m as ke } from "./DefaultPropsProvider.js";
3
+ import { o as j, e as Q, g as pe, a as Pe, P as Ne, H as Ce } from "./Portal.js";
4
+ import { u as Y, e as Se } from "./resolveComponentProps.js";
5
+ import { a as H, d as oe } from "./ButtonBase.js";
6
+ import { c as re } from "./Stack.js";
7
+ import { jsx as A, jsxs as be } from "react/jsx-runtime";
8
+ import { u as we } from "./useTheme.js";
9
+ import { T as Ie, r as Oe, g as se } from "./utils.js";
10
+ function _(t) {
11
+ return j(t).defaultView || window;
12
+ }
13
+ function Fe(t = window) {
14
+ const n = t.document.documentElement.clientWidth;
15
+ return t.innerWidth - n;
16
+ }
17
+ const Me = {
18
+ entering: {
19
+ opacity: 1
20
+ },
21
+ entered: {
22
+ opacity: 1
23
+ }
24
+ }, me = /* @__PURE__ */ f.forwardRef(function(n, r) {
25
+ const o = we(), i = {
26
+ enter: o.transitions.duration.enteringScreen,
27
+ exit: o.transitions.duration.leavingScreen
28
+ }, {
29
+ addEndListener: s,
30
+ appear: a = !0,
31
+ children: c,
32
+ easing: p,
33
+ in: y,
34
+ onEnter: P,
35
+ onEntered: g,
36
+ onEntering: v,
37
+ onExit: h,
38
+ onExited: b,
39
+ onExiting: I,
40
+ style: T,
41
+ timeout: k = i,
42
+ // eslint-disable-next-line react/prop-types
43
+ TransitionComponent: N = Ie,
44
+ ...l
45
+ } = n, m = f.useRef(null), C = Y(m, pe(c), r), x = (E) => (d) => {
46
+ if (E) {
47
+ const u = m.current;
48
+ d === void 0 ? E(u) : E(u, d);
49
+ }
50
+ }, R = x(v), S = x((E, d) => {
51
+ Oe(E);
52
+ const u = se({
53
+ style: T,
54
+ timeout: k,
55
+ easing: p
56
+ }, {
57
+ mode: "enter"
58
+ });
59
+ E.style.webkitTransition = o.transitions.create("opacity", u), E.style.transition = o.transitions.create("opacity", u), P && P(E, d);
60
+ }), w = x(g), F = x(I), D = x((E) => {
61
+ const d = se({
62
+ style: T,
63
+ timeout: k,
64
+ easing: p
65
+ }, {
66
+ mode: "exit"
67
+ });
68
+ E.style.webkitTransition = o.transitions.create("opacity", d), E.style.transition = o.transitions.create("opacity", d), h && h(E);
69
+ }), B = x(b);
70
+ return /* @__PURE__ */ A(N, {
71
+ appear: a,
72
+ in: y,
73
+ nodeRef: m,
74
+ onEnter: S,
75
+ onEntered: w,
76
+ onEntering: R,
77
+ onExit: D,
78
+ onExited: B,
79
+ onExiting: F,
80
+ addEndListener: (E) => {
81
+ s && s(m.current, E);
82
+ },
83
+ timeout: k,
84
+ ...l,
85
+ children: (E, {
86
+ ownerState: d,
87
+ ...u
88
+ }) => /* @__PURE__ */ f.cloneElement(c, {
89
+ style: {
90
+ opacity: 0,
91
+ visibility: E === "exited" && !y ? "hidden" : void 0,
92
+ ...Me[E],
93
+ ...T,
94
+ ...c.props.style
95
+ },
96
+ ref: C,
97
+ ...u
98
+ })
99
+ });
100
+ });
101
+ process.env.NODE_ENV !== "production" && (me.propTypes = {
102
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
103
+ // │ These PropTypes are generated from the TypeScript type definitions. │
104
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
105
+ // └─────────────────────────────────────────────────────────────────────┘
106
+ /**
107
+ * Add a custom transition end trigger. Called with the transitioning DOM
108
+ * node and a done callback. Allows for more fine grained transition end
109
+ * logic. Note: Timeouts are still used as a fallback if provided.
110
+ */
111
+ addEndListener: e.func,
112
+ /**
113
+ * Perform the enter transition when it first mounts if `in` is also `true`.
114
+ * Set this to `false` to disable this behavior.
115
+ * @default true
116
+ */
117
+ appear: e.bool,
118
+ /**
119
+ * A single child content element.
120
+ */
121
+ children: Q.isRequired,
122
+ /**
123
+ * The transition timing function.
124
+ * You may specify a single easing or a object containing enter and exit values.
125
+ */
126
+ easing: e.oneOfType([e.shape({
127
+ enter: e.string,
128
+ exit: e.string
129
+ }), e.string]),
130
+ /**
131
+ * If `true`, the component will transition in.
132
+ */
133
+ in: e.bool,
134
+ /**
135
+ * @ignore
136
+ */
137
+ onEnter: e.func,
138
+ /**
139
+ * @ignore
140
+ */
141
+ onEntered: e.func,
142
+ /**
143
+ * @ignore
144
+ */
145
+ onEntering: e.func,
146
+ /**
147
+ * @ignore
148
+ */
149
+ onExit: e.func,
150
+ /**
151
+ * @ignore
152
+ */
153
+ onExited: e.func,
154
+ /**
155
+ * @ignore
156
+ */
157
+ onExiting: e.func,
158
+ /**
159
+ * @ignore
160
+ */
161
+ style: e.object,
162
+ /**
163
+ * The duration for the transition, in milliseconds.
164
+ * You may specify a single timeout for all transitions, or individually with an object.
165
+ * @default {
166
+ * enter: theme.transitions.duration.enteringScreen,
167
+ * exit: theme.transitions.duration.leavingScreen,
168
+ * }
169
+ */
170
+ timeout: e.oneOfType([e.number, e.shape({
171
+ appear: e.number,
172
+ enter: e.number,
173
+ exit: e.number
174
+ })])
175
+ });
176
+ function Ae(t) {
177
+ return de("MuiBackdrop", t);
178
+ }
179
+ le("MuiBackdrop", ["root", "invisible"]);
180
+ const De = (t) => {
181
+ const {
182
+ classes: n,
183
+ invisible: r
184
+ } = t;
185
+ return fe({
186
+ root: ["root", r && "invisible"]
187
+ }, Ae, n);
188
+ }, Be = J("div", {
189
+ name: "MuiBackdrop",
190
+ slot: "Root",
191
+ overridesResolver: (t, n) => {
192
+ const {
193
+ ownerState: r
194
+ } = t;
195
+ return [n.root, r.invisible && n.invisible];
196
+ }
197
+ })({
198
+ position: "fixed",
199
+ display: "flex",
200
+ alignItems: "center",
201
+ justifyContent: "center",
202
+ right: 0,
203
+ bottom: 0,
204
+ top: 0,
205
+ left: 0,
206
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
207
+ WebkitTapHighlightColor: "transparent",
208
+ variants: [{
209
+ props: {
210
+ invisible: !0
211
+ },
212
+ style: {
213
+ backgroundColor: "transparent"
214
+ }
215
+ }]
216
+ }), he = /* @__PURE__ */ f.forwardRef(function(n, r) {
217
+ const o = ue({
218
+ props: n,
219
+ name: "MuiBackdrop"
220
+ }), {
221
+ children: i,
222
+ className: s,
223
+ component: a = "div",
224
+ invisible: c = !1,
225
+ open: p,
226
+ components: y = {},
227
+ componentsProps: P = {},
228
+ slotProps: g = {},
229
+ slots: v = {},
230
+ TransitionComponent: h,
231
+ transitionDuration: b,
232
+ ...I
233
+ } = o, T = {
234
+ ...o,
235
+ component: a,
236
+ invisible: c
237
+ }, k = De(T), N = {
238
+ transition: h,
239
+ root: y.Root,
240
+ ...v
241
+ }, l = {
242
+ ...P,
243
+ ...g
244
+ }, m = {
245
+ slots: N,
246
+ slotProps: l
247
+ }, [C, x] = H("root", {
248
+ elementType: Be,
249
+ externalForwardedProps: m,
250
+ className: X(k.root, s),
251
+ ownerState: T
252
+ }), [R, S] = H("transition", {
253
+ elementType: me,
254
+ externalForwardedProps: m,
255
+ ownerState: T
256
+ });
257
+ return /* @__PURE__ */ A(R, {
258
+ in: p,
259
+ timeout: b,
260
+ ...I,
261
+ ...S,
262
+ children: /* @__PURE__ */ A(C, {
263
+ "aria-hidden": !0,
264
+ ...x,
265
+ classes: k,
266
+ ref: r,
267
+ children: i
268
+ })
269
+ });
270
+ });
271
+ process.env.NODE_ENV !== "production" && (he.propTypes = {
272
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
273
+ // │ These PropTypes are generated from the TypeScript type definitions. │
274
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
275
+ // └─────────────────────────────────────────────────────────────────────┘
276
+ /**
277
+ * The content of the component.
278
+ */
279
+ children: e.node,
280
+ /**
281
+ * Override or extend the styles applied to the component.
282
+ */
283
+ classes: e.object,
284
+ /**
285
+ * @ignore
286
+ */
287
+ className: e.string,
288
+ /**
289
+ * The component used for the root node.
290
+ * Either a string to use a HTML element or a component.
291
+ */
292
+ component: e.elementType,
293
+ /**
294
+ * The components used for each slot inside.
295
+ *
296
+ * @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.
297
+ *
298
+ * @default {}
299
+ */
300
+ components: e.shape({
301
+ Root: e.elementType
302
+ }),
303
+ /**
304
+ * The extra props for the slot components.
305
+ * You can override the existing props or add new ones.
306
+ *
307
+ * @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.
308
+ *
309
+ * @default {}
310
+ */
311
+ componentsProps: e.shape({
312
+ root: e.object
313
+ }),
314
+ /**
315
+ * If `true`, the backdrop is invisible.
316
+ * It can be used when rendering a popover or a custom select component.
317
+ * @default false
318
+ */
319
+ invisible: e.bool,
320
+ /**
321
+ * If `true`, the component is shown.
322
+ */
323
+ open: e.bool.isRequired,
324
+ /**
325
+ * The props used for each slot inside.
326
+ * @default {}
327
+ */
328
+ slotProps: e.shape({
329
+ root: e.oneOfType([e.func, e.object]),
330
+ transition: e.oneOfType([e.func, e.object])
331
+ }),
332
+ /**
333
+ * The components used for each slot inside.
334
+ * @default {}
335
+ */
336
+ slots: e.shape({
337
+ root: e.elementType,
338
+ transition: e.elementType
339
+ }),
340
+ /**
341
+ * The system prop that allows defining system overrides as well as additional CSS styles.
342
+ */
343
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
344
+ /**
345
+ * The component used for the transition.
346
+ * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
347
+ * @default Fade
348
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
349
+ */
350
+ TransitionComponent: e.elementType,
351
+ /**
352
+ * The duration for the transition, in milliseconds.
353
+ * You may specify a single timeout for all transitions, or individually with an object.
354
+ */
355
+ transitionDuration: e.oneOfType([e.number, e.shape({
356
+ appear: e.number,
357
+ enter: e.number,
358
+ exit: e.number
359
+ })])
360
+ });
361
+ function Le(t) {
362
+ const n = j(t);
363
+ return n.body === t ? _(t).innerWidth > n.documentElement.clientWidth : t.scrollHeight > t.clientHeight;
364
+ }
365
+ function W(t, n) {
366
+ n ? t.setAttribute("aria-hidden", "true") : t.removeAttribute("aria-hidden");
367
+ }
368
+ function ie(t) {
369
+ return parseInt(_(t).getComputedStyle(t).paddingRight, 10) || 0;
370
+ }
371
+ function je(t) {
372
+ const r = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].includes(t.tagName), o = t.tagName === "INPUT" && t.getAttribute("type") === "hidden";
373
+ return r || o;
374
+ }
375
+ function ae(t, n, r, o, i) {
376
+ const s = [n, r, ...o];
377
+ [].forEach.call(t.children, (a) => {
378
+ const c = !s.includes(a), p = !je(a);
379
+ c && p && W(a, i);
380
+ });
381
+ }
382
+ function G(t, n) {
383
+ let r = -1;
384
+ return t.some((o, i) => n(o) ? (r = i, !0) : !1), r;
385
+ }
386
+ function Ue(t, n) {
387
+ const r = [], o = t.container;
388
+ if (!n.disableScrollLock) {
389
+ if (Le(o)) {
390
+ const a = Fe(_(o));
391
+ r.push({
392
+ value: o.style.paddingRight,
393
+ property: "padding-right",
394
+ el: o
395
+ }), o.style.paddingRight = `${ie(o) + a}px`;
396
+ const c = j(o).querySelectorAll(".mui-fixed");
397
+ [].forEach.call(c, (p) => {
398
+ r.push({
399
+ value: p.style.paddingRight,
400
+ property: "padding-right",
401
+ el: p
402
+ }), p.style.paddingRight = `${ie(p) + a}px`;
403
+ });
404
+ }
405
+ let s;
406
+ if (o.parentNode instanceof DocumentFragment)
407
+ s = j(o).body;
408
+ else {
409
+ const a = o.parentElement, c = _(o);
410
+ s = (a == null ? void 0 : a.nodeName) === "HTML" && c.getComputedStyle(a).overflowY === "scroll" ? a : o;
411
+ }
412
+ r.push({
413
+ value: s.style.overflow,
414
+ property: "overflow",
415
+ el: s
416
+ }, {
417
+ value: s.style.overflowX,
418
+ property: "overflow-x",
419
+ el: s
420
+ }, {
421
+ value: s.style.overflowY,
422
+ property: "overflow-y",
423
+ el: s
424
+ }), s.style.overflow = "hidden";
425
+ }
426
+ return () => {
427
+ r.forEach(({
428
+ value: s,
429
+ el: a,
430
+ property: c
431
+ }) => {
432
+ s ? a.style.setProperty(c, s) : a.style.removeProperty(c);
433
+ });
434
+ };
435
+ }
436
+ function Ke(t) {
437
+ const n = [];
438
+ return [].forEach.call(t.children, (r) => {
439
+ r.getAttribute("aria-hidden") === "true" && n.push(r);
440
+ }), n;
441
+ }
442
+ class We {
443
+ constructor() {
444
+ this.modals = [], this.containers = [];
445
+ }
446
+ add(n, r) {
447
+ let o = this.modals.indexOf(n);
448
+ if (o !== -1)
449
+ return o;
450
+ o = this.modals.length, this.modals.push(n), n.modalRef && W(n.modalRef, !1);
451
+ const i = Ke(r);
452
+ ae(r, n.mount, n.modalRef, i, !0);
453
+ const s = G(this.containers, (a) => a.container === r);
454
+ return s !== -1 ? (this.containers[s].modals.push(n), o) : (this.containers.push({
455
+ modals: [n],
456
+ container: r,
457
+ restore: null,
458
+ hiddenSiblings: i
459
+ }), o);
460
+ }
461
+ mount(n, r) {
462
+ const o = G(this.containers, (s) => s.modals.includes(n)), i = this.containers[o];
463
+ i.restore || (i.restore = Ue(i, r));
464
+ }
465
+ remove(n, r = !0) {
466
+ const o = this.modals.indexOf(n);
467
+ if (o === -1)
468
+ return o;
469
+ const i = G(this.containers, (a) => a.modals.includes(n)), s = this.containers[i];
470
+ if (s.modals.splice(s.modals.indexOf(n), 1), this.modals.splice(o, 1), s.modals.length === 0)
471
+ s.restore && s.restore(), n.modalRef && W(n.modalRef, r), ae(s.container, n.mount, n.modalRef, s.hiddenSiblings, !1), this.containers.splice(i, 1);
472
+ else {
473
+ const a = s.modals[s.modals.length - 1];
474
+ a.modalRef && W(a.modalRef, !1);
475
+ }
476
+ return o;
477
+ }
478
+ isTopModal(n) {
479
+ return this.modals.length > 0 && this.modals[this.modals.length - 1] === n;
480
+ }
481
+ }
482
+ const qe = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
483
+ function Ve(t) {
484
+ const n = parseInt(t.getAttribute("tabindex") || "", 10);
485
+ return Number.isNaN(n) ? t.contentEditable === "true" || (t.nodeName === "AUDIO" || t.nodeName === "VIDEO" || t.nodeName === "DETAILS") && t.getAttribute("tabindex") === null ? 0 : t.tabIndex : n;
486
+ }
487
+ function ze(t) {
488
+ if (t.tagName !== "INPUT" || t.type !== "radio" || !t.name)
489
+ return !1;
490
+ const n = (o) => t.ownerDocument.querySelector(`input[type="radio"]${o}`);
491
+ let r = n(`[name="${t.name}"]:checked`);
492
+ return r || (r = n(`[name="${t.name}"]`)), r !== t;
493
+ }
494
+ function He(t) {
495
+ return !(t.disabled || t.tagName === "INPUT" && t.type === "hidden" || ze(t));
496
+ }
497
+ function _e(t) {
498
+ const n = [], r = [];
499
+ return Array.from(t.querySelectorAll(qe)).forEach((o, i) => {
500
+ const s = Ve(o);
501
+ s === -1 || !He(o) || (s === 0 ? n.push(o) : r.push({
502
+ documentOrder: i,
503
+ tabIndex: s,
504
+ node: o
505
+ }));
506
+ }), r.sort((o, i) => o.tabIndex === i.tabIndex ? o.documentOrder - i.documentOrder : o.tabIndex - i.tabIndex).map((o) => o.node).concat(n);
507
+ }
508
+ function $e() {
509
+ return !0;
510
+ }
511
+ function $(t) {
512
+ const {
513
+ children: n,
514
+ disableAutoFocus: r = !1,
515
+ disableEnforceFocus: o = !1,
516
+ disableRestoreFocus: i = !1,
517
+ getTabbable: s = _e,
518
+ isEnabled: a = $e,
519
+ open: c
520
+ } = t, p = f.useRef(!1), y = f.useRef(null), P = f.useRef(null), g = f.useRef(null), v = f.useRef(null), h = f.useRef(!1), b = f.useRef(null), I = Y(pe(n), b), T = f.useRef(null);
521
+ f.useEffect(() => {
522
+ !c || !b.current || (h.current = !r);
523
+ }, [r, c]), f.useEffect(() => {
524
+ if (!c || !b.current)
525
+ return;
526
+ const l = j(b.current);
527
+ return b.current.contains(l.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(`
528
+ `)), b.current.setAttribute("tabIndex", "-1")), h.current && b.current.focus()), () => {
529
+ i || (g.current && g.current.focus && (p.current = !0, g.current.focus()), g.current = null);
530
+ };
531
+ }, [c]), f.useEffect(() => {
532
+ if (!c || !b.current)
533
+ return;
534
+ const l = j(b.current), m = (R) => {
535
+ T.current = R, !(o || !a() || R.key !== "Tab") && l.activeElement === b.current && R.shiftKey && (p.current = !0, P.current && P.current.focus());
536
+ }, C = () => {
537
+ var w, F;
538
+ const R = b.current;
539
+ if (R === null)
540
+ return;
541
+ if (!l.hasFocus() || !a() || p.current) {
542
+ p.current = !1;
543
+ return;
544
+ }
545
+ if (R.contains(l.activeElement) || o && l.activeElement !== y.current && l.activeElement !== P.current)
546
+ return;
547
+ if (l.activeElement !== v.current)
548
+ v.current = null;
549
+ else if (v.current !== null)
550
+ return;
551
+ if (!h.current)
552
+ return;
553
+ let S = [];
554
+ if ((l.activeElement === y.current || l.activeElement === P.current) && (S = s(b.current)), S.length > 0) {
555
+ const D = !!((w = T.current) != null && w.shiftKey && ((F = T.current) == null ? void 0 : F.key) === "Tab"), B = S[0], U = S[S.length - 1];
556
+ typeof B != "string" && typeof U != "string" && (D ? U.focus() : B.focus());
557
+ } else
558
+ R.focus();
559
+ };
560
+ l.addEventListener("focusin", C), l.addEventListener("keydown", m, !0);
561
+ const x = setInterval(() => {
562
+ l.activeElement && l.activeElement.tagName === "BODY" && C();
563
+ }, 50);
564
+ return () => {
565
+ clearInterval(x), l.removeEventListener("focusin", C), l.removeEventListener("keydown", m, !0);
566
+ };
567
+ }, [r, o, i, a, c, s]);
568
+ const k = (l) => {
569
+ g.current === null && (g.current = l.relatedTarget), h.current = !0, v.current = l.target;
570
+ const m = n.props.onFocus;
571
+ m && m(l);
572
+ }, N = (l) => {
573
+ g.current === null && (g.current = l.relatedTarget), h.current = !0;
574
+ };
575
+ return /* @__PURE__ */ be(f.Fragment, {
576
+ children: [/* @__PURE__ */ A("div", {
577
+ tabIndex: c ? 0 : -1,
578
+ onFocus: N,
579
+ ref: y,
580
+ "data-testid": "sentinelStart"
581
+ }), /* @__PURE__ */ f.cloneElement(n, {
582
+ ref: I,
583
+ onFocus: k
584
+ }), /* @__PURE__ */ A("div", {
585
+ tabIndex: c ? 0 : -1,
586
+ onFocus: N,
587
+ ref: P,
588
+ "data-testid": "sentinelEnd"
589
+ })]
590
+ });
591
+ }
592
+ process.env.NODE_ENV !== "production" && ($.propTypes = {
593
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
594
+ // │ These PropTypes are generated from the TypeScript type definitions. │
595
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
596
+ // └─────────────────────────────────────────────────────────────────────┘
597
+ /**
598
+ * A single child content element.
599
+ */
600
+ children: Q,
601
+ /**
602
+ * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
603
+ * replace it to the last focused element when it closes.
604
+ * This also works correctly with any focus trap children that have the `disableAutoFocus` prop.
605
+ *
606
+ * Generally this should never be set to `true` as it makes the focus trap less
607
+ * accessible to assistive technologies, like screen readers.
608
+ * @default false
609
+ */
610
+ disableAutoFocus: e.bool,
611
+ /**
612
+ * If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
613
+ *
614
+ * Generally this should never be set to `true` as it makes the focus trap less
615
+ * accessible to assistive technologies, like screen readers.
616
+ * @default false
617
+ */
618
+ disableEnforceFocus: e.bool,
619
+ /**
620
+ * If `true`, the focus trap will not restore focus to previously focused element once
621
+ * focus trap is hidden or unmounted.
622
+ * @default false
623
+ */
624
+ disableRestoreFocus: e.bool,
625
+ /**
626
+ * Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
627
+ * For instance, you can provide the "tabbable" npm dependency.
628
+ * @param {HTMLElement} root
629
+ */
630
+ getTabbable: e.func,
631
+ /**
632
+ * This prop extends the `open` prop.
633
+ * It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
634
+ * This prop should be memoized.
635
+ * It can be used to support multiple focus trap mounted at the same time.
636
+ * @default function defaultIsEnabled(): boolean {
637
+ * return true;
638
+ * }
639
+ */
640
+ isEnabled: e.func,
641
+ /**
642
+ * If `true`, focus is locked.
643
+ */
644
+ open: e.bool.isRequired
645
+ });
646
+ process.env.NODE_ENV !== "production" && ($.propTypes = Pe($.propTypes));
647
+ function Ye(t) {
648
+ return typeof t == "function" ? t() : t;
649
+ }
650
+ function Ge(t) {
651
+ return t ? t.props.hasOwnProperty("in") : !1;
652
+ }
653
+ const ce = () => {
654
+ }, z = new We();
655
+ function Xe(t) {
656
+ const {
657
+ container: n,
658
+ disableEscapeKeyDown: r = !1,
659
+ disableScrollLock: o = !1,
660
+ closeAfterTransition: i = !1,
661
+ onTransitionEnter: s,
662
+ onTransitionExited: a,
663
+ children: c,
664
+ onClose: p,
665
+ open: y,
666
+ rootRef: P
667
+ } = t, g = f.useRef({}), v = f.useRef(null), h = f.useRef(null), b = Y(h, P), [I, T] = f.useState(!y), k = Ge(c);
668
+ let N = !0;
669
+ (t["aria-hidden"] === "false" || t["aria-hidden"] === !1) && (N = !1);
670
+ const l = () => j(v.current), m = () => (g.current.modalRef = h.current, g.current.mount = v.current, g.current), C = () => {
671
+ z.mount(m(), {
672
+ disableScrollLock: o
673
+ }), h.current && (h.current.scrollTop = 0);
674
+ }, x = oe(() => {
675
+ const d = Ye(n) || l().body;
676
+ z.add(m(), d), h.current && C();
677
+ }), R = () => z.isTopModal(m()), S = oe((d) => {
678
+ v.current = d, d && (y && R() ? C() : h.current && W(h.current, N));
679
+ }), w = f.useCallback(() => {
680
+ z.remove(m(), N);
681
+ }, [N]);
682
+ f.useEffect(() => () => {
683
+ w();
684
+ }, [w]), f.useEffect(() => {
685
+ y ? x() : (!k || !i) && w();
686
+ }, [y, w, k, i, x]);
687
+ const F = (d) => (u) => {
688
+ var O;
689
+ (O = d.onKeyDown) == null || O.call(d, u), !(u.key !== "Escape" || u.which === 229 || // Wait until IME is settled.
690
+ !R()) && (r || (u.stopPropagation(), p && p(u, "escapeKeyDown")));
691
+ }, D = (d) => (u) => {
692
+ var O;
693
+ (O = d.onClick) == null || O.call(d, u), u.target === u.currentTarget && p && p(u, "backdropClick");
694
+ };
695
+ return {
696
+ getRootProps: (d = {}) => {
697
+ const u = Se(t);
698
+ delete u.onTransitionEnter, delete u.onTransitionExited;
699
+ const O = {
700
+ ...u,
701
+ ...d
702
+ };
703
+ return {
704
+ /*
705
+ * Marking an element with the role presentation indicates to assistive technology
706
+ * that this element should be ignored; it exists to support the web application and
707
+ * is not meant for humans to interact with directly.
708
+ * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
709
+ */
710
+ role: "presentation",
711
+ ...O,
712
+ onKeyDown: F(O),
713
+ ref: b
714
+ };
715
+ },
716
+ getBackdropProps: (d = {}) => {
717
+ const u = d;
718
+ return {
719
+ "aria-hidden": !0,
720
+ ...u,
721
+ onClick: D(u),
722
+ open: y
723
+ };
724
+ },
725
+ getTransitionProps: () => {
726
+ const d = () => {
727
+ T(!1), s && s();
728
+ }, u = () => {
729
+ T(!0), a && a(), i && w();
730
+ };
731
+ return {
732
+ onEnter: re(d, (c == null ? void 0 : c.props.onEnter) ?? ce),
733
+ onExited: re(u, (c == null ? void 0 : c.props.onExited) ?? ce)
734
+ };
735
+ },
736
+ rootRef: b,
737
+ portalRef: S,
738
+ isTopModal: R,
739
+ exited: I,
740
+ hasTransition: k
741
+ };
742
+ }
743
+ function Je(t) {
744
+ return de("MuiModal", t);
745
+ }
746
+ le("MuiModal", ["root", "hidden", "backdrop"]);
747
+ const Qe = (t) => {
748
+ const {
749
+ open: n,
750
+ exited: r,
751
+ classes: o
752
+ } = t;
753
+ return fe({
754
+ root: ["root", !n && r && "hidden"],
755
+ backdrop: ["backdrop"]
756
+ }, Je, o);
757
+ }, Ze = J("div", {
758
+ name: "MuiModal",
759
+ slot: "Root",
760
+ overridesResolver: (t, n) => {
761
+ const {
762
+ ownerState: r
763
+ } = t;
764
+ return [n.root, !r.open && r.exited && n.hidden];
765
+ }
766
+ })(ke(({
767
+ theme: t
768
+ }) => ({
769
+ position: "fixed",
770
+ zIndex: (t.vars || t).zIndex.modal,
771
+ right: 0,
772
+ bottom: 0,
773
+ top: 0,
774
+ left: 0,
775
+ variants: [{
776
+ props: ({
777
+ ownerState: n
778
+ }) => !n.open && n.exited,
779
+ style: {
780
+ visibility: "hidden"
781
+ }
782
+ }]
783
+ }))), et = J(he, {
784
+ name: "MuiModal",
785
+ slot: "Backdrop",
786
+ overridesResolver: (t, n) => n.backdrop
787
+ })({
788
+ zIndex: -1
789
+ }), tt = /* @__PURE__ */ f.forwardRef(function(n, r) {
790
+ const o = ue({
791
+ name: "MuiModal",
792
+ props: n
793
+ }), {
794
+ BackdropComponent: i = et,
795
+ BackdropProps: s,
796
+ classes: a,
797
+ className: c,
798
+ closeAfterTransition: p = !1,
799
+ children: y,
800
+ container: P,
801
+ component: g,
802
+ components: v = {},
803
+ componentsProps: h = {},
804
+ disableAutoFocus: b = !1,
805
+ disableEnforceFocus: I = !1,
806
+ disableEscapeKeyDown: T = !1,
807
+ disablePortal: k = !1,
808
+ disableRestoreFocus: N = !1,
809
+ disableScrollLock: l = !1,
810
+ hideBackdrop: m = !1,
811
+ keepMounted: C = !1,
812
+ onBackdropClick: x,
813
+ onClose: R,
814
+ onTransitionEnter: S,
815
+ onTransitionExited: w,
816
+ open: F,
817
+ slotProps: D = {},
818
+ slots: B = {},
819
+ // eslint-disable-next-line react/prop-types
820
+ theme: U,
821
+ ...E
822
+ } = o, d = {
823
+ ...o,
824
+ closeAfterTransition: p,
825
+ disableAutoFocus: b,
826
+ disableEnforceFocus: I,
827
+ disableEscapeKeyDown: T,
828
+ disablePortal: k,
829
+ disableRestoreFocus: N,
830
+ disableScrollLock: l,
831
+ hideBackdrop: m,
832
+ keepMounted: C
833
+ }, {
834
+ getRootProps: u,
835
+ getBackdropProps: O,
836
+ getTransitionProps: Ee,
837
+ portalRef: ge,
838
+ isTopModal: ye,
839
+ exited: Z,
840
+ hasTransition: ee
841
+ } = Xe({
842
+ ...d,
843
+ rootRef: r
844
+ }), K = {
845
+ ...d,
846
+ exited: Z
847
+ }, M = Qe(K), q = {};
848
+ if (y.props.tabIndex === void 0 && (q.tabIndex = "-1"), ee) {
849
+ const {
850
+ onEnter: L,
851
+ onExited: V
852
+ } = Ee();
853
+ q.onEnter = L, q.onExited = V;
854
+ }
855
+ const te = {
856
+ ...E,
857
+ slots: {
858
+ root: v.Root,
859
+ backdrop: v.Backdrop,
860
+ ...B
861
+ },
862
+ slotProps: {
863
+ ...h,
864
+ ...D
865
+ }
866
+ }, [Te, xe] = H("root", {
867
+ elementType: Ze,
868
+ externalForwardedProps: te,
869
+ getSlotProps: u,
870
+ additionalProps: {
871
+ ref: r,
872
+ as: g
873
+ },
874
+ ownerState: K,
875
+ className: X(c, M == null ? void 0 : M.root, !K.open && K.exited && (M == null ? void 0 : M.hidden))
876
+ }), [Re, ne] = H("backdrop", {
877
+ elementType: i,
878
+ externalForwardedProps: te,
879
+ additionalProps: s,
880
+ getSlotProps: (L) => O({
881
+ ...L,
882
+ onClick: (V) => {
883
+ x && x(V), L != null && L.onClick && L.onClick(V);
884
+ }
885
+ }),
886
+ className: X(s == null ? void 0 : s.className, M == null ? void 0 : M.backdrop),
887
+ ownerState: K
888
+ }), ve = Y(s == null ? void 0 : s.ref, ne.ref);
889
+ return !C && !F && (!ee || Z) ? null : /* @__PURE__ */ A(Ne, {
890
+ ref: ge,
891
+ container: P,
892
+ disablePortal: k,
893
+ children: /* @__PURE__ */ be(Te, {
894
+ ...xe,
895
+ children: [!m && i ? /* @__PURE__ */ A(Re, {
896
+ ...ne,
897
+ ref: ve
898
+ }) : null, /* @__PURE__ */ A($, {
899
+ disableEnforceFocus: I,
900
+ disableAutoFocus: b,
901
+ disableRestoreFocus: N,
902
+ isEnabled: ye,
903
+ open: F,
904
+ children: /* @__PURE__ */ f.cloneElement(y, q)
905
+ })]
906
+ })
907
+ });
908
+ });
909
+ process.env.NODE_ENV !== "production" && (tt.propTypes = {
910
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
911
+ // │ These PropTypes are generated from the TypeScript type definitions. │
912
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
913
+ // └─────────────────────────────────────────────────────────────────────┘
914
+ /**
915
+ * A backdrop component. This prop enables custom backdrop rendering.
916
+ * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
917
+ * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
918
+ * @default styled(Backdrop, {
919
+ * name: 'MuiModal',
920
+ * slot: 'Backdrop',
921
+ * overridesResolver: (props, styles) => {
922
+ * return styles.backdrop;
923
+ * },
924
+ * })({
925
+ * zIndex: -1,
926
+ * })
927
+ */
928
+ BackdropComponent: e.elementType,
929
+ /**
930
+ * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
931
+ * @deprecated Use `slotProps.backdrop` instead.
932
+ */
933
+ BackdropProps: e.object,
934
+ /**
935
+ * A single child content element.
936
+ */
937
+ children: Q.isRequired,
938
+ /**
939
+ * Override or extend the styles applied to the component.
940
+ */
941
+ classes: e.object,
942
+ /**
943
+ * @ignore
944
+ */
945
+ className: e.string,
946
+ /**
947
+ * When set to true the Modal waits until a nested Transition is completed before closing.
948
+ * @default false
949
+ */
950
+ closeAfterTransition: e.bool,
951
+ /**
952
+ * The component used for the root node.
953
+ * Either a string to use a HTML element or a component.
954
+ */
955
+ component: e.elementType,
956
+ /**
957
+ * The components used for each slot inside.
958
+ *
959
+ * @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.
960
+ *
961
+ * @default {}
962
+ */
963
+ components: e.shape({
964
+ Backdrop: e.elementType,
965
+ Root: e.elementType
966
+ }),
967
+ /**
968
+ * The extra props for the slot components.
969
+ * You can override the existing props or add new ones.
970
+ *
971
+ * @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.
972
+ *
973
+ * @default {}
974
+ */
975
+ componentsProps: e.shape({
976
+ backdrop: e.oneOfType([e.func, e.object]),
977
+ root: e.oneOfType([e.func, e.object])
978
+ }),
979
+ /**
980
+ * An HTML element or function that returns one.
981
+ * The `container` will have the portal children appended to it.
982
+ *
983
+ * You can also provide a callback, which is called in a React layout effect.
984
+ * This lets you set the container from a ref, and also makes server-side rendering possible.
985
+ *
986
+ * By default, it uses the body of the top-level document object,
987
+ * so it's simply `document.body` most of the time.
988
+ */
989
+ container: e.oneOfType([Ce, e.func]),
990
+ /**
991
+ * If `true`, the modal will not automatically shift focus to itself when it opens, and
992
+ * replace it to the last focused element when it closes.
993
+ * This also works correctly with any modal children that have the `disableAutoFocus` prop.
994
+ *
995
+ * Generally this should never be set to `true` as it makes the modal less
996
+ * accessible to assistive technologies, like screen readers.
997
+ * @default false
998
+ */
999
+ disableAutoFocus: e.bool,
1000
+ /**
1001
+ * If `true`, the modal will not prevent focus from leaving the modal while open.
1002
+ *
1003
+ * Generally this should never be set to `true` as it makes the modal less
1004
+ * accessible to assistive technologies, like screen readers.
1005
+ * @default false
1006
+ */
1007
+ disableEnforceFocus: e.bool,
1008
+ /**
1009
+ * If `true`, hitting escape will not fire the `onClose` callback.
1010
+ * @default false
1011
+ */
1012
+ disableEscapeKeyDown: e.bool,
1013
+ /**
1014
+ * The `children` will be under the DOM hierarchy of the parent component.
1015
+ * @default false
1016
+ */
1017
+ disablePortal: e.bool,
1018
+ /**
1019
+ * If `true`, the modal will not restore focus to previously focused element once
1020
+ * modal is hidden or unmounted.
1021
+ * @default false
1022
+ */
1023
+ disableRestoreFocus: e.bool,
1024
+ /**
1025
+ * Disable the scroll lock behavior.
1026
+ * @default false
1027
+ */
1028
+ disableScrollLock: e.bool,
1029
+ /**
1030
+ * If `true`, the backdrop is not rendered.
1031
+ * @default false
1032
+ */
1033
+ hideBackdrop: e.bool,
1034
+ /**
1035
+ * Always keep the children in the DOM.
1036
+ * This prop can be useful in SEO situation or
1037
+ * when you want to maximize the responsiveness of the Modal.
1038
+ * @default false
1039
+ */
1040
+ keepMounted: e.bool,
1041
+ /**
1042
+ * Callback fired when the backdrop is clicked.
1043
+ * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
1044
+ */
1045
+ onBackdropClick: e.func,
1046
+ /**
1047
+ * Callback fired when the component requests to be closed.
1048
+ * The `reason` parameter can optionally be used to control the response to `onClose`.
1049
+ *
1050
+ * @param {object} event The event source of the callback.
1051
+ * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
1052
+ */
1053
+ onClose: e.func,
1054
+ /**
1055
+ * A function called when a transition enters.
1056
+ */
1057
+ onTransitionEnter: e.func,
1058
+ /**
1059
+ * A function called when a transition has exited.
1060
+ */
1061
+ onTransitionExited: e.func,
1062
+ /**
1063
+ * If `true`, the component is shown.
1064
+ */
1065
+ open: e.bool.isRequired,
1066
+ /**
1067
+ * The props used for each slot inside the Modal.
1068
+ * @default {}
1069
+ */
1070
+ slotProps: e.shape({
1071
+ backdrop: e.oneOfType([e.func, e.object]),
1072
+ root: e.oneOfType([e.func, e.object])
1073
+ }),
1074
+ /**
1075
+ * The components used for each slot inside the Modal.
1076
+ * Either a string to use a HTML element or a component.
1077
+ * @default {}
1078
+ */
1079
+ slots: e.shape({
1080
+ backdrop: e.elementType,
1081
+ root: e.elementType
1082
+ }),
1083
+ /**
1084
+ * The system prop that allows defining system overrides as well as additional CSS styles.
1085
+ */
1086
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1087
+ });
1088
+ export {
1089
+ he as B,
1090
+ me as F,
1091
+ tt as M,
1092
+ Fe as g,
1093
+ _ as o
1094
+ };