v-float 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,82 @@
1
- var gt = Object.defineProperty;
2
- var Ie = (e) => {
1
+ var Nt = Object.defineProperty;
2
+ var ot = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var wt = (e, t, n) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var U = (e, t, n) => wt(e, typeof t != "symbol" ? t + "" : t, n), Ee = (e, t, n) => t.has(e) || Ie("Cannot " + n);
7
- var Te = (e, t, n) => (Ee(e, t, "read from private field"), n ? n.call(e) : t.get(e)), de = (e, t, n) => t.has(e) ? Ie("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Le = (e, t, n, o) => (Ee(e, t, "write to private field"), o ? o.call(e, n) : t.set(e, n), n), Oe = (e, t, n) => (Ee(e, t, "access private method"), n);
8
- import { ref as j, computed as O, toValue as T, shallowRef as Me, watch as ve, onWatcherCleanup as q, onScopeDispose as ae, watchPostEffect as re, getCurrentScope as yt, unref as xt, onMounted as bt, watchEffect as Ae, readonly as Et, shallowReactive as Tt } from "vue";
9
- const Lt = ["top", "right", "bottom", "left"], ee = Math.min, G = Math.max, pe = Math.round, he = Math.floor, F = (e) => ({
5
+ var kt = (e, t, n) => t in e ? Nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
+ var z = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n), Se = (e, t, n) => t.has(e) || ot("Cannot " + n);
7
+ var Re = (e, t, n) => (Se(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Te = (e, t, n) => t.has(e) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Ne = (e, t, n, o) => (Se(e, t, "write to private field"), o ? o.call(e, n) : t.set(e, n), n), ke = (e, t, n) => (Se(e, t, "access private method"), n);
8
+ import { ref as G, computed as A, toValue as P, shallowRef as We, watch as pe, onWatcherCleanup as B, onScopeDispose as re, watchPostEffect as me, getCurrentScope as Ht, unref as Ft, onMounted as $t, watchEffect as Ve, readonly as It, shallowReactive as Wt } from "vue";
9
+ const Vt = ["top", "right", "bottom", "left"], le = Math.min, ee = Math.max, Le = Math.round, xe = Math.floor, K = (e) => ({
10
10
  x: e,
11
11
  y: e
12
- }), Ot = {
12
+ }), Yt = {
13
13
  left: "right",
14
14
  right: "left",
15
15
  bottom: "top",
16
16
  top: "bottom"
17
- }, Rt = {
17
+ }, Xt = {
18
18
  start: "end",
19
19
  end: "start"
20
20
  };
21
- function De(e, t, n) {
22
- return G(e, ee(t, n));
21
+ function Ye(e, t, n) {
22
+ return ee(e, le(t, n));
23
23
  }
24
- function oe(e, t) {
24
+ function ue(e, t) {
25
25
  return typeof e == "function" ? e(t) : e;
26
26
  }
27
- function J(e) {
27
+ function te(e) {
28
28
  return e.split("-")[0];
29
29
  }
30
- function ue(e) {
30
+ function ye(e) {
31
31
  return e.split("-")[1];
32
32
  }
33
- function it(e) {
33
+ function Tt(e) {
34
34
  return e === "x" ? "y" : "x";
35
35
  }
36
- function He(e) {
36
+ function Ke(e) {
37
37
  return e === "y" ? "height" : "width";
38
38
  }
39
- function te(e) {
40
- return ["top", "bottom"].includes(J(e)) ? "y" : "x";
39
+ function ae(e) {
40
+ return ["top", "bottom"].includes(te(e)) ? "y" : "x";
41
41
  }
42
- function Fe(e) {
43
- return it(te(e));
42
+ function Ue(e) {
43
+ return Tt(ae(e));
44
44
  }
45
- function Pt(e, t, n) {
45
+ function jt(e, t, n) {
46
46
  n === void 0 && (n = !1);
47
- const o = ue(e), i = Fe(e), s = He(i);
48
- let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
49
- return t.reference[s] > t.floating[s] && (r = me(r)), [r, me(r)];
47
+ const o = ye(e), i = Ue(e), r = Ke(i);
48
+ let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
49
+ return t.reference[r] > t.floating[r] && (s = Pe(s)), [s, Pe(s)];
50
50
  }
51
- function Ct(e) {
52
- const t = me(e);
53
- return [Ne(e), t, Ne(t)];
51
+ function _t(e) {
52
+ const t = Pe(e);
53
+ return [Xe(e), t, Xe(t)];
54
54
  }
55
- function Ne(e) {
56
- return e.replace(/start|end/g, (t) => Rt[t]);
55
+ function Xe(e) {
56
+ return e.replace(/start|end/g, (t) => Xt[t]);
57
57
  }
58
- function Mt(e, t, n) {
59
- const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
58
+ function Kt(e, t, n) {
59
+ const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
60
60
  switch (e) {
61
61
  case "top":
62
62
  case "bottom":
63
63
  return n ? t ? i : o : t ? o : i;
64
64
  case "left":
65
65
  case "right":
66
- return t ? s : r;
66
+ return t ? r : s;
67
67
  default:
68
68
  return [];
69
69
  }
70
70
  }
71
- function At(e, t, n, o) {
72
- const i = ue(e);
73
- let s = Mt(J(e), n === "start", o);
74
- return i && (s = s.map((r) => r + "-" + i), t && (s = s.concat(s.map(Ne)))), s;
71
+ function Ut(e, t, n, o) {
72
+ const i = ye(e);
73
+ let r = Kt(te(e), n === "start", o);
74
+ return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(Xe)))), r;
75
75
  }
76
- function me(e) {
77
- return e.replace(/left|right|bottom|top/g, (t) => Ot[t]);
76
+ function Pe(e) {
77
+ return e.replace(/left|right|bottom|top/g, (t) => Yt[t]);
78
78
  }
79
- function Dt(e) {
79
+ function qt(e) {
80
80
  return {
81
81
  top: 0,
82
82
  right: 0,
@@ -85,15 +85,15 @@ function Dt(e) {
85
85
  ...e
86
86
  };
87
87
  }
88
- function rt(e) {
89
- return typeof e != "number" ? Dt(e) : {
88
+ function xt(e) {
89
+ return typeof e != "number" ? qt(e) : {
90
90
  top: e,
91
91
  right: e,
92
92
  bottom: e,
93
93
  left: e
94
94
  };
95
95
  }
96
- function ge(e) {
96
+ function Oe(e) {
97
97
  const {
98
98
  x: t,
99
99
  y: n,
@@ -111,161 +111,161 @@ function ge(e) {
111
111
  y: n
112
112
  };
113
113
  }
114
- function Ye(e, t, n) {
114
+ function it(e, t, n) {
115
115
  let {
116
116
  reference: o,
117
117
  floating: i
118
118
  } = e;
119
- const s = te(t), r = Fe(t), l = He(r), a = J(t), c = s === "y", f = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[l] / 2 - i[l] / 2;
120
- let h;
121
- switch (a) {
119
+ const r = ae(t), s = Ue(t), c = Ke(s), f = te(t), a = r === "y", h = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, v = o[c] / 2 - i[c] / 2;
120
+ let u;
121
+ switch (f) {
122
122
  case "top":
123
- h = {
124
- x: f,
123
+ u = {
124
+ x: h,
125
125
  y: o.y - i.height
126
126
  };
127
127
  break;
128
128
  case "bottom":
129
- h = {
130
- x: f,
129
+ u = {
130
+ x: h,
131
131
  y: o.y + o.height
132
132
  };
133
133
  break;
134
134
  case "right":
135
- h = {
135
+ u = {
136
136
  x: o.x + o.width,
137
- y: u
137
+ y: d
138
138
  };
139
139
  break;
140
140
  case "left":
141
- h = {
141
+ u = {
142
142
  x: o.x - i.width,
143
- y: u
143
+ y: d
144
144
  };
145
145
  break;
146
146
  default:
147
- h = {
147
+ u = {
148
148
  x: o.x,
149
149
  y: o.y
150
150
  };
151
151
  }
152
- switch (ue(t)) {
152
+ switch (ye(t)) {
153
153
  case "start":
154
- h[r] -= m * (n && c ? -1 : 1);
154
+ u[s] -= v * (n && a ? -1 : 1);
155
155
  break;
156
156
  case "end":
157
- h[r] += m * (n && c ? -1 : 1);
157
+ u[s] += v * (n && a ? -1 : 1);
158
158
  break;
159
159
  }
160
- return h;
160
+ return u;
161
161
  }
162
- const Nt = async (e, t, n) => {
162
+ const Gt = async (e, t, n) => {
163
163
  const {
164
164
  placement: o = "bottom",
165
165
  strategy: i = "absolute",
166
- middleware: s = [],
167
- platform: r
168
- } = n, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(t));
169
- let c = await r.getElementRects({
166
+ middleware: r = [],
167
+ platform: s
168
+ } = n, c = r.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(t));
169
+ let a = await s.getElementRects({
170
170
  reference: e,
171
171
  floating: t,
172
172
  strategy: i
173
173
  }), {
174
- x: f,
175
- y: u
176
- } = Ye(c, o, a), m = o, h = {}, p = 0;
177
- for (let d = 0; d < l.length; d++) {
174
+ x: h,
175
+ y: d
176
+ } = it(a, o, f), v = o, u = {}, g = 0;
177
+ for (let p = 0; p < c.length; p++) {
178
178
  const {
179
- name: v,
180
- fn: w
181
- } = l[d], {
182
- x: E,
183
- y: x,
184
- data: g,
185
- reset: b
186
- } = await w({
187
- x: f,
188
- y: u,
179
+ name: m,
180
+ fn: y
181
+ } = c[p], {
182
+ x,
183
+ y: T,
184
+ data: w,
185
+ reset: L
186
+ } = await y({
187
+ x: h,
188
+ y: d,
189
189
  initialPlacement: o,
190
- placement: m,
190
+ placement: v,
191
191
  strategy: i,
192
- middlewareData: h,
193
- rects: c,
194
- platform: r,
192
+ middlewareData: u,
193
+ rects: a,
194
+ platform: s,
195
195
  elements: {
196
196
  reference: e,
197
197
  floating: t
198
198
  }
199
199
  });
200
- f = E ?? f, u = x ?? u, h = {
201
- ...h,
202
- [v]: {
203
- ...h[v],
204
- ...g
200
+ h = x ?? h, d = T ?? d, u = {
201
+ ...u,
202
+ [m]: {
203
+ ...u[m],
204
+ ...w
205
205
  }
206
- }, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (c = b.rects === !0 ? await r.getElementRects({
206
+ }, L && g <= 50 && (g++, typeof L == "object" && (L.placement && (v = L.placement), L.rects && (a = L.rects === !0 ? await s.getElementRects({
207
207
  reference: e,
208
208
  floating: t,
209
209
  strategy: i
210
- }) : b.rects), {
211
- x: f,
212
- y: u
213
- } = Ye(c, m, a)), d = -1);
210
+ }) : L.rects), {
211
+ x: h,
212
+ y: d
213
+ } = it(a, v, f)), p = -1);
214
214
  }
215
215
  return {
216
- x: f,
217
- y: u,
218
- placement: m,
216
+ x: h,
217
+ y: d,
218
+ placement: v,
219
219
  strategy: i,
220
- middlewareData: h
220
+ middlewareData: u
221
221
  };
222
222
  };
223
- async function we(e, t) {
223
+ async function Ce(e, t) {
224
224
  var n;
225
225
  t === void 0 && (t = {});
226
226
  const {
227
227
  x: o,
228
228
  y: i,
229
- platform: s,
230
- rects: r,
231
- elements: l,
232
- strategy: a
229
+ platform: r,
230
+ rects: s,
231
+ elements: c,
232
+ strategy: f
233
233
  } = e, {
234
- boundary: c = "clippingAncestors",
235
- rootBoundary: f = "viewport",
236
- elementContext: u = "floating",
237
- altBoundary: m = !1,
238
- padding: h = 0
239
- } = oe(t, e), p = rt(h), v = l[m ? u === "floating" ? "reference" : "floating" : u], w = ge(await s.getClippingRect({
240
- element: (n = await (s.isElement == null ? void 0 : s.isElement(v))) == null || n ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
241
- boundary: c,
242
- rootBoundary: f,
243
- strategy: a
244
- })), E = u === "floating" ? {
234
+ boundary: a = "clippingAncestors",
235
+ rootBoundary: h = "viewport",
236
+ elementContext: d = "floating",
237
+ altBoundary: v = !1,
238
+ padding: u = 0
239
+ } = ue(t, e), g = xt(u), m = c[v ? d === "floating" ? "reference" : "floating" : d], y = Oe(await r.getClippingRect({
240
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(m))) == null || n ? m : m.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
241
+ boundary: a,
242
+ rootBoundary: h,
243
+ strategy: f
244
+ })), x = d === "floating" ? {
245
245
  x: o,
246
246
  y: i,
247
- width: r.floating.width,
248
- height: r.floating.height
249
- } : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), g = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
247
+ width: s.floating.width,
248
+ height: s.floating.height
249
+ } : s.reference, T = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), w = await (r.isElement == null ? void 0 : r.isElement(T)) ? await (r.getScale == null ? void 0 : r.getScale(T)) || {
250
250
  x: 1,
251
251
  y: 1
252
252
  } : {
253
253
  x: 1,
254
254
  y: 1
255
- }, b = ge(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
256
- elements: l,
257
- rect: E,
258
- offsetParent: x,
259
- strategy: a
260
- }) : E);
255
+ }, L = Oe(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
256
+ elements: c,
257
+ rect: x,
258
+ offsetParent: T,
259
+ strategy: f
260
+ }) : x);
261
261
  return {
262
- top: (w.top - b.top + p.top) / g.y,
263
- bottom: (b.bottom - w.bottom + p.bottom) / g.y,
264
- left: (w.left - b.left + p.left) / g.x,
265
- right: (b.right - w.right + p.right) / g.x
262
+ top: (y.top - L.top + g.top) / w.y,
263
+ bottom: (L.bottom - y.bottom + g.bottom) / w.y,
264
+ left: (y.left - L.left + g.left) / w.x,
265
+ right: (L.right - y.right + g.right) / w.x
266
266
  };
267
267
  }
268
- const St = (e) => ({
268
+ const Jt = (e) => ({
269
269
  name: "arrow",
270
270
  options: e,
271
271
  async fn(t) {
@@ -273,36 +273,36 @@ const St = (e) => ({
273
273
  x: n,
274
274
  y: o,
275
275
  placement: i,
276
- rects: s,
277
- platform: r,
278
- elements: l,
279
- middlewareData: a
276
+ rects: r,
277
+ platform: s,
278
+ elements: c,
279
+ middlewareData: f
280
280
  } = t, {
281
- element: c,
282
- padding: f = 0
283
- } = oe(e, t) || {};
284
- if (c == null)
281
+ element: a,
282
+ padding: h = 0
283
+ } = ue(e, t) || {};
284
+ if (a == null)
285
285
  return {};
286
- const u = rt(f), m = {
286
+ const d = xt(h), v = {
287
287
  x: n,
288
288
  y: o
289
- }, h = Fe(i), p = He(h), d = await r.getDimensions(c), v = h === "y", w = v ? "top" : "left", E = v ? "bottom" : "right", x = v ? "clientHeight" : "clientWidth", g = s.reference[p] + s.reference[h] - m[h] - s.floating[p], b = m[h] - s.reference[h], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
290
- let L = R ? R[x] : 0;
291
- (!L || !await (r.isElement == null ? void 0 : r.isElement(R))) && (L = l.floating[x] || s.floating[p]);
292
- const W = g / 2 - b / 2, k = L / 2 - d[p] / 2 - 1, A = ee(u[w], k), I = ee(u[E], k), y = A, C = L - d[p] - I, P = L / 2 - d[p] / 2 + W, Y = De(y, P, C), V = !a.arrow && ue(i) != null && P !== Y && s.reference[p] / 2 - (P < y ? A : I) - d[p] / 2 < 0, H = V ? P < y ? P - y : P - C : 0;
289
+ }, u = Ue(i), g = Ke(u), p = await s.getDimensions(a), m = u === "y", y = m ? "top" : "left", x = m ? "bottom" : "right", T = m ? "clientHeight" : "clientWidth", w = r.reference[g] + r.reference[u] - v[u] - r.floating[g], L = v[u] - r.reference[u], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a));
290
+ let M = O ? O[T] : 0;
291
+ (!M || !await (s.isElement == null ? void 0 : s.isElement(O))) && (M = c.floating[T] || r.floating[g]);
292
+ const H = w / 2 - L / 2, b = M / 2 - p[g] / 2 - 1, l = le(d[y], b), k = le(d[x], b), S = l, W = M - p[g] - k, C = M / 2 - p[g] / 2 + H, D = Ye(S, C, W), E = !f.arrow && ye(i) != null && C !== D && r.reference[g] / 2 - (C < S ? l : k) - p[g] / 2 < 0, R = E ? C < S ? C - S : C - W : 0;
293
293
  return {
294
- [h]: m[h] + H,
294
+ [u]: v[u] + R,
295
295
  data: {
296
- [h]: Y,
297
- centerOffset: P - Y - H,
298
- ...V && {
299
- alignmentOffset: H
296
+ [u]: D,
297
+ centerOffset: C - D - R,
298
+ ...E && {
299
+ alignmentOffset: R
300
300
  }
301
301
  },
302
- reset: V
302
+ reset: E
303
303
  };
304
304
  }
305
- }), kt = function(e) {
305
+ }), Qt = function(e) {
306
306
  return e === void 0 && (e = {}), {
307
307
  name: "flip",
308
308
  options: e,
@@ -310,71 +310,71 @@ const St = (e) => ({
310
310
  var n, o;
311
311
  const {
312
312
  placement: i,
313
- middlewareData: s,
314
- rects: r,
315
- initialPlacement: l,
316
- platform: a,
317
- elements: c
313
+ middlewareData: r,
314
+ rects: s,
315
+ initialPlacement: c,
316
+ platform: f,
317
+ elements: a
318
318
  } = t, {
319
- mainAxis: f = !0,
320
- crossAxis: u = !0,
321
- fallbackPlacements: m,
322
- fallbackStrategy: h = "bestFit",
323
- fallbackAxisSideDirection: p = "none",
324
- flipAlignment: d = !0,
325
- ...v
326
- } = oe(e, t);
327
- if ((n = s.arrow) != null && n.alignmentOffset)
319
+ mainAxis: h = !0,
320
+ crossAxis: d = !0,
321
+ fallbackPlacements: v,
322
+ fallbackStrategy: u = "bestFit",
323
+ fallbackAxisSideDirection: g = "none",
324
+ flipAlignment: p = !0,
325
+ ...m
326
+ } = ue(e, t);
327
+ if ((n = r.arrow) != null && n.alignmentOffset)
328
328
  return {};
329
- const w = J(i), E = te(l), x = J(l) === l, g = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), b = m || (x || !d ? [me(l)] : Ct(l)), R = p !== "none";
330
- !m && R && b.push(...At(l, d, p, g));
331
- const L = [l, ...b], W = await we(t, v), k = [];
332
- let A = ((o = s.flip) == null ? void 0 : o.overflows) || [];
333
- if (f && k.push(W[w]), u) {
334
- const P = Pt(i, r, g);
335
- k.push(W[P[0]], W[P[1]]);
329
+ const y = te(i), x = ae(c), T = te(c) === c, w = await (f.isRTL == null ? void 0 : f.isRTL(a.floating)), L = v || (T || !p ? [Pe(c)] : _t(c)), O = g !== "none";
330
+ !v && O && L.push(...Ut(c, p, g, w));
331
+ const M = [c, ...L], H = await Ce(t, m), b = [];
332
+ let l = ((o = r.flip) == null ? void 0 : o.overflows) || [];
333
+ if (h && b.push(H[y]), d) {
334
+ const C = jt(i, s, w);
335
+ b.push(H[C[0]], H[C[1]]);
336
336
  }
337
- if (A = [...A, {
337
+ if (l = [...l, {
338
338
  placement: i,
339
- overflows: k
340
- }], !k.every((P) => P <= 0)) {
341
- var I, y;
342
- const P = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, Y = L[P];
343
- if (Y)
339
+ overflows: b
340
+ }], !b.every((C) => C <= 0)) {
341
+ var k, S;
342
+ const C = (((k = r.flip) == null ? void 0 : k.index) || 0) + 1, D = M[C];
343
+ if (D)
344
344
  return {
345
345
  data: {
346
- index: P,
347
- overflows: A
346
+ index: C,
347
+ overflows: l
348
348
  },
349
349
  reset: {
350
- placement: Y
350
+ placement: D
351
351
  }
352
352
  };
353
- let V = (y = A.filter((H) => H.overflows[0] <= 0).sort((H, X) => H.overflows[1] - X.overflows[1])[0]) == null ? void 0 : y.placement;
354
- if (!V)
355
- switch (h) {
353
+ let E = (S = l.filter((R) => R.overflows[0] <= 0).sort((R, F) => R.overflows[1] - F.overflows[1])[0]) == null ? void 0 : S.placement;
354
+ if (!E)
355
+ switch (u) {
356
356
  case "bestFit": {
357
- var C;
358
- const H = (C = A.filter((X) => {
359
- if (R) {
360
- const _ = te(X.placement);
361
- return _ === E || // Create a bias to the `y` side axis due to horizontal
357
+ var W;
358
+ const R = (W = l.filter((F) => {
359
+ if (O) {
360
+ const $ = ae(F.placement);
361
+ return $ === x || // Create a bias to the `y` side axis due to horizontal
362
362
  // reading directions favoring greater width.
363
- _ === "y";
363
+ $ === "y";
364
364
  }
365
365
  return !0;
366
- }).map((X) => [X.placement, X.overflows.filter((_) => _ > 0).reduce((_, mt) => _ + mt, 0)]).sort((X, _) => X[1] - _[1])[0]) == null ? void 0 : C[0];
367
- H && (V = H);
366
+ }).map((F) => [F.placement, F.overflows.filter(($) => $ > 0).reduce(($, _) => $ + _, 0)]).sort((F, $) => F[1] - $[1])[0]) == null ? void 0 : W[0];
367
+ R && (E = R);
368
368
  break;
369
369
  }
370
370
  case "initialPlacement":
371
- V = l;
371
+ E = c;
372
372
  break;
373
373
  }
374
- if (i !== V)
374
+ if (i !== E)
375
375
  return {
376
376
  reset: {
377
- placement: V
377
+ placement: E
378
378
  }
379
379
  };
380
380
  }
@@ -382,7 +382,7 @@ const St = (e) => ({
382
382
  }
383
383
  };
384
384
  };
385
- function Xe(e, t) {
385
+ function st(e, t) {
386
386
  return {
387
387
  top: e.top - t.height,
388
388
  right: e.right - t.width,
@@ -390,10 +390,10 @@ function Xe(e, t) {
390
390
  left: e.left - t.width
391
391
  };
392
392
  }
393
- function _e(e) {
394
- return Lt.some((t) => e[t] >= 0);
393
+ function rt(e) {
394
+ return Vt.some((t) => e[t] >= 0);
395
395
  }
396
- const Ht = function(e) {
396
+ const Zt = function(e) {
397
397
  return e === void 0 && (e = {}), {
398
398
  name: "hide",
399
399
  options: e,
@@ -403,29 +403,29 @@ const Ht = function(e) {
403
403
  } = t, {
404
404
  strategy: o = "referenceHidden",
405
405
  ...i
406
- } = oe(e, t);
406
+ } = ue(e, t);
407
407
  switch (o) {
408
408
  case "referenceHidden": {
409
- const s = await we(t, {
409
+ const r = await Ce(t, {
410
410
  ...i,
411
411
  elementContext: "reference"
412
- }), r = Xe(s, n.reference);
412
+ }), s = st(r, n.reference);
413
413
  return {
414
414
  data: {
415
- referenceHiddenOffsets: r,
416
- referenceHidden: _e(r)
415
+ referenceHiddenOffsets: s,
416
+ referenceHidden: rt(s)
417
417
  }
418
418
  };
419
419
  }
420
420
  case "escaped": {
421
- const s = await we(t, {
421
+ const r = await Ce(t, {
422
422
  ...i,
423
423
  altBoundary: !0
424
- }), r = Xe(s, n.floating);
424
+ }), s = st(r, n.floating);
425
425
  return {
426
426
  data: {
427
- escapedOffsets: r,
428
- escaped: _e(r)
427
+ escapedOffsets: s,
428
+ escaped: rt(s)
429
429
  }
430
430
  };
431
431
  }
@@ -435,31 +435,31 @@ const Ht = function(e) {
435
435
  }
436
436
  };
437
437
  };
438
- async function Ft(e, t) {
438
+ async function zt(e, t) {
439
439
  const {
440
440
  placement: n,
441
441
  platform: o,
442
442
  elements: i
443
- } = e, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = J(n), l = ue(n), a = te(n) === "y", c = ["left", "top"].includes(r) ? -1 : 1, f = s && a ? -1 : 1, u = oe(t, e);
443
+ } = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = te(n), c = ye(n), f = ae(n) === "y", a = ["left", "top"].includes(s) ? -1 : 1, h = r && f ? -1 : 1, d = ue(t, e);
444
444
  let {
445
- mainAxis: m,
446
- crossAxis: h,
447
- alignmentAxis: p
448
- } = typeof u == "number" ? {
449
- mainAxis: u,
445
+ mainAxis: v,
446
+ crossAxis: u,
447
+ alignmentAxis: g
448
+ } = typeof d == "number" ? {
449
+ mainAxis: d,
450
450
  crossAxis: 0,
451
451
  alignmentAxis: null
452
452
  } : {
453
- mainAxis: u.mainAxis || 0,
454
- crossAxis: u.crossAxis || 0,
455
- alignmentAxis: u.alignmentAxis
453
+ mainAxis: d.mainAxis || 0,
454
+ crossAxis: d.crossAxis || 0,
455
+ alignmentAxis: d.alignmentAxis
456
456
  };
457
- return l && typeof p == "number" && (h = l === "end" ? p * -1 : p), a ? {
458
- x: h * f,
459
- y: m * c
457
+ return c && typeof g == "number" && (u = c === "end" ? g * -1 : g), f ? {
458
+ x: u * h,
459
+ y: v * a
460
460
  } : {
461
- x: m * c,
462
- y: h * f
461
+ x: v * a,
462
+ y: u * h
463
463
  };
464
464
  }
465
465
  const Bt = function(e) {
@@ -470,21 +470,21 @@ const Bt = function(e) {
470
470
  var n, o;
471
471
  const {
472
472
  x: i,
473
- y: s,
474
- placement: r,
475
- middlewareData: l
476
- } = t, a = await Ft(t, e);
477
- return r === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
478
- x: i + a.x,
479
- y: s + a.y,
473
+ y: r,
474
+ placement: s,
475
+ middlewareData: c
476
+ } = t, f = await zt(t, e);
477
+ return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
478
+ x: i + f.x,
479
+ y: r + f.y,
480
480
  data: {
481
- ...a,
482
- placement: r
481
+ ...f,
482
+ placement: s
483
483
  }
484
484
  };
485
485
  }
486
486
  };
487
- }, $t = function(e) {
487
+ }, en = function(e) {
488
488
  return e === void 0 && (e = {}), {
489
489
  name: "shift",
490
490
  options: e,
@@ -494,92 +494,92 @@ const Bt = function(e) {
494
494
  y: o,
495
495
  placement: i
496
496
  } = t, {
497
- mainAxis: s = !0,
498
- crossAxis: r = !1,
499
- limiter: l = {
500
- fn: (v) => {
497
+ mainAxis: r = !0,
498
+ crossAxis: s = !1,
499
+ limiter: c = {
500
+ fn: (m) => {
501
501
  let {
502
- x: w,
503
- y: E
504
- } = v;
502
+ x: y,
503
+ y: x
504
+ } = m;
505
505
  return {
506
- x: w,
507
- y: E
506
+ x: y,
507
+ y: x
508
508
  };
509
509
  }
510
510
  },
511
- ...a
512
- } = oe(e, t), c = {
511
+ ...f
512
+ } = ue(e, t), a = {
513
513
  x: n,
514
514
  y: o
515
- }, f = await we(t, a), u = te(J(i)), m = it(u);
516
- let h = c[m], p = c[u];
517
- if (s) {
518
- const v = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", E = h + f[v], x = h - f[w];
519
- h = De(E, h, x);
520
- }
515
+ }, h = await Ce(t, f), d = ae(te(i)), v = Tt(d);
516
+ let u = a[v], g = a[d];
521
517
  if (r) {
522
- const v = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", E = p + f[v], x = p - f[w];
523
- p = De(E, p, x);
518
+ const m = v === "y" ? "top" : "left", y = v === "y" ? "bottom" : "right", x = u + h[m], T = u - h[y];
519
+ u = Ye(x, u, T);
520
+ }
521
+ if (s) {
522
+ const m = d === "y" ? "top" : "left", y = d === "y" ? "bottom" : "right", x = g + h[m], T = g - h[y];
523
+ g = Ye(x, g, T);
524
524
  }
525
- const d = l.fn({
525
+ const p = c.fn({
526
526
  ...t,
527
- [m]: h,
528
- [u]: p
527
+ [v]: u,
528
+ [d]: g
529
529
  });
530
530
  return {
531
- ...d,
531
+ ...p,
532
532
  data: {
533
- x: d.x - n,
534
- y: d.y - o,
533
+ x: p.x - n,
534
+ y: p.y - o,
535
535
  enabled: {
536
- [m]: s,
537
- [u]: r
536
+ [v]: r,
537
+ [d]: s
538
538
  }
539
539
  }
540
540
  };
541
541
  }
542
542
  };
543
543
  };
544
- function ye() {
544
+ function Me() {
545
545
  return typeof window < "u";
546
546
  }
547
- function ie(e) {
548
- return st(e) ? (e.nodeName || "").toLowerCase() : "#document";
547
+ function fe(e) {
548
+ return Lt(e) ? (e.nodeName || "").toLowerCase() : "#document";
549
549
  }
550
- function M(e) {
550
+ function V(e) {
551
551
  var t;
552
552
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
553
553
  }
554
- function $(e) {
554
+ function q(e) {
555
555
  var t;
556
- return (t = (st(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
556
+ return (t = (Lt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
557
557
  }
558
- function st(e) {
559
- return ye() ? e instanceof Node || e instanceof M(e).Node : !1;
558
+ function Lt(e) {
559
+ return Me() ? e instanceof Node || e instanceof V(e).Node : !1;
560
560
  }
561
- function N(e) {
562
- return ye() ? e instanceof Element || e instanceof M(e).Element : !1;
561
+ function X(e) {
562
+ return Me() ? e instanceof Element || e instanceof V(e).Element : !1;
563
563
  }
564
- function B(e) {
565
- return ye() ? e instanceof HTMLElement || e instanceof M(e).HTMLElement : !1;
564
+ function U(e) {
565
+ return Me() ? e instanceof HTMLElement || e instanceof V(e).HTMLElement : !1;
566
566
  }
567
- function je(e) {
568
- return !ye() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof M(e).ShadowRoot;
567
+ function lt(e) {
568
+ return !Me() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof V(e).ShadowRoot;
569
569
  }
570
- function fe(e) {
570
+ function be(e) {
571
571
  const {
572
572
  overflow: t,
573
573
  overflowX: n,
574
574
  overflowY: o,
575
575
  display: i
576
- } = S(e);
576
+ } = j(e);
577
577
  return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
578
578
  }
579
- function Vt(e) {
580
- return ["table", "td", "th"].includes(ie(e));
579
+ function tn(e) {
580
+ return ["table", "td", "th"].includes(fe(e));
581
581
  }
582
- function xe(e) {
582
+ function Ae(e) {
583
583
  return [":popover-open", ":modal"].some((t) => {
584
584
  try {
585
585
  return e.matches(t);
@@ -588,32 +588,32 @@ function xe(e) {
588
588
  }
589
589
  });
590
590
  }
591
- function Be(e) {
592
- const t = $e(), n = N(e) ? S(e) : e;
591
+ function qe(e) {
592
+ const t = Ge(), n = X(e) ? j(e) : e;
593
593
  return ["transform", "translate", "scale", "rotate", "perspective"].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) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
594
594
  }
595
- function Wt(e) {
596
- let t = K(e);
597
- for (; B(t) && !ne(t); ) {
598
- if (Be(t))
595
+ function nn(e) {
596
+ let t = J(e);
597
+ for (; U(t) && !ce(t); ) {
598
+ if (qe(t))
599
599
  return t;
600
- if (xe(t))
600
+ if (Ae(t))
601
601
  return null;
602
- t = K(t);
602
+ t = J(t);
603
603
  }
604
604
  return null;
605
605
  }
606
- function $e() {
606
+ function Ge() {
607
607
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
608
608
  }
609
- function ne(e) {
610
- return ["html", "body", "#document"].includes(ie(e));
609
+ function ce(e) {
610
+ return ["html", "body", "#document"].includes(fe(e));
611
611
  }
612
- function S(e) {
613
- return M(e).getComputedStyle(e);
612
+ function j(e) {
613
+ return V(e).getComputedStyle(e);
614
614
  }
615
- function be(e) {
616
- return N(e) ? {
615
+ function De(e) {
616
+ return X(e) ? {
617
617
  scrollLeft: e.scrollLeft,
618
618
  scrollTop: e.scrollTop
619
619
  } : {
@@ -621,186 +621,186 @@ function be(e) {
621
621
  scrollTop: e.scrollY
622
622
  };
623
623
  }
624
- function K(e) {
625
- if (ie(e) === "html")
624
+ function J(e) {
625
+ if (fe(e) === "html")
626
626
  return e;
627
627
  const t = (
628
628
  // Step into the shadow DOM of the parent of a slotted node.
629
629
  e.assignedSlot || // DOM Element detected.
630
630
  e.parentNode || // ShadowRoot detected.
631
- je(e) && e.host || // Fallback.
632
- $(e)
631
+ lt(e) && e.host || // Fallback.
632
+ q(e)
633
633
  );
634
- return je(t) ? t.host : t;
634
+ return lt(t) ? t.host : t;
635
635
  }
636
- function lt(e) {
637
- const t = K(e);
638
- return ne(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : B(t) && fe(t) ? t : lt(t);
636
+ function Pt(e) {
637
+ const t = J(e);
638
+ return ce(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && be(t) ? t : Pt(t);
639
639
  }
640
- function Q(e, t, n) {
640
+ function ne(e, t, n) {
641
641
  var o;
642
642
  t === void 0 && (t = []), n === void 0 && (n = !0);
643
- const i = lt(e), s = i === ((o = e.ownerDocument) == null ? void 0 : o.body), r = M(i);
644
- if (s) {
645
- const l = Se(r);
646
- return t.concat(r, r.visualViewport || [], fe(i) ? i : [], l && n ? Q(l) : []);
643
+ const i = Pt(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = V(i);
644
+ if (r) {
645
+ const c = je(s);
646
+ return t.concat(s, s.visualViewport || [], be(i) ? i : [], c && n ? ne(c) : []);
647
647
  }
648
- return t.concat(i, Q(i, [], n));
648
+ return t.concat(i, ne(i, [], n));
649
649
  }
650
- function Se(e) {
650
+ function je(e) {
651
651
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
652
652
  }
653
- function ct(e) {
654
- const t = S(e);
653
+ function Ot(e) {
654
+ const t = j(e);
655
655
  let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
656
- const i = B(e), s = i ? e.offsetWidth : n, r = i ? e.offsetHeight : o, l = pe(n) !== s || pe(o) !== r;
657
- return l && (n = s, o = r), {
656
+ const i = U(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, c = Le(n) !== r || Le(o) !== s;
657
+ return c && (n = r, o = s), {
658
658
  width: n,
659
659
  height: o,
660
- $: l
660
+ $: c
661
661
  };
662
662
  }
663
- function Ve(e) {
664
- return N(e) ? e : e.contextElement;
663
+ function Je(e) {
664
+ return X(e) ? e : e.contextElement;
665
665
  }
666
- function z(e) {
667
- const t = Ve(e);
668
- if (!B(t))
669
- return F(1);
666
+ function se(e) {
667
+ const t = Je(e);
668
+ if (!U(t))
669
+ return K(1);
670
670
  const n = t.getBoundingClientRect(), {
671
671
  width: o,
672
672
  height: i,
673
- $: s
674
- } = ct(t);
675
- let r = (s ? pe(n.width) : n.width) / o, l = (s ? pe(n.height) : n.height) / i;
676
- return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
677
- x: r,
678
- y: l
673
+ $: r
674
+ } = Ot(t);
675
+ let s = (r ? Le(n.width) : n.width) / o, c = (r ? Le(n.height) : n.height) / i;
676
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
677
+ x: s,
678
+ y: c
679
679
  };
680
680
  }
681
- const It = /* @__PURE__ */ F(0);
682
- function at(e) {
683
- const t = M(e);
684
- return !$e() || !t.visualViewport ? It : {
681
+ const on = /* @__PURE__ */ K(0);
682
+ function Ct(e) {
683
+ const t = V(e);
684
+ return !Ge() || !t.visualViewport ? on : {
685
685
  x: t.visualViewport.offsetLeft,
686
686
  y: t.visualViewport.offsetTop
687
687
  };
688
688
  }
689
- function Yt(e, t, n) {
690
- return t === void 0 && (t = !1), !n || t && n !== M(e) ? !1 : t;
689
+ function sn(e, t, n) {
690
+ return t === void 0 && (t = !1), !n || t && n !== V(e) ? !1 : t;
691
691
  }
692
- function Z(e, t, n, o) {
692
+ function oe(e, t, n, o) {
693
693
  t === void 0 && (t = !1), n === void 0 && (n = !1);
694
- const i = e.getBoundingClientRect(), s = Ve(e);
695
- let r = F(1);
696
- t && (o ? N(o) && (r = z(o)) : r = z(e));
697
- const l = Yt(s, n, o) ? at(s) : F(0);
698
- let a = (i.left + l.x) / r.x, c = (i.top + l.y) / r.y, f = i.width / r.x, u = i.height / r.y;
699
- if (s) {
700
- const m = M(s), h = o && N(o) ? M(o) : o;
701
- let p = m, d = Se(p);
702
- for (; d && o && h !== p; ) {
703
- const v = z(d), w = d.getBoundingClientRect(), E = S(d), x = w.left + (d.clientLeft + parseFloat(E.paddingLeft)) * v.x, g = w.top + (d.clientTop + parseFloat(E.paddingTop)) * v.y;
704
- a *= v.x, c *= v.y, f *= v.x, u *= v.y, a += x, c += g, p = M(d), d = Se(p);
694
+ const i = e.getBoundingClientRect(), r = Je(e);
695
+ let s = K(1);
696
+ t && (o ? X(o) && (s = se(o)) : s = se(e));
697
+ const c = sn(r, n, o) ? Ct(r) : K(0);
698
+ let f = (i.left + c.x) / s.x, a = (i.top + c.y) / s.y, h = i.width / s.x, d = i.height / s.y;
699
+ if (r) {
700
+ const v = V(r), u = o && X(o) ? V(o) : o;
701
+ let g = v, p = je(g);
702
+ for (; p && o && u !== g; ) {
703
+ const m = se(p), y = p.getBoundingClientRect(), x = j(p), T = y.left + (p.clientLeft + parseFloat(x.paddingLeft)) * m.x, w = y.top + (p.clientTop + parseFloat(x.paddingTop)) * m.y;
704
+ f *= m.x, a *= m.y, h *= m.x, d *= m.y, f += T, a += w, g = V(p), p = je(g);
705
705
  }
706
706
  }
707
- return ge({
708
- width: f,
709
- height: u,
710
- x: a,
711
- y: c
707
+ return Oe({
708
+ width: h,
709
+ height: d,
710
+ x: f,
711
+ y: a
712
712
  });
713
713
  }
714
- function We(e, t) {
715
- const n = be(e).scrollLeft;
716
- return t ? t.left + n : Z($(e)).left + n;
714
+ function Qe(e, t) {
715
+ const n = De(e).scrollLeft;
716
+ return t ? t.left + n : oe(q(e)).left + n;
717
717
  }
718
- function ut(e, t, n) {
718
+ function Mt(e, t, n) {
719
719
  n === void 0 && (n = !1);
720
720
  const o = e.getBoundingClientRect(), i = o.left + t.scrollLeft - (n ? 0 : (
721
721
  // RTL <body> scrollbar.
722
- We(e, o)
723
- )), s = o.top + t.scrollTop;
722
+ Qe(e, o)
723
+ )), r = o.top + t.scrollTop;
724
724
  return {
725
725
  x: i,
726
- y: s
726
+ y: r
727
727
  };
728
728
  }
729
- function Xt(e) {
729
+ function rn(e) {
730
730
  let {
731
731
  elements: t,
732
732
  rect: n,
733
733
  offsetParent: o,
734
734
  strategy: i
735
735
  } = e;
736
- const s = i === "fixed", r = $(o), l = t ? xe(t.floating) : !1;
737
- if (o === r || l && s)
736
+ const r = i === "fixed", s = q(o), c = t ? Ae(t.floating) : !1;
737
+ if (o === s || c && r)
738
738
  return n;
739
- let a = {
739
+ let f = {
740
740
  scrollLeft: 0,
741
741
  scrollTop: 0
742
- }, c = F(1);
743
- const f = F(0), u = B(o);
744
- if ((u || !u && !s) && ((ie(o) !== "body" || fe(r)) && (a = be(o)), B(o))) {
745
- const h = Z(o);
746
- c = z(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
742
+ }, a = K(1);
743
+ const h = K(0), d = U(o);
744
+ if ((d || !d && !r) && ((fe(o) !== "body" || be(s)) && (f = De(o)), U(o))) {
745
+ const u = oe(o);
746
+ a = se(o), h.x = u.x + o.clientLeft, h.y = u.y + o.clientTop;
747
747
  }
748
- const m = r && !u && !s ? ut(r, a, !0) : F(0);
748
+ const v = s && !d && !r ? Mt(s, f, !0) : K(0);
749
749
  return {
750
- width: n.width * c.x,
751
- height: n.height * c.y,
752
- x: n.x * c.x - a.scrollLeft * c.x + f.x + m.x,
753
- y: n.y * c.y - a.scrollTop * c.y + f.y + m.y
750
+ width: n.width * a.x,
751
+ height: n.height * a.y,
752
+ x: n.x * a.x - f.scrollLeft * a.x + h.x + v.x,
753
+ y: n.y * a.y - f.scrollTop * a.y + h.y + v.y
754
754
  };
755
755
  }
756
- function _t(e) {
756
+ function ln(e) {
757
757
  return Array.from(e.getClientRects());
758
758
  }
759
- function jt(e) {
760
- const t = $(e), n = be(e), o = e.ownerDocument.body, i = G(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), s = G(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
761
- let r = -n.scrollLeft + We(e);
762
- const l = -n.scrollTop;
763
- return S(o).direction === "rtl" && (r += G(t.clientWidth, o.clientWidth) - i), {
759
+ function an(e) {
760
+ const t = q(e), n = De(e), o = e.ownerDocument.body, i = ee(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = ee(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
761
+ let s = -n.scrollLeft + Qe(e);
762
+ const c = -n.scrollTop;
763
+ return j(o).direction === "rtl" && (s += ee(t.clientWidth, o.clientWidth) - i), {
764
764
  width: i,
765
- height: s,
766
- x: r,
767
- y: l
765
+ height: r,
766
+ x: s,
767
+ y: c
768
768
  };
769
769
  }
770
- function Kt(e, t) {
771
- const n = M(e), o = $(e), i = n.visualViewport;
772
- let s = o.clientWidth, r = o.clientHeight, l = 0, a = 0;
770
+ function cn(e, t) {
771
+ const n = V(e), o = q(e), i = n.visualViewport;
772
+ let r = o.clientWidth, s = o.clientHeight, c = 0, f = 0;
773
773
  if (i) {
774
- s = i.width, r = i.height;
775
- const c = $e();
776
- (!c || c && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
774
+ r = i.width, s = i.height;
775
+ const a = Ge();
776
+ (!a || a && t === "fixed") && (c = i.offsetLeft, f = i.offsetTop);
777
777
  }
778
778
  return {
779
- width: s,
780
- height: r,
781
- x: l,
782
- y: a
779
+ width: r,
780
+ height: s,
781
+ x: c,
782
+ y: f
783
783
  };
784
784
  }
785
- function Ut(e, t) {
786
- const n = Z(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, s = B(e) ? z(e) : F(1), r = e.clientWidth * s.x, l = e.clientHeight * s.y, a = i * s.x, c = o * s.y;
785
+ function un(e, t) {
786
+ const n = oe(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = U(e) ? se(e) : K(1), s = e.clientWidth * r.x, c = e.clientHeight * r.y, f = i * r.x, a = o * r.y;
787
787
  return {
788
- width: r,
789
- height: l,
790
- x: a,
791
- y: c
788
+ width: s,
789
+ height: c,
790
+ x: f,
791
+ y: a
792
792
  };
793
793
  }
794
- function Ke(e, t, n) {
794
+ function at(e, t, n) {
795
795
  let o;
796
796
  if (t === "viewport")
797
- o = Kt(e, n);
797
+ o = cn(e, n);
798
798
  else if (t === "document")
799
- o = jt($(e));
800
- else if (N(t))
801
- o = Ut(t, n);
799
+ o = an(q(e));
800
+ else if (X(t))
801
+ o = un(t, n);
802
802
  else {
803
- const i = at(e);
803
+ const i = Ct(e);
804
804
  o = {
805
805
  x: t.x - i.x,
806
806
  y: t.y - i.y,
@@ -808,106 +808,106 @@ function Ke(e, t, n) {
808
808
  height: t.height
809
809
  };
810
810
  }
811
- return ge(o);
811
+ return Oe(o);
812
812
  }
813
- function ft(e, t) {
814
- const n = K(e);
815
- return n === t || !N(n) || ne(n) ? !1 : S(n).position === "fixed" || ft(n, t);
813
+ function At(e, t) {
814
+ const n = J(e);
815
+ return n === t || !X(n) || ce(n) ? !1 : j(n).position === "fixed" || At(n, t);
816
816
  }
817
- function qt(e, t) {
817
+ function fn(e, t) {
818
818
  const n = t.get(e);
819
819
  if (n)
820
820
  return n;
821
- let o = Q(e, [], !1).filter((l) => N(l) && ie(l) !== "body"), i = null;
822
- const s = S(e).position === "fixed";
823
- let r = s ? K(e) : e;
824
- for (; N(r) && !ne(r); ) {
825
- const l = S(r), a = Be(r);
826
- !a && l.position === "fixed" && (i = null), (s ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || fe(r) && !a && ft(e, r)) ? o = o.filter((f) => f !== r) : i = l, r = K(r);
821
+ let o = ne(e, [], !1).filter((c) => X(c) && fe(c) !== "body"), i = null;
822
+ const r = j(e).position === "fixed";
823
+ let s = r ? J(e) : e;
824
+ for (; X(s) && !ce(s); ) {
825
+ const c = j(s), f = qe(s);
826
+ !f && c.position === "fixed" && (i = null), (r ? !f && !i : !f && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || be(s) && !f && At(e, s)) ? o = o.filter((h) => h !== s) : i = c, s = J(s);
827
827
  }
828
828
  return t.set(e, o), o;
829
829
  }
830
- function Gt(e) {
830
+ function dn(e) {
831
831
  let {
832
832
  element: t,
833
833
  boundary: n,
834
834
  rootBoundary: o,
835
835
  strategy: i
836
836
  } = e;
837
- const r = [...n === "clippingAncestors" ? xe(t) ? [] : qt(t, this._c) : [].concat(n), o], l = r[0], a = r.reduce((c, f) => {
838
- const u = Ke(t, f, i);
839
- return c.top = G(u.top, c.top), c.right = ee(u.right, c.right), c.bottom = ee(u.bottom, c.bottom), c.left = G(u.left, c.left), c;
840
- }, Ke(t, l, i));
837
+ const s = [...n === "clippingAncestors" ? Ae(t) ? [] : fn(t, this._c) : [].concat(n), o], c = s[0], f = s.reduce((a, h) => {
838
+ const d = at(t, h, i);
839
+ return a.top = ee(d.top, a.top), a.right = le(d.right, a.right), a.bottom = le(d.bottom, a.bottom), a.left = ee(d.left, a.left), a;
840
+ }, at(t, c, i));
841
841
  return {
842
- width: a.right - a.left,
843
- height: a.bottom - a.top,
844
- x: a.left,
845
- y: a.top
842
+ width: f.right - f.left,
843
+ height: f.bottom - f.top,
844
+ x: f.left,
845
+ y: f.top
846
846
  };
847
847
  }
848
- function Jt(e) {
848
+ function hn(e) {
849
849
  const {
850
850
  width: t,
851
851
  height: n
852
- } = ct(e);
852
+ } = Ot(e);
853
853
  return {
854
854
  width: t,
855
855
  height: n
856
856
  };
857
857
  }
858
- function Qt(e, t, n) {
859
- const o = B(t), i = $(t), s = n === "fixed", r = Z(e, !0, s, t);
860
- let l = {
858
+ function pn(e, t, n) {
859
+ const o = U(t), i = q(t), r = n === "fixed", s = oe(e, !0, r, t);
860
+ let c = {
861
861
  scrollLeft: 0,
862
862
  scrollTop: 0
863
863
  };
864
- const a = F(0);
865
- if (o || !o && !s)
866
- if ((ie(t) !== "body" || fe(i)) && (l = be(t)), o) {
867
- const m = Z(t, !0, s, t);
868
- a.x = m.x + t.clientLeft, a.y = m.y + t.clientTop;
869
- } else i && (a.x = We(i));
870
- const c = i && !o && !s ? ut(i, l) : F(0), f = r.left + l.scrollLeft - a.x - c.x, u = r.top + l.scrollTop - a.y - c.y;
864
+ const f = K(0);
865
+ if (o || !o && !r)
866
+ if ((fe(t) !== "body" || be(i)) && (c = De(t)), o) {
867
+ const v = oe(t, !0, r, t);
868
+ f.x = v.x + t.clientLeft, f.y = v.y + t.clientTop;
869
+ } else i && (f.x = Qe(i));
870
+ const a = i && !o && !r ? Mt(i, c) : K(0), h = s.left + c.scrollLeft - f.x - a.x, d = s.top + c.scrollTop - f.y - a.y;
871
871
  return {
872
- x: f,
873
- y: u,
874
- width: r.width,
875
- height: r.height
872
+ x: h,
873
+ y: d,
874
+ width: s.width,
875
+ height: s.height
876
876
  };
877
877
  }
878
- function Re(e) {
879
- return S(e).position === "static";
878
+ function He(e) {
879
+ return j(e).position === "static";
880
880
  }
881
- function Ue(e, t) {
882
- if (!B(e) || S(e).position === "fixed")
881
+ function ct(e, t) {
882
+ if (!U(e) || j(e).position === "fixed")
883
883
  return null;
884
884
  if (t)
885
885
  return t(e);
886
886
  let n = e.offsetParent;
887
- return $(e) === n && (n = n.ownerDocument.body), n;
887
+ return q(e) === n && (n = n.ownerDocument.body), n;
888
888
  }
889
- function dt(e, t) {
890
- const n = M(e);
891
- if (xe(e))
889
+ function Dt(e, t) {
890
+ const n = V(e);
891
+ if (Ae(e))
892
892
  return n;
893
- if (!B(e)) {
894
- let i = K(e);
895
- for (; i && !ne(i); ) {
896
- if (N(i) && !Re(i))
893
+ if (!U(e)) {
894
+ let i = J(e);
895
+ for (; i && !ce(i); ) {
896
+ if (X(i) && !He(i))
897
897
  return i;
898
- i = K(i);
898
+ i = J(i);
899
899
  }
900
900
  return n;
901
901
  }
902
- let o = Ue(e, t);
903
- for (; o && Vt(o) && Re(o); )
904
- o = Ue(o, t);
905
- return o && ne(o) && Re(o) && !Be(o) ? n : o || Wt(e) || n;
902
+ let o = ct(e, t);
903
+ for (; o && tn(o) && He(o); )
904
+ o = ct(o, t);
905
+ return o && ce(o) && He(o) && !qe(o) ? n : o || nn(e) || n;
906
906
  }
907
- const Zt = async function(e) {
908
- const t = this.getOffsetParent || dt, n = this.getDimensions, o = await n(e.floating);
907
+ const mn = async function(e) {
908
+ const t = this.getOffsetParent || Dt, n = this.getDimensions, o = await n(e.floating);
909
909
  return {
910
- reference: Qt(e.reference, await t(e.floating), e.strategy),
910
+ reference: pn(e.reference, await t(e.floating), e.strategy),
911
911
  floating: {
912
912
  x: 0,
913
913
  y: 0,
@@ -916,348 +916,582 @@ const Zt = async function(e) {
916
916
  }
917
917
  };
918
918
  };
919
- function zt(e) {
920
- return S(e).direction === "rtl";
921
- }
922
- const en = {
923
- convertOffsetParentRelativeRectToViewportRelativeRect: Xt,
924
- getDocumentElement: $,
925
- getClippingRect: Gt,
926
- getOffsetParent: dt,
927
- getElementRects: Zt,
928
- getClientRects: _t,
929
- getDimensions: Jt,
930
- getScale: z,
931
- isElement: N,
932
- isRTL: zt
919
+ function vn(e) {
920
+ return j(e).direction === "rtl";
921
+ }
922
+ const gn = {
923
+ convertOffsetParentRelativeRectToViewportRelativeRect: rn,
924
+ getDocumentElement: q,
925
+ getClippingRect: dn,
926
+ getOffsetParent: Dt,
927
+ getElementRects: mn,
928
+ getClientRects: ln,
929
+ getDimensions: hn,
930
+ getScale: se,
931
+ isElement: X,
932
+ isRTL: vn
933
933
  };
934
- function ht(e, t) {
934
+ function St(e, t) {
935
935
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
936
936
  }
937
- function tn(e, t) {
937
+ function wn(e, t) {
938
938
  let n = null, o;
939
- const i = $(e);
940
- function s() {
941
- var l;
942
- clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
939
+ const i = q(e);
940
+ function r() {
941
+ var c;
942
+ clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
943
943
  }
944
- function r(l, a) {
945
- l === void 0 && (l = !1), a === void 0 && (a = 1), s();
946
- const c = e.getBoundingClientRect(), {
947
- left: f,
948
- top: u,
949
- width: m,
950
- height: h
951
- } = c;
952
- if (l || t(), !m || !h)
944
+ function s(c, f) {
945
+ c === void 0 && (c = !1), f === void 0 && (f = 1), r();
946
+ const a = e.getBoundingClientRect(), {
947
+ left: h,
948
+ top: d,
949
+ width: v,
950
+ height: u
951
+ } = a;
952
+ if (c || t(), !v || !u)
953
953
  return;
954
- const p = he(u), d = he(i.clientWidth - (f + m)), v = he(i.clientHeight - (u + h)), w = he(f), x = {
955
- rootMargin: -p + "px " + -d + "px " + -v + "px " + -w + "px",
956
- threshold: G(0, ee(1, a)) || 1
954
+ const g = xe(d), p = xe(i.clientWidth - (h + v)), m = xe(i.clientHeight - (d + u)), y = xe(h), T = {
955
+ rootMargin: -g + "px " + -p + "px " + -m + "px " + -y + "px",
956
+ threshold: ee(0, le(1, f)) || 1
957
957
  };
958
- let g = !0;
959
- function b(R) {
960
- const L = R[0].intersectionRatio;
961
- if (L !== a) {
962
- if (!g)
963
- return r();
964
- L ? r(!1, L) : o = setTimeout(() => {
965
- r(!1, 1e-7);
958
+ let w = !0;
959
+ function L(O) {
960
+ const M = O[0].intersectionRatio;
961
+ if (M !== f) {
962
+ if (!w)
963
+ return s();
964
+ M ? s(!1, M) : o = setTimeout(() => {
965
+ s(!1, 1e-7);
966
966
  }, 1e3);
967
967
  }
968
- L === 1 && !ht(c, e.getBoundingClientRect()) && r(), g = !1;
968
+ M === 1 && !St(a, e.getBoundingClientRect()) && s(), w = !1;
969
969
  }
970
970
  try {
971
- n = new IntersectionObserver(b, {
972
- ...x,
971
+ n = new IntersectionObserver(L, {
972
+ ...T,
973
973
  // Handle <iframe>s
974
974
  root: i.ownerDocument
975
975
  });
976
976
  } catch {
977
- n = new IntersectionObserver(b, x);
977
+ n = new IntersectionObserver(L, T);
978
978
  }
979
979
  n.observe(e);
980
980
  }
981
- return r(!0), s;
981
+ return s(!0), r;
982
982
  }
983
- function vt(e, t, n, o) {
983
+ function yn(e, t, n, o) {
984
984
  o === void 0 && (o = {});
985
985
  const {
986
986
  ancestorScroll: i = !0,
987
- ancestorResize: s = !0,
988
- elementResize: r = typeof ResizeObserver == "function",
989
- layoutShift: l = typeof IntersectionObserver == "function",
990
- animationFrame: a = !1
991
- } = o, c = Ve(e), f = i || s ? [...c ? Q(c) : [], ...Q(t)] : [];
992
- f.forEach((w) => {
993
- i && w.addEventListener("scroll", n, {
987
+ ancestorResize: r = !0,
988
+ elementResize: s = typeof ResizeObserver == "function",
989
+ layoutShift: c = typeof IntersectionObserver == "function",
990
+ animationFrame: f = !1
991
+ } = o, a = Je(e), h = i || r ? [...a ? ne(a) : [], ...ne(t)] : [];
992
+ h.forEach((y) => {
993
+ i && y.addEventListener("scroll", n, {
994
994
  passive: !0
995
- }), s && w.addEventListener("resize", n);
995
+ }), r && y.addEventListener("resize", n);
996
996
  });
997
- const u = c && l ? tn(c, n) : null;
998
- let m = -1, h = null;
999
- r && (h = new ResizeObserver((w) => {
1000
- let [E] = w;
1001
- E && E.target === c && h && (h.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1002
- var x;
1003
- (x = h) == null || x.observe(t);
997
+ const d = a && c ? wn(a, n) : null;
998
+ let v = -1, u = null;
999
+ s && (u = new ResizeObserver((y) => {
1000
+ let [x] = y;
1001
+ x && x.target === a && u && (u.unobserve(t), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
1002
+ var T;
1003
+ (T = u) == null || T.observe(t);
1004
1004
  })), n();
1005
- }), c && !a && h.observe(c), h.observe(t));
1006
- let p, d = a ? Z(e) : null;
1007
- a && v();
1008
- function v() {
1009
- const w = Z(e);
1010
- d && !ht(d, w) && n(), d = w, p = requestAnimationFrame(v);
1005
+ }), a && !f && u.observe(a), u.observe(t));
1006
+ let g, p = f ? oe(e) : null;
1007
+ f && m();
1008
+ function m() {
1009
+ const y = oe(e);
1010
+ p && !St(p, y) && n(), p = y, g = requestAnimationFrame(m);
1011
1011
  }
1012
1012
  return n(), () => {
1013
- var w;
1014
- f.forEach((E) => {
1015
- i && E.removeEventListener("scroll", n), s && E.removeEventListener("resize", n);
1016
- }), u == null || u(), (w = h) == null || w.disconnect(), h = null, a && cancelAnimationFrame(p);
1013
+ var y;
1014
+ h.forEach((x) => {
1015
+ i && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
1016
+ }), d == null || d(), (y = u) == null || y.disconnect(), u = null, f && cancelAnimationFrame(g);
1017
1017
  };
1018
1018
  }
1019
- const Rn = Bt, Pn = $t, Cn = kt, Mn = Ht, nn = St, on = (e, t, n) => {
1019
+ const Un = Bt, qn = en, Gn = Qt, Jn = Zt, bn = Jt, En = (e, t, n) => {
1020
1020
  const o = /* @__PURE__ */ new Map(), i = {
1021
- platform: en,
1021
+ platform: gn,
1022
1022
  ...n
1023
- }, s = {
1023
+ }, r = {
1024
1024
  ...i.platform,
1025
1025
  _c: o
1026
1026
  };
1027
- return Nt(e, t, {
1027
+ return Gt(e, t, {
1028
1028
  ...i,
1029
- platform: s
1029
+ platform: r
1030
1030
  });
1031
1031
  };
1032
- function An(e, t, n = {}) {
1032
+ function Qn(e, t, n = {}) {
1033
1033
  const {
1034
1034
  transform: o = !0,
1035
1035
  middlewares: i,
1036
- whileElementsMounted: s,
1037
- open: r = j(!1),
1038
- setOpen: l = (x) => {
1039
- r.value = x;
1040
- }
1041
- } = n, a = O(() => T(n.placement) ?? "bottom"), c = O(() => T(n.strategy) ?? "absolute"), f = j(0), u = j(0), m = j(a.value), h = j(c.value), p = Me({}), d = j(!1), v = async () => {
1036
+ autoUpdate: r = !0,
1037
+ open: s = G(!1)
1038
+ } = n, c = (T) => {
1039
+ s.value = T;
1040
+ }, f = A(() => P(n.placement) ?? "bottom"), a = A(() => P(n.strategy) ?? "absolute"), h = G(0), d = G(0), v = G(f.value), u = G(a.value), g = We({}), p = G(!1), m = async () => {
1042
1041
  if (!e.value || !t.value) return;
1043
- const x = await on(e.value, t.value, {
1044
- placement: a.value,
1045
- strategy: c.value,
1042
+ const T = await En(e.value, t.value, {
1043
+ placement: f.value,
1044
+ strategy: a.value,
1046
1045
  middleware: i
1047
1046
  });
1048
- f.value = x.x, u.value = x.y, m.value = x.placement, h.value = x.strategy, p.value = x.middlewareData, d.value = r.value;
1047
+ h.value = T.x, d.value = T.y, v.value = T.placement, u.value = T.strategy, g.value = T.middlewareData, p.value = s.value;
1049
1048
  };
1050
- ve([a, c], () => {
1051
- r.value && v();
1049
+ pe([f, a], () => {
1050
+ s.value && m();
1052
1051
  });
1053
- let w;
1054
- ve(
1055
- [e, t, r],
1056
- ([x, g, b]) => {
1057
- !b || !x || !g || (s ? w = s(x, g, v) : w = vt(x, g, v), q(() => {
1058
- w == null || w(), w = void 0;
1052
+ let y;
1053
+ pe(
1054
+ [e, t, s],
1055
+ ([T, w, L]) => {
1056
+ !L || !T || !w || (r && (y = yn(
1057
+ T,
1058
+ w,
1059
+ m,
1060
+ typeof r == "object" ? r : void 0
1061
+ )), B(() => {
1062
+ y == null || y(), y = void 0;
1059
1063
  }));
1060
1064
  },
1061
1065
  { immediate: !0 }
1062
- ), ae(() => w == null ? void 0 : w()), ve(r, (x) => {
1063
- x || (d.value = !1);
1066
+ ), re(() => y == null ? void 0 : y()), pe(s, (T) => {
1067
+ T || (p.value = !1);
1064
1068
  });
1065
- const E = O(() => {
1066
- const x = {
1067
- position: h.value,
1068
- left: "0",
1069
- top: "0"
1070
- };
1071
- if (!d.value || !t.value)
1072
- return x;
1073
- const g = qe(t.value, f.value), b = qe(t.value, u.value);
1074
- return T(o) ? {
1075
- ...x,
1076
- transform: `translate(${g}px, ${b}px)`,
1077
- ...pt(t.value) >= 1.5 && {
1078
- willChange: "transform"
1079
- }
1080
- } : {
1081
- ...x,
1082
- left: `${g}px`,
1083
- top: `${b}px`
1084
- };
1069
+ const x = G({
1070
+ position: a.value,
1071
+ left: "0",
1072
+ top: "0"
1085
1073
  });
1086
- return {
1087
- x: f,
1088
- y: u,
1089
- strategy: h,
1090
- placement: m,
1091
- middlewareData: p,
1092
- isPositioned: d,
1093
- floatingStyles: E,
1094
- update: v,
1074
+ return pe(
1075
+ [h, d, () => P(o)],
1076
+ ([T, w, L]) => {
1077
+ const O = t.value;
1078
+ if (!O) return;
1079
+ const M = {
1080
+ position: u.value,
1081
+ left: "0",
1082
+ top: "0"
1083
+ }, H = ut(O, T), b = ut(O, w);
1084
+ L ? x.value = {
1085
+ ...M,
1086
+ transform: `translate(${H}px, ${b}px)`,
1087
+ ...Rt(O) >= 1.5 && {
1088
+ "will-change": "transform"
1089
+ }
1090
+ } : x.value = {
1091
+ ...M,
1092
+ left: `${H}px`,
1093
+ top: `${b}px`
1094
+ };
1095
+ },
1096
+ { immediate: !0 }
1097
+ ), {
1098
+ x: h,
1099
+ y: d,
1100
+ strategy: u,
1101
+ placement: v,
1102
+ middlewareData: g,
1103
+ isPositioned: p,
1104
+ floatingStyles: x,
1105
+ update: m,
1095
1106
  refs: {
1096
1107
  anchorEl: e,
1097
1108
  floatingEl: t
1098
1109
  },
1099
- open: r,
1100
- setOpen: l
1110
+ open: s,
1111
+ setOpen: c
1101
1112
  };
1102
1113
  }
1103
- function qe(e, t) {
1104
- const n = pt(e);
1114
+ function ut(e, t) {
1115
+ const n = Rt(e);
1105
1116
  return Math.round(t * n) / n;
1106
1117
  }
1107
- function pt(e) {
1118
+ function Rt(e) {
1108
1119
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1109
1120
  }
1110
- function Dn(e, t, n, o = {}) {
1111
- return vt(e, t, n, o);
1112
- }
1113
- function Nn(e, t = {}) {
1114
- const { middlewareData: n, placement: o } = e, { offset: i = "-4px" } = t, s = O(() => {
1115
- var a;
1116
- return ((a = n.value.arrow) == null ? void 0 : a.x) ?? 0;
1117
- }), r = O(() => {
1118
- var a;
1119
- return ((a = n.value.arrow) == null ? void 0 : a.y) ?? 0;
1120
- }), l = O(() => {
1121
- const a = T(o).split("-")[0], c = s.value, f = r.value;
1122
- return a === "bottom" ? {
1123
- "inset-inline-start": `${c}px`,
1121
+ function Zn(e, t = {}) {
1122
+ const { middlewareData: n, placement: o } = e, { offset: i = "-4px" } = t, r = A(() => {
1123
+ var f;
1124
+ return ((f = n.value.arrow) == null ? void 0 : f.x) ?? 0;
1125
+ }), s = A(() => {
1126
+ var f;
1127
+ return ((f = n.value.arrow) == null ? void 0 : f.y) ?? 0;
1128
+ }), c = A(() => {
1129
+ const f = P(o).split("-")[0], a = r.value, h = s.value;
1130
+ return f === "bottom" ? {
1131
+ "inset-inline-start": `${a}px`,
1124
1132
  "inset-block-start": i
1125
- } : a === "top" ? {
1126
- "inset-inline-start": `${c}px`,
1133
+ } : f === "top" ? {
1134
+ "inset-inline-start": `${a}px`,
1127
1135
  "inset-block-end": i
1128
- } : a === "right" ? {
1129
- "inset-block-start": `${f}px`,
1136
+ } : f === "right" ? {
1137
+ "inset-block-start": `${h}px`,
1130
1138
  "inset-inline-start": i
1131
- } : a === "left" ? {
1132
- "inset-block-start": `${f}px`,
1139
+ } : f === "left" ? {
1140
+ "inset-block-start": `${h}px`,
1133
1141
  "inset-inline-end": i
1134
1142
  } : {};
1135
1143
  });
1136
1144
  return {
1137
- arrowX: s,
1138
- arrowY: r,
1139
- arrowStyles: l
1145
+ arrowX: r,
1146
+ arrowY: s,
1147
+ arrowStyles: c
1140
1148
  };
1141
1149
  }
1142
- const Ge = 10;
1143
- function rn(e) {
1150
+ let Tn = 0;
1151
+ function xn() {
1152
+ return `vfloat-id-${Tn++}`;
1153
+ }
1154
+ function ft(e) {
1155
+ return typeof e == "object" && e instanceof HTMLElement;
1156
+ }
1157
+ function Fe(e, t) {
1158
+ return e.contains(t);
1159
+ }
1160
+ function Ln(e) {
1161
+ return e.target;
1162
+ }
1163
+ function dt(e, t) {
1164
+ const [n, o] = e;
1165
+ let i = !1;
1166
+ const r = t.length;
1167
+ for (let s = 0, c = r - 1; s < r; c = s++) {
1168
+ const [f, a] = t[s] || [0, 0], [h, d] = t[c] || [0, 0];
1169
+ a >= o != d >= o && n <= (h - f) * (o - a) / (d - a) + f && (i = !i);
1170
+ }
1171
+ return i;
1172
+ }
1173
+ function Pn(e, t) {
1174
+ return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
1175
+ }
1176
+ function On(e = {}) {
1177
+ const { requireIntent: t = !0 } = e;
1178
+ let n, o = !1, i = null, r = null, s = performance.now();
1179
+ function c(f, a) {
1180
+ const h = performance.now(), d = h - s;
1181
+ if (i === null || r === null || d === 0)
1182
+ return i = f, r = a, s = h, null;
1183
+ const v = f - i, u = a - r, p = Math.sqrt(v * v + u * u) / d;
1184
+ return i = f, r = a, s = h, p;
1185
+ }
1186
+ return function({
1187
+ x: a,
1188
+ y: h,
1189
+ placement: d,
1190
+ elements: v,
1191
+ buffer: u,
1192
+ onClose: g
1193
+ }) {
1194
+ const p = A(() => {
1195
+ const m = v.domReference;
1196
+ return ft(m) ? m : (m == null ? void 0 : m.contextElement) ?? null;
1197
+ });
1198
+ return function(y) {
1199
+ var he, Ze, ze, Be, et, tt, nt;
1200
+ function x() {
1201
+ clearTimeout(n), g();
1202
+ }
1203
+ if (clearTimeout(n), !v.domReference || !v.floating || d == null || a == null || h == null)
1204
+ return;
1205
+ const { clientX: T, clientY: w } = y, L = Ln(y), O = y.type === "mouseleave", M = v.floating && Fe(v.floating, L), H = p.value && Fe(p.value, L), b = (he = p.value) == null ? void 0 : he.getBoundingClientRect(), l = (Ze = v.floating) == null ? void 0 : Ze.getBoundingClientRect(), k = d.split("-")[0], S = a > ((l == null ? void 0 : l.right) ?? 0) - ((l == null ? void 0 : l.width) ?? 0) / 2, W = h > ((l == null ? void 0 : l.bottom) ?? 0) - ((l == null ? void 0 : l.height) ?? 0) / 2, C = ((l == null ? void 0 : l.width) ?? 0) > ((b == null ? void 0 : b.width) ?? 0), D = ((l == null ? void 0 : l.height) ?? 0) > ((b == null ? void 0 : b.height) ?? 0), E = ((ze = C ? b : l) == null ? void 0 : ze.left) ?? 0, R = ((Be = C ? b : l) == null ? void 0 : Be.right) ?? 0, F = ((et = D ? b : l) == null ? void 0 : et.top) ?? 0, $ = ((tt = D ? b : l) == null ? void 0 : tt.bottom) ?? 0;
1206
+ if (M && (o = !0, !O))
1207
+ return;
1208
+ if (H && (o = !1), H && !O) {
1209
+ o = !0;
1210
+ return;
1211
+ }
1212
+ if (O && ft(y.relatedTarget) && v.floating && Fe(v.floating, y.relatedTarget))
1213
+ return;
1214
+ if (k === "top" && h >= ((b == null ? void 0 : b.bottom) ?? 0) - 1 || k === "bottom" && h <= ((b == null ? void 0 : b.top) ?? 0) + 1 || k === "left" && a >= ((b == null ? void 0 : b.right) ?? 0) - 1 || k === "right" && a <= ((b == null ? void 0 : b.left) ?? 0) + 1)
1215
+ return x();
1216
+ let _ = [];
1217
+ switch (k) {
1218
+ case "top":
1219
+ _ = [
1220
+ [E, ((b == null ? void 0 : b.top) ?? 0) + 1],
1221
+ [E, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
1222
+ [R, ((l == null ? void 0 : l.bottom) ?? 0) - 1],
1223
+ [R, ((b == null ? void 0 : b.top) ?? 0) + 1]
1224
+ ];
1225
+ break;
1226
+ case "bottom":
1227
+ _ = [
1228
+ [E, ((l == null ? void 0 : l.top) ?? 0) + 1],
1229
+ [E, ((b == null ? void 0 : b.bottom) ?? 0) - 1],
1230
+ [R, ((b == null ? void 0 : b.bottom) ?? 0) - 1],
1231
+ [R, ((l == null ? void 0 : l.top) ?? 0) + 1]
1232
+ ];
1233
+ break;
1234
+ case "left":
1235
+ _ = [
1236
+ [((l == null ? void 0 : l.right) ?? 0) - 1, $],
1237
+ [((l == null ? void 0 : l.right) ?? 0) - 1, F],
1238
+ [((b == null ? void 0 : b.left) ?? 0) + 1, F],
1239
+ [((b == null ? void 0 : b.left) ?? 0) + 1, $]
1240
+ ];
1241
+ break;
1242
+ case "right":
1243
+ _ = [
1244
+ [((b == null ? void 0 : b.right) ?? 0) - 1, $],
1245
+ [((b == null ? void 0 : b.right) ?? 0) - 1, F],
1246
+ [((l == null ? void 0 : l.left) ?? 0) + 1, F],
1247
+ [((l == null ? void 0 : l.left) ?? 0) + 1, $]
1248
+ ];
1249
+ break;
1250
+ }
1251
+ function Ee([N, I]) {
1252
+ switch (k) {
1253
+ case "top": {
1254
+ const Q = [
1255
+ C ? N + u / 2 : S ? N + u * 4 : N - u * 4,
1256
+ I + u + 1
1257
+ ], Z = [
1258
+ C ? N - u / 2 : S ? N + u * 4 : N - u * 4,
1259
+ I + u + 1
1260
+ ], ie = [
1261
+ [
1262
+ (l == null ? void 0 : l.left) ?? 0,
1263
+ S || C ? ((l == null ? void 0 : l.bottom) ?? 0) - u : (l == null ? void 0 : l.top) ?? 0
1264
+ ],
1265
+ [
1266
+ (l == null ? void 0 : l.right) ?? 0,
1267
+ S ? C ? ((l == null ? void 0 : l.bottom) ?? 0) - u : (l == null ? void 0 : l.top) ?? 0 : ((l == null ? void 0 : l.bottom) ?? 0) - u
1268
+ ]
1269
+ ];
1270
+ return [Q, Z, ...ie];
1271
+ }
1272
+ case "bottom": {
1273
+ const Q = [
1274
+ C ? N + u / 2 : S ? N + u * 4 : N - u * 4,
1275
+ I - u
1276
+ ], Z = [
1277
+ C ? N - u / 2 : S ? N + u * 4 : N - u * 4,
1278
+ I - u
1279
+ ], ie = [
1280
+ [
1281
+ (l == null ? void 0 : l.left) ?? 0,
1282
+ S || C ? ((l == null ? void 0 : l.top) ?? 0) + u : (l == null ? void 0 : l.bottom) ?? 0
1283
+ ],
1284
+ [
1285
+ (l == null ? void 0 : l.right) ?? 0,
1286
+ S ? C ? ((l == null ? void 0 : l.top) ?? 0) + u : (l == null ? void 0 : l.bottom) ?? 0 : ((l == null ? void 0 : l.top) ?? 0) + u
1287
+ ]
1288
+ ];
1289
+ return [Q, Z, ...ie];
1290
+ }
1291
+ case "left": {
1292
+ const Q = [
1293
+ N + u + 1,
1294
+ D ? I + u / 2 : W ? I + u * 4 : I - u * 4
1295
+ ], Z = [
1296
+ N + u + 1,
1297
+ D ? I - u / 2 : W ? I + u * 4 : I - u * 4
1298
+ ];
1299
+ return [...[
1300
+ [
1301
+ W || D ? ((l == null ? void 0 : l.right) ?? 0) - u : (l == null ? void 0 : l.left) ?? 0,
1302
+ (l == null ? void 0 : l.top) ?? 0
1303
+ ],
1304
+ [
1305
+ W ? D ? ((l == null ? void 0 : l.right) ?? 0) - u : (l == null ? void 0 : l.left) ?? 0 : ((l == null ? void 0 : l.right) ?? 0) - u,
1306
+ (l == null ? void 0 : l.bottom) ?? 0
1307
+ ]
1308
+ ], Q, Z];
1309
+ }
1310
+ case "right": {
1311
+ const Q = [
1312
+ N - u,
1313
+ D ? I + u / 2 : W ? I + u * 4 : I - u * 4
1314
+ ], Z = [
1315
+ N - u,
1316
+ D ? I - u / 2 : W ? I + u * 4 : I - u * 4
1317
+ ], ie = [
1318
+ [
1319
+ W || D ? ((l == null ? void 0 : l.left) ?? 0) + u : (l == null ? void 0 : l.right) ?? 0,
1320
+ (l == null ? void 0 : l.top) ?? 0
1321
+ ],
1322
+ [
1323
+ W ? D ? ((l == null ? void 0 : l.left) ?? 0) + u : (l == null ? void 0 : l.right) ?? 0 : ((l == null ? void 0 : l.left) ?? 0) + u,
1324
+ (l == null ? void 0 : l.bottom) ?? 0
1325
+ ]
1326
+ ];
1327
+ return [Q, Z, ...ie];
1328
+ }
1329
+ }
1330
+ }
1331
+ if (dt([T, w], _))
1332
+ return;
1333
+ if (o && b && !Pn([T, w], b))
1334
+ return x();
1335
+ if (!O && t) {
1336
+ const N = c(y.clientX, y.clientY);
1337
+ if (N !== null && N < 0.1)
1338
+ return x();
1339
+ }
1340
+ const de = Ee([a, h]);
1341
+ (nt = e.onPolygonChange) == null || nt.call(e, de), dt([T, w], de) ? !o && t && (n = window.setTimeout(x, 40)) : x();
1342
+ };
1343
+ };
1344
+ }
1345
+ const ht = 10;
1346
+ function Cn(e) {
1144
1347
  return e === "mouse" || e === "pen";
1145
1348
  }
1146
- function sn(e, t, n) {
1147
- const { delay: o } = n, i = O(() => {
1148
- const c = T(o);
1149
- return (typeof c == "number" ? c : c.open) ?? 0;
1150
- }), s = O(() => {
1151
- const c = T(o);
1152
- return (typeof c == "number" ? c : c.close) ?? 0;
1349
+ function Mn(e, t, n) {
1350
+ const { delay: o } = n, i = A(() => {
1351
+ const a = P(o);
1352
+ return (typeof a == "number" ? a : a.open) ?? 0;
1353
+ }), r = A(() => {
1354
+ const a = P(o);
1355
+ return (typeof a == "number" ? a : a.close) ?? 0;
1153
1356
  });
1154
- let r, l;
1155
- const a = () => {
1156
- clearTimeout(r), clearTimeout(l);
1357
+ let s, c;
1358
+ const f = () => {
1359
+ clearTimeout(s), clearTimeout(c);
1157
1360
  };
1158
- return ae(a), {
1159
- show: (c) => {
1160
- a();
1161
- const f = c ?? i.value;
1162
- f === 0 ? e() : r = setTimeout(e, f);
1361
+ return re(f), {
1362
+ show: (a) => {
1363
+ f();
1364
+ const h = a ?? i.value;
1365
+ h === 0 ? e() : s = setTimeout(e, h);
1163
1366
  },
1164
- hide: (c) => {
1165
- a();
1166
- const f = c ?? s.value;
1167
- f === 0 ? t() : l = setTimeout(t, f);
1367
+ hide: (a) => {
1368
+ f();
1369
+ const h = a ?? r.value;
1370
+ h === 0 ? t() : c = setTimeout(t, h);
1168
1371
  },
1169
1372
  showDelay: i,
1170
- hideDelay: s,
1171
- clearTimeouts: a
1373
+ hideDelay: r,
1374
+ clearTimeouts: f
1172
1375
  };
1173
1376
  }
1174
- function Sn(e, t = {}) {
1377
+ function zn(e, t = {}) {
1175
1378
  const {
1176
1379
  open: n,
1177
1380
  setOpen: o,
1178
- refs: { anchorEl: i, floatingEl: s }
1381
+ refs: { anchorEl: i, floatingEl: r }
1179
1382
  } = e, {
1180
- enabled: r = !0,
1181
- delay: l = 0,
1182
- restMs: a = 0,
1183
- mouseOnly: c = !1
1184
- } = t, f = O(() => T(r)), u = O(() => T(a)), m = O(() => {
1185
- const y = i.value;
1186
- return !y || y instanceof HTMLElement ? y : y.contextElement ?? null;
1187
- }), { hide: h, show: p, showDelay: d, clearTimeouts: v } = sn(
1383
+ enabled: s = !0,
1384
+ delay: c = 0,
1385
+ restMs: f = 0,
1386
+ mouseOnly: a = !1,
1387
+ safePolygon: h = !1
1388
+ } = t, d = A(() => P(s)), v = A(() => P(f)), u = A(() => {
1389
+ const E = i.value;
1390
+ return !E || E instanceof HTMLElement ? E : E.contextElement ?? null;
1391
+ }), { hide: g, show: p, showDelay: m, clearTimeouts: y } = Mn(
1188
1392
  () => {
1189
1393
  n.value || o(!0);
1190
1394
  },
1191
1395
  () => {
1192
1396
  n.value && o(!1);
1193
1397
  },
1194
- { delay: l }
1398
+ { delay: c }
1195
1399
  );
1196
- let w = null, E;
1197
- const x = O(() => d.value === 0 && u.value > 0);
1198
- function g(y) {
1199
- if (!f.value || !L(y) || !x.value || !w) return;
1200
- const C = { x: y.clientX, y: y.clientY }, P = Math.abs(C.x - w.x), Y = Math.abs(C.y - w.y);
1201
- (P > Ge || Y > Ge) && (w = C, clearTimeout(E), E = setTimeout(() => {
1400
+ let x = null, T;
1401
+ const w = A(() => m.value === 0 && v.value > 0);
1402
+ function L(E) {
1403
+ if (!d.value || !H(E) || !w.value || !x) return;
1404
+ const R = { x: E.clientX, y: E.clientY }, F = Math.abs(R.x - x.x), $ = Math.abs(R.y - x.y);
1405
+ (F > ht || $ > ht) && (x = R, clearTimeout(T), T = setTimeout(() => {
1202
1406
  p(0);
1203
- }, u.value));
1407
+ }, v.value));
1204
1408
  }
1205
- function b(y) {
1206
- !f.value || !L(y) || !x.value || (w = { x: y.clientX, y: y.clientY }, E = setTimeout(() => {
1409
+ function O(E) {
1410
+ !d.value || !H(E) || !w.value || (x = { x: E.clientX, y: E.clientY }, T = setTimeout(() => {
1207
1411
  p(0);
1208
- }, u.value));
1412
+ }, v.value));
1209
1413
  }
1210
- function R() {
1211
- clearTimeout(E), w = null;
1414
+ function M() {
1415
+ clearTimeout(T), x = null;
1212
1416
  }
1213
- re(() => {
1214
- const y = m.value;
1215
- !y || !f.value || !x.value || (y.addEventListener("pointerenter", b), y.addEventListener("pointermove", g), y.addEventListener("pointerleave", R), q(() => {
1216
- y.removeEventListener("pointerenter", b), y.removeEventListener("pointermove", g), y.removeEventListener("pointerleave", R);
1417
+ me(() => {
1418
+ const E = u.value;
1419
+ !E || !d.value || !w.value || (E.addEventListener("pointerenter", O), E.addEventListener("pointermove", L), E.addEventListener("pointerleave", M), B(() => {
1420
+ E.removeEventListener("pointerenter", O), E.removeEventListener("pointermove", L), E.removeEventListener("pointerleave", M);
1217
1421
  }));
1218
- }), ae(() => {
1219
- clearTimeout(E);
1422
+ }), re(() => {
1423
+ clearTimeout(T);
1220
1424
  });
1221
- function L(y) {
1222
- return !(T(c) && !rn(y.pointerType));
1425
+ function H(E) {
1426
+ return !(P(a) && !Cn(E.pointerType));
1223
1427
  }
1224
- function W(y) {
1225
- !f.value || !L(y) || x.value || p();
1428
+ function b(E) {
1429
+ !d.value || !H(E) || w.value || p();
1226
1430
  }
1227
- function k(y) {
1228
- !f.value || !L(y) || v();
1431
+ function l(E) {
1432
+ !d.value || !H(E) || (y(), S());
1229
1433
  }
1230
- function A(y) {
1231
- var C;
1232
- !f.value || !L(y) || (C = s.value) != null && C.contains(y.relatedTarget) || h();
1434
+ let k = null;
1435
+ function S() {
1436
+ k && (document.removeEventListener("pointermove", k), k = null);
1233
1437
  }
1234
- function I(y) {
1235
- var C;
1236
- !f.value || !L(y) || (C = m.value) != null && C.contains(y.relatedTarget) || h();
1438
+ const W = A(() => !!P(h)), C = A(() => {
1439
+ const E = P(h);
1440
+ if (typeof E == "object" && E) return E;
1441
+ if (E === !0) return {};
1442
+ });
1443
+ function D(E) {
1444
+ var _;
1445
+ if (!d.value || !H(E)) return;
1446
+ const { clientX: R, clientY: F } = E, $ = E.relatedTarget;
1447
+ W.value ? setTimeout(() => {
1448
+ var he;
1449
+ S();
1450
+ const Ee = u.value, de = r.value;
1451
+ if (!Ee || !de) {
1452
+ g();
1453
+ return;
1454
+ }
1455
+ k = On(C.value)({
1456
+ x: R,
1457
+ y: F,
1458
+ placement: e.placement.value,
1459
+ elements: {
1460
+ domReference: Ee,
1461
+ floating: de
1462
+ },
1463
+ buffer: ((he = C.value) == null ? void 0 : he.buffer) ?? 1,
1464
+ onClose: () => {
1465
+ S(), g();
1466
+ }
1467
+ }), document.addEventListener("pointermove", k);
1468
+ }, 0) : (_ = r.value) != null && _.contains($) || g();
1237
1469
  }
1238
- re(() => {
1239
- const y = m.value;
1240
- !y || !f.value || (y.addEventListener("pointerenter", W), y.addEventListener("pointerleave", A), q(() => {
1241
- y.removeEventListener("pointerenter", W), y.removeEventListener("pointerleave", A);
1470
+ me(() => {
1471
+ const E = u.value;
1472
+ !E || !d.value || (E.addEventListener("pointerenter", b), E.addEventListener("pointerleave", D), B(() => {
1473
+ E.removeEventListener("pointerenter", b), E.removeEventListener("pointerleave", D);
1242
1474
  }));
1243
- }), re(() => {
1244
- const y = s.value;
1245
- !y || !f.value || (y.addEventListener("pointerenter", k), y.addEventListener("pointerleave", I), q(() => {
1246
- y.removeEventListener("pointerenter", k), y.removeEventListener("pointerleave", I);
1475
+ }), me(() => {
1476
+ const E = r.value;
1477
+ !E || !d.value || (E.addEventListener("pointerenter", l), E.addEventListener("pointerleave", D), B(() => {
1478
+ E.removeEventListener("pointerenter", l), E.removeEventListener("pointerleave", D);
1247
1479
  }));
1480
+ }), re(() => {
1481
+ S();
1248
1482
  });
1249
1483
  }
1250
- function ln(e) {
1251
- return yt() ? (ae(e), !0) : !1;
1484
+ function An(e) {
1485
+ return Ht() ? (re(e), !0) : !1;
1252
1486
  }
1253
- const cn = typeof window < "u" && typeof document < "u";
1487
+ const Dn = typeof window < "u" && typeof document < "u";
1254
1488
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1255
- const an = Object.prototype.toString, un = (e) => an.call(e) === "[object Object]";
1256
- function Pe(e) {
1489
+ const Sn = Object.prototype.toString, Rn = (e) => Sn.call(e) === "[object Object]";
1490
+ function $e(e) {
1257
1491
  return Array.isArray(e) ? e : [e];
1258
1492
  }
1259
- function fn(e, t, n) {
1260
- return ve(
1493
+ function Nn(e, t, n) {
1494
+ return pe(
1261
1495
  e,
1262
1496
  t,
1263
1497
  {
@@ -1266,358 +1500,354 @@ function fn(e, t, n) {
1266
1500
  }
1267
1501
  );
1268
1502
  }
1269
- const dn = cn ? window : void 0;
1270
- function hn(e) {
1503
+ const kn = Dn ? window : void 0;
1504
+ function Hn(e) {
1271
1505
  var t;
1272
- const n = T(e);
1506
+ const n = P(e);
1273
1507
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
1274
1508
  }
1275
- function D(...e) {
1509
+ function Y(...e) {
1276
1510
  const t = [], n = () => {
1277
- t.forEach((l) => l()), t.length = 0;
1278
- }, o = (l, a, c, f) => (l.addEventListener(a, c, f), () => l.removeEventListener(a, c, f)), i = O(() => {
1279
- const l = Pe(T(e[0])).filter((a) => a != null);
1280
- return l.every((a) => typeof a != "string") ? l : void 0;
1281
- }), s = fn(
1511
+ t.forEach((c) => c()), t.length = 0;
1512
+ }, o = (c, f, a, h) => (c.addEventListener(f, a, h), () => c.removeEventListener(f, a, h)), i = A(() => {
1513
+ const c = $e(P(e[0])).filter((f) => f != null);
1514
+ return c.every((f) => typeof f != "string") ? c : void 0;
1515
+ }), r = Nn(
1282
1516
  () => {
1283
- var l, a;
1517
+ var c, f;
1284
1518
  return [
1285
- (a = (l = i.value) == null ? void 0 : l.map((c) => hn(c))) != null ? a : [dn].filter((c) => c != null),
1286
- Pe(T(i.value ? e[1] : e[0])),
1287
- Pe(xt(i.value ? e[2] : e[1])),
1519
+ (f = (c = i.value) == null ? void 0 : c.map((a) => Hn(a))) != null ? f : [kn].filter((a) => a != null),
1520
+ $e(P(i.value ? e[1] : e[0])),
1521
+ $e(Ft(i.value ? e[2] : e[1])),
1288
1522
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
1289
- T(i.value ? e[3] : e[2])
1523
+ P(i.value ? e[3] : e[2])
1290
1524
  ];
1291
1525
  },
1292
- ([l, a, c, f]) => {
1293
- if (n(), !(l != null && l.length) || !(a != null && a.length) || !(c != null && c.length))
1526
+ ([c, f, a, h]) => {
1527
+ if (n(), !(c != null && c.length) || !(f != null && f.length) || !(a != null && a.length))
1294
1528
  return;
1295
- const u = un(f) ? { ...f } : f;
1529
+ const d = Rn(h) ? { ...h } : h;
1296
1530
  t.push(
1297
- ...l.flatMap(
1298
- (m) => a.flatMap(
1299
- (h) => c.map((p) => o(m, h, p, u))
1531
+ ...c.flatMap(
1532
+ (v) => f.flatMap(
1533
+ (u) => a.map((g) => o(v, u, g, d))
1300
1534
  )
1301
1535
  )
1302
1536
  );
1303
1537
  },
1304
1538
  { flush: "post" }
1305
- ), r = () => {
1306
- s(), n();
1539
+ ), s = () => {
1540
+ r(), n();
1307
1541
  };
1308
- return ln(n), r;
1542
+ return An(n), s;
1309
1543
  }
1310
- function kn(e, t = {}) {
1544
+ function Bn(e, t = {}) {
1311
1545
  const {
1312
1546
  open: n,
1313
1547
  setOpen: o,
1314
- refs: { floatingEl: i, anchorEl: s }
1315
- } = e, { enabled: r = !0, requireFocusVisible: l = !0 } = t, a = O(() => s.value ? s.value instanceof HTMLElement ? s.value : s.value.contextElement : null);
1316
- let c = !1, f = !0, u;
1317
- D(window, "blur", () => {
1318
- !n.value && a.value && a.value === document.activeElement && (c = !0);
1319
- }), D(window, "focus", () => {
1320
- c = !1;
1321
- }), bt(() => {
1322
- Je() && Qe() && (D(
1548
+ refs: { floatingEl: i, anchorEl: r }
1549
+ } = e, { enabled: s = !0, requireFocusVisible: c = !0 } = t, f = A(() => r.value ? r.value instanceof HTMLElement ? r.value : r.value.contextElement : null);
1550
+ let a = !1, h = !0, d;
1551
+ Y(window, "blur", () => {
1552
+ !n.value && f.value && f.value === document.activeElement && (a = !0);
1553
+ }), Y(window, "focus", () => {
1554
+ a = !1;
1555
+ }), $t(() => {
1556
+ pt() && mt() && (Y(
1323
1557
  window,
1324
1558
  "keydown",
1325
1559
  () => {
1326
- f = !0;
1560
+ h = !0;
1327
1561
  },
1328
1562
  { capture: !0 }
1329
- ), D(
1563
+ ), Y(
1330
1564
  window,
1331
1565
  "pointerdown",
1332
1566
  () => {
1333
- f = !1;
1567
+ h = !1;
1334
1568
  },
1335
1569
  { capture: !0 }
1336
1570
  ));
1337
1571
  });
1338
- function m(p) {
1339
- if (c) {
1340
- c = !1;
1572
+ function v(g) {
1573
+ if (a) {
1574
+ a = !1;
1341
1575
  return;
1342
1576
  }
1343
- const d = p.target;
1344
- if (T(l) && d) {
1345
- if (Je() && Qe() && !p.relatedTarget) {
1346
- if (!f && !vn(d))
1577
+ const p = g.target;
1578
+ if (P(c) && p) {
1579
+ if (pt() && mt() && !g.relatedTarget) {
1580
+ if (!h && !Fn(p))
1347
1581
  return;
1348
- } else if (!pn(d))
1582
+ } else if (!$n(p))
1349
1583
  return;
1350
1584
  }
1351
1585
  o(!0);
1352
1586
  }
1353
- function h(p) {
1354
- clearTimeout(u), u = window.setTimeout(() => {
1355
- var w;
1356
- const v = (((w = a.value) == null ? void 0 : w.ownerDocument) ?? document).activeElement;
1357
- !p.relatedTarget && v === a.value || i.value && v && i.value.contains(v) || o(!1);
1587
+ function u(g) {
1588
+ clearTimeout(d), d = window.setTimeout(() => {
1589
+ var y;
1590
+ const m = (((y = f.value) == null ? void 0 : y.ownerDocument) ?? document).activeElement;
1591
+ !g.relatedTarget && m === f.value || i.value && m && i.value.contains(m) || o(!1);
1358
1592
  }, 0);
1359
1593
  }
1360
- re(() => {
1361
- if (!T(r)) return;
1362
- const p = a.value;
1363
- !p || !(p instanceof HTMLElement) || (p.addEventListener("focus", m), p.addEventListener("blur", h), q(() => {
1364
- p.removeEventListener("focus", m), p.removeEventListener("blur", h);
1594
+ me(() => {
1595
+ if (!P(s)) return;
1596
+ const g = f.value;
1597
+ !g || !(g instanceof HTMLElement) || (g.addEventListener("focus", v), g.addEventListener("blur", u), B(() => {
1598
+ g.removeEventListener("focus", v), g.removeEventListener("blur", u);
1365
1599
  }));
1366
- }), ae(() => {
1367
- clearTimeout(u);
1600
+ }), re(() => {
1601
+ clearTimeout(d);
1368
1602
  });
1369
1603
  }
1370
- function Je() {
1604
+ function pt() {
1371
1605
  return navigator.platform.toUpperCase().indexOf("MAC") >= 0;
1372
1606
  }
1373
- function Qe() {
1607
+ function mt() {
1374
1608
  return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
1375
1609
  }
1376
- function vn(e) {
1610
+ function Fn(e) {
1377
1611
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement;
1378
1612
  }
1379
- function pn(e) {
1613
+ function $n(e) {
1380
1614
  return e.matches(":focus-visible");
1381
1615
  }
1382
- function Hn(e, t = {}) {
1616
+ function eo(e, t = {}) {
1383
1617
  const { open: n, setOpen: o, refs: i } = e, {
1384
- enabled: s = !0,
1385
- event: r = "click",
1386
- toggle: l = !0,
1387
- ignoreMouse: a = !1,
1388
- keyboardHandlers: c = !0
1618
+ enabled: r = !0,
1619
+ event: s = "click",
1620
+ toggle: c = !0,
1621
+ ignoreMouse: f = !1,
1622
+ keyboardHandlers: a = !0
1389
1623
  } = t;
1390
- let f, u = !1;
1391
- const m = O(() => T(s)), h = O(
1624
+ let h, d = !1;
1625
+ const v = A(() => P(r)), u = A(
1392
1626
  () => i.anchorEl.value instanceof HTMLElement ? i.anchorEl.value : null
1393
1627
  );
1394
- function p() {
1395
- n.value ? T(l) && o(!1) : o(!0);
1628
+ function g() {
1629
+ n.value ? P(c) && o(!1) : o(!0);
1396
1630
  }
1397
- function d(g) {
1398
- f = g.pointerType;
1631
+ function p(w) {
1632
+ h = w.pointerType;
1399
1633
  }
1400
- function v(g) {
1401
- if (g.button !== 0 || T(r) === "click" || Ze(f) && T(a)) return;
1402
- const b = g.target;
1403
- !n.value && b === h.value && g.preventDefault(), p();
1634
+ function m(w) {
1635
+ if (w.button !== 0 || P(s) === "click" || vt(h) && P(f)) return;
1636
+ const L = w.target;
1637
+ !n.value && L === u.value && w.preventDefault(), g();
1404
1638
  }
1405
- function w() {
1406
- if (T(r) === "mousedown" && f) {
1407
- f = void 0;
1639
+ function y() {
1640
+ if (P(s) === "mousedown" && h) {
1641
+ h = void 0;
1408
1642
  return;
1409
1643
  }
1410
- if (Ze(f) && T(a)) {
1411
- f = void 0;
1644
+ if (vt(h) && P(f)) {
1645
+ h = void 0;
1412
1646
  return;
1413
1647
  }
1414
- p(), f = void 0;
1648
+ g(), h = void 0;
1415
1649
  }
1416
- function E(g) {
1417
- if (f = void 0, g.defaultPrevented || !T(c) || ze(g))
1650
+ function x(w) {
1651
+ if (h = void 0, w.defaultPrevented || !P(a) || gt(w))
1418
1652
  return;
1419
- const b = h.value;
1420
- b && (g.key === " " && !et(b) && (g.preventDefault(), u = !0), g.key === "Enter" && p());
1653
+ const L = u.value;
1654
+ L && (w.key === " " && !wt(L) && (w.preventDefault(), d = !0), w.key === "Enter" && g());
1421
1655
  }
1422
- function x(g) {
1423
- const b = h.value;
1424
- b && (g.defaultPrevented || !T(c) || ze(g) || et(b) || g.key === " " && u && (u = !1, p()));
1656
+ function T(w) {
1657
+ const L = u.value;
1658
+ L && (w.defaultPrevented || !P(a) || gt(w) || wt(L) || w.key === " " && d && (d = !1, g()));
1425
1659
  }
1426
- re(() => {
1427
- const g = h.value;
1428
- !m.value || !g || (g.addEventListener("pointerdown", d), g.addEventListener("mousedown", v), g.addEventListener("click", w), g.addEventListener("keydown", E), g.addEventListener("keyup", x), q(() => {
1429
- g.removeEventListener("pointerdown", d), g.removeEventListener("mousedown", v), g.removeEventListener("click", w), g.removeEventListener("keydown", E), g.removeEventListener("keyup", x);
1660
+ me(() => {
1661
+ const w = u.value;
1662
+ !v.value || !w || (w.addEventListener("pointerdown", p), w.addEventListener("mousedown", m), w.addEventListener("click", y), w.addEventListener("keydown", x), w.addEventListener("keyup", T), B(() => {
1663
+ w.removeEventListener("pointerdown", p), w.removeEventListener("mousedown", m), w.removeEventListener("click", y), w.removeEventListener("keydown", x), w.removeEventListener("keyup", T);
1430
1664
  }));
1431
1665
  });
1432
1666
  }
1433
- function Ze(e, t) {
1667
+ function vt(e, t) {
1434
1668
  return e === void 0 ? !1 : e === "mouse";
1435
1669
  }
1436
- function ze(e) {
1670
+ function gt(e) {
1437
1671
  return e.target instanceof HTMLElement && e.target.tagName === "BUTTON";
1438
1672
  }
1439
- function mn(e) {
1673
+ function In(e) {
1440
1674
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1441
1675
  }
1442
- function et(e) {
1443
- return mn(e);
1676
+ function wt(e) {
1677
+ return In(e);
1444
1678
  }
1445
- function Fn(e, t = {}) {
1679
+ function to(e, t = {}) {
1446
1680
  const {
1447
1681
  enabled: n = !0,
1448
1682
  escapeKey: o = !0,
1449
1683
  outsidePress: i = !0,
1450
- outsidePressEvent: s = "pointerdown",
1451
- anchorPress: r = !1,
1452
- anchorPressEvent: l = "pointerdown",
1453
- ancestorScroll: a = !1,
1454
- capture: c
1455
- } = t, f = O(() => T(n)), u = e.refs.floatingEl, m = O(() => {
1456
- const g = e.refs.anchorEl.value;
1457
- return g ? g instanceof HTMLElement ? g : g.contextElement instanceof HTMLElement ? g.contextElement : null : null;
1458
- }), { isComposing: h } = yn(), { escapeKey: p, outsidePress: d } = gn(c);
1459
- let v = !1;
1460
- const w = (g) => {
1461
- !f.value || !e.open.value || !T(o) || g.key !== "Escape" || h() || e.setOpen(!1);
1462
- }, E = (g) => {
1463
- if (!f.value || !e.open.value)
1684
+ outsidePressEvent: r = "pointerdown",
1685
+ anchorPress: s = !1,
1686
+ anchorPressEvent: c = "pointerdown",
1687
+ ancestorScroll: f = !1,
1688
+ capture: a
1689
+ } = t, h = A(() => P(n)), d = e.refs.floatingEl, v = A(() => {
1690
+ const w = e.refs.anchorEl.value;
1691
+ return w ? w instanceof HTMLElement ? w : w.contextElement instanceof HTMLElement ? w.contextElement : null : null;
1692
+ }), { isComposing: u } = Yn(), { escapeKey: g, outsidePress: p } = Wn(a);
1693
+ let m = !1;
1694
+ const y = (w) => {
1695
+ !h.value || !e.open.value || !P(o) || w.key !== "Escape" || u() || e.setOpen(!1);
1696
+ }, x = (w) => {
1697
+ if (!h.value || !e.open.value)
1464
1698
  return;
1465
- if (s === "click" && v) {
1466
- v = !1;
1699
+ if (r === "click" && m) {
1700
+ m = !1;
1467
1701
  return;
1468
1702
  }
1469
- const b = T(i);
1470
- if (!b || typeof b == "function" && !b(g))
1703
+ const L = P(i);
1704
+ if (!L || typeof L == "function" && !L(w))
1471
1705
  return;
1472
- const R = g.target;
1473
- R && (Ce(R) && u.value && wn(g, R) || tt(g, m.value) || tt(g, u.value) || e.setOpen(!1));
1474
- }, x = () => {
1475
- f.value && e.open.value && T(r) && e.setOpen(!1);
1706
+ const O = w.target;
1707
+ O && (Ie(O) && d.value && Vn(w, O) || yt(w, v.value) || yt(w, d.value) || e.setOpen(!1));
1708
+ }, T = () => {
1709
+ h.value && e.open.value && P(s) && e.setOpen(!1);
1476
1710
  };
1477
- Ae((g) => {
1478
- if (!f.value || !e.open.value || !T(a))
1711
+ Ve((w) => {
1712
+ if (!h.value || !e.open.value || !P(f))
1479
1713
  return;
1480
- const b = () => {
1714
+ const L = () => {
1481
1715
  e.open.value && e.setOpen(!1);
1482
- }, R = [];
1483
- m.value && R.push(...Q(m.value).filter(Ce)), u.value && R.push(...Q(u.value).filter(Ce));
1484
- for (const L of R)
1485
- L.addEventListener("scroll", b, { passive: !0 });
1486
- g(() => {
1487
- for (const L of R)
1488
- L.removeEventListener("scroll", b);
1716
+ }, O = [];
1717
+ v.value && O.push(...ne(v.value).filter(Ie)), d.value && O.push(...ne(d.value).filter(Ie));
1718
+ for (const M of O)
1719
+ M.addEventListener("scroll", L, { passive: !0 });
1720
+ w(() => {
1721
+ for (const M of O)
1722
+ M.removeEventListener("scroll", L);
1489
1723
  });
1490
- }), D(document, "keydown", w, T(p)), D(document, s, E, T(d)), D(m, l, x), D(
1491
- u,
1724
+ }), Y(document, "keydown", y, P(g)), Y(document, r, x, P(p)), Y(v, c, T), Y(
1725
+ d,
1492
1726
  "mousedown",
1493
1727
  () => {
1494
- v = !0;
1728
+ m = !0;
1495
1729
  },
1496
1730
  { capture: !0 }
1497
- ), D(
1498
- u,
1731
+ ), Y(
1732
+ d,
1499
1733
  "mouseup",
1500
1734
  () => {
1501
- v = !0;
1735
+ m = !0;
1502
1736
  },
1503
1737
  { capture: !0 }
1504
1738
  );
1505
1739
  }
1506
- function gn(e) {
1740
+ function Wn(e) {
1507
1741
  return {
1508
1742
  escapeKey: typeof e == "boolean" ? e : (e == null ? void 0 : e.escapeKey) ?? !1,
1509
1743
  outsidePress: typeof e == "boolean" ? e : (e == null ? void 0 : e.outsidePress) ?? !0
1510
1744
  };
1511
1745
  }
1512
- function Ce(e) {
1746
+ function Ie(e) {
1513
1747
  return e instanceof Element && e instanceof HTMLElement;
1514
1748
  }
1515
- function tt(e, t) {
1749
+ function yt(e, t) {
1516
1750
  return t ? "composedPath" in e && typeof e.composedPath == "function" ? e.composedPath().includes(t) : t.contains(e.target) : !1;
1517
1751
  }
1518
- function wn(e, t) {
1752
+ function Vn(e, t) {
1519
1753
  const n = t.offsetWidth - t.clientWidth, o = t.offsetHeight - t.clientHeight;
1520
1754
  return n > 0 && e.clientX > t.clientWidth || o > 0 && e.clientY > t.clientHeight;
1521
1755
  }
1522
- function yn() {
1523
- const e = j(!1);
1524
- return D(document, "compositionstart", () => {
1756
+ function Yn() {
1757
+ const e = G(!1);
1758
+ return Y(document, "compositionstart", () => {
1525
1759
  e.value = !0;
1526
- }), D(document, "compositionend", () => {
1760
+ }), Y(document, "compositionend", () => {
1527
1761
  e.value = !1;
1528
1762
  }), {
1529
1763
  isComposing: () => e.value
1530
1764
  };
1531
1765
  }
1532
- function Bn(e, t, n = {}) {
1766
+ function no(e, t, n = {}) {
1533
1767
  const { open: o, refs: i } = t;
1534
- let s;
1535
- const r = j({ x: null, y: null }), l = O(() => T(n.axis ?? "both")), a = O(() => T(n.enabled ?? !0)), c = O(() => T(n.x ?? null)), f = O(() => T(n.y ?? null)), u = (d, v) => {
1536
- r.value = {
1537
- x: d,
1538
- y: v
1539
- }, o.value && (i.anchorEl.value = xn(
1768
+ let r;
1769
+ const s = G({ x: null, y: null }), c = A(() => P(n.axis ?? "both")), f = A(() => P(n.enabled ?? !0)), a = A(() => P(n.x ?? null)), h = A(() => P(n.y ?? null)), d = (p, m) => {
1770
+ s.value = {
1771
+ x: p,
1772
+ y: m
1773
+ }, o.value && (i.anchorEl.value = Xn(
1540
1774
  e.value,
1541
- l.value,
1542
- r.value
1775
+ c.value,
1776
+ s.value
1543
1777
  ));
1544
1778
  };
1545
- Ae(() => {
1546
- const d = c.value, v = f.value;
1547
- a.value && d != null && v != null && u(d, v);
1779
+ Ve(() => {
1780
+ const p = a.value, m = h.value;
1781
+ f.value && p != null && m != null && d(p, m);
1548
1782
  });
1549
- const m = (d) => {
1550
- s = d.pointerType, u(d.clientX, d.clientY);
1551
- }, h = (d) => {
1552
- s = d.pointerType, !o.value && nt(s, !0) && u(d.clientX, d.clientY);
1553
- }, p = (d) => {
1554
- o.value && nt(s, !0) && u(d.clientX, d.clientY);
1783
+ const v = (p) => {
1784
+ r = p.pointerType, d(p.clientX, p.clientY);
1785
+ }, u = (p) => {
1786
+ r = p.pointerType, !o.value && bt(r, !0) && d(p.clientX, p.clientY);
1787
+ }, g = (p) => {
1788
+ o.value && bt(r, !0) && d(p.clientX, p.clientY);
1555
1789
  };
1556
- return Ae(() => {
1557
- if (c.value != null || f.value != null) return;
1558
- const d = e.value;
1559
- !d || !a.value || (d.addEventListener("pointerenter", h), d.addEventListener("pointerdown", m), d.addEventListener("pointermove", p), q(() => {
1560
- d == null || d.removeEventListener("pointerenter", h), d == null || d.removeEventListener("pointerdown", m), d == null || d.removeEventListener("pointermove", p);
1790
+ return Ve(() => {
1791
+ if (a.value != null || h.value != null) return;
1792
+ const p = e.value;
1793
+ !p || !f.value || (p.addEventListener("pointerenter", u), p.addEventListener("pointerdown", v), p.addEventListener("pointermove", g), B(() => {
1794
+ p == null || p.removeEventListener("pointerenter", u), p == null || p.removeEventListener("pointerdown", v), p == null || p.removeEventListener("pointermove", g);
1561
1795
  }));
1562
1796
  }), {
1563
- coordinates: Et(r),
1564
- updatePosition: u
1797
+ coordinates: It(s),
1798
+ updatePosition: d
1565
1799
  };
1566
1800
  }
1567
- function xn(e, t, n) {
1801
+ function Xn(e, t, n) {
1568
1802
  let o = null, i = null;
1569
- const s = e;
1803
+ const r = e;
1570
1804
  return {
1571
- contextElement: s || void 0,
1805
+ contextElement: r || void 0,
1572
1806
  getBoundingClientRect: () => {
1573
- const r = (s == null ? void 0 : s.getBoundingClientRect()) ?? {
1807
+ const s = (r == null ? void 0 : r.getBoundingClientRect()) ?? {
1574
1808
  width: 0,
1575
1809
  height: 0,
1576
1810
  x: 0,
1577
1811
  y: 0
1578
- }, l = t === "x" || t === "both", a = t === "y" || t === "both";
1579
- let c = 0, f = 0, u = r.x, m = r.y;
1580
- return s && (o == null && n.x != null && l && (o = r.x - n.x), i == null && n.y != null && a && (i = r.y - n.y), u -= o || 0, m -= i || 0), l && n.x != null ? u = n.x : (o = null, c = r.width), a && n.y != null ? m = n.y : (i = null, f = r.height), t === "both" && (c = 0, f = 0), {
1581
- width: c,
1582
- height: f,
1583
- x: u,
1584
- y: m,
1585
- top: m,
1586
- right: u + c,
1587
- bottom: m + f,
1588
- left: u
1812
+ }, c = t === "x" || t === "both", f = t === "y" || t === "both";
1813
+ let a = 0, h = 0, d = s.x, v = s.y;
1814
+ return r && (o == null && n.x != null && c && (o = s.x - n.x), i == null && n.y != null && f && (i = s.y - n.y), d -= o || 0, v -= i || 0), c && n.x != null ? d = n.x : (o = null, a = s.width), f && n.y != null ? v = n.y : (i = null, h = s.height), t === "both" && (a = 0, h = 0), {
1815
+ width: a,
1816
+ height: h,
1817
+ x: d,
1818
+ y: v,
1819
+ top: v,
1820
+ right: d + a,
1821
+ bottom: v + h,
1822
+ left: d
1589
1823
  };
1590
1824
  }
1591
1825
  };
1592
1826
  }
1593
- function nt(e, t) {
1827
+ function bt(e, t) {
1594
1828
  if (e === void 0) return !1;
1595
1829
  const n = e === "mouse";
1596
1830
  return t ? n : n || e === "pen";
1597
1831
  }
1598
- function $n(e) {
1832
+ function oo(e) {
1599
1833
  return {
1600
1834
  name: "arrow",
1601
1835
  options: e,
1602
1836
  fn(t) {
1603
- const n = T(e.element);
1604
- return n == null ? {} : nn({ element: n, padding: e.padding }).fn(t);
1837
+ const n = P(e.element);
1838
+ return n == null ? {} : bn({ element: n, padding: e.padding }).fn(t);
1605
1839
  }
1606
1840
  };
1607
1841
  }
1608
- let bn = 0;
1609
- function En() {
1610
- return `vfloat-id-${bn++}`;
1611
- }
1612
- var se;
1613
- class ot {
1842
+ var ve;
1843
+ class Et {
1614
1844
  constructor(t, n = null, o = {}, i = !1) {
1615
- U(this, "id");
1616
- U(this, "data");
1617
- U(this, "parent");
1618
- U(this, "children");
1619
- de(this, se);
1620
- this.id = o.id ?? En(), this.data = t, this.parent = Me(n), this.children = Me([]), Le(this, se, i);
1845
+ z(this, "id");
1846
+ z(this, "data");
1847
+ z(this, "parent");
1848
+ z(this, "children");
1849
+ Te(this, ve);
1850
+ this.id = o.id ?? xn(), this.data = t, this.parent = We(n), this.children = We([]), Ne(this, ve, i);
1621
1851
  }
1622
1852
  /**
1623
1853
  * Adds an existing node instance to this node's children array.
@@ -1688,16 +1918,16 @@ class ot {
1688
1918
  }
1689
1919
  /** Checks if the node is the true root of the tree, distinct from an orphaned node. */
1690
1920
  get isRoot() {
1691
- return Te(this, se);
1921
+ return Re(this, ve);
1692
1922
  }
1693
1923
  /** Checks if the node is a leaf node (has no children). */
1694
1924
  get isLeaf() {
1695
1925
  return this.children.value.length === 0;
1696
1926
  }
1697
1927
  }
1698
- se = new WeakMap();
1699
- var le, ce, ke;
1700
- class Tn {
1928
+ ve = new WeakMap();
1929
+ var ge, we, _e;
1930
+ class jn {
1701
1931
  /**
1702
1932
  * Creates a new Tree instance.
1703
1933
  * @param initialRootData Data for the root node.
@@ -1710,13 +1940,13 @@ class Tn {
1710
1940
  * ```
1711
1941
  */
1712
1942
  constructor(t, n) {
1713
- de(this, ce);
1943
+ Te(this, we);
1714
1944
  /** The root node of the tree. */
1715
- U(this, "root");
1945
+ z(this, "root");
1716
1946
  /** Readonly reactive map of node IDs to TreeNode instances for quick lookups. */
1717
- U(this, "nodeMap");
1718
- de(this, le);
1719
- Le(this, le, (n == null ? void 0 : n.deleteStrategy) ?? "recursive"), this.nodeMap = Tt(/* @__PURE__ */ new Map()), this.root = new ot(t, null, {}, !0), this.nodeMap.set(this.root.id, this.root);
1947
+ z(this, "nodeMap");
1948
+ Te(this, ge);
1949
+ Ne(this, ge, (n == null ? void 0 : n.deleteStrategy) ?? "recursive"), this.nodeMap = Wt(/* @__PURE__ */ new Map()), this.root = new Et(t, null, {}, !0), this.nodeMap.set(this.root.id, this.root);
1720
1950
  }
1721
1951
  /**
1722
1952
  * Finds a node anywhere in the tree by its ID.
@@ -1738,8 +1968,8 @@ class Tn {
1738
1968
  if (!i)
1739
1969
  return console.error(`Tree addNode: Parent node with ID ${n} not found.`), null;
1740
1970
  o.id && this.nodeMap.has(o.id) && (o.id = void 0);
1741
- const s = new ot(t, i, o);
1742
- return this.nodeMap.set(s.id, s), i.addChild(s), s;
1971
+ const r = new Et(t, i, o);
1972
+ return this.nodeMap.set(r.id, r), i.addChild(r), r;
1743
1973
  }
1744
1974
  /**
1745
1975
  * Removes a node from the tree by its ID.
@@ -1749,20 +1979,20 @@ class Tn {
1749
1979
  * @returns True if the node was successfully removed, false otherwise.
1750
1980
  */
1751
1981
  removeNode(t, n) {
1752
- const o = n ?? Te(this, le), i = this.findNodeById(t);
1982
+ const o = n ?? Re(this, ge), i = this.findNodeById(t);
1753
1983
  if (!i)
1754
1984
  return !1;
1755
1985
  if (i.isRoot)
1756
1986
  return console.error("Tree removeNode: Cannot remove the root node."), !1;
1757
- const s = i.parent.value;
1987
+ const r = i.parent.value;
1758
1988
  if (o === "recursive")
1759
- Oe(this, ce, ke).call(this, i);
1989
+ ke(this, we, _e).call(this, i);
1760
1990
  else {
1761
- for (const r of i.children.value)
1762
- r.parent.value = null;
1991
+ for (const s of i.children.value)
1992
+ s.parent.value = null;
1763
1993
  i.children.value = [], this.nodeMap.delete(i.id);
1764
1994
  }
1765
- return s._removeChildInstance(i);
1995
+ return r._removeChildInstance(i);
1766
1996
  }
1767
1997
  /**
1768
1998
  * Moves a node to become a child of a new parent.
@@ -1783,9 +2013,9 @@ class Tn {
1783
2013
  return console.error(`Tree moveNode: New parent node with ID ${n} not found.`), !1;
1784
2014
  if (i.isDescendantOf(o))
1785
2015
  return console.error("Tree moveNode: Cannot move a node to become its own descendant."), !1;
1786
- const s = o.parent.value;
1787
- if (s) {
1788
- if (!s._removeChildInstance(o))
2016
+ const r = o.parent.value;
2017
+ if (r) {
2018
+ if (!r._removeChildInstance(o))
1789
2019
  return console.error("Tree moveNode: Failed to remove node from its original parent."), !1;
1790
2020
  } else if (o.isRoot) {
1791
2021
  if (o.isRoot)
@@ -1806,18 +2036,18 @@ class Tn {
1806
2036
  if (t === "dfs") {
1807
2037
  const i = [n];
1808
2038
  for (; i.length > 0; ) {
1809
- const s = i.pop();
1810
- o.push(s);
1811
- for (let r = s.children.value.length - 1; r >= 0; r--)
1812
- i.push(s.children.value[r]);
2039
+ const r = i.pop();
2040
+ o.push(r);
2041
+ for (let s = r.children.value.length - 1; s >= 0; s--)
2042
+ i.push(r.children.value[s]);
1813
2043
  }
1814
2044
  } else {
1815
2045
  const i = [n];
1816
2046
  for (; i.length > 0; ) {
1817
- const s = i.shift();
1818
- o.push(s);
1819
- for (const r of s.children.value)
1820
- i.push(r);
2047
+ const r = i.shift();
2048
+ o.push(r);
2049
+ for (const s of r.children.value)
2050
+ i.push(s);
1821
2051
  }
1822
2052
  }
1823
2053
  return o;
@@ -1832,15 +2062,15 @@ class Tn {
1832
2062
  this.nodeMap.clear();
1833
2063
  }
1834
2064
  }
1835
- le = new WeakMap(), ce = new WeakSet(), // --- Internal Recursive Helper for Deletion/Cleanup ---
1836
- ke = function(t) {
2065
+ ge = new WeakMap(), we = new WeakSet(), // --- Internal Recursive Helper for Deletion/Cleanup ---
2066
+ _e = function(t) {
1837
2067
  const n = [...t.children.value];
1838
2068
  for (const o of n)
1839
- Oe(this, ce, ke).call(this, o);
2069
+ ke(this, we, _e).call(this, o);
1840
2070
  this.nodeMap.delete(t.id), t.children.value = [];
1841
2071
  };
1842
- function Vn(e, t = {}) {
1843
- const n = new Tn(e, t);
2072
+ function io(e, t = {}) {
2073
+ const n = new jn(e, t);
1844
2074
  return {
1845
2075
  // Wrap original Tree methods in arrow functions to preserve context
1846
2076
  get nodeMap() {
@@ -1849,101 +2079,100 @@ function Vn(e, t = {}) {
1849
2079
  get root() {
1850
2080
  return n.root;
1851
2081
  },
1852
- findNodeById: (r) => n.findNodeById(r),
1853
- moveNode: (r, l) => n.moveNode(r, l),
2082
+ findNodeById: (s) => n.findNodeById(s),
2083
+ moveNode: (s, c) => n.moveNode(s, c),
1854
2084
  dispose: () => n.dispose(),
1855
- addNode: (r, l) => n.addNode(r, l),
1856
- removeNode: (r, l) => n.removeNode(r, l),
1857
- traverse: (r, l) => n.traverse(r, l),
1858
- isTopmost: (r) => {
1859
- const l = n.findNodeById(r);
1860
- if (!l || !l.data.open.value)
2085
+ addNode: (s, c) => n.addNode(s, c),
2086
+ removeNode: (s, c) => n.removeNode(s, c),
2087
+ traverse: (s, c) => n.traverse(s, c),
2088
+ isTopmost: (s) => {
2089
+ const c = n.findNodeById(s);
2090
+ if (!c || !c.data.open.value)
1861
2091
  return !1;
1862
- let a = l.parent.value;
1863
- for (; a; ) {
1864
- if (a.data.open.value)
2092
+ let f = c.parent.value;
2093
+ for (; f; ) {
2094
+ if (f.data.open.value)
1865
2095
  return !1;
1866
- a = a.parent.value;
2096
+ f = f.parent.value;
1867
2097
  }
1868
2098
  return !0;
1869
2099
  },
1870
2100
  getAllOpenNodes: () => {
1871
- const r = [];
1872
- for (const l of n.nodeMap.values())
1873
- l.data.open.value && r.push(l);
1874
- return r;
2101
+ const s = [];
2102
+ for (const c of n.nodeMap.values())
2103
+ c.data.open.value && s.push(c);
2104
+ return s;
1875
2105
  },
1876
- forEach: (r, l, a = {}) => {
1877
- const { relationship: c = "self-and-children", applyToMatching: f = !0 } = a, u = n.findNodeById(r);
1878
- if (!u)
2106
+ forEach: (s, c, f = {}) => {
2107
+ const { relationship: a = "self-and-children", applyToMatching: h = !0 } = f, d = n.findNodeById(s);
2108
+ if (!d)
1879
2109
  return;
1880
- const m = [], h = /* @__PURE__ */ new Set(), p = (v) => {
1881
- v && !h.has(v.id) && (m.push(v), h.add(v.id));
1882
- }, d = (v) => {
1883
- for (const w of v)
1884
- p(w);
2110
+ const v = [], u = /* @__PURE__ */ new Set(), g = (m) => {
2111
+ m && !u.has(m.id) && (v.push(m), u.add(m.id));
2112
+ }, p = (m) => {
2113
+ for (const y of m)
2114
+ g(y);
1885
2115
  };
1886
- if (c === "ancestors-only")
1887
- for (const v of u.getPath())
1888
- v.id !== u.id && p(v);
1889
- else if (c === "siblings-only") {
1890
- if (u.parent.value)
1891
- for (const v of u.parent.value.children.value)
1892
- v.id !== u.id && p(v);
1893
- } else if (c === "descendants-only")
1894
- for (const v of n.traverse("dfs", u))
1895
- v.id !== u.id && p(v);
1896
- else if (c === "children-only")
1897
- d(u.children.value);
1898
- else if (c === "self-and-ancestors")
1899
- d(u.getPath());
1900
- else if (c === "self-and-children")
1901
- p(u), d(u.children.value);
1902
- else if (c === "self-and-descendants")
1903
- d(n.traverse("dfs", u));
1904
- else if (c === "self-and-siblings")
1905
- p(u), u.parent.value && d(u.parent.value.children.value);
1906
- else if (c === "self-ancestors-and-children")
1907
- d(u.getPath()), d(u.children.value);
1908
- else if (c === "full-branch")
1909
- d(u.getPath()), d(n.traverse("dfs", u));
1910
- else if (c === "all-except-branch") {
1911
- const v = /* @__PURE__ */ new Set();
1912
- for (const w of u.getPath())
1913
- v.add(w.id);
1914
- for (const w of n.traverse("dfs", u))
1915
- v.add(w.id);
1916
- for (const w of n.nodeMap.values())
1917
- !v.has(w.id) === f && l(w);
2116
+ if (a === "ancestors-only")
2117
+ for (const m of d.getPath())
2118
+ m.id !== d.id && g(m);
2119
+ else if (a === "siblings-only") {
2120
+ if (d.parent.value)
2121
+ for (const m of d.parent.value.children.value)
2122
+ m.id !== d.id && g(m);
2123
+ } else if (a === "descendants-only")
2124
+ for (const m of n.traverse("dfs", d))
2125
+ m.id !== d.id && g(m);
2126
+ else if (a === "children-only")
2127
+ p(d.children.value);
2128
+ else if (a === "self-and-ancestors")
2129
+ p(d.getPath());
2130
+ else if (a === "self-and-children")
2131
+ g(d), p(d.children.value);
2132
+ else if (a === "self-and-descendants")
2133
+ p(n.traverse("dfs", d));
2134
+ else if (a === "self-and-siblings")
2135
+ g(d), d.parent.value && p(d.parent.value.children.value);
2136
+ else if (a === "self-ancestors-and-children")
2137
+ p(d.getPath()), p(d.children.value);
2138
+ else if (a === "full-branch")
2139
+ p(d.getPath()), p(n.traverse("dfs", d));
2140
+ else if (a === "all-except-branch") {
2141
+ const m = /* @__PURE__ */ new Set();
2142
+ for (const y of d.getPath())
2143
+ m.add(y.id);
2144
+ for (const y of n.traverse("dfs", d))
2145
+ m.add(y.id);
2146
+ for (const y of n.nodeMap.values())
2147
+ !m.has(y.id) === h && c(y);
1918
2148
  return;
1919
2149
  } else {
1920
- console.warn(`forEach: Unknown relationship "${c}".`);
2150
+ console.warn(`forEach: Unknown relationship "${a}".`);
1921
2151
  return;
1922
2152
  }
1923
- if (f)
1924
- for (const v of m)
1925
- l(v);
2153
+ if (h)
2154
+ for (const m of v)
2155
+ c(m);
1926
2156
  else
1927
- for (const v of n.nodeMap.values())
1928
- h.has(v.id) || l(v);
2157
+ for (const m of n.nodeMap.values())
2158
+ u.has(m.id) || c(m);
1929
2159
  }
1930
2160
  };
1931
2161
  }
1932
2162
  export {
1933
- Tn as Tree,
1934
- ot as TreeNode,
1935
- $n as arrow,
1936
- Dn as autoUpdate,
1937
- Cn as flip,
1938
- Mn as hide,
1939
- Rn as offset,
1940
- Pn as shift,
1941
- Nn as useArrow,
1942
- Hn as useClick,
1943
- Bn as useClientPoint,
1944
- Fn as useDismiss,
1945
- An as useFloating,
1946
- Vn as useFloatingTree,
1947
- kn as useFocus,
1948
- Sn as useHover
2163
+ jn as Tree,
2164
+ Et as TreeNode,
2165
+ oo as arrow,
2166
+ Gn as flip,
2167
+ Jn as hide,
2168
+ Un as offset,
2169
+ qn as shift,
2170
+ Zn as useArrow,
2171
+ eo as useClick,
2172
+ no as useClientPoint,
2173
+ to as useDismiss,
2174
+ Qn as useFloating,
2175
+ io as useFloatingTree,
2176
+ Bn as useFocus,
2177
+ zn as useHover
1949
2178
  };