v-float 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/composables/index.d.ts +0 -1
  2. package/dist/composables/index.d.ts.map +1 -1
  3. package/dist/composables/interactions/index.d.ts +1 -1
  4. package/dist/composables/interactions/index.d.ts.map +1 -1
  5. package/dist/composables/interactions/polygon.d.ts +1 -1
  6. package/dist/composables/interactions/polygon.d.ts.map +1 -1
  7. package/dist/composables/interactions/use-click.d.ts +1 -1
  8. package/dist/composables/interactions/use-click.d.ts.map +1 -1
  9. package/dist/composables/interactions/use-client-point.d.ts +180 -20
  10. package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
  11. package/dist/composables/interactions/use-escape-key.d.ts +37 -4
  12. package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
  13. package/dist/composables/interactions/use-focus.d.ts +1 -1
  14. package/dist/composables/interactions/use-focus.d.ts.map +1 -1
  15. package/dist/composables/interactions/use-hover.d.ts +1 -1
  16. package/dist/composables/interactions/use-hover.d.ts.map +1 -1
  17. package/dist/composables/interactions/utils/tree-context.d.ts +1 -1
  18. package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -1
  19. package/dist/composables/use-floating-tree.d.ts +72 -10
  20. package/dist/composables/use-floating-tree.d.ts.map +1 -1
  21. package/dist/composables/use-floating.d.ts +1 -1
  22. package/dist/composables/use-floating.d.ts.map +1 -1
  23. package/dist/v-float.es.js +1476 -1329
  24. package/dist/v-float.umd.js +1 -1
  25. package/package.json +3 -3
  26. package/dist/composables/use-tree.d.ts +0 -144
  27. package/dist/composables/use-tree.d.ts.map +0 -1
@@ -1,22 +1,18 @@
1
- var Jt = Object.defineProperty;
2
- var ht = (e) => {
3
- throw TypeError(e);
4
- };
5
- var Qt = (e, t, n) => t in e ? Jt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var ae = (e, t, n) => Qt(e, typeof t != "symbol" ? t + "" : t, n), $e = (e, t, n) => t.has(e) || ht("Cannot " + n);
7
- var Xe = (e, t, n) => ($e(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ne = (e, t, n) => t.has(e) ? ht("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ye = (e, t, n, o) => ($e(e, t, "write to private field"), o ? o.call(e, n) : t.set(e, n), n), je = (e, t, n) => ($e(e, t, "access private method"), n);
8
- import { watch as pe, getCurrentScope as Zt, onScopeDispose as ge, computed as I, toValue as M, unref as en, watchPostEffect as Ee, onWatcherCleanup as ce, ref as q, watchEffect as mt, readonly as tn, onMounted as nn, shallowRef as qe, shallowReactive as on } from "vue";
9
- function rn(e) {
10
- return Zt() ? (ge(e), !0) : !1;
11
- }
12
- const sn = typeof window < "u" && typeof document < "u";
1
+ var Yt = Object.defineProperty;
2
+ var zt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var ve = (e, t, n) => zt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { watch as ne, getCurrentScope as _t, onScopeDispose as we, computed as N, toValue as A, unref as Ut, watchPostEffect as Ce, onWatcherCleanup as ue, ref as _, watchEffect as Kt, readonly as qt, onMounted as Gt, shallowRef as je, shallowReactive as Jt } from "vue";
5
+ function Qt(e) {
6
+ return _t() ? (we(e), !0) : !1;
7
+ }
8
+ const Zt = typeof window < "u" && typeof document < "u";
13
9
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
14
- const ln = Object.prototype.toString, an = (e) => ln.call(e) === "[object Object]";
15
- function _e(e) {
10
+ const en = Object.prototype.toString, tn = (e) => en.call(e) === "[object Object]";
11
+ function $e(e) {
16
12
  return Array.isArray(e) ? e : [e];
17
13
  }
18
- function cn(e, t, n) {
19
- return pe(
14
+ function nn(e, t, n) {
15
+ return ne(
20
16
  e,
21
17
  t,
22
18
  {
@@ -25,85 +21,85 @@ function cn(e, t, n) {
25
21
  }
26
22
  );
27
23
  }
28
- const un = sn ? window : void 0;
29
- function fn(e) {
24
+ const on = Zt ? window : void 0;
25
+ function rn(e) {
30
26
  var t;
31
- const n = M(e);
27
+ const n = A(e);
32
28
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
33
29
  }
34
- function K(...e) {
30
+ function q(...e) {
35
31
  const t = [], n = () => {
36
32
  t.forEach((a) => a()), t.length = 0;
37
- }, o = (a, u, c, f) => (a.addEventListener(u, c, f), () => a.removeEventListener(u, c, f)), i = I(() => {
38
- const a = _e(M(e[0])).filter((u) => u != null);
39
- return a.every((u) => typeof u != "string") ? a : void 0;
40
- }), s = cn(
33
+ }, o = (a, f, c, u) => (a.addEventListener(f, c, u), () => a.removeEventListener(f, c, u)), i = N(() => {
34
+ const a = $e(A(e[0])).filter((f) => f != null);
35
+ return a.every((f) => typeof f != "string") ? a : void 0;
36
+ }), l = nn(
41
37
  () => {
42
- var a, u;
38
+ var a, f;
43
39
  return [
44
- (u = (a = i.value) == null ? void 0 : a.map((c) => fn(c))) != null ? u : [un].filter((c) => c != null),
45
- _e(M(i.value ? e[1] : e[0])),
46
- _e(en(i.value ? e[2] : e[1])),
40
+ (f = (a = i.value) == null ? void 0 : a.map((c) => rn(c))) != null ? f : [on].filter((c) => c != null),
41
+ $e(A(i.value ? e[1] : e[0])),
42
+ $e(Ut(i.value ? e[2] : e[1])),
47
43
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
48
- M(i.value ? e[3] : e[2])
44
+ A(i.value ? e[3] : e[2])
49
45
  ];
50
46
  },
51
- ([a, u, c, f]) => {
52
- if (n(), !(a != null && a.length) || !(u != null && u.length) || !(c != null && c.length))
47
+ ([a, f, c, u]) => {
48
+ if (n(), !(a != null && a.length) || !(f != null && f.length) || !(c != null && c.length))
53
49
  return;
54
- const d = an(f) ? { ...f } : f;
50
+ const p = tn(u) ? { ...u } : u;
55
51
  t.push(
56
52
  ...a.flatMap(
57
- (p) => u.flatMap(
58
- (h) => c.map((b) => o(p, h, b, d))
53
+ (h) => f.flatMap(
54
+ (d) => c.map((m) => o(h, d, m, p))
59
55
  )
60
56
  )
61
57
  );
62
58
  },
63
59
  { flush: "post" }
64
60
  ), r = () => {
65
- s(), n();
61
+ l(), n();
66
62
  };
67
- return rn(n), r;
63
+ return Qt(n), r;
68
64
  }
69
- function pt() {
65
+ function st() {
70
66
  return typeof navigator > "u" ? !1 : navigator.platform.toUpperCase().indexOf("MAC") >= 0;
71
67
  }
72
- function vt() {
68
+ function lt() {
73
69
  return typeof navigator > "u" ? !1 : /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
74
70
  }
75
- function dn(e) {
71
+ function sn(e) {
76
72
  return typeof (e == null ? void 0 : e.matches) != "function" ? !1 : e.matches(":focus-visible");
77
73
  }
78
- function Ke(e, t) {
74
+ function St(e, t) {
79
75
  if (e === void 0) return !1;
80
76
  const n = e === "mouse";
81
77
  return t ? n : n || e === "pen";
82
78
  }
83
- function Bt(e) {
79
+ function At(e) {
84
80
  return !e || !(e instanceof HTMLElement) ? !1 : e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e.isContentEditable && e.contentEditable !== "false";
85
81
  }
86
- function gt(e) {
82
+ function at(e) {
87
83
  const t = e.target;
88
84
  return t instanceof HTMLElement ? t.tagName === "BUTTON" || t.tagName === "INPUT" && t.getAttribute("type") === "button" || t.getAttribute("role") === "button" : !1;
89
85
  }
90
- function wt(e) {
91
- return Bt(e);
86
+ function ct(e) {
87
+ return At(e);
92
88
  }
93
- function hn(e) {
89
+ function ln(e) {
94
90
  return e instanceof Element && e instanceof HTMLElement;
95
91
  }
96
- function mn(e) {
92
+ function xo(e) {
97
93
  return typeof e == "object" && e !== null && "contextElement" in e;
98
94
  }
99
- function yt(e, t) {
95
+ function ut(e, t) {
100
96
  return t ? "composedPath" in e && typeof e.composedPath == "function" ? e.composedPath().includes(t) : t.contains(e.target) : !1;
101
97
  }
102
- function pn(e, t) {
103
- const n = t.getBoundingClientRect(), o = t.offsetWidth - t.clientWidth, i = t.offsetHeight - t.clientHeight, s = e.clientX - n.left, r = e.clientY - n.top;
98
+ function an(e, t) {
99
+ const n = t.getBoundingClientRect(), o = t.offsetWidth - t.clientWidth, i = t.offsetHeight - t.clientHeight, l = e.clientX - n.left, r = e.clientY - n.top;
104
100
  if (o > 0) {
105
101
  const a = t.clientWidth;
106
- if (s >= a && s <= t.offsetWidth)
102
+ if (l >= a && l <= t.offsetWidth)
107
103
  return !0;
108
104
  }
109
105
  if (i > 0) {
@@ -113,23 +109,23 @@ function pn(e, t) {
113
109
  }
114
110
  return !1;
115
111
  }
116
- function ze(e, t) {
112
+ function Ve(e, t) {
117
113
  return e.contains(t);
118
114
  }
119
- function vn(e) {
115
+ function cn(e) {
120
116
  return e.target;
121
117
  }
122
- function bt() {
118
+ function ft() {
123
119
  return typeof performance < "u" ? performance.now() : Date.now();
124
120
  }
125
- function xt(e) {
121
+ function dt(e) {
126
122
  e !== -1 && clearTimeout(e);
127
123
  }
128
- function gn(e) {
124
+ function un(e) {
129
125
  return e !== null && typeof e == "object" && "data" in e && "id" in e && "children" in e && "parent" in e;
130
126
  }
131
- function et(e) {
132
- return gn(e) ? {
127
+ function Fe(e) {
128
+ return un(e) ? {
133
129
  floatingContext: e.data,
134
130
  treeContext: e
135
131
  } : {
@@ -145,502 +141,761 @@ function J(e, t) {
145
141
  }
146
142
  return t instanceof Element ? t.contains(e) : !1;
147
143
  }
148
- function tt(e, t) {
144
+ function Ke(e, t) {
149
145
  for (const n of e.children.value)
150
146
  if (n.data.open.value) {
151
147
  if (J(t, n.data.refs.anchorEl.value) || J(t, n.data.refs.floatingEl.value))
152
148
  return n;
153
- const o = tt(n, t);
149
+ const o = Ke(n, t);
154
150
  if (o) return o;
155
151
  }
156
152
  return null;
157
153
  }
158
- function Po(e, t = {}) {
159
- const { floatingContext: n, treeContext: o } = et(e), { open: i, setOpen: s, refs: r } = n, {
154
+ function Eo(e, t = {}) {
155
+ const { floatingContext: n, treeContext: o } = Fe(e), { open: i, setOpen: l, refs: r } = n, {
160
156
  enabled: a = !0,
161
- event: u = "click",
157
+ event: f = "click",
162
158
  toggle: c = !0,
163
- ignoreMouse: f = !1,
164
- ignoreKeyboard: d = !1,
165
- ignoreTouch: p = !1,
159
+ ignoreMouse: u = !1,
160
+ ignoreKeyboard: p = !1,
161
+ ignoreTouch: h = !1,
166
162
  // Outside click options
167
- outsideClick: h = !1,
168
- outsideEvent: b = "pointerdown",
169
- outsideCapture: v = !0,
170
- onOutsideClick: g,
171
- preventScrollbarClick: y = !0,
172
- handleDragEvents: C = !0
163
+ outsideClick: d = !1,
164
+ outsideEvent: m = "pointerdown",
165
+ outsideCapture: g = !0,
166
+ onOutsideClick: v,
167
+ preventScrollbarClick: x = !0,
168
+ handleDragEvents: T = !0
173
169
  } = t;
174
- let x, O = !1, m = !1, A = !1;
175
- const S = I(() => M(a)), R = I(() => M(h)), N = I(() => {
176
- const T = r.anchorEl.value;
177
- return T ? T instanceof HTMLElement ? T : mn(T) && T.contextElement instanceof HTMLElement ? T.contextElement : null : null;
178
- }), L = I(() => r.floatingEl.value);
179
- function D() {
180
- A = !0;
170
+ let C, S = !1, w = !1, b = !1;
171
+ const P = N(() => A(a)), F = N(() => A(d)), D = N(() => {
172
+ const O = r.anchorEl.value;
173
+ return O instanceof HTMLElement ? O : null;
174
+ }), M = N(() => r.floatingEl.value);
175
+ function B() {
176
+ b = !0;
181
177
  try {
182
- i.value ? M(c) && s(!1) : s(!0);
178
+ i.value ? A(c) && l(!1) : l(!0);
183
179
  } finally {
184
180
  Promise.resolve().then(() => {
185
- A = !1;
181
+ b = !1;
186
182
  });
187
183
  }
188
184
  }
189
185
  function W() {
190
- x = void 0, O = !1, m = !1;
186
+ C = void 0, S = !1, w = !1;
191
187
  }
192
- function X(T) {
193
- x = T.pointerType;
188
+ function X(O) {
189
+ C = O.pointerType;
194
190
  }
195
- function k(T) {
196
- T.button === 0 && M(u) !== "click" && (V(x) || D());
191
+ function R(O) {
192
+ O.button === 0 && A(f) !== "click" && ($(C) || B());
197
193
  }
198
194
  function E() {
199
- if (M(u) === "mousedown" && x) {
195
+ if (A(f) === "mousedown" && C) {
200
196
  W();
201
197
  return;
202
198
  }
203
- if (V(x)) {
199
+ if ($(C)) {
204
200
  W();
205
201
  return;
206
202
  }
207
- D(), W();
203
+ B(), W();
208
204
  }
209
- function l(T) {
210
- if (x = void 0, T.defaultPrevented || M(d) || gt(T))
205
+ function s(O) {
206
+ if (C = void 0, O.defaultPrevented || A(p) || at(O))
211
207
  return;
212
- const $ = N.value;
213
- $ && (T.key === " " && !wt($) && (T.preventDefault(), O = !0), T.key === "Enter" && D());
208
+ const V = D.value;
209
+ V && (O.key === " " && !ct(V) && (O.preventDefault(), S = !0), O.key === "Enter" && B());
214
210
  }
215
- function F(T) {
216
- const $ = N.value;
217
- $ && (T.defaultPrevented || M(d) || gt(T) || wt($) || T.key === " " && O && (O = !1, D()));
211
+ function k(O) {
212
+ const V = D.value;
213
+ V && (O.defaultPrevented || A(p) || at(O) || ct(V) || O.key === " " && S && (S = !1, B()));
218
214
  }
219
- function w(T) {
220
- if (!S.value || !R.value || !i.value)
215
+ function y(O) {
216
+ if (!P.value || !F.value || !i.value)
221
217
  return;
222
- if (M(b) === "click" && M(C) && m) {
223
- m = !1;
218
+ if (A(m) === "click" && A(T) && w) {
219
+ w = !1;
224
220
  return;
225
221
  }
226
- if (A)
222
+ if (b)
227
223
  return;
228
- const $ = T.target;
229
- if ($ && !(M(y) && hn($) && L.value && pn(T, $))) {
224
+ const V = O.target;
225
+ if (V && !(A(x) && ln(V) && M.value && an(O, V))) {
230
226
  if (o) {
231
- if (!wn(o, $))
227
+ if (!fn(o, V))
232
228
  return;
233
- } else if (yt(T, N.value) || yt(T, L.value))
229
+ } else if (ut(O, D.value) || ut(O, M.value))
234
230
  return;
235
- g ? g(T, n) : s(!1);
231
+ v ? v(O, n) : l(!1);
236
232
  }
237
233
  }
238
234
  function H() {
239
- m = !0;
235
+ w = !0;
240
236
  }
241
237
  function ee() {
242
238
  setTimeout(() => {
243
- m = !1;
239
+ w = !1;
244
240
  }, 0);
245
241
  }
246
- function V(T) {
247
- return !!(Ke(T, !0) && M(f) || T === "touch" && M(p));
242
+ function $(O) {
243
+ return !!(St(O, !0) && A(u) || O === "touch" && A(h));
248
244
  }
249
- Ee(() => {
250
- const T = N.value;
251
- !S.value || !T || (T.addEventListener("pointerdown", X), T.addEventListener("mousedown", k), T.addEventListener("click", E), T.addEventListener("keydown", l), T.addEventListener("keyup", F), ce(() => {
252
- T.removeEventListener("pointerdown", X), T.removeEventListener("mousedown", k), T.removeEventListener("click", E), T.removeEventListener("keydown", l), T.removeEventListener("keyup", F), W();
245
+ Ce(() => {
246
+ const O = D.value;
247
+ !P.value || !O || (O.addEventListener("pointerdown", X), O.addEventListener("mousedown", R), O.addEventListener("click", E), O.addEventListener("keydown", s), O.addEventListener("keyup", k), ue(() => {
248
+ O.removeEventListener("pointerdown", X), O.removeEventListener("mousedown", R), O.removeEventListener("click", E), O.removeEventListener("keydown", s), O.removeEventListener("keyup", k), W();
253
249
  }));
254
- }), K(
255
- () => S.value && R.value ? document : null,
256
- () => M(b),
257
- w,
258
- { capture: M(v) }
259
- ), K(
260
- () => S.value && R.value && M(C) ? L.value : null,
250
+ }), q(
251
+ () => P.value && F.value ? document : null,
252
+ () => A(m),
253
+ y,
254
+ { capture: A(g) }
255
+ ), q(
256
+ () => P.value && F.value && A(T) ? M.value : null,
261
257
  "mousedown",
262
258
  H,
263
259
  { capture: !0 }
264
- ), K(
265
- () => S.value && R.value && M(C) ? L.value : null,
260
+ ), q(
261
+ () => P.value && F.value && A(T) ? M.value : null,
266
262
  "mouseup",
267
263
  ee,
268
264
  { capture: !0 }
269
265
  );
270
266
  }
271
- function wn(e, t) {
272
- return !(J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) || tt(e, t));
273
- }
274
- function Oo(e, t, n = {}) {
275
- const { open: o, refs: i } = t;
276
- let s;
277
- const r = q({ x: null, y: null }), a = I(() => M(n.axis ?? "both")), u = I(() => M(n.enabled ?? !0)), c = I(() => M(n.x ?? null)), f = I(() => M(n.y ?? null)), d = (v, g) => {
278
- r.value = {
279
- x: v,
280
- y: g
281
- }, o.value && (i.anchorEl.value = yn(
282
- e.value,
283
- a.value,
284
- r.value
285
- ));
267
+ function fn(e, t) {
268
+ return !(J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) || Ke(e, t));
269
+ }
270
+ const Ae = (e) => typeof e == "number" && Number.isFinite(e) ? e : null, ce = class ce {
271
+ /**
272
+ * Create a virtual anchor element
273
+ */
274
+ create(t) {
275
+ const n = this.buildConfiguration(t);
276
+ return {
277
+ contextElement: n.referenceElement || void 0,
278
+ getBoundingClientRect: () => this.buildBoundingRect(n)
279
+ };
280
+ }
281
+ /**
282
+ * Build configuration from options with defaults
283
+ */
284
+ buildConfiguration(t) {
285
+ return {
286
+ coordinates: t.coordinates,
287
+ referenceElement: t.referenceElement ?? null,
288
+ baselineCoordinates: t.baselineCoordinates ?? null,
289
+ axis: t.axis ?? "both"
290
+ };
291
+ }
292
+ /**
293
+ * Build the bounding rectangle for the virtual element
294
+ */
295
+ buildBoundingRect(t) {
296
+ const n = this.getReferenceRect(t.referenceElement), o = this.resolvePosition(t, n), i = this.calculateSize(t.axis, n);
297
+ return this.buildDOMRect({
298
+ x: o.x,
299
+ y: o.y,
300
+ width: i.width,
301
+ height: i.height
302
+ });
303
+ }
304
+ /**
305
+ * Get reference element bounds with fallback
306
+ */
307
+ getReferenceRect(t) {
308
+ if (t)
309
+ try {
310
+ return t.getBoundingClientRect();
311
+ } catch (n) {
312
+ console.warn("VirtualElementFactory: Failed to get element bounds", { element: t, error: n });
313
+ }
314
+ return this.buildDOMRect({
315
+ x: 0,
316
+ y: 0,
317
+ width: ce.DEFAULT_DIMENSIONS.width,
318
+ height: ce.DEFAULT_DIMENSIONS.height
319
+ });
320
+ }
321
+ /**
322
+ * Resolve final position from coordinate sources
323
+ */
324
+ resolvePosition(t, n) {
325
+ var o, i;
326
+ return {
327
+ x: this.resolveAxisCoordinate({
328
+ current: t.coordinates.x,
329
+ baseline: ((o = t.baselineCoordinates) == null ? void 0 : o.x) ?? null,
330
+ fallback: n.x,
331
+ isAxisEnabled: t.axis === "x" || t.axis === "both"
332
+ }),
333
+ y: this.resolveAxisCoordinate({
334
+ current: t.coordinates.y,
335
+ baseline: ((i = t.baselineCoordinates) == null ? void 0 : i.y) ?? null,
336
+ fallback: n.y,
337
+ isAxisEnabled: t.axis === "y" || t.axis === "both"
338
+ })
339
+ };
340
+ }
341
+ /**
342
+ * Resolve coordinate for a single axis with clear precedence
343
+ */
344
+ resolveAxisCoordinate(t) {
345
+ const { current: n, baseline: o, fallback: i, isAxisEnabled: l } = t;
346
+ return l && n !== null ? n : o !== null ? o : i;
347
+ }
348
+ /**
349
+ * Calculate virtual element size based on axis constraints
350
+ */
351
+ calculateSize(t, n) {
352
+ const o = (i, l) => Math.max(0, i || l);
353
+ switch (t) {
354
+ case "both":
355
+ return { width: 0, height: 0 };
356
+ case "x":
357
+ return {
358
+ width: o(
359
+ n.width,
360
+ ce.DEFAULT_DIMENSIONS.width
361
+ ),
362
+ height: 0
363
+ };
364
+ case "y":
365
+ return {
366
+ width: 0,
367
+ height: o(
368
+ n.height,
369
+ ce.DEFAULT_DIMENSIONS.height
370
+ )
371
+ };
372
+ }
373
+ }
374
+ /**
375
+ * Build a DOMRect object
376
+ */
377
+ buildDOMRect(t) {
378
+ const { x: n, y: o, width: i, height: l } = t, r = Math.max(0, i), a = Math.max(0, l);
379
+ return {
380
+ x: n,
381
+ y: o,
382
+ width: r,
383
+ height: a,
384
+ top: o,
385
+ right: n + r,
386
+ bottom: o + a,
387
+ left: n,
388
+ toJSON: () => ({ x: n, y: o, width: r, height: a })
389
+ };
390
+ }
391
+ };
392
+ ve(ce, "DEFAULT_DIMENSIONS", { width: 100, height: 30 });
393
+ let Ye = ce;
394
+ class Mt {
395
+ constructor() {
396
+ // The core state every strategy needs: the last known good coordinates
397
+ ve(this, "lastKnownCoordinates", null);
398
+ }
399
+ /**
400
+ * Get coordinates to use when the floating element opens
401
+ * This lets each strategy decide its opening behavior without client code needing to know the details
402
+ */
403
+ getCoordinatesForOpening() {
404
+ return this.lastKnownCoordinates;
405
+ }
406
+ /**
407
+ * Called when the floating element closes
408
+ * This is where strategies should clean up any temporary state
409
+ */
410
+ onClose() {
411
+ this.lastKnownCoordinates = null;
412
+ }
413
+ /**
414
+ * Reset all strategy state - used when the composable is disabled or reset
415
+ */
416
+ reset() {
417
+ this.lastKnownCoordinates = null;
418
+ }
419
+ }
420
+ class dn extends Mt {
421
+ constructor() {
422
+ super(...arguments);
423
+ ve(this, "name", "follow");
424
+ }
425
+ /**
426
+ * Follow strategy needs all pointer events for continuous tracking
427
+ */
428
+ getRequiredEvents() {
429
+ return ["pointerdown", "pointermove", "pointerenter"];
430
+ }
431
+ /**
432
+ * Follow strategy: always update coordinates based on the current pointer position
433
+ * This creates smooth, continuous tracking behavior
434
+ */
435
+ process(n, o) {
436
+ const i = n.coordinates;
437
+ switch (this.lastKnownCoordinates = i, n.type) {
438
+ case "pointerdown":
439
+ return i;
440
+ case "pointermove":
441
+ return o.isOpen && St(n.originalEvent.pointerType, !0) ? i : null;
442
+ case "pointerenter":
443
+ return i;
444
+ default:
445
+ return null;
446
+ }
447
+ }
448
+ }
449
+ class hn extends Mt {
450
+ constructor() {
451
+ super(...arguments);
452
+ ve(this, "name", "static");
453
+ // Static strategy needs to remember the "trigger" coordinates from clicks
454
+ // These take priority over hover coordinates for positioning
455
+ ve(this, "triggerCoordinates", null);
456
+ }
457
+ /**
458
+ * Static strategy only needs click events, not hover or continuous movement
459
+ * This optimization avoids registering unnecessary pointer events
460
+ */
461
+ getRequiredEvents() {
462
+ return ["pointerdown"];
463
+ }
464
+ /**
465
+ * Static strategy: capture coordinates from trigger events, ignore movement
466
+ * This creates stable positioning that doesn't jump around
467
+ */
468
+ process(n, o) {
469
+ const i = n.coordinates;
470
+ return this.triggerCoordinates = i, this.lastKnownCoordinates = i, o.isOpen ? i : null;
471
+ }
472
+ /**
473
+ * Get coordinates to use when floating element opens
474
+ */
475
+ getCoordinatesForOpening() {
476
+ return this.triggerCoordinates ? this.triggerCoordinates : this.lastKnownCoordinates;
477
+ }
478
+ /**
479
+ * Reset tracking state
480
+ */
481
+ reset() {
482
+ super.reset(), this.triggerCoordinates = null;
483
+ }
484
+ onClose() {
485
+ this.triggerCoordinates = null;
486
+ }
487
+ }
488
+ function Co(e, t, n = {}) {
489
+ const { open: o, refs: i } = t, l = new Ye(), r = _({ x: null, y: null }), a = _(null), f = N(() => A(n.axis ?? "both")), c = N(() => A(n.enabled ?? !0)), u = N(() => Ae(A(n.x ?? null))), p = N(() => Ae(A(n.y ?? null))), h = N(
490
+ () => u.value !== null && p.value !== null
491
+ ), d = N(() => h.value ? {
492
+ x: u.value,
493
+ y: p.value
494
+ } : r.value), m = N(() => {
495
+ const b = d.value;
496
+ switch (f.value) {
497
+ case "x":
498
+ return { x: b.x, y: null };
499
+ case "y":
500
+ return { x: null, y: b.y };
501
+ case "both":
502
+ return b;
503
+ }
504
+ }), g = (n.trackingMode ?? "follow") === "follow" ? new dn() : new hn(), v = (b, P) => {
505
+ h.value || (r.value = {
506
+ x: Ae(b),
507
+ y: Ae(P)
508
+ });
509
+ }, x = () => {
510
+ h.value || (r.value = { x: null, y: null });
511
+ }, T = (b, P) => {
512
+ const F = {
513
+ type: P,
514
+ coordinates: { x: b.clientX, y: b.clientY },
515
+ originalEvent: b
516
+ }, D = g.process(F, {
517
+ isOpen: o.value
518
+ });
519
+ D && v(D.x, D.y);
286
520
  };
287
- mt(() => {
288
- const v = c.value, g = f.value;
289
- u.value && v != null && g != null && d(v, g);
521
+ ne(
522
+ [m, a, f, e],
523
+ () => {
524
+ i.anchorEl.value = l.create({
525
+ coordinates: m.value,
526
+ referenceElement: e.value,
527
+ baselineCoordinates: a.value,
528
+ axis: f.value
529
+ });
530
+ },
531
+ { immediate: !0 }
532
+ ), ne(o, (b) => {
533
+ if (!(!c.value || h.value))
534
+ if (b) {
535
+ const P = g.getCoordinatesForOpening();
536
+ P ? (v(P.x, P.y), a.value = { ...P }) : a.value = { ...r.value };
537
+ } else
538
+ g.onClose(), x(), a.value = null;
290
539
  });
291
- const p = (v) => {
292
- s = v.pointerType, d(v.clientX, v.clientY);
293
- }, h = (v) => {
294
- s = v.pointerType, !o.value && Ke(s, !0) && d(v.clientX, v.clientY);
295
- }, b = (v) => {
296
- o.value && Ke(s, !0) && d(v.clientX, v.clientY);
540
+ const C = (b) => {
541
+ T(b, "pointerdown");
542
+ }, S = (b) => {
543
+ T(b, "pointerenter");
544
+ }, w = (b) => {
545
+ T(b, "pointermove");
297
546
  };
298
- return mt(() => {
299
- if (c.value != null || f.value != null) return;
300
- const v = e.value;
301
- !v || !u.value || (v.addEventListener("pointerenter", h), v.addEventListener("pointerdown", p), v.addEventListener("pointermove", b), ce(() => {
302
- v == null || v.removeEventListener("pointerenter", h), v == null || v.removeEventListener("pointerdown", p), v == null || v.removeEventListener("pointermove", b);
303
- }));
547
+ return Kt(() => {
548
+ if (h.value || !c.value) return;
549
+ const b = e.value;
550
+ if (!b) return;
551
+ const P = g.getRequiredEvents(), F = {
552
+ pointerenter: S,
553
+ pointerdown: C,
554
+ pointermove: w
555
+ };
556
+ P.forEach((D) => {
557
+ const M = F[D];
558
+ M && b.addEventListener(D, M);
559
+ }), ue(() => {
560
+ P.forEach((D) => {
561
+ const M = F[D];
562
+ M && b.removeEventListener(D, M);
563
+ });
564
+ });
304
565
  }), {
305
- coordinates: tn(r),
306
- updatePosition: d
566
+ coordinates: qt(m),
567
+ updatePosition: (b, P) => v(b, P)
307
568
  };
308
569
  }
309
- function yn(e, t, n) {
310
- let o = null, i = null;
311
- const s = e;
312
- return {
313
- contextElement: s || void 0,
314
- getBoundingClientRect: () => {
315
- const r = (s == null ? void 0 : s.getBoundingClientRect()) ?? {
316
- width: 0,
317
- height: 0,
318
- x: 0,
319
- y: 0
320
- }, a = t === "x" || t === "both", u = t === "y" || t === "both";
321
- let c = 0, f = 0, d = r.x, p = r.y;
322
- return s && (o == null && n.x != null && a && (o = r.x - n.x), i == null && n.y != null && u && (i = r.y - n.y), d -= o || 0, p -= i || 0), a && n.x != null ? d = n.x : (o = null, c = r.width), u && n.y != null ? p = n.y : (i = null, f = r.height), t === "both" && (c = 0, f = 0), {
323
- width: c,
324
- height: f,
325
- x: d,
326
- y: p,
327
- top: p,
328
- right: d + c,
329
- bottom: p + f,
330
- left: d
331
- };
570
+ function To(e, t = {}) {
571
+ const { floatingContext: n, treeContext: o } = Fe(e), { enabled: i = !0, capture: l = !1, onEscape: r } = t, { isComposing: a } = pn();
572
+ q(document, "keydown", (c) => {
573
+ if (!(c.key !== "Escape" || !A(i) || a())) {
574
+ if (r) {
575
+ r(c);
576
+ return;
577
+ }
578
+ if (o) {
579
+ const u = mn(o);
580
+ u && u.data.setOpen(!1);
581
+ } else
582
+ n.setOpen(!1);
332
583
  }
333
- };
584
+ }, l);
334
585
  }
335
- function Mo(e) {
336
- const { enabled: t = !0, onEscape: n, capture: o } = e, { isComposing: i } = bn();
337
- K(
338
- document,
339
- "keydown",
340
- (s) => {
341
- s.key !== "Escape" || !M(t) || i() || n(s);
342
- },
343
- o
344
- );
586
+ function mn(e) {
587
+ let t = e;
588
+ for (; t.parent.value && !t.isRoot; )
589
+ t = t.parent.value;
590
+ let n = null, o = -1;
591
+ const i = (l) => {
592
+ if (l.data.open.value) {
593
+ const r = l.getPath().length;
594
+ r > o && (o = r, n = l);
595
+ }
596
+ for (const r of l.children.value)
597
+ i(r);
598
+ };
599
+ return i(t), n;
345
600
  }
346
- function bn() {
347
- const e = q(!1);
348
- return K(document, "compositionstart", () => {
601
+ function pn() {
602
+ const e = _(!1);
603
+ return q(document, "compositionstart", () => {
349
604
  e.value = !0;
350
- }), K(document, "compositionend", () => {
605
+ }), q(document, "compositionend", () => {
351
606
  e.value = !1;
352
607
  }), {
353
608
  isComposing: () => e.value
354
609
  };
355
610
  }
356
- function So(e, t = {}) {
357
- const { floatingContext: n, treeContext: o } = et(e), {
611
+ function Oo(e, t = {}) {
612
+ const { floatingContext: n, treeContext: o } = Fe(e), {
358
613
  open: i,
359
- setOpen: s,
614
+ setOpen: l,
360
615
  refs: { floatingEl: r, anchorEl: a }
361
- } = n, { enabled: u = !0, requireFocusVisible: c = !0 } = t, f = I(() => a.value ? a.value instanceof HTMLElement ? a.value : a.value.contextElement : null);
362
- let d = !1, p = !0, h;
363
- K(window, "blur", () => {
364
- !i.value && f.value && f.value === document.activeElement && (d = !0);
365
- }), K(window, "focus", () => {
366
- d = !1;
367
- }), nn(() => {
368
- pt() && vt() && (K(
616
+ } = n, { enabled: f = !0, requireFocusVisible: c = !0 } = t, u = N(() => a.value ? a.value instanceof HTMLElement ? a.value : a.value.contextElement : null);
617
+ let p = !1, h = !0, d;
618
+ q(window, "blur", () => {
619
+ !i.value && u.value && u.value === document.activeElement && (p = !0);
620
+ }), q(window, "focus", () => {
621
+ p = !1;
622
+ }), Gt(() => {
623
+ st() && lt() && (q(
369
624
  window,
370
625
  "keydown",
371
626
  () => {
372
- p = !0;
627
+ h = !0;
373
628
  },
374
629
  { capture: !0 }
375
- ), K(
630
+ ), q(
376
631
  window,
377
632
  "pointerdown",
378
633
  () => {
379
- p = !1;
634
+ h = !1;
380
635
  },
381
636
  { capture: !0 }
382
637
  ));
383
638
  });
384
- function b(g) {
385
- if (d) {
386
- d = !1;
639
+ function m(v) {
640
+ if (p) {
641
+ p = !1;
387
642
  return;
388
643
  }
389
- const y = g.target;
390
- if (M(c) && y) {
391
- if (pt() && vt() && !g.relatedTarget) {
392
- if (!p && !Bt(y))
644
+ const x = v.target;
645
+ if (A(c) && x) {
646
+ if (st() && lt() && !v.relatedTarget) {
647
+ if (!h && !At(x))
393
648
  return;
394
- } else if (!dn(y))
649
+ } else if (!sn(x))
395
650
  return;
396
651
  }
397
- s(!0);
652
+ l(!0);
398
653
  }
399
- function v(g) {
400
- clearTimeout(h), h = window.setTimeout(() => {
401
- var x;
402
- const C = (((x = f.value) == null ? void 0 : x.ownerDocument) ?? document).activeElement;
403
- if (!(!g.relatedTarget && C === f.value)) {
654
+ function g(v) {
655
+ clearTimeout(d), d = window.setTimeout(() => {
656
+ var C;
657
+ const T = (((C = u.value) == null ? void 0 : C.ownerDocument) ?? document).activeElement;
658
+ if (!(!v.relatedTarget && T === u.value)) {
404
659
  if (o) {
405
- if (C && xn(o, C))
660
+ if (T && vn(o, T))
406
661
  return;
407
- } else if (r.value && C && r.value.contains(C))
662
+ } else if (r.value && T && r.value.contains(T))
408
663
  return;
409
- s(!1);
664
+ l(!1);
410
665
  }
411
666
  }, 0);
412
667
  }
413
- Ee(() => {
414
- if (!M(u)) return;
415
- const g = f.value;
416
- !g || !(g instanceof HTMLElement) || (g.addEventListener("focus", b), g.addEventListener("blur", v), ce(() => {
417
- g.removeEventListener("focus", b), g.removeEventListener("blur", v);
668
+ Ce(() => {
669
+ if (!A(f)) return;
670
+ const v = u.value;
671
+ !v || !(v instanceof HTMLElement) || (v.addEventListener("focus", m), v.addEventListener("blur", g), ue(() => {
672
+ v.removeEventListener("focus", m), v.removeEventListener("blur", g);
418
673
  }));
419
- }), ge(() => {
420
- clearTimeout(h);
674
+ }), we(() => {
675
+ clearTimeout(d);
421
676
  });
422
677
  }
423
- function xn(e, t) {
424
- return J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) ? !0 : It(e, t) !== null;
678
+ function vn(e, t) {
679
+ return J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) ? !0 : Dt(e, t) !== null;
425
680
  }
426
- function It(e, t) {
681
+ function Dt(e, t) {
427
682
  for (const n of e.children.value)
428
683
  if (n.data.open.value) {
429
684
  if (J(t, n.data.refs.anchorEl.value) || J(t, n.data.refs.floatingEl.value))
430
685
  return n;
431
- const o = It(n, t);
686
+ const o = Dt(n, t);
432
687
  if (o) return o;
433
688
  }
434
689
  return null;
435
690
  }
436
- let En = 0;
437
- function Tn() {
438
- return `vfloat-id-${En++}`;
691
+ let gn = 0;
692
+ function wn() {
693
+ return `vfloat-id-${gn++}`;
439
694
  }
440
- function Et(e) {
695
+ function ht(e) {
441
696
  return typeof e == "object" && e instanceof HTMLElement;
442
697
  }
443
- function Wt(e) {
698
+ function Nt(e) {
444
699
  return e.children.value.some(
445
- (t) => t.data.open.value || Wt(t)
700
+ (t) => t.data.open.value || Nt(t)
446
701
  );
447
702
  }
448
- function Cn(e, t) {
703
+ function yn(e, t) {
449
704
  return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
450
705
  }
451
- function Tt(e, t) {
706
+ function mt(e, t) {
452
707
  const [n, o] = e;
453
708
  let i = !1;
454
- const s = t.length;
455
- for (let r = 0, a = s - 1; r < s; a = r++) {
456
- const [u, c] = t[r] || [0, 0], [f, d] = t[a] || [0, 0];
457
- c >= o != d >= o && n <= (f - u) * (o - c) / (d - c) + u && (i = !i);
709
+ const l = t.length;
710
+ for (let r = 0, a = l - 1; r < l; a = r++) {
711
+ const [f, c] = t[r] || [0, 0], [u, p] = t[a] || [0, 0];
712
+ c >= o != p >= o && n <= (u - f) * (o - c) / (p - c) + f && (i = !i);
458
713
  }
459
714
  return i;
460
715
  }
461
- function Ln(e = {}) {
716
+ function bn(e = {}) {
462
717
  const { blockPointerEvents: t = !1, requireIntent: n = !0 } = e;
463
718
  let o = -1, i = !1;
464
- function s(a, u, c, f, d) {
465
- const p = bt(), h = p - d;
466
- if (c === null || f === null || h === 0)
719
+ function l(a, f, c, u, p) {
720
+ const h = ft(), d = h - p;
721
+ if (c === null || u === null || d === 0)
467
722
  return {
468
723
  speed: null,
469
724
  lastX: a,
470
- lastY: u,
471
- lastCursorTime: p
725
+ lastY: f,
726
+ lastCursorTime: h
472
727
  };
473
- const b = a - c, v = u - f;
728
+ const m = a - c, g = f - u;
474
729
  return {
475
- speed: Math.sqrt(b * b + v * v) / h,
730
+ speed: Math.sqrt(m * m + g * g) / d,
476
731
  lastX: a,
477
- lastY: u,
478
- lastCursorTime: p
732
+ lastY: f,
733
+ lastCursorTime: h
479
734
  };
480
735
  }
481
- const r = function(u) {
482
- const { x: c, y: f, placement: d, elements: p, buffer: h, onClose: b, nodeId: v, tree: g } = u, y = I(() => {
483
- const m = p.domReference;
484
- return Et(m) ? m : (m == null ? void 0 : m.contextElement) ?? null;
736
+ const r = function(f) {
737
+ const { x: c, y: u, placement: p, elements: h, buffer: d, onClose: m, nodeId: g, tree: v } = f, x = N(() => {
738
+ const w = h.domReference;
739
+ return ht(w) ? w : (w == null ? void 0 : w.contextElement) ?? null;
485
740
  });
486
- let C = null, x = null, O = bt();
487
- return function(A) {
488
- var Ae, lt, at, ct, ut, ft, dt;
489
- function S() {
490
- xt(o), o = -1, b();
741
+ let T = null, C = null, S = ft();
742
+ return function(b) {
743
+ var Se, et, tt, nt, ot, it, rt;
744
+ function P() {
745
+ dt(o), o = -1, m();
491
746
  }
492
- if (xt(o), o = -1, !p.domReference || !p.floating || d == null || c == null || f == null)
747
+ if (dt(o), o = -1, !h.domReference || !h.floating || p == null || c == null || u == null)
493
748
  return;
494
- const { clientX: R, clientY: N } = A, L = [R, N], D = vn(A), W = A.type === "mouseleave", X = p.floating && ze(p.floating, D), k = y.value && ze(y.value, D), E = (Ae = y.value) == null ? void 0 : Ae.getBoundingClientRect(), l = (lt = p.floating) == null ? void 0 : lt.getBoundingClientRect(), F = d.split("-")[0], w = c > ((l == null ? void 0 : l.right) ?? 0) - ((l == null ? void 0 : l.width) ?? 0) / 2, H = f > ((l == null ? void 0 : l.bottom) ?? 0) - ((l == null ? void 0 : l.height) ?? 0) / 2, ee = E ? Cn(L, E) : !1, V = ((l == null ? void 0 : l.width) ?? 0) > ((E == null ? void 0 : E.width) ?? 0), T = ((l == null ? void 0 : l.height) ?? 0) > ((E == null ? void 0 : E.height) ?? 0), $ = ((at = V ? E : l) == null ? void 0 : at.left) ?? 0, ie = ((ct = V ? E : l) == null ? void 0 : ct.right) ?? 0, _ = ((ut = T ? E : l) == null ? void 0 : ut.top) ?? 0, re = ((ft = T ? E : l) == null ? void 0 : ft.bottom) ?? 0;
749
+ const { clientX: F, clientY: D } = b, M = [F, D], B = cn(b), W = b.type === "mouseleave", X = h.floating && Ve(h.floating, B), R = x.value && Ve(x.value, B), E = (Se = x.value) == null ? void 0 : Se.getBoundingClientRect(), s = (et = h.floating) == null ? void 0 : et.getBoundingClientRect(), k = p.split("-")[0], y = c > ((s == null ? void 0 : s.right) ?? 0) - ((s == null ? void 0 : s.width) ?? 0) / 2, H = u > ((s == null ? void 0 : s.bottom) ?? 0) - ((s == null ? void 0 : s.height) ?? 0) / 2, ee = E ? yn(M, E) : !1, $ = ((s == null ? void 0 : s.width) ?? 0) > ((E == null ? void 0 : E.width) ?? 0), O = ((s == null ? void 0 : s.height) ?? 0) > ((E == null ? void 0 : E.height) ?? 0), V = ((tt = $ ? E : s) == null ? void 0 : tt.left) ?? 0, re = ((nt = $ ? E : s) == null ? void 0 : nt.right) ?? 0, z = ((ot = O ? E : s) == null ? void 0 : ot.top) ?? 0, se = ((it = O ? E : s) == null ? void 0 : it.bottom) ?? 0;
495
750
  if (X && (i = !0, !W))
496
751
  return;
497
- if (k && (i = !1), k && !W) {
752
+ if (R && (i = !1), R && !W) {
498
753
  i = !0;
499
754
  return;
500
755
  }
501
- if (W && Et(A.relatedTarget) && p.floating && ze(p.floating, A.relatedTarget))
756
+ if (W && ht(b.relatedTarget) && h.floating && Ve(h.floating, b.relatedTarget))
502
757
  return;
503
- if (g && v) {
504
- const B = g.nodes.get(v);
505
- if (B && Wt(B))
758
+ if (v && g) {
759
+ const I = v.nodes.get(g);
760
+ if (I && Nt(I))
506
761
  return;
507
762
  }
508
- if (F === "top" && f >= ((E == null ? void 0 : E.bottom) ?? 0) - 1 || F === "bottom" && f <= ((E == null ? void 0 : E.top) ?? 0) + 1 || F === "left" && c >= ((E == null ? void 0 : E.right) ?? 0) - 1 || F === "right" && c <= ((E == null ? void 0 : E.left) ?? 0) + 1)
509
- return S();
763
+ if (k === "top" && u >= ((E == null ? void 0 : E.bottom) ?? 0) - 1 || k === "bottom" && u <= ((E == null ? void 0 : E.top) ?? 0) + 1 || k === "left" && c >= ((E == null ? void 0 : E.right) ?? 0) - 1 || k === "right" && c <= ((E == null ? void 0 : E.left) ?? 0) + 1)
764
+ return P();
510
765
  let te = [];
511
- switch (F) {
766
+ switch (k) {
512
767
  case "top":
513
768
  te = [
514
- [$, ((E == null ? void 0 : E.top) ?? 0) + 1],
515
- [$, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
516
- [ie, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
517
- [ie, ((E == null ? void 0 : E.top) ?? 0) + 1]
769
+ [V, ((E == null ? void 0 : E.top) ?? 0) + 1],
770
+ [V, ((s == null ? void 0 : s.bottom) ?? 0) - 1],
771
+ [re, ((s == null ? void 0 : s.bottom) ?? 0) - 1],
772
+ [re, ((E == null ? void 0 : E.top) ?? 0) + 1]
518
773
  ];
519
774
  break;
520
775
  case "bottom":
521
776
  te = [
522
- [$, ((l == null ? void 0 : l.top) ?? 0) + 1],
523
- [$, ((E == null ? void 0 : E.bottom) ?? 0) - 1],
524
- [ie, ((E == null ? void 0 : E.bottom) ?? 0) - 1],
525
- [ie, ((l == null ? void 0 : l.top) ?? 0) + 1]
777
+ [V, ((s == null ? void 0 : s.top) ?? 0) + 1],
778
+ [V, ((E == null ? void 0 : E.bottom) ?? 0) - 1],
779
+ [re, ((E == null ? void 0 : E.bottom) ?? 0) - 1],
780
+ [re, ((s == null ? void 0 : s.top) ?? 0) + 1]
526
781
  ];
527
782
  break;
528
783
  case "left":
529
784
  te = [
530
- [((l == null ? void 0 : l.right) ?? 0) - 1, re],
531
- [((l == null ? void 0 : l.right) ?? 0) - 1, _],
532
- [((E == null ? void 0 : E.left) ?? 0) + 1, _],
533
- [((E == null ? void 0 : E.left) ?? 0) + 1, re]
785
+ [((s == null ? void 0 : s.right) ?? 0) - 1, se],
786
+ [((s == null ? void 0 : s.right) ?? 0) - 1, z],
787
+ [((E == null ? void 0 : E.left) ?? 0) + 1, z],
788
+ [((E == null ? void 0 : E.left) ?? 0) + 1, se]
534
789
  ];
535
790
  break;
536
791
  case "right":
537
792
  te = [
538
- [((E == null ? void 0 : E.right) ?? 0) - 1, re],
539
- [((E == null ? void 0 : E.right) ?? 0) - 1, _],
540
- [((l == null ? void 0 : l.left) ?? 0) + 1, _],
541
- [((l == null ? void 0 : l.left) ?? 0) + 1, re]
793
+ [((E == null ? void 0 : E.right) ?? 0) - 1, se],
794
+ [((E == null ? void 0 : E.right) ?? 0) - 1, z],
795
+ [((s == null ? void 0 : s.left) ?? 0) + 1, z],
796
+ [((s == null ? void 0 : s.left) ?? 0) + 1, se]
542
797
  ];
543
798
  break;
544
799
  }
545
- function Se([B, Y]) {
546
- const P = h;
547
- switch (F) {
800
+ function Le([I, j]) {
801
+ const L = d;
802
+ switch (k) {
548
803
  case "top": {
549
- const se = [
550
- V ? B + P / 2 : w ? B + P * 4 : B - P * 4,
551
- Y + P + 1
552
- ], le = [
553
- V ? B - P / 2 : w ? B + P * 4 : B - P * 4,
554
- Y + P + 1
555
- ], me = [
804
+ const le = [
805
+ $ ? I + L / 2 : y ? I + L * 4 : I - L * 4,
806
+ j + L + 1
807
+ ], ae = [
808
+ $ ? I - L / 2 : y ? I + L * 4 : I - L * 4,
809
+ j + L + 1
810
+ ], pe = [
556
811
  [
557
- (l == null ? void 0 : l.left) ?? 0,
558
- w || V ? ((l == null ? void 0 : l.bottom) ?? 0) - P : (l == null ? void 0 : l.top) ?? 0
812
+ (s == null ? void 0 : s.left) ?? 0,
813
+ y || $ ? ((s == null ? void 0 : s.bottom) ?? 0) - L : (s == null ? void 0 : s.top) ?? 0
559
814
  ],
560
815
  [
561
- (l == null ? void 0 : l.right) ?? 0,
562
- w ? V ? ((l == null ? void 0 : l.bottom) ?? 0) - P : (l == null ? void 0 : l.top) ?? 0 : ((l == null ? void 0 : l.bottom) ?? 0) - P
816
+ (s == null ? void 0 : s.right) ?? 0,
817
+ y ? $ ? ((s == null ? void 0 : s.bottom) ?? 0) - L : (s == null ? void 0 : s.top) ?? 0 : ((s == null ? void 0 : s.bottom) ?? 0) - L
563
818
  ]
564
819
  ];
565
- return [se, le, ...me];
820
+ return [le, ae, ...pe];
566
821
  }
567
822
  case "bottom": {
568
- const se = [
569
- V ? B + P / 2 : w ? B + P * 4 : B - P * 4,
570
- Y - P
571
- ], le = [
572
- V ? B - P / 2 : w ? B + P * 4 : B - P * 4,
573
- Y - P
574
- ], me = [
823
+ const le = [
824
+ $ ? I + L / 2 : y ? I + L * 4 : I - L * 4,
825
+ j - L
826
+ ], ae = [
827
+ $ ? I - L / 2 : y ? I + L * 4 : I - L * 4,
828
+ j - L
829
+ ], pe = [
575
830
  [
576
- (l == null ? void 0 : l.left) ?? 0,
577
- w || V ? ((l == null ? void 0 : l.top) ?? 0) + P : (l == null ? void 0 : l.bottom) ?? 0
831
+ (s == null ? void 0 : s.left) ?? 0,
832
+ y || $ ? ((s == null ? void 0 : s.top) ?? 0) + L : (s == null ? void 0 : s.bottom) ?? 0
578
833
  ],
579
834
  [
580
- (l == null ? void 0 : l.right) ?? 0,
581
- w ? V ? ((l == null ? void 0 : l.top) ?? 0) + P : (l == null ? void 0 : l.bottom) ?? 0 : ((l == null ? void 0 : l.top) ?? 0) + P
835
+ (s == null ? void 0 : s.right) ?? 0,
836
+ y ? $ ? ((s == null ? void 0 : s.top) ?? 0) + L : (s == null ? void 0 : s.bottom) ?? 0 : ((s == null ? void 0 : s.top) ?? 0) + L
582
837
  ]
583
838
  ];
584
- return [se, le, ...me];
839
+ return [le, ae, ...pe];
585
840
  }
586
841
  case "left": {
587
- const se = [
588
- B + P + 1,
589
- T ? Y + P / 2 : H ? Y + P * 4 : Y - P * 4
590
- ], le = [
591
- B + P + 1,
592
- T ? Y - P / 2 : H ? Y + P * 4 : Y - P * 4
842
+ const le = [
843
+ I + L + 1,
844
+ O ? j + L / 2 : H ? j + L * 4 : j - L * 4
845
+ ], ae = [
846
+ I + L + 1,
847
+ O ? j - L / 2 : H ? j + L * 4 : j - L * 4
593
848
  ];
594
849
  return [...[
595
850
  [
596
- H || T ? ((l == null ? void 0 : l.right) ?? 0) - P : (l == null ? void 0 : l.left) ?? 0,
597
- (l == null ? void 0 : l.top) ?? 0
851
+ H || O ? ((s == null ? void 0 : s.right) ?? 0) - L : (s == null ? void 0 : s.left) ?? 0,
852
+ (s == null ? void 0 : s.top) ?? 0
598
853
  ],
599
854
  [
600
- H ? T ? ((l == null ? void 0 : l.right) ?? 0) - P : (l == null ? void 0 : l.left) ?? 0 : ((l == null ? void 0 : l.right) ?? 0) - P,
601
- (l == null ? void 0 : l.bottom) ?? 0
855
+ H ? O ? ((s == null ? void 0 : s.right) ?? 0) - L : (s == null ? void 0 : s.left) ?? 0 : ((s == null ? void 0 : s.right) ?? 0) - L,
856
+ (s == null ? void 0 : s.bottom) ?? 0
602
857
  ]
603
- ], se, le];
858
+ ], le, ae];
604
859
  }
605
860
  case "right": {
606
- const se = [
607
- B - P,
608
- T ? Y + P / 2 : H ? Y + P * 4 : Y - P * 4
609
- ], le = [
610
- B - P,
611
- T ? Y - P / 2 : H ? Y + P * 4 : Y - P * 4
612
- ], me = [
861
+ const le = [
862
+ I - L,
863
+ O ? j + L / 2 : H ? j + L * 4 : j - L * 4
864
+ ], ae = [
865
+ I - L,
866
+ O ? j - L / 2 : H ? j + L * 4 : j - L * 4
867
+ ], pe = [
613
868
  [
614
- H || T ? ((l == null ? void 0 : l.left) ?? 0) + P : (l == null ? void 0 : l.right) ?? 0,
615
- (l == null ? void 0 : l.top) ?? 0
869
+ H || O ? ((s == null ? void 0 : s.left) ?? 0) + L : (s == null ? void 0 : s.right) ?? 0,
870
+ (s == null ? void 0 : s.top) ?? 0
616
871
  ],
617
872
  [
618
- H ? T ? ((l == null ? void 0 : l.left) ?? 0) + P : (l == null ? void 0 : l.right) ?? 0 : ((l == null ? void 0 : l.left) ?? 0) + P,
619
- (l == null ? void 0 : l.bottom) ?? 0
873
+ H ? O ? ((s == null ? void 0 : s.left) ?? 0) + L : (s == null ? void 0 : s.right) ?? 0 : ((s == null ? void 0 : s.left) ?? 0) + L,
874
+ (s == null ? void 0 : s.bottom) ?? 0
620
875
  ]
621
876
  ];
622
- return [se, le, ...me];
877
+ return [le, ae, ...pe];
623
878
  }
624
879
  }
625
880
  }
626
- const he = Se([c, f]);
627
- if ((dt = e.onPolygonChange) == null || dt.call(e, he), !Tt(L, te)) {
628
- if (Tt(L, he)) {
881
+ const me = Le([c, u]);
882
+ if ((rt = e.onPolygonChange) == null || rt.call(e, me), !mt(M, te)) {
883
+ if (mt(M, me)) {
629
884
  if (!i && n) {
630
- const B = s(
631
- A.clientX,
632
- A.clientY,
885
+ const I = l(
886
+ b.clientX,
887
+ b.clientY,
888
+ T,
633
889
  C,
634
- x,
635
- O
890
+ S
636
891
  );
637
- C = B.lastX, x = B.lastY, O = B.lastCursorTime, B.speed !== null && B.speed < 0.1 && (o = window.setTimeout(S, 40));
892
+ T = I.lastX, C = I.lastY, S = I.lastCursorTime, I.speed !== null && I.speed < 0.1 && (o = window.setTimeout(P, 40));
638
893
  }
639
894
  return;
640
895
  }
641
896
  if (i && !ee)
642
- return S();
643
- S();
897
+ return P();
898
+ P();
644
899
  }
645
900
  };
646
901
  };
@@ -648,240 +903,240 @@ function Ln(e = {}) {
648
903
  blockPointerEvents: t
649
904
  }, r;
650
905
  }
651
- const Ct = 10;
652
- function Pn(e, t, n) {
653
- const { delay: o } = n, i = I(() => {
654
- const c = M(o);
906
+ const pt = 10;
907
+ function xn(e, t, n) {
908
+ const { delay: o } = n, i = N(() => {
909
+ const c = A(o);
655
910
  return (typeof c == "number" ? c : c.open) ?? 0;
656
- }), s = I(() => {
657
- const c = M(o);
911
+ }), l = N(() => {
912
+ const c = A(o);
658
913
  return (typeof c == "number" ? c : c.close) ?? 0;
659
914
  });
660
915
  let r, a;
661
- const u = () => {
916
+ const f = () => {
662
917
  clearTimeout(r), clearTimeout(a);
663
918
  };
664
- return ge(u), {
919
+ return we(f), {
665
920
  show: (c) => {
666
- u();
667
- const f = c ?? i.value;
668
- f === 0 ? e() : r = setTimeout(e, f);
921
+ f();
922
+ const u = c ?? i.value;
923
+ u === 0 ? e() : r = setTimeout(e, u);
669
924
  },
670
925
  hide: (c) => {
671
- u();
672
- const f = c ?? s.value;
673
- f === 0 ? t() : a = setTimeout(t, f);
926
+ f();
927
+ const u = c ?? l.value;
928
+ u === 0 ? t() : a = setTimeout(t, u);
674
929
  },
675
930
  showDelay: i,
676
- hideDelay: s,
677
- clearTimeouts: u
931
+ hideDelay: l,
932
+ clearTimeouts: f
678
933
  };
679
934
  }
680
- function Ao(e, t = {}) {
681
- const { floatingContext: n, treeContext: o } = et(e), {
935
+ function Po(e, t = {}) {
936
+ const { floatingContext: n, treeContext: o } = Fe(e), {
682
937
  open: i,
683
- setOpen: s,
938
+ setOpen: l,
684
939
  refs: { anchorEl: r, floatingEl: a }
685
940
  } = n, {
686
- enabled: u = !0,
941
+ enabled: f = !0,
687
942
  delay: c = 0,
688
- restMs: f = 0,
689
- mouseOnly: d = !1,
690
- safePolygon: p = !1
691
- } = t, h = I(() => M(u)), b = I(() => M(f)), v = I(() => {
692
- const w = r.value;
693
- return !w || w instanceof HTMLElement ? w : w.contextElement ?? null;
694
- }), { hide: g, show: y, showDelay: C, clearTimeouts: x } = Pn(
943
+ restMs: u = 0,
944
+ mouseOnly: p = !1,
945
+ safePolygon: h = !1
946
+ } = t, d = N(() => A(f)), m = N(() => A(u)), g = N(() => {
947
+ const y = r.value;
948
+ return !y || y instanceof HTMLElement ? y : y.contextElement ?? null;
949
+ }), { hide: v, show: x, showDelay: T, clearTimeouts: C } = xn(
695
950
  () => {
696
- i.value || s(!0);
951
+ i.value || l(!0);
697
952
  },
698
953
  () => {
699
- i.value && s(!1);
954
+ i.value && l(!1);
700
955
  },
701
956
  { delay: c }
702
957
  );
703
- let O = null, m;
704
- const A = I(() => C.value === 0 && b.value > 0);
705
- function S(w) {
706
- if (!h.value || !L(w) || !A.value || !O) return;
707
- const H = { x: w.clientX, y: w.clientY }, ee = Math.abs(H.x - O.x), V = Math.abs(H.y - O.y);
708
- (ee > Ct || V > Ct) && (O = H, clearTimeout(m), m = setTimeout(() => {
709
- y(0);
710
- }, b.value));
711
- }
712
- function R(w) {
713
- !h.value || !L(w) || !A.value || (O = { x: w.clientX, y: w.clientY }, m = setTimeout(() => {
714
- y(0);
715
- }, b.value));
716
- }
717
- function N() {
718
- clearTimeout(m), O = null;
719
- }
720
- Ee(() => {
721
- const w = v.value;
722
- !w || !h.value || !A.value || (w.addEventListener("pointerenter", R), w.addEventListener("pointermove", S), w.addEventListener("pointerleave", N), ce(() => {
723
- w.removeEventListener("pointerenter", R), w.removeEventListener("pointermove", S), w.removeEventListener("pointerleave", N);
958
+ let S = null, w;
959
+ const b = N(() => T.value === 0 && m.value > 0);
960
+ function P(y) {
961
+ if (!d.value || !M(y) || !b.value || !S) return;
962
+ const H = { x: y.clientX, y: y.clientY }, ee = Math.abs(H.x - S.x), $ = Math.abs(H.y - S.y);
963
+ (ee > pt || $ > pt) && (S = H, clearTimeout(w), w = setTimeout(() => {
964
+ x(0);
965
+ }, m.value));
966
+ }
967
+ function F(y) {
968
+ !d.value || !M(y) || !b.value || (S = { x: y.clientX, y: y.clientY }, w = setTimeout(() => {
969
+ x(0);
970
+ }, m.value));
971
+ }
972
+ function D() {
973
+ clearTimeout(w), S = null;
974
+ }
975
+ Ce(() => {
976
+ const y = g.value;
977
+ !y || !d.value || !b.value || (y.addEventListener("pointerenter", F), y.addEventListener("pointermove", P), y.addEventListener("pointerleave", D), ue(() => {
978
+ y.removeEventListener("pointerenter", F), y.removeEventListener("pointermove", P), y.removeEventListener("pointerleave", D);
724
979
  }));
725
- }), ge(() => {
726
- clearTimeout(m);
980
+ }), we(() => {
981
+ clearTimeout(w);
727
982
  });
728
- function L(w) {
729
- return M(d) ? w.pointerType === "mouse" : !0;
983
+ function M(y) {
984
+ return A(p) ? y.pointerType === "mouse" : !0;
730
985
  }
731
- function D(w) {
732
- !h.value || !L(w) || A.value || (k(), y());
986
+ function B(y) {
987
+ !d.value || !M(y) || b.value || (R(), x());
733
988
  }
734
- function W(w) {
735
- !h.value || !L(w) || (x(), k());
989
+ function W(y) {
990
+ !d.value || !M(y) || (C(), R());
736
991
  }
737
992
  let X = null;
738
- function k() {
993
+ function R() {
739
994
  X && (document.removeEventListener("pointermove", X), X = null);
740
- const w = l.value;
741
- w != null && w.onPolygonChange && w.onPolygonChange([]);
995
+ const y = s.value;
996
+ y != null && y.onPolygonChange && y.onPolygonChange([]);
742
997
  }
743
- const E = I(() => !!M(p)), l = I(() => {
744
- const w = M(p);
745
- if (typeof w == "object" && w) return w;
746
- if (w === !0) return {};
998
+ const E = N(() => !!A(h)), s = N(() => {
999
+ const y = A(h);
1000
+ if (typeof y == "object" && y) return y;
1001
+ if (y === !0) return {};
747
1002
  });
748
- function F(w) {
749
- var T;
750
- if (!h.value || !L(w)) return;
751
- const { clientX: H, clientY: ee } = w, V = w.relatedTarget;
1003
+ function k(y) {
1004
+ var O;
1005
+ if (!d.value || !M(y)) return;
1006
+ const { clientX: H, clientY: ee } = y, $ = y.relatedTarget;
752
1007
  if (E.value)
753
1008
  setTimeout(() => {
754
1009
  var te;
755
- k();
756
- const $ = v.value, ie = a.value;
757
- if (!$ || !ie) {
758
- g();
1010
+ R();
1011
+ const V = g.value, re = a.value;
1012
+ if (!V || !re) {
1013
+ v();
759
1014
  return;
760
1015
  }
761
- let _, re;
1016
+ let z, se;
762
1017
  if (o) {
763
- _ = /* @__PURE__ */ new Map();
764
- const Se = (he) => {
765
- _ == null || _.set(he.id, he);
766
- for (const Ae of he.children.value)
767
- Se(Ae);
1018
+ z = /* @__PURE__ */ new Map();
1019
+ const Le = (me) => {
1020
+ z == null || z.set(me.id, me);
1021
+ for (const Se of me.children.value)
1022
+ Le(Se);
768
1023
  };
769
- Se(o), re = o.id;
1024
+ Le(o), se = o.id;
770
1025
  }
771
- X = Ln(l.value)({
1026
+ X = bn(s.value)({
772
1027
  x: H,
773
1028
  y: ee,
774
1029
  placement: n.placement.value,
775
1030
  elements: {
776
- domReference: $,
777
- floating: ie
1031
+ domReference: V,
1032
+ floating: re
778
1033
  },
779
- buffer: ((te = l.value) == null ? void 0 : te.buffer) ?? 1,
1034
+ buffer: ((te = s.value) == null ? void 0 : te.buffer) ?? 1,
780
1035
  onClose: () => {
781
- k(), g();
1036
+ R(), v();
782
1037
  },
783
- nodeId: re,
784
- tree: _ ? { nodes: _ } : void 0
1038
+ nodeId: se,
1039
+ tree: z ? { nodes: z } : void 0
785
1040
  }), X && document.addEventListener("pointermove", X);
786
1041
  }, 0);
787
1042
  else {
788
1043
  if (o) {
789
- if (!On(o, V))
1044
+ if (!En(o, $))
790
1045
  return;
791
- } else if ((T = a.value) != null && T.contains(V))
1046
+ } else if ((O = a.value) != null && O.contains($))
792
1047
  return;
793
- g();
1048
+ v();
794
1049
  }
795
1050
  }
796
- Ee(() => {
797
- const w = v.value;
798
- !w || !h.value || (w.addEventListener("pointerenter", D), w.addEventListener("pointerleave", F), ce(() => {
799
- w.removeEventListener("pointerenter", D), w.removeEventListener("pointerleave", F);
1051
+ Ce(() => {
1052
+ const y = g.value;
1053
+ !y || !d.value || (y.addEventListener("pointerenter", B), y.addEventListener("pointerleave", k), ue(() => {
1054
+ y.removeEventListener("pointerenter", B), y.removeEventListener("pointerleave", k);
800
1055
  }));
801
- }), Ee(() => {
802
- const w = a.value;
803
- !w || !h.value || (w.addEventListener("pointerenter", W), w.addEventListener("pointerleave", F), ce(() => {
804
- w.removeEventListener("pointerenter", W), w.removeEventListener("pointerleave", F);
1056
+ }), Ce(() => {
1057
+ const y = a.value;
1058
+ !y || !d.value || (y.addEventListener("pointerenter", W), y.addEventListener("pointerleave", k), ue(() => {
1059
+ y.removeEventListener("pointerenter", W), y.removeEventListener("pointerleave", k);
805
1060
  }));
806
- }), ge(() => {
807
- k();
1061
+ }), we(() => {
1062
+ R();
808
1063
  });
809
1064
  }
810
- function On(e, t) {
811
- return t ? !(J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) || tt(e, t)) : !0;
1065
+ function En(e, t) {
1066
+ return t ? !(J(t, e.data.refs.anchorEl.value) || J(t, e.data.refs.floatingEl.value) || Ke(e, t)) : !0;
812
1067
  }
813
- const Mn = ["top", "right", "bottom", "left"], we = Math.min, ue = Math.max, Re = Math.round, De = Math.floor, G = (e) => ({
1068
+ const Cn = ["top", "right", "bottom", "left"], ye = Math.min, fe = Math.max, De = Math.round, Me = Math.floor, G = (e) => ({
814
1069
  x: e,
815
1070
  y: e
816
- }), Sn = {
1071
+ }), Tn = {
817
1072
  left: "right",
818
1073
  right: "left",
819
1074
  bottom: "top",
820
1075
  top: "bottom"
821
- }, An = {
1076
+ }, On = {
822
1077
  start: "end",
823
1078
  end: "start"
824
1079
  };
825
- function Ge(e, t, n) {
826
- return ue(e, we(t, n));
1080
+ function ze(e, t, n) {
1081
+ return fe(e, ye(t, n));
827
1082
  }
828
- function be(e, t) {
1083
+ function xe(e, t) {
829
1084
  return typeof e == "function" ? e(t) : e;
830
1085
  }
831
- function fe(e) {
1086
+ function de(e) {
832
1087
  return e.split("-")[0];
833
1088
  }
834
1089
  function Oe(e) {
835
1090
  return e.split("-")[1];
836
1091
  }
837
- function Vt(e) {
1092
+ function Rt(e) {
838
1093
  return e === "x" ? "y" : "x";
839
1094
  }
840
- function nt(e) {
1095
+ function qe(e) {
841
1096
  return e === "y" ? "height" : "width";
842
1097
  }
843
- const Nn = /* @__PURE__ */ new Set(["top", "bottom"]);
844
- function ne(e) {
845
- return Nn.has(fe(e)) ? "y" : "x";
1098
+ const Pn = /* @__PURE__ */ new Set(["top", "bottom"]);
1099
+ function oe(e) {
1100
+ return Pn.has(de(e)) ? "y" : "x";
846
1101
  }
847
- function ot(e) {
848
- return Vt(ne(e));
1102
+ function Ge(e) {
1103
+ return Rt(oe(e));
849
1104
  }
850
- function Dn(e, t, n) {
1105
+ function Ln(e, t, n) {
851
1106
  n === void 0 && (n = !1);
852
- const o = Oe(e), i = ot(e), s = nt(i);
1107
+ const o = Oe(e), i = Ge(e), l = qe(i);
853
1108
  let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
854
- return t.reference[s] > t.floating[s] && (r = ke(r)), [r, ke(r)];
1109
+ return t.reference[l] > t.floating[l] && (r = Ne(r)), [r, Ne(r)];
855
1110
  }
856
- function Rn(e) {
857
- const t = ke(e);
858
- return [Je(e), t, Je(t)];
1111
+ function Sn(e) {
1112
+ const t = Ne(e);
1113
+ return [_e(e), t, _e(t)];
859
1114
  }
860
- function Je(e) {
861
- return e.replace(/start|end/g, (t) => An[t]);
1115
+ function _e(e) {
1116
+ return e.replace(/start|end/g, (t) => On[t]);
862
1117
  }
863
- const Lt = ["left", "right"], Pt = ["right", "left"], kn = ["top", "bottom"], Fn = ["bottom", "top"];
864
- function Hn(e, t, n) {
1118
+ const vt = ["left", "right"], gt = ["right", "left"], An = ["top", "bottom"], Mn = ["bottom", "top"];
1119
+ function Dn(e, t, n) {
865
1120
  switch (e) {
866
1121
  case "top":
867
1122
  case "bottom":
868
- return n ? t ? Pt : Lt : t ? Lt : Pt;
1123
+ return n ? t ? gt : vt : t ? vt : gt;
869
1124
  case "left":
870
1125
  case "right":
871
- return t ? kn : Fn;
1126
+ return t ? An : Mn;
872
1127
  default:
873
1128
  return [];
874
1129
  }
875
1130
  }
876
- function Bn(e, t, n, o) {
1131
+ function Nn(e, t, n, o) {
877
1132
  const i = Oe(e);
878
- let s = Hn(fe(e), n === "start", o);
879
- return i && (s = s.map((r) => r + "-" + i), t && (s = s.concat(s.map(Je)))), s;
1133
+ let l = Dn(de(e), n === "start", o);
1134
+ return i && (l = l.map((r) => r + "-" + i), t && (l = l.concat(l.map(_e)))), l;
880
1135
  }
881
- function ke(e) {
882
- return e.replace(/left|right|bottom|top/g, (t) => Sn[t]);
1136
+ function Ne(e) {
1137
+ return e.replace(/left|right|bottom|top/g, (t) => Tn[t]);
883
1138
  }
884
- function In(e) {
1139
+ function Rn(e) {
885
1140
  return {
886
1141
  top: 0,
887
1142
  right: 0,
@@ -890,15 +1145,15 @@ function In(e) {
890
1145
  ...e
891
1146
  };
892
1147
  }
893
- function $t(e) {
894
- return typeof e != "number" ? In(e) : {
1148
+ function kt(e) {
1149
+ return typeof e != "number" ? Rn(e) : {
895
1150
  top: e,
896
1151
  right: e,
897
1152
  bottom: e,
898
1153
  left: e
899
1154
  };
900
1155
  }
901
- function Fe(e) {
1156
+ function Re(e) {
902
1157
  const {
903
1158
  x: t,
904
1159
  y: n,
@@ -916,85 +1171,85 @@ function Fe(e) {
916
1171
  y: n
917
1172
  };
918
1173
  }
919
- function Ot(e, t, n) {
1174
+ function wt(e, t, n) {
920
1175
  let {
921
1176
  reference: o,
922
1177
  floating: i
923
1178
  } = e;
924
- const s = ne(t), r = ot(t), a = nt(r), u = fe(t), c = s === "y", f = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[a] / 2 - i[a] / 2;
925
- let h;
926
- switch (u) {
1179
+ const l = oe(t), r = Ge(t), a = qe(r), f = de(t), c = l === "y", u = o.x + o.width / 2 - i.width / 2, p = o.y + o.height / 2 - i.height / 2, h = o[a] / 2 - i[a] / 2;
1180
+ let d;
1181
+ switch (f) {
927
1182
  case "top":
928
- h = {
929
- x: f,
1183
+ d = {
1184
+ x: u,
930
1185
  y: o.y - i.height
931
1186
  };
932
1187
  break;
933
1188
  case "bottom":
934
- h = {
935
- x: f,
1189
+ d = {
1190
+ x: u,
936
1191
  y: o.y + o.height
937
1192
  };
938
1193
  break;
939
1194
  case "right":
940
- h = {
1195
+ d = {
941
1196
  x: o.x + o.width,
942
- y: d
1197
+ y: p
943
1198
  };
944
1199
  break;
945
1200
  case "left":
946
- h = {
1201
+ d = {
947
1202
  x: o.x - i.width,
948
- y: d
1203
+ y: p
949
1204
  };
950
1205
  break;
951
1206
  default:
952
- h = {
1207
+ d = {
953
1208
  x: o.x,
954
1209
  y: o.y
955
1210
  };
956
1211
  }
957
1212
  switch (Oe(t)) {
958
1213
  case "start":
959
- h[r] -= p * (n && c ? -1 : 1);
1214
+ d[r] -= h * (n && c ? -1 : 1);
960
1215
  break;
961
1216
  case "end":
962
- h[r] += p * (n && c ? -1 : 1);
1217
+ d[r] += h * (n && c ? -1 : 1);
963
1218
  break;
964
1219
  }
965
- return h;
1220
+ return d;
966
1221
  }
967
- const Wn = async (e, t, n) => {
1222
+ const kn = async (e, t, n) => {
968
1223
  const {
969
1224
  placement: o = "bottom",
970
1225
  strategy: i = "absolute",
971
- middleware: s = [],
1226
+ middleware: l = [],
972
1227
  platform: r
973
- } = n, a = s.filter(Boolean), u = await (r.isRTL == null ? void 0 : r.isRTL(t));
1228
+ } = n, a = l.filter(Boolean), f = await (r.isRTL == null ? void 0 : r.isRTL(t));
974
1229
  let c = await r.getElementRects({
975
1230
  reference: e,
976
1231
  floating: t,
977
1232
  strategy: i
978
1233
  }), {
979
- x: f,
980
- y: d
981
- } = Ot(c, o, u), p = o, h = {}, b = 0;
982
- for (let v = 0; v < a.length; v++) {
1234
+ x: u,
1235
+ y: p
1236
+ } = wt(c, o, f), h = o, d = {}, m = 0;
1237
+ for (let g = 0; g < a.length; g++) {
983
1238
  const {
984
- name: g,
985
- fn: y
986
- } = a[v], {
987
- x: C,
988
- y: x,
989
- data: O,
990
- reset: m
991
- } = await y({
992
- x: f,
993
- y: d,
1239
+ name: v,
1240
+ fn: x
1241
+ } = a[g], {
1242
+ x: T,
1243
+ y: C,
1244
+ data: S,
1245
+ reset: w
1246
+ } = await x({
1247
+ x: u,
1248
+ y: p,
994
1249
  initialPlacement: o,
995
- placement: p,
1250
+ placement: h,
996
1251
  strategy: i,
997
- middlewareData: h,
1252
+ middlewareData: d,
998
1253
  rects: c,
999
1254
  platform: r,
1000
1255
  elements: {
@@ -1002,75 +1257,75 @@ const Wn = async (e, t, n) => {
1002
1257
  floating: t
1003
1258
  }
1004
1259
  });
1005
- f = C ?? f, d = x ?? d, h = {
1006
- ...h,
1007
- [g]: {
1008
- ...h[g],
1009
- ...O
1260
+ u = T ?? u, p = C ?? p, d = {
1261
+ ...d,
1262
+ [v]: {
1263
+ ...d[v],
1264
+ ...S
1010
1265
  }
1011
- }, m && b <= 50 && (b++, typeof m == "object" && (m.placement && (p = m.placement), m.rects && (c = m.rects === !0 ? await r.getElementRects({
1266
+ }, w && m <= 50 && (m++, typeof w == "object" && (w.placement && (h = w.placement), w.rects && (c = w.rects === !0 ? await r.getElementRects({
1012
1267
  reference: e,
1013
1268
  floating: t,
1014
1269
  strategy: i
1015
- }) : m.rects), {
1016
- x: f,
1017
- y: d
1018
- } = Ot(c, p, u)), v = -1);
1270
+ }) : w.rects), {
1271
+ x: u,
1272
+ y: p
1273
+ } = wt(c, h, f)), g = -1);
1019
1274
  }
1020
1275
  return {
1021
- x: f,
1022
- y: d,
1023
- placement: p,
1276
+ x: u,
1277
+ y: p,
1278
+ placement: h,
1024
1279
  strategy: i,
1025
- middlewareData: h
1280
+ middlewareData: d
1026
1281
  };
1027
1282
  };
1028
- async function He(e, t) {
1283
+ async function ke(e, t) {
1029
1284
  var n;
1030
1285
  t === void 0 && (t = {});
1031
1286
  const {
1032
1287
  x: o,
1033
1288
  y: i,
1034
- platform: s,
1289
+ platform: l,
1035
1290
  rects: r,
1036
1291
  elements: a,
1037
- strategy: u
1292
+ strategy: f
1038
1293
  } = e, {
1039
1294
  boundary: c = "clippingAncestors",
1040
- rootBoundary: f = "viewport",
1041
- elementContext: d = "floating",
1042
- altBoundary: p = !1,
1043
- padding: h = 0
1044
- } = be(t, e), b = $t(h), g = a[p ? d === "floating" ? "reference" : "floating" : d], y = Fe(await s.getClippingRect({
1045
- element: (n = await (s.isElement == null ? void 0 : s.isElement(g))) == null || n ? g : g.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
1295
+ rootBoundary: u = "viewport",
1296
+ elementContext: p = "floating",
1297
+ altBoundary: h = !1,
1298
+ padding: d = 0
1299
+ } = xe(t, e), m = kt(d), v = a[h ? p === "floating" ? "reference" : "floating" : p], x = Re(await l.getClippingRect({
1300
+ element: (n = await (l.isElement == null ? void 0 : l.isElement(v))) == null || n ? v : v.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(a.floating)),
1046
1301
  boundary: c,
1047
- rootBoundary: f,
1048
- strategy: u
1049
- })), C = d === "floating" ? {
1302
+ rootBoundary: u,
1303
+ strategy: f
1304
+ })), T = p === "floating" ? {
1050
1305
  x: o,
1051
1306
  y: i,
1052
1307
  width: r.floating.width,
1053
1308
  height: r.floating.height
1054
- } : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), O = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
1309
+ } : r.reference, C = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(a.floating)), S = await (l.isElement == null ? void 0 : l.isElement(C)) ? await (l.getScale == null ? void 0 : l.getScale(C)) || {
1055
1310
  x: 1,
1056
1311
  y: 1
1057
1312
  } : {
1058
1313
  x: 1,
1059
1314
  y: 1
1060
- }, m = Fe(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1315
+ }, w = Re(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
1061
1316
  elements: a,
1062
- rect: C,
1063
- offsetParent: x,
1064
- strategy: u
1065
- }) : C);
1317
+ rect: T,
1318
+ offsetParent: C,
1319
+ strategy: f
1320
+ }) : T);
1066
1321
  return {
1067
- top: (y.top - m.top + b.top) / O.y,
1068
- bottom: (m.bottom - y.bottom + b.bottom) / O.y,
1069
- left: (y.left - m.left + b.left) / O.x,
1070
- right: (m.right - y.right + b.right) / O.x
1322
+ top: (x.top - w.top + m.top) / S.y,
1323
+ bottom: (w.bottom - x.bottom + m.bottom) / S.y,
1324
+ left: (x.left - w.left + m.left) / S.x,
1325
+ right: (w.right - x.right + m.right) / S.x
1071
1326
  };
1072
1327
  }
1073
- const Vn = (e) => ({
1328
+ const Fn = (e) => ({
1074
1329
  name: "arrow",
1075
1330
  options: e,
1076
1331
  async fn(t) {
@@ -1078,36 +1333,36 @@ const Vn = (e) => ({
1078
1333
  x: n,
1079
1334
  y: o,
1080
1335
  placement: i,
1081
- rects: s,
1336
+ rects: l,
1082
1337
  platform: r,
1083
1338
  elements: a,
1084
- middlewareData: u
1339
+ middlewareData: f
1085
1340
  } = t, {
1086
1341
  element: c,
1087
- padding: f = 0
1088
- } = be(e, t) || {};
1342
+ padding: u = 0
1343
+ } = xe(e, t) || {};
1089
1344
  if (c == null)
1090
1345
  return {};
1091
- const d = $t(f), p = {
1346
+ const p = kt(u), h = {
1092
1347
  x: n,
1093
1348
  y: o
1094
- }, h = ot(i), b = nt(h), v = await r.getDimensions(c), g = h === "y", y = g ? "top" : "left", C = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", O = s.reference[b] + s.reference[h] - p[h] - s.floating[b], m = p[h] - s.reference[h], A = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
1095
- let S = A ? A[x] : 0;
1096
- (!S || !await (r.isElement == null ? void 0 : r.isElement(A))) && (S = a.floating[x] || s.floating[b]);
1097
- const R = O / 2 - m / 2, N = S / 2 - v[b] / 2 - 1, L = we(d[y], N), D = we(d[C], N), W = L, X = S - v[b] - D, k = S / 2 - v[b] / 2 + R, E = Ge(W, k, X), l = !u.arrow && Oe(i) != null && k !== E && s.reference[b] / 2 - (k < W ? L : D) - v[b] / 2 < 0, F = l ? k < W ? k - W : k - X : 0;
1349
+ }, d = Ge(i), m = qe(d), g = await r.getDimensions(c), v = d === "y", x = v ? "top" : "left", T = v ? "bottom" : "right", C = v ? "clientHeight" : "clientWidth", S = l.reference[m] + l.reference[d] - h[d] - l.floating[m], w = h[d] - l.reference[d], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
1350
+ let P = b ? b[C] : 0;
1351
+ (!P || !await (r.isElement == null ? void 0 : r.isElement(b))) && (P = a.floating[C] || l.floating[m]);
1352
+ const F = S / 2 - w / 2, D = P / 2 - g[m] / 2 - 1, M = ye(p[x], D), B = ye(p[T], D), W = M, X = P - g[m] - B, R = P / 2 - g[m] / 2 + F, E = ze(W, R, X), s = !f.arrow && Oe(i) != null && R !== E && l.reference[m] / 2 - (R < W ? M : B) - g[m] / 2 < 0, k = s ? R < W ? R - W : R - X : 0;
1098
1353
  return {
1099
- [h]: p[h] + F,
1354
+ [d]: h[d] + k,
1100
1355
  data: {
1101
- [h]: E,
1102
- centerOffset: k - E - F,
1103
- ...l && {
1104
- alignmentOffset: F
1356
+ [d]: E,
1357
+ centerOffset: R - E - k,
1358
+ ...s && {
1359
+ alignmentOffset: k
1105
1360
  }
1106
1361
  },
1107
- reset: l
1362
+ reset: s
1108
1363
  };
1109
1364
  }
1110
- }), $n = function(e) {
1365
+ }), Hn = function(e) {
1111
1366
  return e === void 0 && (e = {}), {
1112
1367
  name: "flip",
1113
1368
  options: e,
@@ -1115,73 +1370,73 @@ const Vn = (e) => ({
1115
1370
  var n, o;
1116
1371
  const {
1117
1372
  placement: i,
1118
- middlewareData: s,
1373
+ middlewareData: l,
1119
1374
  rects: r,
1120
1375
  initialPlacement: a,
1121
- platform: u,
1376
+ platform: f,
1122
1377
  elements: c
1123
1378
  } = t, {
1124
- mainAxis: f = !0,
1125
- crossAxis: d = !0,
1126
- fallbackPlacements: p,
1127
- fallbackStrategy: h = "bestFit",
1128
- fallbackAxisSideDirection: b = "none",
1129
- flipAlignment: v = !0,
1130
- ...g
1131
- } = be(e, t);
1132
- if ((n = s.arrow) != null && n.alignmentOffset)
1379
+ mainAxis: u = !0,
1380
+ crossAxis: p = !0,
1381
+ fallbackPlacements: h,
1382
+ fallbackStrategy: d = "bestFit",
1383
+ fallbackAxisSideDirection: m = "none",
1384
+ flipAlignment: g = !0,
1385
+ ...v
1386
+ } = xe(e, t);
1387
+ if ((n = l.arrow) != null && n.alignmentOffset)
1133
1388
  return {};
1134
- const y = fe(i), C = ne(a), x = fe(a) === a, O = await (u.isRTL == null ? void 0 : u.isRTL(c.floating)), m = p || (x || !v ? [ke(a)] : Rn(a)), A = b !== "none";
1135
- !p && A && m.push(...Bn(a, v, b, O));
1136
- const S = [a, ...m], R = await He(t, g), N = [];
1137
- let L = ((o = s.flip) == null ? void 0 : o.overflows) || [];
1138
- if (f && N.push(R[y]), d) {
1139
- const k = Dn(i, r, O);
1140
- N.push(R[k[0]], R[k[1]]);
1389
+ const x = de(i), T = oe(a), C = de(a) === a, S = await (f.isRTL == null ? void 0 : f.isRTL(c.floating)), w = h || (C || !g ? [Ne(a)] : Sn(a)), b = m !== "none";
1390
+ !h && b && w.push(...Nn(a, g, m, S));
1391
+ const P = [a, ...w], F = await ke(t, v), D = [];
1392
+ let M = ((o = l.flip) == null ? void 0 : o.overflows) || [];
1393
+ if (u && D.push(F[x]), p) {
1394
+ const R = Ln(i, r, S);
1395
+ D.push(F[R[0]], F[R[1]]);
1141
1396
  }
1142
- if (L = [...L, {
1397
+ if (M = [...M, {
1143
1398
  placement: i,
1144
- overflows: N
1145
- }], !N.every((k) => k <= 0)) {
1146
- var D, W;
1147
- const k = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, E = S[k];
1148
- if (E && (!(d === "alignment" ? C !== ne(E) : !1) || // We leave the current main axis only if every placement on that axis
1399
+ overflows: D
1400
+ }], !D.every((R) => R <= 0)) {
1401
+ var B, W;
1402
+ const R = (((B = l.flip) == null ? void 0 : B.index) || 0) + 1, E = P[R];
1403
+ if (E && (!(p === "alignment" ? T !== oe(E) : !1) || // We leave the current main axis only if every placement on that axis
1149
1404
  // overflows the main axis.
1150
- L.every((w) => ne(w.placement) === C ? w.overflows[0] > 0 : !0)))
1405
+ M.every((y) => oe(y.placement) === T ? y.overflows[0] > 0 : !0)))
1151
1406
  return {
1152
1407
  data: {
1153
- index: k,
1154
- overflows: L
1408
+ index: R,
1409
+ overflows: M
1155
1410
  },
1156
1411
  reset: {
1157
1412
  placement: E
1158
1413
  }
1159
1414
  };
1160
- let l = (W = L.filter((F) => F.overflows[0] <= 0).sort((F, w) => F.overflows[1] - w.overflows[1])[0]) == null ? void 0 : W.placement;
1161
- if (!l)
1162
- switch (h) {
1415
+ let s = (W = M.filter((k) => k.overflows[0] <= 0).sort((k, y) => k.overflows[1] - y.overflows[1])[0]) == null ? void 0 : W.placement;
1416
+ if (!s)
1417
+ switch (d) {
1163
1418
  case "bestFit": {
1164
1419
  var X;
1165
- const F = (X = L.filter((w) => {
1166
- if (A) {
1167
- const H = ne(w.placement);
1168
- return H === C || // Create a bias to the `y` side axis due to horizontal
1420
+ const k = (X = M.filter((y) => {
1421
+ if (b) {
1422
+ const H = oe(y.placement);
1423
+ return H === T || // Create a bias to the `y` side axis due to horizontal
1169
1424
  // reading directions favoring greater width.
1170
1425
  H === "y";
1171
1426
  }
1172
1427
  return !0;
1173
- }).map((w) => [w.placement, w.overflows.filter((H) => H > 0).reduce((H, ee) => H + ee, 0)]).sort((w, H) => w[1] - H[1])[0]) == null ? void 0 : X[0];
1174
- F && (l = F);
1428
+ }).map((y) => [y.placement, y.overflows.filter((H) => H > 0).reduce((H, ee) => H + ee, 0)]).sort((y, H) => y[1] - H[1])[0]) == null ? void 0 : X[0];
1429
+ k && (s = k);
1175
1430
  break;
1176
1431
  }
1177
1432
  case "initialPlacement":
1178
- l = a;
1433
+ s = a;
1179
1434
  break;
1180
1435
  }
1181
- if (i !== l)
1436
+ if (i !== s)
1182
1437
  return {
1183
1438
  reset: {
1184
- placement: l
1439
+ placement: s
1185
1440
  }
1186
1441
  };
1187
1442
  }
@@ -1189,7 +1444,7 @@ const Vn = (e) => ({
1189
1444
  }
1190
1445
  };
1191
1446
  };
1192
- function Mt(e, t) {
1447
+ function yt(e, t) {
1193
1448
  return {
1194
1449
  top: e.top - t.height,
1195
1450
  right: e.right - t.width,
@@ -1197,10 +1452,10 @@ function Mt(e, t) {
1197
1452
  left: e.left - t.width
1198
1453
  };
1199
1454
  }
1200
- function St(e) {
1201
- return Mn.some((t) => e[t] >= 0);
1455
+ function bt(e) {
1456
+ return Cn.some((t) => e[t] >= 0);
1202
1457
  }
1203
- const Xn = function(e) {
1458
+ const In = function(e) {
1204
1459
  return e === void 0 && (e = {}), {
1205
1460
  name: "hide",
1206
1461
  options: e,
@@ -1210,29 +1465,29 @@ const Xn = function(e) {
1210
1465
  } = t, {
1211
1466
  strategy: o = "referenceHidden",
1212
1467
  ...i
1213
- } = be(e, t);
1468
+ } = xe(e, t);
1214
1469
  switch (o) {
1215
1470
  case "referenceHidden": {
1216
- const s = await He(t, {
1471
+ const l = await ke(t, {
1217
1472
  ...i,
1218
1473
  elementContext: "reference"
1219
- }), r = Mt(s, n.reference);
1474
+ }), r = yt(l, n.reference);
1220
1475
  return {
1221
1476
  data: {
1222
1477
  referenceHiddenOffsets: r,
1223
- referenceHidden: St(r)
1478
+ referenceHidden: bt(r)
1224
1479
  }
1225
1480
  };
1226
1481
  }
1227
1482
  case "escaped": {
1228
- const s = await He(t, {
1483
+ const l = await ke(t, {
1229
1484
  ...i,
1230
1485
  altBoundary: !0
1231
- }), r = Mt(s, n.floating);
1486
+ }), r = yt(l, n.floating);
1232
1487
  return {
1233
1488
  data: {
1234
1489
  escapedOffsets: r,
1235
- escaped: St(r)
1490
+ escaped: bt(r)
1236
1491
  }
1237
1492
  };
1238
1493
  }
@@ -1241,35 +1496,35 @@ const Xn = function(e) {
1241
1496
  }
1242
1497
  }
1243
1498
  };
1244
- }, Yn = /* @__PURE__ */ new Set(["left", "top"]);
1245
- async function jn(e, t) {
1499
+ }, Bn = /* @__PURE__ */ new Set(["left", "top"]);
1500
+ async function Wn(e, t) {
1246
1501
  const {
1247
1502
  placement: n,
1248
1503
  platform: o,
1249
1504
  elements: i
1250
- } = e, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = fe(n), a = Oe(n), u = ne(n) === "y", c = Yn.has(r) ? -1 : 1, f = s && u ? -1 : 1, d = be(t, e);
1505
+ } = e, l = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = de(n), a = Oe(n), f = oe(n) === "y", c = Bn.has(r) ? -1 : 1, u = l && f ? -1 : 1, p = xe(t, e);
1251
1506
  let {
1507
+ mainAxis: h,
1508
+ crossAxis: d,
1509
+ alignmentAxis: m
1510
+ } = typeof p == "number" ? {
1252
1511
  mainAxis: p,
1253
- crossAxis: h,
1254
- alignmentAxis: b
1255
- } = typeof d == "number" ? {
1256
- mainAxis: d,
1257
1512
  crossAxis: 0,
1258
1513
  alignmentAxis: null
1259
1514
  } : {
1260
- mainAxis: d.mainAxis || 0,
1261
- crossAxis: d.crossAxis || 0,
1262
- alignmentAxis: d.alignmentAxis
1515
+ mainAxis: p.mainAxis || 0,
1516
+ crossAxis: p.crossAxis || 0,
1517
+ alignmentAxis: p.alignmentAxis
1263
1518
  };
1264
- return a && typeof b == "number" && (h = a === "end" ? b * -1 : b), u ? {
1265
- x: h * f,
1266
- y: p * c
1519
+ return a && typeof m == "number" && (d = a === "end" ? m * -1 : m), f ? {
1520
+ x: d * u,
1521
+ y: h * c
1267
1522
  } : {
1268
- x: p * c,
1269
- y: h * f
1523
+ x: h * c,
1524
+ y: d * u
1270
1525
  };
1271
1526
  }
1272
- const _n = function(e) {
1527
+ const $n = function(e) {
1273
1528
  return e === void 0 && (e = 0), {
1274
1529
  name: "offset",
1275
1530
  options: e,
@@ -1277,21 +1532,21 @@ const _n = function(e) {
1277
1532
  var n, o;
1278
1533
  const {
1279
1534
  x: i,
1280
- y: s,
1535
+ y: l,
1281
1536
  placement: r,
1282
1537
  middlewareData: a
1283
- } = t, u = await jn(t, e);
1538
+ } = t, f = await Wn(t, e);
1284
1539
  return r === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
1285
- x: i + u.x,
1286
- y: s + u.y,
1540
+ x: i + f.x,
1541
+ y: l + f.y,
1287
1542
  data: {
1288
- ...u,
1543
+ ...f,
1289
1544
  placement: r
1290
1545
  }
1291
1546
  };
1292
1547
  }
1293
1548
  };
1294
- }, zn = function(e) {
1549
+ }, Vn = function(e) {
1295
1550
  return e === void 0 && (e = {}), {
1296
1551
  name: "shift",
1297
1552
  options: e,
@@ -1301,96 +1556,96 @@ const _n = function(e) {
1301
1556
  y: o,
1302
1557
  placement: i
1303
1558
  } = t, {
1304
- mainAxis: s = !0,
1559
+ mainAxis: l = !0,
1305
1560
  crossAxis: r = !1,
1306
1561
  limiter: a = {
1307
- fn: (g) => {
1562
+ fn: (v) => {
1308
1563
  let {
1309
- x: y,
1310
- y: C
1311
- } = g;
1564
+ x,
1565
+ y: T
1566
+ } = v;
1312
1567
  return {
1313
- x: y,
1314
- y: C
1568
+ x,
1569
+ y: T
1315
1570
  };
1316
1571
  }
1317
1572
  },
1318
- ...u
1319
- } = be(e, t), c = {
1573
+ ...f
1574
+ } = xe(e, t), c = {
1320
1575
  x: n,
1321
1576
  y: o
1322
- }, f = await He(t, u), d = ne(fe(i)), p = Vt(d);
1323
- let h = c[p], b = c[d];
1324
- if (s) {
1325
- const g = p === "y" ? "top" : "left", y = p === "y" ? "bottom" : "right", C = h + f[g], x = h - f[y];
1326
- h = Ge(C, h, x);
1577
+ }, u = await ke(t, f), p = oe(de(i)), h = Rt(p);
1578
+ let d = c[h], m = c[p];
1579
+ if (l) {
1580
+ const v = h === "y" ? "top" : "left", x = h === "y" ? "bottom" : "right", T = d + u[v], C = d - u[x];
1581
+ d = ze(T, d, C);
1327
1582
  }
1328
1583
  if (r) {
1329
- const g = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", C = b + f[g], x = b - f[y];
1330
- b = Ge(C, b, x);
1584
+ const v = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", T = m + u[v], C = m - u[x];
1585
+ m = ze(T, m, C);
1331
1586
  }
1332
- const v = a.fn({
1587
+ const g = a.fn({
1333
1588
  ...t,
1334
- [p]: h,
1335
- [d]: b
1589
+ [h]: d,
1590
+ [p]: m
1336
1591
  });
1337
1592
  return {
1338
- ...v,
1593
+ ...g,
1339
1594
  data: {
1340
- x: v.x - n,
1341
- y: v.y - o,
1595
+ x: g.x - n,
1596
+ y: g.y - o,
1342
1597
  enabled: {
1343
- [p]: s,
1344
- [d]: r
1598
+ [h]: l,
1599
+ [p]: r
1345
1600
  }
1346
1601
  }
1347
1602
  };
1348
1603
  }
1349
1604
  };
1350
1605
  };
1351
- function Be() {
1606
+ function He() {
1352
1607
  return typeof window < "u";
1353
1608
  }
1354
- function xe(e) {
1355
- return Xt(e) ? (e.nodeName || "").toLowerCase() : "#document";
1609
+ function Ee(e) {
1610
+ return Ft(e) ? (e.nodeName || "").toLowerCase() : "#document";
1356
1611
  }
1357
- function j(e) {
1612
+ function Y(e) {
1358
1613
  var t;
1359
1614
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1360
1615
  }
1361
1616
  function Z(e) {
1362
1617
  var t;
1363
- return (t = (Xt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1618
+ return (t = (Ft(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1364
1619
  }
1365
- function Xt(e) {
1366
- return Be() ? e instanceof Node || e instanceof j(e).Node : !1;
1620
+ function Ft(e) {
1621
+ return He() ? e instanceof Node || e instanceof Y(e).Node : !1;
1367
1622
  }
1368
- function z(e) {
1369
- return Be() ? e instanceof Element || e instanceof j(e).Element : !1;
1623
+ function U(e) {
1624
+ return He() ? e instanceof Element || e instanceof Y(e).Element : !1;
1370
1625
  }
1371
1626
  function Q(e) {
1372
- return Be() ? e instanceof HTMLElement || e instanceof j(e).HTMLElement : !1;
1627
+ return He() ? e instanceof HTMLElement || e instanceof Y(e).HTMLElement : !1;
1373
1628
  }
1374
- function At(e) {
1375
- return !Be() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof j(e).ShadowRoot;
1629
+ function xt(e) {
1630
+ return !He() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Y(e).ShadowRoot;
1376
1631
  }
1377
- const Un = /* @__PURE__ */ new Set(["inline", "contents"]);
1378
- function Me(e) {
1632
+ const Xn = /* @__PURE__ */ new Set(["inline", "contents"]);
1633
+ function Pe(e) {
1379
1634
  const {
1380
1635
  overflow: t,
1381
1636
  overflowX: n,
1382
1637
  overflowY: o,
1383
1638
  display: i
1384
- } = U(e);
1385
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !Un.has(i);
1639
+ } = K(e);
1640
+ return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !Xn.has(i);
1386
1641
  }
1387
- const qn = /* @__PURE__ */ new Set(["table", "td", "th"]);
1388
- function Kn(e) {
1389
- return qn.has(xe(e));
1642
+ const jn = /* @__PURE__ */ new Set(["table", "td", "th"]);
1643
+ function Yn(e) {
1644
+ return jn.has(Ee(e));
1390
1645
  }
1391
- const Gn = [":popover-open", ":modal"];
1646
+ const zn = [":popover-open", ":modal"];
1392
1647
  function Ie(e) {
1393
- return Gn.some((t) => {
1648
+ return zn.some((t) => {
1394
1649
  try {
1395
1650
  return e.matches(t);
1396
1651
  } catch {
@@ -1398,34 +1653,34 @@ function Ie(e) {
1398
1653
  }
1399
1654
  });
1400
1655
  }
1401
- const Jn = ["transform", "translate", "scale", "rotate", "perspective"], Qn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Zn = ["paint", "layout", "strict", "content"];
1402
- function it(e) {
1403
- const t = rt(), n = z(e) ? U(e) : e;
1404
- return Jn.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) || Qn.some((o) => (n.willChange || "").includes(o)) || Zn.some((o) => (n.contain || "").includes(o));
1656
+ const _n = ["transform", "translate", "scale", "rotate", "perspective"], Un = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Kn = ["paint", "layout", "strict", "content"];
1657
+ function Je(e) {
1658
+ const t = Qe(), n = U(e) ? K(e) : e;
1659
+ return _n.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) || Un.some((o) => (n.willChange || "").includes(o)) || Kn.some((o) => (n.contain || "").includes(o));
1405
1660
  }
1406
- function eo(e) {
1407
- let t = oe(e);
1408
- for (; Q(t) && !ye(t); ) {
1409
- if (it(t))
1661
+ function qn(e) {
1662
+ let t = ie(e);
1663
+ for (; Q(t) && !be(t); ) {
1664
+ if (Je(t))
1410
1665
  return t;
1411
1666
  if (Ie(t))
1412
1667
  return null;
1413
- t = oe(t);
1668
+ t = ie(t);
1414
1669
  }
1415
1670
  return null;
1416
1671
  }
1417
- function rt() {
1672
+ function Qe() {
1418
1673
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1419
1674
  }
1420
- const to = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1421
- function ye(e) {
1422
- return to.has(xe(e));
1675
+ const Gn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1676
+ function be(e) {
1677
+ return Gn.has(Ee(e));
1423
1678
  }
1424
- function U(e) {
1425
- return j(e).getComputedStyle(e);
1679
+ function K(e) {
1680
+ return Y(e).getComputedStyle(e);
1426
1681
  }
1427
- function We(e) {
1428
- return z(e) ? {
1682
+ function Be(e) {
1683
+ return U(e) ? {
1429
1684
  scrollLeft: e.scrollLeft,
1430
1685
  scrollTop: e.scrollTop
1431
1686
  } : {
@@ -1433,189 +1688,189 @@ function We(e) {
1433
1688
  scrollTop: e.scrollY
1434
1689
  };
1435
1690
  }
1436
- function oe(e) {
1437
- if (xe(e) === "html")
1691
+ function ie(e) {
1692
+ if (Ee(e) === "html")
1438
1693
  return e;
1439
1694
  const t = (
1440
1695
  // Step into the shadow DOM of the parent of a slotted node.
1441
1696
  e.assignedSlot || // DOM Element detected.
1442
1697
  e.parentNode || // ShadowRoot detected.
1443
- At(e) && e.host || // Fallback.
1698
+ xt(e) && e.host || // Fallback.
1444
1699
  Z(e)
1445
1700
  );
1446
- return At(t) ? t.host : t;
1701
+ return xt(t) ? t.host : t;
1447
1702
  }
1448
- function Yt(e) {
1449
- const t = oe(e);
1450
- return ye(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Q(t) && Me(t) ? t : Yt(t);
1703
+ function Ht(e) {
1704
+ const t = ie(e);
1705
+ return be(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Q(t) && Pe(t) ? t : Ht(t);
1451
1706
  }
1452
1707
  function Te(e, t, n) {
1453
1708
  var o;
1454
1709
  t === void 0 && (t = []), n === void 0 && (n = !0);
1455
- const i = Yt(e), s = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = j(i);
1456
- if (s) {
1457
- const a = Qe(r);
1458
- return t.concat(r, r.visualViewport || [], Me(i) ? i : [], a && n ? Te(a) : []);
1710
+ const i = Ht(e), l = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = Y(i);
1711
+ if (l) {
1712
+ const a = Ue(r);
1713
+ return t.concat(r, r.visualViewport || [], Pe(i) ? i : [], a && n ? Te(a) : []);
1459
1714
  }
1460
1715
  return t.concat(i, Te(i, [], n));
1461
1716
  }
1462
- function Qe(e) {
1717
+ function Ue(e) {
1463
1718
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1464
1719
  }
1465
- function jt(e) {
1466
- const t = U(e);
1720
+ function It(e) {
1721
+ const t = K(e);
1467
1722
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
1468
- const i = Q(e), s = i ? e.offsetWidth : n, r = i ? e.offsetHeight : o, a = Re(n) !== s || Re(o) !== r;
1469
- return a && (n = s, o = r), {
1723
+ const i = Q(e), l = i ? e.offsetWidth : n, r = i ? e.offsetHeight : o, a = De(n) !== l || De(o) !== r;
1724
+ return a && (n = l, o = r), {
1470
1725
  width: n,
1471
1726
  height: o,
1472
1727
  $: a
1473
1728
  };
1474
1729
  }
1475
- function st(e) {
1476
- return z(e) ? e : e.contextElement;
1730
+ function Ze(e) {
1731
+ return U(e) ? e : e.contextElement;
1477
1732
  }
1478
- function ve(e) {
1479
- const t = st(e);
1733
+ function ge(e) {
1734
+ const t = Ze(e);
1480
1735
  if (!Q(t))
1481
1736
  return G(1);
1482
1737
  const n = t.getBoundingClientRect(), {
1483
1738
  width: o,
1484
1739
  height: i,
1485
- $: s
1486
- } = jt(t);
1487
- let r = (s ? Re(n.width) : n.width) / o, a = (s ? Re(n.height) : n.height) / i;
1740
+ $: l
1741
+ } = It(t);
1742
+ let r = (l ? De(n.width) : n.width) / o, a = (l ? De(n.height) : n.height) / i;
1488
1743
  return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1489
1744
  x: r,
1490
1745
  y: a
1491
1746
  };
1492
1747
  }
1493
- const no = /* @__PURE__ */ G(0);
1494
- function _t(e) {
1495
- const t = j(e);
1496
- return !rt() || !t.visualViewport ? no : {
1748
+ const Jn = /* @__PURE__ */ G(0);
1749
+ function Bt(e) {
1750
+ const t = Y(e);
1751
+ return !Qe() || !t.visualViewport ? Jn : {
1497
1752
  x: t.visualViewport.offsetLeft,
1498
1753
  y: t.visualViewport.offsetTop
1499
1754
  };
1500
1755
  }
1501
- function oo(e, t, n) {
1502
- return t === void 0 && (t = !1), !n || t && n !== j(e) ? !1 : t;
1756
+ function Qn(e, t, n) {
1757
+ return t === void 0 && (t = !1), !n || t && n !== Y(e) ? !1 : t;
1503
1758
  }
1504
- function de(e, t, n, o) {
1759
+ function he(e, t, n, o) {
1505
1760
  t === void 0 && (t = !1), n === void 0 && (n = !1);
1506
- const i = e.getBoundingClientRect(), s = st(e);
1761
+ const i = e.getBoundingClientRect(), l = Ze(e);
1507
1762
  let r = G(1);
1508
- t && (o ? z(o) && (r = ve(o)) : r = ve(e));
1509
- const a = oo(s, n, o) ? _t(s) : G(0);
1510
- let u = (i.left + a.x) / r.x, c = (i.top + a.y) / r.y, f = i.width / r.x, d = i.height / r.y;
1511
- if (s) {
1512
- const p = j(s), h = o && z(o) ? j(o) : o;
1513
- let b = p, v = Qe(b);
1514
- for (; v && o && h !== b; ) {
1515
- const g = ve(v), y = v.getBoundingClientRect(), C = U(v), x = y.left + (v.clientLeft + parseFloat(C.paddingLeft)) * g.x, O = y.top + (v.clientTop + parseFloat(C.paddingTop)) * g.y;
1516
- u *= g.x, c *= g.y, f *= g.x, d *= g.y, u += x, c += O, b = j(v), v = Qe(b);
1763
+ t && (o ? U(o) && (r = ge(o)) : r = ge(e));
1764
+ const a = Qn(l, n, o) ? Bt(l) : G(0);
1765
+ let f = (i.left + a.x) / r.x, c = (i.top + a.y) / r.y, u = i.width / r.x, p = i.height / r.y;
1766
+ if (l) {
1767
+ const h = Y(l), d = o && U(o) ? Y(o) : o;
1768
+ let m = h, g = Ue(m);
1769
+ for (; g && o && d !== m; ) {
1770
+ const v = ge(g), x = g.getBoundingClientRect(), T = K(g), C = x.left + (g.clientLeft + parseFloat(T.paddingLeft)) * v.x, S = x.top + (g.clientTop + parseFloat(T.paddingTop)) * v.y;
1771
+ f *= v.x, c *= v.y, u *= v.x, p *= v.y, f += C, c += S, m = Y(g), g = Ue(m);
1517
1772
  }
1518
1773
  }
1519
- return Fe({
1520
- width: f,
1521
- height: d,
1522
- x: u,
1774
+ return Re({
1775
+ width: u,
1776
+ height: p,
1777
+ x: f,
1523
1778
  y: c
1524
1779
  });
1525
1780
  }
1526
- function Ve(e, t) {
1527
- const n = We(e).scrollLeft;
1528
- return t ? t.left + n : de(Z(e)).left + n;
1781
+ function We(e, t) {
1782
+ const n = Be(e).scrollLeft;
1783
+ return t ? t.left + n : he(Z(e)).left + n;
1529
1784
  }
1530
- function zt(e, t) {
1531
- const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Ve(e, n), i = n.top + t.scrollTop;
1785
+ function Wt(e, t) {
1786
+ const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - We(e, n), i = n.top + t.scrollTop;
1532
1787
  return {
1533
1788
  x: o,
1534
1789
  y: i
1535
1790
  };
1536
1791
  }
1537
- function io(e) {
1792
+ function Zn(e) {
1538
1793
  let {
1539
1794
  elements: t,
1540
1795
  rect: n,
1541
1796
  offsetParent: o,
1542
1797
  strategy: i
1543
1798
  } = e;
1544
- const s = i === "fixed", r = Z(o), a = t ? Ie(t.floating) : !1;
1545
- if (o === r || a && s)
1799
+ const l = i === "fixed", r = Z(o), a = t ? Ie(t.floating) : !1;
1800
+ if (o === r || a && l)
1546
1801
  return n;
1547
- let u = {
1802
+ let f = {
1548
1803
  scrollLeft: 0,
1549
1804
  scrollTop: 0
1550
1805
  }, c = G(1);
1551
- const f = G(0), d = Q(o);
1552
- if ((d || !d && !s) && ((xe(o) !== "body" || Me(r)) && (u = We(o)), Q(o))) {
1553
- const h = de(o);
1554
- c = ve(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
1806
+ const u = G(0), p = Q(o);
1807
+ if ((p || !p && !l) && ((Ee(o) !== "body" || Pe(r)) && (f = Be(o)), Q(o))) {
1808
+ const d = he(o);
1809
+ c = ge(o), u.x = d.x + o.clientLeft, u.y = d.y + o.clientTop;
1555
1810
  }
1556
- const p = r && !d && !s ? zt(r, u) : G(0);
1811
+ const h = r && !p && !l ? Wt(r, f) : G(0);
1557
1812
  return {
1558
1813
  width: n.width * c.x,
1559
1814
  height: n.height * c.y,
1560
- x: n.x * c.x - u.scrollLeft * c.x + f.x + p.x,
1561
- y: n.y * c.y - u.scrollTop * c.y + f.y + p.y
1815
+ x: n.x * c.x - f.scrollLeft * c.x + u.x + h.x,
1816
+ y: n.y * c.y - f.scrollTop * c.y + u.y + h.y
1562
1817
  };
1563
1818
  }
1564
- function ro(e) {
1819
+ function eo(e) {
1565
1820
  return Array.from(e.getClientRects());
1566
1821
  }
1567
- function so(e) {
1568
- const t = Z(e), n = We(e), o = e.ownerDocument.body, i = ue(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), s = ue(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1569
- let r = -n.scrollLeft + Ve(e);
1822
+ function to(e) {
1823
+ const t = Z(e), n = Be(e), o = e.ownerDocument.body, i = fe(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), l = fe(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
1824
+ let r = -n.scrollLeft + We(e);
1570
1825
  const a = -n.scrollTop;
1571
- return U(o).direction === "rtl" && (r += ue(t.clientWidth, o.clientWidth) - i), {
1826
+ return K(o).direction === "rtl" && (r += fe(t.clientWidth, o.clientWidth) - i), {
1572
1827
  width: i,
1573
- height: s,
1828
+ height: l,
1574
1829
  x: r,
1575
1830
  y: a
1576
1831
  };
1577
1832
  }
1578
- const Nt = 25;
1579
- function lo(e, t) {
1580
- const n = j(e), o = Z(e), i = n.visualViewport;
1581
- let s = o.clientWidth, r = o.clientHeight, a = 0, u = 0;
1833
+ const Et = 25;
1834
+ function no(e, t) {
1835
+ const n = Y(e), o = Z(e), i = n.visualViewport;
1836
+ let l = o.clientWidth, r = o.clientHeight, a = 0, f = 0;
1582
1837
  if (i) {
1583
- s = i.width, r = i.height;
1584
- const f = rt();
1585
- (!f || f && t === "fixed") && (a = i.offsetLeft, u = i.offsetTop);
1838
+ l = i.width, r = i.height;
1839
+ const u = Qe();
1840
+ (!u || u && t === "fixed") && (a = i.offsetLeft, f = i.offsetTop);
1586
1841
  }
1587
- const c = Ve(o);
1842
+ const c = We(o);
1588
1843
  if (c <= 0) {
1589
- const f = o.ownerDocument, d = f.body, p = getComputedStyle(d), h = f.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, b = Math.abs(o.clientWidth - d.clientWidth - h);
1590
- b <= Nt && (s -= b);
1591
- } else c <= Nt && (s += c);
1844
+ const u = o.ownerDocument, p = u.body, h = getComputedStyle(p), d = u.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, m = Math.abs(o.clientWidth - p.clientWidth - d);
1845
+ m <= Et && (l -= m);
1846
+ } else c <= Et && (l += c);
1592
1847
  return {
1593
- width: s,
1848
+ width: l,
1594
1849
  height: r,
1595
1850
  x: a,
1596
- y: u
1851
+ y: f
1597
1852
  };
1598
1853
  }
1599
- const ao = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1600
- function co(e, t) {
1601
- const n = de(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, s = Q(e) ? ve(e) : G(1), r = e.clientWidth * s.x, a = e.clientHeight * s.y, u = i * s.x, c = o * s.y;
1854
+ const oo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1855
+ function io(e, t) {
1856
+ const n = he(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, l = Q(e) ? ge(e) : G(1), r = e.clientWidth * l.x, a = e.clientHeight * l.y, f = i * l.x, c = o * l.y;
1602
1857
  return {
1603
1858
  width: r,
1604
1859
  height: a,
1605
- x: u,
1860
+ x: f,
1606
1861
  y: c
1607
1862
  };
1608
1863
  }
1609
- function Dt(e, t, n) {
1864
+ function Ct(e, t, n) {
1610
1865
  let o;
1611
1866
  if (t === "viewport")
1612
- o = lo(e, n);
1867
+ o = no(e, n);
1613
1868
  else if (t === "document")
1614
- o = so(Z(e));
1615
- else if (z(t))
1616
- o = co(t, n);
1869
+ o = to(Z(e));
1870
+ else if (U(t))
1871
+ o = io(t, n);
1617
1872
  else {
1618
- const i = _t(e);
1873
+ const i = Bt(e);
1619
1874
  o = {
1620
1875
  x: t.x - i.x,
1621
1876
  y: t.y - i.y,
@@ -1623,110 +1878,110 @@ function Dt(e, t, n) {
1623
1878
  height: t.height
1624
1879
  };
1625
1880
  }
1626
- return Fe(o);
1881
+ return Re(o);
1627
1882
  }
1628
- function Ut(e, t) {
1629
- const n = oe(e);
1630
- return n === t || !z(n) || ye(n) ? !1 : U(n).position === "fixed" || Ut(n, t);
1883
+ function $t(e, t) {
1884
+ const n = ie(e);
1885
+ return n === t || !U(n) || be(n) ? !1 : K(n).position === "fixed" || $t(n, t);
1631
1886
  }
1632
- function uo(e, t) {
1887
+ function ro(e, t) {
1633
1888
  const n = t.get(e);
1634
1889
  if (n)
1635
1890
  return n;
1636
- let o = Te(e, [], !1).filter((a) => z(a) && xe(a) !== "body"), i = null;
1637
- const s = U(e).position === "fixed";
1638
- let r = s ? oe(e) : e;
1639
- for (; z(r) && !ye(r); ) {
1640
- const a = U(r), u = it(r);
1641
- !u && a.position === "fixed" && (i = null), (s ? !u && !i : !u && a.position === "static" && !!i && ao.has(i.position) || Me(r) && !u && Ut(e, r)) ? o = o.filter((f) => f !== r) : i = a, r = oe(r);
1891
+ let o = Te(e, [], !1).filter((a) => U(a) && Ee(a) !== "body"), i = null;
1892
+ const l = K(e).position === "fixed";
1893
+ let r = l ? ie(e) : e;
1894
+ for (; U(r) && !be(r); ) {
1895
+ const a = K(r), f = Je(r);
1896
+ !f && a.position === "fixed" && (i = null), (l ? !f && !i : !f && a.position === "static" && !!i && oo.has(i.position) || Pe(r) && !f && $t(e, r)) ? o = o.filter((u) => u !== r) : i = a, r = ie(r);
1642
1897
  }
1643
1898
  return t.set(e, o), o;
1644
1899
  }
1645
- function fo(e) {
1900
+ function so(e) {
1646
1901
  let {
1647
1902
  element: t,
1648
1903
  boundary: n,
1649
1904
  rootBoundary: o,
1650
1905
  strategy: i
1651
1906
  } = e;
1652
- const r = [...n === "clippingAncestors" ? Ie(t) ? [] : uo(t, this._c) : [].concat(n), o], a = r[0], u = r.reduce((c, f) => {
1653
- const d = Dt(t, f, i);
1654
- return c.top = ue(d.top, c.top), c.right = we(d.right, c.right), c.bottom = we(d.bottom, c.bottom), c.left = ue(d.left, c.left), c;
1655
- }, Dt(t, a, i));
1907
+ const r = [...n === "clippingAncestors" ? Ie(t) ? [] : ro(t, this._c) : [].concat(n), o], a = r[0], f = r.reduce((c, u) => {
1908
+ const p = Ct(t, u, i);
1909
+ return c.top = fe(p.top, c.top), c.right = ye(p.right, c.right), c.bottom = ye(p.bottom, c.bottom), c.left = fe(p.left, c.left), c;
1910
+ }, Ct(t, a, i));
1656
1911
  return {
1657
- width: u.right - u.left,
1658
- height: u.bottom - u.top,
1659
- x: u.left,
1660
- y: u.top
1912
+ width: f.right - f.left,
1913
+ height: f.bottom - f.top,
1914
+ x: f.left,
1915
+ y: f.top
1661
1916
  };
1662
1917
  }
1663
- function ho(e) {
1918
+ function lo(e) {
1664
1919
  const {
1665
1920
  width: t,
1666
1921
  height: n
1667
- } = jt(e);
1922
+ } = It(e);
1668
1923
  return {
1669
1924
  width: t,
1670
1925
  height: n
1671
1926
  };
1672
1927
  }
1673
- function mo(e, t, n) {
1674
- const o = Q(t), i = Z(t), s = n === "fixed", r = de(e, !0, s, t);
1928
+ function ao(e, t, n) {
1929
+ const o = Q(t), i = Z(t), l = n === "fixed", r = he(e, !0, l, t);
1675
1930
  let a = {
1676
1931
  scrollLeft: 0,
1677
1932
  scrollTop: 0
1678
1933
  };
1679
- const u = G(0);
1934
+ const f = G(0);
1680
1935
  function c() {
1681
- u.x = Ve(i);
1936
+ f.x = We(i);
1682
1937
  }
1683
- if (o || !o && !s)
1684
- if ((xe(t) !== "body" || Me(i)) && (a = We(t)), o) {
1685
- const h = de(t, !0, s, t);
1686
- u.x = h.x + t.clientLeft, u.y = h.y + t.clientTop;
1938
+ if (o || !o && !l)
1939
+ if ((Ee(t) !== "body" || Pe(i)) && (a = Be(t)), o) {
1940
+ const d = he(t, !0, l, t);
1941
+ f.x = d.x + t.clientLeft, f.y = d.y + t.clientTop;
1687
1942
  } else i && c();
1688
- s && !o && i && c();
1689
- const f = i && !o && !s ? zt(i, a) : G(0), d = r.left + a.scrollLeft - u.x - f.x, p = r.top + a.scrollTop - u.y - f.y;
1943
+ l && !o && i && c();
1944
+ const u = i && !o && !l ? Wt(i, a) : G(0), p = r.left + a.scrollLeft - f.x - u.x, h = r.top + a.scrollTop - f.y - u.y;
1690
1945
  return {
1691
- x: d,
1692
- y: p,
1946
+ x: p,
1947
+ y: h,
1693
1948
  width: r.width,
1694
1949
  height: r.height
1695
1950
  };
1696
1951
  }
1697
- function Ue(e) {
1698
- return U(e).position === "static";
1952
+ function Xe(e) {
1953
+ return K(e).position === "static";
1699
1954
  }
1700
- function Rt(e, t) {
1701
- if (!Q(e) || U(e).position === "fixed")
1955
+ function Tt(e, t) {
1956
+ if (!Q(e) || K(e).position === "fixed")
1702
1957
  return null;
1703
1958
  if (t)
1704
1959
  return t(e);
1705
1960
  let n = e.offsetParent;
1706
1961
  return Z(e) === n && (n = n.ownerDocument.body), n;
1707
1962
  }
1708
- function qt(e, t) {
1709
- const n = j(e);
1963
+ function Vt(e, t) {
1964
+ const n = Y(e);
1710
1965
  if (Ie(e))
1711
1966
  return n;
1712
1967
  if (!Q(e)) {
1713
- let i = oe(e);
1714
- for (; i && !ye(i); ) {
1715
- if (z(i) && !Ue(i))
1968
+ let i = ie(e);
1969
+ for (; i && !be(i); ) {
1970
+ if (U(i) && !Xe(i))
1716
1971
  return i;
1717
- i = oe(i);
1972
+ i = ie(i);
1718
1973
  }
1719
1974
  return n;
1720
1975
  }
1721
- let o = Rt(e, t);
1722
- for (; o && Kn(o) && Ue(o); )
1723
- o = Rt(o, t);
1724
- return o && ye(o) && Ue(o) && !it(o) ? n : o || eo(e) || n;
1976
+ let o = Tt(e, t);
1977
+ for (; o && Yn(o) && Xe(o); )
1978
+ o = Tt(o, t);
1979
+ return o && be(o) && Xe(o) && !Je(o) ? n : o || qn(e) || n;
1725
1980
  }
1726
- const po = async function(e) {
1727
- const t = this.getOffsetParent || qt, n = this.getDimensions, o = await n(e.floating);
1981
+ const co = async function(e) {
1982
+ const t = this.getOffsetParent || Vt, n = this.getDimensions, o = await n(e.floating);
1728
1983
  return {
1729
- reference: mo(e.reference, await t(e.floating), e.strategy),
1984
+ reference: ao(e.reference, await t(e.floating), e.strategy),
1730
1985
  floating: {
1731
1986
  x: 0,
1732
1987
  y: 0,
@@ -1735,611 +1990,503 @@ const po = async function(e) {
1735
1990
  }
1736
1991
  };
1737
1992
  };
1738
- function vo(e) {
1739
- return U(e).direction === "rtl";
1993
+ function uo(e) {
1994
+ return K(e).direction === "rtl";
1740
1995
  }
1741
- const go = {
1742
- convertOffsetParentRelativeRectToViewportRelativeRect: io,
1996
+ const fo = {
1997
+ convertOffsetParentRelativeRectToViewportRelativeRect: Zn,
1743
1998
  getDocumentElement: Z,
1744
- getClippingRect: fo,
1745
- getOffsetParent: qt,
1746
- getElementRects: po,
1747
- getClientRects: ro,
1748
- getDimensions: ho,
1749
- getScale: ve,
1750
- isElement: z,
1751
- isRTL: vo
1999
+ getClippingRect: so,
2000
+ getOffsetParent: Vt,
2001
+ getElementRects: co,
2002
+ getClientRects: eo,
2003
+ getDimensions: lo,
2004
+ getScale: ge,
2005
+ isElement: U,
2006
+ isRTL: uo
1752
2007
  };
1753
- function Kt(e, t) {
2008
+ function Xt(e, t) {
1754
2009
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1755
2010
  }
1756
- function wo(e, t) {
2011
+ function ho(e, t) {
1757
2012
  let n = null, o;
1758
2013
  const i = Z(e);
1759
- function s() {
2014
+ function l() {
1760
2015
  var a;
1761
2016
  clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
1762
2017
  }
1763
- function r(a, u) {
1764
- a === void 0 && (a = !1), u === void 0 && (u = 1), s();
2018
+ function r(a, f) {
2019
+ a === void 0 && (a = !1), f === void 0 && (f = 1), l();
1765
2020
  const c = e.getBoundingClientRect(), {
1766
- left: f,
1767
- top: d,
1768
- width: p,
1769
- height: h
2021
+ left: u,
2022
+ top: p,
2023
+ width: h,
2024
+ height: d
1770
2025
  } = c;
1771
- if (a || t(), !p || !h)
2026
+ if (a || t(), !h || !d)
1772
2027
  return;
1773
- const b = De(d), v = De(i.clientWidth - (f + p)), g = De(i.clientHeight - (d + h)), y = De(f), x = {
1774
- rootMargin: -b + "px " + -v + "px " + -g + "px " + -y + "px",
1775
- threshold: ue(0, we(1, u)) || 1
2028
+ const m = Me(p), g = Me(i.clientWidth - (u + h)), v = Me(i.clientHeight - (p + d)), x = Me(u), C = {
2029
+ rootMargin: -m + "px " + -g + "px " + -v + "px " + -x + "px",
2030
+ threshold: fe(0, ye(1, f)) || 1
1776
2031
  };
1777
- let O = !0;
1778
- function m(A) {
1779
- const S = A[0].intersectionRatio;
1780
- if (S !== u) {
1781
- if (!O)
2032
+ let S = !0;
2033
+ function w(b) {
2034
+ const P = b[0].intersectionRatio;
2035
+ if (P !== f) {
2036
+ if (!S)
1782
2037
  return r();
1783
- S ? r(!1, S) : o = setTimeout(() => {
2038
+ P ? r(!1, P) : o = setTimeout(() => {
1784
2039
  r(!1, 1e-7);
1785
2040
  }, 1e3);
1786
2041
  }
1787
- S === 1 && !Kt(c, e.getBoundingClientRect()) && r(), O = !1;
2042
+ P === 1 && !Xt(c, e.getBoundingClientRect()) && r(), S = !1;
1788
2043
  }
1789
2044
  try {
1790
- n = new IntersectionObserver(m, {
1791
- ...x,
2045
+ n = new IntersectionObserver(w, {
2046
+ ...C,
1792
2047
  // Handle <iframe>s
1793
2048
  root: i.ownerDocument
1794
2049
  });
1795
2050
  } catch {
1796
- n = new IntersectionObserver(m, x);
2051
+ n = new IntersectionObserver(w, C);
1797
2052
  }
1798
2053
  n.observe(e);
1799
2054
  }
1800
- return r(!0), s;
2055
+ return r(!0), l;
1801
2056
  }
1802
- function yo(e, t, n, o) {
2057
+ function mo(e, t, n, o) {
1803
2058
  o === void 0 && (o = {});
1804
2059
  const {
1805
2060
  ancestorScroll: i = !0,
1806
- ancestorResize: s = !0,
2061
+ ancestorResize: l = !0,
1807
2062
  elementResize: r = typeof ResizeObserver == "function",
1808
2063
  layoutShift: a = typeof IntersectionObserver == "function",
1809
- animationFrame: u = !1
1810
- } = o, c = st(e), f = i || s ? [...c ? Te(c) : [], ...Te(t)] : [];
1811
- f.forEach((y) => {
1812
- i && y.addEventListener("scroll", n, {
2064
+ animationFrame: f = !1
2065
+ } = o, c = Ze(e), u = i || l ? [...c ? Te(c) : [], ...Te(t)] : [];
2066
+ u.forEach((x) => {
2067
+ i && x.addEventListener("scroll", n, {
1813
2068
  passive: !0
1814
- }), s && y.addEventListener("resize", n);
2069
+ }), l && x.addEventListener("resize", n);
1815
2070
  });
1816
- const d = c && a ? wo(c, n) : null;
1817
- let p = -1, h = null;
1818
- r && (h = new ResizeObserver((y) => {
1819
- let [C] = y;
1820
- C && C.target === c && h && (h.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1821
- var x;
1822
- (x = h) == null || x.observe(t);
2071
+ const p = c && a ? ho(c, n) : null;
2072
+ let h = -1, d = null;
2073
+ r && (d = new ResizeObserver((x) => {
2074
+ let [T] = x;
2075
+ T && T.target === c && d && (d.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
2076
+ var C;
2077
+ (C = d) == null || C.observe(t);
1823
2078
  })), n();
1824
- }), c && !u && h.observe(c), h.observe(t));
1825
- let b, v = u ? de(e) : null;
1826
- u && g();
1827
- function g() {
1828
- const y = de(e);
1829
- v && !Kt(v, y) && n(), v = y, b = requestAnimationFrame(g);
2079
+ }), c && !f && d.observe(c), d.observe(t));
2080
+ let m, g = f ? he(e) : null;
2081
+ f && v();
2082
+ function v() {
2083
+ const x = he(e);
2084
+ g && !Xt(g, x) && n(), g = x, m = requestAnimationFrame(v);
1830
2085
  }
1831
2086
  return n(), () => {
1832
- var y;
1833
- f.forEach((C) => {
1834
- i && C.removeEventListener("scroll", n), s && C.removeEventListener("resize", n);
1835
- }), d == null || d(), (y = h) == null || y.disconnect(), h = null, u && cancelAnimationFrame(b);
2087
+ var x;
2088
+ u.forEach((T) => {
2089
+ i && T.removeEventListener("scroll", n), l && T.removeEventListener("resize", n);
2090
+ }), p == null || p(), (x = d) == null || x.disconnect(), d = null, f && cancelAnimationFrame(m);
1836
2091
  };
1837
2092
  }
1838
- const No = _n, Do = zn, Ro = $n, ko = Xn, bo = Vn, xo = (e, t, n) => {
2093
+ const Lo = $n, So = Vn, Ao = Hn, Mo = In, po = Fn, vo = (e, t, n) => {
1839
2094
  const o = /* @__PURE__ */ new Map(), i = {
1840
- platform: go,
2095
+ platform: fo,
1841
2096
  ...n
1842
- }, s = {
2097
+ }, l = {
1843
2098
  ...i.platform,
1844
2099
  _c: o
1845
2100
  };
1846
- return Wn(e, t, {
2101
+ return kn(e, t, {
1847
2102
  ...i,
1848
- platform: s
2103
+ platform: l
1849
2104
  });
1850
2105
  };
1851
- function Fo(e, t, n = {}) {
1852
- const { offset: o = "-4px" } = n, { middlewareData: i, placement: s, refs: r } = t;
1853
- pe(e, (f) => {
1854
- r.arrowEl.value = f;
2106
+ function Do(e, t, n = {}) {
2107
+ const { offset: o = "-4px" } = n, { middlewareData: i, placement: l, refs: r } = t;
2108
+ ne(e, (u) => {
2109
+ r.arrowEl.value = u;
1855
2110
  });
1856
- const a = I(() => {
1857
- var f;
1858
- return ((f = i.value.arrow) == null ? void 0 : f.x) ?? 0;
1859
- }), u = I(() => {
1860
- var f;
1861
- return ((f = i.value.arrow) == null ? void 0 : f.y) ?? 0;
1862
- }), c = I(() => {
2111
+ const a = N(() => {
2112
+ var u;
2113
+ return ((u = i.value.arrow) == null ? void 0 : u.x) ?? 0;
2114
+ }), f = N(() => {
2115
+ var u;
2116
+ return ((u = i.value.arrow) == null ? void 0 : u.y) ?? 0;
2117
+ }), c = N(() => {
1863
2118
  if (!(e.value || r.arrowEl.value) || !i.value.arrow)
1864
2119
  return {};
1865
- const d = M(s).split("-")[0], p = a.value, h = u.value;
1866
- return d === "bottom" ? {
1867
- "inset-inline-start": `${p}px`,
2120
+ const p = A(l).split("-")[0], h = a.value, d = f.value;
2121
+ return p === "bottom" ? {
2122
+ "inset-inline-start": `${h}px`,
1868
2123
  "inset-block-start": o
1869
- } : d === "top" ? {
1870
- "inset-inline-start": `${p}px`,
2124
+ } : p === "top" ? {
2125
+ "inset-inline-start": `${h}px`,
1871
2126
  "inset-block-end": o
1872
- } : d === "right" ? {
1873
- "inset-block-start": `${h}px`,
2127
+ } : p === "right" ? {
2128
+ "inset-block-start": `${d}px`,
1874
2129
  "inset-inline-start": o
1875
- } : d === "left" ? {
1876
- "inset-block-start": `${h}px`,
2130
+ } : p === "left" ? {
2131
+ "inset-block-start": `${d}px`,
1877
2132
  "inset-inline-end": o
1878
2133
  } : {};
1879
2134
  });
1880
2135
  return {
1881
2136
  arrowX: a,
1882
- arrowY: u,
2137
+ arrowY: f,
1883
2138
  arrowStyles: c
1884
2139
  };
1885
2140
  }
1886
- function Eo(e) {
2141
+ function go(e) {
1887
2142
  return {
1888
2143
  name: "arrow",
1889
2144
  options: e,
1890
2145
  fn(t) {
1891
- const n = M(e.element);
1892
- return n == null ? {} : bo({ element: n, padding: e.padding }).fn(t);
2146
+ const n = A(e.element);
2147
+ return n == null ? {} : po({ element: n, padding: e.padding }).fn(t);
1893
2148
  }
1894
2149
  };
1895
2150
  }
1896
- function kt(e, t, n = {}) {
2151
+ function Ot(e, t, n = {}) {
1897
2152
  const {
1898
2153
  transform: o = !0,
1899
2154
  middlewares: i,
1900
- autoUpdate: s = !0,
1901
- open: r = q(!1)
1902
- } = n, a = (m) => {
1903
- r.value = m;
1904
- }, u = I(() => M(n.placement) ?? "bottom"), c = I(() => M(n.strategy) ?? "absolute"), f = q(0), d = q(0), p = q(u.value), h = q(c.value), b = qe({}), v = q(!1), g = q(null), y = I(() => {
1905
- const m = i || [];
1906
- return g.value && !m.some((S) => S.name === "arrow") ? [...m, Eo({ element: g })] : m;
1907
- }), C = async () => {
2155
+ autoUpdate: l = !0,
2156
+ open: r = _(!1)
2157
+ } = n, a = (w) => {
2158
+ r.value = w;
2159
+ }, f = N(() => A(n.placement) ?? "bottom"), c = N(() => A(n.strategy) ?? "absolute"), u = _(0), p = _(0), h = _(f.value), d = _(c.value), m = je({}), g = _(!1), v = _(null), x = N(() => {
2160
+ const w = A(i) || [];
2161
+ return v.value && !w.some((P) => P.name === "arrow") ? [...w, go({ element: v })] : w;
2162
+ }), T = async () => {
1908
2163
  if (!e.value || !t.value) return;
1909
- const m = await xo(e.value, t.value, {
1910
- placement: u.value,
2164
+ const w = await vo(e.value, t.value, {
2165
+ placement: f.value,
1911
2166
  strategy: c.value,
1912
- middleware: y.value
2167
+ middleware: x.value
1913
2168
  });
1914
- f.value = m.x, d.value = m.y, p.value = m.placement, h.value = m.strategy, b.value = m.middlewareData, v.value = r.value;
2169
+ u.value = w.x, p.value = w.y, h.value = w.placement, d.value = w.strategy, m.value = w.middlewareData, g.value = r.value;
1915
2170
  };
1916
- pe([u, c], () => {
1917
- r.value && C();
2171
+ ne([f, c, x], () => {
2172
+ r.value && T();
1918
2173
  });
1919
- let x;
1920
- pe(
2174
+ let C;
2175
+ ne(
1921
2176
  [e, t, r],
1922
- ([m, A, S]) => {
1923
- !S || !m || !A || (s && (x = yo(
1924
- m,
1925
- A,
1926
- C,
1927
- typeof s == "object" ? s : void 0
1928
- )), ce(() => {
1929
- x == null || x(), x = void 0;
2177
+ ([w, b, P]) => {
2178
+ !P || !w || !b || (l && (C = mo(
2179
+ w,
2180
+ b,
2181
+ T,
2182
+ typeof l == "object" ? l : void 0
2183
+ )), ue(() => {
2184
+ C == null || C(), C = void 0;
1930
2185
  }));
1931
2186
  },
1932
2187
  { immediate: !0 }
1933
- ), ge(() => x == null ? void 0 : x()), pe(r, (m) => {
1934
- m || (v.value = !1);
2188
+ ), we(() => C == null ? void 0 : C()), ne(r, (w) => {
2189
+ w || (g.value = !1);
1935
2190
  });
1936
- const O = q({
2191
+ const S = _({
1937
2192
  position: c.value,
1938
2193
  left: "0",
1939
2194
  top: "0"
1940
2195
  });
1941
- return pe(
1942
- [f, d, () => M(o)],
1943
- ([m, A, S]) => {
1944
- const R = t.value;
1945
- if (!R) return;
1946
- const N = {
1947
- position: h.value,
2196
+ return ne(
2197
+ [u, p, () => A(o)],
2198
+ ([w, b, P]) => {
2199
+ const F = t.value;
2200
+ if (!F) return;
2201
+ const D = {
2202
+ position: d.value,
1948
2203
  left: "0",
1949
2204
  top: "0"
1950
- }, L = Ft(R, m), D = Ft(R, A);
1951
- S ? O.value = {
1952
- ...N,
1953
- transform: `translate(${L}px, ${D}px)`,
1954
- ...Gt(R) >= 1.5 && {
2205
+ }, M = Pt(F, w), B = Pt(F, b);
2206
+ P ? S.value = {
2207
+ ...D,
2208
+ transform: `translate(${M}px, ${B}px)`,
2209
+ ...jt(F) >= 1.5 && {
1955
2210
  "will-change": "transform"
1956
2211
  }
1957
- } : O.value = {
1958
- ...N,
1959
- left: `${L}px`,
1960
- top: `${D}px`
2212
+ } : S.value = {
2213
+ ...D,
2214
+ left: `${M}px`,
2215
+ top: `${B}px`
1961
2216
  };
1962
2217
  },
1963
2218
  { immediate: !0 }
1964
2219
  ), {
1965
- x: f,
1966
- y: d,
1967
- strategy: h,
1968
- placement: p,
1969
- middlewareData: b,
1970
- isPositioned: v,
1971
- floatingStyles: O,
1972
- update: C,
2220
+ x: u,
2221
+ y: p,
2222
+ strategy: d,
2223
+ placement: h,
2224
+ middlewareData: m,
2225
+ isPositioned: g,
2226
+ floatingStyles: S,
2227
+ update: T,
1973
2228
  refs: {
1974
2229
  anchorEl: e,
1975
2230
  floatingEl: t,
1976
- arrowEl: g
2231
+ arrowEl: v
1977
2232
  },
1978
2233
  open: r,
1979
2234
  setOpen: a
1980
2235
  };
1981
2236
  }
1982
- function Ft(e, t) {
1983
- const n = Gt(e);
2237
+ function Pt(e, t) {
2238
+ const n = jt(e);
1984
2239
  return Math.round(t * n) / n;
1985
2240
  }
1986
- function Gt(e) {
2241
+ function jt(e) {
1987
2242
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1988
2243
  }
1989
- var Ce;
1990
- class Ht {
1991
- constructor(t, n = null, o = {}, i = !1) {
1992
- ae(this, "id");
1993
- ae(this, "data");
1994
- ae(this, "parent");
1995
- ae(this, "children");
1996
- Ne(this, Ce);
1997
- this.id = o.id ?? Tn(), this.data = t, this.parent = qe(n), this.children = qe([]), Ye(this, Ce, i);
1998
- }
1999
- /**
2000
- * Adds an existing node instance to this node's children array.
2001
- * @internal
2002
- * @param childNode The TreeNode instance to add.
2003
- */
2004
- addChild(t) {
2005
- this.children.value = [...this.children.value, t];
2006
- }
2007
- /**
2008
- * Removes a specific child node instance from this node's children.
2009
- * @internal
2010
- * Note: This only removes the direct child link. Use the Tree's `removeNode` method for full removal including map updates and recursive deletion.
2011
- * @param childNode The child node instance to remove.
2012
- * @returns True if the child was found and removed, false otherwise.
2013
- */
2014
- _removeChildInstance(t) {
2015
- return this.children.value.includes(t) ? (this.children.value = this.children.value.filter((n) => n.id !== t.id), t.parent.value = null, !0) : !1;
2016
- }
2017
- /**
2018
- * Finds the first direct child matching the predicate.
2019
- * @param predicate Function to test each child node.
2020
- * @returns The matching child node or null if not found.
2021
- */
2022
- findChild(t) {
2023
- return this.children.value.find(t) ?? null;
2024
- }
2025
- /**
2026
- * Finds the first descendant node (including self) matching the predicate using DFS.
2027
- * @param predicate Function to test each node.
2028
- * @returns The matching descendant node or null if not found.
2029
- */
2030
- findDescendant(t) {
2031
- const n = [this];
2032
- for (; n.length > 0; ) {
2033
- const o = n.pop();
2034
- if (t(o))
2035
- return o;
2036
- for (let i = o.children.value.length - 1; i >= 0; i--)
2037
- n.push(o.children.value[i]);
2244
+ function No(e, t, n = {}, o = {}) {
2245
+ const { ...i } = n, l = Ot(e, t, i), r = wo(l, o);
2246
+ return {
2247
+ ...r,
2248
+ addNode: (p, h, d = {}) => {
2249
+ const { parentId: m, ...g } = d, v = Ot(p, h, g);
2250
+ return r.addNode(v, m);
2251
+ },
2252
+ getAllOpenNodes: () => {
2253
+ const p = [];
2254
+ for (const h of r.nodeMap.values())
2255
+ h.data.open.value && p.push(h);
2256
+ return p;
2257
+ },
2258
+ getTopmostOpenNode: () => {
2259
+ let p = null, h = -1;
2260
+ for (const d of r.nodeMap.values())
2261
+ if (d.data.open.value) {
2262
+ const m = d.getPath().length;
2263
+ m > h && (h = m, p = d);
2264
+ }
2265
+ return p;
2266
+ },
2267
+ applyToNodes: (p, h, d = {}) => {
2268
+ const { relationship: m = "self-and-children", applyToMatching: g = !0 } = d, v = r.findNodeById(p);
2269
+ if (!v)
2270
+ return;
2271
+ const x = [], T = /* @__PURE__ */ new Set(), C = (w) => {
2272
+ w && !T.has(w.id) && (x.push(w), T.add(w.id));
2273
+ }, S = (w) => {
2274
+ for (const b of w)
2275
+ C(b);
2276
+ };
2277
+ if (m === "ancestors-only")
2278
+ for (const w of v.getPath())
2279
+ w.id !== v.id && C(w);
2280
+ else if (m === "siblings-only") {
2281
+ if (v.parent.value)
2282
+ for (const w of v.parent.value.children.value)
2283
+ w.id !== v.id && C(w);
2284
+ } else if (m === "descendants-only")
2285
+ for (const w of r.traverse("dfs", v))
2286
+ w.id !== v.id && C(w);
2287
+ else if (m === "children-only")
2288
+ S(v.children.value);
2289
+ else if (m === "self-and-ancestors")
2290
+ S(v.getPath());
2291
+ else if (m === "self-and-children")
2292
+ C(v), S(v.children.value);
2293
+ else if (m === "self-and-descendants")
2294
+ S(r.traverse("dfs", v));
2295
+ else if (m === "self-and-siblings")
2296
+ C(v), v.parent.value && S(v.parent.value.children.value);
2297
+ else if (m === "self-ancestors-and-children")
2298
+ S(v.getPath()), S(v.children.value);
2299
+ else if (m === "full-branch")
2300
+ S(v.getPath()), S(r.traverse("dfs", v));
2301
+ else if (m === "all-except-branch") {
2302
+ const w = /* @__PURE__ */ new Set();
2303
+ for (const b of v.getPath())
2304
+ w.add(b.id);
2305
+ for (const b of r.traverse("dfs", v))
2306
+ w.add(b.id);
2307
+ for (const b of r.nodeMap.values())
2308
+ !w.has(b.id) === g && h(b);
2309
+ return;
2310
+ } else {
2311
+ console.warn(`applyToNodes: Unknown relationship "${m}".`);
2312
+ return;
2313
+ }
2314
+ if (g)
2315
+ for (const w of x)
2316
+ h(w);
2317
+ else
2318
+ for (const w of r.nodeMap.values())
2319
+ T.has(w.id) || h(w);
2038
2320
  }
2039
- return null;
2040
- }
2041
- /**
2042
- * Checks if this node is a descendant of the potential ancestor.
2043
- * @param potentialAncestor The node to check against.
2044
- * @returns True if this node is a descendant, false otherwise.
2045
- */
2046
- isDescendantOf(t) {
2047
- let n = this.parent.value;
2048
- for (; n; ) {
2049
- if (n.id === t.id)
2050
- return !0;
2051
- n = n.parent.value;
2321
+ };
2322
+ }
2323
+ function Lt(e, t = null, n = {}, o = !1) {
2324
+ const i = n.id ?? wn(), l = je(t), r = je([]), a = N(() => r.value.length === 0), f = {
2325
+ id: i,
2326
+ data: e,
2327
+ parent: l,
2328
+ children: r,
2329
+ isRoot: o,
2330
+ isLeaf: a,
2331
+ addChild: (c) => {
2332
+ r.value = [...r.value, c];
2333
+ },
2334
+ _removeChildInstance: (c) => r.value.includes(c) ? (r.value = r.value.filter((u) => u.id !== c.id), c.parent.value = null, !0) : !1,
2335
+ findChild: (c) => r.value.find(c) ?? null,
2336
+ findDescendant: (c) => {
2337
+ const u = [f];
2338
+ for (; u.length > 0; ) {
2339
+ const p = u.pop();
2340
+ if (c(p))
2341
+ return p;
2342
+ for (let h = p.children.value.length - 1; h >= 0; h--)
2343
+ u.push(p.children.value[h]);
2344
+ }
2345
+ return null;
2346
+ },
2347
+ isDescendantOf: (c) => {
2348
+ let u = l.value;
2349
+ for (; u; ) {
2350
+ if (u.id === c.id)
2351
+ return !0;
2352
+ u = u.parent.value;
2353
+ }
2354
+ return !1;
2355
+ },
2356
+ getPath: () => {
2357
+ const c = [];
2358
+ let u = f;
2359
+ for (; u; )
2360
+ c.push(u), u = u.parent.value;
2361
+ return c.reverse();
2052
2362
  }
2053
- return !1;
2054
- }
2055
- /**
2056
- * Gets the path of nodes from the root to this node.
2057
- * @returns An array of nodes starting with the root and ending with this node.
2058
- */
2059
- getPath() {
2060
- const t = [];
2061
- let n = this;
2062
- for (; n; )
2063
- t.push(n), n = n.parent.value;
2064
- return t.reverse();
2065
- }
2066
- /** Checks if the node is the true root of the tree, distinct from an orphaned node. */
2067
- get isRoot() {
2068
- return Xe(this, Ce);
2069
- }
2070
- /** Checks if the node is a leaf node (has no children). */
2071
- get isLeaf() {
2072
- return this.children.value.length === 0;
2073
- }
2363
+ };
2364
+ return Object.freeze(f);
2074
2365
  }
2075
- Ce = new WeakMap();
2076
- var Le, Pe, Ze;
2077
- class To {
2078
- /**
2079
- * Creates a new Tree instance.
2080
- * @param initialRootData Data for the root node.
2081
- * @param options Configuration options for the tree behavior.
2082
- *
2083
- * @example
2084
- * ```ts
2085
- * const myTree = new Tree({ name: 'Root' });
2086
- * const childNode = myTree.addNode({ name: 'Child' }, myTree.root.id);
2087
- * ```
2088
- */
2089
- constructor(t, n) {
2090
- Ne(this, Pe);
2091
- /** The root node of the tree. */
2092
- ae(this, "root");
2093
- /** Readonly reactive map of node IDs to TreeNode instances for quick lookups. */
2094
- ae(this, "nodeMap");
2095
- Ne(this, Le);
2096
- Ye(this, Le, (n == null ? void 0 : n.deleteStrategy) ?? "recursive"), this.nodeMap = on(/* @__PURE__ */ new Map()), this.root = new Ht(t, null, {}, !0), this.nodeMap.set(this.root.id, this.root);
2097
- }
2098
- /**
2099
- * Finds a node anywhere in the tree by its ID.
2100
- * @param id The ID of the node to find.
2101
- * @returns The node if found, otherwise null.
2102
- */
2103
- findNodeById(t) {
2104
- return this.nodeMap.get(t) ?? null;
2105
- }
2106
- /**
2107
- * Adds a new node to the tree.
2108
- * @param data The data for the new node.
2109
- * @param parentId The ID of the parent node. If null or undefined, adds to the root.
2110
- * @param nodeOptions Optional configuration for the new node (e.g., custom ID).
2111
- * @returns The newly created TreeNode, or null if the parent was not found.
2112
- */
2113
- addNode(t, n = null, o = {}) {
2114
- const i = n ? this.findNodeById(n) : this.root;
2115
- if (!i)
2116
- return console.error(`Tree addNode: Parent node with ID ${n} not found.`), null;
2117
- o.id && this.nodeMap.has(o.id) && (o.id = void 0);
2118
- const s = new Ht(t, i, o);
2119
- return this.nodeMap.set(s.id, s), i.addChild(s), s;
2120
- }
2121
- /**
2122
- * Removes a node from the tree by its ID.
2123
- * Handles deletion of descendants based on the provided strategy or the tree's default.
2124
- * @param nodeId The ID of the node to remove.
2125
- * @param deleteStrategy Optional strategy override. If not provided, uses the tree's default strategy.
2126
- * @returns True if the node was successfully removed, false otherwise.
2127
- */
2128
- removeNode(t, n) {
2129
- const o = n ?? Xe(this, Le), i = this.findNodeById(t);
2130
- if (!i)
2366
+ function wo(e, t) {
2367
+ const n = (t == null ? void 0 : t.deleteStrategy) ?? "recursive", o = Jt(/* @__PURE__ */ new Map()), i = Lt(e, null, {}, !0);
2368
+ o.set(i.id, i);
2369
+ const l = (h) => o.get(h) ?? null, r = (h, d = null, m = {}) => {
2370
+ const g = d ? l(d) : i;
2371
+ if (!g)
2372
+ return console.error(`Tree addNode: Parent node with ID ${d} not found.`), null;
2373
+ m.id && o.has(m.id) && (m.id = void 0);
2374
+ const v = Lt(h, g, m);
2375
+ return o.set(v.id, v), g.addChild(v), v;
2376
+ }, a = (h, d) => {
2377
+ const m = d ?? n, g = l(h);
2378
+ if (!g)
2131
2379
  return !1;
2132
- if (i.isRoot)
2380
+ if (g.isRoot)
2133
2381
  return console.error("Tree removeNode: Cannot remove the root node."), !1;
2134
- const s = i.parent.value;
2135
- if (o === "recursive")
2136
- je(this, Pe, Ze).call(this, i);
2382
+ const v = g.parent.value;
2383
+ if (m === "recursive")
2384
+ p(g);
2137
2385
  else {
2138
- for (const r of i.children.value)
2139
- r.parent.value = null;
2140
- i.children.value = [], this.nodeMap.delete(i.id);
2386
+ for (const x of g.children.value)
2387
+ x.parent.value = null;
2388
+ g.children.value = [], o.delete(g.id);
2141
2389
  }
2142
- return s._removeChildInstance(i);
2143
- }
2144
- /**
2145
- * Moves a node to become a child of a new parent.
2146
- * @param nodeId The ID of the node to move.
2147
- * @param newParentId The ID of the new parent node. Set to null to move to the root level.
2148
- * @returns True if the node was successfully moved, false otherwise.
2149
- */
2150
- moveNode(t, n) {
2151
- const o = this.findNodeById(t);
2152
- if (!o)
2153
- return console.error(`Tree moveNode: Node with ID ${t} not found.`), !1;
2154
- if (o.isRoot)
2390
+ return v._removeChildInstance(g);
2391
+ }, f = (h, d) => {
2392
+ const m = l(h);
2393
+ if (!m)
2394
+ return console.error(`Tree moveNode: Node with ID ${h} not found.`), !1;
2395
+ if (m.isRoot)
2155
2396
  return console.error("Tree moveNode: Cannot move the root node."), !1;
2156
- if (t === n)
2397
+ if (h === d)
2157
2398
  return console.error("Tree moveNode: Cannot move a node to be a child of itself."), !1;
2158
- const i = n ? this.findNodeById(n) : this.root;
2159
- if (!i)
2160
- return console.error(`Tree moveNode: New parent node with ID ${n} not found.`), !1;
2161
- if (i.isDescendantOf(o))
2399
+ const g = d ? l(d) : i;
2400
+ if (!g)
2401
+ return console.error(`Tree moveNode: New parent node with ID ${d} not found.`), !1;
2402
+ if (g.isDescendantOf(m))
2162
2403
  return console.error("Tree moveNode: Cannot move a node to become its own descendant."), !1;
2163
- const s = o.parent.value;
2164
- if (s) {
2165
- if (!s._removeChildInstance(o))
2404
+ const v = m.parent.value;
2405
+ if (v) {
2406
+ if (!v._removeChildInstance(m))
2166
2407
  return console.error("Tree moveNode: Failed to remove node from its original parent."), !1;
2167
- } else if (o.isRoot) {
2168
- if (o.isRoot)
2408
+ } else if (m.isRoot) {
2409
+ if (m.isRoot)
2169
2410
  return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."), !1;
2170
2411
  }
2171
- return i.addChild(o), o.parent.value = i, !0;
2172
- }
2173
- /**
2174
- * Traverses the tree using either Depth-First Search (DFS) or Breadth-First Search (BFS).
2175
- * @param strategy The traversal strategy ('dfs' or 'bfs'). Defaults to 'dfs'.
2176
- * @param startNode The node to start traversal from. Defaults to the root node.
2177
- * @returns An array of nodes in the order they were visited.
2178
- */
2179
- traverse(t = "dfs", n = this.root) {
2180
- const o = [];
2181
- if (!n)
2182
- return console.warn("Tree traverse: Start node is null, returning empty array."), o;
2183
- if (t === "dfs") {
2184
- const i = [n];
2185
- for (; i.length > 0; ) {
2186
- const s = i.pop();
2187
- o.push(s);
2188
- for (let r = s.children.value.length - 1; r >= 0; r--)
2189
- i.push(s.children.value[r]);
2412
+ return g.addChild(m), m.parent.value = g, !0;
2413
+ }, c = (h = "dfs", d = i) => {
2414
+ const m = [];
2415
+ if (!d)
2416
+ return console.warn("Tree traverse: Start node is null, returning empty array."), m;
2417
+ if (h === "dfs") {
2418
+ const g = [d];
2419
+ for (; g.length > 0; ) {
2420
+ const v = g.pop();
2421
+ m.push(v);
2422
+ for (let x = v.children.value.length - 1; x >= 0; x--)
2423
+ g.push(v.children.value[x]);
2190
2424
  }
2191
2425
  } else {
2192
- const i = [n];
2193
- for (; i.length > 0; ) {
2194
- const s = i.shift();
2195
- o.push(s);
2196
- for (const r of s.children.value)
2197
- i.push(r);
2426
+ const g = [d];
2427
+ for (; g.length > 0; ) {
2428
+ const v = g.shift();
2429
+ m.push(v);
2430
+ for (const x of v.children.value)
2431
+ g.push(x);
2198
2432
  }
2199
2433
  }
2200
- return o;
2201
- }
2202
- /**
2203
- * Clears the internal node map. This is crucial for allowing garbage collection
2204
- * when the Tree instance is no longer needed, especially in scenarios like
2205
- * Vue components where the instance might be tied to the component lifecycle.
2206
- * Call this method when you are finished with the Tree instance (e.g., in `onScopeDispose`).
2207
- */
2208
- dispose() {
2209
- this.nodeMap.clear();
2210
- }
2211
- }
2212
- Le = new WeakMap(), Pe = new WeakSet(), // --- Internal Recursive Helper for Deletion/Cleanup ---
2213
- Ze = function(t) {
2214
- const n = [...t.children.value];
2215
- for (const o of n)
2216
- je(this, Pe, Ze).call(this, o);
2217
- this.nodeMap.delete(t.id), t.children.value = [];
2218
- };
2219
- function Ho(e, t, n = {}, o = {}) {
2220
- const { ...i } = n, s = kt(e, t, i), r = new To(s, o);
2221
- return {
2222
- // Wrap original Tree methods in arrow functions to preserve context
2223
- get nodeMap() {
2224
- return r.nodeMap;
2225
- },
2434
+ return m;
2435
+ }, u = () => {
2436
+ o.clear();
2437
+ }, p = (h) => {
2438
+ const d = [...h.children.value];
2439
+ for (const m of d)
2440
+ p(m);
2441
+ o.delete(h.id), h.children.value = [];
2442
+ };
2443
+ return Object.freeze({
2226
2444
  get root() {
2227
- return r.root;
2228
- },
2229
- findNodeById: (g) => r.findNodeById(g),
2230
- moveNode: (g, y) => r.moveNode(g, y),
2231
- dispose: () => {
2232
- r.dispose();
2445
+ return i;
2233
2446
  },
2234
- addNode: (g, y, C = {}) => {
2235
- const { parentId: x, ...O } = C, m = kt(g, y, O);
2236
- return r.addNode(m, x);
2237
- },
2238
- removeNode: (g, y) => r.removeNode(g, y),
2239
- traverse: (g, y) => r.traverse(g, y),
2240
- getAllOpenNodes: () => {
2241
- const g = [];
2242
- for (const y of r.nodeMap.values())
2243
- y.data.open.value && g.push(y);
2244
- return g;
2245
- },
2246
- getTopmostOpenNode: () => {
2247
- let g = null, y = -1;
2248
- for (const C of r.nodeMap.values())
2249
- if (C.data.open.value) {
2250
- const x = C.getPath().length;
2251
- x > y && (y = x, g = C);
2252
- }
2253
- return g;
2447
+ get nodeMap() {
2448
+ return o;
2254
2449
  },
2255
- forEach: (g, y, C = {}) => {
2256
- const { relationship: x = "self-and-children", applyToMatching: O = !0 } = C, m = r.findNodeById(g);
2257
- if (!m)
2258
- return;
2259
- const A = [], S = /* @__PURE__ */ new Set(), R = (L) => {
2260
- L && !S.has(L.id) && (A.push(L), S.add(L.id));
2261
- }, N = (L) => {
2262
- for (const D of L)
2263
- R(D);
2264
- };
2265
- if (x === "ancestors-only")
2266
- for (const L of m.getPath())
2267
- L.id !== m.id && R(L);
2268
- else if (x === "siblings-only") {
2269
- if (m.parent.value)
2270
- for (const L of m.parent.value.children.value)
2271
- L.id !== m.id && R(L);
2272
- } else if (x === "descendants-only")
2273
- for (const L of r.traverse("dfs", m))
2274
- L.id !== m.id && R(L);
2275
- else if (x === "children-only")
2276
- N(m.children.value);
2277
- else if (x === "self-and-ancestors")
2278
- N(m.getPath());
2279
- else if (x === "self-and-children")
2280
- R(m), N(m.children.value);
2281
- else if (x === "self-and-descendants")
2282
- N(r.traverse("dfs", m));
2283
- else if (x === "self-and-siblings")
2284
- R(m), m.parent.value && N(m.parent.value.children.value);
2285
- else if (x === "self-ancestors-and-children")
2286
- N(m.getPath()), N(m.children.value);
2287
- else if (x === "full-branch")
2288
- N(m.getPath()), N(r.traverse("dfs", m));
2289
- else if (x === "all-except-branch") {
2290
- const L = /* @__PURE__ */ new Set();
2291
- for (const D of m.getPath())
2292
- L.add(D.id);
2293
- for (const D of r.traverse("dfs", m))
2294
- L.add(D.id);
2295
- for (const D of r.nodeMap.values())
2296
- !L.has(D.id) === O && y(D);
2297
- return;
2298
- } else {
2299
- console.warn(`forEach: Unknown relationship "${x}".`);
2300
- return;
2301
- }
2302
- if (O)
2303
- for (const L of A)
2304
- y(L);
2305
- else
2306
- for (const L of r.nodeMap.values())
2307
- S.has(L.id) || y(L);
2308
- }
2309
- };
2450
+ findNodeById: l,
2451
+ addNode: r,
2452
+ removeNode: a,
2453
+ moveNode: f,
2454
+ traverse: c,
2455
+ dispose: u
2456
+ });
2310
2457
  }
2311
2458
  export {
2312
- To as Tree,
2313
- Ht as TreeNode,
2314
- xt as clearTimeoutIfSet,
2315
- ze as contains,
2316
- tt as findDescendantContainingTarget,
2317
- Ro as flip,
2318
- et as getContextFromParameter,
2319
- bt as getCurrentTime,
2320
- vn as getTarget,
2321
- ko as hide,
2322
- gt as isButtonTarget,
2323
- pn as isClickOnScrollbar,
2324
- yt as isEventTargetWithin,
2325
- hn as isHTMLElement,
2326
- pt as isMac,
2327
- Ke as isMouseLikePointerType,
2328
- vt as isSafari,
2329
- wt as isSpaceIgnored,
2459
+ dt as clearTimeoutIfSet,
2460
+ Ve as contains,
2461
+ wo as createTree,
2462
+ Lt as createTreeNode,
2463
+ Ke as findDescendantContainingTarget,
2464
+ Ao as flip,
2465
+ Fe as getContextFromParameter,
2466
+ ft as getCurrentTime,
2467
+ cn as getTarget,
2468
+ Mo as hide,
2469
+ at as isButtonTarget,
2470
+ an as isClickOnScrollbar,
2471
+ ut as isEventTargetWithin,
2472
+ ln as isHTMLElement,
2473
+ st as isMac,
2474
+ St as isMouseLikePointerType,
2475
+ lt as isSafari,
2476
+ ct as isSpaceIgnored,
2330
2477
  J as isTargetWithinElement,
2331
- gn as isTreeNode,
2332
- Bt as isTypeableElement,
2333
- mn as isVirtualElement,
2334
- dn as matchesFocusVisible,
2335
- No as offset,
2336
- Do as shift,
2337
- Fo as useArrow,
2338
- Po as useClick,
2339
- Oo as useClientPoint,
2340
- Mo as useEscapeKey,
2341
- kt as useFloating,
2342
- Ho as useFloatingTree,
2343
- So as useFocus,
2344
- Ao as useHover
2478
+ un as isTreeNode,
2479
+ At as isTypeableElement,
2480
+ xo as isVirtualElement,
2481
+ sn as matchesFocusVisible,
2482
+ Lo as offset,
2483
+ So as shift,
2484
+ Do as useArrow,
2485
+ Eo as useClick,
2486
+ Co as useClientPoint,
2487
+ To as useEscapeKey,
2488
+ Ot as useFloating,
2489
+ No as useFloatingTree,
2490
+ Oo as useFocus,
2491
+ Po as useHover
2345
2492
  };