@still-forest/canopy 0.24.0 → 0.25.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.
@@ -0,0 +1,3078 @@
1
+ import * as c from "react";
2
+ import { useState as hr, useLayoutEffect as vr } from "react";
3
+ import { j as w, c as gr } from "./utils.js";
4
+ import { h as it, u as V } from "./calendar.js";
5
+ import * as Xt from "react-dom";
6
+ import yr from "react-dom";
7
+ var wr = [
8
+ "a",
9
+ "button",
10
+ "div",
11
+ "form",
12
+ "h2",
13
+ "h3",
14
+ "img",
15
+ "input",
16
+ "label",
17
+ "li",
18
+ "nav",
19
+ "ol",
20
+ "p",
21
+ "select",
22
+ "span",
23
+ "svg",
24
+ "ul"
25
+ ], k = wr.reduce((e, t) => {
26
+ const n = it(`Primitive.${t}`), r = c.forwardRef((o, i) => {
27
+ const { asChild: s, ...a } = o, u = s ? n : t;
28
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w.jsx(u, { ...a, ref: i });
29
+ });
30
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
31
+ }, {});
32
+ function xr(e, t) {
33
+ e && Xt.flushSync(() => e.dispatchEvent(t));
34
+ }
35
+ var br = Object.freeze({
36
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
37
+ position: "absolute",
38
+ border: 0,
39
+ width: 1,
40
+ height: 1,
41
+ padding: 0,
42
+ margin: -1,
43
+ overflow: "hidden",
44
+ clip: "rect(0, 0, 0, 0)",
45
+ whiteSpace: "nowrap",
46
+ wordWrap: "normal"
47
+ }), Er = "VisuallyHidden", Gt = c.forwardRef(
48
+ (e, t) => /* @__PURE__ */ w.jsx(
49
+ k.span,
50
+ {
51
+ ...e,
52
+ ref: t,
53
+ style: { ...br, ...e.style }
54
+ }
55
+ )
56
+ );
57
+ Gt.displayName = Er;
58
+ var Ns = Gt;
59
+ function Cr(e, t) {
60
+ const n = c.createContext(t), r = (i) => {
61
+ const { children: s, ...a } = i, u = c.useMemo(() => a, Object.values(a));
62
+ return /* @__PURE__ */ w.jsx(n.Provider, { value: u, children: s });
63
+ };
64
+ r.displayName = e + "Provider";
65
+ function o(i) {
66
+ const s = c.useContext(n);
67
+ if (s) return s;
68
+ if (t !== void 0) return t;
69
+ throw new Error(`\`${i}\` must be used within \`${e}\``);
70
+ }
71
+ return [r, o];
72
+ }
73
+ function st(e, t = []) {
74
+ let n = [];
75
+ function r(i, s) {
76
+ const a = c.createContext(s), u = n.length;
77
+ n = [...n, s];
78
+ const l = (d) => {
79
+ const { scope: h, children: m, ...v } = d, p = h?.[e]?.[u] || a, g = c.useMemo(() => v, Object.values(v));
80
+ return /* @__PURE__ */ w.jsx(p.Provider, { value: g, children: m });
81
+ };
82
+ l.displayName = i + "Provider";
83
+ function f(d, h) {
84
+ const m = h?.[e]?.[u] || a, v = c.useContext(m);
85
+ if (v) return v;
86
+ if (s !== void 0) return s;
87
+ throw new Error(`\`${d}\` must be used within \`${i}\``);
88
+ }
89
+ return [l, f];
90
+ }
91
+ const o = () => {
92
+ const i = n.map((s) => c.createContext(s));
93
+ return function(a) {
94
+ const u = a?.[e] || i;
95
+ return c.useMemo(
96
+ () => ({ [`__scope${e}`]: { ...a, [e]: u } }),
97
+ [a, u]
98
+ );
99
+ };
100
+ };
101
+ return o.scopeName = e, [r, Pr(o, ...t)];
102
+ }
103
+ function Pr(...e) {
104
+ const t = e[0];
105
+ if (e.length === 1) return t;
106
+ const n = () => {
107
+ const r = e.map((o) => ({
108
+ useScope: o(),
109
+ scopeName: o.scopeName
110
+ }));
111
+ return function(i) {
112
+ const s = r.reduce((a, { useScope: u, scopeName: l }) => {
113
+ const d = u(i)[`__scope${l}`];
114
+ return { ...a, ...d };
115
+ }, {});
116
+ return c.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
117
+ };
118
+ };
119
+ return n.scopeName = t.scopeName, n;
120
+ }
121
+ function $(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
122
+ return function(o) {
123
+ if (e?.(o), n === !1 || !o.defaultPrevented)
124
+ return t?.(o);
125
+ };
126
+ }
127
+ var te = globalThis?.document ? c.useLayoutEffect : () => {
128
+ }, Rr = c[" useInsertionEffect ".trim().toString()] || te;
129
+ function qt({
130
+ prop: e,
131
+ defaultProp: t,
132
+ onChange: n = () => {
133
+ },
134
+ caller: r
135
+ }) {
136
+ const [o, i, s] = Ar({
137
+ defaultProp: t,
138
+ onChange: n
139
+ }), a = e !== void 0, u = a ? e : o;
140
+ {
141
+ const f = c.useRef(e !== void 0);
142
+ c.useEffect(() => {
143
+ const d = f.current;
144
+ d !== a && console.warn(
145
+ `${r} is changing from ${d ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
146
+ ), f.current = a;
147
+ }, [a, r]);
148
+ }
149
+ const l = c.useCallback(
150
+ (f) => {
151
+ if (a) {
152
+ const d = Sr(f) ? f(e) : f;
153
+ d !== e && s.current?.(d);
154
+ } else
155
+ i(f);
156
+ },
157
+ [a, e, i, s]
158
+ );
159
+ return [u, l];
160
+ }
161
+ function Ar({
162
+ defaultProp: e,
163
+ onChange: t
164
+ }) {
165
+ const [n, r] = c.useState(e), o = c.useRef(n), i = c.useRef(t);
166
+ return Rr(() => {
167
+ i.current = t;
168
+ }, [t]), c.useEffect(() => {
169
+ o.current !== n && (i.current?.(n), o.current = n);
170
+ }, [n, o]), [n, r, i];
171
+ }
172
+ function Sr(e) {
173
+ return typeof e == "function";
174
+ }
175
+ function Or(e, t) {
176
+ return c.useReducer((n, r) => t[n][r] ?? n, e);
177
+ }
178
+ var he = (e) => {
179
+ const { present: t, children: n } = e, r = Dr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : c.Children.only(n), i = V(r.ref, Nr(o));
180
+ return typeof n == "function" || r.isPresent ? c.cloneElement(o, { ref: i }) : null;
181
+ };
182
+ he.displayName = "Presence";
183
+ function Dr(e) {
184
+ const [t, n] = c.useState(), r = c.useRef(null), o = c.useRef(e), i = c.useRef("none"), s = e ? "mounted" : "unmounted", [a, u] = Or(s, {
185
+ mounted: {
186
+ UNMOUNT: "unmounted",
187
+ ANIMATION_OUT: "unmountSuspended"
188
+ },
189
+ unmountSuspended: {
190
+ MOUNT: "mounted",
191
+ ANIMATION_END: "unmounted"
192
+ },
193
+ unmounted: {
194
+ MOUNT: "mounted"
195
+ }
196
+ });
197
+ return c.useEffect(() => {
198
+ const l = Pe(r.current);
199
+ i.current = a === "mounted" ? l : "none";
200
+ }, [a]), te(() => {
201
+ const l = r.current, f = o.current;
202
+ if (f !== e) {
203
+ const h = i.current, m = Pe(l);
204
+ e ? u("MOUNT") : m === "none" || l?.display === "none" ? u("UNMOUNT") : u(f && h !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
205
+ }
206
+ }, [e, u]), te(() => {
207
+ if (t) {
208
+ let l;
209
+ const f = t.ownerDocument.defaultView ?? window, d = (m) => {
210
+ const p = Pe(r.current).includes(m.animationName);
211
+ if (m.target === t && p && (u("ANIMATION_END"), !o.current)) {
212
+ const g = t.style.animationFillMode;
213
+ t.style.animationFillMode = "forwards", l = f.setTimeout(() => {
214
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
215
+ });
216
+ }
217
+ }, h = (m) => {
218
+ m.target === t && (i.current = Pe(r.current));
219
+ };
220
+ return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
221
+ f.clearTimeout(l), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
222
+ };
223
+ } else
224
+ u("ANIMATION_END");
225
+ }, [t, u]), {
226
+ isPresent: ["mounted", "unmountSuspended"].includes(a),
227
+ ref: c.useCallback((l) => {
228
+ r.current = l ? getComputedStyle(l) : null, n(l);
229
+ }, [])
230
+ };
231
+ }
232
+ function Pe(e) {
233
+ return e?.animationName || "none";
234
+ }
235
+ function Nr(e) {
236
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
237
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
238
+ }
239
+ var Tr = c[" useId ".trim().toString()] || (() => {
240
+ }), Mr = 0;
241
+ function Ne(e) {
242
+ const [t, n] = c.useState(Tr());
243
+ return te(() => {
244
+ n((r) => r ?? String(Mr++));
245
+ }, [e]), t ? `radix-${t}` : "";
246
+ }
247
+ function de(e) {
248
+ const t = c.useRef(e);
249
+ return c.useEffect(() => {
250
+ t.current = e;
251
+ }), c.useMemo(() => (...n) => t.current?.(...n), []);
252
+ }
253
+ function _r(e, t = globalThis?.document) {
254
+ const n = de(e);
255
+ c.useEffect(() => {
256
+ const r = (o) => {
257
+ o.key === "Escape" && n(o);
258
+ };
259
+ return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
260
+ }, [n, t]);
261
+ }
262
+ var Lr = "DismissableLayer", et = "dismissableLayer.update", Fr = "dismissableLayer.pointerDownOutside", Ir = "dismissableLayer.focusOutside", At, Zt = c.createContext({
263
+ layers: /* @__PURE__ */ new Set(),
264
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
265
+ branches: /* @__PURE__ */ new Set()
266
+ }), at = c.forwardRef(
267
+ (e, t) => {
268
+ const {
269
+ disableOutsidePointerEvents: n = !1,
270
+ onEscapeKeyDown: r,
271
+ onPointerDownOutside: o,
272
+ onFocusOutside: i,
273
+ onInteractOutside: s,
274
+ onDismiss: a,
275
+ ...u
276
+ } = e, l = c.useContext(Zt), [f, d] = c.useState(null), h = f?.ownerDocument ?? globalThis?.document, [, m] = c.useState({}), v = V(t, (P) => d(P)), p = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), y = p.indexOf(g), x = f ? p.indexOf(f) : -1, E = l.layersWithOutsidePointerEventsDisabled.size > 0, b = x >= y, C = Wr((P) => {
277
+ const S = P.target, N = [...l.branches].some((O) => O.contains(S));
278
+ !b || N || (o?.(P), s?.(P), P.defaultPrevented || a?.());
279
+ }, h), R = $r((P) => {
280
+ const S = P.target;
281
+ [...l.branches].some((O) => O.contains(S)) || (i?.(P), s?.(P), P.defaultPrevented || a?.());
282
+ }, h);
283
+ return _r((P) => {
284
+ x === l.layers.size - 1 && (r?.(P), !P.defaultPrevented && a && (P.preventDefault(), a()));
285
+ }, h), c.useEffect(() => {
286
+ if (f)
287
+ return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (At = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), St(), () => {
288
+ n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = At);
289
+ };
290
+ }, [f, h, n, l]), c.useEffect(() => () => {
291
+ f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), St());
292
+ }, [f, l]), c.useEffect(() => {
293
+ const P = () => m({});
294
+ return document.addEventListener(et, P), () => document.removeEventListener(et, P);
295
+ }, []), /* @__PURE__ */ w.jsx(
296
+ k.div,
297
+ {
298
+ ...u,
299
+ ref: v,
300
+ style: {
301
+ pointerEvents: E ? b ? "auto" : "none" : void 0,
302
+ ...e.style
303
+ },
304
+ onFocusCapture: $(e.onFocusCapture, R.onFocusCapture),
305
+ onBlurCapture: $(e.onBlurCapture, R.onBlurCapture),
306
+ onPointerDownCapture: $(
307
+ e.onPointerDownCapture,
308
+ C.onPointerDownCapture
309
+ )
310
+ }
311
+ );
312
+ }
313
+ );
314
+ at.displayName = Lr;
315
+ var kr = "DismissableLayerBranch", jr = c.forwardRef((e, t) => {
316
+ const n = c.useContext(Zt), r = c.useRef(null), o = V(t, r);
317
+ return c.useEffect(() => {
318
+ const i = r.current;
319
+ if (i)
320
+ return n.branches.add(i), () => {
321
+ n.branches.delete(i);
322
+ };
323
+ }, [n.branches]), /* @__PURE__ */ w.jsx(k.div, { ...e, ref: o });
324
+ });
325
+ jr.displayName = kr;
326
+ function Wr(e, t = globalThis?.document) {
327
+ const n = de(e), r = c.useRef(!1), o = c.useRef(() => {
328
+ });
329
+ return c.useEffect(() => {
330
+ const i = (a) => {
331
+ if (a.target && !r.current) {
332
+ let u = function() {
333
+ Qt(
334
+ Fr,
335
+ n,
336
+ l,
337
+ { discrete: !0 }
338
+ );
339
+ };
340
+ const l = { originalEvent: a };
341
+ a.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = u, t.addEventListener("click", o.current, { once: !0 })) : u();
342
+ } else
343
+ t.removeEventListener("click", o.current);
344
+ r.current = !1;
345
+ }, s = window.setTimeout(() => {
346
+ t.addEventListener("pointerdown", i);
347
+ }, 0);
348
+ return () => {
349
+ window.clearTimeout(s), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
350
+ };
351
+ }, [t, n]), {
352
+ // ensures we check React component tree (not just DOM tree)
353
+ onPointerDownCapture: () => r.current = !0
354
+ };
355
+ }
356
+ function $r(e, t = globalThis?.document) {
357
+ const n = de(e), r = c.useRef(!1);
358
+ return c.useEffect(() => {
359
+ const o = (i) => {
360
+ i.target && !r.current && Qt(Ir, n, { originalEvent: i }, {
361
+ discrete: !1
362
+ });
363
+ };
364
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
365
+ }, [t, n]), {
366
+ onFocusCapture: () => r.current = !0,
367
+ onBlurCapture: () => r.current = !1
368
+ };
369
+ }
370
+ function St() {
371
+ const e = new CustomEvent(et);
372
+ document.dispatchEvent(e);
373
+ }
374
+ function Qt(e, t, n, { discrete: r }) {
375
+ const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
376
+ t && o.addEventListener(e, t, { once: !0 }), r ? xr(o, i) : o.dispatchEvent(i);
377
+ }
378
+ var Ue = "focusScope.autoFocusOnMount", Ye = "focusScope.autoFocusOnUnmount", Ot = { bubbles: !1, cancelable: !0 }, Br = "FocusScope", ct = c.forwardRef((e, t) => {
379
+ const {
380
+ loop: n = !1,
381
+ trapped: r = !1,
382
+ onMountAutoFocus: o,
383
+ onUnmountAutoFocus: i,
384
+ ...s
385
+ } = e, [a, u] = c.useState(null), l = de(o), f = de(i), d = c.useRef(null), h = V(t, (p) => u(p)), m = c.useRef({
386
+ paused: !1,
387
+ pause() {
388
+ this.paused = !0;
389
+ },
390
+ resume() {
391
+ this.paused = !1;
392
+ }
393
+ }).current;
394
+ c.useEffect(() => {
395
+ if (r) {
396
+ let p = function(E) {
397
+ if (m.paused || !a) return;
398
+ const b = E.target;
399
+ a.contains(b) ? d.current = b : ee(d.current, { select: !0 });
400
+ }, g = function(E) {
401
+ if (m.paused || !a) return;
402
+ const b = E.relatedTarget;
403
+ b !== null && (a.contains(b) || ee(d.current, { select: !0 }));
404
+ }, y = function(E) {
405
+ if (document.activeElement === document.body)
406
+ for (const C of E)
407
+ C.removedNodes.length > 0 && ee(a);
408
+ };
409
+ document.addEventListener("focusin", p), document.addEventListener("focusout", g);
410
+ const x = new MutationObserver(y);
411
+ return a && x.observe(a, { childList: !0, subtree: !0 }), () => {
412
+ document.removeEventListener("focusin", p), document.removeEventListener("focusout", g), x.disconnect();
413
+ };
414
+ }
415
+ }, [r, a, m.paused]), c.useEffect(() => {
416
+ if (a) {
417
+ Nt.add(m);
418
+ const p = document.activeElement;
419
+ if (!a.contains(p)) {
420
+ const y = new CustomEvent(Ue, Ot);
421
+ a.addEventListener(Ue, l), a.dispatchEvent(y), y.defaultPrevented || (Hr(Kr(Jt(a)), { select: !0 }), document.activeElement === p && ee(a));
422
+ }
423
+ return () => {
424
+ a.removeEventListener(Ue, l), setTimeout(() => {
425
+ const y = new CustomEvent(Ye, Ot);
426
+ a.addEventListener(Ye, f), a.dispatchEvent(y), y.defaultPrevented || ee(p ?? document.body, { select: !0 }), a.removeEventListener(Ye, f), Nt.remove(m);
427
+ }, 0);
428
+ };
429
+ }
430
+ }, [a, l, f, m]);
431
+ const v = c.useCallback(
432
+ (p) => {
433
+ if (!n && !r || m.paused) return;
434
+ const g = p.key === "Tab" && !p.altKey && !p.ctrlKey && !p.metaKey, y = document.activeElement;
435
+ if (g && y) {
436
+ const x = p.currentTarget, [E, b] = zr(x);
437
+ E && b ? !p.shiftKey && y === b ? (p.preventDefault(), n && ee(E, { select: !0 })) : p.shiftKey && y === E && (p.preventDefault(), n && ee(b, { select: !0 })) : y === x && p.preventDefault();
438
+ }
439
+ },
440
+ [n, r, m.paused]
441
+ );
442
+ return /* @__PURE__ */ w.jsx(k.div, { tabIndex: -1, ...s, ref: h, onKeyDown: v });
443
+ });
444
+ ct.displayName = Br;
445
+ function Hr(e, { select: t = !1 } = {}) {
446
+ const n = document.activeElement;
447
+ for (const r of e)
448
+ if (ee(r, { select: t }), document.activeElement !== n) return;
449
+ }
450
+ function zr(e) {
451
+ const t = Jt(e), n = Dt(t, e), r = Dt(t.reverse(), e);
452
+ return [n, r];
453
+ }
454
+ function Jt(e) {
455
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
456
+ acceptNode: (r) => {
457
+ const o = r.tagName === "INPUT" && r.type === "hidden";
458
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
459
+ }
460
+ });
461
+ for (; n.nextNode(); ) t.push(n.currentNode);
462
+ return t;
463
+ }
464
+ function Dt(e, t) {
465
+ for (const n of e)
466
+ if (!Vr(n, { upTo: t })) return n;
467
+ }
468
+ function Vr(e, { upTo: t }) {
469
+ if (getComputedStyle(e).visibility === "hidden") return !0;
470
+ for (; e; ) {
471
+ if (t !== void 0 && e === t) return !1;
472
+ if (getComputedStyle(e).display === "none") return !0;
473
+ e = e.parentElement;
474
+ }
475
+ return !1;
476
+ }
477
+ function Ur(e) {
478
+ return e instanceof HTMLInputElement && "select" in e;
479
+ }
480
+ function ee(e, { select: t = !1 } = {}) {
481
+ if (e && e.focus) {
482
+ const n = document.activeElement;
483
+ e.focus({ preventScroll: !0 }), e !== n && Ur(e) && t && e.select();
484
+ }
485
+ }
486
+ var Nt = Yr();
487
+ function Yr() {
488
+ let e = [];
489
+ return {
490
+ add(t) {
491
+ const n = e[0];
492
+ t !== n && n?.pause(), e = Tt(e, t), e.unshift(t);
493
+ },
494
+ remove(t) {
495
+ e = Tt(e, t), e[0]?.resume();
496
+ }
497
+ };
498
+ }
499
+ function Tt(e, t) {
500
+ const n = [...e], r = n.indexOf(t);
501
+ return r !== -1 && n.splice(r, 1), n;
502
+ }
503
+ function Kr(e) {
504
+ return e.filter((t) => t.tagName !== "A");
505
+ }
506
+ var Xr = "Portal", lt = c.forwardRef((e, t) => {
507
+ const { container: n, ...r } = e, [o, i] = c.useState(!1);
508
+ te(() => i(!0), []);
509
+ const s = n || o && globalThis?.document?.body;
510
+ return s ? yr.createPortal(/* @__PURE__ */ w.jsx(k.div, { ...r, ref: t }), s) : null;
511
+ });
512
+ lt.displayName = Xr;
513
+ var Ke = 0;
514
+ function en() {
515
+ c.useEffect(() => {
516
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
517
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Mt()), document.body.insertAdjacentElement("beforeend", e[1] ?? Mt()), Ke++, () => {
518
+ Ke === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Ke--;
519
+ };
520
+ }, []);
521
+ }
522
+ function Mt() {
523
+ const e = document.createElement("span");
524
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
525
+ }
526
+ var K = function() {
527
+ return K = Object.assign || function(t) {
528
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
529
+ n = arguments[r];
530
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
531
+ }
532
+ return t;
533
+ }, K.apply(this, arguments);
534
+ };
535
+ function tn(e, t) {
536
+ var n = {};
537
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
538
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
539
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
540
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
541
+ return n;
542
+ }
543
+ function Gr(e, t, n) {
544
+ if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
545
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
546
+ return e.concat(i || Array.prototype.slice.call(t));
547
+ }
548
+ var Te = "right-scroll-bar-position", Me = "width-before-scroll-bar", qr = "with-scroll-bars-hidden", Zr = "--removed-body-scroll-bar-size";
549
+ function Xe(e, t) {
550
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
551
+ }
552
+ function Qr(e, t) {
553
+ var n = hr(function() {
554
+ return {
555
+ // value
556
+ value: e,
557
+ // last callback
558
+ callback: t,
559
+ // "memoized" public interface
560
+ facade: {
561
+ get current() {
562
+ return n.value;
563
+ },
564
+ set current(r) {
565
+ var o = n.value;
566
+ o !== r && (n.value = r, n.callback(r, o));
567
+ }
568
+ }
569
+ };
570
+ })[0];
571
+ return n.callback = t, n.facade;
572
+ }
573
+ var Jr = typeof window < "u" ? c.useLayoutEffect : c.useEffect, _t = /* @__PURE__ */ new WeakMap();
574
+ function eo(e, t) {
575
+ var n = Qr(null, function(r) {
576
+ return e.forEach(function(o) {
577
+ return Xe(o, r);
578
+ });
579
+ });
580
+ return Jr(function() {
581
+ var r = _t.get(n);
582
+ if (r) {
583
+ var o = new Set(r), i = new Set(e), s = n.current;
584
+ o.forEach(function(a) {
585
+ i.has(a) || Xe(a, null);
586
+ }), i.forEach(function(a) {
587
+ o.has(a) || Xe(a, s);
588
+ });
589
+ }
590
+ _t.set(n, e);
591
+ }, [e]), n;
592
+ }
593
+ function to(e) {
594
+ return e;
595
+ }
596
+ function no(e, t) {
597
+ t === void 0 && (t = to);
598
+ var n = [], r = !1, o = {
599
+ read: function() {
600
+ if (r)
601
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
602
+ return n.length ? n[n.length - 1] : e;
603
+ },
604
+ useMedium: function(i) {
605
+ var s = t(i, r);
606
+ return n.push(s), function() {
607
+ n = n.filter(function(a) {
608
+ return a !== s;
609
+ });
610
+ };
611
+ },
612
+ assignSyncMedium: function(i) {
613
+ for (r = !0; n.length; ) {
614
+ var s = n;
615
+ n = [], s.forEach(i);
616
+ }
617
+ n = {
618
+ push: function(a) {
619
+ return i(a);
620
+ },
621
+ filter: function() {
622
+ return n;
623
+ }
624
+ };
625
+ },
626
+ assignMedium: function(i) {
627
+ r = !0;
628
+ var s = [];
629
+ if (n.length) {
630
+ var a = n;
631
+ n = [], a.forEach(i), s = n;
632
+ }
633
+ var u = function() {
634
+ var f = s;
635
+ s = [], f.forEach(i);
636
+ }, l = function() {
637
+ return Promise.resolve().then(u);
638
+ };
639
+ l(), n = {
640
+ push: function(f) {
641
+ s.push(f), l();
642
+ },
643
+ filter: function(f) {
644
+ return s = s.filter(f), n;
645
+ }
646
+ };
647
+ }
648
+ };
649
+ return o;
650
+ }
651
+ function ro(e) {
652
+ e === void 0 && (e = {});
653
+ var t = no(null);
654
+ return t.options = K({ async: !0, ssr: !1 }, e), t;
655
+ }
656
+ var nn = function(e) {
657
+ var t = e.sideCar, n = tn(e, ["sideCar"]);
658
+ if (!t)
659
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
660
+ var r = t.read();
661
+ if (!r)
662
+ throw new Error("Sidecar medium not found");
663
+ return c.createElement(r, K({}, n));
664
+ };
665
+ nn.isSideCarExport = !0;
666
+ function oo(e, t) {
667
+ return e.useMedium(t), nn;
668
+ }
669
+ var rn = ro(), Ge = function() {
670
+ }, We = c.forwardRef(function(e, t) {
671
+ var n = c.useRef(null), r = c.useState({
672
+ onScrollCapture: Ge,
673
+ onWheelCapture: Ge,
674
+ onTouchMoveCapture: Ge
675
+ }), o = r[0], i = r[1], s = e.forwardProps, a = e.children, u = e.className, l = e.removeScrollBar, f = e.enabled, d = e.shards, h = e.sideCar, m = e.noRelative, v = e.noIsolation, p = e.inert, g = e.allowPinchZoom, y = e.as, x = y === void 0 ? "div" : y, E = e.gapMode, b = tn(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, R = eo([n, t]), P = K(K({}, b), o);
676
+ return c.createElement(
677
+ c.Fragment,
678
+ null,
679
+ f && c.createElement(C, { sideCar: rn, removeScrollBar: l, shards: d, noRelative: m, noIsolation: v, inert: p, setCallbacks: i, allowPinchZoom: !!g, lockRef: n, gapMode: E }),
680
+ s ? c.cloneElement(c.Children.only(a), K(K({}, P), { ref: R })) : c.createElement(x, K({}, P, { className: u, ref: R }), a)
681
+ );
682
+ });
683
+ We.defaultProps = {
684
+ enabled: !0,
685
+ removeScrollBar: !0,
686
+ inert: !1
687
+ };
688
+ We.classNames = {
689
+ fullWidth: Me,
690
+ zeroRight: Te
691
+ };
692
+ var io = function() {
693
+ if (typeof __webpack_nonce__ < "u")
694
+ return __webpack_nonce__;
695
+ };
696
+ function so() {
697
+ if (!document)
698
+ return null;
699
+ var e = document.createElement("style");
700
+ e.type = "text/css";
701
+ var t = io();
702
+ return t && e.setAttribute("nonce", t), e;
703
+ }
704
+ function ao(e, t) {
705
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
706
+ }
707
+ function co(e) {
708
+ var t = document.head || document.getElementsByTagName("head")[0];
709
+ t.appendChild(e);
710
+ }
711
+ var lo = function() {
712
+ var e = 0, t = null;
713
+ return {
714
+ add: function(n) {
715
+ e == 0 && (t = so()) && (ao(t, n), co(t)), e++;
716
+ },
717
+ remove: function() {
718
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
719
+ }
720
+ };
721
+ }, uo = function() {
722
+ var e = lo();
723
+ return function(t, n) {
724
+ c.useEffect(function() {
725
+ return e.add(t), function() {
726
+ e.remove();
727
+ };
728
+ }, [t && n]);
729
+ };
730
+ }, on = function() {
731
+ var e = uo(), t = function(n) {
732
+ var r = n.styles, o = n.dynamic;
733
+ return e(r, o), null;
734
+ };
735
+ return t;
736
+ }, fo = {
737
+ left: 0,
738
+ top: 0,
739
+ right: 0,
740
+ gap: 0
741
+ }, qe = function(e) {
742
+ return parseInt(e || "", 10) || 0;
743
+ }, po = function(e) {
744
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
745
+ return [qe(n), qe(r), qe(o)];
746
+ }, mo = function(e) {
747
+ if (e === void 0 && (e = "margin"), typeof window > "u")
748
+ return fo;
749
+ var t = po(e), n = document.documentElement.clientWidth, r = window.innerWidth;
750
+ return {
751
+ left: t[0],
752
+ top: t[1],
753
+ right: t[2],
754
+ gap: Math.max(0, r - n + t[2] - t[0])
755
+ };
756
+ }, ho = on(), ue = "data-scroll-locked", vo = function(e, t, n, r) {
757
+ var o = e.left, i = e.top, s = e.right, a = e.gap;
758
+ return n === void 0 && (n = "margin"), `
759
+ .`.concat(qr, ` {
760
+ overflow: hidden `).concat(r, `;
761
+ padding-right: `).concat(a, "px ").concat(r, `;
762
+ }
763
+ body[`).concat(ue, `] {
764
+ overflow: hidden `).concat(r, `;
765
+ overscroll-behavior: contain;
766
+ `).concat([
767
+ t && "position: relative ".concat(r, ";"),
768
+ n === "margin" && `
769
+ padding-left: `.concat(o, `px;
770
+ padding-top: `).concat(i, `px;
771
+ padding-right: `).concat(s, `px;
772
+ margin-left:0;
773
+ margin-top:0;
774
+ margin-right: `).concat(a, "px ").concat(r, `;
775
+ `),
776
+ n === "padding" && "padding-right: ".concat(a, "px ").concat(r, ";")
777
+ ].filter(Boolean).join(""), `
778
+ }
779
+
780
+ .`).concat(Te, ` {
781
+ right: `).concat(a, "px ").concat(r, `;
782
+ }
783
+
784
+ .`).concat(Me, ` {
785
+ margin-right: `).concat(a, "px ").concat(r, `;
786
+ }
787
+
788
+ .`).concat(Te, " .").concat(Te, ` {
789
+ right: 0 `).concat(r, `;
790
+ }
791
+
792
+ .`).concat(Me, " .").concat(Me, ` {
793
+ margin-right: 0 `).concat(r, `;
794
+ }
795
+
796
+ body[`).concat(ue, `] {
797
+ `).concat(Zr, ": ").concat(a, `px;
798
+ }
799
+ `);
800
+ }, Lt = function() {
801
+ var e = parseInt(document.body.getAttribute(ue) || "0", 10);
802
+ return isFinite(e) ? e : 0;
803
+ }, go = function() {
804
+ c.useEffect(function() {
805
+ return document.body.setAttribute(ue, (Lt() + 1).toString()), function() {
806
+ var e = Lt() - 1;
807
+ e <= 0 ? document.body.removeAttribute(ue) : document.body.setAttribute(ue, e.toString());
808
+ };
809
+ }, []);
810
+ }, yo = function(e) {
811
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
812
+ go();
813
+ var i = c.useMemo(function() {
814
+ return mo(o);
815
+ }, [o]);
816
+ return c.createElement(ho, { styles: vo(i, !t, o, n ? "" : "!important") });
817
+ }, tt = !1;
818
+ if (typeof window < "u")
819
+ try {
820
+ var Re = Object.defineProperty({}, "passive", {
821
+ get: function() {
822
+ return tt = !0, !0;
823
+ }
824
+ });
825
+ window.addEventListener("test", Re, Re), window.removeEventListener("test", Re, Re);
826
+ } catch {
827
+ tt = !1;
828
+ }
829
+ var ae = tt ? { passive: !1 } : !1, wo = function(e) {
830
+ return e.tagName === "TEXTAREA";
831
+ }, sn = function(e, t) {
832
+ if (!(e instanceof Element))
833
+ return !1;
834
+ var n = window.getComputedStyle(e);
835
+ return (
836
+ // not-not-scrollable
837
+ n[t] !== "hidden" && // contains scroll inside self
838
+ !(n.overflowY === n.overflowX && !wo(e) && n[t] === "visible")
839
+ );
840
+ }, xo = function(e) {
841
+ return sn(e, "overflowY");
842
+ }, bo = function(e) {
843
+ return sn(e, "overflowX");
844
+ }, Ft = function(e, t) {
845
+ var n = t.ownerDocument, r = t;
846
+ do {
847
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
848
+ var o = an(e, r);
849
+ if (o) {
850
+ var i = cn(e, r), s = i[1], a = i[2];
851
+ if (s > a)
852
+ return !0;
853
+ }
854
+ r = r.parentNode;
855
+ } while (r && r !== n.body);
856
+ return !1;
857
+ }, Eo = function(e) {
858
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
859
+ return [
860
+ t,
861
+ n,
862
+ r
863
+ ];
864
+ }, Co = function(e) {
865
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
866
+ return [
867
+ t,
868
+ n,
869
+ r
870
+ ];
871
+ }, an = function(e, t) {
872
+ return e === "v" ? xo(t) : bo(t);
873
+ }, cn = function(e, t) {
874
+ return e === "v" ? Eo(t) : Co(t);
875
+ }, Po = function(e, t) {
876
+ return e === "h" && t === "rtl" ? -1 : 1;
877
+ }, Ro = function(e, t, n, r, o) {
878
+ var i = Po(e, window.getComputedStyle(t).direction), s = i * r, a = n.target, u = t.contains(a), l = !1, f = s > 0, d = 0, h = 0;
879
+ do {
880
+ if (!a)
881
+ break;
882
+ var m = cn(e, a), v = m[0], p = m[1], g = m[2], y = p - g - i * v;
883
+ (v || y) && an(e, a) && (d += y, h += v);
884
+ var x = a.parentNode;
885
+ a = x && x.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? x.host : x;
886
+ } while (
887
+ // portaled content
888
+ !u && a !== document.body || // self content
889
+ u && (t.contains(a) || t === a)
890
+ );
891
+ return (f && Math.abs(d) < 1 || !f && Math.abs(h) < 1) && (l = !0), l;
892
+ }, Ae = function(e) {
893
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
894
+ }, It = function(e) {
895
+ return [e.deltaX, e.deltaY];
896
+ }, kt = function(e) {
897
+ return e && "current" in e ? e.current : e;
898
+ }, Ao = function(e, t) {
899
+ return e[0] === t[0] && e[1] === t[1];
900
+ }, So = function(e) {
901
+ return `
902
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
903
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
904
+ `);
905
+ }, Oo = 0, ce = [];
906
+ function Do(e) {
907
+ var t = c.useRef([]), n = c.useRef([0, 0]), r = c.useRef(), o = c.useState(Oo++)[0], i = c.useState(on)[0], s = c.useRef(e);
908
+ c.useEffect(function() {
909
+ s.current = e;
910
+ }, [e]), c.useEffect(function() {
911
+ if (e.inert) {
912
+ document.body.classList.add("block-interactivity-".concat(o));
913
+ var p = Gr([e.lockRef.current], (e.shards || []).map(kt), !0).filter(Boolean);
914
+ return p.forEach(function(g) {
915
+ return g.classList.add("allow-interactivity-".concat(o));
916
+ }), function() {
917
+ document.body.classList.remove("block-interactivity-".concat(o)), p.forEach(function(g) {
918
+ return g.classList.remove("allow-interactivity-".concat(o));
919
+ });
920
+ };
921
+ }
922
+ }, [e.inert, e.lockRef.current, e.shards]);
923
+ var a = c.useCallback(function(p, g) {
924
+ if ("touches" in p && p.touches.length === 2 || p.type === "wheel" && p.ctrlKey)
925
+ return !s.current.allowPinchZoom;
926
+ var y = Ae(p), x = n.current, E = "deltaX" in p ? p.deltaX : x[0] - y[0], b = "deltaY" in p ? p.deltaY : x[1] - y[1], C, R = p.target, P = Math.abs(E) > Math.abs(b) ? "h" : "v";
927
+ if ("touches" in p && P === "h" && R.type === "range")
928
+ return !1;
929
+ var S = Ft(P, R);
930
+ if (!S)
931
+ return !0;
932
+ if (S ? C = P : (C = P === "v" ? "h" : "v", S = Ft(P, R)), !S)
933
+ return !1;
934
+ if (!r.current && "changedTouches" in p && (E || b) && (r.current = C), !C)
935
+ return !0;
936
+ var N = r.current || C;
937
+ return Ro(N, g, p, N === "h" ? E : b);
938
+ }, []), u = c.useCallback(function(p) {
939
+ var g = p;
940
+ if (!(!ce.length || ce[ce.length - 1] !== i)) {
941
+ var y = "deltaY" in g ? It(g) : Ae(g), x = t.current.filter(function(C) {
942
+ return C.name === g.type && (C.target === g.target || g.target === C.shadowParent) && Ao(C.delta, y);
943
+ })[0];
944
+ if (x && x.should) {
945
+ g.cancelable && g.preventDefault();
946
+ return;
947
+ }
948
+ if (!x) {
949
+ var E = (s.current.shards || []).map(kt).filter(Boolean).filter(function(C) {
950
+ return C.contains(g.target);
951
+ }), b = E.length > 0 ? a(g, E[0]) : !s.current.noIsolation;
952
+ b && g.cancelable && g.preventDefault();
953
+ }
954
+ }
955
+ }, []), l = c.useCallback(function(p, g, y, x) {
956
+ var E = { name: p, delta: g, target: y, should: x, shadowParent: No(y) };
957
+ t.current.push(E), setTimeout(function() {
958
+ t.current = t.current.filter(function(b) {
959
+ return b !== E;
960
+ });
961
+ }, 1);
962
+ }, []), f = c.useCallback(function(p) {
963
+ n.current = Ae(p), r.current = void 0;
964
+ }, []), d = c.useCallback(function(p) {
965
+ l(p.type, It(p), p.target, a(p, e.lockRef.current));
966
+ }, []), h = c.useCallback(function(p) {
967
+ l(p.type, Ae(p), p.target, a(p, e.lockRef.current));
968
+ }, []);
969
+ c.useEffect(function() {
970
+ return ce.push(i), e.setCallbacks({
971
+ onScrollCapture: d,
972
+ onWheelCapture: d,
973
+ onTouchMoveCapture: h
974
+ }), document.addEventListener("wheel", u, ae), document.addEventListener("touchmove", u, ae), document.addEventListener("touchstart", f, ae), function() {
975
+ ce = ce.filter(function(p) {
976
+ return p !== i;
977
+ }), document.removeEventListener("wheel", u, ae), document.removeEventListener("touchmove", u, ae), document.removeEventListener("touchstart", f, ae);
978
+ };
979
+ }, []);
980
+ var m = e.removeScrollBar, v = e.inert;
981
+ return c.createElement(
982
+ c.Fragment,
983
+ null,
984
+ v ? c.createElement(i, { styles: So(o) }) : null,
985
+ m ? c.createElement(yo, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
986
+ );
987
+ }
988
+ function No(e) {
989
+ for (var t = null; e !== null; )
990
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
991
+ return t;
992
+ }
993
+ const To = oo(rn, Do);
994
+ var ut = c.forwardRef(function(e, t) {
995
+ return c.createElement(We, K({}, e, { ref: t, sideCar: To }));
996
+ });
997
+ ut.classNames = We.classNames;
998
+ var Mo = function(e) {
999
+ if (typeof document > "u")
1000
+ return null;
1001
+ var t = Array.isArray(e) ? e[0] : e;
1002
+ return t.ownerDocument.body;
1003
+ }, le = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Oe = {}, Ze = 0, ln = function(e) {
1004
+ return e && (e.host || ln(e.parentNode));
1005
+ }, _o = function(e, t) {
1006
+ return t.map(function(n) {
1007
+ if (e.contains(n))
1008
+ return n;
1009
+ var r = ln(n);
1010
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1011
+ }).filter(function(n) {
1012
+ return !!n;
1013
+ });
1014
+ }, Lo = function(e, t, n, r) {
1015
+ var o = _o(t, Array.isArray(e) ? e : [e]);
1016
+ Oe[n] || (Oe[n] = /* @__PURE__ */ new WeakMap());
1017
+ var i = Oe[n], s = [], a = /* @__PURE__ */ new Set(), u = new Set(o), l = function(d) {
1018
+ !d || a.has(d) || (a.add(d), l(d.parentNode));
1019
+ };
1020
+ o.forEach(l);
1021
+ var f = function(d) {
1022
+ !d || u.has(d) || Array.prototype.forEach.call(d.children, function(h) {
1023
+ if (a.has(h))
1024
+ f(h);
1025
+ else
1026
+ try {
1027
+ var m = h.getAttribute(r), v = m !== null && m !== "false", p = (le.get(h) || 0) + 1, g = (i.get(h) || 0) + 1;
1028
+ le.set(h, p), i.set(h, g), s.push(h), p === 1 && v && Se.set(h, !0), g === 1 && h.setAttribute(n, "true"), v || h.setAttribute(r, "true");
1029
+ } catch (y) {
1030
+ console.error("aria-hidden: cannot operate on ", h, y);
1031
+ }
1032
+ });
1033
+ };
1034
+ return f(t), a.clear(), Ze++, function() {
1035
+ s.forEach(function(d) {
1036
+ var h = le.get(d) - 1, m = i.get(d) - 1;
1037
+ le.set(d, h), i.set(d, m), h || (Se.has(d) || d.removeAttribute(r), Se.delete(d)), m || d.removeAttribute(n);
1038
+ }), Ze--, Ze || (le = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Oe = {});
1039
+ };
1040
+ }, un = function(e, t, n) {
1041
+ n === void 0 && (n = "data-aria-hidden");
1042
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = Mo(e);
1043
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Lo(r, o, n, "aria-hidden")) : function() {
1044
+ return null;
1045
+ };
1046
+ }, $e = "Dialog", [fn, Ts] = st($e), [Fo, U] = fn($e), dn = (e) => {
1047
+ const {
1048
+ __scopeDialog: t,
1049
+ children: n,
1050
+ open: r,
1051
+ defaultOpen: o,
1052
+ onOpenChange: i,
1053
+ modal: s = !0
1054
+ } = e, a = c.useRef(null), u = c.useRef(null), [l, f] = qt({
1055
+ prop: r,
1056
+ defaultProp: o ?? !1,
1057
+ onChange: i,
1058
+ caller: $e
1059
+ });
1060
+ return /* @__PURE__ */ w.jsx(
1061
+ Fo,
1062
+ {
1063
+ scope: t,
1064
+ triggerRef: a,
1065
+ contentRef: u,
1066
+ contentId: Ne(),
1067
+ titleId: Ne(),
1068
+ descriptionId: Ne(),
1069
+ open: l,
1070
+ onOpenChange: f,
1071
+ onOpenToggle: c.useCallback(() => f((d) => !d), [f]),
1072
+ modal: s,
1073
+ children: n
1074
+ }
1075
+ );
1076
+ };
1077
+ dn.displayName = $e;
1078
+ var pn = "DialogTrigger", mn = c.forwardRef(
1079
+ (e, t) => {
1080
+ const { __scopeDialog: n, ...r } = e, o = U(pn, n), i = V(t, o.triggerRef);
1081
+ return /* @__PURE__ */ w.jsx(
1082
+ k.button,
1083
+ {
1084
+ type: "button",
1085
+ "aria-haspopup": "dialog",
1086
+ "aria-expanded": o.open,
1087
+ "aria-controls": o.contentId,
1088
+ "data-state": pt(o.open),
1089
+ ...r,
1090
+ ref: i,
1091
+ onClick: $(e.onClick, o.onOpenToggle)
1092
+ }
1093
+ );
1094
+ }
1095
+ );
1096
+ mn.displayName = pn;
1097
+ var ft = "DialogPortal", [Io, hn] = fn(ft, {
1098
+ forceMount: void 0
1099
+ }), vn = (e) => {
1100
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i = U(ft, t);
1101
+ return /* @__PURE__ */ w.jsx(Io, { scope: t, forceMount: n, children: c.Children.map(r, (s) => /* @__PURE__ */ w.jsx(he, { present: n || i.open, children: /* @__PURE__ */ w.jsx(lt, { asChild: !0, container: o, children: s }) })) });
1102
+ };
1103
+ vn.displayName = ft;
1104
+ var Le = "DialogOverlay", gn = c.forwardRef(
1105
+ (e, t) => {
1106
+ const n = hn(Le, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = U(Le, e.__scopeDialog);
1107
+ return i.modal ? /* @__PURE__ */ w.jsx(he, { present: r || i.open, children: /* @__PURE__ */ w.jsx(jo, { ...o, ref: t }) }) : null;
1108
+ }
1109
+ );
1110
+ gn.displayName = Le;
1111
+ var ko = it("DialogOverlay.RemoveScroll"), jo = c.forwardRef(
1112
+ (e, t) => {
1113
+ const { __scopeDialog: n, ...r } = e, o = U(Le, n);
1114
+ return (
1115
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1116
+ // ie. when `Overlay` and `Content` are siblings
1117
+ /* @__PURE__ */ w.jsx(ut, { as: ko, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ w.jsx(
1118
+ k.div,
1119
+ {
1120
+ "data-state": pt(o.open),
1121
+ ...r,
1122
+ ref: t,
1123
+ style: { pointerEvents: "auto", ...r.style }
1124
+ }
1125
+ ) })
1126
+ );
1127
+ }
1128
+ ), ie = "DialogContent", yn = c.forwardRef(
1129
+ (e, t) => {
1130
+ const n = hn(ie, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = U(ie, e.__scopeDialog);
1131
+ return /* @__PURE__ */ w.jsx(he, { present: r || i.open, children: i.modal ? /* @__PURE__ */ w.jsx(Wo, { ...o, ref: t }) : /* @__PURE__ */ w.jsx($o, { ...o, ref: t }) });
1132
+ }
1133
+ );
1134
+ yn.displayName = ie;
1135
+ var Wo = c.forwardRef(
1136
+ (e, t) => {
1137
+ const n = U(ie, e.__scopeDialog), r = c.useRef(null), o = V(t, n.contentRef, r);
1138
+ return c.useEffect(() => {
1139
+ const i = r.current;
1140
+ if (i) return un(i);
1141
+ }, []), /* @__PURE__ */ w.jsx(
1142
+ wn,
1143
+ {
1144
+ ...e,
1145
+ ref: o,
1146
+ trapFocus: n.open,
1147
+ disableOutsidePointerEvents: !0,
1148
+ onCloseAutoFocus: $(e.onCloseAutoFocus, (i) => {
1149
+ i.preventDefault(), n.triggerRef.current?.focus();
1150
+ }),
1151
+ onPointerDownOutside: $(e.onPointerDownOutside, (i) => {
1152
+ const s = i.detail.originalEvent, a = s.button === 0 && s.ctrlKey === !0;
1153
+ (s.button === 2 || a) && i.preventDefault();
1154
+ }),
1155
+ onFocusOutside: $(
1156
+ e.onFocusOutside,
1157
+ (i) => i.preventDefault()
1158
+ )
1159
+ }
1160
+ );
1161
+ }
1162
+ ), $o = c.forwardRef(
1163
+ (e, t) => {
1164
+ const n = U(ie, e.__scopeDialog), r = c.useRef(!1), o = c.useRef(!1);
1165
+ return /* @__PURE__ */ w.jsx(
1166
+ wn,
1167
+ {
1168
+ ...e,
1169
+ ref: t,
1170
+ trapFocus: !1,
1171
+ disableOutsidePointerEvents: !1,
1172
+ onCloseAutoFocus: (i) => {
1173
+ e.onCloseAutoFocus?.(i), i.defaultPrevented || (r.current || n.triggerRef.current?.focus(), i.preventDefault()), r.current = !1, o.current = !1;
1174
+ },
1175
+ onInteractOutside: (i) => {
1176
+ e.onInteractOutside?.(i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1177
+ const s = i.target;
1178
+ n.triggerRef.current?.contains(s) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
1179
+ }
1180
+ }
1181
+ );
1182
+ }
1183
+ ), wn = c.forwardRef(
1184
+ (e, t) => {
1185
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...s } = e, a = U(ie, n), u = c.useRef(null), l = V(t, u);
1186
+ return en(), /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
1187
+ /* @__PURE__ */ w.jsx(
1188
+ ct,
1189
+ {
1190
+ asChild: !0,
1191
+ loop: !0,
1192
+ trapped: r,
1193
+ onMountAutoFocus: o,
1194
+ onUnmountAutoFocus: i,
1195
+ children: /* @__PURE__ */ w.jsx(
1196
+ at,
1197
+ {
1198
+ role: "dialog",
1199
+ id: a.contentId,
1200
+ "aria-describedby": a.descriptionId,
1201
+ "aria-labelledby": a.titleId,
1202
+ "data-state": pt(a.open),
1203
+ ...s,
1204
+ ref: l,
1205
+ onDismiss: () => a.onOpenChange(!1)
1206
+ }
1207
+ )
1208
+ }
1209
+ ),
1210
+ /* @__PURE__ */ w.jsxs(w.Fragment, { children: [
1211
+ /* @__PURE__ */ w.jsx(Bo, { titleId: a.titleId }),
1212
+ /* @__PURE__ */ w.jsx(zo, { contentRef: u, descriptionId: a.descriptionId })
1213
+ ] })
1214
+ ] });
1215
+ }
1216
+ ), dt = "DialogTitle", xn = c.forwardRef(
1217
+ (e, t) => {
1218
+ const { __scopeDialog: n, ...r } = e, o = U(dt, n);
1219
+ return /* @__PURE__ */ w.jsx(k.h2, { id: o.titleId, ...r, ref: t });
1220
+ }
1221
+ );
1222
+ xn.displayName = dt;
1223
+ var bn = "DialogDescription", En = c.forwardRef(
1224
+ (e, t) => {
1225
+ const { __scopeDialog: n, ...r } = e, o = U(bn, n);
1226
+ return /* @__PURE__ */ w.jsx(k.p, { id: o.descriptionId, ...r, ref: t });
1227
+ }
1228
+ );
1229
+ En.displayName = bn;
1230
+ var Cn = "DialogClose", Pn = c.forwardRef(
1231
+ (e, t) => {
1232
+ const { __scopeDialog: n, ...r } = e, o = U(Cn, n);
1233
+ return /* @__PURE__ */ w.jsx(
1234
+ k.button,
1235
+ {
1236
+ type: "button",
1237
+ ...r,
1238
+ ref: t,
1239
+ onClick: $(e.onClick, () => o.onOpenChange(!1))
1240
+ }
1241
+ );
1242
+ }
1243
+ );
1244
+ Pn.displayName = Cn;
1245
+ function pt(e) {
1246
+ return e ? "open" : "closed";
1247
+ }
1248
+ var Rn = "DialogTitleWarning", [Ms, An] = Cr(Rn, {
1249
+ contentName: ie,
1250
+ titleName: dt,
1251
+ docsSlug: "dialog"
1252
+ }), Bo = ({ titleId: e }) => {
1253
+ const t = An(Rn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1254
+
1255
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1256
+
1257
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
1258
+ return c.useEffect(() => {
1259
+ e && (document.getElementById(e) || console.error(n));
1260
+ }, [n, e]), null;
1261
+ }, Ho = "DialogDescriptionWarning", zo = ({ contentRef: e, descriptionId: t }) => {
1262
+ const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${An(Ho).contentName}}.`;
1263
+ return c.useEffect(() => {
1264
+ const o = e.current?.getAttribute("aria-describedby");
1265
+ t && o && (document.getElementById(t) || console.warn(r));
1266
+ }, [r, e, t]), null;
1267
+ }, _s = dn, Ls = mn, Fs = vn, Is = gn, ks = yn, js = xn, Ws = En, $s = Pn;
1268
+ function Vo(e) {
1269
+ const [t, n] = c.useState(void 0);
1270
+ return te(() => {
1271
+ if (e) {
1272
+ n({ width: e.offsetWidth, height: e.offsetHeight });
1273
+ const r = new ResizeObserver((o) => {
1274
+ if (!Array.isArray(o) || !o.length)
1275
+ return;
1276
+ const i = o[0];
1277
+ let s, a;
1278
+ if ("borderBoxSize" in i) {
1279
+ const u = i.borderBoxSize, l = Array.isArray(u) ? u[0] : u;
1280
+ s = l.inlineSize, a = l.blockSize;
1281
+ } else
1282
+ s = e.offsetWidth, a = e.offsetHeight;
1283
+ n({ width: s, height: a });
1284
+ });
1285
+ return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
1286
+ } else
1287
+ n(void 0);
1288
+ }, [e]), t;
1289
+ }
1290
+ const Uo = ["top", "right", "bottom", "left"], ne = Math.min, W = Math.max, Fe = Math.round, De = Math.floor, G = (e) => ({
1291
+ x: e,
1292
+ y: e
1293
+ }), Yo = {
1294
+ left: "right",
1295
+ right: "left",
1296
+ bottom: "top",
1297
+ top: "bottom"
1298
+ }, Ko = {
1299
+ start: "end",
1300
+ end: "start"
1301
+ };
1302
+ function nt(e, t, n) {
1303
+ return W(e, ne(t, n));
1304
+ }
1305
+ function Q(e, t) {
1306
+ return typeof e == "function" ? e(t) : e;
1307
+ }
1308
+ function J(e) {
1309
+ return e.split("-")[0];
1310
+ }
1311
+ function ve(e) {
1312
+ return e.split("-")[1];
1313
+ }
1314
+ function mt(e) {
1315
+ return e === "x" ? "y" : "x";
1316
+ }
1317
+ function ht(e) {
1318
+ return e === "y" ? "height" : "width";
1319
+ }
1320
+ const Xo = /* @__PURE__ */ new Set(["top", "bottom"]);
1321
+ function X(e) {
1322
+ return Xo.has(J(e)) ? "y" : "x";
1323
+ }
1324
+ function vt(e) {
1325
+ return mt(X(e));
1326
+ }
1327
+ function Go(e, t, n) {
1328
+ n === void 0 && (n = !1);
1329
+ const r = ve(e), o = vt(e), i = ht(o);
1330
+ let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
1331
+ return t.reference[i] > t.floating[i] && (s = Ie(s)), [s, Ie(s)];
1332
+ }
1333
+ function qo(e) {
1334
+ const t = Ie(e);
1335
+ return [rt(e), t, rt(t)];
1336
+ }
1337
+ function rt(e) {
1338
+ return e.replace(/start|end/g, (t) => Ko[t]);
1339
+ }
1340
+ const jt = ["left", "right"], Wt = ["right", "left"], Zo = ["top", "bottom"], Qo = ["bottom", "top"];
1341
+ function Jo(e, t, n) {
1342
+ switch (e) {
1343
+ case "top":
1344
+ case "bottom":
1345
+ return n ? t ? Wt : jt : t ? jt : Wt;
1346
+ case "left":
1347
+ case "right":
1348
+ return t ? Zo : Qo;
1349
+ default:
1350
+ return [];
1351
+ }
1352
+ }
1353
+ function ei(e, t, n, r) {
1354
+ const o = ve(e);
1355
+ let i = Jo(J(e), n === "start", r);
1356
+ return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(rt)))), i;
1357
+ }
1358
+ function Ie(e) {
1359
+ return e.replace(/left|right|bottom|top/g, (t) => Yo[t]);
1360
+ }
1361
+ function ti(e) {
1362
+ return {
1363
+ top: 0,
1364
+ right: 0,
1365
+ bottom: 0,
1366
+ left: 0,
1367
+ ...e
1368
+ };
1369
+ }
1370
+ function Sn(e) {
1371
+ return typeof e != "number" ? ti(e) : {
1372
+ top: e,
1373
+ right: e,
1374
+ bottom: e,
1375
+ left: e
1376
+ };
1377
+ }
1378
+ function ke(e) {
1379
+ const {
1380
+ x: t,
1381
+ y: n,
1382
+ width: r,
1383
+ height: o
1384
+ } = e;
1385
+ return {
1386
+ width: r,
1387
+ height: o,
1388
+ top: n,
1389
+ left: t,
1390
+ right: t + r,
1391
+ bottom: n + o,
1392
+ x: t,
1393
+ y: n
1394
+ };
1395
+ }
1396
+ function $t(e, t, n) {
1397
+ let {
1398
+ reference: r,
1399
+ floating: o
1400
+ } = e;
1401
+ const i = X(t), s = vt(t), a = ht(s), u = J(t), l = i === "y", f = r.x + r.width / 2 - o.width / 2, d = r.y + r.height / 2 - o.height / 2, h = r[a] / 2 - o[a] / 2;
1402
+ let m;
1403
+ switch (u) {
1404
+ case "top":
1405
+ m = {
1406
+ x: f,
1407
+ y: r.y - o.height
1408
+ };
1409
+ break;
1410
+ case "bottom":
1411
+ m = {
1412
+ x: f,
1413
+ y: r.y + r.height
1414
+ };
1415
+ break;
1416
+ case "right":
1417
+ m = {
1418
+ x: r.x + r.width,
1419
+ y: d
1420
+ };
1421
+ break;
1422
+ case "left":
1423
+ m = {
1424
+ x: r.x - o.width,
1425
+ y: d
1426
+ };
1427
+ break;
1428
+ default:
1429
+ m = {
1430
+ x: r.x,
1431
+ y: r.y
1432
+ };
1433
+ }
1434
+ switch (ve(t)) {
1435
+ case "start":
1436
+ m[s] -= h * (n && l ? -1 : 1);
1437
+ break;
1438
+ case "end":
1439
+ m[s] += h * (n && l ? -1 : 1);
1440
+ break;
1441
+ }
1442
+ return m;
1443
+ }
1444
+ const ni = async (e, t, n) => {
1445
+ const {
1446
+ placement: r = "bottom",
1447
+ strategy: o = "absolute",
1448
+ middleware: i = [],
1449
+ platform: s
1450
+ } = n, a = i.filter(Boolean), u = await (s.isRTL == null ? void 0 : s.isRTL(t));
1451
+ let l = await s.getElementRects({
1452
+ reference: e,
1453
+ floating: t,
1454
+ strategy: o
1455
+ }), {
1456
+ x: f,
1457
+ y: d
1458
+ } = $t(l, r, u), h = r, m = {}, v = 0;
1459
+ for (let p = 0; p < a.length; p++) {
1460
+ const {
1461
+ name: g,
1462
+ fn: y
1463
+ } = a[p], {
1464
+ x,
1465
+ y: E,
1466
+ data: b,
1467
+ reset: C
1468
+ } = await y({
1469
+ x: f,
1470
+ y: d,
1471
+ initialPlacement: r,
1472
+ placement: h,
1473
+ strategy: o,
1474
+ middlewareData: m,
1475
+ rects: l,
1476
+ platform: s,
1477
+ elements: {
1478
+ reference: e,
1479
+ floating: t
1480
+ }
1481
+ });
1482
+ f = x ?? f, d = E ?? d, m = {
1483
+ ...m,
1484
+ [g]: {
1485
+ ...m[g],
1486
+ ...b
1487
+ }
1488
+ }, C && v <= 50 && (v++, typeof C == "object" && (C.placement && (h = C.placement), C.rects && (l = C.rects === !0 ? await s.getElementRects({
1489
+ reference: e,
1490
+ floating: t,
1491
+ strategy: o
1492
+ }) : C.rects), {
1493
+ x: f,
1494
+ y: d
1495
+ } = $t(l, h, u)), p = -1);
1496
+ }
1497
+ return {
1498
+ x: f,
1499
+ y: d,
1500
+ placement: h,
1501
+ strategy: o,
1502
+ middlewareData: m
1503
+ };
1504
+ };
1505
+ async function we(e, t) {
1506
+ var n;
1507
+ t === void 0 && (t = {});
1508
+ const {
1509
+ x: r,
1510
+ y: o,
1511
+ platform: i,
1512
+ rects: s,
1513
+ elements: a,
1514
+ strategy: u
1515
+ } = e, {
1516
+ boundary: l = "clippingAncestors",
1517
+ rootBoundary: f = "viewport",
1518
+ elementContext: d = "floating",
1519
+ altBoundary: h = !1,
1520
+ padding: m = 0
1521
+ } = Q(t, e), v = Sn(m), g = a[h ? d === "floating" ? "reference" : "floating" : d], y = ke(await i.getClippingRect({
1522
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
1523
+ boundary: l,
1524
+ rootBoundary: f,
1525
+ strategy: u
1526
+ })), x = d === "floating" ? {
1527
+ x: r,
1528
+ y: o,
1529
+ width: s.floating.width,
1530
+ height: s.floating.height
1531
+ } : s.reference, E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), b = await (i.isElement == null ? void 0 : i.isElement(E)) ? await (i.getScale == null ? void 0 : i.getScale(E)) || {
1532
+ x: 1,
1533
+ y: 1
1534
+ } : {
1535
+ x: 1,
1536
+ y: 1
1537
+ }, C = ke(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
1538
+ elements: a,
1539
+ rect: x,
1540
+ offsetParent: E,
1541
+ strategy: u
1542
+ }) : x);
1543
+ return {
1544
+ top: (y.top - C.top + v.top) / b.y,
1545
+ bottom: (C.bottom - y.bottom + v.bottom) / b.y,
1546
+ left: (y.left - C.left + v.left) / b.x,
1547
+ right: (C.right - y.right + v.right) / b.x
1548
+ };
1549
+ }
1550
+ const ri = (e) => ({
1551
+ name: "arrow",
1552
+ options: e,
1553
+ async fn(t) {
1554
+ const {
1555
+ x: n,
1556
+ y: r,
1557
+ placement: o,
1558
+ rects: i,
1559
+ platform: s,
1560
+ elements: a,
1561
+ middlewareData: u
1562
+ } = t, {
1563
+ element: l,
1564
+ padding: f = 0
1565
+ } = Q(e, t) || {};
1566
+ if (l == null)
1567
+ return {};
1568
+ const d = Sn(f), h = {
1569
+ x: n,
1570
+ y: r
1571
+ }, m = vt(o), v = ht(m), p = await s.getDimensions(l), g = m === "y", y = g ? "top" : "left", x = g ? "bottom" : "right", E = g ? "clientHeight" : "clientWidth", b = i.reference[v] + i.reference[m] - h[m] - i.floating[v], C = h[m] - i.reference[m], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l));
1572
+ let P = R ? R[E] : 0;
1573
+ (!P || !await (s.isElement == null ? void 0 : s.isElement(R))) && (P = a.floating[E] || i.floating[v]);
1574
+ const S = b / 2 - C / 2, N = P / 2 - p[v] / 2 - 1, O = ne(d[y], N), F = ne(d[x], N), I = O, T = P - p[v] - F, D = P / 2 - p[v] / 2 + S, j = nt(I, D, T), M = !u.arrow && ve(o) != null && D !== j && i.reference[v] / 2 - (D < I ? O : F) - p[v] / 2 < 0, _ = M ? D < I ? D - I : D - T : 0;
1575
+ return {
1576
+ [m]: h[m] + _,
1577
+ data: {
1578
+ [m]: j,
1579
+ centerOffset: D - j - _,
1580
+ ...M && {
1581
+ alignmentOffset: _
1582
+ }
1583
+ },
1584
+ reset: M
1585
+ };
1586
+ }
1587
+ }), oi = function(e) {
1588
+ return e === void 0 && (e = {}), {
1589
+ name: "flip",
1590
+ options: e,
1591
+ async fn(t) {
1592
+ var n, r;
1593
+ const {
1594
+ placement: o,
1595
+ middlewareData: i,
1596
+ rects: s,
1597
+ initialPlacement: a,
1598
+ platform: u,
1599
+ elements: l
1600
+ } = t, {
1601
+ mainAxis: f = !0,
1602
+ crossAxis: d = !0,
1603
+ fallbackPlacements: h,
1604
+ fallbackStrategy: m = "bestFit",
1605
+ fallbackAxisSideDirection: v = "none",
1606
+ flipAlignment: p = !0,
1607
+ ...g
1608
+ } = Q(e, t);
1609
+ if ((n = i.arrow) != null && n.alignmentOffset)
1610
+ return {};
1611
+ const y = J(o), x = X(a), E = J(a) === a, b = await (u.isRTL == null ? void 0 : u.isRTL(l.floating)), C = h || (E || !p ? [Ie(a)] : qo(a)), R = v !== "none";
1612
+ !h && R && C.push(...ei(a, p, v, b));
1613
+ const P = [a, ...C], S = await we(t, g), N = [];
1614
+ let O = ((r = i.flip) == null ? void 0 : r.overflows) || [];
1615
+ if (f && N.push(S[y]), d) {
1616
+ const D = Go(o, s, b);
1617
+ N.push(S[D[0]], S[D[1]]);
1618
+ }
1619
+ if (O = [...O, {
1620
+ placement: o,
1621
+ overflows: N
1622
+ }], !N.every((D) => D <= 0)) {
1623
+ var F, I;
1624
+ const D = (((F = i.flip) == null ? void 0 : F.index) || 0) + 1, j = P[D];
1625
+ if (j && (!(d === "alignment" ? x !== X(j) : !1) || // We leave the current main axis only if every placement on that axis
1626
+ // overflows the main axis.
1627
+ O.every((A) => A.overflows[0] > 0 && X(A.placement) === x)))
1628
+ return {
1629
+ data: {
1630
+ index: D,
1631
+ overflows: O
1632
+ },
1633
+ reset: {
1634
+ placement: j
1635
+ }
1636
+ };
1637
+ let M = (I = O.filter((_) => _.overflows[0] <= 0).sort((_, A) => _.overflows[1] - A.overflows[1])[0]) == null ? void 0 : I.placement;
1638
+ if (!M)
1639
+ switch (m) {
1640
+ case "bestFit": {
1641
+ var T;
1642
+ const _ = (T = O.filter((A) => {
1643
+ if (R) {
1644
+ const L = X(A.placement);
1645
+ return L === x || // Create a bias to the `y` side axis due to horizontal
1646
+ // reading directions favoring greater width.
1647
+ L === "y";
1648
+ }
1649
+ return !0;
1650
+ }).map((A) => [A.placement, A.overflows.filter((L) => L > 0).reduce((L, Y) => L + Y, 0)]).sort((A, L) => A[1] - L[1])[0]) == null ? void 0 : T[0];
1651
+ _ && (M = _);
1652
+ break;
1653
+ }
1654
+ case "initialPlacement":
1655
+ M = a;
1656
+ break;
1657
+ }
1658
+ if (o !== M)
1659
+ return {
1660
+ reset: {
1661
+ placement: M
1662
+ }
1663
+ };
1664
+ }
1665
+ return {};
1666
+ }
1667
+ };
1668
+ };
1669
+ function Bt(e, t) {
1670
+ return {
1671
+ top: e.top - t.height,
1672
+ right: e.right - t.width,
1673
+ bottom: e.bottom - t.height,
1674
+ left: e.left - t.width
1675
+ };
1676
+ }
1677
+ function Ht(e) {
1678
+ return Uo.some((t) => e[t] >= 0);
1679
+ }
1680
+ const ii = function(e) {
1681
+ return e === void 0 && (e = {}), {
1682
+ name: "hide",
1683
+ options: e,
1684
+ async fn(t) {
1685
+ const {
1686
+ rects: n
1687
+ } = t, {
1688
+ strategy: r = "referenceHidden",
1689
+ ...o
1690
+ } = Q(e, t);
1691
+ switch (r) {
1692
+ case "referenceHidden": {
1693
+ const i = await we(t, {
1694
+ ...o,
1695
+ elementContext: "reference"
1696
+ }), s = Bt(i, n.reference);
1697
+ return {
1698
+ data: {
1699
+ referenceHiddenOffsets: s,
1700
+ referenceHidden: Ht(s)
1701
+ }
1702
+ };
1703
+ }
1704
+ case "escaped": {
1705
+ const i = await we(t, {
1706
+ ...o,
1707
+ altBoundary: !0
1708
+ }), s = Bt(i, n.floating);
1709
+ return {
1710
+ data: {
1711
+ escapedOffsets: s,
1712
+ escaped: Ht(s)
1713
+ }
1714
+ };
1715
+ }
1716
+ default:
1717
+ return {};
1718
+ }
1719
+ }
1720
+ };
1721
+ }, On = /* @__PURE__ */ new Set(["left", "top"]);
1722
+ async function si(e, t) {
1723
+ const {
1724
+ placement: n,
1725
+ platform: r,
1726
+ elements: o
1727
+ } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = J(n), a = ve(n), u = X(n) === "y", l = On.has(s) ? -1 : 1, f = i && u ? -1 : 1, d = Q(t, e);
1728
+ let {
1729
+ mainAxis: h,
1730
+ crossAxis: m,
1731
+ alignmentAxis: v
1732
+ } = typeof d == "number" ? {
1733
+ mainAxis: d,
1734
+ crossAxis: 0,
1735
+ alignmentAxis: null
1736
+ } : {
1737
+ mainAxis: d.mainAxis || 0,
1738
+ crossAxis: d.crossAxis || 0,
1739
+ alignmentAxis: d.alignmentAxis
1740
+ };
1741
+ return a && typeof v == "number" && (m = a === "end" ? v * -1 : v), u ? {
1742
+ x: m * f,
1743
+ y: h * l
1744
+ } : {
1745
+ x: h * l,
1746
+ y: m * f
1747
+ };
1748
+ }
1749
+ const ai = function(e) {
1750
+ return e === void 0 && (e = 0), {
1751
+ name: "offset",
1752
+ options: e,
1753
+ async fn(t) {
1754
+ var n, r;
1755
+ const {
1756
+ x: o,
1757
+ y: i,
1758
+ placement: s,
1759
+ middlewareData: a
1760
+ } = t, u = await si(t, e);
1761
+ return s === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : {
1762
+ x: o + u.x,
1763
+ y: i + u.y,
1764
+ data: {
1765
+ ...u,
1766
+ placement: s
1767
+ }
1768
+ };
1769
+ }
1770
+ };
1771
+ }, ci = function(e) {
1772
+ return e === void 0 && (e = {}), {
1773
+ name: "shift",
1774
+ options: e,
1775
+ async fn(t) {
1776
+ const {
1777
+ x: n,
1778
+ y: r,
1779
+ placement: o
1780
+ } = t, {
1781
+ mainAxis: i = !0,
1782
+ crossAxis: s = !1,
1783
+ limiter: a = {
1784
+ fn: (g) => {
1785
+ let {
1786
+ x: y,
1787
+ y: x
1788
+ } = g;
1789
+ return {
1790
+ x: y,
1791
+ y: x
1792
+ };
1793
+ }
1794
+ },
1795
+ ...u
1796
+ } = Q(e, t), l = {
1797
+ x: n,
1798
+ y: r
1799
+ }, f = await we(t, u), d = X(J(o)), h = mt(d);
1800
+ let m = l[h], v = l[d];
1801
+ if (i) {
1802
+ const g = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", x = m + f[g], E = m - f[y];
1803
+ m = nt(x, m, E);
1804
+ }
1805
+ if (s) {
1806
+ const g = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", x = v + f[g], E = v - f[y];
1807
+ v = nt(x, v, E);
1808
+ }
1809
+ const p = a.fn({
1810
+ ...t,
1811
+ [h]: m,
1812
+ [d]: v
1813
+ });
1814
+ return {
1815
+ ...p,
1816
+ data: {
1817
+ x: p.x - n,
1818
+ y: p.y - r,
1819
+ enabled: {
1820
+ [h]: i,
1821
+ [d]: s
1822
+ }
1823
+ }
1824
+ };
1825
+ }
1826
+ };
1827
+ }, li = function(e) {
1828
+ return e === void 0 && (e = {}), {
1829
+ options: e,
1830
+ fn(t) {
1831
+ const {
1832
+ x: n,
1833
+ y: r,
1834
+ placement: o,
1835
+ rects: i,
1836
+ middlewareData: s
1837
+ } = t, {
1838
+ offset: a = 0,
1839
+ mainAxis: u = !0,
1840
+ crossAxis: l = !0
1841
+ } = Q(e, t), f = {
1842
+ x: n,
1843
+ y: r
1844
+ }, d = X(o), h = mt(d);
1845
+ let m = f[h], v = f[d];
1846
+ const p = Q(a, t), g = typeof p == "number" ? {
1847
+ mainAxis: p,
1848
+ crossAxis: 0
1849
+ } : {
1850
+ mainAxis: 0,
1851
+ crossAxis: 0,
1852
+ ...p
1853
+ };
1854
+ if (u) {
1855
+ const E = h === "y" ? "height" : "width", b = i.reference[h] - i.floating[E] + g.mainAxis, C = i.reference[h] + i.reference[E] - g.mainAxis;
1856
+ m < b ? m = b : m > C && (m = C);
1857
+ }
1858
+ if (l) {
1859
+ var y, x;
1860
+ const E = h === "y" ? "width" : "height", b = On.has(J(o)), C = i.reference[d] - i.floating[E] + (b && ((y = s.offset) == null ? void 0 : y[d]) || 0) + (b ? 0 : g.crossAxis), R = i.reference[d] + i.reference[E] + (b ? 0 : ((x = s.offset) == null ? void 0 : x[d]) || 0) - (b ? g.crossAxis : 0);
1861
+ v < C ? v = C : v > R && (v = R);
1862
+ }
1863
+ return {
1864
+ [h]: m,
1865
+ [d]: v
1866
+ };
1867
+ }
1868
+ };
1869
+ }, ui = function(e) {
1870
+ return e === void 0 && (e = {}), {
1871
+ name: "size",
1872
+ options: e,
1873
+ async fn(t) {
1874
+ var n, r;
1875
+ const {
1876
+ placement: o,
1877
+ rects: i,
1878
+ platform: s,
1879
+ elements: a
1880
+ } = t, {
1881
+ apply: u = () => {
1882
+ },
1883
+ ...l
1884
+ } = Q(e, t), f = await we(t, l), d = J(o), h = ve(o), m = X(o) === "y", {
1885
+ width: v,
1886
+ height: p
1887
+ } = i.floating;
1888
+ let g, y;
1889
+ d === "top" || d === "bottom" ? (g = d, y = h === (await (s.isRTL == null ? void 0 : s.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = d, g = h === "end" ? "top" : "bottom");
1890
+ const x = p - f.top - f.bottom, E = v - f.left - f.right, b = ne(p - f[g], x), C = ne(v - f[y], E), R = !t.middlewareData.shift;
1891
+ let P = b, S = C;
1892
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = E), (r = t.middlewareData.shift) != null && r.enabled.y && (P = x), R && !h) {
1893
+ const O = W(f.left, 0), F = W(f.right, 0), I = W(f.top, 0), T = W(f.bottom, 0);
1894
+ m ? S = v - 2 * (O !== 0 || F !== 0 ? O + F : W(f.left, f.right)) : P = p - 2 * (I !== 0 || T !== 0 ? I + T : W(f.top, f.bottom));
1895
+ }
1896
+ await u({
1897
+ ...t,
1898
+ availableWidth: S,
1899
+ availableHeight: P
1900
+ });
1901
+ const N = await s.getDimensions(a.floating);
1902
+ return v !== N.width || p !== N.height ? {
1903
+ reset: {
1904
+ rects: !0
1905
+ }
1906
+ } : {};
1907
+ }
1908
+ };
1909
+ };
1910
+ function Be() {
1911
+ return typeof window < "u";
1912
+ }
1913
+ function ge(e) {
1914
+ return Dn(e) ? (e.nodeName || "").toLowerCase() : "#document";
1915
+ }
1916
+ function B(e) {
1917
+ var t;
1918
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1919
+ }
1920
+ function Z(e) {
1921
+ var t;
1922
+ return (t = (Dn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1923
+ }
1924
+ function Dn(e) {
1925
+ return Be() ? e instanceof Node || e instanceof B(e).Node : !1;
1926
+ }
1927
+ function H(e) {
1928
+ return Be() ? e instanceof Element || e instanceof B(e).Element : !1;
1929
+ }
1930
+ function q(e) {
1931
+ return Be() ? e instanceof HTMLElement || e instanceof B(e).HTMLElement : !1;
1932
+ }
1933
+ function zt(e) {
1934
+ return !Be() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof B(e).ShadowRoot;
1935
+ }
1936
+ const fi = /* @__PURE__ */ new Set(["inline", "contents"]);
1937
+ function be(e) {
1938
+ const {
1939
+ overflow: t,
1940
+ overflowX: n,
1941
+ overflowY: r,
1942
+ display: o
1943
+ } = z(e);
1944
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !fi.has(o);
1945
+ }
1946
+ const di = /* @__PURE__ */ new Set(["table", "td", "th"]);
1947
+ function pi(e) {
1948
+ return di.has(ge(e));
1949
+ }
1950
+ const mi = [":popover-open", ":modal"];
1951
+ function He(e) {
1952
+ return mi.some((t) => {
1953
+ try {
1954
+ return e.matches(t);
1955
+ } catch {
1956
+ return !1;
1957
+ }
1958
+ });
1959
+ }
1960
+ const hi = ["transform", "translate", "scale", "rotate", "perspective"], vi = ["transform", "translate", "scale", "rotate", "perspective", "filter"], gi = ["paint", "layout", "strict", "content"];
1961
+ function gt(e) {
1962
+ const t = yt(), n = H(e) ? z(e) : e;
1963
+ return hi.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || vi.some((r) => (n.willChange || "").includes(r)) || gi.some((r) => (n.contain || "").includes(r));
1964
+ }
1965
+ function yi(e) {
1966
+ let t = re(e);
1967
+ for (; q(t) && !pe(t); ) {
1968
+ if (gt(t))
1969
+ return t;
1970
+ if (He(t))
1971
+ return null;
1972
+ t = re(t);
1973
+ }
1974
+ return null;
1975
+ }
1976
+ function yt() {
1977
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1978
+ }
1979
+ const wi = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1980
+ function pe(e) {
1981
+ return wi.has(ge(e));
1982
+ }
1983
+ function z(e) {
1984
+ return B(e).getComputedStyle(e);
1985
+ }
1986
+ function ze(e) {
1987
+ return H(e) ? {
1988
+ scrollLeft: e.scrollLeft,
1989
+ scrollTop: e.scrollTop
1990
+ } : {
1991
+ scrollLeft: e.scrollX,
1992
+ scrollTop: e.scrollY
1993
+ };
1994
+ }
1995
+ function re(e) {
1996
+ if (ge(e) === "html")
1997
+ return e;
1998
+ const t = (
1999
+ // Step into the shadow DOM of the parent of a slotted node.
2000
+ e.assignedSlot || // DOM Element detected.
2001
+ e.parentNode || // ShadowRoot detected.
2002
+ zt(e) && e.host || // Fallback.
2003
+ Z(e)
2004
+ );
2005
+ return zt(t) ? t.host : t;
2006
+ }
2007
+ function Nn(e) {
2008
+ const t = re(e);
2009
+ return pe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : q(t) && be(t) ? t : Nn(t);
2010
+ }
2011
+ function xe(e, t, n) {
2012
+ var r;
2013
+ t === void 0 && (t = []), n === void 0 && (n = !0);
2014
+ const o = Nn(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = B(o);
2015
+ if (i) {
2016
+ const a = ot(s);
2017
+ return t.concat(s, s.visualViewport || [], be(o) ? o : [], a && n ? xe(a) : []);
2018
+ }
2019
+ return t.concat(o, xe(o, [], n));
2020
+ }
2021
+ function ot(e) {
2022
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
2023
+ }
2024
+ function Tn(e) {
2025
+ const t = z(e);
2026
+ let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
2027
+ const o = q(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, a = Fe(n) !== i || Fe(r) !== s;
2028
+ return a && (n = i, r = s), {
2029
+ width: n,
2030
+ height: r,
2031
+ $: a
2032
+ };
2033
+ }
2034
+ function wt(e) {
2035
+ return H(e) ? e : e.contextElement;
2036
+ }
2037
+ function fe(e) {
2038
+ const t = wt(e);
2039
+ if (!q(t))
2040
+ return G(1);
2041
+ const n = t.getBoundingClientRect(), {
2042
+ width: r,
2043
+ height: o,
2044
+ $: i
2045
+ } = Tn(t);
2046
+ let s = (i ? Fe(n.width) : n.width) / r, a = (i ? Fe(n.height) : n.height) / o;
2047
+ return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
2048
+ x: s,
2049
+ y: a
2050
+ };
2051
+ }
2052
+ const xi = /* @__PURE__ */ G(0);
2053
+ function Mn(e) {
2054
+ const t = B(e);
2055
+ return !yt() || !t.visualViewport ? xi : {
2056
+ x: t.visualViewport.offsetLeft,
2057
+ y: t.visualViewport.offsetTop
2058
+ };
2059
+ }
2060
+ function bi(e, t, n) {
2061
+ return t === void 0 && (t = !1), !n || t && n !== B(e) ? !1 : t;
2062
+ }
2063
+ function se(e, t, n, r) {
2064
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
2065
+ const o = e.getBoundingClientRect(), i = wt(e);
2066
+ let s = G(1);
2067
+ t && (r ? H(r) && (s = fe(r)) : s = fe(e));
2068
+ const a = bi(i, n, r) ? Mn(i) : G(0);
2069
+ let u = (o.left + a.x) / s.x, l = (o.top + a.y) / s.y, f = o.width / s.x, d = o.height / s.y;
2070
+ if (i) {
2071
+ const h = B(i), m = r && H(r) ? B(r) : r;
2072
+ let v = h, p = ot(v);
2073
+ for (; p && r && m !== v; ) {
2074
+ const g = fe(p), y = p.getBoundingClientRect(), x = z(p), E = y.left + (p.clientLeft + parseFloat(x.paddingLeft)) * g.x, b = y.top + (p.clientTop + parseFloat(x.paddingTop)) * g.y;
2075
+ u *= g.x, l *= g.y, f *= g.x, d *= g.y, u += E, l += b, v = B(p), p = ot(v);
2076
+ }
2077
+ }
2078
+ return ke({
2079
+ width: f,
2080
+ height: d,
2081
+ x: u,
2082
+ y: l
2083
+ });
2084
+ }
2085
+ function xt(e, t) {
2086
+ const n = ze(e).scrollLeft;
2087
+ return t ? t.left + n : se(Z(e)).left + n;
2088
+ }
2089
+ function _n(e, t, n) {
2090
+ n === void 0 && (n = !1);
2091
+ const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
2092
+ // RTL <body> scrollbar.
2093
+ xt(e, r)
2094
+ )), i = r.top + t.scrollTop;
2095
+ return {
2096
+ x: o,
2097
+ y: i
2098
+ };
2099
+ }
2100
+ function Ei(e) {
2101
+ let {
2102
+ elements: t,
2103
+ rect: n,
2104
+ offsetParent: r,
2105
+ strategy: o
2106
+ } = e;
2107
+ const i = o === "fixed", s = Z(r), a = t ? He(t.floating) : !1;
2108
+ if (r === s || a && i)
2109
+ return n;
2110
+ let u = {
2111
+ scrollLeft: 0,
2112
+ scrollTop: 0
2113
+ }, l = G(1);
2114
+ const f = G(0), d = q(r);
2115
+ if ((d || !d && !i) && ((ge(r) !== "body" || be(s)) && (u = ze(r)), q(r))) {
2116
+ const m = se(r);
2117
+ l = fe(r), f.x = m.x + r.clientLeft, f.y = m.y + r.clientTop;
2118
+ }
2119
+ const h = s && !d && !i ? _n(s, u, !0) : G(0);
2120
+ return {
2121
+ width: n.width * l.x,
2122
+ height: n.height * l.y,
2123
+ x: n.x * l.x - u.scrollLeft * l.x + f.x + h.x,
2124
+ y: n.y * l.y - u.scrollTop * l.y + f.y + h.y
2125
+ };
2126
+ }
2127
+ function Ci(e) {
2128
+ return Array.from(e.getClientRects());
2129
+ }
2130
+ function Pi(e) {
2131
+ const t = Z(e), n = ze(e), r = e.ownerDocument.body, o = W(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = W(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
2132
+ let s = -n.scrollLeft + xt(e);
2133
+ const a = -n.scrollTop;
2134
+ return z(r).direction === "rtl" && (s += W(t.clientWidth, r.clientWidth) - o), {
2135
+ width: o,
2136
+ height: i,
2137
+ x: s,
2138
+ y: a
2139
+ };
2140
+ }
2141
+ function Ri(e, t) {
2142
+ const n = B(e), r = Z(e), o = n.visualViewport;
2143
+ let i = r.clientWidth, s = r.clientHeight, a = 0, u = 0;
2144
+ if (o) {
2145
+ i = o.width, s = o.height;
2146
+ const l = yt();
2147
+ (!l || l && t === "fixed") && (a = o.offsetLeft, u = o.offsetTop);
2148
+ }
2149
+ return {
2150
+ width: i,
2151
+ height: s,
2152
+ x: a,
2153
+ y: u
2154
+ };
2155
+ }
2156
+ const Ai = /* @__PURE__ */ new Set(["absolute", "fixed"]);
2157
+ function Si(e, t) {
2158
+ const n = se(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = q(e) ? fe(e) : G(1), s = e.clientWidth * i.x, a = e.clientHeight * i.y, u = o * i.x, l = r * i.y;
2159
+ return {
2160
+ width: s,
2161
+ height: a,
2162
+ x: u,
2163
+ y: l
2164
+ };
2165
+ }
2166
+ function Vt(e, t, n) {
2167
+ let r;
2168
+ if (t === "viewport")
2169
+ r = Ri(e, n);
2170
+ else if (t === "document")
2171
+ r = Pi(Z(e));
2172
+ else if (H(t))
2173
+ r = Si(t, n);
2174
+ else {
2175
+ const o = Mn(e);
2176
+ r = {
2177
+ x: t.x - o.x,
2178
+ y: t.y - o.y,
2179
+ width: t.width,
2180
+ height: t.height
2181
+ };
2182
+ }
2183
+ return ke(r);
2184
+ }
2185
+ function Ln(e, t) {
2186
+ const n = re(e);
2187
+ return n === t || !H(n) || pe(n) ? !1 : z(n).position === "fixed" || Ln(n, t);
2188
+ }
2189
+ function Oi(e, t) {
2190
+ const n = t.get(e);
2191
+ if (n)
2192
+ return n;
2193
+ let r = xe(e, [], !1).filter((a) => H(a) && ge(a) !== "body"), o = null;
2194
+ const i = z(e).position === "fixed";
2195
+ let s = i ? re(e) : e;
2196
+ for (; H(s) && !pe(s); ) {
2197
+ const a = z(s), u = gt(s);
2198
+ !u && a.position === "fixed" && (o = null), (i ? !u && !o : !u && a.position === "static" && !!o && Ai.has(o.position) || be(s) && !u && Ln(e, s)) ? r = r.filter((f) => f !== s) : o = a, s = re(s);
2199
+ }
2200
+ return t.set(e, r), r;
2201
+ }
2202
+ function Di(e) {
2203
+ let {
2204
+ element: t,
2205
+ boundary: n,
2206
+ rootBoundary: r,
2207
+ strategy: o
2208
+ } = e;
2209
+ const s = [...n === "clippingAncestors" ? He(t) ? [] : Oi(t, this._c) : [].concat(n), r], a = s[0], u = s.reduce((l, f) => {
2210
+ const d = Vt(t, f, o);
2211
+ return l.top = W(d.top, l.top), l.right = ne(d.right, l.right), l.bottom = ne(d.bottom, l.bottom), l.left = W(d.left, l.left), l;
2212
+ }, Vt(t, a, o));
2213
+ return {
2214
+ width: u.right - u.left,
2215
+ height: u.bottom - u.top,
2216
+ x: u.left,
2217
+ y: u.top
2218
+ };
2219
+ }
2220
+ function Ni(e) {
2221
+ const {
2222
+ width: t,
2223
+ height: n
2224
+ } = Tn(e);
2225
+ return {
2226
+ width: t,
2227
+ height: n
2228
+ };
2229
+ }
2230
+ function Ti(e, t, n) {
2231
+ const r = q(t), o = Z(t), i = n === "fixed", s = se(e, !0, i, t);
2232
+ let a = {
2233
+ scrollLeft: 0,
2234
+ scrollTop: 0
2235
+ };
2236
+ const u = G(0);
2237
+ function l() {
2238
+ u.x = xt(o);
2239
+ }
2240
+ if (r || !r && !i)
2241
+ if ((ge(t) !== "body" || be(o)) && (a = ze(t)), r) {
2242
+ const m = se(t, !0, i, t);
2243
+ u.x = m.x + t.clientLeft, u.y = m.y + t.clientTop;
2244
+ } else o && l();
2245
+ i && !r && o && l();
2246
+ const f = o && !r && !i ? _n(o, a) : G(0), d = s.left + a.scrollLeft - u.x - f.x, h = s.top + a.scrollTop - u.y - f.y;
2247
+ return {
2248
+ x: d,
2249
+ y: h,
2250
+ width: s.width,
2251
+ height: s.height
2252
+ };
2253
+ }
2254
+ function Qe(e) {
2255
+ return z(e).position === "static";
2256
+ }
2257
+ function Ut(e, t) {
2258
+ if (!q(e) || z(e).position === "fixed")
2259
+ return null;
2260
+ if (t)
2261
+ return t(e);
2262
+ let n = e.offsetParent;
2263
+ return Z(e) === n && (n = n.ownerDocument.body), n;
2264
+ }
2265
+ function Fn(e, t) {
2266
+ const n = B(e);
2267
+ if (He(e))
2268
+ return n;
2269
+ if (!q(e)) {
2270
+ let o = re(e);
2271
+ for (; o && !pe(o); ) {
2272
+ if (H(o) && !Qe(o))
2273
+ return o;
2274
+ o = re(o);
2275
+ }
2276
+ return n;
2277
+ }
2278
+ let r = Ut(e, t);
2279
+ for (; r && pi(r) && Qe(r); )
2280
+ r = Ut(r, t);
2281
+ return r && pe(r) && Qe(r) && !gt(r) ? n : r || yi(e) || n;
2282
+ }
2283
+ const Mi = async function(e) {
2284
+ const t = this.getOffsetParent || Fn, n = this.getDimensions, r = await n(e.floating);
2285
+ return {
2286
+ reference: Ti(e.reference, await t(e.floating), e.strategy),
2287
+ floating: {
2288
+ x: 0,
2289
+ y: 0,
2290
+ width: r.width,
2291
+ height: r.height
2292
+ }
2293
+ };
2294
+ };
2295
+ function _i(e) {
2296
+ return z(e).direction === "rtl";
2297
+ }
2298
+ const Li = {
2299
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ei,
2300
+ getDocumentElement: Z,
2301
+ getClippingRect: Di,
2302
+ getOffsetParent: Fn,
2303
+ getElementRects: Mi,
2304
+ getClientRects: Ci,
2305
+ getDimensions: Ni,
2306
+ getScale: fe,
2307
+ isElement: H,
2308
+ isRTL: _i
2309
+ };
2310
+ function In(e, t) {
2311
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
2312
+ }
2313
+ function Fi(e, t) {
2314
+ let n = null, r;
2315
+ const o = Z(e);
2316
+ function i() {
2317
+ var a;
2318
+ clearTimeout(r), (a = n) == null || a.disconnect(), n = null;
2319
+ }
2320
+ function s(a, u) {
2321
+ a === void 0 && (a = !1), u === void 0 && (u = 1), i();
2322
+ const l = e.getBoundingClientRect(), {
2323
+ left: f,
2324
+ top: d,
2325
+ width: h,
2326
+ height: m
2327
+ } = l;
2328
+ if (a || t(), !h || !m)
2329
+ return;
2330
+ const v = De(d), p = De(o.clientWidth - (f + h)), g = De(o.clientHeight - (d + m)), y = De(f), E = {
2331
+ rootMargin: -v + "px " + -p + "px " + -g + "px " + -y + "px",
2332
+ threshold: W(0, ne(1, u)) || 1
2333
+ };
2334
+ let b = !0;
2335
+ function C(R) {
2336
+ const P = R[0].intersectionRatio;
2337
+ if (P !== u) {
2338
+ if (!b)
2339
+ return s();
2340
+ P ? s(!1, P) : r = setTimeout(() => {
2341
+ s(!1, 1e-7);
2342
+ }, 1e3);
2343
+ }
2344
+ P === 1 && !In(l, e.getBoundingClientRect()) && s(), b = !1;
2345
+ }
2346
+ try {
2347
+ n = new IntersectionObserver(C, {
2348
+ ...E,
2349
+ // Handle <iframe>s
2350
+ root: o.ownerDocument
2351
+ });
2352
+ } catch {
2353
+ n = new IntersectionObserver(C, E);
2354
+ }
2355
+ n.observe(e);
2356
+ }
2357
+ return s(!0), i;
2358
+ }
2359
+ function Ii(e, t, n, r) {
2360
+ r === void 0 && (r = {});
2361
+ const {
2362
+ ancestorScroll: o = !0,
2363
+ ancestorResize: i = !0,
2364
+ elementResize: s = typeof ResizeObserver == "function",
2365
+ layoutShift: a = typeof IntersectionObserver == "function",
2366
+ animationFrame: u = !1
2367
+ } = r, l = wt(e), f = o || i ? [...l ? xe(l) : [], ...xe(t)] : [];
2368
+ f.forEach((y) => {
2369
+ o && y.addEventListener("scroll", n, {
2370
+ passive: !0
2371
+ }), i && y.addEventListener("resize", n);
2372
+ });
2373
+ const d = l && a ? Fi(l, n) : null;
2374
+ let h = -1, m = null;
2375
+ s && (m = new ResizeObserver((y) => {
2376
+ let [x] = y;
2377
+ x && x.target === l && m && (m.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
2378
+ var E;
2379
+ (E = m) == null || E.observe(t);
2380
+ })), n();
2381
+ }), l && !u && m.observe(l), m.observe(t));
2382
+ let v, p = u ? se(e) : null;
2383
+ u && g();
2384
+ function g() {
2385
+ const y = se(e);
2386
+ p && !In(p, y) && n(), p = y, v = requestAnimationFrame(g);
2387
+ }
2388
+ return n(), () => {
2389
+ var y;
2390
+ f.forEach((x) => {
2391
+ o && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
2392
+ }), d?.(), (y = m) == null || y.disconnect(), m = null, u && cancelAnimationFrame(v);
2393
+ };
2394
+ }
2395
+ const ki = ai, ji = ci, Wi = oi, $i = ui, Bi = ii, Yt = ri, Hi = li, zi = (e, t, n) => {
2396
+ const r = /* @__PURE__ */ new Map(), o = {
2397
+ platform: Li,
2398
+ ...n
2399
+ }, i = {
2400
+ ...o.platform,
2401
+ _c: r
2402
+ };
2403
+ return ni(e, t, {
2404
+ ...o,
2405
+ platform: i
2406
+ });
2407
+ };
2408
+ var Vi = typeof document < "u", Ui = function() {
2409
+ }, _e = Vi ? vr : Ui;
2410
+ function je(e, t) {
2411
+ if (e === t)
2412
+ return !0;
2413
+ if (typeof e != typeof t)
2414
+ return !1;
2415
+ if (typeof e == "function" && e.toString() === t.toString())
2416
+ return !0;
2417
+ let n, r, o;
2418
+ if (e && t && typeof e == "object") {
2419
+ if (Array.isArray(e)) {
2420
+ if (n = e.length, n !== t.length) return !1;
2421
+ for (r = n; r-- !== 0; )
2422
+ if (!je(e[r], t[r]))
2423
+ return !1;
2424
+ return !0;
2425
+ }
2426
+ if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
2427
+ return !1;
2428
+ for (r = n; r-- !== 0; )
2429
+ if (!{}.hasOwnProperty.call(t, o[r]))
2430
+ return !1;
2431
+ for (r = n; r-- !== 0; ) {
2432
+ const i = o[r];
2433
+ if (!(i === "_owner" && e.$$typeof) && !je(e[i], t[i]))
2434
+ return !1;
2435
+ }
2436
+ return !0;
2437
+ }
2438
+ return e !== e && t !== t;
2439
+ }
2440
+ function kn(e) {
2441
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
2442
+ }
2443
+ function Kt(e, t) {
2444
+ const n = kn(e);
2445
+ return Math.round(t * n) / n;
2446
+ }
2447
+ function Je(e) {
2448
+ const t = c.useRef(e);
2449
+ return _e(() => {
2450
+ t.current = e;
2451
+ }), t;
2452
+ }
2453
+ function Yi(e) {
2454
+ e === void 0 && (e = {});
2455
+ const {
2456
+ placement: t = "bottom",
2457
+ strategy: n = "absolute",
2458
+ middleware: r = [],
2459
+ platform: o,
2460
+ elements: {
2461
+ reference: i,
2462
+ floating: s
2463
+ } = {},
2464
+ transform: a = !0,
2465
+ whileElementsMounted: u,
2466
+ open: l
2467
+ } = e, [f, d] = c.useState({
2468
+ x: 0,
2469
+ y: 0,
2470
+ strategy: n,
2471
+ placement: t,
2472
+ middlewareData: {},
2473
+ isPositioned: !1
2474
+ }), [h, m] = c.useState(r);
2475
+ je(h, r) || m(r);
2476
+ const [v, p] = c.useState(null), [g, y] = c.useState(null), x = c.useCallback((A) => {
2477
+ A !== R.current && (R.current = A, p(A));
2478
+ }, []), E = c.useCallback((A) => {
2479
+ A !== P.current && (P.current = A, y(A));
2480
+ }, []), b = i || v, C = s || g, R = c.useRef(null), P = c.useRef(null), S = c.useRef(f), N = u != null, O = Je(u), F = Je(o), I = Je(l), T = c.useCallback(() => {
2481
+ if (!R.current || !P.current)
2482
+ return;
2483
+ const A = {
2484
+ placement: t,
2485
+ strategy: n,
2486
+ middleware: h
2487
+ };
2488
+ F.current && (A.platform = F.current), zi(R.current, P.current, A).then((L) => {
2489
+ const Y = {
2490
+ ...L,
2491
+ // The floating element's position may be recomputed while it's closed
2492
+ // but still mounted (such as when transitioning out). To ensure
2493
+ // `isPositioned` will be `false` initially on the next open, avoid
2494
+ // setting it to `true` when `open === false` (must be specified).
2495
+ isPositioned: I.current !== !1
2496
+ };
2497
+ D.current && !je(S.current, Y) && (S.current = Y, Xt.flushSync(() => {
2498
+ d(Y);
2499
+ }));
2500
+ });
2501
+ }, [h, t, n, F, I]);
2502
+ _e(() => {
2503
+ l === !1 && S.current.isPositioned && (S.current.isPositioned = !1, d((A) => ({
2504
+ ...A,
2505
+ isPositioned: !1
2506
+ })));
2507
+ }, [l]);
2508
+ const D = c.useRef(!1);
2509
+ _e(() => (D.current = !0, () => {
2510
+ D.current = !1;
2511
+ }), []), _e(() => {
2512
+ if (b && (R.current = b), C && (P.current = C), b && C) {
2513
+ if (O.current)
2514
+ return O.current(b, C, T);
2515
+ T();
2516
+ }
2517
+ }, [b, C, T, O, N]);
2518
+ const j = c.useMemo(() => ({
2519
+ reference: R,
2520
+ floating: P,
2521
+ setReference: x,
2522
+ setFloating: E
2523
+ }), [x, E]), M = c.useMemo(() => ({
2524
+ reference: b,
2525
+ floating: C
2526
+ }), [b, C]), _ = c.useMemo(() => {
2527
+ const A = {
2528
+ position: n,
2529
+ left: 0,
2530
+ top: 0
2531
+ };
2532
+ if (!M.floating)
2533
+ return A;
2534
+ const L = Kt(M.floating, f.x), Y = Kt(M.floating, f.y);
2535
+ return a ? {
2536
+ ...A,
2537
+ transform: "translate(" + L + "px, " + Y + "px)",
2538
+ ...kn(M.floating) >= 1.5 && {
2539
+ willChange: "transform"
2540
+ }
2541
+ } : {
2542
+ position: n,
2543
+ left: L,
2544
+ top: Y
2545
+ };
2546
+ }, [n, a, M.floating, f.x, f.y]);
2547
+ return c.useMemo(() => ({
2548
+ ...f,
2549
+ update: T,
2550
+ refs: j,
2551
+ elements: M,
2552
+ floatingStyles: _
2553
+ }), [f, T, j, M, _]);
2554
+ }
2555
+ const Ki = (e) => {
2556
+ function t(n) {
2557
+ return {}.hasOwnProperty.call(n, "current");
2558
+ }
2559
+ return {
2560
+ name: "arrow",
2561
+ options: e,
2562
+ fn(n) {
2563
+ const {
2564
+ element: r,
2565
+ padding: o
2566
+ } = typeof e == "function" ? e(n) : e;
2567
+ return r && t(r) ? r.current != null ? Yt({
2568
+ element: r.current,
2569
+ padding: o
2570
+ }).fn(n) : {} : r ? Yt({
2571
+ element: r,
2572
+ padding: o
2573
+ }).fn(n) : {};
2574
+ }
2575
+ };
2576
+ }, Xi = (e, t) => ({
2577
+ ...ki(e),
2578
+ options: [e, t]
2579
+ }), Gi = (e, t) => ({
2580
+ ...ji(e),
2581
+ options: [e, t]
2582
+ }), qi = (e, t) => ({
2583
+ ...Hi(e),
2584
+ options: [e, t]
2585
+ }), Zi = (e, t) => ({
2586
+ ...Wi(e),
2587
+ options: [e, t]
2588
+ }), Qi = (e, t) => ({
2589
+ ...$i(e),
2590
+ options: [e, t]
2591
+ }), Ji = (e, t) => ({
2592
+ ...Bi(e),
2593
+ options: [e, t]
2594
+ }), es = (e, t) => ({
2595
+ ...Ki(e),
2596
+ options: [e, t]
2597
+ });
2598
+ var ts = "Arrow", jn = c.forwardRef((e, t) => {
2599
+ const { children: n, width: r = 10, height: o = 5, ...i } = e;
2600
+ return /* @__PURE__ */ w.jsx(
2601
+ k.svg,
2602
+ {
2603
+ ...i,
2604
+ ref: t,
2605
+ width: r,
2606
+ height: o,
2607
+ viewBox: "0 0 30 10",
2608
+ preserveAspectRatio: "none",
2609
+ children: e.asChild ? n : /* @__PURE__ */ w.jsx("polygon", { points: "0,0 30,0 15,10" })
2610
+ }
2611
+ );
2612
+ });
2613
+ jn.displayName = ts;
2614
+ var ns = jn, bt = "Popper", [Wn, $n] = st(bt), [rs, Bn] = Wn(bt), Hn = (e) => {
2615
+ const { __scopePopper: t, children: n } = e, [r, o] = c.useState(null);
2616
+ return /* @__PURE__ */ w.jsx(rs, { scope: t, anchor: r, onAnchorChange: o, children: n });
2617
+ };
2618
+ Hn.displayName = bt;
2619
+ var zn = "PopperAnchor", Vn = c.forwardRef(
2620
+ (e, t) => {
2621
+ const { __scopePopper: n, virtualRef: r, ...o } = e, i = Bn(zn, n), s = c.useRef(null), a = V(t, s);
2622
+ return c.useEffect(() => {
2623
+ i.onAnchorChange(r?.current || s.current);
2624
+ }), r ? null : /* @__PURE__ */ w.jsx(k.div, { ...o, ref: a });
2625
+ }
2626
+ );
2627
+ Vn.displayName = zn;
2628
+ var Et = "PopperContent", [os, is] = Wn(Et), Un = c.forwardRef(
2629
+ (e, t) => {
2630
+ const {
2631
+ __scopePopper: n,
2632
+ side: r = "bottom",
2633
+ sideOffset: o = 0,
2634
+ align: i = "center",
2635
+ alignOffset: s = 0,
2636
+ arrowPadding: a = 0,
2637
+ avoidCollisions: u = !0,
2638
+ collisionBoundary: l = [],
2639
+ collisionPadding: f = 0,
2640
+ sticky: d = "partial",
2641
+ hideWhenDetached: h = !1,
2642
+ updatePositionStrategy: m = "optimized",
2643
+ onPlaced: v,
2644
+ ...p
2645
+ } = e, g = Bn(Et, n), [y, x] = c.useState(null), E = V(t, (ye) => x(ye)), [b, C] = c.useState(null), R = Vo(b), P = R?.width ?? 0, S = R?.height ?? 0, N = r + (i !== "center" ? "-" + i : ""), O = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, F = Array.isArray(l) ? l : [l], I = F.length > 0, T = {
2646
+ padding: O,
2647
+ boundary: F.filter(as),
2648
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
2649
+ altBoundary: I
2650
+ }, { refs: D, floatingStyles: j, placement: M, isPositioned: _, middlewareData: A } = Yi({
2651
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
2652
+ strategy: "fixed",
2653
+ placement: N,
2654
+ whileElementsMounted: (...ye) => Ii(...ye, {
2655
+ animationFrame: m === "always"
2656
+ }),
2657
+ elements: {
2658
+ reference: g.anchor
2659
+ },
2660
+ middleware: [
2661
+ Xi({ mainAxis: o + S, alignmentAxis: s }),
2662
+ u && Gi({
2663
+ mainAxis: !0,
2664
+ crossAxis: !1,
2665
+ limiter: d === "partial" ? qi() : void 0,
2666
+ ...T
2667
+ }),
2668
+ u && Zi({ ...T }),
2669
+ Qi({
2670
+ ...T,
2671
+ apply: ({ elements: ye, rects: Rt, availableWidth: fr, availableHeight: dr }) => {
2672
+ const { width: pr, height: mr } = Rt.reference, Ce = ye.floating.style;
2673
+ Ce.setProperty("--radix-popper-available-width", `${fr}px`), Ce.setProperty("--radix-popper-available-height", `${dr}px`), Ce.setProperty("--radix-popper-anchor-width", `${pr}px`), Ce.setProperty("--radix-popper-anchor-height", `${mr}px`);
2674
+ }
2675
+ }),
2676
+ b && es({ element: b, padding: a }),
2677
+ cs({ arrowWidth: P, arrowHeight: S }),
2678
+ h && Ji({ strategy: "referenceHidden", ...T })
2679
+ ]
2680
+ }), [L, Y] = Xn(M), Pt = de(v);
2681
+ te(() => {
2682
+ _ && Pt?.();
2683
+ }, [_, Pt]);
2684
+ const sr = A.arrow?.x, ar = A.arrow?.y, cr = A.arrow?.centerOffset !== 0, [lr, ur] = c.useState();
2685
+ return te(() => {
2686
+ y && ur(window.getComputedStyle(y).zIndex);
2687
+ }, [y]), /* @__PURE__ */ w.jsx(
2688
+ "div",
2689
+ {
2690
+ ref: D.setFloating,
2691
+ "data-radix-popper-content-wrapper": "",
2692
+ style: {
2693
+ ...j,
2694
+ transform: _ ? j.transform : "translate(0, -200%)",
2695
+ // keep off the page when measuring
2696
+ minWidth: "max-content",
2697
+ zIndex: lr,
2698
+ "--radix-popper-transform-origin": [
2699
+ A.transformOrigin?.x,
2700
+ A.transformOrigin?.y
2701
+ ].join(" "),
2702
+ // hide the content if using the hide middleware and should be hidden
2703
+ // set visibility to hidden and disable pointer events so the UI behaves
2704
+ // as if the PopperContent isn't there at all
2705
+ ...A.hide?.referenceHidden && {
2706
+ visibility: "hidden",
2707
+ pointerEvents: "none"
2708
+ }
2709
+ },
2710
+ dir: e.dir,
2711
+ children: /* @__PURE__ */ w.jsx(
2712
+ os,
2713
+ {
2714
+ scope: n,
2715
+ placedSide: L,
2716
+ onArrowChange: C,
2717
+ arrowX: sr,
2718
+ arrowY: ar,
2719
+ shouldHideArrow: cr,
2720
+ children: /* @__PURE__ */ w.jsx(
2721
+ k.div,
2722
+ {
2723
+ "data-side": L,
2724
+ "data-align": Y,
2725
+ ...p,
2726
+ ref: E,
2727
+ style: {
2728
+ ...p.style,
2729
+ // if the PopperContent hasn't been placed yet (not all measurements done)
2730
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
2731
+ animation: _ ? void 0 : "none"
2732
+ }
2733
+ }
2734
+ )
2735
+ }
2736
+ )
2737
+ }
2738
+ );
2739
+ }
2740
+ );
2741
+ Un.displayName = Et;
2742
+ var Yn = "PopperArrow", ss = {
2743
+ top: "bottom",
2744
+ right: "left",
2745
+ bottom: "top",
2746
+ left: "right"
2747
+ }, Kn = c.forwardRef(function(t, n) {
2748
+ const { __scopePopper: r, ...o } = t, i = is(Yn, r), s = ss[i.placedSide];
2749
+ return (
2750
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
2751
+ // doesn't report size as we'd expect on SVG elements.
2752
+ // it reports their bounding box which is effectively the largest path inside the SVG.
2753
+ /* @__PURE__ */ w.jsx(
2754
+ "span",
2755
+ {
2756
+ ref: i.onArrowChange,
2757
+ style: {
2758
+ position: "absolute",
2759
+ left: i.arrowX,
2760
+ top: i.arrowY,
2761
+ [s]: 0,
2762
+ transformOrigin: {
2763
+ top: "",
2764
+ right: "0 0",
2765
+ bottom: "center 0",
2766
+ left: "100% 0"
2767
+ }[i.placedSide],
2768
+ transform: {
2769
+ top: "translateY(100%)",
2770
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
2771
+ bottom: "rotate(180deg)",
2772
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
2773
+ }[i.placedSide],
2774
+ visibility: i.shouldHideArrow ? "hidden" : void 0
2775
+ },
2776
+ children: /* @__PURE__ */ w.jsx(
2777
+ ns,
2778
+ {
2779
+ ...o,
2780
+ ref: n,
2781
+ style: {
2782
+ ...o.style,
2783
+ // ensures the element can be measured correctly (mostly for if SVG)
2784
+ display: "block"
2785
+ }
2786
+ }
2787
+ )
2788
+ }
2789
+ )
2790
+ );
2791
+ });
2792
+ Kn.displayName = Yn;
2793
+ function as(e) {
2794
+ return e !== null;
2795
+ }
2796
+ var cs = (e) => ({
2797
+ name: "transformOrigin",
2798
+ options: e,
2799
+ fn(t) {
2800
+ const { placement: n, rects: r, middlewareData: o } = t, s = o.arrow?.centerOffset !== 0, a = s ? 0 : e.arrowWidth, u = s ? 0 : e.arrowHeight, [l, f] = Xn(n), d = { start: "0%", center: "50%", end: "100%" }[f], h = (o.arrow?.x ?? 0) + a / 2, m = (o.arrow?.y ?? 0) + u / 2;
2801
+ let v = "", p = "";
2802
+ return l === "bottom" ? (v = s ? d : `${h}px`, p = `${-u}px`) : l === "top" ? (v = s ? d : `${h}px`, p = `${r.floating.height + u}px`) : l === "right" ? (v = `${-u}px`, p = s ? d : `${m}px`) : l === "left" && (v = `${r.floating.width + u}px`, p = s ? d : `${m}px`), { data: { x: v, y: p } };
2803
+ }
2804
+ });
2805
+ function Xn(e) {
2806
+ const [t, n = "center"] = e.split("-");
2807
+ return [t, n];
2808
+ }
2809
+ var ls = Hn, Gn = Vn, us = Un, fs = Kn, Ve = "Popover", [qn, Bs] = st(Ve, [
2810
+ $n
2811
+ ]), Ee = $n(), [ds, oe] = qn(Ve), Zn = (e) => {
2812
+ const {
2813
+ __scopePopover: t,
2814
+ children: n,
2815
+ open: r,
2816
+ defaultOpen: o,
2817
+ onOpenChange: i,
2818
+ modal: s = !1
2819
+ } = e, a = Ee(t), u = c.useRef(null), [l, f] = c.useState(!1), [d, h] = qt({
2820
+ prop: r,
2821
+ defaultProp: o ?? !1,
2822
+ onChange: i,
2823
+ caller: Ve
2824
+ });
2825
+ return /* @__PURE__ */ w.jsx(ls, { ...a, children: /* @__PURE__ */ w.jsx(
2826
+ ds,
2827
+ {
2828
+ scope: t,
2829
+ contentId: Ne(),
2830
+ triggerRef: u,
2831
+ open: d,
2832
+ onOpenChange: h,
2833
+ onOpenToggle: c.useCallback(() => h((m) => !m), [h]),
2834
+ hasCustomAnchor: l,
2835
+ onCustomAnchorAdd: c.useCallback(() => f(!0), []),
2836
+ onCustomAnchorRemove: c.useCallback(() => f(!1), []),
2837
+ modal: s,
2838
+ children: n
2839
+ }
2840
+ ) });
2841
+ };
2842
+ Zn.displayName = Ve;
2843
+ var Qn = "PopoverAnchor", ps = c.forwardRef(
2844
+ (e, t) => {
2845
+ const { __scopePopover: n, ...r } = e, o = oe(Qn, n), i = Ee(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: a } = o;
2846
+ return c.useEffect(() => (s(), () => a()), [s, a]), /* @__PURE__ */ w.jsx(Gn, { ...i, ...r, ref: t });
2847
+ }
2848
+ );
2849
+ ps.displayName = Qn;
2850
+ var Jn = "PopoverTrigger", er = c.forwardRef(
2851
+ (e, t) => {
2852
+ const { __scopePopover: n, ...r } = e, o = oe(Jn, n), i = Ee(n), s = V(t, o.triggerRef), a = /* @__PURE__ */ w.jsx(
2853
+ k.button,
2854
+ {
2855
+ type: "button",
2856
+ "aria-haspopup": "dialog",
2857
+ "aria-expanded": o.open,
2858
+ "aria-controls": o.contentId,
2859
+ "data-state": ir(o.open),
2860
+ ...r,
2861
+ ref: s,
2862
+ onClick: $(e.onClick, o.onOpenToggle)
2863
+ }
2864
+ );
2865
+ return o.hasCustomAnchor ? a : /* @__PURE__ */ w.jsx(Gn, { asChild: !0, ...i, children: a });
2866
+ }
2867
+ );
2868
+ er.displayName = Jn;
2869
+ var Ct = "PopoverPortal", [ms, hs] = qn(Ct, {
2870
+ forceMount: void 0
2871
+ }), tr = (e) => {
2872
+ const { __scopePopover: t, forceMount: n, children: r, container: o } = e, i = oe(Ct, t);
2873
+ return /* @__PURE__ */ w.jsx(ms, { scope: t, forceMount: n, children: /* @__PURE__ */ w.jsx(he, { present: n || i.open, children: /* @__PURE__ */ w.jsx(lt, { asChild: !0, container: o, children: r }) }) });
2874
+ };
2875
+ tr.displayName = Ct;
2876
+ var me = "PopoverContent", nr = c.forwardRef(
2877
+ (e, t) => {
2878
+ const n = hs(me, e.__scopePopover), { forceMount: r = n.forceMount, ...o } = e, i = oe(me, e.__scopePopover);
2879
+ return /* @__PURE__ */ w.jsx(he, { present: r || i.open, children: i.modal ? /* @__PURE__ */ w.jsx(gs, { ...o, ref: t }) : /* @__PURE__ */ w.jsx(ys, { ...o, ref: t }) });
2880
+ }
2881
+ );
2882
+ nr.displayName = me;
2883
+ var vs = it("PopoverContent.RemoveScroll"), gs = c.forwardRef(
2884
+ (e, t) => {
2885
+ const n = oe(me, e.__scopePopover), r = c.useRef(null), o = V(t, r), i = c.useRef(!1);
2886
+ return c.useEffect(() => {
2887
+ const s = r.current;
2888
+ if (s) return un(s);
2889
+ }, []), /* @__PURE__ */ w.jsx(ut, { as: vs, allowPinchZoom: !0, children: /* @__PURE__ */ w.jsx(
2890
+ rr,
2891
+ {
2892
+ ...e,
2893
+ ref: o,
2894
+ trapFocus: n.open,
2895
+ disableOutsidePointerEvents: !0,
2896
+ onCloseAutoFocus: $(e.onCloseAutoFocus, (s) => {
2897
+ s.preventDefault(), i.current || n.triggerRef.current?.focus();
2898
+ }),
2899
+ onPointerDownOutside: $(
2900
+ e.onPointerDownOutside,
2901
+ (s) => {
2902
+ const a = s.detail.originalEvent, u = a.button === 0 && a.ctrlKey === !0, l = a.button === 2 || u;
2903
+ i.current = l;
2904
+ },
2905
+ { checkForDefaultPrevented: !1 }
2906
+ ),
2907
+ onFocusOutside: $(
2908
+ e.onFocusOutside,
2909
+ (s) => s.preventDefault(),
2910
+ { checkForDefaultPrevented: !1 }
2911
+ )
2912
+ }
2913
+ ) });
2914
+ }
2915
+ ), ys = c.forwardRef(
2916
+ (e, t) => {
2917
+ const n = oe(me, e.__scopePopover), r = c.useRef(!1), o = c.useRef(!1);
2918
+ return /* @__PURE__ */ w.jsx(
2919
+ rr,
2920
+ {
2921
+ ...e,
2922
+ ref: t,
2923
+ trapFocus: !1,
2924
+ disableOutsidePointerEvents: !1,
2925
+ onCloseAutoFocus: (i) => {
2926
+ e.onCloseAutoFocus?.(i), i.defaultPrevented || (r.current || n.triggerRef.current?.focus(), i.preventDefault()), r.current = !1, o.current = !1;
2927
+ },
2928
+ onInteractOutside: (i) => {
2929
+ e.onInteractOutside?.(i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
2930
+ const s = i.target;
2931
+ n.triggerRef.current?.contains(s) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
2932
+ }
2933
+ }
2934
+ );
2935
+ }
2936
+ ), rr = c.forwardRef(
2937
+ (e, t) => {
2938
+ const {
2939
+ __scopePopover: n,
2940
+ trapFocus: r,
2941
+ onOpenAutoFocus: o,
2942
+ onCloseAutoFocus: i,
2943
+ disableOutsidePointerEvents: s,
2944
+ onEscapeKeyDown: a,
2945
+ onPointerDownOutside: u,
2946
+ onFocusOutside: l,
2947
+ onInteractOutside: f,
2948
+ ...d
2949
+ } = e, h = oe(me, n), m = Ee(n);
2950
+ return en(), /* @__PURE__ */ w.jsx(
2951
+ ct,
2952
+ {
2953
+ asChild: !0,
2954
+ loop: !0,
2955
+ trapped: r,
2956
+ onMountAutoFocus: o,
2957
+ onUnmountAutoFocus: i,
2958
+ children: /* @__PURE__ */ w.jsx(
2959
+ at,
2960
+ {
2961
+ asChild: !0,
2962
+ disableOutsidePointerEvents: s,
2963
+ onInteractOutside: f,
2964
+ onEscapeKeyDown: a,
2965
+ onPointerDownOutside: u,
2966
+ onFocusOutside: l,
2967
+ onDismiss: () => h.onOpenChange(!1),
2968
+ children: /* @__PURE__ */ w.jsx(
2969
+ us,
2970
+ {
2971
+ "data-state": ir(h.open),
2972
+ role: "dialog",
2973
+ id: h.contentId,
2974
+ ...m,
2975
+ ...d,
2976
+ ref: t,
2977
+ style: {
2978
+ ...d.style,
2979
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
2980
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
2981
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
2982
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
2983
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
2984
+ }
2985
+ }
2986
+ )
2987
+ }
2988
+ )
2989
+ }
2990
+ );
2991
+ }
2992
+ ), or = "PopoverClose", ws = c.forwardRef(
2993
+ (e, t) => {
2994
+ const { __scopePopover: n, ...r } = e, o = oe(or, n);
2995
+ return /* @__PURE__ */ w.jsx(
2996
+ k.button,
2997
+ {
2998
+ type: "button",
2999
+ ...r,
3000
+ ref: t,
3001
+ onClick: $(e.onClick, () => o.onOpenChange(!1))
3002
+ }
3003
+ );
3004
+ }
3005
+ );
3006
+ ws.displayName = or;
3007
+ var xs = "PopoverArrow", bs = c.forwardRef(
3008
+ (e, t) => {
3009
+ const { __scopePopover: n, ...r } = e, o = Ee(n);
3010
+ return /* @__PURE__ */ w.jsx(fs, { ...o, ...r, ref: t });
3011
+ }
3012
+ );
3013
+ bs.displayName = xs;
3014
+ function ir(e) {
3015
+ return e ? "open" : "closed";
3016
+ }
3017
+ var Es = Zn, Cs = er, Ps = tr, Rs = nr;
3018
+ function Hs({ ...e }) {
3019
+ return /* @__PURE__ */ w.jsx(Es, { "data-slot": "popover", ...e });
3020
+ }
3021
+ function zs({ ...e }) {
3022
+ return /* @__PURE__ */ w.jsx(Cs, { "data-slot": "popover-trigger", ...e });
3023
+ }
3024
+ function Vs({
3025
+ className: e,
3026
+ align: t = "center",
3027
+ sideOffset: n = 4,
3028
+ ...r
3029
+ }) {
3030
+ return /* @__PURE__ */ w.jsx(Ps, { children: /* @__PURE__ */ w.jsx(
3031
+ Rs,
3032
+ {
3033
+ align: t,
3034
+ className: gr(
3035
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",
3036
+ e
3037
+ ),
3038
+ "data-slot": "popover-content",
3039
+ sideOffset: n,
3040
+ ...r
3041
+ }
3042
+ ) });
3043
+ }
3044
+ export {
3045
+ Gn as A,
3046
+ us as C,
3047
+ at as D,
3048
+ ct as F,
3049
+ Is as O,
3050
+ k as P,
3051
+ ls as R,
3052
+ js as T,
3053
+ br as V,
3054
+ $n as a,
3055
+ qt as b,
3056
+ st as c,
3057
+ $ as d,
3058
+ he as e,
3059
+ lt as f,
3060
+ fs as g,
3061
+ Ns as h,
3062
+ Hs as i,
3063
+ zs as j,
3064
+ Vs as k,
3065
+ _s as l,
3066
+ ks as m,
3067
+ $s as n,
3068
+ Ws as o,
3069
+ Fs as p,
3070
+ te as q,
3071
+ Ls as r,
3072
+ Vo as s,
3073
+ de as t,
3074
+ Ne as u,
3075
+ un as v,
3076
+ en as w,
3077
+ ut as x
3078
+ };