@versini/ui-tooltip 2.0.2 → 2.0.3

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,56 +1,56 @@
1
- import { jsxs as bt, jsx as It } from "react/jsx-runtime";
2
- import { useRef as G, useEffect as pt, useState as ft, useCallback as ut } from "react";
3
- import _ from "clsx";
4
- const _t = "av-tooltip", jt = "av-tooltip-arrow", J = Math.min, z = Math.max, ot = Math.round, P = (t) => ({
1
+ import { jsxs as vt, jsx as _t } from "react/jsx-runtime";
2
+ import { useRef as J, useEffect as gt, useState as ut, useCallback as dt } from "react";
3
+ import Y from "clsx";
4
+ const jt = "av-tooltip", Yt = "av-tooltip-arrow", Q = Math.min, K = Math.max, it = Math.round, D = (t) => ({
5
5
  x: t,
6
6
  y: t
7
- }), Yt = {
7
+ }), zt = {
8
8
  left: "right",
9
9
  right: "left",
10
10
  bottom: "top",
11
11
  top: "bottom"
12
- }, zt = {
12
+ }, Xt = {
13
13
  start: "end",
14
14
  end: "start"
15
15
  };
16
- function dt(t, e, o) {
17
- return z(t, J(e, o));
16
+ function mt(t, e, o) {
17
+ return K(t, Q(e, o));
18
18
  }
19
- function Z(t, e) {
19
+ function tt(t, e) {
20
20
  return typeof t == "function" ? t(e) : t;
21
21
  }
22
- function j(t) {
22
+ function X(t) {
23
23
  return t.split("-")[0];
24
24
  }
25
- function tt(t) {
25
+ function et(t) {
26
26
  return t.split("-")[1];
27
27
  }
28
- function Lt(t) {
28
+ function kt(t) {
29
29
  return t === "x" ? "y" : "x";
30
30
  }
31
- function gt(t) {
31
+ function ht(t) {
32
32
  return t === "y" ? "height" : "width";
33
33
  }
34
- function K(t) {
35
- return ["top", "bottom"].includes(j(t)) ? "y" : "x";
34
+ function z(t) {
35
+ return ["top", "bottom"].includes(X(t)) ? "y" : "x";
36
36
  }
37
- function ht(t) {
38
- return Lt(K(t));
37
+ function wt(t) {
38
+ return kt(z(t));
39
39
  }
40
- function Xt(t, e, o) {
40
+ function Kt(t, e, o) {
41
41
  o === void 0 && (o = !1);
42
- const n = tt(t), i = ht(t), s = gt(i);
42
+ const n = et(t), i = wt(t), s = ht(i);
43
43
  let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
44
- return e.reference[s] > e.floating[s] && (r = it(r)), [r, it(r)];
44
+ return e.reference[s] > e.floating[s] && (r = st(r)), [r, st(r)];
45
45
  }
46
- function Kt(t) {
47
- const e = it(t);
48
- return [mt(t), e, mt(e)];
46
+ function Ut(t) {
47
+ const e = st(t);
48
+ return [pt(t), e, pt(e)];
49
49
  }
50
- function mt(t) {
51
- return t.replace(/start|end/g, (e) => zt[e]);
50
+ function pt(t) {
51
+ return t.replace(/start|end/g, (e) => Xt[e]);
52
52
  }
53
- function Ut(t, e, o) {
53
+ function qt(t, e, o) {
54
54
  const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
55
55
  switch (t) {
56
56
  case "top":
@@ -63,15 +63,15 @@ function Ut(t, e, o) {
63
63
  return [];
64
64
  }
65
65
  }
66
- function qt(t, e, o, n) {
67
- const i = tt(t);
68
- let s = Ut(j(t), o === "start", n);
69
- return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(mt)))), s;
66
+ function Gt(t, e, o, n) {
67
+ const i = et(t);
68
+ let s = qt(X(t), o === "start", n);
69
+ return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(pt)))), s;
70
70
  }
71
- function it(t) {
72
- return t.replace(/left|right|bottom|top/g, (e) => Yt[e]);
71
+ function st(t) {
72
+ return t.replace(/left|right|bottom|top/g, (e) => zt[e]);
73
73
  }
74
- function Gt(t) {
74
+ function Jt(t) {
75
75
  return {
76
76
  top: 0,
77
77
  right: 0,
@@ -80,15 +80,15 @@ function Gt(t) {
80
80
  ...t
81
81
  };
82
82
  }
83
- function kt(t) {
84
- return typeof t != "number" ? Gt(t) : {
83
+ function St(t) {
84
+ return typeof t != "number" ? Jt(t) : {
85
85
  top: t,
86
86
  right: t,
87
87
  bottom: t,
88
88
  left: t
89
89
  };
90
90
  }
91
- function st(t) {
91
+ function rt(t) {
92
92
  const {
93
93
  x: e,
94
94
  y: o,
@@ -106,12 +106,12 @@ function st(t) {
106
106
  y: o
107
107
  };
108
108
  }
109
- function vt(t, e, o) {
109
+ function At(t, e, o) {
110
110
  let {
111
111
  reference: n,
112
112
  floating: i
113
113
  } = t;
114
- const s = K(e), r = ht(e), c = gt(r), l = j(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, p = n[c] / 2 - i[c] / 2;
114
+ const s = z(e), r = wt(e), c = ht(r), l = X(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, f = n.y + n.height / 2 - i.height / 2, p = n[c] / 2 - i[c] / 2;
115
115
  let u;
116
116
  switch (l) {
117
117
  case "top":
@@ -144,7 +144,7 @@ function vt(t, e, o) {
144
144
  y: n.y
145
145
  };
146
146
  }
147
- switch (tt(e)) {
147
+ switch (et(e)) {
148
148
  case "start":
149
149
  u[r] -= p * (o && a ? -1 : 1);
150
150
  break;
@@ -154,7 +154,7 @@ function vt(t, e, o) {
154
154
  }
155
155
  return u;
156
156
  }
157
- const Jt = async (t, e, o) => {
157
+ const Qt = async (t, e, o) => {
158
158
  const {
159
159
  placement: n = "bottom",
160
160
  strategy: i = "absolute",
@@ -168,7 +168,7 @@ const Jt = async (t, e, o) => {
168
168
  }), {
169
169
  x: d,
170
170
  y: f
171
- } = vt(a, n, l), p = n, u = {}, m = 0;
171
+ } = At(a, n, l), p = n, u = {}, m = 0;
172
172
  for (let g = 0; g < c.length; g++) {
173
173
  const {
174
174
  name: h,
@@ -176,7 +176,7 @@ const Jt = async (t, e, o) => {
176
176
  } = c[g], {
177
177
  x,
178
178
  y,
179
- data: A,
179
+ data: v,
180
180
  reset: b
181
181
  } = await w({
182
182
  x: d,
@@ -196,7 +196,7 @@ const Jt = async (t, e, o) => {
196
196
  ...u,
197
197
  [h]: {
198
198
  ...u[h],
199
- ...A
199
+ ...v
200
200
  }
201
201
  }, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (a = b.rects === !0 ? await r.getElementRects({
202
202
  reference: t,
@@ -205,7 +205,7 @@ const Jt = async (t, e, o) => {
205
205
  }) : b.rects), {
206
206
  x: d,
207
207
  y: f
208
- } = vt(a, p, l)), g = -1);
208
+ } = At(a, p, l)), g = -1);
209
209
  }
210
210
  return {
211
211
  x: d,
@@ -215,7 +215,7 @@ const Jt = async (t, e, o) => {
215
215
  middlewareData: u
216
216
  };
217
217
  };
218
- async function St(t, e) {
218
+ async function Pt(t, e) {
219
219
  var o;
220
220
  e === void 0 && (e = {});
221
221
  const {
@@ -231,7 +231,7 @@ async function St(t, e) {
231
231
  elementContext: f = "floating",
232
232
  altBoundary: p = !1,
233
233
  padding: u = 0
234
- } = Z(e, t), m = kt(u), h = c[p ? f === "floating" ? "reference" : "floating" : f], w = st(await s.getClippingRect({
234
+ } = tt(e, t), m = St(u), h = c[p ? f === "floating" ? "reference" : "floating" : f], w = rt(await s.getClippingRect({
235
235
  element: (o = await (s.isElement == null ? void 0 : s.isElement(h))) == null || o ? h : h.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
236
236
  boundary: a,
237
237
  rootBoundary: d,
@@ -241,26 +241,26 @@ async function St(t, e) {
241
241
  y: i,
242
242
  width: r.floating.width,
243
243
  height: r.floating.height
244
- } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
244
+ } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), v = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
245
245
  x: 1,
246
246
  y: 1
247
247
  } : {
248
248
  x: 1,
249
249
  y: 1
250
- }, b = st(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
250
+ }, b = rt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
251
251
  elements: c,
252
252
  rect: x,
253
253
  offsetParent: y,
254
254
  strategy: l
255
255
  }) : x);
256
256
  return {
257
- top: (w.top - b.top + m.top) / A.y,
258
- bottom: (b.bottom - w.bottom + m.bottom) / A.y,
259
- left: (w.left - b.left + m.left) / A.x,
260
- right: (b.right - w.right + m.right) / A.x
257
+ top: (w.top - b.top + m.top) / v.y,
258
+ bottom: (b.bottom - w.bottom + m.bottom) / v.y,
259
+ left: (w.left - b.left + m.left) / v.x,
260
+ right: (b.right - w.right + m.right) / v.x
261
261
  };
262
262
  }
263
- const Qt = (t) => ({
263
+ const Zt = (t) => ({
264
264
  name: "arrow",
265
265
  options: t,
266
266
  async fn(e) {
@@ -275,29 +275,29 @@ const Qt = (t) => ({
275
275
  } = e, {
276
276
  element: a,
277
277
  padding: d = 0
278
- } = Z(t, e) || {};
278
+ } = tt(t, e) || {};
279
279
  if (a == null)
280
280
  return {};
281
- const f = kt(d), p = {
281
+ const f = St(d), p = {
282
282
  x: o,
283
283
  y: n
284
- }, u = ht(i), m = gt(u), g = await r.getDimensions(a), h = u === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", A = s.reference[m] + s.reference[u] - p[u] - s.floating[m], b = p[u] - s.reference[u], N = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
285
- let R = N ? N[y] : 0;
286
- (!R || !await (r.isElement == null ? void 0 : r.isElement(N))) && (R = c.floating[y] || s.floating[m]);
287
- const F = A / 2 - b / 2, E = R / 2 - g[m] / 2 - 1, L = J(f[w], E), H = J(f[x], E), k = L, I = R - g[m] - H, v = R / 2 - g[m] / 2 + F, Y = dt(k, v, I), M = !l.arrow && tt(i) != null && v !== Y && s.reference[m] / 2 - (v < k ? L : H) - g[m] / 2 < 0, S = M ? v < k ? v - k : v - I : 0;
284
+ }, u = wt(i), m = ht(u), g = await r.getDimensions(a), h = u === "y", w = h ? "top" : "left", x = h ? "bottom" : "right", y = h ? "clientHeight" : "clientWidth", v = s.reference[m] + s.reference[u] - p[u] - s.floating[m], b = p[u] - s.reference[u], M = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
285
+ let E = M ? M[y] : 0;
286
+ (!E || !await (r.isElement == null ? void 0 : r.isElement(M))) && (E = c.floating[y] || s.floating[m]);
287
+ const V = v / 2 - b / 2, k = E / 2 - g[m] / 2 - 1, T = Q(f[w], k), I = Q(f[x], k), S = T, _ = E - g[m] - I, C = E / 2 - g[m] / 2 + V, O = mt(S, C, _), j = !l.arrow && et(i) != null && C !== O && s.reference[m] / 2 - (C < S ? T : I) - g[m] / 2 < 0, B = j ? C < S ? C - S : C - _ : 0;
288
288
  return {
289
- [u]: p[u] + S,
289
+ [u]: p[u] + B,
290
290
  data: {
291
- [u]: Y,
292
- centerOffset: v - Y - S,
293
- ...M && {
294
- alignmentOffset: S
291
+ [u]: O,
292
+ centerOffset: C - O - B,
293
+ ...j && {
294
+ alignmentOffset: B
295
295
  }
296
296
  },
297
- reset: M
297
+ reset: j
298
298
  };
299
299
  }
300
- }), Zt = function(t) {
300
+ }), te = function(t) {
301
301
  return t === void 0 && (t = {}), {
302
302
  name: "flip",
303
303
  options: t,
@@ -318,58 +318,62 @@ const Qt = (t) => ({
318
318
  fallbackAxisSideDirection: m = "none",
319
319
  flipAlignment: g = !0,
320
320
  ...h
321
- } = Z(t, e);
321
+ } = tt(t, e);
322
322
  if ((o = s.arrow) != null && o.alignmentOffset)
323
323
  return {};
324
- const w = j(i), x = K(c), y = j(c) === c, A = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (y || !g ? [it(c)] : Kt(c)), N = m !== "none";
325
- !p && N && b.push(...qt(c, g, m, A));
326
- const R = [c, ...b], F = await St(e, h), E = [];
327
- let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
328
- if (d && E.push(F[w]), f) {
329
- const v = Xt(i, r, A);
330
- E.push(F[v[0]], F[v[1]]);
324
+ const w = X(i), x = z(c), y = X(c) === c, v = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), b = p || (y || !g ? [st(c)] : Ut(c)), M = m !== "none";
325
+ !p && M && b.push(...Gt(c, g, m, v));
326
+ const E = [c, ...b], V = await Pt(e, h), k = [];
327
+ let T = ((n = s.flip) == null ? void 0 : n.overflows) || [];
328
+ if (d && k.push(V[w]), f) {
329
+ const O = Kt(i, r, v);
330
+ k.push(V[O[0]], V[O[1]]);
331
331
  }
332
- if (L = [...L, {
332
+ if (T = [...T, {
333
333
  placement: i,
334
- overflows: E
335
- }], !E.every((v) => v <= 0)) {
336
- var H, k;
337
- const v = (((H = s.flip) == null ? void 0 : H.index) || 0) + 1, Y = R[v];
338
- if (Y)
339
- return {
340
- data: {
341
- index: v,
342
- overflows: L
343
- },
344
- reset: {
345
- placement: Y
346
- }
347
- };
348
- let M = (k = L.filter((S) => S.overflows[0] <= 0).sort((S, V) => S.overflows[1] - V.overflows[1])[0]) == null ? void 0 : k.placement;
349
- if (!M)
334
+ overflows: k
335
+ }], !k.every((O) => O <= 0)) {
336
+ var I, S;
337
+ const O = (((I = s.flip) == null ? void 0 : I.index) || 0) + 1, j = E[O];
338
+ if (j) {
339
+ var _;
340
+ const W = f === "alignment" ? x !== z(j) : !1, P = ((_ = T[0]) == null ? void 0 : _.overflows[0]) > 0;
341
+ if (!W || P)
342
+ return {
343
+ data: {
344
+ index: O,
345
+ overflows: T
346
+ },
347
+ reset: {
348
+ placement: j
349
+ }
350
+ };
351
+ }
352
+ let B = (S = T.filter((W) => W.overflows[0] <= 0).sort((W, P) => W.overflows[1] - P.overflows[1])[0]) == null ? void 0 : S.placement;
353
+ if (!B)
350
354
  switch (u) {
351
355
  case "bestFit": {
352
- var I;
353
- const S = (I = L.filter((V) => {
354
- if (N) {
355
- const W = K(V.placement);
356
- return W === x || // Create a bias to the `y` side axis due to horizontal
356
+ var C;
357
+ const W = (C = T.filter((P) => {
358
+ if (M) {
359
+ const $ = z(P.placement);
360
+ return $ === x || // Create a bias to the `y` side axis due to horizontal
357
361
  // reading directions favoring greater width.
358
- W === "y";
362
+ $ === "y";
359
363
  }
360
364
  return !0;
361
- }).map((V) => [V.placement, V.overflows.filter((W) => W > 0).reduce((W, Ht) => W + Ht, 0)]).sort((V, W) => V[1] - W[1])[0]) == null ? void 0 : I[0];
362
- S && (M = S);
365
+ }).map((P) => [P.placement, P.overflows.filter(($) => $ > 0).reduce(($, It) => $ + It, 0)]).sort((P, $) => P[1] - $[1])[0]) == null ? void 0 : C[0];
366
+ W && (B = W);
363
367
  break;
364
368
  }
365
369
  case "initialPlacement":
366
- M = c;
370
+ B = c;
367
371
  break;
368
372
  }
369
- if (i !== M)
373
+ if (i !== B)
370
374
  return {
371
375
  reset: {
372
- placement: M
376
+ placement: B
373
377
  }
374
378
  };
375
379
  }
@@ -377,12 +381,12 @@ const Qt = (t) => ({
377
381
  }
378
382
  };
379
383
  };
380
- async function te(t, e) {
384
+ async function ee(t, e) {
381
385
  const {
382
386
  placement: o,
383
387
  platform: n,
384
388
  elements: i
385
- } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), c = tt(o), l = K(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && l ? -1 : 1, f = Z(e, t);
389
+ } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = X(o), c = et(o), l = z(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && l ? -1 : 1, f = tt(e, t);
386
390
  let {
387
391
  mainAxis: p,
388
392
  crossAxis: u,
@@ -404,7 +408,7 @@ async function te(t, e) {
404
408
  y: u * d
405
409
  };
406
410
  }
407
- const ee = function(t) {
411
+ const ne = function(t) {
408
412
  return t === void 0 && (t = 0), {
409
413
  name: "offset",
410
414
  options: t,
@@ -415,7 +419,7 @@ const ee = function(t) {
415
419
  y: s,
416
420
  placement: r,
417
421
  middlewareData: c
418
- } = e, l = await te(e, t);
422
+ } = e, l = await ee(e, t);
419
423
  return r === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
420
424
  x: i + l.x,
421
425
  y: s + l.y,
@@ -426,7 +430,7 @@ const ee = function(t) {
426
430
  };
427
431
  }
428
432
  };
429
- }, ne = function(t) {
433
+ }, oe = function(t) {
430
434
  return t === void 0 && (t = {}), {
431
435
  name: "shift",
432
436
  options: t,
@@ -451,18 +455,18 @@ const ee = function(t) {
451
455
  }
452
456
  },
453
457
  ...l
454
- } = Z(t, e), a = {
458
+ } = tt(t, e), a = {
455
459
  x: o,
456
460
  y: n
457
- }, d = await St(e, l), f = K(j(i)), p = Lt(f);
461
+ }, d = await Pt(e, l), f = z(X(i)), p = kt(f);
458
462
  let u = a[p], m = a[f];
459
463
  if (s) {
460
464
  const h = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", x = u + d[h], y = u - d[w];
461
- u = dt(x, u, y);
465
+ u = mt(x, u, y);
462
466
  }
463
467
  if (r) {
464
468
  const h = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = m + d[h], y = m - d[w];
465
- m = dt(x, m, y);
469
+ m = mt(x, m, y);
466
470
  }
467
471
  const g = c.fn({
468
472
  ...e,
@@ -483,45 +487,45 @@ const ee = function(t) {
483
487
  }
484
488
  };
485
489
  };
486
- function rt() {
490
+ function ct() {
487
491
  return typeof window < "u";
488
492
  }
489
- function q(t) {
490
- return Pt(t) ? (t.nodeName || "").toLowerCase() : "#document";
493
+ function G(t) {
494
+ return Dt(t) ? (t.nodeName || "").toLowerCase() : "#document";
491
495
  }
492
- function C(t) {
496
+ function A(t) {
493
497
  var e;
494
498
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
495
499
  }
496
- function B(t) {
500
+ function F(t) {
497
501
  var e;
498
- return (e = (Pt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
502
+ return (e = (Dt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
499
503
  }
500
- function Pt(t) {
501
- return rt() ? t instanceof Node || t instanceof C(t).Node : !1;
504
+ function Dt(t) {
505
+ return ct() ? t instanceof Node || t instanceof A(t).Node : !1;
502
506
  }
503
- function T(t) {
504
- return rt() ? t instanceof Element || t instanceof C(t).Element : !1;
507
+ function R(t) {
508
+ return ct() ? t instanceof Element || t instanceof A(t).Element : !1;
505
509
  }
506
- function D(t) {
507
- return rt() ? t instanceof HTMLElement || t instanceof C(t).HTMLElement : !1;
510
+ function N(t) {
511
+ return ct() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
508
512
  }
509
- function At(t) {
510
- return !rt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof C(t).ShadowRoot;
513
+ function Ct(t) {
514
+ return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
511
515
  }
512
- function et(t) {
516
+ function nt(t) {
513
517
  const {
514
518
  overflow: e,
515
519
  overflowX: o,
516
520
  overflowY: n,
517
521
  display: i
518
- } = O(t);
522
+ } = L(t);
519
523
  return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
520
524
  }
521
- function oe(t) {
522
- return ["table", "td", "th"].includes(q(t));
525
+ function ie(t) {
526
+ return ["table", "td", "th"].includes(G(t));
523
527
  }
524
- function ct(t) {
528
+ function lt(t) {
525
529
  return [":popover-open", ":modal"].some((e) => {
526
530
  try {
527
531
  return t.matches(e);
@@ -530,32 +534,32 @@ function ct(t) {
530
534
  }
531
535
  });
532
536
  }
533
- function wt(t) {
534
- const e = xt(), o = T(t) ? O(t) : t;
537
+ function xt(t) {
538
+ const e = yt(), o = R(t) ? L(t) : t;
535
539
  return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
536
540
  }
537
- function ie(t) {
538
- let e = $(t);
539
- for (; D(e) && !U(e); ) {
540
- if (wt(e))
541
+ function se(t) {
542
+ let e = H(t);
543
+ for (; N(e) && !q(e); ) {
544
+ if (xt(e))
541
545
  return e;
542
- if (ct(e))
546
+ if (lt(e))
543
547
  return null;
544
- e = $(e);
548
+ e = H(e);
545
549
  }
546
550
  return null;
547
551
  }
548
- function xt() {
552
+ function yt() {
549
553
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
550
554
  }
551
- function U(t) {
552
- return ["html", "body", "#document"].includes(q(t));
555
+ function q(t) {
556
+ return ["html", "body", "#document"].includes(G(t));
553
557
  }
554
- function O(t) {
555
- return C(t).getComputedStyle(t);
558
+ function L(t) {
559
+ return A(t).getComputedStyle(t);
556
560
  }
557
- function lt(t) {
558
- return T(t) ? {
561
+ function at(t) {
562
+ return R(t) ? {
559
563
  scrollLeft: t.scrollLeft,
560
564
  scrollTop: t.scrollTop
561
565
  } : {
@@ -563,127 +567,127 @@ function lt(t) {
563
567
  scrollTop: t.scrollY
564
568
  };
565
569
  }
566
- function $(t) {
567
- if (q(t) === "html")
570
+ function H(t) {
571
+ if (G(t) === "html")
568
572
  return t;
569
573
  const e = (
570
574
  // Step into the shadow DOM of the parent of a slotted node.
571
575
  t.assignedSlot || // DOM Element detected.
572
576
  t.parentNode || // ShadowRoot detected.
573
- At(t) && t.host || // Fallback.
574
- B(t)
577
+ Ct(t) && t.host || // Fallback.
578
+ F(t)
575
579
  );
576
- return At(e) ? e.host : e;
580
+ return Ct(e) ? e.host : e;
577
581
  }
578
- function Dt(t) {
579
- const e = $(t);
580
- return U(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : D(e) && et(e) ? e : Dt(e);
582
+ function Nt(t) {
583
+ const e = H(t);
584
+ return q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : N(e) && nt(e) ? e : Nt(e);
581
585
  }
582
- function Nt(t, e, o) {
586
+ function Mt(t, e, o) {
583
587
  var n;
584
588
  e === void 0 && (e = []);
585
- const i = Dt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = C(i);
586
- return s ? e.concat(r, r.visualViewport || [], et(i) ? i : [], []) : e.concat(i, Nt(i, []));
589
+ const i = Nt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = A(i);
590
+ return s ? e.concat(r, r.visualViewport || [], nt(i) ? i : [], []) : e.concat(i, Mt(i, []));
587
591
  }
588
- function Ct(t) {
592
+ function Tt(t) {
589
593
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
590
594
  }
591
- function Mt(t) {
592
- const e = O(t);
595
+ function Bt(t) {
596
+ const e = L(t);
593
597
  let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
594
- const i = D(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = ot(o) !== s || ot(n) !== r;
598
+ const i = N(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, c = it(o) !== s || it(n) !== r;
595
599
  return c && (o = s, n = r), {
596
600
  width: o,
597
601
  height: n,
598
602
  $: c
599
603
  };
600
604
  }
601
- function Bt(t) {
602
- return T(t) ? t : t.contextElement;
605
+ function Ft(t) {
606
+ return R(t) ? t : t.contextElement;
603
607
  }
604
- function X(t) {
605
- const e = Bt(t);
606
- if (!D(e))
607
- return P(1);
608
+ function U(t) {
609
+ const e = Ft(t);
610
+ if (!N(e))
611
+ return D(1);
608
612
  const o = e.getBoundingClientRect(), {
609
613
  width: n,
610
614
  height: i,
611
615
  $: s
612
- } = Mt(e);
613
- let r = (s ? ot(o.width) : o.width) / n, c = (s ? ot(o.height) : o.height) / i;
616
+ } = Bt(e);
617
+ let r = (s ? it(o.width) : o.width) / n, c = (s ? it(o.height) : o.height) / i;
614
618
  return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
615
619
  x: r,
616
620
  y: c
617
621
  };
618
622
  }
619
- const se = /* @__PURE__ */ P(0);
620
- function Ft(t) {
621
- const e = C(t);
622
- return !xt() || !e.visualViewport ? se : {
623
+ const re = /* @__PURE__ */ D(0);
624
+ function Vt(t) {
625
+ const e = A(t);
626
+ return !yt() || !e.visualViewport ? re : {
623
627
  x: e.visualViewport.offsetLeft,
624
628
  y: e.visualViewport.offsetTop
625
629
  };
626
630
  }
627
- function re(t, e, o) {
628
- return e === void 0 && (e = !1), !o || e && o !== C(t) ? !1 : e;
631
+ function ce(t, e, o) {
632
+ return e === void 0 && (e = !1), !o || e && o !== A(t) ? !1 : e;
629
633
  }
630
- function Q(t, e, o, n) {
634
+ function Z(t, e, o, n) {
631
635
  e === void 0 && (e = !1), o === void 0 && (o = !1);
632
- const i = t.getBoundingClientRect(), s = Bt(t);
633
- let r = P(1);
634
- e && (n ? T(n) && (r = X(n)) : r = X(t));
635
- const c = re(s, o, n) ? Ft(s) : P(0);
636
+ const i = t.getBoundingClientRect(), s = Ft(t);
637
+ let r = D(1);
638
+ e && (n ? R(n) && (r = U(n)) : r = U(t));
639
+ const c = ce(s, o, n) ? Vt(s) : D(0);
636
640
  let l = (i.left + c.x) / r.x, a = (i.top + c.y) / r.y, d = i.width / r.x, f = i.height / r.y;
637
641
  if (s) {
638
- const p = C(s), u = n && T(n) ? C(n) : n;
639
- let m = p, g = Ct(m);
642
+ const p = A(s), u = n && R(n) ? A(n) : n;
643
+ let m = p, g = Tt(m);
640
644
  for (; g && n && u !== m; ) {
641
- const h = X(g), w = g.getBoundingClientRect(), x = O(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, A = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
642
- l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a += A, m = C(g), g = Ct(m);
645
+ const h = U(g), w = g.getBoundingClientRect(), x = L(g), y = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * h.x, v = w.top + (g.clientTop + parseFloat(x.paddingTop)) * h.y;
646
+ l *= h.x, a *= h.y, d *= h.x, f *= h.y, l += y, a += v, m = A(g), g = Tt(m);
643
647
  }
644
648
  }
645
- return st({
649
+ return rt({
646
650
  width: d,
647
651
  height: f,
648
652
  x: l,
649
653
  y: a
650
654
  });
651
655
  }
652
- function yt(t, e) {
653
- const o = lt(t).scrollLeft;
654
- return e ? e.left + o : Q(B(t)).left + o;
656
+ function bt(t, e) {
657
+ const o = at(t).scrollLeft;
658
+ return e ? e.left + o : Z(F(t)).left + o;
655
659
  }
656
- function Vt(t, e, o) {
660
+ function Wt(t, e, o) {
657
661
  o === void 0 && (o = !1);
658
662
  const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (o ? 0 : (
659
663
  // RTL <body> scrollbar.
660
- yt(t, n)
664
+ bt(t, n)
661
665
  )), s = n.top + e.scrollTop;
662
666
  return {
663
667
  x: i,
664
668
  y: s
665
669
  };
666
670
  }
667
- function ce(t) {
671
+ function le(t) {
668
672
  let {
669
673
  elements: e,
670
674
  rect: o,
671
675
  offsetParent: n,
672
676
  strategy: i
673
677
  } = t;
674
- const s = i === "fixed", r = B(n), c = e ? ct(e.floating) : !1;
678
+ const s = i === "fixed", r = F(n), c = e ? lt(e.floating) : !1;
675
679
  if (n === r || c && s)
676
680
  return o;
677
681
  let l = {
678
682
  scrollLeft: 0,
679
683
  scrollTop: 0
680
- }, a = P(1);
681
- const d = P(0), f = D(n);
682
- if ((f || !f && !s) && ((q(n) !== "body" || et(r)) && (l = lt(n)), D(n))) {
683
- const u = Q(n);
684
- a = X(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
684
+ }, a = D(1);
685
+ const d = D(0), f = N(n);
686
+ if ((f || !f && !s) && ((G(n) !== "body" || nt(r)) && (l = at(n)), N(n))) {
687
+ const u = Z(n);
688
+ a = U(n), d.x = u.x + n.clientLeft, d.y = u.y + n.clientTop;
685
689
  }
686
- const p = r && !f && !s ? Vt(r, l, !0) : P(0);
690
+ const p = r && !f && !s ? Wt(r, l, !0) : D(0);
687
691
  return {
688
692
  width: o.width * a.x,
689
693
  height: o.height * a.y,
@@ -691,26 +695,26 @@ function ce(t) {
691
695
  y: o.y * a.y - l.scrollTop * a.y + d.y + p.y
692
696
  };
693
697
  }
694
- function le(t) {
698
+ function ae(t) {
695
699
  return Array.from(t.getClientRects());
696
700
  }
697
- function ae(t) {
698
- const e = B(t), o = lt(t), n = t.ownerDocument.body, i = z(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = z(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
699
- let r = -o.scrollLeft + yt(t);
701
+ function fe(t) {
702
+ const e = F(t), o = at(t), n = t.ownerDocument.body, i = K(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = K(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
703
+ let r = -o.scrollLeft + bt(t);
700
704
  const c = -o.scrollTop;
701
- return O(n).direction === "rtl" && (r += z(e.clientWidth, n.clientWidth) - i), {
705
+ return L(n).direction === "rtl" && (r += K(e.clientWidth, n.clientWidth) - i), {
702
706
  width: i,
703
707
  height: s,
704
708
  x: r,
705
709
  y: c
706
710
  };
707
711
  }
708
- function fe(t, e) {
709
- const o = C(t), n = B(t), i = o.visualViewport;
712
+ function ue(t, e) {
713
+ const o = A(t), n = F(t), i = o.visualViewport;
710
714
  let s = n.clientWidth, r = n.clientHeight, c = 0, l = 0;
711
715
  if (i) {
712
716
  s = i.width, r = i.height;
713
- const a = xt();
717
+ const a = yt();
714
718
  (!a || a && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
715
719
  }
716
720
  return {
@@ -720,8 +724,8 @@ function fe(t, e) {
720
724
  y: l
721
725
  };
722
726
  }
723
- function ue(t, e) {
724
- const o = Q(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = D(t) ? X(t) : P(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = n * s.y;
727
+ function de(t, e) {
728
+ const o = Z(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = N(t) ? U(t) : D(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, l = i * s.x, a = n * s.y;
725
729
  return {
726
730
  width: r,
727
731
  height: c,
@@ -729,16 +733,16 @@ function ue(t, e) {
729
733
  y: a
730
734
  };
731
735
  }
732
- function Tt(t, e, o) {
736
+ function Ot(t, e, o) {
733
737
  let n;
734
738
  if (e === "viewport")
735
- n = fe(t, o);
739
+ n = ue(t, o);
736
740
  else if (e === "document")
737
- n = ae(B(t));
738
- else if (T(e))
739
- n = ue(e, o);
741
+ n = fe(F(t));
742
+ else if (R(e))
743
+ n = de(e, o);
740
744
  else {
741
- const i = Ft(t);
745
+ const i = Vt(t);
742
746
  n = {
743
747
  x: e.x - i.x,
744
748
  y: e.y - i.y,
@@ -746,36 +750,36 @@ function Tt(t, e, o) {
746
750
  height: e.height
747
751
  };
748
752
  }
749
- return st(n);
753
+ return rt(n);
750
754
  }
751
- function Wt(t, e) {
752
- const o = $(t);
753
- return o === e || !T(o) || U(o) ? !1 : O(o).position === "fixed" || Wt(o, e);
755
+ function $t(t, e) {
756
+ const o = H(t);
757
+ return o === e || !R(o) || q(o) ? !1 : L(o).position === "fixed" || $t(o, e);
754
758
  }
755
- function de(t, e) {
759
+ function me(t, e) {
756
760
  const o = e.get(t);
757
761
  if (o)
758
762
  return o;
759
- let n = Nt(t, []).filter((c) => T(c) && q(c) !== "body"), i = null;
760
- const s = O(t).position === "fixed";
761
- let r = s ? $(t) : t;
762
- for (; T(r) && !U(r); ) {
763
- const c = O(r), l = wt(r);
764
- !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || et(r) && !l && Wt(t, r)) ? n = n.filter((d) => d !== r) : i = c, r = $(r);
763
+ let n = Mt(t, []).filter((c) => R(c) && G(c) !== "body"), i = null;
764
+ const s = L(t).position === "fixed";
765
+ let r = s ? H(t) : t;
766
+ for (; R(r) && !q(r); ) {
767
+ const c = L(r), l = xt(r);
768
+ !l && c.position === "fixed" && (i = null), (s ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || nt(r) && !l && $t(t, r)) ? n = n.filter((d) => d !== r) : i = c, r = H(r);
765
769
  }
766
770
  return e.set(t, n), n;
767
771
  }
768
- function me(t) {
772
+ function pe(t) {
769
773
  let {
770
774
  element: e,
771
775
  boundary: o,
772
776
  rootBoundary: n,
773
777
  strategy: i
774
778
  } = t;
775
- const r = [...o === "clippingAncestors" ? ct(e) ? [] : de(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((a, d) => {
776
- const f = Tt(e, d, i);
777
- return a.top = z(f.top, a.top), a.right = J(f.right, a.right), a.bottom = J(f.bottom, a.bottom), a.left = z(f.left, a.left), a;
778
- }, Tt(e, c, i));
779
+ const r = [...o === "clippingAncestors" ? lt(e) ? [] : me(e, this._c) : [].concat(o), n], c = r[0], l = r.reduce((a, d) => {
780
+ const f = Ot(e, d, i);
781
+ return a.top = K(f.top, a.top), a.right = Q(f.right, a.right), a.bottom = Q(f.bottom, a.bottom), a.left = K(f.left, a.left), a;
782
+ }, Ot(e, c, i));
779
783
  return {
780
784
  width: l.right - l.left,
781
785
  height: l.bottom - l.top,
@@ -783,69 +787,73 @@ function me(t) {
783
787
  y: l.top
784
788
  };
785
789
  }
786
- function pe(t) {
790
+ function ge(t) {
787
791
  const {
788
792
  width: e,
789
793
  height: o
790
- } = Mt(t);
794
+ } = Bt(t);
791
795
  return {
792
796
  width: e,
793
797
  height: o
794
798
  };
795
799
  }
796
- function ge(t, e, o) {
797
- const n = D(e), i = B(e), s = o === "fixed", r = Q(t, !0, s, e);
800
+ function he(t, e, o) {
801
+ const n = N(e), i = F(e), s = o === "fixed", r = Z(t, !0, s, e);
798
802
  let c = {
799
803
  scrollLeft: 0,
800
804
  scrollTop: 0
801
805
  };
802
- const l = P(0);
806
+ const l = D(0);
807
+ function a() {
808
+ l.x = bt(i);
809
+ }
803
810
  if (n || !n && !s)
804
- if ((q(e) !== "body" || et(i)) && (c = lt(e)), n) {
805
- const p = Q(e, !0, s, e);
806
- l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
807
- } else i && (l.x = yt(i));
808
- const a = i && !n && !s ? Vt(i, c) : P(0), d = r.left + c.scrollLeft - l.x - a.x, f = r.top + c.scrollTop - l.y - a.y;
811
+ if ((G(e) !== "body" || nt(i)) && (c = at(e)), n) {
812
+ const u = Z(e, !0, s, e);
813
+ l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
814
+ } else i && a();
815
+ s && !n && i && a();
816
+ const d = i && !n && !s ? Wt(i, c) : D(0), f = r.left + c.scrollLeft - l.x - d.x, p = r.top + c.scrollTop - l.y - d.y;
809
817
  return {
810
- x: d,
811
- y: f,
818
+ x: f,
819
+ y: p,
812
820
  width: r.width,
813
821
  height: r.height
814
822
  };
815
823
  }
816
- function at(t) {
817
- return O(t).position === "static";
824
+ function ft(t) {
825
+ return L(t).position === "static";
818
826
  }
819
- function Ot(t, e) {
820
- if (!D(t) || O(t).position === "fixed")
827
+ function Rt(t, e) {
828
+ if (!N(t) || L(t).position === "fixed")
821
829
  return null;
822
830
  if (e)
823
831
  return e(t);
824
832
  let o = t.offsetParent;
825
- return B(t) === o && (o = o.ownerDocument.body), o;
833
+ return F(t) === o && (o = o.ownerDocument.body), o;
826
834
  }
827
- function $t(t, e) {
828
- const o = C(t);
829
- if (ct(t))
835
+ function Ht(t, e) {
836
+ const o = A(t);
837
+ if (lt(t))
830
838
  return o;
831
- if (!D(t)) {
832
- let i = $(t);
833
- for (; i && !U(i); ) {
834
- if (T(i) && !at(i))
839
+ if (!N(t)) {
840
+ let i = H(t);
841
+ for (; i && !q(i); ) {
842
+ if (R(i) && !ft(i))
835
843
  return i;
836
- i = $(i);
844
+ i = H(i);
837
845
  }
838
846
  return o;
839
847
  }
840
- let n = Ot(t, e);
841
- for (; n && oe(n) && at(n); )
842
- n = Ot(n, e);
843
- return n && U(n) && at(n) && !wt(n) ? o : n || ie(t) || o;
848
+ let n = Rt(t, e);
849
+ for (; n && ie(n) && ft(n); )
850
+ n = Rt(n, e);
851
+ return n && q(n) && ft(n) && !xt(n) ? o : n || se(t) || o;
844
852
  }
845
- const he = async function(t) {
846
- const e = this.getOffsetParent || $t, o = this.getDimensions, n = await o(t.floating);
853
+ const we = async function(t) {
854
+ const e = this.getOffsetParent || Ht, o = this.getDimensions, n = await o(t.floating);
847
855
  return {
848
- reference: ge(t.reference, await e(t.floating), t.strategy),
856
+ reference: he(t.reference, await e(t.floating), t.strategy),
849
857
  floating: {
850
858
  x: 0,
851
859
  y: 0,
@@ -854,36 +862,36 @@ const he = async function(t) {
854
862
  }
855
863
  };
856
864
  };
857
- function we(t) {
858
- return O(t).direction === "rtl";
859
- }
860
- const xe = {
861
- convertOffsetParentRelativeRectToViewportRelativeRect: ce,
862
- getDocumentElement: B,
863
- getClippingRect: me,
864
- getOffsetParent: $t,
865
- getElementRects: he,
866
- getClientRects: le,
867
- getDimensions: pe,
868
- getScale: X,
869
- isElement: T,
870
- isRTL: we
871
- }, ye = ee, be = ne, ve = Zt, Ae = Qt, Ce = (t, e, o) => {
865
+ function xe(t) {
866
+ return L(t).direction === "rtl";
867
+ }
868
+ const ye = {
869
+ convertOffsetParentRelativeRectToViewportRelativeRect: le,
870
+ getDocumentElement: F,
871
+ getClippingRect: pe,
872
+ getOffsetParent: Ht,
873
+ getElementRects: we,
874
+ getClientRects: ae,
875
+ getDimensions: ge,
876
+ getScale: U,
877
+ isElement: R,
878
+ isRTL: xe
879
+ }, be = ne, ve = oe, Ae = te, Ce = Zt, Te = (t, e, o) => {
872
880
  const n = /* @__PURE__ */ new Map(), i = {
873
- platform: xe,
881
+ platform: ye,
874
882
  ...o
875
883
  }, s = {
876
884
  ...i.platform,
877
885
  _c: n
878
886
  };
879
- return Jt(t, e, {
887
+ return Qt(t, e, {
880
888
  ...i,
881
889
  platform: s
882
890
  });
883
- }, Rt = ["mousedown", "touchstart"];
884
- function Te(t, e, o) {
885
- const n = G(null);
886
- return pt(() => {
891
+ }, Lt = ["mousedown", "touchstart"];
892
+ function Oe(t, e, o) {
893
+ const n = J(null);
894
+ return gt(() => {
887
895
  const i = (s) => {
888
896
  const r = s ? s.target : void 0;
889
897
  if (Array.isArray(o)) {
@@ -893,59 +901,59 @@ function Te(t, e, o) {
893
901
  ) && !c && t();
894
902
  } else n.current && !n.current.contains(r) && t();
895
903
  };
896
- return Rt.forEach(
904
+ return Lt.forEach(
897
905
  (s) => document.addEventListener(s, i)
898
906
  ), () => {
899
- Rt.forEach(
907
+ Lt.forEach(
900
908
  (s) => document.removeEventListener(s, i)
901
909
  );
902
910
  };
903
911
  }, [t, o, e]), n;
904
912
  }
905
- function Oe(t, e) {
906
- const [o, n] = ft(!1), i = G(null), s = G(null), r = ut(() => {
913
+ function Re(t, e) {
914
+ const [o, n] = ut(!1), i = J(null), s = J(null), r = dt(() => {
907
915
  n((l) => (!l && (!i.current || i.current === -1) && (i.current = window.setInterval(s.current, e)), !0));
908
- }, [e]), c = ut(() => {
916
+ }, [e]), c = dt(() => {
909
917
  n(!1), window.clearInterval(i.current || -1), i.current = -1;
910
918
  }, []);
911
- return pt(() => (s.current = t, o && r(), c), [t, o, r, c]), { start: r, stop: c, active: o };
919
+ return gt(() => (s.current = t, o && r(), c), [t, o, r, c]), { start: r, stop: c, active: o };
912
920
  }
913
- const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Re = () => _("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), Et = ({
921
+ const ot = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Le = () => Y("absolute top-0 left-0 w-max py-1 px-2 rounded-sm text-sm z-50"), Et = ({
914
922
  mode: t
915
- }) => _({
923
+ }) => Y({
916
924
  "bg-surface-darker": t === "dark" || t === "system",
917
925
  "bg-surface-light": t === "light" || t === "alt-system",
918
926
  "dark:bg-surface-light": t === "system",
919
927
  "dark:bg-surface-darker": t === "alt-system"
920
928
  }), Ee = ({
921
929
  mode: t
922
- }) => _({
930
+ }) => Y({
923
931
  "text-copy-light": t === "dark" || t === "system",
924
932
  "text-copy-dark": t === "light" || t === "alt-system",
925
933
  "dark:text-copy-dark": t === "system",
926
934
  "dark:text-copy-light": t === "alt-system"
927
- }), Le = () => _("absolute", "size-2", "transform rotate-45"), ke = ({
935
+ }), ke = () => Y("absolute", "size-2", "transform rotate-45"), Se = ({
928
936
  mode: t,
929
937
  className: e,
930
938
  tooltipClassName: o,
931
939
  arrowClassName: n
932
940
  }) => {
933
- const i = _("relative inline-block", e), s = _(
934
- _t,
935
- Re(),
941
+ const i = Y("relative inline-block", e), s = Y(
942
+ jt,
943
+ Le(),
936
944
  Et({ mode: t }),
937
945
  Ee({ mode: t }),
938
946
  o
939
- ), r = _(
940
- jt,
941
- Le(),
947
+ ), r = Y(
948
+ Yt,
949
+ ke(),
942
950
  Et({ mode: t }),
943
951
  n
944
952
  );
945
953
  return { tooltip: s, arrow: r, wrapper: i };
946
- }, Se = ({ delay: t = 300 }) => ({
954
+ }, Pe = ({ delay: t = 300 }) => ({
947
955
  animation: `av-tooltip-fade-in ${t}ms ease-in-out`
948
- }), Pe = 5e3, Be = ({
956
+ }), De = 5e3, Fe = ({
949
957
  trigger: t,
950
958
  label: e,
951
959
  placement: o = "top",
@@ -955,76 +963,76 @@ const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Re = (
955
963
  tooltipClassName: r,
956
964
  arrowClassName: c
957
965
  }) => {
958
- const l = Te(() => {
966
+ const l = Oe(() => {
959
967
  g.stop(), m(!1);
960
- }), a = G(null), d = G(null), [f, p] = ft(!1), [u, m] = ft(!1), g = Oe(() => {
968
+ }), a = J(null), d = J(null), [f, p] = ut(!1), [u, m] = ut(!1), g = Re(() => {
961
969
  m(!1);
962
- }, Pe), h = ke({
970
+ }, De), h = Se({
963
971
  mode: n,
964
972
  className: s,
965
973
  tooltipClassName: r,
966
974
  arrowClassName: c
967
- }), w = Se({ delay: i }), x = ut(async () => {
968
- var N, R, F, E;
975
+ }), w = Pe({ delay: i }), x = dt(async () => {
976
+ var M, E, V, k;
969
977
  if (l.current && a.current && d.current) {
970
978
  const {
971
- x: L,
972
- y: H,
973
- middlewareData: k,
974
- placement: I
975
- } = await Ce(l.current, a.current, {
979
+ x: T,
980
+ y: I,
981
+ middlewareData: S,
982
+ placement: _
983
+ } = await Te(l.current, a.current, {
976
984
  placement: o,
977
985
  middleware: [
978
- ye(10),
979
- ve({
986
+ be(10),
987
+ Ae({
980
988
  crossAxis: o.includes("-"),
981
989
  fallbackAxisSideDirection: "start"
982
990
  }),
983
- be({ padding: 5 }),
984
- Ae({ element: d.current })
991
+ ve({ padding: 5 }),
992
+ Ce({ element: d.current })
985
993
  ]
986
994
  });
987
- (N = a == null ? void 0 : a.current) != null && N.style && Object.assign(a.current.style, {
988
- left: nt(L),
989
- top: nt(H),
995
+ (M = a == null ? void 0 : a.current) != null && M.style && Object.assign(a.current.style, {
996
+ left: ot(T),
997
+ top: ot(I),
990
998
  ...w
991
999
  });
992
- const v = {
1000
+ const C = {
993
1001
  top: "bottom",
994
1002
  right: "left",
995
1003
  bottom: "top",
996
1004
  left: "right"
997
- }[I.split("-")[0]];
998
- (R = d == null ? void 0 : d.current) != null && R.style && Object.assign(d.current.style, {
999
- left: nt((F = k.arrow) == null ? void 0 : F.x),
1000
- top: nt((E = k.arrow) == null ? void 0 : E.y),
1005
+ }[_.split("-")[0]];
1006
+ (E = d == null ? void 0 : d.current) != null && E.style && Object.assign(d.current.style, {
1007
+ left: ot((V = S.arrow) == null ? void 0 : V.x),
1008
+ top: ot((k = S.arrow) == null ? void 0 : k.y),
1001
1009
  right: "",
1002
1010
  bottom: "",
1003
- [v]: "-4px"
1011
+ [C]: "-4px"
1004
1012
  });
1005
1013
  }
1006
1014
  }, [o, w, l]);
1007
- pt(() => {
1015
+ gt(() => {
1008
1016
  (async () => f && await x())();
1009
1017
  }, [x, f]);
1010
1018
  const y = () => {
1011
1019
  p(!1), m(!0), g.start();
1012
- }, A = () => {
1020
+ }, v = () => {
1013
1021
  u || p(!0);
1014
1022
  }, b = () => {
1015
1023
  u || p(!1);
1016
1024
  };
1017
- return /* @__PURE__ */ bt(
1025
+ return /* @__PURE__ */ vt(
1018
1026
  "div",
1019
1027
  {
1020
1028
  className: h.wrapper,
1021
1029
  ref: l,
1022
- onMouseEnter: A,
1030
+ onMouseEnter: v,
1023
1031
  onMouseLeave: b,
1024
1032
  onClick: y,
1025
1033
  children: [
1026
1034
  t,
1027
- f && /* @__PURE__ */ bt(
1035
+ f && /* @__PURE__ */ vt(
1028
1036
  "div",
1029
1037
  {
1030
1038
  role: "tooltip",
@@ -1032,7 +1040,7 @@ const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Re = (
1032
1040
  className: h.tooltip,
1033
1041
  children: [
1034
1042
  e,
1035
- /* @__PURE__ */ It("div", { ref: d, className: h.arrow })
1043
+ /* @__PURE__ */ _t("div", { ref: d, className: h.arrow })
1036
1044
  ]
1037
1045
  }
1038
1046
  )
@@ -1041,7 +1049,7 @@ const nt = (t, e = "px") => typeof t > "u" ? "" : `${Math.round(t)}${e}`, Re = (
1041
1049
  );
1042
1050
  };
1043
1051
  export {
1044
- jt as TOOLTIP_ARROW_CLASSNAME,
1045
- _t as TOOLTIP_CLASSNAME,
1046
- Be as Tooltip
1052
+ Yt as TOOLTIP_ARROW_CLASSNAME,
1053
+ jt as TOOLTIP_CLASSNAME,
1054
+ Fe as Tooltip
1047
1055
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { TOOLTIP_ARROW_CLASSNAME as T, TOOLTIP_CLASSNAME as I, Tooltip as e } from "./components/Tooltip/Tooltip.js";
2
2
  /*!
3
- @versini/ui-tooltip v2.0.2
3
+ @versini/ui-tooltip v2.0.3
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_TOOLTIP__ || (window.__VERSINI_UI_TOOLTIP__ = {
8
- version: "2.0.2",
9
- buildTime: "04/12/2025 09:18 AM EDT",
8
+ version: "2.0.3",
9
+ buildTime: "05/26/2025 03:48 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-tooltip",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -39,17 +39,17 @@
39
39
  "react-dom": "^18.3.1 || ^19.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@versini/ui-types": "5.0.2"
42
+ "@versini/ui-types": "5.0.3"
43
43
  },
44
44
  "dependencies": {
45
- "@floating-ui/dom": "1.6.13",
45
+ "@floating-ui/dom": "1.7.0",
46
46
  "@tailwindcss/typography": "0.5.16",
47
47
  "@versini/ui-hooks": "4.7.3",
48
48
  "clsx": "2.1.1",
49
- "tailwindcss": "4.1.3"
49
+ "tailwindcss": "4.1.7"
50
50
  },
51
51
  "sideEffects": [
52
52
  "**/*.css"
53
53
  ],
54
- "gitHead": "1bc09c4f0904bd8c01a22b1a32299fdd7598ae32"
54
+ "gitHead": "863a399128080a19f2668e458d495110aa0f68f8"
55
55
  }