@robuust-digital/vue-components 1.1.0-rc.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,160 @@
1
- import * as _e from "vue";
2
- import { openBlock as U, createBlock as ee, resolveDynamicComponent as ke, normalizeClass as ue, withCtx as W, renderSlot as te, createTextVNode as Ve, toDisplayString as qe, createElementBlock as ze, createElementVNode as L, mergeProps as xt, createCommentVNode as Se, unref as I, watchEffect as C, ref as h, computed as m, cloneVNode as At, h as S, Fragment as ot, defineComponent as T, inject as D, provide as j, onMounted as $, onUnmounted as k, watch as ne, shallowRef as Dt, getCurrentInstance as Ct, Teleport as kt, reactive as Bt, nextTick as Nt, createVNode as G, withModifiers as jt } from "vue";
3
- const it = (e) => typeof e != "string" ? !1 : /^(primary|secondary|tertiary|light|dark|danger|warning|success)(-soft)?$/.test(e) || e.startsWith("custom-") || e === "clear", Xn = {
1
+ import * as Kt from "vue";
2
+ import { openBlock as E, createElementBlock as k, createElementVNode as x, Fragment as Le, renderList as nt, renderSlot as C, createTextVNode as he, toDisplayString as re, createVNode as M, unref as S, normalizeClass as q, createBlock as oe, resolveDynamicComponent as Ie, withCtx as H, createCommentVNode as _, watchEffect as te, mergeProps as qe, computed as b, withDirectives as Yn, vModelCheckbox as Kn, ref as $, onMounted as V, cloneVNode as Gn, h as N, defineComponent as I, inject as Y, provide as ie, onUnmounted as ae, watch as de, shallowRef as Ve, getCurrentInstance as Xn, Teleport as Zn, reactive as Qn, nextTick as Jn, withModifiers as un, getCurrentScope as _n, onScopeDispose as el, shallowReadonly as Pe, normalizeStyle as tl } from "vue";
3
+ function nl(e, t) {
4
+ return E(), k("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ viewBox: "0 0 24 24",
7
+ fill: "currentColor",
8
+ "aria-hidden": "true",
9
+ "data-slot": "icon"
10
+ }, [
11
+ x("path", {
12
+ "fill-rule": "evenodd",
13
+ d: "M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",
14
+ "clip-rule": "evenodd"
15
+ })
16
+ ]);
17
+ }
18
+ function ll(e, t) {
19
+ return E(), k("svg", {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ viewBox: "0 0 24 24",
22
+ fill: "currentColor",
23
+ "aria-hidden": "true",
24
+ "data-slot": "icon"
25
+ }, [
26
+ x("path", {
27
+ "fill-rule": "evenodd",
28
+ d: "M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",
29
+ "clip-rule": "evenodd"
30
+ })
31
+ ]);
32
+ }
33
+ function At(e, t) {
34
+ return E(), k("svg", {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 24 24",
37
+ fill: "currentColor",
38
+ "aria-hidden": "true",
39
+ "data-slot": "icon"
40
+ }, [
41
+ x("path", {
42
+ "fill-rule": "evenodd",
43
+ d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
44
+ "clip-rule": "evenodd"
45
+ })
46
+ ]);
47
+ }
48
+ const rl = { class: "rvc-accordion" }, ol = ["open", "name"], il = ["innerHTML"], Ro = {
49
+ __name: "Accordion",
50
+ props: {
51
+ items: {
52
+ type: Array,
53
+ required: !0,
54
+ default: () => []
55
+ },
56
+ name: {
57
+ type: String,
58
+ default: void 0
59
+ },
60
+ defaultOpenIndex: {
61
+ type: Number,
62
+ default: 0
63
+ },
64
+ contentClass: {
65
+ type: String,
66
+ default: ""
67
+ }
68
+ },
69
+ setup(e) {
70
+ return (t, n) => (E(), k("div", rl, [
71
+ (E(!0), k(Le, null, nt(e.items, (l, r) => (E(), k("details", {
72
+ key: r,
73
+ open: e.defaultOpenIndex === r,
74
+ name: e.name,
75
+ class: "rvc-group/accordion group/accordion"
76
+ }, [
77
+ x("summary", null, [
78
+ C(t.$slots, "summary", {
79
+ item: l,
80
+ active: e.defaultOpenIndex === r
81
+ }, () => [
82
+ he(re(l.title) + " ", 1),
83
+ C(t.$slots, "icon", { classList: "size-5 group-open/accordion:rotate-45 transition-transform" }, () => [
84
+ M(S(ll), { class: "rvc-size-5 group-open/accordion:rvc-rotate-45 rvc-transition-transform" })
85
+ ])
86
+ ])
87
+ ]),
88
+ x("div", {
89
+ class: q(["rvc-accordion-content", e.contentClass])
90
+ }, [
91
+ C(t.$slots, "content", { item: l }, () => [
92
+ x("div", {
93
+ innerHTML: l.content
94
+ }, null, 8, il)
95
+ ])
96
+ ], 2)
97
+ ], 8, ol))), 128))
98
+ ]));
99
+ }
100
+ }, al = { class: "rvc-alert-title" }, Fo = {
101
+ __name: "Alert",
102
+ props: {
103
+ as: {
104
+ type: String,
105
+ default: "div"
106
+ },
107
+ title: {
108
+ type: String,
109
+ default: ""
110
+ },
111
+ icon: {
112
+ type: [Object, Function],
113
+ default: null
114
+ },
115
+ type: {
116
+ type: String,
117
+ default: "info",
118
+ validator: (e) => ["success", "warning", "danger", "info"].includes(e)
119
+ },
120
+ close: {
121
+ type: Boolean,
122
+ default: !1
123
+ }
124
+ },
125
+ emits: ["alert:close"],
126
+ setup(e) {
127
+ return (t, n) => (E(), oe(Ie(e.as), {
128
+ class: q(["rvc-alert", `rvc-alert-${e.type}`])
129
+ }, {
130
+ default: H(() => [
131
+ C(t.$slots, "icon", {}, () => [
132
+ e.icon ? (E(), oe(Ie(e.icon), {
133
+ key: 0,
134
+ class: "rvc-alert-icon"
135
+ })) : _("", !0)
136
+ ]),
137
+ x("div", null, [
138
+ C(t.$slots, "title", {}, () => [
139
+ x("span", al, re(e.title), 1)
140
+ ]),
141
+ C(t.$slots, "default")
142
+ ]),
143
+ C(t.$slots, "close", {}, () => [
144
+ e.close ? (E(), k("button", {
145
+ key: 0,
146
+ type: "button",
147
+ class: "rvc-alert-close rvc-transition-colors",
148
+ onClick: n[0] || (n[0] = (l) => t.$emit("alert:close"))
149
+ }, [
150
+ M(S(At), { class: "rvc-size-5" })
151
+ ])) : _("", !0)
152
+ ])
153
+ ]),
154
+ _: 3
155
+ }, 8, ["class"]));
156
+ }
157
+ }, Bo = {
4
158
  __name: "Badge",
5
159
  props: {
6
160
  as: {
@@ -14,34 +168,34 @@ const it = (e) => typeof e != "string" ? !1 : /^(primary|secondary|tertiary|ligh
14
168
  size: {
15
169
  type: String,
16
170
  default: "base",
17
- validator: (e) => ["xs", "sm", "base", "lg"].includes(e)
171
+ validator: (e) => ["sm", "base"].includes(e)
18
172
  },
19
173
  color: {
20
174
  type: String,
21
- default: "primary",
22
- validator: (e) => it(e)
175
+ default: "default",
176
+ validator: (e) => typeof e != "string" ? !1 : /^(default|gray|red|yellow|green|blue|violet|purple|pink)?$/.test(e) || e.startsWith("custom-")
23
177
  }
24
178
  },
25
179
  setup(e) {
26
- return (t, n) => (U(), ee(ke(e.as), {
27
- class: ue(["badge", `badge-${e.color}`, `badge-${e.size}`])
180
+ return (t, n) => (E(), oe(Ie(e.as), {
181
+ class: q(["rvc-badge", `rvc-badge-${e.color}`, `rvc-badge-${e.size}`])
28
182
  }, {
29
- default: W(() => [
30
- te(t.$slots, "default", { label: e.label }, () => [
31
- Ve(qe(e.label), 1)
183
+ default: H(() => [
184
+ C(t.$slots, "default", { label: e.label }, () => [
185
+ he(re(e.label), 1)
32
186
  ])
33
187
  ]),
34
188
  _: 3
35
189
  }, 8, ["class"]));
36
190
  }
37
- }, Mt = {
191
+ }, sl = {
38
192
  xmlns: "http://www.w3.org/2000/svg",
39
193
  fill: "none",
40
194
  viewBox: "0 0 24 24"
41
195
  };
42
- function Rt(e, t) {
43
- return U(), ze("svg", Mt, t[0] || (t[0] = [
44
- L("circle", {
196
+ function ul(e, t) {
197
+ return E(), k("svg", sl, t[0] || (t[0] = [
198
+ x("circle", {
45
199
  cx: "12",
46
200
  cy: "12",
47
201
  r: "10",
@@ -49,13 +203,16 @@ function Rt(e, t) {
49
203
  "stroke-width": "4",
50
204
  style: { opacity: ".25" }
51
205
  }, null, -1),
52
- L("path", {
206
+ x("path", {
53
207
  fill: "currentColor",
54
208
  d: "M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z"
55
209
  }, null, -1)
56
210
  ]));
57
211
  }
58
- const Ht = { render: Rt }, et = {
212
+ const cn = { render: ul }, cl = {
213
+ key: 0,
214
+ class: "rvc-sr-only"
215
+ }, rt = {
59
216
  __name: "ButtonBase",
60
217
  props: {
61
218
  as: {
@@ -74,13 +231,17 @@ const Ht = { render: Rt }, et = {
74
231
  type: [Object, Function],
75
232
  default: null
76
233
  },
234
+ iconOnly: {
235
+ type: Boolean,
236
+ default: !1
237
+ },
77
238
  iconLeft: {
78
239
  type: Boolean
79
240
  },
80
241
  size: {
81
242
  type: String,
82
243
  default: "base",
83
- validator: (e) => ["xs", "sm", "base", "lg"].includes(e)
244
+ validator: (e) => ["sm", "base"].includes(e)
84
245
  },
85
246
  spinning: {
86
247
  type: Boolean
@@ -88,98 +249,328 @@ const Ht = { render: Rt }, et = {
88
249
  color: {
89
250
  type: String,
90
251
  default: "primary",
91
- validator: (e) => it(e)
252
+ validator: (e) => typeof e != "string" ? !1 : /^(primary|secondary|tertiary|light|dark|green|red|yellow|blue|green-soft|red-soft|yellow-soft|blue-soft)?$/.test(e) || e.startsWith("custom-") || e === "clear"
92
253
  }
93
254
  },
94
255
  setup(e) {
95
- return (t, n) => (U(), ee(ke(e.as), xt(e.bindAs ? { as: e.bindAs } : {}, {
96
- class: ["button", `button-${e.color}`, `button-${e.size}`, { "button-reverse": e.iconLeft }]
256
+ const t = e;
257
+ return te(() => {
258
+ t.iconOnly && !t.icon && console.warn("[ButtonBase] Using iconOnly prop without providing an icon may result in an empty button.");
259
+ }), (n, l) => (E(), oe(Ie(e.as), qe(e.bindAs ? { as: e.bindAs } : {}, {
260
+ class: ["rvc-button", `rvc-button-${e.color}`, `rvc-button-${e.size}`, { "rvc-button-reverse": e.iconLeft }, { "rvc-button-icon-only": e.iconOnly }],
261
+ "aria-label": e.iconOnly ? e.label : null,
262
+ "aria-busy": e.spinning
97
263
  }), {
98
- default: W(() => [
99
- Ve(qe(e.label) + " ", 1),
100
- te(t.$slots, "icon", {}, () => [
101
- e.icon && !e.spinning ? (U(), ee(ke(e.icon), {
264
+ default: H(() => [
265
+ e.iconOnly && e.label ? (E(), k("span", cl, [
266
+ C(n.$slots, "default", { label: e.label }, () => [
267
+ he(re(e.label), 1)
268
+ ])
269
+ ])) : e.label ? C(n.$slots, "default", {
270
+ key: 1,
271
+ label: e.label
272
+ }, () => [
273
+ he(re(e.label), 1)
274
+ ]) : _("", !0),
275
+ C(n.$slots, "icon", { icon: e.icon }, () => [
276
+ e.icon && !e.spinning ? (E(), oe(Ie(e.icon), {
102
277
  key: 0,
103
- class: "button-icon"
104
- })) : Se("", !0)
278
+ class: "rvc-button-icon",
279
+ "aria-hidden": !e.iconOnly
280
+ }, null, 8, ["aria-hidden"])) : _("", !0)
105
281
  ]),
106
- te(t.$slots, "spinner", {}, () => [
107
- e.spinning ? (U(), ee(I(Ht), {
282
+ C(n.$slots, "spinner", { spinning: e.spinning }, () => [
283
+ e.spinning ? (E(), oe(S(cn), {
108
284
  key: 0,
109
- class: "button-icon button-icon-loading"
110
- })) : Se("", !0)
285
+ class: "rvc-button-icon rvc-button-icon-loading",
286
+ "aria-hidden": "true"
287
+ })) : _("", !0)
111
288
  ])
112
289
  ]),
113
290
  _: 3
114
- }, 16, ["class"]));
291
+ }, 16, ["class", "aria-label", "aria-busy"]));
292
+ }
293
+ }, dl = { class: "rvc-checkbox" }, fl = ["id"], vl = { class: "rvc-checkbox-input peer-focus/checkbox:rvc-focus" }, pl = ["for"], Mo = /* @__PURE__ */ Object.assign({
294
+ inheritAttrs: !1
295
+ }, {
296
+ __name: "Checkbox",
297
+ props: {
298
+ modelValue: {
299
+ type: [Boolean, String, Array],
300
+ default: null
301
+ },
302
+ id: {
303
+ type: String,
304
+ required: !0
305
+ },
306
+ label: {
307
+ type: String,
308
+ default: ""
309
+ }
310
+ },
311
+ emits: ["update:modelValue"],
312
+ setup(e, { emit: t }) {
313
+ const n = e, l = t, r = b({
314
+ get: () => n.modelValue,
315
+ set: (o) => l("update:modelValue", o)
316
+ });
317
+ return (o, i) => (E(), k("div", dl, [
318
+ Yn(x("input", qe({ id: e.id }, o.$attrs, {
319
+ "onUpdate:modelValue": i[0] || (i[0] = (a) => r.value = a),
320
+ type: "checkbox",
321
+ class: "rvc-absolute rvc-opacity-0 rvc-inset-0 rvc-cursor-pointer rvc-peer/checkbox"
322
+ }), null, 16, fl), [
323
+ [Kn, r.value]
324
+ ]),
325
+ x("span", vl, [
326
+ M(S(nl))
327
+ ]),
328
+ x("div", null, [
329
+ o.$slots.default || e.label ? C(o.$slots, "default", { key: 0 }, () => [
330
+ x("label", { for: e.id }, re(e.label), 9, pl)
331
+ ]) : _("", !0)
332
+ ])
333
+ ]));
334
+ }
335
+ });
336
+ function ml(e, t) {
337
+ return E(), k("svg", {
338
+ xmlns: "http://www.w3.org/2000/svg",
339
+ viewBox: "0 0 16 16",
340
+ fill: "currentColor",
341
+ "aria-hidden": "true",
342
+ "data-slot": "icon"
343
+ }, [
344
+ x("path", {
345
+ "fill-rule": "evenodd",
346
+ d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",
347
+ "clip-rule": "evenodd"
348
+ })
349
+ ]);
350
+ }
351
+ const gl = { class: "rvc-overflow-x-auto rvc-pb-4" }, hl = { key: 0 }, yl = ["aria-label", "onClick"], bl = ["innerHTML"], wl = { key: 1 }, xl = ["colspan"], $l = { key: 2 }, Sl = ["colspan"], El = { class: "rvc-flex rvc-gap-x-2 rvc-items-center" }, No = {
352
+ __name: "DataTable",
353
+ props: {
354
+ headers: {
355
+ type: Array,
356
+ default: () => [],
357
+ validator: (e) => e.every((t) => !t.align || ["left", "center", "right"].includes(t.align))
358
+ },
359
+ items: {
360
+ type: Array,
361
+ required: !0
362
+ },
363
+ noResultsText: {
364
+ type: String,
365
+ default: "No results found."
366
+ },
367
+ loadingText: {
368
+ type: String,
369
+ default: "Loading content..."
370
+ },
371
+ striped: {
372
+ type: Boolean
373
+ },
374
+ spinning: {
375
+ type: Boolean
376
+ }
377
+ },
378
+ emits: ["table:sortBy"],
379
+ setup(e, { emit: t }) {
380
+ const n = e, l = t, r = $(null), o = (a) => n.headers.find((c) => c.key === a), i = (a) => {
381
+ !r.value || r.value.key !== a.key ? r.value = {
382
+ key: a.key,
383
+ direction: "asc"
384
+ } : r.value.direction === "asc" ? r.value = {
385
+ key: a.key,
386
+ direction: "desc"
387
+ } : r.value = null, l("table:sortBy", r.value);
388
+ };
389
+ return (a, c) => (E(), k("div", gl, [
390
+ x("table", {
391
+ class: q([{ "rvc-table-striped": e.striped }, "rvc-w-full rvc-table"])
392
+ }, [
393
+ e.headers.length ? (E(), k("thead", hl, [
394
+ x("tr", null, [
395
+ C(a.$slots, "headers", { headers: e.headers }, () => [
396
+ (E(!0), k(Le, null, nt(e.headers, (s) => {
397
+ var u, d;
398
+ return E(), k("th", {
399
+ key: `table-header-${s.id}`,
400
+ class: q({
401
+ "rvc-text-left": s.align === "left" || !s.align,
402
+ "rvc-text-center": s.align === "center",
403
+ "rvc-text-right": s.align === "right"
404
+ })
405
+ }, [
406
+ s.sortable ? (E(), k("button", {
407
+ key: 0,
408
+ type: "button",
409
+ "aria-label": `Sort on ${s.label}`,
410
+ class: q([
411
+ "rvc-flex rvc-w-full rvc-gap-x-1.5 hover:rvc-underline rvc-group/table",
412
+ {
413
+ "rvc-justify-center": s.align === "center",
414
+ "rvc-justify-start rvc-flex-row-reverse": s.align === "right"
415
+ }
416
+ ]),
417
+ onClick: (f) => i(s)
418
+ }, [
419
+ C(a.$slots, "header-label", {
420
+ sortBy: r.value,
421
+ header: s
422
+ }, () => [
423
+ he(re(s.label), 1)
424
+ ]),
425
+ M(S(ml), {
426
+ class: q([
427
+ "rvc-size-4 rvc-shrink-0 rvc-transition",
428
+ {
429
+ "rvc-opacity-100": ((u = r.value) == null ? void 0 : u.key) === s.key,
430
+ "rvc-opacity-0 group-hover/table:rvc-opacity-30": !r.value || r.value.key !== s.key,
431
+ "rvc-rotate-180": ((d = r.value) == null ? void 0 : d.key) === s.key && r.value.direction === "desc"
432
+ }
433
+ ])
434
+ }, null, 8, ["class"])
435
+ ], 10, yl)) : C(a.$slots, "header-label", {
436
+ key: 1,
437
+ sortBy: r.value,
438
+ header: s
439
+ }, () => [
440
+ he(re(s.label), 1)
441
+ ])
442
+ ], 2);
443
+ }), 128))
444
+ ])
445
+ ])
446
+ ])) : _("", !0),
447
+ x("tbody", null, [
448
+ e.items.length && !e.spinning ? (E(!0), k(Le, { key: 0 }, nt(e.items.map(({ id: s, ...u }) => u), (s, u) => (E(), k("tr", {
449
+ key: `table-row-${u}-${s.id}`
450
+ }, [
451
+ C(a.$slots, "items", {
452
+ item: s,
453
+ index: u
454
+ }, () => [
455
+ (E(!0), k(Le, null, nt(s, (d, f) => {
456
+ var v, p, m, h;
457
+ return E(), k("td", qe({
458
+ key: `table-row-${u}-column-${f}-${s.id}`,
459
+ ref_for: !0
460
+ }, s.attrs, {
461
+ class: {
462
+ "rvc-text-left": ((v = o(f)) == null ? void 0 : v.align) === "left" || !((p = o(f)) != null && p.align),
463
+ "rvc-text-center": ((m = o(f)) == null ? void 0 : m.align) === "center",
464
+ "rvc-text-right": ((h = o(f)) == null ? void 0 : h.align) === "right"
465
+ },
466
+ innerHTML: d
467
+ }), null, 16, bl);
468
+ }), 128))
469
+ ])
470
+ ]))), 128)) : !e.items.length && !e.spinning ? (E(), k("tr", wl, [
471
+ x("td", {
472
+ colspan: e.headers.length,
473
+ class: "rvc-table-state"
474
+ }, [
475
+ x("p", null, re(e.noResultsText), 1)
476
+ ], 8, xl)
477
+ ])) : (E(), k("tr", $l, [
478
+ x("td", {
479
+ colspan: e.headers.length,
480
+ class: "rvc-table-state"
481
+ }, [
482
+ C(a.$slots, "spinner", {
483
+ spinning: e.spinning,
484
+ label: e.loadingText
485
+ }, () => [
486
+ x("div", El, [
487
+ e.spinning ? (E(), oe(S(cn), {
488
+ key: 0,
489
+ "aria-hidden": "true",
490
+ class: "rvc-table-spinner"
491
+ })) : _("", !0),
492
+ he(" " + re(e.loadingText), 1)
493
+ ])
494
+ ])
495
+ ], 8, Sl)
496
+ ]))
497
+ ])
498
+ ], 2)
499
+ ]));
115
500
  }
116
501
  };
117
- function Ge(e) {
502
+ function Ol(e, t, n) {
503
+ let l = $(n == null ? void 0 : n.value), r = b(() => e.value !== void 0);
504
+ return [b(() => r.value ? e.value : l.value), function(o) {
505
+ return r.value || (l.value = o), t == null ? void 0 : t(o);
506
+ }];
507
+ }
508
+ function kt(e) {
118
509
  typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
119
510
  throw t;
120
511
  }));
121
512
  }
122
- function se() {
123
- let e = [], t = { addEventListener(n, r, l, a) {
124
- return n.addEventListener(r, l, a), t.add(() => n.removeEventListener(r, l, a));
513
+ function Ye() {
514
+ let e = [], t = { addEventListener(n, l, r, o) {
515
+ return n.addEventListener(l, r, o), t.add(() => n.removeEventListener(l, r, o));
125
516
  }, requestAnimationFrame(...n) {
126
- let r = requestAnimationFrame(...n);
127
- t.add(() => cancelAnimationFrame(r));
517
+ let l = requestAnimationFrame(...n);
518
+ t.add(() => cancelAnimationFrame(l));
128
519
  }, nextFrame(...n) {
129
520
  t.requestAnimationFrame(() => {
130
521
  t.requestAnimationFrame(...n);
131
522
  });
132
523
  }, setTimeout(...n) {
133
- let r = setTimeout(...n);
134
- t.add(() => clearTimeout(r));
524
+ let l = setTimeout(...n);
525
+ t.add(() => clearTimeout(l));
135
526
  }, microTask(...n) {
136
- let r = { current: !0 };
137
- return Ge(() => {
138
- r.current && n[0]();
527
+ let l = { current: !0 };
528
+ return kt(() => {
529
+ l.current && n[0]();
139
530
  }), t.add(() => {
140
- r.current = !1;
531
+ l.current = !1;
141
532
  });
142
- }, style(n, r, l) {
143
- let a = n.style.getPropertyValue(r);
144
- return Object.assign(n.style, { [r]: l }), this.add(() => {
145
- Object.assign(n.style, { [r]: a });
533
+ }, style(n, l, r) {
534
+ let o = n.style.getPropertyValue(l);
535
+ return Object.assign(n.style, { [l]: r }), this.add(() => {
536
+ Object.assign(n.style, { [l]: o });
146
537
  });
147
538
  }, group(n) {
148
- let r = se();
149
- return n(r), this.add(() => r.dispose());
539
+ let l = Ye();
540
+ return n(l), this.add(() => l.dispose());
150
541
  }, add(n) {
151
542
  return e.push(n), () => {
152
- let r = e.indexOf(n);
153
- if (r >= 0) for (let l of e.splice(r, 1)) l();
543
+ let l = e.indexOf(n);
544
+ if (l >= 0) for (let r of e.splice(l, 1)) r();
154
545
  };
155
546
  }, dispose() {
156
547
  for (let n of e.splice(0)) n();
157
548
  } };
158
549
  return t;
159
550
  }
160
- var tt;
161
- let It = Symbol("headlessui.useid"), Ut = 0;
162
- const Z = (tt = _e.useId) != null ? tt : function() {
163
- return _e.inject(It, () => `${++Ut}`)();
551
+ var Gt;
552
+ let Ll = Symbol("headlessui.useid"), Tl = 0;
553
+ const ye = (Gt = Kt.useId) != null ? Gt : function() {
554
+ return Kt.inject(Ll, () => `${++Tl}`)();
164
555
  };
165
- function E(e) {
556
+ function D(e) {
166
557
  var t;
167
558
  if (e == null || e.value == null) return null;
168
559
  let n = (t = e.value.$el) != null ? t : e.value;
169
560
  return n instanceof Node ? n : null;
170
561
  }
171
- function M(e, t, ...n) {
562
+ function pe(e, t, ...n) {
172
563
  if (e in t) {
173
- let l = t[e];
174
- return typeof l == "function" ? l(...n) : l;
564
+ let r = t[e];
565
+ return typeof r == "function" ? r(...n) : r;
175
566
  }
176
- let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
177
- throw Error.captureStackTrace && Error.captureStackTrace(r, M), r;
567
+ let l = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((r) => `"${r}"`).join(", ")}.`);
568
+ throw Error.captureStackTrace && Error.captureStackTrace(l, pe), l;
178
569
  }
179
- var Wt = Object.defineProperty, Vt = (e, t, n) => t in e ? Wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nt = (e, t, n) => (Vt(e, typeof t != "symbol" ? t + "" : t, n), n);
180
- let qt = class {
570
+ var Cl = Object.defineProperty, Al = (e, t, n) => t in e ? Cl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Xt = (e, t, n) => (Al(e, typeof t != "symbol" ? t + "" : t, n), n);
571
+ let kl = class {
181
572
  constructor() {
182
- nt(this, "current", this.detect()), nt(this, "currentId", 0);
573
+ Xt(this, "current", this.detect()), Xt(this, "currentId", 0);
183
574
  }
184
575
  set(t) {
185
576
  this.current !== t && (this.currentId = 0, this.current = t);
@@ -199,895 +590,994 @@ let qt = class {
199
590
  detect() {
200
591
  return typeof window > "u" || typeof document > "u" ? "server" : "client";
201
592
  }
202
- }, de = new qt();
203
- function re(e) {
204
- if (de.isServer) return null;
593
+ }, Ke = new kl();
594
+ function Be(e) {
595
+ if (Ke.isServer) return null;
205
596
  if (e instanceof Node) return e.ownerDocument;
206
597
  if (e != null && e.hasOwnProperty("value")) {
207
- let t = E(e);
598
+ let t = D(e);
208
599
  if (t) return t.ownerDocument;
209
600
  }
210
601
  return document;
211
602
  }
212
- let Be = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
213
- var V = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(V || {}), ut = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(ut || {}), zt = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(zt || {});
214
- function Gt(e = document.body) {
215
- return e == null ? [] : Array.from(e.querySelectorAll(Be)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
603
+ let bt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
604
+ var be = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(be || {}), dn = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(dn || {}), Pl = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Pl || {});
605
+ function Dl(e = document.body) {
606
+ return e == null ? [] : Array.from(e.querySelectorAll(bt)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
216
607
  }
217
- var st = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(st || {});
218
- function Yt(e, t = 0) {
608
+ var fn = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(fn || {});
609
+ function Rl(e, t = 0) {
219
610
  var n;
220
- return e === ((n = re(e)) == null ? void 0 : n.body) ? !1 : M(t, { 0() {
221
- return e.matches(Be);
611
+ return e === ((n = Be(e)) == null ? void 0 : n.body) ? !1 : pe(t, { 0() {
612
+ return e.matches(bt);
222
613
  }, 1() {
223
- let r = e;
224
- for (; r !== null; ) {
225
- if (r.matches(Be)) return !0;
226
- r = r.parentElement;
614
+ let l = e;
615
+ for (; l !== null; ) {
616
+ if (l.matches(bt)) return !0;
617
+ l = l.parentElement;
227
618
  }
228
619
  return !1;
229
620
  } });
230
621
  }
231
- var Kt = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Kt || {});
622
+ var Fl = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Fl || {});
232
623
  typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
233
624
  e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
234
625
  }, !0), document.addEventListener("click", (e) => {
235
626
  e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
236
627
  }, !0));
237
- function Q(e) {
628
+ function Te(e) {
238
629
  e == null || e.focus({ preventScroll: !0 });
239
630
  }
240
- let Xt = ["textarea", "input"].join(",");
241
- function Qt(e) {
631
+ let Bl = ["textarea", "input"].join(",");
632
+ function Ml(e) {
242
633
  var t, n;
243
- return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Xt)) != null ? n : !1;
634
+ return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Bl)) != null ? n : !1;
244
635
  }
245
- function Zt(e, t = (n) => n) {
246
- return e.slice().sort((n, r) => {
247
- let l = t(n), a = t(r);
248
- if (l === null || a === null) return 0;
249
- let i = l.compareDocumentPosition(a);
636
+ function Nl(e, t = (n) => n) {
637
+ return e.slice().sort((n, l) => {
638
+ let r = t(n), o = t(l);
639
+ if (r === null || o === null) return 0;
640
+ let i = r.compareDocumentPosition(o);
250
641
  return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
251
642
  });
252
643
  }
253
- function Ee(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
254
- var a;
255
- let i = (a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? a : document, o = Array.isArray(e) ? n ? Zt(e) : e : Gt(e);
256
- l.length > 0 && o.length > 1 && (o = o.filter((v) => !l.includes(v))), r = r ?? i.activeElement;
257
- let u = (() => {
644
+ function lt(e, t, { sorted: n = !0, relativeTo: l = null, skipElements: r = [] } = {}) {
645
+ var o;
646
+ let i = (o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? o : document, a = Array.isArray(e) ? n ? Nl(e) : e : Dl(e);
647
+ r.length > 0 && a.length > 1 && (a = a.filter((p) => !r.includes(p))), l = l ?? i.activeElement;
648
+ let c = (() => {
258
649
  if (t & 5) return 1;
259
650
  if (t & 10) return -1;
260
651
  throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
261
- })(), d = (() => {
652
+ })(), s = (() => {
262
653
  if (t & 1) return 0;
263
- if (t & 2) return Math.max(0, o.indexOf(r)) - 1;
264
- if (t & 4) return Math.max(0, o.indexOf(r)) + 1;
265
- if (t & 8) return o.length - 1;
654
+ if (t & 2) return Math.max(0, a.indexOf(l)) - 1;
655
+ if (t & 4) return Math.max(0, a.indexOf(l)) + 1;
656
+ if (t & 8) return a.length - 1;
266
657
  throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
267
- })(), s = t & 32 ? { preventScroll: !0 } : {}, f = 0, c = o.length, p;
658
+ })(), u = t & 32 ? { preventScroll: !0 } : {}, d = 0, f = a.length, v;
268
659
  do {
269
- if (f >= c || f + c <= 0) return 0;
270
- let v = d + f;
271
- if (t & 16) v = (v + c) % c;
660
+ if (d >= f || d + f <= 0) return 0;
661
+ let p = s + d;
662
+ if (t & 16) p = (p + f) % f;
272
663
  else {
273
- if (v < 0) return 3;
274
- if (v >= c) return 1;
664
+ if (p < 0) return 3;
665
+ if (p >= f) return 1;
275
666
  }
276
- p = o[v], p == null || p.focus(s), f += u;
277
- } while (p !== i.activeElement);
278
- return t & 6 && Qt(p) && p.select(), 2;
667
+ v = a[p], v == null || v.focus(u), d += c;
668
+ } while (v !== i.activeElement);
669
+ return t & 6 && Ml(v) && v.select(), 2;
279
670
  }
280
- function dt() {
671
+ function vn() {
281
672
  return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
282
673
  }
283
- function Jt() {
674
+ function jl() {
284
675
  return /Android/gi.test(window.navigator.userAgent);
285
676
  }
286
- function _t() {
287
- return dt() || Jt();
677
+ function Hl() {
678
+ return vn() || jl();
288
679
  }
289
- function ye(e, t, n) {
290
- de.isServer || C((r) => {
291
- document.addEventListener(e, t, n), r(() => document.removeEventListener(e, t, n));
680
+ function Je(e, t, n) {
681
+ Ke.isServer || te((l) => {
682
+ document.addEventListener(e, t, n), l(() => document.removeEventListener(e, t, n));
292
683
  });
293
684
  }
294
- function ct(e, t, n) {
295
- de.isServer || C((r) => {
296
- window.addEventListener(e, t, n), r(() => window.removeEventListener(e, t, n));
685
+ function pn(e, t, n) {
686
+ Ke.isServer || te((l) => {
687
+ window.addEventListener(e, t, n), l(() => window.removeEventListener(e, t, n));
297
688
  });
298
689
  }
299
- function en(e, t, n = m(() => !0)) {
300
- function r(a, i) {
301
- if (!n.value || a.defaultPrevented) return;
302
- let o = i(a);
303
- if (o === null || !o.getRootNode().contains(o)) return;
304
- let u = function d(s) {
305
- return typeof s == "function" ? d(s()) : Array.isArray(s) || s instanceof Set ? s : [s];
690
+ function Vl(e, t, n = b(() => !0)) {
691
+ function l(o, i) {
692
+ if (!n.value || o.defaultPrevented) return;
693
+ let a = i(o);
694
+ if (a === null || !a.getRootNode().contains(a)) return;
695
+ let c = function s(u) {
696
+ return typeof u == "function" ? s(u()) : Array.isArray(u) || u instanceof Set ? u : [u];
306
697
  }(e);
307
- for (let d of u) {
308
- if (d === null) continue;
309
- let s = d instanceof HTMLElement ? d : E(d);
310
- if (s != null && s.contains(o) || a.composed && a.composedPath().includes(s)) return;
698
+ for (let s of c) {
699
+ if (s === null) continue;
700
+ let u = s instanceof HTMLElement ? s : D(s);
701
+ if (u != null && u.contains(a) || o.composed && o.composedPath().includes(u)) return;
311
702
  }
312
- return !Yt(o, st.Loose) && o.tabIndex !== -1 && a.preventDefault(), t(a, o);
313
- }
314
- let l = h(null);
315
- ye("pointerdown", (a) => {
316
- var i, o;
317
- n.value && (l.value = ((o = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : o[0]) || a.target);
318
- }, !0), ye("mousedown", (a) => {
319
- var i, o;
320
- n.value && (l.value = ((o = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : o[0]) || a.target);
321
- }, !0), ye("click", (a) => {
322
- _t() || l.value && (r(a, () => l.value), l.value = null);
323
- }, !0), ye("touchend", (a) => r(a, () => a.target instanceof HTMLElement ? a.target : null), !0), ct("blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
324
- }
325
- var $e = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))($e || {}), q = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(q || {});
326
- function F({ visible: e = !0, features: t = 0, ourProps: n, theirProps: r, ...l }) {
327
- var a;
328
- let i = vt(r, n), o = Object.assign(l, { props: i });
329
- if (e || t & 2 && i.static) return Ae(o);
703
+ return !Rl(a, fn.Loose) && a.tabIndex !== -1 && o.preventDefault(), t(o, a);
704
+ }
705
+ let r = $(null);
706
+ Je("pointerdown", (o) => {
707
+ var i, a;
708
+ n.value && (r.value = ((a = (i = o.composedPath) == null ? void 0 : i.call(o)) == null ? void 0 : a[0]) || o.target);
709
+ }, !0), Je("mousedown", (o) => {
710
+ var i, a;
711
+ n.value && (r.value = ((a = (i = o.composedPath) == null ? void 0 : i.call(o)) == null ? void 0 : a[0]) || o.target);
712
+ }, !0), Je("click", (o) => {
713
+ Hl() || r.value && (l(o, () => r.value), r.value = null);
714
+ }, !0), Je("touchend", (o) => l(o, () => o.target instanceof HTMLElement ? o.target : null), !0), pn("blur", (o) => l(o, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
715
+ }
716
+ function Zt(e, t) {
717
+ if (e) return e;
718
+ let n = t ?? "button";
719
+ if (typeof n == "string" && n.toLowerCase() === "button") return "button";
720
+ }
721
+ function Il(e, t) {
722
+ let n = $(Zt(e.value.type, e.value.as));
723
+ return V(() => {
724
+ n.value = Zt(e.value.type, e.value.as);
725
+ }), te(() => {
726
+ var l;
727
+ n.value || D(t) && D(t) instanceof HTMLButtonElement && !((l = D(t)) != null && l.hasAttribute("type")) && (n.value = "button");
728
+ }), n;
729
+ }
730
+ var ot = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(ot || {}), we = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(we || {});
731
+ function W({ visible: e = !0, features: t = 0, ourProps: n, theirProps: l, ...r }) {
732
+ var o;
733
+ let i = gn(l, n), a = Object.assign(r, { props: i });
734
+ if (e || t & 2 && i.static) return mt(a);
330
735
  if (t & 1) {
331
- let u = (a = i.unmount) == null || a ? 0 : 1;
332
- return M(u, { 0() {
736
+ let c = (o = i.unmount) == null || o ? 0 : 1;
737
+ return pe(c, { 0() {
333
738
  return null;
334
739
  }, 1() {
335
- return Ae({ ...l, props: { ...i, hidden: !0, style: { display: "none" } } });
740
+ return mt({ ...r, props: { ...i, hidden: !0, style: { display: "none" } } });
336
741
  } });
337
742
  }
338
- return Ae(o);
339
- }
340
- function Ae({ props: e, attrs: t, slots: n, slot: r, name: l }) {
341
- var a, i;
342
- let { as: o, ...u } = pt(e, ["unmount", "static"]), d = (a = n.default) == null ? void 0 : a.call(n, r), s = {};
343
- if (r) {
344
- let f = !1, c = [];
345
- for (let [p, v] of Object.entries(r)) typeof v == "boolean" && (f = !0), v === !0 && c.push(p);
346
- f && (s["data-headlessui-state"] = c.join(" "));
347
- }
348
- if (o === "template") {
349
- if (d = ft(d ?? []), Object.keys(u).length > 0 || Object.keys(t).length > 0) {
350
- let [f, ...c] = d ?? [];
351
- if (!tn(f) || c.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${l} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(u).concat(Object.keys(t)).map((g) => g.trim()).filter((g, b, B) => B.indexOf(g) === b).sort((g, b) => g.localeCompare(b)).map((g) => ` - ${g}`).join(`
352
- `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((g) => ` - ${g}`).join(`
743
+ return mt(a);
744
+ }
745
+ function mt({ props: e, attrs: t, slots: n, slot: l, name: r }) {
746
+ var o, i;
747
+ let { as: a, ...c } = Pt(e, ["unmount", "static"]), s = (o = n.default) == null ? void 0 : o.call(n, l), u = {};
748
+ if (l) {
749
+ let d = !1, f = [];
750
+ for (let [v, p] of Object.entries(l)) typeof p == "boolean" && (d = !0), p === !0 && f.push(v);
751
+ d && (u["data-headlessui-state"] = f.join(" "));
752
+ }
753
+ if (a === "template") {
754
+ if (s = mn(s ?? []), Object.keys(c).length > 0 || Object.keys(t).length > 0) {
755
+ let [d, ...f] = s ?? [];
756
+ if (!Ul(d) || f.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${r} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(c).concat(Object.keys(t)).map((m) => m.trim()).filter((m, h, y) => y.indexOf(m) === h).sort((m, h) => m.localeCompare(h)).map((m) => ` - ${m}`).join(`
757
+ `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((m) => ` - ${m}`).join(`
353
758
  `)].join(`
354
759
  `));
355
- let p = vt((i = f.props) != null ? i : {}, u, s), v = At(f, p, !0);
356
- for (let g in p) g.startsWith("on") && (v.props || (v.props = {}), v.props[g] = p[g]);
357
- return v;
760
+ let v = gn((i = d.props) != null ? i : {}, c, u), p = Gn(d, v, !0);
761
+ for (let m in v) m.startsWith("on") && (p.props || (p.props = {}), p.props[m] = v[m]);
762
+ return p;
358
763
  }
359
- return Array.isArray(d) && d.length === 1 ? d[0] : d;
764
+ return Array.isArray(s) && s.length === 1 ? s[0] : s;
360
765
  }
361
- return S(o, Object.assign({}, u, s), { default: () => d });
766
+ return N(a, Object.assign({}, c, u), { default: () => s });
362
767
  }
363
- function ft(e) {
364
- return e.flatMap((t) => t.type === ot ? ft(t.children) : [t]);
768
+ function mn(e) {
769
+ return e.flatMap((t) => t.type === Le ? mn(t.children) : [t]);
365
770
  }
366
- function vt(...e) {
771
+ function gn(...e) {
367
772
  if (e.length === 0) return {};
368
773
  if (e.length === 1) return e[0];
369
774
  let t = {}, n = {};
370
- for (let r of e) for (let l in r) l.startsWith("on") && typeof r[l] == "function" ? (n[l] != null || (n[l] = []), n[l].push(r[l])) : t[l] = r[l];
371
- if (t.disabled || t["aria-disabled"]) return Object.assign(t, Object.fromEntries(Object.keys(n).map((r) => [r, void 0])));
372
- for (let r in n) Object.assign(t, { [r](l, ...a) {
373
- let i = n[r];
374
- for (let o of i) {
375
- if (l instanceof Event && l.defaultPrevented) return;
376
- o(l, ...a);
775
+ for (let l of e) for (let r in l) r.startsWith("on") && typeof l[r] == "function" ? (n[r] != null || (n[r] = []), n[r].push(l[r])) : t[r] = l[r];
776
+ if (t.disabled || t["aria-disabled"]) return Object.assign(t, Object.fromEntries(Object.keys(n).map((l) => [l, void 0])));
777
+ for (let l in n) Object.assign(t, { [l](r, ...o) {
778
+ let i = n[l];
779
+ for (let a of i) {
780
+ if (r instanceof Event && r.defaultPrevented) return;
781
+ a(r, ...o);
377
782
  }
378
783
  } });
379
784
  return t;
380
785
  }
381
- function pt(e, t = []) {
786
+ function Wl(e) {
787
+ let t = Object.assign({}, e);
788
+ for (let n in t) t[n] === void 0 && delete t[n];
789
+ return t;
790
+ }
791
+ function Pt(e, t = []) {
382
792
  let n = Object.assign({}, e);
383
- for (let r of t) r in n && delete n[r];
793
+ for (let l of t) l in n && delete n[l];
384
794
  return n;
385
795
  }
386
- function tn(e) {
796
+ function Ul(e) {
387
797
  return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
388
798
  }
389
- var Le = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Le || {});
390
- let Ne = T({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: t, attrs: n }) {
799
+ var We = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(We || {});
800
+ let it = I({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: t, attrs: n }) {
391
801
  return () => {
392
- var r;
393
- let { features: l, ...a } = e, i = { "aria-hidden": (l & 2) === 2 ? !0 : (r = a["aria-hidden"]) != null ? r : void 0, hidden: (l & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(l & 4) === 4 && (l & 2) !== 2 && { display: "none" } } };
394
- return F({ ourProps: i, theirProps: a, slot: {}, attrs: n, slots: t, name: "Hidden" });
802
+ var l;
803
+ let { features: r, ...o } = e, i = { "aria-hidden": (r & 2) === 2 ? !0 : (l = o["aria-hidden"]) != null ? l : void 0, hidden: (r & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
804
+ return W({ ourProps: i, theirProps: o, slot: {}, attrs: n, slots: t, name: "Hidden" });
395
805
  };
396
- } }), mt = Symbol("Context");
397
- var P = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(P || {});
398
- function nn() {
399
- return Ye() !== null;
806
+ } }), hn = Symbol("Context");
807
+ var Q = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(Q || {});
808
+ function zl() {
809
+ return Dt() !== null;
400
810
  }
401
- function Ye() {
402
- return D(mt, null);
811
+ function Dt() {
812
+ return Y(hn, null);
403
813
  }
404
- function rn(e) {
405
- j(mt, e);
814
+ function ql(e) {
815
+ ie(hn, e);
406
816
  }
407
- var gt = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(gt || {});
408
- function ln(e) {
817
+ var at = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(at || {});
818
+ function Yl(e) {
409
819
  function t() {
410
820
  document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
411
821
  }
412
822
  typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
413
823
  }
414
- let K = [];
415
- ln(() => {
824
+ let Ee = [];
825
+ Yl(() => {
416
826
  function e(t) {
417
- t.target instanceof HTMLElement && t.target !== document.body && K[0] !== t.target && (K.unshift(t.target), K = K.filter((n) => n != null && n.isConnected), K.splice(10));
827
+ t.target instanceof HTMLElement && t.target !== document.body && Ee[0] !== t.target && (Ee.unshift(t.target), Ee = Ee.filter((n) => n != null && n.isConnected), Ee.splice(10));
418
828
  }
419
829
  window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
420
830
  });
421
- function ht(e, t, n, r) {
422
- de.isServer || C((l) => {
423
- e = e ?? window, e.addEventListener(t, n, r), l(() => e.removeEventListener(t, n, r));
831
+ function Kl(e) {
832
+ var t, n;
833
+ let l = (t = e == null ? void 0 : e.form) != null ? t : e.closest("form");
834
+ if (l) {
835
+ for (let r of l.elements) if (r !== e && (r.tagName === "INPUT" && r.type === "submit" || r.tagName === "BUTTON" && r.type === "submit" || r.nodeName === "INPUT" && r.type === "image")) {
836
+ r.click();
837
+ return;
838
+ }
839
+ (n = l.requestSubmit) == null || n.call(l);
840
+ }
841
+ }
842
+ function yn(e, t, n, l) {
843
+ Ke.isServer || te((r) => {
844
+ e = e ?? window, e.addEventListener(t, n, l), r(() => e.removeEventListener(t, n, l));
424
845
  });
425
846
  }
426
- var ie = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(ie || {});
427
- function an() {
428
- let e = h(0);
429
- return ct("keydown", (t) => {
847
+ var He = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(He || {});
848
+ function Gl() {
849
+ let e = $(0);
850
+ return pn("keydown", (t) => {
430
851
  t.key === "Tab" && (e.value = t.shiftKey ? 1 : 0);
431
852
  }), e;
432
853
  }
433
- function yt(e) {
854
+ function bn(e) {
434
855
  if (!e) return /* @__PURE__ */ new Set();
435
856
  if (typeof e == "function") return new Set(e());
436
857
  let t = /* @__PURE__ */ new Set();
437
858
  for (let n of e.value) {
438
- let r = E(n);
439
- r instanceof HTMLElement && t.add(r);
859
+ let l = D(n);
860
+ l instanceof HTMLElement && t.add(l);
440
861
  }
441
862
  return t;
442
863
  }
443
- var bt = ((e) => (e[e.None = 1] = "None", e[e.InitialFocus = 2] = "InitialFocus", e[e.TabLock = 4] = "TabLock", e[e.FocusLock = 8] = "FocusLock", e[e.RestoreFocus = 16] = "RestoreFocus", e[e.All = 30] = "All", e))(bt || {});
444
- let ae = Object.assign(T({ name: "FocusTrap", props: { as: { type: [Object, String], default: "div" }, initialFocus: { type: Object, default: null }, features: { type: Number, default: 30 }, containers: { type: [Object, Function], default: h(/* @__PURE__ */ new Set()) } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: r }) {
445
- let l = h(null);
446
- r({ el: l, $el: l });
447
- let a = m(() => re(l)), i = h(!1);
448
- $(() => i.value = !0), k(() => i.value = !1), un({ ownerDocument: a }, m(() => i.value && !!(e.features & 16)));
449
- let o = sn({ ownerDocument: a, container: l, initialFocus: m(() => e.initialFocus) }, m(() => i.value && !!(e.features & 2)));
450
- dn({ ownerDocument: a, container: l, containers: e.containers, previousActiveElement: o }, m(() => i.value && !!(e.features & 8)));
451
- let u = an();
452
- function d(p) {
453
- let v = E(l);
454
- v && ((g) => g())(() => {
455
- M(u.value, { [ie.Forwards]: () => {
456
- Ee(v, V.First, { skipElements: [p.relatedTarget] });
457
- }, [ie.Backwards]: () => {
458
- Ee(v, V.Last, { skipElements: [p.relatedTarget] });
864
+ var wn = ((e) => (e[e.None = 1] = "None", e[e.InitialFocus = 2] = "InitialFocus", e[e.TabLock = 4] = "TabLock", e[e.FocusLock = 8] = "FocusLock", e[e.RestoreFocus = 16] = "RestoreFocus", e[e.All = 30] = "All", e))(wn || {});
865
+ let Ne = Object.assign(I({ name: "FocusTrap", props: { as: { type: [Object, String], default: "div" }, initialFocus: { type: Object, default: null }, features: { type: Number, default: 30 }, containers: { type: [Object, Function], default: $(/* @__PURE__ */ new Set()) } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: l }) {
866
+ let r = $(null);
867
+ l({ el: r, $el: r });
868
+ let o = b(() => Be(r)), i = $(!1);
869
+ V(() => i.value = !0), ae(() => i.value = !1), Zl({ ownerDocument: o }, b(() => i.value && !!(e.features & 16)));
870
+ let a = Ql({ ownerDocument: o, container: r, initialFocus: b(() => e.initialFocus) }, b(() => i.value && !!(e.features & 2)));
871
+ Jl({ ownerDocument: o, container: r, containers: e.containers, previousActiveElement: a }, b(() => i.value && !!(e.features & 8)));
872
+ let c = Gl();
873
+ function s(v) {
874
+ let p = D(r);
875
+ p && ((m) => m())(() => {
876
+ pe(c.value, { [He.Forwards]: () => {
877
+ lt(p, be.First, { skipElements: [v.relatedTarget] });
878
+ }, [He.Backwards]: () => {
879
+ lt(p, be.Last, { skipElements: [v.relatedTarget] });
459
880
  } });
460
881
  });
461
882
  }
462
- let s = h(!1);
463
- function f(p) {
464
- p.key === "Tab" && (s.value = !0, requestAnimationFrame(() => {
465
- s.value = !1;
883
+ let u = $(!1);
884
+ function d(v) {
885
+ v.key === "Tab" && (u.value = !0, requestAnimationFrame(() => {
886
+ u.value = !1;
466
887
  }));
467
888
  }
468
- function c(p) {
889
+ function f(v) {
469
890
  if (!i.value) return;
470
- let v = yt(e.containers);
471
- E(l) instanceof HTMLElement && v.add(E(l));
472
- let g = p.relatedTarget;
473
- g instanceof HTMLElement && g.dataset.headlessuiFocusGuard !== "true" && (wt(v, g) || (s.value ? Ee(E(l), M(u.value, { [ie.Forwards]: () => V.Next, [ie.Backwards]: () => V.Previous }) | V.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
891
+ let p = bn(e.containers);
892
+ D(r) instanceof HTMLElement && p.add(D(r));
893
+ let m = v.relatedTarget;
894
+ m instanceof HTMLElement && m.dataset.headlessuiFocusGuard !== "true" && (xn(p, m) || (u.value ? lt(D(r), pe(c.value, { [He.Forwards]: () => be.Next, [He.Backwards]: () => be.Previous }) | be.WrapAround, { relativeTo: v.target }) : v.target instanceof HTMLElement && Te(v.target)));
474
895
  }
475
896
  return () => {
476
- let p = {}, v = { ref: l, onKeydown: f, onFocusout: c }, { features: g, initialFocus: b, containers: B, ...O } = e;
477
- return S(ot, [!!(g & 4) && S(Ne, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: d, features: Le.Focusable }), F({ ourProps: v, theirProps: { ...t, ...O }, slot: p, attrs: t, slots: n, name: "FocusTrap" }), !!(g & 4) && S(Ne, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: d, features: Le.Focusable })]);
897
+ let v = {}, p = { ref: r, onKeydown: d, onFocusout: f }, { features: m, initialFocus: h, containers: y, ...g } = e;
898
+ return N(Le, [!!(m & 4) && N(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: s, features: We.Focusable }), W({ ourProps: p, theirProps: { ...t, ...g }, slot: v, attrs: t, slots: n, name: "FocusTrap" }), !!(m & 4) && N(it, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: s, features: We.Focusable })]);
478
899
  };
479
- } }), { features: bt });
480
- function on(e) {
481
- let t = h(K.slice());
482
- return ne([e], ([n], [r]) => {
483
- r === !0 && n === !1 ? Ge(() => {
900
+ } }), { features: wn });
901
+ function Xl(e) {
902
+ let t = $(Ee.slice());
903
+ return de([e], ([n], [l]) => {
904
+ l === !0 && n === !1 ? kt(() => {
484
905
  t.value.splice(0);
485
- }) : r === !1 && n === !0 && (t.value = K.slice());
906
+ }) : l === !1 && n === !0 && (t.value = Ee.slice());
486
907
  }, { flush: "post" }), () => {
487
908
  var n;
488
- return (n = t.value.find((r) => r != null && r.isConnected)) != null ? n : null;
909
+ return (n = t.value.find((l) => l != null && l.isConnected)) != null ? n : null;
489
910
  };
490
911
  }
491
- function un({ ownerDocument: e }, t) {
492
- let n = on(t);
493
- $(() => {
494
- C(() => {
495
- var r, l;
496
- t.value || ((r = e.value) == null ? void 0 : r.activeElement) === ((l = e.value) == null ? void 0 : l.body) && Q(n());
912
+ function Zl({ ownerDocument: e }, t) {
913
+ let n = Xl(t);
914
+ V(() => {
915
+ te(() => {
916
+ var l, r;
917
+ t.value || ((l = e.value) == null ? void 0 : l.activeElement) === ((r = e.value) == null ? void 0 : r.body) && Te(n());
497
918
  }, { flush: "post" });
498
- }), k(() => {
499
- t.value && Q(n());
919
+ }), ae(() => {
920
+ t.value && Te(n());
500
921
  });
501
922
  }
502
- function sn({ ownerDocument: e, container: t, initialFocus: n }, r) {
503
- let l = h(null), a = h(!1);
504
- return $(() => a.value = !0), k(() => a.value = !1), $(() => {
505
- ne([t, n, r], (i, o) => {
506
- if (i.every((d, s) => (o == null ? void 0 : o[s]) === d) || !r.value) return;
507
- let u = E(t);
508
- u && Ge(() => {
509
- var d, s;
510
- if (!a.value) return;
511
- let f = E(n), c = (d = e.value) == null ? void 0 : d.activeElement;
512
- if (f) {
513
- if (f === c) {
514
- l.value = c;
923
+ function Ql({ ownerDocument: e, container: t, initialFocus: n }, l) {
924
+ let r = $(null), o = $(!1);
925
+ return V(() => o.value = !0), ae(() => o.value = !1), V(() => {
926
+ de([t, n, l], (i, a) => {
927
+ if (i.every((s, u) => (a == null ? void 0 : a[u]) === s) || !l.value) return;
928
+ let c = D(t);
929
+ c && kt(() => {
930
+ var s, u;
931
+ if (!o.value) return;
932
+ let d = D(n), f = (s = e.value) == null ? void 0 : s.activeElement;
933
+ if (d) {
934
+ if (d === f) {
935
+ r.value = f;
515
936
  return;
516
937
  }
517
- } else if (u.contains(c)) {
518
- l.value = c;
938
+ } else if (c.contains(f)) {
939
+ r.value = f;
519
940
  return;
520
941
  }
521
- f ? Q(f) : Ee(u, V.First | V.NoScroll) === ut.Error && console.warn("There are no focusable elements inside the <FocusTrap />"), l.value = (s = e.value) == null ? void 0 : s.activeElement;
942
+ d ? Te(d) : lt(c, be.First | be.NoScroll) === dn.Error && console.warn("There are no focusable elements inside the <FocusTrap />"), r.value = (u = e.value) == null ? void 0 : u.activeElement;
522
943
  });
523
944
  }, { immediate: !0, flush: "post" });
524
- }), l;
525
- }
526
- function dn({ ownerDocument: e, container: t, containers: n, previousActiveElement: r }, l) {
527
- var a;
528
- ht((a = e.value) == null ? void 0 : a.defaultView, "focus", (i) => {
529
- if (!l.value) return;
530
- let o = yt(n);
531
- E(t) instanceof HTMLElement && o.add(E(t));
532
- let u = r.value;
533
- if (!u) return;
534
- let d = i.target;
535
- d && d instanceof HTMLElement ? wt(o, d) ? (r.value = d, Q(d)) : (i.preventDefault(), i.stopPropagation(), Q(u)) : Q(r.value);
945
+ }), r;
946
+ }
947
+ function Jl({ ownerDocument: e, container: t, containers: n, previousActiveElement: l }, r) {
948
+ var o;
949
+ yn((o = e.value) == null ? void 0 : o.defaultView, "focus", (i) => {
950
+ if (!r.value) return;
951
+ let a = bn(n);
952
+ D(t) instanceof HTMLElement && a.add(D(t));
953
+ let c = l.value;
954
+ if (!c) return;
955
+ let s = i.target;
956
+ s && s instanceof HTMLElement ? xn(a, s) ? (l.value = s, Te(s)) : (i.preventDefault(), i.stopPropagation(), Te(c)) : Te(l.value);
536
957
  }, !0);
537
958
  }
538
- function wt(e, t) {
959
+ function xn(e, t) {
539
960
  for (let n of e) if (n.contains(t)) return !0;
540
961
  return !1;
541
962
  }
542
- function cn(e) {
543
- let t = Dt(e.getSnapshot());
544
- return k(e.subscribe(() => {
963
+ function _l(e) {
964
+ let t = Ve(e.getSnapshot());
965
+ return ae(e.subscribe(() => {
545
966
  t.value = e.getSnapshot();
546
967
  })), t;
547
968
  }
548
- function fn(e, t) {
549
- let n = e(), r = /* @__PURE__ */ new Set();
969
+ function er(e, t) {
970
+ let n = e(), l = /* @__PURE__ */ new Set();
550
971
  return { getSnapshot() {
551
972
  return n;
552
- }, subscribe(l) {
553
- return r.add(l), () => r.delete(l);
554
- }, dispatch(l, ...a) {
555
- let i = t[l].call(n, ...a);
556
- i && (n = i, r.forEach((o) => o()));
973
+ }, subscribe(r) {
974
+ return l.add(r), () => l.delete(r);
975
+ }, dispatch(r, ...o) {
976
+ let i = t[r].call(n, ...o);
977
+ i && (n = i, l.forEach((a) => a()));
557
978
  } };
558
979
  }
559
- function vn() {
980
+ function tr() {
560
981
  let e;
561
982
  return { before({ doc: t }) {
562
983
  var n;
563
- let r = t.documentElement;
564
- e = ((n = t.defaultView) != null ? n : window).innerWidth - r.clientWidth;
984
+ let l = t.documentElement;
985
+ e = ((n = t.defaultView) != null ? n : window).innerWidth - l.clientWidth;
565
986
  }, after({ doc: t, d: n }) {
566
- let r = t.documentElement, l = r.clientWidth - r.offsetWidth, a = e - l;
567
- n.style(r, "paddingRight", `${a}px`);
987
+ let l = t.documentElement, r = l.clientWidth - l.offsetWidth, o = e - r;
988
+ n.style(l, "paddingRight", `${o}px`);
568
989
  } };
569
990
  }
570
- function pn() {
571
- return dt() ? { before({ doc: e, d: t, meta: n }) {
572
- function r(l) {
573
- return n.containers.flatMap((a) => a()).some((a) => a.contains(l));
991
+ function nr() {
992
+ return vn() ? { before({ doc: e, d: t, meta: n }) {
993
+ function l(r) {
994
+ return n.containers.flatMap((o) => o()).some((o) => o.contains(r));
574
995
  }
575
996
  t.microTask(() => {
576
- var l;
997
+ var r;
577
998
  if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
578
- let o = se();
579
- o.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => o.dispose()));
999
+ let a = Ye();
1000
+ a.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => a.dispose()));
580
1001
  }
581
- let a = (l = window.scrollY) != null ? l : window.pageYOffset, i = null;
582
- t.addEventListener(e, "click", (o) => {
583
- if (o.target instanceof HTMLElement) try {
584
- let u = o.target.closest("a");
585
- if (!u) return;
586
- let { hash: d } = new URL(u.href), s = e.querySelector(d);
587
- s && !r(s) && (i = s);
1002
+ let o = (r = window.scrollY) != null ? r : window.pageYOffset, i = null;
1003
+ t.addEventListener(e, "click", (a) => {
1004
+ if (a.target instanceof HTMLElement) try {
1005
+ let c = a.target.closest("a");
1006
+ if (!c) return;
1007
+ let { hash: s } = new URL(c.href), u = e.querySelector(s);
1008
+ u && !l(u) && (i = u);
588
1009
  } catch {
589
1010
  }
590
- }, !0), t.addEventListener(e, "touchstart", (o) => {
591
- if (o.target instanceof HTMLElement) if (r(o.target)) {
592
- let u = o.target;
593
- for (; u.parentElement && r(u.parentElement); ) u = u.parentElement;
594
- t.style(u, "overscrollBehavior", "contain");
595
- } else t.style(o.target, "touchAction", "none");
596
- }), t.addEventListener(e, "touchmove", (o) => {
597
- if (o.target instanceof HTMLElement) {
598
- if (o.target.tagName === "INPUT") return;
599
- if (r(o.target)) {
600
- let u = o.target;
601
- for (; u.parentElement && u.dataset.headlessuiPortal !== "" && !(u.scrollHeight > u.clientHeight || u.scrollWidth > u.clientWidth); ) u = u.parentElement;
602
- u.dataset.headlessuiPortal === "" && o.preventDefault();
603
- } else o.preventDefault();
1011
+ }, !0), t.addEventListener(e, "touchstart", (a) => {
1012
+ if (a.target instanceof HTMLElement) if (l(a.target)) {
1013
+ let c = a.target;
1014
+ for (; c.parentElement && l(c.parentElement); ) c = c.parentElement;
1015
+ t.style(c, "overscrollBehavior", "contain");
1016
+ } else t.style(a.target, "touchAction", "none");
1017
+ }), t.addEventListener(e, "touchmove", (a) => {
1018
+ if (a.target instanceof HTMLElement) {
1019
+ if (a.target.tagName === "INPUT") return;
1020
+ if (l(a.target)) {
1021
+ let c = a.target;
1022
+ for (; c.parentElement && c.dataset.headlessuiPortal !== "" && !(c.scrollHeight > c.clientHeight || c.scrollWidth > c.clientWidth); ) c = c.parentElement;
1023
+ c.dataset.headlessuiPortal === "" && a.preventDefault();
1024
+ } else a.preventDefault();
604
1025
  }
605
1026
  }, { passive: !1 }), t.add(() => {
606
- var o;
607
- let u = (o = window.scrollY) != null ? o : window.pageYOffset;
608
- a !== u && window.scrollTo(0, a), i && i.isConnected && (i.scrollIntoView({ block: "nearest" }), i = null);
1027
+ var a;
1028
+ let c = (a = window.scrollY) != null ? a : window.pageYOffset;
1029
+ o !== c && window.scrollTo(0, o), i && i.isConnected && (i.scrollIntoView({ block: "nearest" }), i = null);
609
1030
  });
610
1031
  });
611
1032
  } } : {};
612
1033
  }
613
- function mn() {
1034
+ function lr() {
614
1035
  return { before({ doc: e, d: t }) {
615
1036
  t.style(e.documentElement, "overflow", "hidden");
616
1037
  } };
617
1038
  }
618
- function gn(e) {
1039
+ function rr(e) {
619
1040
  let t = {};
620
1041
  for (let n of e) Object.assign(t, n(t));
621
1042
  return t;
622
1043
  }
623
- let X = fn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
1044
+ let Oe = er(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
624
1045
  var n;
625
- let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: se(), meta: /* @__PURE__ */ new Set() };
626
- return r.count++, r.meta.add(t), this.set(e, r), this;
1046
+ let l = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: Ye(), meta: /* @__PURE__ */ new Set() };
1047
+ return l.count++, l.meta.add(t), this.set(e, l), this;
627
1048
  }, POP(e, t) {
628
1049
  let n = this.get(e);
629
1050
  return n && (n.count--, n.meta.delete(t)), this;
630
1051
  }, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
631
- let r = { doc: e, d: t, meta: gn(n) }, l = [pn(), vn(), mn()];
632
- l.forEach(({ before: a }) => a == null ? void 0 : a(r)), l.forEach(({ after: a }) => a == null ? void 0 : a(r));
1052
+ let l = { doc: e, d: t, meta: rr(n) }, r = [nr(), tr(), lr()];
1053
+ r.forEach(({ before: o }) => o == null ? void 0 : o(l)), r.forEach(({ after: o }) => o == null ? void 0 : o(l));
633
1054
  }, SCROLL_ALLOW({ d: e }) {
634
1055
  e.dispose();
635
1056
  }, TEARDOWN({ doc: e }) {
636
1057
  this.delete(e);
637
1058
  } });
638
- X.subscribe(() => {
639
- let e = X.getSnapshot(), t = /* @__PURE__ */ new Map();
1059
+ Oe.subscribe(() => {
1060
+ let e = Oe.getSnapshot(), t = /* @__PURE__ */ new Map();
640
1061
  for (let [n] of e) t.set(n, n.documentElement.style.overflow);
641
1062
  for (let n of e.values()) {
642
- let r = t.get(n.doc) === "hidden", l = n.count !== 0;
643
- (l && !r || !l && r) && X.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && X.dispatch("TEARDOWN", n);
1063
+ let l = t.get(n.doc) === "hidden", r = n.count !== 0;
1064
+ (r && !l || !r && l) && Oe.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && Oe.dispatch("TEARDOWN", n);
644
1065
  }
645
1066
  });
646
- function hn(e, t, n) {
647
- let r = cn(X), l = m(() => {
648
- let a = e.value ? r.value.get(e.value) : void 0;
649
- return a ? a.count > 0 : !1;
1067
+ function or(e, t, n) {
1068
+ let l = _l(Oe), r = b(() => {
1069
+ let o = e.value ? l.value.get(e.value) : void 0;
1070
+ return o ? o.count > 0 : !1;
650
1071
  });
651
- return ne([e, t], ([a, i], [o], u) => {
652
- if (!a || !i) return;
653
- X.dispatch("PUSH", a, n);
654
- let d = !1;
655
- u(() => {
656
- d || (X.dispatch("POP", o ?? a, n), d = !0);
1072
+ return de([e, t], ([o, i], [a], c) => {
1073
+ if (!o || !i) return;
1074
+ Oe.dispatch("PUSH", o, n);
1075
+ let s = !1;
1076
+ c(() => {
1077
+ s || (Oe.dispatch("POP", a ?? o, n), s = !0);
657
1078
  });
658
- }, { immediate: !0 }), l;
1079
+ }, { immediate: !0 }), r;
659
1080
  }
660
- let De = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
661
- function rt(e, t = h(!0)) {
662
- C((n) => {
663
- var r;
1081
+ let gt = /* @__PURE__ */ new Map(), je = /* @__PURE__ */ new Map();
1082
+ function Qt(e, t = $(!0)) {
1083
+ te((n) => {
1084
+ var l;
664
1085
  if (!t.value) return;
665
- let l = E(e);
666
- if (!l) return;
1086
+ let r = D(e);
1087
+ if (!r) return;
667
1088
  n(function() {
668
1089
  var i;
669
- if (!l) return;
670
- let o = (i = oe.get(l)) != null ? i : 1;
671
- if (o === 1 ? oe.delete(l) : oe.set(l, o - 1), o !== 1) return;
672
- let u = De.get(l);
673
- u && (u["aria-hidden"] === null ? l.removeAttribute("aria-hidden") : l.setAttribute("aria-hidden", u["aria-hidden"]), l.inert = u.inert, De.delete(l));
1090
+ if (!r) return;
1091
+ let a = (i = je.get(r)) != null ? i : 1;
1092
+ if (a === 1 ? je.delete(r) : je.set(r, a - 1), a !== 1) return;
1093
+ let c = gt.get(r);
1094
+ c && (c["aria-hidden"] === null ? r.removeAttribute("aria-hidden") : r.setAttribute("aria-hidden", c["aria-hidden"]), r.inert = c.inert, gt.delete(r));
674
1095
  });
675
- let a = (r = oe.get(l)) != null ? r : 0;
676
- oe.set(l, a + 1), a === 0 && (De.set(l, { "aria-hidden": l.getAttribute("aria-hidden"), inert: l.inert }), l.setAttribute("aria-hidden", "true"), l.inert = !0);
1096
+ let o = (l = je.get(r)) != null ? l : 0;
1097
+ je.set(r, o + 1), o === 0 && (gt.set(r, { "aria-hidden": r.getAttribute("aria-hidden"), inert: r.inert }), r.setAttribute("aria-hidden", "true"), r.inert = !0);
677
1098
  });
678
1099
  }
679
- function yn({ defaultContainers: e = [], portals: t, mainTreeNodeRef: n } = {}) {
680
- let r = h(null), l = re(r);
681
- function a() {
682
- var i, o, u;
683
- let d = [];
684
- for (let s of e) s !== null && (s instanceof HTMLElement ? d.push(s) : "value" in s && s.value instanceof HTMLElement && d.push(s.value));
685
- if (t != null && t.value) for (let s of t.value) d.push(s);
686
- for (let s of (i = l == null ? void 0 : l.querySelectorAll("html > *, body > *")) != null ? i : []) s !== document.body && s !== document.head && s instanceof HTMLElement && s.id !== "headlessui-portal-root" && (s.contains(E(r)) || s.contains((u = (o = E(r)) == null ? void 0 : o.getRootNode()) == null ? void 0 : u.host) || d.some((f) => s.contains(f)) || d.push(s));
687
- return d;
688
- }
689
- return { resolveContainers: a, contains(i) {
690
- return a().some((o) => o.contains(i));
691
- }, mainTreeNodeRef: r, MainTreeNode() {
692
- return n != null ? null : S(Ne, { features: Le.Hidden, ref: r });
1100
+ function ir({ defaultContainers: e = [], portals: t, mainTreeNodeRef: n } = {}) {
1101
+ let l = $(null), r = Be(l);
1102
+ function o() {
1103
+ var i, a, c;
1104
+ let s = [];
1105
+ for (let u of e) u !== null && (u instanceof HTMLElement ? s.push(u) : "value" in u && u.value instanceof HTMLElement && s.push(u.value));
1106
+ if (t != null && t.value) for (let u of t.value) s.push(u);
1107
+ for (let u of (i = r == null ? void 0 : r.querySelectorAll("html > *, body > *")) != null ? i : []) u !== document.body && u !== document.head && u instanceof HTMLElement && u.id !== "headlessui-portal-root" && (u.contains(D(l)) || u.contains((c = (a = D(l)) == null ? void 0 : a.getRootNode()) == null ? void 0 : c.host) || s.some((d) => u.contains(d)) || s.push(u));
1108
+ return s;
1109
+ }
1110
+ return { resolveContainers: o, contains(i) {
1111
+ return o().some((a) => a.contains(i));
1112
+ }, mainTreeNodeRef: l, MainTreeNode() {
1113
+ return n != null ? null : N(it, { features: We.Hidden, ref: l });
693
1114
  } };
694
1115
  }
695
- let Et = Symbol("ForcePortalRootContext");
696
- function bn() {
697
- return D(Et, !1);
1116
+ let $n = Symbol("ForcePortalRootContext");
1117
+ function ar() {
1118
+ return Y($n, !1);
698
1119
  }
699
- let je = T({ name: "ForcePortalRoot", props: { as: { type: [Object, String], default: "template" }, force: { type: Boolean, default: !1 } }, setup(e, { slots: t, attrs: n }) {
700
- return j(Et, e.force), () => {
701
- let { force: r, ...l } = e;
702
- return F({ theirProps: l, ourProps: {}, slot: {}, slots: t, attrs: n, name: "ForcePortalRoot" });
1120
+ let wt = I({ name: "ForcePortalRoot", props: { as: { type: [Object, String], default: "template" }, force: { type: Boolean, default: !1 } }, setup(e, { slots: t, attrs: n }) {
1121
+ return ie($n, e.force), () => {
1122
+ let { force: l, ...r } = e;
1123
+ return W({ theirProps: r, ourProps: {}, slot: {}, slots: t, attrs: n, name: "ForcePortalRoot" });
703
1124
  };
704
- } }), St = Symbol("StackContext");
705
- var Me = ((e) => (e[e.Add = 0] = "Add", e[e.Remove = 1] = "Remove", e))(Me || {});
706
- function wn() {
707
- return D(St, () => {
1125
+ } }), Sn = Symbol("StackContext");
1126
+ var xt = ((e) => (e[e.Add = 0] = "Add", e[e.Remove = 1] = "Remove", e))(xt || {});
1127
+ function sr() {
1128
+ return Y(Sn, () => {
708
1129
  });
709
1130
  }
710
- function En({ type: e, enabled: t, element: n, onUpdate: r }) {
711
- let l = wn();
712
- function a(...i) {
713
- r == null || r(...i), l(...i);
1131
+ function ur({ type: e, enabled: t, element: n, onUpdate: l }) {
1132
+ let r = sr();
1133
+ function o(...i) {
1134
+ l == null || l(...i), r(...i);
714
1135
  }
715
- $(() => {
716
- ne(t, (i, o) => {
717
- i ? a(0, e, n) : o === !0 && a(1, e, n);
1136
+ V(() => {
1137
+ de(t, (i, a) => {
1138
+ i ? o(0, e, n) : a === !0 && o(1, e, n);
718
1139
  }, { immediate: !0, flush: "sync" });
719
- }), k(() => {
720
- t.value && a(1, e, n);
721
- }), j(St, a);
1140
+ }), ae(() => {
1141
+ t.value && o(1, e, n);
1142
+ }), ie(Sn, o);
722
1143
  }
723
- let $t = Symbol("DescriptionContext");
724
- function Sn() {
725
- let e = D($t, null);
1144
+ let En = Symbol("DescriptionContext");
1145
+ function cr() {
1146
+ let e = Y(En, null);
726
1147
  if (e === null) throw new Error("Missing parent");
727
1148
  return e;
728
1149
  }
729
- function $n({ slot: e = h({}), name: t = "Description", props: n = {} } = {}) {
730
- let r = h([]);
731
- function l(a) {
732
- return r.value.push(a), () => {
733
- let i = r.value.indexOf(a);
734
- i !== -1 && r.value.splice(i, 1);
1150
+ function On({ slot: e = $({}), name: t = "Description", props: n = {} } = {}) {
1151
+ let l = $([]);
1152
+ function r(o) {
1153
+ return l.value.push(o), () => {
1154
+ let i = l.value.indexOf(o);
1155
+ i !== -1 && l.value.splice(i, 1);
735
1156
  };
736
1157
  }
737
- return j($t, { register: l, slot: e, name: t, props: n }), m(() => r.value.length > 0 ? r.value.join(" ") : void 0);
1158
+ return ie(En, { register: r, slot: e, name: t, props: n }), b(() => l.value.length > 0 ? l.value.join(" ") : void 0);
738
1159
  }
739
- T({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
740
- var r;
741
- let l = (r = e.id) != null ? r : `headlessui-description-${Z()}`, a = Sn();
742
- return $(() => k(a.register(l))), () => {
743
- let { name: i = "Description", slot: o = h({}), props: u = {} } = a, { ...d } = e, s = { ...Object.entries(u).reduce((f, [c, p]) => Object.assign(f, { [c]: I(p) }), {}), id: l };
744
- return F({ ourProps: s, theirProps: d, slot: o.value, attrs: t, slots: n, name: i });
1160
+ I({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
1161
+ var l;
1162
+ let r = (l = e.id) != null ? l : `headlessui-description-${ye()}`, o = cr();
1163
+ return V(() => ae(o.register(r))), () => {
1164
+ let { name: i = "Description", slot: a = $({}), props: c = {} } = o, { ...s } = e, u = { ...Object.entries(c).reduce((d, [f, v]) => Object.assign(d, { [f]: S(v) }), {}), id: r };
1165
+ return W({ ourProps: u, theirProps: s, slot: a.value, attrs: t, slots: n, name: i });
745
1166
  };
746
1167
  } });
747
- function Ln(e) {
748
- let t = re(e);
1168
+ function dr(e) {
1169
+ let t = Be(e);
749
1170
  if (!t) {
750
1171
  if (e === null) return null;
751
1172
  throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${e}`);
752
1173
  }
753
1174
  let n = t.getElementById("headlessui-portal-root");
754
1175
  if (n) return n;
755
- let r = t.createElement("div");
756
- return r.setAttribute("id", "headlessui-portal-root"), t.body.appendChild(r);
1176
+ let l = t.createElement("div");
1177
+ return l.setAttribute("id", "headlessui-portal-root"), t.body.appendChild(l);
757
1178
  }
758
- const Re = /* @__PURE__ */ new WeakMap();
759
- function Tn(e) {
1179
+ const $t = /* @__PURE__ */ new WeakMap();
1180
+ function fr(e) {
760
1181
  var t;
761
- return (t = Re.get(e)) != null ? t : 0;
762
- }
763
- function lt(e, t) {
764
- let n = t(Tn(e));
765
- return n <= 0 ? Re.delete(e) : Re.set(e, n), n;
766
- }
767
- let Lt = T({ name: "Portal", props: { as: { type: [Object, String], default: "div" } }, setup(e, { slots: t, attrs: n }) {
768
- let r = h(null), l = m(() => re(r)), a = bn(), i = D(Tt, null), o = h(a === !0 || i == null ? Ln(r.value) : i.resolveTarget());
769
- o.value && lt(o.value, (c) => c + 1);
770
- let u = h(!1);
771
- $(() => {
772
- u.value = !0;
773
- }), C(() => {
774
- a || i != null && (o.value = i.resolveTarget());
1182
+ return (t = $t.get(e)) != null ? t : 0;
1183
+ }
1184
+ function Jt(e, t) {
1185
+ let n = t(fr(e));
1186
+ return n <= 0 ? $t.delete(e) : $t.set(e, n), n;
1187
+ }
1188
+ let Ln = I({ name: "Portal", props: { as: { type: [Object, String], default: "div" } }, setup(e, { slots: t, attrs: n }) {
1189
+ let l = $(null), r = b(() => Be(l)), o = ar(), i = Y(Tn, null), a = $(o === !0 || i == null ? dr(l.value) : i.resolveTarget());
1190
+ a.value && Jt(a.value, (f) => f + 1);
1191
+ let c = $(!1);
1192
+ V(() => {
1193
+ c.value = !0;
1194
+ }), te(() => {
1195
+ o || i != null && (a.value = i.resolveTarget());
775
1196
  });
776
- let d = D(He, null), s = !1, f = Ct();
777
- return ne(r, () => {
778
- if (s || !d) return;
779
- let c = E(r);
780
- c && (k(d.register(c), f), s = !0);
781
- }), k(() => {
782
- var c, p;
783
- let v = (c = l.value) == null ? void 0 : c.getElementById("headlessui-portal-root");
784
- !v || o.value !== v || lt(o.value, (g) => g - 1) || o.value.children.length > 0 || (p = o.value.parentElement) == null || p.removeChild(o.value);
1197
+ let s = Y(St, null), u = !1, d = Xn();
1198
+ return de(l, () => {
1199
+ if (u || !s) return;
1200
+ let f = D(l);
1201
+ f && (ae(s.register(f), d), u = !0);
1202
+ }), ae(() => {
1203
+ var f, v;
1204
+ let p = (f = r.value) == null ? void 0 : f.getElementById("headlessui-portal-root");
1205
+ !p || a.value !== p || Jt(a.value, (m) => m - 1) || a.value.children.length > 0 || (v = a.value.parentElement) == null || v.removeChild(a.value);
785
1206
  }), () => {
786
- if (!u.value || o.value === null) return null;
787
- let c = { ref: r, "data-headlessui-portal": "" };
788
- return S(kt, { to: o.value }, F({ ourProps: c, theirProps: e, slot: {}, attrs: n, slots: t, name: "Portal" }));
1207
+ if (!c.value || a.value === null) return null;
1208
+ let f = { ref: l, "data-headlessui-portal": "" };
1209
+ return N(Zn, { to: a.value }, W({ ourProps: f, theirProps: e, slot: {}, attrs: n, slots: t, name: "Portal" }));
789
1210
  };
790
- } }), He = Symbol("PortalParentContext");
791
- function On() {
792
- let e = D(He, null), t = h([]);
793
- function n(a) {
794
- return t.value.push(a), e && e.register(a), () => r(a);
795
- }
796
- function r(a) {
797
- let i = t.value.indexOf(a);
798
- i !== -1 && t.value.splice(i, 1), e && e.unregister(a);
799
- }
800
- let l = { register: n, unregister: r, portals: t };
801
- return [t, T({ name: "PortalWrapper", setup(a, { slots: i }) {
802
- return j(He, l), () => {
803
- var o;
804
- return (o = i.default) == null ? void 0 : o.call(i);
1211
+ } }), St = Symbol("PortalParentContext");
1212
+ function vr() {
1213
+ let e = Y(St, null), t = $([]);
1214
+ function n(o) {
1215
+ return t.value.push(o), e && e.register(o), () => l(o);
1216
+ }
1217
+ function l(o) {
1218
+ let i = t.value.indexOf(o);
1219
+ i !== -1 && t.value.splice(i, 1), e && e.unregister(o);
1220
+ }
1221
+ let r = { register: n, unregister: l, portals: t };
1222
+ return [t, I({ name: "PortalWrapper", setup(o, { slots: i }) {
1223
+ return ie(St, r), () => {
1224
+ var a;
1225
+ return (a = i.default) == null ? void 0 : a.call(i);
805
1226
  };
806
1227
  } })];
807
1228
  }
808
- let Tt = Symbol("PortalGroupContext"), Pn = T({ name: "PortalGroup", props: { as: { type: [Object, String], default: "template" }, target: { type: Object, default: null } }, setup(e, { attrs: t, slots: n }) {
809
- let r = Bt({ resolveTarget() {
1229
+ let Tn = Symbol("PortalGroupContext"), pr = I({ name: "PortalGroup", props: { as: { type: [Object, String], default: "template" }, target: { type: Object, default: null } }, setup(e, { attrs: t, slots: n }) {
1230
+ let l = Qn({ resolveTarget() {
810
1231
  return e.target;
811
1232
  } });
812
- return j(Tt, r), () => {
813
- let { target: l, ...a } = e;
814
- return F({ theirProps: a, ourProps: {}, slot: {}, attrs: t, slots: n, name: "PortalGroup" });
1233
+ return ie(Tn, l), () => {
1234
+ let { target: r, ...o } = e;
1235
+ return W({ theirProps: o, ourProps: {}, slot: {}, attrs: t, slots: n, name: "PortalGroup" });
815
1236
  };
816
1237
  } });
817
- var Fn = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Fn || {});
818
- let Ie = Symbol("DialogContext");
819
- function ce(e) {
820
- let t = D(Ie, null);
1238
+ var mr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(mr || {});
1239
+ let Et = Symbol("DialogContext");
1240
+ function Ge(e) {
1241
+ let t = Y(Et, null);
821
1242
  if (t === null) {
822
1243
  let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
823
- throw Error.captureStackTrace && Error.captureStackTrace(n, ce), n;
1244
+ throw Error.captureStackTrace && Error.captureStackTrace(n, Ge), n;
824
1245
  }
825
1246
  return t;
826
1247
  }
827
- let be = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", xn = T({ name: "Dialog", inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, open: { type: [Boolean, String], default: be }, initialFocus: { type: Object, default: null }, id: { type: String, default: null }, role: { type: String, default: "dialog" } }, emits: { close: (e) => !0 }, setup(e, { emit: t, attrs: n, slots: r, expose: l }) {
828
- var a, i;
829
- let o = (a = e.id) != null ? a : `headlessui-dialog-${Z()}`, u = h(!1);
830
- $(() => {
831
- u.value = !0;
1248
+ let _e = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", Cn = I({ name: "Dialog", inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, open: { type: [Boolean, String], default: _e }, initialFocus: { type: Object, default: null }, id: { type: String, default: null }, role: { type: String, default: "dialog" } }, emits: { close: (e) => !0 }, setup(e, { emit: t, attrs: n, slots: l, expose: r }) {
1249
+ var o, i;
1250
+ let a = (o = e.id) != null ? o : `headlessui-dialog-${ye()}`, c = $(!1);
1251
+ V(() => {
1252
+ c.value = !0;
832
1253
  });
833
- let d = !1, s = m(() => e.role === "dialog" || e.role === "alertdialog" ? e.role : (d || (d = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog")), f = h(0), c = Ye(), p = m(() => e.open === be && c !== null ? (c.value & P.Open) === P.Open : e.open), v = h(null), g = m(() => re(v));
834
- if (l({ el: v, $el: v }), !(e.open !== be || c !== null)) throw new Error("You forgot to provide an `open` prop to the `Dialog`.");
835
- if (typeof p.value != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${p.value === be ? void 0 : e.open}`);
836
- let b = m(() => u.value && p.value ? 0 : 1), B = m(() => b.value === 0), O = m(() => f.value > 1), z = D(Ie, null) !== null, [fe, ve] = On(), { resolveContainers: J, mainTreeNodeRef: pe, MainTreeNode: me } = yn({ portals: fe, defaultContainers: [m(() => {
837
- var y;
838
- return (y = _.panelRef.value) != null ? y : v.value;
839
- })] }), Oe = m(() => O.value ? "parent" : "leaf"), ge = m(() => c !== null ? (c.value & P.Closing) === P.Closing : !1), Pe = m(() => z || ge.value ? !1 : B.value), Fe = m(() => {
840
- var y, w, x;
841
- return (x = Array.from((w = (y = g.value) == null ? void 0 : y.querySelectorAll("body > *")) != null ? w : []).find((A) => A.id === "headlessui-portal-root" ? !1 : A.contains(E(pe)) && A instanceof HTMLElement)) != null ? x : null;
1254
+ let s = !1, u = b(() => e.role === "dialog" || e.role === "alertdialog" ? e.role : (s || (s = !0, console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog")), d = $(0), f = Dt(), v = b(() => e.open === _e && f !== null ? (f.value & Q.Open) === Q.Open : e.open), p = $(null), m = b(() => Be(p));
1255
+ if (r({ el: p, $el: p }), !(e.open !== _e || f !== null)) throw new Error("You forgot to provide an `open` prop to the `Dialog`.");
1256
+ if (typeof v.value != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${v.value === _e ? void 0 : e.open}`);
1257
+ let h = b(() => c.value && v.value ? 0 : 1), y = b(() => h.value === 0), g = b(() => d.value > 1), w = Y(Et, null) !== null, [T, L] = vr(), { resolveContainers: P, mainTreeNodeRef: O, MainTreeNode: R } = ir({ portals: T, defaultContainers: [b(() => {
1258
+ var A;
1259
+ return (A = ce.panelRef.value) != null ? A : p.value;
1260
+ })] }), U = b(() => g.value ? "parent" : "leaf"), F = b(() => f !== null ? (f.value & Q.Closing) === Q.Closing : !1), z = b(() => w || F.value ? !1 : y.value), K = b(() => {
1261
+ var A, B, ne;
1262
+ return (ne = Array.from((B = (A = m.value) == null ? void 0 : A.querySelectorAll("body > *")) != null ? B : []).find((le) => le.id === "headlessui-portal-root" ? !1 : le.contains(D(O)) && le instanceof HTMLElement)) != null ? ne : null;
842
1263
  });
843
- rt(Fe, Pe);
844
- let N = m(() => O.value ? !0 : B.value), le = m(() => {
845
- var y, w, x;
846
- return (x = Array.from((w = (y = g.value) == null ? void 0 : y.querySelectorAll("[data-headlessui-portal]")) != null ? w : []).find((A) => A.contains(E(pe)) && A instanceof HTMLElement)) != null ? x : null;
1264
+ Qt(K, z);
1265
+ let j = b(() => g.value ? !0 : y.value), G = b(() => {
1266
+ var A, B, ne;
1267
+ return (ne = Array.from((B = (A = m.value) == null ? void 0 : A.querySelectorAll("[data-headlessui-portal]")) != null ? B : []).find((le) => le.contains(D(O)) && le instanceof HTMLElement)) != null ? ne : null;
847
1268
  });
848
- rt(le, N), En({ type: "Dialog", enabled: m(() => b.value === 0), element: v, onUpdate: (y, w) => {
849
- if (w === "Dialog") return M(y, { [Me.Add]: () => f.value += 1, [Me.Remove]: () => f.value -= 1 });
1269
+ Qt(G, j), ur({ type: "Dialog", enabled: b(() => h.value === 0), element: p, onUpdate: (A, B) => {
1270
+ if (B === "Dialog") return pe(A, { [xt.Add]: () => d.value += 1, [xt.Remove]: () => d.value -= 1 });
850
1271
  } });
851
- let R = $n({ name: "DialogDescription", slot: m(() => ({ open: p.value })) }), H = h(null), _ = { titleId: H, panelRef: h(null), dialogState: b, setTitleId(y) {
852
- H.value !== y && (H.value = y);
1272
+ let X = On({ name: "DialogDescription", slot: b(() => ({ open: v.value })) }), Z = $(null), ce = { titleId: Z, panelRef: $(null), dialogState: h, setTitleId(A) {
1273
+ Z.value !== A && (Z.value = A);
853
1274
  }, close() {
854
1275
  t("close", !1);
855
1276
  } };
856
- j(Ie, _);
857
- let Qe = m(() => !(!B.value || O.value));
858
- en(J, (y, w) => {
859
- y.preventDefault(), _.close(), Nt(() => w == null ? void 0 : w.focus());
860
- }, Qe);
861
- let Ze = m(() => !(O.value || b.value !== 0));
862
- ht((i = g.value) == null ? void 0 : i.defaultView, "keydown", (y) => {
863
- Ze.value && (y.defaultPrevented || y.key === gt.Escape && (y.preventDefault(), y.stopPropagation(), _.close()));
1277
+ ie(Et, ce);
1278
+ let zt = b(() => !(!y.value || g.value));
1279
+ Vl(P, (A, B) => {
1280
+ A.preventDefault(), ce.close(), Jn(() => B == null ? void 0 : B.focus());
1281
+ }, zt);
1282
+ let qt = b(() => !(g.value || h.value !== 0));
1283
+ yn((i = m.value) == null ? void 0 : i.defaultView, "keydown", (A) => {
1284
+ qt.value && (A.defaultPrevented || A.key === at.Escape && (A.preventDefault(), A.stopPropagation(), ce.close()));
864
1285
  });
865
- let Je = m(() => !(ge.value || b.value !== 0 || z));
866
- return hn(g, Je, (y) => {
867
- var w;
868
- return { containers: [...(w = y.containers) != null ? w : [], J] };
869
- }), C((y) => {
870
- if (b.value !== 0) return;
871
- let w = E(v);
872
- if (!w) return;
873
- let x = new ResizeObserver((A) => {
874
- for (let xe of A) {
875
- let he = xe.target.getBoundingClientRect();
876
- he.x === 0 && he.y === 0 && he.width === 0 && he.height === 0 && _.close();
1286
+ let Yt = b(() => !(F.value || h.value !== 0 || w));
1287
+ return or(m, Yt, (A) => {
1288
+ var B;
1289
+ return { containers: [...(B = A.containers) != null ? B : [], P] };
1290
+ }), te((A) => {
1291
+ if (h.value !== 0) return;
1292
+ let B = D(p);
1293
+ if (!B) return;
1294
+ let ne = new ResizeObserver((le) => {
1295
+ for (let pt of le) {
1296
+ let Qe = pt.target.getBoundingClientRect();
1297
+ Qe.x === 0 && Qe.y === 0 && Qe.width === 0 && Qe.height === 0 && ce.close();
877
1298
  }
878
1299
  });
879
- x.observe(w), y(() => x.disconnect());
1300
+ ne.observe(B), A(() => ne.disconnect());
880
1301
  }), () => {
881
- let { open: y, initialFocus: w, ...x } = e, A = { ...n, ref: v, id: o, role: s.value, "aria-modal": b.value === 0 ? !0 : void 0, "aria-labelledby": H.value, "aria-describedby": R.value }, xe = { open: b.value === 0 };
882
- return S(je, { force: !0 }, () => [S(Lt, () => S(Pn, { target: v.value }, () => S(je, { force: !1 }, () => S(ae, { initialFocus: w, containers: J, features: B.value ? M(Oe.value, { parent: ae.features.RestoreFocus, leaf: ae.features.All & ~ae.features.FocusLock }) : ae.features.None }, () => S(ve, {}, () => F({ ourProps: A, theirProps: { ...x, ...n }, slot: xe, attrs: n, slots: r, visible: b.value === 0, features: $e.RenderStrategy | $e.Static, name: "Dialog" })))))), S(me)]);
1302
+ let { open: A, initialFocus: B, ...ne } = e, le = { ...n, ref: p, id: a, role: u.value, "aria-modal": h.value === 0 ? !0 : void 0, "aria-labelledby": Z.value, "aria-describedby": X.value }, pt = { open: h.value === 0 };
1303
+ return N(wt, { force: !0 }, () => [N(Ln, () => N(pr, { target: p.value }, () => N(wt, { force: !1 }, () => N(Ne, { initialFocus: B, containers: P, features: y.value ? pe(U.value, { parent: Ne.features.RestoreFocus, leaf: Ne.features.All & ~Ne.features.FocusLock }) : Ne.features.None }, () => N(L, {}, () => W({ ourProps: le, theirProps: { ...ne, ...n }, slot: pt, attrs: n, slots: l, visible: h.value === 0, features: ot.RenderStrategy | ot.Static, name: "Dialog" })))))), N(R)]);
883
1304
  };
884
1305
  } });
885
- T({ name: "DialogOverlay", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
886
- var r;
887
- let l = (r = e.id) != null ? r : `headlessui-dialog-overlay-${Z()}`, a = ce("DialogOverlay");
888
- function i(o) {
889
- o.target === o.currentTarget && (o.preventDefault(), o.stopPropagation(), a.close());
1306
+ I({ name: "DialogOverlay", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
1307
+ var l;
1308
+ let r = (l = e.id) != null ? l : `headlessui-dialog-overlay-${ye()}`, o = Ge("DialogOverlay");
1309
+ function i(a) {
1310
+ a.target === a.currentTarget && (a.preventDefault(), a.stopPropagation(), o.close());
890
1311
  }
891
1312
  return () => {
892
- let { ...o } = e;
893
- return F({ ourProps: { id: l, "aria-hidden": !0, onClick: i }, theirProps: o, slot: { open: a.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogOverlay" });
1313
+ let { ...a } = e;
1314
+ return W({ ourProps: { id: r, "aria-hidden": !0, onClick: i }, theirProps: a, slot: { open: o.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogOverlay" });
894
1315
  };
895
1316
  } });
896
- T({ name: "DialogBackdrop", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: r }) {
897
- var l;
898
- let a = (l = e.id) != null ? l : `headlessui-dialog-backdrop-${Z()}`, i = ce("DialogBackdrop"), o = h(null);
899
- return r({ el: o, $el: o }), $(() => {
1317
+ I({ name: "DialogBackdrop", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: l }) {
1318
+ var r;
1319
+ let o = (r = e.id) != null ? r : `headlessui-dialog-backdrop-${ye()}`, i = Ge("DialogBackdrop"), a = $(null);
1320
+ return l({ el: a, $el: a }), V(() => {
900
1321
  if (i.panelRef.value === null) throw new Error("A <DialogBackdrop /> component is being used, but a <DialogPanel /> component is missing.");
901
1322
  }), () => {
902
- let { ...u } = e, d = { id: a, ref: o, "aria-hidden": !0 };
903
- return S(je, { force: !0 }, () => S(Lt, () => F({ ourProps: d, theirProps: { ...t, ...u }, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogBackdrop" })));
1323
+ let { ...c } = e, s = { id: o, ref: a, "aria-hidden": !0 };
1324
+ return N(wt, { force: !0 }, () => N(Ln, () => W({ ourProps: s, theirProps: { ...t, ...c }, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogBackdrop" })));
904
1325
  };
905
1326
  } });
906
- let An = T({ name: "DialogPanel", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n, expose: r }) {
907
- var l;
908
- let a = (l = e.id) != null ? l : `headlessui-dialog-panel-${Z()}`, i = ce("DialogPanel");
909
- r({ el: i.panelRef, $el: i.panelRef });
910
- function o(u) {
911
- u.stopPropagation();
1327
+ let An = I({ name: "DialogPanel", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n, expose: l }) {
1328
+ var r;
1329
+ let o = (r = e.id) != null ? r : `headlessui-dialog-panel-${ye()}`, i = Ge("DialogPanel");
1330
+ l({ el: i.panelRef, $el: i.panelRef });
1331
+ function a(c) {
1332
+ c.stopPropagation();
912
1333
  }
913
1334
  return () => {
914
- let { ...u } = e, d = { id: a, ref: i.panelRef, onClick: o };
915
- return F({ ourProps: d, theirProps: u, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogPanel" });
1335
+ let { ...c } = e, s = { id: o, ref: i.panelRef, onClick: a };
1336
+ return W({ ourProps: s, theirProps: c, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogPanel" });
916
1337
  };
917
- } }), Dn = T({ name: "DialogTitle", props: { as: { type: [Object, String], default: "h2" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
918
- var r;
919
- let l = (r = e.id) != null ? r : `headlessui-dialog-title-${Z()}`, a = ce("DialogTitle");
920
- return $(() => {
921
- a.setTitleId(l), k(() => a.setTitleId(null));
1338
+ } }), kn = I({ name: "DialogTitle", props: { as: { type: [Object, String], default: "h2" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
1339
+ var l;
1340
+ let r = (l = e.id) != null ? l : `headlessui-dialog-title-${ye()}`, o = Ge("DialogTitle");
1341
+ return V(() => {
1342
+ o.setTitleId(r), ae(() => o.setTitleId(null));
922
1343
  }), () => {
923
1344
  let { ...i } = e;
924
- return F({ ourProps: { id: l }, theirProps: i, slot: { open: a.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogTitle" });
1345
+ return W({ ourProps: { id: r }, theirProps: i, slot: { open: o.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogTitle" });
925
1346
  };
926
- } });
927
- function Cn(e) {
1347
+ } }), Pn = Symbol("LabelContext");
1348
+ function Dn() {
1349
+ let e = Y(Pn, null);
1350
+ if (e === null) {
1351
+ let t = new Error("You used a <Label /> component, but it is not inside a parent.");
1352
+ throw Error.captureStackTrace && Error.captureStackTrace(t, Dn), t;
1353
+ }
1354
+ return e;
1355
+ }
1356
+ function gr({ slot: e = {}, name: t = "Label", props: n = {} } = {}) {
1357
+ let l = $([]);
1358
+ function r(o) {
1359
+ return l.value.push(o), () => {
1360
+ let i = l.value.indexOf(o);
1361
+ i !== -1 && l.value.splice(i, 1);
1362
+ };
1363
+ }
1364
+ return ie(Pn, { register: r, slot: e, name: t, props: n }), b(() => l.value.length > 0 ? l.value.join(" ") : void 0);
1365
+ }
1366
+ let hr = I({ name: "Label", props: { as: { type: [Object, String], default: "label" }, passive: { type: [Boolean], default: !1 }, id: { type: String, default: null } }, setup(e, { slots: t, attrs: n }) {
1367
+ var l;
1368
+ let r = (l = e.id) != null ? l : `headlessui-label-${ye()}`, o = Dn();
1369
+ return V(() => ae(o.register(r))), () => {
1370
+ let { name: i = "Label", slot: a = {}, props: c = {} } = o, { passive: s, ...u } = e, d = { ...Object.entries(c).reduce((f, [v, p]) => Object.assign(f, { [v]: S(p) }), {}), id: r };
1371
+ return s && (delete d.onClick, delete d.htmlFor, delete u.onClick), W({ ourProps: d, theirProps: u, slot: a, attrs: n, slots: t, name: i });
1372
+ };
1373
+ } }), Rn = Symbol("GroupContext"), yr = I({ name: "SwitchGroup", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: n }) {
1374
+ let l = $(null), r = gr({ name: "SwitchLabel", props: { htmlFor: b(() => {
1375
+ var i;
1376
+ return (i = l.value) == null ? void 0 : i.id;
1377
+ }), onClick(i) {
1378
+ l.value && (i.currentTarget.tagName === "LABEL" && i.preventDefault(), l.value.click(), l.value.focus({ preventScroll: !0 }));
1379
+ } } }), o = On({ name: "SwitchDescription" });
1380
+ return ie(Rn, { switchRef: l, labelledby: r, describedby: o }), () => W({ theirProps: e, ourProps: {}, slot: {}, slots: t, attrs: n, name: "SwitchGroup" });
1381
+ } }), br = I({ name: "Switch", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "button" }, modelValue: { type: Boolean, default: void 0 }, defaultChecked: { type: Boolean, optional: !0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, value: { type: String, optional: !0 }, id: { type: String, default: null }, disabled: { type: Boolean, default: !1 }, tabIndex: { type: Number, default: 0 } }, inheritAttrs: !1, setup(e, { emit: t, attrs: n, slots: l, expose: r }) {
1382
+ var o;
1383
+ let i = (o = e.id) != null ? o : `headlessui-switch-${ye()}`, a = Y(Rn, null), [c, s] = Ol(b(() => e.modelValue), (g) => t("update:modelValue", g), b(() => e.defaultChecked));
1384
+ function u() {
1385
+ s(!c.value);
1386
+ }
1387
+ let d = $(null), f = a === null ? d : a.switchRef, v = Il(b(() => ({ as: e.as, type: n.type })), f);
1388
+ r({ el: f, $el: f });
1389
+ function p(g) {
1390
+ g.preventDefault(), u();
1391
+ }
1392
+ function m(g) {
1393
+ g.key === at.Space ? (g.preventDefault(), u()) : g.key === at.Enter && Kl(g.currentTarget);
1394
+ }
1395
+ function h(g) {
1396
+ g.preventDefault();
1397
+ }
1398
+ let y = b(() => {
1399
+ var g, w;
1400
+ return (w = (g = D(f)) == null ? void 0 : g.closest) == null ? void 0 : w.call(g, "form");
1401
+ });
1402
+ return V(() => {
1403
+ de([y], () => {
1404
+ if (!y.value || e.defaultChecked === void 0) return;
1405
+ function g() {
1406
+ s(e.defaultChecked);
1407
+ }
1408
+ return y.value.addEventListener("reset", g), () => {
1409
+ var w;
1410
+ (w = y.value) == null || w.removeEventListener("reset", g);
1411
+ };
1412
+ }, { immediate: !0 });
1413
+ }), () => {
1414
+ let { name: g, value: w, form: T, tabIndex: L, ...P } = e, O = { checked: c.value }, R = { id: i, ref: f, role: "switch", type: v.value, tabIndex: L === -1 ? 0 : L, "aria-checked": c.value, "aria-labelledby": a == null ? void 0 : a.labelledby.value, "aria-describedby": a == null ? void 0 : a.describedby.value, onClick: p, onKeyup: m, onKeypress: h };
1415
+ return N(Le, [g != null && c.value != null ? N(it, Wl({ features: We.Hidden, as: "input", type: "checkbox", hidden: !0, readOnly: !0, checked: c.value, form: T, disabled: P.disabled, name: g, value: w })) : null, W({ ourProps: R, theirProps: { ...n, ...Pt(P, ["modelValue", "defaultChecked"]) }, slot: O, attrs: n, slots: l, name: "Switch" })]);
1416
+ };
1417
+ } }), wr = hr;
1418
+ function xr(e) {
928
1419
  let t = { called: !1 };
929
1420
  return (...n) => {
930
1421
  if (!t.called) return t.called = !0, e(...n);
931
1422
  };
932
1423
  }
933
- function Ce(e, ...t) {
1424
+ function ht(e, ...t) {
934
1425
  e && t.length > 0 && e.classList.add(...t);
935
1426
  }
936
- function we(e, ...t) {
1427
+ function et(e, ...t) {
937
1428
  e && t.length > 0 && e.classList.remove(...t);
938
1429
  }
939
- var Ue = ((e) => (e.Finished = "finished", e.Cancelled = "cancelled", e))(Ue || {});
940
- function kn(e, t) {
941
- let n = se();
1430
+ var Ot = ((e) => (e.Finished = "finished", e.Cancelled = "cancelled", e))(Ot || {});
1431
+ function $r(e, t) {
1432
+ let n = Ye();
942
1433
  if (!e) return n.dispose;
943
- let { transitionDuration: r, transitionDelay: l } = getComputedStyle(e), [a, i] = [r, l].map((o) => {
944
- let [u = 0] = o.split(",").filter(Boolean).map((d) => d.includes("ms") ? parseFloat(d) : parseFloat(d) * 1e3).sort((d, s) => s - d);
945
- return u;
1434
+ let { transitionDuration: l, transitionDelay: r } = getComputedStyle(e), [o, i] = [l, r].map((a) => {
1435
+ let [c = 0] = a.split(",").filter(Boolean).map((s) => s.includes("ms") ? parseFloat(s) : parseFloat(s) * 1e3).sort((s, u) => u - s);
1436
+ return c;
946
1437
  });
947
- return a !== 0 ? n.setTimeout(() => t("finished"), a + i) : t("finished"), n.add(() => t("cancelled")), n.dispose;
1438
+ return o !== 0 ? n.setTimeout(() => t("finished"), o + i) : t("finished"), n.add(() => t("cancelled")), n.dispose;
948
1439
  }
949
- function at(e, t, n, r, l, a) {
950
- let i = se(), o = a !== void 0 ? Cn(a) : () => {
1440
+ function _t(e, t, n, l, r, o) {
1441
+ let i = Ye(), a = o !== void 0 ? xr(o) : () => {
951
1442
  };
952
- return we(e, ...l), Ce(e, ...t, ...n), i.nextFrame(() => {
953
- we(e, ...n), Ce(e, ...r), i.add(kn(e, (u) => (we(e, ...r, ...t), Ce(e, ...l), o(u))));
954
- }), i.add(() => we(e, ...t, ...n, ...r, ...l)), i.add(() => o("cancelled")), i.dispose;
1443
+ return et(e, ...r), ht(e, ...t, ...n), i.nextFrame(() => {
1444
+ et(e, ...n), ht(e, ...l), i.add($r(e, (c) => (et(e, ...l, ...t), ht(e, ...r), a(c))));
1445
+ }), i.add(() => et(e, ...t, ...n, ...l, ...r)), i.add(() => a("cancelled")), i.dispose;
955
1446
  }
956
- function Y(e = "") {
1447
+ function Se(e = "") {
957
1448
  return e.split(/\s+/).filter((t) => t.length > 1);
958
1449
  }
959
- let Ke = Symbol("TransitionContext");
960
- var Bn = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Bn || {});
961
- function Nn() {
962
- return D(Ke, null) !== null;
1450
+ let Rt = Symbol("TransitionContext");
1451
+ var Sr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Sr || {});
1452
+ function Er() {
1453
+ return Y(Rt, null) !== null;
963
1454
  }
964
- function jn() {
965
- let e = D(Ke, null);
1455
+ function Or() {
1456
+ let e = Y(Rt, null);
966
1457
  if (e === null) throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");
967
1458
  return e;
968
1459
  }
969
- function Mn() {
970
- let e = D(Xe, null);
1460
+ function Lr() {
1461
+ let e = Y(Ft, null);
971
1462
  if (e === null) throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");
972
1463
  return e;
973
1464
  }
974
- let Xe = Symbol("NestingContext");
975
- function Te(e) {
976
- return "children" in e ? Te(e.children) : e.value.filter(({ state: t }) => t === "visible").length > 0;
977
- }
978
- function Ot(e) {
979
- let t = h([]), n = h(!1);
980
- $(() => n.value = !0), k(() => n.value = !1);
981
- function r(a, i = q.Hidden) {
982
- let o = t.value.findIndex(({ id: u }) => u === a);
983
- o !== -1 && (M(i, { [q.Unmount]() {
984
- t.value.splice(o, 1);
985
- }, [q.Hidden]() {
986
- t.value[o].state = "hidden";
987
- } }), !Te(t) && n.value && (e == null || e()));
988
- }
989
- function l(a) {
990
- let i = t.value.find(({ id: o }) => o === a);
991
- return i ? i.state !== "visible" && (i.state = "visible") : t.value.push({ id: a, state: "visible" }), () => r(a, q.Unmount);
992
- }
993
- return { children: t, register: l, unregister: r };
994
- }
995
- let Pt = $e.RenderStrategy, We = T({ props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: r, expose: l }) {
996
- let a = h(0);
1465
+ let Ft = Symbol("NestingContext");
1466
+ function ct(e) {
1467
+ return "children" in e ? ct(e.children) : e.value.filter(({ state: t }) => t === "visible").length > 0;
1468
+ }
1469
+ function Fn(e) {
1470
+ let t = $([]), n = $(!1);
1471
+ V(() => n.value = !0), ae(() => n.value = !1);
1472
+ function l(o, i = we.Hidden) {
1473
+ let a = t.value.findIndex(({ id: c }) => c === o);
1474
+ a !== -1 && (pe(i, { [we.Unmount]() {
1475
+ t.value.splice(a, 1);
1476
+ }, [we.Hidden]() {
1477
+ t.value[a].state = "hidden";
1478
+ } }), !ct(t) && n.value && (e == null || e()));
1479
+ }
1480
+ function r(o) {
1481
+ let i = t.value.find(({ id: a }) => a === o);
1482
+ return i ? i.state !== "visible" && (i.state = "visible") : t.value.push({ id: o, state: "visible" }), () => l(o, we.Unmount);
1483
+ }
1484
+ return { children: t, register: r, unregister: l };
1485
+ }
1486
+ let Bn = ot.RenderStrategy, Ue = I({ props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: l, expose: r }) {
1487
+ let o = $(0);
997
1488
  function i() {
998
- a.value |= P.Opening, t("beforeEnter");
1489
+ o.value |= Q.Opening, t("beforeEnter");
999
1490
  }
1000
- function o() {
1001
- a.value &= ~P.Opening, t("afterEnter");
1491
+ function a() {
1492
+ o.value &= ~Q.Opening, t("afterEnter");
1002
1493
  }
1003
- function u() {
1004
- a.value |= P.Closing, t("beforeLeave");
1494
+ function c() {
1495
+ o.value |= Q.Closing, t("beforeLeave");
1005
1496
  }
1006
- function d() {
1007
- a.value &= ~P.Closing, t("afterLeave");
1497
+ function s() {
1498
+ o.value &= ~Q.Closing, t("afterLeave");
1008
1499
  }
1009
- if (!Nn() && nn()) return () => S(Ft, { ...e, onBeforeEnter: i, onAfterEnter: o, onBeforeLeave: u, onAfterLeave: d }, r);
1010
- let s = h(null), f = m(() => e.unmount ? q.Unmount : q.Hidden);
1011
- l({ el: s, $el: s });
1012
- let { show: c, appear: p } = jn(), { register: v, unregister: g } = Mn(), b = h(c.value ? "visible" : "hidden"), B = { value: !0 }, O = Z(), z = { value: !1 }, fe = Ot(() => {
1013
- !z.value && b.value !== "hidden" && (b.value = "hidden", g(O), d());
1500
+ if (!Er() && zl()) return () => N(Bt, { ...e, onBeforeEnter: i, onAfterEnter: a, onBeforeLeave: c, onAfterLeave: s }, l);
1501
+ let u = $(null), d = b(() => e.unmount ? we.Unmount : we.Hidden);
1502
+ r({ el: u, $el: u });
1503
+ let { show: f, appear: v } = Or(), { register: p, unregister: m } = Lr(), h = $(f.value ? "visible" : "hidden"), y = { value: !0 }, g = ye(), w = { value: !1 }, T = Fn(() => {
1504
+ !w.value && h.value !== "hidden" && (h.value = "hidden", m(g), s());
1014
1505
  });
1015
- $(() => {
1016
- let N = v(O);
1017
- k(N);
1018
- }), C(() => {
1019
- if (f.value === q.Hidden && O) {
1020
- if (c.value && b.value !== "visible") {
1021
- b.value = "visible";
1506
+ V(() => {
1507
+ let j = p(g);
1508
+ ae(j);
1509
+ }), te(() => {
1510
+ if (d.value === we.Hidden && g) {
1511
+ if (f.value && h.value !== "visible") {
1512
+ h.value = "visible";
1022
1513
  return;
1023
1514
  }
1024
- M(b.value, { hidden: () => g(O), visible: () => v(O) });
1515
+ pe(h.value, { hidden: () => m(g), visible: () => p(g) });
1025
1516
  }
1026
1517
  });
1027
- let ve = Y(e.enter), J = Y(e.enterFrom), pe = Y(e.enterTo), me = Y(e.entered), Oe = Y(e.leave), ge = Y(e.leaveFrom), Pe = Y(e.leaveTo);
1028
- $(() => {
1029
- C(() => {
1030
- if (b.value === "visible") {
1031
- let N = E(s);
1032
- if (N instanceof Comment && N.data === "") throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1518
+ let L = Se(e.enter), P = Se(e.enterFrom), O = Se(e.enterTo), R = Se(e.entered), U = Se(e.leave), F = Se(e.leaveFrom), z = Se(e.leaveTo);
1519
+ V(() => {
1520
+ te(() => {
1521
+ if (h.value === "visible") {
1522
+ let j = D(u);
1523
+ if (j instanceof Comment && j.data === "") throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1033
1524
  }
1034
1525
  });
1035
1526
  });
1036
- function Fe(N) {
1037
- let le = B.value && !p.value, R = E(s);
1038
- !R || !(R instanceof HTMLElement) || le || (z.value = !0, c.value && i(), c.value || u(), N(c.value ? at(R, ve, J, pe, me, (H) => {
1039
- z.value = !1, H === Ue.Finished && o();
1040
- }) : at(R, Oe, ge, Pe, me, (H) => {
1041
- z.value = !1, H === Ue.Finished && (Te(fe) || (b.value = "hidden", g(O), d()));
1527
+ function K(j) {
1528
+ let G = y.value && !v.value, X = D(u);
1529
+ !X || !(X instanceof HTMLElement) || G || (w.value = !0, f.value && i(), f.value || c(), j(f.value ? _t(X, L, P, O, R, (Z) => {
1530
+ w.value = !1, Z === Ot.Finished && a();
1531
+ }) : _t(X, U, F, z, R, (Z) => {
1532
+ w.value = !1, Z === Ot.Finished && (ct(T) || (h.value = "hidden", m(g), s()));
1042
1533
  })));
1043
1534
  }
1044
- return $(() => {
1045
- ne([c], (N, le, R) => {
1046
- Fe(R), B.value = !1;
1535
+ return V(() => {
1536
+ de([f], (j, G, X) => {
1537
+ K(X), y.value = !1;
1047
1538
  }, { immediate: !0 });
1048
- }), j(Xe, fe), rn(m(() => M(b.value, { visible: P.Open, hidden: P.Closed }) | a.value)), () => {
1049
- let { appear: N, show: le, enter: R, enterFrom: H, enterTo: _, entered: Qe, leave: Ze, leaveFrom: Je, leaveTo: y, ...w } = e, x = { ref: s }, A = { ...w, ...p.value && c.value && de.isServer ? { class: ue([n.class, w.class, ...ve, ...J]) } : {} };
1050
- return F({ theirProps: A, ourProps: x, slot: {}, slots: r, attrs: n, features: Pt, visible: b.value === "visible", name: "TransitionChild" });
1539
+ }), ie(Ft, T), ql(b(() => pe(h.value, { visible: Q.Open, hidden: Q.Closed }) | o.value)), () => {
1540
+ let { appear: j, show: G, enter: X, enterFrom: Z, enterTo: ce, entered: zt, leave: qt, leaveFrom: Yt, leaveTo: A, ...B } = e, ne = { ref: u }, le = { ...B, ...v.value && f.value && Ke.isServer ? { class: q([n.class, B.class, ...L, ...P]) } : {} };
1541
+ return W({ theirProps: le, ourProps: ne, slot: {}, slots: l, attrs: n, features: Bn, visible: h.value === "visible", name: "TransitionChild" });
1051
1542
  };
1052
- } }), Rn = We, Ft = T({ inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: r }) {
1053
- let l = Ye(), a = m(() => e.show === null && l !== null ? (l.value & P.Open) === P.Open : e.show);
1054
- C(() => {
1055
- if (![!0, !1].includes(a.value)) throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.');
1543
+ } }), Tr = Ue, Bt = I({ inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: l }) {
1544
+ let r = Dt(), o = b(() => e.show === null && r !== null ? (r.value & Q.Open) === Q.Open : e.show);
1545
+ te(() => {
1546
+ if (![!0, !1].includes(o.value)) throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.');
1056
1547
  });
1057
- let i = h(a.value ? "visible" : "hidden"), o = Ot(() => {
1548
+ let i = $(o.value ? "visible" : "hidden"), a = Fn(() => {
1058
1549
  i.value = "hidden";
1059
- }), u = h(!0), d = { show: a, appear: m(() => e.appear || !u.value) };
1060
- return $(() => {
1061
- C(() => {
1062
- u.value = !1, a.value ? i.value = "visible" : Te(o) || (i.value = "hidden");
1550
+ }), c = $(!0), s = { show: o, appear: b(() => e.appear || !c.value) };
1551
+ return V(() => {
1552
+ te(() => {
1553
+ c.value = !1, o.value ? i.value = "visible" : ct(a) || (i.value = "hidden");
1063
1554
  });
1064
- }), j(Xe, o), j(Ke, d), () => {
1065
- let s = pt(e, ["show", "appear", "unmount", "onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave"]), f = { unmount: e.unmount };
1066
- return F({ ourProps: { ...f, as: "template" }, theirProps: {}, slot: {}, slots: { ...r, default: () => [S(Rn, { onBeforeEnter: () => t("beforeEnter"), onAfterEnter: () => t("afterEnter"), onBeforeLeave: () => t("beforeLeave"), onAfterLeave: () => t("afterLeave"), ...n, ...f, ...s }, r.default)] }, attrs: {}, features: Pt, visible: i.value === "visible", name: "Transition" });
1555
+ }), ie(Ft, a), ie(Rt, s), () => {
1556
+ let u = Pt(e, ["show", "appear", "unmount", "onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave"]), d = { unmount: e.unmount };
1557
+ return W({ ourProps: { ...d, as: "template" }, theirProps: {}, slot: {}, slots: { ...l, default: () => [N(Tr, { onBeforeEnter: () => t("beforeEnter"), onAfterEnter: () => t("afterEnter"), onBeforeLeave: () => t("beforeLeave"), onAfterLeave: () => t("afterLeave"), ...n, ...d, ...u }, l.default)] }, attrs: {}, features: Bn, visible: i.value === "visible", name: "Transition" });
1067
1558
  };
1068
1559
  } });
1069
- function Hn(e, t) {
1070
- return U(), ze("svg", {
1071
- xmlns: "http://www.w3.org/2000/svg",
1072
- viewBox: "0 0 24 24",
1073
- fill: "currentColor",
1074
- "aria-hidden": "true",
1075
- "data-slot": "icon"
1076
- }, [
1077
- L("path", {
1078
- "fill-rule": "evenodd",
1079
- d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
1080
- "clip-rule": "evenodd"
1081
- })
1082
- ]);
1560
+ function Mn(e) {
1561
+ const t = $(null), n = $(!1), l = b(() => e.as === "form"), r = b(() => `${e.id}-title`), o = b(() => `${e.id}-content`), i = b(() => {
1562
+ var a;
1563
+ return (a = t.value) == null ? void 0 : a.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
1564
+ });
1565
+ return {
1566
+ contentRef: t,
1567
+ ready: n,
1568
+ isForm: l,
1569
+ titleId: r,
1570
+ descriptionId: o,
1571
+ initialFocusElement: i
1572
+ };
1083
1573
  }
1084
- const In = {
1574
+ const Cr = {
1085
1575
  class: "rvc-fixed rvc-inset-0 rvc-overflow-hidden",
1086
1576
  role: "presentation"
1087
- }, Un = { class: "rvc-absolute rvc-inset-0 rvc-overflow-hidden" }, Wn = { class: "rvc-pointer-events-none rvc-fixed rvc-inset-y-0 rvc-right-0 rvc-flex rvc-max-w-full rvc-pl-10" }, Vn = { class: "rvc-flex rvc-h-full rvc-flex-col rvc-shadow-xl" }, qn = { class: "rvc-flex rvc-items-center rvc-justify-between" }, zn = {
1577
+ }, Ar = { class: "rvc-absolute rvc-inset-0 rvc-overflow-hidden" }, kr = { class: "rvc-pointer-events-none rvc-fixed rvc-inset-y-0 rvc-right-0 rvc-flex rvc-max-w-full rvc-pl-10" }, Pr = { class: "rvc-flex rvc-h-full rvc-flex-col rvc-shadow-xl" }, Dr = { class: "rvc-flex rvc-items-center rvc-justify-between" }, Rr = {
1088
1578
  key: 0,
1089
1579
  class: "rvc-ml-3 rvc-flex rvc-h-7 rvc-items-center"
1090
- }, Gn = ["id"], Yn = { class: "rvc-flex rvc-shrink-0 drawer-footer" }, Zn = {
1580
+ }, Fr = ["id"], Br = { class: "rvc-flex rvc-shrink-0 rvc-drawer-footer" }, Ho = {
1091
1581
  __name: "Drawer",
1092
1582
  props: {
1093
1583
  as: {
@@ -1127,27 +1617,31 @@ const In = {
1127
1617
  default: "rvc-max-w-xl"
1128
1618
  }
1129
1619
  },
1130
- emits: ["drawer:open", "drawer:close", "drawer:save"],
1620
+ emits: ["drawer:open", "drawer:close", "drawer:save", "drawer:closed"],
1131
1621
  setup(e, { emit: t }) {
1132
- const n = t, r = e, l = h(null), a = h(!1), i = m(() => r.as === "form"), o = m(() => `${r.id}-title`), u = m(() => `${r.id}-content`), d = m(() => {
1133
- var s;
1134
- return (s = l.value) == null ? void 0 : s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
1135
- });
1136
- return (s, f) => (U(), ee(I(Ft), { as: "template" }, {
1137
- default: W(() => [
1138
- G(I(xn), {
1622
+ const n = t, l = e, {
1623
+ contentRef: r,
1624
+ ready: o,
1625
+ isForm: i,
1626
+ titleId: a,
1627
+ descriptionId: c,
1628
+ initialFocusElement: s
1629
+ } = Mn(l);
1630
+ return (u, d) => (E(), oe(S(Bt), { as: "template" }, {
1631
+ default: H(() => [
1632
+ M(S(Cn), {
1139
1633
  as: e.as,
1140
- class: "drawer",
1634
+ class: "rvc-drawer",
1141
1635
  static: "",
1142
1636
  "aria-modal": "true",
1143
1637
  role: "dialog",
1144
- "initial-focus": d.value,
1145
- "aria-labelledby": o.value,
1146
- onClose: f[5] || (f[5] = (c) => s.$emit("drawer:close")),
1147
- onSubmit: f[6] || (f[6] = jt((c) => n("drawer:save", c), ["prevent"]))
1638
+ "initial-focus": S(s),
1639
+ "aria-labelledby": S(a),
1640
+ onClose: d[5] || (d[5] = (f) => u.$emit("drawer:close")),
1641
+ onSubmit: d[6] || (d[6] = un((f) => n("drawer:save", f), ["prevent"]))
1148
1642
  }, {
1149
- default: W(() => [
1150
- G(I(We), {
1643
+ default: H(() => [
1644
+ M(S(Ue), {
1151
1645
  as: "template",
1152
1646
  enter: "rvc-ease-in-out rvc-duration-500",
1153
1647
  "enter-from": "rvc-opacity-0",
@@ -1155,20 +1649,20 @@ const In = {
1155
1649
  leave: "rvc-ease-in-out rvc-duration-500",
1156
1650
  "leave-from": "rvc-opacity-100",
1157
1651
  "leave-to": "rvc-opacity-0",
1158
- onBeforeEnter: f[0] || (f[0] = (c) => n("drawer:open"))
1652
+ onBeforeEnter: d[0] || (d[0] = (f) => n("drawer:open"))
1159
1653
  }, {
1160
- default: W(() => f[7] || (f[7] = [
1161
- L("div", {
1162
- class: "rvc-fixed rvc-inset-0 rvc-transition-opacity drawer-backdrop",
1654
+ default: H(() => d[7] || (d[7] = [
1655
+ x("div", {
1656
+ class: "rvc-fixed rvc-inset-0 rvc-transition-opacity rvc-drawer-backdrop",
1163
1657
  "aria-hidden": "true"
1164
1658
  }, null, -1)
1165
1659
  ])),
1166
1660
  _: 1
1167
1661
  }),
1168
- L("div", In, [
1169
- L("div", Un, [
1170
- L("div", Wn, [
1171
- G(I(We), {
1662
+ x("div", Cr, [
1663
+ x("div", Ar, [
1664
+ x("div", kr, [
1665
+ M(S(Ue), {
1172
1666
  as: "template",
1173
1667
  enter: "rvc-transform rvc-transition rvc-ease-in-out rvc-duration-500 sm:rvc-duration-700",
1174
1668
  "enter-from": "rvc-translate-x-full",
@@ -1176,77 +1670,77 @@ const In = {
1176
1670
  leave: "rvc-transform rvc-transition rvc-ease-in-out rvc-duration-500 sm:rvc-duration-700",
1177
1671
  "leave-from": "rvc-translate-x-0",
1178
1672
  "leave-to": "rvc-translate-x-full",
1179
- onBeforeEnter: f[3] || (f[3] = (c) => a.value = !0),
1180
- onAfterLeave: f[4] || (f[4] = (c) => a.value = !1)
1673
+ onBeforeEnter: d[3] || (d[3] = (f) => o.value = !0),
1674
+ onAfterLeave: d[4] || (d[4] = (f) => (o.value = !1, n("drawer:closed")))
1181
1675
  }, {
1182
- default: W(() => [
1183
- G(I(An), {
1184
- class: ue(["rvc-pointer-events-auto rvc-w-screen", e.panelClass]),
1676
+ default: H(() => [
1677
+ M(S(An), {
1678
+ class: q(["rvc-pointer-events-auto rvc-w-screen", e.panelClass]),
1185
1679
  "aria-busy": e.spinning,
1186
- "aria-describedby": u.value
1680
+ "aria-describedby": S(c)
1187
1681
  }, {
1188
- default: W(() => [
1189
- L("div", Vn, [
1190
- L("header", {
1191
- class: ue([{ "rvc-sticky rvc-top-0 rvc-left-0 rvc-w-full rvc-z-10": e.headerSticky }, "drawer-header"])
1682
+ default: H(() => [
1683
+ x("div", Pr, [
1684
+ x("header", {
1685
+ class: q([{ "rvc-sticky rvc-top-0 rvc-left-0 rvc-w-full rvc-z-10": e.headerSticky }, "rvc-drawer-header"])
1192
1686
  }, [
1193
- te(s.$slots, "header", {
1687
+ C(u.$slots, "header", {
1194
1688
  title: e.title,
1195
1689
  showClose: e.showClose
1196
1690
  }, () => [
1197
- L("div", qn, [
1198
- G(I(Dn), {
1199
- id: o.value,
1200
- class: "drawer-title"
1691
+ x("div", Dr, [
1692
+ M(S(kn), {
1693
+ id: S(a),
1694
+ class: "rvc-drawer-title"
1201
1695
  }, {
1202
- default: W(() => [
1203
- Ve(qe(e.title), 1)
1696
+ default: H(() => [
1697
+ he(re(e.title), 1)
1204
1698
  ]),
1205
1699
  _: 1
1206
1700
  }, 8, ["id"]),
1207
- e.showClose ? (U(), ze("div", zn, [
1208
- L("button", {
1701
+ e.showClose ? (E(), k("div", Rr, [
1702
+ x("button", {
1209
1703
  type: "button",
1210
- class: "rvc-relative drawer-close",
1704
+ class: "rvc-relative rvc-drawer-close",
1211
1705
  "aria-label": "Close panel",
1212
- onClick: f[1] || (f[1] = (c) => n("drawer:close"))
1706
+ onClick: d[1] || (d[1] = (f) => n("drawer:close"))
1213
1707
  }, [
1214
- G(I(Hn), {
1708
+ M(S(At), {
1215
1709
  class: "rvc-size-full",
1216
1710
  "aria-hidden": "true"
1217
1711
  })
1218
1712
  ])
1219
- ])) : Se("", !0)
1713
+ ])) : _("", !0)
1220
1714
  ])
1221
1715
  ])
1222
1716
  ], 2),
1223
- L("div", {
1224
- class: ue([e.scrolledDown ? "rvc-flex-col-reverse" : "rvc-flex-col", "rvc-flex rvc-min-h-0 rvc-flex-1 rvc-overflow-y-scroll"])
1717
+ x("div", {
1718
+ class: q([e.scrolledDown ? "rvc-flex-col-reverse" : "rvc-flex-col", "rvc-flex rvc-min-h-0 rvc-flex-1 rvc-overflow-y-scroll"])
1225
1719
  }, [
1226
- L("div", {
1227
- id: u.value,
1720
+ x("div", {
1721
+ id: S(c),
1228
1722
  ref_key: "contentRef",
1229
- ref: l,
1230
- class: "rvc-relative rvc-flex-1 drawer-content"
1723
+ ref: r,
1724
+ class: "rvc-relative rvc-flex-1 rvc-drawer-content"
1231
1725
  }, [
1232
- te(s.$slots, "default", { ready: a.value })
1233
- ], 8, Gn)
1726
+ C(u.$slots, "default", { ready: S(o) })
1727
+ ], 8, Fr)
1234
1728
  ], 2),
1235
- L("footer", Yn, [
1236
- te(s.$slots, "footer", { loading: e.spinning }, () => [
1237
- G(et, {
1729
+ x("footer", Br, [
1730
+ C(u.$slots, "footer", { loading: e.spinning }, () => [
1731
+ M(rt, {
1238
1732
  type: "button",
1239
1733
  label: e.cancelLabel,
1240
1734
  color: "light",
1241
- onClick: f[2] || (f[2] = (c) => n("drawer:close"))
1735
+ onClick: d[2] || (d[2] = (f) => n("drawer:close"))
1242
1736
  }, null, 8, ["label"]),
1243
- i.value ? (U(), ee(et, {
1737
+ S(i) ? (E(), oe(rt, {
1244
1738
  key: 0,
1245
1739
  type: "submit",
1246
1740
  label: e.submitLabel,
1247
1741
  spinning: e.spinning,
1248
1742
  disabled: e.spinning
1249
- }, null, 8, ["label", "spinning", "disabled"])) : Se("", !0)
1743
+ }, null, 8, ["label", "spinning", "disabled"])) : _("", !0)
1250
1744
  ])
1251
1745
  ])
1252
1746
  ])
@@ -1266,9 +1760,1431 @@ const In = {
1266
1760
  _: 3
1267
1761
  }));
1268
1762
  }
1763
+ }, Vo = /* @__PURE__ */ Object.assign({
1764
+ inheritAttrs: !1
1765
+ }, {
1766
+ __name: "Lightswitch",
1767
+ props: {
1768
+ modelValue: {
1769
+ type: Boolean,
1770
+ default: !1
1771
+ }
1772
+ },
1773
+ emits: ["update:modelValue"],
1774
+ setup(e, { emit: t }) {
1775
+ const n = e, l = t, r = b({
1776
+ get: () => n.modelValue,
1777
+ set: (o) => l("update:modelValue", o)
1778
+ });
1779
+ return (o, i) => (E(), oe(S(yr), {
1780
+ as: "div",
1781
+ class: "rvc-lightswitch-group"
1782
+ }, {
1783
+ default: H(() => [
1784
+ M(S(br), qe({
1785
+ modelValue: r.value,
1786
+ "onUpdate:modelValue": i[0] || (i[0] = (a) => r.value = a),
1787
+ class: [{ "rvc-lightswitch-enabled": r.value }, "rvc-lightswitch"]
1788
+ }, o.$attrs), {
1789
+ default: H(() => [
1790
+ x("span", {
1791
+ class: q([{ "rvc-translate-x-6": r.value }, "rvc-lightswitch-toggle"])
1792
+ }, null, 2)
1793
+ ]),
1794
+ _: 1
1795
+ }, 16, ["modelValue", "class"]),
1796
+ o.$slots.default ? (E(), oe(S(wr), { key: 0 }, {
1797
+ default: H(() => [
1798
+ C(o.$slots, "default")
1799
+ ]),
1800
+ _: 3
1801
+ })) : _("", !0)
1802
+ ]),
1803
+ _: 3
1804
+ }));
1805
+ }
1806
+ }), Mr = {
1807
+ role: "presentation",
1808
+ class: "rvc-fixed rvc-inset-0 rvc-z-10 rvc-w-screen rvc-overflow-y-auto"
1809
+ }, Nr = { class: "rvc-flex rvc-min-h-full rvc-justify-center rvc-p-4 rvc-items-center sm:rvc-p-0" }, jr = { class: "rvc-modal-header" }, Hr = { class: "rvc-flex rvc-items-center rvc-justify-between" }, Vr = {
1810
+ key: 0,
1811
+ class: "rvc-ml-3 rvc-flex rvc-h-7 rvc-items-center"
1812
+ }, Ir = ["id"], Wr = { class: "rvc-modal-footer" }, Io = {
1813
+ __name: "Modal",
1814
+ props: {
1815
+ as: {
1816
+ type: String,
1817
+ default: "div"
1818
+ },
1819
+ id: {
1820
+ type: String,
1821
+ required: !0
1822
+ },
1823
+ title: {
1824
+ type: String,
1825
+ required: !0
1826
+ },
1827
+ showClose: {
1828
+ type: Boolean
1829
+ },
1830
+ spinning: {
1831
+ type: Boolean
1832
+ },
1833
+ submitLabel: {
1834
+ type: String,
1835
+ default: "Confirm"
1836
+ },
1837
+ cancelLabel: {
1838
+ type: String,
1839
+ default: "Cancel"
1840
+ },
1841
+ panelClass: {
1842
+ type: String,
1843
+ default: "sm:rvc-max-w-lg"
1844
+ }
1845
+ },
1846
+ emits: ["modal:open", "modal:close", "modal:save", "modal:closed"],
1847
+ setup(e, { emit: t }) {
1848
+ const n = t, l = e, {
1849
+ contentRef: r,
1850
+ ready: o,
1851
+ isForm: i,
1852
+ titleId: a,
1853
+ descriptionId: c,
1854
+ initialFocusElement: s
1855
+ } = Mn(l);
1856
+ return (u, d) => (E(), oe(S(Bt), { as: "template" }, {
1857
+ default: H(() => [
1858
+ M(S(Cn), {
1859
+ as: e.as,
1860
+ class: "rvc-modal",
1861
+ static: "",
1862
+ "aria-modal": "true",
1863
+ role: "dialog",
1864
+ "initial-focus": S(s),
1865
+ "aria-labelledby": S(a),
1866
+ onClose: d[6] || (d[6] = (f) => u.$emit("modal:close")),
1867
+ onSubmit: d[7] || (d[7] = un((f) => n("modal:save", f), ["prevent"]))
1868
+ }, {
1869
+ default: H(() => [
1870
+ M(S(Ue), {
1871
+ as: "template",
1872
+ enter: "rvc-ease-out rvc-duration-300",
1873
+ "enter-from": "rvc-opacity-0",
1874
+ "enter-to": "rvc-opacity-100",
1875
+ leave: "rvc-ease-in rvc-duration-200",
1876
+ "leave-from": "rvc-opacity-100",
1877
+ "leave-to": "rvc-opacity-0",
1878
+ onBeforeEnter: d[0] || (d[0] = (f) => n("modal:open"))
1879
+ }, {
1880
+ default: H(() => d[8] || (d[8] = [
1881
+ x("div", {
1882
+ "aria-hidden": "true",
1883
+ class: "rvc-fixed rvc-inset-0 rvc-transition-opacity rvc-modal-backdrop"
1884
+ }, null, -1)
1885
+ ])),
1886
+ _: 1
1887
+ }),
1888
+ x("div", Mr, [
1889
+ x("div", Nr, [
1890
+ M(S(Ue), {
1891
+ as: "template",
1892
+ enter: "rvc-ease-out rvc-duration-300",
1893
+ "enter-from": "rvc-opacity-0 rvc-translate-y-4 sm:rvc-translate-y-0 sm:rvc-scale-95",
1894
+ "enter-to": "rvc-opacity-100 rvc-translate-y-0 sm:rvc-scale-100",
1895
+ leave: "rvc-ease-in rvc-duration-200",
1896
+ "leave-from": "rvc-opacity-100 rvc-translate-y-0 sm:rvc-scale-100",
1897
+ "leave-to": "rvc-opacity-0 rvc-translate-y-4 sm:rvc-translate-y-0 sm:rvc-scale-95",
1898
+ onBeforeEnter: d[4] || (d[4] = (f) => o.value = !0),
1899
+ onAfterLeave: d[5] || (d[5] = (f) => (o.value = !1, n("modal:closed")))
1900
+ }, {
1901
+ default: H(() => [
1902
+ M(S(An), {
1903
+ class: q(["rvc-modal-panel", e.panelClass]),
1904
+ "aria-busy": e.spinning,
1905
+ "aria-describedby": S(c)
1906
+ }, {
1907
+ default: H(() => [
1908
+ x("header", jr, [
1909
+ C(u.$slots, "header", { title: e.title }, () => [
1910
+ x("div", Hr, [
1911
+ M(S(kn), {
1912
+ id: S(a),
1913
+ class: "rvc-modal-title"
1914
+ }, {
1915
+ default: H(() => [
1916
+ he(re(e.title), 1)
1917
+ ]),
1918
+ _: 1
1919
+ }, 8, ["id"]),
1920
+ e.showClose ? (E(), k("div", Vr, [
1921
+ x("button", {
1922
+ type: "button",
1923
+ class: "rvc-relative rvc-modal-close",
1924
+ "aria-label": "Close panel",
1925
+ onClick: d[1] || (d[1] = (f) => n("modal:close"))
1926
+ }, [
1927
+ M(S(At), {
1928
+ class: "rvc-size-full",
1929
+ "aria-hidden": "true"
1930
+ })
1931
+ ])
1932
+ ])) : _("", !0)
1933
+ ])
1934
+ ])
1935
+ ]),
1936
+ x("div", {
1937
+ id: S(c),
1938
+ ref_key: "contentRef",
1939
+ ref: r,
1940
+ class: "rvc-modal-content"
1941
+ }, [
1942
+ C(u.$slots, "default", { ready: S(o) })
1943
+ ], 8, Ir),
1944
+ x("footer", Wr, [
1945
+ C(u.$slots, "footer", {}, () => [
1946
+ M(rt, {
1947
+ type: S(i) ? "submit" : "button",
1948
+ label: e.submitLabel,
1949
+ spinning: e.spinning,
1950
+ disabled: e.spinning,
1951
+ onClick: d[2] || (d[2] = (f) => !S(i) && u.$emit("modal:save"))
1952
+ }, null, 8, ["type", "label", "spinning", "disabled"]),
1953
+ M(rt, {
1954
+ type: "button",
1955
+ color: "light",
1956
+ label: e.cancelLabel,
1957
+ onClick: d[3] || (d[3] = (f) => u.$emit("modal:close"))
1958
+ }, null, 8, ["label"])
1959
+ ])
1960
+ ])
1961
+ ]),
1962
+ _: 3
1963
+ }, 8, ["class", "aria-busy", "aria-describedby"])
1964
+ ]),
1965
+ _: 3
1966
+ })
1967
+ ])
1968
+ ])
1969
+ ]),
1970
+ _: 3
1971
+ }, 8, ["as", "initial-focus", "aria-labelledby"])
1972
+ ]),
1973
+ _: 3
1974
+ }));
1975
+ }
1976
+ }, Ur = ["top", "right", "bottom", "left"], en = ["start", "end"], tn = /* @__PURE__ */ Ur.reduce((e, t) => e.concat(t, t + "-" + en[0], t + "-" + en[1]), []), xe = Math.min, J = Math.max, st = Math.round, tt = Math.floor, fe = (e) => ({
1977
+ x: e,
1978
+ y: e
1979
+ }), zr = {
1980
+ left: "right",
1981
+ right: "left",
1982
+ bottom: "top",
1983
+ top: "bottom"
1984
+ }, qr = {
1985
+ start: "end",
1986
+ end: "start"
1987
+ };
1988
+ function Lt(e, t, n) {
1989
+ return J(e, xe(t, n));
1990
+ }
1991
+ function Me(e, t) {
1992
+ return typeof e == "function" ? e(t) : e;
1993
+ }
1994
+ function Ae(e) {
1995
+ return e.split("-")[0];
1996
+ }
1997
+ function ve(e) {
1998
+ return e.split("-")[1];
1999
+ }
2000
+ function Nn(e) {
2001
+ return e === "x" ? "y" : "x";
2002
+ }
2003
+ function Mt(e) {
2004
+ return e === "y" ? "height" : "width";
2005
+ }
2006
+ function Xe(e) {
2007
+ return ["top", "bottom"].includes(Ae(e)) ? "y" : "x";
2008
+ }
2009
+ function Nt(e) {
2010
+ return Nn(Xe(e));
2011
+ }
2012
+ function Yr(e, t, n) {
2013
+ n === void 0 && (n = !1);
2014
+ const l = ve(e), r = Nt(e), o = Mt(r);
2015
+ let i = r === "x" ? l === (n ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
2016
+ return t.reference[o] > t.floating[o] && (i = nn(i)), [i, nn(i)];
2017
+ }
2018
+ function Kr(e) {
2019
+ return e.replace(/start|end/g, (t) => qr[t]);
2020
+ }
2021
+ function nn(e) {
2022
+ return e.replace(/left|right|bottom|top/g, (t) => zr[t]);
2023
+ }
2024
+ function Gr(e) {
2025
+ return {
2026
+ top: 0,
2027
+ right: 0,
2028
+ bottom: 0,
2029
+ left: 0,
2030
+ ...e
2031
+ };
2032
+ }
2033
+ function jn(e) {
2034
+ return typeof e != "number" ? Gr(e) : {
2035
+ top: e,
2036
+ right: e,
2037
+ bottom: e,
2038
+ left: e
2039
+ };
2040
+ }
2041
+ function ut(e) {
2042
+ const {
2043
+ x: t,
2044
+ y: n,
2045
+ width: l,
2046
+ height: r
2047
+ } = e;
2048
+ return {
2049
+ width: l,
2050
+ height: r,
2051
+ top: n,
2052
+ left: t,
2053
+ right: t + l,
2054
+ bottom: n + r,
2055
+ x: t,
2056
+ y: n
2057
+ };
2058
+ }
2059
+ function ln(e, t, n) {
2060
+ let {
2061
+ reference: l,
2062
+ floating: r
2063
+ } = e;
2064
+ const o = Xe(t), i = Nt(t), a = Mt(i), c = Ae(t), s = o === "y", u = l.x + l.width / 2 - r.width / 2, d = l.y + l.height / 2 - r.height / 2, f = l[a] / 2 - r[a] / 2;
2065
+ let v;
2066
+ switch (c) {
2067
+ case "top":
2068
+ v = {
2069
+ x: u,
2070
+ y: l.y - r.height
2071
+ };
2072
+ break;
2073
+ case "bottom":
2074
+ v = {
2075
+ x: u,
2076
+ y: l.y + l.height
2077
+ };
2078
+ break;
2079
+ case "right":
2080
+ v = {
2081
+ x: l.x + l.width,
2082
+ y: d
2083
+ };
2084
+ break;
2085
+ case "left":
2086
+ v = {
2087
+ x: l.x - r.width,
2088
+ y: d
2089
+ };
2090
+ break;
2091
+ default:
2092
+ v = {
2093
+ x: l.x,
2094
+ y: l.y
2095
+ };
2096
+ }
2097
+ switch (ve(t)) {
2098
+ case "start":
2099
+ v[i] -= f * (n && s ? -1 : 1);
2100
+ break;
2101
+ case "end":
2102
+ v[i] += f * (n && s ? -1 : 1);
2103
+ break;
2104
+ }
2105
+ return v;
2106
+ }
2107
+ const Xr = async (e, t, n) => {
2108
+ const {
2109
+ placement: l = "bottom",
2110
+ strategy: r = "absolute",
2111
+ middleware: o = [],
2112
+ platform: i
2113
+ } = n, a = o.filter(Boolean), c = await (i.isRTL == null ? void 0 : i.isRTL(t));
2114
+ let s = await i.getElementRects({
2115
+ reference: e,
2116
+ floating: t,
2117
+ strategy: r
2118
+ }), {
2119
+ x: u,
2120
+ y: d
2121
+ } = ln(s, l, c), f = l, v = {}, p = 0;
2122
+ for (let m = 0; m < a.length; m++) {
2123
+ const {
2124
+ name: h,
2125
+ fn: y
2126
+ } = a[m], {
2127
+ x: g,
2128
+ y: w,
2129
+ data: T,
2130
+ reset: L
2131
+ } = await y({
2132
+ x: u,
2133
+ y: d,
2134
+ initialPlacement: l,
2135
+ placement: f,
2136
+ strategy: r,
2137
+ middlewareData: v,
2138
+ rects: s,
2139
+ platform: i,
2140
+ elements: {
2141
+ reference: e,
2142
+ floating: t
2143
+ }
2144
+ });
2145
+ u = g ?? u, d = w ?? d, v = {
2146
+ ...v,
2147
+ [h]: {
2148
+ ...v[h],
2149
+ ...T
2150
+ }
2151
+ }, L && p <= 50 && (p++, typeof L == "object" && (L.placement && (f = L.placement), L.rects && (s = L.rects === !0 ? await i.getElementRects({
2152
+ reference: e,
2153
+ floating: t,
2154
+ strategy: r
2155
+ }) : L.rects), {
2156
+ x: u,
2157
+ y: d
2158
+ } = ln(s, f, c)), m = -1);
2159
+ }
2160
+ return {
2161
+ x: u,
2162
+ y: d,
2163
+ placement: f,
2164
+ strategy: r,
2165
+ middlewareData: v
2166
+ };
2167
+ };
2168
+ async function jt(e, t) {
2169
+ var n;
2170
+ t === void 0 && (t = {});
2171
+ const {
2172
+ x: l,
2173
+ y: r,
2174
+ platform: o,
2175
+ rects: i,
2176
+ elements: a,
2177
+ strategy: c
2178
+ } = e, {
2179
+ boundary: s = "clippingAncestors",
2180
+ rootBoundary: u = "viewport",
2181
+ elementContext: d = "floating",
2182
+ altBoundary: f = !1,
2183
+ padding: v = 0
2184
+ } = Me(t, e), p = jn(v), h = a[f ? d === "floating" ? "reference" : "floating" : d], y = ut(await o.getClippingRect({
2185
+ element: (n = await (o.isElement == null ? void 0 : o.isElement(h))) == null || n ? h : h.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
2186
+ boundary: s,
2187
+ rootBoundary: u,
2188
+ strategy: c
2189
+ })), g = d === "floating" ? {
2190
+ x: l,
2191
+ y: r,
2192
+ width: i.floating.width,
2193
+ height: i.floating.height
2194
+ } : i.reference, w = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), T = await (o.isElement == null ? void 0 : o.isElement(w)) ? await (o.getScale == null ? void 0 : o.getScale(w)) || {
2195
+ x: 1,
2196
+ y: 1
2197
+ } : {
2198
+ x: 1,
2199
+ y: 1
2200
+ }, L = ut(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
2201
+ elements: a,
2202
+ rect: g,
2203
+ offsetParent: w,
2204
+ strategy: c
2205
+ }) : g);
2206
+ return {
2207
+ top: (y.top - L.top + p.top) / T.y,
2208
+ bottom: (L.bottom - y.bottom + p.bottom) / T.y,
2209
+ left: (y.left - L.left + p.left) / T.x,
2210
+ right: (L.right - y.right + p.right) / T.x
2211
+ };
2212
+ }
2213
+ const Zr = (e) => ({
2214
+ name: "arrow",
2215
+ options: e,
2216
+ async fn(t) {
2217
+ const {
2218
+ x: n,
2219
+ y: l,
2220
+ placement: r,
2221
+ rects: o,
2222
+ platform: i,
2223
+ elements: a,
2224
+ middlewareData: c
2225
+ } = t, {
2226
+ element: s,
2227
+ padding: u = 0
2228
+ } = Me(e, t) || {};
2229
+ if (s == null)
2230
+ return {};
2231
+ const d = jn(u), f = {
2232
+ x: n,
2233
+ y: l
2234
+ }, v = Nt(r), p = Mt(v), m = await i.getDimensions(s), h = v === "y", y = h ? "top" : "left", g = h ? "bottom" : "right", w = h ? "clientHeight" : "clientWidth", T = o.reference[p] + o.reference[v] - f[v] - o.floating[p], L = f[v] - o.reference[v], P = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s));
2235
+ let O = P ? P[w] : 0;
2236
+ (!O || !await (i.isElement == null ? void 0 : i.isElement(P))) && (O = a.floating[w] || o.floating[p]);
2237
+ const R = T / 2 - L / 2, U = O / 2 - m[p] / 2 - 1, F = xe(d[y], U), z = xe(d[g], U), K = F, j = O - m[p] - z, G = O / 2 - m[p] / 2 + R, X = Lt(K, G, j), Z = !c.arrow && ve(r) != null && G !== X && o.reference[p] / 2 - (G < K ? F : z) - m[p] / 2 < 0, ce = Z ? G < K ? G - K : G - j : 0;
2238
+ return {
2239
+ [v]: f[v] + ce,
2240
+ data: {
2241
+ [v]: X,
2242
+ centerOffset: G - X - ce,
2243
+ ...Z && {
2244
+ alignmentOffset: ce
2245
+ }
2246
+ },
2247
+ reset: Z
2248
+ };
2249
+ }
2250
+ });
2251
+ function Qr(e, t, n) {
2252
+ return (e ? [...n.filter((r) => ve(r) === e), ...n.filter((r) => ve(r) !== e)] : n.filter((r) => Ae(r) === r)).filter((r) => e ? ve(r) === e || (t ? Kr(r) !== r : !1) : !0);
2253
+ }
2254
+ const Jr = function(e) {
2255
+ return e === void 0 && (e = {}), {
2256
+ name: "autoPlacement",
2257
+ options: e,
2258
+ async fn(t) {
2259
+ var n, l, r;
2260
+ const {
2261
+ rects: o,
2262
+ middlewareData: i,
2263
+ placement: a,
2264
+ platform: c,
2265
+ elements: s
2266
+ } = t, {
2267
+ crossAxis: u = !1,
2268
+ alignment: d,
2269
+ allowedPlacements: f = tn,
2270
+ autoAlignment: v = !0,
2271
+ ...p
2272
+ } = Me(e, t), m = d !== void 0 || f === tn ? Qr(d || null, v, f) : f, h = await jt(t, p), y = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, g = m[y];
2273
+ if (g == null)
2274
+ return {};
2275
+ const w = Yr(g, o, await (c.isRTL == null ? void 0 : c.isRTL(s.floating)));
2276
+ if (a !== g)
2277
+ return {
2278
+ reset: {
2279
+ placement: m[0]
2280
+ }
2281
+ };
2282
+ const T = [h[Ae(g)], h[w[0]], h[w[1]]], L = [...((l = i.autoPlacement) == null ? void 0 : l.overflows) || [], {
2283
+ placement: g,
2284
+ overflows: T
2285
+ }], P = m[y + 1];
2286
+ if (P)
2287
+ return {
2288
+ data: {
2289
+ index: y + 1,
2290
+ overflows: L
2291
+ },
2292
+ reset: {
2293
+ placement: P
2294
+ }
2295
+ };
2296
+ const O = L.map((F) => {
2297
+ const z = ve(F.placement);
2298
+ return [F.placement, z && u ? (
2299
+ // Check along the mainAxis and main crossAxis side.
2300
+ F.overflows.slice(0, 2).reduce((K, j) => K + j, 0)
2301
+ ) : (
2302
+ // Check only the mainAxis.
2303
+ F.overflows[0]
2304
+ ), F.overflows];
2305
+ }).sort((F, z) => F[1] - z[1]), U = ((r = O.filter((F) => F[2].slice(
2306
+ 0,
2307
+ // Aligned placements should not check their opposite crossAxis
2308
+ // side.
2309
+ ve(F[0]) ? 2 : 3
2310
+ ).every((z) => z <= 0))[0]) == null ? void 0 : r[0]) || O[0][0];
2311
+ return U !== a ? {
2312
+ data: {
2313
+ index: y + 1,
2314
+ overflows: L
2315
+ },
2316
+ reset: {
2317
+ placement: U
2318
+ }
2319
+ } : {};
2320
+ }
2321
+ };
2322
+ };
2323
+ async function _r(e, t) {
2324
+ const {
2325
+ placement: n,
2326
+ platform: l,
2327
+ elements: r
2328
+ } = e, o = await (l.isRTL == null ? void 0 : l.isRTL(r.floating)), i = Ae(n), a = ve(n), c = Xe(n) === "y", s = ["left", "top"].includes(i) ? -1 : 1, u = o && c ? -1 : 1, d = Me(t, e);
2329
+ let {
2330
+ mainAxis: f,
2331
+ crossAxis: v,
2332
+ alignmentAxis: p
2333
+ } = typeof d == "number" ? {
2334
+ mainAxis: d,
2335
+ crossAxis: 0,
2336
+ alignmentAxis: null
2337
+ } : {
2338
+ mainAxis: d.mainAxis || 0,
2339
+ crossAxis: d.crossAxis || 0,
2340
+ alignmentAxis: d.alignmentAxis
2341
+ };
2342
+ return a && typeof p == "number" && (v = a === "end" ? p * -1 : p), c ? {
2343
+ x: v * u,
2344
+ y: f * s
2345
+ } : {
2346
+ x: f * s,
2347
+ y: v * u
2348
+ };
2349
+ }
2350
+ const eo = function(e) {
2351
+ return e === void 0 && (e = 0), {
2352
+ name: "offset",
2353
+ options: e,
2354
+ async fn(t) {
2355
+ var n, l;
2356
+ const {
2357
+ x: r,
2358
+ y: o,
2359
+ placement: i,
2360
+ middlewareData: a
2361
+ } = t, c = await _r(t, e);
2362
+ return i === ((n = a.offset) == null ? void 0 : n.placement) && (l = a.arrow) != null && l.alignmentOffset ? {} : {
2363
+ x: r + c.x,
2364
+ y: o + c.y,
2365
+ data: {
2366
+ ...c,
2367
+ placement: i
2368
+ }
2369
+ };
2370
+ }
2371
+ };
2372
+ }, to = function(e) {
2373
+ return e === void 0 && (e = {}), {
2374
+ name: "shift",
2375
+ options: e,
2376
+ async fn(t) {
2377
+ const {
2378
+ x: n,
2379
+ y: l,
2380
+ placement: r
2381
+ } = t, {
2382
+ mainAxis: o = !0,
2383
+ crossAxis: i = !1,
2384
+ limiter: a = {
2385
+ fn: (h) => {
2386
+ let {
2387
+ x: y,
2388
+ y: g
2389
+ } = h;
2390
+ return {
2391
+ x: y,
2392
+ y: g
2393
+ };
2394
+ }
2395
+ },
2396
+ ...c
2397
+ } = Me(e, t), s = {
2398
+ x: n,
2399
+ y: l
2400
+ }, u = await jt(t, c), d = Xe(Ae(r)), f = Nn(d);
2401
+ let v = s[f], p = s[d];
2402
+ if (o) {
2403
+ const h = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", g = v + u[h], w = v - u[y];
2404
+ v = Lt(g, v, w);
2405
+ }
2406
+ if (i) {
2407
+ const h = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", g = p + u[h], w = p - u[y];
2408
+ p = Lt(g, p, w);
2409
+ }
2410
+ const m = a.fn({
2411
+ ...t,
2412
+ [f]: v,
2413
+ [d]: p
2414
+ });
2415
+ return {
2416
+ ...m,
2417
+ data: {
2418
+ x: m.x - n,
2419
+ y: m.y - l,
2420
+ enabled: {
2421
+ [f]: o,
2422
+ [d]: i
2423
+ }
2424
+ }
2425
+ };
2426
+ }
2427
+ };
2428
+ }, no = function(e) {
2429
+ return e === void 0 && (e = {}), {
2430
+ name: "size",
2431
+ options: e,
2432
+ async fn(t) {
2433
+ var n, l;
2434
+ const {
2435
+ placement: r,
2436
+ rects: o,
2437
+ platform: i,
2438
+ elements: a
2439
+ } = t, {
2440
+ apply: c = () => {
2441
+ },
2442
+ ...s
2443
+ } = Me(e, t), u = await jt(t, s), d = Ae(r), f = ve(r), v = Xe(r) === "y", {
2444
+ width: p,
2445
+ height: m
2446
+ } = o.floating;
2447
+ let h, y;
2448
+ d === "top" || d === "bottom" ? (h = d, y = f === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = d, h = f === "end" ? "top" : "bottom");
2449
+ const g = m - u.top - u.bottom, w = p - u.left - u.right, T = xe(m - u[h], g), L = xe(p - u[y], w), P = !t.middlewareData.shift;
2450
+ let O = T, R = L;
2451
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = w), (l = t.middlewareData.shift) != null && l.enabled.y && (O = g), P && !f) {
2452
+ const F = J(u.left, 0), z = J(u.right, 0), K = J(u.top, 0), j = J(u.bottom, 0);
2453
+ v ? R = p - 2 * (F !== 0 || z !== 0 ? F + z : J(u.left, u.right)) : O = m - 2 * (K !== 0 || j !== 0 ? K + j : J(u.top, u.bottom));
2454
+ }
2455
+ await c({
2456
+ ...t,
2457
+ availableWidth: R,
2458
+ availableHeight: O
2459
+ });
2460
+ const U = await i.getDimensions(a.floating);
2461
+ return p !== U.width || m !== U.height ? {
2462
+ reset: {
2463
+ rects: !0
2464
+ }
2465
+ } : {};
2466
+ }
2467
+ };
2468
+ };
2469
+ function dt() {
2470
+ return typeof window < "u";
2471
+ }
2472
+ function ke(e) {
2473
+ return Ht(e) ? (e.nodeName || "").toLowerCase() : "#document";
2474
+ }
2475
+ function ee(e) {
2476
+ var t;
2477
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
2478
+ }
2479
+ function ge(e) {
2480
+ var t;
2481
+ return (t = (Ht(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
2482
+ }
2483
+ function Ht(e) {
2484
+ return dt() ? e instanceof Node || e instanceof ee(e).Node : !1;
2485
+ }
2486
+ function se(e) {
2487
+ return dt() ? e instanceof Element || e instanceof ee(e).Element : !1;
2488
+ }
2489
+ function me(e) {
2490
+ return dt() ? e instanceof HTMLElement || e instanceof ee(e).HTMLElement : !1;
2491
+ }
2492
+ function rn(e) {
2493
+ return !dt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
2494
+ }
2495
+ function Ze(e) {
2496
+ const {
2497
+ overflow: t,
2498
+ overflowX: n,
2499
+ overflowY: l,
2500
+ display: r
2501
+ } = ue(e);
2502
+ return /auto|scroll|overlay|hidden|clip/.test(t + l + n) && !["inline", "contents"].includes(r);
2503
+ }
2504
+ function lo(e) {
2505
+ return ["table", "td", "th"].includes(ke(e));
2506
+ }
2507
+ function ft(e) {
2508
+ return [":popover-open", ":modal"].some((t) => {
2509
+ try {
2510
+ return e.matches(t);
2511
+ } catch {
2512
+ return !1;
2513
+ }
2514
+ });
2515
+ }
2516
+ function Vt(e) {
2517
+ const t = It(), n = se(e) ? ue(e) : e;
2518
+ return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((l) => (n.willChange || "").includes(l)) || ["paint", "layout", "strict", "content"].some((l) => (n.contain || "").includes(l));
2519
+ }
2520
+ function ro(e) {
2521
+ let t = $e(e);
2522
+ for (; me(t) && !Fe(t); ) {
2523
+ if (Vt(t))
2524
+ return t;
2525
+ if (ft(t))
2526
+ return null;
2527
+ t = $e(t);
2528
+ }
2529
+ return null;
2530
+ }
2531
+ function It() {
2532
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
2533
+ }
2534
+ function Fe(e) {
2535
+ return ["html", "body", "#document"].includes(ke(e));
2536
+ }
2537
+ function ue(e) {
2538
+ return ee(e).getComputedStyle(e);
2539
+ }
2540
+ function vt(e) {
2541
+ return se(e) ? {
2542
+ scrollLeft: e.scrollLeft,
2543
+ scrollTop: e.scrollTop
2544
+ } : {
2545
+ scrollLeft: e.scrollX,
2546
+ scrollTop: e.scrollY
2547
+ };
2548
+ }
2549
+ function $e(e) {
2550
+ if (ke(e) === "html")
2551
+ return e;
2552
+ const t = (
2553
+ // Step into the shadow DOM of the parent of a slotted node.
2554
+ e.assignedSlot || // DOM Element detected.
2555
+ e.parentNode || // ShadowRoot detected.
2556
+ rn(e) && e.host || // Fallback.
2557
+ ge(e)
2558
+ );
2559
+ return rn(t) ? t.host : t;
2560
+ }
2561
+ function Hn(e) {
2562
+ const t = $e(e);
2563
+ return Fe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : me(t) && Ze(t) ? t : Hn(t);
2564
+ }
2565
+ function ze(e, t, n) {
2566
+ var l;
2567
+ t === void 0 && (t = []), n === void 0 && (n = !0);
2568
+ const r = Hn(e), o = r === ((l = e.ownerDocument) == null ? void 0 : l.body), i = ee(r);
2569
+ if (o) {
2570
+ const a = Tt(i);
2571
+ return t.concat(i, i.visualViewport || [], Ze(r) ? r : [], a && n ? ze(a) : []);
2572
+ }
2573
+ return t.concat(r, ze(r, [], n));
2574
+ }
2575
+ function Tt(e) {
2576
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
2577
+ }
2578
+ function Vn(e) {
2579
+ const t = ue(e);
2580
+ let n = parseFloat(t.width) || 0, l = parseFloat(t.height) || 0;
2581
+ const r = me(e), o = r ? e.offsetWidth : n, i = r ? e.offsetHeight : l, a = st(n) !== o || st(l) !== i;
2582
+ return a && (n = o, l = i), {
2583
+ width: n,
2584
+ height: l,
2585
+ $: a
2586
+ };
2587
+ }
2588
+ function Wt(e) {
2589
+ return se(e) ? e : e.contextElement;
2590
+ }
2591
+ function Re(e) {
2592
+ const t = Wt(e);
2593
+ if (!me(t))
2594
+ return fe(1);
2595
+ const n = t.getBoundingClientRect(), {
2596
+ width: l,
2597
+ height: r,
2598
+ $: o
2599
+ } = Vn(t);
2600
+ let i = (o ? st(n.width) : n.width) / l, a = (o ? st(n.height) : n.height) / r;
2601
+ return (!i || !Number.isFinite(i)) && (i = 1), (!a || !Number.isFinite(a)) && (a = 1), {
2602
+ x: i,
2603
+ y: a
2604
+ };
2605
+ }
2606
+ const oo = /* @__PURE__ */ fe(0);
2607
+ function In(e) {
2608
+ const t = ee(e);
2609
+ return !It() || !t.visualViewport ? oo : {
2610
+ x: t.visualViewport.offsetLeft,
2611
+ y: t.visualViewport.offsetTop
2612
+ };
2613
+ }
2614
+ function io(e, t, n) {
2615
+ return t === void 0 && (t = !1), !n || t && n !== ee(e) ? !1 : t;
2616
+ }
2617
+ function Ce(e, t, n, l) {
2618
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
2619
+ const r = e.getBoundingClientRect(), o = Wt(e);
2620
+ let i = fe(1);
2621
+ t && (l ? se(l) && (i = Re(l)) : i = Re(e));
2622
+ const a = io(o, n, l) ? In(o) : fe(0);
2623
+ let c = (r.left + a.x) / i.x, s = (r.top + a.y) / i.y, u = r.width / i.x, d = r.height / i.y;
2624
+ if (o) {
2625
+ const f = ee(o), v = l && se(l) ? ee(l) : l;
2626
+ let p = f, m = Tt(p);
2627
+ for (; m && l && v !== p; ) {
2628
+ const h = Re(m), y = m.getBoundingClientRect(), g = ue(m), w = y.left + (m.clientLeft + parseFloat(g.paddingLeft)) * h.x, T = y.top + (m.clientTop + parseFloat(g.paddingTop)) * h.y;
2629
+ c *= h.x, s *= h.y, u *= h.x, d *= h.y, c += w, s += T, p = ee(m), m = Tt(p);
2630
+ }
2631
+ }
2632
+ return ut({
2633
+ width: u,
2634
+ height: d,
2635
+ x: c,
2636
+ y: s
2637
+ });
2638
+ }
2639
+ function Ut(e, t) {
2640
+ const n = vt(e).scrollLeft;
2641
+ return t ? t.left + n : Ce(ge(e)).left + n;
2642
+ }
2643
+ function Wn(e, t, n) {
2644
+ n === void 0 && (n = !1);
2645
+ const l = e.getBoundingClientRect(), r = l.left + t.scrollLeft - (n ? 0 : (
2646
+ // RTL <body> scrollbar.
2647
+ Ut(e, l)
2648
+ )), o = l.top + t.scrollTop;
2649
+ return {
2650
+ x: r,
2651
+ y: o
2652
+ };
2653
+ }
2654
+ function ao(e) {
2655
+ let {
2656
+ elements: t,
2657
+ rect: n,
2658
+ offsetParent: l,
2659
+ strategy: r
2660
+ } = e;
2661
+ const o = r === "fixed", i = ge(l), a = t ? ft(t.floating) : !1;
2662
+ if (l === i || a && o)
2663
+ return n;
2664
+ let c = {
2665
+ scrollLeft: 0,
2666
+ scrollTop: 0
2667
+ }, s = fe(1);
2668
+ const u = fe(0), d = me(l);
2669
+ if ((d || !d && !o) && ((ke(l) !== "body" || Ze(i)) && (c = vt(l)), me(l))) {
2670
+ const v = Ce(l);
2671
+ s = Re(l), u.x = v.x + l.clientLeft, u.y = v.y + l.clientTop;
2672
+ }
2673
+ const f = i && !d && !o ? Wn(i, c, !0) : fe(0);
2674
+ return {
2675
+ width: n.width * s.x,
2676
+ height: n.height * s.y,
2677
+ x: n.x * s.x - c.scrollLeft * s.x + u.x + f.x,
2678
+ y: n.y * s.y - c.scrollTop * s.y + u.y + f.y
2679
+ };
2680
+ }
2681
+ function so(e) {
2682
+ return Array.from(e.getClientRects());
2683
+ }
2684
+ function uo(e) {
2685
+ const t = ge(e), n = vt(e), l = e.ownerDocument.body, r = J(t.scrollWidth, t.clientWidth, l.scrollWidth, l.clientWidth), o = J(t.scrollHeight, t.clientHeight, l.scrollHeight, l.clientHeight);
2686
+ let i = -n.scrollLeft + Ut(e);
2687
+ const a = -n.scrollTop;
2688
+ return ue(l).direction === "rtl" && (i += J(t.clientWidth, l.clientWidth) - r), {
2689
+ width: r,
2690
+ height: o,
2691
+ x: i,
2692
+ y: a
2693
+ };
2694
+ }
2695
+ function co(e, t) {
2696
+ const n = ee(e), l = ge(e), r = n.visualViewport;
2697
+ let o = l.clientWidth, i = l.clientHeight, a = 0, c = 0;
2698
+ if (r) {
2699
+ o = r.width, i = r.height;
2700
+ const s = It();
2701
+ (!s || s && t === "fixed") && (a = r.offsetLeft, c = r.offsetTop);
2702
+ }
2703
+ return {
2704
+ width: o,
2705
+ height: i,
2706
+ x: a,
2707
+ y: c
2708
+ };
2709
+ }
2710
+ function fo(e, t) {
2711
+ const n = Ce(e, !0, t === "fixed"), l = n.top + e.clientTop, r = n.left + e.clientLeft, o = me(e) ? Re(e) : fe(1), i = e.clientWidth * o.x, a = e.clientHeight * o.y, c = r * o.x, s = l * o.y;
2712
+ return {
2713
+ width: i,
2714
+ height: a,
2715
+ x: c,
2716
+ y: s
2717
+ };
2718
+ }
2719
+ function on(e, t, n) {
2720
+ let l;
2721
+ if (t === "viewport")
2722
+ l = co(e, n);
2723
+ else if (t === "document")
2724
+ l = uo(ge(e));
2725
+ else if (se(t))
2726
+ l = fo(t, n);
2727
+ else {
2728
+ const r = In(e);
2729
+ l = {
2730
+ x: t.x - r.x,
2731
+ y: t.y - r.y,
2732
+ width: t.width,
2733
+ height: t.height
2734
+ };
2735
+ }
2736
+ return ut(l);
2737
+ }
2738
+ function Un(e, t) {
2739
+ const n = $e(e);
2740
+ return n === t || !se(n) || Fe(n) ? !1 : ue(n).position === "fixed" || Un(n, t);
2741
+ }
2742
+ function vo(e, t) {
2743
+ const n = t.get(e);
2744
+ if (n)
2745
+ return n;
2746
+ let l = ze(e, [], !1).filter((a) => se(a) && ke(a) !== "body"), r = null;
2747
+ const o = ue(e).position === "fixed";
2748
+ let i = o ? $e(e) : e;
2749
+ for (; se(i) && !Fe(i); ) {
2750
+ const a = ue(i), c = Vt(i);
2751
+ !c && a.position === "fixed" && (r = null), (o ? !c && !r : !c && a.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || Ze(i) && !c && Un(e, i)) ? l = l.filter((u) => u !== i) : r = a, i = $e(i);
2752
+ }
2753
+ return t.set(e, l), l;
2754
+ }
2755
+ function po(e) {
2756
+ let {
2757
+ element: t,
2758
+ boundary: n,
2759
+ rootBoundary: l,
2760
+ strategy: r
2761
+ } = e;
2762
+ const i = [...n === "clippingAncestors" ? ft(t) ? [] : vo(t, this._c) : [].concat(n), l], a = i[0], c = i.reduce((s, u) => {
2763
+ const d = on(t, u, r);
2764
+ return s.top = J(d.top, s.top), s.right = xe(d.right, s.right), s.bottom = xe(d.bottom, s.bottom), s.left = J(d.left, s.left), s;
2765
+ }, on(t, a, r));
2766
+ return {
2767
+ width: c.right - c.left,
2768
+ height: c.bottom - c.top,
2769
+ x: c.left,
2770
+ y: c.top
2771
+ };
2772
+ }
2773
+ function mo(e) {
2774
+ const {
2775
+ width: t,
2776
+ height: n
2777
+ } = Vn(e);
2778
+ return {
2779
+ width: t,
2780
+ height: n
2781
+ };
2782
+ }
2783
+ function go(e, t, n) {
2784
+ const l = me(t), r = ge(t), o = n === "fixed", i = Ce(e, !0, o, t);
2785
+ let a = {
2786
+ scrollLeft: 0,
2787
+ scrollTop: 0
2788
+ };
2789
+ const c = fe(0);
2790
+ if (l || !l && !o)
2791
+ if ((ke(t) !== "body" || Ze(r)) && (a = vt(t)), l) {
2792
+ const f = Ce(t, !0, o, t);
2793
+ c.x = f.x + t.clientLeft, c.y = f.y + t.clientTop;
2794
+ } else r && (c.x = Ut(r));
2795
+ const s = r && !l && !o ? Wn(r, a) : fe(0), u = i.left + a.scrollLeft - c.x - s.x, d = i.top + a.scrollTop - c.y - s.y;
2796
+ return {
2797
+ x: u,
2798
+ y: d,
2799
+ width: i.width,
2800
+ height: i.height
2801
+ };
2802
+ }
2803
+ function yt(e) {
2804
+ return ue(e).position === "static";
2805
+ }
2806
+ function an(e, t) {
2807
+ if (!me(e) || ue(e).position === "fixed")
2808
+ return null;
2809
+ if (t)
2810
+ return t(e);
2811
+ let n = e.offsetParent;
2812
+ return ge(e) === n && (n = n.ownerDocument.body), n;
2813
+ }
2814
+ function zn(e, t) {
2815
+ const n = ee(e);
2816
+ if (ft(e))
2817
+ return n;
2818
+ if (!me(e)) {
2819
+ let r = $e(e);
2820
+ for (; r && !Fe(r); ) {
2821
+ if (se(r) && !yt(r))
2822
+ return r;
2823
+ r = $e(r);
2824
+ }
2825
+ return n;
2826
+ }
2827
+ let l = an(e, t);
2828
+ for (; l && lo(l) && yt(l); )
2829
+ l = an(l, t);
2830
+ return l && Fe(l) && yt(l) && !Vt(l) ? n : l || ro(e) || n;
2831
+ }
2832
+ const ho = async function(e) {
2833
+ const t = this.getOffsetParent || zn, n = this.getDimensions, l = await n(e.floating);
2834
+ return {
2835
+ reference: go(e.reference, await t(e.floating), e.strategy),
2836
+ floating: {
2837
+ x: 0,
2838
+ y: 0,
2839
+ width: l.width,
2840
+ height: l.height
2841
+ }
2842
+ };
2843
+ };
2844
+ function yo(e) {
2845
+ return ue(e).direction === "rtl";
2846
+ }
2847
+ const bo = {
2848
+ convertOffsetParentRelativeRectToViewportRelativeRect: ao,
2849
+ getDocumentElement: ge,
2850
+ getClippingRect: po,
2851
+ getOffsetParent: zn,
2852
+ getElementRects: ho,
2853
+ getClientRects: so,
2854
+ getDimensions: mo,
2855
+ getScale: Re,
2856
+ isElement: se,
2857
+ isRTL: yo
2858
+ };
2859
+ function wo(e, t) {
2860
+ let n = null, l;
2861
+ const r = ge(e);
2862
+ function o() {
2863
+ var a;
2864
+ clearTimeout(l), (a = n) == null || a.disconnect(), n = null;
2865
+ }
2866
+ function i(a, c) {
2867
+ a === void 0 && (a = !1), c === void 0 && (c = 1), o();
2868
+ const {
2869
+ left: s,
2870
+ top: u,
2871
+ width: d,
2872
+ height: f
2873
+ } = e.getBoundingClientRect();
2874
+ if (a || t(), !d || !f)
2875
+ return;
2876
+ const v = tt(u), p = tt(r.clientWidth - (s + d)), m = tt(r.clientHeight - (u + f)), h = tt(s), g = {
2877
+ rootMargin: -v + "px " + -p + "px " + -m + "px " + -h + "px",
2878
+ threshold: J(0, xe(1, c)) || 1
2879
+ };
2880
+ let w = !0;
2881
+ function T(L) {
2882
+ const P = L[0].intersectionRatio;
2883
+ if (P !== c) {
2884
+ if (!w)
2885
+ return i();
2886
+ P ? i(!1, P) : l = setTimeout(() => {
2887
+ i(!1, 1e-7);
2888
+ }, 1e3);
2889
+ }
2890
+ w = !1;
2891
+ }
2892
+ try {
2893
+ n = new IntersectionObserver(T, {
2894
+ ...g,
2895
+ // Handle <iframe>s
2896
+ root: r.ownerDocument
2897
+ });
2898
+ } catch {
2899
+ n = new IntersectionObserver(T, g);
2900
+ }
2901
+ n.observe(e);
2902
+ }
2903
+ return i(!0), o;
2904
+ }
2905
+ function xo(e, t, n, l) {
2906
+ l === void 0 && (l = {});
2907
+ const {
2908
+ ancestorScroll: r = !0,
2909
+ ancestorResize: o = !0,
2910
+ elementResize: i = typeof ResizeObserver == "function",
2911
+ layoutShift: a = typeof IntersectionObserver == "function",
2912
+ animationFrame: c = !1
2913
+ } = l, s = Wt(e), u = r || o ? [...s ? ze(s) : [], ...ze(t)] : [];
2914
+ u.forEach((y) => {
2915
+ r && y.addEventListener("scroll", n, {
2916
+ passive: !0
2917
+ }), o && y.addEventListener("resize", n);
2918
+ });
2919
+ const d = s && a ? wo(s, n) : null;
2920
+ let f = -1, v = null;
2921
+ i && (v = new ResizeObserver((y) => {
2922
+ let [g] = y;
2923
+ g && g.target === s && v && (v.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
2924
+ var w;
2925
+ (w = v) == null || w.observe(t);
2926
+ })), n();
2927
+ }), s && !c && v.observe(s), v.observe(t));
2928
+ let p, m = c ? Ce(e) : null;
2929
+ c && h();
2930
+ function h() {
2931
+ const y = Ce(e);
2932
+ m && (y.x !== m.x || y.y !== m.y || y.width !== m.width || y.height !== m.height) && n(), m = y, p = requestAnimationFrame(h);
2933
+ }
2934
+ return n(), () => {
2935
+ var y;
2936
+ u.forEach((g) => {
2937
+ r && g.removeEventListener("scroll", n), o && g.removeEventListener("resize", n);
2938
+ }), d == null || d(), (y = v) == null || y.disconnect(), v = null, c && cancelAnimationFrame(p);
2939
+ };
2940
+ }
2941
+ const $o = eo, So = Jr, Eo = to, Oo = no, Lo = Zr, To = (e, t, n) => {
2942
+ const l = /* @__PURE__ */ new Map(), r = {
2943
+ platform: bo,
2944
+ ...n
2945
+ }, o = {
2946
+ ...r.platform,
2947
+ _c: l
2948
+ };
2949
+ return Xr(e, t, {
2950
+ ...r,
2951
+ platform: o
2952
+ });
2953
+ };
2954
+ function Co(e) {
2955
+ return e != null && typeof e == "object" && "$el" in e;
2956
+ }
2957
+ function Ct(e) {
2958
+ if (Co(e)) {
2959
+ const t = e.$el;
2960
+ return Ht(t) && ke(t) === "#comment" ? null : t;
2961
+ }
2962
+ return e;
2963
+ }
2964
+ function De(e) {
2965
+ return typeof e == "function" ? e() : S(e);
2966
+ }
2967
+ function Ao(e) {
2968
+ return {
2969
+ name: "arrow",
2970
+ options: e,
2971
+ fn(t) {
2972
+ const n = Ct(De(e.element));
2973
+ return n == null ? {} : Lo({
2974
+ element: n,
2975
+ padding: e.padding
2976
+ }).fn(t);
2977
+ }
2978
+ };
2979
+ }
2980
+ function qn(e) {
2981
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
2982
+ }
2983
+ function sn(e, t) {
2984
+ const n = qn(e);
2985
+ return Math.round(t * n) / n;
2986
+ }
2987
+ function ko(e, t, n) {
2988
+ n === void 0 && (n = {});
2989
+ const l = n.whileElementsMounted, r = b(() => {
2990
+ var O;
2991
+ return (O = De(n.open)) != null ? O : !0;
2992
+ }), o = b(() => De(n.middleware)), i = b(() => {
2993
+ var O;
2994
+ return (O = De(n.placement)) != null ? O : "bottom";
2995
+ }), a = b(() => {
2996
+ var O;
2997
+ return (O = De(n.strategy)) != null ? O : "absolute";
2998
+ }), c = b(() => {
2999
+ var O;
3000
+ return (O = De(n.transform)) != null ? O : !0;
3001
+ }), s = b(() => Ct(e.value)), u = b(() => Ct(t.value)), d = $(0), f = $(0), v = $(a.value), p = $(i.value), m = Ve({}), h = $(!1), y = b(() => {
3002
+ const O = {
3003
+ position: v.value,
3004
+ left: "0",
3005
+ top: "0"
3006
+ };
3007
+ if (!u.value)
3008
+ return O;
3009
+ const R = sn(u.value, d.value), U = sn(u.value, f.value);
3010
+ return c.value ? {
3011
+ ...O,
3012
+ transform: "translate(" + R + "px, " + U + "px)",
3013
+ ...qn(u.value) >= 1.5 && {
3014
+ willChange: "transform"
3015
+ }
3016
+ } : {
3017
+ position: v.value,
3018
+ left: R + "px",
3019
+ top: U + "px"
3020
+ };
3021
+ });
3022
+ let g;
3023
+ function w() {
3024
+ if (s.value == null || u.value == null)
3025
+ return;
3026
+ const O = r.value;
3027
+ To(s.value, u.value, {
3028
+ middleware: o.value,
3029
+ placement: i.value,
3030
+ strategy: a.value
3031
+ }).then((R) => {
3032
+ d.value = R.x, f.value = R.y, v.value = R.strategy, p.value = R.placement, m.value = R.middlewareData, h.value = O !== !1;
3033
+ });
3034
+ }
3035
+ function T() {
3036
+ typeof g == "function" && (g(), g = void 0);
3037
+ }
3038
+ function L() {
3039
+ if (T(), l === void 0) {
3040
+ w();
3041
+ return;
3042
+ }
3043
+ if (s.value != null && u.value != null) {
3044
+ g = l(s.value, u.value, w);
3045
+ return;
3046
+ }
3047
+ }
3048
+ function P() {
3049
+ r.value || (h.value = !1);
3050
+ }
3051
+ return de([o, i, a, r], w, {
3052
+ flush: "sync"
3053
+ }), de([s, u], L, {
3054
+ flush: "sync"
3055
+ }), de(r, P, {
3056
+ flush: "sync"
3057
+ }), _n() && el(T), {
3058
+ x: Pe(d),
3059
+ y: Pe(f),
3060
+ strategy: Pe(v),
3061
+ placement: Pe(p),
3062
+ middlewareData: Pe(m),
3063
+ isPositioned: Pe(h),
3064
+ floatingStyles: y,
3065
+ update: w
3066
+ };
3067
+ }
3068
+ const Po = ["innerHTML"], Wo = {
3069
+ __name: "Tooltip",
3070
+ props: {
3071
+ content: {
3072
+ type: String,
3073
+ required: !0
3074
+ },
3075
+ blur: {
3076
+ type: Boolean,
3077
+ default: !0
3078
+ },
3079
+ maxWidth: {
3080
+ type: Number,
3081
+ default: null
3082
+ },
3083
+ tooltipClass: {
3084
+ type: String,
3085
+ default: ""
3086
+ },
3087
+ placement: {
3088
+ type: String,
3089
+ default: void 0,
3090
+ validator: (e) => e === void 0 || [
3091
+ "top",
3092
+ "right",
3093
+ "bottom",
3094
+ "left",
3095
+ "top-start",
3096
+ "top-end",
3097
+ "right-start",
3098
+ "right-end",
3099
+ "bottom-start",
3100
+ "bottom-end",
3101
+ "left-start",
3102
+ "left-end"
3103
+ ].includes(e)
3104
+ }
3105
+ },
3106
+ setup(e) {
3107
+ const t = e, n = Ve(), l = Ve(), r = Ve(), {
3108
+ floatingStyles: o,
3109
+ middlewareData: i,
3110
+ placement: a
3111
+ } = ko(n, l, {
3112
+ middleware: [
3113
+ t.placement ? null : So(),
3114
+ $o(10),
3115
+ Eo({ crossAxis: !0, padding: 5 }),
3116
+ Ao({ element: r }),
3117
+ Oo({
3118
+ apply({ availableWidth: u, availableHeight: d, elements: f }) {
3119
+ Object.assign(f.floating.style, {
3120
+ maxWidth: t.maxWidth ? `${Math.min(u, t.maxWidth) / 16}rem` : "",
3121
+ maxHeight: `${d / 16}rem `
3122
+ });
3123
+ }
3124
+ })
3125
+ ],
3126
+ whileElementsMounted: xo,
3127
+ placement: t.placement
3128
+ }), c = (u) => ({
3129
+ top: 0,
3130
+ bottom: 180,
3131
+ left: -90,
3132
+ right: 90
3133
+ })[u.split("-")[0]] || 0, s = (u) => {
3134
+ var v, p;
3135
+ const d = a.value.split("-")[0], f = {
3136
+ left: "right",
3137
+ right: "left",
3138
+ bottom: "top",
3139
+ top: "bottom"
3140
+ }[d];
3141
+ return {
3142
+ style: {
3143
+ left: (v = u.arrow) != null && v.x ? `${u.arrow.x}px` : "",
3144
+ top: (p = u.arrow) != null && p.y ? `${u.arrow.y}px` : "",
3145
+ bottom: "",
3146
+ right: "",
3147
+ [f]: r.value ? `${r.value.offsetWidth * -1}px` : "",
3148
+ transform: `rotate(${c(a.value)}deg)`
3149
+ }
3150
+ };
3151
+ };
3152
+ return (u, d) => (E(), k("div", {
3153
+ ref_key: "wrapperRef",
3154
+ ref: n,
3155
+ class: "rvc-group/tooltip"
3156
+ }, [
3157
+ C(u.$slots, "default"),
3158
+ x("div", {
3159
+ ref_key: "tooltipRef",
3160
+ ref: l,
3161
+ class: q(["group-hover/tooltip:rvc-opacity-100 group-hover/tooltip:rvc-visible rvc-invisible rvc-opacity-0 rvc-tooltip", e.tooltipClass, { "rvc-tooltip-blur": e.blur }]),
3162
+ style: tl(S(o))
3163
+ }, [
3164
+ C(u.$slots, "content", { content: e.content }, () => [
3165
+ e.content ? (E(), k("div", {
3166
+ key: 0,
3167
+ innerHTML: e.content
3168
+ }, null, 8, Po)) : _("", !0)
3169
+ ]),
3170
+ x("div", qe({
3171
+ ref_key: "arrowRef",
3172
+ ref: r,
3173
+ class: "rvc-absolute rvc-tooltip-arrow"
3174
+ }, s(S(i))), null, 16)
3175
+ ], 6)
3176
+ ], 512));
3177
+ }
1269
3178
  };
1270
3179
  export {
1271
- Xn as Badge,
1272
- et as ButtonBase,
1273
- Zn as Drawer
3180
+ Ro as Accordion,
3181
+ Fo as Alert,
3182
+ Bo as Badge,
3183
+ rt as ButtonBase,
3184
+ Mo as Checkbox,
3185
+ No as DataTable,
3186
+ Ho as Drawer,
3187
+ Vo as Lightswitch,
3188
+ Io as Modal,
3189
+ Wo as Tooltip
1274
3190
  };