mimir-ui-kit 1.37.6 → 1.37.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +1,34 @@
1
- import { n as B, u as gt, d as Te, s as Me, o as I, p as Xt, t as Mn, e as Le, W as pe, y as Se, T as Pn, H as he, M as Tt, a as Re, $ as Jt, b as Qt, D as vt, I as An, c as Q } from "./keyboard-B0lm_zyn.js";
2
- import * as y from "react";
3
- import W, { useReducer as Zt, useMemo as q, useSyncExternalStore as $n, useId as We, useEffect as oe, useCallback as ke, useRef as K, useLayoutEffect as en, createContext as ge, useContext as le, useState as ae, Fragment as tt, createRef as Dn } from "react";
4
- import * as Ne from "react-dom";
5
- import { flushSync as we, createPortal as Fn } from "react-dom";
6
- import { w as Ln } from "./use-active-press-86hajhdd.js";
7
- import { u as _n } from "./use-by-comparator-CVuf9KBq.js";
8
- import { K as kn, a as Nn, b as zn, T as Hn, z as Vn, j as Wn, u as Bn, I as bt, G as jn } from "./label-y3ANLTNC.js";
9
- import { A as Un, h as Yn, f as qn, _ as Kn } from "./focus-management-XwV-9qkO.js";
10
- import { e as Gn } from "./use-resolve-button-type-DhFdPxnv.js";
11
- import { c as Xn, i as Xe, u as Jn, R as Qn, H as Zn } from "./open-closed-CdldUPoq.js";
12
- import { r as eo } from "./bugs-diTMAGNw.js";
13
- function De(e, t, n) {
1
+ import { n as U, u as wt, d as Te, s as Pe, o as M, p as Zt, t as An, e as Le, W as me, y as Oe, T as $n, H as pe, M as At, a as Re, $ as en, b as tn, D as yt, I as Dn, c as Z } from "./keyboard-mgWkd2Vh.js";
2
+ import * as w from "react";
3
+ import j, { useReducer as nn, useMemo as X, useSyncExternalStore as Fn, useId as Be, useEffect as oe, useCallback as Ne, useRef as J, useLayoutEffect as on, createContext as he, useContext as le, useState as ce, Fragment as tt, createRef as Ln } from "react";
4
+ import * as Xe from "react-dom";
5
+ import { flushSync as xe, createPortal as _n } from "react-dom";
6
+ import { w as Nn } from "./use-active-press-CqLGIFz7.js";
7
+ import { u as kn } from "./use-by-comparator-CVuf9KBq.js";
8
+ import { K as zn, a as Hn, b as Vn, T as Bn, z as Wn, j as jn, u as Un, I as Et, G as Yn } from "./label-D4GFpe5F.js";
9
+ import { A as qn, h as Kn, f as Gn, _ as Xn } from "./focus-management-DOYCPyGg.js";
10
+ import { e as Jn } from "./use-resolve-button-type-DhFdPxnv.js";
11
+ import { c as Qn, i as Je, u as Zn, x as eo, R as to } from "./open-closed-D2VjDhAN.js";
12
+ import { r as no } from "./bugs-diTMAGNw.js";
13
+ function Se(e, t, n) {
14
14
  let o = n.initialDeps ?? [], i;
15
15
  return () => {
16
16
  var r, s, l, a;
17
- let c;
18
- n.key && ((r = n.debug) != null && r.call(n)) && (c = Date.now());
19
- const f = e();
20
- if (!(f.length !== o.length || f.some((u, m) => o[m] !== u)))
17
+ let u;
18
+ n.key && ((r = n.debug) != null && r.call(n)) && (u = Date.now());
19
+ const c = e();
20
+ if (!(c.length !== o.length || c.some((f, m) => o[m] !== f)))
21
21
  return i;
22
- o = f;
22
+ o = c;
23
23
  let p;
24
- if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...f), n.key && ((l = n.debug) != null && l.call(n))) {
25
- const u = Math.round((Date.now() - c) * 100) / 100, m = Math.round((Date.now() - p) * 100) / 100, h = m / 16, g = (v, E) => {
26
- for (v = String(v); v.length < E; )
24
+ if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...c), n.key && ((l = n.debug) != null && l.call(n))) {
25
+ const f = Math.round((Date.now() - u) * 100) / 100, m = Math.round((Date.now() - p) * 100) / 100, h = m / 16, g = (v, y) => {
26
+ for (v = String(v); v.length < y; )
27
27
  v = " " + v;
28
28
  return v;
29
29
  };
30
30
  console.info(
31
- `%c⏱ ${g(m, 5)} /${g(u, 5)} ms`,
31
+ `%c⏱ ${g(m, 5)} /${g(f, 5)} ms`,
32
32
  `
33
33
  font-size: .6rem;
34
34
  font-weight: bold;
@@ -42,22 +42,22 @@ function De(e, t, n) {
42
42
  return (a = n == null ? void 0 : n.onChange) == null || a.call(n, i), i;
43
43
  };
44
44
  }
45
- function lt(e, t) {
45
+ function st(e, t) {
46
46
  if (e === void 0)
47
47
  throw new Error("Unexpected undefined");
48
48
  return e;
49
49
  }
50
- const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
50
+ const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
51
51
  let o;
52
52
  return function(...i) {
53
53
  e.clearTimeout(o), o = e.setTimeout(() => t.apply(this, i), n);
54
54
  };
55
- }, oo = (e) => e, io = (e) => {
55
+ }, ro = (e) => e, lo = (e) => {
56
56
  const t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1), o = [];
57
57
  for (let i = t; i <= n; i++)
58
58
  o.push(i);
59
59
  return o;
60
- }, ro = (e, t) => {
60
+ }, so = (e, t) => {
61
61
  const n = e.scrollElement;
62
62
  if (!n)
63
63
  return;
@@ -85,9 +85,9 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
85
85
  return r.observe(n, { box: "border-box" }), () => {
86
86
  r.unobserve(n);
87
87
  };
88
- }, It = {
88
+ }, $t = {
89
89
  passive: !0
90
- }, lo = typeof window > "u" ? !0 : "onscrollend" in window, so = (e, t) => {
90
+ }, ao = typeof window > "u" ? !0 : "onscrollend" in window, co = (e, t) => {
91
91
  const n = e.scrollElement;
92
92
  if (!n)
93
93
  return;
@@ -95,20 +95,21 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
95
95
  if (!o)
96
96
  return;
97
97
  let i = 0;
98
- const r = lo ? () => {
99
- } : no(
98
+ const r = ao ? () => {
99
+ } : io(
100
100
  o,
101
101
  () => {
102
102
  t(i, !1);
103
103
  },
104
104
  e.options.isScrollingResetDelay
105
- ), s = (c) => () => {
106
- i = n[e.options.horizontal ? "scrollLeft" : "scrollTop"], r(), t(i, c);
105
+ ), s = (u) => () => {
106
+ const { horizontal: c, isRtl: d } = e.options;
107
+ i = c ? n.scrollLeft * (d && -1 || 1) : n.scrollTop, r(), t(i, u);
107
108
  }, l = s(!0), a = s(!1);
108
- return a(), n.addEventListener("scroll", l, It), n.addEventListener("scrollend", a, It), () => {
109
+ return a(), n.addEventListener("scroll", l, $t), n.addEventListener("scrollend", a, $t), () => {
109
110
  n.removeEventListener("scroll", l), n.removeEventListener("scrollend", a);
110
111
  };
111
- }, ao = (e, t, n) => {
112
+ }, uo = (e, t, n) => {
112
113
  if (t != null && t.borderBoxSize) {
113
114
  const o = t.borderBoxSize[0];
114
115
  if (o)
@@ -119,7 +120,7 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
119
120
  return Math.round(
120
121
  e.getBoundingClientRect()[n.options.horizontal ? "width" : "height"]
121
122
  );
122
- }, co = (e, {
123
+ }, fo = (e, {
123
124
  adjustments: t = 0,
124
125
  behavior: n
125
126
  }, o) => {
@@ -130,7 +131,7 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
130
131
  behavior: n
131
132
  });
132
133
  };
133
- class uo {
134
+ class mo {
134
135
  constructor(t) {
135
136
  this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
136
137
  let n = null;
@@ -142,7 +143,7 @@ class uo {
142
143
  return {
143
144
  disconnect: () => {
144
145
  var i;
145
- return (i = o()) == null ? void 0 : i.disconnect();
146
+ (i = o()) == null || i.disconnect(), n = null;
146
147
  },
147
148
  observe: (i) => {
148
149
  var r;
@@ -165,11 +166,11 @@ class uo {
165
166
  scrollPaddingStart: 0,
166
167
  scrollPaddingEnd: 0,
167
168
  horizontal: !1,
168
- getItemKey: oo,
169
- rangeExtractor: io,
169
+ getItemKey: ro,
170
+ rangeExtractor: lo,
170
171
  onChange: () => {
171
172
  },
172
- measureElement: ao,
173
+ measureElement: uo,
173
174
  initialRect: { width: 0, height: 0 },
174
175
  scrollMargin: 0,
175
176
  gap: 0,
@@ -178,17 +179,32 @@ class uo {
178
179
  lanes: 1,
179
180
  isScrollingResetDelay: 150,
180
181
  enabled: !0,
182
+ isRtl: !1,
181
183
  ...n
182
184
  };
183
- }, this.notify = (n, o) => {
184
- var i, r;
185
- const { startIndex: s, endIndex: l } = this.range ?? {
186
- startIndex: void 0,
187
- endIndex: void 0
188
- }, a = this.calculateRange();
189
- (n || s !== (a == null ? void 0 : a.startIndex) || l !== (a == null ? void 0 : a.endIndex)) && ((r = (i = this.options).onChange) == null || r.call(i, this, o));
190
- }, this.cleanup = () => {
191
- this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.observer.disconnect(), this.elementsCache.clear();
185
+ }, this.notify = (n) => {
186
+ var o, i;
187
+ (i = (o = this.options).onChange) == null || i.call(o, this, n);
188
+ }, this.maybeNotify = Se(
189
+ () => (this.calculateRange(), [
190
+ this.isScrolling,
191
+ this.range ? this.range.startIndex : null,
192
+ this.range ? this.range.endIndex : null
193
+ ]),
194
+ (n) => {
195
+ this.notify(n);
196
+ },
197
+ {
198
+ key: process.env.NODE_ENV !== "production" && "maybeNotify",
199
+ debug: () => this.options.debug,
200
+ initialDeps: [
201
+ this.isScrolling,
202
+ this.range ? this.range.startIndex : null,
203
+ this.range ? this.range.endIndex : null
204
+ ]
205
+ }
206
+ ), this.cleanup = () => {
207
+ this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
192
208
  }, this._didMount = () => () => {
193
209
  this.cleanup();
194
210
  }, this._willUpdate = () => {
@@ -196,21 +212,21 @@ class uo {
196
212
  const o = this.options.enabled ? this.options.getScrollElement() : null;
197
213
  if (this.scrollElement !== o) {
198
214
  if (this.cleanup(), !o) {
199
- this.notify(!1, !1);
215
+ this.maybeNotify();
200
216
  return;
201
217
  }
202
- this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this._scrollToOffset(this.getScrollOffset(), {
218
+ this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
219
+ this.observer.observe(i);
220
+ }), this._scrollToOffset(this.getScrollOffset(), {
203
221
  adjustments: void 0,
204
222
  behavior: void 0
205
223
  }), this.unsubs.push(
206
224
  this.options.observeElementRect(this, (i) => {
207
- this.scrollRect = i, this.notify(!1, !1);
225
+ this.scrollRect = i, this.maybeNotify();
208
226
  })
209
227
  ), this.unsubs.push(
210
228
  this.options.observeElementOffset(this, (i, r) => {
211
- this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i;
212
- const s = this.isScrolling;
213
- this.isScrolling = r, this.notify(s !== r, r);
229
+ this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = r, this.maybeNotify();
214
230
  })
215
231
  );
216
232
  }
@@ -227,7 +243,7 @@ class uo {
227
243
  break;
228
244
  }
229
245
  return r.size === this.options.lanes ? Array.from(r.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
230
- }, this.getMeasurementOptions = De(
246
+ }, this.getMeasurementOptions = Se(
231
247
  () => [
232
248
  this.options.count,
233
249
  this.options.paddingStart,
@@ -245,51 +261,37 @@ class uo {
245
261
  {
246
262
  key: !1
247
263
  }
248
- ), this.getMeasurements = De(
264
+ ), this.getMeasurements = Se(
249
265
  () => [this.getMeasurementOptions(), this.itemSizeCache],
250
266
  ({ count: n, paddingStart: o, scrollMargin: i, getItemKey: r, enabled: s }, l) => {
251
- var a;
252
267
  if (!s)
253
268
  return this.measurementsCache = [], this.itemSizeCache.clear(), [];
254
- this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((d) => {
255
- this.itemSizeCache.set(d.key, d.size);
269
+ this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
270
+ this.itemSizeCache.set(c.key, c.size);
256
271
  }));
257
- const c = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
272
+ const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
258
273
  this.pendingMeasuredCacheIndexes = [];
259
- const f = this.measurementsCache.slice(0, c);
260
- for (let d = c; d < n; d++) {
261
- let p = (a = this.measurementsCache[d]) == null ? void 0 : a.measureElement;
262
- p || (p = (x) => {
263
- const O = r(d), S = this.elementsCache.get(O);
264
- if (!x) {
265
- S && (this.observer.unobserve(S), this.elementsCache.delete(O));
266
- return;
267
- }
268
- S !== x && (S && this.observer.unobserve(S), this.observer.observe(x), this.elementsCache.set(O, x)), x.isConnected && this.resizeItem(
269
- d,
270
- this.options.measureElement(x, void 0, this)
271
- );
272
- });
273
- const u = r(d), m = this.options.lanes === 1 ? f[d - 1] : this.getFurthestMeasurement(f, d), h = m ? m.end + this.options.gap : o + i, g = l.get(u), v = typeof g == "number" ? g : this.options.estimateSize(d), E = h + v, b = m ? m.lane : d % this.options.lanes;
274
- f[d] = {
275
- index: d,
276
- start: h,
277
- size: v,
278
- end: E,
279
- key: u,
280
- lane: b,
281
- measureElement: p
274
+ const u = this.measurementsCache.slice(0, a);
275
+ for (let c = a; c < n; c++) {
276
+ const d = r(c), p = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c), f = p ? p.end + this.options.gap : o + i, m = l.get(d), h = typeof m == "number" ? m : this.options.estimateSize(c), g = f + h, v = p ? p.lane : c % this.options.lanes;
277
+ u[c] = {
278
+ index: c,
279
+ start: f,
280
+ size: h,
281
+ end: g,
282
+ key: d,
283
+ lane: v
282
284
  };
283
285
  }
284
- return this.measurementsCache = f, f;
286
+ return this.measurementsCache = u, u;
285
287
  },
286
288
  {
287
289
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
288
290
  debug: () => this.options.debug
289
291
  }
290
- ), this.calculateRange = De(
292
+ ), this.calculateRange = Se(
291
293
  () => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
292
- (n, o, i) => this.range = n.length > 0 && o > 0 ? fo({
294
+ (n, o, i) => this.range = n.length > 0 && o > 0 ? po({
293
295
  measurements: n,
294
296
  outerSize: o,
295
297
  scrollOffset: i
@@ -298,7 +300,7 @@ class uo {
298
300
  key: process.env.NODE_ENV !== "production" && "calculateRange",
299
301
  debug: () => this.options.debug
300
302
  }
301
- ), this.getIndexes = De(
303
+ ), this.getIndexes = Se(
302
304
  () => [
303
305
  this.options.rangeExtractor,
304
306
  this.calculateRange(),
@@ -321,27 +323,29 @@ class uo {
321
323
  `Missing attribute name '${o}={index}' on measured element.`
322
324
  ), -1);
323
325
  }, this._measureElement = (n, o) => {
324
- const i = this.indexFromElement(n), r = this.getMeasurements()[i];
325
- if (!r || !n.isConnected) {
326
- this.elementsCache.forEach((l, a) => {
327
- l === n && (this.observer.unobserve(n), this.elementsCache.delete(a));
328
- });
326
+ const i = this.indexFromElement(n), r = this.measurementsCache[i];
327
+ if (!r)
329
328
  return;
330
- }
331
- const s = this.elementsCache.get(r.key);
332
- s !== n && (s && this.observer.unobserve(s), this.observer.observe(n), this.elementsCache.set(r.key, n)), this.resizeItem(i, this.options.measureElement(n, o, this));
329
+ const s = r.key, l = this.elementsCache.get(s);
330
+ l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(s, n)), n.isConnected && this.resizeItem(i, this.options.measureElement(n, o, this));
333
331
  }, this.resizeItem = (n, o) => {
334
- const i = this.getMeasurements()[n];
332
+ const i = this.measurementsCache[n];
335
333
  if (!i)
336
334
  return;
337
335
  const r = this.itemSizeCache.get(i.key) ?? i.size, s = o - r;
338
336
  s !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, s, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", s), this._scrollToOffset(this.getScrollOffset(), {
339
337
  adjustments: this.scrollAdjustments += s,
340
338
  behavior: void 0
341
- })), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!0, !1));
339
+ })), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!1));
342
340
  }, this.measureElement = (n) => {
343
- n && this._measureElement(n, void 0);
344
- }, this.getVirtualItems = De(
341
+ if (!n) {
342
+ this.elementsCache.forEach((o, i) => {
343
+ o.isConnected || (this.observer.unobserve(o), this.elementsCache.delete(i));
344
+ });
345
+ return;
346
+ }
347
+ this._measureElement(n, void 0);
348
+ }, this.getVirtualItems = Se(
345
349
  () => [this.getIndexes(), this.getMeasurements()],
346
350
  (n, o) => {
347
351
  const i = [];
@@ -352,17 +356,17 @@ class uo {
352
356
  return i;
353
357
  },
354
358
  {
355
- key: process.env.NODE_ENV !== "production" && "getIndexes",
359
+ key: process.env.NODE_ENV !== "production" && "getVirtualItems",
356
360
  debug: () => this.options.debug
357
361
  }
358
362
  ), this.getVirtualItemForOffset = (n) => {
359
363
  const o = this.getMeasurements();
360
364
  if (o.length !== 0)
361
- return lt(
362
- o[tn(
365
+ return st(
366
+ o[rn(
363
367
  0,
364
368
  o.length - 1,
365
- (i) => lt(o[i]).start,
369
+ (i) => st(o[i]).start,
366
370
  n
367
371
  )]
368
372
  );
@@ -373,7 +377,7 @@ class uo {
373
377
  return Math.max(Math.min(a, n), 0);
374
378
  }, this.getOffsetForIndex = (n, o = "auto") => {
375
379
  n = Math.max(0, Math.min(n, this.options.count - 1));
376
- const i = this.getMeasurements()[n];
380
+ const i = this.measurementsCache[n];
377
381
  if (!i)
378
382
  return;
379
383
  const r = this.getSize(), s = this.getScrollOffset();
@@ -406,10 +410,10 @@ class uo {
406
410
  if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
407
411
  this.options.getItemKey(n)
408
412
  )) {
409
- const [c] = lt(
413
+ const [u] = st(
410
414
  this.getOffsetForIndex(n, l)
411
415
  );
412
- to(c, this.getScrollOffset()) || this.scrollToIndex(n, { align: l, behavior: i });
416
+ oo(u, this.getScrollOffset()) || this.scrollToIndex(n, { align: l, behavior: i });
413
417
  } else
414
418
  this.scrollToIndex(n, { align: l, behavior: i });
415
419
  }));
@@ -426,19 +430,21 @@ class uo {
426
430
  let i;
427
431
  return o.length === 0 ? i = this.options.paddingStart : i = this.options.lanes === 1 ? ((n = o[o.length - 1]) == null ? void 0 : n.end) ?? 0 : Math.max(
428
432
  ...o.slice(-this.options.lanes).map((r) => r.end)
429
- ), i - this.options.scrollMargin + this.options.paddingEnd;
433
+ ), Math.max(
434
+ i - this.options.scrollMargin + this.options.paddingEnd,
435
+ 0
436
+ );
430
437
  }, this._scrollToOffset = (n, {
431
438
  adjustments: o,
432
439
  behavior: i
433
440
  }) => {
434
441
  this.options.scrollToFn(n, { behavior: i, adjustments: o }, this);
435
442
  }, this.measure = () => {
436
- var n, o;
437
- this.itemSizeCache = /* @__PURE__ */ new Map(), (o = (n = this.options).onChange) == null || o.call(n, this, !1);
443
+ this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
438
444
  }, this.setOptions(t);
439
445
  }
440
446
  }
441
- const tn = (e, t, n, o) => {
447
+ const rn = (e, t, n, o) => {
442
448
  for (; e <= t; ) {
443
449
  const i = (e + t) / 2 | 0, r = n(i);
444
450
  if (r < o)
@@ -450,46 +456,46 @@ const tn = (e, t, n, o) => {
450
456
  }
451
457
  return e > 0 ? e - 1 : 0;
452
458
  };
453
- function fo({
459
+ function po({
454
460
  measurements: e,
455
461
  outerSize: t,
456
462
  scrollOffset: n
457
463
  }) {
458
- const o = e.length - 1, r = tn(0, o, (l) => e[l].start, n);
464
+ const o = e.length - 1, r = rn(0, o, (l) => e[l].start, n);
459
465
  let s = r;
460
466
  for (; s < o && e[s].end < n + t; )
461
467
  s++;
462
468
  return { startIndex: r, endIndex: s };
463
469
  }
464
- const mo = typeof document < "u" ? y.useLayoutEffect : y.useEffect;
465
- function po(e) {
466
- const t = y.useReducer(() => ({}), {})[1], n = {
470
+ const ho = typeof document < "u" ? w.useLayoutEffect : w.useEffect;
471
+ function go(e) {
472
+ const t = w.useReducer(() => ({}), {})[1], n = {
467
473
  ...e,
468
474
  onChange: (i, r) => {
469
475
  var s;
470
- r ? we(t) : t(), (s = e.onChange) == null || s.call(e, i, r);
476
+ r ? xe(t) : t(), (s = e.onChange) == null || s.call(e, i, r);
471
477
  }
472
- }, [o] = y.useState(
473
- () => new uo(n)
478
+ }, [o] = w.useState(
479
+ () => new mo(n)
474
480
  );
475
- return o.setOptions(n), y.useEffect(() => o._didMount(), []), mo(() => o._willUpdate()), o;
481
+ return o.setOptions(n), w.useEffect(() => o._didMount(), []), ho(() => o._willUpdate()), o;
476
482
  }
477
- function ho(e) {
478
- return po({
479
- observeElementRect: ro,
480
- observeElementOffset: so,
481
- scrollToFn: co,
483
+ function vo(e) {
484
+ return go({
485
+ observeElementRect: so,
486
+ observeElementOffset: co,
487
+ scrollToFn: fo,
482
488
  ...e
483
489
  });
484
490
  }
485
- function go(e) {
491
+ function bo(e) {
486
492
  if (e === null) return { width: 0, height: 0 };
487
493
  let { width: t, height: n } = e.getBoundingClientRect();
488
494
  return { width: t, height: n };
489
495
  }
490
- function Mt(e, t = !1) {
491
- let [n, o] = Zt(() => ({}), {}), i = q(() => go(e), [e, n]);
492
- return B(() => {
496
+ function Dt(e, t = !1) {
497
+ let [n, o] = nn(() => ({}), {}), i = X(() => bo(e), [e, n]);
498
+ return U(() => {
493
499
  if (!e) return;
494
500
  let r = new ResizeObserver(o);
495
501
  return r.observe(e), () => {
@@ -497,7 +503,7 @@ function Mt(e, t = !1) {
497
503
  };
498
504
  }, [e]), t ? { width: `${i.width}px`, height: `${i.height}px` } : i;
499
505
  }
500
- let vo = class extends Map {
506
+ let xo = class extends Map {
501
507
  constructor(t) {
502
508
  super(), this.factory = t;
503
509
  }
@@ -506,7 +512,7 @@ let vo = class extends Map {
506
512
  return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
507
513
  }
508
514
  };
509
- function nn(e, t) {
515
+ function ln(e, t) {
510
516
  let n = e(), o = /* @__PURE__ */ new Set();
511
517
  return { getSnapshot() {
512
518
  return n;
@@ -517,10 +523,10 @@ function nn(e, t) {
517
523
  s && (n = s, o.forEach((l) => l()));
518
524
  } };
519
525
  }
520
- function on(e) {
521
- return $n(e.subscribe, e.getSnapshot, e.getSnapshot);
526
+ function sn(e) {
527
+ return Fn(e.subscribe, e.getSnapshot, e.getSnapshot);
522
528
  }
523
- let bo = new vo(() => nn(() => [], { ADD(e) {
529
+ let wo = new xo(() => ln(() => [], { ADD(e) {
524
530
  return this.includes(e) ? this : [...this, e];
525
531
  }, REMOVE(e) {
526
532
  let t = this.indexOf(e);
@@ -528,50 +534,50 @@ let bo = new vo(() => nn(() => [], { ADD(e) {
528
534
  let n = this.slice();
529
535
  return n.splice(t, 1), n;
530
536
  } }));
531
- function xt(e, t) {
532
- let n = bo.get(t), o = We(), i = on(n);
533
- if (B(() => {
537
+ function Ot(e, t) {
538
+ let n = wo.get(t), o = Be(), i = sn(n);
539
+ if (U(() => {
534
540
  if (e) return n.dispatch("ADD", o), () => n.dispatch("REMOVE", o);
535
541
  }, [n, e]), !e) return !1;
536
542
  let r = i.indexOf(o), s = i.length;
537
543
  return r === -1 && (r = s, s += 1), r === s - 1;
538
544
  }
539
- let dt = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
540
- function Pt(e) {
545
+ let pt = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
546
+ function Ft(e) {
541
547
  var t;
542
548
  let n = (t = _e.get(e)) != null ? t : 0;
543
- return _e.set(e, n + 1), n !== 0 ? () => At(e) : (dt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => At(e));
549
+ return _e.set(e, n + 1), n !== 0 ? () => Lt(e) : (pt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Lt(e));
544
550
  }
545
- function At(e) {
551
+ function Lt(e) {
546
552
  var t;
547
553
  let n = (t = _e.get(e)) != null ? t : 1;
548
554
  if (n === 1 ? _e.delete(e) : _e.set(e, n - 1), n !== 1) return;
549
- let o = dt.get(e);
550
- o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, dt.delete(e));
555
+ let o = pt.get(e);
556
+ o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, pt.delete(e));
551
557
  }
552
- function xo(e, { allowed: t, disallowed: n } = {}) {
553
- let o = xt(e, "inert-others");
554
- B(() => {
558
+ function yo(e, { allowed: t, disallowed: n } = {}) {
559
+ let o = Ot(e, "inert-others");
560
+ U(() => {
555
561
  var i, r;
556
562
  if (!o) return;
557
563
  let s = Te();
558
- for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(Pt(a));
564
+ for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(Ft(a));
559
565
  let l = (r = t == null ? void 0 : t()) != null ? r : [];
560
566
  for (let a of l) {
561
567
  if (!a) continue;
562
- let c = gt(a);
563
- if (!c) continue;
564
- let f = a.parentElement;
565
- for (; f && f !== c.body; ) {
566
- for (let d of f.children) l.some((p) => d.contains(p)) || s.add(Pt(d));
567
- f = f.parentElement;
568
+ let u = wt(a);
569
+ if (!u) continue;
570
+ let c = a.parentElement;
571
+ for (; c && c !== u.body; ) {
572
+ for (let d of c.children) l.some((p) => d.contains(p)) || s.add(Ft(d));
573
+ c = c.parentElement;
568
574
  }
569
575
  }
570
576
  return s.dispose;
571
577
  }, [o, t, n]);
572
578
  }
573
- function wo(e, t, n) {
574
- let o = Me((i) => {
579
+ function Eo(e, t, n) {
580
+ let o = Pe((i) => {
575
581
  let r = i.getBoundingClientRect();
576
582
  r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0 && n();
577
583
  });
@@ -591,17 +597,17 @@ function wo(e, t, n) {
591
597
  return () => r.dispose();
592
598
  }, [t, o, e]);
593
599
  }
594
- function rn() {
600
+ function an() {
595
601
  return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
596
602
  }
597
- function Eo() {
603
+ function Oo() {
598
604
  return /Android/gi.test(window.navigator.userAgent);
599
605
  }
600
- function ln() {
601
- return rn() || Eo();
606
+ function cn() {
607
+ return an() || Oo();
602
608
  }
603
609
  function Fe(e, t, n, o) {
604
- let i = Me(n);
610
+ let i = Pe(n);
605
611
  oe(() => {
606
612
  if (!e) return;
607
613
  function r(s) {
@@ -610,8 +616,8 @@ function Fe(e, t, n, o) {
610
616
  return document.addEventListener(t, r, o), () => document.removeEventListener(t, r, o);
611
617
  }, [e, t, o]);
612
618
  }
613
- function yo(e, t, n, o) {
614
- let i = Me(n);
619
+ function So(e, t, n, o) {
620
+ let i = Pe(n);
615
621
  oe(() => {
616
622
  if (!e) return;
617
623
  function r(s) {
@@ -620,40 +626,40 @@ function yo(e, t, n, o) {
620
626
  return window.addEventListener(t, r, o), () => window.removeEventListener(t, r, o);
621
627
  }, [e, t, o]);
622
628
  }
623
- const $t = 30;
624
- function Oo(e, t, n) {
625
- let o = xt(e, "outside-click"), i = Me(n), r = ke(function(a, c) {
629
+ const _t = 30;
630
+ function Ro(e, t, n) {
631
+ let o = Ot(e, "outside-click"), i = Pe(n), r = Ne(function(a, u) {
626
632
  if (a.defaultPrevented) return;
627
- let f = c(a);
628
- if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
629
- let d = function p(u) {
630
- return typeof u == "function" ? p(u()) : Array.isArray(u) || u instanceof Set ? u : [u];
633
+ let c = u(a);
634
+ if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
635
+ let d = function p(f) {
636
+ return typeof f == "function" ? p(f()) : Array.isArray(f) || f instanceof Set ? f : [f];
631
637
  }(t);
632
- for (let p of d) if (p !== null && (p.contains(f) || a.composed && a.composedPath().includes(p))) return;
633
- return !Un(f, Yn.Loose) && f.tabIndex !== -1 && a.preventDefault(), i.current(a, f);
634
- }, [i, t]), s = K(null);
638
+ for (let p of d) if (p !== null && (p.contains(c) || a.composed && a.composedPath().includes(p))) return;
639
+ return !qn(c, Kn.Loose) && c.tabIndex !== -1 && a.preventDefault(), i.current(a, c);
640
+ }, [i, t]), s = J(null);
635
641
  Fe(o, "pointerdown", (a) => {
636
- var c, f;
637
- s.current = ((f = (c = a.composedPath) == null ? void 0 : c.call(a)) == null ? void 0 : f[0]) || a.target;
642
+ var u, c;
643
+ s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
638
644
  }, !0), Fe(o, "mousedown", (a) => {
639
- var c, f;
640
- s.current = ((f = (c = a.composedPath) == null ? void 0 : c.call(a)) == null ? void 0 : f[0]) || a.target;
645
+ var u, c;
646
+ s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
641
647
  }, !0), Fe(o, "click", (a) => {
642
- ln() || s.current && (r(a, () => s.current), s.current = null);
648
+ cn() || s.current && (r(a, () => s.current), s.current = null);
643
649
  }, !0);
644
- let l = K({ x: 0, y: 0 });
650
+ let l = J({ x: 0, y: 0 });
645
651
  Fe(o, "touchstart", (a) => {
646
652
  l.current.x = a.touches[0].clientX, l.current.y = a.touches[0].clientY;
647
653
  }, !0), Fe(o, "touchend", (a) => {
648
- let c = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
649
- if (!(Math.abs(c.x - l.current.x) >= $t || Math.abs(c.y - l.current.y) >= $t)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
650
- }, !0), yo(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
654
+ let u = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
655
+ if (!(Math.abs(u.x - l.current.x) >= _t || Math.abs(u.y - l.current.y) >= _t)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
656
+ }, !0), So(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
651
657
  }
652
658
  function nt(...e) {
653
- return q(() => gt(...e), [...e]);
659
+ return X(() => wt(...e), [...e]);
654
660
  }
655
- function So(e, t, n, o) {
656
- let i = Me(n);
661
+ function Co(e, t, n, o) {
662
+ let i = Pe(n);
657
663
  oe(() => {
658
664
  e = e ?? window;
659
665
  function r(s) {
@@ -662,12 +668,12 @@ function So(e, t, n, o) {
662
668
  return e.addEventListener(t, r, o), () => e.removeEventListener(t, r, o);
663
669
  }, [e, t, o]);
664
670
  }
665
- function sn(e) {
666
- let t = K({ value: "", selectionStart: null, selectionEnd: null });
667
- return So(e, "blur", (n) => {
671
+ function un(e) {
672
+ let t = J({ value: "", selectionStart: null, selectionEnd: null });
673
+ return Co(e, "blur", (n) => {
668
674
  let o = n.target;
669
675
  o instanceof HTMLInputElement && (t.current = { value: o.value, selectionStart: o.selectionStart, selectionEnd: o.selectionEnd });
670
- }), I(() => {
676
+ }), M(() => {
671
677
  if (document.activeElement !== e && e instanceof HTMLInputElement && e.isConnected) {
672
678
  if (e.focus({ preventScroll: !0 }), e.value !== t.current.value) e.setSelectionRange(e.value.length, e.value.length);
673
679
  else {
@@ -678,7 +684,7 @@ function sn(e) {
678
684
  }
679
685
  });
680
686
  }
681
- function Ro() {
687
+ function To() {
682
688
  let e;
683
689
  return { before({ doc: t }) {
684
690
  var n;
@@ -689,8 +695,8 @@ function Ro() {
689
695
  n.style(o, "paddingRight", `${r}px`);
690
696
  } };
691
697
  }
692
- function Co() {
693
- return rn() ? { before({ doc: e, d: t, meta: n }) {
698
+ function Io() {
699
+ return an() ? { before({ doc: e, d: t, meta: n }) {
694
700
  function o(i) {
695
701
  return n.containers.flatMap((r) => r()).some((r) => r.contains(i));
696
702
  }
@@ -705,8 +711,8 @@ function Co() {
705
711
  if (l.target instanceof HTMLElement) try {
706
712
  let a = l.target.closest("a");
707
713
  if (!a) return;
708
- let { hash: c } = new URL(a.href), f = e.querySelector(c);
709
- f && !o(f) && (s = f);
714
+ let { hash: u } = new URL(a.href), c = e.querySelector(u);
715
+ c && !o(c) && (s = c);
710
716
  } catch {
711
717
  }
712
718
  }, !0), t.addEventListener(e, "touchstart", (l) => {
@@ -732,17 +738,17 @@ function Co() {
732
738
  });
733
739
  } } : {};
734
740
  }
735
- function To() {
741
+ function Mo() {
736
742
  return { before({ doc: e, d: t }) {
737
743
  t.style(e.documentElement, "overflow", "hidden");
738
744
  } };
739
745
  }
740
- function Io(e) {
746
+ function Po(e) {
741
747
  let t = {};
742
748
  for (let n of e) Object.assign(t, n(t));
743
749
  return t;
744
750
  }
745
- let Ee = nn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
751
+ let we = ln(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
746
752
  var n;
747
753
  let o = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: Te(), meta: /* @__PURE__ */ new Set() };
748
754
  return o.count++, o.meta.add(t), this.set(e, o), this;
@@ -750,60 +756,60 @@ let Ee = nn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
750
756
  let n = this.get(e);
751
757
  return n && (n.count--, n.meta.delete(t)), this;
752
758
  }, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
753
- let o = { doc: e, d: t, meta: Io(n) }, i = [Co(), Ro(), To()];
759
+ let o = { doc: e, d: t, meta: Po(n) }, i = [Io(), To(), Mo()];
754
760
  i.forEach(({ before: r }) => r == null ? void 0 : r(o)), i.forEach(({ after: r }) => r == null ? void 0 : r(o));
755
761
  }, SCROLL_ALLOW({ d: e }) {
756
762
  e.dispose();
757
763
  }, TEARDOWN({ doc: e }) {
758
764
  this.delete(e);
759
765
  } });
760
- Ee.subscribe(() => {
761
- let e = Ee.getSnapshot(), t = /* @__PURE__ */ new Map();
766
+ we.subscribe(() => {
767
+ let e = we.getSnapshot(), t = /* @__PURE__ */ new Map();
762
768
  for (let [n] of e) t.set(n, n.documentElement.style.overflow);
763
769
  for (let n of e.values()) {
764
770
  let o = t.get(n.doc) === "hidden", i = n.count !== 0;
765
- (i && !o || !i && o) && Ee.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && Ee.dispatch("TEARDOWN", n);
771
+ (i && !o || !i && o) && we.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && we.dispatch("TEARDOWN", n);
766
772
  }
767
773
  });
768
- function Mo(e, t, n = () => ({ containers: [] })) {
769
- let o = on(Ee), i = t ? o.get(t) : void 0, r = i ? i.count > 0 : !1;
770
- return B(() => {
771
- if (!(!t || !e)) return Ee.dispatch("PUSH", t, n), () => Ee.dispatch("POP", t, n);
774
+ function Ao(e, t, n = () => ({ containers: [] })) {
775
+ let o = sn(we), i = t ? o.get(t) : void 0, r = i ? i.count > 0 : !1;
776
+ return U(() => {
777
+ if (!(!t || !e)) return we.dispatch("PUSH", t, n), () => we.dispatch("POP", t, n);
772
778
  }, [e, t]), r;
773
779
  }
774
- function Po(e, t, n = () => [document.body]) {
775
- let o = xt(e, "scroll-lock");
776
- Mo(o, t, (i) => {
780
+ function $o(e, t, n = () => [document.body]) {
781
+ let o = Ot(e, "scroll-lock");
782
+ Ao(o, t, (i) => {
777
783
  var r;
778
784
  return { containers: [...(r = i.containers) != null ? r : [], n] };
779
785
  });
780
786
  }
781
- function Dt(e) {
787
+ function Nt(e) {
782
788
  return [e.screenX, e.screenY];
783
789
  }
784
- function Ao() {
785
- let e = K([-1, -1]);
790
+ function Do() {
791
+ let e = J([-1, -1]);
786
792
  return { wasMoved(t) {
787
- let n = Dt(t);
793
+ let n = Nt(t);
788
794
  return e.current[0] === n[0] && e.current[1] === n[1] ? !1 : (e.current = n, !0);
789
795
  }, update(t) {
790
- e.current = Dt(t);
796
+ e.current = Nt(t);
791
797
  } };
792
798
  }
793
- function $o(e, { container: t, accept: n, walk: o }) {
794
- let i = K(n), r = K(o);
799
+ function Fo(e, { container: t, accept: n, walk: o }) {
800
+ let i = J(n), r = J(o);
795
801
  oe(() => {
796
802
  i.current = n, r.current = o;
797
- }, [n, o]), B(() => {
803
+ }, [n, o]), U(() => {
798
804
  if (!t || !e) return;
799
- let s = gt(t);
805
+ let s = wt(t);
800
806
  if (!s) return;
801
- let l = i.current, a = r.current, c = Object.assign((d) => l(d), { acceptNode: l }), f = s.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, c, !1);
802
- for (; f.nextNode(); ) a(f.currentNode);
807
+ let l = i.current, a = r.current, u = Object.assign((d) => l(d), { acceptNode: l }), c = s.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, u, !1);
808
+ for (; c.nextNode(); ) a(c.currentNode);
803
809
  }, [t, e, i, r]);
804
810
  }
805
- function Ft(e, t) {
806
- let n = K([]), o = I(e);
811
+ function kt(e, t) {
812
+ let n = J([]), o = M(e);
807
813
  oe(() => {
808
814
  let i = [...n.current];
809
815
  for (let [r, s] of t.entries()) if (n.current[r] !== s) {
@@ -812,30 +818,33 @@ function Ft(e, t) {
812
818
  }
813
819
  }, [o, ...t]);
814
820
  }
815
- function Pe(e) {
816
- return an(e) ? (e.nodeName || "").toLowerCase() : "#document";
821
+ function ot() {
822
+ return typeof window < "u";
823
+ }
824
+ function Ae(e) {
825
+ return fn(e) ? (e.nodeName || "").toLowerCase() : "#document";
817
826
  }
818
827
  function ee(e) {
819
828
  var t;
820
829
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
821
830
  }
822
- function ce(e) {
831
+ function ae(e) {
823
832
  var t;
824
- return (t = (an(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
833
+ return (t = (fn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
825
834
  }
826
- function an(e) {
827
- return e instanceof Node || e instanceof ee(e).Node;
835
+ function fn(e) {
836
+ return ot() ? e instanceof Node || e instanceof ee(e).Node : !1;
828
837
  }
829
- function X(e) {
830
- return e instanceof Element || e instanceof ee(e).Element;
838
+ function G(e) {
839
+ return ot() ? e instanceof Element || e instanceof ee(e).Element : !1;
831
840
  }
832
841
  function se(e) {
833
- return e instanceof HTMLElement || e instanceof ee(e).HTMLElement;
842
+ return ot() ? e instanceof HTMLElement || e instanceof ee(e).HTMLElement : !1;
834
843
  }
835
- function Lt(e) {
836
- return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
844
+ function zt(e) {
845
+ return !ot() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
837
846
  }
838
- function Be(e) {
847
+ function We(e) {
839
848
  const {
840
849
  overflow: t,
841
850
  overflowX: n,
@@ -844,10 +853,10 @@ function Be(e) {
844
853
  } = ie(e);
845
854
  return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
846
855
  }
847
- function Do(e) {
848
- return ["table", "td", "th"].includes(Pe(e));
856
+ function Lo(e) {
857
+ return ["table", "td", "th"].includes(Ae(e));
849
858
  }
850
- function ot(e) {
859
+ function it(e) {
851
860
  return [":popover-open", ":modal"].some((t) => {
852
861
  try {
853
862
  return e.matches(t);
@@ -856,32 +865,32 @@ function ot(e) {
856
865
  }
857
866
  });
858
867
  }
859
- function wt(e) {
860
- const t = Et(), n = ie(e);
868
+ function St(e) {
869
+ const t = Rt(), n = G(e) ? ie(e) : e;
861
870
  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((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
862
871
  }
863
- function Fo(e) {
864
- let t = fe(e);
872
+ function _o(e) {
873
+ let t = ue(e);
865
874
  for (; se(t) && !Ie(t); ) {
866
- if (ot(t))
867
- return null;
868
- if (wt(t))
875
+ if (St(t))
869
876
  return t;
870
- t = fe(t);
877
+ if (it(t))
878
+ return null;
879
+ t = ue(t);
871
880
  }
872
881
  return null;
873
882
  }
874
- function Et() {
883
+ function Rt() {
875
884
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
876
885
  }
877
886
  function Ie(e) {
878
- return ["html", "body", "#document"].includes(Pe(e));
887
+ return ["html", "body", "#document"].includes(Ae(e));
879
888
  }
880
889
  function ie(e) {
881
890
  return ee(e).getComputedStyle(e);
882
891
  }
883
- function it(e) {
884
- return X(e) ? {
892
+ function rt(e) {
893
+ return G(e) ? {
885
894
  scrollLeft: e.scrollLeft,
886
895
  scrollTop: e.scrollTop
887
896
  } : {
@@ -889,29 +898,36 @@ function it(e) {
889
898
  scrollTop: e.scrollY
890
899
  };
891
900
  }
892
- function fe(e) {
893
- if (Pe(e) === "html")
901
+ function ue(e) {
902
+ if (Ae(e) === "html")
894
903
  return e;
895
904
  const t = (
896
905
  // Step into the shadow DOM of the parent of a slotted node.
897
906
  e.assignedSlot || // DOM Element detected.
898
907
  e.parentNode || // ShadowRoot detected.
899
- Lt(e) && e.host || // Fallback.
900
- ce(e)
908
+ zt(e) && e.host || // Fallback.
909
+ ae(e)
901
910
  );
902
- return Lt(t) ? t.host : t;
911
+ return zt(t) ? t.host : t;
903
912
  }
904
- function cn(e) {
905
- const t = fe(e);
906
- return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && Be(t) ? t : cn(t);
913
+ function dn(e) {
914
+ const t = ue(e);
915
+ return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && We(t) ? t : dn(t);
907
916
  }
908
- function ze(e, t, n) {
917
+ function ke(e, t, n) {
909
918
  var o;
910
919
  t === void 0 && (t = []), n === void 0 && (n = !0);
911
- const i = cn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = ee(i);
912
- return r ? t.concat(s, s.visualViewport || [], Be(i) ? i : [], s.frameElement && n ? ze(s.frameElement) : []) : t.concat(i, ze(i, [], n));
920
+ const i = dn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = ee(i);
921
+ if (r) {
922
+ const l = ht(s);
923
+ return t.concat(s, s.visualViewport || [], We(i) ? i : [], l && n ? ke(l) : []);
924
+ }
925
+ return t.concat(i, ke(i, [], n));
913
926
  }
914
- function Lo() {
927
+ function ht(e) {
928
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
929
+ }
930
+ function No() {
915
931
  const e = navigator.userAgentData;
916
932
  return e && Array.isArray(e.brands) ? e.brands.map((t) => {
917
933
  let {
@@ -921,56 +937,56 @@ function Lo() {
921
937
  return n + "/" + o;
922
938
  }).join(" ") : navigator.userAgent;
923
939
  }
924
- const ue = Math.min, Z = Math.max, Je = Math.round, Ke = Math.floor, de = (e) => ({
940
+ const Me = Math.min, K = Math.max, ze = Math.round, Ke = Math.floor, fe = (e) => ({
925
941
  x: e,
926
942
  y: e
927
- }), _o = {
943
+ }), ko = {
928
944
  left: "right",
929
945
  right: "left",
930
946
  bottom: "top",
931
947
  top: "bottom"
932
- }, ko = {
948
+ }, zo = {
933
949
  start: "end",
934
950
  end: "start"
935
951
  };
936
- function _t(e, t, n) {
937
- return Z(e, ue(t, n));
952
+ function Ht(e, t, n) {
953
+ return K(e, Me(t, n));
938
954
  }
939
- function Ae(e, t) {
955
+ function $e(e, t) {
940
956
  return typeof e == "function" ? e(t) : e;
941
957
  }
942
- function me(e) {
958
+ function de(e) {
943
959
  return e.split("-")[0];
944
960
  }
945
961
  function je(e) {
946
962
  return e.split("-")[1];
947
963
  }
948
- function un(e) {
964
+ function mn(e) {
949
965
  return e === "x" ? "y" : "x";
950
966
  }
951
- function fn(e) {
967
+ function pn(e) {
952
968
  return e === "y" ? "height" : "width";
953
969
  }
954
970
  function ye(e) {
955
- return ["top", "bottom"].includes(me(e)) ? "y" : "x";
971
+ return ["top", "bottom"].includes(de(e)) ? "y" : "x";
956
972
  }
957
- function dn(e) {
958
- return un(ye(e));
973
+ function hn(e) {
974
+ return mn(ye(e));
959
975
  }
960
- function No(e, t, n) {
976
+ function Ho(e, t, n) {
961
977
  n === void 0 && (n = !1);
962
- const o = je(e), i = dn(e), r = fn(i);
978
+ const o = je(e), i = hn(e), r = pn(i);
963
979
  let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
964
980
  return t.reference[r] > t.floating[r] && (s = Qe(s)), [s, Qe(s)];
965
981
  }
966
- function zo(e) {
982
+ function Vo(e) {
967
983
  const t = Qe(e);
968
- return [mt(e), t, mt(t)];
984
+ return [gt(e), t, gt(t)];
969
985
  }
970
- function mt(e) {
971
- return e.replace(/start|end/g, (t) => ko[t]);
986
+ function gt(e) {
987
+ return e.replace(/start|end/g, (t) => zo[t]);
972
988
  }
973
- function Ho(e, t, n) {
989
+ function Bo(e, t, n) {
974
990
  const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
975
991
  switch (e) {
976
992
  case "top":
@@ -983,15 +999,15 @@ function Ho(e, t, n) {
983
999
  return [];
984
1000
  }
985
1001
  }
986
- function Vo(e, t, n, o) {
1002
+ function Wo(e, t, n, o) {
987
1003
  const i = je(e);
988
- let r = Ho(me(e), n === "start", o);
989
- return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(mt)))), r;
1004
+ let r = Bo(de(e), n === "start", o);
1005
+ return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(gt)))), r;
990
1006
  }
991
1007
  function Qe(e) {
992
- return e.replace(/left|right|bottom|top/g, (t) => _o[t]);
1008
+ return e.replace(/left|right|bottom|top/g, (t) => ko[t]);
993
1009
  }
994
- function Wo(e) {
1010
+ function jo(e) {
995
1011
  return {
996
1012
  top: 0,
997
1013
  right: 0,
@@ -1000,8 +1016,8 @@ function Wo(e) {
1000
1016
  ...e
1001
1017
  };
1002
1018
  }
1003
- function Bo(e) {
1004
- return typeof e != "number" ? Wo(e) : {
1019
+ function Uo(e) {
1020
+ return typeof e != "number" ? jo(e) : {
1005
1021
  top: e,
1006
1022
  right: e,
1007
1023
  bottom: e,
@@ -1026,116 +1042,116 @@ function Ze(e) {
1026
1042
  y: n
1027
1043
  };
1028
1044
  }
1029
- function kt(e, t, n) {
1045
+ function Vt(e, t, n) {
1030
1046
  let {
1031
1047
  reference: o,
1032
1048
  floating: i
1033
1049
  } = e;
1034
- const r = ye(t), s = dn(t), l = fn(s), a = me(t), c = r === "y", f = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
1035
- let u;
1050
+ const r = ye(t), s = hn(t), l = pn(s), a = de(t), u = r === "y", c = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
1051
+ let f;
1036
1052
  switch (a) {
1037
1053
  case "top":
1038
- u = {
1039
- x: f,
1054
+ f = {
1055
+ x: c,
1040
1056
  y: o.y - i.height
1041
1057
  };
1042
1058
  break;
1043
1059
  case "bottom":
1044
- u = {
1045
- x: f,
1060
+ f = {
1061
+ x: c,
1046
1062
  y: o.y + o.height
1047
1063
  };
1048
1064
  break;
1049
1065
  case "right":
1050
- u = {
1066
+ f = {
1051
1067
  x: o.x + o.width,
1052
1068
  y: d
1053
1069
  };
1054
1070
  break;
1055
1071
  case "left":
1056
- u = {
1072
+ f = {
1057
1073
  x: o.x - i.width,
1058
1074
  y: d
1059
1075
  };
1060
1076
  break;
1061
1077
  default:
1062
- u = {
1078
+ f = {
1063
1079
  x: o.x,
1064
1080
  y: o.y
1065
1081
  };
1066
1082
  }
1067
1083
  switch (je(t)) {
1068
1084
  case "start":
1069
- u[s] -= p * (n && c ? -1 : 1);
1085
+ f[s] -= p * (n && u ? -1 : 1);
1070
1086
  break;
1071
1087
  case "end":
1072
- u[s] += p * (n && c ? -1 : 1);
1088
+ f[s] += p * (n && u ? -1 : 1);
1073
1089
  break;
1074
1090
  }
1075
- return u;
1091
+ return f;
1076
1092
  }
1077
- const jo = async (e, t, n) => {
1093
+ const Yo = async (e, t, n) => {
1078
1094
  const {
1079
1095
  placement: o = "bottom",
1080
1096
  strategy: i = "absolute",
1081
1097
  middleware: r = [],
1082
1098
  platform: s
1083
1099
  } = n, l = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
1084
- let c = await s.getElementRects({
1100
+ let u = await s.getElementRects({
1085
1101
  reference: e,
1086
1102
  floating: t,
1087
1103
  strategy: i
1088
1104
  }), {
1089
- x: f,
1105
+ x: c,
1090
1106
  y: d
1091
- } = kt(c, o, a), p = o, u = {}, m = 0;
1107
+ } = Vt(u, o, a), p = o, f = {}, m = 0;
1092
1108
  for (let h = 0; h < l.length; h++) {
1093
1109
  const {
1094
1110
  name: g,
1095
1111
  fn: v
1096
1112
  } = l[h], {
1097
- x: E,
1113
+ x: y,
1098
1114
  y: b,
1099
- data: x,
1115
+ data: E,
1100
1116
  reset: O
1101
1117
  } = await v({
1102
- x: f,
1118
+ x: c,
1103
1119
  y: d,
1104
1120
  initialPlacement: o,
1105
1121
  placement: p,
1106
1122
  strategy: i,
1107
- middlewareData: u,
1108
- rects: c,
1123
+ middlewareData: f,
1124
+ rects: u,
1109
1125
  platform: s,
1110
1126
  elements: {
1111
1127
  reference: e,
1112
1128
  floating: t
1113
1129
  }
1114
1130
  });
1115
- f = E ?? f, d = b ?? d, u = {
1116
- ...u,
1131
+ c = y ?? c, d = b ?? d, f = {
1132
+ ...f,
1117
1133
  [g]: {
1118
- ...u[g],
1119
- ...x
1134
+ ...f[g],
1135
+ ...E
1120
1136
  }
1121
- }, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (c = O.rects === !0 ? await s.getElementRects({
1137
+ }, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (u = O.rects === !0 ? await s.getElementRects({
1122
1138
  reference: e,
1123
1139
  floating: t,
1124
1140
  strategy: i
1125
1141
  }) : O.rects), {
1126
- x: f,
1142
+ x: c,
1127
1143
  y: d
1128
- } = kt(c, p, a)), h = -1);
1144
+ } = Vt(u, p, a)), h = -1);
1129
1145
  }
1130
1146
  return {
1131
- x: f,
1147
+ x: c,
1132
1148
  y: d,
1133
1149
  placement: p,
1134
1150
  strategy: i,
1135
- middlewareData: u
1151
+ middlewareData: f
1136
1152
  };
1137
1153
  };
1138
- async function rt(e, t) {
1154
+ async function lt(e, t) {
1139
1155
  var n;
1140
1156
  t === void 0 && (t = {});
1141
1157
  const {
@@ -1146,22 +1162,22 @@ async function rt(e, t) {
1146
1162
  elements: l,
1147
1163
  strategy: a
1148
1164
  } = e, {
1149
- boundary: c = "clippingAncestors",
1150
- rootBoundary: f = "viewport",
1165
+ boundary: u = "clippingAncestors",
1166
+ rootBoundary: c = "viewport",
1151
1167
  elementContext: d = "floating",
1152
1168
  altBoundary: p = !1,
1153
- padding: u = 0
1154
- } = Ae(t, e), m = Bo(u), g = l[p ? d === "floating" ? "reference" : "floating" : d], v = Ze(await r.getClippingRect({
1169
+ padding: f = 0
1170
+ } = $e(t, e), m = Uo(f), g = l[p ? d === "floating" ? "reference" : "floating" : d], v = Ze(await r.getClippingRect({
1155
1171
  element: (n = await (r.isElement == null ? void 0 : r.isElement(g))) == null || n ? g : g.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
1156
- boundary: c,
1157
- rootBoundary: f,
1172
+ boundary: u,
1173
+ rootBoundary: c,
1158
1174
  strategy: a
1159
- })), E = d === "floating" ? {
1175
+ })), y = d === "floating" ? {
1160
1176
  x: o,
1161
1177
  y: i,
1162
1178
  width: s.floating.width,
1163
1179
  height: s.floating.height
1164
- } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), x = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
1180
+ } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), E = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
1165
1181
  x: 1,
1166
1182
  y: 1
1167
1183
  } : {
@@ -1169,18 +1185,18 @@ async function rt(e, t) {
1169
1185
  y: 1
1170
1186
  }, O = Ze(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
1171
1187
  elements: l,
1172
- rect: E,
1188
+ rect: y,
1173
1189
  offsetParent: b,
1174
1190
  strategy: a
1175
- }) : E);
1191
+ }) : y);
1176
1192
  return {
1177
- top: (v.top - O.top + m.top) / x.y,
1178
- bottom: (O.bottom - v.bottom + m.bottom) / x.y,
1179
- left: (v.left - O.left + m.left) / x.x,
1180
- right: (O.right - v.right + m.right) / x.x
1193
+ top: (v.top - O.top + m.top) / E.y,
1194
+ bottom: (O.bottom - v.bottom + m.bottom) / E.y,
1195
+ left: (v.left - O.left + m.left) / E.x,
1196
+ right: (O.right - v.right + m.right) / E.x
1181
1197
  };
1182
1198
  }
1183
- const Uo = function(e) {
1199
+ const qo = function(e) {
1184
1200
  return e === void 0 && (e = {}), {
1185
1201
  name: "flip",
1186
1202
  options: e,
@@ -1192,67 +1208,67 @@ const Uo = function(e) {
1192
1208
  rects: s,
1193
1209
  initialPlacement: l,
1194
1210
  platform: a,
1195
- elements: c
1211
+ elements: u
1196
1212
  } = t, {
1197
- mainAxis: f = !0,
1213
+ mainAxis: c = !0,
1198
1214
  crossAxis: d = !0,
1199
1215
  fallbackPlacements: p,
1200
- fallbackStrategy: u = "bestFit",
1216
+ fallbackStrategy: f = "bestFit",
1201
1217
  fallbackAxisSideDirection: m = "none",
1202
1218
  flipAlignment: h = !0,
1203
1219
  ...g
1204
- } = Ae(e, t);
1220
+ } = $e(e, t);
1205
1221
  if ((n = r.arrow) != null && n.alignmentOffset)
1206
1222
  return {};
1207
- const v = me(i), E = ye(l), b = me(l) === l, x = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), O = p || (b || !h ? [Qe(l)] : zo(l)), S = m !== "none";
1208
- !p && S && O.push(...Vo(l, h, m, x));
1209
- const M = [l, ...O], C = await rt(t, g), N = [];
1210
- let $ = ((o = r.flip) == null ? void 0 : o.overflows) || [];
1211
- if (f && N.push(C[v]), d) {
1212
- const w = No(i, s, x);
1213
- N.push(C[w[0]], C[w[1]]);
1223
+ const v = de(i), y = ye(l), b = de(l) === l, E = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), O = p || (b || !h ? [Qe(l)] : Vo(l)), C = m !== "none";
1224
+ !p && C && O.push(...Wo(l, h, m, E));
1225
+ const T = [l, ...O], S = await lt(t, g), L = [];
1226
+ let A = ((o = r.flip) == null ? void 0 : o.overflows) || [];
1227
+ if (c && L.push(S[v]), d) {
1228
+ const x = Ho(i, s, E);
1229
+ L.push(S[x[0]], S[x[1]]);
1214
1230
  }
1215
- if ($ = [...$, {
1231
+ if (A = [...A, {
1216
1232
  placement: i,
1217
- overflows: N
1218
- }], !N.every((w) => w <= 0)) {
1233
+ overflows: L
1234
+ }], !L.every((x) => x <= 0)) {
1219
1235
  var D, k;
1220
- const w = (((D = r.flip) == null ? void 0 : D.index) || 0) + 1, F = M[w];
1221
- if (F)
1236
+ const x = (((D = r.flip) == null ? void 0 : D.index) || 0) + 1, B = T[x];
1237
+ if (B)
1222
1238
  return {
1223
1239
  data: {
1224
- index: w,
1225
- overflows: $
1240
+ index: x,
1241
+ overflows: A
1226
1242
  },
1227
1243
  reset: {
1228
- placement: F
1244
+ placement: B
1229
1245
  }
1230
1246
  };
1231
- let j = (k = $.filter((P) => P.overflows[0] <= 0).sort((P, L) => P.overflows[1] - L.overflows[1])[0]) == null ? void 0 : k.placement;
1232
- if (!j)
1233
- switch (u) {
1247
+ let _ = (k = A.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : k.placement;
1248
+ if (!_)
1249
+ switch (f) {
1234
1250
  case "bestFit": {
1235
- var z;
1236
- const P = (z = $.filter((L) => {
1237
- if (S) {
1238
- const A = ye(L.placement);
1239
- return A === E || // Create a bias to the `y` side axis due to horizontal
1251
+ var F;
1252
+ const z = (F = A.filter((P) => {
1253
+ if (C) {
1254
+ const $ = ye(P.placement);
1255
+ return $ === y || // Create a bias to the `y` side axis due to horizontal
1240
1256
  // reading directions favoring greater width.
1241
- A === "y";
1257
+ $ === "y";
1242
1258
  }
1243
1259
  return !0;
1244
- }).map((L) => [L.placement, L.overflows.filter((A) => A > 0).reduce((A, J) => A + J, 0)]).sort((L, A) => L[1] - A[1])[0]) == null ? void 0 : z[0];
1245
- P && (j = P);
1260
+ }).map((P) => [P.placement, P.overflows.filter(($) => $ > 0).reduce(($, H) => $ + H, 0)]).sort((P, $) => P[1] - $[1])[0]) == null ? void 0 : F[0];
1261
+ z && (_ = z);
1246
1262
  break;
1247
1263
  }
1248
1264
  case "initialPlacement":
1249
- j = l;
1265
+ _ = l;
1250
1266
  break;
1251
1267
  }
1252
- if (i !== j)
1268
+ if (i !== _)
1253
1269
  return {
1254
1270
  reset: {
1255
- placement: j
1271
+ placement: _
1256
1272
  }
1257
1273
  };
1258
1274
  }
@@ -1260,35 +1276,34 @@ const Uo = function(e) {
1260
1276
  }
1261
1277
  };
1262
1278
  };
1263
- async function Yo(e, t) {
1279
+ async function Ko(e, t) {
1264
1280
  const {
1265
1281
  placement: n,
1266
1282
  platform: o,
1267
1283
  elements: i
1268
- } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = me(n), l = je(n), a = ye(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, f = r && a ? -1 : 1, d = Ae(t, e);
1284
+ } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = de(n), l = je(n), a = ye(n) === "y", u = ["left", "top"].includes(s) ? -1 : 1, c = r && a ? -1 : 1, d = $e(t, e);
1269
1285
  let {
1270
1286
  mainAxis: p,
1271
- crossAxis: u,
1287
+ crossAxis: f,
1272
1288
  alignmentAxis: m
1273
1289
  } = typeof d == "number" ? {
1274
1290
  mainAxis: d,
1275
1291
  crossAxis: 0,
1276
1292
  alignmentAxis: null
1277
1293
  } : {
1278
- mainAxis: 0,
1279
- crossAxis: 0,
1280
- alignmentAxis: null,
1281
- ...d
1294
+ mainAxis: d.mainAxis || 0,
1295
+ crossAxis: d.crossAxis || 0,
1296
+ alignmentAxis: d.alignmentAxis
1282
1297
  };
1283
- return l && typeof m == "number" && (u = l === "end" ? m * -1 : m), a ? {
1284
- x: u * f,
1285
- y: p * c
1298
+ return l && typeof m == "number" && (f = l === "end" ? m * -1 : m), a ? {
1299
+ x: f * c,
1300
+ y: p * u
1286
1301
  } : {
1287
- x: p * c,
1288
- y: u * f
1302
+ x: p * u,
1303
+ y: f * c
1289
1304
  };
1290
1305
  }
1291
- const qo = function(e) {
1306
+ const Go = function(e) {
1292
1307
  return e === void 0 && (e = 0), {
1293
1308
  name: "offset",
1294
1309
  options: e,
@@ -1299,7 +1314,7 @@ const qo = function(e) {
1299
1314
  y: r,
1300
1315
  placement: s,
1301
1316
  middlewareData: l
1302
- } = t, a = await Yo(t, e);
1317
+ } = t, a = await Ko(t, e);
1303
1318
  return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
1304
1319
  x: i + a.x,
1305
1320
  y: r + a.y,
@@ -1310,7 +1325,7 @@ const qo = function(e) {
1310
1325
  };
1311
1326
  }
1312
1327
  };
1313
- }, Ko = function(e) {
1328
+ }, Xo = function(e) {
1314
1329
  return e === void 0 && (e = {}), {
1315
1330
  name: "shift",
1316
1331
  options: e,
@@ -1326,75 +1341,80 @@ const qo = function(e) {
1326
1341
  fn: (g) => {
1327
1342
  let {
1328
1343
  x: v,
1329
- y: E
1344
+ y
1330
1345
  } = g;
1331
1346
  return {
1332
1347
  x: v,
1333
- y: E
1348
+ y
1334
1349
  };
1335
1350
  }
1336
1351
  },
1337
1352
  ...a
1338
- } = Ae(e, t), c = {
1353
+ } = $e(e, t), u = {
1339
1354
  x: n,
1340
1355
  y: o
1341
- }, f = await rt(t, a), d = ye(me(i)), p = un(d);
1342
- let u = c[p], m = c[d];
1356
+ }, c = await lt(t, a), d = ye(de(i)), p = mn(d);
1357
+ let f = u[p], m = u[d];
1343
1358
  if (r) {
1344
- const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", E = u + f[g], b = u - f[v];
1345
- u = _t(E, u, b);
1359
+ const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", y = f + c[g], b = f - c[v];
1360
+ f = Ht(y, f, b);
1346
1361
  }
1347
1362
  if (s) {
1348
- const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", E = m + f[g], b = m - f[v];
1349
- m = _t(E, m, b);
1363
+ const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", y = m + c[g], b = m - c[v];
1364
+ m = Ht(y, m, b);
1350
1365
  }
1351
1366
  const h = l.fn({
1352
1367
  ...t,
1353
- [p]: u,
1368
+ [p]: f,
1354
1369
  [d]: m
1355
1370
  });
1356
1371
  return {
1357
1372
  ...h,
1358
1373
  data: {
1359
1374
  x: h.x - n,
1360
- y: h.y - o
1375
+ y: h.y - o,
1376
+ enabled: {
1377
+ [p]: r,
1378
+ [d]: s
1379
+ }
1361
1380
  }
1362
1381
  };
1363
1382
  }
1364
1383
  };
1365
- }, Go = function(e) {
1384
+ }, Jo = function(e) {
1366
1385
  return e === void 0 && (e = {}), {
1367
1386
  name: "size",
1368
1387
  options: e,
1369
1388
  async fn(t) {
1389
+ var n, o;
1370
1390
  const {
1371
- placement: n,
1372
- rects: o,
1373
- platform: i,
1374
- elements: r
1391
+ placement: i,
1392
+ rects: r,
1393
+ platform: s,
1394
+ elements: l
1375
1395
  } = t, {
1376
- apply: s = () => {
1396
+ apply: a = () => {
1377
1397
  },
1378
- ...l
1379
- } = Ae(e, t), a = await rt(t, l), c = me(n), f = je(n), d = ye(n) === "y", {
1380
- width: p,
1381
- height: u
1382
- } = o.floating;
1383
- let m, h;
1384
- c === "top" || c === "bottom" ? (m = c, h = f === (await (i.isRTL == null ? void 0 : i.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (h = c, m = f === "end" ? "top" : "bottom");
1385
- const g = u - a.top - a.bottom, v = p - a.left - a.right, E = ue(u - a[m], g), b = ue(p - a[h], v), x = !t.middlewareData.shift;
1386
- let O = E, S = b;
1387
- if (d ? S = f || x ? ue(b, v) : v : O = f || x ? ue(E, g) : g, x && !f) {
1388
- const C = Z(a.left, 0), N = Z(a.right, 0), $ = Z(a.top, 0), D = Z(a.bottom, 0);
1389
- d ? S = p - 2 * (C !== 0 || N !== 0 ? C + N : Z(a.left, a.right)) : O = u - 2 * ($ !== 0 || D !== 0 ? $ + D : Z(a.top, a.bottom));
1398
+ ...u
1399
+ } = $e(e, t), c = await lt(t, u), d = de(i), p = je(i), f = ye(i) === "y", {
1400
+ width: m,
1401
+ height: h
1402
+ } = r.floating;
1403
+ let g, v;
1404
+ d === "top" || d === "bottom" ? (g = d, v = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (v = d, g = p === "end" ? "top" : "bottom");
1405
+ const y = h - c.top - c.bottom, b = m - c.left - c.right, E = Me(h - c[g], y), O = Me(m - c[v], b), C = !t.middlewareData.shift;
1406
+ let T = E, S = O;
1407
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = b), (o = t.middlewareData.shift) != null && o.enabled.y && (T = y), C && !p) {
1408
+ const A = K(c.left, 0), D = K(c.right, 0), k = K(c.top, 0), F = K(c.bottom, 0);
1409
+ f ? S = m - 2 * (A !== 0 || D !== 0 ? A + D : K(c.left, c.right)) : T = h - 2 * (k !== 0 || F !== 0 ? k + F : K(c.top, c.bottom));
1390
1410
  }
1391
- await s({
1411
+ await a({
1392
1412
  ...t,
1393
1413
  availableWidth: S,
1394
- availableHeight: O
1414
+ availableHeight: T
1395
1415
  });
1396
- const M = await i.getDimensions(r.floating);
1397
- return p !== M.width || u !== M.height ? {
1416
+ const L = await s.getDimensions(l.floating);
1417
+ return m !== L.width || h !== L.height ? {
1398
1418
  reset: {
1399
1419
  rects: !0
1400
1420
  }
@@ -1402,117 +1422,118 @@ const qo = function(e) {
1402
1422
  }
1403
1423
  };
1404
1424
  };
1405
- function mn(e) {
1425
+ function gn(e) {
1406
1426
  const t = ie(e);
1407
1427
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1408
- const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l = Je(n) !== r || Je(o) !== s;
1428
+ const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l = ze(n) !== r || ze(o) !== s;
1409
1429
  return l && (n = r, o = s), {
1410
1430
  width: n,
1411
1431
  height: o,
1412
1432
  $: l
1413
1433
  };
1414
1434
  }
1415
- function yt(e) {
1416
- return X(e) ? e : e.contextElement;
1435
+ function Ct(e) {
1436
+ return G(e) ? e : e.contextElement;
1417
1437
  }
1418
1438
  function Ce(e) {
1419
- const t = yt(e);
1439
+ const t = Ct(e);
1420
1440
  if (!se(t))
1421
- return de(1);
1441
+ return fe(1);
1422
1442
  const n = t.getBoundingClientRect(), {
1423
1443
  width: o,
1424
1444
  height: i,
1425
1445
  $: r
1426
- } = mn(t);
1427
- let s = (r ? Je(n.width) : n.width) / o, l = (r ? Je(n.height) : n.height) / i;
1446
+ } = gn(t);
1447
+ let s = (r ? ze(n.width) : n.width) / o, l = (r ? ze(n.height) : n.height) / i;
1428
1448
  return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1429
1449
  x: s,
1430
1450
  y: l
1431
1451
  };
1432
1452
  }
1433
- const Xo = /* @__PURE__ */ de(0);
1434
- function pn(e) {
1453
+ const Qo = /* @__PURE__ */ fe(0);
1454
+ function vn(e) {
1435
1455
  const t = ee(e);
1436
- return !Et() || !t.visualViewport ? Xo : {
1456
+ return !Rt() || !t.visualViewport ? Qo : {
1437
1457
  x: t.visualViewport.offsetLeft,
1438
1458
  y: t.visualViewport.offsetTop
1439
1459
  };
1440
1460
  }
1441
- function Jo(e, t, n) {
1461
+ function Zo(e, t, n) {
1442
1462
  return t === void 0 && (t = !1), !n || t && n !== ee(e) ? !1 : t;
1443
1463
  }
1444
- function Oe(e, t, n, o) {
1464
+ function Ee(e, t, n, o) {
1445
1465
  t === void 0 && (t = !1), n === void 0 && (n = !1);
1446
- const i = e.getBoundingClientRect(), r = yt(e);
1447
- let s = de(1);
1448
- t && (o ? X(o) && (s = Ce(o)) : s = Ce(e));
1449
- const l = Jo(r, n, o) ? pn(r) : de(0);
1450
- let a = (i.left + l.x) / s.x, c = (i.top + l.y) / s.y, f = i.width / s.x, d = i.height / s.y;
1466
+ const i = e.getBoundingClientRect(), r = Ct(e);
1467
+ let s = fe(1);
1468
+ t && (o ? G(o) && (s = Ce(o)) : s = Ce(e));
1469
+ const l = Zo(r, n, o) ? vn(r) : fe(0);
1470
+ let a = (i.left + l.x) / s.x, u = (i.top + l.y) / s.y, c = i.width / s.x, d = i.height / s.y;
1451
1471
  if (r) {
1452
- const p = ee(r), u = o && X(o) ? ee(o) : o;
1453
- let m = p, h = m.frameElement;
1454
- for (; h && o && u !== m; ) {
1455
- const g = Ce(h), v = h.getBoundingClientRect(), E = ie(h), b = v.left + (h.clientLeft + parseFloat(E.paddingLeft)) * g.x, x = v.top + (h.clientTop + parseFloat(E.paddingTop)) * g.y;
1456
- a *= g.x, c *= g.y, f *= g.x, d *= g.y, a += b, c += x, m = ee(h), h = m.frameElement;
1472
+ const p = ee(r), f = o && G(o) ? ee(o) : o;
1473
+ let m = p, h = ht(m);
1474
+ for (; h && o && f !== m; ) {
1475
+ const g = Ce(h), v = h.getBoundingClientRect(), y = ie(h), b = v.left + (h.clientLeft + parseFloat(y.paddingLeft)) * g.x, E = v.top + (h.clientTop + parseFloat(y.paddingTop)) * g.y;
1476
+ a *= g.x, u *= g.y, c *= g.x, d *= g.y, a += b, u += E, m = ee(h), h = ht(m);
1457
1477
  }
1458
1478
  }
1459
1479
  return Ze({
1460
- width: f,
1480
+ width: c,
1461
1481
  height: d,
1462
1482
  x: a,
1463
- y: c
1483
+ y: u
1464
1484
  });
1465
1485
  }
1466
- function Qo(e) {
1486
+ function ei(e) {
1467
1487
  let {
1468
1488
  elements: t,
1469
1489
  rect: n,
1470
1490
  offsetParent: o,
1471
1491
  strategy: i
1472
1492
  } = e;
1473
- const r = i === "fixed", s = ce(o), l = t ? ot(t.floating) : !1;
1493
+ const r = i === "fixed", s = ae(o), l = t ? it(t.floating) : !1;
1474
1494
  if (o === s || l && r)
1475
1495
  return n;
1476
1496
  let a = {
1477
1497
  scrollLeft: 0,
1478
1498
  scrollTop: 0
1479
- }, c = de(1);
1480
- const f = de(0), d = se(o);
1481
- if ((d || !d && !r) && ((Pe(o) !== "body" || Be(s)) && (a = it(o)), se(o))) {
1482
- const p = Oe(o);
1483
- c = Ce(o), f.x = p.x + o.clientLeft, f.y = p.y + o.clientTop;
1499
+ }, u = fe(1);
1500
+ const c = fe(0), d = se(o);
1501
+ if ((d || !d && !r) && ((Ae(o) !== "body" || We(s)) && (a = rt(o)), se(o))) {
1502
+ const p = Ee(o);
1503
+ u = Ce(o), c.x = p.x + o.clientLeft, c.y = p.y + o.clientTop;
1484
1504
  }
1485
1505
  return {
1486
- width: n.width * c.x,
1487
- height: n.height * c.y,
1488
- x: n.x * c.x - a.scrollLeft * c.x + f.x,
1489
- y: n.y * c.y - a.scrollTop * c.y + f.y
1506
+ width: n.width * u.x,
1507
+ height: n.height * u.y,
1508
+ x: n.x * u.x - a.scrollLeft * u.x + c.x,
1509
+ y: n.y * u.y - a.scrollTop * u.y + c.y
1490
1510
  };
1491
1511
  }
1492
- function Zo(e) {
1512
+ function ti(e) {
1493
1513
  return Array.from(e.getClientRects());
1494
1514
  }
1495
- function hn(e) {
1496
- return Oe(ce(e)).left + it(e).scrollLeft;
1515
+ function vt(e, t) {
1516
+ const n = rt(e).scrollLeft;
1517
+ return t ? t.left + n : Ee(ae(e)).left + n;
1497
1518
  }
1498
- function ei(e) {
1499
- const t = ce(e), n = it(e), o = e.ownerDocument.body, i = Z(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = Z(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1500
- let s = -n.scrollLeft + hn(e);
1519
+ function ni(e) {
1520
+ const t = ae(e), n = rt(e), o = e.ownerDocument.body, i = K(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = K(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1521
+ let s = -n.scrollLeft + vt(e);
1501
1522
  const l = -n.scrollTop;
1502
- return ie(o).direction === "rtl" && (s += Z(t.clientWidth, o.clientWidth) - i), {
1523
+ return ie(o).direction === "rtl" && (s += K(t.clientWidth, o.clientWidth) - i), {
1503
1524
  width: i,
1504
1525
  height: r,
1505
1526
  x: s,
1506
1527
  y: l
1507
1528
  };
1508
1529
  }
1509
- function ti(e, t) {
1510
- const n = ee(e), o = ce(e), i = n.visualViewport;
1530
+ function oi(e, t) {
1531
+ const n = ee(e), o = ae(e), i = n.visualViewport;
1511
1532
  let r = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
1512
1533
  if (i) {
1513
1534
  r = i.width, s = i.height;
1514
- const c = Et();
1515
- (!c || c && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
1535
+ const u = Rt();
1536
+ (!u || u && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
1516
1537
  }
1517
1538
  return {
1518
1539
  width: r,
@@ -1521,25 +1542,25 @@ function ti(e, t) {
1521
1542
  y: a
1522
1543
  };
1523
1544
  }
1524
- function ni(e, t) {
1525
- const n = Oe(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = se(e) ? Ce(e) : de(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = i * r.x, c = o * r.y;
1545
+ function ii(e, t) {
1546
+ const n = Ee(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = se(e) ? Ce(e) : fe(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = i * r.x, u = o * r.y;
1526
1547
  return {
1527
1548
  width: s,
1528
1549
  height: l,
1529
1550
  x: a,
1530
- y: c
1551
+ y: u
1531
1552
  };
1532
1553
  }
1533
- function Nt(e, t, n) {
1554
+ function Bt(e, t, n) {
1534
1555
  let o;
1535
1556
  if (t === "viewport")
1536
- o = ti(e, n);
1557
+ o = oi(e, n);
1537
1558
  else if (t === "document")
1538
- o = ei(ce(e));
1539
- else if (X(t))
1540
- o = ni(t, n);
1559
+ o = ni(ae(e));
1560
+ else if (G(t))
1561
+ o = ii(t, n);
1541
1562
  else {
1542
- const i = pn(e);
1563
+ const i = vn(e);
1543
1564
  o = {
1544
1565
  ...t,
1545
1566
  x: t.x - i.x,
@@ -1548,34 +1569,34 @@ function Nt(e, t, n) {
1548
1569
  }
1549
1570
  return Ze(o);
1550
1571
  }
1551
- function gn(e, t) {
1552
- const n = fe(e);
1553
- return n === t || !X(n) || Ie(n) ? !1 : ie(n).position === "fixed" || gn(n, t);
1572
+ function bn(e, t) {
1573
+ const n = ue(e);
1574
+ return n === t || !G(n) || Ie(n) ? !1 : ie(n).position === "fixed" || bn(n, t);
1554
1575
  }
1555
- function oi(e, t) {
1576
+ function ri(e, t) {
1556
1577
  const n = t.get(e);
1557
1578
  if (n)
1558
1579
  return n;
1559
- let o = ze(e, [], !1).filter((l) => X(l) && Pe(l) !== "body"), i = null;
1580
+ let o = ke(e, [], !1).filter((l) => G(l) && Ae(l) !== "body"), i = null;
1560
1581
  const r = ie(e).position === "fixed";
1561
- let s = r ? fe(e) : e;
1562
- for (; X(s) && !Ie(s); ) {
1563
- const l = ie(s), a = wt(s);
1564
- !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Be(s) && !a && gn(e, s)) ? o = o.filter((f) => f !== s) : i = l, s = fe(s);
1582
+ let s = r ? ue(e) : e;
1583
+ for (; G(s) && !Ie(s); ) {
1584
+ const l = ie(s), a = St(s);
1585
+ !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || We(s) && !a && bn(e, s)) ? o = o.filter((c) => c !== s) : i = l, s = ue(s);
1565
1586
  }
1566
1587
  return t.set(e, o), o;
1567
1588
  }
1568
- function ii(e) {
1589
+ function li(e) {
1569
1590
  let {
1570
1591
  element: t,
1571
1592
  boundary: n,
1572
1593
  rootBoundary: o,
1573
1594
  strategy: i
1574
1595
  } = e;
1575
- const s = [...n === "clippingAncestors" ? ot(t) ? [] : oi(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((c, f) => {
1576
- const d = Nt(t, f, i);
1577
- return c.top = Z(d.top, c.top), c.right = ue(d.right, c.right), c.bottom = ue(d.bottom, c.bottom), c.left = Z(d.left, c.left), c;
1578
- }, Nt(t, l, i));
1596
+ const s = [...n === "clippingAncestors" ? it(t) ? [] : ri(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((u, c) => {
1597
+ const d = Bt(t, c, i);
1598
+ return u.top = K(d.top, u.top), u.right = Me(d.right, u.right), u.bottom = Me(d.bottom, u.bottom), u.left = K(d.left, u.left), u;
1599
+ }, Bt(t, l, i));
1579
1600
  return {
1580
1601
  width: a.right - a.left,
1581
1602
  height: a.bottom - a.top,
@@ -1583,64 +1604,75 @@ function ii(e) {
1583
1604
  y: a.top
1584
1605
  };
1585
1606
  }
1586
- function ri(e) {
1607
+ function si(e) {
1587
1608
  const {
1588
1609
  width: t,
1589
1610
  height: n
1590
- } = mn(e);
1611
+ } = gn(e);
1591
1612
  return {
1592
1613
  width: t,
1593
1614
  height: n
1594
1615
  };
1595
1616
  }
1596
- function li(e, t, n) {
1597
- const o = se(t), i = ce(t), r = n === "fixed", s = Oe(e, !0, r, t);
1617
+ function ai(e, t, n) {
1618
+ const o = se(t), i = ae(t), r = n === "fixed", s = Ee(e, !0, r, t);
1598
1619
  let l = {
1599
1620
  scrollLeft: 0,
1600
1621
  scrollTop: 0
1601
1622
  };
1602
- const a = de(0);
1623
+ const a = fe(0);
1603
1624
  if (o || !o && !r)
1604
- if ((Pe(t) !== "body" || Be(i)) && (l = it(t)), o) {
1605
- const d = Oe(t, !0, r, t);
1606
- a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
1607
- } else i && (a.x = hn(i));
1608
- const c = s.left + l.scrollLeft - a.x, f = s.top + l.scrollTop - a.y;
1625
+ if ((Ae(t) !== "body" || We(i)) && (l = rt(t)), o) {
1626
+ const f = Ee(t, !0, r, t);
1627
+ a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
1628
+ } else i && (a.x = vt(i));
1629
+ let u = 0, c = 0;
1630
+ if (i && !o && !r) {
1631
+ const f = i.getBoundingClientRect();
1632
+ c = f.top + l.scrollTop, u = f.left + l.scrollLeft - // RTL <body> scrollbar.
1633
+ vt(i, f);
1634
+ }
1635
+ const d = s.left + l.scrollLeft - a.x - u, p = s.top + l.scrollTop - a.y - c;
1609
1636
  return {
1610
- x: c,
1611
- y: f,
1637
+ x: d,
1638
+ y: p,
1612
1639
  width: s.width,
1613
1640
  height: s.height
1614
1641
  };
1615
1642
  }
1616
- function st(e) {
1643
+ function at(e) {
1617
1644
  return ie(e).position === "static";
1618
1645
  }
1619
- function zt(e, t) {
1620
- return !se(e) || ie(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
1646
+ function Wt(e, t) {
1647
+ if (!se(e) || ie(e).position === "fixed")
1648
+ return null;
1649
+ if (t)
1650
+ return t(e);
1651
+ let n = e.offsetParent;
1652
+ return ae(e) === n && (n = n.ownerDocument.body), n;
1621
1653
  }
1622
- function vn(e, t) {
1654
+ function xn(e, t) {
1623
1655
  const n = ee(e);
1624
- if (ot(e))
1656
+ if (it(e))
1625
1657
  return n;
1626
1658
  if (!se(e)) {
1627
- let i = fe(e);
1659
+ let i = ue(e);
1628
1660
  for (; i && !Ie(i); ) {
1629
- if (X(i) && !st(i))
1661
+ if (G(i) && !at(i))
1630
1662
  return i;
1631
- i = fe(i);
1663
+ i = ue(i);
1632
1664
  }
1633
1665
  return n;
1634
1666
  }
1635
- let o = zt(e, t);
1636
- for (; o && Do(o) && st(o); )
1637
- o = zt(o, t);
1638
- return o && Ie(o) && st(o) && !wt(o) ? n : o || Fo(e) || n;
1667
+ let o = Wt(e, t);
1668
+ for (; o && Lo(o) && at(o); )
1669
+ o = Wt(o, t);
1670
+ return o && Ie(o) && at(o) && !St(o) ? n : o || _o(e) || n;
1639
1671
  }
1640
- const si = async function(e) {
1641
- const t = this.getOffsetParent || vn, n = this.getDimensions, o = await n(e.floating);
1672
+ const ci = async function(e) {
1673
+ const t = this.getOffsetParent || xn, n = this.getDimensions, o = await n(e.floating);
1642
1674
  return {
1643
- reference: li(e.reference, await t(e.floating), e.strategy),
1675
+ reference: ai(e.reference, await t(e.floating), e.strategy),
1644
1676
  floating: {
1645
1677
  x: 0,
1646
1678
  y: 0,
@@ -1649,24 +1681,24 @@ const si = async function(e) {
1649
1681
  }
1650
1682
  };
1651
1683
  };
1652
- function ai(e) {
1684
+ function ui(e) {
1653
1685
  return ie(e).direction === "rtl";
1654
1686
  }
1655
- const ci = {
1656
- convertOffsetParentRelativeRectToViewportRelativeRect: Qo,
1657
- getDocumentElement: ce,
1658
- getClippingRect: ii,
1659
- getOffsetParent: vn,
1660
- getElementRects: si,
1661
- getClientRects: Zo,
1662
- getDimensions: ri,
1687
+ const fi = {
1688
+ convertOffsetParentRelativeRectToViewportRelativeRect: ei,
1689
+ getDocumentElement: ae,
1690
+ getClippingRect: li,
1691
+ getOffsetParent: xn,
1692
+ getElementRects: ci,
1693
+ getClientRects: ti,
1694
+ getDimensions: si,
1663
1695
  getScale: Ce,
1664
- isElement: X,
1665
- isRTL: ai
1696
+ isElement: G,
1697
+ isRTL: ui
1666
1698
  };
1667
- function ui(e, t) {
1699
+ function di(e, t) {
1668
1700
  let n = null, o;
1669
- const i = ce(e);
1701
+ const i = ae(e);
1670
1702
  function r() {
1671
1703
  var l;
1672
1704
  clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
@@ -1674,43 +1706,43 @@ function ui(e, t) {
1674
1706
  function s(l, a) {
1675
1707
  l === void 0 && (l = !1), a === void 0 && (a = 1), r();
1676
1708
  const {
1677
- left: c,
1678
- top: f,
1709
+ left: u,
1710
+ top: c,
1679
1711
  width: d,
1680
1712
  height: p
1681
1713
  } = e.getBoundingClientRect();
1682
1714
  if (l || t(), !d || !p)
1683
1715
  return;
1684
- const u = Ke(f), m = Ke(i.clientWidth - (c + d)), h = Ke(i.clientHeight - (f + p)), g = Ke(c), E = {
1685
- rootMargin: -u + "px " + -m + "px " + -h + "px " + -g + "px",
1686
- threshold: Z(0, ue(1, a)) || 1
1716
+ const f = Ke(c), m = Ke(i.clientWidth - (u + d)), h = Ke(i.clientHeight - (c + p)), g = Ke(u), y = {
1717
+ rootMargin: -f + "px " + -m + "px " + -h + "px " + -g + "px",
1718
+ threshold: K(0, Me(1, a)) || 1
1687
1719
  };
1688
1720
  let b = !0;
1689
- function x(O) {
1690
- const S = O[0].intersectionRatio;
1691
- if (S !== a) {
1721
+ function E(O) {
1722
+ const C = O[0].intersectionRatio;
1723
+ if (C !== a) {
1692
1724
  if (!b)
1693
1725
  return s();
1694
- S ? s(!1, S) : o = setTimeout(() => {
1726
+ C ? s(!1, C) : o = setTimeout(() => {
1695
1727
  s(!1, 1e-7);
1696
1728
  }, 1e3);
1697
1729
  }
1698
1730
  b = !1;
1699
1731
  }
1700
1732
  try {
1701
- n = new IntersectionObserver(x, {
1702
- ...E,
1733
+ n = new IntersectionObserver(E, {
1734
+ ...y,
1703
1735
  // Handle <iframe>s
1704
1736
  root: i.ownerDocument
1705
1737
  });
1706
1738
  } catch {
1707
- n = new IntersectionObserver(x, E);
1739
+ n = new IntersectionObserver(E, y);
1708
1740
  }
1709
1741
  n.observe(e);
1710
1742
  }
1711
1743
  return s(!0), r;
1712
1744
  }
1713
- function fi(e, t, n, o) {
1745
+ function mi(e, t, n, o) {
1714
1746
  o === void 0 && (o = {});
1715
1747
  const {
1716
1748
  ancestorScroll: i = !0,
@@ -1718,48 +1750,48 @@ function fi(e, t, n, o) {
1718
1750
  elementResize: s = typeof ResizeObserver == "function",
1719
1751
  layoutShift: l = typeof IntersectionObserver == "function",
1720
1752
  animationFrame: a = !1
1721
- } = o, c = yt(e), f = i || r ? [...c ? ze(c) : [], ...ze(t)] : [];
1722
- f.forEach((v) => {
1753
+ } = o, u = Ct(e), c = i || r ? [...u ? ke(u) : [], ...ke(t)] : [];
1754
+ c.forEach((v) => {
1723
1755
  i && v.addEventListener("scroll", n, {
1724
1756
  passive: !0
1725
1757
  }), r && v.addEventListener("resize", n);
1726
1758
  });
1727
- const d = c && l ? ui(c, n) : null;
1728
- let p = -1, u = null;
1729
- s && (u = new ResizeObserver((v) => {
1730
- let [E] = v;
1731
- E && E.target === c && u && (u.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1759
+ const d = u && l ? di(u, n) : null;
1760
+ let p = -1, f = null;
1761
+ s && (f = new ResizeObserver((v) => {
1762
+ let [y] = v;
1763
+ y && y.target === u && f && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1732
1764
  var b;
1733
- (b = u) == null || b.observe(t);
1765
+ (b = f) == null || b.observe(t);
1734
1766
  })), n();
1735
- }), c && !a && u.observe(c), u.observe(t));
1736
- let m, h = a ? Oe(e) : null;
1767
+ }), u && !a && f.observe(u), f.observe(t));
1768
+ let m, h = a ? Ee(e) : null;
1737
1769
  a && g();
1738
1770
  function g() {
1739
- const v = Oe(e);
1771
+ const v = Ee(e);
1740
1772
  h && (v.x !== h.x || v.y !== h.y || v.width !== h.width || v.height !== h.height) && n(), h = v, m = requestAnimationFrame(g);
1741
1773
  }
1742
1774
  return n(), () => {
1743
1775
  var v;
1744
- f.forEach((E) => {
1745
- i && E.removeEventListener("scroll", n), r && E.removeEventListener("resize", n);
1746
- }), d == null || d(), (v = u) == null || v.disconnect(), u = null, a && cancelAnimationFrame(m);
1776
+ c.forEach((y) => {
1777
+ i && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
1778
+ }), d == null || d(), (v = f) == null || v.disconnect(), f = null, a && cancelAnimationFrame(m);
1747
1779
  };
1748
1780
  }
1749
- const at = rt, di = qo, mi = Ko, pi = Uo, hi = Go, gi = (e, t, n) => {
1781
+ const ct = lt, pi = Go, hi = Xo, gi = qo, vi = Jo, bi = (e, t, n) => {
1750
1782
  const o = /* @__PURE__ */ new Map(), i = {
1751
- platform: ci,
1783
+ platform: fi,
1752
1784
  ...n
1753
1785
  }, r = {
1754
1786
  ...i.platform,
1755
1787
  _c: o
1756
1788
  };
1757
- return jo(e, t, {
1789
+ return Yo(e, t, {
1758
1790
  ...i,
1759
1791
  platform: r
1760
1792
  });
1761
1793
  };
1762
- var Ge = typeof document < "u" ? en : oe;
1794
+ var Ge = typeof document < "u" ? on : oe;
1763
1795
  function et(e, t) {
1764
1796
  if (e === t)
1765
1797
  return !0;
@@ -1790,20 +1822,20 @@ function et(e, t) {
1790
1822
  }
1791
1823
  return e !== e && t !== t;
1792
1824
  }
1793
- function bn(e) {
1825
+ function wn(e) {
1794
1826
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1795
1827
  }
1796
- function Ht(e, t) {
1797
- const n = bn(e);
1828
+ function jt(e, t) {
1829
+ const n = wn(e);
1798
1830
  return Math.round(t * n) / n;
1799
1831
  }
1800
- function Vt(e) {
1801
- const t = y.useRef(e);
1832
+ function ut(e) {
1833
+ const t = w.useRef(e);
1802
1834
  return Ge(() => {
1803
1835
  t.current = e;
1804
1836
  }), t;
1805
1837
  }
1806
- function vi(e) {
1838
+ function xi(e) {
1807
1839
  e === void 0 && (e = {});
1808
1840
  const {
1809
1841
  placement: t = "bottom",
@@ -1816,138 +1848,142 @@ function vi(e) {
1816
1848
  } = {},
1817
1849
  transform: l = !0,
1818
1850
  whileElementsMounted: a,
1819
- open: c
1820
- } = e, [f, d] = y.useState({
1851
+ open: u
1852
+ } = e, [c, d] = w.useState({
1821
1853
  x: 0,
1822
1854
  y: 0,
1823
1855
  strategy: n,
1824
1856
  placement: t,
1825
1857
  middlewareData: {},
1826
1858
  isPositioned: !1
1827
- }), [p, u] = y.useState(o);
1828
- et(p, o) || u(o);
1829
- const [m, h] = y.useState(null), [g, v] = y.useState(null), E = y.useCallback((P) => {
1830
- P !== S.current && (S.current = P, h(P));
1831
- }, []), b = y.useCallback((P) => {
1832
- P !== M.current && (M.current = P, v(P));
1833
- }, []), x = r || m, O = s || g, S = y.useRef(null), M = y.useRef(null), C = y.useRef(f), N = a != null, $ = Vt(a), D = Vt(i), k = y.useCallback(() => {
1834
- if (!S.current || !M.current)
1859
+ }), [p, f] = w.useState(o);
1860
+ et(p, o) || f(o);
1861
+ const [m, h] = w.useState(null), [g, v] = w.useState(null), y = w.useCallback((P) => {
1862
+ P !== C.current && (C.current = P, h(P));
1863
+ }, []), b = w.useCallback((P) => {
1864
+ P !== T.current && (T.current = P, v(P));
1865
+ }, []), E = r || m, O = s || g, C = w.useRef(null), T = w.useRef(null), S = w.useRef(c), L = a != null, A = ut(a), D = ut(i), k = ut(u), F = w.useCallback(() => {
1866
+ if (!C.current || !T.current)
1835
1867
  return;
1836
1868
  const P = {
1837
1869
  placement: t,
1838
1870
  strategy: n,
1839
1871
  middleware: p
1840
1872
  };
1841
- D.current && (P.platform = D.current), gi(S.current, M.current, P).then((L) => {
1842
- const A = {
1843
- ...L,
1844
- isPositioned: !0
1873
+ D.current && (P.platform = D.current), bi(C.current, T.current, P).then(($) => {
1874
+ const H = {
1875
+ ...$,
1876
+ // The floating element's position may be recomputed while it's closed
1877
+ // but still mounted (such as when transitioning out). To ensure
1878
+ // `isPositioned` will be `false` initially on the next open, avoid
1879
+ // setting it to `true` when `open === false` (must be specified).
1880
+ isPositioned: k.current !== !1
1845
1881
  };
1846
- z.current && !et(C.current, A) && (C.current = A, Ne.flushSync(() => {
1847
- d(A);
1882
+ x.current && !et(S.current, H) && (S.current = H, Xe.flushSync(() => {
1883
+ d(H);
1848
1884
  }));
1849
1885
  });
1850
- }, [p, t, n, D]);
1886
+ }, [p, t, n, D, k]);
1851
1887
  Ge(() => {
1852
- c === !1 && C.current.isPositioned && (C.current.isPositioned = !1, d((P) => ({
1888
+ u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, d((P) => ({
1853
1889
  ...P,
1854
1890
  isPositioned: !1
1855
1891
  })));
1856
- }, [c]);
1857
- const z = y.useRef(!1);
1858
- Ge(() => (z.current = !0, () => {
1859
- z.current = !1;
1892
+ }, [u]);
1893
+ const x = w.useRef(!1);
1894
+ Ge(() => (x.current = !0, () => {
1895
+ x.current = !1;
1860
1896
  }), []), Ge(() => {
1861
- if (x && (S.current = x), O && (M.current = O), x && O) {
1862
- if ($.current)
1863
- return $.current(x, O, k);
1864
- k();
1897
+ if (E && (C.current = E), O && (T.current = O), E && O) {
1898
+ if (A.current)
1899
+ return A.current(E, O, F);
1900
+ F();
1865
1901
  }
1866
- }, [x, O, k, $, N]);
1867
- const w = y.useMemo(() => ({
1868
- reference: S,
1869
- floating: M,
1870
- setReference: E,
1902
+ }, [E, O, F, A, L]);
1903
+ const B = w.useMemo(() => ({
1904
+ reference: C,
1905
+ floating: T,
1906
+ setReference: y,
1871
1907
  setFloating: b
1872
- }), [E, b]), F = y.useMemo(() => ({
1873
- reference: x,
1908
+ }), [y, b]), _ = w.useMemo(() => ({
1909
+ reference: E,
1874
1910
  floating: O
1875
- }), [x, O]), j = y.useMemo(() => {
1911
+ }), [E, O]), z = w.useMemo(() => {
1876
1912
  const P = {
1877
1913
  position: n,
1878
1914
  left: 0,
1879
1915
  top: 0
1880
1916
  };
1881
- if (!F.floating)
1917
+ if (!_.floating)
1882
1918
  return P;
1883
- const L = Ht(F.floating, f.x), A = Ht(F.floating, f.y);
1919
+ const $ = jt(_.floating, c.x), H = jt(_.floating, c.y);
1884
1920
  return l ? {
1885
1921
  ...P,
1886
- transform: "translate(" + L + "px, " + A + "px)",
1887
- ...bn(F.floating) >= 1.5 && {
1922
+ transform: "translate(" + $ + "px, " + H + "px)",
1923
+ ...wn(_.floating) >= 1.5 && {
1888
1924
  willChange: "transform"
1889
1925
  }
1890
1926
  } : {
1891
1927
  position: n,
1892
- left: L,
1893
- top: A
1928
+ left: $,
1929
+ top: H
1894
1930
  };
1895
- }, [n, l, F.floating, f.x, f.y]);
1896
- return y.useMemo(() => ({
1897
- ...f,
1898
- update: k,
1899
- refs: w,
1900
- elements: F,
1901
- floatingStyles: j
1902
- }), [f, k, w, F, j]);
1903
- }
1904
- const xn = (e, t) => ({
1905
- ...di(e),
1906
- options: [e, t]
1907
- }), bi = (e, t) => ({
1908
- ...mi(e),
1909
- options: [e, t]
1910
- }), xi = (e, t) => ({
1931
+ }, [n, l, _.floating, c.x, c.y]);
1932
+ return w.useMemo(() => ({
1933
+ ...c,
1934
+ update: F,
1935
+ refs: B,
1936
+ elements: _,
1937
+ floatingStyles: z
1938
+ }), [c, F, B, _, z]);
1939
+ }
1940
+ const yn = (e, t) => ({
1911
1941
  ...pi(e),
1912
1942
  options: [e, t]
1913
1943
  }), wi = (e, t) => ({
1914
1944
  ...hi(e),
1915
1945
  options: [e, t]
1916
- }), wn = {
1917
- ...y
1918
- }, Ei = wn.useInsertionEffect, yi = Ei || ((e) => e());
1919
- function En(e) {
1920
- const t = y.useRef(() => {
1946
+ }), yi = (e, t) => ({
1947
+ ...gi(e),
1948
+ options: [e, t]
1949
+ }), Ei = (e, t) => ({
1950
+ ...vi(e),
1951
+ options: [e, t]
1952
+ }), En = {
1953
+ ...w
1954
+ }, Oi = En.useInsertionEffect, Si = Oi || ((e) => e());
1955
+ function On(e) {
1956
+ const t = w.useRef(() => {
1921
1957
  if (process.env.NODE_ENV !== "production")
1922
1958
  throw new Error("Cannot call an event handler while rendering.");
1923
1959
  });
1924
- return yi(() => {
1960
+ return Si(() => {
1925
1961
  t.current = e;
1926
- }), y.useCallback(function() {
1962
+ }), w.useCallback(function() {
1927
1963
  for (var n = arguments.length, o = new Array(n), i = 0; i < n; i++)
1928
1964
  o[i] = arguments[i];
1929
1965
  return t.current == null ? void 0 : t.current(...o);
1930
1966
  }, []);
1931
1967
  }
1932
- var pt = typeof document < "u" ? en : oe;
1933
- let Wt = !1, Oi = 0;
1934
- const Bt = () => (
1968
+ var bt = typeof document < "u" ? on : oe;
1969
+ let Ut = !1, Ri = 0;
1970
+ const Yt = () => (
1935
1971
  // Ensure the id is unique with multiple independent versions of Floating UI
1936
1972
  // on <React 18
1937
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + Oi++
1973
+ "floating-ui-" + Math.random().toString(36).slice(2, 6) + Ri++
1938
1974
  );
1939
- function Si() {
1940
- const [e, t] = y.useState(() => Wt ? Bt() : void 0);
1941
- return pt(() => {
1942
- e == null && t(Bt());
1943
- }, []), y.useEffect(() => {
1944
- Wt = !0;
1975
+ function Ci() {
1976
+ const [e, t] = w.useState(() => Ut ? Yt() : void 0);
1977
+ return bt(() => {
1978
+ e == null && t(Yt());
1979
+ }, []), w.useEffect(() => {
1980
+ Ut = !0;
1945
1981
  }, []), e;
1946
1982
  }
1947
- const Ri = wn.useId, Ci = Ri || Si;
1983
+ const Ti = En.useId, Ii = Ti || Ci;
1948
1984
  let He;
1949
1985
  process.env.NODE_ENV !== "production" && (He = /* @__PURE__ */ new Set());
1950
- function Ti() {
1986
+ function Mi() {
1951
1987
  for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
1952
1988
  n[o] = arguments[o];
1953
1989
  const i = "Floating UI: " + n.join(" ");
@@ -1956,7 +1992,7 @@ function Ti() {
1956
1992
  (r = He) == null || r.add(i), console.warn(i);
1957
1993
  }
1958
1994
  }
1959
- function Ii() {
1995
+ function Pi() {
1960
1996
  for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
1961
1997
  n[o] = arguments[o];
1962
1998
  const i = "Floating UI: " + n.join(" ");
@@ -1965,7 +2001,7 @@ function Ii() {
1965
2001
  (r = He) == null || r.add(i), console.error(i);
1966
2002
  }
1967
2003
  }
1968
- function Mi() {
2004
+ function Ai() {
1969
2005
  const e = /* @__PURE__ */ new Map();
1970
2006
  return {
1971
2007
  emit(t, n) {
@@ -1981,60 +2017,60 @@ function Mi() {
1981
2017
  }
1982
2018
  };
1983
2019
  }
1984
- const Pi = /* @__PURE__ */ y.createContext(null), Ai = /* @__PURE__ */ y.createContext(null), $i = () => {
2020
+ const $i = /* @__PURE__ */ w.createContext(null), Di = /* @__PURE__ */ w.createContext(null), Fi = () => {
1985
2021
  var e;
1986
- return ((e = y.useContext(Pi)) == null ? void 0 : e.id) || null;
1987
- }, Di = () => y.useContext(Ai);
1988
- function Fi(e) {
2022
+ return ((e = w.useContext($i)) == null ? void 0 : e.id) || null;
2023
+ }, Li = () => w.useContext(Di), _i = "data-floating-ui-focusable";
2024
+ function Ni(e) {
1989
2025
  const {
1990
2026
  open: t = !1,
1991
2027
  onOpenChange: n,
1992
2028
  elements: o
1993
- } = e, i = Ci(), r = y.useRef({}), [s] = y.useState(() => Mi()), l = $i() != null;
2029
+ } = e, i = Ii(), r = w.useRef({}), [s] = w.useState(() => Ai()), l = Fi() != null;
1994
2030
  if (process.env.NODE_ENV !== "production") {
1995
- const u = o.reference;
1996
- u && !X(u) && Ii("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
2031
+ const f = o.reference;
2032
+ f && !G(f) && Pi("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
1997
2033
  }
1998
- const [a, c] = y.useState(o.reference), f = En((u, m, h) => {
1999
- r.current.openEvent = u ? m : void 0, s.emit("openchange", {
2000
- open: u,
2034
+ const [a, u] = w.useState(o.reference), c = On((f, m, h) => {
2035
+ r.current.openEvent = f ? m : void 0, s.emit("openchange", {
2036
+ open: f,
2001
2037
  event: m,
2002
2038
  reason: h,
2003
2039
  nested: l
2004
- }), n == null || n(u, m, h);
2005
- }), d = y.useMemo(() => ({
2006
- setPositionReference: c
2007
- }), []), p = y.useMemo(() => ({
2040
+ }), n == null || n(f, m, h);
2041
+ }), d = w.useMemo(() => ({
2042
+ setPositionReference: u
2043
+ }), []), p = w.useMemo(() => ({
2008
2044
  reference: a || o.reference || null,
2009
2045
  floating: o.floating || null,
2010
2046
  domReference: o.reference
2011
2047
  }), [a, o.reference, o.floating]);
2012
- return y.useMemo(() => ({
2048
+ return w.useMemo(() => ({
2013
2049
  dataRef: r,
2014
2050
  open: t,
2015
- onOpenChange: f,
2051
+ onOpenChange: c,
2016
2052
  elements: p,
2017
2053
  events: s,
2018
2054
  floatingId: i,
2019
2055
  refs: d
2020
- }), [t, f, p, s, i, d]);
2056
+ }), [t, c, p, s, i, d]);
2021
2057
  }
2022
- function Li(e) {
2058
+ function ki(e) {
2023
2059
  e === void 0 && (e = {});
2024
2060
  const {
2025
2061
  nodeId: t
2026
- } = e, n = Fi({
2062
+ } = e, n = Ni({
2027
2063
  ...e,
2028
2064
  elements: {
2029
2065
  reference: null,
2030
2066
  floating: null,
2031
2067
  ...e.elements
2032
2068
  }
2033
- }), o = e.rootContext || n, i = o.elements, [r, s] = y.useState(null), [l, a] = y.useState(null), f = (i == null ? void 0 : i.reference) || r, d = y.useRef(null), p = Di();
2034
- pt(() => {
2035
- f && (d.current = f);
2036
- }, [f]);
2037
- const u = vi({
2069
+ }), o = e.rootContext || n, i = o.elements, [r, s] = w.useState(null), [l, a] = w.useState(null), c = (i == null ? void 0 : i.reference) || r, d = w.useRef(null), p = Li();
2070
+ bt(() => {
2071
+ c && (d.current = c);
2072
+ }, [c]);
2073
+ const f = xi({
2038
2074
  ...e,
2039
2075
  elements: {
2040
2076
  ...i,
@@ -2042,102 +2078,103 @@ function Li(e) {
2042
2078
  reference: l
2043
2079
  }
2044
2080
  }
2045
- }), m = y.useCallback((b) => {
2046
- const x = X(b) ? {
2081
+ }), m = w.useCallback((b) => {
2082
+ const E = G(b) ? {
2047
2083
  getBoundingClientRect: () => b.getBoundingClientRect(),
2048
2084
  contextElement: b
2049
2085
  } : b;
2050
- a(x), u.refs.setReference(x);
2051
- }, [u.refs]), h = y.useCallback((b) => {
2052
- (X(b) || b === null) && (d.current = b, s(b)), (X(u.refs.reference.current) || u.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2086
+ a(E), f.refs.setReference(E);
2087
+ }, [f.refs]), h = w.useCallback((b) => {
2088
+ (G(b) || b === null) && (d.current = b, s(b)), (G(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2053
2089
  // `null` to support `positionReference` + an unstable `reference`
2054
2090
  // callback ref.
2055
- b !== null && !X(b)) && u.refs.setReference(b);
2056
- }, [u.refs]), g = y.useMemo(() => ({
2057
- ...u.refs,
2091
+ b !== null && !G(b)) && f.refs.setReference(b);
2092
+ }, [f.refs]), g = w.useMemo(() => ({
2093
+ ...f.refs,
2058
2094
  setReference: h,
2059
2095
  setPositionReference: m,
2060
2096
  domReference: d
2061
- }), [u.refs, h, m]), v = y.useMemo(() => ({
2062
- ...u.elements,
2063
- domReference: f
2064
- }), [u.elements, f]), E = y.useMemo(() => ({
2065
- ...u,
2097
+ }), [f.refs, h, m]), v = w.useMemo(() => ({
2098
+ ...f.elements,
2099
+ domReference: c
2100
+ }), [f.elements, c]), y = w.useMemo(() => ({
2101
+ ...f,
2066
2102
  ...o,
2067
2103
  refs: g,
2068
2104
  elements: v,
2069
2105
  nodeId: t
2070
- }), [u, g, v, t, o]);
2071
- return pt(() => {
2072
- o.dataRef.current.floatingContext = E;
2073
- const b = p == null ? void 0 : p.nodesRef.current.find((x) => x.id === t);
2074
- b && (b.context = E);
2075
- }), y.useMemo(() => ({
2076
- ...u,
2077
- context: E,
2106
+ }), [f, g, v, t, o]);
2107
+ return bt(() => {
2108
+ o.dataRef.current.floatingContext = y;
2109
+ const b = p == null ? void 0 : p.nodesRef.current.find((E) => E.id === t);
2110
+ b && (b.context = y);
2111
+ }), w.useMemo(() => ({
2112
+ ...f,
2113
+ context: y,
2078
2114
  refs: g,
2079
2115
  elements: v
2080
- }), [u, g, v, E]);
2116
+ }), [f, g, v, y]);
2081
2117
  }
2082
- const jt = "active", Ut = "selected";
2083
- function ct(e, t, n) {
2118
+ const qt = "active", Kt = "selected";
2119
+ function ft(e, t, n) {
2084
2120
  const o = /* @__PURE__ */ new Map(), i = n === "item";
2085
2121
  let r = e;
2086
2122
  if (i && e) {
2087
2123
  const {
2088
- [jt]: s,
2089
- [Ut]: l,
2124
+ [qt]: s,
2125
+ [Kt]: l,
2090
2126
  ...a
2091
2127
  } = e;
2092
2128
  r = a;
2093
2129
  }
2094
2130
  return {
2095
2131
  ...n === "floating" && {
2096
- tabIndex: -1
2132
+ tabIndex: -1,
2133
+ [_i]: ""
2097
2134
  },
2098
2135
  ...r,
2099
2136
  ...t.map((s) => {
2100
2137
  const l = s ? s[n] : null;
2101
2138
  return typeof l == "function" ? e ? l(e) : null : l;
2102
2139
  }).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
2103
- let [c, f] = a;
2104
- if (!(i && [jt, Ut].includes(c)))
2105
- if (c.indexOf("on") === 0) {
2106
- if (o.has(c) || o.set(c, []), typeof f == "function") {
2140
+ let [u, c] = a;
2141
+ if (!(i && [qt, Kt].includes(u)))
2142
+ if (u.indexOf("on") === 0) {
2143
+ if (o.has(u) || o.set(u, []), typeof c == "function") {
2107
2144
  var d;
2108
- (d = o.get(c)) == null || d.push(f), s[c] = function() {
2109
- for (var p, u = arguments.length, m = new Array(u), h = 0; h < u; h++)
2145
+ (d = o.get(u)) == null || d.push(c), s[u] = function() {
2146
+ for (var p, f = arguments.length, m = new Array(f), h = 0; h < f; h++)
2110
2147
  m[h] = arguments[h];
2111
- return (p = o.get(c)) == null ? void 0 : p.map((g) => g(...m)).find((g) => g !== void 0);
2148
+ return (p = o.get(u)) == null ? void 0 : p.map((g) => g(...m)).find((g) => g !== void 0);
2112
2149
  };
2113
2150
  }
2114
2151
  } else
2115
- s[c] = f;
2152
+ s[u] = c;
2116
2153
  }), s), {})
2117
2154
  };
2118
2155
  }
2119
- function _i(e) {
2156
+ function zi(e) {
2120
2157
  e === void 0 && (e = []);
2121
- const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i = y.useCallback(
2122
- (l) => ct(l, e, "reference"),
2158
+ const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i = w.useCallback(
2159
+ (l) => ft(l, e, "reference"),
2123
2160
  // eslint-disable-next-line react-hooks/exhaustive-deps
2124
2161
  t
2125
- ), r = y.useCallback(
2126
- (l) => ct(l, e, "floating"),
2162
+ ), r = w.useCallback(
2163
+ (l) => ft(l, e, "floating"),
2127
2164
  // eslint-disable-next-line react-hooks/exhaustive-deps
2128
2165
  n
2129
- ), s = y.useCallback(
2130
- (l) => ct(l, e, "item"),
2166
+ ), s = w.useCallback(
2167
+ (l) => ft(l, e, "item"),
2131
2168
  // eslint-disable-next-line react-hooks/exhaustive-deps
2132
2169
  o
2133
2170
  );
2134
- return y.useMemo(() => ({
2171
+ return w.useMemo(() => ({
2135
2172
  getReferenceProps: i,
2136
2173
  getFloatingProps: r,
2137
2174
  getItemProps: s
2138
2175
  }), [i, r, s]);
2139
2176
  }
2140
- function Yt(e, t) {
2177
+ function Gt(e, t) {
2141
2178
  return {
2142
2179
  ...e,
2143
2180
  rects: {
@@ -2149,7 +2186,7 @@ function Yt(e, t) {
2149
2186
  }
2150
2187
  };
2151
2188
  }
2152
- const ki = (e) => ({
2189
+ const Hi = (e) => ({
2153
2190
  name: "inner",
2154
2191
  options: e,
2155
2192
  async fn(t) {
@@ -2161,32 +2198,36 @@ const ki = (e) => ({
2161
2198
  index: s = 0,
2162
2199
  minItemsVisible: l = 4,
2163
2200
  referenceOverflowThreshold: a = 0,
2164
- scrollRef: c,
2165
- ...f
2166
- } = Ae(e, t), {
2201
+ scrollRef: u,
2202
+ ...c
2203
+ } = $e(e, t), {
2167
2204
  rects: d,
2168
2205
  elements: {
2169
2206
  floating: p
2170
2207
  }
2171
- } = t, u = n.current[s];
2172
- if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") || Ti('`placement` side must be "bottom" when using the `inner`', "middleware.")), !u)
2208
+ } = t, f = n.current[s], m = (u == null ? void 0 : u.current) || p, h = p.clientTop || m.clientTop, g = p.clientTop !== 0, v = m.clientTop !== 0, y = p === m;
2209
+ if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") || Mi('`placement` side must be "bottom" when using the `inner`', "middleware.")), !f)
2173
2210
  return {};
2174
- const m = {
2211
+ const b = {
2175
2212
  ...t,
2176
- ...await xn(-u.offsetTop - p.clientTop - d.reference.height / 2 - u.offsetHeight / 2 - r).fn(t)
2177
- }, h = (c == null ? void 0 : c.current) || p, g = await at(Yt(m, h.scrollHeight), f), v = await at(m, {
2178
- ...f,
2213
+ ...await yn(-f.offsetTop - p.clientTop - d.reference.height / 2 - f.offsetHeight / 2 - r).fn(t)
2214
+ }, E = await ct(Gt(b, m.scrollHeight + h + p.clientTop), c), O = await ct(b, {
2215
+ ...c,
2179
2216
  elementContext: "reference"
2180
- }), E = Math.max(0, g.top), b = m.y + E, x = Math.max(0, h.scrollHeight - E - Math.max(0, g.bottom));
2181
- return h.style.maxHeight = x + "px", h.scrollTop = E, i && (h.offsetHeight < u.offsetHeight * Math.min(l, n.current.length - 1) - 1 || v.top >= -a || v.bottom >= -a ? Ne.flushSync(() => i(!0)) : Ne.flushSync(() => i(!1))), o && (o.current = await at(Yt({
2182
- ...m,
2183
- y: b
2184
- }, h.offsetHeight), f)), {
2185
- y: b
2217
+ }), C = K(0, E.top), T = b.y + C, S = ze(K(0, m.scrollHeight + (g && y || v ? h * 2 : 0) - C - K(0, E.bottom)));
2218
+ if (m.style.maxHeight = S + "px", m.scrollTop = C, i) {
2219
+ const L = m.scrollHeight > m.offsetHeight && m.offsetHeight < f.offsetHeight * l - 1 || O.top >= -a || O.bottom >= -a;
2220
+ Xe.flushSync(() => i(L));
2221
+ }
2222
+ return o && (o.current = await ct(Gt({
2223
+ ...b,
2224
+ y: T
2225
+ }, m.offsetHeight + h + p.clientTop), c)), {
2226
+ y: T
2186
2227
  };
2187
2228
  }
2188
2229
  });
2189
- function Ni(e, t) {
2230
+ function Vi(e, t) {
2190
2231
  const {
2191
2232
  open: n,
2192
2233
  elements: o
@@ -2195,116 +2236,119 @@ function Ni(e, t) {
2195
2236
  overflowRef: r,
2196
2237
  scrollRef: s,
2197
2238
  onChange: l
2198
- } = t, a = En(l), c = y.useRef(!1), f = y.useRef(null), d = y.useRef(null);
2199
- y.useEffect(() => {
2239
+ } = t, a = On(l), u = w.useRef(!1), c = w.useRef(null), d = w.useRef(null);
2240
+ w.useEffect(() => {
2200
2241
  if (!i) return;
2201
- function u(h) {
2242
+ function f(h) {
2202
2243
  if (h.ctrlKey || !m || r.current == null)
2203
2244
  return;
2204
- const g = h.deltaY, v = r.current.top >= -0.5, E = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, x = g < 0 ? -1 : 1, O = g < 0 ? "max" : "min";
2205
- m.scrollHeight <= m.clientHeight || (!v && g > 0 || !E && g < 0 ? (h.preventDefault(), Ne.flushSync(() => {
2206
- a((S) => S + Math[O](g, b * x));
2207
- })) : /firefox/i.test(Lo()) && (m.scrollTop += g));
2245
+ const g = h.deltaY, v = r.current.top >= -0.5, y = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, E = g < 0 ? -1 : 1, O = g < 0 ? "max" : "min";
2246
+ m.scrollHeight <= m.clientHeight || (!v && g > 0 || !y && g < 0 ? (h.preventDefault(), Xe.flushSync(() => {
2247
+ a((C) => C + Math[O](g, b * E));
2248
+ })) : /firefox/i.test(No()) && (m.scrollTop += g));
2208
2249
  }
2209
2250
  const m = (s == null ? void 0 : s.current) || o.floating;
2210
2251
  if (n && m)
2211
- return m.addEventListener("wheel", u), requestAnimationFrame(() => {
2212
- f.current = m.scrollTop, r.current != null && (d.current = {
2252
+ return m.addEventListener("wheel", f), requestAnimationFrame(() => {
2253
+ c.current = m.scrollTop, r.current != null && (d.current = {
2213
2254
  ...r.current
2214
2255
  });
2215
2256
  }), () => {
2216
- f.current = null, d.current = null, m.removeEventListener("wheel", u);
2257
+ c.current = null, d.current = null, m.removeEventListener("wheel", f);
2217
2258
  };
2218
2259
  }, [i, n, o.floating, r, s, a]);
2219
- const p = y.useMemo(() => ({
2260
+ const p = w.useMemo(() => ({
2220
2261
  onKeyDown() {
2221
- c.current = !0;
2262
+ u.current = !0;
2222
2263
  },
2223
2264
  onWheel() {
2224
- c.current = !1;
2265
+ u.current = !1;
2225
2266
  },
2226
2267
  onPointerMove() {
2227
- c.current = !1;
2268
+ u.current = !1;
2228
2269
  },
2229
2270
  onScroll() {
2230
- const u = (s == null ? void 0 : s.current) || o.floating;
2231
- if (!(!r.current || !u || !c.current)) {
2232
- if (f.current !== null) {
2233
- const m = u.scrollTop - f.current;
2234
- (r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) && Ne.flushSync(() => a((h) => h + m));
2271
+ const f = (s == null ? void 0 : s.current) || o.floating;
2272
+ if (!(!r.current || !f || !u.current)) {
2273
+ if (c.current !== null) {
2274
+ const m = f.scrollTop - c.current;
2275
+ (r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) && Xe.flushSync(() => a((h) => h + m));
2235
2276
  }
2236
2277
  requestAnimationFrame(() => {
2237
- f.current = u.scrollTop;
2278
+ c.current = f.scrollTop;
2238
2279
  });
2239
2280
  }
2240
2281
  }
2241
2282
  }), [o.floating, a, r, s]);
2242
- return y.useMemo(() => i ? {
2283
+ return w.useMemo(() => i ? {
2243
2284
  floating: p
2244
2285
  } : {}, [i, p]);
2245
2286
  }
2246
- let Ue = ge({ styles: void 0, setReference: () => {
2287
+ let Ue = he({ styles: void 0, setReference: () => {
2247
2288
  }, setFloating: () => {
2248
2289
  }, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
2249
2290
  Ue.displayName = "FloatingContext";
2250
- let Ot = ge(null);
2251
- Ot.displayName = "PlacementContext";
2252
- function zi(e) {
2253
- return q(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
2291
+ let Tt = he(null);
2292
+ Tt.displayName = "PlacementContext";
2293
+ function Bi(e) {
2294
+ return X(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
2254
2295
  }
2255
- function Hi() {
2296
+ function Wi() {
2256
2297
  return le(Ue).setReference;
2257
2298
  }
2258
- function Vi() {
2299
+ function ji() {
2259
2300
  let { getFloatingProps: e, slot: t } = le(Ue);
2260
- return ke((...n) => Object.assign({}, e(...n), { "data-anchor": t.anchor }), [e, t]);
2301
+ return Ne((...n) => Object.assign({}, e(...n), { "data-anchor": t.anchor }), [e, t]);
2261
2302
  }
2262
- function Wi(e = null) {
2303
+ function Ui(e = null) {
2263
2304
  e === !1 && (e = null), typeof e == "string" && (e = { to: e });
2264
- let t = le(Ot), n = q(() => e, [JSON.stringify(e, typeof HTMLElement < "u" ? (i, r) => r instanceof HTMLElement ? r.outerHTML : r : void 0)]);
2265
- B(() => {
2305
+ let t = le(Tt), n = X(() => e, [JSON.stringify(e, (i, r) => {
2306
+ var s;
2307
+ return (s = r == null ? void 0 : r.outerHTML) != null ? s : r;
2308
+ })]);
2309
+ U(() => {
2266
2310
  t == null || t(n ?? null);
2267
2311
  }, [t, n]);
2268
2312
  let o = le(Ue);
2269
- return q(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
2270
- }
2271
- let qt = 4;
2272
- function Bi({ children: e, enabled: t = !0 }) {
2273
- let [n, o] = ae(null), [i, r] = ae(0), s = K(null), [l, a] = ae(null);
2274
- ji(l);
2275
- let c = t && n !== null && l !== null, { to: f = "bottom", gap: d = 0, offset: p = 0, padding: u = 0, inner: m } = Ui(n, l), [h, g = "center"] = f.split(" ");
2276
- B(() => {
2277
- c && r(0);
2278
- }, [c]);
2279
- let { refs: v, floatingStyles: E, context: b } = Li({ open: c, placement: h === "selection" ? g === "center" ? "bottom" : `bottom-${g}` : g === "center" ? `${h}` : `${h}-${g}`, strategy: "absolute", transform: !1, middleware: [xn({ mainAxis: h === "selection" ? 0 : d, crossAxis: p }), bi({ padding: u }), h !== "selection" && xi({ padding: u }), h === "selection" && m ? ki({ ...m, padding: u, overflowRef: s, offset: i, minItemsVisible: qt, referenceOverflowThreshold: u, onFallbackChange(D) {
2280
- var k, z;
2313
+ return X(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
2314
+ }
2315
+ let Xt = 4;
2316
+ function Yi({ children: e, enabled: t = !0 }) {
2317
+ let [n, o] = ce(null), [i, r] = ce(0), s = J(null), [l, a] = ce(null);
2318
+ qi(l);
2319
+ let u = t && n !== null && l !== null, { to: c = "bottom", gap: d = 0, offset: p = 0, padding: f = 0, inner: m } = Ki(n, l), [h, g = "center"] = c.split(" ");
2320
+ U(() => {
2321
+ u && r(0);
2322
+ }, [u]);
2323
+ let { refs: v, floatingStyles: y, context: b } = ki({ open: u, placement: h === "selection" ? g === "center" ? "bottom" : `bottom-${g}` : g === "center" ? `${h}` : `${h}-${g}`, strategy: "absolute", transform: !1, middleware: [yn({ mainAxis: h === "selection" ? 0 : d, crossAxis: p }), wi({ padding: f }), h !== "selection" && yi({ padding: f }), h === "selection" && m ? Hi({ ...m, padding: f, overflowRef: s, offset: i, minItemsVisible: Xt, referenceOverflowThreshold: f, onFallbackChange(D) {
2324
+ var k, F;
2281
2325
  if (!D) return;
2282
- let w = b.elements.floating;
2283
- if (!w) return;
2284
- let F = parseFloat(getComputedStyle(w).scrollPaddingBottom) || 0, j = Math.min(qt, w.childElementCount), P = 0, L = 0;
2285
- for (let A of (z = (k = b.elements.floating) == null ? void 0 : k.childNodes) != null ? z : []) if (A instanceof HTMLElement) {
2286
- let J = A.offsetTop, U = J + A.clientHeight + F, ve = w.scrollTop, R = ve + w.clientHeight;
2287
- if (J >= ve && U <= R) j--;
2326
+ let x = b.elements.floating;
2327
+ if (!x) return;
2328
+ let B = parseFloat(getComputedStyle(x).scrollPaddingBottom) || 0, _ = Math.min(Xt, x.childElementCount), z = 0, P = 0;
2329
+ for (let $ of (F = (k = b.elements.floating) == null ? void 0 : k.childNodes) != null ? F : []) if ($ instanceof HTMLElement) {
2330
+ let H = $.offsetTop, Y = H + $.clientHeight + B, ge = x.scrollTop, R = ge + x.clientHeight;
2331
+ if (H >= ge && Y <= R) _--;
2288
2332
  else {
2289
- L = Math.max(0, Math.min(U, R) - Math.max(J, ve)), P = A.clientHeight;
2333
+ P = Math.max(0, Math.min(Y, R) - Math.max(H, ge)), z = $.clientHeight;
2290
2334
  break;
2291
2335
  }
2292
2336
  }
2293
- j >= 1 && r((A) => {
2294
- let J = P * j - L + F;
2295
- return A >= J ? A : J;
2337
+ _ >= 1 && r(($) => {
2338
+ let H = z * _ - P + B;
2339
+ return $ >= H ? $ : H;
2296
2340
  });
2297
- } }) : null, wi({ padding: u, apply({ availableWidth: D, availableHeight: k, elements: z }) {
2298
- Object.assign(z.floating.style, { overflow: "auto", maxWidth: `${D}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${k}px)` });
2299
- } })].filter(Boolean), whileElementsMounted: fi }), [x = h, O = g] = b.placement.split("-");
2300
- h === "selection" && (x = "selection");
2301
- let S = q(() => ({ anchor: [x, O].filter(Boolean).join(" ") }), [x, O]), M = Ni(b, { overflowRef: s, onChange: r }), { getReferenceProps: C, getFloatingProps: N } = _i([M]), $ = I((D) => {
2341
+ } }) : null, Ei({ padding: f, apply({ availableWidth: D, availableHeight: k, elements: F }) {
2342
+ Object.assign(F.floating.style, { overflow: "auto", maxWidth: `${D}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${k}px)` });
2343
+ } })].filter(Boolean), whileElementsMounted: mi }), [E = h, O = g] = b.placement.split("-");
2344
+ h === "selection" && (E = "selection");
2345
+ let C = X(() => ({ anchor: [E, O].filter(Boolean).join(" ") }), [E, O]), T = Vi(b, { overflowRef: s, onChange: r }), { getReferenceProps: S, getFloatingProps: L } = zi([T]), A = M((D) => {
2302
2346
  a(D), v.setFloating(D);
2303
2347
  });
2304
- return y.createElement(Ot.Provider, { value: o }, y.createElement(Ue.Provider, { value: { setFloating: $, setReference: v.setReference, styles: E, getReferenceProps: C, getFloatingProps: N, slot: S } }, e));
2348
+ return w.createElement(Tt.Provider, { value: o }, w.createElement(Ue.Provider, { value: { setFloating: A, setReference: v.setReference, styles: y, getReferenceProps: S, getFloatingProps: L, slot: C } }, e));
2305
2349
  }
2306
- function ji(e) {
2307
- B(() => {
2350
+ function qi(e) {
2351
+ U(() => {
2308
2352
  if (!e) return;
2309
2353
  let t = new MutationObserver(() => {
2310
2354
  let n = window.getComputedStyle(e).maxHeight, o = parseFloat(n);
@@ -2317,91 +2361,91 @@ function ji(e) {
2317
2361
  };
2318
2362
  }, [e]);
2319
2363
  }
2320
- function Ui(e, t) {
2364
+ function Ki(e, t) {
2321
2365
  var n, o, i;
2322
- let r = ut((n = e == null ? void 0 : e.gap) != null ? n : "var(--anchor-gap, 0)", t), s = ut((o = e == null ? void 0 : e.offset) != null ? o : "var(--anchor-offset, 0)", t), l = ut((i = e == null ? void 0 : e.padding) != null ? i : "var(--anchor-padding, 0)", t);
2366
+ let r = dt((n = e == null ? void 0 : e.gap) != null ? n : "var(--anchor-gap, 0)", t), s = dt((o = e == null ? void 0 : e.offset) != null ? o : "var(--anchor-offset, 0)", t), l = dt((i = e == null ? void 0 : e.padding) != null ? i : "var(--anchor-padding, 0)", t);
2323
2367
  return { ...e, gap: r, offset: s, padding: l };
2324
2368
  }
2325
- function ut(e, t, n = void 0) {
2326
- let o = Xt(), i = I((a, c) => {
2369
+ function dt(e, t, n = void 0) {
2370
+ let o = Zt(), i = M((a, u) => {
2327
2371
  if (a == null) return [n, null];
2328
2372
  if (typeof a == "number") return [a, null];
2329
2373
  if (typeof a == "string") {
2330
- if (!c) return [n, null];
2331
- let f = Kt(a, c);
2332
- return [f, (d) => {
2333
- let p = yn(a);
2374
+ if (!u) return [n, null];
2375
+ let c = Jt(a, u);
2376
+ return [c, (d) => {
2377
+ let p = Sn(a);
2334
2378
  {
2335
- let u = p.map((m) => window.getComputedStyle(c).getPropertyValue(m));
2379
+ let f = p.map((m) => window.getComputedStyle(u).getPropertyValue(m));
2336
2380
  o.requestAnimationFrame(function m() {
2337
2381
  o.nextFrame(m);
2338
2382
  let h = !1;
2339
- for (let [v, E] of p.entries()) {
2340
- let b = window.getComputedStyle(c).getPropertyValue(E);
2341
- if (u[v] !== b) {
2342
- u[v] = b, h = !0;
2383
+ for (let [v, y] of p.entries()) {
2384
+ let b = window.getComputedStyle(u).getPropertyValue(y);
2385
+ if (f[v] !== b) {
2386
+ f[v] = b, h = !0;
2343
2387
  break;
2344
2388
  }
2345
2389
  }
2346
2390
  if (!h) return;
2347
- let g = Kt(a, c);
2348
- f !== g && (d(g), f = g);
2391
+ let g = Jt(a, u);
2392
+ c !== g && (d(g), c = g);
2349
2393
  });
2350
2394
  }
2351
2395
  return o.dispose;
2352
2396
  }];
2353
2397
  }
2354
2398
  return [n, null];
2355
- }), r = q(() => i(e, t)[0], [e, t]), [s = r, l] = ae();
2356
- return B(() => {
2357
- let [a, c] = i(e, t);
2358
- if (l(a), !!c) return c(l);
2399
+ }), r = X(() => i(e, t)[0], [e, t]), [s = r, l] = ce();
2400
+ return U(() => {
2401
+ let [a, u] = i(e, t);
2402
+ if (l(a), !!u) return u(l);
2359
2403
  }, [e, t]), s;
2360
2404
  }
2361
- function yn(e) {
2405
+ function Sn(e) {
2362
2406
  let t = /var\((.*)\)/.exec(e);
2363
2407
  if (t) {
2364
2408
  let n = t[1].indexOf(",");
2365
2409
  if (n === -1) return [t[1]];
2366
2410
  let o = t[1].slice(0, n).trim(), i = t[1].slice(n + 1).trim();
2367
- return i ? [o, ...yn(i)] : [o];
2411
+ return i ? [o, ...Sn(i)] : [o];
2368
2412
  }
2369
2413
  return [];
2370
2414
  }
2371
- function Kt(e, t) {
2415
+ function Jt(e, t) {
2372
2416
  let n = document.createElement("div");
2373
2417
  t.appendChild(n), n.style.setProperty("margin-top", "0px", "important"), n.style.setProperty("margin-top", e, "important");
2374
2418
  let o = parseFloat(window.getComputedStyle(n).marginTop) || 0;
2375
2419
  return t.removeChild(n), o;
2376
2420
  }
2377
- function Yi({ children: e, freeze: t }) {
2378
- let n = ht(t, e);
2379
- return W.createElement(W.Fragment, null, n);
2421
+ function Gi({ children: e, freeze: t }) {
2422
+ let n = xt(t, e);
2423
+ return j.createElement(j.Fragment, null, n);
2380
2424
  }
2381
- function ht(e, t) {
2382
- let [n, o] = ae(t);
2425
+ function xt(e, t) {
2426
+ let [n, o] = ce(t);
2383
2427
  return !e && n !== t && o(t), e ? n : t;
2384
2428
  }
2385
- function qi(e) {
2429
+ function Xi(e) {
2386
2430
  function t() {
2387
2431
  document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
2388
2432
  }
2389
2433
  typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
2390
2434
  }
2391
- let xe = [];
2392
- qi(() => {
2435
+ let be = [];
2436
+ Xi(() => {
2393
2437
  function e(t) {
2394
- if (!(t.target instanceof HTMLElement) || t.target === document.body || xe[0] === t.target) return;
2438
+ if (!(t.target instanceof HTMLElement) || t.target === document.body || be[0] === t.target) return;
2395
2439
  let n = t.target;
2396
- n = n.closest(qn), xe.unshift(n ?? t.target), xe = xe.filter((o) => o != null && o.isConnected), xe.splice(10);
2440
+ n = n.closest(Gn), be.unshift(n ?? t.target), be = be.filter((o) => o != null && o.isConnected), be.splice(10);
2397
2441
  }
2398
2442
  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 });
2399
2443
  });
2400
- function Ki(e) {
2444
+ function Ji(e) {
2401
2445
  throw new Error("Unexpected object: " + e);
2402
2446
  }
2403
- var H = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(H || {});
2404
- function Gt(e, t) {
2447
+ var V = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(V || {});
2448
+ function Qt(e, t) {
2405
2449
  let n = t.resolveItems();
2406
2450
  if (n.length <= 0) return null;
2407
2451
  let o = t.resolveActiveIndex(), i = o ?? -1;
@@ -2430,35 +2474,35 @@ function Gt(e, t) {
2430
2474
  case 5:
2431
2475
  return null;
2432
2476
  default:
2433
- Ki(e);
2477
+ Ji(e);
2434
2478
  }
2435
2479
  }
2436
- var St = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(St || {});
2437
- function Gi(e) {
2438
- let t = I(e), n = K(!1);
2480
+ var It = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(It || {});
2481
+ function Qi(e) {
2482
+ let t = M(e), n = J(!1);
2439
2483
  oe(() => (n.current = !1, () => {
2440
- n.current = !0, Mn(() => {
2484
+ n.current = !0, An(() => {
2441
2485
  n.current && t();
2442
2486
  });
2443
2487
  }), [t]);
2444
2488
  }
2445
- function Xi() {
2489
+ function Zi() {
2446
2490
  let e = typeof document > "u";
2447
- return "useSyncExternalStore" in y ? ((t) => t.useSyncExternalStore)(y)(() => () => {
2491
+ return "useSyncExternalStore" in w ? ((t) => t.useSyncExternalStore)(w)(() => () => {
2448
2492
  }, () => !1, () => !e) : !1;
2449
2493
  }
2450
- function Ji() {
2451
- let e = Xi(), [t, n] = y.useState(Le.isHandoffComplete);
2452
- return t && Le.isHandoffComplete === !1 && n(!1), y.useEffect(() => {
2494
+ function er() {
2495
+ let e = Zi(), [t, n] = w.useState(Le.isHandoffComplete);
2496
+ return t && Le.isHandoffComplete === !1 && n(!1), w.useEffect(() => {
2453
2497
  t !== !0 && n(!0);
2454
- }, [t]), y.useEffect(() => Le.handoff(), []), e ? !1 : t;
2498
+ }, [t]), w.useEffect(() => Le.handoff(), []), e ? !1 : t;
2455
2499
  }
2456
- let Qi = ge(!1);
2457
- function Zi() {
2458
- return le(Qi);
2500
+ let tr = he(!1);
2501
+ function nr() {
2502
+ return le(tr);
2459
2503
  }
2460
- function er(e) {
2461
- let t = Zi(), n = le(Sn), o = nt(e), [i, r] = ae(() => {
2504
+ function or(e) {
2505
+ let t = nr(), n = le(Cn), o = nt(e), [i, r] = ce(() => {
2462
2506
  var s;
2463
2507
  if (!t && n !== null) return (s = n.current) != null ? s : null;
2464
2508
  if (Le.isServer) return null;
@@ -2474,38 +2518,38 @@ function er(e) {
2474
2518
  t || n !== null && r(n.current);
2475
2519
  }, [n, r, t]), i;
2476
2520
  }
2477
- let On = tt, tr = pe(function(e, t) {
2478
- let n = e, o = K(null), i = Se(Pn((f) => {
2479
- o.current = f;
2480
- }), t), r = nt(o), s = er(o), [l] = ae(() => {
2481
- var f;
2482
- return Le.isServer ? null : (f = r == null ? void 0 : r.createElement("div")) != null ? f : null;
2483
- }), a = le(rr), c = Ji();
2484
- return B(() => {
2521
+ let Rn = tt, ir = me(function(e, t) {
2522
+ let n = e, o = J(null), i = Oe($n((c) => {
2523
+ o.current = c;
2524
+ }), t), r = nt(o), s = or(o), [l] = ce(() => {
2525
+ var c;
2526
+ return Le.isServer ? null : (c = r == null ? void 0 : r.createElement("div")) != null ? c : null;
2527
+ }), a = le(ar), u = er();
2528
+ return U(() => {
2485
2529
  !s || !l || s.contains(l) || (l.setAttribute("data-headlessui-portal", ""), s.appendChild(l));
2486
- }, [s, l]), B(() => {
2530
+ }, [s, l]), U(() => {
2487
2531
  if (l && a) return a.register(l);
2488
- }, [a, l]), Gi(() => {
2489
- var f;
2490
- !s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((f = s.parentElement) == null || f.removeChild(s)));
2491
- }), c ? !s || !l ? null : Fn(he({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: On, name: "Portal" }), l) : null;
2532
+ }, [a, l]), Qi(() => {
2533
+ var c;
2534
+ !s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((c = s.parentElement) == null || c.removeChild(s)));
2535
+ }), u ? !s || !l ? null : _n(pe({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: Rn, name: "Portal" }), l) : null;
2492
2536
  });
2493
- function nr(e, t) {
2494
- let n = Se(t), { enabled: o = !0, ...i } = e;
2495
- return o ? W.createElement(tr, { ...i, ref: n }) : he({ ourProps: { ref: n }, theirProps: i, slot: {}, defaultTag: On, name: "Portal" });
2496
- }
2497
- let or = tt, Sn = ge(null);
2498
- function ir(e, t) {
2499
- let { target: n, ...o } = e, i = { ref: Se(t) };
2500
- return W.createElement(Sn.Provider, { value: n }, he({ ourProps: i, theirProps: o, defaultTag: or, name: "Popover.Group" }));
2501
- }
2502
- let rr = ge(null), lr = pe(nr), sr = pe(ir), ar = Object.assign(lr, { Group: sr });
2503
- var cr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(cr || {}), ur = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(ur || {}), fr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(fr || {}), dr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(dr || {});
2504
- function ft(e, t = (n) => n) {
2505
- let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) : Kn(o, (s) => s.dataRef.current.domRef.current), r = n ? i.indexOf(n) : null;
2537
+ function rr(e, t) {
2538
+ let n = Oe(t), { enabled: o = !0, ...i } = e;
2539
+ return o ? j.createElement(ir, { ...i, ref: n }) : pe({ ourProps: { ref: n }, theirProps: i, slot: {}, defaultTag: Rn, name: "Portal" });
2540
+ }
2541
+ let lr = tt, Cn = he(null);
2542
+ function sr(e, t) {
2543
+ let { target: n, ...o } = e, i = { ref: Oe(t) };
2544
+ return j.createElement(Cn.Provider, { value: n }, pe({ ourProps: i, theirProps: o, defaultTag: lr, name: "Popover.Group" }));
2545
+ }
2546
+ let ar = he(null), cr = me(rr), ur = me(sr), fr = Object.assign(cr, { Group: ur });
2547
+ var dr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(dr || {}), mr = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(mr || {}), pr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(pr || {}), hr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(hr || {});
2548
+ function mt(e, t = (n) => n) {
2549
+ let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) : Xn(o, (s) => s.dataRef.current.domRef.current), r = n ? i.indexOf(n) : null;
2506
2550
  return r === -1 && (r = null), { options: i, activeOptionIndex: r };
2507
2551
  }
2508
- let mr = { 1(e) {
2552
+ let gr = { 1(e) {
2509
2553
  var t;
2510
2554
  return (t = e.dataRef.current) != null && t.disabled || e.comboboxState === 1 ? e : { ...e, activeOptionIndex: null, comboboxState: 1, isTyping: !1, activationTrigger: 2, __demoMode: !1 };
2511
2555
  }, 0(e) {
@@ -2522,32 +2566,32 @@ let mr = { 1(e) {
2522
2566
  var n, o, i, r;
2523
2567
  if ((n = e.dataRef.current) != null && n.disabled || e.optionsElement && !((o = e.dataRef.current) != null && o.optionsPropsRef.current.static) && e.comboboxState === 1) return e;
2524
2568
  if (e.virtual) {
2525
- let { options: c, disabled: f } = e.virtual, d = t.focus === H.Specific ? t.idx : Gt(t, { resolveItems: () => c, resolveActiveIndex: () => {
2526
- var u, m;
2527
- return (m = (u = e.activeOptionIndex) != null ? u : c.findIndex((h) => !f(h))) != null ? m : null;
2528
- }, resolveDisabled: f, resolveId() {
2569
+ let { options: u, disabled: c } = e.virtual, d = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => u, resolveActiveIndex: () => {
2570
+ var f, m;
2571
+ return (m = (f = e.activeOptionIndex) != null ? f : u.findIndex((h) => !c(h))) != null ? m : null;
2572
+ }, resolveDisabled: c, resolveId() {
2529
2573
  throw new Error("Function not implemented.");
2530
2574
  } }), p = (i = t.trigger) != null ? i : 2;
2531
2575
  return e.activeOptionIndex === d && e.activationTrigger === p ? e : { ...e, activeOptionIndex: d, activationTrigger: p, isTyping: !1, __demoMode: !1 };
2532
2576
  }
2533
- let s = ft(e);
2577
+ let s = mt(e);
2534
2578
  if (s.activeOptionIndex === null) {
2535
- let c = s.options.findIndex((f) => !f.dataRef.current.disabled);
2536
- c !== -1 && (s.activeOptionIndex = c);
2579
+ let u = s.options.findIndex((c) => !c.dataRef.current.disabled);
2580
+ u !== -1 && (s.activeOptionIndex = u);
2537
2581
  }
2538
- let l = t.focus === H.Specific ? t.idx : Gt(t, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (c) => c.id, resolveDisabled: (c) => c.dataRef.current.disabled }), a = (r = t.trigger) != null ? r : 2;
2582
+ let l = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (u) => u.id, resolveDisabled: (u) => u.dataRef.current.disabled }), a = (r = t.trigger) != null ? r : 2;
2539
2583
  return e.activeOptionIndex === l && e.activationTrigger === a ? e : { ...e, ...s, isTyping: !1, activeOptionIndex: l, activationTrigger: a, __demoMode: !1 };
2540
2584
  }, 4: (e, t) => {
2541
2585
  var n, o, i;
2542
2586
  if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: [...e.options, t.payload] };
2543
- let r = t.payload, s = ft(e, (a) => (a.push(r), a));
2587
+ let r = t.payload, s = mt(e, (a) => (a.push(r), a));
2544
2588
  e.activeOptionIndex === null && (o = e.dataRef.current) != null && o.isSelected(t.payload.dataRef.current.value) && (s.activeOptionIndex = s.options.indexOf(r));
2545
2589
  let l = { ...e, ...s, activationTrigger: 2 };
2546
2590
  return (i = e.dataRef.current) != null && i.__demoMode && e.dataRef.current.value === void 0 && (l.activeOptionIndex = 0), l;
2547
2591
  }, 5: (e, t) => {
2548
2592
  var n;
2549
2593
  if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: e.options.filter((i) => i.id !== t.id) };
2550
- let o = ft(e, (i) => {
2594
+ let o = mt(e, (i) => {
2551
2595
  let r = i.findIndex((s) => s.id === t.id);
2552
2596
  return r !== -1 && i.splice(r, 1), i;
2553
2597
  });
@@ -2562,294 +2606,291 @@ let mr = { 1(e) {
2562
2606
  r !== -1 ? i = r : i = null;
2563
2607
  }
2564
2608
  return { ...e, activeOptionIndex: i, virtual: { options: t.options, disabled: (o = t.disabled) != null ? o : () => !1 } };
2565
- }, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } }, Rt = ge(null);
2566
- Rt.displayName = "ComboboxActionsContext";
2609
+ }, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } }, Mt = he(null);
2610
+ Mt.displayName = "ComboboxActionsContext";
2567
2611
  function Ye(e) {
2568
- let t = le(Rt);
2612
+ let t = le(Mt);
2569
2613
  if (t === null) {
2570
2614
  let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
2571
2615
  throw Error.captureStackTrace && Error.captureStackTrace(n, Ye), n;
2572
2616
  }
2573
2617
  return t;
2574
2618
  }
2575
- let Rn = ge(null);
2576
- function pr(e) {
2577
- let t = $e("VirtualProvider"), { options: n } = t.virtual, [o, i] = q(() => {
2578
- let c = t.optionsElement;
2579
- if (!c) return [0, 0];
2580
- let f = window.getComputedStyle(c);
2581
- return [parseFloat(f.paddingBlockStart || f.paddingTop), parseFloat(f.paddingBlockEnd || f.paddingBottom)];
2582
- }, [t.optionsElement]), r = ho({ enabled: n.length !== 0, scrollPaddingStart: o, scrollPaddingEnd: i, count: n.length, estimateSize() {
2619
+ let Tn = he(null);
2620
+ function vr(e) {
2621
+ let t = De("VirtualProvider"), { options: n } = t.virtual, [o, i] = X(() => {
2622
+ let u = t.optionsElement;
2623
+ if (!u) return [0, 0];
2624
+ let c = window.getComputedStyle(u);
2625
+ return [parseFloat(c.paddingBlockStart || c.paddingTop), parseFloat(c.paddingBlockEnd || c.paddingBottom)];
2626
+ }, [t.optionsElement]), r = vo({ enabled: n.length !== 0, scrollPaddingStart: o, scrollPaddingEnd: i, count: n.length, estimateSize() {
2583
2627
  return 40;
2584
2628
  }, getScrollElement() {
2585
2629
  return t.optionsElement;
2586
- }, overscan: 12 }), [s, l] = ae(0);
2587
- B(() => {
2588
- l((c) => c + 1);
2630
+ }, overscan: 12 }), [s, l] = ce(0);
2631
+ U(() => {
2632
+ l((u) => u + 1);
2589
2633
  }, [n]);
2590
2634
  let a = r.getVirtualItems();
2591
- return a.length === 0 ? null : W.createElement(Rn.Provider, { value: r }, W.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (c) => {
2592
- if (c) {
2593
- if (typeof process < "u" && process.env.JEST_WORKER_ID !== void 0 || t.activationTrigger === 0) return;
2594
- t.activeOptionIndex !== null && n.length > t.activeOptionIndex && r.scrollToIndex(t.activeOptionIndex);
2595
- }
2596
- } }, a.map((c) => {
2597
- var f;
2598
- return W.createElement(tt, { key: c.key }, W.cloneElement((f = e.children) == null ? void 0 : f.call(e, { ...e.slot, option: n[c.index] }), { key: `${s}-${c.key}`, "data-index": c.index, "aria-setsize": n.length, "aria-posinset": c.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${c.start}px)`, overflowAnchor: "none" } }));
2635
+ return a.length === 0 ? null : j.createElement(Tn.Provider, { value: r }, j.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (u) => {
2636
+ u && t.activationTrigger !== 0 && t.activeOptionIndex !== null && n.length > t.activeOptionIndex && r.scrollToIndex(t.activeOptionIndex);
2637
+ } }, a.map((u) => {
2638
+ var c;
2639
+ return j.createElement(tt, { key: u.key }, j.cloneElement((c = e.children) == null ? void 0 : c.call(e, { ...e.slot, option: n[u.index] }), { key: `${s}-${u.key}`, "data-index": u.index, "aria-setsize": n.length, "aria-posinset": u.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${u.start}px)`, overflowAnchor: "none" } }));
2599
2640
  })));
2600
2641
  }
2601
- let Ve = ge(null);
2642
+ let Ve = he(null);
2602
2643
  Ve.displayName = "ComboboxDataContext";
2603
- function $e(e) {
2644
+ function De(e) {
2604
2645
  let t = le(Ve);
2605
2646
  if (t === null) {
2606
2647
  let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
2607
- throw Error.captureStackTrace && Error.captureStackTrace(n, $e), n;
2648
+ throw Error.captureStackTrace && Error.captureStackTrace(n, De), n;
2608
2649
  }
2609
2650
  return t;
2610
2651
  }
2611
- function hr(e, t) {
2612
- return Re(t.type, mr, e, t);
2652
+ function br(e, t) {
2653
+ return Re(t.type, gr, e, t);
2613
2654
  }
2614
- let gr = tt;
2615
- function vr(e, t) {
2655
+ let xr = tt;
2656
+ function wr(e, t) {
2616
2657
  var n, o;
2617
- let i = Nn(), { value: r, defaultValue: s, onChange: l, form: a, name: c, by: f, disabled: d = i || !1, onClose: p, __demoMode: u = !1, multiple: m = !1, immediate: h = !1, virtual: g = null, nullable: v, ...E } = e, b = zn(s), [x = m ? [] : void 0, O] = Hn(r, l, b), [S, M] = Zt(hr, { dataRef: Dn(), comboboxState: u ? 0 : 1, isTyping: !1, options: [], virtual: g ? { options: g.options, disabled: (n = g.disabled) != null ? n : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: u }), C = K(!1), N = K({ static: !1, hold: !1 }), $ = _n(f), D = I((T) => g ? f === null ? g.options.indexOf(T) : g.options.findIndex((_) => $(_, T)) : S.options.findIndex((_) => $(_.dataRef.current.value, T))), k = ke((T) => Re(w.mode, { 1: () => x.some((_) => $(_, T)), 0: () => $(x, T) }), [x]), z = I((T) => S.activeOptionIndex === D(T)), w = q(() => ({ ...S, immediate: h, optionsPropsRef: N, value: x, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: g ? S.virtual : null, get activeOptionIndex() {
2618
- if (C.current && S.activeOptionIndex === null && (g ? g.options.length > 0 : S.options.length > 0)) {
2658
+ let i = Hn(), { value: r, defaultValue: s, onChange: l, form: a, name: u, by: c, disabled: d = i || !1, onClose: p, __demoMode: f = !1, multiple: m = !1, immediate: h = !1, virtual: g = null, nullable: v, ...y } = e, b = Vn(s), [E = m ? [] : void 0, O] = Bn(r, l, b), [C, T] = nn(br, { dataRef: Ln(), comboboxState: f ? 0 : 1, isTyping: !1, options: [], virtual: g ? { options: g.options, disabled: (n = g.disabled) != null ? n : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: f }), S = J(!1), L = J({ static: !1, hold: !1 }), A = kn(c), D = M((I) => g ? c === null ? g.options.indexOf(I) : g.options.findIndex((N) => A(N, I)) : C.options.findIndex((N) => A(N.dataRef.current.value, I))), k = Ne((I) => Re(x.mode, { 1: () => E.some((N) => A(N, I)), 0: () => A(E, I) }), [E]), F = M((I) => C.activeOptionIndex === D(I)), x = X(() => ({ ...C, immediate: h, optionsPropsRef: L, value: E, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: g ? C.virtual : null, get activeOptionIndex() {
2659
+ if (S.current && C.activeOptionIndex === null && (g ? g.options.length > 0 : C.options.length > 0)) {
2619
2660
  if (g) {
2620
- let _ = g.options.findIndex((re) => {
2621
- var qe, Ct;
2622
- return !((Ct = (qe = g.disabled) == null ? void 0 : qe.call(g, re)) != null && Ct);
2661
+ let N = g.options.findIndex((re) => {
2662
+ var qe, Pt;
2663
+ return !((Pt = (qe = g.disabled) == null ? void 0 : qe.call(g, re)) != null && Pt);
2623
2664
  });
2624
- if (_ !== -1) return _;
2665
+ if (N !== -1) return N;
2625
2666
  }
2626
- let T = S.options.findIndex((_) => !_.dataRef.current.disabled);
2627
- if (T !== -1) return T;
2667
+ let I = C.options.findIndex((N) => !N.dataRef.current.disabled);
2668
+ if (I !== -1) return I;
2628
2669
  }
2629
- return S.activeOptionIndex;
2630
- }, calculateIndex: D, compare: $, isSelected: k, isActive: z }), [x, b, d, m, u, S, g]);
2631
- B(() => {
2632
- var T;
2633
- g && M({ type: 7, options: g.options, disabled: (T = g.disabled) != null ? T : null });
2634
- }, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]), B(() => {
2635
- S.dataRef.current = w;
2636
- }, [w]);
2637
- let F = w.comboboxState === 0;
2638
- Oo(F, [w.buttonElement, w.inputElement, w.optionsElement], () => G.closeCombobox());
2639
- let j = q(() => {
2640
- var T, _, re;
2641
- return { open: w.comboboxState === 0, disabled: d, activeIndex: w.activeOptionIndex, activeOption: w.activeOptionIndex === null ? null : w.virtual ? w.virtual.options[(T = w.activeOptionIndex) != null ? T : 0] : (re = (_ = w.options[w.activeOptionIndex]) == null ? void 0 : _.dataRef.current.value) != null ? re : null, value: x };
2642
- }, [w, d, x]), P = I(() => {
2643
- if (w.activeOptionIndex !== null) {
2644
- if (G.setIsTyping(!1), w.virtual) R(w.virtual.options[w.activeOptionIndex]);
2670
+ return C.activeOptionIndex;
2671
+ }, calculateIndex: D, compare: A, isSelected: k, isActive: F }), [E, b, d, m, f, C, g]);
2672
+ U(() => {
2673
+ var I;
2674
+ g && T({ type: 7, options: g.options, disabled: (I = g.disabled) != null ? I : null });
2675
+ }, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]), U(() => {
2676
+ C.dataRef.current = x;
2677
+ }, [x]);
2678
+ let B = x.comboboxState === 0;
2679
+ Ro(B, [x.buttonElement, x.inputElement, x.optionsElement], () => Q.closeCombobox());
2680
+ let _ = X(() => {
2681
+ var I, N, re;
2682
+ return { open: x.comboboxState === 0, disabled: d, activeIndex: x.activeOptionIndex, activeOption: x.activeOptionIndex === null ? null : x.virtual ? x.virtual.options[(I = x.activeOptionIndex) != null ? I : 0] : (re = (N = x.options[x.activeOptionIndex]) == null ? void 0 : N.dataRef.current.value) != null ? re : null, value: E };
2683
+ }, [x, d, E]), z = M(() => {
2684
+ if (x.activeOptionIndex !== null) {
2685
+ if (Q.setIsTyping(!1), x.virtual) R(x.virtual.options[x.activeOptionIndex]);
2645
2686
  else {
2646
- let { dataRef: T } = w.options[w.activeOptionIndex];
2647
- R(T.current.value);
2687
+ let { dataRef: I } = x.options[x.activeOptionIndex];
2688
+ R(I.current.value);
2648
2689
  }
2649
- G.goToOption(H.Specific, w.activeOptionIndex);
2690
+ Q.goToOption(V.Specific, x.activeOptionIndex);
2650
2691
  }
2651
- }), L = I(() => {
2652
- M({ type: 0 }), C.current = !0;
2653
- }), A = I(() => {
2654
- M({ type: 1 }), C.current = !1, p == null || p();
2655
- }), J = I((T) => {
2656
- M({ type: 3, isTyping: T });
2657
- }), U = I((T, _, re) => (C.current = !1, T === H.Specific ? M({ type: 2, focus: H.Specific, idx: _, trigger: re }) : M({ type: 2, focus: T, trigger: re }))), ve = I((T, _) => (M({ type: 4, payload: { id: T, dataRef: _ } }), () => {
2658
- w.isActive(_.current.value) && (C.current = !0), M({ type: 5, id: T });
2659
- })), R = I((T) => Re(w.mode, { 0() {
2660
- return O == null ? void 0 : O(T);
2692
+ }), P = M(() => {
2693
+ T({ type: 0 }), S.current = !0;
2694
+ }), $ = M(() => {
2695
+ T({ type: 1 }), S.current = !1, p == null || p();
2696
+ }), H = M((I) => {
2697
+ T({ type: 3, isTyping: I });
2698
+ }), Y = M((I, N, re) => (S.current = !1, I === V.Specific ? T({ type: 2, focus: V.Specific, idx: N, trigger: re }) : T({ type: 2, focus: I, trigger: re }))), ge = M((I, N) => (T({ type: 4, payload: { id: I, dataRef: N } }), () => {
2699
+ x.isActive(N.current.value) && (S.current = !0), T({ type: 5, id: I });
2700
+ })), R = M((I) => Re(x.mode, { 0() {
2701
+ return O == null ? void 0 : O(I);
2661
2702
  }, 1() {
2662
- let _ = w.value.slice(), re = _.findIndex((qe) => $(qe, T));
2663
- return re === -1 ? _.push(T) : _.splice(re, 1), O == null ? void 0 : O(_);
2664
- } })), te = I((T) => {
2665
- M({ type: 6, trigger: T });
2666
- }), Y = I((T) => {
2667
- M({ type: 8, element: T });
2668
- }), ne = I((T) => {
2669
- M({ type: 9, element: T });
2670
- }), V = I((T) => {
2671
- M({ type: 10, element: T });
2672
- }), G = q(() => ({ onChange: R, registerOption: ve, goToOption: U, setIsTyping: J, closeCombobox: A, openCombobox: L, setActivationTrigger: te, selectActiveOption: P, setInputElement: Y, setButtonElement: ne, setOptionsElement: V }), []), [be, Cn] = Vn(), Tn = t === null ? {} : { ref: t }, In = ke(() => {
2703
+ let N = x.value.slice(), re = N.findIndex((qe) => A(qe, I));
2704
+ return re === -1 ? N.push(I) : N.splice(re, 1), O == null ? void 0 : O(N);
2705
+ } })), te = M((I) => {
2706
+ T({ type: 6, trigger: I });
2707
+ }), q = M((I) => {
2708
+ T({ type: 8, element: I });
2709
+ }), ne = M((I) => {
2710
+ T({ type: 9, element: I });
2711
+ }), W = M((I) => {
2712
+ T({ type: 10, element: I });
2713
+ }), Q = X(() => ({ onChange: R, registerOption: ge, goToOption: Y, setIsTyping: H, closeCombobox: $, openCombobox: P, setActivationTrigger: te, selectActiveOption: z, setInputElement: q, setButtonElement: ne, setOptionsElement: W }), []), [ve, In] = Wn(), Mn = t === null ? {} : { ref: t }, Pn = Ne(() => {
2673
2714
  if (b !== void 0) return O == null ? void 0 : O(b);
2674
2715
  }, [O, b]);
2675
- return W.createElement(Cn, { value: be, props: { htmlFor: (o = w.inputElement) == null ? void 0 : o.id }, slot: { open: w.comboboxState === 0, disabled: d } }, W.createElement(Bi, null, W.createElement(Rt.Provider, { value: G }, W.createElement(Ve.Provider, { value: w }, W.createElement(Xn, { value: Re(w.comboboxState, { 0: Xe.Open, 1: Xe.Closed }) }, c != null && W.createElement(Wn, { disabled: d, data: x != null ? { [c]: x } : {}, form: a, onReset: In }), he({ ourProps: Tn, theirProps: E, slot: j, defaultTag: gr, name: "Combobox" }))))));
2716
+ return j.createElement(In, { value: ve, props: { htmlFor: (o = x.inputElement) == null ? void 0 : o.id }, slot: { open: x.comboboxState === 0, disabled: d } }, j.createElement(Yi, null, j.createElement(Mt.Provider, { value: Q }, j.createElement(Ve.Provider, { value: x }, j.createElement(Qn, { value: Re(x.comboboxState, { 0: Je.Open, 1: Je.Closed }) }, u != null && j.createElement(jn, { disabled: d, data: E != null ? { [u]: E } : {}, form: a, onReset: Pn }), pe({ ourProps: Mn, theirProps: y, slot: _, defaultTag: xr, name: "Combobox" }))))));
2676
2717
  }
2677
- let br = "input";
2678
- function xr(e, t) {
2718
+ let yr = "input";
2719
+ function Er(e, t) {
2679
2720
  var n, o, i, r, s;
2680
- let l = $e("Combobox.Input"), a = Ye("Combobox.Input"), c = We(), f = Bn(), { id: d = f || `headlessui-combobox-input-${c}`, onChange: p, displayValue: u, disabled: m = l.disabled || !1, autoFocus: h = !1, type: g = "text", ...v } = e, E = K(null), b = Se(E, t, Hi(), a.setInputElement), x = nt(l.inputElement), O = Xt(), S = I(() => {
2681
- a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(H.Nothing);
2682
- }), M = q(() => {
2721
+ let l = De("Combobox.Input"), a = Ye("Combobox.Input"), u = Be(), c = Un(), { id: d = c || `headlessui-combobox-input-${u}`, onChange: p, displayValue: f, disabled: m = l.disabled || !1, autoFocus: h = !1, type: g = "text", ...v } = e, y = J(null), b = Oe(y, t, Wi(), a.setInputElement), E = nt(l.inputElement), O = Zt(), C = M(() => {
2722
+ a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(V.Nothing);
2723
+ }), T = X(() => {
2683
2724
  var R;
2684
- return typeof u == "function" && l.value !== void 0 ? (R = u(l.value)) != null ? R : "" : typeof l.value == "string" ? l.value : "";
2685
- }, [l.value, u]);
2686
- Ft(([R, te], [Y, ne]) => {
2725
+ return typeof f == "function" && l.value !== void 0 ? (R = f(l.value)) != null ? R : "" : typeof l.value == "string" ? l.value : "";
2726
+ }, [l.value, f]);
2727
+ kt(([R, te], [q, ne]) => {
2687
2728
  if (l.isTyping) return;
2688
- let V = E.current;
2689
- V && ((ne === 0 && te === 1 || R !== Y) && (V.value = R), requestAnimationFrame(() => {
2690
- if (l.isTyping || !V || (x == null ? void 0 : x.activeElement) !== V) return;
2691
- let { selectionStart: G, selectionEnd: be } = V;
2692
- Math.abs((be ?? 0) - (G ?? 0)) === 0 && G === 0 && V.setSelectionRange(V.value.length, V.value.length);
2729
+ let W = y.current;
2730
+ W && ((ne === 0 && te === 1 || R !== q) && (W.value = R), requestAnimationFrame(() => {
2731
+ if (l.isTyping || !W || (E == null ? void 0 : E.activeElement) !== W) return;
2732
+ let { selectionStart: Q, selectionEnd: ve } = W;
2733
+ Math.abs((ve ?? 0) - (Q ?? 0)) === 0 && Q === 0 && W.setSelectionRange(W.value.length, W.value.length);
2693
2734
  }));
2694
- }, [M, l.comboboxState, x, l.isTyping]), Ft(([R], [te]) => {
2735
+ }, [T, l.comboboxState, E, l.isTyping]), kt(([R], [te]) => {
2695
2736
  if (R === 0 && te === 1) {
2696
2737
  if (l.isTyping) return;
2697
- let Y = E.current;
2698
- if (!Y) return;
2699
- let ne = Y.value, { selectionStart: V, selectionEnd: G, selectionDirection: be } = Y;
2700
- Y.value = "", Y.value = ne, be !== null ? Y.setSelectionRange(V, G, be) : Y.setSelectionRange(V, G);
2738
+ let q = y.current;
2739
+ if (!q) return;
2740
+ let ne = q.value, { selectionStart: W, selectionEnd: Q, selectionDirection: ve } = q;
2741
+ q.value = "", q.value = ne, ve !== null ? q.setSelectionRange(W, Q, ve) : q.setSelectionRange(W, Q);
2701
2742
  }
2702
2743
  }, [l.comboboxState]);
2703
- let C = K(!1), N = I(() => {
2704
- C.current = !0;
2705
- }), $ = I(() => {
2744
+ let S = J(!1), L = M(() => {
2745
+ S.current = !0;
2746
+ }), A = M(() => {
2706
2747
  O.nextFrame(() => {
2707
- C.current = !1;
2748
+ S.current = !1;
2708
2749
  });
2709
- }), D = I((R) => {
2750
+ }), D = M((R) => {
2710
2751
  switch (a.setIsTyping(!0), R.key) {
2711
- case Q.Enter:
2712
- if (l.comboboxState !== 0 || C.current) return;
2752
+ case Z.Enter:
2753
+ if (l.comboboxState !== 0 || S.current) return;
2713
2754
  if (R.preventDefault(), R.stopPropagation(), l.activeOptionIndex === null) {
2714
2755
  a.closeCombobox();
2715
2756
  return;
2716
2757
  }
2717
2758
  a.selectActiveOption(), l.mode === 0 && a.closeCombobox();
2718
2759
  break;
2719
- case Q.ArrowDown:
2720
- return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(H.Next), 1: () => a.openCombobox() });
2721
- case Q.ArrowUp:
2722
- return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(H.Previous), 1: () => {
2723
- we(() => a.openCombobox()), l.value || a.goToOption(H.Last);
2760
+ case Z.ArrowDown:
2761
+ return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Next), 1: () => a.openCombobox() });
2762
+ case Z.ArrowUp:
2763
+ return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Previous), 1: () => {
2764
+ xe(() => a.openCombobox()), l.value || a.goToOption(V.Last);
2724
2765
  } });
2725
- case Q.Home:
2766
+ case Z.Home:
2726
2767
  if (R.shiftKey) break;
2727
- return R.preventDefault(), R.stopPropagation(), a.goToOption(H.First);
2728
- case Q.PageUp:
2729
- return R.preventDefault(), R.stopPropagation(), a.goToOption(H.First);
2730
- case Q.End:
2768
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
2769
+ case Z.PageUp:
2770
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
2771
+ case Z.End:
2731
2772
  if (R.shiftKey) break;
2732
- return R.preventDefault(), R.stopPropagation(), a.goToOption(H.Last);
2733
- case Q.PageDown:
2734
- return R.preventDefault(), R.stopPropagation(), a.goToOption(H.Last);
2735
- case Q.Escape:
2736
- return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null && S(), a.closeCombobox());
2737
- case Q.Tab:
2773
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
2774
+ case Z.PageDown:
2775
+ return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
2776
+ case Z.Escape:
2777
+ return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null && C(), a.closeCombobox());
2778
+ case Z.Tab:
2738
2779
  if (l.comboboxState !== 0) return;
2739
2780
  l.mode === 0 && l.activationTrigger !== 1 && a.selectActiveOption(), a.closeCombobox();
2740
2781
  break;
2741
2782
  }
2742
- }), k = I((R) => {
2743
- p == null || p(R), l.mode === 0 && R.target.value === "" && S(), a.openCombobox();
2744
- }), z = I((R) => {
2745
- var te, Y, ne;
2746
- let V = (te = R.relatedTarget) != null ? te : xe.find((G) => G !== R.currentTarget);
2747
- if (!((Y = l.optionsElement) != null && Y.contains(V)) && !((ne = l.buttonElement) != null && ne.contains(V)) && l.comboboxState === 0) return R.preventDefault(), l.mode === 0 && l.value === null && S(), a.closeCombobox();
2748
- }), w = I((R) => {
2749
- var te, Y, ne;
2750
- let V = (te = R.relatedTarget) != null ? te : xe.find((G) => G !== R.currentTarget);
2751
- (Y = l.buttonElement) != null && Y.contains(V) || (ne = l.optionsElement) != null && ne.contains(V) || l.disabled || l.immediate && l.comboboxState !== 0 && O.microTask(() => {
2752
- we(() => a.openCombobox()), a.setActivationTrigger(1);
2783
+ }), k = M((R) => {
2784
+ p == null || p(R), l.mode === 0 && R.target.value === "" && C(), a.openCombobox();
2785
+ }), F = M((R) => {
2786
+ var te, q, ne;
2787
+ let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
2788
+ if (!((q = l.optionsElement) != null && q.contains(W)) && !((ne = l.buttonElement) != null && ne.contains(W)) && l.comboboxState === 0) return R.preventDefault(), l.mode === 0 && l.value === null && C(), a.closeCombobox();
2789
+ }), x = M((R) => {
2790
+ var te, q, ne;
2791
+ let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
2792
+ (q = l.buttonElement) != null && q.contains(W) || (ne = l.optionsElement) != null && ne.contains(W) || l.disabled || l.immediate && l.comboboxState !== 0 && O.microTask(() => {
2793
+ xe(() => a.openCombobox()), a.setActivationTrigger(1);
2753
2794
  });
2754
- }), F = bt(), j = jn(), { isFocused: P, focusProps: L } = Jt({ autoFocus: h }), { isHovered: A, hoverProps: J } = Qt({ isDisabled: m }), U = q(() => ({ open: l.comboboxState === 0, disabled: m, hover: A, focus: P, autofocus: h }), [l, A, P, h, m]), ve = vt({ ref: b, id: d, role: "combobox", type: g, "aria-controls": (n = l.optionsElement) == null ? void 0 : n.id, "aria-expanded": l.comboboxState === 0, "aria-activedescendant": l.activeOptionIndex === null ? void 0 : l.virtual ? (o = l.options.find((R) => !R.dataRef.current.disabled && l.compare(R.dataRef.current.value, l.virtual.options[l.activeOptionIndex]))) == null ? void 0 : o.id : (i = l.options[l.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": F, "aria-describedby": j, "aria-autocomplete": "list", defaultValue: (s = (r = e.defaultValue) != null ? r : l.defaultValue !== void 0 ? u == null ? void 0 : u(l.defaultValue) : null) != null ? s : l.defaultValue, disabled: m || void 0, autoFocus: h, onCompositionStart: N, onCompositionEnd: $, onKeyDown: D, onChange: k, onFocus: w, onBlur: z }, L, J);
2755
- return he({ ourProps: ve, theirProps: v, slot: U, defaultTag: br, name: "Combobox.Input" });
2795
+ }), B = Et(), _ = Yn(), { isFocused: z, focusProps: P } = en({ autoFocus: h }), { isHovered: $, hoverProps: H } = tn({ isDisabled: m }), Y = X(() => ({ open: l.comboboxState === 0, disabled: m, hover: $, focus: z, autofocus: h }), [l, $, z, h, m]), ge = yt({ ref: b, id: d, role: "combobox", type: g, "aria-controls": (n = l.optionsElement) == null ? void 0 : n.id, "aria-expanded": l.comboboxState === 0, "aria-activedescendant": l.activeOptionIndex === null ? void 0 : l.virtual ? (o = l.options.find((R) => !R.dataRef.current.disabled && l.compare(R.dataRef.current.value, l.virtual.options[l.activeOptionIndex]))) == null ? void 0 : o.id : (i = l.options[l.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": B, "aria-describedby": _, "aria-autocomplete": "list", defaultValue: (s = (r = e.defaultValue) != null ? r : l.defaultValue !== void 0 ? f == null ? void 0 : f(l.defaultValue) : null) != null ? s : l.defaultValue, disabled: m || void 0, autoFocus: h, onCompositionStart: L, onCompositionEnd: A, onKeyDown: D, onChange: k, onFocus: x, onBlur: F }, P, H);
2796
+ return pe({ ourProps: ge, theirProps: v, slot: Y, defaultTag: yr, name: "Combobox.Input" });
2756
2797
  }
2757
- let wr = "button";
2758
- function Er(e, t) {
2798
+ let Or = "button";
2799
+ function Sr(e, t) {
2759
2800
  var n;
2760
- let o = $e("Combobox.Button"), i = Ye("Combobox.Button"), r = Se(t, i.setButtonElement), s = An(), l = We(), { id: a = `headlessui-combobox-button-${l}`, disabled: c = o.disabled || !1, autoFocus: f = !1, ...d } = e, p = sn(o.inputElement), u = I((C) => {
2761
- switch (C.key) {
2762
- case Q.Space:
2763
- case Q.Enter:
2764
- C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && we(() => i.openCombobox()), p();
2801
+ let o = De("Combobox.Button"), i = Ye("Combobox.Button"), r = Oe(t, i.setButtonElement), s = Dn(), l = Be(), { id: a = `headlessui-combobox-button-${l}`, disabled: u = o.disabled || !1, autoFocus: c = !1, ...d } = e, p = un(o.inputElement), f = M((S) => {
2802
+ switch (S.key) {
2803
+ case Z.Space:
2804
+ case Z.Enter:
2805
+ S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && xe(() => i.openCombobox()), p();
2765
2806
  return;
2766
- case Q.ArrowDown:
2767
- C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && (we(() => i.openCombobox()), o.value || i.goToOption(H.First)), p();
2807
+ case Z.ArrowDown:
2808
+ S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.First)), p();
2768
2809
  return;
2769
- case Q.ArrowUp:
2770
- C.preventDefault(), C.stopPropagation(), o.comboboxState === 1 && (we(() => i.openCombobox()), o.value || i.goToOption(H.Last)), p();
2810
+ case Z.ArrowUp:
2811
+ S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.Last)), p();
2771
2812
  return;
2772
- case Q.Escape:
2813
+ case Z.Escape:
2773
2814
  if (o.comboboxState !== 0) return;
2774
- C.preventDefault(), o.optionsElement && !o.optionsPropsRef.current.static && C.stopPropagation(), we(() => i.closeCombobox()), p();
2815
+ S.preventDefault(), o.optionsElement && !o.optionsPropsRef.current.static && S.stopPropagation(), xe(() => i.closeCombobox()), p();
2775
2816
  return;
2776
2817
  default:
2777
2818
  return;
2778
2819
  }
2779
- }), m = I((C) => {
2780
- C.preventDefault(), !eo(C.currentTarget) && (C.button === St.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), p());
2781
- }), h = bt([a]), { isFocusVisible: g, focusProps: v } = Jt({ autoFocus: f }), { isHovered: E, hoverProps: b } = Qt({ isDisabled: c }), { pressed: x, pressProps: O } = Ln({ disabled: c }), S = q(() => ({ open: o.comboboxState === 0, active: x || o.comboboxState === 0, disabled: c, value: o.value, hover: E, focus: g }), [o, E, g, x, c]), M = vt({ ref: r, id: a, type: Gn(e, o.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (n = o.optionsElement) == null ? void 0 : n.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": h, disabled: c || void 0, autoFocus: f, onMouseDown: m, onKeyDown: u }, v, b, O);
2782
- return he({ mergeRefs: s, ourProps: M, theirProps: d, slot: S, defaultTag: wr, name: "Combobox.Button" });
2820
+ }), m = M((S) => {
2821
+ S.preventDefault(), !no(S.currentTarget) && (S.button === It.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), p());
2822
+ }), h = Et([a]), { isFocusVisible: g, focusProps: v } = en({ autoFocus: c }), { isHovered: y, hoverProps: b } = tn({ isDisabled: u }), { pressed: E, pressProps: O } = Nn({ disabled: u }), C = X(() => ({ open: o.comboboxState === 0, active: E || o.comboboxState === 0, disabled: u, value: o.value, hover: y, focus: g }), [o, y, g, E, u]), T = yt({ ref: r, id: a, type: Jn(e, o.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (n = o.optionsElement) == null ? void 0 : n.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": h, disabled: u || void 0, autoFocus: c, onMouseDown: m, onKeyDown: f }, v, b, O);
2823
+ return pe({ mergeRefs: s, ourProps: T, theirProps: d, slot: C, defaultTag: Or, name: "Combobox.Button" });
2783
2824
  }
2784
- let yr = "div", Or = Tt.RenderStrategy | Tt.Static;
2785
- function Sr(e, t) {
2825
+ let Rr = "div", Cr = At.RenderStrategy | At.Static;
2826
+ function Tr(e, t) {
2786
2827
  var n, o, i;
2787
- let r = We(), { id: s = `headlessui-combobox-options-${r}`, hold: l = !1, anchor: a, portal: c = !1, modal: f = !0, transition: d = !1, ...p } = e, u = $e("Combobox.Options"), m = Ye("Combobox.Options"), h = zi(a);
2788
- h && (c = !0);
2789
- let [g, v] = Wi(h), [E, b] = ae(null), x = Vi(), O = Se(t, h ? g : null, m.setOptionsElement, b), S = nt(u.optionsElement), M = Jn(), [C, N] = Qn(d, E, M !== null ? (M & Xe.Open) === Xe.Open : u.comboboxState === 0);
2790
- wo(C, u.inputElement, m.closeCombobox);
2791
- let $ = u.__demoMode ? !1 : f && u.comboboxState === 0;
2792
- Po($, S);
2793
- let D = u.__demoMode ? !1 : f && u.comboboxState === 0;
2794
- xo(D, { allowed: ke(() => [u.inputElement, u.buttonElement, u.optionsElement], [u.inputElement, u.buttonElement, u.optionsElement]) }), B(() => {
2795
- var U;
2796
- u.optionsPropsRef.current.static = (U = e.static) != null ? U : !1;
2797
- }, [u.optionsPropsRef, e.static]), B(() => {
2798
- u.optionsPropsRef.current.hold = l;
2799
- }, [u.optionsPropsRef, l]), $o(u.comboboxState === 0, { container: u.optionsElement, accept(U) {
2800
- return U.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : U.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
2801
- }, walk(U) {
2802
- U.setAttribute("role", "none");
2828
+ let r = Be(), { id: s = `headlessui-combobox-options-${r}`, hold: l = !1, anchor: a, portal: u = !1, modal: c = !0, transition: d = !1, ...p } = e, f = De("Combobox.Options"), m = Ye("Combobox.Options"), h = Bi(a);
2829
+ h && (u = !0);
2830
+ let [g, v] = Ui(h), [y, b] = ce(null), E = ji(), O = Oe(t, h ? g : null, m.setOptionsElement, b), C = nt(f.optionsElement), T = Zn(), [S, L] = eo(d, y, T !== null ? (T & Je.Open) === Je.Open : f.comboboxState === 0);
2831
+ Eo(S, f.inputElement, m.closeCombobox);
2832
+ let A = f.__demoMode ? !1 : c && f.comboboxState === 0;
2833
+ $o(A, C);
2834
+ let D = f.__demoMode ? !1 : c && f.comboboxState === 0;
2835
+ yo(D, { allowed: Ne(() => [f.inputElement, f.buttonElement, f.optionsElement], [f.inputElement, f.buttonElement, f.optionsElement]) }), U(() => {
2836
+ var Y;
2837
+ f.optionsPropsRef.current.static = (Y = e.static) != null ? Y : !1;
2838
+ }, [f.optionsPropsRef, e.static]), U(() => {
2839
+ f.optionsPropsRef.current.hold = l;
2840
+ }, [f.optionsPropsRef, l]), Fo(f.comboboxState === 0, { container: f.optionsElement, accept(Y) {
2841
+ return Y.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : Y.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
2842
+ }, walk(Y) {
2843
+ Y.setAttribute("role", "none");
2803
2844
  } });
2804
- let k = bt([(n = u.buttonElement) == null ? void 0 : n.id]), z = q(() => ({ open: u.comboboxState === 0, option: void 0 }), [u.comboboxState]), w = I(() => {
2845
+ let k = Et([(n = f.buttonElement) == null ? void 0 : n.id]), F = X(() => ({ open: f.comboboxState === 0, option: void 0 }), [f.comboboxState]), x = M(() => {
2805
2846
  m.setActivationTrigger(0);
2806
- }), F = I((U) => {
2807
- U.preventDefault(), m.setActivationTrigger(0);
2808
- }), j = vt(h ? x() : {}, { "aria-labelledby": k, role: "listbox", "aria-multiselectable": u.mode === 1 ? !0 : void 0, id: s, ref: O, style: { ...p.style, ...v, "--input-width": Mt(u.inputElement, !0).width, "--button-width": Mt(u.buttonElement, !0).width }, onWheel: u.activationTrigger === 0 ? void 0 : w, onMouseDown: F, ...Zn(N) }), P = C && u.comboboxState === 1, L = ht(P, (o = u.virtual) == null ? void 0 : o.options), A = ht(P, u.value), J = I((U) => u.compare(A, U));
2809
- if (u.virtual) {
2810
- if (L === void 0) throw new Error("Missing `options` in virtual mode");
2811
- Object.assign(p, { children: W.createElement(Ve.Provider, { value: L !== u.virtual.options ? { ...u, virtual: { ...u.virtual, options: L } } : u }, W.createElement(pr, { slot: z }, p.children)) });
2847
+ }), B = M((Y) => {
2848
+ Y.preventDefault(), m.setActivationTrigger(0);
2849
+ }), _ = yt(h ? E() : {}, { "aria-labelledby": k, role: "listbox", "aria-multiselectable": f.mode === 1 ? !0 : void 0, id: s, ref: O, style: { ...p.style, ...v, "--input-width": Dt(f.inputElement, !0).width, "--button-width": Dt(f.buttonElement, !0).width }, onWheel: f.activationTrigger === 0 ? void 0 : x, onMouseDown: B, ...to(L) }), z = S && f.comboboxState === 1, P = xt(z, (o = f.virtual) == null ? void 0 : o.options), $ = xt(z, f.value), H = M((Y) => f.compare($, Y));
2850
+ if (f.virtual) {
2851
+ if (P === void 0) throw new Error("Missing `options` in virtual mode");
2852
+ Object.assign(p, { children: j.createElement(Ve.Provider, { value: P !== f.virtual.options ? { ...f, virtual: { ...f.virtual, options: P } } : f }, j.createElement(vr, { slot: F }, p.children)) });
2812
2853
  }
2813
- return W.createElement(ar, { enabled: c ? e.static || C : !1 }, W.createElement(Ve.Provider, { value: u.mode === 1 ? u : { ...u, isSelected: J } }, he({ ourProps: j, theirProps: { ...p, children: W.createElement(Yi, { freeze: P }, typeof p.children == "function" ? (i = p.children) == null ? void 0 : i.call(p, z) : p.children) }, slot: z, defaultTag: yr, features: Or, visible: C, name: "Combobox.Options" })));
2854
+ return j.createElement(fr, { enabled: u ? e.static || S : !1 }, j.createElement(Ve.Provider, { value: f.mode === 1 ? f : { ...f, isSelected: H } }, pe({ ourProps: _, theirProps: { ...p, children: j.createElement(Gi, { freeze: z }, typeof p.children == "function" ? (i = p.children) == null ? void 0 : i.call(p, F) : p.children) }, slot: F, defaultTag: Rr, features: Cr, visible: S, name: "Combobox.Options" })));
2814
2855
  }
2815
- let Rr = "div";
2816
- function Cr(e, t) {
2856
+ let Ir = "div";
2857
+ function Mr(e, t) {
2817
2858
  var n, o, i, r;
2818
- let s = $e("Combobox.Option"), l = Ye("Combobox.Option"), a = We(), { id: c = `headlessui-combobox-option-${a}`, value: f, disabled: d = (i = (o = (n = s.virtual) == null ? void 0 : n.disabled) == null ? void 0 : o.call(n, f)) != null ? i : !1, order: p = null, ...u } = e, m = sn(s.inputElement), h = s.virtual ? s.activeOptionIndex === s.calculateIndex(f) : s.activeOptionIndex === null ? !1 : ((r = s.options[s.activeOptionIndex]) == null ? void 0 : r.id) === c, g = s.isSelected(f), v = K(null), E = Me({ disabled: d, value: f, domRef: v, order: p }), b = le(Rn), x = Se(t, v, b ? b.measureElement : null), O = I(() => {
2819
- l.setIsTyping(!1), l.onChange(f);
2859
+ let s = De("Combobox.Option"), l = Ye("Combobox.Option"), a = Be(), { id: u = `headlessui-combobox-option-${a}`, value: c, disabled: d = (i = (o = (n = s.virtual) == null ? void 0 : n.disabled) == null ? void 0 : o.call(n, c)) != null ? i : !1, order: p = null, ...f } = e, m = un(s.inputElement), h = s.virtual ? s.activeOptionIndex === s.calculateIndex(c) : s.activeOptionIndex === null ? !1 : ((r = s.options[s.activeOptionIndex]) == null ? void 0 : r.id) === u, g = s.isSelected(c), v = J(null), y = Pe({ disabled: d, value: c, domRef: v, order: p }), b = le(Tn), E = Oe(t, v, b ? b.measureElement : null), O = M(() => {
2860
+ l.setIsTyping(!1), l.onChange(c);
2820
2861
  });
2821
- B(() => l.registerOption(c, E), [E, c]);
2822
- let S = K(!(s.virtual || s.__demoMode));
2823
- B(() => {
2862
+ U(() => l.registerOption(u, y), [y, u]);
2863
+ let C = J(!(s.virtual || s.__demoMode));
2864
+ U(() => {
2824
2865
  if (!s.virtual && !s.__demoMode) return Te().requestAnimationFrame(() => {
2825
- S.current = !0;
2866
+ C.current = !0;
2826
2867
  });
2827
- }, [s.virtual, s.__demoMode]), B(() => {
2828
- if (S.current && s.comboboxState === 0 && h && s.activationTrigger !== 0) return Te().requestAnimationFrame(() => {
2829
- var w, F;
2830
- (F = (w = v.current) == null ? void 0 : w.scrollIntoView) == null || F.call(w, { block: "nearest" });
2868
+ }, [s.virtual, s.__demoMode]), U(() => {
2869
+ if (C.current && s.comboboxState === 0 && h && s.activationTrigger !== 0) return Te().requestAnimationFrame(() => {
2870
+ var x, B;
2871
+ (B = (x = v.current) == null ? void 0 : x.scrollIntoView) == null || B.call(x, { block: "nearest" });
2831
2872
  });
2832
2873
  }, [v, h, s.comboboxState, s.activationTrigger, s.activeOptionIndex]);
2833
- let M = I((w) => {
2834
- w.preventDefault(), w.button === St.Left && (d || (O(), ln() || requestAnimationFrame(() => m()), s.mode === 0 && l.closeCombobox()));
2835
- }), C = I(() => {
2836
- if (d) return l.goToOption(H.Nothing);
2837
- let w = s.calculateIndex(f);
2838
- l.goToOption(H.Specific, w);
2839
- }), N = Ao(), $ = I((w) => N.update(w)), D = I((w) => {
2840
- if (!N.wasMoved(w) || d || h) return;
2841
- let F = s.calculateIndex(f);
2842
- l.goToOption(H.Specific, F, 0);
2843
- }), k = I((w) => {
2844
- N.wasMoved(w) && (d || h && (s.optionsPropsRef.current.hold || l.goToOption(H.Nothing)));
2845
- }), z = q(() => ({ active: h, focus: h, selected: g, disabled: d }), [h, g, d]);
2846
- return he({ ourProps: { id: c, ref: x, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": g, disabled: void 0, onMouseDown: M, onFocus: C, onPointerEnter: $, onMouseEnter: $, onPointerMove: D, onMouseMove: D, onPointerLeave: k, onMouseLeave: k }, theirProps: u, slot: z, defaultTag: Rr, name: "Combobox.Option" });
2847
- }
2848
- let Tr = pe(vr), Ir = pe(Er), Mr = pe(xr), Pr = kn, Ar = pe(Sr), $r = pe(Cr), jr = Object.assign(Tr, { Input: Mr, Button: Ir, Label: Pr, Options: Ar, Option: $r });
2874
+ let T = M((x) => {
2875
+ x.preventDefault(), x.button === It.Left && (d || (O(), cn() || requestAnimationFrame(() => m()), s.mode === 0 && l.closeCombobox()));
2876
+ }), S = M(() => {
2877
+ if (d) return l.goToOption(V.Nothing);
2878
+ let x = s.calculateIndex(c);
2879
+ l.goToOption(V.Specific, x);
2880
+ }), L = Do(), A = M((x) => L.update(x)), D = M((x) => {
2881
+ if (!L.wasMoved(x) || d || h) return;
2882
+ let B = s.calculateIndex(c);
2883
+ l.goToOption(V.Specific, B, 0);
2884
+ }), k = M((x) => {
2885
+ L.wasMoved(x) && (d || h && (s.optionsPropsRef.current.hold || l.goToOption(V.Nothing)));
2886
+ }), F = X(() => ({ active: h, focus: h, selected: g, disabled: d }), [h, g, d]);
2887
+ return pe({ ourProps: { id: u, ref: E, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": g, disabled: void 0, onMouseDown: T, onFocus: S, onPointerEnter: A, onMouseEnter: A, onPointerMove: D, onMouseMove: D, onPointerLeave: k, onMouseLeave: k }, theirProps: f, slot: F, defaultTag: Ir, name: "Combobox.Option" });
2888
+ }
2889
+ let Pr = me(wr), Ar = me(Sr), $r = me(Er), Dr = zn, Fr = me(Tr), Lr = me(Mr), qr = Object.assign(Pr, { Input: $r, Button: Ar, Label: Dr, Options: Fr, Option: Lr });
2849
2890
  export {
2850
- Mr as G,
2851
- jr as H,
2852
- Ar as K,
2853
- Ir as U,
2854
- $r as W
2891
+ $r as G,
2892
+ qr as H,
2893
+ Fr as K,
2894
+ Ar as U,
2895
+ Lr as j
2855
2896
  };