siteguide.js 0.3.0 → 0.5.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/README.md +57 -1
- package/dist/css/siteguide.css +1 -1
- package/dist/index.d.ts +137 -45
- package/dist/index.js +3 -3
- package/dist/index.mjs +665 -583
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var n in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
1
|
+
var It = Object.defineProperty, Yt = Object.defineProperties;
|
|
2
|
+
var qt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var tt = Object.getOwnPropertySymbols;
|
|
4
|
+
var bt = Object.prototype.hasOwnProperty, _t = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ct = Math.pow, ft = (e, t, n) => t in e ? It(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, L = (e, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
bt.call(t, n) && ft(e, n, t[n]);
|
|
8
|
+
if (tt)
|
|
9
|
+
for (var n of tt(t))
|
|
10
|
+
_t.call(t, n) && ft(e, n, t[n]);
|
|
11
|
+
return e;
|
|
12
|
+
}, X = (e, t) => Yt(e, qt(t));
|
|
13
|
+
var Pt = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
|
-
for (var i in
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
for (var i of
|
|
19
|
-
|
|
15
|
+
for (var i in e)
|
|
16
|
+
bt.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
|
|
17
|
+
if (e != null && tt)
|
|
18
|
+
for (var i of tt(e))
|
|
19
|
+
t.indexOf(i) < 0 && _t.call(e, i) && (n[i] = e[i]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
22
|
+
var y = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
|
|
23
|
+
var k = (e, t, n) => new Promise((i, o) => {
|
|
24
24
|
var r = (a) => {
|
|
25
25
|
try {
|
|
26
26
|
l(n.next(a));
|
|
@@ -34,196 +34,199 @@ var A = (t, e, n) => new Promise((i, o) => {
|
|
|
34
34
|
o(c);
|
|
35
35
|
}
|
|
36
36
|
}, l = (a) => a.done ? i(a.value) : Promise.resolve(a.value).then(r, s);
|
|
37
|
-
l((n = n.apply(
|
|
37
|
+
l((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
const
|
|
40
|
-
x:
|
|
41
|
-
y:
|
|
42
|
-
}),
|
|
39
|
+
const Ut = ["top", "right", "bottom", "left"], Lt = ["start", "end"], St = /* @__PURE__ */ Ut.reduce((e, t) => e.concat(t, t + "-" + Lt[0], t + "-" + Lt[1]), []), K = Math.min, z = Math.max, et = Math.round, $ = (e) => ({
|
|
40
|
+
x: e,
|
|
41
|
+
y: e
|
|
42
|
+
}), Xt = {
|
|
43
43
|
left: "right",
|
|
44
44
|
right: "left",
|
|
45
45
|
bottom: "top",
|
|
46
46
|
top: "bottom"
|
|
47
|
-
},
|
|
47
|
+
}, Kt = {
|
|
48
48
|
start: "end",
|
|
49
49
|
end: "start"
|
|
50
50
|
};
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function Gt(e, t, n) {
|
|
52
|
+
return z(e, K(t, n));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function it(e, t) {
|
|
55
|
+
return typeof e == "function" ? e(t) : e;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
57
|
+
function J(e) {
|
|
58
|
+
return e.split("-")[0];
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
60
|
+
function M(e) {
|
|
61
|
+
return e.split("-")[1];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
63
|
+
function Jt(e) {
|
|
64
|
+
return e === "x" ? "y" : "x";
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function gt(e) {
|
|
67
|
+
return e === "y" ? "height" : "width";
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
69
|
+
function pt(e) {
|
|
70
|
+
return ["top", "bottom"].includes(J(e)) ? "y" : "x";
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function mt(e) {
|
|
73
|
+
return Jt(pt(e));
|
|
74
|
+
}
|
|
75
|
+
function Qt(e, t, n) {
|
|
73
76
|
n === void 0 && (n = !1);
|
|
74
|
-
const i =
|
|
77
|
+
const i = M(e), o = mt(e), r = gt(o);
|
|
75
78
|
let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
76
|
-
return
|
|
79
|
+
return t.reference[r] > t.floating[r] && (s = Rt(s)), [s, Rt(s)];
|
|
77
80
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
81
|
+
function Zt(e) {
|
|
82
|
+
return e.replace(/start|end/g, (t) => Kt[t]);
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
84
|
+
function Rt(e) {
|
|
85
|
+
return e.replace(/left|right|bottom|top/g, (t) => Xt[t]);
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
87
|
+
function te(e) {
|
|
88
|
+
return L({
|
|
86
89
|
top: 0,
|
|
87
90
|
right: 0,
|
|
88
91
|
bottom: 0,
|
|
89
92
|
left: 0
|
|
90
|
-
},
|
|
91
|
-
}
|
|
92
|
-
function
|
|
93
|
-
return typeof
|
|
94
|
-
top:
|
|
95
|
-
right:
|
|
96
|
-
bottom:
|
|
97
|
-
left:
|
|
93
|
+
}, e);
|
|
94
|
+
}
|
|
95
|
+
function Dt(e) {
|
|
96
|
+
return typeof e != "number" ? te(e) : {
|
|
97
|
+
top: e,
|
|
98
|
+
right: e,
|
|
99
|
+
bottom: e,
|
|
100
|
+
left: e
|
|
98
101
|
};
|
|
99
102
|
}
|
|
100
|
-
function
|
|
103
|
+
function nt(e) {
|
|
101
104
|
const {
|
|
102
|
-
x:
|
|
105
|
+
x: t,
|
|
103
106
|
y: n,
|
|
104
107
|
width: i,
|
|
105
108
|
height: o
|
|
106
|
-
} =
|
|
109
|
+
} = e;
|
|
107
110
|
return {
|
|
108
111
|
width: i,
|
|
109
112
|
height: o,
|
|
110
113
|
top: n,
|
|
111
|
-
left:
|
|
112
|
-
right:
|
|
114
|
+
left: t,
|
|
115
|
+
right: t + i,
|
|
113
116
|
bottom: n + o,
|
|
114
|
-
x:
|
|
117
|
+
x: t,
|
|
115
118
|
y: n
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
|
-
function
|
|
121
|
+
function Tt(e, t, n) {
|
|
119
122
|
let {
|
|
120
123
|
reference: i,
|
|
121
124
|
floating: o
|
|
122
|
-
} =
|
|
123
|
-
const r =
|
|
124
|
-
let
|
|
125
|
+
} = e;
|
|
126
|
+
const r = pt(t), s = mt(t), l = gt(s), a = J(t), c = r === "y", h = i.x + i.width / 2 - o.width / 2, f = i.y + i.height / 2 - o.height / 2, g = i[l] / 2 - o[l] / 2;
|
|
127
|
+
let u;
|
|
125
128
|
switch (a) {
|
|
126
129
|
case "top":
|
|
127
|
-
|
|
128
|
-
x:
|
|
130
|
+
u = {
|
|
131
|
+
x: h,
|
|
129
132
|
y: i.y - o.height
|
|
130
133
|
};
|
|
131
134
|
break;
|
|
132
135
|
case "bottom":
|
|
133
|
-
|
|
134
|
-
x:
|
|
136
|
+
u = {
|
|
137
|
+
x: h,
|
|
135
138
|
y: i.y + i.height
|
|
136
139
|
};
|
|
137
140
|
break;
|
|
138
141
|
case "right":
|
|
139
|
-
|
|
142
|
+
u = {
|
|
140
143
|
x: i.x + i.width,
|
|
141
|
-
y:
|
|
144
|
+
y: f
|
|
142
145
|
};
|
|
143
146
|
break;
|
|
144
147
|
case "left":
|
|
145
|
-
|
|
148
|
+
u = {
|
|
146
149
|
x: i.x - o.width,
|
|
147
|
-
y:
|
|
150
|
+
y: f
|
|
148
151
|
};
|
|
149
152
|
break;
|
|
150
153
|
default:
|
|
151
|
-
|
|
154
|
+
u = {
|
|
152
155
|
x: i.x,
|
|
153
156
|
y: i.y
|
|
154
157
|
};
|
|
155
158
|
}
|
|
156
|
-
switch (
|
|
159
|
+
switch (M(t)) {
|
|
157
160
|
case "start":
|
|
158
|
-
|
|
161
|
+
u[s] -= g * (n && c ? -1 : 1);
|
|
159
162
|
break;
|
|
160
163
|
case "end":
|
|
161
|
-
|
|
164
|
+
u[s] += g * (n && c ? -1 : 1);
|
|
162
165
|
break;
|
|
163
166
|
}
|
|
164
|
-
return
|
|
167
|
+
return u;
|
|
165
168
|
}
|
|
166
|
-
const
|
|
169
|
+
const ee = (e, t, n) => k(void 0, null, function* () {
|
|
167
170
|
const {
|
|
168
171
|
placement: i = "bottom",
|
|
169
172
|
strategy: o = "absolute",
|
|
170
173
|
middleware: r = [],
|
|
171
174
|
platform: s
|
|
172
|
-
} = n, l = r.filter(Boolean), a = yield s.isRTL == null ? void 0 : s.isRTL(
|
|
175
|
+
} = n, l = r.filter(Boolean), a = yield s.isRTL == null ? void 0 : s.isRTL(t);
|
|
173
176
|
let c = yield s.getElementRects({
|
|
174
|
-
reference:
|
|
175
|
-
floating:
|
|
177
|
+
reference: e,
|
|
178
|
+
floating: t,
|
|
176
179
|
strategy: o
|
|
177
180
|
}), {
|
|
178
|
-
x:
|
|
179
|
-
y:
|
|
180
|
-
} =
|
|
181
|
-
for (let
|
|
181
|
+
x: h,
|
|
182
|
+
y: f
|
|
183
|
+
} = Tt(c, i, a), g = i, u = {}, d = 0;
|
|
184
|
+
for (let p = 0; p < l.length; p++) {
|
|
182
185
|
const {
|
|
183
|
-
name:
|
|
184
|
-
fn:
|
|
185
|
-
} = l[
|
|
186
|
+
name: w,
|
|
187
|
+
fn: x
|
|
188
|
+
} = l[p], {
|
|
186
189
|
x: _,
|
|
187
|
-
y:
|
|
188
|
-
data:
|
|
189
|
-
reset:
|
|
190
|
-
} = yield
|
|
191
|
-
x:
|
|
192
|
-
y:
|
|
190
|
+
y: m,
|
|
191
|
+
data: v,
|
|
192
|
+
reset: b
|
|
193
|
+
} = yield x({
|
|
194
|
+
x: h,
|
|
195
|
+
y: f,
|
|
193
196
|
initialPlacement: i,
|
|
194
|
-
placement:
|
|
197
|
+
placement: g,
|
|
195
198
|
strategy: o,
|
|
196
|
-
middlewareData:
|
|
199
|
+
middlewareData: u,
|
|
197
200
|
rects: c,
|
|
198
201
|
platform: s,
|
|
199
202
|
elements: {
|
|
200
|
-
reference:
|
|
201
|
-
floating:
|
|
203
|
+
reference: e,
|
|
204
|
+
floating: t
|
|
202
205
|
}
|
|
203
206
|
});
|
|
204
|
-
|
|
205
|
-
[
|
|
206
|
-
}),
|
|
207
|
-
reference:
|
|
208
|
-
floating:
|
|
207
|
+
h = _ != null ? _ : h, f = m != null ? m : f, u = X(L({}, u), {
|
|
208
|
+
[w]: L(L({}, u[w]), v)
|
|
209
|
+
}), b && d <= 50 && (d++, typeof b == "object" && (b.placement && (g = b.placement), b.rects && (c = b.rects === !0 ? yield s.getElementRects({
|
|
210
|
+
reference: e,
|
|
211
|
+
floating: t,
|
|
209
212
|
strategy: o
|
|
210
|
-
}) :
|
|
211
|
-
x:
|
|
212
|
-
y:
|
|
213
|
-
} =
|
|
213
|
+
}) : b.rects), {
|
|
214
|
+
x: h,
|
|
215
|
+
y: f
|
|
216
|
+
} = Tt(c, g, a)), p = -1);
|
|
214
217
|
}
|
|
215
218
|
return {
|
|
216
|
-
x:
|
|
217
|
-
y:
|
|
218
|
-
placement:
|
|
219
|
+
x: h,
|
|
220
|
+
y: f,
|
|
221
|
+
placement: g,
|
|
219
222
|
strategy: o,
|
|
220
|
-
middlewareData:
|
|
223
|
+
middlewareData: u
|
|
221
224
|
};
|
|
222
225
|
});
|
|
223
|
-
function
|
|
224
|
-
return
|
|
226
|
+
function ne(e, t) {
|
|
227
|
+
return k(this, null, function* () {
|
|
225
228
|
var n;
|
|
226
|
-
|
|
229
|
+
t === void 0 && (t = {});
|
|
227
230
|
const {
|
|
228
231
|
x: i,
|
|
229
232
|
y: o,
|
|
@@ -231,166 +234,205 @@ function Kt(t, e) {
|
|
|
231
234
|
rects: s,
|
|
232
235
|
elements: l,
|
|
233
236
|
strategy: a
|
|
234
|
-
} =
|
|
237
|
+
} = e, {
|
|
235
238
|
boundary: c = "clippingAncestors",
|
|
236
|
-
rootBoundary:
|
|
237
|
-
elementContext:
|
|
238
|
-
altBoundary:
|
|
239
|
-
padding:
|
|
240
|
-
} = it(
|
|
241
|
-
element: (n = yield r.isElement == null ? void 0 : r.isElement(
|
|
239
|
+
rootBoundary: h = "viewport",
|
|
240
|
+
elementContext: f = "floating",
|
|
241
|
+
altBoundary: g = !1,
|
|
242
|
+
padding: u = 0
|
|
243
|
+
} = it(t, e), d = Dt(u), w = l[g ? f === "floating" ? "reference" : "floating" : f], x = nt(yield r.getClippingRect({
|
|
244
|
+
element: (n = yield r.isElement == null ? void 0 : r.isElement(w)) == null || n ? w : w.contextElement || (yield r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
|
|
242
245
|
boundary: c,
|
|
243
|
-
rootBoundary:
|
|
246
|
+
rootBoundary: h,
|
|
244
247
|
strategy: a
|
|
245
|
-
})), _ =
|
|
248
|
+
})), _ = f === "floating" ? {
|
|
246
249
|
x: i,
|
|
247
250
|
y: o,
|
|
248
251
|
width: s.floating.width,
|
|
249
252
|
height: s.floating.height
|
|
250
|
-
} : s.reference,
|
|
253
|
+
} : s.reference, m = yield r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating), v = (yield r.isElement == null ? void 0 : r.isElement(m)) ? (yield r.getScale == null ? void 0 : r.getScale(m)) || {
|
|
251
254
|
x: 1,
|
|
252
255
|
y: 1
|
|
253
256
|
} : {
|
|
254
257
|
x: 1,
|
|
255
258
|
y: 1
|
|
256
|
-
},
|
|
259
|
+
}, b = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? yield r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
257
260
|
elements: l,
|
|
258
261
|
rect: _,
|
|
259
|
-
offsetParent:
|
|
262
|
+
offsetParent: m,
|
|
260
263
|
strategy: a
|
|
261
264
|
}) : _);
|
|
262
265
|
return {
|
|
263
|
-
top: (
|
|
264
|
-
bottom: (
|
|
265
|
-
left: (
|
|
266
|
-
right: (
|
|
266
|
+
top: (x.top - b.top + d.top) / v.y,
|
|
267
|
+
bottom: (b.bottom - x.bottom + d.bottom) / v.y,
|
|
268
|
+
left: (x.left - b.left + d.left) / v.x,
|
|
269
|
+
right: (b.right - x.right + d.right) / v.x
|
|
267
270
|
};
|
|
268
271
|
});
|
|
269
272
|
}
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
const ie = (e) => ({
|
|
274
|
+
name: "arrow",
|
|
275
|
+
options: e,
|
|
276
|
+
fn(n) {
|
|
277
|
+
return k(this, null, function* () {
|
|
278
|
+
const {
|
|
279
|
+
x: i,
|
|
280
|
+
y: o,
|
|
281
|
+
placement: r,
|
|
282
|
+
rects: s,
|
|
283
|
+
platform: l,
|
|
284
|
+
elements: a,
|
|
285
|
+
middlewareData: c
|
|
286
|
+
} = n, {
|
|
287
|
+
element: h,
|
|
288
|
+
padding: f = 0
|
|
289
|
+
} = it(e, n) || {};
|
|
290
|
+
if (h == null)
|
|
291
|
+
return {};
|
|
292
|
+
const g = Dt(f), u = {
|
|
293
|
+
x: i,
|
|
294
|
+
y: o
|
|
295
|
+
}, d = mt(r), p = gt(d), w = yield l.getDimensions(h), x = d === "y", _ = x ? "top" : "left", m = x ? "bottom" : "right", v = x ? "clientHeight" : "clientWidth", b = s.reference[p] + s.reference[d] - u[d] - s.floating[p], B = u[d] - s.reference[d], V = yield l.getOffsetParent == null ? void 0 : l.getOffsetParent(h);
|
|
296
|
+
let H = V ? V[v] : 0;
|
|
297
|
+
(!H || !(yield l.isElement == null ? void 0 : l.isElement(V))) && (H = a.floating[v] || s.floating[p]);
|
|
298
|
+
const vt = b / 2 - B / 2, q = H / 2 - w[p] / 2 - 1, U = K(g[_], q), C = K(g[m], q), E = U, Z = H - w[p] - C, D = H / 2 - w[p] / 2 + vt, lt = Gt(E, D, Z), ct = !c.arrow && M(r) != null && D !== lt && s.reference[p] / 2 - (D < E ? U : C) - w[p] / 2 < 0, at = ct ? D < E ? D - E : D - Z : 0;
|
|
299
|
+
return {
|
|
300
|
+
[d]: u[d] + at,
|
|
301
|
+
data: L({
|
|
302
|
+
[d]: lt,
|
|
303
|
+
centerOffset: D - lt - at
|
|
304
|
+
}, ct && {
|
|
305
|
+
alignmentOffset: at
|
|
306
|
+
}),
|
|
307
|
+
reset: ct
|
|
308
|
+
};
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
function oe(e, t, n) {
|
|
313
|
+
return (e ? [...n.filter((o) => M(o) === e), ...n.filter((o) => M(o) !== e)] : n.filter((o) => J(o) === o)).filter((o) => e ? M(o) === e || (t ? Zt(o) !== o : !1) : !0);
|
|
272
314
|
}
|
|
273
|
-
const
|
|
274
|
-
return
|
|
315
|
+
const se = function(e) {
|
|
316
|
+
return e === void 0 && (e = {}), {
|
|
275
317
|
name: "autoPlacement",
|
|
276
|
-
options:
|
|
318
|
+
options: e,
|
|
277
319
|
fn(n) {
|
|
278
|
-
return
|
|
320
|
+
return k(this, null, function* () {
|
|
279
321
|
var i, o, r;
|
|
280
322
|
const {
|
|
281
323
|
rects: s,
|
|
282
324
|
middlewareData: l,
|
|
283
325
|
placement: a,
|
|
284
326
|
platform: c,
|
|
285
|
-
elements:
|
|
286
|
-
} = n,
|
|
287
|
-
crossAxis:
|
|
288
|
-
alignment:
|
|
289
|
-
allowedPlacements:
|
|
290
|
-
autoAlignment:
|
|
291
|
-
} =
|
|
327
|
+
elements: h
|
|
328
|
+
} = n, U = it(e, n), {
|
|
329
|
+
crossAxis: f = !1,
|
|
330
|
+
alignment: g,
|
|
331
|
+
allowedPlacements: u = St,
|
|
332
|
+
autoAlignment: d = !0
|
|
333
|
+
} = U, p = Pt(U, [
|
|
292
334
|
"crossAxis",
|
|
293
335
|
"alignment",
|
|
294
336
|
"allowedPlacements",
|
|
295
337
|
"autoAlignment"
|
|
296
|
-
]),
|
|
297
|
-
if (
|
|
338
|
+
]), w = g !== void 0 || u === St ? oe(g || null, d, u) : u, x = yield ne(n, p), _ = ((i = l.autoPlacement) == null ? void 0 : i.index) || 0, m = w[_];
|
|
339
|
+
if (m == null)
|
|
298
340
|
return {};
|
|
299
|
-
const
|
|
300
|
-
if (a !==
|
|
341
|
+
const v = Qt(m, s, yield c.isRTL == null ? void 0 : c.isRTL(h.floating));
|
|
342
|
+
if (a !== m)
|
|
301
343
|
return {
|
|
302
344
|
reset: {
|
|
303
|
-
placement:
|
|
345
|
+
placement: w[0]
|
|
304
346
|
}
|
|
305
347
|
};
|
|
306
|
-
const
|
|
307
|
-
placement:
|
|
308
|
-
overflows:
|
|
309
|
-
}],
|
|
310
|
-
if (
|
|
348
|
+
const b = [x[J(m)], x[v[0]], x[v[1]]], B = [...((o = l.autoPlacement) == null ? void 0 : o.overflows) || [], {
|
|
349
|
+
placement: m,
|
|
350
|
+
overflows: b
|
|
351
|
+
}], V = w[_ + 1];
|
|
352
|
+
if (V)
|
|
311
353
|
return {
|
|
312
354
|
data: {
|
|
313
355
|
index: _ + 1,
|
|
314
|
-
overflows:
|
|
356
|
+
overflows: B
|
|
315
357
|
},
|
|
316
358
|
reset: {
|
|
317
|
-
placement:
|
|
359
|
+
placement: V
|
|
318
360
|
}
|
|
319
361
|
};
|
|
320
|
-
const
|
|
321
|
-
const
|
|
322
|
-
return [
|
|
362
|
+
const H = B.map((C) => {
|
|
363
|
+
const E = M(C.placement);
|
|
364
|
+
return [C.placement, E && f ? (
|
|
323
365
|
// Check along the mainAxis and main crossAxis side.
|
|
324
|
-
|
|
366
|
+
C.overflows.slice(0, 2).reduce((Z, D) => Z + D, 0)
|
|
325
367
|
) : (
|
|
326
368
|
// Check only the mainAxis.
|
|
327
|
-
|
|
328
|
-
),
|
|
329
|
-
}).sort((
|
|
369
|
+
C.overflows[0]
|
|
370
|
+
), C.overflows];
|
|
371
|
+
}).sort((C, E) => C[1] - E[1]), q = ((r = H.filter((C) => C[2].slice(
|
|
330
372
|
0,
|
|
331
373
|
// Aligned placements should not check their opposite crossAxis
|
|
332
374
|
// side.
|
|
333
|
-
|
|
334
|
-
).every((
|
|
335
|
-
return
|
|
375
|
+
M(C[0]) ? 2 : 3
|
|
376
|
+
).every((E) => E <= 0))[0]) == null ? void 0 : r[0]) || H[0][0];
|
|
377
|
+
return q !== a ? {
|
|
336
378
|
data: {
|
|
337
379
|
index: _ + 1,
|
|
338
|
-
overflows:
|
|
380
|
+
overflows: B
|
|
339
381
|
},
|
|
340
382
|
reset: {
|
|
341
|
-
placement:
|
|
383
|
+
placement: q
|
|
342
384
|
}
|
|
343
385
|
} : {};
|
|
344
386
|
});
|
|
345
387
|
}
|
|
346
388
|
};
|
|
347
389
|
};
|
|
348
|
-
function
|
|
349
|
-
return
|
|
390
|
+
function re(e, t) {
|
|
391
|
+
return k(this, null, function* () {
|
|
350
392
|
const {
|
|
351
393
|
placement: n,
|
|
352
394
|
platform: i,
|
|
353
395
|
elements: o
|
|
354
|
-
} =
|
|
396
|
+
} = e, r = yield i.isRTL == null ? void 0 : i.isRTL(o.floating), s = J(n), l = M(n), a = pt(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, h = r && a ? -1 : 1, f = it(t, e);
|
|
355
397
|
let {
|
|
356
|
-
mainAxis:
|
|
357
|
-
crossAxis:
|
|
358
|
-
alignmentAxis:
|
|
359
|
-
} = typeof
|
|
360
|
-
mainAxis:
|
|
398
|
+
mainAxis: g,
|
|
399
|
+
crossAxis: u,
|
|
400
|
+
alignmentAxis: d
|
|
401
|
+
} = typeof f == "number" ? {
|
|
402
|
+
mainAxis: f,
|
|
361
403
|
crossAxis: 0,
|
|
362
404
|
alignmentAxis: null
|
|
363
405
|
} : {
|
|
364
|
-
mainAxis:
|
|
365
|
-
crossAxis:
|
|
366
|
-
alignmentAxis:
|
|
406
|
+
mainAxis: f.mainAxis || 0,
|
|
407
|
+
crossAxis: f.crossAxis || 0,
|
|
408
|
+
alignmentAxis: f.alignmentAxis
|
|
367
409
|
};
|
|
368
|
-
return l && typeof
|
|
369
|
-
x:
|
|
370
|
-
y:
|
|
410
|
+
return l && typeof d == "number" && (u = l === "end" ? d * -1 : d), a ? {
|
|
411
|
+
x: u * h,
|
|
412
|
+
y: g * c
|
|
371
413
|
} : {
|
|
372
|
-
x:
|
|
373
|
-
y:
|
|
414
|
+
x: g * c,
|
|
415
|
+
y: u * h
|
|
374
416
|
};
|
|
375
417
|
});
|
|
376
418
|
}
|
|
377
|
-
const
|
|
378
|
-
return
|
|
419
|
+
const le = function(e) {
|
|
420
|
+
return e === void 0 && (e = 0), {
|
|
379
421
|
name: "offset",
|
|
380
|
-
options:
|
|
422
|
+
options: e,
|
|
381
423
|
fn(n) {
|
|
382
|
-
return
|
|
424
|
+
return k(this, null, function* () {
|
|
383
425
|
var i, o;
|
|
384
426
|
const {
|
|
385
427
|
x: r,
|
|
386
428
|
y: s,
|
|
387
429
|
placement: l,
|
|
388
430
|
middlewareData: a
|
|
389
|
-
} = n, c = yield
|
|
431
|
+
} = n, c = yield re(n, e);
|
|
390
432
|
return l === ((i = a.offset) == null ? void 0 : i.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
|
|
391
433
|
x: r + c.x,
|
|
392
434
|
y: s + c.y,
|
|
393
|
-
data:
|
|
435
|
+
data: X(L({}, c), {
|
|
394
436
|
placement: l
|
|
395
437
|
})
|
|
396
438
|
};
|
|
@@ -398,239 +440,239 @@ const Zt = function(t) {
|
|
|
398
440
|
}
|
|
399
441
|
};
|
|
400
442
|
};
|
|
401
|
-
function
|
|
443
|
+
function ot() {
|
|
402
444
|
return typeof window != "undefined";
|
|
403
445
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
446
|
+
function Y(e) {
|
|
447
|
+
return kt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
406
448
|
}
|
|
407
|
-
function
|
|
408
|
-
var
|
|
409
|
-
return (
|
|
449
|
+
function P(e) {
|
|
450
|
+
var t;
|
|
451
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
410
452
|
}
|
|
411
|
-
function
|
|
412
|
-
var
|
|
413
|
-
return (
|
|
453
|
+
function F(e) {
|
|
454
|
+
var t;
|
|
455
|
+
return (t = (kt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
414
456
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
457
|
+
function kt(e) {
|
|
458
|
+
return ot() ? e instanceof Node || e instanceof P(e).Node : !1;
|
|
417
459
|
}
|
|
418
|
-
function
|
|
419
|
-
return
|
|
460
|
+
function T(e) {
|
|
461
|
+
return ot() ? e instanceof Element || e instanceof P(e).Element : !1;
|
|
420
462
|
}
|
|
421
|
-
function
|
|
422
|
-
return
|
|
463
|
+
function A(e) {
|
|
464
|
+
return ot() ? e instanceof HTMLElement || e instanceof P(e).HTMLElement : !1;
|
|
423
465
|
}
|
|
424
|
-
function
|
|
425
|
-
return !
|
|
466
|
+
function Ot(e) {
|
|
467
|
+
return !ot() || typeof ShadowRoot == "undefined" ? !1 : e instanceof ShadowRoot || e instanceof P(e).ShadowRoot;
|
|
426
468
|
}
|
|
427
|
-
function
|
|
469
|
+
function Q(e) {
|
|
428
470
|
const {
|
|
429
|
-
overflow:
|
|
471
|
+
overflow: t,
|
|
430
472
|
overflowX: n,
|
|
431
473
|
overflowY: i,
|
|
432
474
|
display: o
|
|
433
|
-
} =
|
|
434
|
-
return /auto|scroll|overlay|hidden|clip/.test(
|
|
475
|
+
} = O(e);
|
|
476
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !["inline", "contents"].includes(o);
|
|
435
477
|
}
|
|
436
|
-
function
|
|
437
|
-
return ["table", "td", "th"].includes(
|
|
478
|
+
function ce(e) {
|
|
479
|
+
return ["table", "td", "th"].includes(Y(e));
|
|
438
480
|
}
|
|
439
|
-
function
|
|
440
|
-
return [":popover-open", ":modal"].some((
|
|
481
|
+
function st(e) {
|
|
482
|
+
return [":popover-open", ":modal"].some((t) => {
|
|
441
483
|
try {
|
|
442
|
-
return
|
|
484
|
+
return e.matches(t);
|
|
443
485
|
} catch (n) {
|
|
444
486
|
return !1;
|
|
445
487
|
}
|
|
446
488
|
});
|
|
447
489
|
}
|
|
448
|
-
function
|
|
449
|
-
const
|
|
450
|
-
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !
|
|
490
|
+
function wt(e) {
|
|
491
|
+
const t = xt(), n = T(e) ? O(e) : e;
|
|
492
|
+
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
|
|
451
493
|
}
|
|
452
|
-
function
|
|
453
|
-
let
|
|
454
|
-
for (;
|
|
455
|
-
if (
|
|
456
|
-
return
|
|
457
|
-
if (
|
|
494
|
+
function ae(e) {
|
|
495
|
+
let t = N(e);
|
|
496
|
+
for (; A(t) && !I(t); ) {
|
|
497
|
+
if (wt(t))
|
|
498
|
+
return t;
|
|
499
|
+
if (st(t))
|
|
458
500
|
return null;
|
|
459
|
-
|
|
501
|
+
t = N(t);
|
|
460
502
|
}
|
|
461
503
|
return null;
|
|
462
504
|
}
|
|
463
|
-
function
|
|
505
|
+
function xt() {
|
|
464
506
|
return typeof CSS == "undefined" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
465
507
|
}
|
|
466
|
-
function
|
|
467
|
-
return ["html", "body", "#document"].includes(
|
|
508
|
+
function I(e) {
|
|
509
|
+
return ["html", "body", "#document"].includes(Y(e));
|
|
468
510
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
511
|
+
function O(e) {
|
|
512
|
+
return P(e).getComputedStyle(e);
|
|
471
513
|
}
|
|
472
|
-
function
|
|
473
|
-
return
|
|
474
|
-
scrollLeft:
|
|
475
|
-
scrollTop:
|
|
514
|
+
function rt(e) {
|
|
515
|
+
return T(e) ? {
|
|
516
|
+
scrollLeft: e.scrollLeft,
|
|
517
|
+
scrollTop: e.scrollTop
|
|
476
518
|
} : {
|
|
477
|
-
scrollLeft:
|
|
478
|
-
scrollTop:
|
|
519
|
+
scrollLeft: e.scrollX,
|
|
520
|
+
scrollTop: e.scrollY
|
|
479
521
|
};
|
|
480
522
|
}
|
|
481
|
-
function
|
|
482
|
-
if (
|
|
483
|
-
return
|
|
484
|
-
const
|
|
523
|
+
function N(e) {
|
|
524
|
+
if (Y(e) === "html")
|
|
525
|
+
return e;
|
|
526
|
+
const t = (
|
|
485
527
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
528
|
+
e.assignedSlot || // DOM Element detected.
|
|
529
|
+
e.parentNode || // ShadowRoot detected.
|
|
530
|
+
Ot(e) && e.host || // Fallback.
|
|
531
|
+
F(e)
|
|
490
532
|
);
|
|
491
|
-
return
|
|
533
|
+
return Ot(t) ? t.host : t;
|
|
492
534
|
}
|
|
493
|
-
function
|
|
494
|
-
const
|
|
495
|
-
return
|
|
535
|
+
function Mt(e) {
|
|
536
|
+
const t = N(e);
|
|
537
|
+
return I(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : A(t) && Q(t) ? t : Mt(t);
|
|
496
538
|
}
|
|
497
|
-
function
|
|
539
|
+
function ut(e, t, n) {
|
|
498
540
|
var i;
|
|
499
|
-
|
|
500
|
-
const o =
|
|
541
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
542
|
+
const o = Mt(e), r = o === ((i = e.ownerDocument) == null ? void 0 : i.body), s = P(o);
|
|
501
543
|
if (r) {
|
|
502
|
-
const l =
|
|
503
|
-
return
|
|
544
|
+
const l = dt(s);
|
|
545
|
+
return t.concat(s, s.visualViewport || [], Q(o) ? o : [], l && n ? ut(l) : []);
|
|
504
546
|
}
|
|
505
|
-
return
|
|
547
|
+
return t.concat(o, ut(o, [], n));
|
|
506
548
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
549
|
+
function dt(e) {
|
|
550
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
509
551
|
}
|
|
510
|
-
function
|
|
511
|
-
const
|
|
512
|
-
let n = parseFloat(
|
|
513
|
-
const o =
|
|
552
|
+
function Ft(e) {
|
|
553
|
+
const t = O(e);
|
|
554
|
+
let n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
555
|
+
const o = A(e), r = o ? e.offsetWidth : n, s = o ? e.offsetHeight : i, l = et(n) !== r || et(i) !== s;
|
|
514
556
|
return l && (n = r, i = s), {
|
|
515
557
|
width: n,
|
|
516
558
|
height: i,
|
|
517
559
|
$: l
|
|
518
560
|
};
|
|
519
561
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
562
|
+
function Bt(e) {
|
|
563
|
+
return T(e) ? e : e.contextElement;
|
|
522
564
|
}
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
526
|
-
return
|
|
527
|
-
const n =
|
|
565
|
+
function j(e) {
|
|
566
|
+
const t = Bt(e);
|
|
567
|
+
if (!A(t))
|
|
568
|
+
return $(1);
|
|
569
|
+
const n = t.getBoundingClientRect(), {
|
|
528
570
|
width: i,
|
|
529
571
|
height: o,
|
|
530
572
|
$: r
|
|
531
|
-
} =
|
|
532
|
-
let s = (r ?
|
|
573
|
+
} = Ft(t);
|
|
574
|
+
let s = (r ? et(n.width) : n.width) / i, l = (r ? et(n.height) : n.height) / o;
|
|
533
575
|
return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
534
576
|
x: s,
|
|
535
577
|
y: l
|
|
536
578
|
};
|
|
537
579
|
}
|
|
538
|
-
const
|
|
539
|
-
function
|
|
540
|
-
const
|
|
541
|
-
return !
|
|
542
|
-
x:
|
|
543
|
-
y:
|
|
580
|
+
const fe = /* @__PURE__ */ $(0);
|
|
581
|
+
function Ht(e) {
|
|
582
|
+
const t = P(e);
|
|
583
|
+
return !xt() || !t.visualViewport ? fe : {
|
|
584
|
+
x: t.visualViewport.offsetLeft,
|
|
585
|
+
y: t.visualViewport.offsetTop
|
|
544
586
|
};
|
|
545
587
|
}
|
|
546
|
-
function
|
|
547
|
-
return
|
|
588
|
+
function he(e, t, n) {
|
|
589
|
+
return t === void 0 && (t = !1), !n || t && n !== P(e) ? !1 : t;
|
|
548
590
|
}
|
|
549
|
-
function
|
|
550
|
-
|
|
551
|
-
const o =
|
|
552
|
-
let s =
|
|
553
|
-
|
|
554
|
-
const l =
|
|
555
|
-
let a = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y,
|
|
591
|
+
function G(e, t, n, i) {
|
|
592
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
593
|
+
const o = e.getBoundingClientRect(), r = Bt(e);
|
|
594
|
+
let s = $(1);
|
|
595
|
+
t && (i ? T(i) && (s = j(i)) : s = j(e));
|
|
596
|
+
const l = he(r, n, i) ? Ht(r) : $(0);
|
|
597
|
+
let a = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y, h = o.width / s.x, f = o.height / s.y;
|
|
556
598
|
if (r) {
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
for (;
|
|
560
|
-
const
|
|
561
|
-
a *=
|
|
599
|
+
const g = P(r), u = i && T(i) ? P(i) : i;
|
|
600
|
+
let d = g, p = dt(d);
|
|
601
|
+
for (; p && i && u !== d; ) {
|
|
602
|
+
const w = j(p), x = p.getBoundingClientRect(), _ = O(p), m = x.left + (p.clientLeft + parseFloat(_.paddingLeft)) * w.x, v = x.top + (p.clientTop + parseFloat(_.paddingTop)) * w.y;
|
|
603
|
+
a *= w.x, c *= w.y, h *= w.x, f *= w.y, a += m, c += v, d = P(p), p = dt(d);
|
|
562
604
|
}
|
|
563
605
|
}
|
|
564
|
-
return
|
|
565
|
-
width:
|
|
566
|
-
height:
|
|
606
|
+
return nt({
|
|
607
|
+
width: h,
|
|
608
|
+
height: f,
|
|
567
609
|
x: a,
|
|
568
610
|
y: c
|
|
569
611
|
});
|
|
570
612
|
}
|
|
571
|
-
function
|
|
572
|
-
const n =
|
|
573
|
-
return
|
|
613
|
+
function yt(e, t) {
|
|
614
|
+
const n = rt(e).scrollLeft;
|
|
615
|
+
return t ? t.left + n : G(F(e)).left + n;
|
|
574
616
|
}
|
|
575
|
-
function
|
|
617
|
+
function Nt(e, t, n) {
|
|
576
618
|
n === void 0 && (n = !1);
|
|
577
|
-
const i =
|
|
619
|
+
const i = e.getBoundingClientRect(), o = i.left + t.scrollLeft - (n ? 0 : (
|
|
578
620
|
// RTL <body> scrollbar.
|
|
579
|
-
|
|
580
|
-
)), r = i.top +
|
|
621
|
+
yt(e, i)
|
|
622
|
+
)), r = i.top + t.scrollTop;
|
|
581
623
|
return {
|
|
582
624
|
x: o,
|
|
583
625
|
y: r
|
|
584
626
|
};
|
|
585
627
|
}
|
|
586
|
-
function
|
|
628
|
+
function ue(e) {
|
|
587
629
|
let {
|
|
588
|
-
elements:
|
|
630
|
+
elements: t,
|
|
589
631
|
rect: n,
|
|
590
632
|
offsetParent: i,
|
|
591
633
|
strategy: o
|
|
592
|
-
} =
|
|
593
|
-
const r = o === "fixed", s =
|
|
634
|
+
} = e;
|
|
635
|
+
const r = o === "fixed", s = F(i), l = t ? st(t.floating) : !1;
|
|
594
636
|
if (i === s || l && r)
|
|
595
637
|
return n;
|
|
596
638
|
let a = {
|
|
597
639
|
scrollLeft: 0,
|
|
598
640
|
scrollTop: 0
|
|
599
|
-
}, c =
|
|
600
|
-
const
|
|
601
|
-
if ((
|
|
602
|
-
const
|
|
603
|
-
c =
|
|
641
|
+
}, c = $(1);
|
|
642
|
+
const h = $(0), f = A(i);
|
|
643
|
+
if ((f || !f && !r) && ((Y(i) !== "body" || Q(s)) && (a = rt(i)), A(i))) {
|
|
644
|
+
const u = G(i);
|
|
645
|
+
c = j(i), h.x = u.x + i.clientLeft, h.y = u.y + i.clientTop;
|
|
604
646
|
}
|
|
605
|
-
const
|
|
647
|
+
const g = s && !f && !r ? Nt(s, a, !0) : $(0);
|
|
606
648
|
return {
|
|
607
649
|
width: n.width * c.x,
|
|
608
650
|
height: n.height * c.y,
|
|
609
|
-
x: n.x * c.x - a.scrollLeft * c.x +
|
|
610
|
-
y: n.y * c.y - a.scrollTop * c.y +
|
|
651
|
+
x: n.x * c.x - a.scrollLeft * c.x + h.x + g.x,
|
|
652
|
+
y: n.y * c.y - a.scrollTop * c.y + h.y + g.y
|
|
611
653
|
};
|
|
612
654
|
}
|
|
613
|
-
function
|
|
614
|
-
return Array.from(
|
|
655
|
+
function de(e) {
|
|
656
|
+
return Array.from(e.getClientRects());
|
|
615
657
|
}
|
|
616
|
-
function
|
|
617
|
-
const
|
|
618
|
-
let s = -n.scrollLeft +
|
|
658
|
+
function ge(e) {
|
|
659
|
+
const t = F(e), n = rt(e), i = e.ownerDocument.body, o = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
660
|
+
let s = -n.scrollLeft + yt(e);
|
|
619
661
|
const l = -n.scrollTop;
|
|
620
|
-
return
|
|
662
|
+
return O(i).direction === "rtl" && (s += z(t.clientWidth, i.clientWidth) - o), {
|
|
621
663
|
width: o,
|
|
622
664
|
height: r,
|
|
623
665
|
x: s,
|
|
624
666
|
y: l
|
|
625
667
|
};
|
|
626
668
|
}
|
|
627
|
-
function
|
|
628
|
-
const n =
|
|
669
|
+
function pe(e, t) {
|
|
670
|
+
const n = P(e), i = F(e), o = n.visualViewport;
|
|
629
671
|
let r = i.clientWidth, s = i.clientHeight, l = 0, a = 0;
|
|
630
672
|
if (o) {
|
|
631
673
|
r = o.width, s = o.height;
|
|
632
|
-
const c =
|
|
633
|
-
(!c || c &&
|
|
674
|
+
const c = xt();
|
|
675
|
+
(!c || c && t === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
|
|
634
676
|
}
|
|
635
677
|
return {
|
|
636
678
|
width: r,
|
|
@@ -639,8 +681,8 @@ function le(t, e) {
|
|
|
639
681
|
y: a
|
|
640
682
|
};
|
|
641
683
|
}
|
|
642
|
-
function
|
|
643
|
-
const n =
|
|
684
|
+
function me(e, t) {
|
|
685
|
+
const n = G(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, r = A(e) ? j(e) : $(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = o * r.x, c = i * r.y;
|
|
644
686
|
return {
|
|
645
687
|
width: s,
|
|
646
688
|
height: l,
|
|
@@ -648,53 +690,53 @@ function ce(t, e) {
|
|
|
648
690
|
y: c
|
|
649
691
|
};
|
|
650
692
|
}
|
|
651
|
-
function
|
|
693
|
+
function Et(e, t, n) {
|
|
652
694
|
let i;
|
|
653
|
-
if (
|
|
654
|
-
i =
|
|
655
|
-
else if (
|
|
656
|
-
i =
|
|
657
|
-
else if (
|
|
658
|
-
i =
|
|
695
|
+
if (t === "viewport")
|
|
696
|
+
i = pe(e, n);
|
|
697
|
+
else if (t === "document")
|
|
698
|
+
i = ge(F(e));
|
|
699
|
+
else if (T(t))
|
|
700
|
+
i = me(t, n);
|
|
659
701
|
else {
|
|
660
|
-
const o =
|
|
702
|
+
const o = Ht(e);
|
|
661
703
|
i = {
|
|
662
|
-
x:
|
|
663
|
-
y:
|
|
664
|
-
width:
|
|
665
|
-
height:
|
|
704
|
+
x: t.x - o.x,
|
|
705
|
+
y: t.y - o.y,
|
|
706
|
+
width: t.width,
|
|
707
|
+
height: t.height
|
|
666
708
|
};
|
|
667
709
|
}
|
|
668
|
-
return
|
|
710
|
+
return nt(i);
|
|
669
711
|
}
|
|
670
|
-
function
|
|
671
|
-
const n =
|
|
672
|
-
return n ===
|
|
712
|
+
function Vt(e, t) {
|
|
713
|
+
const n = N(e);
|
|
714
|
+
return n === t || !T(n) || I(n) ? !1 : O(n).position === "fixed" || Vt(n, t);
|
|
673
715
|
}
|
|
674
|
-
function
|
|
675
|
-
const n =
|
|
716
|
+
function we(e, t) {
|
|
717
|
+
const n = t.get(e);
|
|
676
718
|
if (n)
|
|
677
719
|
return n;
|
|
678
|
-
let i =
|
|
679
|
-
const r =
|
|
680
|
-
let s = r ?
|
|
681
|
-
for (;
|
|
682
|
-
const l =
|
|
683
|
-
!a && l.position === "fixed" && (o = null), (r ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) ||
|
|
720
|
+
let i = ut(e, [], !1).filter((l) => T(l) && Y(l) !== "body"), o = null;
|
|
721
|
+
const r = O(e).position === "fixed";
|
|
722
|
+
let s = r ? N(e) : e;
|
|
723
|
+
for (; T(s) && !I(s); ) {
|
|
724
|
+
const l = O(s), a = wt(s);
|
|
725
|
+
!a && l.position === "fixed" && (o = null), (r ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Q(s) && !a && Vt(e, s)) ? i = i.filter((h) => h !== s) : o = l, s = N(s);
|
|
684
726
|
}
|
|
685
|
-
return
|
|
727
|
+
return t.set(e, i), i;
|
|
686
728
|
}
|
|
687
|
-
function
|
|
729
|
+
function xe(e) {
|
|
688
730
|
let {
|
|
689
|
-
element:
|
|
731
|
+
element: t,
|
|
690
732
|
boundary: n,
|
|
691
733
|
rootBoundary: i,
|
|
692
734
|
strategy: o
|
|
693
|
-
} =
|
|
694
|
-
const s = [...n === "clippingAncestors" ?
|
|
695
|
-
const
|
|
696
|
-
return c.top =
|
|
697
|
-
},
|
|
735
|
+
} = e;
|
|
736
|
+
const s = [...n === "clippingAncestors" ? st(t) ? [] : we(t, this._c) : [].concat(n), i], l = s[0], a = s.reduce((c, h) => {
|
|
737
|
+
const f = Et(t, h, o);
|
|
738
|
+
return c.top = z(f.top, c.top), c.right = K(f.right, c.right), c.bottom = K(f.bottom, c.bottom), c.left = z(f.left, c.left), c;
|
|
739
|
+
}, Et(t, l, o));
|
|
698
740
|
return {
|
|
699
741
|
width: a.right - a.left,
|
|
700
742
|
height: a.bottom - a.top,
|
|
@@ -702,70 +744,70 @@ function fe(t) {
|
|
|
702
744
|
y: a.top
|
|
703
745
|
};
|
|
704
746
|
}
|
|
705
|
-
function
|
|
747
|
+
function ye(e) {
|
|
706
748
|
const {
|
|
707
|
-
width:
|
|
749
|
+
width: t,
|
|
708
750
|
height: n
|
|
709
|
-
} =
|
|
751
|
+
} = Ft(e);
|
|
710
752
|
return {
|
|
711
|
-
width:
|
|
753
|
+
width: t,
|
|
712
754
|
height: n
|
|
713
755
|
};
|
|
714
756
|
}
|
|
715
|
-
function
|
|
716
|
-
const i =
|
|
757
|
+
function ve(e, t, n) {
|
|
758
|
+
const i = A(t), o = F(t), r = n === "fixed", s = G(e, !0, r, t);
|
|
717
759
|
let l = {
|
|
718
760
|
scrollLeft: 0,
|
|
719
761
|
scrollTop: 0
|
|
720
762
|
};
|
|
721
|
-
const a =
|
|
763
|
+
const a = $(0);
|
|
722
764
|
if (i || !i && !r)
|
|
723
|
-
if ((
|
|
724
|
-
const
|
|
725
|
-
a.x =
|
|
726
|
-
} else o && (a.x =
|
|
727
|
-
const c = o && !i && !r ?
|
|
765
|
+
if ((Y(t) !== "body" || Q(o)) && (l = rt(t)), i) {
|
|
766
|
+
const g = G(t, !0, r, t);
|
|
767
|
+
a.x = g.x + t.clientLeft, a.y = g.y + t.clientTop;
|
|
768
|
+
} else o && (a.x = yt(o));
|
|
769
|
+
const c = o && !i && !r ? Nt(o, l) : $(0), h = s.left + l.scrollLeft - a.x - c.x, f = s.top + l.scrollTop - a.y - c.y;
|
|
728
770
|
return {
|
|
729
|
-
x:
|
|
730
|
-
y:
|
|
771
|
+
x: h,
|
|
772
|
+
y: f,
|
|
731
773
|
width: s.width,
|
|
732
774
|
height: s.height
|
|
733
775
|
};
|
|
734
776
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
777
|
+
function ht(e) {
|
|
778
|
+
return O(e).position === "static";
|
|
737
779
|
}
|
|
738
|
-
function
|
|
739
|
-
if (!
|
|
780
|
+
function $t(e, t) {
|
|
781
|
+
if (!A(e) || O(e).position === "fixed")
|
|
740
782
|
return null;
|
|
741
|
-
if (
|
|
742
|
-
return e
|
|
743
|
-
let n =
|
|
744
|
-
return
|
|
745
|
-
}
|
|
746
|
-
function
|
|
747
|
-
const n =
|
|
748
|
-
if (
|
|
783
|
+
if (t)
|
|
784
|
+
return t(e);
|
|
785
|
+
let n = e.offsetParent;
|
|
786
|
+
return F(e) === n && (n = n.ownerDocument.body), n;
|
|
787
|
+
}
|
|
788
|
+
function Wt(e, t) {
|
|
789
|
+
const n = P(e);
|
|
790
|
+
if (st(e))
|
|
749
791
|
return n;
|
|
750
|
-
if (!
|
|
751
|
-
let o =
|
|
752
|
-
for (; o && !
|
|
753
|
-
if (
|
|
792
|
+
if (!A(e)) {
|
|
793
|
+
let o = N(e);
|
|
794
|
+
for (; o && !I(o); ) {
|
|
795
|
+
if (T(o) && !ht(o))
|
|
754
796
|
return o;
|
|
755
|
-
o =
|
|
797
|
+
o = N(o);
|
|
756
798
|
}
|
|
757
799
|
return n;
|
|
758
800
|
}
|
|
759
|
-
let i =
|
|
760
|
-
for (; i &&
|
|
761
|
-
i =
|
|
762
|
-
return i &&
|
|
763
|
-
}
|
|
764
|
-
const
|
|
765
|
-
return
|
|
766
|
-
const
|
|
801
|
+
let i = $t(e, t);
|
|
802
|
+
for (; i && ce(i) && ht(i); )
|
|
803
|
+
i = $t(i, t);
|
|
804
|
+
return i && I(i) && ht(i) && !wt(i) ? n : i || ae(e) || n;
|
|
805
|
+
}
|
|
806
|
+
const be = function(e) {
|
|
807
|
+
return k(this, null, function* () {
|
|
808
|
+
const t = this.getOffsetParent || Wt, n = this.getDimensions, i = yield n(e.floating);
|
|
767
809
|
return {
|
|
768
|
-
reference:
|
|
810
|
+
reference: ve(e.reference, yield t(e.floating), e.strategy),
|
|
769
811
|
floating: {
|
|
770
812
|
x: 0,
|
|
771
813
|
y: 0,
|
|
@@ -775,245 +817,279 @@ const he = function(t) {
|
|
|
775
817
|
};
|
|
776
818
|
});
|
|
777
819
|
};
|
|
778
|
-
function
|
|
779
|
-
return
|
|
780
|
-
}
|
|
781
|
-
const
|
|
782
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
783
|
-
getDocumentElement:
|
|
784
|
-
getClippingRect:
|
|
785
|
-
getOffsetParent:
|
|
786
|
-
getElementRects:
|
|
787
|
-
getClientRects:
|
|
788
|
-
getDimensions:
|
|
789
|
-
getScale:
|
|
790
|
-
isElement:
|
|
791
|
-
isRTL:
|
|
792
|
-
},
|
|
793
|
-
const i = /* @__PURE__ */ new Map(), o =
|
|
794
|
-
platform:
|
|
795
|
-
}, n), r =
|
|
820
|
+
function _e(e) {
|
|
821
|
+
return O(e).direction === "rtl";
|
|
822
|
+
}
|
|
823
|
+
const Ce = {
|
|
824
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ue,
|
|
825
|
+
getDocumentElement: F,
|
|
826
|
+
getClippingRect: xe,
|
|
827
|
+
getOffsetParent: Wt,
|
|
828
|
+
getElementRects: be,
|
|
829
|
+
getClientRects: de,
|
|
830
|
+
getDimensions: ye,
|
|
831
|
+
getScale: j,
|
|
832
|
+
isElement: T,
|
|
833
|
+
isRTL: _e
|
|
834
|
+
}, Pe = le, Le = se, Se = ie, Re = (e, t, n) => {
|
|
835
|
+
const i = /* @__PURE__ */ new Map(), o = L({
|
|
836
|
+
platform: Ce
|
|
837
|
+
}, n), r = X(L({}, o.platform), {
|
|
796
838
|
_c: i
|
|
797
839
|
});
|
|
798
|
-
return
|
|
840
|
+
return ee(e, t, X(L({}, o), {
|
|
799
841
|
platform: r
|
|
800
842
|
}));
|
|
801
843
|
};
|
|
802
|
-
function
|
|
803
|
-
return
|
|
844
|
+
function W(e) {
|
|
845
|
+
return e === null || typeof e == "undefined";
|
|
804
846
|
}
|
|
805
|
-
function
|
|
806
|
-
return !
|
|
847
|
+
function R(e) {
|
|
848
|
+
return !W(e);
|
|
807
849
|
}
|
|
808
|
-
function
|
|
809
|
-
return new Promise((
|
|
850
|
+
function At(e) {
|
|
851
|
+
return new Promise((t) => setTimeout(t, e));
|
|
810
852
|
}
|
|
811
|
-
function
|
|
853
|
+
function zt(e) {
|
|
812
854
|
var i;
|
|
813
|
-
const
|
|
814
|
-
return !
|
|
855
|
+
const t = e.parentElement;
|
|
856
|
+
return !t || t.nodeName === "HTML" ? !1 : ((i = document.defaultView) == null ? void 0 : i.getComputedStyle(e, null).getPropertyValue("position")) === "fixed" ? !0 : zt(t);
|
|
815
857
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
858
|
+
function jt(e) {
|
|
859
|
+
return zt(e) ? "fixed" : "absolute";
|
|
818
860
|
}
|
|
819
|
-
class
|
|
861
|
+
class Te {
|
|
820
862
|
/** @inheritdoc */
|
|
821
|
-
renderContent(
|
|
822
|
-
|
|
863
|
+
renderContent(t, n, i) {
|
|
864
|
+
t.querySelector(`.${i.classPrefix}-content`).appendChild(n.node);
|
|
823
865
|
}
|
|
824
866
|
}
|
|
825
|
-
function
|
|
826
|
-
const n = document.createElement(
|
|
827
|
-
return
|
|
867
|
+
function S(e, t) {
|
|
868
|
+
const n = document.createElement(e);
|
|
869
|
+
return t && t.length > 0 && (t = t.filter((i) => i), n.classList.add(...t)), n;
|
|
828
870
|
}
|
|
829
|
-
class
|
|
871
|
+
class Oe {
|
|
830
872
|
/** @inheritdoc */
|
|
831
|
-
renderContent(
|
|
873
|
+
renderContent(t, n, i) {
|
|
832
874
|
var r, s, l, a;
|
|
833
|
-
const o =
|
|
875
|
+
const o = t.querySelector(`.${i.classPrefix}-content`);
|
|
834
876
|
if (n.imgSrc) {
|
|
835
|
-
const c =
|
|
877
|
+
const c = S("img", [
|
|
836
878
|
`${i.classPrefix}-image`,
|
|
837
879
|
`${(s = (r = n.customization) == null ? void 0 : r.imageClass) != null ? s : ""}`
|
|
838
880
|
]);
|
|
839
881
|
c.src = n.imgSrc, o.appendChild(c);
|
|
840
882
|
}
|
|
841
883
|
if (n.text) {
|
|
842
|
-
const c =
|
|
884
|
+
const c = S("p", [
|
|
843
885
|
`${i.classPrefix}-description`,
|
|
844
886
|
`${(a = (l = n.customization) == null ? void 0 : l.descriptionClass) != null ? a : ""}`
|
|
845
887
|
]);
|
|
846
|
-
c.innerText = n.text, o.appendChild(c);
|
|
888
|
+
c.innerText = i.translateFn(n.text), o.appendChild(c);
|
|
847
889
|
}
|
|
848
890
|
}
|
|
849
891
|
}
|
|
850
|
-
function
|
|
851
|
-
var l, a, c, f,
|
|
852
|
-
|
|
853
|
-
|
|
892
|
+
function Ee(e, t, n) {
|
|
893
|
+
var l, a, c, h, f, g, u, d, p, w, x, _;
|
|
894
|
+
if (e.innerHTML = "", e.className = `${n.config.classPrefix} ${n.config.animationClass}`, n.config.enableArrow) {
|
|
895
|
+
const m = S("div", [`${n.config.classPrefix}-arrow`]);
|
|
896
|
+
e.appendChild(m);
|
|
897
|
+
}
|
|
898
|
+
(l = t.customization) != null && l.class && e.classList.add(t.customization.class);
|
|
899
|
+
const i = S("div", [
|
|
854
900
|
`${n.config.classPrefix}-header`,
|
|
855
|
-
`${(c = (a =
|
|
901
|
+
`${(c = (a = t.customization) == null ? void 0 : a.headerClass) != null ? c : ""}`
|
|
856
902
|
]);
|
|
857
|
-
|
|
858
|
-
const o =
|
|
903
|
+
e.appendChild(i);
|
|
904
|
+
const o = S("h1", [
|
|
859
905
|
`${n.config.classPrefix}-title`,
|
|
860
|
-
`${(
|
|
906
|
+
`${(f = (h = t.customization) == null ? void 0 : h.titleClass) != null ? f : ""}`
|
|
861
907
|
]);
|
|
862
|
-
if (o.innerHTML = (
|
|
863
|
-
const
|
|
908
|
+
if (o.innerHTML = n.config.translateFn((g = t.title) != null ? g : ""), i.appendChild(o), n.config.allowClose) {
|
|
909
|
+
const m = S("button", [
|
|
864
910
|
`${n.config.classPrefix}-close`,
|
|
865
|
-
`${(
|
|
911
|
+
`${(d = (u = t.customization) == null ? void 0 : u.closeButtonClass) != null ? d : ""}`
|
|
866
912
|
]);
|
|
867
|
-
|
|
913
|
+
$e(m, n.config.closeIcon), m.onclick = n.complete.bind(n), i.appendChild(m);
|
|
868
914
|
}
|
|
869
|
-
const r =
|
|
915
|
+
const r = S("div", [
|
|
870
916
|
`${n.config.classPrefix}-content`,
|
|
871
|
-
`${(
|
|
917
|
+
`${(w = (p = t.customization) == null ? void 0 : p.contentClass) != null ? w : ""}`
|
|
872
918
|
]);
|
|
873
|
-
|
|
874
|
-
const s =
|
|
919
|
+
e.appendChild(r);
|
|
920
|
+
const s = S("div", [
|
|
875
921
|
`${n.config.classPrefix}-footer`,
|
|
876
|
-
`${(_ = (
|
|
922
|
+
`${(_ = (x = t.customization) == null ? void 0 : x.footerClass) != null ? _ : ""}`
|
|
877
923
|
]);
|
|
878
|
-
|
|
879
|
-
var
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
function Ce(t) {
|
|
924
|
+
W(t.buttonList) && (t.buttonList = Ae(n)), t.buttonList.forEach((m) => {
|
|
925
|
+
var B;
|
|
926
|
+
const v = [`${n.config.classPrefix}-button`, (B = m.class) != null ? B : ""];
|
|
927
|
+
W(m.type) || m.type === "secondary" ? v.push(`${n.config.classPrefix}-button-secondary`) : m.type === "primary" ? v.push(`${n.config.classPrefix}-button-primary`) : m.type === "link" && v.push(`${n.config.classPrefix}-button-link`), !W(m.class) && m.class !== "" && v.push(m.class);
|
|
928
|
+
const b = S("button", v);
|
|
929
|
+
b.innerText = n.config.translateFn(m.text), b.onclick = (V) => {
|
|
930
|
+
m.action.call(n);
|
|
931
|
+
}, s.appendChild(b);
|
|
932
|
+
}), e.appendChild(s);
|
|
933
|
+
}
|
|
934
|
+
function $e(e, t) {
|
|
935
|
+
t instanceof HTMLElement ? e.appendChild(t) : e.innerHTML = t.innerHTML;
|
|
936
|
+
}
|
|
937
|
+
function Ae(e) {
|
|
893
938
|
return [
|
|
894
939
|
{
|
|
895
940
|
text: "Back",
|
|
896
|
-
action:
|
|
941
|
+
action: e.prev
|
|
897
942
|
},
|
|
898
943
|
{
|
|
899
944
|
text: "Next",
|
|
900
945
|
type: "primary",
|
|
901
|
-
action:
|
|
946
|
+
action: e.next
|
|
902
947
|
}
|
|
903
948
|
];
|
|
904
949
|
}
|
|
905
|
-
class
|
|
950
|
+
class De {
|
|
906
951
|
constructor() {
|
|
907
|
-
|
|
952
|
+
y(this, "_renderContentStrategy", /* @__PURE__ */ new Map());
|
|
953
|
+
y(this, "_staticSides", {
|
|
954
|
+
top: "bottom",
|
|
955
|
+
right: "left",
|
|
956
|
+
bottom: "top",
|
|
957
|
+
left: "right"
|
|
958
|
+
});
|
|
908
959
|
this.setUpStrategies();
|
|
909
960
|
}
|
|
910
961
|
/** @inheritdoc */
|
|
911
|
-
render(
|
|
962
|
+
render(t, n) {
|
|
912
963
|
return new Promise((i) => {
|
|
913
964
|
var o, r;
|
|
914
965
|
if (!this._renderContentStrategy.has(n.popupData.type))
|
|
915
966
|
throw new Error("Missing popup creator strategy");
|
|
916
|
-
|
|
917
|
-
}).then(() => {
|
|
918
|
-
|
|
919
|
-
return n.isFirst || !n.hasHost && !((i = n.prevStep) != null && i.hasHost) || !n.hasHost && !((o = n.nextStep) != null && o.hasHost) ? Promise.resolve() : xe(400);
|
|
920
|
-
}).then(() => {
|
|
921
|
-
this.updatePosition(e, n), e.style.opacity = "1", e.style.animation = "fadeIn 0.3s ease-out";
|
|
967
|
+
t.style.display = "none", t.classList.remove(n.tour.config.animationClass), n.hostElement ? t.style.position = jt(n.hostElement) : t.style.position = "fixed", Ee(t, n.popupData, n.tour), (o = this._renderContentStrategy.get(n.popupData.type)) == null || o.renderContent(t, n.popupData, n.tour.config), (r = n.hostElement) == null || r.scrollIntoView(n.tour.config.scrollTo), i();
|
|
968
|
+
}).then(() => n.isFirst && n.direction === "toNext" ? At(0) : At(400)).then(() => {
|
|
969
|
+
t.style.display = "block", this.updatePosition(t, n), t.classList.add(n.tour.config.animationClass);
|
|
922
970
|
});
|
|
923
971
|
}
|
|
924
972
|
/** @inheritdoc */
|
|
925
|
-
updatePosition(
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
973
|
+
updatePosition(t, n) {
|
|
974
|
+
R(n.hostElement) ? this.renderFloatingPopup(t, n) : this.renderCenterPopup(t);
|
|
975
|
+
}
|
|
976
|
+
renderFloatingPopup(t, n) {
|
|
977
|
+
var c;
|
|
978
|
+
const i = t.style.position === "fixed" ? window.scrollY || document.documentElement.scrollTop : 0, o = t.querySelector(`.${n.tour.config.classPrefix}-arrow`), r = [], s = R(n.popupData.position) && n.popupData.position !== "auto" ? n.popupData.position : void 0, l = (c = o == null ? void 0 : o.offsetWidth) != null ? c : 10, a = Math.sqrt(2 * Ct(l, 2)) / 2 + n.tour.config.highlight.padding;
|
|
979
|
+
r.push(Pe(a)), (n.popupData.position === "auto" || W(s)) && r.push(Le()), n.tour.config.enableArrow && R(o) && r.push(Se({ element: o })), Re(n.hostElement, t, {
|
|
980
|
+
placement: s,
|
|
981
|
+
middleware: [...r]
|
|
982
|
+
}).then(({ x: h, y: f, middlewareData: g, placement: u }) => {
|
|
983
|
+
Object.assign(t.style, {
|
|
984
|
+
top: `${f - i}px`,
|
|
985
|
+
left: `${h}px`,
|
|
986
|
+
marginTop: "0",
|
|
987
|
+
marginLeft: "0"
|
|
935
988
|
});
|
|
936
|
-
|
|
989
|
+
const d = u.split("-")[0], p = this._staticSides[d];
|
|
990
|
+
if (g.arrow && R(o)) {
|
|
991
|
+
const { x: w, y: x } = g.arrow;
|
|
992
|
+
Object.assign(o.style, {
|
|
993
|
+
left: w != null ? `${w}px` : "",
|
|
994
|
+
top: x != null ? `${x}px` : "",
|
|
995
|
+
right: "",
|
|
996
|
+
bottom: "",
|
|
997
|
+
[p]: `${-l / 2}px`,
|
|
998
|
+
transform: "rotate(45deg)"
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
renderCenterPopup(t) {
|
|
1004
|
+
Object.assign(t.style, {
|
|
937
1005
|
top: "50%",
|
|
938
1006
|
left: "50%",
|
|
939
|
-
|
|
1007
|
+
marginTop: `-${t.clientHeight / 2}px`,
|
|
1008
|
+
marginLeft: `-${t.clientWidth / 2}px`
|
|
940
1009
|
});
|
|
941
1010
|
}
|
|
942
1011
|
setUpStrategies() {
|
|
943
|
-
this._renderContentStrategy.set("text", new
|
|
1012
|
+
this._renderContentStrategy.set("text", new Oe()), this._renderContentStrategy.set("custom", new Te());
|
|
944
1013
|
}
|
|
945
1014
|
}
|
|
946
|
-
class
|
|
1015
|
+
class ke {
|
|
947
1016
|
/** @inheritdoc */
|
|
948
|
-
render(
|
|
1017
|
+
render(t, n) {
|
|
949
1018
|
return new Promise((i) => {
|
|
950
|
-
n.hostElement && (
|
|
1019
|
+
n.hostElement && (t.style.position = jt(n.hostElement)), i();
|
|
951
1020
|
}).then(() => {
|
|
952
|
-
this.updatePosition(
|
|
1021
|
+
this.updatePosition(t, n);
|
|
953
1022
|
});
|
|
954
1023
|
}
|
|
955
1024
|
/** @inheritdoc */
|
|
956
|
-
updatePosition(
|
|
957
|
-
var
|
|
1025
|
+
updatePosition(t, n) {
|
|
1026
|
+
var s, l;
|
|
958
1027
|
if (!n.hostElement) {
|
|
959
|
-
|
|
1028
|
+
t.style.width = "0", t.style.height = "0", t.style.top = "50%", t.style.left = "50%", t.style.transform = "translate(-50%, -50%)", t.style.borderWidth = "0";
|
|
960
1029
|
return;
|
|
961
1030
|
}
|
|
962
|
-
const i = n.hostElement.getBoundingClientRect(), o = (
|
|
963
|
-
|
|
1031
|
+
const i = n.hostElement.getBoundingClientRect(), o = (l = (s = n.tour.config.highlight) == null ? void 0 : s.padding) != null ? l : 8, r = t.style.position === "fixed" ? 0 : window.scrollY || document.documentElement.scrollTop;
|
|
1032
|
+
t.style.transform = "", t.style.borderWidth = "2px", t.style.left = `${i.left - o}px`, t.style.top = `${i.top + r - o}px`, t.style.width = `${i.width + 2 * o}px`, t.style.height = `${i.height + 2 * o}px`;
|
|
964
1033
|
}
|
|
965
1034
|
}
|
|
966
|
-
class
|
|
967
|
-
constructor(
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
this
|
|
1035
|
+
class Me {
|
|
1036
|
+
constructor(t, n) {
|
|
1037
|
+
y(this, "id");
|
|
1038
|
+
y(this, "popupData");
|
|
1039
|
+
y(this, "tour");
|
|
1040
|
+
y(this, "index");
|
|
1041
|
+
y(this, "_hostElement", null);
|
|
1042
|
+
y(this, "_direction", "toNext");
|
|
1043
|
+
y(this, "_hostData");
|
|
1044
|
+
y(this, "_popupRenderer");
|
|
1045
|
+
y(this, "_highlightRenderer");
|
|
1046
|
+
var i;
|
|
1047
|
+
this.id = n.id, this.popupData = n.popup, this.tour = t, this.index = (i = n.index) != null ? i : null, this._hostData = n.host, this._popupRenderer = t.popupRenderer, this._highlightRenderer = t.highlightRenderer;
|
|
976
1048
|
}
|
|
977
1049
|
get isFirst() {
|
|
978
|
-
return this.
|
|
1050
|
+
return this.index === 0;
|
|
979
1051
|
}
|
|
980
1052
|
get nextStep() {
|
|
981
|
-
var
|
|
982
|
-
return (
|
|
1053
|
+
var t;
|
|
1054
|
+
return (t = this.tour.stepList[this.tour.stepList.indexOf(this) + 1]) != null ? t : null;
|
|
983
1055
|
}
|
|
984
1056
|
get prevStep() {
|
|
985
|
-
var
|
|
986
|
-
return (
|
|
1057
|
+
var t;
|
|
1058
|
+
return (t = this.tour.stepList[this.tour.stepList.indexOf(this) - 1]) != null ? t : null;
|
|
1059
|
+
}
|
|
1060
|
+
get direction() {
|
|
1061
|
+
return this._direction;
|
|
987
1062
|
}
|
|
988
1063
|
get hasHost() {
|
|
989
|
-
return
|
|
1064
|
+
return R(this._hostElement);
|
|
990
1065
|
}
|
|
991
1066
|
get hostElement() {
|
|
992
1067
|
return this._hostElement;
|
|
993
1068
|
}
|
|
994
|
-
show() {
|
|
995
|
-
return
|
|
996
|
-
var
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
this.
|
|
1001
|
-
|
|
1002
|
-
]
|
|
1069
|
+
show(t) {
|
|
1070
|
+
return k(this, null, function* () {
|
|
1071
|
+
var i;
|
|
1072
|
+
if (W(this.tour.popup))
|
|
1073
|
+
return;
|
|
1074
|
+
this._direction = t, this._hostData && (this._hostElement = this.resolveHostElement(
|
|
1075
|
+
typeof this._hostData == "function" ? this._hostData() : (i = this._hostData) != null ? i : null
|
|
1076
|
+
));
|
|
1077
|
+
const n = [this._popupRenderer.render(this.tour.popup, this)];
|
|
1078
|
+
!this.tour.config.highlight.disable && !W(this.tour.highlight) && n.push(this._highlightRenderer.render(this.tour.highlight, this)), yield Promise.all(n);
|
|
1003
1079
|
});
|
|
1004
1080
|
}
|
|
1005
|
-
resolveHostElement(
|
|
1006
|
-
return typeof this._hostData == "string" ? document.querySelector(this._hostData) :
|
|
1081
|
+
resolveHostElement(t) {
|
|
1082
|
+
return typeof this._hostData == "string" ? document.querySelector(this._hostData) : t;
|
|
1007
1083
|
}
|
|
1008
1084
|
}
|
|
1009
|
-
function
|
|
1085
|
+
function Fe(e) {
|
|
1010
1086
|
return {
|
|
1011
1087
|
innerHTML: `
|
|
1012
1088
|
<svg
|
|
1013
1089
|
xmlns="http://www.w3.org/2000/svg"
|
|
1014
1090
|
fill="none"
|
|
1015
1091
|
viewBox="0 0 162 162"
|
|
1016
|
-
class="${
|
|
1092
|
+
class="${e}-close-icon"
|
|
1017
1093
|
>
|
|
1018
1094
|
<path
|
|
1019
1095
|
stroke-linecap="round"
|
|
@@ -1031,36 +1107,37 @@ function Ee(t) {
|
|
|
1031
1107
|
`
|
|
1032
1108
|
};
|
|
1033
1109
|
}
|
|
1034
|
-
class
|
|
1035
|
-
constructor(
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
w(this, "_activeStep", null);
|
|
1047
|
-
w(this, "_bodyResizeObserver");
|
|
1048
|
-
w(this, "_config");
|
|
1049
|
-
w(this, "_stepMap", /* @__PURE__ */ new Map());
|
|
1050
|
-
var n, i, o, r, s, l, a, c, f;
|
|
1110
|
+
class He {
|
|
1111
|
+
constructor(t) {
|
|
1112
|
+
y(this, "popupRenderer", new De());
|
|
1113
|
+
y(this, "highlightRenderer", new ke());
|
|
1114
|
+
y(this, "_popup", null);
|
|
1115
|
+
y(this, "_highlight", null);
|
|
1116
|
+
y(this, "_stepList", []);
|
|
1117
|
+
y(this, "_activeStep", null);
|
|
1118
|
+
y(this, "_bodyResizeObserver");
|
|
1119
|
+
y(this, "_config");
|
|
1120
|
+
y(this, "_stepMap", /* @__PURE__ */ new Map());
|
|
1121
|
+
var n, i, o, r, s, l, a, c, h, f, g, u, d, p, w;
|
|
1051
1122
|
this._bodyResizeObserver = this.getBodyResizeObserver(), this._config = {
|
|
1052
|
-
classPrefix: (n =
|
|
1053
|
-
|
|
1054
|
-
|
|
1123
|
+
classPrefix: (n = t.classPrefix) != null ? n : "siteguide",
|
|
1124
|
+
animationClass: (i = t.animationClass) != null ? i : "siteguide-animation",
|
|
1125
|
+
allowClose: (o = t.allowClose) != null ? o : !0,
|
|
1126
|
+
// @ts-expect-error
|
|
1127
|
+
scrollTo: (r = t.scrollTo) != null ? r : {
|
|
1055
1128
|
behavior: "smooth",
|
|
1056
1129
|
block: "center",
|
|
1057
1130
|
inline: "center"
|
|
1058
1131
|
},
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1132
|
+
allowClickoutClose: (s = t.allowClickoutClose) != null ? s : !1,
|
|
1133
|
+
closeIcon: (a = t.closeIcon) != null ? a : Fe((l = t.classPrefix) != null ? l : "siteguide"),
|
|
1134
|
+
enableArrow: (c = t.enableArrow) != null ? c : !0,
|
|
1135
|
+
highlight: {
|
|
1136
|
+
disable: (f = (h = t.highlight) == null ? void 0 : h.disable) != null ? f : !1,
|
|
1137
|
+
padding: (u = (g = t.highlight) == null ? void 0 : g.padding) != null ? u : 8,
|
|
1138
|
+
class: (p = (d = t.highlight) == null ? void 0 : d.class) != null ? p : "siteguide-highlight"
|
|
1139
|
+
},
|
|
1140
|
+
translateFn: (w = t.translateFn) != null ? w : (x) => x
|
|
1064
1141
|
};
|
|
1065
1142
|
}
|
|
1066
1143
|
get stepList() {
|
|
@@ -1072,52 +1149,57 @@ class $e {
|
|
|
1072
1149
|
get popup() {
|
|
1073
1150
|
return this._popup;
|
|
1074
1151
|
}
|
|
1075
|
-
get
|
|
1076
|
-
return this.
|
|
1152
|
+
get highlight() {
|
|
1153
|
+
return this._highlight;
|
|
1077
1154
|
}
|
|
1078
|
-
addStep(
|
|
1079
|
-
if (this._stepMap.has(
|
|
1155
|
+
addStep(t) {
|
|
1156
|
+
if (this._stepMap.has(t.id))
|
|
1080
1157
|
throw new Error("Step with provided id has been already registered");
|
|
1081
|
-
const n = new
|
|
1082
|
-
this._stepList.push(n), this._stepMap.set(
|
|
1158
|
+
const n = new Me(this, t);
|
|
1159
|
+
R(t.index) ? this._stepList.splice(t.index, 0, n) : this._stepList.push(n), this._stepMap.set(t.id, n);
|
|
1083
1160
|
}
|
|
1084
|
-
addSteps(
|
|
1085
|
-
|
|
1161
|
+
addSteps(t) {
|
|
1162
|
+
t.forEach((n) => this.addStep(n));
|
|
1086
1163
|
}
|
|
1087
|
-
removeStep(
|
|
1088
|
-
this._stepList = this._stepList.filter((n) =>
|
|
1164
|
+
removeStep(t) {
|
|
1165
|
+
this._stepList = this._stepList.filter((n) => t !== n.id), this._stepMap.delete(t);
|
|
1089
1166
|
}
|
|
1090
1167
|
start() {
|
|
1091
|
-
this.
|
|
1168
|
+
this._popup = S("div", [this._config.classPrefix]), document.body.appendChild(this._popup), this._config.highlight.disable || (this._highlight = S("div", [
|
|
1169
|
+
R(this._config.highlight.class) ? this._config.highlight.class : `${this._config.classPrefix}-highlight`
|
|
1170
|
+
]), document.body.appendChild(this._highlight)), this.next();
|
|
1092
1171
|
}
|
|
1093
1172
|
complete() {
|
|
1094
|
-
this.
|
|
1173
|
+
this._popup && document.body.removeChild(this._popup), this._highlight && document.body.removeChild(this._highlight), this._activeStep = null;
|
|
1095
1174
|
}
|
|
1096
1175
|
prev() {
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1176
|
+
const t = R(this._activeStep) ? this._stepList.indexOf(this._activeStep) - 1 : this._stepList.indexOf(this._stepList[this._stepList.length - 1]);
|
|
1177
|
+
if (t < 0) {
|
|
1099
1178
|
this.complete();
|
|
1100
1179
|
return;
|
|
1101
1180
|
}
|
|
1102
|
-
this._activeStep = this._stepList[
|
|
1181
|
+
this._activeStep = this._stepList[t], this._activeStep.show("fromBack");
|
|
1103
1182
|
}
|
|
1104
1183
|
next() {
|
|
1105
|
-
const
|
|
1106
|
-
if (
|
|
1184
|
+
const t = R(this._activeStep) ? this._stepList.indexOf(this._activeStep) + 1 : this._stepList.indexOf(this._stepList[0]);
|
|
1185
|
+
if (t >= this._stepList.length) {
|
|
1107
1186
|
this.complete();
|
|
1108
1187
|
return;
|
|
1109
1188
|
}
|
|
1110
|
-
this._activeStep = this._stepList[
|
|
1189
|
+
this._activeStep = this._stepList[t], this._activeStep.show("toNext");
|
|
1190
|
+
}
|
|
1191
|
+
setConfig(t) {
|
|
1192
|
+
this._config = L(L({}, this._config), t);
|
|
1111
1193
|
}
|
|
1112
1194
|
getBodyResizeObserver() {
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1195
|
+
const t = new ResizeObserver(() => {
|
|
1196
|
+
this._activeStep && (R(this._popup) && this.popupRenderer.updatePosition(this._popup, this._activeStep), R(this._highlight) && !this.config.highlight.disable && this.highlightRenderer.updatePosition(this._highlight, this._activeStep));
|
|
1115
1197
|
});
|
|
1116
|
-
return
|
|
1198
|
+
return t.observe(document.body), t;
|
|
1117
1199
|
}
|
|
1118
1200
|
}
|
|
1119
1201
|
export {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1202
|
+
He as Tour,
|
|
1203
|
+
Me as TourStep,
|
|
1204
|
+
S as createElement
|
|
1123
1205
|
};
|