@shiva004/surveys 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -60
- package/dist/feedback/FeedbackApp.d.ts +3 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.js +698 -863
- package/dist/logs/LogsApp.d.ts +5 -0
- package/dist/logs/data.d.ts +18 -0
- package/dist/style.css +1 -1
- package/dist/ui.d.ts +0 -17
- package/package.json +2 -2
- package/dist/journey/JourneyApp.d.ts +0 -2
- package/dist/journey/analytics.d.ts +0 -29
- package/dist/survey/SurveyApp.d.ts +0 -2
- package/dist/survey/data.d.ts +0 -3
- package/dist/survey/nps.d.ts +0 -12
- package/dist/types.d.ts +0 -40
package/dist/index.js
CHANGED
|
@@ -1,564 +1,407 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"/dashboard": [["/checkout", 0.25], ["/docs", 0.15], ["/features", 0.1], ["EXIT", 0.5]],
|
|
27
|
-
"/checkout": [["EXIT", 1]]
|
|
28
|
-
}, he = (t, a) => {
|
|
29
|
-
let n = 0;
|
|
30
|
-
for (const [s, i] of t)
|
|
31
|
-
if (n += i, a < n) return s;
|
|
32
|
-
return t[t.length - 1][0];
|
|
33
|
-
};
|
|
34
|
-
function we(t, a) {
|
|
35
|
-
return Array.from({ length: t }, () => {
|
|
36
|
-
let n = he(Me, a());
|
|
37
|
-
const s = [n];
|
|
38
|
-
for (; s.length < 8; ) {
|
|
39
|
-
const i = he(Ee[n], a());
|
|
40
|
-
if (i === "EXIT") break;
|
|
41
|
-
s.push(i), n = i;
|
|
42
|
-
}
|
|
43
|
-
return s;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const Ae = () => we(400, be(42));
|
|
47
|
-
function Pe(t) {
|
|
48
|
-
const a = /* @__PURE__ */ new Map(), n = (s) => (a.has(s) || a.set(s, { views: 0, entries: 0, bounces: 0, exits: 0 }), a.get(s));
|
|
49
|
-
for (const s of t)
|
|
50
|
-
s.forEach((i) => {
|
|
51
|
-
n(i).views += 1;
|
|
52
|
-
}), n(s[0]).entries += 1, s.length === 1 && (n(s[0]).bounces += 1), n(s[s.length - 1]).exits += 1;
|
|
53
|
-
return [...a.entries()].map(([s, i]) => ({
|
|
54
|
-
page: s,
|
|
55
|
-
views: i.views,
|
|
56
|
-
bounceRate: i.entries ? i.bounces / i.entries * 100 : 0,
|
|
57
|
-
exitRate: i.views ? i.exits / i.views * 100 : 0
|
|
58
|
-
})).sort((s, i) => i.views - s.views);
|
|
59
|
-
}
|
|
60
|
-
function Re(t, a = 8) {
|
|
61
|
-
const n = /* @__PURE__ */ new Map();
|
|
62
|
-
for (const s of t) {
|
|
63
|
-
const i = s.slice(0, 4), m = i.join(">"), f = n.get(m) ?? { steps: i, users: 0, conv: 0 };
|
|
64
|
-
f.users += 1, s.includes("/signup") && (f.conv += 1), n.set(m, f);
|
|
65
|
-
}
|
|
66
|
-
return [...n.values()].map((s) => ({ steps: s.steps, users: s.users, convRate: s.conv / s.users * 100 })).sort((s, i) => i.users - s.users).slice(0, a);
|
|
67
|
-
}
|
|
68
|
-
function $e(t) {
|
|
69
|
-
const a = /* @__PURE__ */ new Map();
|
|
70
|
-
for (const n of t)
|
|
71
|
-
for (let s = 0; s < n.length - 1; s++) {
|
|
72
|
-
const i = a.get(n[s]) ?? /* @__PURE__ */ new Map();
|
|
73
|
-
i.set(n[s + 1], (i.get(n[s + 1]) ?? 0) + 1), a.set(n[s], i);
|
|
74
|
-
}
|
|
75
|
-
return [...a.entries()].map(([n, s]) => {
|
|
76
|
-
const i = [...s.values()].reduce((m, f) => m + f, 0);
|
|
77
|
-
return {
|
|
78
|
-
from: n,
|
|
79
|
-
total: i,
|
|
80
|
-
destinations: [...s.entries()].map(([m, f]) => ({ to: m, pct: f / i * 100 })).sort((m, f) => f.pct - m.pct)
|
|
81
|
-
};
|
|
82
|
-
}).sort((n, s) => s.total - n.total);
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import ue, { useState as j, useEffect as $, useMemo as ae, useCallback as F, useRef as B, useLayoutEffect as oe, useContext as me, useSyncExternalStore as pe, createContext as ge } from "react";
|
|
3
|
+
import { createPortal as le } from "react-dom";
|
|
4
|
+
const fe = ["Ease of use", "Performance", "Design & appearance", "Features", "Navigation", "Something else"], ve = ["", "Poor", "Fair", "Good", "Very good", "Excellent"];
|
|
5
|
+
function we({ rating: t, onRate: a }) {
|
|
6
|
+
const [i, s] = j(0), o = i || t;
|
|
7
|
+
return /* @__PURE__ */ n(V, { children: [
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "rating", role: "radiogroup", "aria-label": "Star rating", onMouseLeave: () => s(0), children: [1, 2, 3, 4, 5].map((u) => /* @__PURE__ */ e(
|
|
9
|
+
"button",
|
|
10
|
+
{
|
|
11
|
+
type: "button",
|
|
12
|
+
role: "radio",
|
|
13
|
+
"aria-checked": t === u,
|
|
14
|
+
"aria-label": `${u} star${u > 1 ? "s" : ""}`,
|
|
15
|
+
className: `star ${u <= o ? "active" : ""}`,
|
|
16
|
+
onMouseEnter: () => s(u),
|
|
17
|
+
onFocus: () => s(u),
|
|
18
|
+
onBlur: () => s(0),
|
|
19
|
+
onClick: () => a(u),
|
|
20
|
+
children: "★"
|
|
21
|
+
},
|
|
22
|
+
u
|
|
23
|
+
)) }),
|
|
24
|
+
/* @__PURE__ */ e("div", { className: "hint", children: o ? `${o} out of 5 · ${ve[o]}` : "Select a rating to continue" })
|
|
25
|
+
] });
|
|
83
26
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
]
|
|
100
|
-
var u;
|
|
101
|
-
const [t, a] = y("nav"), [n, s] = y(Ae), [i, m] = y(qe), f = Y(() => Pe(n), [n]), g = Y(() => Re(n), [n]), w = Y(() => $e(n), [n]), c = f.reduce((h, l) => h + l.views, 0), d = n.length, o = n.filter((h) => h.length === 1).length;
|
|
102
|
-
return /* @__PURE__ */ r(
|
|
103
|
-
ee,
|
|
104
|
-
{
|
|
105
|
-
title: "User Journey",
|
|
106
|
-
subtitle: "One stream of page views feeds every view below.",
|
|
107
|
-
actions: /* @__PURE__ */ e("button", { className: "btn primary", onClick: () => s((h) => [...h, ...we(50, Math.random)]), children: "+ Simulate 50 sessions" }),
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ r("div", { className: "stats", children: [
|
|
110
|
-
/* @__PURE__ */ e(q, { label: "Sessions", value: d.toLocaleString(), color: "#6366f1" }),
|
|
111
|
-
/* @__PURE__ */ e(q, { label: "Page views", value: c.toLocaleString(), color: "#0ea5e9" }),
|
|
112
|
-
/* @__PURE__ */ e(q, { label: "Bounce rate", value: `${d ? (o / d * 100).toFixed(1) : 0}%`, color: "#f59e0b" }),
|
|
113
|
-
/* @__PURE__ */ e(q, { label: "Top page", value: ((u = f[0]) == null ? void 0 : u.page) ?? "—", color: "#10b981" })
|
|
114
|
-
] }),
|
|
115
|
-
/* @__PURE__ */ e(fe, { items: Oe, value: t, onChange: a }),
|
|
116
|
-
t === "nav" && /* @__PURE__ */ r("table", { className: "table", children: [
|
|
117
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
|
|
118
|
-
/* @__PURE__ */ e("th", { children: "Page" }),
|
|
119
|
-
/* @__PURE__ */ e("th", { children: "Views" }),
|
|
120
|
-
/* @__PURE__ */ e("th", { children: "Share" }),
|
|
121
|
-
/* @__PURE__ */ e("th", { children: "Bounce rate" }),
|
|
122
|
-
/* @__PURE__ */ e("th", { children: "Exit rate" })
|
|
123
|
-
] }) }),
|
|
124
|
-
/* @__PURE__ */ e("tbody", { children: f.map((h) => /* @__PURE__ */ r("tr", { children: [
|
|
125
|
-
/* @__PURE__ */ e("td", { className: "mono", children: h.page }),
|
|
126
|
-
/* @__PURE__ */ e("td", { className: "mono", children: h.views }),
|
|
127
|
-
/* @__PURE__ */ e("td", { style: { minWidth: 120 }, children: /* @__PURE__ */ e(K, { pct: h.views / c * 100 }) }),
|
|
128
|
-
/* @__PURE__ */ r("td", { className: "mono", style: { color: Fe(h.bounceRate) }, children: [
|
|
129
|
-
h.bounceRate.toFixed(1),
|
|
130
|
-
"%"
|
|
131
|
-
] }),
|
|
132
|
-
/* @__PURE__ */ r("td", { className: "mono", children: [
|
|
133
|
-
h.exitRate.toFixed(1),
|
|
134
|
-
"%"
|
|
135
|
-
] })
|
|
136
|
-
] }, h.page)) })
|
|
137
|
-
] }),
|
|
138
|
-
t === "paths" && /* @__PURE__ */ e("div", { className: "grid", children: g.map((h, l) => /* @__PURE__ */ r("div", { className: "card", children: [
|
|
139
|
-
/* @__PURE__ */ r("div", { className: "row", children: [
|
|
140
|
-
/* @__PURE__ */ r("span", { className: "pill passive", children: [
|
|
141
|
-
"#",
|
|
142
|
-
l + 1
|
|
143
|
-
] }),
|
|
144
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
145
|
-
/* @__PURE__ */ r("span", { className: "mono small", children: [
|
|
146
|
-
h.convRate.toFixed(1),
|
|
147
|
-
"% reach signup"
|
|
148
|
-
] })
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ e("div", { className: "steps", title: h.steps.join(" → "), children: h.steps.map((k, v) => /* @__PURE__ */ r(ge.Fragment, { children: [
|
|
151
|
-
v > 0 && /* @__PURE__ */ e("span", { className: "muted", children: "→" }),
|
|
152
|
-
/* @__PURE__ */ e("span", { className: "chip static", children: _e(k) })
|
|
153
|
-
] }, v)) }),
|
|
154
|
-
/* @__PURE__ */ r("div", { className: "small muted", children: [
|
|
155
|
-
h.users,
|
|
156
|
-
" users"
|
|
157
|
-
] }),
|
|
158
|
-
/* @__PURE__ */ e(K, { pct: h.convRate, color: "#10b981" })
|
|
159
|
-
] }, h.steps.join(">"))) }),
|
|
160
|
-
t === "flows" && /* @__PURE__ */ e("div", { className: "grid", children: w.map((h) => /* @__PURE__ */ r("div", { className: "card", children: [
|
|
161
|
-
/* @__PURE__ */ r("div", { className: "row", children: [
|
|
162
|
-
/* @__PURE__ */ e("strong", { className: "mono", children: h.from }),
|
|
163
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
164
|
-
/* @__PURE__ */ r("span", { className: "small muted", children: [
|
|
165
|
-
h.total,
|
|
166
|
-
" transitions"
|
|
167
|
-
] })
|
|
168
|
-
] }),
|
|
169
|
-
h.destinations.slice(0, 4).map((l) => /* @__PURE__ */ r("div", { children: [
|
|
170
|
-
/* @__PURE__ */ r("div", { className: "row small", children: [
|
|
171
|
-
/* @__PURE__ */ r("span", { className: "mono", children: [
|
|
172
|
-
"→ ",
|
|
173
|
-
l.to
|
|
174
|
-
] }),
|
|
175
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
176
|
-
/* @__PURE__ */ r("span", { className: "mono", children: [
|
|
177
|
-
l.pct.toFixed(0),
|
|
178
|
-
"%"
|
|
179
|
-
] })
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ e(K, { pct: l.pct })
|
|
182
|
-
] }, l.to))
|
|
183
|
-
] }, h.from)) }),
|
|
184
|
-
t === "maps" && /* @__PURE__ */ e(Je, { map: i, setMap: m, sessions: n })
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
);
|
|
188
|
-
}, Je = ({ map: t, setMap: a, sessions: n }) => {
|
|
189
|
-
const [s, i] = y(""), [m, f] = y("curious"), [g, w] = y([]), [c, d] = y(""), o = () => {
|
|
190
|
-
if (!s.trim()) return d("Stage name is required.");
|
|
191
|
-
if (g.length === 0) return d("Pick at least one touchpoint page.");
|
|
192
|
-
const u = { id: Z("st"), name: s.trim(), emotion: m, pages: g };
|
|
193
|
-
a({ ...t, stages: [...t.stages, u] }), i(""), w([]), d("");
|
|
194
|
-
};
|
|
195
|
-
return /* @__PURE__ */ r("div", { className: "stack", children: [
|
|
196
|
-
/* @__PURE__ */ e("input", { className: "input", value: t.name, onChange: (u) => a({ ...t, name: u.target.value }), "aria-label": "Journey name" }),
|
|
197
|
-
/* @__PURE__ */ r("div", { className: "stages", children: [
|
|
198
|
-
t.stages.map((u, h) => {
|
|
199
|
-
const l = Le(n, u.pages), k = ue[u.emotion] ?? "#7c3aed";
|
|
200
|
-
return /* @__PURE__ */ r("div", { className: "card stage", children: [
|
|
201
|
-
/* @__PURE__ */ r("div", { className: "row", children: [
|
|
202
|
-
/* @__PURE__ */ e("span", { className: "badge", style: { background: `${k}30`, color: k }, children: h + 1 }),
|
|
203
|
-
/* @__PURE__ */ e("strong", { children: u.name }),
|
|
204
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
205
|
-
/* @__PURE__ */ e("button", { className: "btn danger", "aria-label": `Remove ${u.name}`, onClick: () => a({ ...t, stages: t.stages.filter((v) => v.id !== u.id) }), children: "✕" })
|
|
206
|
-
] }),
|
|
207
|
-
u.pages.map((v) => /* @__PURE__ */ r("div", { className: "small mono muted", children: [
|
|
208
|
-
"✓ ",
|
|
209
|
-
v
|
|
210
|
-
] }, v)),
|
|
211
|
-
/* @__PURE__ */ r("div", { className: "small", style: { color: k }, children: [
|
|
212
|
-
"Emotion: ",
|
|
213
|
-
u.emotion
|
|
214
|
-
] }),
|
|
215
|
-
/* @__PURE__ */ e(K, { pct: l }),
|
|
216
|
-
/* @__PURE__ */ r("div", { className: "small mono muted", children: [
|
|
217
|
-
l.toFixed(0),
|
|
218
|
-
"% reach"
|
|
219
|
-
] })
|
|
220
|
-
] }, u.id);
|
|
221
|
-
}),
|
|
222
|
-
t.stages.length === 0 && /* @__PURE__ */ e("div", { className: "muted", children: "No stages yet. Add one below." })
|
|
27
|
+
function be({ onClose: t }) {
|
|
28
|
+
const [a, i] = j(1), [s, o] = j(0), [u, T] = j([]), [g, N] = j(""), d = (l) => T((h) => h.includes(l) ? h.filter((b) => b !== l) : [...h, l]);
|
|
29
|
+
return /* @__PURE__ */ e("div", { className: "overlay", onClick: (l) => {
|
|
30
|
+
l.target === l.currentTarget && t();
|
|
31
|
+
}, children: /* @__PURE__ */ n("div", { className: "modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "survey-title", children: [
|
|
32
|
+
/* @__PURE__ */ e("button", { className: "close", onClick: t, "aria-label": "Close survey", children: "×" }),
|
|
33
|
+
/* @__PURE__ */ e("div", { className: "progress", children: [1, 2, 3, 4].map((l) => /* @__PURE__ */ e("span", { className: l <= a ? "done" : "" }, l)) }),
|
|
34
|
+
a === 1 && /* @__PURE__ */ n(V, { children: [
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "label", children: "Step 01 / 04 · Quick rating" }),
|
|
36
|
+
/* @__PURE__ */ e("h2", { id: "survey-title", children: "How was your experience?" }),
|
|
37
|
+
/* @__PURE__ */ e("p", { className: "desc", children: "Your feedback helps us make things better." }),
|
|
38
|
+
/* @__PURE__ */ e(we, { rating: s, onRate: o }),
|
|
39
|
+
/* @__PURE__ */ n("div", { className: "actions", children: [
|
|
40
|
+
/* @__PURE__ */ e("button", { className: "btn secondary", onClick: t, children: "Cancel" }),
|
|
41
|
+
/* @__PURE__ */ e("button", { className: "btn", disabled: !s, onClick: () => i(2), children: "Next →" })
|
|
42
|
+
] })
|
|
223
43
|
] }),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */ e("
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
/* @__PURE__ */ e("button", { className: "btn
|
|
44
|
+
a === 2 && /* @__PURE__ */ n(V, { children: [
|
|
45
|
+
/* @__PURE__ */ e("div", { className: "label", children: "Step 02 / 04 · What matters?" }),
|
|
46
|
+
/* @__PURE__ */ e("h2", { id: "survey-title", children: "What would you like us to improve?" }),
|
|
47
|
+
/* @__PURE__ */ e("p", { className: "desc", children: "Choose all that apply." }),
|
|
48
|
+
/* @__PURE__ */ e("div", { className: "choices", children: fe.map((l) => /* @__PURE__ */ n("label", { className: `choice ${u.includes(l) ? "checked" : ""}`, children: [
|
|
49
|
+
/* @__PURE__ */ e("input", { type: "checkbox", checked: u.includes(l), onChange: () => d(l) }),
|
|
50
|
+
l
|
|
51
|
+
] }, l)) }),
|
|
52
|
+
/* @__PURE__ */ n("div", { className: "actions", children: [
|
|
53
|
+
/* @__PURE__ */ e("button", { className: "btn secondary", onClick: () => i(1), children: "← Back" }),
|
|
54
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: () => i(3), children: "Next →" })
|
|
235
55
|
] })
|
|
56
|
+
] }),
|
|
57
|
+
a === 3 && /* @__PURE__ */ n(V, { children: [
|
|
58
|
+
/* @__PURE__ */ e("div", { className: "label", children: "Step 03 / 04 · Your thoughts" }),
|
|
59
|
+
/* @__PURE__ */ e("h2", { id: "survey-title", children: "Anything else you'd like to share?" }),
|
|
60
|
+
/* @__PURE__ */ e("p", { className: "desc", children: "Comments are optional." }),
|
|
61
|
+
/* @__PURE__ */ e(
|
|
62
|
+
"textarea",
|
|
63
|
+
{
|
|
64
|
+
className: "field",
|
|
65
|
+
placeholder: "Share your thoughts, ideas, or suggestions...",
|
|
66
|
+
value: g,
|
|
67
|
+
onChange: (l) => N(l.target.value)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ n("div", { className: "actions", children: [
|
|
71
|
+
/* @__PURE__ */ e("button", { className: "btn secondary", onClick: () => i(2), children: "← Back" }),
|
|
72
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: () => i(4), children: "Submit →" })
|
|
73
|
+
] })
|
|
74
|
+
] }),
|
|
75
|
+
a === 4 && /* @__PURE__ */ n("div", { className: "success", children: [
|
|
76
|
+
/* @__PURE__ */ e("div", { className: "success-mark", children: "✓" }),
|
|
77
|
+
/* @__PURE__ */ e("div", { className: "label", children: "Step 04 / 04 · Completed" }),
|
|
78
|
+
/* @__PURE__ */ e("h2", { id: "survey-title", children: "Thank you for your feedback!" }),
|
|
79
|
+
/* @__PURE__ */ n("p", { children: [
|
|
80
|
+
"This is a preview, so your response (",
|
|
81
|
+
s,
|
|
82
|
+
" ★) isn't sent anywhere."
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: t, children: "Done" })
|
|
236
85
|
] })
|
|
86
|
+
] }) });
|
|
87
|
+
}
|
|
88
|
+
const ye = () => {
|
|
89
|
+
const [t, a] = j(!1);
|
|
90
|
+
return $(() => {
|
|
91
|
+
if (!t) return;
|
|
92
|
+
const i = (o) => {
|
|
93
|
+
o.key === "Escape" && a(!1);
|
|
94
|
+
};
|
|
95
|
+
document.addEventListener("keydown", i);
|
|
96
|
+
const s = document.body.style.overflow;
|
|
97
|
+
return document.body.style.overflow = "hidden", () => {
|
|
98
|
+
document.removeEventListener("keydown", i), document.body.style.overflow = s;
|
|
99
|
+
};
|
|
100
|
+
}, [t]), /* @__PURE__ */ n("div", { className: "fb-root", children: [
|
|
101
|
+
/* @__PURE__ */ e("main", { className: "page", children: /* @__PURE__ */ e("button", { className: "btn", onClick: () => a(!0), children: "Preview Feedback" }) }),
|
|
102
|
+
t && /* @__PURE__ */ e(be, { onClose: () => a(!1) })
|
|
237
103
|
] });
|
|
238
|
-
},
|
|
104
|
+
}, se = {
|
|
105
|
+
login: { name: "login.logger.log", lines: [
|
|
106
|
+
{ t: "09:14:02", l: "INFO", m: "Login request received for user=jdoe@example.com", d: { meaning: "Normal event. The login flow started.", fix: "Nothing to do." } },
|
|
107
|
+
{ t: "09:14:02", l: "DEBUG", m: "Validating credentials payload (fields: email, password)", d: { meaning: "Extra detail for developers while tracing a request.", fix: "Nothing to do." } },
|
|
108
|
+
{ t: "09:14:03", l: "DEBUG", m: "Looking up user record in users table", d: { meaning: "Shows which step the app is on. Useful to see where a flow stops.", fix: "Nothing to do." } },
|
|
109
|
+
{ t: "09:14:04", l: "WARN", m: "Password attempt 2 of 3 for user=jdoe@example.com", d: { meaning: "Something unusual, but the app kept going. A third failure will lock the account.", fix: "Ask the user to reset the password if this repeats." } },
|
|
110
|
+
{ t: "09:14:05", l: "ERROR", m: "Authentication failed: invalid credentials (HTTP 401)", d: { meaning: "The login was rejected. The server answered 401, so the email or password did not match.", fix: "Check the typed credentials, then confirm the account exists and is not locked.", stack: `AuthError: invalid credentials
|
|
111
|
+
at AuthService.verify (auth.service.js:88:15)
|
|
112
|
+
at async login (login.controller.js:42:9)` } },
|
|
113
|
+
{ t: "09:14:35", l: "INFO", m: "Retry allowed after 30s cooldown", d: { meaning: "Normal event. The user may try again.", fix: "Nothing to do." } },
|
|
114
|
+
{ t: "09:14:51", l: "WARN", m: "Session cookie missing SameSite attribute", d: { meaning: "Login works, but some browsers may block the cookie later.", fix: "Set SameSite=Lax (or Strict) when the cookie is created." } },
|
|
115
|
+
{ t: "09:15:10", l: "INFO", m: "Login succeeded for user=jdoe@example.com session=a91f3c", d: { meaning: "Normal event. The login worked on the retry.", fix: "Nothing to do." } },
|
|
116
|
+
{ t: "09:15:42", l: "ERROR", m: "Token refresh failed: network timeout after 5000ms", d: { meaning: "The app could not reach the auth server in time, so the session may expire.", fix: "Check the Network tab for the refresh request and the server response time.", stack: `TimeoutError: 5000ms exceeded
|
|
117
|
+
at refreshToken (token.service.js:57:11)` } }
|
|
118
|
+
] },
|
|
119
|
+
console: { name: "console.log", lines: [
|
|
120
|
+
{ t: "09:10:11", l: "INFO", m: "[vite] connected.", d: { meaning: "Normal event. The dev server connected.", fix: "Nothing to do." } },
|
|
121
|
+
{ t: "09:10:12", l: "WARN", m: 'Warning: Each child in a list should have a unique "key" prop.', d: { meaning: "React warns that list items have no stable key. The page works, but updates may be slow or glitchy.", fix: "Add a unique key prop to each item rendered in the list." } },
|
|
122
|
+
{ t: "09:10:14", l: "ERROR", m: "Uncaught TypeError: Cannot read properties of undefined (reading 'name')", d: { meaning: "The code read .name from a value that was undefined, so the component crashed.", fix: "Open the file and line in the stack trace, and check why the value is missing.", stack: `TypeError: Cannot read properties of undefined (reading 'name')
|
|
123
|
+
at ProfileCard (ProfileCard.jsx:14:28)
|
|
124
|
+
at renderWithHooks (react-dom.js:1482:18)` } },
|
|
125
|
+
{ t: "09:10:14", l: "DEBUG", m: "Rendering <ProfileCard /> props={ user: undefined }", d: { meaning: "This line shows the cause: user was undefined when the card rendered.", fix: "Make sure the profile request finished before rendering." } },
|
|
126
|
+
{ t: "09:10:15", l: "ERROR", m: "GET /api/profile 500 (Internal Server Error)", d: { meaning: "The server failed while handling the request. This explains the missing user above.", fix: "Check the server logs for this request and its error.", stack: `GET /api/profile
|
|
127
|
+
Status: 500
|
|
128
|
+
Request-Id: req_7f2c9` } },
|
|
129
|
+
{ t: "09:10:19", l: "WARN", m: "Deprecated API: componentWillMount will be removed", d: { meaning: "Still works today, but will break in a future upgrade.", fix: "Move the logic to componentDidMount or a useEffect hook." } },
|
|
130
|
+
{ t: "09:10:21", l: "INFO", m: "Route changed: /login → /dashboard", d: { meaning: "Normal event.", fix: "Nothing to do." } }
|
|
131
|
+
] },
|
|
132
|
+
debug: { name: "app.debug.log", lines: [
|
|
133
|
+
{ t: "09:00:01", l: "INFO", m: "Application initialized successfully", d: { meaning: "Normal event.", fix: "Nothing to do." } },
|
|
134
|
+
{ t: "09:00:02", l: "DEBUG", m: "Config loaded from /etc/app/config.json", d: { meaning: "Developer detail.", fix: "Nothing to do." } },
|
|
135
|
+
{ t: "09:00:04", l: "WARN", m: "Image resource took longer than expected (assets/profile.webp)", d: { meaning: "A slow asset. The page still loads.", fix: "Compress the image or serve it from a CDN." } }
|
|
136
|
+
] }
|
|
137
|
+
}, Ne = ["ALL", "ERROR", "WARN", "INFO", "DEBUG"], Y = [
|
|
239
138
|
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
{ id: "s1q1", type: "nps", text: "How likely are you to recommend us to a colleague?", required: !0 },
|
|
248
|
-
{ id: "s1q2", type: "rating", text: "How satisfied are you with the product?", required: !0 },
|
|
249
|
-
{ id: "s1q3", type: "multiple_choice", text: "Which feature do you use most?", required: !1, options: ["Feature Flags", "Experiments", "Segments", "Audit Log"] },
|
|
250
|
-
{ id: "s1q4", type: "open_text", text: "What is one thing we should improve?", required: !1 }
|
|
251
|
-
]
|
|
139
|
+
target: "titlebar",
|
|
140
|
+
place: "bottom",
|
|
141
|
+
title: "Meet the Log Viewer",
|
|
142
|
+
body: "The Log Viewer shows what your application recorded while it ran. When something breaks, it is the first place to look to find out what happened and why.",
|
|
143
|
+
enter: (t) => {
|
|
144
|
+
t.setFile("login"), t.setLevel("ALL"), t.setQuery(""), t.setSel(null);
|
|
145
|
+
}
|
|
252
146
|
},
|
|
253
147
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
148
|
+
target: "files",
|
|
149
|
+
place: "right",
|
|
150
|
+
title: "Open a log file",
|
|
151
|
+
body: "Every log file lives in this list. Click one to open it. Each file records a different part of the app: login activity, browser console output, or general debug messages. The number shows how many lines it holds.",
|
|
152
|
+
enter: (t) => {
|
|
153
|
+
t.setFile("login"), t.setLevel("ALL"), t.setSel(null);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
target: "logpane",
|
|
158
|
+
place: "top",
|
|
159
|
+
title: "Inspect login.logger.log",
|
|
160
|
+
body: "This file records every step of the login flow, one line per event: a line number, the time, a level, and a message. Read it top to bottom to follow what happened in order. Click any line to see more about it.",
|
|
161
|
+
enter: (t) => {
|
|
162
|
+
t.setFile("login"), t.setLevel("ALL"), t.setQuery(""), t.setSel(null);
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
target: "filters",
|
|
167
|
+
place: "bottom",
|
|
168
|
+
title: "Find console errors fast",
|
|
169
|
+
body: "Open console.log, which holds what the browser console printed, then press the Error filter. Only the red lines are left, such as an uncaught TypeError or a failed request. The search box narrows it down further.",
|
|
170
|
+
enter: (t) => {
|
|
171
|
+
t.setFile("console"), t.setLevel("ERROR"), t.setQuery(""), t.setSel(null);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
target: "details",
|
|
176
|
+
place: "left",
|
|
177
|
+
title: "Read errors and warnings",
|
|
178
|
+
body: "Select a line and its details appear here: what the message means, a suggested fix, and the stack trace showing the exact file and line. Levels tell you how serious a line is.",
|
|
179
|
+
legend: !0,
|
|
180
|
+
enter: (t) => {
|
|
181
|
+
t.setFile("login"), t.setLevel("ALL"), t.setQuery(""), t.setSel(4);
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
target: "summary",
|
|
186
|
+
place: "bottom",
|
|
187
|
+
title: "Debug problems with it",
|
|
188
|
+
body: "Use these counters to see how healthy a session was. Start with the errors, read the warnings around them, then follow the debug lines before an error to find the cause. Fix it, reload, and check that the error is gone.",
|
|
189
|
+
enter: (t) => {
|
|
190
|
+
t.setFile("console"), t.setLevel("ALL"), t.setQuery(""), t.setSel(2);
|
|
191
|
+
}
|
|
264
192
|
}
|
|
265
|
-
]
|
|
266
|
-
function
|
|
267
|
-
const t =
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
193
|
+
];
|
|
194
|
+
function ke({ step: t, total: a, onNext: i, onBack: s, onClose: o }) {
|
|
195
|
+
const u = Y[t], T = B(null), [g, N] = j(null), [d, l] = j({ w: 340, h: 260 }), [h, b] = j({ w: window.innerWidth, h: window.innerHeight }), m = F(() => {
|
|
196
|
+
const r = document.querySelector(`[data-tour="${u.target}"]`);
|
|
197
|
+
if (b({ w: window.innerWidth, h: window.innerHeight }), !r) {
|
|
198
|
+
N(null);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const f = r.getBoundingClientRect(), S = 8, M = Math.max(4, f.left - S), y = Math.max(4, f.top - S), P = Math.min(window.innerWidth - 8, f.width + S * 2) - Math.max(0, 4 - (f.left - S)), A = Math.min(f.height + S * 2, window.innerHeight - 8);
|
|
202
|
+
N({ x: M, y, w: P, h: A });
|
|
203
|
+
}, [u.target]);
|
|
204
|
+
$(() => {
|
|
205
|
+
const f = [setTimeout(() => {
|
|
206
|
+
const S = document.querySelector(`[data-tour="${u.target}"]`);
|
|
207
|
+
S && S.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
208
|
+
}, 60), ...[0, 120, 300, 550, 800].map((S) => setTimeout(m, S))];
|
|
209
|
+
return () => f.forEach(clearTimeout);
|
|
210
|
+
}, [t, m, u.target]), $(() => (window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), () => {
|
|
211
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
212
|
+
}), [m]), oe(() => {
|
|
213
|
+
T.current && l({ w: T.current.offsetWidth, h: T.current.offsetHeight });
|
|
214
|
+
}, [t, h.w]), $(() => {
|
|
215
|
+
const r = (f) => {
|
|
216
|
+
f.key === "ArrowRight" ? (f.preventDefault(), i()) : f.key === "ArrowLeft" ? (f.preventDefault(), s()) : f.key === "Escape" && o();
|
|
281
217
|
};
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const n = t.questions.find((s) => s.type === "nps");
|
|
298
|
-
return n ? a.filter((s) => s.surveyId === t.id).map((s) => {
|
|
299
|
-
var i;
|
|
300
|
-
return (i = s.answers.find((m) => m.questionId === n.id)) == null ? void 0 : i.value;
|
|
301
|
-
}).filter((s) => typeof s == "number") : [];
|
|
302
|
-
}
|
|
303
|
-
const He = ["nps", "rating", "multiple_choice", "open_text"], ye = (t) => new Date(t).toLocaleDateString(void 0, { day: "2-digit", month: "short", year: "numeric" }), Xe = () => {
|
|
304
|
-
const [t, a] = y(Be), [n, s] = y(We), [i, m] = y({ name: "list" }), f = (o) => t.find((u) => u.id === o), g = () => m({ name: "list" });
|
|
305
|
-
if (i.name === "create")
|
|
306
|
-
return /* @__PURE__ */ e(
|
|
307
|
-
Ue,
|
|
308
|
-
{
|
|
309
|
-
onCancel: g,
|
|
310
|
-
onSave: (o) => {
|
|
311
|
-
a((u) => [o, ...u]), g();
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
if (i.name === "take") {
|
|
316
|
-
const o = f(i.id);
|
|
317
|
-
return o ? /* @__PURE__ */ e(
|
|
318
|
-
Ve,
|
|
319
|
-
{
|
|
320
|
-
survey: o,
|
|
321
|
-
onCancel: g,
|
|
322
|
-
onSubmit: (u) => {
|
|
323
|
-
s((h) => [{ id: Z("r"), surveyId: o.id, userId: `user_${900 + h.length}`, createdAt: (/* @__PURE__ */ new Date()).toISOString(), answers: u }, ...h]), m({ name: "results", id: o.id });
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
) : null;
|
|
327
|
-
}
|
|
328
|
-
if (i.name === "results") {
|
|
329
|
-
const o = f(i.id);
|
|
330
|
-
return o ? /* @__PURE__ */ e(Ye, { survey: o, responses: n.filter((u) => u.surveyId === o.id), onBack: g, onTake: () => m({ name: "take", id: o.id }) }) : null;
|
|
218
|
+
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
219
|
+
}, [i, s, o]), $(() => {
|
|
220
|
+
var r;
|
|
221
|
+
(r = T.current) == null || r.focus({ preventScroll: !0 });
|
|
222
|
+
}, [t]);
|
|
223
|
+
const p = g || { x: h.w / 2, y: h.h / 2, w: 0, h: 0 }, q = `polygon(0 0, 0 100%, ${p.x}px 100%, ${p.x}px ${p.y}px, ${p.x + p.w}px ${p.y}px, ${p.x + p.w}px ${p.y + p.h}px, ${p.x}px ${p.y + p.h}px, ${p.x}px 100%, 100% 100%, 100% 0)`, w = 14, k = 16, O = h.w < 700, E = Math.min(360, h.w - w * 2), c = d.h;
|
|
224
|
+
let W = { left: (h.w - E) / 2, top: Math.max(w, (h.h - c) / 2) };
|
|
225
|
+
if (g) {
|
|
226
|
+
const r = g.x + g.w / 2 - E / 2, f = g.y + g.h / 2 - c / 2, S = (I) => Math.min(Math.max(w, I), h.w - E - w), M = (I) => Math.min(Math.max(w, I), h.h - c - w), y = {
|
|
227
|
+
right: { ok: g.x + g.w + k + E <= h.w - w, left: g.x + g.w + k, top: M(f) },
|
|
228
|
+
left: { ok: g.x - k - E >= w, left: g.x - k - E, top: M(f) },
|
|
229
|
+
bottom: { ok: g.y + g.h + k + c <= h.h - w, left: S(r), top: g.y + g.h + k },
|
|
230
|
+
top: { ok: g.y - k - c >= w, left: S(r), top: g.y - k - c }
|
|
231
|
+
}, A = (O ? ["bottom", "top"] : [u.place, "right", "left", "bottom", "top"]).find((I) => y[I].ok);
|
|
232
|
+
W = A ? { left: y[A].left, top: y[A].top } : { left: O ? (h.w - E) / 2 : h.w - E - w, top: h.h - c - w };
|
|
331
233
|
}
|
|
332
|
-
const
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
|
|
335
|
-
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
/* @__PURE__ */ e(q, { label: "Active", value: c, color: "#10b981" }),
|
|
343
|
-
/* @__PURE__ */ e(q, { label: "Total responses", value: w }),
|
|
344
|
-
/* @__PURE__ */ e(q, { label: "Overall NPS", value: d ? d.score : "—", color: "#f59e0b" })
|
|
234
|
+
const D = t === 0, x = t === a - 1;
|
|
235
|
+
return /* @__PURE__ */ n("div", { className: "tour-root", role: "dialog", "aria-modal": "true", "aria-labelledby": "tour-title", children: [
|
|
236
|
+
/* @__PURE__ */ e("div", { className: "tour-dim", style: { clipPath: q, WebkitClipPath: q }, onClick: (r) => r.stopPropagation() }),
|
|
237
|
+
g && /* @__PURE__ */ e("div", { className: "tour-ring", style: { left: g.x, top: g.y, width: g.w, height: g.h } }),
|
|
238
|
+
/* @__PURE__ */ n("div", { className: "tour-tip", ref: T, tabIndex: -1, style: { width: E, left: W.left, top: W.top }, children: [
|
|
239
|
+
/* @__PURE__ */ n("div", { className: "tip-head", children: [
|
|
240
|
+
/* @__PURE__ */ n("span", { className: "counter", "aria-live": "polite", children: [
|
|
241
|
+
t + 1,
|
|
242
|
+
"/",
|
|
243
|
+
a
|
|
345
244
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
|
|
348
|
-
/* @__PURE__ */ e("th", { children: "Survey" }),
|
|
349
|
-
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
350
|
-
/* @__PURE__ */ e("th", { children: "Progress" }),
|
|
351
|
-
/* @__PURE__ */ e("th", { children: "NPS" }),
|
|
352
|
-
/* @__PURE__ */ e("th", { children: "Created" }),
|
|
353
|
-
/* @__PURE__ */ e("th", {})
|
|
354
|
-
] }) }),
|
|
355
|
-
/* @__PURE__ */ e("tbody", { children: t.map((o) => {
|
|
356
|
-
const u = n.filter((l) => l.surveyId === o.id).length, h = le(ce(o, n));
|
|
357
|
-
return /* @__PURE__ */ r("tr", { children: [
|
|
358
|
-
/* @__PURE__ */ r("td", { children: [
|
|
359
|
-
/* @__PURE__ */ e("strong", { children: o.name }),
|
|
360
|
-
/* @__PURE__ */ r("div", { className: "muted small", children: [
|
|
361
|
-
o.questions.length,
|
|
362
|
-
" questions"
|
|
363
|
-
] })
|
|
364
|
-
] }),
|
|
365
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
366
|
-
"select",
|
|
367
|
-
{
|
|
368
|
-
className: "input slim",
|
|
369
|
-
value: o.status,
|
|
370
|
-
onChange: (l) => a((k) => k.map((v) => v.id === o.id ? { ...v, status: l.target.value } : v)),
|
|
371
|
-
children: ["draft", "active", "paused", "closed"].map((l) => /* @__PURE__ */ e("option", { children: l }, l))
|
|
372
|
-
}
|
|
373
|
-
) }),
|
|
374
|
-
/* @__PURE__ */ r("td", { style: { minWidth: 140 }, children: [
|
|
375
|
-
/* @__PURE__ */ r("div", { className: "small mono", children: [
|
|
376
|
-
u,
|
|
377
|
-
" / ",
|
|
378
|
-
o.target
|
|
379
|
-
] }),
|
|
380
|
-
/* @__PURE__ */ e(K, { pct: u / o.target * 100 })
|
|
381
|
-
] }),
|
|
382
|
-
/* @__PURE__ */ e("td", { className: "mono", children: h ? h.score : "—" }),
|
|
383
|
-
/* @__PURE__ */ e("td", { className: "muted small", children: ye(o.createdAt) }),
|
|
384
|
-
/* @__PURE__ */ r("td", { className: "right", children: [
|
|
385
|
-
/* @__PURE__ */ e("button", { className: "btn", onClick: () => m({ name: "results", id: o.id }), children: "Results" }),
|
|
386
|
-
" ",
|
|
387
|
-
/* @__PURE__ */ e("button", { className: "btn", disabled: o.status !== "active", title: o.status !== "active" ? "Set status to active to collect answers" : "", onClick: () => m({ name: "take", id: o.id }), children: "Take" }),
|
|
388
|
-
" ",
|
|
389
|
-
/* @__PURE__ */ e(
|
|
390
|
-
"button",
|
|
391
|
-
{
|
|
392
|
-
className: "btn danger",
|
|
393
|
-
onClick: () => {
|
|
394
|
-
window.confirm(`Delete "${o.name}" and its responses?`) && (a((l) => l.filter((k) => k.id !== o.id)), s((l) => l.filter((k) => k.surveyId !== o.id)));
|
|
395
|
-
},
|
|
396
|
-
children: "Delete"
|
|
397
|
-
}
|
|
398
|
-
)
|
|
399
|
-
] })
|
|
400
|
-
] }, o.id);
|
|
401
|
-
}) })
|
|
402
|
-
] })
|
|
403
|
-
]
|
|
404
|
-
}
|
|
405
|
-
);
|
|
406
|
-
}, Ue = ({ onSave: t, onCancel: a }) => {
|
|
407
|
-
const [n, s] = y(""), [i, m] = y(""), [f, g] = y(100), [w, c] = y([{ id: Z("q"), type: "nps", text: "How likely are you to recommend us?", required: !0 }]), [d, o] = y(""), u = (l, k) => c((v) => v.map((I) => I.id === l ? { ...I, ...k } : I)), h = () => {
|
|
408
|
-
if (!n.trim()) return o("Survey name is required.");
|
|
409
|
-
if (w.length === 0) return o("Add at least one question.");
|
|
410
|
-
if (w.some((l) => !l.text.trim())) return o("Every question needs text.");
|
|
411
|
-
if (w.some((l) => l.type === "multiple_choice" && (l.options ?? []).filter((k) => k.trim()).length < 2)) return o("Multiple choice needs at least two options.");
|
|
412
|
-
t({
|
|
413
|
-
id: Z("s"),
|
|
414
|
-
name: n.trim(),
|
|
415
|
-
description: i.trim(),
|
|
416
|
-
status: "active",
|
|
417
|
-
target: f,
|
|
418
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
419
|
-
questions: w.map((l) => ({ ...l, text: l.text.trim(), options: l.type === "multiple_choice" ? (l.options ?? []).filter((k) => k.trim()) : void 0 }))
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
return /* @__PURE__ */ r(ee, { title: "Create Survey", subtitle: "Build a new survey.", actions: /* @__PURE__ */ e("button", { className: "btn", onClick: a, children: "Back" }), children: [
|
|
423
|
-
/* @__PURE__ */ r("div", { className: "card form", children: [
|
|
424
|
-
/* @__PURE__ */ r("label", { children: [
|
|
425
|
-
"Name",
|
|
426
|
-
/* @__PURE__ */ e("input", { className: "input", value: n, onChange: (l) => s(l.target.value), placeholder: "e.g. Q1 Product Satisfaction" })
|
|
245
|
+
/* @__PURE__ */ e("button", { className: "xbtn", onClick: o, "aria-label": "Close tutorial", children: "×" })
|
|
427
246
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
"
|
|
430
|
-
/* @__PURE__ */ e("
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
] }),
|
|
437
|
-
/* @__PURE__ */ r("h3", { children: [
|
|
438
|
-
"Questions (",
|
|
439
|
-
w.length,
|
|
440
|
-
")"
|
|
441
|
-
] }),
|
|
442
|
-
w.map((l, k) => /* @__PURE__ */ r("div", { className: "card form", children: [
|
|
443
|
-
/* @__PURE__ */ r("div", { className: "row", children: [
|
|
444
|
-
/* @__PURE__ */ r("strong", { children: [
|
|
445
|
-
"Q",
|
|
446
|
-
k + 1
|
|
447
|
-
] }),
|
|
448
|
-
/* @__PURE__ */ e("select", { className: "input slim", value: l.type, onChange: (v) => u(l.id, { type: v.target.value, options: v.target.value === "multiple_choice" ? ["Option 1", "Option 2"] : void 0 }), children: He.map((v) => /* @__PURE__ */ e("option", { value: v, children: v.replace("_", " ") }, v)) }),
|
|
449
|
-
/* @__PURE__ */ r("label", { className: "inline", children: [
|
|
450
|
-
/* @__PURE__ */ e("input", { type: "checkbox", checked: l.required, onChange: (v) => u(l.id, { required: v.target.checked }) }),
|
|
451
|
-
" required"
|
|
247
|
+
/* @__PURE__ */ n("div", { className: "tip-body", children: [
|
|
248
|
+
/* @__PURE__ */ e("h2", { id: "tour-title", children: u.title }),
|
|
249
|
+
/* @__PURE__ */ e("p", { children: u.body }),
|
|
250
|
+
u.legend && /* @__PURE__ */ n("div", { className: "legend", children: [
|
|
251
|
+
/* @__PURE__ */ e("span", { className: "lvl ERROR", children: "ERROR" }),
|
|
252
|
+
/* @__PURE__ */ e("span", { className: "lvl WARN", children: "WARN" }),
|
|
253
|
+
/* @__PURE__ */ e("span", { className: "lvl INFO", children: "INFO" }),
|
|
254
|
+
/* @__PURE__ */ e("span", { className: "lvl DEBUG", children: "DEBUG" })
|
|
452
255
|
] }),
|
|
453
|
-
/* @__PURE__ */ e("
|
|
454
|
-
|
|
256
|
+
u.legend && /* @__PURE__ */ e("p", { style: { marginTop: 8, fontSize: 12, color: "#a1a1aa" }, children: "ERROR: something failed. WARN: something unusual, but it kept going. INFO: normal events. DEBUG: developer detail." })
|
|
257
|
+
] }, t),
|
|
258
|
+
/* @__PURE__ */ e("div", { className: "dots", children: Array.from({ length: a }, (r, f) => /* @__PURE__ */ e("i", { className: f <= t ? "on" : "" }, f)) }),
|
|
259
|
+
/* @__PURE__ */ n("div", { className: "tip-foot", children: [
|
|
260
|
+
/* @__PURE__ */ e("button", { className: "btn ghost", onClick: s, disabled: D, children: "← Back" }),
|
|
261
|
+
/* @__PURE__ */ e("span", { className: "sp" }),
|
|
262
|
+
x && /* @__PURE__ */ e("button", { className: "btn", onClick: o, children: "Finish" }),
|
|
263
|
+
/* @__PURE__ */ e("button", { className: x ? "btn ghost" : "btn", onClick: i, disabled: x, children: "Next →" })
|
|
455
264
|
] }),
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
/* @__PURE__ */ e("
|
|
265
|
+
/* @__PURE__ */ n("div", { className: "kbd", children: [
|
|
266
|
+
/* @__PURE__ */ e("kbd", { children: "←" }),
|
|
267
|
+
" ",
|
|
268
|
+
/* @__PURE__ */ e("kbd", { children: "→" }),
|
|
269
|
+
" to navigate · ",
|
|
270
|
+
/* @__PURE__ */ e("kbd", { children: "Esc" }),
|
|
271
|
+
" to close"
|
|
460
272
|
] })
|
|
461
|
-
] }, l.id)),
|
|
462
|
-
/* @__PURE__ */ r("div", { className: "row", children: [
|
|
463
|
-
/* @__PURE__ */ e("button", { className: "btn", onClick: () => c((l) => [...l, { id: Z("q"), type: "rating", text: "", required: !1 }]), children: "+ Add question" }),
|
|
464
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
465
|
-
d && /* @__PURE__ */ e("span", { className: "error", children: d }),
|
|
466
|
-
/* @__PURE__ */ e("button", { className: "btn primary", onClick: h, children: "Create Survey" })
|
|
467
273
|
] })
|
|
468
274
|
] });
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
275
|
+
}
|
|
276
|
+
let re = !1;
|
|
277
|
+
const Se = ({ autoStart: t = !0 }) => {
|
|
278
|
+
const [a, i] = j("login"), [s, o] = j("ALL"), [u, T] = j(""), [g, N] = j(null), [d, l] = j(!1), [h, b] = j(0), m = { setFile: i, setLevel: o, setQuery: T, setSel: N }, p = se[a].lines, q = ae(
|
|
279
|
+
() => p.map((r, f) => ({ ...r, i: f })).filter((r) => (s === "ALL" || r.l === s) && r.m.toLowerCase().includes(u.toLowerCase())),
|
|
280
|
+
[p, s, u]
|
|
281
|
+
), w = (r) => p.filter((f) => f.l === r).length, k = g != null ? p[g] : null, O = F((r) => {
|
|
282
|
+
b(r), Y[r].enter(m);
|
|
283
|
+
}, []), E = () => {
|
|
284
|
+
O(0), l(!0);
|
|
285
|
+
}, c = F(() => b((r) => r >= Y.length - 1 ? r : (Y[r + 1].enter(m), r + 1)), []), W = F(() => b((r) => r <= 0 ? r : (Y[r - 1].enter(m), r - 1)), []), D = F(() => l(!1), []);
|
|
286
|
+
$(() => {
|
|
287
|
+
if (!t || re) return;
|
|
288
|
+
const r = setTimeout(() => {
|
|
289
|
+
re = !0, E();
|
|
290
|
+
}, 600);
|
|
291
|
+
return () => clearTimeout(r);
|
|
292
|
+
}, []);
|
|
293
|
+
const x = (r) => {
|
|
294
|
+
i(r), o("ALL"), T(""), N(null);
|
|
474
295
|
};
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
479
|
-
".
|
|
480
|
-
c.text,
|
|
481
|
-
c.required && /* @__PURE__ */ e("span", { className: "error", children: " *" })
|
|
296
|
+
return /* @__PURE__ */ e("div", { className: "lg-root", children: /* @__PURE__ */ n("div", { className: "app", children: [
|
|
297
|
+
/* @__PURE__ */ n("div", { className: "top", children: [
|
|
298
|
+
/* @__PURE__ */ n("div", { className: "brand", children: [
|
|
299
|
+
"pulse",
|
|
300
|
+
/* @__PURE__ */ e("span", { children: ".logs" })
|
|
482
301
|
] }),
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
493
|
-
m && /* @__PURE__ */ e("span", { className: "error", children: m }),
|
|
494
|
-
/* @__PURE__ */ e("button", { className: "btn primary", onClick: w, children: "Submit response" })
|
|
495
|
-
] })
|
|
496
|
-
] });
|
|
497
|
-
}, Ye = ({ survey: t, responses: a, onBack: n, onTake: s }) => {
|
|
498
|
-
const i = Y(() => le(ce(t, a)), [t, a]), m = t.questions.find((g) => g.type === "nps"), f = (g) => i ? Math.round(g / i.total * 100) : 0;
|
|
499
|
-
return /* @__PURE__ */ r(
|
|
500
|
-
ee,
|
|
501
|
-
{
|
|
502
|
-
title: t.name,
|
|
503
|
-
subtitle: `${a.length} responses`,
|
|
504
|
-
actions: /* @__PURE__ */ r(ae, { children: [
|
|
505
|
-
/* @__PURE__ */ e("button", { className: "btn", onClick: n, children: "Back" }),
|
|
506
|
-
/* @__PURE__ */ e("button", { className: "btn primary", disabled: t.status !== "active", onClick: s, children: "Take survey" })
|
|
302
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: E, children: "▶ Start tutorial" })
|
|
303
|
+
] }),
|
|
304
|
+
/* @__PURE__ */ n("div", { className: "viewer", children: [
|
|
305
|
+
/* @__PURE__ */ n("div", { className: "titlebar", "data-tour": "titlebar", children: [
|
|
306
|
+
/* @__PURE__ */ n("div", { children: [
|
|
307
|
+
/* @__PURE__ */ e("h1", { children: "Log Viewer" }),
|
|
308
|
+
/* @__PURE__ */ e("small", { children: "Inspect application errors, warnings and debug output" })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ e("span", { className: "badge", children: "SAMPLE DATA" })
|
|
507
311
|
] }),
|
|
508
|
-
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */ e(
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
|
|
513
|
-
|
|
312
|
+
/* @__PURE__ */ n("div", { className: "layout", children: [
|
|
313
|
+
/* @__PURE__ */ n("aside", { className: "files", "data-tour": "files", children: [
|
|
314
|
+
/* @__PURE__ */ e("h3", { children: "Log files" }),
|
|
315
|
+
Object.entries(se).map(([r, f]) => /* @__PURE__ */ n("button", { className: `file mono ${a === r ? "on" : ""}`, onClick: () => x(r), children: [
|
|
316
|
+
/* @__PURE__ */ e("span", { children: "📄" }),
|
|
317
|
+
f.name,
|
|
318
|
+
/* @__PURE__ */ e("span", { className: "n", children: f.lines.length })
|
|
319
|
+
] }, r))
|
|
514
320
|
] }),
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
321
|
+
/* @__PURE__ */ n("section", { className: "main", children: [
|
|
322
|
+
/* @__PURE__ */ n("div", { className: "summary", "data-tour": "summary", children: [
|
|
323
|
+
/* @__PURE__ */ n("div", { className: "stat e", children: [
|
|
324
|
+
/* @__PURE__ */ e("b", { children: w("ERROR") }),
|
|
325
|
+
/* @__PURE__ */ e("span", { children: "Errors" })
|
|
326
|
+
] }),
|
|
327
|
+
/* @__PURE__ */ n("div", { className: "stat w", children: [
|
|
328
|
+
/* @__PURE__ */ e("b", { children: w("WARN") }),
|
|
329
|
+
/* @__PURE__ */ e("span", { children: "Warnings" })
|
|
330
|
+
] }),
|
|
331
|
+
/* @__PURE__ */ n("div", { className: "stat", children: [
|
|
332
|
+
/* @__PURE__ */ e("b", { children: p.length }),
|
|
333
|
+
/* @__PURE__ */ e("span", { children: "Total lines" })
|
|
334
|
+
] })
|
|
335
|
+
] }),
|
|
336
|
+
/* @__PURE__ */ n("div", { className: "filters", "data-tour": "filters", children: [
|
|
337
|
+
Ne.map((r) => /* @__PURE__ */ n("button", { className: `chip ${s === r ? "on" : ""}`, onClick: () => {
|
|
338
|
+
o(r), N(null);
|
|
339
|
+
}, children: [
|
|
340
|
+
r === "ALL" ? "All" : r[0] + r.slice(1).toLowerCase(),
|
|
341
|
+
r !== "ALL" && ` (${w(r)})`
|
|
342
|
+
] }, r)),
|
|
343
|
+
/* @__PURE__ */ e("input", { className: "search", placeholder: "Search logs…", value: u, onChange: (r) => T(r.target.value), "aria-label": "Search logs" })
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ n("div", { className: "logpane mono", "data-tour": "logpane", children: [
|
|
346
|
+
/* @__PURE__ */ n("div", { className: "head", children: [
|
|
347
|
+
se[a].name,
|
|
348
|
+
" · ",
|
|
349
|
+
q.length,
|
|
350
|
+
" line",
|
|
351
|
+
q.length !== 1 && "s"
|
|
352
|
+
] }),
|
|
353
|
+
q.length === 0 && /* @__PURE__ */ e("div", { className: "empty", children: "No lines match this filter." }),
|
|
354
|
+
q.map((r) => /* @__PURE__ */ n("button", { className: `line ${g === r.i ? "sel" : ""}`, onClick: () => N(r.i), children: [
|
|
355
|
+
/* @__PURE__ */ e("span", { className: "ln", children: r.i + 1 }),
|
|
356
|
+
/* @__PURE__ */ e("span", { className: "ts", children: r.t }),
|
|
357
|
+
/* @__PURE__ */ e("span", { className: `lvl ${r.l}`, children: r.l }),
|
|
358
|
+
/* @__PURE__ */ e("span", { className: "msg", "data-lvl": r.l, children: r.m })
|
|
359
|
+
] }, r.i))
|
|
360
|
+
] })
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ n("aside", { className: "details", "data-tour": "details", children: [
|
|
363
|
+
/* @__PURE__ */ e("h3", { children: "Details" }),
|
|
364
|
+
!k && /* @__PURE__ */ e("div", { className: "placeholder", children: "Select a log line to see what it means and how to fix it." }),
|
|
365
|
+
k && /* @__PURE__ */ n(V, { children: [
|
|
366
|
+
/* @__PURE__ */ n("div", { className: "box", children: [
|
|
367
|
+
/* @__PURE__ */ e("b", { children: "Message" }),
|
|
368
|
+
/* @__PURE__ */ e("span", { className: `lvl ${k.l}`, style: { marginRight: 6 }, children: k.l }),
|
|
369
|
+
k.m
|
|
370
|
+
] }),
|
|
371
|
+
/* @__PURE__ */ n("div", { className: "box", children: [
|
|
372
|
+
/* @__PURE__ */ e("b", { children: "What it means" }),
|
|
373
|
+
k.d.meaning
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ n("div", { className: "box", children: [
|
|
376
|
+
/* @__PURE__ */ e("b", { children: "Suggested fix" }),
|
|
377
|
+
k.d.fix
|
|
378
|
+
] }),
|
|
379
|
+
k.d.stack && /* @__PURE__ */ n("div", { className: "box", children: [
|
|
380
|
+
/* @__PURE__ */ e("b", { children: "Stack trace" }),
|
|
381
|
+
/* @__PURE__ */ e("pre", { className: "mono", children: k.d.stack })
|
|
382
|
+
] })
|
|
541
383
|
] })
|
|
542
384
|
] })
|
|
543
|
-
]
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
385
|
+
] })
|
|
386
|
+
] }),
|
|
387
|
+
d && /* @__PURE__ */ e(ke, { step: h, total: Y.length, onNext: c, onBack: W, onClose: D })
|
|
388
|
+
] }) });
|
|
389
|
+
}, xe = ({ items: t, value: a, onChange: i }) => /* @__PURE__ */ e("div", { className: "tabs", children: t.map((s) => /* @__PURE__ */ e("button", { type: "button", className: s.id === a ? "tab active" : "tab", onClick: () => i(s.id), children: s.label }, s.id)) }), Be = () => {
|
|
390
|
+
const [t, a] = j("logs");
|
|
391
|
+
return /* @__PURE__ */ n("div", { className: "shell", children: [
|
|
392
|
+
/* @__PURE__ */ n("header", { className: "topbar", children: [
|
|
550
393
|
/* @__PURE__ */ e("strong", { children: "POC" }),
|
|
551
|
-
/* @__PURE__ */ e(
|
|
394
|
+
/* @__PURE__ */ e(xe, { items: [{ id: "logs", label: "Logs" }, { id: "feedback", label: "Feedback" }], value: t, onChange: a })
|
|
552
395
|
] }),
|
|
553
|
-
/* @__PURE__ */ e("main", { children: t === "
|
|
396
|
+
/* @__PURE__ */ e("main", { children: t === "logs" ? /* @__PURE__ */ e(Se, {}) : /* @__PURE__ */ e(ye, {}) })
|
|
554
397
|
] });
|
|
555
|
-
},
|
|
398
|
+
}, G = (t, a) => {
|
|
556
399
|
try {
|
|
557
400
|
return t();
|
|
558
401
|
} catch {
|
|
559
402
|
return a;
|
|
560
403
|
}
|
|
561
|
-
},
|
|
404
|
+
}, ne = (t) => Math.random().toString(36).slice(2, 2 + t), X = () => location.pathname + location.hash, je = ".sj, [data-sj-ignore]", Te = () => ({
|
|
562
405
|
pages: {},
|
|
563
406
|
scrollMs: 0,
|
|
564
407
|
clicks: 0,
|
|
@@ -571,11 +414,11 @@ const He = ["nps", "rating", "multiple_choice", "open_text"], ye = (t) => new Da
|
|
|
571
414
|
drops: {},
|
|
572
415
|
log: []
|
|
573
416
|
});
|
|
574
|
-
class
|
|
417
|
+
class Ee {
|
|
575
418
|
constructor(a) {
|
|
576
|
-
this.getCfg = a, this.activeStep = null, this.q = [], this.version = 0, this.subs = /* @__PURE__ */ new Set(), this.navSubs = /* @__PURE__ */ new Set(), this.overrides = {}, this.prev = "", this.booted = !1, this.scrolling = !1, this.scrollTimer = 0, this.lastMove = 0, this.subscribe = (
|
|
577
|
-
this.subs.delete(
|
|
578
|
-
}), this.getVersion = () => this.version, this.uid =
|
|
419
|
+
this.getCfg = a, this.activeStep = null, this.q = [], this.version = 0, this.subs = /* @__PURE__ */ new Set(), this.navSubs = /* @__PURE__ */ new Set(), this.overrides = {}, this.prev = "", this.booted = !1, this.scrolling = !1, this.scrollTimer = 0, this.lastMove = 0, this.subscribe = (i) => (this.subs.add(i), () => {
|
|
420
|
+
this.subs.delete(i);
|
|
421
|
+
}), this.getVersion = () => this.version, this.uid = G(() => localStorage.getItem("sjU") || (localStorage.setItem("sjU", ne(10)), localStorage.getItem("sjU")), "anon"), this.sid = G(() => sessionStorage.getItem("sjS") || (sessionStorage.setItem("sjS", ne(8)), sessionStorage.getItem("sjS")), ne(8)), this.state = { ...Te(), ...G(() => JSON.parse(sessionStorage.getItem("sjState") || "null"), null) };
|
|
579
422
|
}
|
|
580
423
|
get cfg() {
|
|
581
424
|
return { ...this.getCfg(), ...this.overrides };
|
|
@@ -592,24 +435,24 @@ class ze {
|
|
|
592
435
|
};
|
|
593
436
|
}
|
|
594
437
|
/* ---- data ---- */
|
|
595
|
-
page(a =
|
|
438
|
+
page(a = X()) {
|
|
596
439
|
return this.state.pages[a] || (this.state.pages[a] = { ms: 0, scrollMs: 0, depth: 0, clicks: 0, views: 0, m: {} });
|
|
597
440
|
}
|
|
598
441
|
save() {
|
|
599
|
-
|
|
442
|
+
G(() => sessionStorage.setItem("sjState", JSON.stringify({ ...this.state, log: this.state.log.slice(0, 40) })), void 0);
|
|
600
443
|
}
|
|
601
|
-
bin(a,
|
|
602
|
-
const
|
|
603
|
-
|
|
444
|
+
bin(a, i, s) {
|
|
445
|
+
const o = X(), u = document.documentElement.scrollWidth || 1, T = this.state.heat[o] || (this.state.heat[o] = {}), g = Math.round(a / u * 100) + "," + (i / 20 | 0);
|
|
446
|
+
T[g] = (T[g] || 0) + s;
|
|
604
447
|
}
|
|
605
|
-
track(a,
|
|
606
|
-
const s = { sid: this.sid, uid: this.uid, type: a, t: Date.now(), page:
|
|
448
|
+
track(a, i = {}) {
|
|
449
|
+
const s = { sid: this.sid, uid: this.uid, type: a, t: Date.now(), page: X(), ...i };
|
|
607
450
|
this.q.push(s), this.state.log.unshift(s), this.state.log.length > 60 && this.state.log.pop();
|
|
608
|
-
const
|
|
609
|
-
|
|
451
|
+
const o = this.cfg.onEvent;
|
|
452
|
+
o && G(() => o(s), void 0);
|
|
610
453
|
}
|
|
611
454
|
payload(a) {
|
|
612
|
-
const
|
|
455
|
+
const i = this.state;
|
|
613
456
|
return JSON.stringify({
|
|
614
457
|
sessionId: this.sid,
|
|
615
458
|
userId: this.uid,
|
|
@@ -619,114 +462,114 @@ class ze {
|
|
|
619
462
|
doc: [document.documentElement.scrollWidth, document.documentElement.scrollHeight],
|
|
620
463
|
events: a,
|
|
621
464
|
summary: {
|
|
622
|
-
pages:
|
|
623
|
-
scrollMs:
|
|
624
|
-
clicks:
|
|
625
|
-
nav:
|
|
626
|
-
tour: { started:
|
|
627
|
-
heat:
|
|
465
|
+
pages: i.pages,
|
|
466
|
+
scrollMs: i.scrollMs,
|
|
467
|
+
clicks: i.clicks,
|
|
468
|
+
nav: i.nav,
|
|
469
|
+
tour: { started: i.started, completed: i.completed, skipped: i.skipped, drops: i.drops, steps: i.steps },
|
|
470
|
+
heat: i.heat
|
|
628
471
|
}
|
|
629
472
|
});
|
|
630
473
|
}
|
|
631
474
|
flush(a = !1) {
|
|
632
475
|
if (this.save(), !this.q.length) return;
|
|
633
|
-
const
|
|
476
|
+
const i = this.q;
|
|
634
477
|
this.q = [];
|
|
635
478
|
const s = this.cfg;
|
|
636
479
|
if (!s.endpoint) {
|
|
637
|
-
this.state.log.unshift({ type: "flush (dry-run)", t: Date.now(), n: `${
|
|
480
|
+
this.state.log.unshift({ type: "flush (dry-run)", t: Date.now(), n: `${i.length} events` });
|
|
638
481
|
return;
|
|
639
482
|
}
|
|
640
|
-
const
|
|
641
|
-
a && navigator.sendBeacon && navigator.sendBeacon(s.endpoint, new Blob([
|
|
642
|
-
if (!
|
|
483
|
+
const o = this.payload(i);
|
|
484
|
+
a && navigator.sendBeacon && navigator.sendBeacon(s.endpoint, new Blob([o], { type: "application/json" })) || fetch(s.endpoint, { method: "POST", body: o, keepalive: !0, headers: { "Content-Type": "application/json", ...s.headers || {} } }).then((u) => {
|
|
485
|
+
if (!u.ok) throw new Error("bad status");
|
|
643
486
|
}).catch(() => {
|
|
644
|
-
this.q =
|
|
487
|
+
this.q = i.concat(this.q).slice(-500);
|
|
645
488
|
});
|
|
646
489
|
}
|
|
647
490
|
/* ---- tour funnel ---- */
|
|
648
|
-
tourStart(a,
|
|
649
|
-
|
|
491
|
+
tourStart(a, i) {
|
|
492
|
+
i || this.state.started++, this.track(i ? "tour_resume" : "tour_start", { steps: a });
|
|
650
493
|
}
|
|
651
|
-
stepView(a,
|
|
652
|
-
const
|
|
653
|
-
|
|
494
|
+
stepView(a, i, s) {
|
|
495
|
+
const o = this.state.steps[a] || (this.state.steps[a] = { views: 0, ms: 0, title: i });
|
|
496
|
+
o.views++, this.activeStep = a, this.track("step_view", { step: a, title: i, total: s }), this.save();
|
|
654
497
|
}
|
|
655
|
-
tourEnd(a,
|
|
656
|
-
a === "complete" ? (this.state.completed++, this.track("tour_complete", { steps:
|
|
498
|
+
tourEnd(a, i, s, o) {
|
|
499
|
+
a === "complete" ? (this.state.completed++, this.track("tour_complete", { steps: o })) : (this.state.skipped++, this.state.drops[i] = (this.state.drops[i] || 0) + 1, this.track("tour_skip", { step: i, title: s })), this.activeStep = null, G(() => sessionStorage.removeItem("sjTour"), void 0), G(() => localStorage.setItem("sjDone", a), void 0), this.flush();
|
|
657
500
|
}
|
|
658
501
|
/* ---- passive listeners; returns a cleanup function (safe under React StrictMode) ---- */
|
|
659
502
|
attach() {
|
|
660
503
|
const a = this.state;
|
|
661
|
-
this.prev =
|
|
662
|
-
let
|
|
504
|
+
this.prev = X();
|
|
505
|
+
let i = performance.now();
|
|
663
506
|
this.booted || (this.booted = !0, this.page().views++, this.track("session_start", { ua: navigator.userAgent.slice(0, 60), ref: document.referrer }));
|
|
664
|
-
const s = [],
|
|
665
|
-
|
|
666
|
-
},
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
}, 250),
|
|
507
|
+
const s = [], o = (d, l, h, b) => {
|
|
508
|
+
d.addEventListener(l, h, b), s.push(() => d.removeEventListener(l, h, b));
|
|
509
|
+
}, u = window.setInterval(() => {
|
|
510
|
+
const d = performance.now(), l = d - i;
|
|
511
|
+
if (i = d, document.hidden) return;
|
|
512
|
+
const h = this.page();
|
|
513
|
+
h.ms += l, this.scrolling && (h.scrollMs += l, a.scrollMs += l), this.activeStep !== null && a.steps[this.activeStep] && (a.steps[this.activeStep].ms += l);
|
|
514
|
+
}, 250), T = window.setInterval(() => this.emit(), 500), g = window.setInterval(() => this.flush(), this.cfg.flushMs || 5e3);
|
|
672
515
|
s.push(() => {
|
|
673
|
-
clearInterval(
|
|
674
|
-
}),
|
|
516
|
+
clearInterval(u), clearInterval(T), clearInterval(g);
|
|
517
|
+
}), o(window, "scroll", () => {
|
|
675
518
|
this.scrolling = !0, clearTimeout(this.scrollTimer), this.scrollTimer = window.setTimeout(() => {
|
|
676
519
|
this.scrolling = !1;
|
|
677
520
|
}, 160);
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
|
|
521
|
+
const d = this.page(), l = Math.min(100, Math.round((scrollY + innerHeight) / document.documentElement.scrollHeight * 100));
|
|
522
|
+
l > d.depth && (d.depth = l, [25, 50, 75, 100].forEach((h) => {
|
|
523
|
+
l >= h && !d.m[h] && (d.m[h] = 1, this.track("scroll_depth", { pct: h }));
|
|
681
524
|
}));
|
|
682
|
-
}, { passive: !0 }),
|
|
683
|
-
const
|
|
684
|
-
|
|
685
|
-
}, { passive: !0 }),
|
|
686
|
-
const
|
|
687
|
-
if (!
|
|
688
|
-
a.clicks++, this.page().clicks++, this.bin(
|
|
689
|
-
const
|
|
690
|
-
this.track("click", { sel:
|
|
691
|
-
const
|
|
692
|
-
|
|
525
|
+
}, { passive: !0 }), o(window, "mousemove", (d) => {
|
|
526
|
+
const l = Date.now();
|
|
527
|
+
l - this.lastMove > 120 && (this.lastMove = l, this.bin(d.pageX, d.pageY, 1));
|
|
528
|
+
}, { passive: !0 }), o(document, "click", (d) => {
|
|
529
|
+
const l = d.target;
|
|
530
|
+
if (!l || !l.closest || l.closest(je)) return;
|
|
531
|
+
a.clicks++, this.page().clicks++, this.bin(d.pageX, d.pageY, 6);
|
|
532
|
+
const h = l.id ? "#" + l.id : l.tagName.toLowerCase() + (typeof l.className == "string" && l.className ? "." + l.className.trim().split(/\s+/)[0] : "");
|
|
533
|
+
this.track("click", { sel: h, x: d.pageX, y: d.pageY, text: (l.textContent || "").trim().slice(0, 30), step: this.activeStep });
|
|
534
|
+
const b = l.closest("a[href]");
|
|
535
|
+
b && !b.getAttribute("href").startsWith("#") && (this.track("navigate_out", { to: b.href }), this.flush(!0));
|
|
693
536
|
}, !0);
|
|
694
|
-
const
|
|
695
|
-
const
|
|
696
|
-
|
|
537
|
+
const N = () => {
|
|
538
|
+
const d = X();
|
|
539
|
+
d !== this.prev && (a.nav++, this.track("navigate", { from: this.prev, to: d }), this.prev = d, this.page().views++, this.navSubs.forEach((l) => l()));
|
|
697
540
|
};
|
|
698
|
-
return ["pushState", "replaceState"].forEach((
|
|
699
|
-
const
|
|
700
|
-
history[
|
|
701
|
-
const
|
|
702
|
-
return setTimeout(
|
|
541
|
+
return ["pushState", "replaceState"].forEach((d) => {
|
|
542
|
+
const l = history[d];
|
|
543
|
+
history[d] = function(...h) {
|
|
544
|
+
const b = l.apply(this, h);
|
|
545
|
+
return setTimeout(N), b;
|
|
703
546
|
}, s.push(() => {
|
|
704
|
-
history[
|
|
547
|
+
history[d] = l;
|
|
705
548
|
});
|
|
706
|
-
}),
|
|
549
|
+
}), o(window, "popstate", N), o(window, "hashchange", N), o(document, "visibilitychange", () => {
|
|
707
550
|
document.hidden && this.flush(!0);
|
|
708
|
-
}),
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
}), () => s.forEach((
|
|
551
|
+
}), o(window, "pagehide", () => {
|
|
552
|
+
const d = this.activeStep;
|
|
553
|
+
d !== null && (this.track("tour_abandon", { step: d }), a.drops[d] = (a.drops[d] || 0) + 1, G(() => sessionStorage.setItem("sjTour", JSON.stringify({ i: d, t: Date.now() })), void 0)), this.flush(!0);
|
|
554
|
+
}), () => s.forEach((d) => d());
|
|
712
555
|
}
|
|
713
556
|
}
|
|
714
|
-
const
|
|
715
|
-
function
|
|
557
|
+
const te = (t) => !!t && t.isConnected && t.getClientRects().length > 0;
|
|
558
|
+
function Ce(t) {
|
|
716
559
|
var s;
|
|
717
|
-
const a = t.dataset,
|
|
560
|
+
const a = t.dataset, i = (t.getAttribute("aria-label") || t.getAttribute("title") || t.textContent || "").trim().replace(/\s+/g, " ");
|
|
718
561
|
return {
|
|
719
562
|
el: t,
|
|
720
|
-
title: a.sjTitle || t.getAttribute("aria-label") || ((s = t.querySelector("h1,h2,h3")) == null ? void 0 : s.textContent) ||
|
|
721
|
-
body: a.sjBody ||
|
|
563
|
+
title: a.sjTitle || t.getAttribute("aria-label") || ((s = t.querySelector("h1,h2,h3")) == null ? void 0 : s.textContent) || i.slice(0, 28) || t.tagName.toLowerCase(),
|
|
564
|
+
body: a.sjBody || i.slice(0, 140),
|
|
722
565
|
placement: a.sjPlace || "auto"
|
|
723
566
|
};
|
|
724
567
|
}
|
|
725
|
-
function
|
|
568
|
+
function Le(t) {
|
|
726
569
|
const a = (s) => !s.page || s.page === location.pathname;
|
|
727
|
-
let
|
|
570
|
+
let i;
|
|
728
571
|
if (t.steps)
|
|
729
|
-
|
|
572
|
+
i = t.steps.map((s) => ({
|
|
730
573
|
...s,
|
|
731
574
|
placement: s.placement ?? "auto",
|
|
732
575
|
el: s.target && a(s) ? document.querySelector(s.target) : null,
|
|
@@ -734,90 +577,90 @@ function Ze(t) {
|
|
|
734
577
|
}));
|
|
735
578
|
else {
|
|
736
579
|
let s = [...document.querySelectorAll("[data-sj-title],[data-sj-step]")];
|
|
737
|
-
s.length || (s = [...document.querySelectorAll("header,nav,main>section,footer")].slice(0, 6)),
|
|
580
|
+
s.length || (s = [...document.querySelectorAll("header,nav,main>section,footer")].slice(0, 6)), i = s.filter(te).sort((o, u) => (+(o.dataset.sjStep || 0) || 99) - (+(u.dataset.sjStep || 0) || 99)).map(Ce);
|
|
738
581
|
}
|
|
739
|
-
return t.welcome &&
|
|
582
|
+
return t.welcome && i.unshift({ ...t.welcome, el: null, placement: "auto", welcome: !0 }), t.outro && i.push({ ...t.outro, el: null, placement: "auto", outro: !0 }), i;
|
|
740
583
|
}
|
|
741
|
-
const
|
|
742
|
-
const
|
|
743
|
-
const x =
|
|
744
|
-
if (!t || !
|
|
745
|
-
const
|
|
746
|
-
let
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
|
|
584
|
+
const Z = (t, a, i) => Math.max(a, Math.min(i, t)), Re = ({ open: t, anim: a, theme: i, steps: s, index: o, startLabel: u, tracker: T, onNext: g, onBack: N, onSkip: d, onTheme: l }) => {
|
|
585
|
+
const h = B(null), b = B(null), m = B(0), [p, q] = j(null), w = s[o], k = F(() => {
|
|
586
|
+
const x = h.current;
|
|
587
|
+
if (!t || !w || !x) return;
|
|
588
|
+
const r = innerWidth, f = innerHeight, S = 12, M = 16;
|
|
589
|
+
let y = { x: r / 2, y: f / 2, w: 0, h: 0 }, P = !0;
|
|
590
|
+
if (te(w.el)) {
|
|
591
|
+
const R = w.el.getBoundingClientRect(), U = Math.max(R.left - 8, 0), C = Math.max(R.top - 8, 0);
|
|
592
|
+
y = { x: U, y: C, w: Math.min(R.right + 8, r) - U, h: Math.min(R.bottom + 8, f) - C }, P = !1;
|
|
750
593
|
}
|
|
751
|
-
const
|
|
752
|
-
let
|
|
753
|
-
if (!
|
|
754
|
-
const
|
|
755
|
-
top: { x:
|
|
756
|
-
bottom: { x:
|
|
757
|
-
left: { x:
|
|
758
|
-
right: { x:
|
|
759
|
-
},
|
|
760
|
-
|
|
594
|
+
const A = x.offsetWidth, I = x.offsetHeight;
|
|
595
|
+
let J = (r - A) / 2, H = (f - I) / 2, z = "c", v = 0, L = 0;
|
|
596
|
+
if (!P) {
|
|
597
|
+
const R = y.x + y.w / 2, U = y.y + y.h / 2, C = {
|
|
598
|
+
top: { x: R - A / 2, y: y.y - I - M, ok: y.y - I - M >= S },
|
|
599
|
+
bottom: { x: R - A / 2, y: y.y + y.h + M, ok: y.y + y.h + M + I <= f - S },
|
|
600
|
+
left: { x: y.x - A - M, y: U - I / 2, ok: y.x - A - M >= S },
|
|
601
|
+
right: { x: y.x + y.w + M, y: U - I / 2, ok: y.x + y.w + M + A <= r - S }
|
|
602
|
+
}, Q = w.placement !== "auto" && w.placement in C ? w.placement : "bottom", de = { top: "bottom", bottom: "top", left: "right", right: "left" }[Q], K = (w.placement === "auto" ? ["bottom", "top", "right", "left"] : [Q, de, "bottom", "top", "right", "left"]).find((he) => C[he].ok);
|
|
603
|
+
K ? (J = C[K].x, H = C[K].y, z = K) : (H = f - I - S, z = "in"), J = Z(J, S, r - A - S), H = Z(H, S, f - I - S), v = Z(R - J, 22, A - 22), L = Z(U - H, 22, I - 22);
|
|
761
604
|
}
|
|
762
|
-
|
|
763
|
-
}, [t,
|
|
764
|
-
cancelAnimationFrame(
|
|
765
|
-
}, [
|
|
766
|
-
if (
|
|
605
|
+
q({ hole: y, centered: P, x: Math.round(J), y: Math.round(H), side: z, ax: v, ay: L, vw: r, vh: f });
|
|
606
|
+
}, [t, w]), O = F(() => {
|
|
607
|
+
cancelAnimationFrame(m.current), m.current = requestAnimationFrame(k);
|
|
608
|
+
}, [k]);
|
|
609
|
+
if (oe(() => {
|
|
767
610
|
if (!t) return;
|
|
768
|
-
|
|
769
|
-
const x = window.setTimeout(
|
|
611
|
+
k();
|
|
612
|
+
const x = window.setTimeout(k, 380), r = window.setTimeout(k, 700);
|
|
770
613
|
return () => {
|
|
771
|
-
clearTimeout(x), clearTimeout(
|
|
614
|
+
clearTimeout(x), clearTimeout(r);
|
|
772
615
|
};
|
|
773
|
-
}, [t,
|
|
616
|
+
}, [t, o, k]), $(() => {
|
|
774
617
|
if (!t) return;
|
|
775
|
-
addEventListener("scroll",
|
|
776
|
-
const x =
|
|
618
|
+
addEventListener("scroll", O, { passive: !0 }), addEventListener("resize", O);
|
|
619
|
+
const x = T.onNavigate(O);
|
|
777
620
|
return () => {
|
|
778
|
-
removeEventListener("scroll",
|
|
621
|
+
removeEventListener("scroll", O), removeEventListener("resize", O), x(), cancelAnimationFrame(m.current);
|
|
779
622
|
};
|
|
780
|
-
}, [t,
|
|
623
|
+
}, [t, O, T]), $(() => {
|
|
781
624
|
var x;
|
|
782
|
-
t &&
|
|
783
|
-
}, [t,
|
|
784
|
-
const
|
|
785
|
-
[0, 0,
|
|
786
|
-
[
|
|
787
|
-
[
|
|
788
|
-
[
|
|
789
|
-
] : [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
|
|
790
|
-
return
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
-
|
|
793
|
-
/* @__PURE__ */ e("div", { className: "sj-ring", style:
|
|
794
|
-
/* @__PURE__ */
|
|
625
|
+
t && w && ((x = b.current) == null || x.focus({ preventScroll: !0 }));
|
|
626
|
+
}, [t, o, w]), !w) return null;
|
|
627
|
+
const E = o === s.length - 1, c = p, W = c ? [
|
|
628
|
+
[0, 0, c.vw, c.hole.y],
|
|
629
|
+
[c.hole.y + c.hole.h, 0, c.vw, c.vh - c.hole.y - c.hole.h],
|
|
630
|
+
[c.hole.y, 0, c.hole.x, c.hole.h],
|
|
631
|
+
[c.hole.y, c.hole.x + c.hole.w, c.vw - c.hole.x - c.hole.w, c.hole.h]
|
|
632
|
+
] : [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], D = (x) => Math.max(0, x) + "px";
|
|
633
|
+
return le(
|
|
634
|
+
/* @__PURE__ */ n("div", { className: `sj${t ? " on" : ""}${a ? " anim" : ""}`, "data-theme": i, "data-sj-ignore": !0, children: [
|
|
635
|
+
W.map(([x, r, f, S], M) => /* @__PURE__ */ e("div", { className: "sj-p", style: { top: D(x), left: D(r), width: D(f), height: D(S) } }, M)),
|
|
636
|
+
/* @__PURE__ */ e("div", { className: "sj-ring", style: c ? { top: c.hole.y, left: c.hole.x, width: D(c.hole.w), height: D(c.hole.h), opacity: c.centered ? 0 : 1 } : { opacity: 0 } }),
|
|
637
|
+
/* @__PURE__ */ n(
|
|
795
638
|
"div",
|
|
796
639
|
{
|
|
797
|
-
ref:
|
|
640
|
+
ref: h,
|
|
798
641
|
className: "sj-pop",
|
|
799
642
|
role: "dialog",
|
|
800
643
|
"aria-modal": "true",
|
|
801
644
|
"aria-live": "polite",
|
|
802
|
-
"data-side": (
|
|
803
|
-
style: { transform:
|
|
645
|
+
"data-side": (c == null ? void 0 : c.side) ?? "c",
|
|
646
|
+
style: { transform: c ? `translate(${c.x}px,${c.y}px)` : void 0, "--ax": ((c == null ? void 0 : c.ax) ?? 0) + "px", "--ay": ((c == null ? void 0 : c.ay) ?? 0) + "px" },
|
|
804
647
|
children: [
|
|
805
648
|
/* @__PURE__ */ e("i", { className: "sj-arr" }),
|
|
806
|
-
/* @__PURE__ */ e("div", { className: "sj-bar", children: /* @__PURE__ */ e("b", { style: { width: Math.round((
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */ e("span", { children:
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ e("button", { className: "sj-x", "aria-label": "Switch light or dark theme", onClick:
|
|
811
|
-
/* @__PURE__ */ e("button", { className: "sj-x", "aria-label": "Close tour", onClick:
|
|
649
|
+
/* @__PURE__ */ e("div", { className: "sj-bar", children: /* @__PURE__ */ e("b", { style: { width: Math.round((o + 1) / s.length * 100) + "%" } }) }),
|
|
650
|
+
/* @__PURE__ */ n("div", { className: "sj-hd", children: [
|
|
651
|
+
/* @__PURE__ */ e("span", { children: w.welcome ? "Welcome" : `Step ${o + 1} of ${s.length}` }),
|
|
652
|
+
/* @__PURE__ */ n("span", { children: [
|
|
653
|
+
/* @__PURE__ */ e("button", { className: "sj-x", "aria-label": "Switch light or dark theme", onClick: l, children: "◐" }),
|
|
654
|
+
/* @__PURE__ */ e("button", { className: "sj-x", "aria-label": "Close tour", onClick: d, children: "×" })
|
|
812
655
|
] })
|
|
813
656
|
] }),
|
|
814
|
-
/* @__PURE__ */ e("h3", { children:
|
|
815
|
-
/* @__PURE__ */ e("p", { children:
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */ e("button", { className: "sj-g", style: { visibility:
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */ e("button", { className: "sj-g", style: { visibility:
|
|
820
|
-
/* @__PURE__ */ e("button", { ref:
|
|
657
|
+
/* @__PURE__ */ e("h3", { children: w.title }),
|
|
658
|
+
/* @__PURE__ */ e("p", { children: w.body }),
|
|
659
|
+
/* @__PURE__ */ n("div", { className: "sj-ft", children: [
|
|
660
|
+
/* @__PURE__ */ e("button", { className: "sj-g", style: { visibility: E ? "hidden" : "visible" }, onClick: d, children: "Skip" }),
|
|
661
|
+
/* @__PURE__ */ n("span", { children: [
|
|
662
|
+
/* @__PURE__ */ e("button", { className: "sj-g", style: { visibility: o ? "visible" : "hidden" }, onClick: N, children: "Back" }),
|
|
663
|
+
/* @__PURE__ */ e("button", { ref: b, className: "sj-b", onClick: g, children: w.welcome ? u || "Start tour" : E ? "Finish" : "Next" })
|
|
821
664
|
] })
|
|
822
665
|
] })
|
|
823
666
|
]
|
|
@@ -826,143 +669,143 @@ const se = (t, a, n) => Math.max(a, Math.min(n, t)), et = ({ open: t, anim: a, t
|
|
|
826
669
|
] }),
|
|
827
670
|
document.body
|
|
828
671
|
);
|
|
829
|
-
},
|
|
830
|
-
const a =
|
|
831
|
-
return
|
|
832
|
-
const
|
|
833
|
-
const
|
|
834
|
-
if (!
|
|
835
|
-
const
|
|
836
|
-
if (!
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
for (const
|
|
840
|
-
const [
|
|
841
|
-
if (
|
|
842
|
-
const
|
|
843
|
-
|
|
672
|
+
}, Me = ({ tracker: t }) => {
|
|
673
|
+
const a = B(null);
|
|
674
|
+
return $(() => {
|
|
675
|
+
const i = () => {
|
|
676
|
+
const o = a.current;
|
|
677
|
+
if (!o) return;
|
|
678
|
+
const u = o.getContext("2d");
|
|
679
|
+
if (!u) return;
|
|
680
|
+
const T = document.documentElement.scrollWidth, g = t.state.heat[location.pathname + location.hash] || {};
|
|
681
|
+
o.width = innerWidth, o.height = innerHeight, u.globalCompositeOperation = "lighter";
|
|
682
|
+
for (const N in g) {
|
|
683
|
+
const [d, l] = N.split(",").map(Number), h = d / 100 * T - scrollX, b = l * 20 + 10 - scrollY;
|
|
684
|
+
if (h < -40 || b < -40 || h > innerWidth + 40 || b > innerHeight + 40) continue;
|
|
685
|
+
const m = Math.min(1, g[N] / 6), p = u.createRadialGradient(h, b, 0, h, b, 34);
|
|
686
|
+
p.addColorStop(0, `rgba(255,70,50,${0.5 * m + 0.1})`), p.addColorStop(1, "rgba(255,70,50,0)"), u.fillStyle = p, u.fillRect(h - 34, b - 34, 68, 68);
|
|
844
687
|
}
|
|
845
688
|
};
|
|
846
|
-
|
|
847
|
-
const s = window.setInterval(
|
|
848
|
-
return addEventListener("scroll",
|
|
849
|
-
clearInterval(s), removeEventListener("scroll",
|
|
689
|
+
i();
|
|
690
|
+
const s = window.setInterval(i, 250);
|
|
691
|
+
return addEventListener("scroll", i, { passive: !0 }), addEventListener("resize", i), () => {
|
|
692
|
+
clearInterval(s), removeEventListener("scroll", i), removeEventListener("resize", i);
|
|
850
693
|
};
|
|
851
|
-
}, [t]),
|
|
852
|
-
},
|
|
853
|
-
function
|
|
854
|
-
const t =
|
|
694
|
+
}, [t]), le(/* @__PURE__ */ e("canvas", { ref: a, className: "sj-heat", "data-sj-ignore": !0 }), document.body);
|
|
695
|
+
}, ce = ge(null);
|
|
696
|
+
function ie() {
|
|
697
|
+
const t = me(ce);
|
|
855
698
|
if (!t) throw new Error("useJourney must be used inside <JourneyProvider>");
|
|
856
699
|
return t;
|
|
857
700
|
}
|
|
858
|
-
function
|
|
859
|
-
const { tracker: t } =
|
|
860
|
-
return
|
|
701
|
+
function Ae() {
|
|
702
|
+
const { tracker: t } = ie();
|
|
703
|
+
return pe(t.subscribe, t.getVersion, t.getVersion), t.state;
|
|
861
704
|
}
|
|
862
|
-
const
|
|
705
|
+
const _ = (t, a) => {
|
|
863
706
|
try {
|
|
864
707
|
return t();
|
|
865
708
|
} catch {
|
|
866
709
|
return a;
|
|
867
710
|
}
|
|
868
|
-
},
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
const s =
|
|
872
|
-
|
|
873
|
-
const
|
|
874
|
-
return
|
|
711
|
+
}, Ie = ({ config: t, children: a }) => {
|
|
712
|
+
const i = B(t ?? {});
|
|
713
|
+
i.current = t ?? {};
|
|
714
|
+
const s = ae(() => new Ee(() => i.current), []), [o, u] = j(() => _(() => localStorage.getItem("sjTheme"), null) ?? (t == null ? void 0 : t.theme) ?? "auto"), [T, g] = j(() => _(() => matchMedia("(prefers-color-scheme:dark)").matches, !1));
|
|
715
|
+
$(() => {
|
|
716
|
+
const v = matchMedia("(prefers-color-scheme:dark)"), L = () => g(v.matches);
|
|
717
|
+
return v.addEventListener("change", L), () => v.removeEventListener("change", L);
|
|
875
718
|
}, []);
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
document.documentElement.setAttribute("data-sj-theme",
|
|
879
|
-
}, [
|
|
880
|
-
const
|
|
881
|
-
|
|
719
|
+
const N = o === "auto" ? T ? "dark" : "light" : o;
|
|
720
|
+
$(() => {
|
|
721
|
+
document.documentElement.setAttribute("data-sj-theme", N);
|
|
722
|
+
}, [N]);
|
|
723
|
+
const d = F((v) => {
|
|
724
|
+
u(v), _(() => localStorage.setItem("sjTheme", v), void 0), s.track("theme", { theme: v });
|
|
882
725
|
}, [s]);
|
|
883
|
-
|
|
884
|
-
const [
|
|
885
|
-
if (!
|
|
886
|
-
const
|
|
887
|
-
s.tourEnd(
|
|
888
|
-
}, [s]),
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
|
|
726
|
+
$(() => s.attach(), [s]);
|
|
727
|
+
const [l, h] = j(!1), [b, m] = j([]), [p, q] = j(-1), [w, k] = j(!1), O = B([]), E = B(-1), c = B(!1), W = B(!1), D = B(0), x = F((v) => {
|
|
728
|
+
if (!c.current) return;
|
|
729
|
+
const L = O.current[E.current];
|
|
730
|
+
s.tourEnd(v, E.current, (L == null ? void 0 : L.title) ?? "", O.current.length), c.current = !1, h(!1);
|
|
731
|
+
}, [s]), r = F((v, L = 0) => {
|
|
732
|
+
const R = O.current, U = i.current;
|
|
733
|
+
if (v < 0 && (v = 0), v >= R.length) return x("complete");
|
|
734
|
+
const C = R[v];
|
|
735
|
+
if (C.page && C.page !== location.pathname) {
|
|
736
|
+
_(() => sessionStorage.setItem("sjTour", JSON.stringify({ i: v, t: Date.now(), go: 1 })), void 0), s.track("step_navigate", { step: v, to: C.page }), s.flush(!0), location.href = C.page;
|
|
894
737
|
return;
|
|
895
738
|
}
|
|
896
|
-
if (
|
|
897
|
-
if (
|
|
739
|
+
if (C.wait && !C.el && C.target && (C.el = document.querySelector(C.target)), C.target && !te(C.el)) {
|
|
740
|
+
if (L < (U.waitMs ?? 2500) / 100) {
|
|
898
741
|
window.setTimeout(() => {
|
|
899
|
-
|
|
742
|
+
c.current && r(v, L + 1);
|
|
900
743
|
}, 100);
|
|
901
744
|
return;
|
|
902
745
|
}
|
|
903
|
-
s.track("step_missing", { step:
|
|
904
|
-
const
|
|
905
|
-
return
|
|
746
|
+
s.track("step_missing", { step: v, target: C.target });
|
|
747
|
+
const Q = v >= E.current ? 1 : -1;
|
|
748
|
+
return r(v + (v + Q < 0 ? 1 : Q), 0);
|
|
906
749
|
}
|
|
907
|
-
|
|
908
|
-
|
|
750
|
+
E.current = v, q(v), s.stepView(v, C.title, R.length), W.current && (k(!0), clearTimeout(D.current), D.current = window.setTimeout(() => k(!1), 520)), te(C.el) && C.el.scrollIntoView({ block: "center", behavior: W.current ? "smooth" : "auto" }), W.current || requestAnimationFrame(() => {
|
|
751
|
+
W.current = !0;
|
|
909
752
|
});
|
|
910
|
-
}, [x, s]),
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
}, [
|
|
914
|
-
|
|
915
|
-
}, [
|
|
916
|
-
|
|
917
|
-
}, [
|
|
918
|
-
|
|
919
|
-
const
|
|
920
|
-
let
|
|
921
|
-
return
|
|
922
|
-
}, [
|
|
923
|
-
|
|
924
|
-
}, []),
|
|
925
|
-
if (!
|
|
926
|
-
const
|
|
927
|
-
|
|
753
|
+
}, [x, s]), f = F((v = 0, L = !1) => {
|
|
754
|
+
const R = Le(i.current);
|
|
755
|
+
R.length && (O.current = R, m(R), c.current = !0, W.current = !1, h(!0), s.tourStart(R.length, L), r(v));
|
|
756
|
+
}, [r, s]), S = F(() => f(0), [f]), M = F(() => x("skip"), [x]), y = F(() => {
|
|
757
|
+
c.current && (s.track("step_next", { step: E.current }), r(E.current + 1));
|
|
758
|
+
}, [r, s]), P = F(() => {
|
|
759
|
+
c.current && r(E.current - 1);
|
|
760
|
+
}, [r]);
|
|
761
|
+
$(() => {
|
|
762
|
+
const v = _(() => JSON.parse(sessionStorage.getItem("sjTour") || "null"), null), L = i.current;
|
|
763
|
+
let R;
|
|
764
|
+
return v && Date.now() - v.t < 3e5 ? R = window.setTimeout(() => f(v.i, !0), 400) : L.autoStart !== !1 && !(L.once && _(() => localStorage.getItem("sjDone"), null)) && (R = window.setTimeout(() => f(0), 600)), () => clearTimeout(R);
|
|
765
|
+
}, [f]), $(() => () => {
|
|
766
|
+
c.current = !1;
|
|
767
|
+
}, []), $(() => {
|
|
768
|
+
if (!l) return;
|
|
769
|
+
const v = (L) => {
|
|
770
|
+
L.key === "Escape" ? x("skip") : L.key === "ArrowRight" ? y() : L.key === "ArrowLeft" && P();
|
|
928
771
|
};
|
|
929
|
-
return addEventListener("keydown",
|
|
930
|
-
}, [
|
|
931
|
-
const [
|
|
772
|
+
return addEventListener("keydown", v), () => removeEventListener("keydown", v);
|
|
773
|
+
}, [l, x, y, P]);
|
|
774
|
+
const [A, I] = j(!1), J = F(() => I((v) => !v), []), H = F((v) => s.configure(v), [s]), z = ae(() => ({
|
|
932
775
|
tracker: s,
|
|
933
|
-
theme:
|
|
934
|
-
resolvedTheme:
|
|
935
|
-
setTheme:
|
|
936
|
-
open:
|
|
937
|
-
start:
|
|
938
|
-
stop:
|
|
939
|
-
next:
|
|
940
|
-
back:
|
|
941
|
-
heat:
|
|
942
|
-
toggleHeat:
|
|
943
|
-
configure:
|
|
944
|
-
}), [s,
|
|
945
|
-
return /* @__PURE__ */
|
|
776
|
+
theme: o,
|
|
777
|
+
resolvedTheme: N,
|
|
778
|
+
setTheme: d,
|
|
779
|
+
open: l,
|
|
780
|
+
start: S,
|
|
781
|
+
stop: M,
|
|
782
|
+
next: y,
|
|
783
|
+
back: P,
|
|
784
|
+
heat: A,
|
|
785
|
+
toggleHeat: J,
|
|
786
|
+
configure: H
|
|
787
|
+
}), [s, o, N, d, l, S, M, y, P, A, J, H]);
|
|
788
|
+
return /* @__PURE__ */ n(ce.Provider, { value: z, children: [
|
|
946
789
|
a,
|
|
947
|
-
|
|
948
|
-
|
|
790
|
+
b.length > 0 && /* @__PURE__ */ e(
|
|
791
|
+
Re,
|
|
949
792
|
{
|
|
950
|
-
open:
|
|
951
|
-
anim:
|
|
952
|
-
theme:
|
|
953
|
-
steps:
|
|
954
|
-
index:
|
|
793
|
+
open: l,
|
|
794
|
+
anim: w,
|
|
795
|
+
theme: N,
|
|
796
|
+
steps: b,
|
|
797
|
+
index: p,
|
|
955
798
|
startLabel: t == null ? void 0 : t.startLabel,
|
|
956
799
|
tracker: s,
|
|
957
|
-
onNext:
|
|
958
|
-
onBack:
|
|
959
|
-
onSkip:
|
|
960
|
-
onTheme: () =>
|
|
800
|
+
onNext: y,
|
|
801
|
+
onBack: P,
|
|
802
|
+
onSkip: M,
|
|
803
|
+
onTheme: () => d(N === "dark" ? "light" : "dark")
|
|
961
804
|
}
|
|
962
805
|
),
|
|
963
|
-
|
|
806
|
+
A && /* @__PURE__ */ e(Me, { tracker: s })
|
|
964
807
|
] });
|
|
965
|
-
},
|
|
808
|
+
}, ee = (t) => t < 6e4 ? (t / 1e3).toFixed(1) + "s" : Math.floor(t / 6e4) + "m " + Math.round(t % 6e4 / 1e3) + "s", Fe = `import { JourneyProvider } from '@shiva004/surveys';
|
|
966
809
|
|
|
967
810
|
<JourneyProvider
|
|
968
811
|
config={{
|
|
@@ -978,70 +821,70 @@ const V = (t, a) => {
|
|
|
978
821
|
}}
|
|
979
822
|
>
|
|
980
823
|
<App />
|
|
981
|
-
</JourneyProvider>`,
|
|
982
|
-
const { toggleHeat:
|
|
983
|
-
return /* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
824
|
+
</JourneyProvider>`, Oe = ({ open: t, onClose: a }) => {
|
|
825
|
+
const { toggleHeat: i, configure: s } = ie(), o = Ae(), [u, T] = j("m"), g = location.pathname + location.hash, N = o.pages[g] || { ms: 0, depth: 0 }, d = o.started ? Math.round(o.completed / o.started * 100) + "%" : "–", l = [["Time on page", ee(N.ms)], ["Scrolling", ee(o.scrollMs)], ["Scroll depth", N.depth + "%"], ["Clicks", o.clicks], ["Completion", d], ["Navigations", o.nav]], h = Object.entries(o.steps).sort((m, p) => +m[0] - +p[0]), b = Math.max(1, ...h.map((m) => m[1].ms));
|
|
826
|
+
return /* @__PURE__ */ n("aside", { className: `nw-ins${t ? " open" : ""}`, "data-sj-ignore": !0, "aria-label": "Journey insights", children: [
|
|
827
|
+
/* @__PURE__ */ n("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
985
828
|
/* @__PURE__ */ e("strong", { children: "Journey insights" }),
|
|
986
829
|
/* @__PURE__ */ e("button", { className: "nw-x", onClick: a, "aria-label": "Close", children: "×" })
|
|
987
830
|
] }),
|
|
988
|
-
/* @__PURE__ */ e("div", { className: "nw-tabs", children: [["m", "Metrics"], ["e", "Events"], ["c", "Embed"]].map(([
|
|
989
|
-
|
|
990
|
-
/* @__PURE__ */ e("div", { className: "nw-kpis", children:
|
|
991
|
-
/* @__PURE__ */ e("small", { children:
|
|
992
|
-
/* @__PURE__ */ e("b", { children:
|
|
993
|
-
] },
|
|
831
|
+
/* @__PURE__ */ e("div", { className: "nw-tabs", children: [["m", "Metrics"], ["e", "Events"], ["c", "Embed"]].map(([m, p]) => /* @__PURE__ */ e("button", { className: u === m ? "on" : "", onClick: () => T(m), children: p }, m)) }),
|
|
832
|
+
u === "m" && /* @__PURE__ */ n(V, { children: [
|
|
833
|
+
/* @__PURE__ */ e("div", { className: "nw-kpis", children: l.map(([m, p]) => /* @__PURE__ */ n("div", { className: "nw-kpi", children: [
|
|
834
|
+
/* @__PURE__ */ e("small", { children: m }),
|
|
835
|
+
/* @__PURE__ */ e("b", { children: p })
|
|
836
|
+
] }, m)) }),
|
|
994
837
|
/* @__PURE__ */ e("h4", { children: "Time per page" }),
|
|
995
|
-
Object.entries(
|
|
996
|
-
/* @__PURE__ */ e("span", { children:
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
|
|
838
|
+
Object.entries(o.pages).map(([m, p]) => /* @__PURE__ */ n("div", { className: "nw-row", children: [
|
|
839
|
+
/* @__PURE__ */ e("span", { children: m }),
|
|
840
|
+
/* @__PURE__ */ n("span", { children: [
|
|
841
|
+
ee(p.ms),
|
|
999
842
|
" · ",
|
|
1000
|
-
|
|
843
|
+
p.depth,
|
|
1001
844
|
"% deep"
|
|
1002
845
|
] })
|
|
1003
|
-
] },
|
|
846
|
+
] }, m)),
|
|
1004
847
|
/* @__PURE__ */ e("h4", { children: "Walkthrough funnel and drop-offs" }),
|
|
1005
|
-
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
+
|
|
848
|
+
h.length ? h.map(([m, p]) => /* @__PURE__ */ n(ue.Fragment, { children: [
|
|
849
|
+
/* @__PURE__ */ n("div", { className: "nw-row", children: [
|
|
850
|
+
/* @__PURE__ */ n("span", { children: [
|
|
851
|
+
+m + 1,
|
|
1009
852
|
". ",
|
|
1010
|
-
|
|
853
|
+
p.title
|
|
1011
854
|
] }),
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
|
|
855
|
+
/* @__PURE__ */ n("span", { children: [
|
|
856
|
+
p.views,
|
|
1014
857
|
"× · ",
|
|
1015
|
-
|
|
1016
|
-
|
|
858
|
+
ee(p.ms),
|
|
859
|
+
o.drops[+m] ? /* @__PURE__ */ n(V, { children: [
|
|
1017
860
|
" · ",
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
|
|
861
|
+
/* @__PURE__ */ n("b", { className: "nw-warn", children: [
|
|
862
|
+
o.drops[+m],
|
|
1020
863
|
" dropped"
|
|
1021
864
|
] })
|
|
1022
865
|
] }) : null
|
|
1023
866
|
] })
|
|
1024
867
|
] }),
|
|
1025
|
-
/* @__PURE__ */ e("div", { className: "nw-meter", children: /* @__PURE__ */ e("i", { style: { width: Math.round(
|
|
1026
|
-
] },
|
|
868
|
+
/* @__PURE__ */ e("div", { className: "nw-meter", children: /* @__PURE__ */ e("i", { style: { width: Math.round(p.ms / b * 100) + "%" } }) })
|
|
869
|
+
] }, m)) : /* @__PURE__ */ n("div", { className: "nw-row", children: [
|
|
1027
870
|
/* @__PURE__ */ e("span", { children: "No tour data yet" }),
|
|
1028
871
|
/* @__PURE__ */ e("span", {})
|
|
1029
872
|
] }),
|
|
1030
873
|
/* @__PURE__ */ e("h4", { children: "Heatmap" }),
|
|
1031
|
-
/* @__PURE__ */ e("button", { className: "nw-btn", onClick:
|
|
874
|
+
/* @__PURE__ */ e("button", { className: "nw-btn", onClick: i, children: "Toggle heatmap overlay" })
|
|
1032
875
|
] }),
|
|
1033
|
-
|
|
1034
|
-
/* @__PURE__ */ e("span", { children:
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
String(
|
|
876
|
+
u === "e" && o.log.slice(0, 30).map((m, p) => /* @__PURE__ */ n("div", { className: "nw-row", children: [
|
|
877
|
+
/* @__PURE__ */ e("span", { children: m.type }),
|
|
878
|
+
/* @__PURE__ */ n("span", { children: [
|
|
879
|
+
String(m.title || m.sel || m.pct || m.n || m.to || m.theme || ""),
|
|
1037
880
|
" · ",
|
|
1038
|
-
new Date(
|
|
881
|
+
new Date(m.t).toLocaleTimeString()
|
|
1039
882
|
] })
|
|
1040
|
-
] }, `${
|
|
1041
|
-
|
|
883
|
+
] }, `${m.t}-${p}`)),
|
|
884
|
+
u === "c" && /* @__PURE__ */ n(V, { children: [
|
|
1042
885
|
/* @__PURE__ */ e("h4", { children: "Install in a React app" }),
|
|
1043
|
-
/* @__PURE__ */ e("pre", { children:
|
|
1044
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ e("pre", { children: Fe }),
|
|
887
|
+
/* @__PURE__ */ n("p", { children: [
|
|
1045
888
|
"No ",
|
|
1046
889
|
/* @__PURE__ */ e("code", { children: "steps" }),
|
|
1047
890
|
"? Add ",
|
|
@@ -1057,8 +900,8 @@ const V = (t, a) => {
|
|
|
1057
900
|
" continues the tour after navigating."
|
|
1058
901
|
] }),
|
|
1059
902
|
/* @__PURE__ */ e("h4", { children: "Backend endpoint" }),
|
|
1060
|
-
/* @__PURE__ */ e("input", { placeholder: "/api/journey/events", onChange: (
|
|
1061
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ e("input", { placeholder: "/api/journey/events", onChange: (m) => s({ endpoint: m.target.value.trim() }) }),
|
|
904
|
+
/* @__PURE__ */ n("p", { children: [
|
|
1062
905
|
"Run ",
|
|
1063
906
|
/* @__PURE__ */ e("code", { children: "node server.js" }),
|
|
1064
907
|
", open ",
|
|
@@ -1067,82 +910,82 @@ const V = (t, a) => {
|
|
|
1067
910
|
] })
|
|
1068
911
|
] })
|
|
1069
912
|
] });
|
|
1070
|
-
},
|
|
1071
|
-
const { start: t, setTheme: a, resolvedTheme:
|
|
1072
|
-
return /* @__PURE__ */
|
|
1073
|
-
/* @__PURE__ */
|
|
1074
|
-
/* @__PURE__ */
|
|
913
|
+
}, $e = () => {
|
|
914
|
+
const { start: t, setTheme: a, resolvedTheme: i } = ie(), [s, o] = j(!1);
|
|
915
|
+
return /* @__PURE__ */ n("div", { className: "nw", id: "top", children: [
|
|
916
|
+
/* @__PURE__ */ n("header", { className: "nw-head", "data-sj-step": 1, "data-sj-title": "Main navigation", "data-sj-body": "Jump between Features, Pricing and Contact from here. It stays visible as you scroll.", "data-sj-place": "bottom", children: [
|
|
917
|
+
/* @__PURE__ */ n("a", { className: "nw-logo", href: "#top", children: [
|
|
1075
918
|
/* @__PURE__ */ e("i", { children: "◆" }),
|
|
1076
919
|
" Northwind"
|
|
1077
920
|
] }),
|
|
1078
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ n("nav", { className: "nw-nav", children: [
|
|
1079
922
|
/* @__PURE__ */ e("a", { href: "#features", children: "Features" }),
|
|
1080
923
|
/* @__PURE__ */ e("a", { href: "#pricing", children: "Pricing" }),
|
|
1081
924
|
/* @__PURE__ */ e("a", { href: "#contact", children: "Contact" })
|
|
1082
925
|
] }),
|
|
1083
926
|
/* @__PURE__ */ e("button", { className: "nw-btn", id: "srch", "data-sj-step": 2, "data-sj-title": "Search", "data-sj-body": "Find any page or help article instantly.", "data-sj-place": "left", children: "Search" })
|
|
1084
927
|
] }),
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
928
|
+
/* @__PURE__ */ n("main", { className: "nw-wrap", children: [
|
|
929
|
+
/* @__PURE__ */ n("section", { className: "nw-hero", children: [
|
|
1087
930
|
/* @__PURE__ */ e("h1", { children: "Ship products people actually finish onboarding." }),
|
|
1088
931
|
/* @__PURE__ */ e("p", { children: "Northwind is a sample site. The walkthrough reads each element’s position at runtime, so the same component fits any layout." }),
|
|
1089
|
-
/* @__PURE__ */
|
|
932
|
+
/* @__PURE__ */ n("div", { className: "nw-acts", children: [
|
|
1090
933
|
/* @__PURE__ */ e("a", { className: "nw-btn p", href: "#pricing", "data-sj-step": 3, "data-sj-title": "Primary action", "data-sj-body": "Start here. This button takes new visitors straight to the plans. You can click it while it is highlighted.", "data-sj-place": "right", children: "Get started" }),
|
|
1091
934
|
/* @__PURE__ */ e("a", { className: "nw-btn", href: "#features", children: "See features" })
|
|
1092
935
|
] })
|
|
1093
936
|
] }),
|
|
1094
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ n("section", { id: "features", "data-sj-step": 4, "data-sj-title": "Feature overview", "data-sj-body": "Three things Northwind does best. Large sections are fitted to the screen automatically.", "data-sj-place": "top", children: [
|
|
1095
938
|
/* @__PURE__ */ e("h2", { children: "Features" }),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ n("div", { className: "nw-grid", children: [
|
|
940
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
1098
941
|
/* @__PURE__ */ e("h3", { children: "Live analytics" }),
|
|
1099
942
|
/* @__PURE__ */ e("p", { children: "Page time, scroll depth and clicks, collected as people browse." })
|
|
1100
943
|
] }),
|
|
1101
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
1102
945
|
/* @__PURE__ */ e("h3", { children: "Heatmaps" }),
|
|
1103
946
|
/* @__PURE__ */ e("p", { children: "See where attention gathers and where it never reaches." })
|
|
1104
947
|
] }),
|
|
1105
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
1106
949
|
/* @__PURE__ */ e("h3", { children: "Guided tours" }),
|
|
1107
950
|
/* @__PURE__ */ e("p", { children: "Spotlight any element with a popup that repositions itself." })
|
|
1108
951
|
] })
|
|
1109
952
|
] })
|
|
1110
953
|
] }),
|
|
1111
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ n("section", { id: "pricing", children: [
|
|
1112
955
|
/* @__PURE__ */ e("h2", { children: "Pricing" }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ n("div", { className: "nw-grid", children: [
|
|
957
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
1115
958
|
/* @__PURE__ */ e("h3", { children: "Starter" }),
|
|
1116
959
|
/* @__PURE__ */ e("div", { className: "nw-big", children: "$0" }),
|
|
1117
960
|
/* @__PURE__ */ e("p", { children: "For side projects." })
|
|
1118
961
|
] }),
|
|
1119
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
1120
963
|
/* @__PURE__ */ e("h3", { children: "Team" }),
|
|
1121
964
|
/* @__PURE__ */ e("div", { className: "nw-big", children: "$29" }),
|
|
1122
965
|
/* @__PURE__ */ e("p", { children: "For growing teams." })
|
|
1123
966
|
] }),
|
|
1124
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ n("div", { className: "nw-card hot", "data-sj-step": 5, "data-sj-title": "Recommended plan", "data-sj-body": "Most teams pick this one. The popup flips sides on its own when there is no room.", "data-sj-place": "left", children: [
|
|
1125
968
|
/* @__PURE__ */ e("h3", { children: "Scale" }),
|
|
1126
969
|
/* @__PURE__ */ e("div", { className: "nw-big", children: "$99" }),
|
|
1127
970
|
/* @__PURE__ */ e("p", { children: "Unlimited journeys and exports." })
|
|
1128
971
|
] })
|
|
1129
972
|
] })
|
|
1130
973
|
] }),
|
|
1131
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ n("section", { id: "contact", children: [
|
|
1132
975
|
/* @__PURE__ */ e("h2", { children: "Contact" }),
|
|
1133
976
|
/* @__PURE__ */ e("div", { className: "nw-card", children: /* @__PURE__ */ e("p", { children: "hello@northwind.example: we reply within a day." }) })
|
|
1134
977
|
] })
|
|
1135
978
|
] }),
|
|
1136
979
|
/* @__PURE__ */ e("footer", { className: "nw-foot", "data-sj-step": 6, "data-sj-title": "Footer and help", "data-sj-body": "Legal links, support and contact details live down here.", "data-sj-place": "top", children: "© Northwind · Privacy · Terms · Status" }),
|
|
1137
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ n("div", { className: "nw-dock", "data-sj-ignore": !0, children: [
|
|
1138
981
|
/* @__PURE__ */ e("button", { onClick: t, children: "▶ Tour" }),
|
|
1139
|
-
/* @__PURE__ */ e("button", { onClick: () => a(
|
|
1140
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
982
|
+
/* @__PURE__ */ e("button", { onClick: () => a(i === "dark" ? "light" : "dark"), children: "◐ Theme" }),
|
|
983
|
+
/* @__PURE__ */ e("button", { onClick: () => o((u) => !u), children: "▤ Insights" })
|
|
1141
984
|
] }),
|
|
1142
|
-
/* @__PURE__ */ e(
|
|
985
|
+
/* @__PURE__ */ e(Oe, { open: s, onClose: () => o(!1) })
|
|
1143
986
|
] });
|
|
1144
|
-
},
|
|
1145
|
-
|
|
987
|
+
}, He = ({ endpoint: t, config: a }) => /* @__PURE__ */ e(
|
|
988
|
+
Ie,
|
|
1146
989
|
{
|
|
1147
990
|
config: {
|
|
1148
991
|
endpoint: t ?? new URLSearchParams(location.search).get("api") ?? "",
|
|
@@ -1151,24 +994,16 @@ const V = (t, a) => {
|
|
|
1151
994
|
outro: { title: "You’re all set", body: "Open Insights to see the time, scroll depth, clicks and heatmap this session just generated." },
|
|
1152
995
|
...a
|
|
1153
996
|
},
|
|
1154
|
-
children: /* @__PURE__ */ e(
|
|
997
|
+
children: /* @__PURE__ */ e($e, {})
|
|
1155
998
|
}
|
|
1156
999
|
);
|
|
1157
1000
|
export {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
pe as npsCategory,
|
|
1167
|
-
le as npsOf,
|
|
1168
|
-
ce as npsScores,
|
|
1169
|
-
Re as pathStats,
|
|
1170
|
-
we as simulate,
|
|
1171
|
-
Le as stageReach,
|
|
1172
|
-
de as useJourney,
|
|
1173
|
-
st as useJourneyStats
|
|
1001
|
+
ye as FeedbackApp,
|
|
1002
|
+
Ie as JourneyProvider,
|
|
1003
|
+
Ee as JourneyTracker,
|
|
1004
|
+
Se as LogsApp,
|
|
1005
|
+
Be as LogsFeedbackApp,
|
|
1006
|
+
He as WalkthroughDemo,
|
|
1007
|
+
ie as useJourney,
|
|
1008
|
+
Ae as useJourneyStats
|
|
1174
1009
|
};
|