@ed.yakovich/component-library 0.0.1
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/README.md +53 -0
- package/dist/components/Accordion/context/index.js +7 -0
- package/dist/components/Accordion/index.js +38 -0
- package/dist/components/Accordion/types/index.js +1 -0
- package/dist/components/Cart/index.js +35 -0
- package/dist/components/EquipmentSummary/context/index.js +10 -0
- package/dist/components/EquipmentSummary/index.js +65 -0
- package/dist/components/EquipmentSummary/types/index.js +1 -0
- package/dist/components/Grid/index.js +19 -0
- package/dist/components/HeroBanner/context/index.js +7 -0
- package/dist/components/HeroBanner/index.js +33 -0
- package/dist/components/HeroBanner/types/index.js +1 -0
- package/dist/components/InfoBanner/context/index.js +7 -0
- package/dist/components/InfoBanner/index.js +26 -0
- package/dist/components/InfoBanner/types/index.js +1 -0
- package/dist/components/Nav/index.js +23 -0
- package/dist/components/OfferCards/context/index.js +7 -0
- package/dist/components/OfferCards/index.js +30 -0
- package/dist/components/OfferCards/subComponents/OfferCard.js +62 -0
- package/dist/components/OfferCards/types/index.js +1 -0
- package/dist/components/SaleBanner/context/index.js +7 -0
- package/dist/components/SaleBanner/index.js +59 -0
- package/dist/components/SaleBanner/types/index.js +1 -0
- package/dist/components/StickyFooter/index.js +11 -0
- package/dist/index-0d8e0844-BJzWsYCM.js +7403 -0
- package/dist/index-C9Rf5U9q.js +29143 -0
- package/dist/index-b30029d4-E1YxEHFH.js +12 -0
- package/dist/index-e6818ded-r_t6ryaW.js +57 -0
- package/dist/index.esm-322571ff-D1REhsOg.js +41 -0
- package/dist/lib/components/Accordion/context/index.d.ts +10 -0
- package/dist/lib/components/Accordion/index.d.ts +2 -0
- package/dist/lib/components/Accordion/types/index.d.ts +13 -0
- package/dist/lib/components/Cart/index.d.ts +6 -0
- package/dist/lib/components/EquipmentSummary/context/index.d.ts +10 -0
- package/dist/lib/components/EquipmentSummary/index.d.ts +2 -0
- package/dist/lib/components/EquipmentSummary/types/index.d.ts +14 -0
- package/dist/lib/components/Grid/index.d.ts +13 -0
- package/dist/lib/components/HeroBanner/context/index.d.ts +10 -0
- package/dist/lib/components/HeroBanner/index.d.ts +2 -0
- package/dist/lib/components/HeroBanner/types/index.d.ts +11 -0
- package/dist/lib/components/InfoBanner/context/index.d.ts +10 -0
- package/dist/lib/components/InfoBanner/index.d.ts +2 -0
- package/dist/lib/components/InfoBanner/types/index.d.ts +7 -0
- package/dist/lib/components/Nav/index.d.ts +8 -0
- package/dist/lib/components/OfferCards/context/index.d.ts +9 -0
- package/dist/lib/components/OfferCards/index.d.ts +2 -0
- package/dist/lib/components/OfferCards/subComponents/OfferCard.d.ts +3 -0
- package/dist/lib/components/OfferCards/types/index.d.ts +26 -0
- package/dist/lib/components/SaleBanner/context/index.d.ts +10 -0
- package/dist/lib/components/SaleBanner/index.d.ts +2 -0
- package/dist/lib/components/SaleBanner/types/index.d.ts +11 -0
- package/dist/lib/components/StickyFooter/index.d.ts +7 -0
- package/dist/lib/main.d.ts +16 -0
- package/dist/link-DO_Jvm9n.js +685 -0
- package/dist/main.js +34 -0
- package/dist/prism-accordion.entry-DeyFGNx-.js +51 -0
- package/dist/prism-avatar_2.entry-MLbdVrJg.js +68 -0
- package/dist/prism-badge.entry-BG5y7O5U.js +58 -0
- package/dist/prism-banner.entry-DChrjpFH.js +82 -0
- package/dist/prism-breadcrumb.entry-1YzYlKen.js +33 -0
- package/dist/prism-button_2.entry-DO8IGIoS.js +110 -0
- package/dist/prism-card.entry-DQ6P4TZP.js +119 -0
- package/dist/prism-carousel.entry-BA8zsHRW.js +3111 -0
- package/dist/prism-checkbox-group.entry-CP4-gghb.js +62 -0
- package/dist/prism-checkbox.entry-CJCy8fvC.js +99 -0
- package/dist/prism-data-table.entry--0djw8ls.js +10475 -0
- package/dist/prism-datepicker.entry-DPm7tpKB.js +249 -0
- package/dist/prism-form.entry-CS1zRoMt.js +42 -0
- package/dist/prism-grid.entry-jcx2aMUm.js +28 -0
- package/dist/prism-header.entry-CBSIpa0M.js +202 -0
- package/dist/prism-hero.entry-B0CKL5y9.js +23 -0
- package/dist/prism-icon_2.entry-Aja4QGUK.js +118 -0
- package/dist/prism-image.entry-B--khr6E.js +38 -0
- package/dist/prism-input-file.entry-i5qJkwEK.js +119 -0
- package/dist/prism-input-otp.entry-DXoARuzH.js +63 -0
- package/dist/prism-input-text.entry-D4QQ-dYX.js +228 -0
- package/dist/prism-input-textarea.entry-eeQHnhqC.js +140 -0
- package/dist/prism-layout.entry-bfKqOEnU.js +20 -0
- package/dist/prism-lineitem.entry-YIRZPVe_.js +44 -0
- package/dist/prism-menu.entry-BIlRCiaA.js +231 -0
- package/dist/prism-modal.entry-Kc-SpAR-.js +94 -0
- package/dist/prism-pagination.entry-BCo9aMdq.js +60 -0
- package/dist/prism-popover.entry-LmDvzCiR.js +1013 -0
- package/dist/prism-popper.entry-BqrcyTkE.js +959 -0
- package/dist/prism-progress.entry-29_ezvop.js +79 -0
- package/dist/prism-radio-group.entry-cL6AqjTk.js +66 -0
- package/dist/prism-radio.entry-CM_vZFZA.js +101 -0
- package/dist/prism-select.entry-B6A3gk7B.js +230 -0
- package/dist/prism-switch.entry-CtEfKB58.js +95 -0
- package/dist/prism-tab.entry-DIDUhFlk.js +20 -0
- package/dist/prism-tabs.entry-Cj3dW5_E.js +70 -0
- package/dist/prism-tooltip.entry-DEdY5eRd.js +52 -0
- package/dist/prism-typeahead.entry-D2XrvXaG.js +1234 -0
- package/package.json +56 -0
|
@@ -0,0 +1,1013 @@
|
|
|
1
|
+
import { r as Rt, h as U, H as Ft, g as Tt } from "./index-C9Rf5U9q.js";
|
|
2
|
+
import { g as It } from "./index-e6818ded-r_t6ryaW.js";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
|
|
5
|
+
*/
|
|
6
|
+
const $ = Math.min, M = Math.max, Z = Math.round, Q = Math.floor, S = (t) => ({
|
|
7
|
+
x: t,
|
|
8
|
+
y: t
|
|
9
|
+
}), Pt = {
|
|
10
|
+
left: "right",
|
|
11
|
+
right: "left",
|
|
12
|
+
bottom: "top",
|
|
13
|
+
top: "bottom"
|
|
14
|
+
}, St = {
|
|
15
|
+
start: "end",
|
|
16
|
+
end: "start"
|
|
17
|
+
};
|
|
18
|
+
function rt(t, e, o) {
|
|
19
|
+
return M(t, $(e, o));
|
|
20
|
+
}
|
|
21
|
+
function G(t, e) {
|
|
22
|
+
return typeof t == "function" ? t(e) : t;
|
|
23
|
+
}
|
|
24
|
+
function B(t) {
|
|
25
|
+
return t.split("-")[0];
|
|
26
|
+
}
|
|
27
|
+
function K(t) {
|
|
28
|
+
return t.split("-")[1];
|
|
29
|
+
}
|
|
30
|
+
function bt(t) {
|
|
31
|
+
return t === "x" ? "y" : "x";
|
|
32
|
+
}
|
|
33
|
+
function lt(t) {
|
|
34
|
+
return t === "y" ? "height" : "width";
|
|
35
|
+
}
|
|
36
|
+
function ot(t) {
|
|
37
|
+
return ["top", "bottom"].includes(B(t)) ? "y" : "x";
|
|
38
|
+
}
|
|
39
|
+
function ct(t) {
|
|
40
|
+
return bt(ot(t));
|
|
41
|
+
}
|
|
42
|
+
function Dt(t, e, o) {
|
|
43
|
+
o === void 0 && (o = !1);
|
|
44
|
+
const n = K(t), i = ct(t), s = lt(i);
|
|
45
|
+
let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
46
|
+
return e.reference[s] > e.floating[s] && (r = tt(r)), [r, tt(r)];
|
|
47
|
+
}
|
|
48
|
+
function Nt(t) {
|
|
49
|
+
const e = tt(t);
|
|
50
|
+
return [st(t), e, st(e)];
|
|
51
|
+
}
|
|
52
|
+
function st(t) {
|
|
53
|
+
return t.replace(/start|end/g, (e) => St[e]);
|
|
54
|
+
}
|
|
55
|
+
function Ut(t, e, o) {
|
|
56
|
+
const n = ["left", "right"], i = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
57
|
+
switch (t) {
|
|
58
|
+
case "top":
|
|
59
|
+
case "bottom":
|
|
60
|
+
return o ? e ? i : n : e ? n : i;
|
|
61
|
+
case "left":
|
|
62
|
+
case "right":
|
|
63
|
+
return e ? s : r;
|
|
64
|
+
default:
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function Mt(t, e, o, n) {
|
|
69
|
+
const i = K(t);
|
|
70
|
+
let s = Ut(B(t), o === "start", n);
|
|
71
|
+
return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), s;
|
|
72
|
+
}
|
|
73
|
+
function tt(t) {
|
|
74
|
+
return t.replace(/left|right|bottom|top/g, (e) => Pt[e]);
|
|
75
|
+
}
|
|
76
|
+
function Bt(t) {
|
|
77
|
+
return {
|
|
78
|
+
top: 0,
|
|
79
|
+
right: 0,
|
|
80
|
+
bottom: 0,
|
|
81
|
+
left: 0,
|
|
82
|
+
...t
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function wt(t) {
|
|
86
|
+
return typeof t != "number" ? Bt(t) : {
|
|
87
|
+
top: t,
|
|
88
|
+
right: t,
|
|
89
|
+
bottom: t,
|
|
90
|
+
left: t
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function et(t) {
|
|
94
|
+
return {
|
|
95
|
+
...t,
|
|
96
|
+
top: t.y,
|
|
97
|
+
left: t.x,
|
|
98
|
+
right: t.x + t.width,
|
|
99
|
+
bottom: t.y + t.height
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function dt(t, e, o) {
|
|
103
|
+
let {
|
|
104
|
+
reference: n,
|
|
105
|
+
floating: i
|
|
106
|
+
} = t;
|
|
107
|
+
const s = ot(e), r = ct(e), l = lt(r), c = B(e), a = s === "y", d = n.x + n.width / 2 - i.width / 2, u = n.y + n.height / 2 - i.height / 2, m = n[l] / 2 - i[l] / 2;
|
|
108
|
+
let f;
|
|
109
|
+
switch (c) {
|
|
110
|
+
case "top":
|
|
111
|
+
f = {
|
|
112
|
+
x: d,
|
|
113
|
+
y: n.y - i.height
|
|
114
|
+
};
|
|
115
|
+
break;
|
|
116
|
+
case "bottom":
|
|
117
|
+
f = {
|
|
118
|
+
x: d,
|
|
119
|
+
y: n.y + n.height
|
|
120
|
+
};
|
|
121
|
+
break;
|
|
122
|
+
case "right":
|
|
123
|
+
f = {
|
|
124
|
+
x: n.x + n.width,
|
|
125
|
+
y: u
|
|
126
|
+
};
|
|
127
|
+
break;
|
|
128
|
+
case "left":
|
|
129
|
+
f = {
|
|
130
|
+
x: n.x - i.width,
|
|
131
|
+
y: u
|
|
132
|
+
};
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
f = {
|
|
136
|
+
x: n.x,
|
|
137
|
+
y: n.y
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
switch (K(e)) {
|
|
141
|
+
case "start":
|
|
142
|
+
f[r] -= m * (o && a ? -1 : 1);
|
|
143
|
+
break;
|
|
144
|
+
case "end":
|
|
145
|
+
f[r] += m * (o && a ? -1 : 1);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
return f;
|
|
149
|
+
}
|
|
150
|
+
const Wt = async (t, e, o) => {
|
|
151
|
+
const {
|
|
152
|
+
placement: n = "bottom",
|
|
153
|
+
strategy: i = "absolute",
|
|
154
|
+
middleware: s = [],
|
|
155
|
+
platform: r
|
|
156
|
+
} = o, l = s.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
157
|
+
let a = await r.getElementRects({
|
|
158
|
+
reference: t,
|
|
159
|
+
floating: e,
|
|
160
|
+
strategy: i
|
|
161
|
+
}), {
|
|
162
|
+
x: d,
|
|
163
|
+
y: u
|
|
164
|
+
} = dt(a, n, c), m = n, f = {}, h = 0;
|
|
165
|
+
for (let p = 0; p < l.length; p++) {
|
|
166
|
+
const {
|
|
167
|
+
name: b,
|
|
168
|
+
fn: g
|
|
169
|
+
} = l[p], {
|
|
170
|
+
x: w,
|
|
171
|
+
y: x,
|
|
172
|
+
data: v,
|
|
173
|
+
reset: y
|
|
174
|
+
} = await g({
|
|
175
|
+
x: d,
|
|
176
|
+
y: u,
|
|
177
|
+
initialPlacement: n,
|
|
178
|
+
placement: m,
|
|
179
|
+
strategy: i,
|
|
180
|
+
middlewareData: f,
|
|
181
|
+
rects: a,
|
|
182
|
+
platform: r,
|
|
183
|
+
elements: {
|
|
184
|
+
reference: t,
|
|
185
|
+
floating: e
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
d = w ?? d, u = x ?? u, f = {
|
|
189
|
+
...f,
|
|
190
|
+
[b]: {
|
|
191
|
+
...f[b],
|
|
192
|
+
...v
|
|
193
|
+
}
|
|
194
|
+
}, y && h <= 50 && (h++, typeof y == "object" && (y.placement && (m = y.placement), y.rects && (a = y.rects === !0 ? await r.getElementRects({
|
|
195
|
+
reference: t,
|
|
196
|
+
floating: e,
|
|
197
|
+
strategy: i
|
|
198
|
+
}) : y.rects), {
|
|
199
|
+
x: d,
|
|
200
|
+
y: u
|
|
201
|
+
} = dt(a, m, c)), p = -1);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
x: d,
|
|
205
|
+
y: u,
|
|
206
|
+
placement: m,
|
|
207
|
+
strategy: i,
|
|
208
|
+
middlewareData: f
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
async function xt(t, e) {
|
|
212
|
+
var o;
|
|
213
|
+
e === void 0 && (e = {});
|
|
214
|
+
const {
|
|
215
|
+
x: n,
|
|
216
|
+
y: i,
|
|
217
|
+
platform: s,
|
|
218
|
+
rects: r,
|
|
219
|
+
elements: l,
|
|
220
|
+
strategy: c
|
|
221
|
+
} = t, {
|
|
222
|
+
boundary: a = "clippingAncestors",
|
|
223
|
+
rootBoundary: d = "viewport",
|
|
224
|
+
elementContext: u = "floating",
|
|
225
|
+
altBoundary: m = !1,
|
|
226
|
+
padding: f = 0
|
|
227
|
+
} = G(e, t), h = wt(f), b = l[m ? u === "floating" ? "reference" : "floating" : u], g = et(await s.getClippingRect({
|
|
228
|
+
element: (o = await (s.isElement == null ? void 0 : s.isElement(b))) == null || o ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
229
|
+
boundary: a,
|
|
230
|
+
rootBoundary: d,
|
|
231
|
+
strategy: c
|
|
232
|
+
})), w = u === "floating" ? {
|
|
233
|
+
...r.floating,
|
|
234
|
+
x: n,
|
|
235
|
+
y: i
|
|
236
|
+
} : r.reference, x = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), v = await (s.isElement == null ? void 0 : s.isElement(x)) ? await (s.getScale == null ? void 0 : s.getScale(x)) || {
|
|
237
|
+
x: 1,
|
|
238
|
+
y: 1
|
|
239
|
+
} : {
|
|
240
|
+
x: 1,
|
|
241
|
+
y: 1
|
|
242
|
+
}, y = et(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
243
|
+
elements: l,
|
|
244
|
+
rect: w,
|
|
245
|
+
offsetParent: x,
|
|
246
|
+
strategy: c
|
|
247
|
+
}) : w);
|
|
248
|
+
return {
|
|
249
|
+
top: (g.top - y.top + h.top) / v.y,
|
|
250
|
+
bottom: (y.bottom - g.bottom + h.bottom) / v.y,
|
|
251
|
+
left: (g.left - y.left + h.left) / v.x,
|
|
252
|
+
right: (y.right - g.right + h.right) / v.x
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const Vt = (t) => ({
|
|
256
|
+
name: "arrow",
|
|
257
|
+
options: t,
|
|
258
|
+
async fn(e) {
|
|
259
|
+
const {
|
|
260
|
+
x: o,
|
|
261
|
+
y: n,
|
|
262
|
+
placement: i,
|
|
263
|
+
rects: s,
|
|
264
|
+
platform: r,
|
|
265
|
+
elements: l,
|
|
266
|
+
middlewareData: c
|
|
267
|
+
} = e, {
|
|
268
|
+
element: a,
|
|
269
|
+
padding: d = 0
|
|
270
|
+
} = G(t, e) || {};
|
|
271
|
+
if (a == null)
|
|
272
|
+
return {};
|
|
273
|
+
const u = wt(d), m = {
|
|
274
|
+
x: o,
|
|
275
|
+
y: n
|
|
276
|
+
}, f = ct(i), h = lt(f), p = await r.getDimensions(a), b = f === "y", g = b ? "top" : "left", w = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", v = s.reference[h] + s.reference[f] - m[f] - s.floating[h], y = m[f] - s.reference[f], L = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
|
|
277
|
+
let C = L ? L[x] : 0;
|
|
278
|
+
(!C || !await (r.isElement == null ? void 0 : r.isElement(L))) && (C = l.floating[x] || s.floating[h]);
|
|
279
|
+
const N = v / 2 - y / 2, z = C / 2 - p[h] / 2 - 1, j = $(u[g], z), X = $(u[w], z), A = j, Y = C - p[h] - X, E = C / 2 - p[h] / 2 + N, O = rt(A, E, Y), R = !c.arrow && K(i) != null && E !== O && s.reference[h] / 2 - (E < A ? j : X) - p[h] / 2 < 0, T = R ? E < A ? E - A : E - Y : 0;
|
|
280
|
+
return {
|
|
281
|
+
[f]: m[f] + T,
|
|
282
|
+
data: {
|
|
283
|
+
[f]: O,
|
|
284
|
+
centerOffset: E - O - T,
|
|
285
|
+
...R && {
|
|
286
|
+
alignmentOffset: T
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
reset: R
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}), $t = function(t) {
|
|
293
|
+
return t === void 0 && (t = {}), {
|
|
294
|
+
name: "flip",
|
|
295
|
+
options: t,
|
|
296
|
+
async fn(e) {
|
|
297
|
+
var o, n;
|
|
298
|
+
const {
|
|
299
|
+
placement: i,
|
|
300
|
+
middlewareData: s,
|
|
301
|
+
rects: r,
|
|
302
|
+
initialPlacement: l,
|
|
303
|
+
platform: c,
|
|
304
|
+
elements: a
|
|
305
|
+
} = e, {
|
|
306
|
+
mainAxis: d = !0,
|
|
307
|
+
crossAxis: u = !0,
|
|
308
|
+
fallbackPlacements: m,
|
|
309
|
+
fallbackStrategy: f = "bestFit",
|
|
310
|
+
fallbackAxisSideDirection: h = "none",
|
|
311
|
+
flipAlignment: p = !0,
|
|
312
|
+
...b
|
|
313
|
+
} = G(t, e);
|
|
314
|
+
if ((o = s.arrow) != null && o.alignmentOffset)
|
|
315
|
+
return {};
|
|
316
|
+
const g = B(i), w = B(l) === l, x = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), v = m || (w || !p ? [tt(l)] : Nt(l));
|
|
317
|
+
!m && h !== "none" && v.push(...Mt(l, p, h, x));
|
|
318
|
+
const y = [l, ...v], L = await xt(e, b), C = [];
|
|
319
|
+
let N = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
320
|
+
if (d && C.push(L[g]), u) {
|
|
321
|
+
const A = Dt(i, r, x);
|
|
322
|
+
C.push(L[A[0]], L[A[1]]);
|
|
323
|
+
}
|
|
324
|
+
if (N = [...N, {
|
|
325
|
+
placement: i,
|
|
326
|
+
overflows: C
|
|
327
|
+
}], !C.every((A) => A <= 0)) {
|
|
328
|
+
var z, j;
|
|
329
|
+
const A = (((z = s.flip) == null ? void 0 : z.index) || 0) + 1, Y = y[A];
|
|
330
|
+
if (Y)
|
|
331
|
+
return {
|
|
332
|
+
data: {
|
|
333
|
+
index: A,
|
|
334
|
+
overflows: N
|
|
335
|
+
},
|
|
336
|
+
reset: {
|
|
337
|
+
placement: Y
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
let E = (j = N.filter((O) => O.overflows[0] <= 0).sort((O, R) => O.overflows[1] - R.overflows[1])[0]) == null ? void 0 : j.placement;
|
|
341
|
+
if (!E)
|
|
342
|
+
switch (f) {
|
|
343
|
+
case "bestFit": {
|
|
344
|
+
var X;
|
|
345
|
+
const O = (X = N.map((R) => [R.placement, R.overflows.filter((T) => T > 0).reduce((T, Ot) => T + Ot, 0)]).sort((R, T) => R[1] - T[1])[0]) == null ? void 0 : X[0];
|
|
346
|
+
O && (E = O);
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
case "initialPlacement":
|
|
350
|
+
E = l;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
if (i !== E)
|
|
354
|
+
return {
|
|
355
|
+
reset: {
|
|
356
|
+
placement: E
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
return {};
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
async function Ht(t, e) {
|
|
365
|
+
const {
|
|
366
|
+
placement: o,
|
|
367
|
+
platform: n,
|
|
368
|
+
elements: i
|
|
369
|
+
} = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = B(o), l = K(o), c = ot(o) === "y", a = ["left", "top"].includes(r) ? -1 : 1, d = s && c ? -1 : 1, u = G(e, t);
|
|
370
|
+
let {
|
|
371
|
+
mainAxis: m,
|
|
372
|
+
crossAxis: f,
|
|
373
|
+
alignmentAxis: h
|
|
374
|
+
} = typeof u == "number" ? {
|
|
375
|
+
mainAxis: u,
|
|
376
|
+
crossAxis: 0,
|
|
377
|
+
alignmentAxis: null
|
|
378
|
+
} : {
|
|
379
|
+
mainAxis: 0,
|
|
380
|
+
crossAxis: 0,
|
|
381
|
+
alignmentAxis: null,
|
|
382
|
+
...u
|
|
383
|
+
};
|
|
384
|
+
return l && typeof h == "number" && (f = l === "end" ? h * -1 : h), c ? {
|
|
385
|
+
x: f * d,
|
|
386
|
+
y: m * a
|
|
387
|
+
} : {
|
|
388
|
+
x: m * a,
|
|
389
|
+
y: f * d
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
const zt = function(t) {
|
|
393
|
+
return t === void 0 && (t = 0), {
|
|
394
|
+
name: "offset",
|
|
395
|
+
options: t,
|
|
396
|
+
async fn(e) {
|
|
397
|
+
var o, n;
|
|
398
|
+
const {
|
|
399
|
+
x: i,
|
|
400
|
+
y: s,
|
|
401
|
+
placement: r,
|
|
402
|
+
middlewareData: l
|
|
403
|
+
} = e, c = await Ht(e, t);
|
|
404
|
+
return r === ((o = l.offset) == null ? void 0 : o.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
|
|
405
|
+
x: i + c.x,
|
|
406
|
+
y: s + c.y,
|
|
407
|
+
data: {
|
|
408
|
+
...c,
|
|
409
|
+
placement: r
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}, jt = function(t) {
|
|
415
|
+
return t === void 0 && (t = {}), {
|
|
416
|
+
name: "shift",
|
|
417
|
+
options: t,
|
|
418
|
+
async fn(e) {
|
|
419
|
+
const {
|
|
420
|
+
x: o,
|
|
421
|
+
y: n,
|
|
422
|
+
placement: i
|
|
423
|
+
} = e, {
|
|
424
|
+
mainAxis: s = !0,
|
|
425
|
+
crossAxis: r = !1,
|
|
426
|
+
limiter: l = {
|
|
427
|
+
fn: (b) => {
|
|
428
|
+
let {
|
|
429
|
+
x: g,
|
|
430
|
+
y: w
|
|
431
|
+
} = b;
|
|
432
|
+
return {
|
|
433
|
+
x: g,
|
|
434
|
+
y: w
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
...c
|
|
439
|
+
} = G(t, e), a = {
|
|
440
|
+
x: o,
|
|
441
|
+
y: n
|
|
442
|
+
}, d = await xt(e, c), u = ot(B(i)), m = bt(u);
|
|
443
|
+
let f = a[m], h = a[u];
|
|
444
|
+
if (s) {
|
|
445
|
+
const b = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", w = f + d[b], x = f - d[g];
|
|
446
|
+
f = rt(w, f, x);
|
|
447
|
+
}
|
|
448
|
+
if (r) {
|
|
449
|
+
const b = u === "y" ? "top" : "left", g = u === "y" ? "bottom" : "right", w = h + d[b], x = h - d[g];
|
|
450
|
+
h = rt(w, h, x);
|
|
451
|
+
}
|
|
452
|
+
const p = l.fn({
|
|
453
|
+
...e,
|
|
454
|
+
[m]: f,
|
|
455
|
+
[u]: h
|
|
456
|
+
});
|
|
457
|
+
return {
|
|
458
|
+
...p,
|
|
459
|
+
data: {
|
|
460
|
+
x: p.x - o,
|
|
461
|
+
y: p.y - n
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
function D(t) {
|
|
468
|
+
return yt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
469
|
+
}
|
|
470
|
+
function _(t) {
|
|
471
|
+
var e;
|
|
472
|
+
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
473
|
+
}
|
|
474
|
+
function P(t) {
|
|
475
|
+
var e;
|
|
476
|
+
return (e = (yt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
477
|
+
}
|
|
478
|
+
function yt(t) {
|
|
479
|
+
return t instanceof Node || t instanceof _(t).Node;
|
|
480
|
+
}
|
|
481
|
+
function I(t) {
|
|
482
|
+
return t instanceof Element || t instanceof _(t).Element;
|
|
483
|
+
}
|
|
484
|
+
function F(t) {
|
|
485
|
+
return t instanceof HTMLElement || t instanceof _(t).HTMLElement;
|
|
486
|
+
}
|
|
487
|
+
function ht(t) {
|
|
488
|
+
return typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof _(t).ShadowRoot;
|
|
489
|
+
}
|
|
490
|
+
function J(t) {
|
|
491
|
+
const {
|
|
492
|
+
overflow: e,
|
|
493
|
+
overflowX: o,
|
|
494
|
+
overflowY: n,
|
|
495
|
+
display: i
|
|
496
|
+
} = k(t);
|
|
497
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
|
|
498
|
+
}
|
|
499
|
+
function Xt(t) {
|
|
500
|
+
return ["table", "td", "th"].includes(D(t));
|
|
501
|
+
}
|
|
502
|
+
function at(t) {
|
|
503
|
+
const e = ft(), o = k(t);
|
|
504
|
+
return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
|
|
505
|
+
}
|
|
506
|
+
function Yt(t) {
|
|
507
|
+
let e = H(t);
|
|
508
|
+
for (; F(e) && !nt(e); ) {
|
|
509
|
+
if (at(e))
|
|
510
|
+
return e;
|
|
511
|
+
e = H(e);
|
|
512
|
+
}
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
function ft() {
|
|
516
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
517
|
+
}
|
|
518
|
+
function nt(t) {
|
|
519
|
+
return ["html", "body", "#document"].includes(D(t));
|
|
520
|
+
}
|
|
521
|
+
function k(t) {
|
|
522
|
+
return _(t).getComputedStyle(t);
|
|
523
|
+
}
|
|
524
|
+
function it(t) {
|
|
525
|
+
return I(t) ? {
|
|
526
|
+
scrollLeft: t.scrollLeft,
|
|
527
|
+
scrollTop: t.scrollTop
|
|
528
|
+
} : {
|
|
529
|
+
scrollLeft: t.pageXOffset,
|
|
530
|
+
scrollTop: t.pageYOffset
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function H(t) {
|
|
534
|
+
if (D(t) === "html")
|
|
535
|
+
return t;
|
|
536
|
+
const e = (
|
|
537
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
538
|
+
t.assignedSlot || // DOM Element detected.
|
|
539
|
+
t.parentNode || // ShadowRoot detected.
|
|
540
|
+
ht(t) && t.host || // Fallback.
|
|
541
|
+
P(t)
|
|
542
|
+
);
|
|
543
|
+
return ht(e) ? e.host : e;
|
|
544
|
+
}
|
|
545
|
+
function vt(t) {
|
|
546
|
+
const e = H(t);
|
|
547
|
+
return nt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : F(e) && J(e) ? e : vt(e);
|
|
548
|
+
}
|
|
549
|
+
function q(t, e, o) {
|
|
550
|
+
var n;
|
|
551
|
+
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
552
|
+
const i = vt(t), s = i === ((n = t.ownerDocument) == null ? void 0 : n.body), r = _(i);
|
|
553
|
+
return s ? e.concat(r, r.visualViewport || [], J(i) ? i : [], r.frameElement && o ? q(r.frameElement) : []) : e.concat(i, q(i, [], o));
|
|
554
|
+
}
|
|
555
|
+
function Et(t) {
|
|
556
|
+
const e = k(t);
|
|
557
|
+
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
558
|
+
const i = F(t), s = i ? t.offsetWidth : o, r = i ? t.offsetHeight : n, l = Z(o) !== s || Z(n) !== r;
|
|
559
|
+
return l && (o = s, n = r), {
|
|
560
|
+
width: o,
|
|
561
|
+
height: n,
|
|
562
|
+
$: l
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function ut(t) {
|
|
566
|
+
return I(t) ? t : t.contextElement;
|
|
567
|
+
}
|
|
568
|
+
function V(t) {
|
|
569
|
+
const e = ut(t);
|
|
570
|
+
if (!F(e))
|
|
571
|
+
return S(1);
|
|
572
|
+
const o = e.getBoundingClientRect(), {
|
|
573
|
+
width: n,
|
|
574
|
+
height: i,
|
|
575
|
+
$: s
|
|
576
|
+
} = Et(e);
|
|
577
|
+
let r = (s ? Z(o.width) : o.width) / n, l = (s ? Z(o.height) : o.height) / i;
|
|
578
|
+
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
579
|
+
x: r,
|
|
580
|
+
y: l
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
const qt = /* @__PURE__ */ S(0);
|
|
584
|
+
function _t(t) {
|
|
585
|
+
const e = _(t);
|
|
586
|
+
return !ft() || !e.visualViewport ? qt : {
|
|
587
|
+
x: e.visualViewport.offsetLeft,
|
|
588
|
+
y: e.visualViewport.offsetTop
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function Gt(t, e, o) {
|
|
592
|
+
return e === void 0 && (e = !1), !o || e && o !== _(t) ? !1 : e;
|
|
593
|
+
}
|
|
594
|
+
function W(t, e, o, n) {
|
|
595
|
+
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
596
|
+
const i = t.getBoundingClientRect(), s = ut(t);
|
|
597
|
+
let r = S(1);
|
|
598
|
+
e && (n ? I(n) && (r = V(n)) : r = V(t));
|
|
599
|
+
const l = Gt(s, o, n) ? _t(s) : S(0);
|
|
600
|
+
let c = (i.left + l.x) / r.x, a = (i.top + l.y) / r.y, d = i.width / r.x, u = i.height / r.y;
|
|
601
|
+
if (s) {
|
|
602
|
+
const m = _(s), f = n && I(n) ? _(n) : n;
|
|
603
|
+
let h = m, p = h.frameElement;
|
|
604
|
+
for (; p && n && f !== h; ) {
|
|
605
|
+
const b = V(p), g = p.getBoundingClientRect(), w = k(p), x = g.left + (p.clientLeft + parseFloat(w.paddingLeft)) * b.x, v = g.top + (p.clientTop + parseFloat(w.paddingTop)) * b.y;
|
|
606
|
+
c *= b.x, a *= b.y, d *= b.x, u *= b.y, c += x, a += v, h = _(p), p = h.frameElement;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return et({
|
|
610
|
+
width: d,
|
|
611
|
+
height: u,
|
|
612
|
+
x: c,
|
|
613
|
+
y: a
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
const Kt = [":popover-open", ":modal"];
|
|
617
|
+
function At(t) {
|
|
618
|
+
return Kt.some((e) => {
|
|
619
|
+
try {
|
|
620
|
+
return t.matches(e);
|
|
621
|
+
} catch {
|
|
622
|
+
return !1;
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
function Jt(t) {
|
|
627
|
+
let {
|
|
628
|
+
elements: e,
|
|
629
|
+
rect: o,
|
|
630
|
+
offsetParent: n,
|
|
631
|
+
strategy: i
|
|
632
|
+
} = t;
|
|
633
|
+
const s = i === "fixed", r = P(n), l = e ? At(e.floating) : !1;
|
|
634
|
+
if (n === r || l && s)
|
|
635
|
+
return o;
|
|
636
|
+
let c = {
|
|
637
|
+
scrollLeft: 0,
|
|
638
|
+
scrollTop: 0
|
|
639
|
+
}, a = S(1);
|
|
640
|
+
const d = S(0), u = F(n);
|
|
641
|
+
if ((u || !u && !s) && ((D(n) !== "body" || J(r)) && (c = it(n)), F(n))) {
|
|
642
|
+
const m = W(n);
|
|
643
|
+
a = V(n), d.x = m.x + n.clientLeft, d.y = m.y + n.clientTop;
|
|
644
|
+
}
|
|
645
|
+
return {
|
|
646
|
+
width: o.width * a.x,
|
|
647
|
+
height: o.height * a.y,
|
|
648
|
+
x: o.x * a.x - c.scrollLeft * a.x + d.x,
|
|
649
|
+
y: o.y * a.y - c.scrollTop * a.y + d.y
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function Qt(t) {
|
|
653
|
+
return Array.from(t.getClientRects());
|
|
654
|
+
}
|
|
655
|
+
function kt(t) {
|
|
656
|
+
return W(P(t)).left + it(t).scrollLeft;
|
|
657
|
+
}
|
|
658
|
+
function Zt(t) {
|
|
659
|
+
const e = P(t), o = it(t), n = t.ownerDocument.body, i = M(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = M(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
660
|
+
let r = -o.scrollLeft + kt(t);
|
|
661
|
+
const l = -o.scrollTop;
|
|
662
|
+
return k(n).direction === "rtl" && (r += M(e.clientWidth, n.clientWidth) - i), {
|
|
663
|
+
width: i,
|
|
664
|
+
height: s,
|
|
665
|
+
x: r,
|
|
666
|
+
y: l
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function te(t, e) {
|
|
670
|
+
const o = _(t), n = P(t), i = o.visualViewport;
|
|
671
|
+
let s = n.clientWidth, r = n.clientHeight, l = 0, c = 0;
|
|
672
|
+
if (i) {
|
|
673
|
+
s = i.width, r = i.height;
|
|
674
|
+
const a = ft();
|
|
675
|
+
(!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
|
|
676
|
+
}
|
|
677
|
+
return {
|
|
678
|
+
width: s,
|
|
679
|
+
height: r,
|
|
680
|
+
x: l,
|
|
681
|
+
y: c
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function ee(t, e) {
|
|
685
|
+
const o = W(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, s = F(t) ? V(t) : S(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, c = i * s.x, a = n * s.y;
|
|
686
|
+
return {
|
|
687
|
+
width: r,
|
|
688
|
+
height: l,
|
|
689
|
+
x: c,
|
|
690
|
+
y: a
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function mt(t, e, o) {
|
|
694
|
+
let n;
|
|
695
|
+
if (e === "viewport")
|
|
696
|
+
n = te(t, o);
|
|
697
|
+
else if (e === "document")
|
|
698
|
+
n = Zt(P(t));
|
|
699
|
+
else if (I(e))
|
|
700
|
+
n = ee(e, o);
|
|
701
|
+
else {
|
|
702
|
+
const i = _t(t);
|
|
703
|
+
n = {
|
|
704
|
+
...e,
|
|
705
|
+
x: e.x - i.x,
|
|
706
|
+
y: e.y - i.y
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
return et(n);
|
|
710
|
+
}
|
|
711
|
+
function Lt(t, e) {
|
|
712
|
+
const o = H(t);
|
|
713
|
+
return o === e || !I(o) || nt(o) ? !1 : k(o).position === "fixed" || Lt(o, e);
|
|
714
|
+
}
|
|
715
|
+
function oe(t, e) {
|
|
716
|
+
const o = e.get(t);
|
|
717
|
+
if (o)
|
|
718
|
+
return o;
|
|
719
|
+
let n = q(t, [], !1).filter((l) => I(l) && D(l) !== "body"), i = null;
|
|
720
|
+
const s = k(t).position === "fixed";
|
|
721
|
+
let r = s ? H(t) : t;
|
|
722
|
+
for (; I(r) && !nt(r); ) {
|
|
723
|
+
const l = k(r), c = at(r);
|
|
724
|
+
!c && l.position === "fixed" && (i = null), (s ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || J(r) && !c && Lt(t, r)) ? n = n.filter((d) => d !== r) : i = l, r = H(r);
|
|
725
|
+
}
|
|
726
|
+
return e.set(t, n), n;
|
|
727
|
+
}
|
|
728
|
+
function ne(t) {
|
|
729
|
+
let {
|
|
730
|
+
element: e,
|
|
731
|
+
boundary: o,
|
|
732
|
+
rootBoundary: n,
|
|
733
|
+
strategy: i
|
|
734
|
+
} = t;
|
|
735
|
+
const r = [...o === "clippingAncestors" ? oe(e, this._c) : [].concat(o), n], l = r[0], c = r.reduce((a, d) => {
|
|
736
|
+
const u = mt(e, d, i);
|
|
737
|
+
return a.top = M(u.top, a.top), a.right = $(u.right, a.right), a.bottom = $(u.bottom, a.bottom), a.left = M(u.left, a.left), a;
|
|
738
|
+
}, mt(e, l, i));
|
|
739
|
+
return {
|
|
740
|
+
width: c.right - c.left,
|
|
741
|
+
height: c.bottom - c.top,
|
|
742
|
+
x: c.left,
|
|
743
|
+
y: c.top
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
function ie(t) {
|
|
747
|
+
const {
|
|
748
|
+
width: e,
|
|
749
|
+
height: o
|
|
750
|
+
} = Et(t);
|
|
751
|
+
return {
|
|
752
|
+
width: e,
|
|
753
|
+
height: o
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
function re(t, e, o) {
|
|
757
|
+
const n = F(e), i = P(e), s = o === "fixed", r = W(t, !0, s, e);
|
|
758
|
+
let l = {
|
|
759
|
+
scrollLeft: 0,
|
|
760
|
+
scrollTop: 0
|
|
761
|
+
};
|
|
762
|
+
const c = S(0);
|
|
763
|
+
if (n || !n && !s)
|
|
764
|
+
if ((D(e) !== "body" || J(i)) && (l = it(e)), n) {
|
|
765
|
+
const u = W(e, !0, s, e);
|
|
766
|
+
c.x = u.x + e.clientLeft, c.y = u.y + e.clientTop;
|
|
767
|
+
} else i && (c.x = kt(i));
|
|
768
|
+
const a = r.left + l.scrollLeft - c.x, d = r.top + l.scrollTop - c.y;
|
|
769
|
+
return {
|
|
770
|
+
x: a,
|
|
771
|
+
y: d,
|
|
772
|
+
width: r.width,
|
|
773
|
+
height: r.height
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
function pt(t, e) {
|
|
777
|
+
return !F(t) || k(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
778
|
+
}
|
|
779
|
+
function Ct(t, e) {
|
|
780
|
+
const o = _(t);
|
|
781
|
+
if (!F(t) || At(t))
|
|
782
|
+
return o;
|
|
783
|
+
let n = pt(t, e);
|
|
784
|
+
for (; n && Xt(n) && k(n).position === "static"; )
|
|
785
|
+
n = pt(n, e);
|
|
786
|
+
return n && (D(n) === "html" || D(n) === "body" && k(n).position === "static" && !at(n)) ? o : n || Yt(t) || o;
|
|
787
|
+
}
|
|
788
|
+
const se = async function(t) {
|
|
789
|
+
const e = this.getOffsetParent || Ct, o = this.getDimensions;
|
|
790
|
+
return {
|
|
791
|
+
reference: re(t.reference, await e(t.floating), t.strategy),
|
|
792
|
+
floating: {
|
|
793
|
+
x: 0,
|
|
794
|
+
y: 0,
|
|
795
|
+
...await o(t.floating)
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
function le(t) {
|
|
800
|
+
return k(t).direction === "rtl";
|
|
801
|
+
}
|
|
802
|
+
const ce = {
|
|
803
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Jt,
|
|
804
|
+
getDocumentElement: P,
|
|
805
|
+
getClippingRect: ne,
|
|
806
|
+
getOffsetParent: Ct,
|
|
807
|
+
getElementRects: se,
|
|
808
|
+
getClientRects: Qt,
|
|
809
|
+
getDimensions: ie,
|
|
810
|
+
getScale: V,
|
|
811
|
+
isElement: I,
|
|
812
|
+
isRTL: le
|
|
813
|
+
};
|
|
814
|
+
function ae(t, e) {
|
|
815
|
+
let o = null, n;
|
|
816
|
+
const i = P(t);
|
|
817
|
+
function s() {
|
|
818
|
+
var l;
|
|
819
|
+
clearTimeout(n), (l = o) == null || l.disconnect(), o = null;
|
|
820
|
+
}
|
|
821
|
+
function r(l, c) {
|
|
822
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), s();
|
|
823
|
+
const {
|
|
824
|
+
left: a,
|
|
825
|
+
top: d,
|
|
826
|
+
width: u,
|
|
827
|
+
height: m
|
|
828
|
+
} = t.getBoundingClientRect();
|
|
829
|
+
if (l || e(), !u || !m)
|
|
830
|
+
return;
|
|
831
|
+
const f = Q(d), h = Q(i.clientWidth - (a + u)), p = Q(i.clientHeight - (d + m)), b = Q(a), w = {
|
|
832
|
+
rootMargin: -f + "px " + -h + "px " + -p + "px " + -b + "px",
|
|
833
|
+
threshold: M(0, $(1, c)) || 1
|
|
834
|
+
};
|
|
835
|
+
let x = !0;
|
|
836
|
+
function v(y) {
|
|
837
|
+
const L = y[0].intersectionRatio;
|
|
838
|
+
if (L !== c) {
|
|
839
|
+
if (!x)
|
|
840
|
+
return r();
|
|
841
|
+
L ? r(!1, L) : n = setTimeout(() => {
|
|
842
|
+
r(!1, 1e-7);
|
|
843
|
+
}, 100);
|
|
844
|
+
}
|
|
845
|
+
x = !1;
|
|
846
|
+
}
|
|
847
|
+
try {
|
|
848
|
+
o = new IntersectionObserver(v, {
|
|
849
|
+
...w,
|
|
850
|
+
// Handle <iframe>s
|
|
851
|
+
root: i.ownerDocument
|
|
852
|
+
});
|
|
853
|
+
} catch {
|
|
854
|
+
o = new IntersectionObserver(v, w);
|
|
855
|
+
}
|
|
856
|
+
o.observe(t);
|
|
857
|
+
}
|
|
858
|
+
return r(!0), s;
|
|
859
|
+
}
|
|
860
|
+
function gt(t, e, o, n) {
|
|
861
|
+
n === void 0 && (n = {});
|
|
862
|
+
const {
|
|
863
|
+
ancestorScroll: i = !0,
|
|
864
|
+
ancestorResize: s = !0,
|
|
865
|
+
elementResize: r = typeof ResizeObserver == "function",
|
|
866
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
867
|
+
animationFrame: c = !1
|
|
868
|
+
} = n, a = ut(t), d = i || s ? [...a ? q(a) : [], ...q(e)] : [];
|
|
869
|
+
d.forEach((g) => {
|
|
870
|
+
i && g.addEventListener("scroll", o, {
|
|
871
|
+
passive: !0
|
|
872
|
+
}), s && g.addEventListener("resize", o);
|
|
873
|
+
});
|
|
874
|
+
const u = a && l ? ae(a, o) : null;
|
|
875
|
+
let m = -1, f = null;
|
|
876
|
+
r && (f = new ResizeObserver((g) => {
|
|
877
|
+
let [w] = g;
|
|
878
|
+
w && w.target === a && f && (f.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
879
|
+
var x;
|
|
880
|
+
(x = f) == null || x.observe(e);
|
|
881
|
+
})), o();
|
|
882
|
+
}), a && !c && f.observe(a), f.observe(e));
|
|
883
|
+
let h, p = c ? W(t) : null;
|
|
884
|
+
c && b();
|
|
885
|
+
function b() {
|
|
886
|
+
const g = W(t);
|
|
887
|
+
p && (g.x !== p.x || g.y !== p.y || g.width !== p.width || g.height !== p.height) && o(), p = g, h = requestAnimationFrame(b);
|
|
888
|
+
}
|
|
889
|
+
return o(), () => {
|
|
890
|
+
var g;
|
|
891
|
+
d.forEach((w) => {
|
|
892
|
+
i && w.removeEventListener("scroll", o), s && w.removeEventListener("resize", o);
|
|
893
|
+
}), u == null || u(), (g = f) == null || g.disconnect(), f = null, c && cancelAnimationFrame(h);
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
const fe = jt, ue = $t, de = Vt, he = (t, e, o) => {
|
|
897
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
898
|
+
platform: ce,
|
|
899
|
+
...o
|
|
900
|
+
}, s = {
|
|
901
|
+
...i.platform,
|
|
902
|
+
_c: n
|
|
903
|
+
};
|
|
904
|
+
return Wt(t, e, {
|
|
905
|
+
...i,
|
|
906
|
+
platform: s
|
|
907
|
+
});
|
|
908
|
+
}, me = ":host{display:block}.floatingui{--tw-shadow:0px 4px 8px -4px var(--shadow-color);--tw-shadow-colored:0px 4px 8px -4px var(--tw-shadow-color);--tw-border-opacity:0.15;border-color:rgb(var(--border-color-stroke-neutral2-base)/var(--tw-border-opacity));border-radius:var(--border-radius-small,4px);border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);display:none;isolation:auto;left:0;padding:.5rem 1rem;position:absolute;top:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:560}.floatingui.open{display:block}.arrow{display:none}.arrow.on{--tw-bg-opacity:1;--shadow-color:var(--material-neutral2-base-shadow);--tw-border-opacity:0.15;background-color:rgb(var(--background-color-material-neutral2-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral-base)/var(--tw-border-opacity));border-style:solid;border-width:0;display:block;height:.5rem;position:absolute;transform:rotate(45deg);width:.5rem;z-index:1}.floatingui.context-theme1-inverse,.floatingui.context-theme1-inverse .arrow{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-border-opacity:0.15;background-color:rgb(var(--background-color-material-theme1-inverse-base)/var(--tw-bg-opacity));color:rgb(var(--text-color-inverse-base)/var(--tw-text-opacity))}.floatingui.context-neutral,.floatingui.context-neutral .arrow{--tw-bg-opacity:1;--tw-border-opacity:0.15;--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral-base)/var(--tw-border-opacity))}.floatingui.context-neutral2,.floatingui.context-neutral2 .arrow{--tw-bg-opacity:1;--tw-border-opacity:0.15;--shadow-color:var(--material-neutral2-base-shadow);background-color:rgb(var(--background-color-material-neutral2-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral2-base)/var(--tw-border-opacity))}.floatingui.tooltip-theme1-inverse{--tw-bg-opacity:1;--tw-text-opacity:1;color:rgb(var(--text-color-inverse-base)/var(--tw-text-opacity))}.floatingui.tooltip-theme1-inverse,.floatingui.tooltip-theme1-inverse .arrow{background-color:rgb(var(--background-color-material-theme1-inverse-base)/var(--tw-bg-opacity))}.floatingui.tooltip-theme1-inverse .arrow{--tw-bg-opacity:1}.floatingui.tooltip-neutral,.floatingui.tooltip-neutral .arrow{--tw-bg-opacity:1;--tw-border-opacity:0.15;--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral-base)/var(--tw-border-opacity))}.floatingui.tooltip-neutral2,.floatingui.tooltip-neutral2 .arrow{--tw-bg-opacity:1;--tw-border-opacity:0.15;--shadow-color:var(--material-neutral2-base-shadow);background-color:rgb(var(--background-color-material-neutral2-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral2-base)/var(--tw-border-opacity))}", pe = me, ge = class {
|
|
909
|
+
constructor(t) {
|
|
910
|
+
Rt(this, t), this._popoverId = It(), this._slots = { reference: !1 }, this.placement = "right-end", this.prismId = `popover-${this._popoverId}`, this.offset = 2, this.shift = 2, this.as = "tooltip", this.label = "Tooltip Button", this.icon = "info", this.tooltipTone = "theme1-inverse", this.contextTone = "neutral2", this.arrow = !0, this.open = !1;
|
|
911
|
+
}
|
|
912
|
+
/** @internal */
|
|
913
|
+
// @State() _isOpen = false;
|
|
914
|
+
/** @internal */
|
|
915
|
+
watchMultipleNumbers() {
|
|
916
|
+
this._computeFloatingUI();
|
|
917
|
+
}
|
|
918
|
+
/** @internal */
|
|
919
|
+
_computeFloatingUI() {
|
|
920
|
+
this._floatingElement && he(this._referenceElement, this._floatingElement, {
|
|
921
|
+
placement: this.placement,
|
|
922
|
+
middleware: [zt(this.offset), ue(), fe({ padding: this.offset }), de({ element: this._arrowElement })]
|
|
923
|
+
}).then(({ x: t, y: e, placement: o, middlewareData: n }) => {
|
|
924
|
+
Object.assign(this._floatingElement.style, {
|
|
925
|
+
left: `${t}px`,
|
|
926
|
+
top: `${e}px`
|
|
927
|
+
});
|
|
928
|
+
const { x: i, y: s } = n.arrow, r = {
|
|
929
|
+
top: "bottom",
|
|
930
|
+
right: "left",
|
|
931
|
+
bottom: "top",
|
|
932
|
+
left: "right"
|
|
933
|
+
}[o.split("-")[0]];
|
|
934
|
+
Object.assign(this._arrowElement.style, {
|
|
935
|
+
left: i != null ? `${i}px` : "",
|
|
936
|
+
top: s != null ? `${s}px` : "",
|
|
937
|
+
right: "",
|
|
938
|
+
bottom: "",
|
|
939
|
+
[r]: "-5px",
|
|
940
|
+
borderLeftWidth: o.split("-")[0] === "bottom" || o.split("-")[0] === "right" ? "1px" : "0",
|
|
941
|
+
borderTopWidth: o.split("-")[0] === "bottom" || o.split("-")[0] === "left" ? "1px" : "0",
|
|
942
|
+
borderRightWidth: o.split("-")[0] === "top" || o.split("-")[0] === "left" ? "1px" : "0",
|
|
943
|
+
borderBottomWidth: o.split("-")[0] === "top" || o.split("-")[0] === "right" ? "1px" : "0"
|
|
944
|
+
});
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
/** @internal */
|
|
948
|
+
_showFloatingUI(t) {
|
|
949
|
+
t && (this.open = this.as === "context" ? !this.open : !0), this.as === "context" && this._slots.reference && (this._referenceElement.tagName.toLowerCase() === "prism-button" ? this._referenceElement.setAttribute("expanded", this.open.toString()) : this._referenceElement.setAttribute("aria-expanded", this.open.toString())), gt(this._referenceElement, this._floatingElement, this._computeFloatingUI.bind(this));
|
|
950
|
+
}
|
|
951
|
+
/** @internal */
|
|
952
|
+
_hideFloatingUI() {
|
|
953
|
+
this.open = !1;
|
|
954
|
+
}
|
|
955
|
+
componentDidRender() {
|
|
956
|
+
this._computeFloatingUI();
|
|
957
|
+
}
|
|
958
|
+
componentDidLoad() {
|
|
959
|
+
gt(this._referenceElement, this._floatingElement, this._computeFloatingUI.bind(this));
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* @internal
|
|
963
|
+
* When a slot is used for the reference element, it has to receive focus and other interactive events
|
|
964
|
+
* This is only for the initial setup
|
|
965
|
+
*/
|
|
966
|
+
_handleReferenceEvents(t) {
|
|
967
|
+
let e = ["prism-button", "button", "a"];
|
|
968
|
+
switch (t && !e.includes(t.tagName.toLowerCase()) && (this._referenceElement = t.querySelectorAll(e.join(","))[0]), t && e.includes(t.tagName.toLowerCase()) && (this._referenceElement = t), this._referenceElement.tagName.toLowerCase()) {
|
|
969
|
+
case "prism-button":
|
|
970
|
+
this.as === "tooltip" && (this._referenceElement.addEventListener("prismFocus", this._showFloatingUI.bind(this)), this._referenceElement.addEventListener("prismBlur", this._hideFloatingUI.bind(this)), this._referenceElement.addEventListener("mouseenter", this._showFloatingUI.bind(this)), this._referenceElement.addEventListener("mouseleave", this._hideFloatingUI.bind(this))), this.as === "context" && (this._referenceElement.addEventListener("prismPress", this._showFloatingUI.bind(this)), this._referenceElement.setAttribute("expanded", this.open.toString())), this._referenceElement.setAttribute("describedby", this.prismId), this._referenceElement.setAttribute("label", this.label);
|
|
971
|
+
break;
|
|
972
|
+
case "button":
|
|
973
|
+
case "a":
|
|
974
|
+
this.as === "tooltip" && (this._referenceElement.addEventListener("focus", this._showFloatingUI.bind(this)), this._referenceElement.addEventListener("blur", this._hideFloatingUI.bind(this)), this._referenceElement.addEventListener("mouseenter", this._showFloatingUI.bind(this)), this._referenceElement.addEventListener("mouseleave", this._hideFloatingUI.bind(this))), this.as === "context" && (this._referenceElement.addEventListener("click", this._showFloatingUI.bind(this)), this._referenceElement.setAttribute("aria-expanded", this.open.toString())), this._referenceElement.setAttribute("aria-describedby", this.prismId), this._referenceElement.setAttribute("aria-label", this.label);
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
connectedCallback() {
|
|
979
|
+
const t = this.el.querySelector('[slot="reference"]');
|
|
980
|
+
this._slots.reference = !!t, this._slots.reference && this._handleReferenceEvents(t), this.el.addEventListener("keydown", (e) => {
|
|
981
|
+
e.key === "Escape" && this._hideFloatingUI();
|
|
982
|
+
}), document.addEventListener("mousedown", (e) => {
|
|
983
|
+
const o = e.target, n = this.el.tagName.toLowerCase();
|
|
984
|
+
o.closest(n) !== this.el && this._hideFloatingUI();
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
disconnectedCallback() {
|
|
988
|
+
this.el.removeEventListener("keydown", (t) => {
|
|
989
|
+
t.key === "Escape" && this._hideFloatingUI();
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
render() {
|
|
993
|
+
return U(Ft, { key: "81141e7f8251f200e72fdd1471a5ade00efe8bd8" }, this._slots.reference ? U("slot", { name: "reference" }) : U("prism-button", { id: "button", onPrismFocus: this.as === "tooltip" ? this._showFloatingUI.bind(this) : void 0, onPrismBlur: this.as === "tooltip" ? this._hideFloatingUI.bind(this) : void 0, onMouseEnter: this.as === "tooltip" ? this._showFloatingUI.bind(this) : void 0, onMouseLeave: this.as === "tooltip" ? this._hideFloatingUI.bind(this) : void 0, onPrismPress: this.as === "context" ? this._showFloatingUI.bind(this) : void 0, describedby: this.prismId, display: "ghost-icon", label: this.label, ref: (t) => this._referenceElement = t, expanded: this.as === "context" ? this.open : void 0 }, U("prism-icon", { name: this.icon, role: "presentation" })), U("div", { key: "027307bf37c7a6ad74c7443a4974f12bd928261e", ref: (t) => this._floatingElement = t, id: this.prismId, class: {
|
|
994
|
+
open: this.open,
|
|
995
|
+
floatingui: !0,
|
|
996
|
+
[`tooltip-${this.tooltipTone}`]: this.as === "tooltip",
|
|
997
|
+
[`context-${this.contextTone}`]: this.as === "context"
|
|
998
|
+
}, role: this.as === "tooltip" ? "tooltip" : void 0 }, U("slot", { key: "775157fd24862abe2334a837bfbf03877f2a0640" }), U("span", { key: "68cae2955c4868df0c8ab4c5e4a2431e22473655", ref: (t) => this._arrowElement = t, class: { arrow: !0, on: this.arrow === !0 } })));
|
|
999
|
+
}
|
|
1000
|
+
get el() {
|
|
1001
|
+
return Tt(this);
|
|
1002
|
+
}
|
|
1003
|
+
static get watchers() {
|
|
1004
|
+
return {
|
|
1005
|
+
offset: ["watchMultipleNumbers"],
|
|
1006
|
+
shift: ["watchMultipleNumbers"]
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
ge.style = pe;
|
|
1011
|
+
export {
|
|
1012
|
+
ge as prism_popover
|
|
1013
|
+
};
|