v-float 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,33 @@
1
- var jt = Object.defineProperty;
2
- var zt = (e, t, n) => t in e ? jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var ye = (e, t, n) => zt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { watch as se, computed as N, toValue as D, useId as Ut, ref as U, watchEffect as Kt, onWatcherCleanup as pe, readonly as qt, shallowRef as Xe, onScopeDispose as xe, shallowReactive as Gt, getCurrentScope as Jt, unref as Qt, watchPostEffect as Oe, onMounted as Zt } from "vue";
5
- function So(e, t, n = {}) {
6
- const { offset: o = "-4px" } = n, { middlewareData: i, placement: c, refs: r } = t;
7
- se(e, (f) => {
8
- r.arrowEl.value = f;
1
+ var wn = Object.defineProperty;
2
+ var bn = (t, e, n) => e in t ? wn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var Be = (t, e, n) => bn(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { watch as de, computed as F, toValue as T, useId as yn, ref as ie, watchEffect as xn, onWatcherCleanup as Te, readonly as _t, shallowRef as dt, onScopeDispose as Ie, shallowReactive as En, getCurrentScope as Cn, unref as Tn, watchPostEffect as Me } from "vue";
5
+ function gr(t, e, n = {}) {
6
+ const { offset: o = "-4px" } = n, { middlewareData: r, placement: l, refs: i } = e;
7
+ de(t, (f) => {
8
+ i.arrowEl.value = f;
9
9
  });
10
- const a = N(() => {
10
+ const a = F(() => {
11
11
  var f;
12
- return ((f = i.value.arrow) == null ? void 0 : f.x) ?? 0;
13
- }), d = N(() => {
12
+ return ((f = r.value.arrow) == null ? void 0 : f.x) ?? 0;
13
+ }), d = F(() => {
14
14
  var f;
15
- return ((f = i.value.arrow) == null ? void 0 : f.y) ?? 0;
16
- }), s = N(() => {
17
- if (!(e.value || r.arrowEl.value) || !i.value.arrow)
15
+ return ((f = r.value.arrow) == null ? void 0 : f.y) ?? 0;
16
+ }), s = F(() => {
17
+ if (!(t.value || i.arrowEl.value) || !r.value.arrow)
18
18
  return {};
19
- const u = D(c).split("-")[0], m = a.value, h = d.value;
19
+ const u = T(l).split("-")[0], h = a.value, v = d.value;
20
20
  return u === "bottom" ? {
21
- "inset-inline-start": `${m}px`,
21
+ "inset-inline-start": `${h}px`,
22
22
  "inset-block-start": o
23
23
  } : u === "top" ? {
24
- "inset-inline-start": `${m}px`,
24
+ "inset-inline-start": `${h}px`,
25
25
  "inset-block-end": o
26
26
  } : u === "right" ? {
27
- "inset-block-start": `${h}px`,
27
+ "inset-block-start": `${v}px`,
28
28
  "inset-inline-start": o
29
29
  } : u === "left" ? {
30
- "inset-block-start": `${h}px`,
30
+ "inset-block-start": `${v}px`,
31
31
  "inset-inline-end": o
32
32
  } : {};
33
33
  });
@@ -37,102 +37,102 @@ function So(e, t, n = {}) {
37
37
  arrowStyles: s
38
38
  };
39
39
  }
40
- let en = 0;
41
- function St() {
42
- return Ut() || `id-${++en}`;
40
+ let An = 0;
41
+ function jt() {
42
+ return yn() || `id-${++An}`;
43
43
  }
44
- function Ye(e) {
45
- return e instanceof Element && e instanceof HTMLElement;
44
+ function Xe(t) {
45
+ return t instanceof Element && t instanceof HTMLElement;
46
46
  }
47
- function tn() {
47
+ function Sn() {
48
48
  return typeof navigator > "u" ? !1 : navigator.platform.toUpperCase().indexOf("MAC") >= 0;
49
49
  }
50
- function nn() {
50
+ function On() {
51
51
  return typeof navigator > "u" ? !1 : /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
52
52
  }
53
- function on(e) {
54
- return typeof (e == null ? void 0 : e.matches) != "function" ? !1 : e.matches(":focus-visible");
53
+ function Ln(t) {
54
+ return typeof (t == null ? void 0 : t.matches) != "function" ? !1 : t.matches(":focus-visible");
55
55
  }
56
- function Lt(e, t) {
57
- if (e === void 0) return !1;
58
- const n = e === "mouse";
59
- return t ? n : n || e === "pen";
56
+ function qt(t, e) {
57
+ if (t === void 0) return !1;
58
+ const n = t === "mouse";
59
+ return e ? n : n || t === "pen";
60
60
  }
61
- function At(e) {
62
- return !e || !(e instanceof HTMLElement) ? !1 : e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e.isContentEditable && e.contentEditable !== "false";
61
+ function wt(t) {
62
+ return !t || !(t instanceof HTMLElement) ? !1 : t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t.isContentEditable && t.contentEditable !== "false";
63
63
  }
64
- function lt(e) {
65
- const t = e.target;
66
- return t instanceof HTMLElement ? t.tagName === "BUTTON" || t.tagName === "INPUT" && t.getAttribute("type") === "button" || t.getAttribute("role") === "button" : !1;
64
+ function Tt(t) {
65
+ const e = t.target;
66
+ return e instanceof HTMLElement ? e.tagName === "BUTTON" || e.tagName === "INPUT" && e.getAttribute("type") === "button" || e.getAttribute("role") === "button" : !1;
67
67
  }
68
- function at(e) {
69
- return At(e);
68
+ function At(t) {
69
+ return wt(t);
70
70
  }
71
- function ct(e, t) {
72
- return t ? "composedPath" in e && typeof e.composedPath == "function" ? e.composedPath().includes(t) : t.contains(e.target) : !1;
71
+ function St(t, e) {
72
+ return e ? "composedPath" in t && typeof t.composedPath == "function" ? t.composedPath().includes(e) : e.contains(t.target) : !1;
73
73
  }
74
- function rn(e, t) {
75
- const n = t.getBoundingClientRect(), o = t.offsetWidth - t.clientWidth, i = t.offsetHeight - t.clientHeight, c = e.clientX - n.left, r = e.clientY - n.top;
74
+ function Dn(t, e) {
75
+ const n = e.getBoundingClientRect(), o = e.offsetWidth - e.clientWidth, r = e.offsetHeight - e.clientHeight, l = t.clientX - n.left, i = t.clientY - n.top;
76
76
  if (o > 0) {
77
- const a = t.clientWidth;
78
- if (c >= a && c <= t.offsetWidth)
77
+ const a = e.clientWidth;
78
+ if (l >= a && l <= e.offsetWidth)
79
79
  return !0;
80
80
  }
81
- if (i > 0) {
82
- const a = t.clientHeight;
83
- if (r >= a && r <= t.offsetHeight)
81
+ if (r > 0) {
82
+ const a = e.clientHeight;
83
+ if (i >= a && i <= e.offsetHeight)
84
84
  return !0;
85
85
  }
86
86
  return !1;
87
87
  }
88
- function $e(e, t) {
89
- return e.contains(t);
88
+ function ut(t, e) {
89
+ return t.contains(e);
90
90
  }
91
- function sn(e) {
92
- return e.target;
91
+ function Pn(t) {
92
+ return t.target;
93
93
  }
94
- function ut() {
94
+ function Ot() {
95
95
  return typeof performance < "u" ? performance.now() : Date.now();
96
96
  }
97
- function ft(e) {
98
- e !== -1 && clearTimeout(e);
97
+ function Lt(t) {
98
+ t !== -1 && clearTimeout(t);
99
99
  }
100
- function ln(e) {
101
- return e !== null && typeof e == "object" && "data" in e && "id" in e && "children" in e && "parent" in e;
100
+ function Rn(t) {
101
+ return t !== null && typeof t == "object" && "data" in t && "id" in t && "children" in t && "parent" in t;
102
102
  }
103
- function Ke(e) {
104
- return ln(e) ? {
105
- floatingContext: e.data,
106
- treeContext: e
103
+ function je(t) {
104
+ return Rn(t) ? {
105
+ floatingContext: t.data,
106
+ treeContext: t
107
107
  } : {
108
- floatingContext: e,
108
+ floatingContext: t,
109
109
  treeContext: null
110
110
  };
111
111
  }
112
- function q(e, t) {
113
- if (!t) return !1;
114
- if (typeof t == "object" && t !== null && "contextElement" in t) {
115
- const n = t.contextElement;
116
- return n instanceof Element ? n.contains(e) : !1;
112
+ function ue(t, e) {
113
+ if (!e) return !1;
114
+ if (typeof e == "object" && e !== null && "contextElement" in e) {
115
+ const n = e.contextElement;
116
+ return n instanceof Element ? n.contains(t) : !1;
117
117
  }
118
- return t instanceof Element ? t.contains(e) : !1;
118
+ return e instanceof Element ? e.contains(t) : !1;
119
119
  }
120
- function qe(e, t) {
121
- for (const n of e.children.value)
120
+ function rt(t, e) {
121
+ for (const n of t.children.value)
122
122
  if (n.data.open.value) {
123
- if (q(t, n.data.refs.anchorEl.value) || q(t, n.data.refs.floatingEl.value))
123
+ if (ue(e, n.data.refs.anchorEl.value) || ue(e, n.data.refs.floatingEl.value))
124
124
  return n;
125
- const o = qe(n, t);
125
+ const o = rt(n, e);
126
126
  if (o) return o;
127
127
  }
128
128
  return null;
129
129
  }
130
- const De = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, me = class me {
130
+ const Ge = (t) => typeof t == "number" && Number.isFinite(t) ? t : null, Re = class Re {
131
131
  /**
132
132
  * Create a virtual anchor element
133
133
  */
134
- create(t) {
135
- const n = this.buildConfiguration(t);
134
+ create(e) {
135
+ const n = this.buildConfiguration(e);
136
136
  return {
137
137
  contextElement: n.referenceElement || void 0,
138
138
  getBoundingClientRect: () => this.buildBoundingRect(n)
@@ -141,83 +141,83 @@ const De = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, me = cl
141
141
  /**
142
142
  * Build configuration from options with defaults
143
143
  */
144
- buildConfiguration(t) {
144
+ buildConfiguration(e) {
145
145
  return {
146
- coordinates: t.coordinates,
147
- referenceElement: t.referenceElement ?? null,
148
- baselineCoordinates: t.baselineCoordinates ?? null,
149
- axis: t.axis ?? "both"
146
+ coordinates: e.coordinates,
147
+ referenceElement: e.referenceElement ?? null,
148
+ baselineCoordinates: e.baselineCoordinates ?? null,
149
+ axis: e.axis ?? "both"
150
150
  };
151
151
  }
152
152
  /**
153
153
  * Build the bounding rectangle for the virtual element
154
154
  */
155
- buildBoundingRect(t) {
156
- const n = this.getReferenceRect(t.referenceElement), o = this.resolvePosition(t, n), i = this.calculateSize(t.axis, n);
155
+ buildBoundingRect(e) {
156
+ const n = this.getReferenceRect(e.referenceElement), o = this.resolvePosition(e, n), r = this.calculateSize(e.axis, n);
157
157
  return this.buildDOMRect({
158
158
  x: o.x,
159
159
  y: o.y,
160
- width: i.width,
161
- height: i.height
160
+ width: r.width,
161
+ height: r.height
162
162
  });
163
163
  }
164
164
  /**
165
165
  * Get reference element bounds with fallback
166
166
  */
167
- getReferenceRect(t) {
168
- if (t)
167
+ getReferenceRect(e) {
168
+ if (e)
169
169
  try {
170
- return t.getBoundingClientRect();
170
+ return e.getBoundingClientRect();
171
171
  } catch (n) {
172
- console.warn("VirtualElementFactory: Failed to get element bounds", { element: t, error: n });
172
+ console.warn("VirtualElementFactory: Failed to get element bounds", { element: e, error: n });
173
173
  }
174
174
  return this.buildDOMRect({
175
175
  x: 0,
176
176
  y: 0,
177
- width: me.DEFAULT_DIMENSIONS.width,
178
- height: me.DEFAULT_DIMENSIONS.height
177
+ width: Re.DEFAULT_DIMENSIONS.width,
178
+ height: Re.DEFAULT_DIMENSIONS.height
179
179
  });
180
180
  }
181
181
  /**
182
182
  * Resolve final position from coordinate sources
183
183
  */
184
- resolvePosition(t, n) {
185
- var o, i;
184
+ resolvePosition(e, n) {
185
+ var o, r;
186
186
  return {
187
187
  x: this.resolveAxisCoordinate({
188
- current: t.coordinates.x,
189
- baseline: ((o = t.baselineCoordinates) == null ? void 0 : o.x) ?? null,
188
+ current: e.coordinates.x,
189
+ baseline: ((o = e.baselineCoordinates) == null ? void 0 : o.x) ?? null,
190
190
  fallback: n.x,
191
- isAxisEnabled: t.axis === "x" || t.axis === "both"
191
+ isAxisEnabled: e.axis === "x" || e.axis === "both"
192
192
  }),
193
193
  y: this.resolveAxisCoordinate({
194
- current: t.coordinates.y,
195
- baseline: ((i = t.baselineCoordinates) == null ? void 0 : i.y) ?? null,
194
+ current: e.coordinates.y,
195
+ baseline: ((r = e.baselineCoordinates) == null ? void 0 : r.y) ?? null,
196
196
  fallback: n.y,
197
- isAxisEnabled: t.axis === "y" || t.axis === "both"
197
+ isAxisEnabled: e.axis === "y" || e.axis === "both"
198
198
  })
199
199
  };
200
200
  }
201
201
  /**
202
202
  * Resolve coordinate for a single axis with clear precedence
203
203
  */
204
- resolveAxisCoordinate(t) {
205
- const { current: n, baseline: o, fallback: i, isAxisEnabled: c } = t;
206
- return c && n !== null ? n : o !== null ? o : i;
204
+ resolveAxisCoordinate(e) {
205
+ const { current: n, baseline: o, fallback: r, isAxisEnabled: l } = e;
206
+ return l && n !== null ? n : o !== null ? o : r;
207
207
  }
208
208
  /**
209
209
  * Calculate virtual element size based on axis constraints
210
210
  */
211
- calculateSize(t, n) {
212
- const o = (i, c) => Math.max(0, i || c);
213
- switch (t) {
211
+ calculateSize(e, n) {
212
+ const o = (r, l) => Math.max(0, r || l);
213
+ switch (e) {
214
214
  case "both":
215
215
  return { width: 0, height: 0 };
216
216
  case "x":
217
217
  return {
218
218
  width: o(
219
219
  n.width,
220
- me.DEFAULT_DIMENSIONS.width
220
+ Re.DEFAULT_DIMENSIONS.width
221
221
  ),
222
222
  height: 0
223
223
  };
@@ -226,7 +226,7 @@ const De = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, me = cl
226
226
  width: 0,
227
227
  height: o(
228
228
  n.height,
229
- me.DEFAULT_DIMENSIONS.height
229
+ Re.DEFAULT_DIMENSIONS.height
230
230
  )
231
231
  };
232
232
  }
@@ -234,27 +234,27 @@ const De = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, me = cl
234
234
  /**
235
235
  * Build a DOMRect object
236
236
  */
237
- buildDOMRect(t) {
238
- const { x: n, y: o, width: i, height: c } = t, r = Math.max(0, i), a = Math.max(0, c);
237
+ buildDOMRect(e) {
238
+ const { x: n, y: o, width: r, height: l } = e, i = Math.max(0, r), a = Math.max(0, l);
239
239
  return {
240
240
  x: n,
241
241
  y: o,
242
- width: r,
242
+ width: i,
243
243
  height: a,
244
244
  top: o,
245
- right: n + r,
245
+ right: n + i,
246
246
  bottom: o + a,
247
247
  left: n,
248
- toJSON: () => ({ x: n, y: o, width: r, height: a })
248
+ toJSON: () => ({ x: n, y: o, width: i, height: a })
249
249
  };
250
250
  }
251
251
  };
252
- ye(me, "DEFAULT_DIMENSIONS", { width: 100, height: 30 });
253
- let je = me;
254
- class Dt {
252
+ Be(Re, "DEFAULT_DIMENSIONS", { width: 100, height: 30 });
253
+ let ht = Re;
254
+ class Gt {
255
255
  constructor() {
256
256
  // The core state every strategy needs: the last known good coordinates
257
- ye(this, "lastKnownCoordinates", null);
257
+ Be(this, "lastKnownCoordinates", null);
258
258
  }
259
259
  /**
260
260
  * Get coordinates to use when the floating element opens
@@ -277,10 +277,10 @@ class Dt {
277
277
  this.lastKnownCoordinates = null;
278
278
  }
279
279
  }
280
- class an extends Dt {
280
+ class Mn extends Gt {
281
281
  constructor() {
282
282
  super(...arguments);
283
- ye(this, "name", "follow");
283
+ Be(this, "name", "follow");
284
284
  }
285
285
  /**
286
286
  * Follow strategy needs all pointer events for continuous tracking
@@ -293,26 +293,26 @@ class an extends Dt {
293
293
  * This creates smooth, continuous tracking behavior
294
294
  */
295
295
  process(n, o) {
296
- const i = n.coordinates;
297
- switch (this.lastKnownCoordinates = i, n.type) {
296
+ const r = n.coordinates;
297
+ switch (this.lastKnownCoordinates = r, n.type) {
298
298
  case "pointerdown":
299
- return i;
299
+ return r;
300
300
  case "pointermove":
301
- return o.isOpen && Lt(n.originalEvent.pointerType, !0) ? i : null;
301
+ return o.isOpen && qt(n.originalEvent.pointerType, !0) ? r : null;
302
302
  case "pointerenter":
303
- return i;
303
+ return r;
304
304
  default:
305
305
  return null;
306
306
  }
307
307
  }
308
308
  }
309
- class cn extends Dt {
309
+ class Nn extends Gt {
310
310
  constructor() {
311
311
  super(...arguments);
312
- ye(this, "name", "static");
312
+ Be(this, "name", "static");
313
313
  // Static strategy needs to remember the "trigger" coordinates from clicks
314
314
  // These take priority over hover coordinates for positioning
315
- ye(this, "triggerCoordinates", null);
315
+ Be(this, "triggerCoordinates", null);
316
316
  }
317
317
  /**
318
318
  * Static strategy only needs click events, not hover or continuous movement
@@ -326,8 +326,8 @@ class cn extends Dt {
326
326
  * This creates stable positioning that doesn't jump around
327
327
  */
328
328
  process(n, o) {
329
- const i = n.coordinates;
330
- return this.triggerCoordinates = i, this.lastKnownCoordinates = i, o.isOpen ? i : null;
329
+ const r = n.coordinates;
330
+ return this.triggerCoordinates = r, this.lastKnownCoordinates = r, o.isOpen ? r : null;
331
331
  }
332
332
  /**
333
333
  * Get coordinates to use when floating element opens
@@ -345,532 +345,532 @@ class cn extends Dt {
345
345
  this.triggerCoordinates = null;
346
346
  }
347
347
  }
348
- function Lo(e, t, n = {}) {
349
- const { open: o, refs: i } = t, c = new je(), r = U({ x: null, y: null }), a = U(null), d = N(() => D(n.axis ?? "both")), s = N(() => D(n.enabled ?? !0)), f = N(() => De(D(n.x ?? null))), u = N(() => De(D(n.y ?? null))), m = N(
348
+ function wr(t, e, n = {}) {
349
+ const { open: o, refs: r } = e, l = new ht(), i = ie({ x: null, y: null }), a = ie(null), d = F(() => T(n.axis ?? "both")), s = F(() => T(n.enabled ?? !0)), f = F(() => Ge(T(n.x ?? null))), u = F(() => Ge(T(n.y ?? null))), h = F(
350
350
  () => f.value !== null && u.value !== null
351
- ), h = N(() => m.value ? {
351
+ ), v = F(() => h.value ? {
352
352
  x: f.value,
353
353
  y: u.value
354
- } : r.value), p = N(() => {
355
- const y = h.value;
354
+ } : i.value), g = F(() => {
355
+ const E = v.value;
356
356
  switch (d.value) {
357
357
  case "x":
358
- return { x: y.x, y: null };
358
+ return { x: E.x, y: null };
359
359
  case "y":
360
- return { x: null, y: y.y };
360
+ return { x: null, y: E.y };
361
361
  case "both":
362
- return y;
362
+ return E;
363
363
  }
364
- }), g = (n.trackingMode ?? "follow") === "follow" ? new an() : new cn(), v = (y, O) => {
365
- m.value || (r.value = {
366
- x: De(y),
367
- y: De(O)
364
+ }), w = (n.trackingMode ?? "follow") === "follow" ? new Mn() : new Nn(), m = (E, P) => {
365
+ h.value || (i.value = {
366
+ x: Ge(E),
367
+ y: Ge(P)
368
368
  });
369
- }, x = () => {
370
- m.value || (r.value = { x: null, y: null });
371
- }, b = (y, O) => {
372
- const M = {
373
- type: O,
374
- coordinates: { x: y.clientX, y: y.clientY },
375
- originalEvent: y
376
- }, R = g.process(M, {
369
+ }, p = () => {
370
+ h.value || (i.value = { x: null, y: null });
371
+ }, y = (E, P) => {
372
+ const z = {
373
+ type: P,
374
+ coordinates: { x: E.clientX, y: E.clientY },
375
+ originalEvent: E
376
+ }, k = w.process(z, {
377
377
  isOpen: o.value
378
378
  });
379
- R && v(R.x, R.y);
379
+ k && m(k.x, k.y);
380
380
  };
381
- se(
382
- [p, a, d, e],
381
+ de(
382
+ [g, a, d, t],
383
383
  () => {
384
- i.anchorEl.value = c.create({
385
- coordinates: p.value,
386
- referenceElement: e.value,
384
+ r.anchorEl.value = l.create({
385
+ coordinates: g.value,
386
+ referenceElement: t.value,
387
387
  baselineCoordinates: a.value,
388
388
  axis: d.value
389
389
  });
390
390
  },
391
391
  { immediate: !0 }
392
- ), se(o, (y) => {
393
- if (!(!s.value || m.value))
394
- if (y) {
395
- const O = g.getCoordinatesForOpening();
396
- O ? (v(O.x, O.y), a.value = { ...O }) : a.value = { ...r.value };
392
+ ), de(o, (E) => {
393
+ if (!(!s.value || h.value))
394
+ if (E) {
395
+ const P = w.getCoordinatesForOpening();
396
+ P ? (m(P.x, P.y), a.value = { ...P }) : a.value = { ...i.value };
397
397
  } else
398
- g.onClose(), x(), a.value = null;
398
+ w.onClose(), p(), a.value = null;
399
399
  });
400
- const E = (y) => {
401
- b(y, "pointerdown");
402
- }, P = (y) => {
403
- b(y, "pointerenter");
404
- }, S = (y) => {
405
- b(y, "pointermove");
400
+ const L = (E) => {
401
+ y(E, "pointerdown");
402
+ }, R = (E) => {
403
+ y(E, "pointerenter");
404
+ }, D = (E) => {
405
+ y(E, "pointermove");
406
406
  };
407
- return Kt(() => {
408
- if (m.value || !s.value) return;
409
- const y = e.value;
410
- if (!y) return;
411
- const O = g.getRequiredEvents(), M = {
412
- pointerenter: P,
413
- pointerdown: E,
414
- pointermove: S
407
+ return xn(() => {
408
+ if (h.value || !s.value) return;
409
+ const E = t.value;
410
+ if (!E) return;
411
+ const P = w.getRequiredEvents(), z = {
412
+ pointerenter: R,
413
+ pointerdown: L,
414
+ pointermove: D
415
415
  };
416
- O.forEach((R) => {
417
- const A = M[R];
418
- A && y.addEventListener(R, A);
419
- }), pe(() => {
420
- O.forEach((R) => {
421
- const A = M[R];
422
- A && y.removeEventListener(R, A);
416
+ P.forEach((k) => {
417
+ const N = z[k];
418
+ N && E.addEventListener(k, N);
419
+ }), Te(() => {
420
+ P.forEach((k) => {
421
+ const N = z[k];
422
+ N && E.removeEventListener(k, N);
423
423
  });
424
424
  });
425
425
  }), {
426
- coordinates: qt(p),
427
- updatePosition: (y, O) => v(y, O)
426
+ coordinates: _t(g),
427
+ updatePosition: (E, P) => m(E, P)
428
428
  };
429
429
  }
430
- const Rt = ["top", "right", "bottom", "left"], dt = ["start", "end"], ht = /* @__PURE__ */ Rt.reduce((e, t) => e.concat(t, t + "-" + dt[0], t + "-" + dt[1]), []), le = Math.min, Y = Math.max, Me = Math.round, Re = Math.floor, Z = (e) => ({
431
- x: e,
432
- y: e
433
- }), un = {
430
+ const Zt = ["top", "right", "bottom", "left"], Dt = ["start", "end"], Pt = /* @__PURE__ */ Zt.reduce((t, e) => t.concat(e, e + "-" + Dt[0], e + "-" + Dt[1]), []), Oe = Math.min, ae = Math.max, Qe = Math.round, Ze = Math.floor, be = (t) => ({
431
+ x: t,
432
+ y: t
433
+ }), In = {
434
434
  left: "right",
435
435
  right: "left",
436
436
  bottom: "top",
437
437
  top: "bottom"
438
- }, fn = {
438
+ }, Fn = {
439
439
  start: "end",
440
440
  end: "start"
441
441
  };
442
- function ze(e, t, n) {
443
- return Y(e, le(t, n));
442
+ function vt(t, e, n) {
443
+ return ae(t, Oe(e, n));
444
444
  }
445
- function ce(e, t) {
446
- return typeof e == "function" ? e(t) : e;
445
+ function De(t, e) {
446
+ return typeof t == "function" ? t(e) : t;
447
447
  }
448
- function ee(e) {
449
- return e.split("-")[0];
448
+ function ye(t) {
449
+ return t.split("-")[0];
450
450
  }
451
- function G(e) {
452
- return e.split("-")[1];
451
+ function pe(t) {
452
+ return t.split("-")[1];
453
453
  }
454
- function Mt(e) {
455
- return e === "x" ? "y" : "x";
454
+ function Jt(t) {
455
+ return t === "x" ? "y" : "x";
456
456
  }
457
- function Ge(e) {
458
- return e === "y" ? "height" : "width";
457
+ function bt(t) {
458
+ return t === "y" ? "height" : "width";
459
459
  }
460
- const dn = /* @__PURE__ */ new Set(["top", "bottom"]);
461
- function ie(e) {
462
- return dn.has(ee(e)) ? "y" : "x";
460
+ const kn = /* @__PURE__ */ new Set(["top", "bottom"]);
461
+ function Ce(t) {
462
+ return kn.has(ye(t)) ? "y" : "x";
463
463
  }
464
- function Je(e) {
465
- return Mt(ie(e));
464
+ function yt(t) {
465
+ return Jt(Ce(t));
466
466
  }
467
- function Nt(e, t, n) {
467
+ function Qt(t, e, n) {
468
468
  n === void 0 && (n = !1);
469
- const o = G(e), i = Je(e), c = Ge(i);
470
- let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
471
- return t.reference[c] > t.floating[c] && (r = ke(r)), [r, ke(r)];
469
+ const o = pe(t), r = yt(t), l = bt(r);
470
+ let i = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
471
+ return e.reference[l] > e.floating[l] && (i = tt(i)), [i, tt(i)];
472
472
  }
473
- function hn(e) {
474
- const t = ke(e);
475
- return [Ne(e), t, Ne(t)];
473
+ function Hn(t) {
474
+ const e = tt(t);
475
+ return [et(t), e, et(e)];
476
476
  }
477
- function Ne(e) {
478
- return e.replace(/start|end/g, (t) => fn[t]);
477
+ function et(t) {
478
+ return t.replace(/start|end/g, (e) => Fn[e]);
479
479
  }
480
- const mt = ["left", "right"], pt = ["right", "left"], mn = ["top", "bottom"], pn = ["bottom", "top"];
481
- function vn(e, t, n) {
482
- switch (e) {
480
+ const Rt = ["left", "right"], Mt = ["right", "left"], Bn = ["top", "bottom"], Wn = ["bottom", "top"];
481
+ function Vn(t, e, n) {
482
+ switch (t) {
483
483
  case "top":
484
484
  case "bottom":
485
- return n ? t ? pt : mt : t ? mt : pt;
485
+ return n ? e ? Mt : Rt : e ? Rt : Mt;
486
486
  case "left":
487
487
  case "right":
488
- return t ? mn : pn;
488
+ return e ? Bn : Wn;
489
489
  default:
490
490
  return [];
491
491
  }
492
492
  }
493
- function gn(e, t, n, o) {
494
- const i = G(e);
495
- let c = vn(ee(e), n === "start", o);
496
- return i && (c = c.map((r) => r + "-" + i), t && (c = c.concat(c.map(Ne)))), c;
493
+ function $n(t, e, n, o) {
494
+ const r = pe(t);
495
+ let l = Vn(ye(t), n === "start", o);
496
+ return r && (l = l.map((i) => i + "-" + r), e && (l = l.concat(l.map(et)))), l;
497
497
  }
498
- function ke(e) {
499
- return e.replace(/left|right|bottom|top/g, (t) => un[t]);
498
+ function tt(t) {
499
+ return t.replace(/left|right|bottom|top/g, (e) => In[e]);
500
500
  }
501
- function wn(e) {
501
+ function Kn(t) {
502
502
  return {
503
503
  top: 0,
504
504
  right: 0,
505
505
  bottom: 0,
506
506
  left: 0,
507
- ...e
507
+ ...t
508
508
  };
509
509
  }
510
- function kt(e) {
511
- return typeof e != "number" ? wn(e) : {
512
- top: e,
513
- right: e,
514
- bottom: e,
515
- left: e
510
+ function en(t) {
511
+ return typeof t != "number" ? Kn(t) : {
512
+ top: t,
513
+ right: t,
514
+ bottom: t,
515
+ left: t
516
516
  };
517
517
  }
518
- function Fe(e) {
518
+ function nt(t) {
519
519
  const {
520
- x: t,
520
+ x: e,
521
521
  y: n,
522
522
  width: o,
523
- height: i
524
- } = e;
523
+ height: r
524
+ } = t;
525
525
  return {
526
526
  width: o,
527
- height: i,
527
+ height: r,
528
528
  top: n,
529
- left: t,
530
- right: t + o,
531
- bottom: n + i,
532
- x: t,
529
+ left: e,
530
+ right: e + o,
531
+ bottom: n + r,
532
+ x: e,
533
533
  y: n
534
534
  };
535
535
  }
536
- function vt(e, t, n) {
536
+ function Nt(t, e, n) {
537
537
  let {
538
538
  reference: o,
539
- floating: i
540
- } = e;
541
- const c = ie(t), r = Je(t), a = Ge(r), d = ee(t), s = c === "y", f = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[a] / 2 - i[a] / 2;
542
- let h;
539
+ floating: r
540
+ } = t;
541
+ const l = Ce(e), i = yt(e), a = bt(i), d = ye(e), s = l === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, h = o[a] / 2 - r[a] / 2;
542
+ let v;
543
543
  switch (d) {
544
544
  case "top":
545
- h = {
545
+ v = {
546
546
  x: f,
547
- y: o.y - i.height
547
+ y: o.y - r.height
548
548
  };
549
549
  break;
550
550
  case "bottom":
551
- h = {
551
+ v = {
552
552
  x: f,
553
553
  y: o.y + o.height
554
554
  };
555
555
  break;
556
556
  case "right":
557
- h = {
557
+ v = {
558
558
  x: o.x + o.width,
559
559
  y: u
560
560
  };
561
561
  break;
562
562
  case "left":
563
- h = {
564
- x: o.x - i.width,
563
+ v = {
564
+ x: o.x - r.width,
565
565
  y: u
566
566
  };
567
567
  break;
568
568
  default:
569
- h = {
569
+ v = {
570
570
  x: o.x,
571
571
  y: o.y
572
572
  };
573
573
  }
574
- switch (G(t)) {
574
+ switch (pe(e)) {
575
575
  case "start":
576
- h[r] -= m * (n && s ? -1 : 1);
576
+ v[i] -= h * (n && s ? -1 : 1);
577
577
  break;
578
578
  case "end":
579
- h[r] += m * (n && s ? -1 : 1);
579
+ v[i] += h * (n && s ? -1 : 1);
580
580
  break;
581
581
  }
582
- return h;
582
+ return v;
583
583
  }
584
- const yn = async (e, t, n) => {
584
+ const zn = async (t, e, n) => {
585
585
  const {
586
586
  placement: o = "bottom",
587
- strategy: i = "absolute",
588
- middleware: c = [],
589
- platform: r
590
- } = n, a = c.filter(Boolean), d = await (r.isRTL == null ? void 0 : r.isRTL(t));
591
- let s = await r.getElementRects({
592
- reference: e,
593
- floating: t,
594
- strategy: i
587
+ strategy: r = "absolute",
588
+ middleware: l = [],
589
+ platform: i
590
+ } = n, a = l.filter(Boolean), d = await (i.isRTL == null ? void 0 : i.isRTL(e));
591
+ let s = await i.getElementRects({
592
+ reference: t,
593
+ floating: e,
594
+ strategy: r
595
595
  }), {
596
596
  x: f,
597
597
  y: u
598
- } = vt(s, o, d), m = o, h = {}, p = 0;
599
- for (let g = 0; g < a.length; g++) {
598
+ } = Nt(s, o, d), h = o, v = {}, g = 0;
599
+ for (let w = 0; w < a.length; w++) {
600
600
  const {
601
- name: v,
602
- fn: x
603
- } = a[g], {
604
- x: b,
605
- y: E,
606
- data: P,
607
- reset: S
608
- } = await x({
601
+ name: m,
602
+ fn: p
603
+ } = a[w], {
604
+ x: y,
605
+ y: L,
606
+ data: R,
607
+ reset: D
608
+ } = await p({
609
609
  x: f,
610
610
  y: u,
611
611
  initialPlacement: o,
612
- placement: m,
613
- strategy: i,
614
- middlewareData: h,
612
+ placement: h,
613
+ strategy: r,
614
+ middlewareData: v,
615
615
  rects: s,
616
- platform: r,
616
+ platform: i,
617
617
  elements: {
618
- reference: e,
619
- floating: t
618
+ reference: t,
619
+ floating: e
620
620
  }
621
621
  });
622
- f = b ?? f, u = E ?? u, h = {
623
- ...h,
624
- [v]: {
625
- ...h[v],
626
- ...P
622
+ f = y ?? f, u = L ?? u, v = {
623
+ ...v,
624
+ [m]: {
625
+ ...v[m],
626
+ ...R
627
627
  }
628
- }, S && p <= 50 && (p++, typeof S == "object" && (S.placement && (m = S.placement), S.rects && (s = S.rects === !0 ? await r.getElementRects({
629
- reference: e,
630
- floating: t,
631
- strategy: i
632
- }) : S.rects), {
628
+ }, D && g <= 50 && (g++, typeof D == "object" && (D.placement && (h = D.placement), D.rects && (s = D.rects === !0 ? await i.getElementRects({
629
+ reference: t,
630
+ floating: e,
631
+ strategy: r
632
+ }) : D.rects), {
633
633
  x: f,
634
634
  y: u
635
- } = vt(s, m, d)), g = -1);
635
+ } = Nt(s, h, d)), w = -1);
636
636
  }
637
637
  return {
638
638
  x: f,
639
639
  y: u,
640
- placement: m,
641
- strategy: i,
642
- middlewareData: h
640
+ placement: h,
641
+ strategy: r,
642
+ middlewareData: v
643
643
  };
644
644
  };
645
- async function Ee(e, t) {
645
+ async function Ve(t, e) {
646
646
  var n;
647
- t === void 0 && (t = {});
647
+ e === void 0 && (e = {});
648
648
  const {
649
649
  x: o,
650
- y: i,
651
- platform: c,
652
- rects: r,
650
+ y: r,
651
+ platform: l,
652
+ rects: i,
653
653
  elements: a,
654
654
  strategy: d
655
- } = e, {
655
+ } = t, {
656
656
  boundary: s = "clippingAncestors",
657
657
  rootBoundary: f = "viewport",
658
658
  elementContext: u = "floating",
659
- altBoundary: m = !1,
660
- padding: h = 0
661
- } = ce(t, e), p = kt(h), v = a[m ? u === "floating" ? "reference" : "floating" : u], x = Fe(await c.getClippingRect({
662
- element: (n = await (c.isElement == null ? void 0 : c.isElement(v))) == null || n ? v : v.contextElement || await (c.getDocumentElement == null ? void 0 : c.getDocumentElement(a.floating)),
659
+ altBoundary: h = !1,
660
+ padding: v = 0
661
+ } = De(e, t), g = en(v), m = a[h ? u === "floating" ? "reference" : "floating" : u], p = nt(await l.getClippingRect({
662
+ element: (n = await (l.isElement == null ? void 0 : l.isElement(m))) == null || n ? m : m.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(a.floating)),
663
663
  boundary: s,
664
664
  rootBoundary: f,
665
665
  strategy: d
666
- })), b = u === "floating" ? {
666
+ })), y = u === "floating" ? {
667
667
  x: o,
668
- y: i,
669
- width: r.floating.width,
670
- height: r.floating.height
671
- } : r.reference, E = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(a.floating)), P = await (c.isElement == null ? void 0 : c.isElement(E)) ? await (c.getScale == null ? void 0 : c.getScale(E)) || {
668
+ y: r,
669
+ width: i.floating.width,
670
+ height: i.floating.height
671
+ } : i.reference, L = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(a.floating)), R = await (l.isElement == null ? void 0 : l.isElement(L)) ? await (l.getScale == null ? void 0 : l.getScale(L)) || {
672
672
  x: 1,
673
673
  y: 1
674
674
  } : {
675
675
  x: 1,
676
676
  y: 1
677
- }, S = Fe(c.convertOffsetParentRelativeRectToViewportRelativeRect ? await c.convertOffsetParentRelativeRectToViewportRelativeRect({
677
+ }, D = nt(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
678
678
  elements: a,
679
- rect: b,
680
- offsetParent: E,
679
+ rect: y,
680
+ offsetParent: L,
681
681
  strategy: d
682
- }) : b);
682
+ }) : y);
683
683
  return {
684
- top: (x.top - S.top + p.top) / P.y,
685
- bottom: (S.bottom - x.bottom + p.bottom) / P.y,
686
- left: (x.left - S.left + p.left) / P.x,
687
- right: (S.right - x.right + p.right) / P.x
684
+ top: (p.top - D.top + g.top) / R.y,
685
+ bottom: (D.bottom - p.bottom + g.bottom) / R.y,
686
+ left: (p.left - D.left + g.left) / R.x,
687
+ right: (D.right - p.right + g.right) / R.x
688
688
  };
689
689
  }
690
- const bn = (e) => ({
690
+ const Xn = (t) => ({
691
691
  name: "arrow",
692
- options: e,
693
- async fn(t) {
692
+ options: t,
693
+ async fn(e) {
694
694
  const {
695
695
  x: n,
696
696
  y: o,
697
- placement: i,
698
- rects: c,
699
- platform: r,
697
+ placement: r,
698
+ rects: l,
699
+ platform: i,
700
700
  elements: a,
701
701
  middlewareData: d
702
- } = t, {
702
+ } = e, {
703
703
  element: s,
704
704
  padding: f = 0
705
- } = ce(e, t) || {};
705
+ } = De(t, e) || {};
706
706
  if (s == null)
707
707
  return {};
708
- const u = kt(f), m = {
708
+ const u = en(f), h = {
709
709
  x: n,
710
710
  y: o
711
- }, h = Je(i), p = Ge(h), g = await r.getDimensions(s), v = h === "y", x = v ? "top" : "left", b = v ? "bottom" : "right", E = v ? "clientHeight" : "clientWidth", P = c.reference[p] + c.reference[h] - m[h] - c.floating[p], S = m[h] - c.reference[h], y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(s));
712
- let O = y ? y[E] : 0;
713
- (!O || !await (r.isElement == null ? void 0 : r.isElement(y))) && (O = a.floating[E] || c.floating[p]);
714
- const M = P / 2 - S / 2, R = O / 2 - g[p] / 2 - 1, A = le(u[x], R), k = le(u[b], R), F = A, $ = O - g[p] - k, H = O / 2 - g[p] / 2 + M, C = ze(F, H, $), l = !d.arrow && G(i) != null && H !== C && c.reference[p] / 2 - (H < F ? A : k) - g[p] / 2 < 0, I = l ? H < F ? H - F : H - $ : 0;
711
+ }, v = yt(r), g = bt(v), w = await i.getDimensions(s), m = v === "y", p = m ? "top" : "left", y = m ? "bottom" : "right", L = m ? "clientHeight" : "clientWidth", R = l.reference[g] + l.reference[v] - h[v] - l.floating[g], D = h[v] - l.reference[v], E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s));
712
+ let P = E ? E[L] : 0;
713
+ (!P || !await (i.isElement == null ? void 0 : i.isElement(E))) && (P = a.floating[L] || l.floating[g]);
714
+ const z = R / 2 - D / 2, k = P / 2 - w[g] / 2 - 1, N = Oe(u[p], k), W = Oe(u[y], k), Y = N, X = P - w[g] - W, $ = P / 2 - w[g] / 2 + z, C = vt(Y, $, X), c = !d.arrow && pe(r) != null && $ !== C && l.reference[g] / 2 - ($ < Y ? N : W) - w[g] / 2 < 0, V = c ? $ < Y ? $ - Y : $ - X : 0;
715
715
  return {
716
- [h]: m[h] + I,
716
+ [v]: h[v] + V,
717
717
  data: {
718
- [h]: C,
719
- centerOffset: H - C - I,
720
- ...l && {
721
- alignmentOffset: I
718
+ [v]: C,
719
+ centerOffset: $ - C - V,
720
+ ...c && {
721
+ alignmentOffset: V
722
722
  }
723
723
  },
724
- reset: l
724
+ reset: c
725
725
  };
726
726
  }
727
727
  });
728
- function xn(e, t, n) {
729
- return (e ? [...n.filter((i) => G(i) === e), ...n.filter((i) => G(i) !== e)] : n.filter((i) => ee(i) === i)).filter((i) => e ? G(i) === e || (t ? Ne(i) !== i : !1) : !0);
728
+ function Yn(t, e, n) {
729
+ return (t ? [...n.filter((r) => pe(r) === t), ...n.filter((r) => pe(r) !== t)] : n.filter((r) => ye(r) === r)).filter((r) => t ? pe(r) === t || (e ? et(r) !== r : !1) : !0);
730
730
  }
731
- const En = function(e) {
732
- return e === void 0 && (e = {}), {
731
+ const Un = function(t) {
732
+ return t === void 0 && (t = {}), {
733
733
  name: "autoPlacement",
734
- options: e,
735
- async fn(t) {
736
- var n, o, i;
734
+ options: t,
735
+ async fn(e) {
736
+ var n, o, r;
737
737
  const {
738
- rects: c,
739
- middlewareData: r,
738
+ rects: l,
739
+ middlewareData: i,
740
740
  placement: a,
741
741
  platform: d,
742
742
  elements: s
743
- } = t, {
743
+ } = e, {
744
744
  crossAxis: f = !1,
745
745
  alignment: u,
746
- allowedPlacements: m = ht,
747
- autoAlignment: h = !0,
748
- ...p
749
- } = ce(e, t), g = u !== void 0 || m === ht ? xn(u || null, h, m) : m, v = await Ee(t, p), x = ((n = r.autoPlacement) == null ? void 0 : n.index) || 0, b = g[x];
750
- if (b == null)
746
+ allowedPlacements: h = Pt,
747
+ autoAlignment: v = !0,
748
+ ...g
749
+ } = De(t, e), w = u !== void 0 || h === Pt ? Yn(u || null, v, h) : h, m = await Ve(e, g), p = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, y = w[p];
750
+ if (y == null)
751
751
  return {};
752
- const E = Nt(b, c, await (d.isRTL == null ? void 0 : d.isRTL(s.floating)));
753
- if (a !== b)
752
+ const L = Qt(y, l, await (d.isRTL == null ? void 0 : d.isRTL(s.floating)));
753
+ if (a !== y)
754
754
  return {
755
755
  reset: {
756
- placement: g[0]
756
+ placement: w[0]
757
757
  }
758
758
  };
759
- const P = [v[ee(b)], v[E[0]], v[E[1]]], S = [...((o = r.autoPlacement) == null ? void 0 : o.overflows) || [], {
760
- placement: b,
761
- overflows: P
762
- }], y = g[x + 1];
763
- if (y)
759
+ const R = [m[ye(y)], m[L[0]], m[L[1]]], D = [...((o = i.autoPlacement) == null ? void 0 : o.overflows) || [], {
760
+ placement: y,
761
+ overflows: R
762
+ }], E = w[p + 1];
763
+ if (E)
764
764
  return {
765
765
  data: {
766
- index: x + 1,
767
- overflows: S
766
+ index: p + 1,
767
+ overflows: D
768
768
  },
769
769
  reset: {
770
- placement: y
770
+ placement: E
771
771
  }
772
772
  };
773
- const O = S.map((A) => {
774
- const k = G(A.placement);
775
- return [A.placement, k && f ? (
773
+ const P = D.map((N) => {
774
+ const W = pe(N.placement);
775
+ return [N.placement, W && f ? (
776
776
  // Check along the mainAxis and main crossAxis side.
777
- A.overflows.slice(0, 2).reduce((F, $) => F + $, 0)
777
+ N.overflows.slice(0, 2).reduce((Y, X) => Y + X, 0)
778
778
  ) : (
779
779
  // Check only the mainAxis.
780
- A.overflows[0]
781
- ), A.overflows];
782
- }).sort((A, k) => A[1] - k[1]), R = ((i = O.filter((A) => A[2].slice(
780
+ N.overflows[0]
781
+ ), N.overflows];
782
+ }).sort((N, W) => N[1] - W[1]), k = ((r = P.filter((N) => N[2].slice(
783
783
  0,
784
784
  // Aligned placements should not check their opposite crossAxis
785
785
  // side.
786
- G(A[0]) ? 2 : 3
787
- ).every((k) => k <= 0))[0]) == null ? void 0 : i[0]) || O[0][0];
788
- return R !== a ? {
786
+ pe(N[0]) ? 2 : 3
787
+ ).every((W) => W <= 0))[0]) == null ? void 0 : r[0]) || P[0][0];
788
+ return k !== a ? {
789
789
  data: {
790
- index: x + 1,
791
- overflows: S
790
+ index: p + 1,
791
+ overflows: D
792
792
  },
793
793
  reset: {
794
- placement: R
794
+ placement: k
795
795
  }
796
796
  } : {};
797
797
  }
798
798
  };
799
- }, Cn = function(e) {
800
- return e === void 0 && (e = {}), {
799
+ }, _n = function(t) {
800
+ return t === void 0 && (t = {}), {
801
801
  name: "flip",
802
- options: e,
803
- async fn(t) {
802
+ options: t,
803
+ async fn(e) {
804
804
  var n, o;
805
805
  const {
806
- placement: i,
807
- middlewareData: c,
808
- rects: r,
806
+ placement: r,
807
+ middlewareData: l,
808
+ rects: i,
809
809
  initialPlacement: a,
810
810
  platform: d,
811
811
  elements: s
812
- } = t, {
812
+ } = e, {
813
813
  mainAxis: f = !0,
814
814
  crossAxis: u = !0,
815
- fallbackPlacements: m,
816
- fallbackStrategy: h = "bestFit",
817
- fallbackAxisSideDirection: p = "none",
818
- flipAlignment: g = !0,
819
- ...v
820
- } = ce(e, t);
821
- if ((n = c.arrow) != null && n.alignmentOffset)
815
+ fallbackPlacements: h,
816
+ fallbackStrategy: v = "bestFit",
817
+ fallbackAxisSideDirection: g = "none",
818
+ flipAlignment: w = !0,
819
+ ...m
820
+ } = De(t, e);
821
+ if ((n = l.arrow) != null && n.alignmentOffset)
822
822
  return {};
823
- const x = ee(i), b = ie(a), E = ee(a) === a, P = await (d.isRTL == null ? void 0 : d.isRTL(s.floating)), S = m || (E || !g ? [ke(a)] : hn(a)), y = p !== "none";
824
- !m && y && S.push(...gn(a, g, p, P));
825
- const O = [a, ...S], M = await Ee(t, v), R = [];
826
- let A = ((o = c.flip) == null ? void 0 : o.overflows) || [];
827
- if (f && R.push(M[x]), u) {
828
- const H = Nt(i, r, P);
829
- R.push(M[H[0]], M[H[1]]);
823
+ const p = ye(r), y = Ce(a), L = ye(a) === a, R = await (d.isRTL == null ? void 0 : d.isRTL(s.floating)), D = h || (L || !w ? [tt(a)] : Hn(a)), E = g !== "none";
824
+ !h && E && D.push(...$n(a, w, g, R));
825
+ const P = [a, ...D], z = await Ve(e, m), k = [];
826
+ let N = ((o = l.flip) == null ? void 0 : o.overflows) || [];
827
+ if (f && k.push(z[p]), u) {
828
+ const $ = Qt(r, i, R);
829
+ k.push(z[$[0]], z[$[1]]);
830
830
  }
831
- if (A = [...A, {
832
- placement: i,
833
- overflows: R
834
- }], !R.every((H) => H <= 0)) {
835
- var k, F;
836
- const H = (((k = c.flip) == null ? void 0 : k.index) || 0) + 1, C = O[H];
837
- if (C && (!(u === "alignment" ? b !== ie(C) : !1) || // We leave the current main axis only if every placement on that axis
831
+ if (N = [...N, {
832
+ placement: r,
833
+ overflows: k
834
+ }], !k.every(($) => $ <= 0)) {
835
+ var W, Y;
836
+ const $ = (((W = l.flip) == null ? void 0 : W.index) || 0) + 1, C = P[$];
837
+ if (C && (!(u === "alignment" ? y !== Ce(C) : !1) || // We leave the current main axis only if every placement on that axis
838
838
  // overflows the main axis.
839
- A.every((w) => ie(w.placement) === b ? w.overflows[0] > 0 : !0)))
839
+ N.every((b) => Ce(b.placement) === y ? b.overflows[0] > 0 : !0)))
840
840
  return {
841
841
  data: {
842
- index: H,
843
- overflows: A
842
+ index: $,
843
+ overflows: N
844
844
  },
845
845
  reset: {
846
846
  placement: C
847
847
  }
848
848
  };
849
- let l = (F = A.filter((I) => I.overflows[0] <= 0).sort((I, w) => I.overflows[1] - w.overflows[1])[0]) == null ? void 0 : F.placement;
850
- if (!l)
851
- switch (h) {
849
+ let c = (Y = N.filter((V) => V.overflows[0] <= 0).sort((V, b) => V.overflows[1] - b.overflows[1])[0]) == null ? void 0 : Y.placement;
850
+ if (!c)
851
+ switch (v) {
852
852
  case "bestFit": {
853
- var $;
854
- const I = ($ = A.filter((w) => {
855
- if (y) {
856
- const B = ie(w.placement);
857
- return B === b || // Create a bias to the `y` side axis due to horizontal
853
+ var X;
854
+ const V = (X = N.filter((b) => {
855
+ if (E) {
856
+ const U = Ce(b.placement);
857
+ return U === y || // Create a bias to the `y` side axis due to horizontal
858
858
  // reading directions favoring greater width.
859
- B === "y";
859
+ U === "y";
860
860
  }
861
861
  return !0;
862
- }).map((w) => [w.placement, w.overflows.filter((B) => B > 0).reduce((B, oe) => B + oe, 0)]).sort((w, B) => w[1] - B[1])[0]) == null ? void 0 : $[0];
863
- I && (l = I);
862
+ }).map((b) => [b.placement, b.overflows.filter((U) => U > 0).reduce((U, te) => U + te, 0)]).sort((b, U) => b[1] - U[1])[0]) == null ? void 0 : X[0];
863
+ V && (c = V);
864
864
  break;
865
865
  }
866
866
  case "initialPlacement":
867
- l = a;
867
+ c = a;
868
868
  break;
869
869
  }
870
- if (i !== l)
870
+ if (r !== c)
871
871
  return {
872
872
  reset: {
873
- placement: l
873
+ placement: c
874
874
  }
875
875
  };
876
876
  }
@@ -878,50 +878,50 @@ const En = function(e) {
878
878
  }
879
879
  };
880
880
  };
881
- function gt(e, t) {
881
+ function It(t, e) {
882
882
  return {
883
- top: e.top - t.height,
884
- right: e.right - t.width,
885
- bottom: e.bottom - t.height,
886
- left: e.left - t.width
883
+ top: t.top - e.height,
884
+ right: t.right - e.width,
885
+ bottom: t.bottom - e.height,
886
+ left: t.left - e.width
887
887
  };
888
888
  }
889
- function wt(e) {
890
- return Rt.some((t) => e[t] >= 0);
889
+ function Ft(t) {
890
+ return Zt.some((e) => t[e] >= 0);
891
891
  }
892
- const Tn = function(e) {
893
- return e === void 0 && (e = {}), {
892
+ const jn = function(t) {
893
+ return t === void 0 && (t = {}), {
894
894
  name: "hide",
895
- options: e,
896
- async fn(t) {
895
+ options: t,
896
+ async fn(e) {
897
897
  const {
898
898
  rects: n
899
- } = t, {
899
+ } = e, {
900
900
  strategy: o = "referenceHidden",
901
- ...i
902
- } = ce(e, t);
901
+ ...r
902
+ } = De(t, e);
903
903
  switch (o) {
904
904
  case "referenceHidden": {
905
- const c = await Ee(t, {
906
- ...i,
905
+ const l = await Ve(e, {
906
+ ...r,
907
907
  elementContext: "reference"
908
- }), r = gt(c, n.reference);
908
+ }), i = It(l, n.reference);
909
909
  return {
910
910
  data: {
911
- referenceHiddenOffsets: r,
912
- referenceHidden: wt(r)
911
+ referenceHiddenOffsets: i,
912
+ referenceHidden: Ft(i)
913
913
  }
914
914
  };
915
915
  }
916
916
  case "escaped": {
917
- const c = await Ee(t, {
918
- ...i,
917
+ const l = await Ve(e, {
918
+ ...r,
919
919
  altBoundary: !0
920
- }), r = gt(c, n.floating);
920
+ }), i = It(l, n.floating);
921
921
  return {
922
922
  data: {
923
- escapedOffsets: r,
924
- escaped: wt(r)
923
+ escapedOffsets: i,
924
+ escaped: Ft(i)
925
925
  }
926
926
  };
927
927
  }
@@ -930,17 +930,17 @@ const Tn = function(e) {
930
930
  }
931
931
  }
932
932
  };
933
- }, On = /* @__PURE__ */ new Set(["left", "top"]);
934
- async function Pn(e, t) {
933
+ }, qn = /* @__PURE__ */ new Set(["left", "top"]);
934
+ async function Gn(t, e) {
935
935
  const {
936
936
  placement: n,
937
937
  platform: o,
938
- elements: i
939
- } = e, c = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = ee(n), a = G(n), d = ie(n) === "y", s = On.has(r) ? -1 : 1, f = c && d ? -1 : 1, u = ce(t, e);
938
+ elements: r
939
+ } = t, l = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), i = ye(n), a = pe(n), d = Ce(n) === "y", s = qn.has(i) ? -1 : 1, f = l && d ? -1 : 1, u = De(e, t);
940
940
  let {
941
- mainAxis: m,
942
- crossAxis: h,
943
- alignmentAxis: p
941
+ mainAxis: h,
942
+ crossAxis: v,
943
+ alignmentAxis: g
944
944
  } = typeof u == "number" ? {
945
945
  mainAxis: u,
946
946
  crossAxis: 0,
@@ -950,126 +950,126 @@ async function Pn(e, t) {
950
950
  crossAxis: u.crossAxis || 0,
951
951
  alignmentAxis: u.alignmentAxis
952
952
  };
953
- return a && typeof p == "number" && (h = a === "end" ? p * -1 : p), d ? {
954
- x: h * f,
955
- y: m * s
953
+ return a && typeof g == "number" && (v = a === "end" ? g * -1 : g), d ? {
954
+ x: v * f,
955
+ y: h * s
956
956
  } : {
957
- x: m * s,
958
- y: h * f
957
+ x: h * s,
958
+ y: v * f
959
959
  };
960
960
  }
961
- const Sn = function(e) {
962
- return e === void 0 && (e = 0), {
961
+ const Zn = function(t) {
962
+ return t === void 0 && (t = 0), {
963
963
  name: "offset",
964
- options: e,
965
- async fn(t) {
964
+ options: t,
965
+ async fn(e) {
966
966
  var n, o;
967
967
  const {
968
- x: i,
969
- y: c,
970
- placement: r,
968
+ x: r,
969
+ y: l,
970
+ placement: i,
971
971
  middlewareData: a
972
- } = t, d = await Pn(t, e);
973
- return r === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
974
- x: i + d.x,
975
- y: c + d.y,
972
+ } = e, d = await Gn(e, t);
973
+ return i === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
974
+ x: r + d.x,
975
+ y: l + d.y,
976
976
  data: {
977
977
  ...d,
978
- placement: r
978
+ placement: i
979
979
  }
980
980
  };
981
981
  }
982
982
  };
983
- }, Ln = function(e) {
984
- return e === void 0 && (e = {}), {
983
+ }, Jn = function(t) {
984
+ return t === void 0 && (t = {}), {
985
985
  name: "shift",
986
- options: e,
987
- async fn(t) {
986
+ options: t,
987
+ async fn(e) {
988
988
  const {
989
989
  x: n,
990
990
  y: o,
991
- placement: i
992
- } = t, {
993
- mainAxis: c = !0,
994
- crossAxis: r = !1,
991
+ placement: r
992
+ } = e, {
993
+ mainAxis: l = !0,
994
+ crossAxis: i = !1,
995
995
  limiter: a = {
996
- fn: (v) => {
996
+ fn: (m) => {
997
997
  let {
998
- x,
999
- y: b
1000
- } = v;
998
+ x: p,
999
+ y
1000
+ } = m;
1001
1001
  return {
1002
- x,
1003
- y: b
1002
+ x: p,
1003
+ y
1004
1004
  };
1005
1005
  }
1006
1006
  },
1007
1007
  ...d
1008
- } = ce(e, t), s = {
1008
+ } = De(t, e), s = {
1009
1009
  x: n,
1010
1010
  y: o
1011
- }, f = await Ee(t, d), u = ie(ee(i)), m = Mt(u);
1012
- let h = s[m], p = s[u];
1013
- if (c) {
1014
- const v = m === "y" ? "top" : "left", x = m === "y" ? "bottom" : "right", b = h + f[v], E = h - f[x];
1015
- h = ze(b, h, E);
1011
+ }, f = await Ve(e, d), u = Ce(ye(r)), h = Jt(u);
1012
+ let v = s[h], g = s[u];
1013
+ if (l) {
1014
+ const m = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", y = v + f[m], L = v - f[p];
1015
+ v = vt(y, v, L);
1016
1016
  }
1017
- if (r) {
1018
- const v = u === "y" ? "top" : "left", x = u === "y" ? "bottom" : "right", b = p + f[v], E = p - f[x];
1019
- p = ze(b, p, E);
1017
+ if (i) {
1018
+ const m = u === "y" ? "top" : "left", p = u === "y" ? "bottom" : "right", y = g + f[m], L = g - f[p];
1019
+ g = vt(y, g, L);
1020
1020
  }
1021
- const g = a.fn({
1022
- ...t,
1023
- [m]: h,
1024
- [u]: p
1021
+ const w = a.fn({
1022
+ ...e,
1023
+ [h]: v,
1024
+ [u]: g
1025
1025
  });
1026
1026
  return {
1027
- ...g,
1027
+ ...w,
1028
1028
  data: {
1029
- x: g.x - n,
1030
- y: g.y - o,
1029
+ x: w.x - n,
1030
+ y: w.y - o,
1031
1031
  enabled: {
1032
- [m]: c,
1033
- [u]: r
1032
+ [h]: l,
1033
+ [u]: i
1034
1034
  }
1035
1035
  }
1036
1036
  };
1037
1037
  }
1038
1038
  };
1039
- }, An = function(e) {
1040
- return e === void 0 && (e = {}), {
1039
+ }, Qn = function(t) {
1040
+ return t === void 0 && (t = {}), {
1041
1041
  name: "size",
1042
- options: e,
1043
- async fn(t) {
1042
+ options: t,
1043
+ async fn(e) {
1044
1044
  var n, o;
1045
1045
  const {
1046
- placement: i,
1047
- rects: c,
1048
- platform: r,
1046
+ placement: r,
1047
+ rects: l,
1048
+ platform: i,
1049
1049
  elements: a
1050
- } = t, {
1050
+ } = e, {
1051
1051
  apply: d = () => {
1052
1052
  },
1053
1053
  ...s
1054
- } = ce(e, t), f = await Ee(t, s), u = ee(i), m = G(i), h = ie(i) === "y", {
1055
- width: p,
1056
- height: g
1057
- } = c.floating;
1058
- let v, x;
1059
- u === "top" || u === "bottom" ? (v = u, x = m === (await (r.isRTL == null ? void 0 : r.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = u, v = m === "end" ? "top" : "bottom");
1060
- const b = g - f.top - f.bottom, E = p - f.left - f.right, P = le(g - f[v], b), S = le(p - f[x], E), y = !t.middlewareData.shift;
1061
- let O = P, M = S;
1062
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = E), (o = t.middlewareData.shift) != null && o.enabled.y && (O = b), y && !m) {
1063
- const A = Y(f.left, 0), k = Y(f.right, 0), F = Y(f.top, 0), $ = Y(f.bottom, 0);
1064
- h ? M = p - 2 * (A !== 0 || k !== 0 ? A + k : Y(f.left, f.right)) : O = g - 2 * (F !== 0 || $ !== 0 ? F + $ : Y(f.top, f.bottom));
1054
+ } = De(t, e), f = await Ve(e, s), u = ye(r), h = pe(r), v = Ce(r) === "y", {
1055
+ width: g,
1056
+ height: w
1057
+ } = l.floating;
1058
+ let m, p;
1059
+ u === "top" || u === "bottom" ? (m = u, p = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (p = u, m = h === "end" ? "top" : "bottom");
1060
+ const y = w - f.top - f.bottom, L = g - f.left - f.right, R = Oe(w - f[m], y), D = Oe(g - f[p], L), E = !e.middlewareData.shift;
1061
+ let P = R, z = D;
1062
+ if ((n = e.middlewareData.shift) != null && n.enabled.x && (z = L), (o = e.middlewareData.shift) != null && o.enabled.y && (P = y), E && !h) {
1063
+ const N = ae(f.left, 0), W = ae(f.right, 0), Y = ae(f.top, 0), X = ae(f.bottom, 0);
1064
+ v ? z = g - 2 * (N !== 0 || W !== 0 ? N + W : ae(f.left, f.right)) : P = w - 2 * (Y !== 0 || X !== 0 ? Y + X : ae(f.top, f.bottom));
1065
1065
  }
1066
1066
  await d({
1067
- ...t,
1068
- availableWidth: M,
1069
- availableHeight: O
1067
+ ...e,
1068
+ availableWidth: z,
1069
+ availableHeight: P
1070
1070
  });
1071
- const R = await r.getDimensions(a.floating);
1072
- return p !== R.width || g !== R.height ? {
1071
+ const k = await i.getDimensions(a.floating);
1072
+ return g !== k.width || w !== k.height ? {
1073
1073
  reset: {
1074
1074
  rects: !0
1075
1075
  }
@@ -1077,311 +1077,311 @@ const Sn = function(e) {
1077
1077
  }
1078
1078
  };
1079
1079
  };
1080
- function He() {
1080
+ function it() {
1081
1081
  return typeof window < "u";
1082
1082
  }
1083
- function Te(e) {
1084
- return Ft(e) ? (e.nodeName || "").toLowerCase() : "#document";
1083
+ function Ke(t) {
1084
+ return tn(t) ? (t.nodeName || "").toLowerCase() : "#document";
1085
1085
  }
1086
- function j(e) {
1087
- var t;
1088
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1086
+ function ce(t) {
1087
+ var e;
1088
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1089
1089
  }
1090
- function ne(e) {
1091
- var t;
1092
- return (t = (Ft(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1090
+ function Ee(t) {
1091
+ var e;
1092
+ return (e = (tn(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1093
1093
  }
1094
- function Ft(e) {
1095
- return He() ? e instanceof Node || e instanceof j(e).Node : !1;
1094
+ function tn(t) {
1095
+ return it() ? t instanceof Node || t instanceof ce(t).Node : !1;
1096
1096
  }
1097
- function J(e) {
1098
- return He() ? e instanceof Element || e instanceof j(e).Element : !1;
1097
+ function me(t) {
1098
+ return it() ? t instanceof Element || t instanceof ce(t).Element : !1;
1099
1099
  }
1100
- function te(e) {
1101
- return He() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
1100
+ function xe(t) {
1101
+ return it() ? t instanceof HTMLElement || t instanceof ce(t).HTMLElement : !1;
1102
1102
  }
1103
- function yt(e) {
1104
- return !He() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
1103
+ function kt(t) {
1104
+ return !it() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof ce(t).ShadowRoot;
1105
1105
  }
1106
- const Dn = /* @__PURE__ */ new Set(["inline", "contents"]);
1107
- function Se(e) {
1106
+ const eo = /* @__PURE__ */ new Set(["inline", "contents"]);
1107
+ function qe(t) {
1108
1108
  const {
1109
- overflow: t,
1109
+ overflow: e,
1110
1110
  overflowX: n,
1111
1111
  overflowY: o,
1112
- display: i
1113
- } = Q(e);
1114
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !Dn.has(i);
1112
+ display: r
1113
+ } = ge(t);
1114
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !eo.has(r);
1115
1115
  }
1116
- const Rn = /* @__PURE__ */ new Set(["table", "td", "th"]);
1117
- function Mn(e) {
1118
- return Rn.has(Te(e));
1116
+ const to = /* @__PURE__ */ new Set(["table", "td", "th"]);
1117
+ function no(t) {
1118
+ return to.has(Ke(t));
1119
1119
  }
1120
- const Nn = [":popover-open", ":modal"];
1121
- function Ie(e) {
1122
- return Nn.some((t) => {
1120
+ const oo = [":popover-open", ":modal"];
1121
+ function st(t) {
1122
+ return oo.some((e) => {
1123
1123
  try {
1124
- return e.matches(t);
1124
+ return t.matches(e);
1125
1125
  } catch {
1126
1126
  return !1;
1127
1127
  }
1128
1128
  });
1129
1129
  }
1130
- const kn = ["transform", "translate", "scale", "rotate", "perspective"], Fn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Hn = ["paint", "layout", "strict", "content"];
1131
- function Qe(e) {
1132
- const t = Ze(), n = J(e) ? Q(e) : e;
1133
- return kn.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Fn.some((o) => (n.willChange || "").includes(o)) || Hn.some((o) => (n.contain || "").includes(o));
1134
- }
1135
- function In(e) {
1136
- let t = ae(e);
1137
- for (; te(t) && !Ce(t); ) {
1138
- if (Qe(t))
1139
- return t;
1140
- if (Ie(t))
1130
+ const ro = ["transform", "translate", "scale", "rotate", "perspective"], io = ["transform", "translate", "scale", "rotate", "perspective", "filter"], so = ["paint", "layout", "strict", "content"];
1131
+ function xt(t) {
1132
+ const e = Et(), n = me(t) ? ge(t) : t;
1133
+ return ro.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || io.some((o) => (n.willChange || "").includes(o)) || so.some((o) => (n.contain || "").includes(o));
1134
+ }
1135
+ function lo(t) {
1136
+ let e = Le(t);
1137
+ for (; xe(e) && !$e(e); ) {
1138
+ if (xt(e))
1139
+ return e;
1140
+ if (st(e))
1141
1141
  return null;
1142
- t = ae(t);
1142
+ e = Le(e);
1143
1143
  }
1144
1144
  return null;
1145
1145
  }
1146
- function Ze() {
1146
+ function Et() {
1147
1147
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1148
1148
  }
1149
- const Bn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1150
- function Ce(e) {
1151
- return Bn.has(Te(e));
1149
+ const ao = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1150
+ function $e(t) {
1151
+ return ao.has(Ke(t));
1152
1152
  }
1153
- function Q(e) {
1154
- return j(e).getComputedStyle(e);
1153
+ function ge(t) {
1154
+ return ce(t).getComputedStyle(t);
1155
1155
  }
1156
- function Be(e) {
1157
- return J(e) ? {
1158
- scrollLeft: e.scrollLeft,
1159
- scrollTop: e.scrollTop
1156
+ function lt(t) {
1157
+ return me(t) ? {
1158
+ scrollLeft: t.scrollLeft,
1159
+ scrollTop: t.scrollTop
1160
1160
  } : {
1161
- scrollLeft: e.scrollX,
1162
- scrollTop: e.scrollY
1161
+ scrollLeft: t.scrollX,
1162
+ scrollTop: t.scrollY
1163
1163
  };
1164
1164
  }
1165
- function ae(e) {
1166
- if (Te(e) === "html")
1167
- return e;
1168
- const t = (
1165
+ function Le(t) {
1166
+ if (Ke(t) === "html")
1167
+ return t;
1168
+ const e = (
1169
1169
  // Step into the shadow DOM of the parent of a slotted node.
1170
- e.assignedSlot || // DOM Element detected.
1171
- e.parentNode || // ShadowRoot detected.
1172
- yt(e) && e.host || // Fallback.
1173
- ne(e)
1170
+ t.assignedSlot || // DOM Element detected.
1171
+ t.parentNode || // ShadowRoot detected.
1172
+ kt(t) && t.host || // Fallback.
1173
+ Ee(t)
1174
1174
  );
1175
- return yt(t) ? t.host : t;
1175
+ return kt(e) ? e.host : e;
1176
1176
  }
1177
- function Ht(e) {
1178
- const t = ae(e);
1179
- return Ce(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : te(t) && Se(t) ? t : Ht(t);
1177
+ function nn(t) {
1178
+ const e = Le(t);
1179
+ return $e(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : xe(e) && qe(e) ? e : nn(e);
1180
1180
  }
1181
- function Pe(e, t, n) {
1181
+ function Ye(t, e, n) {
1182
1182
  var o;
1183
- t === void 0 && (t = []), n === void 0 && (n = !0);
1184
- const i = Ht(e), c = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = j(i);
1185
- if (c) {
1186
- const a = Ue(r);
1187
- return t.concat(r, r.visualViewport || [], Se(i) ? i : [], a && n ? Pe(a) : []);
1188
- }
1189
- return t.concat(i, Pe(i, [], n));
1190
- }
1191
- function Ue(e) {
1192
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1193
- }
1194
- function It(e) {
1195
- const t = Q(e);
1196
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1197
- const i = te(e), c = i ? e.offsetWidth : n, r = i ? e.offsetHeight : o, a = Me(n) !== c || Me(o) !== r;
1198
- return a && (n = c, o = r), {
1183
+ e === void 0 && (e = []), n === void 0 && (n = !0);
1184
+ const r = nn(t), l = r === ((o = t.ownerDocument) == null ? void 0 : o.body), i = ce(r);
1185
+ if (l) {
1186
+ const a = pt(i);
1187
+ return e.concat(i, i.visualViewport || [], qe(r) ? r : [], a && n ? Ye(a) : []);
1188
+ }
1189
+ return e.concat(r, Ye(r, [], n));
1190
+ }
1191
+ function pt(t) {
1192
+ return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1193
+ }
1194
+ function on(t) {
1195
+ const e = ge(t);
1196
+ let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
1197
+ const r = xe(t), l = r ? t.offsetWidth : n, i = r ? t.offsetHeight : o, a = Qe(n) !== l || Qe(o) !== i;
1198
+ return a && (n = l, o = i), {
1199
1199
  width: n,
1200
1200
  height: o,
1201
1201
  $: a
1202
1202
  };
1203
1203
  }
1204
- function et(e) {
1205
- return J(e) ? e : e.contextElement;
1204
+ function Ct(t) {
1205
+ return me(t) ? t : t.contextElement;
1206
1206
  }
1207
- function be(e) {
1208
- const t = et(e);
1209
- if (!te(t))
1210
- return Z(1);
1211
- const n = t.getBoundingClientRect(), {
1207
+ function We(t) {
1208
+ const e = Ct(t);
1209
+ if (!xe(e))
1210
+ return be(1);
1211
+ const n = e.getBoundingClientRect(), {
1212
1212
  width: o,
1213
- height: i,
1214
- $: c
1215
- } = It(t);
1216
- let r = (c ? Me(n.width) : n.width) / o, a = (c ? Me(n.height) : n.height) / i;
1217
- return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1218
- x: r,
1213
+ height: r,
1214
+ $: l
1215
+ } = on(e);
1216
+ let i = (l ? Qe(n.width) : n.width) / o, a = (l ? Qe(n.height) : n.height) / r;
1217
+ return (!i || !Number.isFinite(i)) && (i = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1218
+ x: i,
1219
1219
  y: a
1220
1220
  };
1221
1221
  }
1222
- const Wn = /* @__PURE__ */ Z(0);
1223
- function Bt(e) {
1224
- const t = j(e);
1225
- return !Ze() || !t.visualViewport ? Wn : {
1226
- x: t.visualViewport.offsetLeft,
1227
- y: t.visualViewport.offsetTop
1222
+ const uo = /* @__PURE__ */ be(0);
1223
+ function rn(t) {
1224
+ const e = ce(t);
1225
+ return !Et() || !e.visualViewport ? uo : {
1226
+ x: e.visualViewport.offsetLeft,
1227
+ y: e.visualViewport.offsetTop
1228
1228
  };
1229
1229
  }
1230
- function $n(e, t, n) {
1231
- return t === void 0 && (t = !1), !n || t && n !== j(e) ? !1 : t;
1232
- }
1233
- function ve(e, t, n, o) {
1234
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1235
- const i = e.getBoundingClientRect(), c = et(e);
1236
- let r = Z(1);
1237
- t && (o ? J(o) && (r = be(o)) : r = be(e));
1238
- const a = $n(c, n, o) ? Bt(c) : Z(0);
1239
- let d = (i.left + a.x) / r.x, s = (i.top + a.y) / r.y, f = i.width / r.x, u = i.height / r.y;
1240
- if (c) {
1241
- const m = j(c), h = o && J(o) ? j(o) : o;
1242
- let p = m, g = Ue(p);
1243
- for (; g && o && h !== p; ) {
1244
- const v = be(g), x = g.getBoundingClientRect(), b = Q(g), E = x.left + (g.clientLeft + parseFloat(b.paddingLeft)) * v.x, P = x.top + (g.clientTop + parseFloat(b.paddingTop)) * v.y;
1245
- d *= v.x, s *= v.y, f *= v.x, u *= v.y, d += E, s += P, p = j(g), g = Ue(p);
1230
+ function co(t, e, n) {
1231
+ return e === void 0 && (e = !1), !n || e && n !== ce(t) ? !1 : e;
1232
+ }
1233
+ function Fe(t, e, n, o) {
1234
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
1235
+ const r = t.getBoundingClientRect(), l = Ct(t);
1236
+ let i = be(1);
1237
+ e && (o ? me(o) && (i = We(o)) : i = We(t));
1238
+ const a = co(l, n, o) ? rn(l) : be(0);
1239
+ let d = (r.left + a.x) / i.x, s = (r.top + a.y) / i.y, f = r.width / i.x, u = r.height / i.y;
1240
+ if (l) {
1241
+ const h = ce(l), v = o && me(o) ? ce(o) : o;
1242
+ let g = h, w = pt(g);
1243
+ for (; w && o && v !== g; ) {
1244
+ const m = We(w), p = w.getBoundingClientRect(), y = ge(w), L = p.left + (w.clientLeft + parseFloat(y.paddingLeft)) * m.x, R = p.top + (w.clientTop + parseFloat(y.paddingTop)) * m.y;
1245
+ d *= m.x, s *= m.y, f *= m.x, u *= m.y, d += L, s += R, g = ce(w), w = pt(g);
1246
1246
  }
1247
1247
  }
1248
- return Fe({
1248
+ return nt({
1249
1249
  width: f,
1250
1250
  height: u,
1251
1251
  x: d,
1252
1252
  y: s
1253
1253
  });
1254
1254
  }
1255
- function We(e, t) {
1256
- const n = Be(e).scrollLeft;
1257
- return t ? t.left + n : ve(ne(e)).left + n;
1255
+ function at(t, e) {
1256
+ const n = lt(t).scrollLeft;
1257
+ return e ? e.left + n : Fe(Ee(t)).left + n;
1258
1258
  }
1259
- function Wt(e, t) {
1260
- const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - We(e, n), i = n.top + t.scrollTop;
1259
+ function sn(t, e) {
1260
+ const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - at(t, n), r = n.top + e.scrollTop;
1261
1261
  return {
1262
1262
  x: o,
1263
- y: i
1263
+ y: r
1264
1264
  };
1265
1265
  }
1266
- function Vn(e) {
1266
+ function fo(t) {
1267
1267
  let {
1268
- elements: t,
1268
+ elements: e,
1269
1269
  rect: n,
1270
1270
  offsetParent: o,
1271
- strategy: i
1272
- } = e;
1273
- const c = i === "fixed", r = ne(o), a = t ? Ie(t.floating) : !1;
1274
- if (o === r || a && c)
1271
+ strategy: r
1272
+ } = t;
1273
+ const l = r === "fixed", i = Ee(o), a = e ? st(e.floating) : !1;
1274
+ if (o === i || a && l)
1275
1275
  return n;
1276
1276
  let d = {
1277
1277
  scrollLeft: 0,
1278
1278
  scrollTop: 0
1279
- }, s = Z(1);
1280
- const f = Z(0), u = te(o);
1281
- if ((u || !u && !c) && ((Te(o) !== "body" || Se(r)) && (d = Be(o)), te(o))) {
1282
- const h = ve(o);
1283
- s = be(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
1279
+ }, s = be(1);
1280
+ const f = be(0), u = xe(o);
1281
+ if ((u || !u && !l) && ((Ke(o) !== "body" || qe(i)) && (d = lt(o)), xe(o))) {
1282
+ const v = Fe(o);
1283
+ s = We(o), f.x = v.x + o.clientLeft, f.y = v.y + o.clientTop;
1284
1284
  }
1285
- const m = r && !u && !c ? Wt(r, d) : Z(0);
1285
+ const h = i && !u && !l ? sn(i, d) : be(0);
1286
1286
  return {
1287
1287
  width: n.width * s.x,
1288
1288
  height: n.height * s.y,
1289
- x: n.x * s.x - d.scrollLeft * s.x + f.x + m.x,
1290
- y: n.y * s.y - d.scrollTop * s.y + f.y + m.y
1289
+ x: n.x * s.x - d.scrollLeft * s.x + f.x + h.x,
1290
+ y: n.y * s.y - d.scrollTop * s.y + f.y + h.y
1291
1291
  };
1292
1292
  }
1293
- function _n(e) {
1294
- return Array.from(e.getClientRects());
1293
+ function ho(t) {
1294
+ return Array.from(t.getClientRects());
1295
1295
  }
1296
- function Xn(e) {
1297
- const t = ne(e), n = Be(e), o = e.ownerDocument.body, i = Y(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), c = Y(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1298
- let r = -n.scrollLeft + We(e);
1296
+ function vo(t) {
1297
+ const e = Ee(t), n = lt(t), o = t.ownerDocument.body, r = ae(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), l = ae(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
1298
+ let i = -n.scrollLeft + at(t);
1299
1299
  const a = -n.scrollTop;
1300
- return Q(o).direction === "rtl" && (r += Y(t.clientWidth, o.clientWidth) - i), {
1301
- width: i,
1302
- height: c,
1303
- x: r,
1300
+ return ge(o).direction === "rtl" && (i += ae(e.clientWidth, o.clientWidth) - r), {
1301
+ width: r,
1302
+ height: l,
1303
+ x: i,
1304
1304
  y: a
1305
1305
  };
1306
1306
  }
1307
- const bt = 25;
1308
- function Yn(e, t) {
1309
- const n = j(e), o = ne(e), i = n.visualViewport;
1310
- let c = o.clientWidth, r = o.clientHeight, a = 0, d = 0;
1311
- if (i) {
1312
- c = i.width, r = i.height;
1313
- const f = Ze();
1314
- (!f || f && t === "fixed") && (a = i.offsetLeft, d = i.offsetTop);
1307
+ const Ht = 25;
1308
+ function po(t, e) {
1309
+ const n = ce(t), o = Ee(t), r = n.visualViewport;
1310
+ let l = o.clientWidth, i = o.clientHeight, a = 0, d = 0;
1311
+ if (r) {
1312
+ l = r.width, i = r.height;
1313
+ const f = Et();
1314
+ (!f || f && e === "fixed") && (a = r.offsetLeft, d = r.offsetTop);
1315
1315
  }
1316
- const s = We(o);
1316
+ const s = at(o);
1317
1317
  if (s <= 0) {
1318
- const f = o.ownerDocument, u = f.body, m = getComputedStyle(u), h = f.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, p = Math.abs(o.clientWidth - u.clientWidth - h);
1319
- p <= bt && (c -= p);
1320
- } else s <= bt && (c += s);
1318
+ const f = o.ownerDocument, u = f.body, h = getComputedStyle(u), v = f.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, g = Math.abs(o.clientWidth - u.clientWidth - v);
1319
+ g <= Ht && (l -= g);
1320
+ } else s <= Ht && (l += s);
1321
1321
  return {
1322
- width: c,
1323
- height: r,
1322
+ width: l,
1323
+ height: i,
1324
1324
  x: a,
1325
1325
  y: d
1326
1326
  };
1327
1327
  }
1328
- const jn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1329
- function zn(e, t) {
1330
- const n = ve(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, c = te(e) ? be(e) : Z(1), r = e.clientWidth * c.x, a = e.clientHeight * c.y, d = i * c.x, s = o * c.y;
1328
+ const mo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1329
+ function go(t, e) {
1330
+ const n = Fe(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, l = xe(t) ? We(t) : be(1), i = t.clientWidth * l.x, a = t.clientHeight * l.y, d = r * l.x, s = o * l.y;
1331
1331
  return {
1332
- width: r,
1332
+ width: i,
1333
1333
  height: a,
1334
1334
  x: d,
1335
1335
  y: s
1336
1336
  };
1337
1337
  }
1338
- function xt(e, t, n) {
1338
+ function Bt(t, e, n) {
1339
1339
  let o;
1340
- if (t === "viewport")
1341
- o = Yn(e, n);
1342
- else if (t === "document")
1343
- o = Xn(ne(e));
1344
- else if (J(t))
1345
- o = zn(t, n);
1340
+ if (e === "viewport")
1341
+ o = po(t, n);
1342
+ else if (e === "document")
1343
+ o = vo(Ee(t));
1344
+ else if (me(e))
1345
+ o = go(e, n);
1346
1346
  else {
1347
- const i = Bt(e);
1347
+ const r = rn(t);
1348
1348
  o = {
1349
- x: t.x - i.x,
1350
- y: t.y - i.y,
1351
- width: t.width,
1352
- height: t.height
1349
+ x: e.x - r.x,
1350
+ y: e.y - r.y,
1351
+ width: e.width,
1352
+ height: e.height
1353
1353
  };
1354
1354
  }
1355
- return Fe(o);
1355
+ return nt(o);
1356
1356
  }
1357
- function $t(e, t) {
1358
- const n = ae(e);
1359
- return n === t || !J(n) || Ce(n) ? !1 : Q(n).position === "fixed" || $t(n, t);
1357
+ function ln(t, e) {
1358
+ const n = Le(t);
1359
+ return n === e || !me(n) || $e(n) ? !1 : ge(n).position === "fixed" || ln(n, e);
1360
1360
  }
1361
- function Un(e, t) {
1362
- const n = t.get(e);
1361
+ function wo(t, e) {
1362
+ const n = e.get(t);
1363
1363
  if (n)
1364
1364
  return n;
1365
- let o = Pe(e, [], !1).filter((a) => J(a) && Te(a) !== "body"), i = null;
1366
- const c = Q(e).position === "fixed";
1367
- let r = c ? ae(e) : e;
1368
- for (; J(r) && !Ce(r); ) {
1369
- const a = Q(r), d = Qe(r);
1370
- !d && a.position === "fixed" && (i = null), (c ? !d && !i : !d && a.position === "static" && !!i && jn.has(i.position) || Se(r) && !d && $t(e, r)) ? o = o.filter((f) => f !== r) : i = a, r = ae(r);
1365
+ let o = Ye(t, [], !1).filter((a) => me(a) && Ke(a) !== "body"), r = null;
1366
+ const l = ge(t).position === "fixed";
1367
+ let i = l ? Le(t) : t;
1368
+ for (; me(i) && !$e(i); ) {
1369
+ const a = ge(i), d = xt(i);
1370
+ !d && a.position === "fixed" && (r = null), (l ? !d && !r : !d && a.position === "static" && !!r && mo.has(r.position) || qe(i) && !d && ln(t, i)) ? o = o.filter((f) => f !== i) : r = a, i = Le(i);
1371
1371
  }
1372
- return t.set(e, o), o;
1372
+ return e.set(t, o), o;
1373
1373
  }
1374
- function Kn(e) {
1374
+ function bo(t) {
1375
1375
  let {
1376
- element: t,
1376
+ element: e,
1377
1377
  boundary: n,
1378
1378
  rootBoundary: o,
1379
- strategy: i
1380
- } = e;
1381
- const r = [...n === "clippingAncestors" ? Ie(t) ? [] : Un(t, this._c) : [].concat(n), o], a = r[0], d = r.reduce((s, f) => {
1382
- const u = xt(t, f, i);
1383
- return s.top = Y(u.top, s.top), s.right = le(u.right, s.right), s.bottom = le(u.bottom, s.bottom), s.left = Y(u.left, s.left), s;
1384
- }, xt(t, a, i));
1379
+ strategy: r
1380
+ } = t;
1381
+ const i = [...n === "clippingAncestors" ? st(e) ? [] : wo(e, this._c) : [].concat(n), o], a = i[0], d = i.reduce((s, f) => {
1382
+ const u = Bt(e, f, r);
1383
+ return s.top = ae(u.top, s.top), s.right = Oe(u.right, s.right), s.bottom = Oe(u.bottom, s.bottom), s.left = ae(u.left, s.left), s;
1384
+ }, Bt(e, a, r));
1385
1385
  return {
1386
1386
  width: d.right - d.left,
1387
1387
  height: d.bottom - d.top,
@@ -1389,73 +1389,73 @@ function Kn(e) {
1389
1389
  y: d.top
1390
1390
  };
1391
1391
  }
1392
- function qn(e) {
1392
+ function yo(t) {
1393
1393
  const {
1394
- width: t,
1394
+ width: e,
1395
1395
  height: n
1396
- } = It(e);
1396
+ } = on(t);
1397
1397
  return {
1398
- width: t,
1398
+ width: e,
1399
1399
  height: n
1400
1400
  };
1401
1401
  }
1402
- function Gn(e, t, n) {
1403
- const o = te(t), i = ne(t), c = n === "fixed", r = ve(e, !0, c, t);
1402
+ function xo(t, e, n) {
1403
+ const o = xe(e), r = Ee(e), l = n === "fixed", i = Fe(t, !0, l, e);
1404
1404
  let a = {
1405
1405
  scrollLeft: 0,
1406
1406
  scrollTop: 0
1407
1407
  };
1408
- const d = Z(0);
1408
+ const d = be(0);
1409
1409
  function s() {
1410
- d.x = We(i);
1411
- }
1412
- if (o || !o && !c)
1413
- if ((Te(t) !== "body" || Se(i)) && (a = Be(t)), o) {
1414
- const h = ve(t, !0, c, t);
1415
- d.x = h.x + t.clientLeft, d.y = h.y + t.clientTop;
1416
- } else i && s();
1417
- c && !o && i && s();
1418
- const f = i && !o && !c ? Wt(i, a) : Z(0), u = r.left + a.scrollLeft - d.x - f.x, m = r.top + a.scrollTop - d.y - f.y;
1410
+ d.x = at(r);
1411
+ }
1412
+ if (o || !o && !l)
1413
+ if ((Ke(e) !== "body" || qe(r)) && (a = lt(e)), o) {
1414
+ const v = Fe(e, !0, l, e);
1415
+ d.x = v.x + e.clientLeft, d.y = v.y + e.clientTop;
1416
+ } else r && s();
1417
+ l && !o && r && s();
1418
+ const f = r && !o && !l ? sn(r, a) : be(0), u = i.left + a.scrollLeft - d.x - f.x, h = i.top + a.scrollTop - d.y - f.y;
1419
1419
  return {
1420
1420
  x: u,
1421
- y: m,
1422
- width: r.width,
1423
- height: r.height
1421
+ y: h,
1422
+ width: i.width,
1423
+ height: i.height
1424
1424
  };
1425
1425
  }
1426
- function Ve(e) {
1427
- return Q(e).position === "static";
1426
+ function ct(t) {
1427
+ return ge(t).position === "static";
1428
1428
  }
1429
- function Et(e, t) {
1430
- if (!te(e) || Q(e).position === "fixed")
1429
+ function Wt(t, e) {
1430
+ if (!xe(t) || ge(t).position === "fixed")
1431
1431
  return null;
1432
- if (t)
1433
- return t(e);
1434
- let n = e.offsetParent;
1435
- return ne(e) === n && (n = n.ownerDocument.body), n;
1436
- }
1437
- function Vt(e, t) {
1438
- const n = j(e);
1439
- if (Ie(e))
1432
+ if (e)
1433
+ return e(t);
1434
+ let n = t.offsetParent;
1435
+ return Ee(t) === n && (n = n.ownerDocument.body), n;
1436
+ }
1437
+ function an(t, e) {
1438
+ const n = ce(t);
1439
+ if (st(t))
1440
1440
  return n;
1441
- if (!te(e)) {
1442
- let i = ae(e);
1443
- for (; i && !Ce(i); ) {
1444
- if (J(i) && !Ve(i))
1445
- return i;
1446
- i = ae(i);
1441
+ if (!xe(t)) {
1442
+ let r = Le(t);
1443
+ for (; r && !$e(r); ) {
1444
+ if (me(r) && !ct(r))
1445
+ return r;
1446
+ r = Le(r);
1447
1447
  }
1448
1448
  return n;
1449
1449
  }
1450
- let o = Et(e, t);
1451
- for (; o && Mn(o) && Ve(o); )
1452
- o = Et(o, t);
1453
- return o && Ce(o) && Ve(o) && !Qe(o) ? n : o || In(e) || n;
1450
+ let o = Wt(t, e);
1451
+ for (; o && no(o) && ct(o); )
1452
+ o = Wt(o, e);
1453
+ return o && $e(o) && ct(o) && !xt(o) ? n : o || lo(t) || n;
1454
1454
  }
1455
- const Jn = async function(e) {
1456
- const t = this.getOffsetParent || Vt, n = this.getDimensions, o = await n(e.floating);
1455
+ const Eo = async function(t) {
1456
+ const e = this.getOffsetParent || an, n = this.getDimensions, o = await n(t.floating);
1457
1457
  return {
1458
- reference: Gn(e.reference, await t(e.floating), e.strategy),
1458
+ reference: xo(t.reference, await e(t.floating), t.strategy),
1459
1459
  floating: {
1460
1460
  x: 0,
1461
1461
  y: 0,
@@ -1464,351 +1464,351 @@ const Jn = async function(e) {
1464
1464
  }
1465
1465
  };
1466
1466
  };
1467
- function Qn(e) {
1468
- return Q(e).direction === "rtl";
1469
- }
1470
- const Zn = {
1471
- convertOffsetParentRelativeRectToViewportRelativeRect: Vn,
1472
- getDocumentElement: ne,
1473
- getClippingRect: Kn,
1474
- getOffsetParent: Vt,
1475
- getElementRects: Jn,
1476
- getClientRects: _n,
1477
- getDimensions: qn,
1478
- getScale: be,
1479
- isElement: J,
1480
- isRTL: Qn
1467
+ function Co(t) {
1468
+ return ge(t).direction === "rtl";
1469
+ }
1470
+ const To = {
1471
+ convertOffsetParentRelativeRectToViewportRelativeRect: fo,
1472
+ getDocumentElement: Ee,
1473
+ getClippingRect: bo,
1474
+ getOffsetParent: an,
1475
+ getElementRects: Eo,
1476
+ getClientRects: ho,
1477
+ getDimensions: yo,
1478
+ getScale: We,
1479
+ isElement: me,
1480
+ isRTL: Co
1481
1481
  };
1482
- function _t(e, t) {
1483
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1482
+ function un(t, e) {
1483
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1484
1484
  }
1485
- function eo(e, t) {
1485
+ function Ao(t, e) {
1486
1486
  let n = null, o;
1487
- const i = ne(e);
1488
- function c() {
1487
+ const r = Ee(t);
1488
+ function l() {
1489
1489
  var a;
1490
1490
  clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
1491
1491
  }
1492
- function r(a, d) {
1493
- a === void 0 && (a = !1), d === void 0 && (d = 1), c();
1494
- const s = e.getBoundingClientRect(), {
1492
+ function i(a, d) {
1493
+ a === void 0 && (a = !1), d === void 0 && (d = 1), l();
1494
+ const s = t.getBoundingClientRect(), {
1495
1495
  left: f,
1496
1496
  top: u,
1497
- width: m,
1498
- height: h
1497
+ width: h,
1498
+ height: v
1499
1499
  } = s;
1500
- if (a || t(), !m || !h)
1500
+ if (a || e(), !h || !v)
1501
1501
  return;
1502
- const p = Re(u), g = Re(i.clientWidth - (f + m)), v = Re(i.clientHeight - (u + h)), x = Re(f), E = {
1503
- rootMargin: -p + "px " + -g + "px " + -v + "px " + -x + "px",
1504
- threshold: Y(0, le(1, d)) || 1
1502
+ const g = Ze(u), w = Ze(r.clientWidth - (f + h)), m = Ze(r.clientHeight - (u + v)), p = Ze(f), L = {
1503
+ rootMargin: -g + "px " + -w + "px " + -m + "px " + -p + "px",
1504
+ threshold: ae(0, Oe(1, d)) || 1
1505
1505
  };
1506
- let P = !0;
1507
- function S(y) {
1508
- const O = y[0].intersectionRatio;
1509
- if (O !== d) {
1510
- if (!P)
1511
- return r();
1512
- O ? r(!1, O) : o = setTimeout(() => {
1513
- r(!1, 1e-7);
1506
+ let R = !0;
1507
+ function D(E) {
1508
+ const P = E[0].intersectionRatio;
1509
+ if (P !== d) {
1510
+ if (!R)
1511
+ return i();
1512
+ P ? i(!1, P) : o = setTimeout(() => {
1513
+ i(!1, 1e-7);
1514
1514
  }, 1e3);
1515
1515
  }
1516
- O === 1 && !_t(s, e.getBoundingClientRect()) && r(), P = !1;
1516
+ P === 1 && !un(s, t.getBoundingClientRect()) && i(), R = !1;
1517
1517
  }
1518
1518
  try {
1519
- n = new IntersectionObserver(S, {
1520
- ...E,
1519
+ n = new IntersectionObserver(D, {
1520
+ ...L,
1521
1521
  // Handle <iframe>s
1522
- root: i.ownerDocument
1522
+ root: r.ownerDocument
1523
1523
  });
1524
1524
  } catch {
1525
- n = new IntersectionObserver(S, E);
1525
+ n = new IntersectionObserver(D, L);
1526
1526
  }
1527
- n.observe(e);
1527
+ n.observe(t);
1528
1528
  }
1529
- return r(!0), c;
1529
+ return i(!0), l;
1530
1530
  }
1531
- function to(e, t, n, o) {
1531
+ function So(t, e, n, o) {
1532
1532
  o === void 0 && (o = {});
1533
1533
  const {
1534
- ancestorScroll: i = !0,
1535
- ancestorResize: c = !0,
1536
- elementResize: r = typeof ResizeObserver == "function",
1534
+ ancestorScroll: r = !0,
1535
+ ancestorResize: l = !0,
1536
+ elementResize: i = typeof ResizeObserver == "function",
1537
1537
  layoutShift: a = typeof IntersectionObserver == "function",
1538
1538
  animationFrame: d = !1
1539
- } = o, s = et(e), f = i || c ? [...s ? Pe(s) : [], ...Pe(t)] : [];
1540
- f.forEach((x) => {
1541
- i && x.addEventListener("scroll", n, {
1539
+ } = o, s = Ct(t), f = r || l ? [...s ? Ye(s) : [], ...Ye(e)] : [];
1540
+ f.forEach((p) => {
1541
+ r && p.addEventListener("scroll", n, {
1542
1542
  passive: !0
1543
- }), c && x.addEventListener("resize", n);
1543
+ }), l && p.addEventListener("resize", n);
1544
1544
  });
1545
- const u = s && a ? eo(s, n) : null;
1546
- let m = -1, h = null;
1547
- r && (h = new ResizeObserver((x) => {
1548
- let [b] = x;
1549
- b && b.target === s && h && (h.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1550
- var E;
1551
- (E = h) == null || E.observe(t);
1545
+ const u = s && a ? Ao(s, n) : null;
1546
+ let h = -1, v = null;
1547
+ i && (v = new ResizeObserver((p) => {
1548
+ let [y] = p;
1549
+ y && y.target === s && v && (v.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1550
+ var L;
1551
+ (L = v) == null || L.observe(e);
1552
1552
  })), n();
1553
- }), s && !d && h.observe(s), h.observe(t));
1554
- let p, g = d ? ve(e) : null;
1555
- d && v();
1556
- function v() {
1557
- const x = ve(e);
1558
- g && !_t(g, x) && n(), g = x, p = requestAnimationFrame(v);
1553
+ }), s && !d && v.observe(s), v.observe(e));
1554
+ let g, w = d ? Fe(t) : null;
1555
+ d && m();
1556
+ function m() {
1557
+ const p = Fe(t);
1558
+ w && !un(w, p) && n(), w = p, g = requestAnimationFrame(m);
1559
1559
  }
1560
1560
  return n(), () => {
1561
- var x;
1562
- f.forEach((b) => {
1563
- i && b.removeEventListener("scroll", n), c && b.removeEventListener("resize", n);
1564
- }), u == null || u(), (x = h) == null || x.disconnect(), h = null, d && cancelAnimationFrame(p);
1561
+ var p;
1562
+ f.forEach((y) => {
1563
+ r && y.removeEventListener("scroll", n), l && y.removeEventListener("resize", n);
1564
+ }), u == null || u(), (p = v) == null || p.disconnect(), v = null, d && cancelAnimationFrame(g);
1565
1565
  };
1566
1566
  }
1567
- const Ao = Sn, Do = En, Ro = Ln, Mo = Cn, No = An, ko = Tn, no = bn, oo = (e, t, n) => {
1568
- const o = /* @__PURE__ */ new Map(), i = {
1569
- platform: Zn,
1567
+ const br = Zn, yr = Un, xr = Jn, Er = _n, Cr = Qn, Tr = jn, Oo = Xn, Lo = (t, e, n) => {
1568
+ const o = /* @__PURE__ */ new Map(), r = {
1569
+ platform: To,
1570
1570
  ...n
1571
- }, c = {
1572
- ...i.platform,
1571
+ }, l = {
1572
+ ...r.platform,
1573
1573
  _c: o
1574
1574
  };
1575
- return yn(e, t, {
1576
- ...i,
1577
- platform: c
1575
+ return zn(t, e, {
1576
+ ...r,
1577
+ platform: l
1578
1578
  });
1579
1579
  };
1580
- function io(e) {
1580
+ function Do(t) {
1581
1581
  return {
1582
1582
  name: "arrow",
1583
- options: e,
1584
- fn(t) {
1585
- const n = D(e.element);
1586
- return n == null ? {} : no({ element: n, padding: e.padding }).fn(t);
1583
+ options: t,
1584
+ fn(e) {
1585
+ const n = T(t.element);
1586
+ return n == null ? {} : Oo({ element: n, padding: t.padding }).fn(e);
1587
1587
  }
1588
1588
  };
1589
1589
  }
1590
- function ro(e, t, n = {}) {
1590
+ function Po(t, e, n = {}) {
1591
1591
  const {
1592
1592
  transform: o = !0,
1593
- middlewares: i,
1594
- autoUpdate: c = !0,
1595
- open: r = U(!1),
1593
+ middlewares: r,
1594
+ autoUpdate: l = !0,
1595
+ open: i = ie(!1),
1596
1596
  onOpenChange: a
1597
- } = n, d = (y, O, M) => {
1598
- if (r.value === y) return;
1599
- r.value = y;
1600
- const R = O ?? "programmatic";
1601
- a == null || a(y, R, M);
1602
- }, s = N(() => D(n.placement) ?? "bottom"), f = N(() => D(n.strategy) ?? "absolute"), u = U(0), m = U(0), h = U(s.value), p = U(f.value), g = Xe({}), v = U(!1), x = U(null), b = N(() => {
1603
- const y = D(i) || [];
1604
- return x.value && !y.some((M) => M.name === "arrow") ? [...y, io({ element: x })] : y;
1605
- }), E = async () => {
1606
- if (!(!e.value || !t.value))
1597
+ } = n, d = (E, P, z) => {
1598
+ if (i.value === E) return;
1599
+ i.value = E;
1600
+ const k = P ?? "programmatic";
1601
+ a == null || a(E, k, z);
1602
+ }, s = F(() => T(n.placement) ?? "bottom"), f = F(() => T(n.strategy) ?? "absolute"), u = ie(0), h = ie(0), v = ie(s.value), g = ie(f.value), w = dt({}), m = ie(!1), p = ie(null), y = F(() => {
1603
+ const E = T(r) || [];
1604
+ return p.value && !E.some((z) => z.name === "arrow") ? [...E, Do({ element: p })] : E;
1605
+ }), L = async () => {
1606
+ if (!(!t.value || !e.value))
1607
1607
  try {
1608
- const y = await oo(e.value, t.value, {
1608
+ const E = await Lo(t.value, e.value, {
1609
1609
  placement: s.value,
1610
1610
  strategy: f.value,
1611
- middleware: b.value
1611
+ middleware: y.value
1612
1612
  });
1613
- u.value = y.x, m.value = y.y, h.value = y.placement, p.value = y.strategy, g.value = y.middlewareData, v.value = r.value;
1613
+ u.value = E.x, h.value = E.y, v.value = E.placement, g.value = E.strategy, w.value = E.middlewareData, m.value = i.value;
1614
1614
  } catch {
1615
1615
  }
1616
1616
  };
1617
- se([s, f, b], () => {
1618
- r.value && E();
1617
+ de([s, f, y], () => {
1618
+ i.value && L();
1619
1619
  });
1620
- let P;
1621
- se(
1622
- [e, t, r],
1623
- ([y, O, M]) => {
1624
- !M || !y || !O || (c && (P = to(
1625
- y,
1626
- O,
1620
+ let R;
1621
+ de(
1622
+ [t, e, i],
1623
+ ([E, P, z]) => {
1624
+ !z || !E || !P || (l && (R = So(
1627
1625
  E,
1628
- typeof c == "object" ? c : void 0
1629
- )), pe(() => {
1630
- P == null || P(), P = void 0;
1626
+ P,
1627
+ L,
1628
+ typeof l == "object" ? l : void 0
1629
+ )), Te(() => {
1630
+ R == null || R(), R = void 0;
1631
1631
  }));
1632
1632
  },
1633
1633
  { immediate: !0 }
1634
- ), xe(() => P == null ? void 0 : P()), se(r, (y) => {
1635
- y || (v.value = !1);
1634
+ ), Ie(() => R == null ? void 0 : R()), de(i, (E) => {
1635
+ E || (m.value = !1);
1636
1636
  });
1637
- const S = U({
1637
+ const D = ie({
1638
1638
  position: f.value,
1639
1639
  left: "0",
1640
1640
  top: "0"
1641
1641
  });
1642
- return se(
1643
- [u, m, () => D(o)],
1644
- ([y, O, M]) => {
1645
- const R = t.value;
1646
- if (!R) return;
1647
- const A = {
1648
- position: p.value,
1642
+ return de(
1643
+ [u, h, () => T(o)],
1644
+ ([E, P, z]) => {
1645
+ const k = e.value;
1646
+ if (!k) return;
1647
+ const N = {
1648
+ position: g.value,
1649
1649
  left: "0",
1650
1650
  top: "0"
1651
- }, k = Ct(R, y), F = Ct(R, O);
1652
- M ? S.value = {
1653
- ...A,
1654
- transform: `translate(${k}px, ${F}px)`,
1655
- ...Xt(R) >= 1.5 && {
1651
+ }, W = Vt(k, E), Y = Vt(k, P);
1652
+ z ? D.value = {
1653
+ ...N,
1654
+ transform: `translate(${W}px, ${Y}px)`,
1655
+ ...cn(k) >= 1.5 && {
1656
1656
  "will-change": "transform"
1657
1657
  }
1658
- } : S.value = {
1659
- ...A,
1660
- left: `${k}px`,
1661
- top: `${F}px`
1658
+ } : D.value = {
1659
+ ...N,
1660
+ left: `${W}px`,
1661
+ top: `${Y}px`
1662
1662
  };
1663
1663
  },
1664
1664
  { immediate: !0 }
1665
1665
  ), {
1666
1666
  id: n.id,
1667
1667
  x: u,
1668
- y: m,
1669
- strategy: p,
1670
- placement: h,
1671
- middlewareData: g,
1672
- isPositioned: v,
1673
- floatingStyles: S,
1674
- update: E,
1668
+ y: h,
1669
+ strategy: g,
1670
+ placement: v,
1671
+ middlewareData: w,
1672
+ isPositioned: m,
1673
+ floatingStyles: D,
1674
+ update: L,
1675
1675
  refs: {
1676
- anchorEl: e,
1677
- floatingEl: t,
1678
- arrowEl: x
1676
+ anchorEl: t,
1677
+ floatingEl: e,
1678
+ arrowEl: p
1679
1679
  },
1680
- open: r,
1680
+ open: i,
1681
1681
  setOpen: d
1682
1682
  };
1683
1683
  }
1684
- function Ct(e, t) {
1685
- const n = Xt(e);
1686
- return Math.round(t * n) / n;
1684
+ function Vt(t, e) {
1685
+ const n = cn(t);
1686
+ return Math.round(e * n) / n;
1687
1687
  }
1688
- function Xt(e) {
1689
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1688
+ function cn(t) {
1689
+ return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1690
1690
  }
1691
- function Fo(e = {}) {
1692
- let t;
1693
- return t = so(e), {
1694
- ...t,
1691
+ function Ar(t = {}) {
1692
+ let e;
1693
+ return e = Ro(t), {
1694
+ ...e,
1695
1695
  get root() {
1696
- return t.root;
1696
+ return e.root;
1697
1697
  },
1698
- addNode: (r, a, d = {}) => {
1699
- const { parentId: s, ...f } = d, u = St(), m = f.onOpenChange, h = ro(r, a, {
1698
+ addNode: (i, a, d = {}) => {
1699
+ const { parentId: s, ...f } = d, u = jt(), h = f.onOpenChange, v = Po(i, a, {
1700
1700
  ...f,
1701
1701
  id: u,
1702
- onOpenChange: (g, v, x) => {
1703
- if (m == null || m(g, v, x), !g) {
1704
- const b = t.findNodeById(u);
1705
- if (b) {
1706
- const E = b.children.value;
1707
- for (const P of E)
1708
- P.data.open.value && P.data.setOpen(!1, "tree-ancestor-close", x);
1702
+ onOpenChange: (w, m, p) => {
1703
+ if (h == null || h(w, m, p), !w) {
1704
+ const y = e.findNodeById(u);
1705
+ if (y) {
1706
+ const L = y.children.value;
1707
+ for (const R of L)
1708
+ R.data.open.value && R.data.setOpen(!1, "tree-ancestor-close", p);
1709
1709
  }
1710
1710
  }
1711
1711
  }
1712
1712
  });
1713
- return t.addNode(h, s, { id: u });
1713
+ return e.addNode(v, s, { id: u });
1714
1714
  },
1715
1715
  getAllOpenNodes: () => {
1716
- const r = [];
1717
- for (const a of t.nodeMap.values())
1718
- a.data.open.value && r.push(a);
1719
- return r;
1716
+ const i = [];
1717
+ for (const a of e.nodeMap.values())
1718
+ a.data.open.value && i.push(a);
1719
+ return i;
1720
1720
  },
1721
1721
  getDeepestOpenNode: () => {
1722
- let r = null, a = -1;
1723
- for (const d of t.nodeMap.values())
1722
+ let i = null, a = -1;
1723
+ for (const d of e.nodeMap.values())
1724
1724
  if (d.data.open.value) {
1725
1725
  const s = d.getPath().length;
1726
- s > a && (a = s, r = d);
1726
+ s > a && (a = s, i = d);
1727
1727
  }
1728
- return r;
1728
+ return i;
1729
1729
  },
1730
- applyToNodes: (r, a, d = {}) => {
1731
- const { relationship: s = "self-and-children", applyToMatching: f = !0 } = d, u = t.findNodeById(r);
1730
+ applyToNodes: (i, a, d = {}) => {
1731
+ const { relationship: s = "self-and-children", applyToMatching: f = !0 } = d, u = e.findNodeById(i);
1732
1732
  if (!u)
1733
1733
  return;
1734
- const m = [], h = /* @__PURE__ */ new Set(), p = (v) => {
1735
- v && !h.has(v.id) && (m.push(v), h.add(v.id));
1736
- }, g = (v) => {
1737
- for (const x of v)
1738
- p(x);
1734
+ const h = [], v = /* @__PURE__ */ new Set(), g = (m) => {
1735
+ m && !v.has(m.id) && (h.push(m), v.add(m.id));
1736
+ }, w = (m) => {
1737
+ for (const p of m)
1738
+ g(p);
1739
1739
  };
1740
1740
  if (s === "ancestors-only")
1741
- for (const v of u.getPath())
1742
- v.id !== u.id && p(v);
1741
+ for (const m of u.getPath())
1742
+ m.id !== u.id && g(m);
1743
1743
  else if (s === "siblings-only") {
1744
1744
  if (u.parent.value)
1745
- for (const v of u.parent.value.children.value)
1746
- v.id !== u.id && p(v);
1745
+ for (const m of u.parent.value.children.value)
1746
+ m.id !== u.id && g(m);
1747
1747
  } else if (s === "descendants-only")
1748
- for (const v of t.traverse("dfs", u))
1749
- v.id !== u.id && p(v);
1748
+ for (const m of e.traverse("dfs", u))
1749
+ m.id !== u.id && g(m);
1750
1750
  else if (s === "children-only")
1751
- g(u.children.value);
1751
+ w(u.children.value);
1752
1752
  else if (s === "self-and-ancestors")
1753
- g(u.getPath());
1753
+ w(u.getPath());
1754
1754
  else if (s === "self-and-children")
1755
- p(u), g(u.children.value);
1755
+ g(u), w(u.children.value);
1756
1756
  else if (s === "self-and-descendants")
1757
- g(t.traverse("dfs", u));
1757
+ w(e.traverse("dfs", u));
1758
1758
  else if (s === "self-and-siblings")
1759
- p(u), u.parent.value && g(u.parent.value.children.value);
1759
+ g(u), u.parent.value && w(u.parent.value.children.value);
1760
1760
  else if (s === "self-ancestors-and-children")
1761
- g(u.getPath()), g(u.children.value);
1761
+ w(u.getPath()), w(u.children.value);
1762
1762
  else if (s === "full-branch")
1763
- g(u.getPath()), g(t.traverse("dfs", u));
1763
+ w(u.getPath()), w(e.traverse("dfs", u));
1764
1764
  else if (s === "all-except-branch") {
1765
- const v = /* @__PURE__ */ new Set();
1766
- for (const x of u.getPath())
1767
- v.add(x.id);
1768
- for (const x of t.traverse("dfs", u))
1769
- v.add(x.id);
1770
- for (const x of t.nodeMap.values())
1771
- !v.has(x.id) === f && a(x);
1765
+ const m = /* @__PURE__ */ new Set();
1766
+ for (const p of u.getPath())
1767
+ m.add(p.id);
1768
+ for (const p of e.traverse("dfs", u))
1769
+ m.add(p.id);
1770
+ for (const p of e.nodeMap.values())
1771
+ !m.has(p.id) === f && a(p);
1772
1772
  return;
1773
1773
  } else {
1774
1774
  console.warn(`applyToNodes: Unknown relationship "${s}".`);
1775
1775
  return;
1776
1776
  }
1777
1777
  if (f)
1778
- for (const v of m)
1779
- a(v);
1778
+ for (const m of h)
1779
+ a(m);
1780
1780
  else
1781
- for (const v of t.nodeMap.values())
1782
- h.has(v.id) || a(v);
1781
+ for (const m of e.nodeMap.values())
1782
+ v.has(m.id) || a(m);
1783
1783
  }
1784
1784
  };
1785
1785
  }
1786
- function Tt(e, t = null, n = {}, o = !1) {
1787
- const i = n.id ?? St(), c = Xe(t), r = Xe([]), a = N(() => r.value.length === 0), d = {
1788
- id: i,
1789
- data: e,
1790
- parent: c,
1791
- children: r,
1786
+ function $t(t, e = null, n = {}, o = !1) {
1787
+ const r = n.id ?? jt(), l = dt(e), i = dt([]), a = F(() => i.value.length === 0), d = {
1788
+ id: r,
1789
+ data: t,
1790
+ parent: l,
1791
+ children: i,
1792
1792
  isRoot: o,
1793
1793
  isLeaf: a,
1794
1794
  addChild: (s) => {
1795
- r.value = [...r.value, s];
1795
+ i.value = [...i.value, s];
1796
1796
  },
1797
- _removeChildInstance: (s) => r.value.includes(s) ? (r.value = r.value.filter((f) => f.id !== s.id), s.parent.value = null, !0) : !1,
1798
- findChild: (s) => r.value.find(s) ?? null,
1797
+ _removeChildInstance: (s) => i.value.includes(s) ? (i.value = i.value.filter((f) => f.id !== s.id), s.parent.value = null, !0) : !1,
1798
+ findChild: (s) => i.value.find(s) ?? null,
1799
1799
  findDescendant: (s) => {
1800
1800
  const f = [d];
1801
1801
  for (; f.length > 0; ) {
1802
1802
  const u = f.pop();
1803
1803
  if (s(u))
1804
1804
  return u;
1805
- for (let m = u.children.value.length - 1; m >= 0; m--)
1806
- f.push(u.children.value[m]);
1805
+ for (let h = u.children.value.length - 1; h >= 0; h--)
1806
+ f.push(u.children.value[h]);
1807
1807
  }
1808
1808
  return null;
1809
1809
  },
1810
1810
  isDescendantOf: (s) => {
1811
- let f = c.value;
1811
+ let f = l.value;
1812
1812
  for (; f; ) {
1813
1813
  if (f.id === s.id)
1814
1814
  return !0;
@@ -1826,89 +1826,89 @@ function Tt(e, t = null, n = {}, o = !1) {
1826
1826
  };
1827
1827
  return Object.freeze(d);
1828
1828
  }
1829
- function so(e) {
1830
- const t = (e == null ? void 0 : e.deleteStrategy) ?? "recursive", n = Gt(/* @__PURE__ */ new Map());
1829
+ function Ro(t) {
1830
+ const e = (t == null ? void 0 : t.deleteStrategy) ?? "recursive", n = En(/* @__PURE__ */ new Map());
1831
1831
  let o = null;
1832
- const i = (u) => n.get(u) ?? null, c = (u, m = null, h = {}) => {
1832
+ const r = (u) => n.get(u) ?? null, l = (u, h = null, v = {}) => {
1833
1833
  if (!o) {
1834
- if (m != null)
1834
+ if (h != null)
1835
1835
  return console.error(
1836
- `Tree addNode: Cannot add a non-root node before a root exists. Received parentId=${m}.`
1836
+ `Tree addNode: Cannot add a non-root node before a root exists. Received parentId=${h}.`
1837
1837
  ), null;
1838
- const v = Tt(u, null, h, !0);
1839
- return n.set(v.id, v), o = v, v;
1838
+ const m = $t(u, null, v, !0);
1839
+ return n.set(m.id, m), o = m, m;
1840
1840
  }
1841
- const p = m ? i(m) : o;
1842
- if (!p)
1843
- return console.error(`Tree addNode: Parent node with ID ${m} not found.`), null;
1844
- h.id && n.has(h.id) && (h.id = void 0);
1845
- const g = Tt(u, p, h);
1846
- return n.set(g.id, g), p.addChild(g), g;
1847
- }, r = (u, m) => {
1848
- const h = m ?? t, p = i(u);
1849
- if (!p)
1841
+ const g = h ? r(h) : o;
1842
+ if (!g)
1843
+ return console.error(`Tree addNode: Parent node with ID ${h} not found.`), null;
1844
+ v.id && n.has(v.id) && (v.id = void 0);
1845
+ const w = $t(u, g, v);
1846
+ return n.set(w.id, w), g.addChild(w), w;
1847
+ }, i = (u, h) => {
1848
+ const v = h ?? e, g = r(u);
1849
+ if (!g)
1850
1850
  return !1;
1851
- if (p.isRoot)
1851
+ if (g.isRoot)
1852
1852
  return console.error("Tree removeNode: Cannot remove the root node."), !1;
1853
- const g = p.parent.value;
1854
- if (h === "recursive")
1855
- f(p);
1853
+ const w = g.parent.value;
1854
+ if (v === "recursive")
1855
+ f(g);
1856
1856
  else {
1857
- for (const v of p.children.value)
1858
- v.parent.value = null;
1859
- p.children.value = [], n.delete(p.id);
1857
+ for (const m of g.children.value)
1858
+ m.parent.value = null;
1859
+ g.children.value = [], n.delete(g.id);
1860
1860
  }
1861
- return g._removeChildInstance(p);
1862
- }, a = (u, m) => {
1863
- const h = i(u);
1864
- if (!h)
1861
+ return w._removeChildInstance(g);
1862
+ }, a = (u, h) => {
1863
+ const v = r(u);
1864
+ if (!v)
1865
1865
  return console.error(`Tree moveNode: Node with ID ${u} not found.`), !1;
1866
- if (h.isRoot)
1866
+ if (v.isRoot)
1867
1867
  return console.error("Tree moveNode: Cannot move the root node."), !1;
1868
- if (u === m)
1868
+ if (u === h)
1869
1869
  return console.error("Tree moveNode: Cannot move a node to be a child of itself."), !1;
1870
- const p = m ? i(m) : o;
1871
- if (!p)
1872
- return console.error(`Tree moveNode: New parent node with ID ${m} not found.`), !1;
1873
- if (p.isDescendantOf(h))
1870
+ const g = h ? r(h) : o;
1871
+ if (!g)
1872
+ return console.error(`Tree moveNode: New parent node with ID ${h} not found.`), !1;
1873
+ if (g.isDescendantOf(v))
1874
1874
  return console.error("Tree moveNode: Cannot move a node to become its own descendant."), !1;
1875
- const g = h.parent.value;
1876
- if (g) {
1877
- if (!g._removeChildInstance(h))
1875
+ const w = v.parent.value;
1876
+ if (w) {
1877
+ if (!w._removeChildInstance(v))
1878
1878
  return console.error("Tree moveNode: Failed to remove node from its original parent."), !1;
1879
- } else if (h.isRoot) {
1880
- if (h.isRoot)
1879
+ } else if (v.isRoot) {
1880
+ if (v.isRoot)
1881
1881
  return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."), !1;
1882
1882
  }
1883
- return p.addChild(h), h.parent.value = p, !0;
1884
- }, d = (u = "dfs", m = o) => {
1885
- const h = [];
1886
- if (!m)
1887
- return console.warn("Tree traverse: Start node is null, returning empty array."), h;
1883
+ return g.addChild(v), v.parent.value = g, !0;
1884
+ }, d = (u = "dfs", h = o) => {
1885
+ const v = [];
1886
+ if (!h)
1887
+ return console.warn("Tree traverse: Start node is null, returning empty array."), v;
1888
1888
  if (u === "dfs") {
1889
- const p = [m];
1890
- for (; p.length > 0; ) {
1891
- const g = p.pop();
1892
- h.push(g);
1893
- for (let v = g.children.value.length - 1; v >= 0; v--)
1894
- p.push(g.children.value[v]);
1889
+ const g = [h];
1890
+ for (; g.length > 0; ) {
1891
+ const w = g.pop();
1892
+ v.push(w);
1893
+ for (let m = w.children.value.length - 1; m >= 0; m--)
1894
+ g.push(w.children.value[m]);
1895
1895
  }
1896
1896
  } else {
1897
- const p = [m];
1898
- for (; p.length > 0; ) {
1899
- const g = p.shift();
1900
- h.push(g);
1901
- for (const v of g.children.value)
1902
- p.push(v);
1897
+ const g = [h];
1898
+ for (; g.length > 0; ) {
1899
+ const w = g.shift();
1900
+ v.push(w);
1901
+ for (const m of w.children.value)
1902
+ g.push(m);
1903
1903
  }
1904
1904
  }
1905
- return h;
1905
+ return v;
1906
1906
  }, s = () => {
1907
1907
  n.clear();
1908
1908
  }, f = (u) => {
1909
- const m = [...u.children.value];
1910
- for (const h of m)
1911
- f(h);
1909
+ const h = [...u.children.value];
1910
+ for (const v of h)
1911
+ f(v);
1912
1912
  n.delete(u.id), u.children.value = [];
1913
1913
  };
1914
1914
  return Object.freeze({
@@ -1918,352 +1918,359 @@ function so(e) {
1918
1918
  get nodeMap() {
1919
1919
  return n;
1920
1920
  },
1921
- findNodeById: i,
1922
- addNode: c,
1923
- removeNode: r,
1921
+ findNodeById: r,
1922
+ addNode: l,
1923
+ removeNode: i,
1924
1924
  moveNode: a,
1925
1925
  traverse: d,
1926
1926
  dispose: s
1927
1927
  });
1928
1928
  }
1929
- function lo(e) {
1930
- return Jt() ? (xe(e), !0) : !1;
1929
+ function Mo(t) {
1930
+ return Cn() ? (Ie(t), !0) : !1;
1931
1931
  }
1932
- const ao = typeof window < "u" && typeof document < "u";
1932
+ const No = typeof window < "u" && typeof document < "u";
1933
1933
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1934
- const co = Object.prototype.toString, uo = (e) => co.call(e) === "[object Object]";
1935
- function _e(e) {
1936
- return Array.isArray(e) ? e : [e];
1934
+ const Io = Object.prototype.toString, Fo = (t) => Io.call(t) === "[object Object]";
1935
+ function ft(t) {
1936
+ return Array.isArray(t) ? t : [t];
1937
1937
  }
1938
- function fo(e, t, n) {
1939
- return se(
1940
- e,
1938
+ function ko(t, e, n) {
1939
+ return de(
1941
1940
  t,
1941
+ e,
1942
1942
  {
1943
1943
  ...n,
1944
1944
  immediate: !0
1945
1945
  }
1946
1946
  );
1947
1947
  }
1948
- const ho = ao ? window : void 0;
1949
- function mo(e) {
1950
- var t;
1951
- const n = D(e);
1952
- return (t = n == null ? void 0 : n.$el) != null ? t : n;
1953
- }
1954
- function K(...e) {
1955
- const t = [], n = () => {
1956
- t.forEach((a) => a()), t.length = 0;
1957
- }, o = (a, d, s, f) => (a.addEventListener(d, s, f), () => a.removeEventListener(d, s, f)), i = N(() => {
1958
- const a = _e(D(e[0])).filter((d) => d != null);
1948
+ const Ho = No ? window : void 0;
1949
+ function Bo(t) {
1950
+ var e;
1951
+ const n = T(t);
1952
+ return (e = n == null ? void 0 : n.$el) != null ? e : n;
1953
+ }
1954
+ function ne(...t) {
1955
+ const e = [], n = () => {
1956
+ e.forEach((a) => a()), e.length = 0;
1957
+ }, o = (a, d, s, f) => (a.addEventListener(d, s, f), () => a.removeEventListener(d, s, f)), r = F(() => {
1958
+ const a = ft(T(t[0])).filter((d) => d != null);
1959
1959
  return a.every((d) => typeof d != "string") ? a : void 0;
1960
- }), c = fo(
1960
+ }), l = ko(
1961
1961
  () => {
1962
1962
  var a, d;
1963
1963
  return [
1964
- (d = (a = i.value) == null ? void 0 : a.map((s) => mo(s))) != null ? d : [ho].filter((s) => s != null),
1965
- _e(D(i.value ? e[1] : e[0])),
1966
- _e(Qt(i.value ? e[2] : e[1])),
1964
+ (d = (a = r.value) == null ? void 0 : a.map((s) => Bo(s))) != null ? d : [Ho].filter((s) => s != null),
1965
+ ft(T(r.value ? t[1] : t[0])),
1966
+ ft(Tn(r.value ? t[2] : t[1])),
1967
1967
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1968
- D(i.value ? e[3] : e[2])
1968
+ T(r.value ? t[3] : t[2])
1969
1969
  ];
1970
1970
  },
1971
1971
  ([a, d, s, f]) => {
1972
1972
  if (n(), !(a != null && a.length) || !(d != null && d.length) || !(s != null && s.length))
1973
1973
  return;
1974
- const u = uo(f) ? { ...f } : f;
1975
- t.push(
1974
+ const u = Fo(f) ? { ...f } : f;
1975
+ e.push(
1976
1976
  ...a.flatMap(
1977
- (m) => d.flatMap(
1978
- (h) => s.map((p) => o(m, h, p, u))
1977
+ (h) => d.flatMap(
1978
+ (v) => s.map((g) => o(h, v, g, u))
1979
1979
  )
1980
1980
  )
1981
1981
  );
1982
1982
  },
1983
1983
  { flush: "post" }
1984
- ), r = () => {
1985
- c(), n();
1984
+ ), i = () => {
1985
+ l(), n();
1986
1986
  };
1987
- return lo(n), r;
1987
+ return Mo(n), i;
1988
1988
  }
1989
- function Ho(e, t = {}) {
1990
- const { floatingContext: n, treeContext: o } = Ke(e), { open: i, setOpen: c, refs: r } = n, {
1989
+ function Sr(t, e = {}) {
1990
+ const { floatingContext: n, treeContext: o } = je(t), { open: r, setOpen: l, refs: i } = n, {
1991
1991
  enabled: a = !0,
1992
1992
  event: d = "click",
1993
1993
  toggle: s = !0,
1994
1994
  ignoreMouse: f = !1,
1995
1995
  ignoreKeyboard: u = !1,
1996
- ignoreTouch: m = !1,
1996
+ ignoreTouch: h = !1,
1997
1997
  // Outside click options
1998
- outsideClick: h = !1,
1999
- outsideEvent: p = "pointerdown",
2000
- outsideCapture: g = !0,
2001
- onOutsideClick: v,
2002
- preventScrollbarClick: x = !0,
2003
- handleDragEvents: b = !0
2004
- } = t;
2005
- let E, P = !1, S = !1, y = !1;
2006
- const O = N(() => D(a)), M = N(() => D(h)), R = N(() => {
2007
- const T = r.anchorEl.value;
2008
- return T instanceof HTMLElement ? T : null;
2009
- }), A = N(() => r.floatingEl.value);
2010
- function k(T, V) {
2011
- y = !0;
1998
+ outsideClick: v = !1,
1999
+ outsideEvent: g = "pointerdown",
2000
+ outsideCapture: w = !0,
2001
+ onOutsideClick: m,
2002
+ preventScrollbarClick: p = !0,
2003
+ handleDragEvents: y = !0
2004
+ } = e;
2005
+ let L, R = !1, D = !1, E = !1;
2006
+ const P = F(() => T(a)), z = F(() => T(v)), k = F(() => {
2007
+ const S = i.anchorEl.value;
2008
+ return S instanceof HTMLElement ? S : null;
2009
+ }), N = F(() => i.floatingEl.value);
2010
+ function W(S, j) {
2011
+ E = !0;
2012
2012
  try {
2013
- i.value ? D(s) && c(!1, T, V) : c(!0, T, V);
2013
+ r.value ? T(s) && l(!1, S, j) : l(!0, S, j);
2014
2014
  } finally {
2015
2015
  Promise.resolve().then(() => {
2016
- y = !1;
2016
+ E = !1;
2017
2017
  });
2018
2018
  }
2019
2019
  }
2020
- function F() {
2021
- E = void 0, P = !1, S = !1;
2020
+ function Y() {
2021
+ L = void 0, R = !1, D = !1;
2022
2022
  }
2023
- function $(T) {
2024
- E = T.pointerType;
2023
+ function X(S) {
2024
+ L = S.pointerType;
2025
2025
  }
2026
- function H(T) {
2027
- T.button === 0 && D(d) !== "click" && (_(E) || k("anchor-click", T));
2026
+ function $(S) {
2027
+ S.button === 0 && T(d) !== "click" && (J(L) || W("anchor-click", S));
2028
2028
  }
2029
- function C(T) {
2030
- if (D(u) && T.detail === 0) {
2031
- F();
2029
+ function C(S) {
2030
+ if (T(u) && S.detail === 0) {
2031
+ Y();
2032
2032
  return;
2033
2033
  }
2034
- if (D(d) === "mousedown" && E) {
2035
- F();
2034
+ if (T(d) === "mousedown" && L) {
2035
+ Y();
2036
2036
  return;
2037
2037
  }
2038
- if (_(E)) {
2039
- F();
2038
+ if (J(L)) {
2039
+ Y();
2040
2040
  return;
2041
2041
  }
2042
- k("anchor-click", T), F();
2042
+ W("anchor-click", S), Y();
2043
2043
  }
2044
- function l(T) {
2045
- if (E = void 0, T.defaultPrevented || D(u) || lt(T))
2044
+ function c(S) {
2045
+ if (L = void 0, S.defaultPrevented || T(u) || Tt(S))
2046
2046
  return;
2047
- const V = R.value;
2048
- V && (T.key === " " && !at(V) && (T.preventDefault(), P = !0), T.key === "Enter" && k("keyboard-activate", T));
2047
+ const j = k.value;
2048
+ j && (S.key === " " && !At(j) && (S.preventDefault(), R = !0), S.key === "Enter" && W("keyboard-activate", S));
2049
2049
  }
2050
- function I(T) {
2051
- const V = R.value;
2052
- V && (T.defaultPrevented || D(u) || lt(T) || at(V) || T.key === " " && P && (P = !1, k("keyboard-activate", T)));
2050
+ function V(S) {
2051
+ const j = k.value;
2052
+ j && (S.defaultPrevented || T(u) || Tt(S) || At(j) || S.key === " " && R && (R = !1, W("keyboard-activate", S)));
2053
2053
  }
2054
- function w(T) {
2055
- if (!O.value || !M.value || !i.value)
2054
+ function b(S) {
2055
+ if (!P.value || !z.value || !r.value)
2056
2056
  return;
2057
- if (D(p) === "click" && D(b) && S) {
2058
- S = !1;
2057
+ if (T(g) === "click" && T(y) && D) {
2058
+ D = !1;
2059
2059
  return;
2060
2060
  }
2061
- if (y)
2061
+ if (E)
2062
2062
  return;
2063
- const V = T.target;
2064
- if (V && !(D(x) && Ye(V) && A.value && rn(T, V))) {
2063
+ const j = S.target;
2064
+ if (j && !(T(p) && Xe(j) && N.value && Dn(S, j))) {
2065
2065
  if (o) {
2066
- if (!po(o, V))
2066
+ if (!Wo(o, j))
2067
2067
  return;
2068
- } else if (ct(T, R.value) || ct(T, A.value))
2068
+ } else if (St(S, k.value) || St(S, N.value))
2069
2069
  return;
2070
- v ? v(T, n) : c(!1, "outside-pointer", T);
2070
+ m ? m(S, n) : l(!1, "outside-pointer", S);
2071
2071
  }
2072
2072
  }
2073
- function B() {
2074
- S = !0;
2073
+ function U() {
2074
+ D = !0;
2075
2075
  }
2076
- function oe() {
2076
+ function te() {
2077
2077
  setTimeout(() => {
2078
- S = !1;
2078
+ D = !1;
2079
2079
  }, 0);
2080
2080
  }
2081
- function _(T) {
2082
- return !!(Lt(T, !0) && D(f) || T === "touch" && D(m));
2081
+ function J(S) {
2082
+ return !!(qt(S, !0) && T(f) || S === "touch" && T(h));
2083
2083
  }
2084
- Oe(() => {
2085
- const T = R.value;
2086
- !O.value || !T || (T.addEventListener("pointerdown", $), T.addEventListener("mousedown", H), T.addEventListener("click", C), T.addEventListener("keydown", l), T.addEventListener("keyup", I), pe(() => {
2087
- T.removeEventListener("pointerdown", $), T.removeEventListener("mousedown", H), T.removeEventListener("click", C), T.removeEventListener("keydown", l), T.removeEventListener("keyup", I), F();
2084
+ Me(() => {
2085
+ const S = k.value;
2086
+ !P.value || !S || (S.addEventListener("pointerdown", X), S.addEventListener("mousedown", $), S.addEventListener("click", C), S.addEventListener("keydown", c), S.addEventListener("keyup", V), Te(() => {
2087
+ S.removeEventListener("pointerdown", X), S.removeEventListener("mousedown", $), S.removeEventListener("click", C), S.removeEventListener("keydown", c), S.removeEventListener("keyup", V), Y();
2088
2088
  }));
2089
- }), K(
2090
- () => O.value && M.value ? document : null,
2091
- () => D(p),
2092
- w,
2093
- { capture: D(g) }
2094
- ), K(
2095
- () => O.value && M.value && D(b) ? A.value : null,
2089
+ }), ne(
2090
+ () => P.value && z.value ? document : null,
2091
+ () => T(g),
2092
+ b,
2093
+ { capture: T(w) }
2094
+ ), ne(
2095
+ () => P.value && z.value && T(y) ? N.value : null,
2096
2096
  "mousedown",
2097
- B,
2097
+ U,
2098
2098
  { capture: !0 }
2099
- ), K(
2100
- () => O.value && M.value && D(b) ? A.value : null,
2099
+ ), ne(
2100
+ () => P.value && z.value && T(y) ? N.value : null,
2101
2101
  "mouseup",
2102
- oe,
2102
+ te,
2103
2103
  { capture: !0 }
2104
2104
  );
2105
2105
  }
2106
- function po(e, t) {
2107
- return !(q(t, e.data.refs.anchorEl.value) || q(t, e.data.refs.floatingEl.value) || qe(e, t));
2106
+ function Wo(t, e) {
2107
+ return !(ue(e, t.data.refs.anchorEl.value) || ue(e, t.data.refs.floatingEl.value) || rt(t, e));
2108
2108
  }
2109
- function Io(e, t = {}) {
2110
- const { floatingContext: n, treeContext: o } = Ke(e), { enabled: i = !0, capture: c = !1, onEscape: r } = t, { isComposing: a } = go();
2111
- K(document, "keydown", (s) => {
2112
- if (!(s.key !== "Escape" || !D(i) || a())) {
2113
- if (r) {
2114
- r(s);
2109
+ function Or(t, e = {}) {
2110
+ const { floatingContext: n, treeContext: o } = je(t), { enabled: r = !0, capture: l = !1, onEscape: i } = e, { isComposing: a } = $o();
2111
+ ne(document, "keydown", (s) => {
2112
+ if (!(s.key !== "Escape" || !T(r) || a())) {
2113
+ if (i) {
2114
+ i(s);
2115
2115
  return;
2116
2116
  }
2117
2117
  if (o) {
2118
- const f = vo(o);
2118
+ const f = Vo(o);
2119
2119
  f && f.data.setOpen(!1, "escape-key", s);
2120
2120
  } else
2121
2121
  n.setOpen(!1, "escape-key", s);
2122
2122
  }
2123
- }, c);
2123
+ }, l);
2124
2124
  }
2125
- function vo(e) {
2126
- var c;
2127
- let t = e;
2128
- for (; (c = t.parent) != null && c.value && !t.isRoot; )
2129
- t = t.parent.value;
2125
+ function Vo(t) {
2126
+ var l;
2127
+ let e = t;
2128
+ for (; (l = e.parent) != null && l.value && !e.isRoot; )
2129
+ e = e.parent.value;
2130
2130
  let n = null, o = -1;
2131
- const i = (r) => {
2131
+ const r = (i) => {
2132
2132
  var d;
2133
- if (r.data.open.value) {
2134
- const s = r.getPath().length;
2135
- s > o && (o = s, n = r);
2133
+ if (i.data.open.value) {
2134
+ const s = i.getPath().length;
2135
+ s > o && (o = s, n = i);
2136
2136
  }
2137
- const a = ((d = r.children) == null ? void 0 : d.value) ?? [];
2137
+ const a = ((d = i.children) == null ? void 0 : d.value) ?? [];
2138
2138
  for (const s of a)
2139
- i(s);
2139
+ r(s);
2140
2140
  };
2141
- return i(t), n;
2142
- }
2143
- function go() {
2144
- const e = U(!1);
2145
- return K(document, "compositionstart", () => {
2146
- e.value = !0;
2147
- }), K(document, "compositionend", () => {
2148
- e.value = !1;
2141
+ return r(e), n;
2142
+ }
2143
+ function $o() {
2144
+ const t = ie(!1);
2145
+ return ne(document, "compositionstart", () => {
2146
+ t.value = !0;
2147
+ }), ne(document, "compositionend", () => {
2148
+ t.value = !1;
2149
2149
  }), {
2150
- isComposing: () => e.value
2150
+ isComposing: () => t.value
2151
2151
  };
2152
2152
  }
2153
- const wo = 0;
2154
- function Bo(e, t = {}) {
2153
+ const Je = ie(!1);
2154
+ typeof window < "u" && (ne(
2155
+ window,
2156
+ "keydown",
2157
+ () => {
2158
+ Je.value = !0;
2159
+ },
2160
+ { capture: !0 }
2161
+ ), ne(
2162
+ window,
2163
+ "pointerdown",
2164
+ () => {
2165
+ Je.value = !1;
2166
+ },
2167
+ { capture: !0 }
2168
+ ), ne(
2169
+ window,
2170
+ "pointermove",
2171
+ () => {
2172
+ Je.value = !1;
2173
+ },
2174
+ { capture: !0 }
2175
+ ));
2176
+ const fn = _t(Je), Ko = 0;
2177
+ function Lr(t, e = {}) {
2155
2178
  const {
2156
2179
  open: n,
2157
2180
  setOpen: o,
2158
- refs: { floatingEl: i, anchorEl: c }
2159
- } = e, { enabled: r = !0, requireFocusVisible: a = !0, tree: d } = t, s = N(() => c.value ? c.value instanceof HTMLElement ? c.value : c.value.contextElement : null);
2160
- let f = !1, u = !0;
2161
- const m = tn() && nn();
2162
- let h, p = new yo(i);
2181
+ refs: { floatingEl: r, anchorEl: l }
2182
+ } = t, { enabled: i = !0, requireFocusVisible: a = !0, tree: d } = e, s = F(() => l.value ? l.value instanceof HTMLElement ? l.value : l.value.contextElement : null);
2183
+ let f = !1;
2184
+ const u = Sn() && On();
2185
+ let h, v = new zo(r);
2163
2186
  if (d) {
2164
- let b = null;
2165
- if (e.id && (b = d.findNodeById(e.id)), !b) {
2166
- for (const E of d.nodeMap.values())
2167
- if (E.data === e) {
2168
- b = E;
2187
+ let p = null;
2188
+ if (t.id && (p = d.findNodeById(t.id)), !p) {
2189
+ for (const y of d.nodeMap.values())
2190
+ if (y.data === t) {
2191
+ p = y;
2169
2192
  break;
2170
2193
  }
2171
2194
  }
2172
- b && (p = new bo(b));
2195
+ p && (v = new Xo(p));
2173
2196
  }
2174
- K(window, "blur", () => {
2197
+ ne(window, "blur", () => {
2175
2198
  !n.value && s.value && s.value === document.activeElement && (f = !0);
2176
- }), K(window, "focus", () => {
2199
+ }), ne(window, "focus", () => {
2177
2200
  f = !1;
2178
- }), Zt(() => {
2179
- m && (K(
2180
- window,
2181
- "keydown",
2182
- () => {
2183
- u = !0;
2184
- },
2185
- { capture: !0 }
2186
- ), K(
2187
- window,
2188
- "pointerdown",
2189
- () => {
2190
- u = !1;
2191
- },
2192
- { capture: !0 }
2193
- ));
2194
2201
  });
2195
- function g(b) {
2202
+ function g(p) {
2196
2203
  if (f) {
2197
2204
  f = !1;
2198
2205
  return;
2199
2206
  }
2200
- const E = b.target instanceof Element ? b.target : null;
2201
- if (D(a) && E) {
2202
- if (m && !b.relatedTarget) {
2203
- if (!u && !At(E))
2207
+ const y = p.target instanceof Element ? p.target : null;
2208
+ if (T(a) && y) {
2209
+ if (u && !p.relatedTarget) {
2210
+ if (!fn.value && !wt(y))
2204
2211
  return;
2205
- } else if (!on(E))
2212
+ } else if (!Ln(y))
2206
2213
  return;
2207
2214
  }
2208
2215
  try {
2209
- o(!0, "focus", b);
2210
- } catch (P) {
2211
- console.error("[useFocus] Error in onFocus handler:", P);
2216
+ o(!0, "focus", p);
2217
+ } catch (L) {
2218
+ console.error("[useFocus] Error in onFocus handler:", L);
2212
2219
  }
2213
2220
  }
2214
- function v(b) {
2221
+ function w(p) {
2215
2222
  clearTimeout(h), h = window.setTimeout(() => {
2216
- var S;
2217
- const P = (((S = s.value) == null ? void 0 : S.ownerDocument) ?? document).activeElement;
2218
- if (!(!b.relatedTarget && P === s.value) && !p.shouldRemainOpen(P))
2223
+ var R;
2224
+ const L = (((R = s.value) == null ? void 0 : R.ownerDocument) ?? document).activeElement;
2225
+ if (!(!p.relatedTarget && L === s.value) && !v.shouldRemainOpen(L))
2219
2226
  try {
2220
- if (P instanceof Element) {
2221
- const y = p.getAncestorsToClose(P);
2222
- for (const O of y)
2227
+ if (L instanceof Element) {
2228
+ const D = v.getAncestorsToClose(L);
2229
+ for (const E of D)
2223
2230
  try {
2224
- O.data.setOpen(!1, "tree-ancestor-close", b);
2225
- } catch (M) {
2226
- console.error("[useFocus] Error closing ancestor on blur:", M);
2231
+ E.data.setOpen(!1, "tree-ancestor-close", p);
2232
+ } catch (P) {
2233
+ console.error("[useFocus] Error closing ancestor on blur:", P);
2227
2234
  }
2228
2235
  }
2229
- o(!1, "blur", b);
2230
- } catch (y) {
2231
- console.error("[useFocus] Error in onBlur handler:", y);
2236
+ o(!1, "blur", p);
2237
+ } catch (D) {
2238
+ console.error("[useFocus] Error in onBlur handler:", D);
2232
2239
  }
2233
- }, wo);
2240
+ }, Ko);
2234
2241
  }
2235
- K(
2242
+ ne(
2236
2243
  document,
2237
2244
  "focusin",
2238
- (b) => {
2239
- if (!D(r)) return;
2240
- const E = b.target;
2241
- if (!(E instanceof Element)) return;
2242
- const P = s.value;
2243
- if (!(P && q(E, P)) && !p.shouldRemainOpen(E))
2245
+ (p) => {
2246
+ if (!T(i)) return;
2247
+ const y = p.target;
2248
+ if (!(y instanceof Element)) return;
2249
+ const L = s.value;
2250
+ if (!(L && ue(y, L)) && !v.shouldRemainOpen(y))
2244
2251
  try {
2245
- const S = p.getAncestorsToClose(E);
2246
- for (const y of S)
2252
+ const R = v.getAncestorsToClose(y);
2253
+ for (const D of R)
2247
2254
  try {
2248
- y.data.setOpen(!1, "tree-ancestor-close", b);
2249
- } catch (O) {
2250
- console.error("[useFocus] Error closing ancestor on focusin:", O);
2255
+ D.data.setOpen(!1, "tree-ancestor-close", p);
2256
+ } catch (E) {
2257
+ console.error("[useFocus] Error closing ancestor on focusin:", E);
2251
2258
  }
2252
- o(!1, "blur", b);
2253
- } catch (S) {
2254
- console.error("[useFocus] Error in document focusin handler:", S);
2259
+ o(!1, "blur", p);
2260
+ } catch (R) {
2261
+ console.error("[useFocus] Error in document focusin handler:", R);
2255
2262
  }
2256
2263
  },
2257
2264
  { capture: !0 }
2258
2265
  );
2259
- const x = Oe(() => {
2260
- if (!D(r)) return;
2261
- const b = s.value;
2262
- !b || !(b instanceof HTMLElement) || (b.addEventListener("focus", g), b.addEventListener("blur", v), pe(() => {
2263
- b.removeEventListener("focus", g), b.removeEventListener("blur", v);
2266
+ const m = Me(() => {
2267
+ if (!T(i)) return;
2268
+ const p = s.value;
2269
+ !p || !(p instanceof HTMLElement) || (p.addEventListener("focus", g), p.addEventListener("blur", w), Te(() => {
2270
+ p.removeEventListener("focus", g), p.removeEventListener("blur", w);
2264
2271
  }));
2265
2272
  });
2266
- return xe(() => {
2273
+ return Ie(() => {
2267
2274
  clearTimeout(h);
2268
2275
  }), {
2269
2276
  /**
@@ -2271,38 +2278,38 @@ function Bo(e, t = {}) {
2271
2278
  * Useful for manual cleanup in testing scenarios.
2272
2279
  */
2273
2280
  cleanup: () => {
2274
- clearTimeout(h), x();
2281
+ clearTimeout(h), m();
2275
2282
  }
2276
2283
  };
2277
2284
  }
2278
- class yo {
2279
- constructor(t) {
2280
- this.floatingEl = t;
2285
+ class zo {
2286
+ constructor(e) {
2287
+ this.floatingEl = e;
2281
2288
  }
2282
- shouldRemainOpen(t) {
2283
- return !t || !this.floatingEl.value ? !1 : this.floatingEl.value.contains(t);
2289
+ shouldRemainOpen(e) {
2290
+ return !e || !this.floatingEl.value ? !1 : this.floatingEl.value.contains(e);
2284
2291
  }
2285
- getAncestorsToClose(t) {
2292
+ getAncestorsToClose(e) {
2286
2293
  return [];
2287
2294
  }
2288
2295
  }
2289
- class bo {
2290
- constructor(t) {
2291
- this.treeContext = t;
2296
+ class Xo {
2297
+ constructor(e) {
2298
+ this.treeContext = e;
2292
2299
  }
2293
- shouldRemainOpen(t) {
2294
- return t ? this.isFocusWithinNodeHierarchy(this.treeContext, t) : !1;
2300
+ shouldRemainOpen(e) {
2301
+ return e ? this.isFocusWithinNodeHierarchy(this.treeContext, e) : !1;
2295
2302
  }
2296
2303
  /**
2297
2304
  * Returns a list of ancestors (starting from the immediate parent upward) that do not
2298
2305
  * contain the provided target within their subtree. Useful for closing ancestors when
2299
2306
  * focus moves outside the current branch.
2300
2307
  */
2301
- getAncestorsToClose(t) {
2308
+ getAncestorsToClose(e) {
2302
2309
  const n = [];
2303
2310
  let o = this.treeContext.parent.value;
2304
2311
  for (; o; ) {
2305
- if (!this.isFocusWithinNodeHierarchy(o, t)) {
2312
+ if (!this.isFocusWithinNodeHierarchy(o, e)) {
2306
2313
  n.push(o), o = o.parent.value;
2307
2314
  continue;
2308
2315
  }
@@ -2310,410 +2317,1204 @@ class bo {
2310
2317
  }
2311
2318
  return n;
2312
2319
  }
2313
- isFocusWithinNodeHierarchy(t, n) {
2314
- return q(n, t.data.refs.anchorEl.value) || q(n, t.data.refs.floatingEl.value) ? !0 : this.findDescendantContainingFocus(t, n) !== null;
2320
+ isFocusWithinNodeHierarchy(e, n) {
2321
+ return ue(n, e.data.refs.anchorEl.value) || ue(n, e.data.refs.floatingEl.value) ? !0 : this.findDescendantContainingFocus(e, n) !== null;
2315
2322
  }
2316
- findDescendantContainingFocus(t, n) {
2317
- for (const o of t.children.value)
2323
+ findDescendantContainingFocus(e, n) {
2324
+ for (const o of e.children.value)
2318
2325
  if (o.data.open.value) {
2319
- if (q(n, o.data.refs.anchorEl.value) || q(n, o.data.refs.floatingEl.value))
2326
+ if (ue(n, o.data.refs.anchorEl.value) || ue(n, o.data.refs.floatingEl.value))
2320
2327
  return o;
2321
- const i = this.findDescendantContainingFocus(o, n);
2322
- if (i) return i;
2328
+ const r = this.findDescendantContainingFocus(o, n);
2329
+ if (r) return r;
2323
2330
  }
2324
2331
  return null;
2325
2332
  }
2326
2333
  }
2327
- function Yt(e) {
2328
- return e.children.value.some(
2329
- (t) => t.data.open.value || Yt(t)
2334
+ function dn(t) {
2335
+ return t.children.value.some(
2336
+ (e) => e.data.open.value || dn(e)
2330
2337
  );
2331
2338
  }
2332
- function xo(e, t) {
2333
- return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
2334
- }
2335
- function Ot(e, t) {
2336
- const [n, o] = e;
2337
- let i = !1;
2338
- const c = t.length;
2339
- for (let r = 0, a = c - 1; r < c; a = r++) {
2340
- const [d, s] = t[r] || [0, 0], [f, u] = t[a] || [0, 0];
2341
- s >= o != u >= o && n <= (f - d) * (o - s) / (u - s) + d && (i = !i);
2342
- }
2343
- return i;
2344
- }
2345
- function Eo(e = {}) {
2346
- const { blockPointerEvents: t = !1, requireIntent: n = !0 } = e;
2347
- let o = -1, i = !1;
2348
- function c(a, d, s, f, u) {
2349
- const m = ut(), h = m - u;
2350
- if (s === null || f === null || h === 0)
2339
+ function Yo(t, e) {
2340
+ return t[0] >= e.x && t[0] <= e.x + e.width && t[1] >= e.y && t[1] <= e.y + e.height;
2341
+ }
2342
+ function Kt(t, e) {
2343
+ const [n, o] = t;
2344
+ let r = !1;
2345
+ const l = e.length;
2346
+ for (let i = 0, a = l - 1; i < l; a = i++) {
2347
+ const [d, s] = e[i] || [0, 0], [f, u] = e[a] || [0, 0];
2348
+ s >= o != u >= o && n <= (f - d) * (o - s) / (u - s) + d && (r = !r);
2349
+ }
2350
+ return r;
2351
+ }
2352
+ function Uo(t = {}) {
2353
+ const { blockPointerEvents: e = !1, requireIntent: n = !0 } = t;
2354
+ let o = -1, r = !1;
2355
+ function l(a, d, s, f, u) {
2356
+ const h = Ot(), v = h - u;
2357
+ if (s === null || f === null || v === 0)
2351
2358
  return {
2352
2359
  speed: null,
2353
2360
  lastX: a,
2354
2361
  lastY: d,
2355
- lastCursorTime: m
2362
+ lastCursorTime: h
2356
2363
  };
2357
- const p = a - s, g = d - f;
2364
+ const g = a - s, w = d - f;
2358
2365
  return {
2359
- speed: Math.sqrt(p * p + g * g) / h,
2366
+ speed: Math.sqrt(g * g + w * w) / v,
2360
2367
  lastX: a,
2361
2368
  lastY: d,
2362
- lastCursorTime: m
2369
+ lastCursorTime: h
2363
2370
  };
2364
2371
  }
2365
- const r = function(d) {
2366
- const { x: s, y: f, placement: u, elements: m, buffer: h, onClose: p, nodeId: g, tree: v } = d, x = N(() => {
2367
- const S = m.domReference;
2368
- return Ye(S) ? S : (S == null ? void 0 : S.contextElement) ?? null;
2372
+ const i = function(d) {
2373
+ const { x: s, y: f, placement: u, elements: h, buffer: v, onClose: g, nodeId: w, tree: m } = d, p = F(() => {
2374
+ const D = h.domReference;
2375
+ return Xe(D) ? D : (D == null ? void 0 : D.contextElement) ?? null;
2369
2376
  });
2370
- let b = null, E = null, P = ut();
2371
- return function(y) {
2372
- var Ae, tt, nt, ot, it, rt, st;
2373
- function O() {
2374
- ft(o), o = -1, p();
2377
+ let y = null, L = null, R = Ot();
2378
+ return function(E) {
2379
+ var we, ke, Ae, Se, He, O, M;
2380
+ function P() {
2381
+ Lt(o), o = -1, g();
2375
2382
  }
2376
- if (ft(o), o = -1, !m.domReference || !m.floating || u == null || s == null || f == null)
2383
+ if (Lt(o), o = -1, !h.domReference || !h.floating || u == null || s == null || f == null)
2377
2384
  return;
2378
- const { clientX: M, clientY: R } = y, A = [M, R], k = sn(y), F = y.type === "mouseleave", $ = m.floating && $e(m.floating, k), H = x.value && $e(x.value, k), C = (Ae = x.value) == null ? void 0 : Ae.getBoundingClientRect(), l = (tt = m.floating) == null ? void 0 : tt.getBoundingClientRect(), I = u.split("-")[0], w = s > ((l == null ? void 0 : l.right) ?? 0) - ((l == null ? void 0 : l.width) ?? 0) / 2, B = f > ((l == null ? void 0 : l.bottom) ?? 0) - ((l == null ? void 0 : l.height) ?? 0) / 2, oe = C ? xo(A, C) : !1, _ = ((l == null ? void 0 : l.width) ?? 0) > ((C == null ? void 0 : C.width) ?? 0), T = ((l == null ? void 0 : l.height) ?? 0) > ((C == null ? void 0 : C.height) ?? 0), V = ((nt = _ ? C : l) == null ? void 0 : nt.left) ?? 0, ue = ((ot = _ ? C : l) == null ? void 0 : ot.right) ?? 0, z = ((it = T ? C : l) == null ? void 0 : it.top) ?? 0, fe = ((rt = T ? C : l) == null ? void 0 : rt.bottom) ?? 0;
2379
- if ($ && (i = !0, !F))
2385
+ const { clientX: z, clientY: k } = E, N = [z, k], W = Pn(E), Y = E.type === "mouseleave", X = h.floating && ut(h.floating, W), $ = p.value && ut(p.value, W), C = (we = p.value) == null ? void 0 : we.getBoundingClientRect(), c = (ke = h.floating) == null ? void 0 : ke.getBoundingClientRect(), V = u.split("-")[0], b = s > ((c == null ? void 0 : c.right) ?? 0) - ((c == null ? void 0 : c.width) ?? 0) / 2, U = f > ((c == null ? void 0 : c.bottom) ?? 0) - ((c == null ? void 0 : c.height) ?? 0) / 2, te = C ? Yo(N, C) : !1, J = ((c == null ? void 0 : c.width) ?? 0) > ((C == null ? void 0 : C.width) ?? 0), S = ((c == null ? void 0 : c.height) ?? 0) > ((C == null ? void 0 : C.height) ?? 0), j = ((Ae = J ? C : c) == null ? void 0 : Ae.left) ?? 0, he = ((Se = J ? C : c) == null ? void 0 : Se.right) ?? 0, oe = ((He = S ? C : c) == null ? void 0 : He.top) ?? 0, ve = ((O = S ? C : c) == null ? void 0 : O.bottom) ?? 0;
2386
+ if (X && (r = !0, !Y))
2380
2387
  return;
2381
- if (H && (i = !1), H && !F) {
2382
- i = !0;
2388
+ if ($ && (r = !1), $ && !Y) {
2389
+ r = !0;
2383
2390
  return;
2384
2391
  }
2385
- if (F && Ye(y.relatedTarget) && m.floating && $e(m.floating, y.relatedTarget))
2392
+ if (Y && Xe(E.relatedTarget) && h.floating && ut(h.floating, E.relatedTarget))
2386
2393
  return;
2387
- if (v && g) {
2388
- const W = v.nodes.get(g);
2389
- if (W && Yt(W))
2394
+ if (m && w) {
2395
+ const I = m.nodes.get(w);
2396
+ if (I && dn(I))
2390
2397
  return;
2391
2398
  }
2392
- if (I === "top" && f >= ((C == null ? void 0 : C.bottom) ?? 0) - 1 || I === "bottom" && f <= ((C == null ? void 0 : C.top) ?? 0) + 1 || I === "left" && s >= ((C == null ? void 0 : C.right) ?? 0) - 1 || I === "right" && s <= ((C == null ? void 0 : C.left) ?? 0) + 1)
2393
- return O();
2394
- let re = [];
2395
- switch (I) {
2399
+ if (V === "top" && f >= ((C == null ? void 0 : C.bottom) ?? 0) - 1 || V === "bottom" && f <= ((C == null ? void 0 : C.top) ?? 0) + 1 || V === "left" && s >= ((C == null ? void 0 : C.right) ?? 0) - 1 || V === "right" && s <= ((C == null ? void 0 : C.left) ?? 0) + 1)
2400
+ return P();
2401
+ let se = [];
2402
+ switch (V) {
2396
2403
  case "top":
2397
- re = [
2398
- [V, ((C == null ? void 0 : C.top) ?? 0) + 1],
2399
- [V, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
2400
- [ue, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
2401
- [ue, ((C == null ? void 0 : C.top) ?? 0) + 1]
2404
+ se = [
2405
+ [j, ((C == null ? void 0 : C.top) ?? 0) + 1],
2406
+ [j, ((c == null ? void 0 : c.bottom) ?? 0) - 1],
2407
+ [he, ((c == null ? void 0 : c.bottom) ?? 0) - 1],
2408
+ [he, ((C == null ? void 0 : C.top) ?? 0) + 1]
2402
2409
  ];
2403
2410
  break;
2404
2411
  case "bottom":
2405
- re = [
2406
- [V, ((l == null ? void 0 : l.top) ?? 0) + 1],
2407
- [V, ((C == null ? void 0 : C.bottom) ?? 0) - 1],
2408
- [ue, ((C == null ? void 0 : C.bottom) ?? 0) - 1],
2409
- [ue, ((l == null ? void 0 : l.top) ?? 0) + 1]
2412
+ se = [
2413
+ [j, ((c == null ? void 0 : c.top) ?? 0) + 1],
2414
+ [j, ((C == null ? void 0 : C.bottom) ?? 0) - 1],
2415
+ [he, ((C == null ? void 0 : C.bottom) ?? 0) - 1],
2416
+ [he, ((c == null ? void 0 : c.top) ?? 0) + 1]
2410
2417
  ];
2411
2418
  break;
2412
2419
  case "left":
2413
- re = [
2414
- [((l == null ? void 0 : l.right) ?? 0) - 1, fe],
2415
- [((l == null ? void 0 : l.right) ?? 0) - 1, z],
2416
- [((C == null ? void 0 : C.left) ?? 0) + 1, z],
2417
- [((C == null ? void 0 : C.left) ?? 0) + 1, fe]
2420
+ se = [
2421
+ [((c == null ? void 0 : c.right) ?? 0) - 1, ve],
2422
+ [((c == null ? void 0 : c.right) ?? 0) - 1, oe],
2423
+ [((C == null ? void 0 : C.left) ?? 0) + 1, oe],
2424
+ [((C == null ? void 0 : C.left) ?? 0) + 1, ve]
2418
2425
  ];
2419
2426
  break;
2420
2427
  case "right":
2421
- re = [
2422
- [((C == null ? void 0 : C.right) ?? 0) - 1, fe],
2423
- [((C == null ? void 0 : C.right) ?? 0) - 1, z],
2424
- [((l == null ? void 0 : l.left) ?? 0) + 1, z],
2425
- [((l == null ? void 0 : l.left) ?? 0) + 1, fe]
2428
+ se = [
2429
+ [((C == null ? void 0 : C.right) ?? 0) - 1, ve],
2430
+ [((C == null ? void 0 : C.right) ?? 0) - 1, oe],
2431
+ [((c == null ? void 0 : c.left) ?? 0) + 1, oe],
2432
+ [((c == null ? void 0 : c.left) ?? 0) + 1, ve]
2426
2433
  ];
2427
2434
  break;
2428
2435
  }
2429
- function Le([W, X]) {
2430
- const L = h;
2431
- switch (I) {
2436
+ function re([I, K]) {
2437
+ const A = v;
2438
+ switch (V) {
2432
2439
  case "top": {
2433
- const de = [
2434
- _ ? W + L / 2 : w ? W + L * 4 : W - L * 4,
2435
- X + L + 1
2436
- ], he = [
2437
- _ ? W - L / 2 : w ? W + L * 4 : W - L * 4,
2438
- X + L + 1
2439
- ], we = [
2440
+ const q = [
2441
+ J ? I + A / 2 : b ? I + A * 4 : I - A * 4,
2442
+ K + A + 1
2443
+ ], ee = [
2444
+ J ? I - A / 2 : b ? I + A * 4 : I - A * 4,
2445
+ K + A + 1
2446
+ ], Q = [
2440
2447
  [
2441
- (l == null ? void 0 : l.left) ?? 0,
2442
- w || _ ? ((l == null ? void 0 : l.bottom) ?? 0) - L : (l == null ? void 0 : l.top) ?? 0
2448
+ (c == null ? void 0 : c.left) ?? 0,
2449
+ b || J ? ((c == null ? void 0 : c.bottom) ?? 0) - A : (c == null ? void 0 : c.top) ?? 0
2443
2450
  ],
2444
2451
  [
2445
- (l == null ? void 0 : l.right) ?? 0,
2446
- w ? _ ? ((l == null ? void 0 : l.bottom) ?? 0) - L : (l == null ? void 0 : l.top) ?? 0 : ((l == null ? void 0 : l.bottom) ?? 0) - L
2452
+ (c == null ? void 0 : c.right) ?? 0,
2453
+ b ? J ? ((c == null ? void 0 : c.bottom) ?? 0) - A : (c == null ? void 0 : c.top) ?? 0 : ((c == null ? void 0 : c.bottom) ?? 0) - A
2447
2454
  ]
2448
2455
  ];
2449
- return [de, he, ...we];
2456
+ return [q, ee, ...Q];
2450
2457
  }
2451
2458
  case "bottom": {
2452
- const de = [
2453
- _ ? W + L / 2 : w ? W + L * 4 : W - L * 4,
2454
- X - L
2455
- ], he = [
2456
- _ ? W - L / 2 : w ? W + L * 4 : W - L * 4,
2457
- X - L
2458
- ], we = [
2459
+ const q = [
2460
+ J ? I + A / 2 : b ? I + A * 4 : I - A * 4,
2461
+ K - A
2462
+ ], ee = [
2463
+ J ? I - A / 2 : b ? I + A * 4 : I - A * 4,
2464
+ K - A
2465
+ ], Q = [
2459
2466
  [
2460
- (l == null ? void 0 : l.left) ?? 0,
2461
- w || _ ? ((l == null ? void 0 : l.top) ?? 0) + L : (l == null ? void 0 : l.bottom) ?? 0
2467
+ (c == null ? void 0 : c.left) ?? 0,
2468
+ b || J ? ((c == null ? void 0 : c.top) ?? 0) + A : (c == null ? void 0 : c.bottom) ?? 0
2462
2469
  ],
2463
2470
  [
2464
- (l == null ? void 0 : l.right) ?? 0,
2465
- w ? _ ? ((l == null ? void 0 : l.top) ?? 0) + L : (l == null ? void 0 : l.bottom) ?? 0 : ((l == null ? void 0 : l.top) ?? 0) + L
2471
+ (c == null ? void 0 : c.right) ?? 0,
2472
+ b ? J ? ((c == null ? void 0 : c.top) ?? 0) + A : (c == null ? void 0 : c.bottom) ?? 0 : ((c == null ? void 0 : c.top) ?? 0) + A
2466
2473
  ]
2467
2474
  ];
2468
- return [de, he, ...we];
2475
+ return [q, ee, ...Q];
2469
2476
  }
2470
2477
  case "left": {
2471
- const de = [
2472
- W + L + 1,
2473
- T ? X + L / 2 : B ? X + L * 4 : X - L * 4
2474
- ], he = [
2475
- W + L + 1,
2476
- T ? X - L / 2 : B ? X + L * 4 : X - L * 4
2478
+ const q = [
2479
+ I + A + 1,
2480
+ S ? K + A / 2 : U ? K + A * 4 : K - A * 4
2481
+ ], ee = [
2482
+ I + A + 1,
2483
+ S ? K - A / 2 : U ? K + A * 4 : K - A * 4
2477
2484
  ];
2478
2485
  return [...[
2479
2486
  [
2480
- B || T ? ((l == null ? void 0 : l.right) ?? 0) - L : (l == null ? void 0 : l.left) ?? 0,
2481
- (l == null ? void 0 : l.top) ?? 0
2487
+ U || S ? ((c == null ? void 0 : c.right) ?? 0) - A : (c == null ? void 0 : c.left) ?? 0,
2488
+ (c == null ? void 0 : c.top) ?? 0
2482
2489
  ],
2483
2490
  [
2484
- B ? T ? ((l == null ? void 0 : l.right) ?? 0) - L : (l == null ? void 0 : l.left) ?? 0 : ((l == null ? void 0 : l.right) ?? 0) - L,
2485
- (l == null ? void 0 : l.bottom) ?? 0
2491
+ U ? S ? ((c == null ? void 0 : c.right) ?? 0) - A : (c == null ? void 0 : c.left) ?? 0 : ((c == null ? void 0 : c.right) ?? 0) - A,
2492
+ (c == null ? void 0 : c.bottom) ?? 0
2486
2493
  ]
2487
- ], de, he];
2494
+ ], q, ee];
2488
2495
  }
2489
2496
  case "right": {
2490
- const de = [
2491
- W - L,
2492
- T ? X + L / 2 : B ? X + L * 4 : X - L * 4
2493
- ], he = [
2494
- W - L,
2495
- T ? X - L / 2 : B ? X + L * 4 : X - L * 4
2496
- ], we = [
2497
+ const q = [
2498
+ I - A,
2499
+ S ? K + A / 2 : U ? K + A * 4 : K - A * 4
2500
+ ], ee = [
2501
+ I - A,
2502
+ S ? K - A / 2 : U ? K + A * 4 : K - A * 4
2503
+ ], Q = [
2497
2504
  [
2498
- B || T ? ((l == null ? void 0 : l.left) ?? 0) + L : (l == null ? void 0 : l.right) ?? 0,
2499
- (l == null ? void 0 : l.top) ?? 0
2505
+ U || S ? ((c == null ? void 0 : c.left) ?? 0) + A : (c == null ? void 0 : c.right) ?? 0,
2506
+ (c == null ? void 0 : c.top) ?? 0
2500
2507
  ],
2501
2508
  [
2502
- B ? T ? ((l == null ? void 0 : l.left) ?? 0) + L : (l == null ? void 0 : l.right) ?? 0 : ((l == null ? void 0 : l.left) ?? 0) + L,
2503
- (l == null ? void 0 : l.bottom) ?? 0
2509
+ U ? S ? ((c == null ? void 0 : c.left) ?? 0) + A : (c == null ? void 0 : c.right) ?? 0 : ((c == null ? void 0 : c.left) ?? 0) + A,
2510
+ (c == null ? void 0 : c.bottom) ?? 0
2504
2511
  ]
2505
2512
  ];
2506
- return [de, he, ...we];
2513
+ return [q, ee, ...Q];
2507
2514
  }
2508
2515
  }
2509
2516
  }
2510
- const ge = Le([s, f]);
2511
- if ((st = e.onPolygonChange) == null || st.call(e, ge), !Ot(A, re)) {
2512
- if (Ot(A, ge)) {
2513
- if (!i && n) {
2514
- const W = c(
2515
- y.clientX,
2516
- y.clientY,
2517
- b,
2518
- E,
2519
- P
2517
+ const fe = re([s, f]);
2518
+ if ((M = t.onPolygonChange) == null || M.call(t, fe), !Kt(N, se)) {
2519
+ if (Kt(N, fe)) {
2520
+ if (!r && n) {
2521
+ const I = l(
2522
+ E.clientX,
2523
+ E.clientY,
2524
+ y,
2525
+ L,
2526
+ R
2520
2527
  );
2521
- b = W.lastX, E = W.lastY, P = W.lastCursorTime, W.speed !== null && W.speed < 0.1 && (o = window.setTimeout(O, 40));
2528
+ y = I.lastX, L = I.lastY, R = I.lastCursorTime, I.speed !== null && I.speed < 0.1 && (o = window.setTimeout(P, 40));
2522
2529
  }
2523
2530
  return;
2524
2531
  }
2525
- if (i && !oe)
2526
- return O();
2527
- O();
2532
+ if (r && !te)
2533
+ return P();
2534
+ P();
2528
2535
  }
2529
2536
  };
2530
2537
  };
2531
- return r.__options = {
2532
- blockPointerEvents: t
2533
- }, r;
2534
- }
2535
- const Pt = 10;
2536
- function Co(e, t, n) {
2537
- const { delay: o } = n, i = N(() => {
2538
- const s = D(o);
2538
+ return i.__options = {
2539
+ blockPointerEvents: e
2540
+ }, i;
2541
+ }
2542
+ const zt = 10;
2543
+ function _o(t, e, n) {
2544
+ const { delay: o } = n, r = F(() => {
2545
+ const s = T(o);
2539
2546
  return (typeof s == "number" ? s : s.open) ?? 0;
2540
- }), c = N(() => {
2541
- const s = D(o);
2547
+ }), l = F(() => {
2548
+ const s = T(o);
2542
2549
  return (typeof s == "number" ? s : s.close) ?? 0;
2543
2550
  });
2544
- let r, a;
2551
+ let i, a;
2545
2552
  const d = () => {
2546
- clearTimeout(r), clearTimeout(a);
2553
+ clearTimeout(i), clearTimeout(a);
2547
2554
  };
2548
- return xe(d), {
2555
+ return Ie(d), {
2549
2556
  show: (s, f) => {
2550
2557
  d();
2551
- const u = s ?? i.value;
2552
- u === 0 ? e(f) : r = setTimeout(() => e(f), u);
2558
+ const u = s ?? r.value;
2559
+ u === 0 ? t(f) : i = setTimeout(() => t(f), u);
2553
2560
  },
2554
2561
  hide: (s, f) => {
2555
2562
  d();
2556
- const u = s ?? c.value;
2557
- u === 0 ? t(f) : a = setTimeout(() => t(f), u);
2563
+ const u = s ?? l.value;
2564
+ u === 0 ? e(f) : a = setTimeout(() => e(f), u);
2558
2565
  },
2559
- showDelay: i,
2560
- hideDelay: c,
2566
+ showDelay: r,
2567
+ hideDelay: l,
2561
2568
  clearTimeouts: d
2562
2569
  };
2563
2570
  }
2564
- function Wo(e, t = {}) {
2565
- const { floatingContext: n, treeContext: o } = Ke(e), {
2566
- open: i,
2567
- setOpen: c,
2568
- refs: { anchorEl: r, floatingEl: a }
2571
+ function Dr(t, e = {}) {
2572
+ const { floatingContext: n, treeContext: o } = je(t), {
2573
+ open: r,
2574
+ setOpen: l,
2575
+ refs: { anchorEl: i, floatingEl: a }
2569
2576
  } = n, {
2570
2577
  enabled: d = !0,
2571
2578
  delay: s = 0,
2572
2579
  restMs: f = 0,
2573
2580
  mouseOnly: u = !1,
2574
- safePolygon: m = !1
2575
- } = t, h = N(() => D(d)), p = N(() => D(f)), g = N(() => {
2576
- const w = r.value;
2577
- return !w || w instanceof HTMLElement ? w : w.contextElement ?? null;
2578
- }), { hide: v, show: x, showDelay: b, clearTimeouts: E } = Co(
2579
- (w) => {
2580
- i.value || c(!0, "hover", w);
2581
+ safePolygon: h = !1
2582
+ } = e, v = F(() => T(d)), g = F(() => T(f)), w = F(() => {
2583
+ const b = i.value;
2584
+ return !b || b instanceof HTMLElement ? b : b.contextElement ?? null;
2585
+ }), { hide: m, show: p, showDelay: y, clearTimeouts: L } = _o(
2586
+ (b) => {
2587
+ r.value || l(!0, "hover", b);
2581
2588
  },
2582
- (w) => {
2583
- i.value && c(!1, "hover", w);
2589
+ (b) => {
2590
+ r.value && l(!1, "hover", b);
2584
2591
  },
2585
2592
  { delay: s }
2586
2593
  );
2587
- let P = null, S;
2588
- const y = N(() => b.value === 0 && p.value > 0);
2589
- function O(w) {
2590
- if (!h.value || !A(w) || !y.value || !P) return;
2591
- const B = { x: w.clientX, y: w.clientY }, oe = Math.abs(B.x - P.x), _ = Math.abs(B.y - P.y);
2592
- (oe > Pt || _ > Pt) && (P = B, clearTimeout(S), S = setTimeout(() => {
2593
- x(0, w);
2594
- }, p.value));
2595
- }
2596
- function M(w) {
2597
- !h.value || !A(w) || !y.value || (P = { x: w.clientX, y: w.clientY }, S = setTimeout(() => {
2598
- x(0, w);
2599
- }, p.value));
2600
- }
2601
- function R() {
2602
- clearTimeout(S), P = null;
2603
- }
2604
- Oe(() => {
2605
- const w = g.value;
2606
- !w || !h.value || !y.value || (w.addEventListener("pointerenter", M), w.addEventListener("pointermove", O), w.addEventListener("pointerleave", R), pe(() => {
2607
- w.removeEventListener("pointerenter", M), w.removeEventListener("pointermove", O), w.removeEventListener("pointerleave", R);
2594
+ let R = null, D;
2595
+ const E = F(() => y.value === 0 && g.value > 0);
2596
+ function P(b) {
2597
+ if (!v.value || !N(b) || !E.value || !R) return;
2598
+ const U = { x: b.clientX, y: b.clientY }, te = Math.abs(U.x - R.x), J = Math.abs(U.y - R.y);
2599
+ (te > zt || J > zt) && (R = U, clearTimeout(D), D = setTimeout(() => {
2600
+ p(0, b);
2601
+ }, g.value));
2602
+ }
2603
+ function z(b) {
2604
+ !v.value || !N(b) || !E.value || (R = { x: b.clientX, y: b.clientY }, D = setTimeout(() => {
2605
+ p(0, b);
2606
+ }, g.value));
2607
+ }
2608
+ function k() {
2609
+ clearTimeout(D), R = null;
2610
+ }
2611
+ Me(() => {
2612
+ const b = w.value;
2613
+ !b || !v.value || !E.value || (b.addEventListener("pointerenter", z), b.addEventListener("pointermove", P), b.addEventListener("pointerleave", k), Te(() => {
2614
+ b.removeEventListener("pointerenter", z), b.removeEventListener("pointermove", P), b.removeEventListener("pointerleave", k);
2608
2615
  }));
2609
- }), xe(() => {
2610
- clearTimeout(S);
2616
+ }), Ie(() => {
2617
+ clearTimeout(D);
2611
2618
  });
2612
- function A(w) {
2613
- return D(u) ? w.pointerType === "mouse" : !0;
2619
+ function N(b) {
2620
+ return T(u) ? b.pointerType === "mouse" : !0;
2614
2621
  }
2615
- function k(w) {
2616
- !h.value || !A(w) || y.value || (H(), x(void 0, w));
2622
+ function W(b) {
2623
+ !v.value || !N(b) || E.value || ($(), p(void 0, b));
2617
2624
  }
2618
- function F(w) {
2619
- !h.value || !A(w) || (E(), H());
2625
+ function Y(b) {
2626
+ !v.value || !N(b) || (L(), $());
2620
2627
  }
2621
- let $ = null;
2622
- function H() {
2623
- $ && (document.removeEventListener("pointermove", $), $ = null);
2624
- const w = l.value;
2625
- w != null && w.onPolygonChange && w.onPolygonChange([]);
2628
+ let X = null;
2629
+ function $() {
2630
+ X && (document.removeEventListener("pointermove", X), X = null);
2631
+ const b = c.value;
2632
+ b != null && b.onPolygonChange && b.onPolygonChange([]);
2626
2633
  }
2627
- const C = N(() => !!D(m)), l = N(() => {
2628
- const w = D(m);
2629
- if (typeof w == "object" && w) return w;
2630
- if (w === !0) return {};
2634
+ const C = F(() => !!T(h)), c = F(() => {
2635
+ const b = T(h);
2636
+ if (typeof b == "object" && b) return b;
2637
+ if (b === !0) return {};
2631
2638
  });
2632
- function I(w) {
2633
- var T;
2634
- if (!h.value || !A(w)) return;
2635
- const { clientX: B, clientY: oe } = w, _ = w.relatedTarget;
2639
+ function V(b) {
2640
+ var S;
2641
+ if (!v.value || !N(b)) return;
2642
+ const { clientX: U, clientY: te } = b, J = b.relatedTarget;
2636
2643
  if (C.value)
2637
2644
  setTimeout(() => {
2638
- var re;
2639
- H();
2640
- const V = g.value, ue = a.value;
2641
- if (!V || !ue) {
2642
- v(void 0, w);
2645
+ var se;
2646
+ $();
2647
+ const j = w.value, he = a.value;
2648
+ if (!j || !he) {
2649
+ m(void 0, b);
2643
2650
  return;
2644
2651
  }
2645
- let z, fe;
2652
+ let oe, ve;
2646
2653
  if (o) {
2647
- z = /* @__PURE__ */ new Map();
2648
- const Le = (ge) => {
2649
- z == null || z.set(ge.id, ge);
2650
- for (const Ae of ge.children.value)
2651
- Le(Ae);
2654
+ oe = /* @__PURE__ */ new Map();
2655
+ const re = (fe) => {
2656
+ oe == null || oe.set(fe.id, fe);
2657
+ for (const we of fe.children.value)
2658
+ re(we);
2652
2659
  };
2653
- Le(o), fe = o.id;
2660
+ re(o), ve = o.id;
2654
2661
  }
2655
- $ = Eo(l.value)({
2656
- x: B,
2657
- y: oe,
2662
+ X = Uo(c.value)({
2663
+ x: U,
2664
+ y: te,
2658
2665
  placement: n.placement.value,
2659
2666
  elements: {
2660
- domReference: V,
2661
- floating: ue
2667
+ domReference: j,
2668
+ floating: he
2662
2669
  },
2663
- buffer: ((re = l.value) == null ? void 0 : re.buffer) ?? 1,
2670
+ buffer: ((se = c.value) == null ? void 0 : se.buffer) ?? 1,
2664
2671
  onClose: () => {
2665
- H(), v(void 0);
2672
+ $(), m(void 0);
2666
2673
  },
2667
- nodeId: fe,
2668
- tree: z ? { nodes: z } : void 0
2669
- }), $ && document.addEventListener("pointermove", $);
2674
+ nodeId: ve,
2675
+ tree: oe ? { nodes: oe } : void 0
2676
+ }), X && document.addEventListener("pointermove", X);
2670
2677
  }, 0);
2671
2678
  else {
2672
2679
  if (o) {
2673
- if (!To(o, _))
2680
+ if (!jo(o, J))
2674
2681
  return;
2675
- } else if ((T = a.value) != null && T.contains(_))
2682
+ } else if ((S = a.value) != null && S.contains(J))
2676
2683
  return;
2677
- v(void 0, w);
2684
+ m(void 0, b);
2678
2685
  }
2679
2686
  }
2680
- Oe(() => {
2681
- const w = g.value;
2682
- !w || !h.value || (w.addEventListener("pointerenter", k), w.addEventListener("pointerleave", I), pe(() => {
2683
- w.removeEventListener("pointerenter", k), w.removeEventListener("pointerleave", I);
2687
+ Me(() => {
2688
+ const b = w.value;
2689
+ !b || !v.value || (b.addEventListener("pointerenter", W), b.addEventListener("pointerleave", V), Te(() => {
2690
+ b.removeEventListener("pointerenter", W), b.removeEventListener("pointerleave", V);
2684
2691
  }));
2685
- }), Oe(() => {
2686
- const w = a.value;
2687
- !w || !h.value || (w.addEventListener("pointerenter", F), w.addEventListener("pointerleave", I), pe(() => {
2688
- w.removeEventListener("pointerenter", F), w.removeEventListener("pointerleave", I);
2692
+ }), Me(() => {
2693
+ const b = a.value;
2694
+ !b || !v.value || (b.addEventListener("pointerenter", Y), b.addEventListener("pointerleave", V), Te(() => {
2695
+ b.removeEventListener("pointerenter", Y), b.removeEventListener("pointerleave", V);
2689
2696
  }));
2690
- }), xe(() => {
2691
- H();
2697
+ }), Ie(() => {
2698
+ $();
2692
2699
  });
2693
2700
  }
2694
- function To(e, t) {
2695
- return t ? !(q(t, e.data.refs.anchorEl.value) || q(t, e.data.refs.floatingEl.value) || qe(e, t)) : !0;
2701
+ function jo(t, e) {
2702
+ return e ? !(ue(e, t.data.refs.anchorEl.value) || ue(e, t.data.refs.floatingEl.value) || rt(t, e)) : !0;
2703
+ }
2704
+ function qo(t, e, n, o) {
2705
+ const r = F(() => !!T(o.virtual));
2706
+ de(
2707
+ [r, o.open, F(() => T(n))],
2708
+ ([l, i, a]) => {
2709
+ const d = t.value;
2710
+ if (!d) return;
2711
+ if (!l || !i || a == null) {
2712
+ d.removeAttribute("aria-activedescendant");
2713
+ return;
2714
+ }
2715
+ const s = e.value[a];
2716
+ s && (s.id || (s.id = `vfloat-option-${Math.random().toString(16).slice(2, 10)}`), d.setAttribute("aria-activedescendant", s.id), o.virtualItemRef && (o.virtualItemRef.value = s));
2717
+ }
2718
+ );
2719
+ }
2720
+ function Ne(t, e, n) {
2721
+ const {
2722
+ items: o,
2723
+ loop: r,
2724
+ allowEscape: l,
2725
+ isVirtual: i,
2726
+ findNextEnabled: a,
2727
+ getFirstEnabledIndex: d,
2728
+ getLastEnabledIndex: s
2729
+ } = n, f = o.length, u = t == null ? e === 1 ? 0 : f - 1 : t + e;
2730
+ let h = a(u, e, r);
2731
+ if (h == null && r) {
2732
+ if (l && i)
2733
+ return { type: "navigate", index: null };
2734
+ h = e === 1 ? d() : s();
2735
+ }
2736
+ return h != null ? { type: "navigate", index: h } : null;
2737
+ }
2738
+ class Go {
2739
+ handleKey(e, n) {
2740
+ const { isRtl: o, nested: r } = n;
2741
+ return e === "ArrowDown" ? Ne(n.current, 1, n) : e === "ArrowUp" ? Ne(n.current, -1, n) : r && e === (o ? "ArrowRight" : "ArrowLeft") ? { type: "close" } : null;
2742
+ }
2743
+ }
2744
+ class Zo {
2745
+ handleKey(e, n) {
2746
+ const { isRtl: o, nested: r } = n;
2747
+ return e === "ArrowRight" ? Ne(n.current, o ? -1 : 1, n) : e === "ArrowLeft" ? Ne(n.current, o ? 1 : -1, n) : r && e === "ArrowUp" ? { type: "close" } : null;
2748
+ }
2749
+ }
2750
+ class Xt {
2751
+ constructor(e = !1, n = "row") {
2752
+ this.fallbackToLinear = e, this.loopDirection = n;
2753
+ }
2754
+ handleKey(e, n) {
2755
+ const {
2756
+ current: o,
2757
+ items: r,
2758
+ isDisabled: l,
2759
+ loop: i,
2760
+ allowEscape: a,
2761
+ isVirtual: d,
2762
+ getFirstEnabledIndex: s,
2763
+ getLastEnabledIndex: f,
2764
+ cols: u
2765
+ } = n;
2766
+ if (e === "ArrowRight" || e === "ArrowLeft") {
2767
+ const h = e === "ArrowRight" ? 1 : -1;
2768
+ if (o === null)
2769
+ return Ne(o, h, n);
2770
+ const v = o + h, g = Math.floor(o / u), w = Math.floor(v / u);
2771
+ if (v >= 0 && v < r.length && g === w && !l(v))
2772
+ return { type: "navigate", index: v };
2773
+ if (i) {
2774
+ if (a && d) {
2775
+ const p = o === 0, y = o === r.length - 1;
2776
+ if (h === -1 && p || h === 1 && y)
2777
+ return { type: "navigate", index: null };
2778
+ }
2779
+ let m;
2780
+ if (this.loopDirection === "next" ? h === 1 ? (m = o + 1, m >= r.length && (m = 0)) : (m = o - 1, m < 0 && (m = r.length - 1)) : h === 1 ? m = g * u : m = Math.min((g + 1) * u - 1, r.length - 1), this.loopDirection === "next") {
2781
+ let p = m;
2782
+ for (let y = 0; y < r.length; y++) {
2783
+ if (!l(p))
2784
+ return { type: "navigate", index: p };
2785
+ if (p += h, p >= r.length && (p = 0), p < 0 && (p = r.length - 1), p === m) break;
2786
+ }
2787
+ } else {
2788
+ const p = h, y = g * u, L = Math.min((g + 1) * u - 1, r.length - 1);
2789
+ for (; m >= y && m <= L; ) {
2790
+ if (!l(m))
2791
+ return { type: "navigate", index: m };
2792
+ if (m += p, m < y || m > L) break;
2793
+ }
2794
+ }
2795
+ }
2796
+ return Ne(o, h, n);
2797
+ }
2798
+ if (e === "ArrowDown" || e === "ArrowUp") {
2799
+ if (u <= 1) return null;
2800
+ const h = e === "ArrowDown" ? u : -u, v = h > 0 ? u : -u;
2801
+ let w = (o ?? (h > 0 ? -u : r.length)) + h;
2802
+ for (; w >= 0 && w < r.length && l(w); )
2803
+ w += v;
2804
+ if (w >= 0 && w < r.length)
2805
+ return { type: "navigate", index: w };
2806
+ if (i) {
2807
+ if (a && d)
2808
+ return { type: "navigate", index: null };
2809
+ if (o === null) {
2810
+ const y = h > 0 ? s() : f();
2811
+ return y != null ? { type: "navigate", index: y } : null;
2812
+ }
2813
+ const m = o % u;
2814
+ let p;
2815
+ for (h > 0 ? p = m : (p = (Math.ceil(r.length / u) - 1) * u + m, p >= r.length && (p -= u)); p >= 0 && p < r.length && l(p); )
2816
+ p += v;
2817
+ if (p >= 0 && p < r.length)
2818
+ return { type: "navigate", index: p };
2819
+ }
2820
+ if (this.fallbackToLinear)
2821
+ return Ne(o, e === "ArrowDown" ? 1 : -1, n);
2822
+ }
2823
+ return null;
2824
+ }
2825
+ }
2826
+ function Pr(t, e) {
2827
+ const { floatingContext: n, treeContext: o } = je(t), { refs: r, open: l, setOpen: i } = n, {
2828
+ listRef: a,
2829
+ activeIndex: d,
2830
+ onNavigate: s,
2831
+ enabled: f = !0,
2832
+ loop: u = !1,
2833
+ orientation: h = "vertical",
2834
+ disabledIndices: v,
2835
+ focusItemOnHover: g = !0,
2836
+ openOnArrowKeyDown: w = !0,
2837
+ scrollItemIntoView: m = !0,
2838
+ selectedIndex: p = null,
2839
+ focusItemOnOpen: y = "auto",
2840
+ nested: L = !1,
2841
+ rtl: R = !1,
2842
+ virtual: D = !1,
2843
+ virtualItemRef: E,
2844
+ cols: P = 1,
2845
+ allowEscape: z = !1
2846
+ } = e, k = {
2847
+ isEnabled: F(() => T(f)),
2848
+ anchorEl: F(() => {
2849
+ const O = r.anchorEl.value;
2850
+ return O instanceof HTMLElement ? O : O && "contextElement" in O && O.contextElement instanceof HTMLElement ? O.contextElement : null;
2851
+ }),
2852
+ floatingEl: F(() => r.floatingEl.value),
2853
+ isVirtual: F(() => !!T(D)),
2854
+ isRtl: F(() => !!T(R)),
2855
+ gridCols: F(() => Math.max(1, Number(T(P) ?? 1)))
2856
+ }, { isEnabled: N, anchorEl: W, floatingEl: Y, isVirtual: X, isRtl: $, gridCols: C } = k, c = () => d !== void 0 ? T(d) : null, V = (O) => v ? Array.isArray(v) ? v.includes(O) : !!v(O) : !1, b = () => {
2857
+ const O = a.value;
2858
+ for (let M = 0; M < O.length; M++)
2859
+ if (O[M] && !V(M)) return M;
2860
+ return null;
2861
+ }, U = [], te = (O) => (U.push(O), O), J = () => {
2862
+ var O;
2863
+ for (; U.length; )
2864
+ (O = U.pop()) == null || O();
2865
+ }, S = () => {
2866
+ const O = a.value;
2867
+ for (let M = O.length - 1; M >= 0; M--)
2868
+ if (O[M] && !V(M)) return M;
2869
+ return null;
2870
+ };
2871
+ function j(O, M, I) {
2872
+ switch (O) {
2873
+ case "vertical":
2874
+ return M;
2875
+ case "horizontal":
2876
+ return I;
2877
+ default:
2878
+ return M || I;
2879
+ }
2880
+ }
2881
+ function he(O, M) {
2882
+ return j(M, O === "ArrowUp" || O === "ArrowDown", O === "ArrowLeft" || O === "ArrowRight");
2883
+ }
2884
+ function oe(O, M, I) {
2885
+ return j(M, O === "ArrowDown", I ? O === "ArrowLeft" : O === "ArrowRight") || O === "Enter" || O === " " || O === "";
2886
+ }
2887
+ const ve = (O, M, I) => {
2888
+ const K = a.value, A = K.length;
2889
+ let q = O;
2890
+ for (let ee = 0; ee < A; ee++) {
2891
+ if (q < 0 || q >= A) {
2892
+ if (!I) return null;
2893
+ q = (q + A) % A;
2894
+ }
2895
+ if (K[q] && !V(q)) return q;
2896
+ q += M;
2897
+ }
2898
+ return null;
2899
+ }, se = (O, M = !1) => {
2900
+ var K;
2901
+ if (O == null) return;
2902
+ const I = a.value[O];
2903
+ if (I && !X.value) {
2904
+ I.focus({ preventScroll: !0 });
2905
+ const A = m;
2906
+ !!A && (M || fn.value) && ((K = I.scrollIntoView) == null || K.call(
2907
+ I,
2908
+ typeof A == "boolean" ? { block: "nearest", inline: "nearest" } : A
2909
+ ));
2910
+ }
2911
+ };
2912
+ let re = null;
2913
+ const fe = (O) => {
2914
+ if (O.defaultPrevented) return;
2915
+ const M = O.target;
2916
+ if (M && wt(M) && M !== W.value) return;
2917
+ const I = O.key, K = T(h);
2918
+ if (re = I, l.value && X.value) {
2919
+ we(O);
2920
+ return;
2921
+ }
2922
+ if (!he(I, K) || l.value || !T(w)) return;
2923
+ O.preventDefault(), i(!0, "keyboard-activate", O);
2924
+ const q = (p !== void 0 ? T(p) : null) ?? (oe(I, K, $.value) ? b() : S());
2925
+ q != null && (s == null || s(q));
2926
+ }, we = (O) => {
2927
+ if (O.defaultPrevented) return;
2928
+ const M = O.key, I = T(h), K = a.value;
2929
+ if (!K.length) return;
2930
+ if (!X.value) {
2931
+ if (M === "Home") {
2932
+ O.preventDefault();
2933
+ const Q = b();
2934
+ Q != null && (s == null || s(Q));
2935
+ return;
2936
+ }
2937
+ if (M === "End") {
2938
+ O.preventDefault();
2939
+ const Q = S();
2940
+ Q != null && (s == null || s(Q));
2941
+ return;
2942
+ }
2943
+ }
2944
+ let A;
2945
+ I === "vertical" ? A = new Go() : I === "horizontal" ? A = C.value > 1 ? new Xt(!1, T(e.gridLoopDirection) ?? "row") : new Zo() : A = new Xt(!0, T(e.gridLoopDirection) ?? "row");
2946
+ const q = {
2947
+ current: c(),
2948
+ items: K,
2949
+ isRtl: $.value,
2950
+ loop: !!T(u),
2951
+ allowEscape: !!T(z),
2952
+ isVirtual: X.value,
2953
+ cols: C.value,
2954
+ nested: !!T(L),
2955
+ isDisabled: V,
2956
+ findNextEnabled: ve,
2957
+ getFirstEnabledIndex: b,
2958
+ getLastEnabledIndex: S
2959
+ }, ee = A.handleKey(M, q);
2960
+ if (ee) {
2961
+ if (ee.type === "navigate")
2962
+ O.preventDefault(), s == null || s(ee.index);
2963
+ else if (ee.type === "close") {
2964
+ O.preventDefault(), i(!1, "programmatic", O);
2965
+ const Q = o == null ? void 0 : o.parent.value, le = Q == null ? void 0 : Q.data.refs.anchorEl.value;
2966
+ le instanceof HTMLElement ? le.focus({ preventScroll: !0 }) : le && "contextElement" in le && le.contextElement instanceof HTMLElement && le.contextElement.focus({ preventScroll: !0 });
2967
+ }
2968
+ }
2969
+ }, ke = de(
2970
+ [l, F(() => c())],
2971
+ ([O, M]) => {
2972
+ N.value && O && M != null && se(M);
2973
+ },
2974
+ { flush: "post" }
2975
+ );
2976
+ te(ke), te(
2977
+ ne(
2978
+ () => N.value ? W.value : null,
2979
+ "keydown",
2980
+ fe
2981
+ )
2982
+ ), te(
2983
+ ne(
2984
+ () => N.value ? Y.value : null,
2985
+ "keydown",
2986
+ we
2987
+ )
2988
+ );
2989
+ const Ae = Me(() => {
2990
+ if (!N.value || !T(g)) return;
2991
+ const O = Y.value;
2992
+ if (!O) return;
2993
+ let M = null, I = null;
2994
+ const K = (A) => {
2995
+ if (M === A.clientX && I === A.clientY) return;
2996
+ M = A.clientX, I = A.clientY;
2997
+ const q = A.target;
2998
+ if (!q) return;
2999
+ const ee = a.value;
3000
+ let Q = -1;
3001
+ for (let le = 0; le < ee.length; le++) {
3002
+ const x = ee[le];
3003
+ if (x && (x === q || x.contains(q))) {
3004
+ Q = le;
3005
+ break;
3006
+ }
3007
+ }
3008
+ Q >= 0 && (s == null || s(Q));
3009
+ };
3010
+ O.addEventListener("mousemove", K), Te(() => {
3011
+ O.removeEventListener("mousemove", K);
3012
+ });
3013
+ });
3014
+ te(Ae);
3015
+ const Se = ie(!1), He = de(
3016
+ () => l.value,
3017
+ (O) => {
3018
+ if (N.value) {
3019
+ if (O && !Se.value) {
3020
+ const M = T(y);
3021
+ if (M === !0 || M === "auto" && re != null) {
3022
+ const K = (p !== void 0 ? T(p) : null) ?? (re && oe(re, T(h), $.value) ? b() : S());
3023
+ K != null && (s == null || s(K), se(K, !0));
3024
+ }
3025
+ }
3026
+ Se.value = O;
3027
+ }
3028
+ },
3029
+ { flush: "post", immediate: !0 }
3030
+ );
3031
+ return te(He), qo(
3032
+ W,
3033
+ a,
3034
+ F(() => c()),
3035
+ { virtual: D, open: l, virtualItemRef: E }
3036
+ ), { cleanup: J };
3037
+ }
3038
+ /*!
3039
+ * tabbable 6.3.0
3040
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
3041
+ */
3042
+ var Jo = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], mt = /* @__PURE__ */ Jo.join(","), hn = typeof Element > "u", Ue = hn ? function() {
3043
+ } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ot = !hn && Element.prototype.getRootNode ? function(t) {
3044
+ var e;
3045
+ return t == null || (e = t.getRootNode) === null || e === void 0 ? void 0 : e.call(t);
3046
+ } : function(t) {
3047
+ return t == null ? void 0 : t.ownerDocument;
3048
+ }, _e = function(e, n) {
3049
+ var o;
3050
+ n === void 0 && (n = !0);
3051
+ var r = e == null || (o = e.getAttribute) === null || o === void 0 ? void 0 : o.call(e, "inert"), l = r === "" || r === "true", i = l || n && e && _e(e.parentNode);
3052
+ return i;
3053
+ }, Qo = function(e) {
3054
+ var n, o = e == null || (n = e.getAttribute) === null || n === void 0 ? void 0 : n.call(e, "contenteditable");
3055
+ return o === "" || o === "true";
3056
+ }, er = function(e, n, o) {
3057
+ if (_e(e))
3058
+ return [];
3059
+ var r = Array.prototype.slice.apply(e.querySelectorAll(mt));
3060
+ return n && Ue.call(e, mt) && r.unshift(e), r = r.filter(o), r;
3061
+ }, gt = function(e, n, o) {
3062
+ for (var r = [], l = Array.from(e); l.length; ) {
3063
+ var i = l.shift();
3064
+ if (!_e(i, !1))
3065
+ if (i.tagName === "SLOT") {
3066
+ var a = i.assignedElements(), d = a.length ? a : i.children, s = gt(d, !0, o);
3067
+ o.flatten ? r.push.apply(r, s) : r.push({
3068
+ scopeParent: i,
3069
+ candidates: s
3070
+ });
3071
+ } else {
3072
+ var f = Ue.call(i, mt);
3073
+ f && o.filter(i) && (n || !e.includes(i)) && r.push(i);
3074
+ var u = i.shadowRoot || // check for an undisclosed shadow
3075
+ typeof o.getShadowRoot == "function" && o.getShadowRoot(i), h = !_e(u, !1) && (!o.shadowRootFilter || o.shadowRootFilter(i));
3076
+ if (u && h) {
3077
+ var v = gt(u === !0 ? i.children : u.children, !0, o);
3078
+ o.flatten ? r.push.apply(r, v) : r.push({
3079
+ scopeParent: i,
3080
+ candidates: v
3081
+ });
3082
+ } else
3083
+ l.unshift.apply(l, i.children);
3084
+ }
3085
+ }
3086
+ return r;
3087
+ }, vn = function(e) {
3088
+ return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
3089
+ }, pn = function(e) {
3090
+ if (!e)
3091
+ throw new Error("No node provided");
3092
+ return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Qo(e)) && !vn(e) ? 0 : e.tabIndex;
3093
+ }, tr = function(e, n) {
3094
+ var o = pn(e);
3095
+ return o < 0 && n && !vn(e) ? 0 : o;
3096
+ }, nr = function(e, n) {
3097
+ return e.tabIndex === n.tabIndex ? e.documentOrder - n.documentOrder : e.tabIndex - n.tabIndex;
3098
+ }, mn = function(e) {
3099
+ return e.tagName === "INPUT";
3100
+ }, or = function(e) {
3101
+ return mn(e) && e.type === "hidden";
3102
+ }, rr = function(e) {
3103
+ var n = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(o) {
3104
+ return o.tagName === "SUMMARY";
3105
+ });
3106
+ return n;
3107
+ }, ir = function(e, n) {
3108
+ for (var o = 0; o < e.length; o++)
3109
+ if (e[o].checked && e[o].form === n)
3110
+ return e[o];
3111
+ }, sr = function(e) {
3112
+ if (!e.name)
3113
+ return !0;
3114
+ var n = e.form || ot(e), o = function(a) {
3115
+ return n.querySelectorAll('input[type="radio"][name="' + a + '"]');
3116
+ }, r;
3117
+ if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
3118
+ r = o(window.CSS.escape(e.name));
3119
+ else
3120
+ try {
3121
+ r = o(e.name);
3122
+ } catch (i) {
3123
+ return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", i.message), !1;
3124
+ }
3125
+ var l = ir(r, e.form);
3126
+ return !l || l === e;
3127
+ }, lr = function(e) {
3128
+ return mn(e) && e.type === "radio";
3129
+ }, ar = function(e) {
3130
+ return lr(e) && !sr(e);
3131
+ }, ur = function(e) {
3132
+ var n, o = e && ot(e), r = (n = o) === null || n === void 0 ? void 0 : n.host, l = !1;
3133
+ if (o && o !== e) {
3134
+ var i, a, d;
3135
+ for (l = !!((i = r) !== null && i !== void 0 && (a = i.ownerDocument) !== null && a !== void 0 && a.contains(r) || e != null && (d = e.ownerDocument) !== null && d !== void 0 && d.contains(e)); !l && r; ) {
3136
+ var s, f, u;
3137
+ o = ot(r), r = (s = o) === null || s === void 0 ? void 0 : s.host, l = !!((f = r) !== null && f !== void 0 && (u = f.ownerDocument) !== null && u !== void 0 && u.contains(r));
3138
+ }
3139
+ }
3140
+ return l;
3141
+ }, Yt = function(e) {
3142
+ var n = e.getBoundingClientRect(), o = n.width, r = n.height;
3143
+ return o === 0 && r === 0;
3144
+ }, cr = function(e, n) {
3145
+ var o = n.displayCheck, r = n.getShadowRoot;
3146
+ if (o === "full-native" && "checkVisibility" in e) {
3147
+ var l = e.checkVisibility({
3148
+ // Checking opacity might be desirable for some use cases, but natively,
3149
+ // opacity zero elements _are_ focusable and tabbable.
3150
+ checkOpacity: !1,
3151
+ opacityProperty: !1,
3152
+ contentVisibilityAuto: !0,
3153
+ visibilityProperty: !0,
3154
+ // This is an alias for `visibilityProperty`. Contemporary browsers
3155
+ // support both. However, this alias has wider browser support (Chrome
3156
+ // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
3157
+ // we include it anyway.
3158
+ checkVisibilityCSS: !0
3159
+ });
3160
+ return !l;
3161
+ }
3162
+ if (getComputedStyle(e).visibility === "hidden")
3163
+ return !0;
3164
+ var i = Ue.call(e, "details>summary:first-of-type"), a = i ? e.parentElement : e;
3165
+ if (Ue.call(a, "details:not([open]) *"))
3166
+ return !0;
3167
+ if (!o || o === "full" || // full-native can run this branch when it falls through in case
3168
+ // Element#checkVisibility is unsupported
3169
+ o === "full-native" || o === "legacy-full") {
3170
+ if (typeof r == "function") {
3171
+ for (var d = e; e; ) {
3172
+ var s = e.parentElement, f = ot(e);
3173
+ if (s && !s.shadowRoot && r(s) === !0)
3174
+ return Yt(e);
3175
+ e.assignedSlot ? e = e.assignedSlot : !s && f !== e.ownerDocument ? e = f.host : e = s;
3176
+ }
3177
+ e = d;
3178
+ }
3179
+ if (ur(e))
3180
+ return !e.getClientRects().length;
3181
+ if (o !== "legacy-full")
3182
+ return !0;
3183
+ } else if (o === "non-zero-area")
3184
+ return Yt(e);
3185
+ return !1;
3186
+ }, fr = function(e) {
3187
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
3188
+ for (var n = e.parentElement; n; ) {
3189
+ if (n.tagName === "FIELDSET" && n.disabled) {
3190
+ for (var o = 0; o < n.children.length; o++) {
3191
+ var r = n.children.item(o);
3192
+ if (r.tagName === "LEGEND")
3193
+ return Ue.call(n, "fieldset[disabled] *") ? !0 : !r.contains(e);
3194
+ }
3195
+ return !0;
3196
+ }
3197
+ n = n.parentElement;
3198
+ }
3199
+ return !1;
3200
+ }, dr = function(e, n) {
3201
+ return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
3202
+ // because we're limited in the type of selectors we can use in JSDom (see related
3203
+ // note related to `candidateSelectors`)
3204
+ _e(n) || or(n) || cr(n, e) || // For a details element with a summary, the summary element gets the focus
3205
+ rr(n) || fr(n));
3206
+ }, Ut = function(e, n) {
3207
+ return !(ar(n) || pn(n) < 0 || !dr(e, n));
3208
+ }, hr = function(e) {
3209
+ var n = parseInt(e.getAttribute("tabindex"), 10);
3210
+ return !!(isNaN(n) || n >= 0);
3211
+ }, gn = function(e) {
3212
+ var n = [], o = [];
3213
+ return e.forEach(function(r, l) {
3214
+ var i = !!r.scopeParent, a = i ? r.scopeParent : r, d = tr(a, i), s = i ? gn(r.candidates) : a;
3215
+ d === 0 ? i ? n.push.apply(n, s) : n.push(a) : o.push({
3216
+ documentOrder: l,
3217
+ tabIndex: d,
3218
+ item: r,
3219
+ isScope: i,
3220
+ content: s
3221
+ });
3222
+ }), o.sort(nr).reduce(function(r, l) {
3223
+ return l.isScope ? r.push.apply(r, l.content) : r.push(l.content), r;
3224
+ }, []).concat(n);
3225
+ }, vr = function(e, n) {
3226
+ n = n || {};
3227
+ var o;
3228
+ return n.getShadowRoot ? o = gt([e], n.includeContainer, {
3229
+ filter: Ut.bind(null, n),
3230
+ flatten: !1,
3231
+ getShadowRoot: n.getShadowRoot,
3232
+ shadowRootFilter: hr
3233
+ }) : o = er(e, n.includeContainer, Ut.bind(null, n)), gn(o);
3234
+ };
3235
+ function Rr(t, e = {}) {
3236
+ const { floatingContext: n, treeContext: o } = je(t), {
3237
+ refs: { floatingEl: r, anchorEl: l },
3238
+ open: i,
3239
+ setOpen: a
3240
+ } = n, {
3241
+ enabled: d = !0,
3242
+ modal: s = !1,
3243
+ guards: f = !0,
3244
+ order: u = ["content"],
3245
+ initialFocus: h = "first",
3246
+ returnFocus: v = !0,
3247
+ restoreFocus: g = !1,
3248
+ closeOnFocusOut: w = !1,
3249
+ preventScroll: m = !0,
3250
+ outsideElementsInert: p = !1
3251
+ } = e, y = F(() => !!T(d)), L = F(() => !!T(s)), R = F(() => !!T(f)), D = F(
3252
+ () => Array.isArray(T(u)) ? T(u) : ["content"]
3253
+ ), E = F(() => !!T(v)), P = F(() => !!T(g)), z = F(() => !!T(w)), k = F(() => !!T(m)), N = F(() => !!T(p)), W = F(() => r.value), Y = ie(null);
3254
+ let X = null, $ = null, C = null, c = null, V = null, b = null, U = null;
3255
+ const te = ie(-1);
3256
+ let J = !1;
3257
+ const S = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, j = [];
3258
+ function he(x) {
3259
+ !x || !x.isConnected || x !== x.ownerDocument.body && (j.push(x), j.length > 20 && j.shift());
3260
+ }
3261
+ function oe() {
3262
+ for (; j.length; ) {
3263
+ const x = j.pop();
3264
+ if (x.isConnected) return x;
3265
+ }
3266
+ return null;
3267
+ }
3268
+ function ve() {
3269
+ if (!o) return !0;
3270
+ const x = (H) => {
3271
+ for (const B of H.children.value)
3272
+ if (B.data.open.value || x(B)) return !0;
3273
+ return !1;
3274
+ };
3275
+ return !x(o);
3276
+ }
3277
+ function se(x) {
3278
+ const H = x.hasAttribute("tabindex"), B = x.getAttribute("tabindex");
3279
+ return H || x.setAttribute("tabindex", "-1"), () => {
3280
+ H ? B != null && x.setAttribute("tabindex", B) : x.removeAttribute("tabindex");
3281
+ };
3282
+ }
3283
+ function re(x) {
3284
+ try {
3285
+ return vr(x, { displayCheck: "full", includeContainer: !1 });
3286
+ } catch {
3287
+ return [];
3288
+ }
3289
+ }
3290
+ function fe(x) {
3291
+ const H = re(x), B = l.value;
3292
+ return D.value.map((_) => _ === "floating" ? x : _ === "reference" ? Xe(B) ? B : (B == null ? void 0 : B.contextElement) instanceof HTMLElement ? B.contextElement : null : H).flat().filter((_) => !!_);
3293
+ }
3294
+ function we() {
3295
+ const x = document.createElement("div");
3296
+ return x.setAttribute("tabindex", "0"), x.setAttribute("aria-hidden", "true"), x.style.cssText = "position:absolute;width:1px;height:1px;opacity:0;", x;
3297
+ }
3298
+ function ke(x) {
3299
+ R.value && (c || V || (c = we(), V = we(), x.insertBefore(c, x.firstChild), x.appendChild(V), b = Se(c, "before", x), U = Se(V, "after", x)));
3300
+ }
3301
+ function Ae() {
3302
+ b == null || b(), U == null || U(), b = null, U = null, c && c.parentNode && c.parentNode.removeChild(c), V && V.parentNode && V.parentNode.removeChild(V), c = null, V = null;
3303
+ }
3304
+ function Se(x, H, B) {
3305
+ const _ = (G) => {
3306
+ G.preventDefault();
3307
+ const Z = fe(B);
3308
+ if (!Z.length) {
3309
+ M(B);
3310
+ return;
3311
+ }
3312
+ M(H === "before" ? Z[Z.length - 1] : Z[0]);
3313
+ };
3314
+ return x.addEventListener("focus", _), () => x.removeEventListener("focus", _);
3315
+ }
3316
+ function He(x) {
3317
+ if (!L.value) return () => {
3318
+ };
3319
+ const H = [], B = x.ownerDocument.body, _ = Array.from(B.children);
3320
+ for (const G of _)
3321
+ if (!G.contains(x)) {
3322
+ const Z = G.getAttribute("aria-hidden");
3323
+ H.push(G), G.setAttribute("aria-hidden", "true"), G.__prevAriaHidden = Z;
3324
+ }
3325
+ return () => {
3326
+ for (const G of H) {
3327
+ const Z = G.__prevAriaHidden;
3328
+ Z == null ? G.removeAttribute("aria-hidden") : G.setAttribute("aria-hidden", Z), delete G.__prevAriaHidden;
3329
+ }
3330
+ };
3331
+ }
3332
+ function O(x) {
3333
+ if (!L.value || !N.value) return () => {
3334
+ };
3335
+ const B = x.ownerDocument.body, G = Array.from(B.children).filter((Z) => !Z.contains(x)).map((Z) => ({
3336
+ el: Z,
3337
+ ariaHidden: Z.getAttribute("aria-hidden"),
3338
+ inert: Z.inert ?? null
3339
+ }));
3340
+ for (const { el: Z } of G)
3341
+ S ? Z.inert = !0 : Z.setAttribute("aria-hidden", "true");
3342
+ return () => {
3343
+ var Z;
3344
+ for (const Pe of G) {
3345
+ if (S) {
3346
+ const ze = Pe.el;
3347
+ Pe.inert == null ? (ze.inert = !1, (Z = ze.removeAttribute) == null || Z.call(ze, "inert")) : ze.inert = Pe.inert;
3348
+ }
3349
+ Pe.ariaHidden == null ? Pe.el.removeAttribute("aria-hidden") : Pe.el.setAttribute("aria-hidden", Pe.ariaHidden);
3350
+ }
3351
+ };
3352
+ }
3353
+ function M(x, H) {
3354
+ if (x)
3355
+ try {
3356
+ x.focus(H ?? { preventScroll: k.value });
3357
+ } catch {
3358
+ }
3359
+ }
3360
+ function I(x) {
3361
+ const H = T(h), B = re(x);
3362
+ if (typeof H == "number") {
3363
+ const _ = B[H] ?? null;
3364
+ M(_);
3365
+ return;
3366
+ }
3367
+ if (typeof H == "function") {
3368
+ M(H(), { preventScroll: k.value });
3369
+ return;
3370
+ }
3371
+ if (Xe(H)) {
3372
+ M(H, { preventScroll: k.value });
3373
+ return;
3374
+ }
3375
+ if (H === "last") {
3376
+ M(B[B.length - 1] ?? null);
3377
+ return;
3378
+ }
3379
+ B.length > 0 ? M(B[0]) : (X = se(x), M(x));
3380
+ }
3381
+ function K(x, H) {
3382
+ if (x.key !== "Tab") return;
3383
+ const B = fe(H);
3384
+ if (!B.length) {
3385
+ X ?? (X = se(H)), x.preventDefault(), M(H);
3386
+ return;
3387
+ }
3388
+ const _ = document.activeElement, G = B[0], Z = B[B.length - 1];
3389
+ x.shiftKey ? (!_ || _ === G) && (x.preventDefault(), M(Z)) : (!_ || _ === Z) && (x.preventDefault(), M(G));
3390
+ }
3391
+ function A(x) {
3392
+ return o ? ue(x, o.data.refs.anchorEl.value) || ue(x, o.data.refs.floatingEl.value) ? !0 : !!rt(o, x) : !!W.value && W.value.contains(x);
3393
+ }
3394
+ const q = ne(
3395
+ () => y.value && i.value ? W.value : null,
3396
+ "keydown",
3397
+ (x) => {
3398
+ const H = W.value;
3399
+ H && K(x, H);
3400
+ },
3401
+ { capture: !0 }
3402
+ ), ee = ne(
3403
+ () => y.value && i.value ? document : null,
3404
+ "focusin",
3405
+ (x) => {
3406
+ const H = W.value, B = x.target;
3407
+ if (!(!H || !B) && ve() && !H.contains(B) && !A(B)) {
3408
+ if (L.value) {
3409
+ const G = fe(H)[0] ?? H;
3410
+ M(G);
3411
+ } else if (z.value) {
3412
+ J = !0;
3413
+ try {
3414
+ a(!1, "blur", x);
3415
+ } catch (_) {
3416
+ console.error("[useFocusTrap] Error closing on focus out:", _);
3417
+ }
3418
+ }
3419
+ }
3420
+ },
3421
+ { capture: !0 }
3422
+ );
3423
+ ne(
3424
+ () => y.value && i.value ? W.value : null,
3425
+ "focusin",
3426
+ (x) => {
3427
+ const H = W.value;
3428
+ if (!H) return;
3429
+ const B = re(H), _ = x.target;
3430
+ if (!(_ instanceof HTMLElement)) {
3431
+ te.value = -1;
3432
+ return;
3433
+ }
3434
+ te.value = B.indexOf(_);
3435
+ }
3436
+ ), ne(
3437
+ () => y.value && i.value ? W.value : null,
3438
+ "focusout",
3439
+ (x) => {
3440
+ if (!P.value) return;
3441
+ const H = W.value;
3442
+ H && queueMicrotask(() => {
3443
+ const B = H.ownerDocument, _ = B.activeElement;
3444
+ if (_ && H.contains(_) || _ && _ !== B.body) return;
3445
+ const G = re(H), Z = G[te.value] ?? G[G.length - 1] ?? H;
3446
+ M(Z);
3447
+ });
3448
+ }
3449
+ ), ne(
3450
+ () => y.value && i.value ? document : null,
3451
+ "pointerdown",
3452
+ () => {
3453
+ queueMicrotask(() => {
3454
+ });
3455
+ },
3456
+ { capture: !0 }
3457
+ );
3458
+ const Q = Me(() => {
3459
+ if (!y.value || !i.value) return;
3460
+ const x = W.value;
3461
+ if (!x) return;
3462
+ const B = x.ownerDocument.activeElement;
3463
+ Y.value = B, he(B), ke(x), $ = He(x), C = O(x), queueMicrotask(() => I(x)), Te(() => {
3464
+ Ae(), X && (X(), X = null), $ && ($(), $ = null), C && (C(), C = null);
3465
+ });
3466
+ });
3467
+ de(
3468
+ () => i.value,
3469
+ (x, H) => {
3470
+ if (!x && H) {
3471
+ const B = Y.value;
3472
+ if (Y.value = null, E.value && !J) {
3473
+ const _ = oe() ?? B ?? le();
3474
+ if (_) {
3475
+ const G = re(_);
3476
+ M(G[0] ?? _, { preventScroll: !0 });
3477
+ }
3478
+ }
3479
+ J = !1;
3480
+ }
3481
+ },
3482
+ { flush: "post" }
3483
+ );
3484
+ function le() {
3485
+ const x = l.value;
3486
+ return x instanceof HTMLElement ? x : (x == null ? void 0 : x.contextElement) instanceof HTMLElement ? x.contextElement : null;
3487
+ }
3488
+ return Ie(() => {
3489
+ q(), ee(), Ae(), X && X(), $ && $(), C && C();
3490
+ }), {
3491
+ cleanup: () => {
3492
+ q(), ee(), Q(), Ae(), X && X(), $ && $(), C && C();
3493
+ }
3494
+ };
2696
3495
  }
2697
3496
  export {
2698
- an as FollowTracker,
2699
- cn as StaticTracker,
2700
- Dt as TrackingStrategy,
2701
- je as VirtualElementFactory,
2702
- io as arrow,
2703
- Do as autoPlacement,
2704
- so as createTree,
2705
- Tt as createTreeNode,
2706
- Mo as flip,
2707
- ko as hide,
2708
- Ao as offset,
2709
- Ro as shift,
2710
- No as size,
2711
- So as useArrow,
2712
- Ho as useClick,
2713
- Lo as useClientPoint,
2714
- Io as useEscapeKey,
2715
- ro as useFloating,
2716
- Fo as useFloatingTree,
2717
- Bo as useFocus,
2718
- Wo as useHover
3497
+ Mn as FollowTracker,
3498
+ Nn as StaticTracker,
3499
+ Gt as TrackingStrategy,
3500
+ ht as VirtualElementFactory,
3501
+ Do as arrow,
3502
+ yr as autoPlacement,
3503
+ Ro as createTree,
3504
+ $t as createTreeNode,
3505
+ Er as flip,
3506
+ Tr as hide,
3507
+ br as offset,
3508
+ xr as shift,
3509
+ Cr as size,
3510
+ gr as useArrow,
3511
+ Sr as useClick,
3512
+ wr as useClientPoint,
3513
+ Or as useEscapeKey,
3514
+ Po as useFloating,
3515
+ Ar as useFloatingTree,
3516
+ Lr as useFocus,
3517
+ Rr as useFocusTrap,
3518
+ Dr as useHover,
3519
+ Pr as useListNavigation
2719
3520
  };