@oneb/ui-vue 0.3.23 → 0.3.26

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,941 +0,0 @@
1
- const U = Math.min, k = Math.max, K = Math.round, X = Math.floor, C = (t) => ({
2
- x: t,
3
- y: t
4
- }), Pt = {
5
- left: "right",
6
- right: "left",
7
- bottom: "top",
8
- top: "bottom"
9
- }, Bt = {
10
- start: "end",
11
- end: "start"
12
- };
13
- function gt(t, e, n) {
14
- return k(t, U(e, n));
15
- }
16
- function Q(t, e) {
17
- return typeof t == "function" ? t(e) : t;
18
- }
19
- function P(t) {
20
- return t.split("-")[0];
21
- }
22
- function Z(t) {
23
- return t.split("-")[1];
24
- }
25
- function vt(t) {
26
- return t === "x" ? "y" : "x";
27
- }
28
- function bt(t) {
29
- return t === "y" ? "height" : "width";
30
- }
31
- function W(t) {
32
- return ["top", "bottom"].includes(P(t)) ? "y" : "x";
33
- }
34
- function At(t) {
35
- return vt(W(t));
36
- }
37
- function Mt(t, e, n) {
38
- n === void 0 && (n = !1);
39
- const o = Z(t), i = At(t), r = bt(i);
40
- let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
41
- return e.reference[r] > e.floating[r] && (s = G(s)), [s, G(s)];
42
- }
43
- function Nt(t) {
44
- const e = G(t);
45
- return [st(t), e, st(e)];
46
- }
47
- function st(t) {
48
- return t.replace(/start|end/g, (e) => Bt[e]);
49
- }
50
- function Vt(t, e, n) {
51
- const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
52
- switch (t) {
53
- case "top":
54
- case "bottom":
55
- return n ? e ? i : o : e ? o : i;
56
- case "left":
57
- case "right":
58
- return e ? r : s;
59
- default:
60
- return [];
61
- }
62
- }
63
- function Wt(t, e, n, o) {
64
- const i = Z(t);
65
- let r = Vt(P(t), n === "start", o);
66
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(st)))), r;
67
- }
68
- function G(t) {
69
- return t.replace(/left|right|bottom|top/g, (e) => Pt[e]);
70
- }
71
- function Ht(t) {
72
- return {
73
- top: 0,
74
- right: 0,
75
- bottom: 0,
76
- left: 0,
77
- ...t
78
- };
79
- }
80
- function $t(t) {
81
- return typeof t != "number" ? Ht(t) : {
82
- top: t,
83
- right: t,
84
- bottom: t,
85
- left: t
86
- };
87
- }
88
- function J(t) {
89
- const {
90
- x: e,
91
- y: n,
92
- width: o,
93
- height: i
94
- } = t;
95
- return {
96
- width: o,
97
- height: i,
98
- top: n,
99
- left: e,
100
- right: e + o,
101
- bottom: n + i,
102
- x: e,
103
- y: n
104
- };
105
- }
106
- function pt(t, e, n) {
107
- let {
108
- reference: o,
109
- floating: i
110
- } = t;
111
- const r = W(e), s = At(e), c = bt(s), l = P(e), f = r === "y", d = o.x + o.width / 2 - i.width / 2, a = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
112
- let u;
113
- switch (l) {
114
- case "top":
115
- u = {
116
- x: d,
117
- y: o.y - i.height
118
- };
119
- break;
120
- case "bottom":
121
- u = {
122
- x: d,
123
- y: o.y + o.height
124
- };
125
- break;
126
- case "right":
127
- u = {
128
- x: o.x + o.width,
129
- y: a
130
- };
131
- break;
132
- case "left":
133
- u = {
134
- x: o.x - i.width,
135
- y: a
136
- };
137
- break;
138
- default:
139
- u = {
140
- x: o.x,
141
- y: o.y
142
- };
143
- }
144
- switch (Z(e)) {
145
- case "start":
146
- u[s] -= m * (n && f ? -1 : 1);
147
- break;
148
- case "end":
149
- u[s] += m * (n && f ? -1 : 1);
150
- break;
151
- }
152
- return u;
153
- }
154
- const _t = async (t, e, n) => {
155
- const {
156
- placement: o = "bottom",
157
- strategy: i = "absolute",
158
- middleware: r = [],
159
- platform: s
160
- } = n, c = r.filter(Boolean), l = await (s.isRTL == null ? void 0 : s.isRTL(e));
161
- let f = await s.getElementRects({
162
- reference: t,
163
- floating: e,
164
- strategy: i
165
- }), {
166
- x: d,
167
- y: a
168
- } = pt(f, o, l), m = o, u = {}, h = 0;
169
- for (let p = 0; p < c.length; p++) {
170
- const {
171
- name: w,
172
- fn: g
173
- } = c[p], {
174
- x,
175
- y,
176
- data: b,
177
- reset: v
178
- } = await g({
179
- x: d,
180
- y: a,
181
- initialPlacement: o,
182
- placement: m,
183
- strategy: i,
184
- middlewareData: u,
185
- rects: f,
186
- platform: s,
187
- elements: {
188
- reference: t,
189
- floating: e
190
- }
191
- });
192
- d = x ?? d, a = y ?? a, u = {
193
- ...u,
194
- [w]: {
195
- ...u[w],
196
- ...b
197
- }
198
- }, v && h <= 50 && (h++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (f = v.rects === !0 ? await s.getElementRects({
199
- reference: t,
200
- floating: e,
201
- strategy: i
202
- }) : v.rects), {
203
- x: d,
204
- y: a
205
- } = pt(f, m, l)), p = -1);
206
- }
207
- return {
208
- x: d,
209
- y: a,
210
- placement: m,
211
- strategy: i,
212
- middlewareData: u
213
- };
214
- };
215
- async function Rt(t, e) {
216
- var n;
217
- e === void 0 && (e = {});
218
- const {
219
- x: o,
220
- y: i,
221
- platform: r,
222
- rects: s,
223
- elements: c,
224
- strategy: l
225
- } = t, {
226
- boundary: f = "clippingAncestors",
227
- rootBoundary: d = "viewport",
228
- elementContext: a = "floating",
229
- altBoundary: m = !1,
230
- padding: u = 0
231
- } = Q(e, t), h = $t(u), w = c[m ? a === "floating" ? "reference" : "floating" : a], g = J(await r.getClippingRect({
232
- element: (n = await (r.isElement == null ? void 0 : r.isElement(w))) == null || n ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
233
- boundary: f,
234
- rootBoundary: d,
235
- strategy: l
236
- })), x = a === "floating" ? {
237
- x: o,
238
- y: i,
239
- width: s.floating.width,
240
- height: s.floating.height
241
- } : s.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
242
- x: 1,
243
- y: 1
244
- } : {
245
- x: 1,
246
- y: 1
247
- }, v = J(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
248
- elements: c,
249
- rect: x,
250
- offsetParent: y,
251
- strategy: l
252
- }) : x);
253
- return {
254
- top: (g.top - v.top + h.top) / b.y,
255
- bottom: (v.bottom - g.bottom + h.bottom) / b.y,
256
- left: (g.left - v.left + h.left) / b.x,
257
- right: (v.right - g.right + h.right) / b.x
258
- };
259
- }
260
- const zt = function(t) {
261
- return t === void 0 && (t = {}), {
262
- name: "flip",
263
- options: t,
264
- async fn(e) {
265
- var n, o;
266
- const {
267
- placement: i,
268
- middlewareData: r,
269
- rects: s,
270
- initialPlacement: c,
271
- platform: l,
272
- elements: f
273
- } = e, {
274
- mainAxis: d = !0,
275
- crossAxis: a = !0,
276
- fallbackPlacements: m,
277
- fallbackStrategy: u = "bestFit",
278
- fallbackAxisSideDirection: h = "none",
279
- flipAlignment: p = !0,
280
- ...w
281
- } = Q(t, e);
282
- if ((n = r.arrow) != null && n.alignmentOffset)
283
- return {};
284
- const g = P(i), x = W(c), y = P(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), v = m || (y || !p ? [G(c)] : Nt(c)), _ = h !== "none";
285
- !m && _ && v.push(...Wt(c, p, h, b));
286
- const M = [c, ...v], ot = await Rt(e, w), q = [];
287
- let z = ((o = r.flip) == null ? void 0 : o.overflows) || [];
288
- if (d && q.push(ot[g]), a) {
289
- const F = Mt(i, s, b);
290
- q.push(ot[F[0]], ot[F[1]]);
291
- }
292
- if (z = [...z, {
293
- placement: i,
294
- overflows: q
295
- }], !q.every((F) => F <= 0)) {
296
- var ut, dt;
297
- const F = (((ut = r.flip) == null ? void 0 : ut.index) || 0) + 1, ht = M[F];
298
- if (ht)
299
- return {
300
- data: {
301
- index: F,
302
- overflows: z
303
- },
304
- reset: {
305
- placement: ht
306
- }
307
- };
308
- let I = (dt = z.filter((N) => N.overflows[0] <= 0).sort((N, L) => N.overflows[1] - L.overflows[1])[0]) == null ? void 0 : dt.placement;
309
- if (!I)
310
- switch (u) {
311
- case "bestFit": {
312
- var mt;
313
- const N = (mt = z.filter((L) => {
314
- if (_) {
315
- const S = W(L.placement);
316
- return S === x || // Create a bias to the `y` side axis due to horizontal
317
- // reading directions favoring greater width.
318
- S === "y";
319
- }
320
- return !0;
321
- }).map((L) => [L.placement, L.overflows.filter((S) => S > 0).reduce((S, kt) => S + kt, 0)]).sort((L, S) => L[1] - S[1])[0]) == null ? void 0 : mt[0];
322
- N && (I = N);
323
- break;
324
- }
325
- case "initialPlacement":
326
- I = c;
327
- break;
328
- }
329
- if (i !== I)
330
- return {
331
- reset: {
332
- placement: I
333
- }
334
- };
335
- }
336
- return {};
337
- }
338
- };
339
- };
340
- async function It(t, e) {
341
- const {
342
- placement: n,
343
- platform: o,
344
- elements: i
345
- } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = P(n), c = Z(n), l = W(n) === "y", f = ["left", "top"].includes(s) ? -1 : 1, d = r && l ? -1 : 1, a = Q(e, t);
346
- let {
347
- mainAxis: m,
348
- crossAxis: u,
349
- alignmentAxis: h
350
- } = typeof a == "number" ? {
351
- mainAxis: a,
352
- crossAxis: 0,
353
- alignmentAxis: null
354
- } : {
355
- mainAxis: a.mainAxis || 0,
356
- crossAxis: a.crossAxis || 0,
357
- alignmentAxis: a.alignmentAxis
358
- };
359
- return c && typeof h == "number" && (u = c === "end" ? h * -1 : h), l ? {
360
- x: u * d,
361
- y: m * f
362
- } : {
363
- x: m * f,
364
- y: u * d
365
- };
366
- }
367
- const jt = function(t) {
368
- return t === void 0 && (t = 0), {
369
- name: "offset",
370
- options: t,
371
- async fn(e) {
372
- var n, o;
373
- const {
374
- x: i,
375
- y: r,
376
- placement: s,
377
- middlewareData: c
378
- } = e, l = await It(e, t);
379
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
380
- x: i + l.x,
381
- y: r + l.y,
382
- data: {
383
- ...l,
384
- placement: s
385
- }
386
- };
387
- }
388
- };
389
- }, Yt = function(t) {
390
- return t === void 0 && (t = {}), {
391
- name: "shift",
392
- options: t,
393
- async fn(e) {
394
- const {
395
- x: n,
396
- y: o,
397
- placement: i
398
- } = e, {
399
- mainAxis: r = !0,
400
- crossAxis: s = !1,
401
- limiter: c = {
402
- fn: (w) => {
403
- let {
404
- x: g,
405
- y: x
406
- } = w;
407
- return {
408
- x: g,
409
- y: x
410
- };
411
- }
412
- },
413
- ...l
414
- } = Q(t, e), f = {
415
- x: n,
416
- y: o
417
- }, d = await Rt(e, l), a = W(P(i)), m = vt(a);
418
- let u = f[m], h = f[a];
419
- if (r) {
420
- const w = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", x = u + d[w], y = u - d[g];
421
- u = gt(x, u, y);
422
- }
423
- if (s) {
424
- const w = a === "y" ? "top" : "left", g = a === "y" ? "bottom" : "right", x = h + d[w], y = h - d[g];
425
- h = gt(x, h, y);
426
- }
427
- const p = c.fn({
428
- ...e,
429
- [m]: u,
430
- [a]: h
431
- });
432
- return {
433
- ...p,
434
- data: {
435
- x: p.x - n,
436
- y: p.y - o,
437
- enabled: {
438
- [m]: r,
439
- [a]: s
440
- }
441
- }
442
- };
443
- }
444
- };
445
- };
446
- function tt() {
447
- return typeof window < "u";
448
- }
449
- function $(t) {
450
- return Ot(t) ? (t.nodeName || "").toLowerCase() : "#document";
451
- }
452
- function A(t) {
453
- var e;
454
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
455
- }
456
- function T(t) {
457
- var e;
458
- return (e = (Ot(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
459
- }
460
- function Ot(t) {
461
- return tt() ? t instanceof Node || t instanceof A(t).Node : !1;
462
- }
463
- function R(t) {
464
- return tt() ? t instanceof Element || t instanceof A(t).Element : !1;
465
- }
466
- function E(t) {
467
- return tt() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
468
- }
469
- function wt(t) {
470
- return !tt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
471
- }
472
- function Y(t) {
473
- const {
474
- overflow: e,
475
- overflowX: n,
476
- overflowY: o,
477
- display: i
478
- } = O(t);
479
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(i);
480
- }
481
- function qt(t) {
482
- return ["table", "td", "th"].includes($(t));
483
- }
484
- function et(t) {
485
- return [":popover-open", ":modal"].some((e) => {
486
- try {
487
- return t.matches(e);
488
- } catch {
489
- return !1;
490
- }
491
- });
492
- }
493
- function ct(t) {
494
- const e = lt(), n = R(t) ? O(t) : t;
495
- return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
496
- }
497
- function Xt(t) {
498
- let e = D(t);
499
- for (; E(e) && !H(e); ) {
500
- if (ct(e))
501
- return e;
502
- if (et(e))
503
- return null;
504
- e = D(e);
505
- }
506
- return null;
507
- }
508
- function lt() {
509
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
510
- }
511
- function H(t) {
512
- return ["html", "body", "#document"].includes($(t));
513
- }
514
- function O(t) {
515
- return A(t).getComputedStyle(t);
516
- }
517
- function nt(t) {
518
- return R(t) ? {
519
- scrollLeft: t.scrollLeft,
520
- scrollTop: t.scrollTop
521
- } : {
522
- scrollLeft: t.scrollX,
523
- scrollTop: t.scrollY
524
- };
525
- }
526
- function D(t) {
527
- if ($(t) === "html")
528
- return t;
529
- const e = (
530
- // Step into the shadow DOM of the parent of a slotted node.
531
- t.assignedSlot || // DOM Element detected.
532
- t.parentNode || // ShadowRoot detected.
533
- wt(t) && t.host || // Fallback.
534
- T(t)
535
- );
536
- return wt(e) ? e.host : e;
537
- }
538
- function Ct(t) {
539
- const e = D(t);
540
- return H(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : E(e) && Y(e) ? e : Ct(e);
541
- }
542
- function j(t, e, n) {
543
- var o;
544
- e === void 0 && (e = []), n === void 0 && (n = !0);
545
- const i = Ct(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(i);
546
- if (r) {
547
- const c = rt(s);
548
- return e.concat(s, s.visualViewport || [], Y(i) ? i : [], c && n ? j(c) : []);
549
- }
550
- return e.concat(i, j(i, [], n));
551
- }
552
- function rt(t) {
553
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
554
- }
555
- function Et(t) {
556
- const e = O(t);
557
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
558
- const i = E(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = K(n) !== r || K(o) !== s;
559
- return c && (n = r, o = s), {
560
- width: n,
561
- height: o,
562
- $: c
563
- };
564
- }
565
- function ft(t) {
566
- return R(t) ? t : t.contextElement;
567
- }
568
- function V(t) {
569
- const e = ft(t);
570
- if (!E(e))
571
- return C(1);
572
- const n = e.getBoundingClientRect(), {
573
- width: o,
574
- height: i,
575
- $: r
576
- } = Et(e);
577
- let s = (r ? K(n.width) : n.width) / o, c = (r ? K(n.height) : n.height) / i;
578
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
579
- x: s,
580
- y: c
581
- };
582
- }
583
- const Ut = /* @__PURE__ */ C(0);
584
- function Tt(t) {
585
- const e = A(t);
586
- return !lt() || !e.visualViewport ? Ut : {
587
- x: e.visualViewport.offsetLeft,
588
- y: e.visualViewport.offsetTop
589
- };
590
- }
591
- function Kt(t, e, n) {
592
- return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
593
- }
594
- function B(t, e, n, o) {
595
- e === void 0 && (e = !1), n === void 0 && (n = !1);
596
- const i = t.getBoundingClientRect(), r = ft(t);
597
- let s = C(1);
598
- e && (o ? R(o) && (s = V(o)) : s = V(t));
599
- const c = Kt(r, n, o) ? Tt(r) : C(0);
600
- let l = (i.left + c.x) / s.x, f = (i.top + c.y) / s.y, d = i.width / s.x, a = i.height / s.y;
601
- if (r) {
602
- const m = A(r), u = o && R(o) ? A(o) : o;
603
- let h = m, p = rt(h);
604
- for (; p && o && u !== h; ) {
605
- const w = V(p), g = p.getBoundingClientRect(), x = O(p), y = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, b = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
606
- l *= w.x, f *= w.y, d *= w.x, a *= w.y, l += y, f += b, h = A(p), p = rt(h);
607
- }
608
- }
609
- return J({
610
- width: d,
611
- height: a,
612
- x: l,
613
- y: f
614
- });
615
- }
616
- function at(t, e) {
617
- const n = nt(t).scrollLeft;
618
- return e ? e.left + n : B(T(t)).left + n;
619
- }
620
- function Lt(t, e, n) {
621
- n === void 0 && (n = !1);
622
- const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - (n ? 0 : (
623
- // RTL <body> scrollbar.
624
- at(t, o)
625
- )), r = o.top + e.scrollTop;
626
- return {
627
- x: i,
628
- y: r
629
- };
630
- }
631
- function Gt(t) {
632
- let {
633
- elements: e,
634
- rect: n,
635
- offsetParent: o,
636
- strategy: i
637
- } = t;
638
- const r = i === "fixed", s = T(o), c = e ? et(e.floating) : !1;
639
- if (o === s || c && r)
640
- return n;
641
- let l = {
642
- scrollLeft: 0,
643
- scrollTop: 0
644
- }, f = C(1);
645
- const d = C(0), a = E(o);
646
- if ((a || !a && !r) && (($(o) !== "body" || Y(s)) && (l = nt(o)), E(o))) {
647
- const u = B(o);
648
- f = V(o), d.x = u.x + o.clientLeft, d.y = u.y + o.clientTop;
649
- }
650
- const m = s && !a && !r ? Lt(s, l, !0) : C(0);
651
- return {
652
- width: n.width * f.x,
653
- height: n.height * f.y,
654
- x: n.x * f.x - l.scrollLeft * f.x + d.x + m.x,
655
- y: n.y * f.y - l.scrollTop * f.y + d.y + m.y
656
- };
657
- }
658
- function Jt(t) {
659
- return Array.from(t.getClientRects());
660
- }
661
- function Qt(t) {
662
- const e = T(t), n = nt(t), o = t.ownerDocument.body, i = k(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = k(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
663
- let s = -n.scrollLeft + at(t);
664
- const c = -n.scrollTop;
665
- return O(o).direction === "rtl" && (s += k(e.clientWidth, o.clientWidth) - i), {
666
- width: i,
667
- height: r,
668
- x: s,
669
- y: c
670
- };
671
- }
672
- function Zt(t, e) {
673
- const n = A(t), o = T(t), i = n.visualViewport;
674
- let r = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
675
- if (i) {
676
- r = i.width, s = i.height;
677
- const f = lt();
678
- (!f || f && e === "fixed") && (c = i.offsetLeft, l = i.offsetTop);
679
- }
680
- return {
681
- width: r,
682
- height: s,
683
- x: c,
684
- y: l
685
- };
686
- }
687
- function te(t, e) {
688
- const n = B(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = E(t) ? V(t) : C(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = i * r.x, f = o * r.y;
689
- return {
690
- width: s,
691
- height: c,
692
- x: l,
693
- y: f
694
- };
695
- }
696
- function xt(t, e, n) {
697
- let o;
698
- if (e === "viewport")
699
- o = Zt(t, n);
700
- else if (e === "document")
701
- o = Qt(T(t));
702
- else if (R(e))
703
- o = te(e, n);
704
- else {
705
- const i = Tt(t);
706
- o = {
707
- x: e.x - i.x,
708
- y: e.y - i.y,
709
- width: e.width,
710
- height: e.height
711
- };
712
- }
713
- return J(o);
714
- }
715
- function St(t, e) {
716
- const n = D(t);
717
- return n === e || !R(n) || H(n) ? !1 : O(n).position === "fixed" || St(n, e);
718
- }
719
- function ee(t, e) {
720
- const n = e.get(t);
721
- if (n)
722
- return n;
723
- let o = j(t, [], !1).filter((c) => R(c) && $(c) !== "body"), i = null;
724
- const r = O(t).position === "fixed";
725
- let s = r ? D(t) : t;
726
- for (; R(s) && !H(s); ) {
727
- const c = O(s), l = ct(s);
728
- !l && c.position === "fixed" && (i = null), (r ? !l && !i : !l && c.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || Y(s) && !l && St(t, s)) ? o = o.filter((d) => d !== s) : i = c, s = D(s);
729
- }
730
- return e.set(t, o), o;
731
- }
732
- function ne(t) {
733
- let {
734
- element: e,
735
- boundary: n,
736
- rootBoundary: o,
737
- strategy: i
738
- } = t;
739
- const s = [...n === "clippingAncestors" ? et(e) ? [] : ee(e, this._c) : [].concat(n), o], c = s[0], l = s.reduce((f, d) => {
740
- const a = xt(e, d, i);
741
- return f.top = k(a.top, f.top), f.right = U(a.right, f.right), f.bottom = U(a.bottom, f.bottom), f.left = k(a.left, f.left), f;
742
- }, xt(e, c, i));
743
- return {
744
- width: l.right - l.left,
745
- height: l.bottom - l.top,
746
- x: l.left,
747
- y: l.top
748
- };
749
- }
750
- function oe(t) {
751
- const {
752
- width: e,
753
- height: n
754
- } = Et(t);
755
- return {
756
- width: e,
757
- height: n
758
- };
759
- }
760
- function ie(t, e, n) {
761
- const o = E(e), i = T(e), r = n === "fixed", s = B(t, !0, r, e);
762
- let c = {
763
- scrollLeft: 0,
764
- scrollTop: 0
765
- };
766
- const l = C(0);
767
- if (o || !o && !r)
768
- if (($(e) !== "body" || Y(i)) && (c = nt(e)), o) {
769
- const m = B(e, !0, r, e);
770
- l.x = m.x + e.clientLeft, l.y = m.y + e.clientTop;
771
- } else
772
- i && (l.x = at(i));
773
- const f = i && !o && !r ? Lt(i, c) : C(0), d = s.left + c.scrollLeft - l.x - f.x, a = s.top + c.scrollTop - l.y - f.y;
774
- return {
775
- x: d,
776
- y: a,
777
- width: s.width,
778
- height: s.height
779
- };
780
- }
781
- function it(t) {
782
- return O(t).position === "static";
783
- }
784
- function yt(t, e) {
785
- if (!E(t) || O(t).position === "fixed")
786
- return null;
787
- if (e)
788
- return e(t);
789
- let n = t.offsetParent;
790
- return T(t) === n && (n = n.ownerDocument.body), n;
791
- }
792
- function Dt(t, e) {
793
- const n = A(t);
794
- if (et(t))
795
- return n;
796
- if (!E(t)) {
797
- let i = D(t);
798
- for (; i && !H(i); ) {
799
- if (R(i) && !it(i))
800
- return i;
801
- i = D(i);
802
- }
803
- return n;
804
- }
805
- let o = yt(t, e);
806
- for (; o && qt(o) && it(o); )
807
- o = yt(o, e);
808
- return o && H(o) && it(o) && !ct(o) ? n : o || Xt(t) || n;
809
- }
810
- const se = async function(t) {
811
- const e = this.getOffsetParent || Dt, n = this.getDimensions, o = await n(t.floating);
812
- return {
813
- reference: ie(t.reference, await e(t.floating), t.strategy),
814
- floating: {
815
- x: 0,
816
- y: 0,
817
- width: o.width,
818
- height: o.height
819
- }
820
- };
821
- };
822
- function re(t) {
823
- return O(t).direction === "rtl";
824
- }
825
- const ce = {
826
- convertOffsetParentRelativeRectToViewportRelativeRect: Gt,
827
- getDocumentElement: T,
828
- getClippingRect: ne,
829
- getOffsetParent: Dt,
830
- getElementRects: se,
831
- getClientRects: Jt,
832
- getDimensions: oe,
833
- getScale: V,
834
- isElement: R,
835
- isRTL: re
836
- };
837
- function Ft(t, e) {
838
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
839
- }
840
- function le(t, e) {
841
- let n = null, o;
842
- const i = T(t);
843
- function r() {
844
- var c;
845
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
846
- }
847
- function s(c, l) {
848
- c === void 0 && (c = !1), l === void 0 && (l = 1), r();
849
- const f = t.getBoundingClientRect(), {
850
- left: d,
851
- top: a,
852
- width: m,
853
- height: u
854
- } = f;
855
- if (c || e(), !m || !u)
856
- return;
857
- const h = X(a), p = X(i.clientWidth - (d + m)), w = X(i.clientHeight - (a + u)), g = X(d), y = {
858
- rootMargin: -h + "px " + -p + "px " + -w + "px " + -g + "px",
859
- threshold: k(0, U(1, l)) || 1
860
- };
861
- let b = !0;
862
- function v(_) {
863
- const M = _[0].intersectionRatio;
864
- if (M !== l) {
865
- if (!b)
866
- return s();
867
- M ? s(!1, M) : o = setTimeout(() => {
868
- s(!1, 1e-7);
869
- }, 1e3);
870
- }
871
- M === 1 && !Ft(f, t.getBoundingClientRect()) && s(), b = !1;
872
- }
873
- try {
874
- n = new IntersectionObserver(v, {
875
- ...y,
876
- // Handle <iframe>s
877
- root: i.ownerDocument
878
- });
879
- } catch {
880
- n = new IntersectionObserver(v, y);
881
- }
882
- n.observe(t);
883
- }
884
- return s(!0), r;
885
- }
886
- function fe(t, e, n, o) {
887
- o === void 0 && (o = {});
888
- const {
889
- ancestorScroll: i = !0,
890
- ancestorResize: r = !0,
891
- elementResize: s = typeof ResizeObserver == "function",
892
- layoutShift: c = typeof IntersectionObserver == "function",
893
- animationFrame: l = !1
894
- } = o, f = ft(t), d = i || r ? [...f ? j(f) : [], ...j(e)] : [];
895
- d.forEach((g) => {
896
- i && g.addEventListener("scroll", n, {
897
- passive: !0
898
- }), r && g.addEventListener("resize", n);
899
- });
900
- const a = f && c ? le(f, n) : null;
901
- let m = -1, u = null;
902
- s && (u = new ResizeObserver((g) => {
903
- let [x] = g;
904
- x && x.target === f && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
905
- var y;
906
- (y = u) == null || y.observe(e);
907
- })), n();
908
- }), f && !l && u.observe(f), u.observe(e));
909
- let h, p = l ? B(t) : null;
910
- l && w();
911
- function w() {
912
- const g = B(t);
913
- p && !Ft(p, g) && n(), p = g, h = requestAnimationFrame(w);
914
- }
915
- return n(), () => {
916
- var g;
917
- d.forEach((x) => {
918
- i && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
919
- }), a == null || a(), (g = u) == null || g.disconnect(), u = null, l && cancelAnimationFrame(h);
920
- };
921
- }
922
- const ae = jt, ue = Yt, de = zt, me = (t, e, n) => {
923
- const o = /* @__PURE__ */ new Map(), i = {
924
- platform: ce,
925
- ...n
926
- }, r = {
927
- ...i.platform,
928
- _c: o
929
- };
930
- return _t(t, e, {
931
- ...i,
932
- platform: r
933
- });
934
- };
935
- export {
936
- fe as a,
937
- me as c,
938
- de as f,
939
- ae as o,
940
- ue as s
941
- };