@notificationapi/react 1.4.1 → 1.5.1

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
@@ -1,1694 +0,0 @@
1
- import { jsx as E, jsxs as Z } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { useContext as Fe } from "react";
4
- import { Preferences as We } from "../components/Preferences/Preferences.js";
5
- import { NotificationAPIContext as Be } from "../components/Provider/context.js";
6
- import { W as Ae } from "./WebPushOptInMessage.js";
7
- import { P as e, g as z, a as H, s as j, u as Y, c as $, f as X, m as ae, h as V } from "./DefaultPropsProvider.js";
8
- import { u as ve } from "./useTheme.js";
9
- import { u as ee, f as ge } from "./ButtonBase.js";
10
- import { T as je, a as Le, g as he } from "./utils.js";
11
- import { o as K, e as le, g as Re, a as $e, P as Ue, H as Ke } from "./Portal.js";
12
- import { u as ne, e as Ve } from "./resolveComponentProps.js";
13
- import { c as ye } from "./PreferenceInput.js";
14
- import { P as ke } from "./Paper.js";
15
- import { a as _e } from "./Divider.js";
16
- import { T as qe } from "./Typography.js";
17
- function oe(o) {
18
- return K(o).defaultView || window;
19
- }
20
- function ze(o = window) {
21
- const t = o.document.documentElement.clientWidth;
22
- return o.innerWidth - t;
23
- }
24
- const He = {
25
- entering: {
26
- opacity: 1
27
- },
28
- entered: {
29
- opacity: 1
30
- }
31
- }, ce = /* @__PURE__ */ d.forwardRef(function(t, r) {
32
- const n = ve(), i = {
33
- enter: n.transitions.duration.enteringScreen,
34
- exit: n.transitions.duration.leavingScreen
35
- }, {
36
- addEndListener: s,
37
- appear: a = !0,
38
- children: l,
39
- easing: f,
40
- in: y,
41
- onEnter: S,
42
- onEntered: x,
43
- onEntering: C,
44
- onExit: h,
45
- onExited: b,
46
- onExiting: M,
47
- style: v,
48
- timeout: R = i,
49
- // eslint-disable-next-line react/prop-types
50
- TransitionComponent: P = je,
51
- ...c
52
- } = t, m = d.useRef(null), w = ne(m, Re(l), r), T = (g) => (p) => {
53
- if (g) {
54
- const u = m.current;
55
- p === void 0 ? g(u) : g(u, p);
56
- }
57
- }, k = T(C), N = T((g, p) => {
58
- Le(g);
59
- const u = he({
60
- style: v,
61
- timeout: R,
62
- easing: f
63
- }, {
64
- mode: "enter"
65
- });
66
- g.style.webkitTransition = n.transitions.create("opacity", u), g.style.transition = n.transitions.create("opacity", u), S && S(g, p);
67
- }), D = T(x), F = T(M), W = T((g) => {
68
- const p = he({
69
- style: v,
70
- timeout: R,
71
- easing: f
72
- }, {
73
- mode: "exit"
74
- });
75
- g.style.webkitTransition = n.transitions.create("opacity", p), g.style.transition = n.transitions.create("opacity", p), h && h(g);
76
- }), I = T(b);
77
- return /* @__PURE__ */ E(P, {
78
- appear: a,
79
- in: y,
80
- nodeRef: m,
81
- onEnter: N,
82
- onEntered: D,
83
- onEntering: k,
84
- onExit: W,
85
- onExited: I,
86
- onExiting: F,
87
- addEndListener: (g) => {
88
- s && s(m.current, g);
89
- },
90
- timeout: R,
91
- ...c,
92
- children: (g, {
93
- ownerState: p,
94
- ...u
95
- }) => /* @__PURE__ */ d.cloneElement(l, {
96
- style: {
97
- opacity: 0,
98
- visibility: g === "exited" && !y ? "hidden" : void 0,
99
- ...He[g],
100
- ...v,
101
- ...l.props.style
102
- },
103
- ref: w,
104
- ...u
105
- })
106
- });
107
- });
108
- process.env.NODE_ENV !== "production" && (ce.propTypes = {
109
- // ┌────────────────────────────── Warning ──────────────────────────────┐
110
- // │ These PropTypes are generated from the TypeScript type definitions. │
111
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
112
- // └─────────────────────────────────────────────────────────────────────┘
113
- /**
114
- * Add a custom transition end trigger. Called with the transitioning DOM
115
- * node and a done callback. Allows for more fine grained transition end
116
- * logic. Note: Timeouts are still used as a fallback if provided.
117
- */
118
- addEndListener: e.func,
119
- /**
120
- * Perform the enter transition when it first mounts if `in` is also `true`.
121
- * Set this to `false` to disable this behavior.
122
- * @default true
123
- */
124
- appear: e.bool,
125
- /**
126
- * A single child content element.
127
- */
128
- children: le.isRequired,
129
- /**
130
- * The transition timing function.
131
- * You may specify a single easing or a object containing enter and exit values.
132
- */
133
- easing: e.oneOfType([e.shape({
134
- enter: e.string,
135
- exit: e.string
136
- }), e.string]),
137
- /**
138
- * If `true`, the component will transition in.
139
- */
140
- in: e.bool,
141
- /**
142
- * @ignore
143
- */
144
- onEnter: e.func,
145
- /**
146
- * @ignore
147
- */
148
- onEntered: e.func,
149
- /**
150
- * @ignore
151
- */
152
- onEntering: e.func,
153
- /**
154
- * @ignore
155
- */
156
- onExit: e.func,
157
- /**
158
- * @ignore
159
- */
160
- onExited: e.func,
161
- /**
162
- * @ignore
163
- */
164
- onExiting: e.func,
165
- /**
166
- * @ignore
167
- */
168
- style: e.object,
169
- /**
170
- * The duration for the transition, in milliseconds.
171
- * You may specify a single timeout for all transitions, or individually with an object.
172
- * @default {
173
- * enter: theme.transitions.duration.enteringScreen,
174
- * exit: theme.transitions.duration.leavingScreen,
175
- * }
176
- */
177
- timeout: e.oneOfType([e.number, e.shape({
178
- appear: e.number,
179
- enter: e.number,
180
- exit: e.number
181
- })])
182
- });
183
- function Ye(o) {
184
- return H("MuiBackdrop", o);
185
- }
186
- z("MuiBackdrop", ["root", "invisible"]);
187
- const Xe = (o) => {
188
- const {
189
- classes: t,
190
- invisible: r
191
- } = o;
192
- return X({
193
- root: ["root", r && "invisible"]
194
- }, Ye, t);
195
- }, Ge = j("div", {
196
- name: "MuiBackdrop",
197
- slot: "Root",
198
- overridesResolver: (o, t) => {
199
- const {
200
- ownerState: r
201
- } = o;
202
- return [t.root, r.invisible && t.invisible];
203
- }
204
- })({
205
- position: "fixed",
206
- display: "flex",
207
- alignItems: "center",
208
- justifyContent: "center",
209
- right: 0,
210
- bottom: 0,
211
- top: 0,
212
- left: 0,
213
- backgroundColor: "rgba(0, 0, 0, 0.5)",
214
- WebkitTapHighlightColor: "transparent",
215
- variants: [{
216
- props: {
217
- invisible: !0
218
- },
219
- style: {
220
- backgroundColor: "transparent"
221
- }
222
- }]
223
- }), de = /* @__PURE__ */ d.forwardRef(function(t, r) {
224
- const n = Y({
225
- props: t,
226
- name: "MuiBackdrop"
227
- }), {
228
- children: i,
229
- className: s,
230
- component: a = "div",
231
- invisible: l = !1,
232
- open: f,
233
- components: y = {},
234
- componentsProps: S = {},
235
- slotProps: x = {},
236
- slots: C = {},
237
- TransitionComponent: h,
238
- transitionDuration: b,
239
- ...M
240
- } = n, v = {
241
- ...n,
242
- component: a,
243
- invisible: l
244
- }, R = Xe(v), P = {
245
- transition: h,
246
- root: y.Root,
247
- ...C
248
- }, c = {
249
- ...S,
250
- ...x
251
- }, m = {
252
- slots: P,
253
- slotProps: c
254
- }, [w, T] = ee("root", {
255
- elementType: Ge,
256
- externalForwardedProps: m,
257
- className: $(R.root, s),
258
- ownerState: v
259
- }), [k, N] = ee("transition", {
260
- elementType: ce,
261
- externalForwardedProps: m,
262
- ownerState: v
263
- });
264
- return /* @__PURE__ */ E(k, {
265
- in: f,
266
- timeout: b,
267
- ...M,
268
- ...N,
269
- children: /* @__PURE__ */ E(w, {
270
- "aria-hidden": !0,
271
- ...T,
272
- classes: R,
273
- ref: r,
274
- children: i
275
- })
276
- });
277
- });
278
- process.env.NODE_ENV !== "production" && (de.propTypes = {
279
- // ┌────────────────────────────── Warning ──────────────────────────────┐
280
- // │ These PropTypes are generated from the TypeScript type definitions. │
281
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
282
- // └─────────────────────────────────────────────────────────────────────┘
283
- /**
284
- * The content of the component.
285
- */
286
- children: e.node,
287
- /**
288
- * Override or extend the styles applied to the component.
289
- */
290
- classes: e.object,
291
- /**
292
- * @ignore
293
- */
294
- className: e.string,
295
- /**
296
- * The component used for the root node.
297
- * Either a string to use a HTML element or a component.
298
- */
299
- component: e.elementType,
300
- /**
301
- * The components used for each slot inside.
302
- *
303
- * @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.
304
- *
305
- * @default {}
306
- */
307
- components: e.shape({
308
- Root: e.elementType
309
- }),
310
- /**
311
- * The extra props for the slot components.
312
- * You can override the existing props or add new ones.
313
- *
314
- * @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.
315
- *
316
- * @default {}
317
- */
318
- componentsProps: e.shape({
319
- root: e.object
320
- }),
321
- /**
322
- * If `true`, the backdrop is invisible.
323
- * It can be used when rendering a popover or a custom select component.
324
- * @default false
325
- */
326
- invisible: e.bool,
327
- /**
328
- * If `true`, the component is shown.
329
- */
330
- open: e.bool.isRequired,
331
- /**
332
- * The props used for each slot inside.
333
- * @default {}
334
- */
335
- slotProps: e.shape({
336
- root: e.oneOfType([e.func, e.object]),
337
- transition: e.oneOfType([e.func, e.object])
338
- }),
339
- /**
340
- * The components used for each slot inside.
341
- * @default {}
342
- */
343
- slots: e.shape({
344
- root: e.elementType,
345
- transition: e.elementType
346
- }),
347
- /**
348
- * The system prop that allows defining system overrides as well as additional CSS styles.
349
- */
350
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
351
- /**
352
- * The component used for the transition.
353
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
354
- * @default Fade
355
- * @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.
356
- */
357
- TransitionComponent: e.elementType,
358
- /**
359
- * The duration for the transition, in milliseconds.
360
- * You may specify a single timeout for all transitions, or individually with an object.
361
- */
362
- transitionDuration: e.oneOfType([e.number, e.shape({
363
- appear: e.number,
364
- enter: e.number,
365
- exit: e.number
366
- })])
367
- });
368
- function Je(o) {
369
- const t = K(o);
370
- return t.body === o ? oe(o).innerWidth > t.documentElement.clientWidth : o.scrollHeight > o.clientHeight;
371
- }
372
- function q(o, t) {
373
- t ? o.setAttribute("aria-hidden", "true") : o.removeAttribute("aria-hidden");
374
- }
375
- function xe(o) {
376
- return parseInt(oe(o).getComputedStyle(o).paddingRight, 10) || 0;
377
- }
378
- function Qe(o) {
379
- const r = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].includes(o.tagName), n = o.tagName === "INPUT" && o.getAttribute("type") === "hidden";
380
- return r || n;
381
- }
382
- function Te(o, t, r, n, i) {
383
- const s = [t, r, ...n];
384
- [].forEach.call(o.children, (a) => {
385
- const l = !s.includes(a), f = !Qe(a);
386
- l && f && q(a, i);
387
- });
388
- }
389
- function se(o, t) {
390
- let r = -1;
391
- return o.some((n, i) => t(n) ? (r = i, !0) : !1), r;
392
- }
393
- function Ze(o, t) {
394
- const r = [], n = o.container;
395
- if (!t.disableScrollLock) {
396
- if (Je(n)) {
397
- const a = ze(oe(n));
398
- r.push({
399
- value: n.style.paddingRight,
400
- property: "padding-right",
401
- el: n
402
- }), n.style.paddingRight = `${xe(n) + a}px`;
403
- const l = K(n).querySelectorAll(".mui-fixed");
404
- [].forEach.call(l, (f) => {
405
- r.push({
406
- value: f.style.paddingRight,
407
- property: "padding-right",
408
- el: f
409
- }), f.style.paddingRight = `${xe(f) + a}px`;
410
- });
411
- }
412
- let s;
413
- if (n.parentNode instanceof DocumentFragment)
414
- s = K(n).body;
415
- else {
416
- const a = n.parentElement, l = oe(n);
417
- s = (a == null ? void 0 : a.nodeName) === "HTML" && l.getComputedStyle(a).overflowY === "scroll" ? a : n;
418
- }
419
- r.push({
420
- value: s.style.overflow,
421
- property: "overflow",
422
- el: s
423
- }, {
424
- value: s.style.overflowX,
425
- property: "overflow-x",
426
- el: s
427
- }, {
428
- value: s.style.overflowY,
429
- property: "overflow-y",
430
- el: s
431
- }), s.style.overflow = "hidden";
432
- }
433
- return () => {
434
- r.forEach(({
435
- value: s,
436
- el: a,
437
- property: l
438
- }) => {
439
- s ? a.style.setProperty(l, s) : a.style.removeProperty(l);
440
- });
441
- };
442
- }
443
- function eo(o) {
444
- const t = [];
445
- return [].forEach.call(o.children, (r) => {
446
- r.getAttribute("aria-hidden") === "true" && t.push(r);
447
- }), t;
448
- }
449
- class oo {
450
- constructor() {
451
- this.modals = [], this.containers = [];
452
- }
453
- add(t, r) {
454
- let n = this.modals.indexOf(t);
455
- if (n !== -1)
456
- return n;
457
- n = this.modals.length, this.modals.push(t), t.modalRef && q(t.modalRef, !1);
458
- const i = eo(r);
459
- Te(r, t.mount, t.modalRef, i, !0);
460
- const s = se(this.containers, (a) => a.container === r);
461
- return s !== -1 ? (this.containers[s].modals.push(t), n) : (this.containers.push({
462
- modals: [t],
463
- container: r,
464
- restore: null,
465
- hiddenSiblings: i
466
- }), n);
467
- }
468
- mount(t, r) {
469
- const n = se(this.containers, (s) => s.modals.includes(t)), i = this.containers[n];
470
- i.restore || (i.restore = Ze(i, r));
471
- }
472
- remove(t, r = !0) {
473
- const n = this.modals.indexOf(t);
474
- if (n === -1)
475
- return n;
476
- const i = se(this.containers, (a) => a.modals.includes(t)), s = this.containers[i];
477
- if (s.modals.splice(s.modals.indexOf(t), 1), this.modals.splice(n, 1), s.modals.length === 0)
478
- s.restore && s.restore(), t.modalRef && q(t.modalRef, r), Te(s.container, t.mount, t.modalRef, s.hiddenSiblings, !1), this.containers.splice(i, 1);
479
- else {
480
- const a = s.modals[s.modals.length - 1];
481
- a.modalRef && q(a.modalRef, !1);
482
- }
483
- return n;
484
- }
485
- isTopModal(t) {
486
- return this.modals.length > 0 && this.modals[this.modals.length - 1] === t;
487
- }
488
- }
489
- const to = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
490
- function no(o) {
491
- const t = parseInt(o.getAttribute("tabindex") || "", 10);
492
- return Number.isNaN(t) ? o.contentEditable === "true" || (o.nodeName === "AUDIO" || o.nodeName === "VIDEO" || o.nodeName === "DETAILS") && o.getAttribute("tabindex") === null ? 0 : o.tabIndex : t;
493
- }
494
- function ro(o) {
495
- if (o.tagName !== "INPUT" || o.type !== "radio" || !o.name)
496
- return !1;
497
- const t = (n) => o.ownerDocument.querySelector(`input[type="radio"]${n}`);
498
- let r = t(`[name="${o.name}"]:checked`);
499
- return r || (r = t(`[name="${o.name}"]`)), r !== o;
500
- }
501
- function so(o) {
502
- return !(o.disabled || o.tagName === "INPUT" && o.type === "hidden" || ro(o));
503
- }
504
- function io(o) {
505
- const t = [], r = [];
506
- return Array.from(o.querySelectorAll(to)).forEach((n, i) => {
507
- const s = no(n);
508
- s === -1 || !so(n) || (s === 0 ? t.push(n) : r.push({
509
- documentOrder: i,
510
- tabIndex: s,
511
- node: n
512
- }));
513
- }), r.sort((n, i) => n.tabIndex === i.tabIndex ? n.documentOrder - i.documentOrder : n.tabIndex - i.tabIndex).map((n) => n.node).concat(t);
514
- }
515
- function ao() {
516
- return !0;
517
- }
518
- function te(o) {
519
- const {
520
- children: t,
521
- disableAutoFocus: r = !1,
522
- disableEnforceFocus: n = !1,
523
- disableRestoreFocus: i = !1,
524
- getTabbable: s = io,
525
- isEnabled: a = ao,
526
- open: l
527
- } = o, f = d.useRef(!1), y = d.useRef(null), S = d.useRef(null), x = d.useRef(null), C = d.useRef(null), h = d.useRef(!1), b = d.useRef(null), M = ne(Re(t), b), v = d.useRef(null);
528
- d.useEffect(() => {
529
- !l || !b.current || (h.current = !r);
530
- }, [r, l]), d.useEffect(() => {
531
- if (!l || !b.current)
532
- return;
533
- const c = K(b.current);
534
- return b.current.contains(c.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(`
535
- `)), b.current.setAttribute("tabIndex", "-1")), h.current && b.current.focus()), () => {
536
- i || (x.current && x.current.focus && (f.current = !0, x.current.focus()), x.current = null);
537
- };
538
- }, [l]), d.useEffect(() => {
539
- if (!l || !b.current)
540
- return;
541
- const c = K(b.current), m = (k) => {
542
- v.current = k, !(n || !a() || k.key !== "Tab") && c.activeElement === b.current && k.shiftKey && (f.current = !0, S.current && S.current.focus());
543
- }, w = () => {
544
- var D, F;
545
- const k = b.current;
546
- if (k === null)
547
- return;
548
- if (!c.hasFocus() || !a() || f.current) {
549
- f.current = !1;
550
- return;
551
- }
552
- if (k.contains(c.activeElement) || n && c.activeElement !== y.current && c.activeElement !== S.current)
553
- return;
554
- if (c.activeElement !== C.current)
555
- C.current = null;
556
- else if (C.current !== null)
557
- return;
558
- if (!h.current)
559
- return;
560
- let N = [];
561
- if ((c.activeElement === y.current || c.activeElement === S.current) && (N = s(b.current)), N.length > 0) {
562
- const W = !!((D = v.current) != null && D.shiftKey && ((F = v.current) == null ? void 0 : F.key) === "Tab"), I = N[0], B = N[N.length - 1];
563
- typeof I != "string" && typeof B != "string" && (W ? B.focus() : I.focus());
564
- } else
565
- k.focus();
566
- };
567
- c.addEventListener("focusin", w), c.addEventListener("keydown", m, !0);
568
- const T = setInterval(() => {
569
- c.activeElement && c.activeElement.tagName === "BODY" && w();
570
- }, 50);
571
- return () => {
572
- clearInterval(T), c.removeEventListener("focusin", w), c.removeEventListener("keydown", m, !0);
573
- };
574
- }, [r, n, i, a, l, s]);
575
- const R = (c) => {
576
- x.current === null && (x.current = c.relatedTarget), h.current = !0, C.current = c.target;
577
- const m = t.props.onFocus;
578
- m && m(c);
579
- }, P = (c) => {
580
- x.current === null && (x.current = c.relatedTarget), h.current = !0;
581
- };
582
- return /* @__PURE__ */ Z(d.Fragment, {
583
- children: [/* @__PURE__ */ E("div", {
584
- tabIndex: l ? 0 : -1,
585
- onFocus: P,
586
- ref: y,
587
- "data-testid": "sentinelStart"
588
- }), /* @__PURE__ */ d.cloneElement(t, {
589
- ref: M,
590
- onFocus: R
591
- }), /* @__PURE__ */ E("div", {
592
- tabIndex: l ? 0 : -1,
593
- onFocus: P,
594
- ref: S,
595
- "data-testid": "sentinelEnd"
596
- })]
597
- });
598
- }
599
- process.env.NODE_ENV !== "production" && (te.propTypes = {
600
- // ┌────────────────────────────── Warning ──────────────────────────────┐
601
- // │ These PropTypes are generated from the TypeScript type definitions. │
602
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
603
- // └─────────────────────────────────────────────────────────────────────┘
604
- /**
605
- * A single child content element.
606
- */
607
- children: le,
608
- /**
609
- * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
610
- * replace it to the last focused element when it closes.
611
- * This also works correctly with any focus trap children that have the `disableAutoFocus` prop.
612
- *
613
- * Generally this should never be set to `true` as it makes the focus trap less
614
- * accessible to assistive technologies, like screen readers.
615
- * @default false
616
- */
617
- disableAutoFocus: e.bool,
618
- /**
619
- * If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
620
- *
621
- * Generally this should never be set to `true` as it makes the focus trap less
622
- * accessible to assistive technologies, like screen readers.
623
- * @default false
624
- */
625
- disableEnforceFocus: e.bool,
626
- /**
627
- * If `true`, the focus trap will not restore focus to previously focused element once
628
- * focus trap is hidden or unmounted.
629
- * @default false
630
- */
631
- disableRestoreFocus: e.bool,
632
- /**
633
- * Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
634
- * For instance, you can provide the "tabbable" npm dependency.
635
- * @param {HTMLElement} root
636
- */
637
- getTabbable: e.func,
638
- /**
639
- * This prop extends the `open` prop.
640
- * It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
641
- * This prop should be memoized.
642
- * It can be used to support multiple focus trap mounted at the same time.
643
- * @default function defaultIsEnabled(): boolean {
644
- * return true;
645
- * }
646
- */
647
- isEnabled: e.func,
648
- /**
649
- * If `true`, focus is locked.
650
- */
651
- open: e.bool.isRequired
652
- });
653
- process.env.NODE_ENV !== "production" && (te.propTypes = $e(te.propTypes));
654
- function lo(o) {
655
- return typeof o == "function" ? o() : o;
656
- }
657
- function co(o) {
658
- return o ? o.props.hasOwnProperty("in") : !1;
659
- }
660
- const Ee = () => {
661
- }, Q = new oo();
662
- function po(o) {
663
- const {
664
- container: t,
665
- disableEscapeKeyDown: r = !1,
666
- disableScrollLock: n = !1,
667
- closeAfterTransition: i = !1,
668
- onTransitionEnter: s,
669
- onTransitionExited: a,
670
- children: l,
671
- onClose: f,
672
- open: y,
673
- rootRef: S
674
- } = o, x = d.useRef({}), C = d.useRef(null), h = d.useRef(null), b = ne(h, S), [M, v] = d.useState(!y), R = co(l);
675
- let P = !0;
676
- (o["aria-hidden"] === "false" || o["aria-hidden"] === !1) && (P = !1);
677
- const c = () => K(C.current), m = () => (x.current.modalRef = h.current, x.current.mount = C.current, x.current), w = () => {
678
- Q.mount(m(), {
679
- disableScrollLock: n
680
- }), h.current && (h.current.scrollTop = 0);
681
- }, T = ge(() => {
682
- const p = lo(t) || c().body;
683
- Q.add(m(), p), h.current && w();
684
- }), k = () => Q.isTopModal(m()), N = ge((p) => {
685
- C.current = p, p && (y && k() ? w() : h.current && q(h.current, P));
686
- }), D = d.useCallback(() => {
687
- Q.remove(m(), P);
688
- }, [P]);
689
- d.useEffect(() => () => {
690
- D();
691
- }, [D]), d.useEffect(() => {
692
- y ? T() : (!R || !i) && D();
693
- }, [y, D, R, i, T]);
694
- const F = (p) => (u) => {
695
- var O;
696
- (O = p.onKeyDown) == null || O.call(p, u), !(u.key !== "Escape" || u.which === 229 || // Wait until IME is settled.
697
- !k()) && (r || (u.stopPropagation(), f && f(u, "escapeKeyDown")));
698
- }, W = (p) => (u) => {
699
- var O;
700
- (O = p.onClick) == null || O.call(p, u), u.target === u.currentTarget && f && f(u, "backdropClick");
701
- };
702
- return {
703
- getRootProps: (p = {}) => {
704
- const u = Ve(o);
705
- delete u.onTransitionEnter, delete u.onTransitionExited;
706
- const O = {
707
- ...u,
708
- ...p
709
- };
710
- return {
711
- /*
712
- * Marking an element with the role presentation indicates to assistive technology
713
- * that this element should be ignored; it exists to support the web application and
714
- * is not meant for humans to interact with directly.
715
- * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
716
- */
717
- role: "presentation",
718
- ...O,
719
- onKeyDown: F(O),
720
- ref: b
721
- };
722
- },
723
- getBackdropProps: (p = {}) => {
724
- const u = p;
725
- return {
726
- "aria-hidden": !0,
727
- ...u,
728
- onClick: W(u),
729
- open: y
730
- };
731
- },
732
- getTransitionProps: () => {
733
- const p = () => {
734
- v(!1), s && s();
735
- }, u = () => {
736
- v(!0), a && a(), i && D();
737
- };
738
- return {
739
- onEnter: ye(p, (l == null ? void 0 : l.props.onEnter) ?? Ee),
740
- onExited: ye(u, (l == null ? void 0 : l.props.onExited) ?? Ee)
741
- };
742
- },
743
- rootRef: b,
744
- portalRef: N,
745
- isTopModal: k,
746
- exited: M,
747
- hasTransition: R
748
- };
749
- }
750
- function uo(o) {
751
- return H("MuiModal", o);
752
- }
753
- z("MuiModal", ["root", "hidden", "backdrop"]);
754
- const fo = (o) => {
755
- const {
756
- open: t,
757
- exited: r,
758
- classes: n
759
- } = o;
760
- return X({
761
- root: ["root", !t && r && "hidden"],
762
- backdrop: ["backdrop"]
763
- }, uo, n);
764
- }, bo = j("div", {
765
- name: "MuiModal",
766
- slot: "Root",
767
- overridesResolver: (o, t) => {
768
- const {
769
- ownerState: r
770
- } = o;
771
- return [t.root, !r.open && r.exited && t.hidden];
772
- }
773
- })(ae(({
774
- theme: o
775
- }) => ({
776
- position: "fixed",
777
- zIndex: (o.vars || o).zIndex.modal,
778
- right: 0,
779
- bottom: 0,
780
- top: 0,
781
- left: 0,
782
- variants: [{
783
- props: ({
784
- ownerState: t
785
- }) => !t.open && t.exited,
786
- style: {
787
- visibility: "hidden"
788
- }
789
- }]
790
- }))), mo = j(de, {
791
- name: "MuiModal",
792
- slot: "Backdrop",
793
- overridesResolver: (o, t) => t.backdrop
794
- })({
795
- zIndex: -1
796
- }), Ce = /* @__PURE__ */ d.forwardRef(function(t, r) {
797
- const n = Y({
798
- name: "MuiModal",
799
- props: t
800
- }), {
801
- BackdropComponent: i = mo,
802
- BackdropProps: s,
803
- classes: a,
804
- className: l,
805
- closeAfterTransition: f = !1,
806
- children: y,
807
- container: S,
808
- component: x,
809
- components: C = {},
810
- componentsProps: h = {},
811
- disableAutoFocus: b = !1,
812
- disableEnforceFocus: M = !1,
813
- disableEscapeKeyDown: v = !1,
814
- disablePortal: R = !1,
815
- disableRestoreFocus: P = !1,
816
- disableScrollLock: c = !1,
817
- hideBackdrop: m = !1,
818
- keepMounted: w = !1,
819
- onBackdropClick: T,
820
- onClose: k,
821
- onTransitionEnter: N,
822
- onTransitionExited: D,
823
- open: F,
824
- slotProps: W = {},
825
- slots: I = {},
826
- // eslint-disable-next-line react/prop-types
827
- theme: B,
828
- ...g
829
- } = n, p = {
830
- ...n,
831
- closeAfterTransition: f,
832
- disableAutoFocus: b,
833
- disableEnforceFocus: M,
834
- disableEscapeKeyDown: v,
835
- disablePortal: R,
836
- disableRestoreFocus: P,
837
- disableScrollLock: c,
838
- hideBackdrop: m,
839
- keepMounted: w
840
- }, {
841
- getRootProps: u,
842
- getBackdropProps: O,
843
- getTransitionProps: re,
844
- portalRef: L,
845
- isTopModal: Ne,
846
- exited: ue,
847
- hasTransition: fe
848
- } = po({
849
- ...p,
850
- rootRef: r
851
- }), _ = {
852
- ...p,
853
- exited: ue
854
- }, A = fo(_), G = {};
855
- if (y.props.tabIndex === void 0 && (G.tabIndex = "-1"), fe) {
856
- const {
857
- onEnter: U,
858
- onExited: J
859
- } = re();
860
- G.onEnter = U, G.onExited = J;
861
- }
862
- const be = {
863
- ...g,
864
- slots: {
865
- root: C.Root,
866
- backdrop: C.Backdrop,
867
- ...I
868
- },
869
- slotProps: {
870
- ...h,
871
- ...W
872
- }
873
- }, [De, Oe] = ee("root", {
874
- elementType: bo,
875
- externalForwardedProps: be,
876
- getSlotProps: u,
877
- additionalProps: {
878
- ref: r,
879
- as: x
880
- },
881
- ownerState: _,
882
- className: $(l, A == null ? void 0 : A.root, !_.open && _.exited && (A == null ? void 0 : A.hidden))
883
- }), [Me, me] = ee("backdrop", {
884
- elementType: i,
885
- externalForwardedProps: be,
886
- additionalProps: s,
887
- getSlotProps: (U) => O({
888
- ...U,
889
- onClick: (J) => {
890
- T && T(J), U != null && U.onClick && U.onClick(J);
891
- }
892
- }),
893
- className: $(s == null ? void 0 : s.className, A == null ? void 0 : A.backdrop),
894
- ownerState: _
895
- }), Ie = ne(s == null ? void 0 : s.ref, me.ref);
896
- return !w && !F && (!fe || ue) ? null : /* @__PURE__ */ E(Ue, {
897
- ref: L,
898
- container: S,
899
- disablePortal: R,
900
- children: /* @__PURE__ */ Z(De, {
901
- ...Oe,
902
- children: [!m && i ? /* @__PURE__ */ E(Me, {
903
- ...me,
904
- ref: Ie
905
- }) : null, /* @__PURE__ */ E(te, {
906
- disableEnforceFocus: M,
907
- disableAutoFocus: b,
908
- disableRestoreFocus: P,
909
- isEnabled: Ne,
910
- open: F,
911
- children: /* @__PURE__ */ d.cloneElement(y, G)
912
- })]
913
- })
914
- });
915
- });
916
- process.env.NODE_ENV !== "production" && (Ce.propTypes = {
917
- // ┌────────────────────────────── Warning ──────────────────────────────┐
918
- // │ These PropTypes are generated from the TypeScript type definitions. │
919
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
920
- // └─────────────────────────────────────────────────────────────────────┘
921
- /**
922
- * A backdrop component. This prop enables custom backdrop rendering.
923
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
924
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
925
- * @default styled(Backdrop, {
926
- * name: 'MuiModal',
927
- * slot: 'Backdrop',
928
- * overridesResolver: (props, styles) => {
929
- * return styles.backdrop;
930
- * },
931
- * })({
932
- * zIndex: -1,
933
- * })
934
- */
935
- BackdropComponent: e.elementType,
936
- /**
937
- * Props applied to the [`Backdrop`](https://mui.com/material-ui/api/backdrop/) element.
938
- * @deprecated Use `slotProps.backdrop` instead.
939
- */
940
- BackdropProps: e.object,
941
- /**
942
- * A single child content element.
943
- */
944
- children: le.isRequired,
945
- /**
946
- * Override or extend the styles applied to the component.
947
- */
948
- classes: e.object,
949
- /**
950
- * @ignore
951
- */
952
- className: e.string,
953
- /**
954
- * When set to true the Modal waits until a nested Transition is completed before closing.
955
- * @default false
956
- */
957
- closeAfterTransition: e.bool,
958
- /**
959
- * The component used for the root node.
960
- * Either a string to use a HTML element or a component.
961
- */
962
- component: e.elementType,
963
- /**
964
- * The components used for each slot inside.
965
- *
966
- * @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.
967
- *
968
- * @default {}
969
- */
970
- components: e.shape({
971
- Backdrop: e.elementType,
972
- Root: e.elementType
973
- }),
974
- /**
975
- * The extra props for the slot components.
976
- * You can override the existing props or add new ones.
977
- *
978
- * @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.
979
- *
980
- * @default {}
981
- */
982
- componentsProps: e.shape({
983
- backdrop: e.oneOfType([e.func, e.object]),
984
- root: e.oneOfType([e.func, e.object])
985
- }),
986
- /**
987
- * An HTML element or function that returns one.
988
- * The `container` will have the portal children appended to it.
989
- *
990
- * You can also provide a callback, which is called in a React layout effect.
991
- * This lets you set the container from a ref, and also makes server-side rendering possible.
992
- *
993
- * By default, it uses the body of the top-level document object,
994
- * so it's simply `document.body` most of the time.
995
- */
996
- container: e.oneOfType([Ke, e.func]),
997
- /**
998
- * If `true`, the modal will not automatically shift focus to itself when it opens, and
999
- * replace it to the last focused element when it closes.
1000
- * This also works correctly with any modal children that have the `disableAutoFocus` prop.
1001
- *
1002
- * Generally this should never be set to `true` as it makes the modal less
1003
- * accessible to assistive technologies, like screen readers.
1004
- * @default false
1005
- */
1006
- disableAutoFocus: e.bool,
1007
- /**
1008
- * If `true`, the modal will not prevent focus from leaving the modal while open.
1009
- *
1010
- * Generally this should never be set to `true` as it makes the modal less
1011
- * accessible to assistive technologies, like screen readers.
1012
- * @default false
1013
- */
1014
- disableEnforceFocus: e.bool,
1015
- /**
1016
- * If `true`, hitting escape will not fire the `onClose` callback.
1017
- * @default false
1018
- */
1019
- disableEscapeKeyDown: e.bool,
1020
- /**
1021
- * The `children` will be under the DOM hierarchy of the parent component.
1022
- * @default false
1023
- */
1024
- disablePortal: e.bool,
1025
- /**
1026
- * If `true`, the modal will not restore focus to previously focused element once
1027
- * modal is hidden or unmounted.
1028
- * @default false
1029
- */
1030
- disableRestoreFocus: e.bool,
1031
- /**
1032
- * Disable the scroll lock behavior.
1033
- * @default false
1034
- */
1035
- disableScrollLock: e.bool,
1036
- /**
1037
- * If `true`, the backdrop is not rendered.
1038
- * @default false
1039
- */
1040
- hideBackdrop: e.bool,
1041
- /**
1042
- * Always keep the children in the DOM.
1043
- * This prop can be useful in SEO situation or
1044
- * when you want to maximize the responsiveness of the Modal.
1045
- * @default false
1046
- */
1047
- keepMounted: e.bool,
1048
- /**
1049
- * Callback fired when the backdrop is clicked.
1050
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
1051
- */
1052
- onBackdropClick: e.func,
1053
- /**
1054
- * Callback fired when the component requests to be closed.
1055
- * The `reason` parameter can optionally be used to control the response to `onClose`.
1056
- *
1057
- * @param {object} event The event source of the callback.
1058
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
1059
- */
1060
- onClose: e.func,
1061
- /**
1062
- * A function called when a transition enters.
1063
- */
1064
- onTransitionEnter: e.func,
1065
- /**
1066
- * A function called when a transition has exited.
1067
- */
1068
- onTransitionExited: e.func,
1069
- /**
1070
- * If `true`, the component is shown.
1071
- */
1072
- open: e.bool.isRequired,
1073
- /**
1074
- * The props used for each slot inside the Modal.
1075
- * @default {}
1076
- */
1077
- slotProps: e.shape({
1078
- backdrop: e.oneOfType([e.func, e.object]),
1079
- root: e.oneOfType([e.func, e.object])
1080
- }),
1081
- /**
1082
- * The components used for each slot inside the Modal.
1083
- * Either a string to use a HTML element or a component.
1084
- * @default {}
1085
- */
1086
- slots: e.shape({
1087
- backdrop: e.elementType,
1088
- root: e.elementType
1089
- }),
1090
- /**
1091
- * The system prop that allows defining system overrides as well as additional CSS styles.
1092
- */
1093
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1094
- });
1095
- function go(o) {
1096
- return H("MuiDialog", o);
1097
- }
1098
- const ie = z("MuiDialog", ["root", "scrollPaper", "scrollBody", "container", "paper", "paperScrollPaper", "paperScrollBody", "paperWidthFalse", "paperWidthXs", "paperWidthSm", "paperWidthMd", "paperWidthLg", "paperWidthXl", "paperFullWidth", "paperFullScreen"]), pe = /* @__PURE__ */ d.createContext({});
1099
- process.env.NODE_ENV !== "production" && (pe.displayName = "DialogContext");
1100
- const ho = j(de, {
1101
- name: "MuiDialog",
1102
- slot: "Backdrop",
1103
- overrides: (o, t) => t.backdrop
1104
- })({
1105
- // Improve scrollable dialog support.
1106
- zIndex: -1
1107
- }), yo = (o) => {
1108
- const {
1109
- classes: t,
1110
- scroll: r,
1111
- maxWidth: n,
1112
- fullWidth: i,
1113
- fullScreen: s
1114
- } = o, a = {
1115
- root: ["root"],
1116
- container: ["container", `scroll${V(r)}`],
1117
- paper: ["paper", `paperScroll${V(r)}`, `paperWidth${V(String(n))}`, i && "paperFullWidth", s && "paperFullScreen"]
1118
- };
1119
- return X(a, go, t);
1120
- }, xo = j(Ce, {
1121
- name: "MuiDialog",
1122
- slot: "Root",
1123
- overridesResolver: (o, t) => t.root
1124
- })({
1125
- "@media print": {
1126
- // Use !important to override the Modal inline-style.
1127
- position: "absolute !important"
1128
- }
1129
- }), To = j("div", {
1130
- name: "MuiDialog",
1131
- slot: "Container",
1132
- overridesResolver: (o, t) => {
1133
- const {
1134
- ownerState: r
1135
- } = o;
1136
- return [t.container, t[`scroll${V(r.scroll)}`]];
1137
- }
1138
- })({
1139
- height: "100%",
1140
- "@media print": {
1141
- height: "auto"
1142
- },
1143
- // We disable the focus ring for mouse, touch and keyboard users.
1144
- outline: 0,
1145
- variants: [{
1146
- props: {
1147
- scroll: "paper"
1148
- },
1149
- style: {
1150
- display: "flex",
1151
- justifyContent: "center",
1152
- alignItems: "center"
1153
- }
1154
- }, {
1155
- props: {
1156
- scroll: "body"
1157
- },
1158
- style: {
1159
- overflowY: "auto",
1160
- overflowX: "hidden",
1161
- textAlign: "center",
1162
- "&::after": {
1163
- content: '""',
1164
- display: "inline-block",
1165
- verticalAlign: "middle",
1166
- height: "100%",
1167
- width: "0"
1168
- }
1169
- }
1170
- }]
1171
- }), Eo = j(ke, {
1172
- name: "MuiDialog",
1173
- slot: "Paper",
1174
- overridesResolver: (o, t) => {
1175
- const {
1176
- ownerState: r
1177
- } = o;
1178
- return [t.paper, t[`scrollPaper${V(r.scroll)}`], t[`paperWidth${V(String(r.maxWidth))}`], r.fullWidth && t.paperFullWidth, r.fullScreen && t.paperFullScreen];
1179
- }
1180
- })(ae(({
1181
- theme: o
1182
- }) => ({
1183
- margin: 32,
1184
- position: "relative",
1185
- overflowY: "auto",
1186
- "@media print": {
1187
- overflowY: "visible",
1188
- boxShadow: "none"
1189
- },
1190
- variants: [{
1191
- props: {
1192
- scroll: "paper"
1193
- },
1194
- style: {
1195
- display: "flex",
1196
- flexDirection: "column",
1197
- maxHeight: "calc(100% - 64px)"
1198
- }
1199
- }, {
1200
- props: {
1201
- scroll: "body"
1202
- },
1203
- style: {
1204
- display: "inline-block",
1205
- verticalAlign: "middle",
1206
- textAlign: "initial"
1207
- }
1208
- }, {
1209
- props: ({
1210
- ownerState: t
1211
- }) => !t.maxWidth,
1212
- style: {
1213
- maxWidth: "calc(100% - 64px)"
1214
- }
1215
- }, {
1216
- props: {
1217
- maxWidth: "xs"
1218
- },
1219
- style: {
1220
- maxWidth: o.breakpoints.unit === "px" ? Math.max(o.breakpoints.values.xs, 444) : `max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,
1221
- [`&.${ie.paperScrollBody}`]: {
1222
- [o.breakpoints.down(Math.max(o.breakpoints.values.xs, 444) + 32 * 2)]: {
1223
- maxWidth: "calc(100% - 64px)"
1224
- }
1225
- }
1226
- }
1227
- }, ...Object.keys(o.breakpoints.values).filter((t) => t !== "xs").map((t) => ({
1228
- props: {
1229
- maxWidth: t
1230
- },
1231
- style: {
1232
- maxWidth: `${o.breakpoints.values[t]}${o.breakpoints.unit}`,
1233
- [`&.${ie.paperScrollBody}`]: {
1234
- [o.breakpoints.down(o.breakpoints.values[t] + 32 * 2)]: {
1235
- maxWidth: "calc(100% - 64px)"
1236
- }
1237
- }
1238
- }
1239
- })), {
1240
- props: ({
1241
- ownerState: t
1242
- }) => t.fullWidth,
1243
- style: {
1244
- width: "calc(100% - 64px)"
1245
- }
1246
- }, {
1247
- props: ({
1248
- ownerState: t
1249
- }) => t.fullScreen,
1250
- style: {
1251
- margin: 0,
1252
- width: "100%",
1253
- maxWidth: "100%",
1254
- height: "100%",
1255
- maxHeight: "none",
1256
- borderRadius: 0,
1257
- [`&.${ie.paperScrollBody}`]: {
1258
- margin: 0,
1259
- maxWidth: "100%"
1260
- }
1261
- }
1262
- }]
1263
- }))), Pe = /* @__PURE__ */ d.forwardRef(function(t, r) {
1264
- const n = Y({
1265
- props: t,
1266
- name: "MuiDialog"
1267
- }), i = ve(), s = {
1268
- enter: i.transitions.duration.enteringScreen,
1269
- exit: i.transitions.duration.leavingScreen
1270
- }, {
1271
- "aria-describedby": a,
1272
- "aria-labelledby": l,
1273
- "aria-modal": f = !0,
1274
- BackdropComponent: y,
1275
- BackdropProps: S,
1276
- children: x,
1277
- className: C,
1278
- disableEscapeKeyDown: h = !1,
1279
- fullScreen: b = !1,
1280
- fullWidth: M = !1,
1281
- maxWidth: v = "sm",
1282
- onBackdropClick: R,
1283
- onClick: P,
1284
- onClose: c,
1285
- open: m,
1286
- PaperComponent: w = ke,
1287
- PaperProps: T = {},
1288
- scroll: k = "paper",
1289
- TransitionComponent: N = ce,
1290
- transitionDuration: D = s,
1291
- TransitionProps: F,
1292
- ...W
1293
- } = n, I = {
1294
- ...n,
1295
- disableEscapeKeyDown: h,
1296
- fullScreen: b,
1297
- fullWidth: M,
1298
- maxWidth: v,
1299
- scroll: k
1300
- }, B = yo(I), g = d.useRef(), p = (L) => {
1301
- g.current = L.target === L.currentTarget;
1302
- }, u = (L) => {
1303
- P && P(L), g.current && (g.current = null, R && R(L), c && c(L, "backdropClick"));
1304
- }, O = _e(l), re = d.useMemo(() => ({
1305
- titleId: O
1306
- }), [O]);
1307
- return /* @__PURE__ */ E(xo, {
1308
- className: $(B.root, C),
1309
- closeAfterTransition: !0,
1310
- components: {
1311
- Backdrop: ho
1312
- },
1313
- componentsProps: {
1314
- backdrop: {
1315
- transitionDuration: D,
1316
- as: y,
1317
- ...S
1318
- }
1319
- },
1320
- disableEscapeKeyDown: h,
1321
- onClose: c,
1322
- open: m,
1323
- ref: r,
1324
- onClick: u,
1325
- ownerState: I,
1326
- ...W,
1327
- children: /* @__PURE__ */ E(N, {
1328
- appear: !0,
1329
- in: m,
1330
- timeout: D,
1331
- role: "presentation",
1332
- ...F,
1333
- children: /* @__PURE__ */ E(To, {
1334
- className: $(B.container),
1335
- onMouseDown: p,
1336
- ownerState: I,
1337
- children: /* @__PURE__ */ E(Eo, {
1338
- as: w,
1339
- elevation: 24,
1340
- role: "dialog",
1341
- "aria-describedby": a,
1342
- "aria-labelledby": O,
1343
- "aria-modal": f,
1344
- ...T,
1345
- className: $(B.paper, T.className),
1346
- ownerState: I,
1347
- children: /* @__PURE__ */ E(pe.Provider, {
1348
- value: re,
1349
- children: x
1350
- })
1351
- })
1352
- })
1353
- })
1354
- });
1355
- });
1356
- process.env.NODE_ENV !== "production" && (Pe.propTypes = {
1357
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1358
- // │ These PropTypes are generated from the TypeScript type definitions. │
1359
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1360
- // └─────────────────────────────────────────────────────────────────────┘
1361
- /**
1362
- * The id(s) of the element(s) that describe the dialog.
1363
- */
1364
- "aria-describedby": e.string,
1365
- /**
1366
- * The id(s) of the element(s) that label the dialog.
1367
- */
1368
- "aria-labelledby": e.string,
1369
- /**
1370
- * Informs assistive technologies that the element is modal.
1371
- * It's added on the element with role="dialog".
1372
- * @default true
1373
- */
1374
- "aria-modal": e.oneOfType([e.oneOf(["false", "true"]), e.bool]),
1375
- /**
1376
- * A backdrop component. This prop enables custom backdrop rendering.
1377
- * @deprecated Use `slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
1378
- * Use the `slots.backdrop` prop to make your application ready for the next version of Material UI.
1379
- * @default styled(Backdrop, {
1380
- * name: 'MuiModal',
1381
- * slot: 'Backdrop',
1382
- * overridesResolver: (props, styles) => {
1383
- * return styles.backdrop;
1384
- * },
1385
- * })({
1386
- * zIndex: -1,
1387
- * })
1388
- */
1389
- BackdropComponent: e.elementType,
1390
- /**
1391
- * @ignore
1392
- */
1393
- BackdropProps: e.object,
1394
- /**
1395
- * Dialog children, usually the included sub-components.
1396
- */
1397
- children: e.node,
1398
- /**
1399
- * Override or extend the styles applied to the component.
1400
- */
1401
- classes: e.object,
1402
- /**
1403
- * @ignore
1404
- */
1405
- className: e.string,
1406
- /**
1407
- * If `true`, hitting escape will not fire the `onClose` callback.
1408
- * @default false
1409
- */
1410
- disableEscapeKeyDown: e.bool,
1411
- /**
1412
- * If `true`, the dialog is full-screen.
1413
- * @default false
1414
- */
1415
- fullScreen: e.bool,
1416
- /**
1417
- * If `true`, the dialog stretches to `maxWidth`.
1418
- *
1419
- * Notice that the dialog width grow is limited by the default margin.
1420
- * @default false
1421
- */
1422
- fullWidth: e.bool,
1423
- /**
1424
- * Determine the max-width of the dialog.
1425
- * The dialog width grows with the size of the screen.
1426
- * Set to `false` to disable `maxWidth`.
1427
- * @default 'sm'
1428
- */
1429
- maxWidth: e.oneOfType([e.oneOf(["xs", "sm", "md", "lg", "xl", !1]), e.string]),
1430
- /**
1431
- * Callback fired when the backdrop is clicked.
1432
- * @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
1433
- */
1434
- onBackdropClick: e.func,
1435
- /**
1436
- * @ignore
1437
- */
1438
- onClick: e.func,
1439
- /**
1440
- * Callback fired when the component requests to be closed.
1441
- *
1442
- * @param {object} event The event source of the callback.
1443
- * @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
1444
- */
1445
- onClose: e.func,
1446
- /**
1447
- * If `true`, the component is shown.
1448
- */
1449
- open: e.bool.isRequired,
1450
- /**
1451
- * The component used to render the body of the dialog.
1452
- * @default Paper
1453
- */
1454
- PaperComponent: e.elementType,
1455
- /**
1456
- * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
1457
- * @default {}
1458
- */
1459
- PaperProps: e.object,
1460
- /**
1461
- * Determine the container for scrolling the dialog.
1462
- * @default 'paper'
1463
- */
1464
- scroll: e.oneOf(["body", "paper"]),
1465
- /**
1466
- * The system prop that allows defining system overrides as well as additional CSS styles.
1467
- */
1468
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1469
- /**
1470
- * The component used for the transition.
1471
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
1472
- * @default Fade
1473
- */
1474
- TransitionComponent: e.elementType,
1475
- /**
1476
- * The duration for the transition, in milliseconds.
1477
- * You may specify a single timeout for all transitions, or individually with an object.
1478
- * @default {
1479
- * enter: theme.transitions.duration.enteringScreen,
1480
- * exit: theme.transitions.duration.leavingScreen,
1481
- * }
1482
- */
1483
- transitionDuration: e.oneOfType([e.number, e.shape({
1484
- appear: e.number,
1485
- enter: e.number,
1486
- exit: e.number
1487
- })]),
1488
- /**
1489
- * Props applied to the transition element.
1490
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
1491
- */
1492
- TransitionProps: e.object
1493
- });
1494
- function vo(o) {
1495
- return H("MuiDialogContent", o);
1496
- }
1497
- z("MuiDialogContent", ["root", "dividers"]);
1498
- function Ro(o) {
1499
- return H("MuiDialogTitle", o);
1500
- }
1501
- const ko = z("MuiDialogTitle", ["root"]), Co = (o) => {
1502
- const {
1503
- classes: t,
1504
- dividers: r
1505
- } = o;
1506
- return X({
1507
- root: ["root", r && "dividers"]
1508
- }, vo, t);
1509
- }, Po = j("div", {
1510
- name: "MuiDialogContent",
1511
- slot: "Root",
1512
- overridesResolver: (o, t) => {
1513
- const {
1514
- ownerState: r
1515
- } = o;
1516
- return [t.root, r.dividers && t.dividers];
1517
- }
1518
- })(ae(({
1519
- theme: o
1520
- }) => ({
1521
- flex: "1 1 auto",
1522
- // Add iOS momentum scrolling for iOS < 13.0
1523
- WebkitOverflowScrolling: "touch",
1524
- overflowY: "auto",
1525
- padding: "20px 24px",
1526
- variants: [{
1527
- props: ({
1528
- ownerState: t
1529
- }) => t.dividers,
1530
- style: {
1531
- padding: "16px 24px",
1532
- borderTop: `1px solid ${(o.vars || o).palette.divider}`,
1533
- borderBottom: `1px solid ${(o.vars || o).palette.divider}`
1534
- }
1535
- }, {
1536
- props: ({
1537
- ownerState: t
1538
- }) => !t.dividers,
1539
- style: {
1540
- [`.${ko.root} + &`]: {
1541
- paddingTop: 0
1542
- }
1543
- }
1544
- }]
1545
- }))), Se = /* @__PURE__ */ d.forwardRef(function(t, r) {
1546
- const n = Y({
1547
- props: t,
1548
- name: "MuiDialogContent"
1549
- }), {
1550
- className: i,
1551
- dividers: s = !1,
1552
- ...a
1553
- } = n, l = {
1554
- ...n,
1555
- dividers: s
1556
- }, f = Co(l);
1557
- return /* @__PURE__ */ E(Po, {
1558
- className: $(f.root, i),
1559
- ownerState: l,
1560
- ref: r,
1561
- ...a
1562
- });
1563
- });
1564
- process.env.NODE_ENV !== "production" && (Se.propTypes = {
1565
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1566
- // │ These PropTypes are generated from the TypeScript type definitions. │
1567
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1568
- // └─────────────────────────────────────────────────────────────────────┘
1569
- /**
1570
- * The content of the component.
1571
- */
1572
- children: e.node,
1573
- /**
1574
- * Override or extend the styles applied to the component.
1575
- */
1576
- classes: e.object,
1577
- /**
1578
- * @ignore
1579
- */
1580
- className: e.string,
1581
- /**
1582
- * Display the top and bottom dividers.
1583
- * @default false
1584
- */
1585
- dividers: e.bool,
1586
- /**
1587
- * The system prop that allows defining system overrides as well as additional CSS styles.
1588
- */
1589
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1590
- });
1591
- const So = (o) => {
1592
- const {
1593
- classes: t
1594
- } = o;
1595
- return X({
1596
- root: ["root"]
1597
- }, Ro, t);
1598
- }, wo = j(qe, {
1599
- name: "MuiDialogTitle",
1600
- slot: "Root",
1601
- overridesResolver: (o, t) => t.root
1602
- })({
1603
- padding: "16px 24px",
1604
- flex: "0 0 auto"
1605
- }), we = /* @__PURE__ */ d.forwardRef(function(t, r) {
1606
- const n = Y({
1607
- props: t,
1608
- name: "MuiDialogTitle"
1609
- }), {
1610
- className: i,
1611
- id: s,
1612
- ...a
1613
- } = n, l = n, f = So(l), {
1614
- titleId: y = s
1615
- } = d.useContext(pe);
1616
- return /* @__PURE__ */ E(wo, {
1617
- component: "h2",
1618
- className: $(f.root, i),
1619
- ownerState: l,
1620
- ref: r,
1621
- variant: "h6",
1622
- id: s ?? y,
1623
- ...a
1624
- });
1625
- });
1626
- process.env.NODE_ENV !== "production" && (we.propTypes = {
1627
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1628
- // │ These PropTypes are generated from the TypeScript type definitions. │
1629
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1630
- // └─────────────────────────────────────────────────────────────────────┘
1631
- /**
1632
- * The content of the component.
1633
- */
1634
- children: e.node,
1635
- /**
1636
- * Override or extend the styles applied to the component.
1637
- */
1638
- classes: e.object,
1639
- /**
1640
- * @ignore
1641
- */
1642
- className: e.string,
1643
- /**
1644
- * @ignore
1645
- */
1646
- id: e.string,
1647
- /**
1648
- * The system prop that allows defining system overrides as well as additional CSS styles.
1649
- */
1650
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
1651
- });
1652
- function _o(o) {
1653
- const t = Fe(Be);
1654
- if (!t)
1655
- return null;
1656
- const r = {
1657
- open: o.open === void 0 ? !0 : o.open,
1658
- onClose: o.onClose || (() => {
1659
- }),
1660
- collapse: o.collapse === void 0 ? !1 : o.collapse
1661
- };
1662
- return /* @__PURE__ */ Z(
1663
- Pe,
1664
- {
1665
- open: r.open,
1666
- onClose: r.onClose,
1667
- maxWidth: "sm",
1668
- fullWidth: !0,
1669
- PaperProps: {
1670
- style: { borderRadius: 8 }
1671
- },
1672
- "aria-hidden": !r.open,
1673
- scroll: "body",
1674
- children: [
1675
- /* @__PURE__ */ E(we, { children: "Notification Preferences" }),
1676
- /* @__PURE__ */ Z(Se, { children: [
1677
- /* @__PURE__ */ E(We, {}),
1678
- t.webPushOptInMessage && /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E(
1679
- Ae,
1680
- {
1681
- hideAfterInteraction: !1,
1682
- descriptionStyle: { fontSize: 12 }
1683
- }
1684
- ) })
1685
- ] })
1686
- ]
1687
- }
1688
- );
1689
- }
1690
- export {
1691
- Ce as M,
1692
- _o as N,
1693
- oe as o
1694
- };