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