@trailguide/core 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics.d.ts +15 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/dom.d.ts +1 -0
- package/dist/dom.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/storage.d.ts +21 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/theme.d.ts +33 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/trailguide.d.ts +6 -2
- package/dist/trailguide.d.ts.map +1 -1
- package/dist/trailguide.js +592 -423
- package/dist/trailguide.umd.js +7 -4
- package/dist/types.d.ts +13 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/validate.d.ts +2 -3
- package/dist/validate.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/trailguide.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var Xt = Object.defineProperty;
|
|
2
|
+
var zt = (t, e, n) => e in t ? Xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => zt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
const Q = Math.min, z = Math.max, st = Math.round, L = (t) => ({
|
|
5
5
|
x: t,
|
|
6
6
|
y: t
|
|
7
|
-
}),
|
|
7
|
+
}), jt = {
|
|
8
8
|
left: "right",
|
|
9
9
|
right: "left",
|
|
10
10
|
bottom: "top",
|
|
11
11
|
top: "bottom"
|
|
12
|
-
},
|
|
12
|
+
}, Yt = {
|
|
13
13
|
start: "end",
|
|
14
14
|
end: "start"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function gt(t, e, n) {
|
|
17
|
+
return z(t, Q(e, n));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function tt(t, e) {
|
|
20
20
|
return typeof t == "function" ? t(e) : t;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function X(t) {
|
|
23
23
|
return t.split("-")[0];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function et(t) {
|
|
26
26
|
return t.split("-")[1];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function $t(t) {
|
|
29
29
|
return t === "x" ? "y" : "x";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function wt(t) {
|
|
32
32
|
return t === "y" ? "height" : "width";
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
return
|
|
34
|
+
const Kt = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
35
|
+
function _(t) {
|
|
36
|
+
return Kt.has(X(t)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function xt(t) {
|
|
39
|
+
return $t(_(t));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Gt(t, e, n) {
|
|
42
42
|
n === void 0 && (n = !1);
|
|
43
|
-
const i =
|
|
43
|
+
const i = et(t), o = xt(t), s = wt(o);
|
|
44
44
|
let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
45
|
-
return e.reference[s] > e.floating[s] && (r =
|
|
45
|
+
return e.reference[s] > e.floating[s] && (r = rt(r)), [r, rt(r)];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const e =
|
|
49
|
-
return [
|
|
47
|
+
function Jt(t) {
|
|
48
|
+
const e = rt(t);
|
|
49
|
+
return [mt(t), e, mt(e)];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return t.replace(/start|end/g, (e) =>
|
|
51
|
+
function mt(t) {
|
|
52
|
+
return t.replace(/start|end/g, (e) => Yt[e]);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
54
|
+
const At = ["left", "right"], Tt = ["right", "left"], Ut = ["top", "bottom"], Qt = ["bottom", "top"];
|
|
55
|
+
function Zt(t, e, n) {
|
|
56
56
|
switch (t) {
|
|
57
57
|
case "top":
|
|
58
58
|
case "bottom":
|
|
59
|
-
return n ? e ?
|
|
59
|
+
return n ? e ? Tt : At : e ? At : Tt;
|
|
60
60
|
case "left":
|
|
61
61
|
case "right":
|
|
62
|
-
return e ?
|
|
62
|
+
return e ? Ut : Qt;
|
|
63
63
|
default:
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const o =
|
|
69
|
-
let s =
|
|
70
|
-
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(
|
|
67
|
+
function te(t, e, n, i) {
|
|
68
|
+
const o = et(t);
|
|
69
|
+
let s = Zt(X(t), n === "start", i);
|
|
70
|
+
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(mt)))), s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
72
|
+
function rt(t) {
|
|
73
|
+
return t.replace(/left|right|bottom|top/g, (e) => jt[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ee(t) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -81,15 +81,15 @@ function Gt(t) {
|
|
|
81
81
|
...t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return typeof t != "number" ?
|
|
84
|
+
function Lt(t) {
|
|
85
|
+
return typeof t != "number" ? ee(t) : {
|
|
86
86
|
top: t,
|
|
87
87
|
right: t,
|
|
88
88
|
bottom: t,
|
|
89
89
|
left: t
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function lt(t) {
|
|
93
93
|
const {
|
|
94
94
|
x: e,
|
|
95
95
|
y: n,
|
|
@@ -107,14 +107,14 @@ function st(t) {
|
|
|
107
107
|
y: n
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Ct(t, e, n) {
|
|
111
111
|
let {
|
|
112
112
|
reference: i,
|
|
113
113
|
floating: o
|
|
114
114
|
} = t;
|
|
115
|
-
const s =
|
|
115
|
+
const s = _(e), r = xt(e), l = wt(r), a = X(e), c = s === "y", d = i.x + i.width / 2 - o.width / 2, u = i.y + i.height / 2 - o.height / 2, h = i[l] / 2 - o[l] / 2;
|
|
116
116
|
let f;
|
|
117
|
-
switch (
|
|
117
|
+
switch (a) {
|
|
118
118
|
case "top":
|
|
119
119
|
f = {
|
|
120
120
|
x: d,
|
|
@@ -145,17 +145,17 @@ function vt(t, e, n) {
|
|
|
145
145
|
y: i.y
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
switch (
|
|
148
|
+
switch (et(e)) {
|
|
149
149
|
case "start":
|
|
150
|
-
f[r] -=
|
|
150
|
+
f[r] -= h * (n && c ? -1 : 1);
|
|
151
151
|
break;
|
|
152
152
|
case "end":
|
|
153
|
-
f[r] +=
|
|
153
|
+
f[r] += h * (n && c ? -1 : 1);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
return f;
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
158
|
+
async function ie(t, e) {
|
|
159
159
|
var n;
|
|
160
160
|
e === void 0 && (e = {});
|
|
161
161
|
const {
|
|
@@ -164,19 +164,19 @@ async function Jt(t, e) {
|
|
|
164
164
|
platform: s,
|
|
165
165
|
rects: r,
|
|
166
166
|
elements: l,
|
|
167
|
-
strategy:
|
|
167
|
+
strategy: a
|
|
168
168
|
} = t, {
|
|
169
|
-
boundary:
|
|
169
|
+
boundary: c = "clippingAncestors",
|
|
170
170
|
rootBoundary: d = "viewport",
|
|
171
171
|
elementContext: u = "floating",
|
|
172
|
-
altBoundary:
|
|
172
|
+
altBoundary: h = !1,
|
|
173
173
|
padding: f = 0
|
|
174
|
-
} =
|
|
174
|
+
} = tt(e, t), p = Lt(f), m = l[h ? u === "floating" ? "reference" : "floating" : u], y = lt(await s.getClippingRect({
|
|
175
175
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(m))) == null || n ? m : m.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
176
|
-
boundary:
|
|
176
|
+
boundary: c,
|
|
177
177
|
rootBoundary: d,
|
|
178
|
-
strategy:
|
|
179
|
-
})),
|
|
178
|
+
strategy: a
|
|
179
|
+
})), w = u === "floating" ? {
|
|
180
180
|
x: i,
|
|
181
181
|
y: o,
|
|
182
182
|
width: r.floating.width,
|
|
@@ -187,55 +187,55 @@ async function Jt(t, e) {
|
|
|
187
187
|
} : {
|
|
188
188
|
x: 1,
|
|
189
189
|
y: 1
|
|
190
|
-
}, E =
|
|
190
|
+
}, E = lt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
191
191
|
elements: l,
|
|
192
|
-
rect:
|
|
192
|
+
rect: w,
|
|
193
193
|
offsetParent: x,
|
|
194
|
-
strategy:
|
|
195
|
-
}) :
|
|
194
|
+
strategy: a
|
|
195
|
+
}) : w);
|
|
196
196
|
return {
|
|
197
|
-
top: (
|
|
198
|
-
bottom: (E.bottom -
|
|
199
|
-
left: (
|
|
200
|
-
right: (E.right -
|
|
197
|
+
top: (y.top - E.top + p.top) / v.y,
|
|
198
|
+
bottom: (E.bottom - y.bottom + p.bottom) / v.y,
|
|
199
|
+
left: (y.left - E.left + p.left) / v.x,
|
|
200
|
+
right: (E.right - y.right + p.right) / v.x
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const ne = async (t, e, n) => {
|
|
204
204
|
const {
|
|
205
205
|
placement: i = "bottom",
|
|
206
206
|
strategy: o = "absolute",
|
|
207
207
|
middleware: s = [],
|
|
208
208
|
platform: r
|
|
209
|
-
} = n, l = s.filter(Boolean),
|
|
210
|
-
let
|
|
209
|
+
} = n, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
210
|
+
let c = await r.getElementRects({
|
|
211
211
|
reference: t,
|
|
212
212
|
floating: e,
|
|
213
213
|
strategy: o
|
|
214
214
|
}), {
|
|
215
215
|
x: d,
|
|
216
216
|
y: u
|
|
217
|
-
} =
|
|
217
|
+
} = Ct(c, i, a), h = i, f = {}, p = 0;
|
|
218
218
|
for (let m = 0; m < l.length; m++) {
|
|
219
219
|
var g;
|
|
220
220
|
const {
|
|
221
|
-
name:
|
|
222
|
-
fn:
|
|
221
|
+
name: y,
|
|
222
|
+
fn: w
|
|
223
223
|
} = l[m], {
|
|
224
224
|
x,
|
|
225
225
|
y: v,
|
|
226
226
|
data: E,
|
|
227
227
|
reset: A
|
|
228
|
-
} = await
|
|
228
|
+
} = await w({
|
|
229
229
|
x: d,
|
|
230
230
|
y: u,
|
|
231
231
|
initialPlacement: i,
|
|
232
|
-
placement:
|
|
232
|
+
placement: h,
|
|
233
233
|
strategy: o,
|
|
234
234
|
middlewareData: f,
|
|
235
|
-
rects:
|
|
235
|
+
rects: c,
|
|
236
236
|
platform: {
|
|
237
237
|
...r,
|
|
238
|
-
detectOverflow: (g = r.detectOverflow) != null ? g :
|
|
238
|
+
detectOverflow: (g = r.detectOverflow) != null ? g : ie
|
|
239
239
|
},
|
|
240
240
|
elements: {
|
|
241
241
|
reference: t,
|
|
@@ -244,27 +244,27 @@ const Qt = async (t, e, n) => {
|
|
|
244
244
|
});
|
|
245
245
|
d = x ?? d, u = v ?? u, f = {
|
|
246
246
|
...f,
|
|
247
|
-
[
|
|
248
|
-
...f[
|
|
247
|
+
[y]: {
|
|
248
|
+
...f[y],
|
|
249
249
|
...E
|
|
250
250
|
}
|
|
251
|
-
}, A &&
|
|
251
|
+
}, A && p <= 50 && (p++, typeof A == "object" && (A.placement && (h = A.placement), A.rects && (c = A.rects === !0 ? await r.getElementRects({
|
|
252
252
|
reference: t,
|
|
253
253
|
floating: e,
|
|
254
254
|
strategy: o
|
|
255
255
|
}) : A.rects), {
|
|
256
256
|
x: d,
|
|
257
257
|
y: u
|
|
258
|
-
} =
|
|
258
|
+
} = Ct(c, h, a)), m = -1);
|
|
259
259
|
}
|
|
260
260
|
return {
|
|
261
261
|
x: d,
|
|
262
262
|
y: u,
|
|
263
|
-
placement:
|
|
263
|
+
placement: h,
|
|
264
264
|
strategy: o,
|
|
265
265
|
middlewareData: f
|
|
266
266
|
};
|
|
267
|
-
},
|
|
267
|
+
}, oe = (t) => ({
|
|
268
268
|
name: "arrow",
|
|
269
269
|
options: t,
|
|
270
270
|
async fn(e) {
|
|
@@ -275,33 +275,33 @@ const Qt = async (t, e, n) => {
|
|
|
275
275
|
rects: s,
|
|
276
276
|
platform: r,
|
|
277
277
|
elements: l,
|
|
278
|
-
middlewareData:
|
|
278
|
+
middlewareData: a
|
|
279
279
|
} = e, {
|
|
280
|
-
element:
|
|
280
|
+
element: c,
|
|
281
281
|
padding: d = 0
|
|
282
|
-
} =
|
|
283
|
-
if (
|
|
282
|
+
} = tt(t, e) || {};
|
|
283
|
+
if (c == null)
|
|
284
284
|
return {};
|
|
285
|
-
const u =
|
|
285
|
+
const u = Lt(d), h = {
|
|
286
286
|
x: n,
|
|
287
287
|
y: i
|
|
288
|
-
}, f =
|
|
289
|
-
let
|
|
290
|
-
(!
|
|
291
|
-
const
|
|
288
|
+
}, f = xt(o), p = wt(f), g = await r.getDimensions(c), m = f === "y", y = m ? "top" : "left", w = m ? "bottom" : "right", x = m ? "clientHeight" : "clientWidth", v = s.reference[p] + s.reference[f] - h[f] - s.floating[p], E = h[f] - s.reference[f], A = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
289
|
+
let M = A ? A[x] : 0;
|
|
290
|
+
(!M || !await (r.isElement == null ? void 0 : r.isElement(A))) && (M = l.floating[x] || s.floating[p]);
|
|
291
|
+
const G = v / 2 - E / 2, N = M / 2 - g[p] / 2 - 1, P = Q(u[y], N), J = Q(u[w], N), V = P, U = M - g[p] - J, S = M / 2 - g[p] / 2 + G, W = gt(V, S, U), F = !a.arrow && et(o) != null && S !== W && s.reference[p] / 2 - (S < V ? P : J) - g[p] / 2 < 0, I = F ? S < V ? S - V : S - U : 0;
|
|
292
292
|
return {
|
|
293
|
-
[f]:
|
|
293
|
+
[f]: h[f] + I,
|
|
294
294
|
data: {
|
|
295
|
-
[f]:
|
|
296
|
-
centerOffset: S -
|
|
297
|
-
...
|
|
298
|
-
alignmentOffset:
|
|
295
|
+
[f]: W,
|
|
296
|
+
centerOffset: S - W - I,
|
|
297
|
+
...F && {
|
|
298
|
+
alignmentOffset: I
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
|
-
reset:
|
|
301
|
+
reset: F
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
}),
|
|
304
|
+
}), se = function(t) {
|
|
305
305
|
return t === void 0 && (t = {}), {
|
|
306
306
|
name: "flip",
|
|
307
307
|
options: t,
|
|
@@ -312,87 +312,87 @@ const Qt = async (t, e, n) => {
|
|
|
312
312
|
middlewareData: s,
|
|
313
313
|
rects: r,
|
|
314
314
|
initialPlacement: l,
|
|
315
|
-
platform:
|
|
316
|
-
elements:
|
|
315
|
+
platform: a,
|
|
316
|
+
elements: c
|
|
317
317
|
} = e, {
|
|
318
318
|
mainAxis: d = !0,
|
|
319
319
|
crossAxis: u = !0,
|
|
320
|
-
fallbackPlacements:
|
|
320
|
+
fallbackPlacements: h,
|
|
321
321
|
fallbackStrategy: f = "bestFit",
|
|
322
|
-
fallbackAxisSideDirection:
|
|
322
|
+
fallbackAxisSideDirection: p = "none",
|
|
323
323
|
flipAlignment: g = !0,
|
|
324
324
|
...m
|
|
325
|
-
} =
|
|
325
|
+
} = tt(t, e);
|
|
326
326
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
327
327
|
return {};
|
|
328
|
-
const
|
|
329
|
-
!
|
|
330
|
-
const
|
|
328
|
+
const y = X(o), w = _(l), x = X(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), E = h || (x || !g ? [rt(l)] : Jt(l)), A = p !== "none";
|
|
329
|
+
!h && A && E.push(...te(l, g, p, v));
|
|
330
|
+
const M = [l, ...E], G = await a.detectOverflow(e, m), N = [];
|
|
331
331
|
let P = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
332
|
-
if (d &&
|
|
333
|
-
const S =
|
|
334
|
-
|
|
332
|
+
if (d && N.push(G[y]), u) {
|
|
333
|
+
const S = Gt(o, r, v);
|
|
334
|
+
N.push(G[S[0]], G[S[1]]);
|
|
335
335
|
}
|
|
336
336
|
if (P = [...P, {
|
|
337
337
|
placement: o,
|
|
338
|
-
overflows:
|
|
339
|
-
}], !
|
|
340
|
-
var
|
|
341
|
-
const S = (((
|
|
342
|
-
if (
|
|
338
|
+
overflows: N
|
|
339
|
+
}], !N.every((S) => S <= 0)) {
|
|
340
|
+
var J, V;
|
|
341
|
+
const S = (((J = s.flip) == null ? void 0 : J.index) || 0) + 1, W = M[S];
|
|
342
|
+
if (W && (!(u === "alignment" ? w !== _(W) : !1) || // We leave the current main axis only if every placement on that axis
|
|
343
343
|
// overflows the main axis.
|
|
344
|
-
P.every((
|
|
344
|
+
P.every((k) => _(k.placement) === w ? k.overflows[0] > 0 : !0)))
|
|
345
345
|
return {
|
|
346
346
|
data: {
|
|
347
347
|
index: S,
|
|
348
348
|
overflows: P
|
|
349
349
|
},
|
|
350
350
|
reset: {
|
|
351
|
-
placement:
|
|
351
|
+
placement: W
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
let
|
|
355
|
-
if (!
|
|
354
|
+
let F = (V = P.filter((I) => I.overflows[0] <= 0).sort((I, k) => I.overflows[1] - k.overflows[1])[0]) == null ? void 0 : V.placement;
|
|
355
|
+
if (!F)
|
|
356
356
|
switch (f) {
|
|
357
357
|
case "bestFit": {
|
|
358
|
-
var
|
|
359
|
-
const
|
|
358
|
+
var U;
|
|
359
|
+
const I = (U = P.filter((k) => {
|
|
360
360
|
if (A) {
|
|
361
|
-
const B =
|
|
362
|
-
return B ===
|
|
361
|
+
const B = _(k.placement);
|
|
362
|
+
return B === w || // Create a bias to the `y` side axis due to horizontal
|
|
363
363
|
// reading directions favoring greater width.
|
|
364
364
|
B === "y";
|
|
365
365
|
}
|
|
366
366
|
return !0;
|
|
367
|
-
}).map((
|
|
368
|
-
|
|
367
|
+
}).map((k) => [k.placement, k.overflows.filter((B) => B > 0).reduce((B, Ht) => B + Ht, 0)]).sort((k, B) => k[1] - B[1])[0]) == null ? void 0 : U[0];
|
|
368
|
+
I && (F = I);
|
|
369
369
|
break;
|
|
370
370
|
}
|
|
371
371
|
case "initialPlacement":
|
|
372
|
-
|
|
372
|
+
F = l;
|
|
373
373
|
break;
|
|
374
374
|
}
|
|
375
|
-
if (o !==
|
|
375
|
+
if (o !== F)
|
|
376
376
|
return {
|
|
377
377
|
reset: {
|
|
378
|
-
placement:
|
|
378
|
+
placement: F
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
382
|
return {};
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
|
-
},
|
|
386
|
-
async function
|
|
385
|
+
}, re = /* @__PURE__ */ new Set(["left", "top"]);
|
|
386
|
+
async function le(t, e) {
|
|
387
387
|
const {
|
|
388
388
|
placement: n,
|
|
389
389
|
platform: i,
|
|
390
390
|
elements: o
|
|
391
|
-
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r =
|
|
391
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = X(n), l = et(n), a = _(n) === "y", c = re.has(r) ? -1 : 1, d = s && a ? -1 : 1, u = tt(e, t);
|
|
392
392
|
let {
|
|
393
|
-
mainAxis:
|
|
393
|
+
mainAxis: h,
|
|
394
394
|
crossAxis: f,
|
|
395
|
-
alignmentAxis:
|
|
395
|
+
alignmentAxis: p
|
|
396
396
|
} = typeof u == "number" ? {
|
|
397
397
|
mainAxis: u,
|
|
398
398
|
crossAxis: 0,
|
|
@@ -402,15 +402,15 @@ async function ie(t, e) {
|
|
|
402
402
|
crossAxis: u.crossAxis || 0,
|
|
403
403
|
alignmentAxis: u.alignmentAxis
|
|
404
404
|
};
|
|
405
|
-
return l && typeof
|
|
405
|
+
return l && typeof p == "number" && (f = l === "end" ? p * -1 : p), a ? {
|
|
406
406
|
x: f * d,
|
|
407
|
-
y:
|
|
407
|
+
y: h * c
|
|
408
408
|
} : {
|
|
409
|
-
x:
|
|
409
|
+
x: h * c,
|
|
410
410
|
y: f * d
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const ce = function(t) {
|
|
414
414
|
return t === void 0 && (t = 0), {
|
|
415
415
|
name: "offset",
|
|
416
416
|
options: t,
|
|
@@ -421,18 +421,18 @@ const ne = function(t) {
|
|
|
421
421
|
y: s,
|
|
422
422
|
placement: r,
|
|
423
423
|
middlewareData: l
|
|
424
|
-
} = e,
|
|
424
|
+
} = e, a = await le(e, t);
|
|
425
425
|
return r === ((n = l.offset) == null ? void 0 : n.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
|
|
426
|
-
x: o +
|
|
427
|
-
y: s +
|
|
426
|
+
x: o + a.x,
|
|
427
|
+
y: s + a.y,
|
|
428
428
|
data: {
|
|
429
|
-
...
|
|
429
|
+
...a,
|
|
430
430
|
placement: r
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
|
-
},
|
|
435
|
+
}, ae = function(t) {
|
|
436
436
|
return t === void 0 && (t = {}), {
|
|
437
437
|
name: "shift",
|
|
438
438
|
options: t,
|
|
@@ -445,36 +445,36 @@ const ne = function(t) {
|
|
|
445
445
|
} = e, {
|
|
446
446
|
mainAxis: r = !0,
|
|
447
447
|
crossAxis: l = !1,
|
|
448
|
-
limiter:
|
|
449
|
-
fn: (
|
|
448
|
+
limiter: a = {
|
|
449
|
+
fn: (y) => {
|
|
450
450
|
let {
|
|
451
|
-
x:
|
|
451
|
+
x: w,
|
|
452
452
|
y: x
|
|
453
|
-
} =
|
|
453
|
+
} = y;
|
|
454
454
|
return {
|
|
455
|
-
x:
|
|
455
|
+
x: w,
|
|
456
456
|
y: x
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
},
|
|
460
|
-
...
|
|
461
|
-
} =
|
|
460
|
+
...c
|
|
461
|
+
} = tt(t, e), d = {
|
|
462
462
|
x: n,
|
|
463
463
|
y: i
|
|
464
|
-
}, u = await s.detectOverflow(e,
|
|
465
|
-
let
|
|
464
|
+
}, u = await s.detectOverflow(e, c), h = _(X(o)), f = $t(h);
|
|
465
|
+
let p = d[f], g = d[h];
|
|
466
466
|
if (r) {
|
|
467
|
-
const
|
|
468
|
-
|
|
467
|
+
const y = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = p + u[y], v = p - u[w];
|
|
468
|
+
p = gt(x, p, v);
|
|
469
469
|
}
|
|
470
470
|
if (l) {
|
|
471
|
-
const
|
|
472
|
-
g =
|
|
471
|
+
const y = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", x = g + u[y], v = g - u[w];
|
|
472
|
+
g = gt(x, g, v);
|
|
473
473
|
}
|
|
474
|
-
const m =
|
|
474
|
+
const m = a.fn({
|
|
475
475
|
...e,
|
|
476
|
-
[f]:
|
|
477
|
-
[
|
|
476
|
+
[f]: p,
|
|
477
|
+
[h]: g
|
|
478
478
|
});
|
|
479
479
|
return {
|
|
480
480
|
...m,
|
|
@@ -483,56 +483,56 @@ const ne = function(t) {
|
|
|
483
483
|
y: m.y - i,
|
|
484
484
|
enabled: {
|
|
485
485
|
[f]: r,
|
|
486
|
-
[
|
|
486
|
+
[h]: l
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function ct() {
|
|
494
494
|
return typeof window < "u";
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
return
|
|
496
|
+
function K(t) {
|
|
497
|
+
return Rt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function T(t) {
|
|
500
500
|
var e;
|
|
501
501
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function D(t) {
|
|
504
504
|
var e;
|
|
505
|
-
return (e = (
|
|
505
|
+
return (e = (Rt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
507
|
+
function Rt(t) {
|
|
508
|
+
return ct() ? t instanceof Node || t instanceof T(t).Node : !1;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return
|
|
510
|
+
function O(t) {
|
|
511
|
+
return ct() ? t instanceof Element || t instanceof T(t).Element : !1;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
513
|
+
function R(t) {
|
|
514
|
+
return ct() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
return !
|
|
516
|
+
function Et(t) {
|
|
517
|
+
return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
|
|
518
518
|
}
|
|
519
|
-
const
|
|
520
|
-
function
|
|
519
|
+
const ue = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
520
|
+
function it(t) {
|
|
521
521
|
const {
|
|
522
522
|
overflow: e,
|
|
523
523
|
overflowX: n,
|
|
524
524
|
overflowY: i,
|
|
525
525
|
display: o
|
|
526
|
-
} =
|
|
527
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !
|
|
526
|
+
} = $(t);
|
|
527
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ue.has(o);
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
531
|
-
return
|
|
529
|
+
const fe = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
530
|
+
function de(t) {
|
|
531
|
+
return fe.has(K(t));
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
535
|
-
return
|
|
533
|
+
const he = [":popover-open", ":modal"];
|
|
534
|
+
function at(t) {
|
|
535
|
+
return he.some((e) => {
|
|
536
536
|
try {
|
|
537
537
|
return t.matches(e);
|
|
538
538
|
} catch {
|
|
@@ -540,34 +540,34 @@ function lt(t) {
|
|
|
540
540
|
}
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
function
|
|
545
|
-
const e =
|
|
546
|
-
return
|
|
543
|
+
const pe = ["transform", "translate", "scale", "rotate", "perspective"], ge = ["transform", "translate", "scale", "rotate", "perspective", "filter"], me = ["paint", "layout", "strict", "content"];
|
|
544
|
+
function bt(t) {
|
|
545
|
+
const e = vt(), n = O(t) ? $(t) : t;
|
|
546
|
+
return pe.some((i) => n[i] ? n[i] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ge.some((i) => (n.willChange || "").includes(i)) || me.some((i) => (n.contain || "").includes(i));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
let e =
|
|
550
|
-
for (;
|
|
551
|
-
if (
|
|
548
|
+
function ye(t) {
|
|
549
|
+
let e = q(t);
|
|
550
|
+
for (; R(e) && !Y(e); ) {
|
|
551
|
+
if (bt(e))
|
|
552
552
|
return e;
|
|
553
|
-
if (
|
|
553
|
+
if (at(e))
|
|
554
554
|
return null;
|
|
555
|
-
e =
|
|
555
|
+
e = q(e);
|
|
556
556
|
}
|
|
557
557
|
return null;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function vt() {
|
|
560
560
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
561
561
|
}
|
|
562
|
-
const
|
|
562
|
+
const we = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
563
563
|
function Y(t) {
|
|
564
|
-
return
|
|
564
|
+
return we.has(K(t));
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
return
|
|
566
|
+
function $(t) {
|
|
567
|
+
return T(t).getComputedStyle(t);
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
return
|
|
569
|
+
function ut(t) {
|
|
570
|
+
return O(t) ? {
|
|
571
571
|
scrollLeft: t.scrollLeft,
|
|
572
572
|
scrollTop: t.scrollTop
|
|
573
573
|
} : {
|
|
@@ -575,185 +575,185 @@ function ct(t) {
|
|
|
575
575
|
scrollTop: t.scrollY
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
if (
|
|
578
|
+
function q(t) {
|
|
579
|
+
if (K(t) === "html")
|
|
580
580
|
return t;
|
|
581
581
|
const e = (
|
|
582
582
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
583
583
|
t.assignedSlot || // DOM Element detected.
|
|
584
584
|
t.parentNode || // ShadowRoot detected.
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
Et(t) && t.host || // Fallback.
|
|
586
|
+
D(t)
|
|
587
587
|
);
|
|
588
|
-
return
|
|
588
|
+
return Et(e) ? e.host : e;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
591
|
-
const e =
|
|
592
|
-
return Y(e) ? t.ownerDocument ? t.ownerDocument.body : t.body :
|
|
590
|
+
function Pt(t) {
|
|
591
|
+
const e = q(t);
|
|
592
|
+
return Y(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : R(e) && it(e) ? e : Pt(e);
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Ft(t, e, n) {
|
|
595
595
|
var i;
|
|
596
596
|
e === void 0 && (e = []);
|
|
597
|
-
const o =
|
|
598
|
-
return s ? (
|
|
597
|
+
const o = Pt(t), s = o === ((i = t.ownerDocument) == null ? void 0 : i.body), r = T(o);
|
|
598
|
+
return s ? (yt(r), e.concat(r, r.visualViewport || [], it(o) ? o : [], [])) : e.concat(o, Ft(o, []));
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function yt(t) {
|
|
601
601
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const e =
|
|
603
|
+
function Dt(t) {
|
|
604
|
+
const e = $(t);
|
|
605
605
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
606
|
-
const o =
|
|
606
|
+
const o = R(t), s = o ? t.offsetWidth : n, r = o ? t.offsetHeight : i, l = st(n) !== s || st(i) !== r;
|
|
607
607
|
return l && (n = s, i = r), {
|
|
608
608
|
width: n,
|
|
609
609
|
height: i,
|
|
610
610
|
$: l
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
613
|
+
function Bt(t) {
|
|
614
|
+
return O(t) ? t : t.contextElement;
|
|
615
615
|
}
|
|
616
616
|
function j(t) {
|
|
617
|
-
const e =
|
|
618
|
-
if (
|
|
619
|
-
return
|
|
617
|
+
const e = Bt(t);
|
|
618
|
+
if (!R(e))
|
|
619
|
+
return L(1);
|
|
620
620
|
const n = e.getBoundingClientRect(), {
|
|
621
621
|
width: i,
|
|
622
622
|
height: o,
|
|
623
623
|
$: s
|
|
624
|
-
} =
|
|
625
|
-
let r = (s ?
|
|
624
|
+
} = Dt(e);
|
|
625
|
+
let r = (s ? st(n.width) : n.width) / i, l = (s ? st(n.height) : n.height) / o;
|
|
626
626
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
627
627
|
x: r,
|
|
628
628
|
y: l
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
const e =
|
|
634
|
-
return !
|
|
631
|
+
const xe = /* @__PURE__ */ L(0);
|
|
632
|
+
function _t(t) {
|
|
633
|
+
const e = T(t);
|
|
634
|
+
return !vt() || !e.visualViewport ? xe : {
|
|
635
635
|
x: e.visualViewport.offsetLeft,
|
|
636
636
|
y: e.visualViewport.offsetTop
|
|
637
637
|
};
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
return e === void 0 && (e = !1), !n || e && n !==
|
|
639
|
+
function be(t, e, n) {
|
|
640
|
+
return e === void 0 && (e = !1), !n || e && n !== T(t) ? !1 : e;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Z(t, e, n, i) {
|
|
643
643
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
644
|
-
const o = t.getBoundingClientRect(), s =
|
|
645
|
-
let r =
|
|
646
|
-
e && (i ?
|
|
647
|
-
const l =
|
|
648
|
-
let
|
|
644
|
+
const o = t.getBoundingClientRect(), s = Bt(t);
|
|
645
|
+
let r = L(1);
|
|
646
|
+
e && (i ? O(i) && (r = j(i)) : r = j(t));
|
|
647
|
+
const l = be(s, n, i) ? _t(s) : L(0);
|
|
648
|
+
let a = (o.left + l.x) / r.x, c = (o.top + l.y) / r.y, d = o.width / r.x, u = o.height / r.y;
|
|
649
649
|
if (s) {
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
for (; g && i && f !==
|
|
653
|
-
const m = j(g),
|
|
654
|
-
|
|
650
|
+
const h = T(s), f = i && O(i) ? T(i) : i;
|
|
651
|
+
let p = h, g = yt(p);
|
|
652
|
+
for (; g && i && f !== p; ) {
|
|
653
|
+
const m = j(g), y = g.getBoundingClientRect(), w = $(g), x = y.left + (g.clientLeft + parseFloat(w.paddingLeft)) * m.x, v = y.top + (g.clientTop + parseFloat(w.paddingTop)) * m.y;
|
|
654
|
+
a *= m.x, c *= m.y, d *= m.x, u *= m.y, a += x, c += v, p = T(g), g = yt(p);
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
return
|
|
657
|
+
return lt({
|
|
658
658
|
width: d,
|
|
659
659
|
height: u,
|
|
660
|
-
x:
|
|
661
|
-
y:
|
|
660
|
+
x: a,
|
|
661
|
+
y: c
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
const n =
|
|
666
|
-
return e ? e.left + n :
|
|
664
|
+
function ft(t, e) {
|
|
665
|
+
const n = ut(t).scrollLeft;
|
|
666
|
+
return e ? e.left + n : Z(D(t)).left + n;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft -
|
|
668
|
+
function qt(t, e) {
|
|
669
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), o = n.top + e.scrollTop;
|
|
670
670
|
return {
|
|
671
671
|
x: i,
|
|
672
672
|
y: o
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ve(t) {
|
|
676
676
|
let {
|
|
677
677
|
elements: e,
|
|
678
678
|
rect: n,
|
|
679
679
|
offsetParent: i,
|
|
680
680
|
strategy: o
|
|
681
681
|
} = t;
|
|
682
|
-
const s = o === "fixed", r =
|
|
682
|
+
const s = o === "fixed", r = D(i), l = e ? at(e.floating) : !1;
|
|
683
683
|
if (i === r || l && s)
|
|
684
684
|
return n;
|
|
685
|
-
let
|
|
685
|
+
let a = {
|
|
686
686
|
scrollLeft: 0,
|
|
687
687
|
scrollTop: 0
|
|
688
|
-
},
|
|
689
|
-
const d =
|
|
690
|
-
if ((u || !u && !s) && ((
|
|
691
|
-
const f =
|
|
692
|
-
|
|
688
|
+
}, c = L(1);
|
|
689
|
+
const d = L(0), u = R(i);
|
|
690
|
+
if ((u || !u && !s) && ((K(i) !== "body" || it(r)) && (a = ut(i)), R(i))) {
|
|
691
|
+
const f = Z(i);
|
|
692
|
+
c = j(i), d.x = f.x + i.clientLeft, d.y = f.y + i.clientTop;
|
|
693
693
|
}
|
|
694
|
-
const
|
|
694
|
+
const h = r && !u && !s ? qt(r, a) : L(0);
|
|
695
695
|
return {
|
|
696
|
-
width: n.width *
|
|
697
|
-
height: n.height *
|
|
698
|
-
x: n.x *
|
|
699
|
-
y: n.y *
|
|
696
|
+
width: n.width * c.x,
|
|
697
|
+
height: n.height * c.y,
|
|
698
|
+
x: n.x * c.x - a.scrollLeft * c.x + d.x + h.x,
|
|
699
|
+
y: n.y * c.y - a.scrollTop * c.y + d.y + h.y
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Se(t) {
|
|
703
703
|
return Array.from(t.getClientRects());
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
const e =
|
|
707
|
-
let r = -n.scrollLeft +
|
|
705
|
+
function Ae(t) {
|
|
706
|
+
const e = D(t), n = ut(t), i = t.ownerDocument.body, o = z(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = z(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
707
|
+
let r = -n.scrollLeft + ft(t);
|
|
708
708
|
const l = -n.scrollTop;
|
|
709
|
-
return
|
|
709
|
+
return $(i).direction === "rtl" && (r += z(e.clientWidth, i.clientWidth) - o), {
|
|
710
710
|
width: o,
|
|
711
711
|
height: s,
|
|
712
712
|
x: r,
|
|
713
713
|
y: l
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
|
-
const
|
|
717
|
-
function
|
|
718
|
-
const n =
|
|
719
|
-
let s = i.clientWidth, r = i.clientHeight, l = 0,
|
|
716
|
+
const It = 25;
|
|
717
|
+
function Te(t, e) {
|
|
718
|
+
const n = T(t), i = D(t), o = n.visualViewport;
|
|
719
|
+
let s = i.clientWidth, r = i.clientHeight, l = 0, a = 0;
|
|
720
720
|
if (o) {
|
|
721
721
|
s = o.width, r = o.height;
|
|
722
|
-
const d =
|
|
723
|
-
(!d || d && e === "fixed") && (l = o.offsetLeft,
|
|
722
|
+
const d = vt();
|
|
723
|
+
(!d || d && e === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
|
|
724
724
|
}
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
727
|
-
const d = i.ownerDocument, u = d.body,
|
|
728
|
-
|
|
729
|
-
} else
|
|
725
|
+
const c = ft(i);
|
|
726
|
+
if (c <= 0) {
|
|
727
|
+
const d = i.ownerDocument, u = d.body, h = getComputedStyle(u), f = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - u.clientWidth - f);
|
|
728
|
+
p <= It && (s -= p);
|
|
729
|
+
} else c <= It && (s += c);
|
|
730
730
|
return {
|
|
731
731
|
width: s,
|
|
732
732
|
height: r,
|
|
733
733
|
x: l,
|
|
734
|
-
y:
|
|
734
|
+
y: a
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
const
|
|
738
|
-
function
|
|
739
|
-
const n =
|
|
737
|
+
const Ce = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
738
|
+
function Ee(t, e) {
|
|
739
|
+
const n = Z(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, s = R(t) ? j(t) : L(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, a = o * s.x, c = i * s.y;
|
|
740
740
|
return {
|
|
741
741
|
width: r,
|
|
742
742
|
height: l,
|
|
743
|
-
x:
|
|
744
|
-
y:
|
|
743
|
+
x: a,
|
|
744
|
+
y: c
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function kt(t, e, n) {
|
|
748
748
|
let i;
|
|
749
749
|
if (e === "viewport")
|
|
750
|
-
i =
|
|
750
|
+
i = Te(t, n);
|
|
751
751
|
else if (e === "document")
|
|
752
|
-
i =
|
|
753
|
-
else if (
|
|
754
|
-
i =
|
|
752
|
+
i = Ae(D(t));
|
|
753
|
+
else if (O(e))
|
|
754
|
+
i = Ee(e, n);
|
|
755
755
|
else {
|
|
756
|
-
const o =
|
|
756
|
+
const o = _t(t);
|
|
757
757
|
i = {
|
|
758
758
|
x: e.x - o.x,
|
|
759
759
|
y: e.y - o.y,
|
|
@@ -761,110 +761,110 @@ function At(t, e, n) {
|
|
|
761
761
|
height: e.height
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
return
|
|
764
|
+
return lt(i);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const n =
|
|
768
|
-
return n === e || !
|
|
766
|
+
function Mt(t, e) {
|
|
767
|
+
const n = q(t);
|
|
768
|
+
return n === e || !O(n) || Y(n) ? !1 : $(n).position === "fixed" || Mt(n, e);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Ie(t, e) {
|
|
771
771
|
const n = e.get(t);
|
|
772
772
|
if (n)
|
|
773
773
|
return n;
|
|
774
|
-
let i =
|
|
775
|
-
const s =
|
|
776
|
-
let r = s ?
|
|
777
|
-
for (;
|
|
778
|
-
const l =
|
|
779
|
-
!
|
|
774
|
+
let i = Ft(t, []).filter((l) => O(l) && K(l) !== "body"), o = null;
|
|
775
|
+
const s = $(t).position === "fixed";
|
|
776
|
+
let r = s ? q(t) : t;
|
|
777
|
+
for (; O(r) && !Y(r); ) {
|
|
778
|
+
const l = $(r), a = bt(r);
|
|
779
|
+
!a && l.position === "fixed" && (o = null), (s ? !a && !o : !a && l.position === "static" && !!o && Ce.has(o.position) || it(r) && !a && Mt(t, r)) ? i = i.filter((d) => d !== r) : o = l, r = q(r);
|
|
780
780
|
}
|
|
781
781
|
return e.set(t, i), i;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function ke(t) {
|
|
784
784
|
let {
|
|
785
785
|
element: e,
|
|
786
786
|
boundary: n,
|
|
787
787
|
rootBoundary: i,
|
|
788
788
|
strategy: o
|
|
789
789
|
} = t;
|
|
790
|
-
const r = [...n === "clippingAncestors" ?
|
|
791
|
-
const u =
|
|
792
|
-
return
|
|
793
|
-
},
|
|
790
|
+
const r = [...n === "clippingAncestors" ? at(e) ? [] : Ie(e, this._c) : [].concat(n), i], l = r[0], a = r.reduce((c, d) => {
|
|
791
|
+
const u = kt(e, d, o);
|
|
792
|
+
return c.top = z(u.top, c.top), c.right = Q(u.right, c.right), c.bottom = Q(u.bottom, c.bottom), c.left = z(u.left, c.left), c;
|
|
793
|
+
}, kt(e, l, o));
|
|
794
794
|
return {
|
|
795
|
-
width:
|
|
796
|
-
height:
|
|
797
|
-
x:
|
|
798
|
-
y:
|
|
795
|
+
width: a.right - a.left,
|
|
796
|
+
height: a.bottom - a.top,
|
|
797
|
+
x: a.left,
|
|
798
|
+
y: a.top
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Oe(t) {
|
|
802
802
|
const {
|
|
803
803
|
width: e,
|
|
804
804
|
height: n
|
|
805
|
-
} =
|
|
805
|
+
} = Dt(t);
|
|
806
806
|
return {
|
|
807
807
|
width: e,
|
|
808
808
|
height: n
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
const i =
|
|
811
|
+
function $e(t, e, n) {
|
|
812
|
+
const i = R(e), o = D(e), s = n === "fixed", r = Z(t, !0, s, e);
|
|
813
813
|
let l = {
|
|
814
814
|
scrollLeft: 0,
|
|
815
815
|
scrollTop: 0
|
|
816
816
|
};
|
|
817
|
-
const
|
|
818
|
-
function
|
|
819
|
-
|
|
817
|
+
const a = L(0);
|
|
818
|
+
function c() {
|
|
819
|
+
a.x = ft(o);
|
|
820
820
|
}
|
|
821
821
|
if (i || !i && !s)
|
|
822
|
-
if ((
|
|
823
|
-
const f =
|
|
824
|
-
|
|
825
|
-
} else o &&
|
|
826
|
-
s && !i && o &&
|
|
827
|
-
const d = o && !i && !s ?
|
|
822
|
+
if ((K(e) !== "body" || it(o)) && (l = ut(e)), i) {
|
|
823
|
+
const f = Z(e, !0, s, e);
|
|
824
|
+
a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
|
|
825
|
+
} else o && c();
|
|
826
|
+
s && !i && o && c();
|
|
827
|
+
const d = o && !i && !s ? qt(o, l) : L(0), u = r.left + l.scrollLeft - a.x - d.x, h = r.top + l.scrollTop - a.y - d.y;
|
|
828
828
|
return {
|
|
829
829
|
x: u,
|
|
830
|
-
y:
|
|
830
|
+
y: h,
|
|
831
831
|
width: r.width,
|
|
832
832
|
height: r.height
|
|
833
833
|
};
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
return
|
|
835
|
+
function dt(t) {
|
|
836
|
+
return $(t).position === "static";
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
if (
|
|
838
|
+
function Ot(t, e) {
|
|
839
|
+
if (!R(t) || $(t).position === "fixed")
|
|
840
840
|
return null;
|
|
841
841
|
if (e)
|
|
842
842
|
return e(t);
|
|
843
843
|
let n = t.offsetParent;
|
|
844
|
-
return
|
|
844
|
+
return D(t) === n && (n = n.ownerDocument.body), n;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
const n =
|
|
848
|
-
if (
|
|
846
|
+
function Nt(t, e) {
|
|
847
|
+
const n = T(t);
|
|
848
|
+
if (at(t))
|
|
849
849
|
return n;
|
|
850
|
-
if (
|
|
851
|
-
let o =
|
|
850
|
+
if (!R(t)) {
|
|
851
|
+
let o = q(t);
|
|
852
852
|
for (; o && !Y(o); ) {
|
|
853
|
-
if (
|
|
853
|
+
if (O(o) && !dt(o))
|
|
854
854
|
return o;
|
|
855
|
-
o =
|
|
855
|
+
o = q(o);
|
|
856
856
|
}
|
|
857
857
|
return n;
|
|
858
858
|
}
|
|
859
|
-
let i =
|
|
860
|
-
for (; i &&
|
|
861
|
-
i =
|
|
862
|
-
return i && Y(i) &&
|
|
859
|
+
let i = Ot(t, e);
|
|
860
|
+
for (; i && de(i) && dt(i); )
|
|
861
|
+
i = Ot(i, e);
|
|
862
|
+
return i && Y(i) && dt(i) && !bt(i) ? n : i || ye(t) || n;
|
|
863
863
|
}
|
|
864
|
-
const
|
|
865
|
-
const e = this.getOffsetParent ||
|
|
864
|
+
const Le = async function(t) {
|
|
865
|
+
const e = this.getOffsetParent || Nt, n = this.getDimensions, i = await n(t.floating);
|
|
866
866
|
return {
|
|
867
|
-
reference:
|
|
867
|
+
reference: $e(t.reference, await e(t.floating), t.strategy),
|
|
868
868
|
floating: {
|
|
869
869
|
x: 0,
|
|
870
870
|
y: 0,
|
|
@@ -873,107 +873,142 @@ const Te = async function(t) {
|
|
|
873
873
|
}
|
|
874
874
|
};
|
|
875
875
|
};
|
|
876
|
-
function
|
|
877
|
-
return
|
|
878
|
-
}
|
|
879
|
-
const
|
|
880
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
881
|
-
getDocumentElement:
|
|
882
|
-
getClippingRect:
|
|
883
|
-
getOffsetParent:
|
|
884
|
-
getElementRects:
|
|
885
|
-
getClientRects:
|
|
886
|
-
getDimensions:
|
|
876
|
+
function Re(t) {
|
|
877
|
+
return $(t).direction === "rtl";
|
|
878
|
+
}
|
|
879
|
+
const Pe = {
|
|
880
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ve,
|
|
881
|
+
getDocumentElement: D,
|
|
882
|
+
getClippingRect: ke,
|
|
883
|
+
getOffsetParent: Nt,
|
|
884
|
+
getElementRects: Le,
|
|
885
|
+
getClientRects: Se,
|
|
886
|
+
getDimensions: Oe,
|
|
887
887
|
getScale: j,
|
|
888
|
-
isElement:
|
|
889
|
-
isRTL:
|
|
890
|
-
},
|
|
888
|
+
isElement: O,
|
|
889
|
+
isRTL: Re
|
|
890
|
+
}, Fe = ce, De = ae, Be = se, _e = oe, qe = (t, e, n) => {
|
|
891
891
|
const i = /* @__PURE__ */ new Map(), o = {
|
|
892
|
-
platform:
|
|
892
|
+
platform: Pe,
|
|
893
893
|
...n
|
|
894
894
|
}, s = {
|
|
895
895
|
...o.platform,
|
|
896
896
|
_c: i
|
|
897
897
|
};
|
|
898
|
-
return
|
|
898
|
+
return ne(t, e, {
|
|
899
899
|
...o,
|
|
900
900
|
platform: s
|
|
901
901
|
});
|
|
902
902
|
};
|
|
903
|
-
function
|
|
903
|
+
function Vt(t) {
|
|
904
904
|
try {
|
|
905
905
|
return document.querySelector(t);
|
|
906
906
|
} catch {
|
|
907
907
|
return console.warn(`[Trailguide] Invalid selector: ${t}`), null;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Wt(t) {
|
|
911
911
|
const e = t.getBoundingClientRect(), n = window.getComputedStyle(t);
|
|
912
912
|
return e.width > 0 && e.height > 0 && n.visibility !== "hidden" && n.display !== "none" && n.opacity !== "0";
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function Me(t) {
|
|
915
915
|
t.scrollIntoView({
|
|
916
916
|
behavior: "smooth",
|
|
917
917
|
block: "center",
|
|
918
918
|
inline: "center"
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Ne(t) {
|
|
922
|
+
const e = document.createElement("div");
|
|
923
|
+
return e.textContent = t, e.innerHTML;
|
|
924
|
+
}
|
|
925
|
+
function nt(t, e, n) {
|
|
922
926
|
const i = document.createElement(t);
|
|
923
927
|
return e && (i.className = e), n && n.appendChild(i), i;
|
|
924
928
|
}
|
|
925
|
-
|
|
929
|
+
function Ve() {
|
|
930
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
931
|
+
}
|
|
932
|
+
let ht = null;
|
|
933
|
+
function We() {
|
|
934
|
+
return ht || (ht = Ve()), ht;
|
|
935
|
+
}
|
|
936
|
+
async function He(t, e) {
|
|
937
|
+
if (!t.endpoint) return;
|
|
938
|
+
const n = {
|
|
939
|
+
...e,
|
|
940
|
+
user_id: t.userId,
|
|
941
|
+
session_id: We(),
|
|
942
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
943
|
+
};
|
|
944
|
+
try {
|
|
945
|
+
const i = await fetch(t.endpoint, {
|
|
946
|
+
method: "POST",
|
|
947
|
+
headers: { "Content-Type": "application/json" },
|
|
948
|
+
body: JSON.stringify(n)
|
|
949
|
+
});
|
|
950
|
+
t.debug && (i.ok ? console.log("[Trailguide Analytics]", n) : console.error(`[Trailguide Analytics] Server error: ${i.status}`));
|
|
951
|
+
} catch (i) {
|
|
952
|
+
t.debug && console.error("[Trailguide Analytics] Failed:", i);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
class Xe {
|
|
926
956
|
constructor(e = {}) {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
957
|
+
C(this, "trail", null);
|
|
958
|
+
C(this, "currentStepIndex", 0);
|
|
959
|
+
C(this, "isActive", !1);
|
|
960
|
+
C(this, "options", {});
|
|
931
961
|
// DOM elements
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
962
|
+
C(this, "overlay", null);
|
|
963
|
+
C(this, "tooltip", null);
|
|
964
|
+
C(this, "arrowEl", null);
|
|
935
965
|
// Cleanup functions
|
|
936
|
-
|
|
966
|
+
C(this, "cleanupFns", []);
|
|
967
|
+
C(this, "stepCleanupFns", []);
|
|
968
|
+
C(this, "instanceId", `trailguide-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`);
|
|
969
|
+
// Bug fix: cancel pending step transition timers to prevent stale callbacks
|
|
970
|
+
C(this, "stepTimerId", null);
|
|
937
971
|
this.options = e;
|
|
938
972
|
}
|
|
939
973
|
start(e) {
|
|
940
|
-
this.trail = e, this.currentStepIndex = 0, this.isActive = !0, this.createOverlay(), this.showStep(), this.bindKeyboard();
|
|
974
|
+
this.trail = e, this.currentStepIndex = 0, this.isActive = !0, this.createOverlay(), this.showStep(), this.bindKeyboard(), this.emitAnalytics("trail_started");
|
|
941
975
|
}
|
|
942
976
|
stop() {
|
|
943
|
-
|
|
977
|
+
var e, n;
|
|
978
|
+
this.isActive ? (this.emitAnalytics("trail_abandoned"), this.isActive = !1, this.cleanup(), (n = (e = this.options).onAbandoned) == null || n.call(e)) : this.cleanup();
|
|
944
979
|
}
|
|
945
980
|
next() {
|
|
946
|
-
!this.trail || !this.isActive || (this.currentStepIndex < this.trail.steps.length - 1 ? (this.currentStepIndex++, this.showStep()) : this.complete());
|
|
981
|
+
!this.trail || !this.isActive || (this.emitAnalytics("step_completed"), this.currentStepIndex < this.trail.steps.length - 1 ? (this.currentStepIndex++, this.showStep()) : this.complete());
|
|
947
982
|
}
|
|
948
983
|
prev() {
|
|
949
984
|
!this.trail || !this.isActive || this.currentStepIndex > 0 && (this.currentStepIndex--, this.showStep());
|
|
950
985
|
}
|
|
951
986
|
skip() {
|
|
952
987
|
var e, n;
|
|
953
|
-
this.isActive = !1, this.cleanup(), (n = (e = this.options).onSkip) == null || n.call(e);
|
|
988
|
+
this.emitAnalytics("trail_skipped"), this.isActive = !1, this.cleanup(), (n = (e = this.options).onSkip) == null || n.call(e);
|
|
954
989
|
}
|
|
955
990
|
goToStep(e) {
|
|
956
991
|
!this.trail || !this.isActive || e >= 0 && e < this.trail.steps.length && (this.currentStepIndex = e, this.showStep());
|
|
957
992
|
}
|
|
958
993
|
complete() {
|
|
959
994
|
var e, n;
|
|
960
|
-
this.isActive = !1, this.cleanup(), (n = (e = this.options).onComplete) == null || n.call(e);
|
|
995
|
+
this.emitAnalytics("trail_completed"), this.isActive = !1, this.cleanup(), (n = (e = this.options).onComplete) == null || n.call(e);
|
|
961
996
|
}
|
|
962
997
|
createOverlay() {
|
|
963
|
-
var
|
|
964
|
-
this.overlay =
|
|
965
|
-
const e =
|
|
998
|
+
var i, o, s;
|
|
999
|
+
this.overlay = nt("div", "trailguide-overlay"), document.body.appendChild(this.overlay);
|
|
1000
|
+
const e = nt("div", "trailguide-spotlight", this.overlay), n = `${this.instanceId}-mask`;
|
|
966
1001
|
e.innerHTML = `
|
|
967
1002
|
<svg width="100%" height="100%">
|
|
968
1003
|
<defs>
|
|
969
|
-
<mask id="
|
|
1004
|
+
<mask id="${n}">
|
|
970
1005
|
<rect x="0" y="0" width="100%" height="100%" fill="white" />
|
|
971
1006
|
<rect class="trailguide-cutout" rx="4" fill="black" />
|
|
972
1007
|
</mask>
|
|
973
1008
|
</defs>
|
|
974
|
-
<rect x="0" y="0" width="100%" height="100%"
|
|
1009
|
+
<rect x="0" y="0" width="100%" height="100%" mask="url(#${n})" />
|
|
975
1010
|
</svg>
|
|
976
|
-
`,
|
|
1011
|
+
`, nt("div", "trailguide-highlight", this.overlay), this.tooltip = nt("div", "trailguide-tooltip"), this.tooltip.innerHTML = `
|
|
977
1012
|
<div class="trailguide-tooltip-content">
|
|
978
1013
|
<div class="trailguide-tooltip-header">
|
|
979
1014
|
<h3 class="trailguide-tooltip-title"></h3>
|
|
@@ -989,22 +1024,43 @@ class Fe {
|
|
|
989
1024
|
</div>
|
|
990
1025
|
<div class="trailguide-tooltip-arrow"></div>
|
|
991
1026
|
</div>
|
|
992
|
-
`, document.body.appendChild(this.tooltip), this.arrowEl = this.tooltip.querySelector(".trailguide-tooltip-arrow"), (
|
|
1027
|
+
`, document.body.appendChild(this.tooltip), this.arrowEl = this.tooltip.querySelector(".trailguide-tooltip-arrow"), (i = this.tooltip.querySelector(".trailguide-tooltip-close")) == null || i.addEventListener("click", () => this.skip()), (o = this.tooltip.querySelector(".trailguide-btn-prev")) == null || o.addEventListener("click", () => this.prev()), (s = this.tooltip.querySelector(".trailguide-btn-next")) == null || s.addEventListener("click", () => this.next());
|
|
993
1028
|
}
|
|
994
1029
|
showStep() {
|
|
1030
|
+
var l, a;
|
|
995
1031
|
if (!this.trail || !this.overlay || !this.tooltip) return;
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1032
|
+
this.stepTimerId !== null && (clearTimeout(this.stepTimerId), this.stepTimerId = null), this.stepCleanupFns.forEach((c) => c()), this.stepCleanupFns = [], this.tooltip.style.transform = "";
|
|
1033
|
+
const e = this.overlay.querySelector(".trailguide-spotlight"), n = this.overlay.querySelector(".trailguide-highlight");
|
|
1034
|
+
e && (e.style.display = ""), n && (n.style.display = "");
|
|
1035
|
+
const i = this.trail.steps[this.currentStepIndex];
|
|
1036
|
+
if (!i) return;
|
|
1037
|
+
this.emitAnalytics("step_viewed");
|
|
1038
|
+
const o = Vt(i.target), s = !o, r = o ? !Wt(o) : !1;
|
|
1039
|
+
if (s || r) {
|
|
1040
|
+
if (i.optional) {
|
|
1041
|
+
this.currentStepIndex < this.trail.steps.length - 1 ? (this.currentStepIndex++, this.showStep()) : this.complete();
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
const c = s ? "element_not_found" : "element_not_visible";
|
|
1045
|
+
(a = (l = this.options).onError) == null || a.call(l, i, c), console.warn(`[Trailguide] Target not found or not visible: ${i.target}`), this.showErrorState(i);
|
|
1001
1046
|
return;
|
|
1002
1047
|
}
|
|
1003
|
-
|
|
1004
|
-
var
|
|
1005
|
-
this.updateSpotlight(
|
|
1048
|
+
Me(o), this.stepTimerId = setTimeout(() => {
|
|
1049
|
+
var c, d;
|
|
1050
|
+
this.stepTimerId = null, this.isActive && (this.updateSpotlight(o), this.updateTooltip(i, o), (d = (c = this.options).onStepChange) == null || d.call(c, i, this.currentStepIndex));
|
|
1006
1051
|
}, 100);
|
|
1007
1052
|
}
|
|
1053
|
+
showErrorState(e) {
|
|
1054
|
+
var u, h;
|
|
1055
|
+
if (!this.tooltip || !this.trail) return;
|
|
1056
|
+
const n = (u = this.overlay) == null ? void 0 : u.querySelector(".trailguide-spotlight"), i = (h = this.overlay) == null ? void 0 : h.querySelector(".trailguide-highlight");
|
|
1057
|
+
n && (n.style.display = "none"), i && (i.style.display = "none");
|
|
1058
|
+
const o = this.tooltip.querySelector(".trailguide-tooltip-title"), s = this.tooltip.querySelector(".trailguide-tooltip-body"), r = this.tooltip.querySelector(".trailguide-tooltip-progress"), l = this.tooltip.querySelector(".trailguide-btn-prev"), a = this.tooltip.querySelector(".trailguide-btn-next"), c = this.currentStepIndex === 0, d = this.currentStepIndex === this.trail.steps.length - 1;
|
|
1059
|
+
o && (o.textContent = "Element Not Found"), s && (s.innerHTML = `
|
|
1060
|
+
<p style="color: #ef4444; margin: 0 0 8px 0;">Could not find: <code style="background: #fee2e2; padding: 2px 6px; border-radius: 4px; font-size: 12px;">${Ne(e.target)}</code></p>
|
|
1061
|
+
<p style="margin: 0; font-size: 13px; color: #6b7280;">The target element doesn't exist on this page. Press <kbd style="background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 11px;">Esc</kbd> to close or skip to the next step.</p>
|
|
1062
|
+
`), r && (r.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`), l && (l.style.display = c ? "none" : "block"), a && (a.textContent = d ? "Close" : "Skip Step"), this.tooltip.style.left = "50%", this.tooltip.style.top = "50%", this.tooltip.style.transform = "translate(-50%, -50%)";
|
|
1063
|
+
}
|
|
1008
1064
|
updateSpotlight(e) {
|
|
1009
1065
|
if (!this.overlay) return;
|
|
1010
1066
|
const n = e.getBoundingClientRect(), i = 8, o = this.overlay.querySelector(".trailguide-cutout");
|
|
@@ -1016,26 +1072,26 @@ class Fe {
|
|
|
1016
1072
|
const l = e.getBoundingClientRect();
|
|
1017
1073
|
o && (o.setAttribute("x", String(l.left - i)), o.setAttribute("y", String(l.top - i)), o.setAttribute("width", String(l.width + i * 2)), o.setAttribute("height", String(l.height + i * 2))), s && (s.style.top = `${l.top - i}px`, s.style.left = `${l.left - i}px`, s.style.width = `${l.width + i * 2}px`, s.style.height = `${l.height + i * 2}px`);
|
|
1018
1074
|
};
|
|
1019
|
-
window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), this.
|
|
1075
|
+
window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), this.stepCleanupFns.push(() => {
|
|
1020
1076
|
window.removeEventListener("scroll", r, !0), window.removeEventListener("resize", r);
|
|
1021
1077
|
});
|
|
1022
1078
|
}
|
|
1023
1079
|
async updateTooltip(e, n) {
|
|
1024
1080
|
if (!this.tooltip || !this.trail || !this.arrowEl) return;
|
|
1025
|
-
const i = this.currentStepIndex === 0, o = this.currentStepIndex === this.trail.steps.length - 1, s = this.tooltip.querySelector(".trailguide-tooltip-title"), r = this.tooltip.querySelector(".trailguide-tooltip-body"), l = this.tooltip.querySelector(".trailguide-tooltip-progress"),
|
|
1026
|
-
s && (s.textContent = e.title), r && (r.textContent = e.content), l && (l.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`),
|
|
1027
|
-
const { x: d, y: u, middlewareData:
|
|
1081
|
+
const i = this.currentStepIndex === 0, o = this.currentStepIndex === this.trail.steps.length - 1, s = this.tooltip.querySelector(".trailguide-tooltip-title"), r = this.tooltip.querySelector(".trailguide-tooltip-body"), l = this.tooltip.querySelector(".trailguide-tooltip-progress"), a = this.tooltip.querySelector(".trailguide-btn-prev"), c = this.tooltip.querySelector(".trailguide-btn-next");
|
|
1082
|
+
s && (s.textContent = e.title), r && (r.textContent = e.content), l && (l.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`), a && (a.style.display = i ? "none" : "block"), c && (c.textContent = o ? "Finish" : "Next");
|
|
1083
|
+
const { x: d, y: u, placement: h, middlewareData: f } = await qe(n, this.tooltip, {
|
|
1028
1084
|
placement: e.placement,
|
|
1029
1085
|
middleware: [
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1086
|
+
Fe(12),
|
|
1087
|
+
Be(),
|
|
1088
|
+
De({ padding: 8 }),
|
|
1089
|
+
_e({ element: this.arrowEl })
|
|
1034
1090
|
]
|
|
1035
1091
|
});
|
|
1036
|
-
if (this.tooltip.style.left = `${d}px`, this.tooltip.style.top = `${u}px`,
|
|
1037
|
-
const { x:
|
|
1038
|
-
this.arrowEl.style.left =
|
|
1092
|
+
if (!(!this.tooltip || !this.isActive) && (this.tooltip.style.left = `${d}px`, this.tooltip.style.top = `${u}px`, this.tooltip.dataset.placement = h, f.arrow && this.arrowEl)) {
|
|
1093
|
+
const { x: p, y: g } = f.arrow;
|
|
1094
|
+
this.arrowEl.style.left = p != null ? `${p}px` : "", this.arrowEl.style.top = g != null ? `${g}px` : "";
|
|
1039
1095
|
}
|
|
1040
1096
|
}
|
|
1041
1097
|
bindKeyboard() {
|
|
@@ -1058,26 +1114,77 @@ class Fe {
|
|
|
1058
1114
|
}
|
|
1059
1115
|
cleanup() {
|
|
1060
1116
|
var e, n;
|
|
1061
|
-
this.cleanupFns.forEach((i) => i()), this.cleanupFns = [], (e = this.overlay) == null || e.remove(), (n = this.tooltip) == null || n.remove(), this.overlay = null, this.tooltip = null;
|
|
1117
|
+
this.stepTimerId !== null && (clearTimeout(this.stepTimerId), this.stepTimerId = null), this.stepCleanupFns.forEach((i) => i()), this.stepCleanupFns = [], this.cleanupFns.forEach((i) => i()), this.cleanupFns = [], (e = this.overlay) == null || e.remove(), (n = this.tooltip) == null || n.remove(), this.overlay = null, this.tooltip = null, this.arrowEl = null;
|
|
1118
|
+
}
|
|
1119
|
+
emitAnalytics(e) {
|
|
1120
|
+
if (!this.options.analytics || !this.trail) return;
|
|
1121
|
+
const n = this.trail.steps[this.currentStepIndex], i = this.options.analytics.trailId || this.trail.id;
|
|
1122
|
+
He(this.options.analytics, {
|
|
1123
|
+
event_type: e,
|
|
1124
|
+
trail_id: i,
|
|
1125
|
+
step_id: n == null ? void 0 : n.id,
|
|
1126
|
+
step_index: this.currentStepIndex
|
|
1127
|
+
});
|
|
1062
1128
|
}
|
|
1063
1129
|
}
|
|
1064
1130
|
let b = null;
|
|
1065
|
-
function
|
|
1066
|
-
return b && b.stop(), b = new
|
|
1131
|
+
function Ye(t, e) {
|
|
1132
|
+
return b && b.stop(), b = new Xe(e), b.start(t), b;
|
|
1067
1133
|
}
|
|
1068
|
-
function
|
|
1069
|
-
b == null || b.stop();
|
|
1134
|
+
function Ke() {
|
|
1135
|
+
b == null || b.stop(), b = null;
|
|
1070
1136
|
}
|
|
1071
|
-
function
|
|
1137
|
+
function Ge() {
|
|
1072
1138
|
b == null || b.next();
|
|
1073
1139
|
}
|
|
1074
|
-
function
|
|
1140
|
+
function Je() {
|
|
1075
1141
|
b == null || b.prev();
|
|
1076
1142
|
}
|
|
1077
|
-
function
|
|
1078
|
-
b == null || b.skip();
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1143
|
+
function Ue() {
|
|
1144
|
+
b == null || b.skip(), b = null;
|
|
1145
|
+
}
|
|
1146
|
+
const Qe = {
|
|
1147
|
+
// Backgrounds
|
|
1148
|
+
bgBase: "#0f172a",
|
|
1149
|
+
bgCard: "#1e293b",
|
|
1150
|
+
bgGlass: "rgba(255,255,255,0.06)",
|
|
1151
|
+
bgInput: "rgba(255,255,255,0.03)",
|
|
1152
|
+
// Text
|
|
1153
|
+
textPrimary: "#f8fafc",
|
|
1154
|
+
textSecondary: "#e2e8f0",
|
|
1155
|
+
textTertiary: "#cbd5e1",
|
|
1156
|
+
textMuted: "#94a3b8",
|
|
1157
|
+
textFaint: "#64748b",
|
|
1158
|
+
// Borders
|
|
1159
|
+
borderSubtle: "rgba(255,255,255,0.06)",
|
|
1160
|
+
borderPanel: "rgba(255,255,255,0.08)",
|
|
1161
|
+
borderControl: "rgba(255,255,255,0.1)",
|
|
1162
|
+
// Brand / accent
|
|
1163
|
+
accent: "#1a91a2",
|
|
1164
|
+
accentBg: "rgba(26,145,162,0.15)",
|
|
1165
|
+
accentBorder: "rgba(26,145,162,0.3)",
|
|
1166
|
+
// Error / recording
|
|
1167
|
+
error: "#ef4444",
|
|
1168
|
+
errorBg: "rgba(239,68,68,0.1)",
|
|
1169
|
+
errorBorder: "rgba(239,68,68,0.3)",
|
|
1170
|
+
errorLight: "rgba(248,113,113,0.1)",
|
|
1171
|
+
errorText: "#fca5a5",
|
|
1172
|
+
// Success
|
|
1173
|
+
success: "#10b981",
|
|
1174
|
+
successBg: "rgba(16,185,129,0.1)",
|
|
1175
|
+
successBorder: "rgba(16,185,129,0.3)",
|
|
1176
|
+
successText: "#6ee7b7",
|
|
1177
|
+
// Warning
|
|
1178
|
+
warningBg: "rgba(234,179,8,0.1)",
|
|
1179
|
+
// Disabled
|
|
1180
|
+
disabled: "#9ca3af",
|
|
1181
|
+
disabledBg: "#4b5563",
|
|
1182
|
+
// Shadows
|
|
1183
|
+
shadowLight: "0 4px 12px rgba(0,0,0,0.15)",
|
|
1184
|
+
shadowMedium: "0 4px 20px rgba(0,0,0,0.4)",
|
|
1185
|
+
shadowOverlay: "rgba(0,0,0,0.3)"
|
|
1186
|
+
};
|
|
1187
|
+
function Ze(t) {
|
|
1081
1188
|
const e = [], n = [];
|
|
1082
1189
|
return t.id || e.push({
|
|
1083
1190
|
stepId: "",
|
|
@@ -1104,8 +1211,8 @@ function He(t) {
|
|
|
1104
1211
|
});
|
|
1105
1212
|
return;
|
|
1106
1213
|
}
|
|
1107
|
-
const s =
|
|
1108
|
-
s ?
|
|
1214
|
+
const s = Vt(i.target);
|
|
1215
|
+
s ? Wt(s) || n.push({
|
|
1109
1216
|
stepId: i.id,
|
|
1110
1217
|
stepIndex: o,
|
|
1111
1218
|
type: "hidden_target",
|
|
@@ -1117,7 +1224,7 @@ function He(t) {
|
|
|
1117
1224
|
type: "missing_target",
|
|
1118
1225
|
message: `Step ${o + 1} ("${i.title}"): Target element not found`,
|
|
1119
1226
|
selector: i.target
|
|
1120
|
-
}), i.target &&
|
|
1227
|
+
}), i.target && ze(i.target) && n.push({
|
|
1121
1228
|
stepId: i.id,
|
|
1122
1229
|
stepIndex: o,
|
|
1123
1230
|
type: "unstable_selector",
|
|
@@ -1130,10 +1237,10 @@ function He(t) {
|
|
|
1130
1237
|
warnings: n
|
|
1131
1238
|
});
|
|
1132
1239
|
}
|
|
1133
|
-
function
|
|
1240
|
+
function ze(t) {
|
|
1134
1241
|
return t.startsWith("#") || t.includes("[data-") ? !1 : !!(t.includes(":nth-child") || t.includes(":nth-of-type") || /^\.[a-z]+-[a-z0-9]+$/i.test(t));
|
|
1135
1242
|
}
|
|
1136
|
-
function
|
|
1243
|
+
function ti(t) {
|
|
1137
1244
|
if (t.valid && t.warnings.length === 0) {
|
|
1138
1245
|
console.log("%c✓ Trail validation passed", "color: green; font-weight: bold");
|
|
1139
1246
|
return;
|
|
@@ -1144,16 +1251,78 @@ function Xe(t) {
|
|
|
1144
1251
|
console.warn(`Step ${e.stepIndex + 1}: ${e.message}`), e.selector && console.warn(` Selector: ${e.selector}`);
|
|
1145
1252
|
}), console.groupEnd());
|
|
1146
1253
|
}
|
|
1254
|
+
const St = "trailguide:";
|
|
1255
|
+
function pt(t) {
|
|
1256
|
+
return `${St}completed:${t}`;
|
|
1257
|
+
}
|
|
1258
|
+
function ot(t) {
|
|
1259
|
+
return `${St}progress:${t}`;
|
|
1260
|
+
}
|
|
1261
|
+
function H() {
|
|
1262
|
+
try {
|
|
1263
|
+
return typeof window < "u" ? window.localStorage : null;
|
|
1264
|
+
} catch {
|
|
1265
|
+
return null;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
const ei = {
|
|
1269
|
+
/** Returns true if the user has completed or skipped this tour */
|
|
1270
|
+
hasCompleted(t) {
|
|
1271
|
+
var e;
|
|
1272
|
+
return ((e = H()) == null ? void 0 : e.getItem(pt(t))) === "true";
|
|
1273
|
+
},
|
|
1274
|
+
/** Marks the tour as completed so it won't auto-show again */
|
|
1275
|
+
markCompleted(t) {
|
|
1276
|
+
var e;
|
|
1277
|
+
(e = H()) == null || e.setItem(pt(t), "true");
|
|
1278
|
+
},
|
|
1279
|
+
/** Returns the last step index the user reached, or null if no progress saved */
|
|
1280
|
+
getProgress(t) {
|
|
1281
|
+
var i;
|
|
1282
|
+
const e = (i = H()) == null ? void 0 : i.getItem(ot(t));
|
|
1283
|
+
if (e == null) return null;
|
|
1284
|
+
const n = parseInt(e, 10);
|
|
1285
|
+
return isNaN(n) ? null : n;
|
|
1286
|
+
},
|
|
1287
|
+
/** Saves the user's current step so they can resume later */
|
|
1288
|
+
saveProgress(t, e) {
|
|
1289
|
+
var n;
|
|
1290
|
+
(n = H()) == null || n.setItem(ot(t), String(e));
|
|
1291
|
+
},
|
|
1292
|
+
/** Clears saved progress (but keeps the completion flag) */
|
|
1293
|
+
clearProgress(t) {
|
|
1294
|
+
var e;
|
|
1295
|
+
(e = H()) == null || e.removeItem(ot(t));
|
|
1296
|
+
},
|
|
1297
|
+
/** Clears both completion and progress state for this tour */
|
|
1298
|
+
reset(t) {
|
|
1299
|
+
const e = H();
|
|
1300
|
+
e == null || e.removeItem(pt(t)), e == null || e.removeItem(ot(t));
|
|
1301
|
+
},
|
|
1302
|
+
/** Clears all Trailguide state from localStorage */
|
|
1303
|
+
resetAll() {
|
|
1304
|
+
const t = H();
|
|
1305
|
+
if (!t) return;
|
|
1306
|
+
const e = [];
|
|
1307
|
+
for (let n = 0; n < t.length; n++) {
|
|
1308
|
+
const i = t.key(n);
|
|
1309
|
+
i != null && i.startsWith(St) && e.push(i);
|
|
1310
|
+
}
|
|
1311
|
+
e.forEach((n) => t.removeItem(n));
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1147
1314
|
export {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1315
|
+
Xe as Trailguide,
|
|
1316
|
+
Vt as findElement,
|
|
1317
|
+
Wt as isElementVisible,
|
|
1318
|
+
ti as logValidationResults,
|
|
1319
|
+
Ge as next,
|
|
1320
|
+
Je as prev,
|
|
1321
|
+
Me as scrollToElement,
|
|
1322
|
+
Ue as skip,
|
|
1323
|
+
Ye as start,
|
|
1324
|
+
Ke as stop,
|
|
1325
|
+
Qe as theme,
|
|
1326
|
+
ei as tourStorage,
|
|
1327
|
+
Ze as validateTrail
|
|
1159
1328
|
};
|