@component-labs/ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/HMKTUWOU-DlOdK4rt.js +25 -0
  2. package/dist/HMKTUWOU-DlOdK4rt.js.map +1 -0
  3. package/dist/HOITXJDS-DBccNHOl.js +48 -0
  4. package/dist/HOITXJDS-DBccNHOl.js.map +1 -0
  5. package/dist/I7KWAPMF-CcAk8kiH.js +86 -0
  6. package/dist/I7KWAPMF-CcAk8kiH.js.map +1 -0
  7. package/dist/IQYAUKXT-CoP_Jrsi.js +546 -0
  8. package/dist/IQYAUKXT-CoP_Jrsi.js.map +1 -0
  9. package/dist/PZ3OL7I2-h7WHitqi.js +61 -0
  10. package/dist/PZ3OL7I2-h7WHitqi.js.map +1 -0
  11. package/dist/Provider.d.ts +8 -0
  12. package/dist/Provider.d.ts.map +1 -0
  13. package/dist/Q5W46E73-DjlVG3LH.js +353 -0
  14. package/dist/Q5W46E73-DjlVG3LH.js.map +1 -0
  15. package/dist/U6HHPQDW-BkT6kvCd.js +888 -0
  16. package/dist/U6HHPQDW-BkT6kvCd.js.map +1 -0
  17. package/dist/X6LNAU2F-DroCIVyL.js +1692 -0
  18. package/dist/X6LNAU2F-DroCIVyL.js.map +1 -0
  19. package/dist/Z32PU2LQ-CPSDShGU.js +1116 -0
  20. package/dist/Z32PU2LQ-CPSDShGU.js.map +1 -0
  21. package/dist/button.d.ts +4 -0
  22. package/dist/button.d.ts.map +1 -0
  23. package/dist/button.js +252 -0
  24. package/dist/button.js.map +1 -0
  25. package/dist/checkbox.d.ts +4 -0
  26. package/dist/checkbox.d.ts.map +1 -0
  27. package/dist/checkbox.js +210 -0
  28. package/dist/checkbox.js.map +1 -0
  29. package/dist/combobox.d.ts +4 -0
  30. package/dist/combobox.d.ts.map +1 -0
  31. package/dist/combobox.js +948 -0
  32. package/dist/combobox.js.map +1 -0
  33. package/dist/components/button/Button.d.ts +26 -0
  34. package/dist/components/button/Button.d.ts.map +1 -0
  35. package/dist/components/button/Button.docs.d.ts +4 -0
  36. package/dist/components/button/Button.docs.d.ts.map +1 -0
  37. package/dist/components/button/Button.showcase.d.ts +40 -0
  38. package/dist/components/button/Button.showcase.d.ts.map +1 -0
  39. package/dist/components/checkbox/Checkbox.d.ts +19 -0
  40. package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
  41. package/dist/components/checkbox/Checkbox.docs.d.ts +4 -0
  42. package/dist/components/checkbox/Checkbox.docs.d.ts.map +1 -0
  43. package/dist/components/checkbox/Checkbox.showcase.d.ts +35 -0
  44. package/dist/components/checkbox/Checkbox.showcase.d.ts.map +1 -0
  45. package/dist/components/combobox/Combobox.d.ts +36 -0
  46. package/dist/components/combobox/Combobox.d.ts.map +1 -0
  47. package/dist/components/combobox/Combobox.docs.d.ts +4 -0
  48. package/dist/components/combobox/Combobox.docs.d.ts.map +1 -0
  49. package/dist/components/combobox/Combobox.showcase.d.ts +43 -0
  50. package/dist/components/combobox/Combobox.showcase.d.ts.map +1 -0
  51. package/dist/components/data-table/DataTable.d.ts +86 -0
  52. package/dist/components/data-table/DataTable.d.ts.map +1 -0
  53. package/dist/components/data-table/DataTable.docs.d.ts +4 -0
  54. package/dist/components/data-table/DataTable.docs.d.ts.map +1 -0
  55. package/dist/components/data-table/DataTable.showcase.d.ts +36 -0
  56. package/dist/components/data-table/DataTable.showcase.d.ts.map +1 -0
  57. package/dist/components/date-picker/date-picker.d.ts +1 -0
  58. package/dist/components/date-picker/date-picker.d.ts.map +1 -0
  59. package/dist/components/dialog/Dialog.d.ts +56 -0
  60. package/dist/components/dialog/Dialog.d.ts.map +1 -0
  61. package/dist/components/dialog/Dialog.docs.d.ts +4 -0
  62. package/dist/components/dialog/Dialog.docs.d.ts.map +1 -0
  63. package/dist/components/input/Input.d.ts +22 -0
  64. package/dist/components/input/Input.d.ts.map +1 -0
  65. package/dist/components/input/Input.docs.d.ts +4 -0
  66. package/dist/components/input/Input.docs.d.ts.map +1 -0
  67. package/dist/components/menu/Menu.d.ts +41 -0
  68. package/dist/components/menu/Menu.d.ts.map +1 -0
  69. package/dist/components/menu/Menu.docs.d.ts +4 -0
  70. package/dist/components/menu/Menu.docs.d.ts.map +1 -0
  71. package/dist/components/menu/Menu.showcase.d.ts +43 -0
  72. package/dist/components/menu/Menu.showcase.d.ts.map +1 -0
  73. package/dist/components/slider/date-picker.d.ts +1 -0
  74. package/dist/components/slider/date-picker.d.ts.map +1 -0
  75. package/dist/components/sub-menu/date-picker.d.ts +1 -0
  76. package/dist/components/sub-menu/date-picker.d.ts.map +1 -0
  77. package/dist/components/switch/Switch.d.ts +17 -0
  78. package/dist/components/switch/Switch.d.ts.map +1 -0
  79. package/dist/components/switch/Switch.docs.d.ts +4 -0
  80. package/dist/components/switch/Switch.docs.d.ts.map +1 -0
  81. package/dist/components/toast/date-picker.d.ts +1 -0
  82. package/dist/components/toast/date-picker.d.ts.map +1 -0
  83. package/dist/data-table.d.ts +4 -0
  84. package/dist/data-table.d.ts.map +1 -0
  85. package/dist/data-table.js +298 -0
  86. package/dist/data-table.js.map +1 -0
  87. package/dist/dialog.d.ts +4 -0
  88. package/dist/dialog.d.ts.map +1 -0
  89. package/dist/dialog.js +323 -0
  90. package/dist/dialog.js.map +1 -0
  91. package/dist/index.d.ts +27 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/input.d.ts +4 -0
  94. package/dist/input.d.ts.map +1 -0
  95. package/dist/input.js +230 -0
  96. package/dist/input.js.map +1 -0
  97. package/dist/lib/IntersectionObserver.d.ts +30 -0
  98. package/dist/lib/IntersectionObserver.d.ts.map +1 -0
  99. package/dist/lib/utils.d.ts +7 -0
  100. package/dist/lib/utils.d.ts.map +1 -0
  101. package/dist/menu.d.ts +4 -0
  102. package/dist/menu.d.ts.map +1 -0
  103. package/dist/menu.js +1335 -0
  104. package/dist/menu.js.map +1 -0
  105. package/dist/switch.d.ts +4 -0
  106. package/dist/switch.d.ts.map +1 -0
  107. package/dist/switch.js +194 -0
  108. package/dist/switch.js.map +1 -0
  109. package/dist/types/docs.d.ts +24 -0
  110. package/dist/types/docs.d.ts.map +1 -0
  111. package/dist/utils-BZvHF7th.js +2806 -0
  112. package/dist/utils-BZvHF7th.js.map +1 -0
  113. package/package.json +98 -0
  114. package/src/styles.css +91 -0
@@ -0,0 +1,1116 @@
1
+ import { createContext as et, useRef as V, useState as j, useMemo as ie, useContext as Nt, useEffect as N, useCallback as dt, isValidElement as Re } from "react";
2
+ import { E as ue, c as U, i as Le, l as se, h as w, w as X, m as Rt, C as Me, f as _, a as Y, F as at, j as Ve, a9 as Ut, D as P, r as Z, aa as bt, ab as Gt, ac as He, ad as Oe, ae as $e, M as Lt, G as W, O as H, d as ae, af as Ie, ag as _e, u as ke, ah as ce, ai as Be, aj as qe, n as pt, ak as je, K as We, a7 as le, a2 as Ye, k as yt, al as Xe, am as tt, R as ze, v as Ue, H as Ge, an as Ke } from "./U6HHPQDW-BkT6kvCd.js";
3
+ import { flushSync as fe, createPortal as Kt } from "react-dom";
4
+ import { jsx as p, jsxs as lt, Fragment as ft } from "react/jsx-runtime";
5
+ import { a as I, m as Je, o as Qe, t as Ze, c as tn, b as St, s as Ct, g as en, f as Dt, e as de } from "./Q5W46E73-DjlVG3LH.js";
6
+ var Mt = ue(), me = Mt.useProviderContext, nn = Mt.ContextProvider, rn = Mt.ScopedContextProvider, mt = ue(
7
+ [nn],
8
+ [rn]
9
+ ), tr = mt.useScopedContext, Vt = mt.useProviderContext, er = mt.ContextProvider, ve = mt.ScopedContextProvider, on = et(void 0), un = et(void 0), sn = "div";
10
+ function Jt(e, t) {
11
+ const n = setTimeout(t, e);
12
+ return () => clearTimeout(n);
13
+ }
14
+ function an(e) {
15
+ let t = requestAnimationFrame(() => {
16
+ t = requestAnimationFrame(e);
17
+ });
18
+ return () => cancelAnimationFrame(t);
19
+ }
20
+ function Qt(...e) {
21
+ return e.join(", ").split(", ").reduce((t, n) => {
22
+ const r = n.endsWith("ms") ? 1 : 1e3, u = Number.parseFloat(n || "0s") * r;
23
+ return u > t ? u : t;
24
+ }, 0);
25
+ }
26
+ function ge(e, t, n) {
27
+ return !n && t !== !1 && (!e || !!t);
28
+ }
29
+ var Ht = U(function({ store: t, alwaysVisible: n, ...r }) {
30
+ const u = me();
31
+ t = t || u, Le(
32
+ t,
33
+ process.env.NODE_ENV !== "production" && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
34
+ );
35
+ const i = V(null), o = se(r.id), [s, f] = j(null), m = t.useState("open"), l = t.useState("mounted"), S = t.useState("animated"), b = t.useState("contentElement"), R = I(t.disclosure, "contentElement");
36
+ w(() => {
37
+ i.current && (t == null || t.setContentElement(i.current));
38
+ }, [t]), w(() => {
39
+ let y;
40
+ return t == null || t.setState("animated", (a) => (y = a, !0)), () => {
41
+ y !== void 0 && (t == null || t.setState("animated", y));
42
+ };
43
+ }, [t]), w(() => {
44
+ if (S) {
45
+ if (!(b != null && b.isConnected)) {
46
+ f(null);
47
+ return;
48
+ }
49
+ return an(() => {
50
+ f(m ? "enter" : l ? "leave" : null);
51
+ });
52
+ }
53
+ }, [S, b, m, l]), w(() => {
54
+ if (!t || !S || !s || !b) return;
55
+ const y = () => t == null ? void 0 : t.setState("animating", !1), a = () => fe(y);
56
+ if (s === "leave" && m || s === "enter" && !m) return;
57
+ if (typeof S == "number")
58
+ return Jt(S, a);
59
+ const {
60
+ transitionDuration: v,
61
+ animationDuration: g,
62
+ transitionDelay: d,
63
+ animationDelay: B
64
+ } = getComputedStyle(b), {
65
+ transitionDuration: x = "0",
66
+ animationDuration: vt = "0",
67
+ transitionDelay: K = "0",
68
+ animationDelay: L = "0"
69
+ } = R ? getComputedStyle(R) : {}, F = Qt(
70
+ d,
71
+ B,
72
+ K,
73
+ L
74
+ ), A = Qt(
75
+ v,
76
+ g,
77
+ x,
78
+ vt
79
+ ), O = F + A;
80
+ if (!O) {
81
+ s === "enter" && t.setState("animated", !1), y();
82
+ return;
83
+ }
84
+ const gt = 1e3 / 60, rt = Math.max(O - gt, 0);
85
+ return Jt(rt, a);
86
+ }, [t, S, b, R, m, s]), r = X(
87
+ r,
88
+ (y) => /* @__PURE__ */ p(ve, { value: t, children: y }),
89
+ [t]
90
+ );
91
+ const M = ge(l, r.hidden, n), C = r.style, k = ie(() => M ? { ...C, display: "none" } : C, [M, C]);
92
+ return r = {
93
+ id: o,
94
+ "data-open": m || void 0,
95
+ "data-enter": s === "enter" || void 0,
96
+ "data-leave": s === "leave" || void 0,
97
+ hidden: M,
98
+ ...r,
99
+ ref: Rt(o ? t.setContentElement : null, i, r.ref),
100
+ style: k
101
+ }, Me(r);
102
+ }), cn = _(function(t) {
103
+ const n = Ht(t);
104
+ return Y(sn, n);
105
+ });
106
+ _(function({
107
+ unmountOnHide: t,
108
+ ...n
109
+ }) {
110
+ const r = me(), u = n.store || r;
111
+ return I(
112
+ u,
113
+ (o) => !t || (o == null ? void 0 : o.mounted)
114
+ ) === !1 ? null : /* @__PURE__ */ p(cn, { ...n });
115
+ });
116
+ function he(e = {}) {
117
+ const t = Je(
118
+ e.store,
119
+ Qe(e.disclosure, ["contentElement", "disclosureElement"])
120
+ );
121
+ Ze(e, t);
122
+ const n = t == null ? void 0 : t.getState(), r = at(
123
+ e.open,
124
+ n == null ? void 0 : n.open,
125
+ e.defaultOpen,
126
+ !1
127
+ ), u = at(e.animated, n == null ? void 0 : n.animated, !1), i = {
128
+ open: r,
129
+ animated: u,
130
+ animating: !!u && r,
131
+ mounted: r,
132
+ contentElement: at(n == null ? void 0 : n.contentElement, null),
133
+ disclosureElement: at(n == null ? void 0 : n.disclosureElement, null)
134
+ }, o = tn(i, t);
135
+ return St(
136
+ o,
137
+ () => Ct(o, ["animated", "animating"], (s) => {
138
+ s.animated || o.setState("animating", !1);
139
+ })
140
+ ), St(
141
+ o,
142
+ () => en(o, ["open"], () => {
143
+ o.getState().animated && o.setState("animating", !0);
144
+ })
145
+ ), St(
146
+ o,
147
+ () => Ct(o, ["open", "animating"], (s) => {
148
+ o.setState("mounted", s.open || s.animating);
149
+ })
150
+ ), {
151
+ ...o,
152
+ disclosure: e.disclosure,
153
+ setOpen: (s) => o.setState("open", s),
154
+ show: () => o.setState("open", !0),
155
+ hide: () => o.setState("open", !1),
156
+ toggle: () => o.setState("open", (s) => !s),
157
+ stopAnimation: () => o.setState("animating", !1),
158
+ setContentElement: (s) => o.setState("contentElement", s),
159
+ setDisclosureElement: (s) => o.setState("disclosureElement", s)
160
+ };
161
+ }
162
+ function Ee(e, t, n) {
163
+ return Ve(t, [n.store, n.disclosure]), Dt(e, n, "open", "setOpen"), Dt(e, n, "mounted", "setMounted"), Dt(e, n, "animated"), Object.assign(e, { disclosure: n.disclosure });
164
+ }
165
+ function ln(e = {}) {
166
+ const [t, n] = de(he, e);
167
+ return Ee(t, n, e);
168
+ }
169
+ var Zt = et(null), fn = "span", be = U(
170
+ function(t) {
171
+ return t = {
172
+ ...t,
173
+ style: {
174
+ border: 0,
175
+ clip: "rect(0 0 0 0)",
176
+ height: "1px",
177
+ margin: "-1px",
178
+ overflow: "hidden",
179
+ padding: 0,
180
+ position: "absolute",
181
+ whiteSpace: "nowrap",
182
+ width: "1px",
183
+ ...t.style
184
+ }
185
+ }, t;
186
+ }
187
+ );
188
+ _(function(t) {
189
+ const n = be(t);
190
+ return Y(fn, n);
191
+ });
192
+ var dn = "span", mn = U(
193
+ function(t) {
194
+ return t = {
195
+ "data-focus-trap": "",
196
+ tabIndex: 0,
197
+ "aria-hidden": !0,
198
+ ...t,
199
+ style: {
200
+ // Prevents unintended scroll jumps.
201
+ position: "fixed",
202
+ top: 0,
203
+ left: 0,
204
+ ...t.style
205
+ }
206
+ }, t = be(t), t;
207
+ }
208
+ ), ct = _(function(t) {
209
+ const n = mn(t);
210
+ return Y(dn, n);
211
+ }), vn = "div";
212
+ function gn(e) {
213
+ return P(e).body;
214
+ }
215
+ function hn(e, t) {
216
+ return t ? typeof t == "function" ? t(e) : t : P(e).createElement("div");
217
+ }
218
+ function En(e = "id") {
219
+ return `${e ? `${e}-` : ""}${Math.random().toString(36).slice(2, 8)}`;
220
+ }
221
+ function q(e) {
222
+ queueMicrotask(() => {
223
+ e == null || e.focus();
224
+ });
225
+ }
226
+ var pe = U(function({
227
+ preserveTabOrder: t,
228
+ preserveTabOrderAnchor: n,
229
+ portalElement: r,
230
+ portalRef: u,
231
+ portal: i = !0,
232
+ ...o
233
+ }) {
234
+ const s = V(null), f = Rt(s, o.ref), m = Nt(Zt), [l, S] = j(null), [b, R] = j(
235
+ null
236
+ ), M = V(null), C = V(null), k = V(null), y = V(null);
237
+ return w(() => {
238
+ const a = s.current;
239
+ if (!a || !i) {
240
+ S(null);
241
+ return;
242
+ }
243
+ const v = hn(a, r);
244
+ if (!v) {
245
+ S(null);
246
+ return;
247
+ }
248
+ const g = v.isConnected;
249
+ if (g || (m || gn(a)).appendChild(v), v.id || (v.id = a.id ? `portal/${a.id}` : En()), S(v), Ut(u, v), !g)
250
+ return () => {
251
+ v.remove(), Ut(u, null);
252
+ };
253
+ }, [i, r, m, u]), w(() => {
254
+ if (!i || !t || !n) return;
255
+ const v = P(n).createElement("span");
256
+ return v.style.position = "fixed", n.insertAdjacentElement("afterend", v), R(v), () => {
257
+ v.remove(), R(null);
258
+ };
259
+ }, [i, t, n]), N(() => {
260
+ if (!l || !t) return;
261
+ let a = 0;
262
+ const v = (g) => {
263
+ if (!Z(g)) return;
264
+ const d = g.type === "focusin";
265
+ if (cancelAnimationFrame(a), d)
266
+ return He(l);
267
+ a = requestAnimationFrame(() => {
268
+ Oe(l, !0);
269
+ });
270
+ };
271
+ return l.addEventListener("focusin", v, !0), l.addEventListener("focusout", v, !0), () => {
272
+ cancelAnimationFrame(a), l.removeEventListener("focusin", v, !0), l.removeEventListener("focusout", v, !0);
273
+ };
274
+ }, [l, t]), o = X(
275
+ o,
276
+ (a) => {
277
+ if (a = // While the portal node is not in the DOM, we need to pass the
278
+ // current context to the portal context, otherwise it's going to
279
+ // reset to the body element on nested portals.
280
+ /* @__PURE__ */ p(Zt.Provider, { value: l || m, children: a }), !i) return a;
281
+ if (!l)
282
+ return /* @__PURE__ */ p(
283
+ "span",
284
+ {
285
+ ref: f,
286
+ id: o.id,
287
+ style: { position: "fixed" },
288
+ hidden: !0
289
+ }
290
+ );
291
+ a = /* @__PURE__ */ lt(ft, { children: [
292
+ t && l && /* @__PURE__ */ p(
293
+ ct,
294
+ {
295
+ ref: C,
296
+ "data-focus-trap": o.id,
297
+ className: "__focus-trap-inner-before",
298
+ onFocus: (g) => {
299
+ Z(g, l) ? q(bt()) : q(M.current);
300
+ }
301
+ }
302
+ ),
303
+ a,
304
+ t && l && /* @__PURE__ */ p(
305
+ ct,
306
+ {
307
+ ref: k,
308
+ "data-focus-trap": o.id,
309
+ className: "__focus-trap-inner-after",
310
+ onFocus: (g) => {
311
+ Z(g, l) ? q(Gt()) : q(y.current);
312
+ }
313
+ }
314
+ )
315
+ ] }), l && (a = Kt(a, l));
316
+ let v = /* @__PURE__ */ lt(ft, { children: [
317
+ t && l && /* @__PURE__ */ p(
318
+ ct,
319
+ {
320
+ ref: M,
321
+ "data-focus-trap": o.id,
322
+ className: "__focus-trap-outer-before",
323
+ onFocus: (g) => {
324
+ !(g.relatedTarget === y.current) && Z(g, l) ? q(C.current) : q(Gt());
325
+ }
326
+ }
327
+ ),
328
+ t && // We're using position: fixed here so that the browser doesn't
329
+ // add margin to the element when setting gap on a parent element.
330
+ /* @__PURE__ */ p("span", { "aria-owns": l == null ? void 0 : l.id, style: { position: "fixed" } }),
331
+ t && l && /* @__PURE__ */ p(
332
+ ct,
333
+ {
334
+ ref: y,
335
+ "data-focus-trap": o.id,
336
+ className: "__focus-trap-outer-after",
337
+ onFocus: (g) => {
338
+ if (Z(g, l))
339
+ q(k.current);
340
+ else {
341
+ const d = bt();
342
+ if (d === C.current) {
343
+ requestAnimationFrame(() => {
344
+ var B;
345
+ return (B = bt()) == null ? void 0 : B.focus();
346
+ });
347
+ return;
348
+ }
349
+ q(d);
350
+ }
351
+ }
352
+ }
353
+ )
354
+ ] });
355
+ return b && t && (v = Kt(
356
+ v,
357
+ b
358
+ )), /* @__PURE__ */ lt(ft, { children: [
359
+ v,
360
+ a
361
+ ] });
362
+ },
363
+ [l, m, i, o.id, t, b]
364
+ ), o = {
365
+ ...o,
366
+ ref: f
367
+ }, o;
368
+ });
369
+ _(function(t) {
370
+ const n = pe(t);
371
+ return Y(vn, n);
372
+ });
373
+ var te = et(0);
374
+ function bn({ level: e, children: t }) {
375
+ const n = Nt(te), r = Math.max(
376
+ Math.min(e || n + 1, 6),
377
+ 1
378
+ );
379
+ return /* @__PURE__ */ p(te.Provider, { value: r, children: t });
380
+ }
381
+ var pn = "div", ye = U(function({ autoFocusOnShow: t = !0, ...n }) {
382
+ return n = X(
383
+ n,
384
+ (r) => /* @__PURE__ */ p($e.Provider, { value: t, children: r }),
385
+ [t]
386
+ ), n;
387
+ });
388
+ _(function(t) {
389
+ const n = ye(t);
390
+ return Y(pn, n);
391
+ });
392
+ function yn(e, t) {
393
+ const r = P(e).createElement("button");
394
+ return r.type = "button", r.tabIndex = -1, r.textContent = "Dismiss popup", Object.assign(r.style, {
395
+ border: "0px",
396
+ clip: "rect(0 0 0 0)",
397
+ height: "1px",
398
+ margin: "-1px",
399
+ overflow: "hidden",
400
+ padding: "0px",
401
+ position: "absolute",
402
+ whiteSpace: "nowrap",
403
+ width: "1px"
404
+ }), r.addEventListener("click", t), e.prepend(r), () => {
405
+ r.removeEventListener("click", t), r.remove();
406
+ };
407
+ }
408
+ function Sn(e) {
409
+ const t = V(null);
410
+ return N(() => {
411
+ if (!e) {
412
+ t.current = null;
413
+ return;
414
+ }
415
+ return Lt("mousedown", (r) => {
416
+ t.current = r.target;
417
+ }, !0);
418
+ }, [e]), t;
419
+ }
420
+ var xt = /* @__PURE__ */ new WeakMap();
421
+ function nt(e, t, n) {
422
+ xt.has(e) || xt.set(e, /* @__PURE__ */ new Map());
423
+ const r = xt.get(e), u = r.get(t);
424
+ if (!u)
425
+ return r.set(t, n()), () => {
426
+ var s;
427
+ (s = r.get(t)) == null || s(), r.delete(t);
428
+ };
429
+ const i = n(), o = () => {
430
+ i(), u(), r.delete(t);
431
+ };
432
+ return r.set(t, o), () => {
433
+ r.get(t) === o && (i(), r.set(t, u));
434
+ };
435
+ }
436
+ function Ot(e, t, n) {
437
+ return nt(e, t, () => {
438
+ const u = e.getAttribute(t);
439
+ return e.setAttribute(t, n), () => {
440
+ u == null ? e.removeAttribute(t) : e.setAttribute(t, u);
441
+ };
442
+ });
443
+ }
444
+ function z(e, t, n) {
445
+ return nt(e, t, () => {
446
+ const u = t in e, i = e[t];
447
+ return e[t] = n, () => {
448
+ u ? e[t] = i : delete e[t];
449
+ };
450
+ });
451
+ }
452
+ function Ft(e, t) {
453
+ return e ? nt(e, "style", () => {
454
+ const r = e.style.cssText;
455
+ return Object.assign(e.style, t), () => {
456
+ e.style.cssText = r;
457
+ };
458
+ }) : () => {
459
+ };
460
+ }
461
+ function Dn(e, t, n) {
462
+ return e ? nt(e, t, () => {
463
+ const u = e.style.getPropertyValue(t);
464
+ return e.style.setProperty(t, n), () => {
465
+ u ? e.style.setProperty(t, u) : e.style.removeProperty(t);
466
+ };
467
+ }) : () => {
468
+ };
469
+ }
470
+ var xn = ["SCRIPT", "STYLE"];
471
+ function At(e) {
472
+ return `__ariakit-dialog-snapshot-${e}`;
473
+ }
474
+ function Pn(e, t) {
475
+ const n = P(t), r = At(e);
476
+ if (!n.body[r]) return !0;
477
+ do {
478
+ if (t === n.body) return !1;
479
+ if (t[r]) return !0;
480
+ if (!t.parentElement) return !1;
481
+ t = t.parentElement;
482
+ } while (!0);
483
+ }
484
+ function wn(e, t, n) {
485
+ return xn.includes(t.tagName) || !Pn(e, t) ? !1 : !n.some(
486
+ (r) => r && H(t, r)
487
+ );
488
+ }
489
+ function $t(e, t, n, r) {
490
+ for (let u of t) {
491
+ if (!(u != null && u.isConnected)) continue;
492
+ const i = t.some((f) => !f || f === u ? !1 : f.contains(u)), o = P(u), s = u;
493
+ for (; u.parentElement && u !== o.body; ) {
494
+ if (r == null || r(u.parentElement, s), !i)
495
+ for (const f of u.parentElement.children)
496
+ wn(e, f, t) && n(f, s);
497
+ u = u.parentElement;
498
+ }
499
+ }
500
+ }
501
+ function Cn(e, t) {
502
+ const { body: n } = P(t[0]), r = [];
503
+ return $t(e, t, (i) => {
504
+ r.push(z(i, At(e), !0));
505
+ }), W(z(n, At(e), !0), () => {
506
+ for (const i of r)
507
+ i();
508
+ });
509
+ }
510
+ function Se(e, ...t) {
511
+ if (!e) return !1;
512
+ const n = e.getAttribute("data-backdrop");
513
+ return n == null ? !1 : n === "" || n === "true" || !t.length ? !0 : t.some((r) => n === r);
514
+ }
515
+ function G(e = "", t = !1) {
516
+ return `__ariakit-dialog-${t ? "ancestor" : "outside"}${e ? `-${e}` : ""}`;
517
+ }
518
+ function Fn(e, t = "") {
519
+ return W(
520
+ z(e, G(), !0),
521
+ z(e, G(t), !0)
522
+ );
523
+ }
524
+ function De(e, t = "") {
525
+ return W(
526
+ z(e, G("", !0), !0),
527
+ z(e, G(t, !0), !0)
528
+ );
529
+ }
530
+ function It(e, t) {
531
+ const n = G(t, !0);
532
+ if (e[n]) return !0;
533
+ const r = G(t);
534
+ do {
535
+ if (e[r]) return !0;
536
+ if (!e.parentElement) return !1;
537
+ e = e.parentElement;
538
+ } while (!0);
539
+ }
540
+ function ee(e, t) {
541
+ const n = [], r = t.map((i) => i == null ? void 0 : i.id);
542
+ return $t(
543
+ e,
544
+ t,
545
+ (i) => {
546
+ Se(i, ...r) || n.unshift(Fn(i, e));
547
+ },
548
+ (i, o) => {
549
+ o.hasAttribute("data-dialog") && o.id !== e || n.unshift(De(i, e));
550
+ }
551
+ ), () => {
552
+ for (const i of n)
553
+ i();
554
+ };
555
+ }
556
+ function An(e) {
557
+ return e.tagName === "HTML" ? !0 : H(P(e).body, e);
558
+ }
559
+ function Tn(e, t) {
560
+ if (!e) return !1;
561
+ if (H(e, t)) return !0;
562
+ const n = t.getAttribute("aria-activedescendant");
563
+ if (n) {
564
+ const r = P(e).getElementById(n);
565
+ if (r)
566
+ return H(e, r);
567
+ }
568
+ return !1;
569
+ }
570
+ function Nn(e, t) {
571
+ if (!("clientY" in e)) return !1;
572
+ const n = t.getBoundingClientRect();
573
+ return n.width === 0 || n.height === 0 ? !1 : n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
574
+ }
575
+ function Pt({
576
+ store: e,
577
+ type: t,
578
+ listener: n,
579
+ capture: r,
580
+ domReady: u
581
+ }) {
582
+ const i = ae(n), o = I(e, "open"), s = V(!1);
583
+ w(() => {
584
+ if (!o || !u) return;
585
+ const { contentElement: f } = e.getState();
586
+ if (!f) return;
587
+ const m = () => {
588
+ s.current = !0;
589
+ };
590
+ return f.addEventListener("focusin", m, !0), () => f.removeEventListener("focusin", m, !0);
591
+ }, [e, o, u]), N(() => o ? Lt(t, (m) => {
592
+ const { contentElement: l, disclosureElement: S } = e.getState(), b = m.target;
593
+ !l || !b || !An(b) || H(l, b) || Tn(S, b) || b.hasAttribute("data-focus-trap") || Nn(m, l) || s.current && !It(b, l.id) || Ie(b) || i(m);
594
+ }, r) : void 0, [o, r]);
595
+ }
596
+ function wt(e, t) {
597
+ return typeof e == "function" ? e(t) : !!e;
598
+ }
599
+ function Rn(e, t, n) {
600
+ const r = I(e, "open"), u = Sn(r), i = { store: e, domReady: n, capture: !0 };
601
+ Pt({
602
+ ...i,
603
+ type: "click",
604
+ listener: (o) => {
605
+ const { contentElement: s } = e.getState(), f = u.current;
606
+ f && _e(f) && It(f, s == null ? void 0 : s.id) && wt(t, o) && e.hide();
607
+ }
608
+ }), Pt({
609
+ ...i,
610
+ type: "focusin",
611
+ listener: (o) => {
612
+ const { contentElement: s } = e.getState();
613
+ s && o.target !== P(s) && wt(t, o) && e.hide();
614
+ }
615
+ }), Pt({
616
+ ...i,
617
+ type: "contextmenu",
618
+ listener: (o) => {
619
+ wt(t, o) && e.hide();
620
+ }
621
+ });
622
+ }
623
+ var ne = et({});
624
+ function Ln(e) {
625
+ const t = Nt(ne), [n, r] = j([]), u = dt(
626
+ (s) => {
627
+ var f;
628
+ return r((m) => [...m, s]), W((f = t.add) == null ? void 0 : f.call(t, s), () => {
629
+ r((m) => m.filter((l) => l !== s));
630
+ });
631
+ },
632
+ [t]
633
+ );
634
+ w(() => Ct(e, ["open", "contentElement"], (s) => {
635
+ var f;
636
+ if (s.open && s.contentElement)
637
+ return (f = t.add) == null ? void 0 : f.call(t, e);
638
+ }), [e, t]);
639
+ const i = ie(() => ({ store: e, add: u }), [e, u]);
640
+ return { wrapElement: dt(
641
+ (s) => /* @__PURE__ */ p(ne.Provider, { value: i, children: s }),
642
+ [i]
643
+ ), nestedDialogs: n };
644
+ }
645
+ function Mn({
646
+ attribute: e,
647
+ contentId: t,
648
+ contentElement: n,
649
+ enabled: r
650
+ }) {
651
+ const [u, i] = ke(), o = dt(() => {
652
+ if (!r || !n) return !1;
653
+ const { body: s } = P(n), f = s.getAttribute(e);
654
+ return !f || f === t;
655
+ }, [u, r, n, e, t]);
656
+ return N(() => {
657
+ if (!r || !t || !n) return;
658
+ const { body: s } = P(n);
659
+ if (o())
660
+ return s.setAttribute(e, t), () => s.removeAttribute(e);
661
+ const f = new MutationObserver(() => fe(i));
662
+ return f.observe(s, { attributeFilter: [e] }), () => f.disconnect();
663
+ }, [u, r, t, n, o, e]), o;
664
+ }
665
+ function Vn(e) {
666
+ const t = e.getBoundingClientRect().left;
667
+ return Math.round(t) + e.scrollLeft ? "paddingLeft" : "paddingRight";
668
+ }
669
+ function Hn(e, t, n) {
670
+ const r = Mn({
671
+ attribute: "data-dialog-prevent-body-scroll",
672
+ contentElement: e,
673
+ contentId: t,
674
+ enabled: n
675
+ });
676
+ N(() => {
677
+ if (!r() || !e) return;
678
+ const u = P(e), i = ce(e), { documentElement: o, body: s } = u, f = o.style.getPropertyValue("--scrollbar-width"), m = f ? Number.parseInt(f, 10) : i.innerWidth - o.clientWidth, l = () => Dn(
679
+ o,
680
+ "--scrollbar-width",
681
+ `${m}px`
682
+ ), S = Vn(o), b = () => Ft(s, {
683
+ overflow: "hidden",
684
+ [S]: `${m}px`
685
+ }), R = () => {
686
+ var C, k;
687
+ const { scrollX: y, scrollY: a, visualViewport: v } = i, g = (C = v == null ? void 0 : v.offsetLeft) != null ? C : 0, d = (k = v == null ? void 0 : v.offsetTop) != null ? k : 0, B = Ft(s, {
688
+ position: "fixed",
689
+ overflow: "hidden",
690
+ top: `${-(a - Math.floor(d))}px`,
691
+ left: `${-(y - Math.floor(g))}px`,
692
+ right: "0",
693
+ [S]: `${m}px`
694
+ });
695
+ return () => {
696
+ B(), process.env.NODE_ENV !== "test" && i.scrollTo({ left: y, top: a, behavior: "instant" });
697
+ };
698
+ }, M = Be() && !qe();
699
+ return W(
700
+ l(),
701
+ M ? R() : b()
702
+ );
703
+ }, [r, e]);
704
+ }
705
+ function On(e, ...t) {
706
+ if (!e) return !1;
707
+ const n = e.getAttribute("data-focus-trap");
708
+ return n == null ? !1 : t.length ? n === "" ? !1 : t.some((r) => n === r) : !0;
709
+ }
710
+ function xe() {
711
+ return "inert" in HTMLElement.prototype;
712
+ }
713
+ function $n(e) {
714
+ return Ot(e, "aria-hidden", "true");
715
+ }
716
+ function Pe(e, t) {
717
+ if (!("style" in e)) return pt;
718
+ if (xe())
719
+ return z(e, "inert", !0);
720
+ const r = je(e, !0).map((u) => {
721
+ if (t != null && t.some((o) => o && H(o, u))) return pt;
722
+ const i = nt(u, "focus", () => (u.focus = pt, () => {
723
+ delete u.focus;
724
+ }));
725
+ return W(Ot(u, "tabindex", "-1"), i);
726
+ });
727
+ return W(
728
+ ...r,
729
+ $n(e),
730
+ Ft(e, {
731
+ pointerEvents: "none",
732
+ userSelect: "none",
733
+ cursor: "default"
734
+ })
735
+ );
736
+ }
737
+ function In(e, t) {
738
+ const n = [], r = t.map((i) => i == null ? void 0 : i.id);
739
+ return $t(
740
+ e,
741
+ t,
742
+ (i) => {
743
+ Se(i, ...r) || On(i, ...r) || n.unshift(Pe(i, t));
744
+ },
745
+ (i) => {
746
+ i.hasAttribute("role") && (t.some((o) => o && H(o, i)) || n.unshift(Ot(i, "role", "none")));
747
+ }
748
+ ), () => {
749
+ for (const i of n)
750
+ i();
751
+ };
752
+ }
753
+ var _n = "div", kn = [
754
+ "a",
755
+ "button",
756
+ "details",
757
+ "dialog",
758
+ "div",
759
+ "form",
760
+ "h1",
761
+ "h2",
762
+ "h3",
763
+ "h4",
764
+ "h5",
765
+ "h6",
766
+ "header",
767
+ "img",
768
+ "input",
769
+ "label",
770
+ "li",
771
+ "nav",
772
+ "ol",
773
+ "p",
774
+ "section",
775
+ "select",
776
+ "span",
777
+ "summary",
778
+ "textarea",
779
+ "ul",
780
+ "svg"
781
+ ];
782
+ U(
783
+ function(t) {
784
+ return t;
785
+ }
786
+ );
787
+ var Tt = _(
788
+ // @ts-expect-error
789
+ function(t) {
790
+ return Y(_n, t);
791
+ }
792
+ );
793
+ Object.assign(
794
+ Tt,
795
+ kn.reduce((e, t) => (e[t] = _(function(r) {
796
+ return Y(t, r);
797
+ }), e), {})
798
+ );
799
+ function Bn({
800
+ store: e,
801
+ backdrop: t,
802
+ alwaysVisible: n,
803
+ hidden: r
804
+ }) {
805
+ const u = V(null), i = ln({ disclosure: e }), o = I(e, "contentElement");
806
+ N(() => {
807
+ const m = u.current, l = o;
808
+ m && l && (m.style.zIndex = getComputedStyle(l).zIndex);
809
+ }, [o]), w(() => {
810
+ const m = o == null ? void 0 : o.id;
811
+ if (!m) return;
812
+ const l = u.current;
813
+ if (l)
814
+ return De(l, m);
815
+ }, [o]);
816
+ const s = Ht({
817
+ ref: u,
818
+ store: i,
819
+ role: "presentation",
820
+ "data-backdrop": (o == null ? void 0 : o.id) || "",
821
+ alwaysVisible: n,
822
+ hidden: r ?? void 0,
823
+ style: {
824
+ position: "fixed",
825
+ top: 0,
826
+ right: 0,
827
+ bottom: 0,
828
+ left: 0
829
+ }
830
+ });
831
+ return t ? Re(t) ? /* @__PURE__ */ p(Tt, { ...s, render: t }) : /* @__PURE__ */ p(Tt, { ...s, render: /* @__PURE__ */ p(typeof t != "boolean" ? t : "div", {}) }) : null;
832
+ }
833
+ function qn(e = {}) {
834
+ return he(e);
835
+ }
836
+ function jn(e, t, n) {
837
+ return Ee(e, t, n);
838
+ }
839
+ function Wn(e = {}) {
840
+ const [t, n] = de(qn, e);
841
+ return jn(t, n, e);
842
+ }
843
+ var Yn = "div", re = Ge();
844
+ function Xn(e) {
845
+ const t = le();
846
+ return !t || e && H(e, t) ? !1 : !!tt(t);
847
+ }
848
+ function oe(e, t = !1) {
849
+ if (!e) return null;
850
+ const n = "current" in e ? e.current : e;
851
+ return n ? t ? tt(n) ? n : null : n : null;
852
+ }
853
+ var zn = U(function({
854
+ store: t,
855
+ open: n,
856
+ onClose: r,
857
+ focusable: u = !0,
858
+ modal: i = !0,
859
+ portal: o = !!i,
860
+ backdrop: s = !!i,
861
+ hideOnEscape: f = !0,
862
+ hideOnInteractOutside: m = !0,
863
+ getPersistentElements: l,
864
+ preventBodyScroll: S = !!i,
865
+ autoFocusOnShow: b = !0,
866
+ autoFocusOnHide: R = !0,
867
+ initialFocus: M,
868
+ finalFocus: C,
869
+ unmountOnHide: k,
870
+ unstable_treeSnapshotKey: y,
871
+ ...a
872
+ }) {
873
+ const v = Vt(), g = V(null), d = Wn({
874
+ store: t || v,
875
+ open: n,
876
+ setOpen(c) {
877
+ if (c) return;
878
+ const E = g.current;
879
+ if (!E) return;
880
+ const D = new Event("close", { bubbles: !1, cancelable: !0 });
881
+ r && E.addEventListener("close", r, { once: !0 }), E.dispatchEvent(D), D.defaultPrevented && d.setOpen(!0);
882
+ }
883
+ }), { portalRef: B, domReady: x } = We(o, a.portalRef), vt = a.preserveTabOrder, K = I(
884
+ d,
885
+ (c) => vt && !i && c.mounted
886
+ ), L = se(a.id), F = I(d, "open"), A = I(d, "mounted"), O = I(d, "contentElement"), gt = ge(A, a.hidden, a.alwaysVisible);
887
+ Hn(O, L, S && !gt), Rn(d, m, x);
888
+ const { wrapElement: rt, nestedDialogs: ht } = Ln(d);
889
+ a = X(a, rt, [rt]), w(() => {
890
+ if (!F) return;
891
+ const c = g.current, E = le(c, !0);
892
+ E && E.tagName !== "BODY" && (c && H(c, E) || d.setDisclosureElement(E));
893
+ }, [d, F]), re && N(() => {
894
+ if (!A) return;
895
+ const { disclosureElement: c } = d.getState();
896
+ if (!c || !Ye(c)) return;
897
+ const E = () => {
898
+ let D = !1;
899
+ const h = () => {
900
+ D = !0;
901
+ }, T = { capture: !0, once: !0 };
902
+ c.addEventListener("focusin", h, T), Ue(c, "mouseup", () => {
903
+ c.removeEventListener("focusin", h, !0), !D && Ke(c);
904
+ });
905
+ };
906
+ return c.addEventListener("mousedown", E), () => {
907
+ c.removeEventListener("mousedown", E);
908
+ };
909
+ }, [d, A]), N(() => {
910
+ if (!A || !x) return;
911
+ const c = g.current;
912
+ if (!c) return;
913
+ const E = ce(c), D = E.visualViewport || E, h = () => {
914
+ var T, $;
915
+ const Q = ($ = (T = E.visualViewport) == null ? void 0 : T.height) != null ? $ : E.innerHeight;
916
+ c.style.setProperty("--dialog-viewport-height", `${Q}px`);
917
+ };
918
+ return h(), D.addEventListener("resize", h), () => {
919
+ D.removeEventListener("resize", h);
920
+ };
921
+ }, [A, x]), N(() => {
922
+ if (!i || !A || !x) return;
923
+ const c = g.current;
924
+ if (!(!c || c.querySelector("[data-dialog-dismiss]")))
925
+ return yn(c, d.hide);
926
+ }, [d, i, A, x]), w(() => {
927
+ if (!xe() || F || !A || !x) return;
928
+ const c = g.current;
929
+ if (c)
930
+ return Pe(c);
931
+ }, [F, A, x]);
932
+ const ot = F && x;
933
+ w(() => {
934
+ if (!L || !ot) return;
935
+ const c = g.current;
936
+ return Cn(L, [c]);
937
+ }, [L, ot, y]);
938
+ const _t = ae(l);
939
+ w(() => {
940
+ if (!L || !ot) return;
941
+ const { disclosureElement: c } = d.getState(), E = g.current, D = _t() || [], h = [
942
+ E,
943
+ ...D,
944
+ ...ht.map((T) => T.getState().contentElement)
945
+ ];
946
+ return i ? W(
947
+ ee(L, h),
948
+ In(L, h)
949
+ ) : ee(L, [c, ...h]);
950
+ }, [
951
+ L,
952
+ d,
953
+ ot,
954
+ _t,
955
+ ht,
956
+ i,
957
+ y
958
+ ]);
959
+ const kt = !!b, Bt = yt(b), [we, Ce] = j(!1);
960
+ N(() => {
961
+ if (!F || !kt || !x || !(O != null && O.isConnected)) return;
962
+ const c = oe(M, !0) || // If no initial focus is specified, we try to focus the first element
963
+ // with the autofocus attribute. If it's an Ariakit component, the
964
+ // Focusable component will consume the autoFocus prop and add the
965
+ // data-autofocus attribute to the element instead.
966
+ O.querySelector(
967
+ "[data-autofocus=true],[autofocus]"
968
+ ) || // We have to fallback to the first focusable element otherwise portaled
969
+ // dialogs with preserveTabOrder set to true will not receive focus
970
+ // properly because the elements aren't tabbable until the dialog receives
971
+ // focus.
972
+ Xe(O, !0, o && K) || // Finally, we fallback to the dialog element itself.
973
+ O, E = tt(c);
974
+ Bt(E ? c : null) && (Ce(!0), queueMicrotask(() => {
975
+ c.focus(), re && E && c.scrollIntoView({ block: "nearest", inline: "nearest" });
976
+ }));
977
+ }, [
978
+ F,
979
+ kt,
980
+ x,
981
+ O,
982
+ M,
983
+ o,
984
+ K,
985
+ Bt
986
+ ]);
987
+ const it = !!R, qt = yt(R), [ut, jt] = j(!1);
988
+ N(() => {
989
+ if (F)
990
+ return jt(!0), () => jt(!1);
991
+ }, [F]);
992
+ const J = dt(
993
+ (c, E = !0) => {
994
+ const { disclosureElement: D } = d.getState();
995
+ if (Xn(c)) return;
996
+ let h = oe(C) || D;
997
+ if (h != null && h.id) {
998
+ const $ = P(h), Q = `[aria-activedescendant="${h.id}"]`, st = $.querySelector(Q);
999
+ st && (h = st);
1000
+ }
1001
+ if (h && !tt(h)) {
1002
+ const $ = h.closest("[data-dialog]");
1003
+ if ($ != null && $.id) {
1004
+ const Q = P($), st = `[aria-controls~="${$.id}"]`, zt = Q.querySelector(st);
1005
+ zt && (h = zt);
1006
+ }
1007
+ }
1008
+ const T = h && tt(h);
1009
+ if (!T && E) {
1010
+ requestAnimationFrame(() => J(c, !1));
1011
+ return;
1012
+ }
1013
+ qt(T ? h : null) && T && (h == null || h.focus({ preventScroll: !0 }));
1014
+ },
1015
+ [d, C, qt]
1016
+ ), Et = V(!1);
1017
+ w(() => {
1018
+ if (F || !ut || !it) return;
1019
+ const c = g.current;
1020
+ Et.current = !0, J(c);
1021
+ }, [F, ut, x, it, J]), N(() => {
1022
+ if (!ut || !it) return;
1023
+ const c = g.current;
1024
+ return () => {
1025
+ if (Et.current) {
1026
+ Et.current = !1;
1027
+ return;
1028
+ }
1029
+ J(c);
1030
+ };
1031
+ }, [ut, it, J]);
1032
+ const Wt = yt(f);
1033
+ N(() => !x || !A ? void 0 : Lt("keydown", (E) => {
1034
+ if (E.key !== "Escape" || E.defaultPrevented) return;
1035
+ const D = g.current;
1036
+ if (!D || It(D)) return;
1037
+ const h = E.target;
1038
+ if (!h) return;
1039
+ const { disclosureElement: T } = d.getState();
1040
+ !!(h.tagName === "BODY" || H(D, h) || !T || H(T, h)) && Wt(E) && d.hide();
1041
+ }, !0), [d, x, A, Wt]), a = X(
1042
+ a,
1043
+ (c) => /* @__PURE__ */ p(bn, { level: i ? 1 : void 0, children: c }),
1044
+ [i]
1045
+ );
1046
+ const Yt = a.hidden, Xt = a.alwaysVisible;
1047
+ a = X(
1048
+ a,
1049
+ (c) => s ? /* @__PURE__ */ lt(ft, { children: [
1050
+ /* @__PURE__ */ p(
1051
+ Bn,
1052
+ {
1053
+ store: d,
1054
+ backdrop: s,
1055
+ hidden: Yt,
1056
+ alwaysVisible: Xt
1057
+ }
1058
+ ),
1059
+ c
1060
+ ] }) : c,
1061
+ [d, s, Yt, Xt]
1062
+ );
1063
+ const [Fe, Ae] = j(), [Te, Ne] = j();
1064
+ return a = X(
1065
+ a,
1066
+ (c) => /* @__PURE__ */ p(ve, { value: d, children: /* @__PURE__ */ p(on.Provider, { value: Ae, children: /* @__PURE__ */ p(un.Provider, { value: Ne, children: c }) }) }),
1067
+ [d]
1068
+ ), a = {
1069
+ id: L,
1070
+ "data-dialog": "",
1071
+ role: "dialog",
1072
+ tabIndex: u ? -1 : void 0,
1073
+ "aria-labelledby": Fe,
1074
+ "aria-describedby": Te,
1075
+ ...a,
1076
+ ref: Rt(g, a.ref)
1077
+ }, a = ye({
1078
+ ...a,
1079
+ autoFocusOnShow: we
1080
+ }), a = Ht({ store: d, ...a }), a = ze({ ...a, focusable: u }), a = pe({ portal: o, ...a, portalRef: B, preserveTabOrder: K }), a;
1081
+ });
1082
+ function Un(e, t = Vt) {
1083
+ return _(function(r) {
1084
+ const u = t(), i = r.store || u;
1085
+ return I(
1086
+ i,
1087
+ (s) => !r.unmountOnHide || (s == null ? void 0 : s.mounted) || !!r.open
1088
+ ) ? /* @__PURE__ */ p(e, { ...r }) : null;
1089
+ });
1090
+ }
1091
+ var nr = Un(
1092
+ _(function(t) {
1093
+ const n = zn(t);
1094
+ return Y(Yn, n);
1095
+ }),
1096
+ Vt
1097
+ );
1098
+ export {
1099
+ un as D,
1100
+ te as H,
1101
+ Tt as R,
1102
+ on as a,
1103
+ nr as b,
1104
+ Un as c,
1105
+ Wn as d,
1106
+ me as e,
1107
+ Vt as f,
1108
+ ve as g,
1109
+ er as h,
1110
+ ge as i,
1111
+ zn as j,
1112
+ qn as k,
1113
+ jn as l,
1114
+ tr as u
1115
+ };
1116
+ //# sourceMappingURL=Z32PU2LQ-CPSDShGU.js.map