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