@ganpatiinfo/gids-core-web 8.2.0 → 9.0.0
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.
- package/dist/css/index.css +475 -0
- package/dist/css/index.css.map +1 -1
- package/dist/custom-elements.json +332 -0
- package/dist/gids-field.js +1 -1
- package/dist/gids-icon.js +1 -1
- package/dist/gids-input.js +1 -1
- package/dist/gids-overflow-container.js +1 -1
- package/dist/gids-overlay-provider.js +1 -1
- package/dist/gids-password-field.js +1 -1
- package/dist/gids-popover.d.ts +11 -0
- package/dist/gids-popover.js +1 -0
- package/dist/gids-scrim.js +1 -1
- package/dist/gids-text-field.js +1 -1
- package/dist/gids-toggle-button.js +1 -1
- package/dist/gids-tooltip.d.ts +11 -0
- package/dist/gids-tooltip.js +1 -0
- package/dist/index.js +1 -1
- package/dist/p-B8kX8Vqv.js +1 -0
- package/dist/p-CFw4_-5A.js +1 -0
- package/dist/{p-Bg3lw2Ae.js → p-DvoHLz_5.js} +1 -1
- package/dist/p-a3JfEYJp.js +1 -0
- package/dist/{p-DjvDBWCb.js → p-iCAclJND.js} +1 -1
- package/dist/types/components/html/GidsButton/GidsButton.d.ts +1 -1
- package/dist/types/components/html/GidsDropdownItem/GidsDropdownItem.d.ts +9 -0
- package/dist/types/components/html/GidsDropdownMenu/GidsDropdownMenu.d.ts +6 -0
- package/dist/types/components/html/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts +5 -0
- package/dist/types/components/html/GidsEditButton/GidsEditButton.d.ts +7 -0
- package/dist/types/components/html/GidsListItem/GidsListItem.d.ts +11 -0
- package/dist/types/components/html/GidsMenu/GidsMenu.d.ts +6 -0
- package/dist/types/components/html/GidsMenuGroup/GidsMenuGroup.d.ts +5 -0
- package/dist/types/components/shared/GidsFloatingElementManager.d.ts +57 -0
- package/dist/types/components/shared/GidsFloatingElementTypes.d.ts +4 -0
- package/dist/types/components/webComponents/GidsPopover/GidsPopover.d.ts +24 -0
- package/dist/types/components/webComponents/GidsTooltip/GidsTooltip.d.ts +23 -0
- package/dist/types/components.d.ts +77 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/childrenValidityUtils.d.ts +8 -0
- package/dist-bundled/es/gids-field.js +1 -1
- package/dist-bundled/es/gids-icon.js +9 -9
- package/dist-bundled/es/gids-input.js +4 -4
- package/dist-bundled/es/gids-overflow-container.js +4 -4
- package/dist-bundled/es/gids-overlay-provider.js +3 -3
- package/dist-bundled/es/gids-password-field.js +19 -19
- package/dist-bundled/es/gids-popover.js +110 -0
- package/dist-bundled/es/gids-scrim.js +3 -3
- package/dist-bundled/es/gids-text-field.js +7 -7
- package/dist-bundled/es/gids-toggle-button.js +5 -5
- package/dist-bundled/es/gids-tooltip.js +66 -0
- package/dist-bundled/es/index.js +33 -19
- package/dist-bundled/es/p-B8kX8Vqv-trBz4jdS.js +7 -0
- package/dist-bundled/es/p-CFw4_-5A-Dzvju3VE.js +25 -0
- package/dist-bundled/es/{p-DijVkS9b-CtFkEtlE.js → p-DijVkS9b-CeV1i4T-.js} +1 -1
- package/dist-bundled/es/{p-Bg3lw2Ae-CkC8nUqv.js → p-DvoHLz_5-C5EvA91N.js} +7 -7
- package/dist-bundled/es/p-a3JfEYJp-DyhDK6VZ.js +1128 -0
- package/dist-bundled/es/{p-DjvDBWCb-C9js0PPL.js → p-iCAclJND-Bmsvd-W1.js} +10 -10
- package/dist-bundled/es/{p-veoOgDXg-DElc87c0.js → p-veoOgDXg-fRinub-C.js} +12 -5
- package/dist-bundled/umd/gids-field.umd.js +1 -1
- package/dist-bundled/umd/gids-icon.umd.js +2 -2
- package/dist-bundled/umd/gids-input.umd.js +1 -1
- package/dist-bundled/umd/gids-overflow-container.umd.js +1 -1
- package/dist-bundled/umd/gids-overlay-provider.umd.js +2 -2
- package/dist-bundled/umd/gids-password-field.umd.js +1 -1
- package/dist-bundled/umd/gids-popover.umd.js +5 -0
- package/dist-bundled/umd/gids-scrim.umd.js +1 -1
- package/dist-bundled/umd/gids-text-field.umd.js +1 -1
- package/dist-bundled/umd/gids-toggle-button.umd.js +2 -2
- package/dist-bundled/umd/gids-tooltip.umd.js +5 -0
- package/dist-bundled/umd/index.umd.js +2 -2
- package/dist-bundled/umd-complete/gids-core-web.umd.js +3 -3
- package/package.json +278 -262
- package/dist/p-CWdkmFbc.js +0 -1
- package/dist-bundled/es/p-CWdkmFbc-D89ZE8Mi.js +0 -24
|
@@ -0,0 +1,1128 @@
|
|
|
1
|
+
import { o as Ot } from "./p-B8kX8Vqv-trBz4jdS.js";
|
|
2
|
+
const q = Math.min, _ = Math.max, st = Math.round, ot = Math.floor, L = (t) => ({
|
|
3
|
+
x: t,
|
|
4
|
+
y: t
|
|
5
|
+
}), Xt = {
|
|
6
|
+
left: "right",
|
|
7
|
+
right: "left",
|
|
8
|
+
bottom: "top",
|
|
9
|
+
top: "bottom"
|
|
10
|
+
};
|
|
11
|
+
function pt(t, e, n) {
|
|
12
|
+
return _(t, q(e, n));
|
|
13
|
+
}
|
|
14
|
+
function et(t, e) {
|
|
15
|
+
return typeof t == "function" ? t(e) : t;
|
|
16
|
+
}
|
|
17
|
+
function U(t) {
|
|
18
|
+
return t.split("-")[0];
|
|
19
|
+
}
|
|
20
|
+
function nt(t) {
|
|
21
|
+
return t.split("-")[1];
|
|
22
|
+
}
|
|
23
|
+
function Mt(t) {
|
|
24
|
+
return t === "x" ? "y" : "x";
|
|
25
|
+
}
|
|
26
|
+
function bt(t) {
|
|
27
|
+
return t === "y" ? "height" : "width";
|
|
28
|
+
}
|
|
29
|
+
function k(t) {
|
|
30
|
+
const e = t[0];
|
|
31
|
+
return e === "t" || e === "b" ? "y" : "x";
|
|
32
|
+
}
|
|
33
|
+
function vt(t) {
|
|
34
|
+
return Mt(k(t));
|
|
35
|
+
}
|
|
36
|
+
function Yt(t, e, n) {
|
|
37
|
+
n === void 0 && (n = !1);
|
|
38
|
+
const i = nt(t), o = vt(t), s = bt(o);
|
|
39
|
+
let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
40
|
+
return e.reference[s] > e.floating[s] && (r = rt(r)), [r, rt(r)];
|
|
41
|
+
}
|
|
42
|
+
function qt(t) {
|
|
43
|
+
const e = rt(t);
|
|
44
|
+
return [wt(t), e, wt(e)];
|
|
45
|
+
}
|
|
46
|
+
function wt(t) {
|
|
47
|
+
return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
|
|
48
|
+
}
|
|
49
|
+
const Ct = ["left", "right"], St = ["right", "left"], Zt = ["top", "bottom"], Kt = ["bottom", "top"];
|
|
50
|
+
function Gt(t, e, n) {
|
|
51
|
+
switch (t) {
|
|
52
|
+
case "top":
|
|
53
|
+
case "bottom":
|
|
54
|
+
return n ? e ? St : Ct : e ? Ct : St;
|
|
55
|
+
case "left":
|
|
56
|
+
case "right":
|
|
57
|
+
return e ? Zt : Kt;
|
|
58
|
+
default:
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function Jt(t, e, n, i) {
|
|
63
|
+
const o = nt(t);
|
|
64
|
+
let s = Gt(U(t), n === "start", i);
|
|
65
|
+
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(wt)))), s;
|
|
66
|
+
}
|
|
67
|
+
function rt(t) {
|
|
68
|
+
const e = U(t);
|
|
69
|
+
return Xt[e] + t.slice(e.length);
|
|
70
|
+
}
|
|
71
|
+
function Qt(t) {
|
|
72
|
+
return {
|
|
73
|
+
top: 0,
|
|
74
|
+
right: 0,
|
|
75
|
+
bottom: 0,
|
|
76
|
+
left: 0,
|
|
77
|
+
...t
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function kt(t) {
|
|
81
|
+
return typeof t != "number" ? Qt(t) : {
|
|
82
|
+
top: t,
|
|
83
|
+
right: t,
|
|
84
|
+
bottom: t,
|
|
85
|
+
left: t
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function lt(t) {
|
|
89
|
+
const {
|
|
90
|
+
x: e,
|
|
91
|
+
y: n,
|
|
92
|
+
width: i,
|
|
93
|
+
height: o
|
|
94
|
+
} = t;
|
|
95
|
+
return {
|
|
96
|
+
width: i,
|
|
97
|
+
height: o,
|
|
98
|
+
top: n,
|
|
99
|
+
left: e,
|
|
100
|
+
right: e + i,
|
|
101
|
+
bottom: n + o,
|
|
102
|
+
x: e,
|
|
103
|
+
y: n
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function Tt(t, e, n) {
|
|
107
|
+
let {
|
|
108
|
+
reference: i,
|
|
109
|
+
floating: o
|
|
110
|
+
} = t;
|
|
111
|
+
const s = k(e), r = vt(e), l = bt(r), c = U(e), f = s === "y", h = i.x + i.width / 2 - o.width / 2, u = i.y + i.height / 2 - o.height / 2, d = i[l] / 2 - o[l] / 2;
|
|
112
|
+
let a;
|
|
113
|
+
switch (c) {
|
|
114
|
+
case "top":
|
|
115
|
+
a = {
|
|
116
|
+
x: h,
|
|
117
|
+
y: i.y - o.height
|
|
118
|
+
};
|
|
119
|
+
break;
|
|
120
|
+
case "bottom":
|
|
121
|
+
a = {
|
|
122
|
+
x: h,
|
|
123
|
+
y: i.y + i.height
|
|
124
|
+
};
|
|
125
|
+
break;
|
|
126
|
+
case "right":
|
|
127
|
+
a = {
|
|
128
|
+
x: i.x + i.width,
|
|
129
|
+
y: u
|
|
130
|
+
};
|
|
131
|
+
break;
|
|
132
|
+
case "left":
|
|
133
|
+
a = {
|
|
134
|
+
x: i.x - o.width,
|
|
135
|
+
y: u
|
|
136
|
+
};
|
|
137
|
+
break;
|
|
138
|
+
default:
|
|
139
|
+
a = {
|
|
140
|
+
x: i.x,
|
|
141
|
+
y: i.y
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
switch (nt(e)) {
|
|
145
|
+
case "start":
|
|
146
|
+
a[r] -= d * (n && f ? -1 : 1);
|
|
147
|
+
break;
|
|
148
|
+
case "end":
|
|
149
|
+
a[r] += d * (n && f ? -1 : 1);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
return a;
|
|
153
|
+
}
|
|
154
|
+
async function te(t, e) {
|
|
155
|
+
var n;
|
|
156
|
+
e === void 0 && (e = {});
|
|
157
|
+
const {
|
|
158
|
+
x: i,
|
|
159
|
+
y: o,
|
|
160
|
+
platform: s,
|
|
161
|
+
rects: r,
|
|
162
|
+
elements: l,
|
|
163
|
+
strategy: c
|
|
164
|
+
} = t, {
|
|
165
|
+
boundary: f = "clippingAncestors",
|
|
166
|
+
rootBoundary: h = "viewport",
|
|
167
|
+
elementContext: u = "floating",
|
|
168
|
+
altBoundary: d = !1,
|
|
169
|
+
padding: a = 0
|
|
170
|
+
} = et(e, t), m = kt(a), w = l[d ? u === "floating" ? "reference" : "floating" : u], p = lt(await s.getClippingRect({
|
|
171
|
+
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)),
|
|
172
|
+
boundary: f,
|
|
173
|
+
rootBoundary: h,
|
|
174
|
+
strategy: c
|
|
175
|
+
})), x = u === "floating" ? {
|
|
176
|
+
x: i,
|
|
177
|
+
y: o,
|
|
178
|
+
width: r.floating.width,
|
|
179
|
+
height: r.floating.height
|
|
180
|
+
} : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), b = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
|
|
181
|
+
x: 1,
|
|
182
|
+
y: 1
|
|
183
|
+
} : {
|
|
184
|
+
x: 1,
|
|
185
|
+
y: 1
|
|
186
|
+
}, A = lt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
187
|
+
elements: l,
|
|
188
|
+
rect: x,
|
|
189
|
+
offsetParent: y,
|
|
190
|
+
strategy: c
|
|
191
|
+
}) : x);
|
|
192
|
+
return {
|
|
193
|
+
top: (p.top - A.top + m.top) / b.y,
|
|
194
|
+
bottom: (A.bottom - p.bottom + m.bottom) / b.y,
|
|
195
|
+
left: (p.left - A.left + m.left) / b.x,
|
|
196
|
+
right: (A.right - p.right + m.right) / b.x
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const ee = 50, ne = async (t, e, n) => {
|
|
200
|
+
const {
|
|
201
|
+
placement: i = "bottom",
|
|
202
|
+
strategy: o = "absolute",
|
|
203
|
+
middleware: s = [],
|
|
204
|
+
platform: r
|
|
205
|
+
} = n, l = r.detectOverflow ? r : {
|
|
206
|
+
...r,
|
|
207
|
+
detectOverflow: te
|
|
208
|
+
}, c = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
209
|
+
let f = await r.getElementRects({
|
|
210
|
+
reference: t,
|
|
211
|
+
floating: e,
|
|
212
|
+
strategy: o
|
|
213
|
+
}), {
|
|
214
|
+
x: h,
|
|
215
|
+
y: u
|
|
216
|
+
} = Tt(f, i, c), d = i, a = 0;
|
|
217
|
+
const m = {};
|
|
218
|
+
for (let g = 0; g < s.length; g++) {
|
|
219
|
+
const w = s[g];
|
|
220
|
+
if (!w)
|
|
221
|
+
continue;
|
|
222
|
+
const {
|
|
223
|
+
name: p,
|
|
224
|
+
fn: x
|
|
225
|
+
} = w, {
|
|
226
|
+
x: y,
|
|
227
|
+
y: b,
|
|
228
|
+
data: A,
|
|
229
|
+
reset: v
|
|
230
|
+
} = await x({
|
|
231
|
+
x: h,
|
|
232
|
+
y: u,
|
|
233
|
+
initialPlacement: i,
|
|
234
|
+
placement: d,
|
|
235
|
+
strategy: o,
|
|
236
|
+
middlewareData: m,
|
|
237
|
+
rects: f,
|
|
238
|
+
platform: l,
|
|
239
|
+
elements: {
|
|
240
|
+
reference: t,
|
|
241
|
+
floating: e
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
h = y ?? h, u = b ?? u, m[p] = {
|
|
245
|
+
...m[p],
|
|
246
|
+
...A
|
|
247
|
+
}, v && a < ee && (a++, typeof v == "object" && (v.placement && (d = v.placement), v.rects && (f = v.rects === !0 ? await r.getElementRects({
|
|
248
|
+
reference: t,
|
|
249
|
+
floating: e,
|
|
250
|
+
strategy: o
|
|
251
|
+
}) : v.rects), {
|
|
252
|
+
x: h,
|
|
253
|
+
y: u
|
|
254
|
+
} = Tt(f, d, c)), g = -1);
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
x: h,
|
|
258
|
+
y: u,
|
|
259
|
+
placement: d,
|
|
260
|
+
strategy: o,
|
|
261
|
+
middlewareData: m
|
|
262
|
+
};
|
|
263
|
+
}, ie = (t) => ({
|
|
264
|
+
name: "arrow",
|
|
265
|
+
options: t,
|
|
266
|
+
async fn(e) {
|
|
267
|
+
const {
|
|
268
|
+
x: n,
|
|
269
|
+
y: i,
|
|
270
|
+
placement: o,
|
|
271
|
+
rects: s,
|
|
272
|
+
platform: r,
|
|
273
|
+
elements: l,
|
|
274
|
+
middlewareData: c
|
|
275
|
+
} = e, {
|
|
276
|
+
element: f,
|
|
277
|
+
padding: h = 0
|
|
278
|
+
} = et(t, e) || {};
|
|
279
|
+
if (f == null)
|
|
280
|
+
return {};
|
|
281
|
+
const u = kt(h), d = {
|
|
282
|
+
x: n,
|
|
283
|
+
y: i
|
|
284
|
+
}, a = vt(o), m = bt(a), g = await r.getDimensions(f), w = a === "y", p = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = s.reference[m] + s.reference[a] - d[a] - s.floating[m], A = d[a] - s.reference[a], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(f));
|
|
285
|
+
let O = v ? v[y] : 0;
|
|
286
|
+
(!O || !await (r.isElement == null ? void 0 : r.isElement(v))) && (O = l.floating[y] || s.floating[m]);
|
|
287
|
+
const G = b / 2 - A / 2, B = O / 2 - g[m] / 2 - 1, F = q(u[p], B), J = q(u[x], B), V = F, Q = O - g[m] - J, E = O / 2 - g[m] / 2 + G, I = pt(V, E, Q), N = !c.arrow && nt(o) != null && E !== I && s.reference[m] / 2 - (E < V ? F : J) - g[m] / 2 < 0, C = N ? E < V ? E - V : E - Q : 0;
|
|
288
|
+
return {
|
|
289
|
+
[a]: d[a] + C,
|
|
290
|
+
data: {
|
|
291
|
+
[a]: I,
|
|
292
|
+
centerOffset: E - I - C,
|
|
293
|
+
...N && {
|
|
294
|
+
alignmentOffset: C
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
reset: N
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
}), oe = function(t) {
|
|
301
|
+
return t === void 0 && (t = {}), {
|
|
302
|
+
name: "flip",
|
|
303
|
+
options: t,
|
|
304
|
+
async fn(e) {
|
|
305
|
+
var n, i;
|
|
306
|
+
const {
|
|
307
|
+
placement: o,
|
|
308
|
+
middlewareData: s,
|
|
309
|
+
rects: r,
|
|
310
|
+
initialPlacement: l,
|
|
311
|
+
platform: c,
|
|
312
|
+
elements: f
|
|
313
|
+
} = e, {
|
|
314
|
+
mainAxis: h = !0,
|
|
315
|
+
crossAxis: u = !0,
|
|
316
|
+
fallbackPlacements: d,
|
|
317
|
+
fallbackStrategy: a = "bestFit",
|
|
318
|
+
fallbackAxisSideDirection: m = "none",
|
|
319
|
+
flipAlignment: g = !0,
|
|
320
|
+
...w
|
|
321
|
+
} = et(t, e);
|
|
322
|
+
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
323
|
+
return {};
|
|
324
|
+
const p = U(o), x = k(l), y = U(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(f.floating)), A = d || (y || !g ? [rt(l)] : qt(l)), v = m !== "none";
|
|
325
|
+
!d && v && A.push(...Jt(l, g, m, b));
|
|
326
|
+
const O = [l, ...A], G = await c.detectOverflow(e, w), B = [];
|
|
327
|
+
let F = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
328
|
+
if (h && B.push(G[p]), u) {
|
|
329
|
+
const E = Yt(o, r, b);
|
|
330
|
+
B.push(G[E[0]], G[E[1]]);
|
|
331
|
+
}
|
|
332
|
+
if (F = [...F, {
|
|
333
|
+
placement: o,
|
|
334
|
+
overflows: B
|
|
335
|
+
}], !B.every((E) => E <= 0)) {
|
|
336
|
+
var J, V;
|
|
337
|
+
const E = (((J = s.flip) == null ? void 0 : J.index) || 0) + 1, I = O[E];
|
|
338
|
+
if (I && (!(u === "alignment" ? x !== k(I) : !1) || // We leave the current main axis only if every placement on that axis
|
|
339
|
+
// overflows the main axis.
|
|
340
|
+
F.every((S) => k(S.placement) === x ? S.overflows[0] > 0 : !0)))
|
|
341
|
+
return {
|
|
342
|
+
data: {
|
|
343
|
+
index: E,
|
|
344
|
+
overflows: F
|
|
345
|
+
},
|
|
346
|
+
reset: {
|
|
347
|
+
placement: I
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
let N = (V = F.filter((C) => C.overflows[0] <= 0).sort((C, S) => C.overflows[1] - S.overflows[1])[0]) == null ? void 0 : V.placement;
|
|
351
|
+
if (!N)
|
|
352
|
+
switch (a) {
|
|
353
|
+
case "bestFit": {
|
|
354
|
+
var Q;
|
|
355
|
+
const C = (Q = F.filter((S) => {
|
|
356
|
+
if (v) {
|
|
357
|
+
const M = k(S.placement);
|
|
358
|
+
return M === x || // Create a bias to the `y` side axis due to horizontal
|
|
359
|
+
// reading directions favoring greater width.
|
|
360
|
+
M === "y";
|
|
361
|
+
}
|
|
362
|
+
return !0;
|
|
363
|
+
}).map((S) => [S.placement, S.overflows.filter((M) => M > 0).reduce((M, jt) => M + jt, 0)]).sort((S, M) => S[1] - M[1])[0]) == null ? void 0 : Q[0];
|
|
364
|
+
C && (N = C);
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
case "initialPlacement":
|
|
368
|
+
N = l;
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
if (o !== N)
|
|
372
|
+
return {
|
|
373
|
+
reset: {
|
|
374
|
+
placement: N
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
return {};
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}, se = /* @__PURE__ */ new Set(["left", "top"]);
|
|
382
|
+
async function re(t, e) {
|
|
383
|
+
const {
|
|
384
|
+
placement: n,
|
|
385
|
+
platform: i,
|
|
386
|
+
elements: o
|
|
387
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = U(n), l = nt(n), c = k(n) === "y", f = se.has(r) ? -1 : 1, h = s && c ? -1 : 1, u = et(e, t);
|
|
388
|
+
let {
|
|
389
|
+
mainAxis: d,
|
|
390
|
+
crossAxis: a,
|
|
391
|
+
alignmentAxis: m
|
|
392
|
+
} = typeof u == "number" ? {
|
|
393
|
+
mainAxis: u,
|
|
394
|
+
crossAxis: 0,
|
|
395
|
+
alignmentAxis: null
|
|
396
|
+
} : {
|
|
397
|
+
mainAxis: u.mainAxis || 0,
|
|
398
|
+
crossAxis: u.crossAxis || 0,
|
|
399
|
+
alignmentAxis: u.alignmentAxis
|
|
400
|
+
};
|
|
401
|
+
return l && typeof m == "number" && (a = l === "end" ? m * -1 : m), c ? {
|
|
402
|
+
x: a * h,
|
|
403
|
+
y: d * f
|
|
404
|
+
} : {
|
|
405
|
+
x: d * f,
|
|
406
|
+
y: a * h
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
const le = function(t) {
|
|
410
|
+
return t === void 0 && (t = 0), {
|
|
411
|
+
name: "offset",
|
|
412
|
+
options: t,
|
|
413
|
+
async fn(e) {
|
|
414
|
+
var n, i;
|
|
415
|
+
const {
|
|
416
|
+
x: o,
|
|
417
|
+
y: s,
|
|
418
|
+
placement: r,
|
|
419
|
+
middlewareData: l
|
|
420
|
+
} = e, c = await re(e, t);
|
|
421
|
+
return r === ((n = l.offset) == null ? void 0 : n.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
|
|
422
|
+
x: o + c.x,
|
|
423
|
+
y: s + c.y,
|
|
424
|
+
data: {
|
|
425
|
+
...c,
|
|
426
|
+
placement: r
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
}, ce = function(t) {
|
|
432
|
+
return t === void 0 && (t = {}), {
|
|
433
|
+
name: "shift",
|
|
434
|
+
options: t,
|
|
435
|
+
async fn(e) {
|
|
436
|
+
const {
|
|
437
|
+
x: n,
|
|
438
|
+
y: i,
|
|
439
|
+
placement: o,
|
|
440
|
+
platform: s
|
|
441
|
+
} = e, {
|
|
442
|
+
mainAxis: r = !0,
|
|
443
|
+
crossAxis: l = !1,
|
|
444
|
+
limiter: c = {
|
|
445
|
+
fn: (p) => {
|
|
446
|
+
let {
|
|
447
|
+
x,
|
|
448
|
+
y
|
|
449
|
+
} = p;
|
|
450
|
+
return {
|
|
451
|
+
x,
|
|
452
|
+
y
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
...f
|
|
457
|
+
} = et(t, e), h = {
|
|
458
|
+
x: n,
|
|
459
|
+
y: i
|
|
460
|
+
}, u = await s.detectOverflow(e, f), d = k(U(o)), a = Mt(d);
|
|
461
|
+
let m = h[a], g = h[d];
|
|
462
|
+
if (r) {
|
|
463
|
+
const p = a === "y" ? "top" : "left", x = a === "y" ? "bottom" : "right", y = m + u[p], b = m - u[x];
|
|
464
|
+
m = pt(y, m, b);
|
|
465
|
+
}
|
|
466
|
+
if (l) {
|
|
467
|
+
const p = d === "y" ? "top" : "left", x = d === "y" ? "bottom" : "right", y = g + u[p], b = g - u[x];
|
|
468
|
+
g = pt(y, g, b);
|
|
469
|
+
}
|
|
470
|
+
const w = c.fn({
|
|
471
|
+
...e,
|
|
472
|
+
[a]: m,
|
|
473
|
+
[d]: g
|
|
474
|
+
});
|
|
475
|
+
return {
|
|
476
|
+
...w,
|
|
477
|
+
data: {
|
|
478
|
+
x: w.x - n,
|
|
479
|
+
y: w.y - i,
|
|
480
|
+
enabled: {
|
|
481
|
+
[a]: r,
|
|
482
|
+
[d]: l
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
function ct() {
|
|
490
|
+
return typeof window < "u";
|
|
491
|
+
}
|
|
492
|
+
function K(t) {
|
|
493
|
+
return $t(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
494
|
+
}
|
|
495
|
+
function R(t) {
|
|
496
|
+
var e;
|
|
497
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
498
|
+
}
|
|
499
|
+
function D(t) {
|
|
500
|
+
var e;
|
|
501
|
+
return (e = ($t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
502
|
+
}
|
|
503
|
+
function $t(t) {
|
|
504
|
+
return ct() ? t instanceof Node || t instanceof R(t).Node : !1;
|
|
505
|
+
}
|
|
506
|
+
function T(t) {
|
|
507
|
+
return ct() ? t instanceof Element || t instanceof R(t).Element : !1;
|
|
508
|
+
}
|
|
509
|
+
function W(t) {
|
|
510
|
+
return ct() ? t instanceof HTMLElement || t instanceof R(t).HTMLElement : !1;
|
|
511
|
+
}
|
|
512
|
+
function Pt(t) {
|
|
513
|
+
return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof R(t).ShadowRoot;
|
|
514
|
+
}
|
|
515
|
+
function it(t) {
|
|
516
|
+
const {
|
|
517
|
+
overflow: e,
|
|
518
|
+
overflowX: n,
|
|
519
|
+
overflowY: i,
|
|
520
|
+
display: o
|
|
521
|
+
} = P(t);
|
|
522
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && o !== "inline" && o !== "contents";
|
|
523
|
+
}
|
|
524
|
+
function ae(t) {
|
|
525
|
+
return /^(table|td|th)$/.test(K(t));
|
|
526
|
+
}
|
|
527
|
+
function at(t) {
|
|
528
|
+
try {
|
|
529
|
+
if (t.matches(":popover-open"))
|
|
530
|
+
return !0;
|
|
531
|
+
} catch {
|
|
532
|
+
}
|
|
533
|
+
try {
|
|
534
|
+
return t.matches(":modal");
|
|
535
|
+
} catch {
|
|
536
|
+
return !1;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
const fe = /transform|translate|scale|rotate|perspective|filter/, ue = /paint|layout|strict|content/, z = (t) => !!t && t !== "none";
|
|
540
|
+
let ht;
|
|
541
|
+
function Et(t) {
|
|
542
|
+
const e = T(t) ? P(t) : t;
|
|
543
|
+
return z(e.transform) || z(e.translate) || z(e.scale) || z(e.rotate) || z(e.perspective) || !At() && (z(e.backdropFilter) || z(e.filter)) || fe.test(e.willChange || "") || ue.test(e.contain || "");
|
|
544
|
+
}
|
|
545
|
+
function he(t) {
|
|
546
|
+
let e = $(t);
|
|
547
|
+
for (; W(e) && !Z(e); ) {
|
|
548
|
+
if (Et(e))
|
|
549
|
+
return e;
|
|
550
|
+
if (at(e))
|
|
551
|
+
return null;
|
|
552
|
+
e = $(e);
|
|
553
|
+
}
|
|
554
|
+
return null;
|
|
555
|
+
}
|
|
556
|
+
function At() {
|
|
557
|
+
return ht == null && (ht = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), ht;
|
|
558
|
+
}
|
|
559
|
+
function Z(t) {
|
|
560
|
+
return /^(html|body|#document)$/.test(K(t));
|
|
561
|
+
}
|
|
562
|
+
function P(t) {
|
|
563
|
+
return R(t).getComputedStyle(t);
|
|
564
|
+
}
|
|
565
|
+
function ft(t) {
|
|
566
|
+
return T(t) ? {
|
|
567
|
+
scrollLeft: t.scrollLeft,
|
|
568
|
+
scrollTop: t.scrollTop
|
|
569
|
+
} : {
|
|
570
|
+
scrollLeft: t.scrollX,
|
|
571
|
+
scrollTop: t.scrollY
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
function $(t) {
|
|
575
|
+
if (K(t) === "html")
|
|
576
|
+
return t;
|
|
577
|
+
const e = (
|
|
578
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
579
|
+
t.assignedSlot || // DOM Element detected.
|
|
580
|
+
t.parentNode || // ShadowRoot detected.
|
|
581
|
+
Pt(t) && t.host || // Fallback.
|
|
582
|
+
D(t)
|
|
583
|
+
);
|
|
584
|
+
return Pt(e) ? e.host : e;
|
|
585
|
+
}
|
|
586
|
+
function Bt(t) {
|
|
587
|
+
const e = $(t);
|
|
588
|
+
return Z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && it(e) ? e : Bt(e);
|
|
589
|
+
}
|
|
590
|
+
function tt(t, e, n) {
|
|
591
|
+
var i;
|
|
592
|
+
e === void 0 && (e = []), n === void 0 && (n = !0);
|
|
593
|
+
const o = Bt(t), s = o === ((i = t.ownerDocument) == null ? void 0 : i.body), r = R(o);
|
|
594
|
+
if (s) {
|
|
595
|
+
const l = xt(r);
|
|
596
|
+
return e.concat(r, r.visualViewport || [], it(o) ? o : [], l && n ? tt(l) : []);
|
|
597
|
+
} else
|
|
598
|
+
return e.concat(o, tt(o, [], n));
|
|
599
|
+
}
|
|
600
|
+
function xt(t) {
|
|
601
|
+
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
602
|
+
}
|
|
603
|
+
function Vt(t) {
|
|
604
|
+
const e = P(t);
|
|
605
|
+
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
606
|
+
const o = W(t), s = o ? t.offsetWidth : n, r = o ? t.offsetHeight : i, l = st(n) !== s || st(i) !== r;
|
|
607
|
+
return l && (n = s, i = r), {
|
|
608
|
+
width: n,
|
|
609
|
+
height: i,
|
|
610
|
+
$: l
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
function Rt(t) {
|
|
614
|
+
return T(t) ? t : t.contextElement;
|
|
615
|
+
}
|
|
616
|
+
function Y(t) {
|
|
617
|
+
const e = Rt(t);
|
|
618
|
+
if (!W(e))
|
|
619
|
+
return L(1);
|
|
620
|
+
const n = e.getBoundingClientRect(), {
|
|
621
|
+
width: i,
|
|
622
|
+
height: o,
|
|
623
|
+
$: s
|
|
624
|
+
} = Vt(e);
|
|
625
|
+
let r = (s ? st(n.width) : n.width) / i, l = (s ? st(n.height) : n.height) / o;
|
|
626
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
627
|
+
x: r,
|
|
628
|
+
y: l
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
const de = /* @__PURE__ */ L(0);
|
|
632
|
+
function It(t) {
|
|
633
|
+
const e = R(t);
|
|
634
|
+
return !At() || !e.visualViewport ? de : {
|
|
635
|
+
x: e.visualViewport.offsetLeft,
|
|
636
|
+
y: e.visualViewport.offsetTop
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
function me(t, e, n) {
|
|
640
|
+
return e === void 0 && (e = !1), !n || e && n !== R(t) ? !1 : e;
|
|
641
|
+
}
|
|
642
|
+
function j(t, e, n, i) {
|
|
643
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
644
|
+
const o = t.getBoundingClientRect(), s = Rt(t);
|
|
645
|
+
let r = L(1);
|
|
646
|
+
e && (i ? T(i) && (r = Y(i)) : r = Y(t));
|
|
647
|
+
const l = me(s, n, i) ? It(s) : L(0);
|
|
648
|
+
let c = (o.left + l.x) / r.x, f = (o.top + l.y) / r.y, h = o.width / r.x, u = o.height / r.y;
|
|
649
|
+
if (s) {
|
|
650
|
+
const d = R(s), a = i && T(i) ? R(i) : i;
|
|
651
|
+
let m = d, g = xt(m);
|
|
652
|
+
for (; g && i && a !== m; ) {
|
|
653
|
+
const w = Y(g), p = g.getBoundingClientRect(), x = P(g), y = p.left + (g.clientLeft + parseFloat(x.paddingLeft)) * w.x, b = p.top + (g.clientTop + parseFloat(x.paddingTop)) * w.y;
|
|
654
|
+
c *= w.x, f *= w.y, h *= w.x, u *= w.y, c += y, f += b, m = R(g), g = xt(m);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return lt({
|
|
658
|
+
width: h,
|
|
659
|
+
height: u,
|
|
660
|
+
x: c,
|
|
661
|
+
y: f
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
function ut(t, e) {
|
|
665
|
+
const n = ft(t).scrollLeft;
|
|
666
|
+
return e ? e.left + n : j(D(t)).left + n;
|
|
667
|
+
}
|
|
668
|
+
function zt(t, e) {
|
|
669
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ut(t, n), o = n.top + e.scrollTop;
|
|
670
|
+
return {
|
|
671
|
+
x: i,
|
|
672
|
+
y: o
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function ge(t) {
|
|
676
|
+
let {
|
|
677
|
+
elements: e,
|
|
678
|
+
rect: n,
|
|
679
|
+
offsetParent: i,
|
|
680
|
+
strategy: o
|
|
681
|
+
} = t;
|
|
682
|
+
const s = o === "fixed", r = D(i), l = e ? at(e.floating) : !1;
|
|
683
|
+
if (i === r || l && s)
|
|
684
|
+
return n;
|
|
685
|
+
let c = {
|
|
686
|
+
scrollLeft: 0,
|
|
687
|
+
scrollTop: 0
|
|
688
|
+
}, f = L(1);
|
|
689
|
+
const h = L(0), u = W(i);
|
|
690
|
+
if ((u || !u && !s) && ((K(i) !== "body" || it(r)) && (c = ft(i)), u)) {
|
|
691
|
+
const a = j(i);
|
|
692
|
+
f = Y(i), h.x = a.x + i.clientLeft, h.y = a.y + i.clientTop;
|
|
693
|
+
}
|
|
694
|
+
const d = r && !u && !s ? zt(r, c) : L(0);
|
|
695
|
+
return {
|
|
696
|
+
width: n.width * f.x,
|
|
697
|
+
height: n.height * f.y,
|
|
698
|
+
x: n.x * f.x - c.scrollLeft * f.x + h.x + d.x,
|
|
699
|
+
y: n.y * f.y - c.scrollTop * f.y + h.y + d.y
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function pe(t) {
|
|
703
|
+
return Array.from(t.getClientRects());
|
|
704
|
+
}
|
|
705
|
+
function we(t) {
|
|
706
|
+
const e = D(t), n = ft(t), i = t.ownerDocument.body, o = _(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = _(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
707
|
+
let r = -n.scrollLeft + ut(t);
|
|
708
|
+
const l = -n.scrollTop;
|
|
709
|
+
return P(i).direction === "rtl" && (r += _(e.clientWidth, i.clientWidth) - o), {
|
|
710
|
+
width: o,
|
|
711
|
+
height: s,
|
|
712
|
+
x: r,
|
|
713
|
+
y: l
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
const Lt = 25;
|
|
717
|
+
function xe(t, e) {
|
|
718
|
+
const n = R(t), i = D(t), o = n.visualViewport;
|
|
719
|
+
let s = i.clientWidth, r = i.clientHeight, l = 0, c = 0;
|
|
720
|
+
if (o) {
|
|
721
|
+
s = o.width, r = o.height;
|
|
722
|
+
const h = At();
|
|
723
|
+
(!h || h && e === "fixed") && (l = o.offsetLeft, c = o.offsetTop);
|
|
724
|
+
}
|
|
725
|
+
const f = ut(i);
|
|
726
|
+
if (f <= 0) {
|
|
727
|
+
const h = i.ownerDocument, u = h.body, d = getComputedStyle(u), a = h.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(i.clientWidth - u.clientWidth - a);
|
|
728
|
+
m <= Lt && (s -= m);
|
|
729
|
+
} else f <= Lt && (s += f);
|
|
730
|
+
return {
|
|
731
|
+
width: s,
|
|
732
|
+
height: r,
|
|
733
|
+
x: l,
|
|
734
|
+
y: c
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function ye(t, e) {
|
|
738
|
+
const n = j(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, s = W(t) ? Y(t) : L(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = o * s.x, f = i * s.y;
|
|
739
|
+
return {
|
|
740
|
+
width: r,
|
|
741
|
+
height: l,
|
|
742
|
+
x: c,
|
|
743
|
+
y: f
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function Dt(t, e, n) {
|
|
747
|
+
let i;
|
|
748
|
+
if (e === "viewport")
|
|
749
|
+
i = xe(t, n);
|
|
750
|
+
else if (e === "document")
|
|
751
|
+
i = we(D(t));
|
|
752
|
+
else if (T(e))
|
|
753
|
+
i = ye(e, n);
|
|
754
|
+
else {
|
|
755
|
+
const o = It(t);
|
|
756
|
+
i = {
|
|
757
|
+
x: e.x - o.x,
|
|
758
|
+
y: e.y - o.y,
|
|
759
|
+
width: e.width,
|
|
760
|
+
height: e.height
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
return lt(i);
|
|
764
|
+
}
|
|
765
|
+
function Ht(t, e) {
|
|
766
|
+
const n = $(t);
|
|
767
|
+
return n === e || !T(n) || Z(n) ? !1 : P(n).position === "fixed" || Ht(n, e);
|
|
768
|
+
}
|
|
769
|
+
function be(t, e) {
|
|
770
|
+
const n = e.get(t);
|
|
771
|
+
if (n)
|
|
772
|
+
return n;
|
|
773
|
+
let i = tt(t, [], !1).filter((l) => T(l) && K(l) !== "body"), o = null;
|
|
774
|
+
const s = P(t).position === "fixed";
|
|
775
|
+
let r = s ? $(t) : t;
|
|
776
|
+
for (; T(r) && !Z(r); ) {
|
|
777
|
+
const l = P(r), c = Et(r);
|
|
778
|
+
!c && l.position === "fixed" && (o = null), (s ? !c && !o : !c && l.position === "static" && !!o && (o.position === "absolute" || o.position === "fixed") || it(r) && !c && Ht(t, r)) ? i = i.filter((h) => h !== r) : o = l, r = $(r);
|
|
779
|
+
}
|
|
780
|
+
return e.set(t, i), i;
|
|
781
|
+
}
|
|
782
|
+
function ve(t) {
|
|
783
|
+
let {
|
|
784
|
+
element: e,
|
|
785
|
+
boundary: n,
|
|
786
|
+
rootBoundary: i,
|
|
787
|
+
strategy: o
|
|
788
|
+
} = t;
|
|
789
|
+
const r = [...n === "clippingAncestors" ? at(e) ? [] : be(e, this._c) : [].concat(n), i], l = Dt(e, r[0], o);
|
|
790
|
+
let c = l.top, f = l.right, h = l.bottom, u = l.left;
|
|
791
|
+
for (let d = 1; d < r.length; d++) {
|
|
792
|
+
const a = Dt(e, r[d], o);
|
|
793
|
+
c = _(a.top, c), f = q(a.right, f), h = q(a.bottom, h), u = _(a.left, u);
|
|
794
|
+
}
|
|
795
|
+
return {
|
|
796
|
+
width: f - u,
|
|
797
|
+
height: h - c,
|
|
798
|
+
x: u,
|
|
799
|
+
y: c
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function Ee(t) {
|
|
803
|
+
const {
|
|
804
|
+
width: e,
|
|
805
|
+
height: n
|
|
806
|
+
} = Vt(t);
|
|
807
|
+
return {
|
|
808
|
+
width: e,
|
|
809
|
+
height: n
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
function Ae(t, e, n) {
|
|
813
|
+
const i = W(e), o = D(e), s = n === "fixed", r = j(t, !0, s, e);
|
|
814
|
+
let l = {
|
|
815
|
+
scrollLeft: 0,
|
|
816
|
+
scrollTop: 0
|
|
817
|
+
};
|
|
818
|
+
const c = L(0);
|
|
819
|
+
function f() {
|
|
820
|
+
c.x = ut(o);
|
|
821
|
+
}
|
|
822
|
+
if (i || !i && !s)
|
|
823
|
+
if ((K(e) !== "body" || it(o)) && (l = ft(e)), i) {
|
|
824
|
+
const a = j(e, !0, s, e);
|
|
825
|
+
c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
|
|
826
|
+
} else o && f();
|
|
827
|
+
s && !i && o && f();
|
|
828
|
+
const h = o && !i && !s ? zt(o, l) : L(0), u = r.left + l.scrollLeft - c.x - h.x, d = r.top + l.scrollTop - c.y - h.y;
|
|
829
|
+
return {
|
|
830
|
+
x: u,
|
|
831
|
+
y: d,
|
|
832
|
+
width: r.width,
|
|
833
|
+
height: r.height
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function dt(t) {
|
|
837
|
+
return P(t).position === "static";
|
|
838
|
+
}
|
|
839
|
+
function Ft(t, e) {
|
|
840
|
+
if (!W(t) || P(t).position === "fixed")
|
|
841
|
+
return null;
|
|
842
|
+
if (e)
|
|
843
|
+
return e(t);
|
|
844
|
+
let n = t.offsetParent;
|
|
845
|
+
return D(t) === n && (n = n.ownerDocument.body), n;
|
|
846
|
+
}
|
|
847
|
+
function _t(t, e) {
|
|
848
|
+
const n = R(t);
|
|
849
|
+
if (at(t))
|
|
850
|
+
return n;
|
|
851
|
+
if (!W(t)) {
|
|
852
|
+
let o = $(t);
|
|
853
|
+
for (; o && !Z(o); ) {
|
|
854
|
+
if (T(o) && !dt(o))
|
|
855
|
+
return o;
|
|
856
|
+
o = $(o);
|
|
857
|
+
}
|
|
858
|
+
return n;
|
|
859
|
+
}
|
|
860
|
+
let i = Ft(t, e);
|
|
861
|
+
for (; i && ae(i) && dt(i); )
|
|
862
|
+
i = Ft(i, e);
|
|
863
|
+
return i && Z(i) && dt(i) && !Et(i) ? n : i || he(t) || n;
|
|
864
|
+
}
|
|
865
|
+
const Re = async function(t) {
|
|
866
|
+
const e = this.getOffsetParent || _t, n = this.getDimensions, i = await n(t.floating);
|
|
867
|
+
return {
|
|
868
|
+
reference: Ae(t.reference, await e(t.floating), t.strategy),
|
|
869
|
+
floating: {
|
|
870
|
+
x: 0,
|
|
871
|
+
y: 0,
|
|
872
|
+
width: i.width,
|
|
873
|
+
height: i.height
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
function Oe(t) {
|
|
878
|
+
return P(t).direction === "rtl";
|
|
879
|
+
}
|
|
880
|
+
const yt = {
|
|
881
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ge,
|
|
882
|
+
getDocumentElement: D,
|
|
883
|
+
getClippingRect: ve,
|
|
884
|
+
getOffsetParent: _t,
|
|
885
|
+
getElementRects: Re,
|
|
886
|
+
getClientRects: pe,
|
|
887
|
+
getDimensions: Ee,
|
|
888
|
+
getScale: Y,
|
|
889
|
+
isElement: T,
|
|
890
|
+
isRTL: Oe
|
|
891
|
+
};
|
|
892
|
+
function Ut(t, e) {
|
|
893
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
894
|
+
}
|
|
895
|
+
function Ce(t, e) {
|
|
896
|
+
let n = null, i;
|
|
897
|
+
const o = D(t);
|
|
898
|
+
function s() {
|
|
899
|
+
var l;
|
|
900
|
+
clearTimeout(i), (l = n) == null || l.disconnect(), n = null;
|
|
901
|
+
}
|
|
902
|
+
function r(l, c) {
|
|
903
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), s();
|
|
904
|
+
const f = t.getBoundingClientRect(), {
|
|
905
|
+
left: h,
|
|
906
|
+
top: u,
|
|
907
|
+
width: d,
|
|
908
|
+
height: a
|
|
909
|
+
} = f;
|
|
910
|
+
if (l || e(), !d || !a)
|
|
911
|
+
return;
|
|
912
|
+
const m = ot(u), g = ot(o.clientWidth - (h + d)), w = ot(o.clientHeight - (u + a)), p = ot(h), y = {
|
|
913
|
+
rootMargin: -m + "px " + -g + "px " + -w + "px " + -p + "px",
|
|
914
|
+
threshold: _(0, q(1, c)) || 1
|
|
915
|
+
};
|
|
916
|
+
let b = !0;
|
|
917
|
+
function A(v) {
|
|
918
|
+
const O = v[0].intersectionRatio;
|
|
919
|
+
if (O !== c) {
|
|
920
|
+
if (!b)
|
|
921
|
+
return r();
|
|
922
|
+
O ? r(!1, O) : i = setTimeout(() => {
|
|
923
|
+
r(!1, 1e-7);
|
|
924
|
+
}, 1e3);
|
|
925
|
+
}
|
|
926
|
+
O === 1 && !Ut(f, t.getBoundingClientRect()) && r(), b = !1;
|
|
927
|
+
}
|
|
928
|
+
try {
|
|
929
|
+
n = new IntersectionObserver(A, {
|
|
930
|
+
...y,
|
|
931
|
+
// Handle <iframe>s
|
|
932
|
+
root: o.ownerDocument
|
|
933
|
+
});
|
|
934
|
+
} catch {
|
|
935
|
+
n = new IntersectionObserver(A, y);
|
|
936
|
+
}
|
|
937
|
+
n.observe(t);
|
|
938
|
+
}
|
|
939
|
+
return r(!0), s;
|
|
940
|
+
}
|
|
941
|
+
function Se(t, e, n, i) {
|
|
942
|
+
i === void 0 && (i = {});
|
|
943
|
+
const {
|
|
944
|
+
ancestorScroll: o = !0,
|
|
945
|
+
ancestorResize: s = !0,
|
|
946
|
+
elementResize: r = typeof ResizeObserver == "function",
|
|
947
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
948
|
+
animationFrame: c = !1
|
|
949
|
+
} = i, f = Rt(t), h = o || s ? [...f ? tt(f) : [], ...e ? tt(e) : []] : [];
|
|
950
|
+
h.forEach((p) => {
|
|
951
|
+
o && p.addEventListener("scroll", n, {
|
|
952
|
+
passive: !0
|
|
953
|
+
}), s && p.addEventListener("resize", n);
|
|
954
|
+
});
|
|
955
|
+
const u = f && l ? Ce(f, n) : null;
|
|
956
|
+
let d = -1, a = null;
|
|
957
|
+
r && (a = new ResizeObserver((p) => {
|
|
958
|
+
let [x] = p;
|
|
959
|
+
x && x.target === f && a && e && (a.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
|
|
960
|
+
var y;
|
|
961
|
+
(y = a) == null || y.observe(e);
|
|
962
|
+
})), n();
|
|
963
|
+
}), f && !c && a.observe(f), e && a.observe(e));
|
|
964
|
+
let m, g = c ? j(t) : null;
|
|
965
|
+
c && w();
|
|
966
|
+
function w() {
|
|
967
|
+
const p = j(t);
|
|
968
|
+
g && !Ut(g, p) && n(), g = p, m = requestAnimationFrame(w);
|
|
969
|
+
}
|
|
970
|
+
return n(), () => {
|
|
971
|
+
var p;
|
|
972
|
+
h.forEach((x) => {
|
|
973
|
+
o && x.removeEventListener("scroll", n), s && x.removeEventListener("resize", n);
|
|
974
|
+
}), u?.(), (p = a) == null || p.disconnect(), a = null, c && cancelAnimationFrame(m);
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
const Te = le, Pe = ce, Le = oe, De = ie, Fe = (t, e, n) => {
|
|
978
|
+
const i = /* @__PURE__ */ new Map(), o = {
|
|
979
|
+
platform: yt,
|
|
980
|
+
...n
|
|
981
|
+
}, s = {
|
|
982
|
+
...o.platform,
|
|
983
|
+
_c: i
|
|
984
|
+
};
|
|
985
|
+
return ne(t, e, {
|
|
986
|
+
...o,
|
|
987
|
+
platform: s
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
function Nt(t) {
|
|
991
|
+
var e;
|
|
992
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
993
|
+
}
|
|
994
|
+
const Ne = /transform|translate|scale|rotate|perspective|filter/, We = /paint|layout|strict|content/, H = (t) => !!t && t !== "none";
|
|
995
|
+
let mt;
|
|
996
|
+
function Me(t) {
|
|
997
|
+
const e = (n = t, typeof window < "u" && (n instanceof Element || n instanceof Nt(n).Element) ? Nt(i = t).getComputedStyle(i) : t);
|
|
998
|
+
var n, i;
|
|
999
|
+
return H(e.transform) || H(e.translate) || H(e.scale) || H(e.rotate) || H(e.perspective) || (mt == null && (mt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), !mt && (H(e.backdropFilter) || H(e.filter))) || Ne.test(e.willChange || "") || We.test(e.contain || "");
|
|
1000
|
+
}
|
|
1001
|
+
function ke(t) {
|
|
1002
|
+
return (function(e) {
|
|
1003
|
+
for (let n = e; n; n = gt(n)) if (n instanceof Element && getComputedStyle(n).display === "none") return null;
|
|
1004
|
+
for (let n = gt(e); n; n = gt(n)) {
|
|
1005
|
+
if (!(n instanceof Element)) continue;
|
|
1006
|
+
const i = getComputedStyle(n);
|
|
1007
|
+
if (i.display !== "contents" && (i.position !== "static" || Me(i) || n.tagName === "BODY"))
|
|
1008
|
+
return n;
|
|
1009
|
+
}
|
|
1010
|
+
return null;
|
|
1011
|
+
})(t);
|
|
1012
|
+
}
|
|
1013
|
+
function gt(t) {
|
|
1014
|
+
return t.assignedSlot ? t.assignedSlot : t.parentNode instanceof ShadowRoot ? t.parentNode.host : t.parentNode;
|
|
1015
|
+
}
|
|
1016
|
+
const X = class X {
|
|
1017
|
+
constructor(e, n) {
|
|
1018
|
+
this.el = e, this.config = n, this.offset = 10, this.timeDelayBeforeFadingOut = 50, this.popoverMainAxisEnabled = !0, this.currentPlacement = n.placement, this.cleanup = null;
|
|
1019
|
+
}
|
|
1020
|
+
setCommonTimingConfig() {
|
|
1021
|
+
this.timeBeforeElementShows = this.config.showWithoutDelay ? 50 : 500, this.timeOfAnimation = this.config.showWithoutDelay ? 50 : 250;
|
|
1022
|
+
}
|
|
1023
|
+
initialize() {
|
|
1024
|
+
this.setCommonTimingConfig(), this.floatingElement = this.el.shadowRoot?.querySelector(this.config.floatingElementSelector), this.floatingElement && this.applyViewportMaxWidth(), this.arrowEl = this.config.showArrow !== !1 && this.config.arrowElementSelector ? this.el.shadowRoot?.querySelector(this.config.arrowElementSelector) : null, this.anchorElement = this.config.htmlFor?.length > 0 ? document.getElementById(this.config.htmlFor) : this.config.getAnchorElementFromSlot(this.el.shadowRoot), this.anchorElement ? this.setupPositioning() : console.warn("Could not determine the element associated with this floating element." + (this.config.htmlFor?.length > 0 ? `Element with id=${this.config.htmlFor} could not be found on the DOM.` : ""));
|
|
1025
|
+
}
|
|
1026
|
+
getAnchorElement() {
|
|
1027
|
+
return this.anchorElement;
|
|
1028
|
+
}
|
|
1029
|
+
updateConfig(e) {
|
|
1030
|
+
this.config = { ...this.config, ...e }, "showWithoutDelay" in e && this.setCommonTimingConfig(), this.forceUpdate();
|
|
1031
|
+
}
|
|
1032
|
+
getConfig() {
|
|
1033
|
+
return this.config;
|
|
1034
|
+
}
|
|
1035
|
+
getCurrentPlacement() {
|
|
1036
|
+
return this.currentPlacement || this.config.placement;
|
|
1037
|
+
}
|
|
1038
|
+
reposition() {
|
|
1039
|
+
this.forceUpdate();
|
|
1040
|
+
}
|
|
1041
|
+
forceUpdate() {
|
|
1042
|
+
this.anchorElement && this.floatingElement && this.updatePosition();
|
|
1043
|
+
}
|
|
1044
|
+
setupPositioning() {
|
|
1045
|
+
this.anchorElement && this.updatePosition();
|
|
1046
|
+
}
|
|
1047
|
+
setupAutoUpdate() {
|
|
1048
|
+
!this.cleanup && this.anchorElement && (this.cleanup = Se(this.anchorElement, this.floatingElement, (() => {
|
|
1049
|
+
this.updatePosition();
|
|
1050
|
+
}), { ancestorScroll: !0, ancestorResize: !1, elementResize: !0, layoutShift: !0, animationFrame: !1 }));
|
|
1051
|
+
}
|
|
1052
|
+
cleanupAutoUpdate() {
|
|
1053
|
+
this.cleanup && (this.cleanup(), this.cleanup = null);
|
|
1054
|
+
}
|
|
1055
|
+
updatePosition() {
|
|
1056
|
+
if (!this.anchorElement) return;
|
|
1057
|
+
const e = [Te(this.offset)], n = Le({ mainAxis: !0, crossAxis: !this.config.lockToMainAxis && "alignment", fallbackAxisSideDirection: "end", padding: this.offset }), i = this.config.elementType === Ot.POPOVER, o = Pe({ padding: this.offset, mainAxis: this.config.elementType === Ot.TOOLTIP || i && this.popoverMainAxisEnabled, crossAxis: !1 });
|
|
1058
|
+
this.config.placement.includes("-") ? e.push(n, o) : e.push(o, n), this.config.showArrow !== !1 && this.arrowEl && e.push(De({ element: this.arrowEl, padding: this.offset })), Fe(this.anchorElement, this.floatingElement, { placement: this.config.placement, strategy: "fixed", middleware: e, platform: { ...yt, getOffsetParent: (s) => yt.getOffsetParent(s, ke) } }).then((({ x: s, y: r, middlewareData: l, placement: c }) => {
|
|
1059
|
+
if (i) {
|
|
1060
|
+
const d = c.startsWith("left") || c.startsWith("right"), a = c.startsWith("top") || c.startsWith("bottom"), m = this.isAnchorInViewport(), g = !!a || (d ? m : this.popoverMainAxisEnabled);
|
|
1061
|
+
if (g !== this.popoverMainAxisEnabled) return this.popoverMainAxisEnabled = g, void this.updatePosition();
|
|
1062
|
+
}
|
|
1063
|
+
this.currentPlacement = c, Object.assign(this.floatingElement.style, { left: `${s}px`, top: `${r}px`, position: "fixed", transition: `opacity ${this.timeOfAnimation}ms ease` });
|
|
1064
|
+
const f = c.split("-")[0] ?? "bottom", h = { top: "bottom", right: "left", bottom: "top", left: "right" }[f], { arrowZIndex: u } = this.normalizeFloatingElementStacking();
|
|
1065
|
+
if (l.arrow && this.arrowEl) {
|
|
1066
|
+
const d = this.arrowEl.offsetWidth, { x: a, y: m } = l.arrow;
|
|
1067
|
+
this.arrowEl.style.borderRadius = `${["left", "right"].includes(f) ? "0 " : ""}var(--gidsFloatingElement-tip-border-radius, 2px)${["top", "bottom"].includes(f) ? " 0" : ""}`, Object.assign(this.arrowEl.style, { left: a !== null ? `${a}px` : "", top: m !== null ? `${m}px` : "", right: "", bottom: "", [h]: -d / 2 + "px", transform: "rotate(45deg)", zIndex: `${u}`, background: "var(--gidsFloatingElement-background)" });
|
|
1068
|
+
}
|
|
1069
|
+
}));
|
|
1070
|
+
}
|
|
1071
|
+
applyViewportMaxWidth() {
|
|
1072
|
+
const e = `calc(100vw - ${2 * this.offset}px)`;
|
|
1073
|
+
this.floatingElement?.style.maxWidth !== e && (this.floatingElement.style.maxWidth = e);
|
|
1074
|
+
}
|
|
1075
|
+
normalizeFloatingElementStacking() {
|
|
1076
|
+
const e = this.floatingElement.style.zIndex || (window.getComputedStyle?.(this.floatingElement).zIndex ?? ""), n = Number.parseInt(e, 10), i = Number.isNaN(n) ? -1 : n - 1, o = Number.isNaN(n) ? i + 1 : n;
|
|
1077
|
+
return Number.isNaN(o) || (this.floatingElement.style.zIndex = `${o}`), Array.from(this.floatingElement.children).forEach(((s) => {
|
|
1078
|
+
if (!(s instanceof HTMLElement) || s === this.arrowEl) return;
|
|
1079
|
+
const r = s.style.zIndex || (window.getComputedStyle?.(s).zIndex ?? ""), l = Number.parseInt(r, 10), c = window.getComputedStyle?.(s).position ?? "";
|
|
1080
|
+
(r === "" || r === "auto" || Number.isNaN(l) || l < o) && (s.style.zIndex = `${o}`, c !== "" && c !== "static" || (s.style.position = "relative"));
|
|
1081
|
+
})), { contentZIndex: o, arrowZIndex: i };
|
|
1082
|
+
}
|
|
1083
|
+
hideFloatingElement() {
|
|
1084
|
+
this.floatingElement.classList.remove(this.config.visibilityClass), X.currentFloatingElements.delete(this.config.elementType);
|
|
1085
|
+
}
|
|
1086
|
+
showFloatingElement() {
|
|
1087
|
+
const e = X.currentFloatingElements.get(this.config.elementType);
|
|
1088
|
+
e && e.hideFloatingElement(), this.floatingElement.classList.add(this.config.visibilityClass), X.currentFloatingElements.set(this.config.elementType, this);
|
|
1089
|
+
}
|
|
1090
|
+
isVisible() {
|
|
1091
|
+
return this.floatingElement.classList.contains(this.config.visibilityClass);
|
|
1092
|
+
}
|
|
1093
|
+
show() {
|
|
1094
|
+
this.setupAutoUpdate(), this.showFloatingElement();
|
|
1095
|
+
}
|
|
1096
|
+
hide() {
|
|
1097
|
+
this.cleanupAutoUpdate(), this.hideFloatingElement();
|
|
1098
|
+
}
|
|
1099
|
+
toggle() {
|
|
1100
|
+
this.isVisible() ? this.hide() : this.show();
|
|
1101
|
+
}
|
|
1102
|
+
showAfterDelay() {
|
|
1103
|
+
clearTimeout(this.hoverOutTimeout), this.hoverTimeout = setTimeout((() => {
|
|
1104
|
+
this.show();
|
|
1105
|
+
}), this.timeBeforeElementShows);
|
|
1106
|
+
}
|
|
1107
|
+
hideAfterDelay() {
|
|
1108
|
+
clearTimeout(this.hoverTimeout), this.hoverOutTimeout = setTimeout((() => {
|
|
1109
|
+
this.hide();
|
|
1110
|
+
}), this.timeDelayBeforeFadingOut);
|
|
1111
|
+
}
|
|
1112
|
+
cancelDelayedActions() {
|
|
1113
|
+
clearTimeout(this.hoverTimeout), clearTimeout(this.hoverOutTimeout);
|
|
1114
|
+
}
|
|
1115
|
+
destroy() {
|
|
1116
|
+
this.cleanupAutoUpdate(), this.cancelDelayedActions();
|
|
1117
|
+
}
|
|
1118
|
+
isAnchorInViewport() {
|
|
1119
|
+
if (!(this.anchorElement && this.anchorElement instanceof Element)) return !1;
|
|
1120
|
+
const e = this.anchorElement.getBoundingClientRect(), n = window.innerHeight || document.documentElement?.clientHeight || 0, i = window.innerWidth || document.documentElement?.clientWidth || 0, o = e.height / 2 + 2 * this.offset;
|
|
1121
|
+
return e.bottom >= o && e.top <= n - o && e.right >= 0 && e.left <= i;
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
X.currentFloatingElements = /* @__PURE__ */ new Map();
|
|
1125
|
+
let Wt = X;
|
|
1126
|
+
export {
|
|
1127
|
+
Wt as g
|
|
1128
|
+
};
|