@purpurds/modal 3.0.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.
@@ -0,0 +1,2144 @@
1
+ import { jsxs as K, jsx as _, Fragment as Dt } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import { useCallback as Q, createContext as xe, useMemo as ve, createElement as m, useContext as nt, useLayoutEffect as It, useRef as O, useEffect as A, useState as V, forwardRef as C, Children as R, isValidElement as B, cloneElement as te, Fragment as Ie, useReducer as Rt } from "react";
4
+ import Lt, { flushSync as rt } from "react-dom";
5
+ function P() {
6
+ return P = Object.assign ? Object.assign.bind() : function(e) {
7
+ for (var n = 1; n < arguments.length; n++) {
8
+ var t = arguments[n];
9
+ for (var o in t)
10
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
11
+ }
12
+ return e;
13
+ }, P.apply(this, arguments);
14
+ }
15
+ function j(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
16
+ return function(a) {
17
+ if (e == null || e(a), t === !1 || !a.defaultPrevented)
18
+ return n == null ? void 0 : n(a);
19
+ };
20
+ }
21
+ function Mt(e, n) {
22
+ typeof e == "function" ? e(n) : e != null && (e.current = n);
23
+ }
24
+ function ot(...e) {
25
+ return (n) => e.forEach(
26
+ (t) => Mt(t, n)
27
+ );
28
+ }
29
+ function J(...e) {
30
+ return Q(ot(...e), e);
31
+ }
32
+ function Ft(e, n = []) {
33
+ let t = [];
34
+ function o(r, i) {
35
+ const u = /* @__PURE__ */ xe(i), l = t.length;
36
+ t = [
37
+ ...t,
38
+ i
39
+ ];
40
+ function d(s) {
41
+ const { scope: h, children: f, ...E } = s, c = (h == null ? void 0 : h[e][l]) || u, v = ve(
42
+ () => E,
43
+ Object.values(E)
44
+ );
45
+ return /* @__PURE__ */ m(c.Provider, {
46
+ value: v
47
+ }, f);
48
+ }
49
+ function p(s, h) {
50
+ const f = (h == null ? void 0 : h[e][l]) || u, E = nt(f);
51
+ if (E)
52
+ return E;
53
+ if (i !== void 0)
54
+ return i;
55
+ throw new Error(`\`${s}\` must be used within \`${r}\``);
56
+ }
57
+ return d.displayName = r + "Provider", [
58
+ d,
59
+ p
60
+ ];
61
+ }
62
+ const a = () => {
63
+ const r = t.map((i) => /* @__PURE__ */ xe(i));
64
+ return function(u) {
65
+ const l = (u == null ? void 0 : u[e]) || r;
66
+ return ve(
67
+ () => ({
68
+ [`__scope${e}`]: {
69
+ ...u,
70
+ [e]: l
71
+ }
72
+ }),
73
+ [
74
+ u,
75
+ l
76
+ ]
77
+ );
78
+ };
79
+ };
80
+ return a.scopeName = e, [
81
+ o,
82
+ kt(a, ...n)
83
+ ];
84
+ }
85
+ function kt(...e) {
86
+ const n = e[0];
87
+ if (e.length === 1)
88
+ return n;
89
+ const t = () => {
90
+ const o = e.map(
91
+ (a) => ({
92
+ useScope: a(),
93
+ scopeName: a.scopeName
94
+ })
95
+ );
96
+ return function(r) {
97
+ const i = o.reduce((u, { useScope: l, scopeName: d }) => {
98
+ const s = l(r)[`__scope${d}`];
99
+ return {
100
+ ...u,
101
+ ...s
102
+ };
103
+ }, {});
104
+ return ve(
105
+ () => ({
106
+ [`__scope${n.scopeName}`]: i
107
+ }),
108
+ [
109
+ i
110
+ ]
111
+ );
112
+ };
113
+ };
114
+ return t.scopeName = n.scopeName, t;
115
+ }
116
+ const Oe = globalThis != null && globalThis.document ? It : () => {
117
+ }, jt = g.useId || (() => {
118
+ });
119
+ let Bt = 0;
120
+ function me(e) {
121
+ const [n, t] = g.useState(jt());
122
+ return Oe(() => {
123
+ e || t(
124
+ (o) => o ?? String(Bt++)
125
+ );
126
+ }, [
127
+ e
128
+ ]), e || (n ? `radix-${n}` : "");
129
+ }
130
+ function z(e) {
131
+ const n = O(e);
132
+ return A(() => {
133
+ n.current = e;
134
+ }), ve(
135
+ () => (...t) => {
136
+ var o;
137
+ return (o = n.current) === null || o === void 0 ? void 0 : o.call(n, ...t);
138
+ },
139
+ []
140
+ );
141
+ }
142
+ function Wt({ prop: e, defaultProp: n, onChange: t = () => {
143
+ } }) {
144
+ const [o, a] = Ut({
145
+ defaultProp: n,
146
+ onChange: t
147
+ }), r = e !== void 0, i = r ? e : o, u = z(t), l = Q((d) => {
148
+ if (r) {
149
+ const s = typeof d == "function" ? d(e) : d;
150
+ s !== e && u(s);
151
+ } else
152
+ a(d);
153
+ }, [
154
+ r,
155
+ e,
156
+ a,
157
+ u
158
+ ]);
159
+ return [
160
+ i,
161
+ l
162
+ ];
163
+ }
164
+ function Ut({ defaultProp: e, onChange: n }) {
165
+ const t = V(e), [o] = t, a = O(o), r = z(n);
166
+ return A(() => {
167
+ a.current !== o && (r(o), a.current = o);
168
+ }, [
169
+ o,
170
+ a,
171
+ r
172
+ ]), t;
173
+ }
174
+ const Re = /* @__PURE__ */ C((e, n) => {
175
+ const { children: t, ...o } = e, a = R.toArray(t), r = a.find(Gt);
176
+ if (r) {
177
+ const i = r.props.children, u = a.map((l) => l === r ? R.count(i) > 1 ? R.only(null) : /* @__PURE__ */ B(i) ? i.props.children : null : l);
178
+ return /* @__PURE__ */ m(Pe, P({}, o, {
179
+ ref: n
180
+ }), /* @__PURE__ */ B(i) ? /* @__PURE__ */ te(i, void 0, u) : null);
181
+ }
182
+ return /* @__PURE__ */ m(Pe, P({}, o, {
183
+ ref: n
184
+ }), t);
185
+ });
186
+ Re.displayName = "Slot";
187
+ const Pe = /* @__PURE__ */ C((e, n) => {
188
+ const { children: t, ...o } = e;
189
+ return /* @__PURE__ */ B(t) ? /* @__PURE__ */ te(t, {
190
+ ...Kt(o, t.props),
191
+ ref: n ? ot(n, t.ref) : t.ref
192
+ }) : R.count(t) > 1 ? R.only(null) : null;
193
+ });
194
+ Pe.displayName = "SlotClone";
195
+ const Ht = ({ children: e }) => /* @__PURE__ */ m(Ie, null, e);
196
+ function Gt(e) {
197
+ return /* @__PURE__ */ B(e) && e.type === Ht;
198
+ }
199
+ function Kt(e, n) {
200
+ const t = {
201
+ ...n
202
+ };
203
+ for (const o in n) {
204
+ const a = e[o], r = n[o];
205
+ /^on[A-Z]/.test(o) ? a && r ? t[o] = (...u) => {
206
+ r(...u), a(...u);
207
+ } : a && (t[o] = a) : o === "style" ? t[o] = {
208
+ ...a,
209
+ ...r
210
+ } : o === "className" && (t[o] = [
211
+ a,
212
+ r
213
+ ].filter(Boolean).join(" "));
214
+ }
215
+ return {
216
+ ...e,
217
+ ...t
218
+ };
219
+ }
220
+ const Vt = [
221
+ "a",
222
+ "button",
223
+ "div",
224
+ "form",
225
+ "h2",
226
+ "h3",
227
+ "img",
228
+ "input",
229
+ "label",
230
+ "li",
231
+ "nav",
232
+ "ol",
233
+ "p",
234
+ "span",
235
+ "svg",
236
+ "ul"
237
+ ], W = Vt.reduce((e, n) => {
238
+ const t = /* @__PURE__ */ C((o, a) => {
239
+ const { asChild: r, ...i } = o, u = r ? Re : n;
240
+ return A(() => {
241
+ window[Symbol.for("radix-ui")] = !0;
242
+ }, []), /* @__PURE__ */ m(u, P({}, i, {
243
+ ref: a
244
+ }));
245
+ });
246
+ return t.displayName = `Primitive.${n}`, {
247
+ ...e,
248
+ [n]: t
249
+ };
250
+ }, {});
251
+ function zt(e, n) {
252
+ e && rt(
253
+ () => e.dispatchEvent(n)
254
+ );
255
+ }
256
+ function Xt(e, n = globalThis == null ? void 0 : globalThis.document) {
257
+ const t = z(e);
258
+ A(() => {
259
+ const o = (a) => {
260
+ a.key === "Escape" && t(a);
261
+ };
262
+ return n.addEventListener("keydown", o), () => n.removeEventListener("keydown", o);
263
+ }, [
264
+ t,
265
+ n
266
+ ]);
267
+ }
268
+ const Ne = "dismissableLayer.update", Yt = "dismissableLayer.pointerDownOutside", qt = "dismissableLayer.focusOutside";
269
+ let ke;
270
+ const Zt = /* @__PURE__ */ xe({
271
+ layers: /* @__PURE__ */ new Set(),
272
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
273
+ branches: /* @__PURE__ */ new Set()
274
+ }), Qt = /* @__PURE__ */ C((e, n) => {
275
+ var t;
276
+ const { disableOutsidePointerEvents: o = !1, onEscapeKeyDown: a, onPointerDownOutside: r, onFocusOutside: i, onInteractOutside: u, onDismiss: l, ...d } = e, p = nt(Zt), [s, h] = V(null), f = (t = s == null ? void 0 : s.ownerDocument) !== null && t !== void 0 ? t : globalThis == null ? void 0 : globalThis.document, [, E] = V({}), c = J(
277
+ n,
278
+ (w) => h(w)
279
+ ), v = Array.from(p.layers), [b] = [
280
+ ...p.layersWithOutsidePointerEventsDisabled
281
+ ].slice(-1), x = v.indexOf(b), $ = s ? v.indexOf(s) : -1, y = p.layersWithOutsidePointerEventsDisabled.size > 0, S = $ >= x, U = Jt((w) => {
282
+ const L = w.target, ne = [
283
+ ...p.branches
284
+ ].some(
285
+ (I) => I.contains(L)
286
+ );
287
+ !S || ne || (r == null || r(w), u == null || u(w), w.defaultPrevented || l == null || l());
288
+ }, f), T = en((w) => {
289
+ const L = w.target;
290
+ [
291
+ ...p.branches
292
+ ].some(
293
+ (I) => I.contains(L)
294
+ ) || (i == null || i(w), u == null || u(w), w.defaultPrevented || l == null || l());
295
+ }, f);
296
+ return Xt((w) => {
297
+ $ === p.layers.size - 1 && (a == null || a(w), !w.defaultPrevented && l && (w.preventDefault(), l()));
298
+ }, f), A(() => {
299
+ if (s)
300
+ return o && (p.layersWithOutsidePointerEventsDisabled.size === 0 && (ke = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), p.layersWithOutsidePointerEventsDisabled.add(s)), p.layers.add(s), je(), () => {
301
+ o && p.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = ke);
302
+ };
303
+ }, [
304
+ s,
305
+ f,
306
+ o,
307
+ p
308
+ ]), A(() => () => {
309
+ s && (p.layers.delete(s), p.layersWithOutsidePointerEventsDisabled.delete(s), je());
310
+ }, [
311
+ s,
312
+ p
313
+ ]), A(() => {
314
+ const w = () => E({});
315
+ return document.addEventListener(Ne, w), () => document.removeEventListener(Ne, w);
316
+ }, []), /* @__PURE__ */ m(W.div, P({}, d, {
317
+ ref: c,
318
+ style: {
319
+ pointerEvents: y ? S ? "auto" : "none" : void 0,
320
+ ...e.style
321
+ },
322
+ onFocusCapture: j(e.onFocusCapture, T.onFocusCapture),
323
+ onBlurCapture: j(e.onBlurCapture, T.onBlurCapture),
324
+ onPointerDownCapture: j(e.onPointerDownCapture, U.onPointerDownCapture)
325
+ }));
326
+ });
327
+ function Jt(e, n = globalThis == null ? void 0 : globalThis.document) {
328
+ const t = z(e), o = O(!1), a = O(() => {
329
+ });
330
+ return A(() => {
331
+ const r = (u) => {
332
+ if (u.target && !o.current) {
333
+ let d = function() {
334
+ at(Yt, t, l, {
335
+ discrete: !0
336
+ });
337
+ };
338
+ const l = {
339
+ originalEvent: u
340
+ };
341
+ u.pointerType === "touch" ? (n.removeEventListener("click", a.current), a.current = d, n.addEventListener("click", a.current, {
342
+ once: !0
343
+ })) : d();
344
+ } else
345
+ n.removeEventListener("click", a.current);
346
+ o.current = !1;
347
+ }, i = window.setTimeout(() => {
348
+ n.addEventListener("pointerdown", r);
349
+ }, 0);
350
+ return () => {
351
+ window.clearTimeout(i), n.removeEventListener("pointerdown", r), n.removeEventListener("click", a.current);
352
+ };
353
+ }, [
354
+ n,
355
+ t
356
+ ]), {
357
+ // ensures we check React component tree (not just DOM tree)
358
+ onPointerDownCapture: () => o.current = !0
359
+ };
360
+ }
361
+ function en(e, n = globalThis == null ? void 0 : globalThis.document) {
362
+ const t = z(e), o = O(!1);
363
+ return A(() => {
364
+ const a = (r) => {
365
+ r.target && !o.current && at(qt, t, {
366
+ originalEvent: r
367
+ }, {
368
+ discrete: !1
369
+ });
370
+ };
371
+ return n.addEventListener("focusin", a), () => n.removeEventListener("focusin", a);
372
+ }, [
373
+ n,
374
+ t
375
+ ]), {
376
+ onFocusCapture: () => o.current = !0,
377
+ onBlurCapture: () => o.current = !1
378
+ };
379
+ }
380
+ function je() {
381
+ const e = new CustomEvent(Ne);
382
+ document.dispatchEvent(e);
383
+ }
384
+ function at(e, n, t, { discrete: o }) {
385
+ const a = t.originalEvent.target, r = new CustomEvent(e, {
386
+ bubbles: !1,
387
+ cancelable: !0,
388
+ detail: t
389
+ });
390
+ n && a.addEventListener(e, n, {
391
+ once: !0
392
+ }), o ? zt(a, r) : a.dispatchEvent(r);
393
+ }
394
+ const _e = "focusScope.autoFocusOnMount", be = "focusScope.autoFocusOnUnmount", Be = {
395
+ bubbles: !1,
396
+ cancelable: !0
397
+ }, tn = /* @__PURE__ */ C((e, n) => {
398
+ const { loop: t = !1, trapped: o = !1, onMountAutoFocus: a, onUnmountAutoFocus: r, ...i } = e, [u, l] = V(null), d = z(a), p = z(r), s = O(null), h = J(
399
+ n,
400
+ (c) => l(c)
401
+ ), f = O({
402
+ paused: !1,
403
+ pause() {
404
+ this.paused = !0;
405
+ },
406
+ resume() {
407
+ this.paused = !1;
408
+ }
409
+ }).current;
410
+ A(() => {
411
+ if (o) {
412
+ let c = function($) {
413
+ if (f.paused || !u)
414
+ return;
415
+ const y = $.target;
416
+ u.contains(y) ? s.current = y : k(s.current, {
417
+ select: !0
418
+ });
419
+ }, v = function($) {
420
+ if (f.paused || !u)
421
+ return;
422
+ const y = $.relatedTarget;
423
+ y !== null && (u.contains(y) || k(s.current, {
424
+ select: !0
425
+ }));
426
+ }, b = function($) {
427
+ if (document.activeElement === document.body)
428
+ for (const S of $)
429
+ S.removedNodes.length > 0 && k(u);
430
+ };
431
+ document.addEventListener("focusin", c), document.addEventListener("focusout", v);
432
+ const x = new MutationObserver(b);
433
+ return u && x.observe(u, {
434
+ childList: !0,
435
+ subtree: !0
436
+ }), () => {
437
+ document.removeEventListener("focusin", c), document.removeEventListener("focusout", v), x.disconnect();
438
+ };
439
+ }
440
+ }, [
441
+ o,
442
+ u,
443
+ f.paused
444
+ ]), A(() => {
445
+ if (u) {
446
+ Ue.add(f);
447
+ const c = document.activeElement;
448
+ if (!u.contains(c)) {
449
+ const b = new CustomEvent(_e, Be);
450
+ u.addEventListener(_e, d), u.dispatchEvent(b), b.defaultPrevented || (nn(cn(it(u)), {
451
+ select: !0
452
+ }), document.activeElement === c && k(u));
453
+ }
454
+ return () => {
455
+ u.removeEventListener(_e, d), setTimeout(() => {
456
+ const b = new CustomEvent(be, Be);
457
+ u.addEventListener(be, p), u.dispatchEvent(b), b.defaultPrevented || k(c ?? document.body, {
458
+ select: !0
459
+ }), u.removeEventListener(be, p), Ue.remove(f);
460
+ }, 0);
461
+ };
462
+ }
463
+ }, [
464
+ u,
465
+ d,
466
+ p,
467
+ f
468
+ ]);
469
+ const E = Q((c) => {
470
+ if (!t && !o || f.paused)
471
+ return;
472
+ const v = c.key === "Tab" && !c.altKey && !c.ctrlKey && !c.metaKey, b = document.activeElement;
473
+ if (v && b) {
474
+ const x = c.currentTarget, [$, y] = rn(x);
475
+ $ && y ? !c.shiftKey && b === y ? (c.preventDefault(), t && k($, {
476
+ select: !0
477
+ })) : c.shiftKey && b === $ && (c.preventDefault(), t && k(y, {
478
+ select: !0
479
+ })) : b === x && c.preventDefault();
480
+ }
481
+ }, [
482
+ t,
483
+ o,
484
+ f.paused
485
+ ]);
486
+ return /* @__PURE__ */ m(W.div, P({
487
+ tabIndex: -1
488
+ }, i, {
489
+ ref: h,
490
+ onKeyDown: E
491
+ }));
492
+ });
493
+ function nn(e, { select: n = !1 } = {}) {
494
+ const t = document.activeElement;
495
+ for (const o of e)
496
+ if (k(o, {
497
+ select: n
498
+ }), document.activeElement !== t)
499
+ return;
500
+ }
501
+ function rn(e) {
502
+ const n = it(e), t = We(n, e), o = We(n.reverse(), e);
503
+ return [
504
+ t,
505
+ o
506
+ ];
507
+ }
508
+ function it(e) {
509
+ const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
510
+ acceptNode: (o) => {
511
+ const a = o.tagName === "INPUT" && o.type === "hidden";
512
+ return o.disabled || o.hidden || a ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
513
+ }
514
+ });
515
+ for (; t.nextNode(); )
516
+ n.push(t.currentNode);
517
+ return n;
518
+ }
519
+ function We(e, n) {
520
+ for (const t of e)
521
+ if (!on(t, {
522
+ upTo: n
523
+ }))
524
+ return t;
525
+ }
526
+ function on(e, { upTo: n }) {
527
+ if (getComputedStyle(e).visibility === "hidden")
528
+ return !0;
529
+ for (; e; ) {
530
+ if (n !== void 0 && e === n)
531
+ return !1;
532
+ if (getComputedStyle(e).display === "none")
533
+ return !0;
534
+ e = e.parentElement;
535
+ }
536
+ return !1;
537
+ }
538
+ function an(e) {
539
+ return e instanceof HTMLInputElement && "select" in e;
540
+ }
541
+ function k(e, { select: n = !1 } = {}) {
542
+ if (e && e.focus) {
543
+ const t = document.activeElement;
544
+ e.focus({
545
+ preventScroll: !0
546
+ }), e !== t && an(e) && n && e.select();
547
+ }
548
+ }
549
+ const Ue = un();
550
+ function un() {
551
+ let e = [];
552
+ return {
553
+ add(n) {
554
+ const t = e[0];
555
+ n !== t && (t == null || t.pause()), e = He(e, n), e.unshift(n);
556
+ },
557
+ remove(n) {
558
+ var t;
559
+ e = He(e, n), (t = e[0]) === null || t === void 0 || t.resume();
560
+ }
561
+ };
562
+ }
563
+ function He(e, n) {
564
+ const t = [
565
+ ...e
566
+ ], o = t.indexOf(n);
567
+ return o !== -1 && t.splice(o, 1), t;
568
+ }
569
+ function cn(e) {
570
+ return e.filter(
571
+ (n) => n.tagName !== "A"
572
+ );
573
+ }
574
+ const sn = /* @__PURE__ */ C((e, n) => {
575
+ var t;
576
+ const { container: o = globalThis == null || (t = globalThis.document) === null || t === void 0 ? void 0 : t.body, ...a } = e;
577
+ return o ? /* @__PURE__ */ Lt.createPortal(/* @__PURE__ */ m(W.div, P({}, a, {
578
+ ref: n
579
+ })), o) : null;
580
+ });
581
+ function ln(e, n) {
582
+ return Rt((t, o) => {
583
+ const a = n[t][o];
584
+ return a ?? t;
585
+ }, e);
586
+ }
587
+ const he = (e) => {
588
+ const { present: n, children: t } = e, o = dn(n), a = typeof t == "function" ? t({
589
+ present: o.isPresent
590
+ }) : R.only(t), r = J(o.ref, a.ref);
591
+ return typeof t == "function" || o.isPresent ? /* @__PURE__ */ te(a, {
592
+ ref: r
593
+ }) : null;
594
+ };
595
+ he.displayName = "Presence";
596
+ function dn(e) {
597
+ const [n, t] = V(), o = O({}), a = O(e), r = O("none"), i = e ? "mounted" : "unmounted", [u, l] = ln(i, {
598
+ mounted: {
599
+ UNMOUNT: "unmounted",
600
+ ANIMATION_OUT: "unmountSuspended"
601
+ },
602
+ unmountSuspended: {
603
+ MOUNT: "mounted",
604
+ ANIMATION_END: "unmounted"
605
+ },
606
+ unmounted: {
607
+ MOUNT: "mounted"
608
+ }
609
+ });
610
+ return A(() => {
611
+ const d = re(o.current);
612
+ r.current = u === "mounted" ? d : "none";
613
+ }, [
614
+ u
615
+ ]), Oe(() => {
616
+ const d = o.current, p = a.current;
617
+ if (p !== e) {
618
+ const h = r.current, f = re(d);
619
+ e ? l("MOUNT") : f === "none" || (d == null ? void 0 : d.display) === "none" ? l("UNMOUNT") : l(p && h !== f ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
620
+ }
621
+ }, [
622
+ e,
623
+ l
624
+ ]), Oe(() => {
625
+ if (n) {
626
+ const d = (s) => {
627
+ const f = re(o.current).includes(s.animationName);
628
+ s.target === n && f && rt(
629
+ () => l("ANIMATION_END")
630
+ );
631
+ }, p = (s) => {
632
+ s.target === n && (r.current = re(o.current));
633
+ };
634
+ return n.addEventListener("animationstart", p), n.addEventListener("animationcancel", d), n.addEventListener("animationend", d), () => {
635
+ n.removeEventListener("animationstart", p), n.removeEventListener("animationcancel", d), n.removeEventListener("animationend", d);
636
+ };
637
+ } else
638
+ l("ANIMATION_END");
639
+ }, [
640
+ n,
641
+ l
642
+ ]), {
643
+ isPresent: [
644
+ "mounted",
645
+ "unmountSuspended"
646
+ ].includes(u),
647
+ ref: Q((d) => {
648
+ d && (o.current = getComputedStyle(d)), t(d);
649
+ }, [])
650
+ };
651
+ }
652
+ function re(e) {
653
+ return (e == null ? void 0 : e.animationName) || "none";
654
+ }
655
+ let $e = 0;
656
+ function pn() {
657
+ A(() => {
658
+ var e, n;
659
+ const t = document.querySelectorAll("[data-radix-focus-guard]");
660
+ return document.body.insertAdjacentElement("afterbegin", (e = t[0]) !== null && e !== void 0 ? e : Ge()), document.body.insertAdjacentElement("beforeend", (n = t[1]) !== null && n !== void 0 ? n : Ge()), $e++, () => {
661
+ $e === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach(
662
+ (o) => o.remove()
663
+ ), $e--;
664
+ };
665
+ }, []);
666
+ }
667
+ function Ge() {
668
+ const e = document.createElement("span");
669
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
670
+ }
671
+ var F = function() {
672
+ return F = Object.assign || function(n) {
673
+ for (var t, o = 1, a = arguments.length; o < a; o++) {
674
+ t = arguments[o];
675
+ for (var r in t)
676
+ Object.prototype.hasOwnProperty.call(t, r) && (n[r] = t[r]);
677
+ }
678
+ return n;
679
+ }, F.apply(this, arguments);
680
+ };
681
+ function ut(e, n) {
682
+ var t = {};
683
+ for (var o in e)
684
+ Object.prototype.hasOwnProperty.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
685
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
686
+ for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
687
+ n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (t[o[a]] = e[o[a]]);
688
+ return t;
689
+ }
690
+ function fn(e, n, t) {
691
+ if (t || arguments.length === 2)
692
+ for (var o = 0, a = n.length, r; o < a; o++)
693
+ (r || !(o in n)) && (r || (r = Array.prototype.slice.call(n, 0, o)), r[o] = n[o]);
694
+ return e.concat(r || Array.prototype.slice.call(n));
695
+ }
696
+ var pe = "right-scroll-bar-position", fe = "width-before-scroll-bar", vn = "with-scroll-bars-hidden", hn = "--removed-body-scroll-bar-size";
697
+ function gn(e, n) {
698
+ return typeof e == "function" ? e(n) : e && (e.current = n), e;
699
+ }
700
+ function mn(e, n) {
701
+ var t = V(function() {
702
+ return {
703
+ // value
704
+ value: e,
705
+ // last callback
706
+ callback: n,
707
+ // "memoized" public interface
708
+ facade: {
709
+ get current() {
710
+ return t.value;
711
+ },
712
+ set current(o) {
713
+ var a = t.value;
714
+ a !== o && (t.value = o, t.callback(o, a));
715
+ }
716
+ }
717
+ };
718
+ })[0];
719
+ return t.callback = n, t.facade;
720
+ }
721
+ function _n(e, n) {
722
+ return mn(n || null, function(t) {
723
+ return e.forEach(function(o) {
724
+ return gn(o, t);
725
+ });
726
+ });
727
+ }
728
+ function bn(e) {
729
+ return e;
730
+ }
731
+ function $n(e, n) {
732
+ n === void 0 && (n = bn);
733
+ var t = [], o = !1, a = {
734
+ read: function() {
735
+ if (o)
736
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
737
+ return t.length ? t[t.length - 1] : e;
738
+ },
739
+ useMedium: function(r) {
740
+ var i = n(r, o);
741
+ return t.push(i), function() {
742
+ t = t.filter(function(u) {
743
+ return u !== i;
744
+ });
745
+ };
746
+ },
747
+ assignSyncMedium: function(r) {
748
+ for (o = !0; t.length; ) {
749
+ var i = t;
750
+ t = [], i.forEach(r);
751
+ }
752
+ t = {
753
+ push: function(u) {
754
+ return r(u);
755
+ },
756
+ filter: function() {
757
+ return t;
758
+ }
759
+ };
760
+ },
761
+ assignMedium: function(r) {
762
+ o = !0;
763
+ var i = [];
764
+ if (t.length) {
765
+ var u = t;
766
+ t = [], u.forEach(r), i = t;
767
+ }
768
+ var l = function() {
769
+ var p = i;
770
+ i = [], p.forEach(r);
771
+ }, d = function() {
772
+ return Promise.resolve().then(l);
773
+ };
774
+ d(), t = {
775
+ push: function(p) {
776
+ i.push(p), d();
777
+ },
778
+ filter: function(p) {
779
+ return i = i.filter(p), t;
780
+ }
781
+ };
782
+ }
783
+ };
784
+ return a;
785
+ }
786
+ function yn(e) {
787
+ e === void 0 && (e = {});
788
+ var n = $n(null);
789
+ return n.options = F({ async: !0, ssr: !1 }, e), n;
790
+ }
791
+ var ct = function(e) {
792
+ var n = e.sideCar, t = ut(e, ["sideCar"]);
793
+ if (!n)
794
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
795
+ var o = n.read();
796
+ if (!o)
797
+ throw new Error("Sidecar medium not found");
798
+ return g.createElement(o, F({}, t));
799
+ };
800
+ ct.isSideCarExport = !0;
801
+ function En(e, n) {
802
+ return e.useMedium(n), ct;
803
+ }
804
+ var st = yn(), ye = function() {
805
+ }, ge = g.forwardRef(function(e, n) {
806
+ var t = g.useRef(null), o = g.useState({
807
+ onScrollCapture: ye,
808
+ onWheelCapture: ye,
809
+ onTouchMoveCapture: ye
810
+ }), a = o[0], r = o[1], i = e.forwardProps, u = e.children, l = e.className, d = e.removeScrollBar, p = e.enabled, s = e.shards, h = e.sideCar, f = e.noIsolation, E = e.inert, c = e.allowPinchZoom, v = e.as, b = v === void 0 ? "div" : v, x = ut(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), $ = h, y = _n([t, n]), S = F(F({}, x), a);
811
+ return g.createElement(
812
+ g.Fragment,
813
+ null,
814
+ p && g.createElement($, { sideCar: st, removeScrollBar: d, shards: s, noIsolation: f, inert: E, setCallbacks: r, allowPinchZoom: !!c, lockRef: t }),
815
+ i ? g.cloneElement(g.Children.only(u), F(F({}, S), { ref: y })) : g.createElement(b, F({}, S, { className: l, ref: y }), u)
816
+ );
817
+ });
818
+ ge.defaultProps = {
819
+ enabled: !0,
820
+ removeScrollBar: !0,
821
+ inert: !1
822
+ };
823
+ ge.classNames = {
824
+ fullWidth: fe,
825
+ zeroRight: pe
826
+ };
827
+ var Ke, wn = function() {
828
+ if (Ke)
829
+ return Ke;
830
+ if (typeof __webpack_nonce__ < "u")
831
+ return __webpack_nonce__;
832
+ };
833
+ function Sn() {
834
+ if (!document)
835
+ return null;
836
+ var e = document.createElement("style");
837
+ e.type = "text/css";
838
+ var n = wn();
839
+ return n && e.setAttribute("nonce", n), e;
840
+ }
841
+ function Cn(e, n) {
842
+ e.styleSheet ? e.styleSheet.cssText = n : e.appendChild(document.createTextNode(n));
843
+ }
844
+ function xn(e) {
845
+ var n = document.head || document.getElementsByTagName("head")[0];
846
+ n.appendChild(e);
847
+ }
848
+ var On = function() {
849
+ var e = 0, n = null;
850
+ return {
851
+ add: function(t) {
852
+ e == 0 && (n = Sn()) && (Cn(n, t), xn(n)), e++;
853
+ },
854
+ remove: function() {
855
+ e--, !e && n && (n.parentNode && n.parentNode.removeChild(n), n = null);
856
+ }
857
+ };
858
+ }, Pn = function() {
859
+ var e = On();
860
+ return function(n, t) {
861
+ g.useEffect(function() {
862
+ return e.add(n), function() {
863
+ e.remove();
864
+ };
865
+ }, [n && t]);
866
+ };
867
+ }, lt = function() {
868
+ var e = Pn(), n = function(t) {
869
+ var o = t.styles, a = t.dynamic;
870
+ return e(o, a), null;
871
+ };
872
+ return n;
873
+ }, Nn = {
874
+ left: 0,
875
+ top: 0,
876
+ right: 0,
877
+ gap: 0
878
+ }, Ee = function(e) {
879
+ return parseInt(e || "", 10) || 0;
880
+ }, An = function(e) {
881
+ var n = window.getComputedStyle(document.body), t = n[e === "padding" ? "paddingLeft" : "marginLeft"], o = n[e === "padding" ? "paddingTop" : "marginTop"], a = n[e === "padding" ? "paddingRight" : "marginRight"];
882
+ return [Ee(t), Ee(o), Ee(a)];
883
+ }, Tn = function(e) {
884
+ if (e === void 0 && (e = "margin"), typeof window > "u")
885
+ return Nn;
886
+ var n = An(e), t = document.documentElement.clientWidth, o = window.innerWidth;
887
+ return {
888
+ left: n[0],
889
+ top: n[1],
890
+ right: n[2],
891
+ gap: Math.max(0, o - t + n[2] - n[0])
892
+ };
893
+ }, Dn = lt(), In = function(e, n, t, o) {
894
+ var a = e.left, r = e.top, i = e.right, u = e.gap;
895
+ return t === void 0 && (t = "margin"), `
896
+ .`.concat(vn, ` {
897
+ overflow: hidden `).concat(o, `;
898
+ padding-right: `).concat(u, "px ").concat(o, `;
899
+ }
900
+ body {
901
+ overflow: hidden `).concat(o, `;
902
+ overscroll-behavior: contain;
903
+ `).concat([
904
+ n && "position: relative ".concat(o, ";"),
905
+ t === "margin" && `
906
+ padding-left: `.concat(a, `px;
907
+ padding-top: `).concat(r, `px;
908
+ padding-right: `).concat(i, `px;
909
+ margin-left:0;
910
+ margin-top:0;
911
+ margin-right: `).concat(u, "px ").concat(o, `;
912
+ `),
913
+ t === "padding" && "padding-right: ".concat(u, "px ").concat(o, ";")
914
+ ].filter(Boolean).join(""), `
915
+ }
916
+
917
+ .`).concat(pe, ` {
918
+ right: `).concat(u, "px ").concat(o, `;
919
+ }
920
+
921
+ .`).concat(fe, ` {
922
+ margin-right: `).concat(u, "px ").concat(o, `;
923
+ }
924
+
925
+ .`).concat(pe, " .").concat(pe, ` {
926
+ right: 0 `).concat(o, `;
927
+ }
928
+
929
+ .`).concat(fe, " .").concat(fe, ` {
930
+ margin-right: 0 `).concat(o, `;
931
+ }
932
+
933
+ body {
934
+ `).concat(hn, ": ").concat(u, `px;
935
+ }
936
+ `);
937
+ }, Rn = function(e) {
938
+ var n = e.noRelative, t = e.noImportant, o = e.gapMode, a = o === void 0 ? "margin" : o, r = g.useMemo(function() {
939
+ return Tn(a);
940
+ }, [a]);
941
+ return g.createElement(Dn, { styles: In(r, !n, a, t ? "" : "!important") });
942
+ }, Ae = !1;
943
+ if (typeof window < "u")
944
+ try {
945
+ var oe = Object.defineProperty({}, "passive", {
946
+ get: function() {
947
+ return Ae = !0, !0;
948
+ }
949
+ });
950
+ window.addEventListener("test", oe, oe), window.removeEventListener("test", oe, oe);
951
+ } catch {
952
+ Ae = !1;
953
+ }
954
+ var X = Ae ? { passive: !1 } : !1, Ln = function(e) {
955
+ return e.tagName === "TEXTAREA";
956
+ }, dt = function(e, n) {
957
+ var t = window.getComputedStyle(e);
958
+ return (
959
+ // not-not-scrollable
960
+ t[n] !== "hidden" && // contains scroll inside self
961
+ !(t.overflowY === t.overflowX && !Ln(e) && t[n] === "visible")
962
+ );
963
+ }, Mn = function(e) {
964
+ return dt(e, "overflowY");
965
+ }, Fn = function(e) {
966
+ return dt(e, "overflowX");
967
+ }, Ve = function(e, n) {
968
+ var t = n;
969
+ do {
970
+ typeof ShadowRoot < "u" && t instanceof ShadowRoot && (t = t.host);
971
+ var o = pt(e, t);
972
+ if (o) {
973
+ var a = ft(e, t), r = a[1], i = a[2];
974
+ if (r > i)
975
+ return !0;
976
+ }
977
+ t = t.parentNode;
978
+ } while (t && t !== document.body);
979
+ return !1;
980
+ }, kn = function(e) {
981
+ var n = e.scrollTop, t = e.scrollHeight, o = e.clientHeight;
982
+ return [
983
+ n,
984
+ t,
985
+ o
986
+ ];
987
+ }, jn = function(e) {
988
+ var n = e.scrollLeft, t = e.scrollWidth, o = e.clientWidth;
989
+ return [
990
+ n,
991
+ t,
992
+ o
993
+ ];
994
+ }, pt = function(e, n) {
995
+ return e === "v" ? Mn(n) : Fn(n);
996
+ }, ft = function(e, n) {
997
+ return e === "v" ? kn(n) : jn(n);
998
+ }, Bn = function(e, n) {
999
+ return e === "h" && n === "rtl" ? -1 : 1;
1000
+ }, Wn = function(e, n, t, o, a) {
1001
+ var r = Bn(e, window.getComputedStyle(n).direction), i = r * o, u = t.target, l = n.contains(u), d = !1, p = i > 0, s = 0, h = 0;
1002
+ do {
1003
+ var f = ft(e, u), E = f[0], c = f[1], v = f[2], b = c - v - r * E;
1004
+ (E || b) && pt(e, u) && (s += b, h += E), u = u.parentNode;
1005
+ } while (
1006
+ // portaled content
1007
+ !l && u !== document.body || // self content
1008
+ l && (n.contains(u) || n === u)
1009
+ );
1010
+ return (p && (a && s === 0 || !a && i > s) || !p && (a && h === 0 || !a && -i > h)) && (d = !0), d;
1011
+ }, ae = function(e) {
1012
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
1013
+ }, ze = function(e) {
1014
+ return [e.deltaX, e.deltaY];
1015
+ }, Xe = function(e) {
1016
+ return e && "current" in e ? e.current : e;
1017
+ }, Un = function(e, n) {
1018
+ return e[0] === n[0] && e[1] === n[1];
1019
+ }, Hn = function(e) {
1020
+ return `
1021
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
1022
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
1023
+ `);
1024
+ }, Gn = 0, Y = [];
1025
+ function Kn(e) {
1026
+ var n = g.useRef([]), t = g.useRef([0, 0]), o = g.useRef(), a = g.useState(Gn++)[0], r = g.useState(function() {
1027
+ return lt();
1028
+ })[0], i = g.useRef(e);
1029
+ g.useEffect(function() {
1030
+ i.current = e;
1031
+ }, [e]), g.useEffect(function() {
1032
+ if (e.inert) {
1033
+ document.body.classList.add("block-interactivity-".concat(a));
1034
+ var c = fn([e.lockRef.current], (e.shards || []).map(Xe), !0).filter(Boolean);
1035
+ return c.forEach(function(v) {
1036
+ return v.classList.add("allow-interactivity-".concat(a));
1037
+ }), function() {
1038
+ document.body.classList.remove("block-interactivity-".concat(a)), c.forEach(function(v) {
1039
+ return v.classList.remove("allow-interactivity-".concat(a));
1040
+ });
1041
+ };
1042
+ }
1043
+ }, [e.inert, e.lockRef.current, e.shards]);
1044
+ var u = g.useCallback(function(c, v) {
1045
+ if ("touches" in c && c.touches.length === 2)
1046
+ return !i.current.allowPinchZoom;
1047
+ var b = ae(c), x = t.current, $ = "deltaX" in c ? c.deltaX : x[0] - b[0], y = "deltaY" in c ? c.deltaY : x[1] - b[1], S, U = c.target, T = Math.abs($) > Math.abs(y) ? "h" : "v";
1048
+ if ("touches" in c && T === "h" && U.type === "range")
1049
+ return !1;
1050
+ var w = Ve(T, U);
1051
+ if (!w)
1052
+ return !0;
1053
+ if (w ? S = T : (S = T === "v" ? "h" : "v", w = Ve(T, U)), !w)
1054
+ return !1;
1055
+ if (!o.current && "changedTouches" in c && ($ || y) && (o.current = S), !S)
1056
+ return !0;
1057
+ var L = o.current || S;
1058
+ return Wn(L, v, c, L === "h" ? $ : y, !0);
1059
+ }, []), l = g.useCallback(function(c) {
1060
+ var v = c;
1061
+ if (!(!Y.length || Y[Y.length - 1] !== r)) {
1062
+ var b = "deltaY" in v ? ze(v) : ae(v), x = n.current.filter(function(S) {
1063
+ return S.name === v.type && S.target === v.target && Un(S.delta, b);
1064
+ })[0];
1065
+ if (x && x.should) {
1066
+ v.cancelable && v.preventDefault();
1067
+ return;
1068
+ }
1069
+ if (!x) {
1070
+ var $ = (i.current.shards || []).map(Xe).filter(Boolean).filter(function(S) {
1071
+ return S.contains(v.target);
1072
+ }), y = $.length > 0 ? u(v, $[0]) : !i.current.noIsolation;
1073
+ y && v.cancelable && v.preventDefault();
1074
+ }
1075
+ }
1076
+ }, []), d = g.useCallback(function(c, v, b, x) {
1077
+ var $ = { name: c, delta: v, target: b, should: x };
1078
+ n.current.push($), setTimeout(function() {
1079
+ n.current = n.current.filter(function(y) {
1080
+ return y !== $;
1081
+ });
1082
+ }, 1);
1083
+ }, []), p = g.useCallback(function(c) {
1084
+ t.current = ae(c), o.current = void 0;
1085
+ }, []), s = g.useCallback(function(c) {
1086
+ d(c.type, ze(c), c.target, u(c, e.lockRef.current));
1087
+ }, []), h = g.useCallback(function(c) {
1088
+ d(c.type, ae(c), c.target, u(c, e.lockRef.current));
1089
+ }, []);
1090
+ g.useEffect(function() {
1091
+ return Y.push(r), e.setCallbacks({
1092
+ onScrollCapture: s,
1093
+ onWheelCapture: s,
1094
+ onTouchMoveCapture: h
1095
+ }), document.addEventListener("wheel", l, X), document.addEventListener("touchmove", l, X), document.addEventListener("touchstart", p, X), function() {
1096
+ Y = Y.filter(function(c) {
1097
+ return c !== r;
1098
+ }), document.removeEventListener("wheel", l, X), document.removeEventListener("touchmove", l, X), document.removeEventListener("touchstart", p, X);
1099
+ };
1100
+ }, []);
1101
+ var f = e.removeScrollBar, E = e.inert;
1102
+ return g.createElement(
1103
+ g.Fragment,
1104
+ null,
1105
+ E ? g.createElement(r, { styles: Hn(a) }) : null,
1106
+ f ? g.createElement(Rn, { gapMode: "margin" }) : null
1107
+ );
1108
+ }
1109
+ const Vn = En(st, Kn);
1110
+ var vt = g.forwardRef(function(e, n) {
1111
+ return g.createElement(ge, F({}, e, { ref: n, sideCar: Vn }));
1112
+ });
1113
+ vt.classNames = ge.classNames;
1114
+ const zn = vt;
1115
+ var Xn = function(e) {
1116
+ if (typeof document > "u")
1117
+ return null;
1118
+ var n = Array.isArray(e) ? e[0] : e;
1119
+ return n.ownerDocument.body;
1120
+ }, q = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), ue = {}, we = 0, ht = function(e) {
1121
+ return e && (e.host || ht(e.parentNode));
1122
+ }, Yn = function(e, n) {
1123
+ return n.map(function(t) {
1124
+ if (e.contains(t))
1125
+ return t;
1126
+ var o = ht(t);
1127
+ return o && e.contains(o) ? o : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
1128
+ }).filter(function(t) {
1129
+ return !!t;
1130
+ });
1131
+ }, qn = function(e, n, t, o) {
1132
+ var a = Yn(n, Array.isArray(e) ? e : [e]);
1133
+ ue[t] || (ue[t] = /* @__PURE__ */ new WeakMap());
1134
+ var r = ue[t], i = [], u = /* @__PURE__ */ new Set(), l = new Set(a), d = function(s) {
1135
+ !s || u.has(s) || (u.add(s), d(s.parentNode));
1136
+ };
1137
+ a.forEach(d);
1138
+ var p = function(s) {
1139
+ !s || l.has(s) || Array.prototype.forEach.call(s.children, function(h) {
1140
+ if (u.has(h))
1141
+ p(h);
1142
+ else {
1143
+ var f = h.getAttribute(o), E = f !== null && f !== "false", c = (q.get(h) || 0) + 1, v = (r.get(h) || 0) + 1;
1144
+ q.set(h, c), r.set(h, v), i.push(h), c === 1 && E && ie.set(h, !0), v === 1 && h.setAttribute(t, "true"), E || h.setAttribute(o, "true");
1145
+ }
1146
+ });
1147
+ };
1148
+ return p(n), u.clear(), we++, function() {
1149
+ i.forEach(function(s) {
1150
+ var h = q.get(s) - 1, f = r.get(s) - 1;
1151
+ q.set(s, h), r.set(s, f), h || (ie.has(s) || s.removeAttribute(o), ie.delete(s)), f || s.removeAttribute(t);
1152
+ }), we--, we || (q = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), ue = {});
1153
+ };
1154
+ }, Zn = function(e, n, t) {
1155
+ t === void 0 && (t = "data-aria-hidden");
1156
+ var o = Array.from(Array.isArray(e) ? e : [e]), a = n || Xn(e);
1157
+ return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live]"))), qn(o, a, t, "aria-hidden")) : function() {
1158
+ return null;
1159
+ };
1160
+ };
1161
+ const gt = "Dialog", [mt, wo] = Ft(gt), [Qn, M] = mt(gt), Jn = (e) => {
1162
+ const { __scopeDialog: n, children: t, open: o, defaultOpen: a, onOpenChange: r, modal: i = !0 } = e, u = O(null), l = O(null), [d = !1, p] = Wt({
1163
+ prop: o,
1164
+ defaultProp: a,
1165
+ onChange: r
1166
+ });
1167
+ return /* @__PURE__ */ m(Qn, {
1168
+ scope: n,
1169
+ triggerRef: u,
1170
+ contentRef: l,
1171
+ contentId: me(),
1172
+ titleId: me(),
1173
+ descriptionId: me(),
1174
+ open: d,
1175
+ onOpenChange: p,
1176
+ onOpenToggle: Q(
1177
+ () => p(
1178
+ (s) => !s
1179
+ ),
1180
+ [
1181
+ p
1182
+ ]
1183
+ ),
1184
+ modal: i
1185
+ }, t);
1186
+ }, er = "DialogTrigger", tr = /* @__PURE__ */ C((e, n) => {
1187
+ const { __scopeDialog: t, ...o } = e, a = M(er, t), r = J(n, a.triggerRef);
1188
+ return /* @__PURE__ */ m(W.button, P({
1189
+ type: "button",
1190
+ "aria-haspopup": "dialog",
1191
+ "aria-expanded": a.open,
1192
+ "aria-controls": a.contentId,
1193
+ "data-state": Le(a.open)
1194
+ }, o, {
1195
+ ref: r,
1196
+ onClick: j(e.onClick, a.onOpenToggle)
1197
+ }));
1198
+ }), _t = "DialogPortal", [nr, bt] = mt(_t, {
1199
+ forceMount: void 0
1200
+ }), rr = (e) => {
1201
+ const { __scopeDialog: n, forceMount: t, children: o, container: a } = e, r = M(_t, n);
1202
+ return /* @__PURE__ */ m(nr, {
1203
+ scope: n,
1204
+ forceMount: t
1205
+ }, R.map(
1206
+ o,
1207
+ (i) => /* @__PURE__ */ m(he, {
1208
+ present: t || r.open
1209
+ }, /* @__PURE__ */ m(sn, {
1210
+ asChild: !0,
1211
+ container: a
1212
+ }, i))
1213
+ ));
1214
+ }, Te = "DialogOverlay", or = /* @__PURE__ */ C((e, n) => {
1215
+ const t = bt(Te, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = M(Te, e.__scopeDialog);
1216
+ return r.modal ? /* @__PURE__ */ m(he, {
1217
+ present: o || r.open
1218
+ }, /* @__PURE__ */ m(ar, P({}, a, {
1219
+ ref: n
1220
+ }))) : null;
1221
+ }), ar = /* @__PURE__ */ C((e, n) => {
1222
+ const { __scopeDialog: t, ...o } = e, a = M(Te, t);
1223
+ return (
1224
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1225
+ // ie. when `Overlay` and `Content` are siblings
1226
+ /* @__PURE__ */ m(zn, {
1227
+ as: Re,
1228
+ allowPinchZoom: !0,
1229
+ shards: [
1230
+ a.contentRef
1231
+ ]
1232
+ }, /* @__PURE__ */ m(W.div, P({
1233
+ "data-state": Le(a.open)
1234
+ }, o, {
1235
+ ref: n,
1236
+ style: {
1237
+ pointerEvents: "auto",
1238
+ ...o.style
1239
+ }
1240
+ })))
1241
+ );
1242
+ }), ee = "DialogContent", ir = /* @__PURE__ */ C((e, n) => {
1243
+ const t = bt(ee, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = M(ee, e.__scopeDialog);
1244
+ return /* @__PURE__ */ m(he, {
1245
+ present: o || r.open
1246
+ }, r.modal ? /* @__PURE__ */ m(ur, P({}, a, {
1247
+ ref: n
1248
+ })) : /* @__PURE__ */ m(cr, P({}, a, {
1249
+ ref: n
1250
+ })));
1251
+ }), ur = /* @__PURE__ */ C((e, n) => {
1252
+ const t = M(ee, e.__scopeDialog), o = O(null), a = J(n, t.contentRef, o);
1253
+ return A(() => {
1254
+ const r = o.current;
1255
+ if (r)
1256
+ return Zn(r);
1257
+ }, []), /* @__PURE__ */ m($t, P({}, e, {
1258
+ ref: a,
1259
+ trapFocus: t.open,
1260
+ disableOutsidePointerEvents: !0,
1261
+ onCloseAutoFocus: j(e.onCloseAutoFocus, (r) => {
1262
+ var i;
1263
+ r.preventDefault(), (i = t.triggerRef.current) === null || i === void 0 || i.focus();
1264
+ }),
1265
+ onPointerDownOutside: j(e.onPointerDownOutside, (r) => {
1266
+ const i = r.detail.originalEvent, u = i.button === 0 && i.ctrlKey === !0;
1267
+ (i.button === 2 || u) && r.preventDefault();
1268
+ }),
1269
+ onFocusOutside: j(
1270
+ e.onFocusOutside,
1271
+ (r) => r.preventDefault()
1272
+ )
1273
+ }));
1274
+ }), cr = /* @__PURE__ */ C((e, n) => {
1275
+ const t = M(ee, e.__scopeDialog), o = O(!1), a = O(!1);
1276
+ return /* @__PURE__ */ m($t, P({}, e, {
1277
+ ref: n,
1278
+ trapFocus: !1,
1279
+ disableOutsidePointerEvents: !1,
1280
+ onCloseAutoFocus: (r) => {
1281
+ var i;
1282
+ if ((i = e.onCloseAutoFocus) === null || i === void 0 || i.call(e, r), !r.defaultPrevented) {
1283
+ var u;
1284
+ o.current || (u = t.triggerRef.current) === null || u === void 0 || u.focus(), r.preventDefault();
1285
+ }
1286
+ o.current = !1, a.current = !1;
1287
+ },
1288
+ onInteractOutside: (r) => {
1289
+ var i, u;
1290
+ (i = e.onInteractOutside) === null || i === void 0 || i.call(e, r), r.defaultPrevented || (o.current = !0, r.detail.originalEvent.type === "pointerdown" && (a.current = !0));
1291
+ const l = r.target;
1292
+ ((u = t.triggerRef.current) === null || u === void 0 ? void 0 : u.contains(l)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && a.current && r.preventDefault();
1293
+ }
1294
+ }));
1295
+ }), $t = /* @__PURE__ */ C((e, n) => {
1296
+ const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: r, ...i } = e, u = M(ee, t), l = O(null), d = J(n, l);
1297
+ return pn(), /* @__PURE__ */ m(Ie, null, /* @__PURE__ */ m(tn, {
1298
+ asChild: !0,
1299
+ loop: !0,
1300
+ trapped: o,
1301
+ onMountAutoFocus: a,
1302
+ onUnmountAutoFocus: r
1303
+ }, /* @__PURE__ */ m(Qt, P({
1304
+ role: "dialog",
1305
+ id: u.contentId,
1306
+ "aria-describedby": u.descriptionId,
1307
+ "aria-labelledby": u.titleId,
1308
+ "data-state": Le(u.open)
1309
+ }, i, {
1310
+ ref: d,
1311
+ onDismiss: () => u.onOpenChange(!1)
1312
+ }))), !1);
1313
+ }), sr = "DialogTitle", lr = /* @__PURE__ */ C((e, n) => {
1314
+ const { __scopeDialog: t, ...o } = e, a = M(sr, t);
1315
+ return /* @__PURE__ */ m(W.h2, P({
1316
+ id: a.titleId
1317
+ }, o, {
1318
+ ref: n
1319
+ }));
1320
+ }), dr = "DialogDescription", pr = /* @__PURE__ */ C((e, n) => {
1321
+ const { __scopeDialog: t, ...o } = e, a = M(dr, t);
1322
+ return /* @__PURE__ */ m(W.p, P({
1323
+ id: a.descriptionId
1324
+ }, o, {
1325
+ ref: n
1326
+ }));
1327
+ }), fr = "DialogClose", vr = /* @__PURE__ */ C((e, n) => {
1328
+ const { __scopeDialog: t, ...o } = e, a = M(fr, t);
1329
+ return /* @__PURE__ */ m(W.button, P({
1330
+ type: "button"
1331
+ }, o, {
1332
+ ref: n,
1333
+ onClick: j(
1334
+ e.onClick,
1335
+ () => a.onOpenChange(!1)
1336
+ )
1337
+ }));
1338
+ });
1339
+ function Le(e) {
1340
+ return e ? "open" : "closed";
1341
+ }
1342
+ const hr = Jn, gr = tr, mr = rr, _r = or, br = ir, $r = lr, Ye = pr, yr = vr, qe = {
1343
+ SM: "sm",
1344
+ MD: "md",
1345
+ LG: "lg"
1346
+ };
1347
+ function Er(e) {
1348
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1349
+ }
1350
+ var yt = { exports: {} };
1351
+ /*!
1352
+ Copyright (c) 2018 Jed Watson.
1353
+ Licensed under the MIT License (MIT), see
1354
+ http://jedwatson.github.io/classnames
1355
+ */
1356
+ (function(e) {
1357
+ (function() {
1358
+ var n = {}.hasOwnProperty;
1359
+ function t() {
1360
+ for (var r = "", i = 0; i < arguments.length; i++) {
1361
+ var u = arguments[i];
1362
+ u && (r = a(r, o(u)));
1363
+ }
1364
+ return r;
1365
+ }
1366
+ function o(r) {
1367
+ if (typeof r == "string" || typeof r == "number")
1368
+ return r;
1369
+ if (typeof r != "object")
1370
+ return "";
1371
+ if (Array.isArray(r))
1372
+ return t.apply(null, r);
1373
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1374
+ return r.toString();
1375
+ var i = "";
1376
+ for (var u in r)
1377
+ n.call(r, u) && r[u] && (i = a(i, u));
1378
+ return i;
1379
+ }
1380
+ function a(r, i) {
1381
+ return i ? r ? r + " " + i : r + i : r;
1382
+ }
1383
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1384
+ })();
1385
+ })(yt);
1386
+ var wr = yt.exports;
1387
+ const Ze = /* @__PURE__ */ Er(wr), Sr = "_rotate_7s2g1_1", Cr = "_dash_7s2g1_1", ce = {
1388
+ "purpur-spinner": "_purpur-spinner_7s2g1_1",
1389
+ rotate: Sr,
1390
+ "purpur-spinner--xxs": "_purpur-spinner--xxs_7s2g1_4",
1391
+ "purpur-spinner--xs": "_purpur-spinner--xs_7s2g1_8",
1392
+ "purpur-spinner--sm": "_purpur-spinner--sm_7s2g1_12",
1393
+ "purpur-spinner--md": "_purpur-spinner--md_7s2g1_16",
1394
+ "purpur-spinner--lg": "_purpur-spinner--lg_7s2g1_20",
1395
+ "purpur-spinner__circle": "_purpur-spinner__circle_7s2g1_24",
1396
+ dash: Cr,
1397
+ "purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_7s2g1_33",
1398
+ "purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_7s2g1_36",
1399
+ "purpur-spinner__circle--negative-disabled": "_purpur-spinner__circle--negative-disabled_7s2g1_39"
1400
+ }, se = "purpur-spinner", xr = {
1401
+ PRIMARY: "primary",
1402
+ DISABLED: "disabled",
1403
+ NEGATIVE: "negative",
1404
+ NEGATIVE_DISABLED: "negative-disabled"
1405
+ }, Or = {
1406
+ XXS: "xxs",
1407
+ XS: "xs",
1408
+ SM: "sm",
1409
+ MD: "md",
1410
+ LG: "lg"
1411
+ }, Pr = ({
1412
+ ["data-testid"]: e,
1413
+ size: n = Or.SM,
1414
+ variant: t = xr.PRIMARY,
1415
+ ...o
1416
+ }) => /* @__PURE__ */ _(
1417
+ "div",
1418
+ {
1419
+ className: Ze([ce[se], ce[`${se}--${n}`]]),
1420
+ "data-testid": e,
1421
+ ...o,
1422
+ children: /* @__PURE__ */ _("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ _(
1423
+ "circle",
1424
+ {
1425
+ className: Ze(
1426
+ ce[`${se}__circle`],
1427
+ ce[`${se}__circle--${t}`]
1428
+ ),
1429
+ cx: "25",
1430
+ cy: "25",
1431
+ r: "20"
1432
+ }
1433
+ ) })
1434
+ }
1435
+ );
1436
+ function Nr(e) {
1437
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1438
+ }
1439
+ var Et = { exports: {} };
1440
+ /*!
1441
+ Copyright (c) 2018 Jed Watson.
1442
+ Licensed under the MIT License (MIT), see
1443
+ http://jedwatson.github.io/classnames
1444
+ */
1445
+ (function(e) {
1446
+ (function() {
1447
+ var n = {}.hasOwnProperty;
1448
+ function t() {
1449
+ for (var r = "", i = 0; i < arguments.length; i++) {
1450
+ var u = arguments[i];
1451
+ u && (r = a(r, o(u)));
1452
+ }
1453
+ return r;
1454
+ }
1455
+ function o(r) {
1456
+ if (typeof r == "string" || typeof r == "number")
1457
+ return r;
1458
+ if (typeof r != "object")
1459
+ return "";
1460
+ if (Array.isArray(r))
1461
+ return t.apply(null, r);
1462
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1463
+ return r.toString();
1464
+ var i = "";
1465
+ for (var u in r)
1466
+ n.call(r, u) && r[u] && (i = a(i, u));
1467
+ return i;
1468
+ }
1469
+ function a(r, i) {
1470
+ return i ? r ? r + " " + i : r + i : r;
1471
+ }
1472
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1473
+ })();
1474
+ })(Et);
1475
+ var Ar = Et.exports;
1476
+ const Tr = /* @__PURE__ */ Nr(Ar), H = {
1477
+ "purpur-button": "_purpur-button_1fna2_1",
1478
+ "purpur-button--sm": "_purpur-button--sm_1fna2_33",
1479
+ "purpur-button--icon-only": "_purpur-button--icon-only_1fna2_36",
1480
+ "purpur-button--md": "_purpur-button--md_1fna2_39",
1481
+ "purpur-button--lg": "_purpur-button--lg_1fna2_45",
1482
+ "purpur-button--full-width": "_purpur-button--full-width_1fna2_51",
1483
+ "purpur-button--primary": "_purpur-button--primary_1fna2_54",
1484
+ "purpur-button--disabled": "_purpur-button--disabled_1fna2_58",
1485
+ "purpur-button--primary-negative": "_purpur-button--primary-negative_1fna2_64",
1486
+ "purpur-button--secondary": "_purpur-button--secondary_1fna2_76",
1487
+ "purpur-button--secondary-negative": "_purpur-button--secondary-negative_1fna2_87",
1488
+ "purpur-button--expressive": "_purpur-button--expressive_1fna2_98",
1489
+ "purpur-button--expressive-negative": "_purpur-button--expressive-negative_1fna2_108",
1490
+ "purpur-button--negative": "_purpur-button--negative_1fna2_120",
1491
+ "purpur-button--destructive": "_purpur-button--destructive_1fna2_127",
1492
+ "purpur-button--destructive-negative": "_purpur-button--destructive-negative_1fna2_137",
1493
+ "purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_1fna2_147",
1494
+ "purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1fna2_160",
1495
+ "purpur-button--text-negative": "_purpur-button--text-negative_1fna2_175",
1496
+ "purpur-button--text": "_purpur-button--text_1fna2_175"
1497
+ }, G = "purpur-button", Dr = ({
1498
+ children: e,
1499
+ className: n,
1500
+ ["data-testid"]: t,
1501
+ disabled: o = !1,
1502
+ fullWidth: a = !1,
1503
+ iconOnly: r,
1504
+ loading: i = !1,
1505
+ onClick: u,
1506
+ size: l = qe.MD,
1507
+ variant: d,
1508
+ type: p = "button",
1509
+ ...s
1510
+ }, h) => {
1511
+ if (r && d === "destructive")
1512
+ return null;
1513
+ const f = Tr(
1514
+ [
1515
+ H[G],
1516
+ H[`${G}--${d}`],
1517
+ H[`${G}--${l}`]
1518
+ ],
1519
+ {
1520
+ [H[`${G}--icon-only`]]: r,
1521
+ [H[`${G}--negative`]]: d.endsWith("negative"),
1522
+ [H[`${G}--full-width`]]: a,
1523
+ [H[`${G}--disabled`]]: o || i
1524
+ },
1525
+ n
1526
+ ), E = (v) => {
1527
+ o || i ? v.preventDefault() : u && u(v);
1528
+ }, c = () => d.endsWith("negative") ? "negative-disabled" : "disabled";
1529
+ return /* @__PURE__ */ K(
1530
+ "button",
1531
+ {
1532
+ className: f,
1533
+ "data-testid": t,
1534
+ type: p,
1535
+ ref: h,
1536
+ "aria-disabled": s["aria-disabled"] || o || i,
1537
+ onClick: E,
1538
+ ...s,
1539
+ children: [
1540
+ i && /* @__PURE__ */ _(Pr, { size: l === qe.LG ? "xs" : "xxs", variant: c() }),
1541
+ " ",
1542
+ e
1543
+ ]
1544
+ }
1545
+ );
1546
+ }, Me = C(Dr);
1547
+ Me.displayName = "Button";
1548
+ function Ir(e) {
1549
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1550
+ }
1551
+ var wt = { exports: {} };
1552
+ /*!
1553
+ Copyright (c) 2018 Jed Watson.
1554
+ Licensed under the MIT License (MIT), see
1555
+ http://jedwatson.github.io/classnames
1556
+ */
1557
+ (function(e) {
1558
+ (function() {
1559
+ var n = {}.hasOwnProperty;
1560
+ function t() {
1561
+ for (var r = "", i = 0; i < arguments.length; i++) {
1562
+ var u = arguments[i];
1563
+ u && (r = a(r, o(u)));
1564
+ }
1565
+ return r;
1566
+ }
1567
+ function o(r) {
1568
+ if (typeof r == "string" || typeof r == "number")
1569
+ return r;
1570
+ if (typeof r != "object")
1571
+ return "";
1572
+ if (Array.isArray(r))
1573
+ return t.apply(null, r);
1574
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1575
+ return r.toString();
1576
+ var i = "";
1577
+ for (var u in r)
1578
+ n.call(r, u) && r[u] && (i = a(i, u));
1579
+ return i;
1580
+ }
1581
+ function a(r, i) {
1582
+ return i ? r ? r + " " + i : r + i : r;
1583
+ }
1584
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1585
+ })();
1586
+ })(wt);
1587
+ var Rr = wt.exports;
1588
+ const Lr = /* @__PURE__ */ Ir(Rr), Se = {
1589
+ "purpur-heading": "_purpur-heading_2c2y0_1",
1590
+ "purpur-heading--hyphens": "_purpur-heading--hyphens_2c2y0_8",
1591
+ "purpur-heading--subsection-100": "_purpur-heading--subsection-100_2c2y0_11",
1592
+ "purpur-heading--title-100": "_purpur-heading--title-100_2c2y0_17",
1593
+ "purpur-heading--title-200": "_purpur-heading--title-200_2c2y0_23",
1594
+ "purpur-heading--title-300": "_purpur-heading--title-300_2c2y0_29",
1595
+ "purpur-heading--title-400": "_purpur-heading--title-400_2c2y0_35",
1596
+ "purpur-heading--title-500": "_purpur-heading--title-500_2c2y0_41",
1597
+ "purpur-heading--title-600": "_purpur-heading--title-600_2c2y0_47",
1598
+ "purpur-heading--title-700": "_purpur-heading--title-700_2c2y0_53",
1599
+ "purpur-heading--display-25": "_purpur-heading--display-25_2c2y0_59",
1600
+ "purpur-heading--display-50": "_purpur-heading--display-50_2c2y0_65",
1601
+ "purpur-heading--display-100": "_purpur-heading--display-100_2c2y0_71",
1602
+ "purpur-heading--display-200": "_purpur-heading--display-200_2c2y0_77"
1603
+ }, Mr = {
1604
+ TITLE100: "title-100",
1605
+ TITLE200: "title-200",
1606
+ TITLE300: "title-300",
1607
+ TITLE400: "title-400",
1608
+ TITLE500: "title-500",
1609
+ TITLE600: "title-600",
1610
+ TITLE700: "title-700",
1611
+ SUBSECTION100: "subsection-100"
1612
+ }, Ce = "purpur-heading", Fr = ({
1613
+ ["data-testid"]: e,
1614
+ children: n,
1615
+ className: t = "",
1616
+ enableHyphenation: o = !1,
1617
+ tag: a,
1618
+ variant: r = Mr.TITLE100,
1619
+ ...i
1620
+ }) => {
1621
+ const u = a, l = Lr([
1622
+ t,
1623
+ Se[Ce],
1624
+ Se[`${Ce}--${r}`],
1625
+ {
1626
+ [Se[`${Ce}--hyphens`]]: o
1627
+ }
1628
+ ]);
1629
+ return /* @__PURE__ */ _(u, { ...i, className: l, "data-testid": e, children: n });
1630
+ };
1631
+ function kr(e) {
1632
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1633
+ }
1634
+ var St = { exports: {} };
1635
+ /*!
1636
+ Copyright (c) 2018 Jed Watson.
1637
+ Licensed under the MIT License (MIT), see
1638
+ http://jedwatson.github.io/classnames
1639
+ */
1640
+ (function(e) {
1641
+ (function() {
1642
+ var n = {}.hasOwnProperty;
1643
+ function t() {
1644
+ for (var r = "", i = 0; i < arguments.length; i++) {
1645
+ var u = arguments[i];
1646
+ u && (r = a(r, o.call(this, u)));
1647
+ }
1648
+ return r;
1649
+ }
1650
+ function o(r) {
1651
+ if (typeof r == "string" || typeof r == "number")
1652
+ return this && this[r] || r;
1653
+ if (typeof r != "object")
1654
+ return "";
1655
+ if (Array.isArray(r))
1656
+ return t.apply(this, r);
1657
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1658
+ return r.toString();
1659
+ var i = "";
1660
+ for (var u in r)
1661
+ n.call(r, u) && r[u] && (i = a(i, this && this[u] || u));
1662
+ return i;
1663
+ }
1664
+ function a(r, i) {
1665
+ return i ? r ? r + " " + i : r + i : r;
1666
+ }
1667
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1668
+ })();
1669
+ })(St);
1670
+ var jr = St.exports;
1671
+ const Br = /* @__PURE__ */ kr(jr), Wr = {
1672
+ "purpur-icon": "_purpur-icon_8u1lq_1",
1673
+ "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
1674
+ "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
1675
+ "purpur-icon--sm": "_purpur-icon--sm_8u1lq_12",
1676
+ "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
1677
+ "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
1678
+ "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
1679
+ }, Ur = {
1680
+ name: "close",
1681
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
1682
+ keywords: ["close"],
1683
+ category: "utility"
1684
+ }, Ct = (e) => /* @__PURE__ */ _(
1685
+ Xr,
1686
+ {
1687
+ ...e,
1688
+ svg: Ur
1689
+ }
1690
+ );
1691
+ Ct.displayName = "IconClose";
1692
+ const Hr = Br.bind(Wr), Qe = "purpur-icon", Gr = "md", Kr = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Vr = ({ content: e = "", title: n } = {}) => {
1693
+ const t = [
1694
+ { name: "xmlns", value: "http://www.w3.org/2000/svg" },
1695
+ { name: "fill", value: "currentColor" },
1696
+ { name: "viewBox", value: "0 0 24 24" },
1697
+ n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
1698
+ ], o = n ? `<title>${n}</title>` : "";
1699
+ return `<svg ${Kr(t)}>${o}${e}</svg>`;
1700
+ }, zr = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Xr = ({
1701
+ ["data-testid"]: e,
1702
+ svg: n,
1703
+ allyTitle: t,
1704
+ className: o = "",
1705
+ size: a = Gr,
1706
+ ...r
1707
+ }) => {
1708
+ const i = Vr({
1709
+ content: zr(n.svg),
1710
+ title: t
1711
+ }), u = Hr(o, Qe, `${Qe}--${a}`);
1712
+ return /* @__PURE__ */ _(
1713
+ "span",
1714
+ {
1715
+ "aria-label": t,
1716
+ className: u,
1717
+ "data-testid": e,
1718
+ dangerouslySetInnerHTML: { __html: i },
1719
+ ...r
1720
+ }
1721
+ );
1722
+ };
1723
+ function Yr(e) {
1724
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1725
+ }
1726
+ var xt = { exports: {} };
1727
+ /*!
1728
+ Copyright (c) 2018 Jed Watson.
1729
+ Licensed under the MIT License (MIT), see
1730
+ http://jedwatson.github.io/classnames
1731
+ */
1732
+ (function(e) {
1733
+ (function() {
1734
+ var n = {}.hasOwnProperty;
1735
+ function t() {
1736
+ for (var r = "", i = 0; i < arguments.length; i++) {
1737
+ var u = arguments[i];
1738
+ u && (r = a(r, o(u)));
1739
+ }
1740
+ return r;
1741
+ }
1742
+ function o(r) {
1743
+ if (typeof r == "string" || typeof r == "number")
1744
+ return r;
1745
+ if (typeof r != "object")
1746
+ return "";
1747
+ if (Array.isArray(r))
1748
+ return t.apply(null, r);
1749
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1750
+ return r.toString();
1751
+ var i = "";
1752
+ for (var u in r)
1753
+ n.call(r, u) && r[u] && (i = a(i, u));
1754
+ return i;
1755
+ }
1756
+ function a(r, i) {
1757
+ return i ? r ? r + " " + i : r + i : r;
1758
+ }
1759
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1760
+ })();
1761
+ })(xt);
1762
+ var qr = xt.exports;
1763
+ const Zr = /* @__PURE__ */ Yr(qr), le = {
1764
+ "purpur-paragraph": "_purpur-paragraph_hwaj6_1",
1765
+ "purpur-paragraph--disabled": "_purpur-paragraph--disabled_hwaj6_7",
1766
+ "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_hwaj6_10",
1767
+ "purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_hwaj6_13",
1768
+ "purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_hwaj6_19",
1769
+ "purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_hwaj6_26",
1770
+ "purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_hwaj6_33",
1771
+ "purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_hwaj6_39",
1772
+ "purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_hwaj6_45",
1773
+ "purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_hwaj6_51",
1774
+ "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_hwaj6_57",
1775
+ "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_hwaj6_64",
1776
+ "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_hwaj6_71"
1777
+ }, Qr = {
1778
+ PARAGRAPH100: "paragraph-100",
1779
+ PARAGRAPH100MEDIUM: "paragraph-100-medium",
1780
+ PARAGRAPH100BOLD: "paragraph-100-bold",
1781
+ PARAGRAPH200: "paragraph-200",
1782
+ PREAMBLE100: "preamble-100",
1783
+ PREAMBLE200: "preamble-200",
1784
+ ADDITIONAL100: "additional-100",
1785
+ ADDITIONAL100MEDIUM: "additional-100-medium",
1786
+ OVERLINE100: "overline-100",
1787
+ OVERLINE200: "overline-200"
1788
+ }, de = "purpur-paragraph", Jr = ({
1789
+ ["data-testid"]: e,
1790
+ children: n,
1791
+ className: t = "",
1792
+ disabled: o,
1793
+ enableHyphenation: a = !1,
1794
+ variant: r = Qr.PARAGRAPH100,
1795
+ ...i
1796
+ }) => {
1797
+ const u = Zr([
1798
+ t,
1799
+ le[de],
1800
+ le[`${de}--${r}`],
1801
+ {
1802
+ [le[`${de}--hyphens`]]: a,
1803
+ [le[`${de}--disabled`]]: o
1804
+ }
1805
+ ]);
1806
+ return /* @__PURE__ */ _("p", { ...i, className: u, "data-testid": e, children: n });
1807
+ };
1808
+ function Z() {
1809
+ return Z = Object.assign ? Object.assign.bind() : function(e) {
1810
+ for (var n = 1; n < arguments.length; n++) {
1811
+ var t = arguments[n];
1812
+ for (var o in t)
1813
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
1814
+ }
1815
+ return e;
1816
+ }, Z.apply(this, arguments);
1817
+ }
1818
+ function eo(e, n) {
1819
+ typeof e == "function" ? e(n) : e != null && (e.current = n);
1820
+ }
1821
+ function to(...e) {
1822
+ return (n) => e.forEach(
1823
+ (t) => eo(t, n)
1824
+ );
1825
+ }
1826
+ const Ot = /* @__PURE__ */ C((e, n) => {
1827
+ const { children: t, ...o } = e, a = R.toArray(t), r = a.find(ro);
1828
+ if (r) {
1829
+ const i = r.props.children, u = a.map((l) => l === r ? R.count(i) > 1 ? R.only(null) : /* @__PURE__ */ B(i) ? i.props.children : null : l);
1830
+ return /* @__PURE__ */ m(De, Z({}, o, {
1831
+ ref: n
1832
+ }), /* @__PURE__ */ B(i) ? /* @__PURE__ */ te(i, void 0, u) : null);
1833
+ }
1834
+ return /* @__PURE__ */ m(De, Z({}, o, {
1835
+ ref: n
1836
+ }), t);
1837
+ });
1838
+ Ot.displayName = "Slot";
1839
+ const De = /* @__PURE__ */ C((e, n) => {
1840
+ const { children: t, ...o } = e;
1841
+ return /* @__PURE__ */ B(t) ? /* @__PURE__ */ te(t, {
1842
+ ...oo(o, t.props),
1843
+ ref: n ? to(n, t.ref) : t.ref
1844
+ }) : R.count(t) > 1 ? R.only(null) : null;
1845
+ });
1846
+ De.displayName = "SlotClone";
1847
+ const no = ({ children: e }) => /* @__PURE__ */ m(Ie, null, e);
1848
+ function ro(e) {
1849
+ return /* @__PURE__ */ B(e) && e.type === no;
1850
+ }
1851
+ function oo(e, n) {
1852
+ const t = {
1853
+ ...n
1854
+ };
1855
+ for (const o in n) {
1856
+ const a = e[o], r = n[o];
1857
+ /^on[A-Z]/.test(o) ? a && r ? t[o] = (...i) => {
1858
+ r(...i), a(...i);
1859
+ } : a && (t[o] = a) : o === "style" ? t[o] = {
1860
+ ...a,
1861
+ ...r
1862
+ } : o === "className" && (t[o] = [
1863
+ a,
1864
+ r
1865
+ ].filter(Boolean).join(" "));
1866
+ }
1867
+ return {
1868
+ ...e,
1869
+ ...t
1870
+ };
1871
+ }
1872
+ const ao = [
1873
+ "a",
1874
+ "button",
1875
+ "div",
1876
+ "form",
1877
+ "h2",
1878
+ "h3",
1879
+ "img",
1880
+ "input",
1881
+ "label",
1882
+ "li",
1883
+ "nav",
1884
+ "ol",
1885
+ "p",
1886
+ "span",
1887
+ "svg",
1888
+ "ul"
1889
+ ], io = ao.reduce((e, n) => {
1890
+ const t = /* @__PURE__ */ C((o, a) => {
1891
+ const { asChild: r, ...i } = o, u = r ? Ot : n;
1892
+ return A(() => {
1893
+ window[Symbol.for("radix-ui")] = !0;
1894
+ }, []), /* @__PURE__ */ m(u, Z({}, i, {
1895
+ ref: a
1896
+ }));
1897
+ });
1898
+ return t.displayName = `Primitive.${n}`, {
1899
+ ...e,
1900
+ [n]: t
1901
+ };
1902
+ }, {}), uo = /* @__PURE__ */ C((e, n) => /* @__PURE__ */ m(io.span, Z({}, e, {
1903
+ ref: n,
1904
+ style: {
1905
+ // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
1906
+ position: "absolute",
1907
+ border: 0,
1908
+ width: 1,
1909
+ height: 1,
1910
+ padding: 0,
1911
+ margin: -1,
1912
+ overflow: "hidden",
1913
+ clip: "rect(0, 0, 0, 0)",
1914
+ whiteSpace: "nowrap",
1915
+ wordWrap: "normal",
1916
+ ...e.style
1917
+ }
1918
+ }))), co = uo, so = ({
1919
+ asChild: e,
1920
+ children: n,
1921
+ className: t = "",
1922
+ ["data-testid"]: o
1923
+ }) => /* @__PURE__ */ _(co, { asChild: e, "data-testid": o, className: t, children: n }), lo = "600px";
1924
+ function po(e) {
1925
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1926
+ }
1927
+ var Pt = { exports: {} };
1928
+ /*!
1929
+ Copyright (c) 2018 Jed Watson.
1930
+ Licensed under the MIT License (MIT), see
1931
+ http://jedwatson.github.io/classnames
1932
+ */
1933
+ (function(e) {
1934
+ (function() {
1935
+ var n = {}.hasOwnProperty;
1936
+ function t() {
1937
+ for (var r = "", i = 0; i < arguments.length; i++) {
1938
+ var u = arguments[i];
1939
+ u && (r = a(r, o.call(this, u)));
1940
+ }
1941
+ return r;
1942
+ }
1943
+ function o(r) {
1944
+ if (typeof r == "string" || typeof r == "number")
1945
+ return this && this[r] || r;
1946
+ if (typeof r != "object")
1947
+ return "";
1948
+ if (Array.isArray(r))
1949
+ return t.apply(this, r);
1950
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
1951
+ return r.toString();
1952
+ var i = "";
1953
+ for (var u in r)
1954
+ n.call(r, u) && r[u] && (i = a(i, this && this[u] || u));
1955
+ return i;
1956
+ }
1957
+ function a(r, i) {
1958
+ return i ? r ? r + " " + i : r + i : r;
1959
+ }
1960
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1961
+ })();
1962
+ })(Pt);
1963
+ var fo = Pt.exports;
1964
+ const vo = /* @__PURE__ */ po(fo), ho = "_fadeIn_1fnes_1", go = {
1965
+ "purpur-modal-content": "_purpur-modal-content_1fnes_1",
1966
+ fadeIn: ho,
1967
+ "purpur-modal-content__overlay": "_purpur-modal-content__overlay_1fnes_30",
1968
+ "purpur-modal-content__close-button": "_purpur-modal-content__close-button_1fnes_37",
1969
+ "purpur-modal-content__wrapper": "_purpur-modal-content__wrapper_1fnes_48",
1970
+ "purpur-modal-content__wrapper-inner": "_purpur-modal-content__wrapper-inner_1fnes_59",
1971
+ "purpur-modal-content__image-wrapper": "_purpur-modal-content__image-wrapper_1fnes_68",
1972
+ "purpur-modal-content__header": "_purpur-modal-content__header_1fnes_91",
1973
+ "purpur-modal-content__title": "_purpur-modal-content__title_1fnes_104",
1974
+ "purpur-modal-content__description": "_purpur-modal-content__description_1fnes_107",
1975
+ "purpur-modal-content__body": "_purpur-modal-content__body_1fnes_110",
1976
+ "purpur-modal-content__body-inner": "_purpur-modal-content__body-inner_1fnes_120",
1977
+ "purpur-modal-content__actions": "_purpur-modal-content__actions_1fnes_133",
1978
+ "purpur-modal-content__button": "_purpur-modal-content__button_1fnes_145",
1979
+ "purpur-modal-content--with-image": "_purpur-modal-content--with-image_1fnes_156",
1980
+ "purpur-modal-content--overflow": "_purpur-modal-content--overflow_1fnes_156",
1981
+ "purpur-modal-content--sticky-footer": "_purpur-modal-content--sticky-footer_1fnes_194"
1982
+ }, Je = (e) => e.showCloseButton === !0, D = vo.bind(go), N = "purpur-modal-content", mo = C(
1983
+ ({
1984
+ ["data-testid"]: e,
1985
+ actions: n,
1986
+ children: t,
1987
+ className: o,
1988
+ description: a,
1989
+ disableCloseOnClickOutside: r,
1990
+ hideDescription: i,
1991
+ image: u,
1992
+ primaryActionVariant: l = "primary",
1993
+ stickyButtons: d = !0,
1994
+ title: p,
1995
+ ...s
1996
+ }, h) => {
1997
+ const { closeButtonAllyLabel: f, showCloseButton: E, ...c } = s, [v, b] = V(!1), x = O(null), $ = O(null), y = O(null), S = O(null), U = D([
1998
+ N,
1999
+ { [`${N}--with-image`]: !!u },
2000
+ { [`${N}--overflow`]: v },
2001
+ { [`${N}--sticky-footer`]: d },
2002
+ o
2003
+ ]), T = (I) => e ? `${e} ${I}` : void 0, w = (I) => {
2004
+ r && I.preventDefault();
2005
+ }, L = Q(() => {
2006
+ if (!x.current || !$.current || !y.current || !S.current)
2007
+ return;
2008
+ const I = window.innerWidth < parseInt(lo), Nt = window.getComputedStyle(
2009
+ I ? x.current : y.current,
2010
+ null
2011
+ ), At = parseFloat(Nt.getPropertyValue("height")), Tt = I ? $.current.offsetHeight : S.current.offsetHeight;
2012
+ b(At < Tt);
2013
+ }, []), ne = (I) => {
2014
+ r && !E && I.preventDefault();
2015
+ };
2016
+ return A(() => (window.addEventListener("resize", L), () => {
2017
+ window.removeEventListener("resize", L);
2018
+ }), []), /* @__PURE__ */ K(mr, { children: [
2019
+ /* @__PURE__ */ _(_r, { className: D(`${N}__overlay`) }),
2020
+ /* @__PURE__ */ K(
2021
+ br,
2022
+ {
2023
+ ...c,
2024
+ className: U,
2025
+ "data-testid": e,
2026
+ ref: h,
2027
+ ...!a && { "aria-describedby": void 0 },
2028
+ onPointerDownOutside: w,
2029
+ onOpenAutoFocus: L,
2030
+ onEscapeKeyDown: ne,
2031
+ children: [
2032
+ /* @__PURE__ */ K("div", { ref: x, className: D(`${N}__wrapper`), children: [
2033
+ Je(s) && f && u && /* @__PURE__ */ _(
2034
+ et,
2035
+ {
2036
+ allyLabel: f,
2037
+ hasImage: !0,
2038
+ "data-testid": T("close-button")
2039
+ }
2040
+ ),
2041
+ /* @__PURE__ */ K("div", { ref: $, className: D(`${N}__wrapper-inner`), children: [
2042
+ /* @__PURE__ */ K("div", { className: D(`${N}__header`), children: [
2043
+ Je(s) && f && !u && /* @__PURE__ */ _(
2044
+ et,
2045
+ {
2046
+ allyLabel: f,
2047
+ "data-testid": T("close-button")
2048
+ }
2049
+ ),
2050
+ /* @__PURE__ */ _(
2051
+ $r,
2052
+ {
2053
+ asChild: !0,
2054
+ className: D(`${N}__title`),
2055
+ "data-testid": T("title"),
2056
+ children: /* @__PURE__ */ _(Fr, { tag: "h2", variant: "title-200", children: p })
2057
+ }
2058
+ )
2059
+ ] }),
2060
+ u && /* @__PURE__ */ _(
2061
+ "div",
2062
+ {
2063
+ className: D(`${N}__image-wrapper`),
2064
+ "data-testid": T("image"),
2065
+ children: u
2066
+ }
2067
+ ),
2068
+ /* @__PURE__ */ _("div", { ref: y, className: D(`${N}__body`), children: /* @__PURE__ */ K("div", { ref: S, className: D(`${N}__body-inner`), children: [
2069
+ a && /* @__PURE__ */ _(Dt, { children: i ? /* @__PURE__ */ _(so, { asChild: !0, children: /* @__PURE__ */ _(Ye, { "data-testid": T("description"), children: a }) }) : /* @__PURE__ */ _(
2070
+ Ye,
2071
+ {
2072
+ asChild: !0,
2073
+ className: D(`${N}__description`),
2074
+ "data-testid": T("description"),
2075
+ children: /* @__PURE__ */ _(Jr, { variant: "paragraph-100", children: a })
2076
+ }
2077
+ ) }),
2078
+ /* @__PURE__ */ _("div", { children: t }),
2079
+ !d && /* @__PURE__ */ _(tt, { actions: n, primaryActionVariant: l })
2080
+ ] }) })
2081
+ ] })
2082
+ ] }),
2083
+ d && /* @__PURE__ */ _(tt, { actions: n, primaryActionVariant: l })
2084
+ ]
2085
+ }
2086
+ )
2087
+ ] });
2088
+ }
2089
+ ), et = ({
2090
+ allyLabel: e,
2091
+ hasImage: n,
2092
+ ["data-testid"]: t
2093
+ }) => /* @__PURE__ */ _(yr, { asChild: !0, children: /* @__PURE__ */ _(
2094
+ Me,
2095
+ {
2096
+ variant: n ? "primary-negative" : "tertiary-purple",
2097
+ size: "sm",
2098
+ iconOnly: !0,
2099
+ "aria-label": e,
2100
+ className: D(`${N}__close-button`),
2101
+ "data-testid": t,
2102
+ children: /* @__PURE__ */ _(Ct, {})
2103
+ }
2104
+ ) }), _o = 3, tt = ({
2105
+ actions: e,
2106
+ primaryActionVariant: n
2107
+ }) => {
2108
+ const t = [n, "secondary", "text"];
2109
+ return e && e.length > 0 ? /* @__PURE__ */ _("div", { className: D(`${N}__actions`), "data-testid": "modal actions", children: e.slice(0, _o).map(({ label: o, onClick: a }, r) => /* @__PURE__ */ _(
2110
+ Me,
2111
+ {
2112
+ "data-testid": "modal actions button",
2113
+ variant: t[r] || "",
2114
+ onClick: a,
2115
+ className: D(`${N}__button`),
2116
+ children: o
2117
+ },
2118
+ o
2119
+ )) }) : null;
2120
+ }, bo = C(
2121
+ ({ ["data-testid"]: e, children: n, className: t, ...o }, a) => /* @__PURE__ */ _(
2122
+ gr,
2123
+ {
2124
+ asChild: !0,
2125
+ ref: a,
2126
+ "data-testid": e,
2127
+ className: t,
2128
+ ...o,
2129
+ children: n
2130
+ }
2131
+ )
2132
+ ), Fe = ({
2133
+ ["data-testid"]: e,
2134
+ children: n,
2135
+ open: t,
2136
+ onOpenChange: o
2137
+ }) => /* @__PURE__ */ _(hr, { open: t, onOpenChange: o, "data-testid": e, children: n });
2138
+ Fe.Trigger = bo;
2139
+ Fe.Content = mo;
2140
+ Fe.displayName = "Modal";
2141
+ export {
2142
+ Fe as Modal
2143
+ };
2144
+ //# sourceMappingURL=modal.es.js.map