wj-elements 0.1.55 → 0.1.56

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,32 +1,32 @@
1
- var Ot = Object.defineProperty;
2
- var Lt = (t, e, n) => e in t ? Ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var st = (t, e, n) => (Lt(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import Tt, { event as U } from "./wje-element.js";
5
- const N = Math.min, R = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
1
+ var Lt = Object.defineProperty;
2
+ var Ot = (t, e, n) => e in t ? Lt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var st = (t, e, n) => (Ot(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import Tt, { event as G } from "./wje-element.js";
5
+ const F = Math.min, C = Math.max, Z = Math.round, Q = Math.floor, B = (t) => ({
6
6
  x: t,
7
7
  y: t
8
- }), Pt = {
8
+ }), St = {
9
9
  left: "right",
10
10
  right: "left",
11
11
  bottom: "top",
12
12
  top: "bottom"
13
- }, St = {
13
+ }, Pt = {
14
14
  start: "end",
15
15
  end: "start"
16
16
  };
17
- function kt(t, e, n) {
18
- return R(t, N(e, n));
17
+ function Dt(t, e, n) {
18
+ return C(t, F(e, n));
19
19
  }
20
- function K(t, e) {
20
+ function J(t, e) {
21
21
  return typeof t == "function" ? t(e) : t;
22
22
  }
23
23
  function j(t) {
24
24
  return t.split("-")[0];
25
25
  }
26
- function I(t) {
26
+ function $(t) {
27
27
  return t.split("-")[1];
28
28
  }
29
- function Dt(t) {
29
+ function kt(t) {
30
30
  return t === "x" ? "y" : "x";
31
31
  }
32
32
  function ct(t) {
@@ -36,12 +36,12 @@ function nt(t) {
36
36
  return ["top", "bottom"].includes(j(t)) ? "y" : "x";
37
37
  }
38
38
  function lt(t) {
39
- return Dt(nt(t));
39
+ return kt(nt(t));
40
40
  }
41
41
  function Ht(t, e, n) {
42
42
  n === void 0 && (n = !1);
43
- const o = I(t), i = lt(t), s = ct(i);
44
- let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
43
+ const i = $(t), o = lt(t), s = ct(o);
44
+ let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
45
45
  return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
46
46
  }
47
47
  function Wt(t) {
@@ -49,14 +49,14 @@ function Wt(t) {
49
49
  return [rt(t), e, rt(e)];
50
50
  }
51
51
  function rt(t) {
52
- return t.replace(/start|end/g, (e) => St[e]);
52
+ return t.replace(/start|end/g, (e) => Pt[e]);
53
53
  }
54
54
  function Mt(t, e, n) {
55
- const o = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
55
+ const i = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
56
56
  switch (t) {
57
57
  case "top":
58
58
  case "bottom":
59
- return n ? e ? i : o : e ? o : i;
59
+ return n ? e ? o : i : e ? i : o;
60
60
  case "left":
61
61
  case "right":
62
62
  return e ? s : r;
@@ -64,15 +64,15 @@ function Mt(t, e, n) {
64
64
  return [];
65
65
  }
66
66
  }
67
- function Ft(t, e, n, o) {
68
- const i = I(t);
69
- let s = Mt(j(t), n === "start", o);
70
- return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(rt)))), s;
67
+ function Nt(t, e, n, i) {
68
+ const o = $(t);
69
+ let s = Mt(j(t), n === "start", i);
70
+ return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(rt)))), s;
71
71
  }
72
72
  function tt(t) {
73
- return t.replace(/left|right|bottom|top/g, (e) => Pt[e]);
73
+ return t.replace(/left|right|bottom|top/g, (e) => St[e]);
74
74
  }
75
- function Nt(t) {
75
+ function Ft(t) {
76
76
  return {
77
77
  top: 0,
78
78
  right: 0,
@@ -82,7 +82,7 @@ function Nt(t) {
82
82
  };
83
83
  }
84
84
  function gt(t) {
85
- return typeof t != "number" ? Nt(t) : {
85
+ return typeof t != "number" ? Ft(t) : {
86
86
  top: t,
87
87
  right: t,
88
88
  bottom: t,
@@ -100,43 +100,43 @@ function et(t) {
100
100
  }
101
101
  function ht(t, e, n) {
102
102
  let {
103
- reference: o,
104
- floating: i
103
+ reference: i,
104
+ floating: o
105
105
  } = t;
106
- const s = nt(e), r = lt(e), l = ct(r), c = j(e), a = s === "y", d = o.x + o.width / 2 - i.width / 2, h = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
106
+ const s = nt(e), r = lt(e), l = ct(r), c = j(e), a = s === "y", d = i.x + i.width / 2 - o.width / 2, h = i.y + i.height / 2 - o.height / 2, p = i[l] / 2 - o[l] / 2;
107
107
  let f;
108
108
  switch (c) {
109
109
  case "top":
110
110
  f = {
111
111
  x: d,
112
- y: o.y - i.height
112
+ y: i.y - o.height
113
113
  };
114
114
  break;
115
115
  case "bottom":
116
116
  f = {
117
117
  x: d,
118
- y: o.y + o.height
118
+ y: i.y + i.height
119
119
  };
120
120
  break;
121
121
  case "right":
122
122
  f = {
123
- x: o.x + o.width,
123
+ x: i.x + i.width,
124
124
  y: h
125
125
  };
126
126
  break;
127
127
  case "left":
128
128
  f = {
129
- x: o.x - i.width,
129
+ x: i.x - o.width,
130
130
  y: h
131
131
  };
132
132
  break;
133
133
  default:
134
134
  f = {
135
- x: o.x,
136
- y: o.y
135
+ x: i.x,
136
+ y: i.y
137
137
  };
138
138
  }
139
- switch (I(e)) {
139
+ switch ($(e)) {
140
140
  case "start":
141
141
  f[r] -= p * (n && a ? -1 : 1);
142
142
  break;
@@ -148,34 +148,34 @@ function ht(t, e, n) {
148
148
  }
149
149
  const Bt = async (t, e, n) => {
150
150
  const {
151
- placement: o = "bottom",
152
- strategy: i = "absolute",
151
+ placement: i = "bottom",
152
+ strategy: o = "absolute",
153
153
  middleware: s = [],
154
154
  platform: r
155
155
  } = n, l = s.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
156
156
  let a = await r.getElementRects({
157
157
  reference: t,
158
158
  floating: e,
159
- strategy: i
159
+ strategy: o
160
160
  }), {
161
161
  x: d,
162
162
  y: h
163
- } = ht(a, o, c), p = o, f = {}, u = 0;
163
+ } = ht(a, i, c), p = i, f = {}, u = 0;
164
164
  for (let m = 0; m < l.length; m++) {
165
165
  const {
166
166
  name: w,
167
167
  fn: g
168
168
  } = l[m], {
169
169
  x,
170
- y: b,
170
+ y,
171
171
  data: A,
172
172
  reset: v
173
173
  } = await g({
174
174
  x: d,
175
175
  y: h,
176
- initialPlacement: o,
176
+ initialPlacement: i,
177
177
  placement: p,
178
- strategy: i,
178
+ strategy: o,
179
179
  middlewareData: f,
180
180
  rects: a,
181
181
  platform: r,
@@ -184,7 +184,7 @@ const Bt = async (t, e, n) => {
184
184
  floating: e
185
185
  }
186
186
  });
187
- if (d = x ?? d, h = b ?? h, f = {
187
+ if (d = x ?? d, h = y ?? h, f = {
188
188
  ...f,
189
189
  [w]: {
190
190
  ...f[w],
@@ -194,7 +194,7 @@ const Bt = async (t, e, n) => {
194
194
  u++, typeof v == "object" && (v.placement && (p = v.placement), v.rects && (a = v.rects === !0 ? await r.getElementRects({
195
195
  reference: t,
196
196
  floating: e,
197
- strategy: i
197
+ strategy: o
198
198
  }) : v.rects), {
199
199
  x: d,
200
200
  y: h
@@ -206,7 +206,7 @@ const Bt = async (t, e, n) => {
206
206
  x: d,
207
207
  y: h,
208
208
  placement: p,
209
- strategy: i,
209
+ strategy: o,
210
210
  middlewareData: f
211
211
  };
212
212
  };
@@ -214,8 +214,8 @@ async function wt(t, e) {
214
214
  var n;
215
215
  e === void 0 && (e = {});
216
216
  const {
217
- x: o,
218
- y: i,
217
+ x: i,
218
+ y: o,
219
219
  platform: s,
220
220
  rects: r,
221
221
  elements: l,
@@ -226,16 +226,16 @@ async function wt(t, e) {
226
226
  elementContext: h = "floating",
227
227
  altBoundary: p = !1,
228
228
  padding: f = 0
229
- } = K(e, t), u = gt(f), w = l[p ? h === "floating" ? "reference" : "floating" : h], g = et(await s.getClippingRect({
229
+ } = J(e, t), u = gt(f), w = l[p ? h === "floating" ? "reference" : "floating" : h], g = et(await s.getClippingRect({
230
230
  element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
231
231
  boundary: a,
232
232
  rootBoundary: d,
233
233
  strategy: c
234
234
  })), x = h === "floating" ? {
235
235
  ...r.floating,
236
- x: o,
237
- y: i
238
- } : r.reference, b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), A = await (s.isElement == null ? void 0 : s.isElement(b)) ? await (s.getScale == null ? void 0 : s.getScale(b)) || {
236
+ x: i,
237
+ y: o
238
+ } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), A = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
239
239
  x: 1,
240
240
  y: 1
241
241
  } : {
@@ -243,7 +243,7 @@ async function wt(t, e) {
243
243
  y: 1
244
244
  }, v = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
245
245
  rect: x,
246
- offsetParent: b,
246
+ offsetParent: y,
247
247
  strategy: c
248
248
  }) : x);
249
249
  return {
@@ -259,8 +259,8 @@ const Vt = (t) => ({
259
259
  async fn(e) {
260
260
  const {
261
261
  x: n,
262
- y: o,
263
- placement: i,
262
+ y: i,
263
+ placement: o,
264
264
  rects: s,
265
265
  platform: r,
266
266
  elements: l,
@@ -268,26 +268,26 @@ const Vt = (t) => ({
268
268
  } = e, {
269
269
  element: a,
270
270
  padding: d = 0
271
- } = K(t, e) || {};
271
+ } = J(t, e) || {};
272
272
  if (a == null)
273
273
  return {};
274
274
  const h = gt(d), p = {
275
275
  x: n,
276
- y: o
277
- }, f = lt(i), u = ct(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", b = w ? "clientHeight" : "clientWidth", A = s.reference[u] + s.reference[f] - p[f] - s.floating[u], v = p[f] - s.reference[f], y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
278
- let E = y ? y[b] : 0;
279
- (!E || !await (r.isElement == null ? void 0 : r.isElement(y))) && (E = l.floating[b] || s.floating[u]);
280
- const P = A / 2 - v / 2, F = E / 2 - m[u] / 2 - 1, Y = N(h[g], F), X = N(h[x], F), L = Y, q = E - m[u] - X, C = E / 2 - m[u] / 2 + P, S = kt(L, C, q), k = !c.arrow && I(i) != null && C != S && s.reference[u] / 2 - (C < L ? Y : X) - m[u] / 2 < 0, H = k ? C < L ? C - L : C - q : 0;
276
+ y: i
277
+ }, f = lt(o), u = ct(f), m = await r.getDimensions(a), w = f === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", A = s.reference[u] + s.reference[f] - p[f] - s.floating[u], v = p[f] - s.reference[f], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
278
+ let E = b ? b[y] : 0;
279
+ (!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = l.floating[y] || s.floating[u]);
280
+ const S = A / 2 - v / 2, N = E / 2 - m[u] / 2 - 1, Y = F(h[g], N), X = F(h[x], N), O = Y, q = E - m[u] - X, R = E / 2 - m[u] / 2 + S, P = Dt(O, R, q), D = !c.arrow && $(o) != null && R != P && s.reference[u] / 2 - (R < O ? Y : X) - m[u] / 2 < 0, H = D ? R < O ? R - O : R - q : 0;
281
281
  return {
282
282
  [f]: p[f] + H,
283
283
  data: {
284
- [f]: S,
285
- centerOffset: C - S - H,
286
- ...k && {
284
+ [f]: P,
285
+ centerOffset: R - P - H,
286
+ ...D && {
287
287
  alignmentOffset: H
288
288
  }
289
289
  },
290
- reset: k
290
+ reset: D
291
291
  };
292
292
  }
293
293
  }), jt = function(t) {
@@ -295,9 +295,9 @@ const Vt = (t) => ({
295
295
  name: "flip",
296
296
  options: t,
297
297
  async fn(e) {
298
- var n, o;
298
+ var n, i;
299
299
  const {
300
- placement: i,
300
+ placement: o,
301
301
  middlewareData: s,
302
302
  rects: r,
303
303
  initialPlacement: l,
@@ -311,50 +311,50 @@ const Vt = (t) => ({
311
311
  fallbackAxisSideDirection: u = "none",
312
312
  flipAlignment: m = !0,
313
313
  ...w
314
- } = K(t, e);
314
+ } = J(t, e);
315
315
  if ((n = s.arrow) != null && n.alignmentOffset)
316
316
  return {};
317
- const g = j(i), x = j(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (x || !m ? [tt(l)] : Wt(l));
318
- !p && u !== "none" && A.push(...Ft(l, m, u, b));
319
- const v = [l, ...A], y = await wt(e, w), E = [];
320
- let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
321
- if (d && E.push(y[g]), h) {
322
- const L = Ht(i, r, b);
323
- E.push(y[L[0]], y[L[1]]);
317
+ const g = j(o), x = j(l) === l, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), A = p || (x || !m ? [tt(l)] : Wt(l));
318
+ !p && u !== "none" && A.push(...Nt(l, m, u, y));
319
+ const v = [l, ...A], b = await wt(e, w), E = [];
320
+ let S = ((i = s.flip) == null ? void 0 : i.overflows) || [];
321
+ if (d && E.push(b[g]), h) {
322
+ const O = Ht(o, r, y);
323
+ E.push(b[O[0]], b[O[1]]);
324
324
  }
325
- if (P = [...P, {
326
- placement: i,
325
+ if (S = [...S, {
326
+ placement: o,
327
327
  overflows: E
328
- }], !E.every((L) => L <= 0)) {
329
- var F, Y;
330
- const L = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, q = v[L];
328
+ }], !E.every((O) => O <= 0)) {
329
+ var N, Y;
330
+ const O = (((N = s.flip) == null ? void 0 : N.index) || 0) + 1, q = v[O];
331
331
  if (q)
332
332
  return {
333
333
  data: {
334
- index: L,
335
- overflows: P
334
+ index: O,
335
+ overflows: S
336
336
  },
337
337
  reset: {
338
338
  placement: q
339
339
  }
340
340
  };
341
- let C = (Y = P.filter((S) => S.overflows[0] <= 0).sort((S, k) => S.overflows[1] - k.overflows[1])[0]) == null ? void 0 : Y.placement;
342
- if (!C)
341
+ let R = (Y = S.filter((P) => P.overflows[0] <= 0).sort((P, D) => P.overflows[1] - D.overflows[1])[0]) == null ? void 0 : Y.placement;
342
+ if (!R)
343
343
  switch (f) {
344
344
  case "bestFit": {
345
345
  var X;
346
- const S = (X = P.map((k) => [k.placement, k.overflows.filter((H) => H > 0).reduce((H, Rt) => H + Rt, 0)]).sort((k, H) => k[1] - H[1])[0]) == null ? void 0 : X[0];
347
- S && (C = S);
346
+ const P = (X = S.map((D) => [D.placement, D.overflows.filter((H) => H > 0).reduce((H, Ct) => H + Ct, 0)]).sort((D, H) => D[1] - H[1])[0]) == null ? void 0 : X[0];
347
+ P && (R = P);
348
348
  break;
349
349
  }
350
350
  case "initialPlacement":
351
- C = l;
351
+ R = l;
352
352
  break;
353
353
  }
354
- if (i !== C)
354
+ if (o !== R)
355
355
  return {
356
356
  reset: {
357
- placement: C
357
+ placement: R
358
358
  }
359
359
  };
360
360
  }
@@ -362,12 +362,12 @@ const Vt = (t) => ({
362
362
  }
363
363
  };
364
364
  };
365
- async function zt(t, e) {
365
+ async function _t(t, e) {
366
366
  const {
367
367
  placement: n,
368
- platform: o,
369
- elements: i
370
- } = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = j(n), l = I(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, h = K(e, t);
368
+ platform: i,
369
+ elements: o
370
+ } = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = j(n), l = $(n), c = nt(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, h = J(e, t);
371
371
  let {
372
372
  mainAxis: p,
373
373
  crossAxis: f,
@@ -390,61 +390,61 @@ async function zt(t, e) {
390
390
  y: f * d
391
391
  };
392
392
  }
393
- const $t = function(t) {
393
+ const It = function(t) {
394
394
  return t === void 0 && (t = 0), {
395
395
  name: "offset",
396
396
  options: t,
397
397
  async fn(e) {
398
398
  const {
399
399
  x: n,
400
- y: o
401
- } = e, i = await zt(e, t);
400
+ y: i
401
+ } = e, o = await _t(e, t);
402
402
  return {
403
- x: n + i.x,
404
- y: o + i.y,
405
- data: i
403
+ x: n + o.x,
404
+ y: i + o.y,
405
+ data: o
406
406
  };
407
407
  }
408
408
  };
409
- }, _t = function(t) {
409
+ }, zt = function(t) {
410
410
  return t === void 0 && (t = {}), {
411
411
  name: "size",
412
412
  options: t,
413
413
  async fn(e) {
414
414
  const {
415
415
  placement: n,
416
- rects: o,
417
- platform: i,
416
+ rects: i,
417
+ platform: o,
418
418
  elements: s
419
419
  } = e, {
420
420
  apply: r = () => {
421
421
  },
422
422
  ...l
423
- } = K(t, e), c = await wt(e, l), a = j(n), d = I(n), h = nt(n) === "y", {
423
+ } = J(t, e), c = await wt(e, l), a = j(n), d = $(n), h = nt(n) === "y", {
424
424
  width: p,
425
425
  height: f
426
- } = o.floating;
426
+ } = i.floating;
427
427
  let u, m;
428
- a === "top" || a === "bottom" ? (u = a, m = d === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, u = d === "end" ? "top" : "bottom");
428
+ a === "top" || a === "bottom" ? (u = a, m = d === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (m = a, u = d === "end" ? "top" : "bottom");
429
429
  const w = f - c[u], g = p - c[m], x = !e.middlewareData.shift;
430
- let b = w, A = g;
430
+ let y = w, A = g;
431
431
  if (h) {
432
- const y = p - c.left - c.right;
433
- A = d || x ? N(g, y) : y;
432
+ const b = p - c.left - c.right;
433
+ A = d || x ? F(g, b) : b;
434
434
  } else {
435
- const y = f - c.top - c.bottom;
436
- b = d || x ? N(w, y) : y;
435
+ const b = f - c.top - c.bottom;
436
+ y = d || x ? F(w, b) : b;
437
437
  }
438
438
  if (x && !d) {
439
- const y = R(c.left, 0), E = R(c.right, 0), P = R(c.top, 0), F = R(c.bottom, 0);
440
- h ? A = p - 2 * (y !== 0 || E !== 0 ? y + E : R(c.left, c.right)) : b = f - 2 * (P !== 0 || F !== 0 ? P + F : R(c.top, c.bottom));
439
+ const b = C(c.left, 0), E = C(c.right, 0), S = C(c.top, 0), N = C(c.bottom, 0);
440
+ h ? A = p - 2 * (b !== 0 || E !== 0 ? b + E : C(c.left, c.right)) : y = f - 2 * (S !== 0 || N !== 0 ? S + N : C(c.top, c.bottom));
441
441
  }
442
442
  await r({
443
443
  ...e,
444
444
  availableWidth: A,
445
- availableHeight: b
445
+ availableHeight: y
446
446
  });
447
- const v = await i.getDimensions(s.floating);
447
+ const v = await o.getDimensions(s.floating);
448
448
  return p !== v.width || f !== v.height ? {
449
449
  reset: {
450
450
  rects: !0
@@ -456,7 +456,7 @@ const $t = function(t) {
456
456
  function V(t) {
457
457
  return vt(t) ? (t.nodeName || "").toLowerCase() : "#document";
458
458
  }
459
- function O(t) {
459
+ function L(t) {
460
460
  var e;
461
461
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
462
462
  }
@@ -465,52 +465,52 @@ function M(t) {
465
465
  return (e = (vt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
466
466
  }
467
467
  function vt(t) {
468
- return t instanceof Node || t instanceof O(t).Node;
468
+ return t instanceof Node || t instanceof L(t).Node;
469
469
  }
470
470
  function W(t) {
471
- return t instanceof Element || t instanceof O(t).Element;
471
+ return t instanceof Element || t instanceof L(t).Element;
472
472
  }
473
- function D(t) {
474
- return t instanceof HTMLElement || t instanceof O(t).HTMLElement;
473
+ function k(t) {
474
+ return t instanceof HTMLElement || t instanceof L(t).HTMLElement;
475
475
  }
476
476
  function dt(t) {
477
- return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof O(t).ShadowRoot;
477
+ return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof L(t).ShadowRoot;
478
478
  }
479
- function G(t) {
479
+ function K(t) {
480
480
  const {
481
481
  overflow: e,
482
482
  overflowX: n,
483
- overflowY: o,
484
- display: i
483
+ overflowY: i,
484
+ display: o
485
485
  } = T(t);
486
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
486
+ return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !["inline", "contents"].includes(o);
487
487
  }
488
- function It(t) {
488
+ function $t(t) {
489
489
  return ["table", "td", "th"].includes(V(t));
490
490
  }
491
491
  function at(t) {
492
492
  const e = ft(), n = T(t);
493
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
493
+ return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
494
494
  }
495
495
  function Yt(t) {
496
- let e = _(t);
497
- for (; D(e) && !ot(e); ) {
496
+ let e = z(t);
497
+ for (; k(e) && !it(e); ) {
498
498
  if (at(e))
499
499
  return e;
500
- e = _(e);
500
+ e = z(e);
501
501
  }
502
502
  return null;
503
503
  }
504
504
  function ft() {
505
505
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
506
506
  }
507
- function ot(t) {
507
+ function it(t) {
508
508
  return ["html", "body", "#document"].includes(V(t));
509
509
  }
510
510
  function T(t) {
511
- return O(t).getComputedStyle(t);
511
+ return L(t).getComputedStyle(t);
512
512
  }
513
- function it(t) {
513
+ function ot(t) {
514
514
  return W(t) ? {
515
515
  scrollLeft: t.scrollLeft,
516
516
  scrollTop: t.scrollTop
@@ -519,7 +519,7 @@ function it(t) {
519
519
  scrollTop: t.pageYOffset
520
520
  };
521
521
  }
522
- function _(t) {
522
+ function z(t) {
523
523
  if (V(t) === "html")
524
524
  return t;
525
525
  const e = (
@@ -532,67 +532,67 @@ function _(t) {
532
532
  return dt(e) ? e.host : e;
533
533
  }
534
534
  function xt(t) {
535
- const e = _(t);
536
- return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : D(e) && G(e) ? e : xt(e);
535
+ const e = z(t);
536
+ return it(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && K(e) ? e : xt(e);
537
537
  }
538
- function J(t, e, n) {
539
- var o;
538
+ function U(t, e, n) {
539
+ var i;
540
540
  e === void 0 && (e = []), n === void 0 && (n = !0);
541
- const i = xt(t), s = i === ((o = t.ownerDocument) == null ? void 0 : o.body), r = O(i);
542
- return s ? e.concat(r, r.visualViewport || [], G(i) ? i : [], r.frameElement && n ? J(r.frameElement) : []) : e.concat(i, J(i, [], n));
541
+ const o = xt(t), s = o === ((i = t.ownerDocument) == null ? void 0 : i.body), r = L(o);
542
+ return s ? e.concat(r, r.visualViewport || [], K(o) ? o : [], r.frameElement && n ? U(r.frameElement) : []) : e.concat(o, U(o, [], n));
543
543
  }
544
- function bt(t) {
544
+ function yt(t) {
545
545
  const e = T(t);
546
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
547
- const i = D(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, l = Z(n) !== s || Z(o) !== r;
548
- return l && (n = s, o = r), {
546
+ let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
547
+ const o = k(t), s = o ? t.offsetWidth : n, r = o ? t.offsetHeight : i, l = Z(n) !== s || Z(i) !== r;
548
+ return l && (n = s, i = r), {
549
549
  width: n,
550
- height: o,
550
+ height: i,
551
551
  $: l
552
552
  };
553
553
  }
554
554
  function ut(t) {
555
555
  return W(t) ? t : t.contextElement;
556
556
  }
557
- function $(t) {
557
+ function I(t) {
558
558
  const e = ut(t);
559
- if (!D(e))
559
+ if (!k(e))
560
560
  return B(1);
561
561
  const n = e.getBoundingClientRect(), {
562
- width: o,
563
- height: i,
562
+ width: i,
563
+ height: o,
564
564
  $: s
565
- } = bt(e);
566
- let r = (s ? Z(n.width) : n.width) / o, l = (s ? Z(n.height) : n.height) / i;
565
+ } = yt(e);
566
+ let r = (s ? Z(n.width) : n.width) / i, l = (s ? Z(n.height) : n.height) / o;
567
567
  return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
568
568
  x: r,
569
569
  y: l
570
570
  };
571
571
  }
572
572
  const Xt = /* @__PURE__ */ B(0);
573
- function yt(t) {
574
- const e = O(t);
573
+ function bt(t) {
574
+ const e = L(t);
575
575
  return !ft() || !e.visualViewport ? Xt : {
576
576
  x: e.visualViewport.offsetLeft,
577
577
  y: e.visualViewport.offsetTop
578
578
  };
579
579
  }
580
580
  function qt(t, e, n) {
581
- return e === void 0 && (e = !1), !n || e && n !== O(t) ? !1 : e;
581
+ return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
582
582
  }
583
- function z(t, e, n, o) {
583
+ function _(t, e, n, i) {
584
584
  e === void 0 && (e = !1), n === void 0 && (n = !1);
585
- const i = t.getBoundingClientRect(), s = ut(t);
585
+ const o = t.getBoundingClientRect(), s = ut(t);
586
586
  let r = B(1);
587
- e && (o ? W(o) && (r = $(o)) : r = $(t));
588
- const l = qt(s, n, o) ? yt(s) : B(0);
589
- let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, h = i.height / r.y;
587
+ e && (i ? W(i) && (r = I(i)) : r = I(t));
588
+ const l = qt(s, n, i) ? bt(s) : B(0);
589
+ let c = (o.left + l.x) / r.x, a = (o.top + l.y) / r.y, d = o.width / r.x, h = o.height / r.y;
590
590
  if (s) {
591
- const p = O(s), f = o && W(o) ? O(o) : o;
591
+ const p = L(s), f = i && W(i) ? L(i) : i;
592
592
  let u = p.frameElement;
593
- for (; u && o && f !== p; ) {
594
- const m = $(u), w = u.getBoundingClientRect(), g = T(u), x = w.left + (u.clientLeft + parseFloat(g.paddingLeft)) * m.x, b = w.top + (u.clientTop + parseFloat(g.paddingTop)) * m.y;
595
- c *= m.x, a *= m.y, d *= m.x, h *= m.y, c += x, a += b, u = O(u).frameElement;
593
+ for (; u && i && f !== p; ) {
594
+ const m = I(u), w = u.getBoundingClientRect(), g = T(u), x = w.left + (u.clientLeft + parseFloat(g.paddingLeft)) * m.x, y = w.top + (u.clientTop + parseFloat(g.paddingTop)) * m.y;
595
+ c *= m.x, a *= m.y, d *= m.x, h *= m.y, c += x, a += y, u = L(u).frameElement;
596
596
  }
597
597
  }
598
598
  return et({
@@ -602,13 +602,13 @@ function z(t, e, n, o) {
602
602
  y: a
603
603
  });
604
604
  }
605
- function Ut(t) {
605
+ function Gt(t) {
606
606
  let {
607
607
  rect: e,
608
608
  offsetParent: n,
609
- strategy: o
609
+ strategy: i
610
610
  } = t;
611
- const i = D(n), s = M(n);
611
+ const o = k(n), s = M(n);
612
612
  if (n === s)
613
613
  return e;
614
614
  let r = {
@@ -616,9 +616,9 @@ function Ut(t) {
616
616
  scrollTop: 0
617
617
  }, l = B(1);
618
618
  const c = B(0);
619
- if ((i || !i && o !== "fixed") && ((V(n) !== "body" || G(s)) && (r = it(n)), D(n))) {
620
- const a = z(n);
621
- l = $(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
619
+ if ((o || !o && i !== "fixed") && ((V(n) !== "body" || K(s)) && (r = ot(n)), k(n))) {
620
+ const a = _(n);
621
+ l = I(n), c.x = a.x + n.clientLeft, c.y = a.y + n.clientTop;
622
622
  }
623
623
  return {
624
624
  width: e.width * l.x,
@@ -627,30 +627,30 @@ function Ut(t) {
627
627
  y: e.y * l.y - r.scrollTop * l.y + c.y
628
628
  };
629
629
  }
630
- function Jt(t) {
630
+ function Ut(t) {
631
631
  return Array.from(t.getClientRects());
632
632
  }
633
633
  function At(t) {
634
- return z(M(t)).left + it(t).scrollLeft;
634
+ return _(M(t)).left + ot(t).scrollLeft;
635
635
  }
636
- function Kt(t) {
637
- const e = M(t), n = it(t), o = t.ownerDocument.body, i = R(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = R(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
636
+ function Jt(t) {
637
+ const e = M(t), n = ot(t), i = t.ownerDocument.body, o = C(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = C(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
638
638
  let r = -n.scrollLeft + At(t);
639
639
  const l = -n.scrollTop;
640
- return T(o).direction === "rtl" && (r += R(e.clientWidth, o.clientWidth) - i), {
641
- width: i,
640
+ return T(i).direction === "rtl" && (r += C(e.clientWidth, i.clientWidth) - o), {
641
+ width: o,
642
642
  height: s,
643
643
  x: r,
644
644
  y: l
645
645
  };
646
646
  }
647
- function Gt(t, e) {
648
- const n = O(t), o = M(t), i = n.visualViewport;
649
- let s = o.clientWidth, r = o.clientHeight, l = 0, c = 0;
650
- if (i) {
651
- s = i.width, r = i.height;
647
+ function Kt(t, e) {
648
+ const n = L(t), i = M(t), o = n.visualViewport;
649
+ let s = i.clientWidth, r = i.clientHeight, l = 0, c = 0;
650
+ if (o) {
651
+ s = o.width, r = o.height;
652
652
  const a = ft();
653
- (!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
653
+ (!a || a && e === "fixed") && (l = o.offsetLeft, c = o.offsetTop);
654
654
  }
655
655
  return {
656
656
  width: s,
@@ -660,7 +660,7 @@ function Gt(t, e) {
660
660
  };
661
661
  }
662
662
  function Qt(t, e) {
663
- const n = z(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = D(t) ? $(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = o * s.y;
663
+ const n = _(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, s = k(t) ? I(t) : B(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = o * s.x, a = i * s.y;
664
664
  return {
665
665
  width: r,
666
666
  height: l,
@@ -669,51 +669,51 @@ function Qt(t, e) {
669
669
  };
670
670
  }
671
671
  function pt(t, e, n) {
672
- let o;
672
+ let i;
673
673
  if (e === "viewport")
674
- o = Gt(t, n);
674
+ i = Kt(t, n);
675
675
  else if (e === "document")
676
- o = Kt(M(t));
676
+ i = Jt(M(t));
677
677
  else if (W(e))
678
- o = Qt(e, n);
678
+ i = Qt(e, n);
679
679
  else {
680
- const i = yt(t);
681
- o = {
680
+ const o = bt(t);
681
+ i = {
682
682
  ...e,
683
- x: e.x - i.x,
684
- y: e.y - i.y
683
+ x: e.x - o.x,
684
+ y: e.y - o.y
685
685
  };
686
686
  }
687
- return et(o);
687
+ return et(i);
688
688
  }
689
689
  function Et(t, e) {
690
- const n = _(t);
691
- return n === e || !W(n) || ot(n) ? !1 : T(n).position === "fixed" || Et(n, e);
690
+ const n = z(t);
691
+ return n === e || !W(n) || it(n) ? !1 : T(n).position === "fixed" || Et(n, e);
692
692
  }
693
693
  function Zt(t, e) {
694
694
  const n = e.get(t);
695
695
  if (n)
696
696
  return n;
697
- let o = J(t, [], !1).filter((l) => W(l) && V(l) !== "body"), i = null;
697
+ let i = U(t, [], !1).filter((l) => W(l) && V(l) !== "body"), o = null;
698
698
  const s = T(t).position === "fixed";
699
- let r = s ? _(t) : t;
700
- for (; W(r) && !ot(r); ) {
699
+ let r = s ? z(t) : t;
700
+ for (; W(r) && !it(r); ) {
701
701
  const l = T(r), c = at(r);
702
- !c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(r) && !c && Et(t, r)) ? o = o.filter((d) => d !== r) : i = l, r = _(r);
702
+ !c && l.position === "fixed" && (o = null), (s ? !c && !o : !c && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || K(r) && !c && Et(t, r)) ? i = i.filter((d) => d !== r) : o = l, r = z(r);
703
703
  }
704
- return e.set(t, o), o;
704
+ return e.set(t, i), i;
705
705
  }
706
706
  function te(t) {
707
707
  let {
708
708
  element: e,
709
709
  boundary: n,
710
- rootBoundary: o,
711
- strategy: i
710
+ rootBoundary: i,
711
+ strategy: o
712
712
  } = t;
713
- const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), o], l = r[0], c = r.reduce((a, d) => {
714
- const h = pt(e, d, i);
715
- return a.top = R(h.top, a.top), a.right = N(h.right, a.right), a.bottom = N(h.bottom, a.bottom), a.left = R(h.left, a.left), a;
716
- }, pt(e, l, i));
713
+ const r = [...n === "clippingAncestors" ? Zt(e, this._c) : [].concat(n), i], l = r[0], c = r.reduce((a, d) => {
714
+ const h = pt(e, d, o);
715
+ return a.top = C(h.top, a.top), a.right = F(h.right, a.right), a.bottom = F(h.bottom, a.bottom), a.left = C(h.left, a.left), a;
716
+ }, pt(e, l, o));
717
717
  return {
718
718
  width: c.right - c.left,
719
719
  height: c.bottom - c.top,
@@ -722,21 +722,21 @@ function te(t) {
722
722
  };
723
723
  }
724
724
  function ee(t) {
725
- return bt(t);
725
+ return yt(t);
726
726
  }
727
727
  function ne(t, e, n) {
728
- const o = D(e), i = M(e), s = n === "fixed", r = z(t, !0, s, e);
728
+ const i = k(e), o = M(e), s = n === "fixed", r = _(t, !0, s, e);
729
729
  let l = {
730
730
  scrollLeft: 0,
731
731
  scrollTop: 0
732
732
  };
733
733
  const c = B(0);
734
- if (o || !o && !s)
735
- if ((V(e) !== "body" || G(i)) && (l = it(e)), o) {
736
- const a = z(e, !0, s, e);
734
+ if (i || !i && !s)
735
+ if ((V(e) !== "body" || K(o)) && (l = ot(e)), i) {
736
+ const a = _(e, !0, s, e);
737
737
  c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
738
738
  } else
739
- i && (c.x = At(i));
739
+ o && (c.x = At(o));
740
740
  return {
741
741
  x: r.left + l.scrollLeft - c.x,
742
742
  y: r.top + l.scrollTop - c.y,
@@ -745,26 +745,26 @@ function ne(t, e, n) {
745
745
  };
746
746
  }
747
747
  function mt(t, e) {
748
- return !D(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
748
+ return !k(t) || T(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
749
749
  }
750
- function Ct(t, e) {
751
- const n = O(t);
752
- if (!D(t))
750
+ function Rt(t, e) {
751
+ const n = L(t);
752
+ if (!k(t))
753
753
  return n;
754
- let o = mt(t, e);
755
- for (; o && It(o) && T(o).position === "static"; )
756
- o = mt(o, e);
757
- return o && (V(o) === "html" || V(o) === "body" && T(o).position === "static" && !at(o)) ? n : o || Yt(t) || n;
754
+ let i = mt(t, e);
755
+ for (; i && $t(i) && T(i).position === "static"; )
756
+ i = mt(i, e);
757
+ return i && (V(i) === "html" || V(i) === "body" && T(i).position === "static" && !at(i)) ? n : i || Yt(t) || n;
758
758
  }
759
- const oe = async function(t) {
759
+ const ie = async function(t) {
760
760
  let {
761
761
  reference: e,
762
762
  floating: n,
763
- strategy: o
763
+ strategy: i
764
764
  } = t;
765
- const i = this.getOffsetParent || Ct, s = this.getDimensions;
765
+ const o = this.getOffsetParent || Rt, s = this.getDimensions;
766
766
  return {
767
- reference: ne(e, await i(n), o),
767
+ reference: ne(e, await o(n), i),
768
768
  floating: {
769
769
  x: 0,
770
770
  y: 0,
@@ -772,26 +772,26 @@ const oe = async function(t) {
772
772
  }
773
773
  };
774
774
  };
775
- function ie(t) {
775
+ function oe(t) {
776
776
  return T(t).direction === "rtl";
777
777
  }
778
778
  const se = {
779
- convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
779
+ convertOffsetParentRelativeRectToViewportRelativeRect: Gt,
780
780
  getDocumentElement: M,
781
781
  getClippingRect: te,
782
- getOffsetParent: Ct,
783
- getElementRects: oe,
784
- getClientRects: Jt,
782
+ getOffsetParent: Rt,
783
+ getElementRects: ie,
784
+ getClientRects: Ut,
785
785
  getDimensions: ee,
786
- getScale: $,
786
+ getScale: I,
787
787
  isElement: W,
788
- isRTL: ie
788
+ isRTL: oe
789
789
  };
790
790
  function re(t, e) {
791
- let n = null, o;
792
- const i = M(t);
791
+ let n = null, i;
792
+ const o = M(t);
793
793
  function s() {
794
- clearTimeout(o), n && n.disconnect(), n = null;
794
+ clearTimeout(i), n && n.disconnect(), n = null;
795
795
  }
796
796
  function r(l, c) {
797
797
  l === void 0 && (l = !1), c === void 0 && (c = 1), s();
@@ -803,27 +803,27 @@ function re(t, e) {
803
803
  } = t.getBoundingClientRect();
804
804
  if (l || e(), !h || !p)
805
805
  return;
806
- const f = Q(d), u = Q(i.clientWidth - (a + h)), m = Q(i.clientHeight - (d + p)), w = Q(a), x = {
806
+ const f = Q(d), u = Q(o.clientWidth - (a + h)), m = Q(o.clientHeight - (d + p)), w = Q(a), x = {
807
807
  rootMargin: -f + "px " + -u + "px " + -m + "px " + -w + "px",
808
- threshold: R(0, N(1, c)) || 1
808
+ threshold: C(0, F(1, c)) || 1
809
809
  };
810
- let b = !0;
810
+ let y = !0;
811
811
  function A(v) {
812
- const y = v[0].intersectionRatio;
813
- if (y !== c) {
814
- if (!b)
812
+ const b = v[0].intersectionRatio;
813
+ if (b !== c) {
814
+ if (!y)
815
815
  return r();
816
- y ? r(!1, y) : o = setTimeout(() => {
816
+ b ? r(!1, b) : i = setTimeout(() => {
817
817
  r(!1, 1e-7);
818
818
  }, 100);
819
819
  }
820
- b = !1;
820
+ y = !1;
821
821
  }
822
822
  try {
823
823
  n = new IntersectionObserver(A, {
824
824
  ...x,
825
825
  // Handle <iframe>s
826
- root: i.ownerDocument
826
+ root: o.ownerDocument
827
827
  });
828
828
  } catch {
829
829
  n = new IntersectionObserver(A, x);
@@ -832,17 +832,17 @@ function re(t, e) {
832
832
  }
833
833
  return r(!0), s;
834
834
  }
835
- function ce(t, e, n, o) {
836
- o === void 0 && (o = {});
835
+ function ce(t, e, n, i) {
836
+ i === void 0 && (i = {});
837
837
  const {
838
- ancestorScroll: i = !0,
838
+ ancestorScroll: o = !0,
839
839
  ancestorResize: s = !0,
840
840
  elementResize: r = typeof ResizeObserver == "function",
841
841
  layoutShift: l = typeof IntersectionObserver == "function",
842
842
  animationFrame: c = !1
843
- } = o, a = ut(t), d = i || s ? [...a ? J(a) : [], ...J(e)] : [];
843
+ } = i, a = ut(t), d = o || s ? [...a ? U(a) : [], ...U(e)] : [];
844
844
  d.forEach((g) => {
845
- i && g.addEventListener("scroll", n, {
845
+ o && g.addEventListener("scroll", n, {
846
846
  passive: !0
847
847
  }), s && g.addEventListener("resize", n);
848
848
  });
@@ -854,28 +854,28 @@ function ce(t, e, n, o) {
854
854
  f && f.observe(e);
855
855
  })), n();
856
856
  }), a && !c && f.observe(a), f.observe(e));
857
- let u, m = c ? z(t) : null;
857
+ let u, m = c ? _(t) : null;
858
858
  c && w();
859
859
  function w() {
860
- const g = z(t);
860
+ const g = _(t);
861
861
  m && (g.x !== m.x || g.y !== m.y || g.width !== m.width || g.height !== m.height) && n(), m = g, u = requestAnimationFrame(w);
862
862
  }
863
863
  return n(), () => {
864
864
  d.forEach((g) => {
865
- i && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
865
+ o && g.removeEventListener("scroll", n), s && g.removeEventListener("resize", n);
866
866
  }), h && h(), f && f.disconnect(), f = null, c && cancelAnimationFrame(u);
867
867
  };
868
868
  }
869
869
  const le = (t, e, n) => {
870
- const o = /* @__PURE__ */ new Map(), i = {
870
+ const i = /* @__PURE__ */ new Map(), o = {
871
871
  platform: se,
872
872
  ...n
873
873
  }, s = {
874
- ...i.platform,
875
- _c: o
874
+ ...o.platform,
875
+ _c: i
876
876
  };
877
877
  return Bt(t, e, {
878
- ...i,
878
+ ...o,
879
879
  platform: s
880
880
  });
881
881
  }, ae = ":host{--wje-popup-top: auto;--wje-popup-left: auto;display:flex}.native-popup{position:absolute;isolation:isolate;z-index:999;left:var(--wje-popup-left);top:var(--wje-popup-top)}.native-popup:not(.popup-active){display:none}";
@@ -889,9 +889,12 @@ class he extends Tt {
889
889
  super();
890
890
  st(this, "className", "Popup");
891
891
  st(this, "clickHandler", (n) => {
892
- n.composedPath().some((i) => i === this) || this.hasAttribute("active") && this.removeAttribute("active");
892
+ n.composedPath().some((o) => o === this) || this.hasAttribute("active") && this.removeAttribute("active");
893
893
  });
894
- this._manual = !1;
894
+ this._manual = !1, this._stageList = {
895
+ IDLE: "IDLE",
896
+ PROCESSING: "PROCESSING"
897
+ }, this._stage = this._stageList.IDLE;
895
898
  }
896
899
  /**
897
900
  * Sets the manual property of the popup.
@@ -918,33 +921,19 @@ class he extends Tt {
918
921
  static get cssStyleSheet() {
919
922
  return ae;
920
923
  }
921
- /**
922
- * Returns the list of attributes to observe for changes.
923
- *
924
- * @static
925
- * @returns {Array<string>}
926
- */
927
- static get observedAttributes() {
928
- return ["active"];
929
- }
930
924
  /**
931
925
  * Sets up the attributes for the component.
932
926
  */
933
927
  setupAttributes() {
934
928
  this.isShadowRoot = "open";
935
929
  }
936
- /**
937
- * Called when an attribute changes.
938
- *
939
- * @param {string} name - The name of the attribute.
940
- * @param {string} old - The old value of the attribute.
941
- * @param {string} newName - The new value of the attribute.
942
- */
943
- attributeChangedCallback(n, o, i) {
944
- n === "active" && (this.hasAttribute(n) ? this.show() : this.hide());
930
+ afterDisconnect() {
931
+ var n;
932
+ G.removeElement(this.anchorEl), document.removeEventListener("click", this.clickHandler, { capture: !0 }), (n = this.cleanup) == null || n.call(this);
945
933
  }
946
- beforeDraw(n, o, i) {
947
- document.removeEventListener("click", this.clickHandler);
934
+ beforeDraw(n, i, o) {
935
+ var s;
936
+ this._stage = this._stageList.PROCESSING, document.removeEventListener("click", this.clickHandler, { capture: !0 }), (s = this.cleanup) == null || s.call(this);
948
937
  }
949
938
  /**
950
939
  * Draws the component.
@@ -954,7 +943,7 @@ class he extends Tt {
954
943
  * @param {Object} params - The parameters for drawing.
955
944
  * @returns {DocumentFragment}
956
945
  */
957
- draw(n, o, i) {
946
+ draw(n, i, o) {
958
947
  let s = document.createDocumentFragment(), r = document.createElement("slot");
959
948
  r.setAttribute("name", "anchor");
960
949
  let l = document.createElement("slot");
@@ -964,8 +953,8 @@ class he extends Tt {
964
953
  let a = document.createElement("slot");
965
954
  return c.appendChild(a), c.appendChild(l), s.appendChild(r), s.appendChild(c), this.slotAnchor = r, this.slotArrow = l, this.native = c, s;
966
955
  }
967
- afterDraw(n, o, i) {
968
- this.setAnchor();
956
+ afterDraw(n, i, o) {
957
+ this.setAnchor(), this._stage = this._stageList.IDLE;
969
958
  }
970
959
  /**
971
960
  * Sets the anchor for the popup.
@@ -977,9 +966,9 @@ class he extends Tt {
977
966
  this.anchorEl = n.querySelector("#" + this.anchor);
978
967
  } else
979
968
  this.slotAnchor instanceof HTMLSlotElement && (this.anchorEl = this.slotAnchor.assignedElements({ flatten: !0 })[0]);
980
- this.manual && U.addListener(this.anchorEl, "click", null, (n) => {
969
+ this.manual && G.addListener(this.anchorEl, "click", null, (n) => {
981
970
  this.hasAttribute("disabled") || this.showHide();
982
- }, { stopPropagation: !0 }), document.addEventListener("click", this.clickHandler, { capture: !0 });
971
+ }, { stopPropagation: !0 }), document.removeEventListener("click", this.clickHandler, { capture: !0 }), document.addEventListener("click", this.clickHandler, { capture: !0 });
983
972
  }
984
973
  /**
985
974
  * Toggles the active attribute of the popup.
@@ -998,12 +987,12 @@ class he extends Tt {
998
987
  element: this.arrow
999
988
  })
1000
989
  ), this.offsetCalc = Math.sqrt(2 * this.arrow.offsetWidth ** 2) / 2 + +this.offset)), n.push(
1001
- $t(this.offsetCalc)
990
+ It(this.offsetCalc)
1002
991
  ), n.push(
1003
992
  jt()
1004
993
  ), this.hasAttribute("size") && n.push(
1005
- _t({
1006
- apply({ availableWidth: o, availableHeight: i, elements: s }) {
994
+ zt({
995
+ apply({ availableWidth: i, availableHeight: o, elements: s }) {
1007
996
  Object.assign(s.floating.style, {
1008
997
  width: `${s.reference.offsetWidth}px`
1009
998
  });
@@ -1013,8 +1002,8 @@ class he extends Tt {
1013
1002
  placement: this.placement || "bottom",
1014
1003
  strategy: "fixed",
1015
1004
  middleware: n
1016
- }).then(({ x: o, y: i, middlewareData: s, placement: r, strategy: l }) => {
1017
- if (this.native.style.setProperty("--wje-popup-left", o + "px"), this.native.style.setProperty("--wje-popup-top", i + "px"), this.native.style.position = l, this.arrow) {
1005
+ }).then(({ x: i, y: o, middlewareData: s, placement: r, strategy: l }) => {
1006
+ if (this.native.style.setProperty("--wje-popup-left", i + "px"), this.native.style.setProperty("--wje-popup-top", o + "px"), this.native.style.position = l, this.arrow) {
1018
1007
  const c = {
1019
1008
  top: "bottom",
1020
1009
  right: "left",
@@ -1030,7 +1019,7 @@ class he extends Tt {
1030
1019
  });
1031
1020
  }
1032
1021
  }
1033
- }), U.dispatchCustomEvent(this, "wje-popup:reposition", {
1022
+ }), G.dispatchCustomEvent(this, "wje-popup:reposition", {
1034
1023
  data: { top: "bottom", right: "left", bottom: "top", left: "right" },
1035
1024
  context: this,
1036
1025
  event: this
@@ -1042,7 +1031,8 @@ class he extends Tt {
1042
1031
  * Sets up auto update for repositioning.
1043
1032
  */
1044
1033
  show() {
1045
- U.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), this.cleanup = ce(this.anchorEl, this.native, () => {
1034
+ var n;
1035
+ G.dispatchCustomEvent(this, "wje-popup:show"), this.native.classList.add("popup-active"), (n = this.cleanup) == null || n.call(this), this.cleanup = ce(this.anchorEl, this.native, () => {
1046
1036
  this.reposition();
1047
1037
  }), this.hasAttribute("active") || this.setAttribute("active", "");
1048
1038
  }
@@ -1052,7 +1042,8 @@ class he extends Tt {
1052
1042
  * Cleans up the auto update for repositioning.
1053
1043
  */
1054
1044
  hide() {
1055
- U.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), this.removeAttribute("active"), this.cleanup, this.cleanup = void 0;
1045
+ var n;
1046
+ G.dispatchCustomEvent(this, "wje-popup:hide"), this.native.classList.remove("popup-active"), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0, this.hasAttribute("active") && this.removeAttribute("active");
1056
1047
  }
1057
1048
  /**
1058
1049
  * Removes the active attribute when the popup is hidden.
@@ -1060,12 +1051,6 @@ class he extends Tt {
1060
1051
  onHide() {
1061
1052
  this.removeAttribute("active");
1062
1053
  }
1063
- /**
1064
- * Adds event listeners after the component is drawn.
1065
- */
1066
- disconnectedCallback() {
1067
- U.removeElement(this.anchorEl);
1068
- }
1069
1054
  }
1070
1055
  export {
1071
1056
  he as P