@shiva004/surveys 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -53
- package/dist/feedback/FeedbackApp.d.ts +3 -0
- package/dist/index.d.ts +4 -10
- package/dist/index.js +959 -1128
- 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/dist/walkthrough/JourneyProvider.d.ts +27 -0
- package/dist/walkthrough/TourOverlay.d.ts +23 -0
- package/dist/walkthrough/WalkthroughDemo.d.ts +11 -0
- package/dist/walkthrough/index.d.ts +7 -0
- package/dist/walkthrough/tour.d.ts +39 -0
- package/dist/walkthrough/tracker.d.ts +83 -0
- package/package.json +4 -3
- package/dist/docs/UserJourneyDocs.d.ts +0 -12
- package/dist/docs/pages.d.ts +0 -22
- package/dist/docs/statics.d.ts +0 -10
- 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,1178 +1,1009 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"/dashboard": [["/checkout", 0.25], ["/docs", 0.15], ["/features", 0.1], ["EXIT", 0.5]],
|
|
26
|
-
"/checkout": [["EXIT", 1]]
|
|
27
|
-
}, L = (t, r) => {
|
|
28
|
-
let n = 0;
|
|
29
|
-
for (const [s, i] of t)
|
|
30
|
-
if (n += i, r < n) return s;
|
|
31
|
-
return t[t.length - 1][0];
|
|
32
|
-
};
|
|
33
|
-
function G(t, r) {
|
|
34
|
-
return Array.from({ length: t }, () => {
|
|
35
|
-
let n = L(K, r());
|
|
36
|
-
const s = [n];
|
|
37
|
-
for (; s.length < 8; ) {
|
|
38
|
-
const i = L(Z[n], r());
|
|
39
|
-
if (i === "EXIT") break;
|
|
40
|
-
s.push(i), n = i;
|
|
41
|
-
}
|
|
42
|
-
return s;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const ee = () => G(400, B(42));
|
|
46
|
-
function te(t) {
|
|
47
|
-
const r = /* @__PURE__ */ new Map(), n = (s) => (r.has(s) || r.set(s, { views: 0, entries: 0, bounces: 0, exits: 0 }), r.get(s));
|
|
48
|
-
for (const s of t)
|
|
49
|
-
s.forEach((i) => {
|
|
50
|
-
n(i).views += 1;
|
|
51
|
-
}), n(s[0]).entries += 1, s.length === 1 && (n(s[0]).bounces += 1), n(s[s.length - 1]).exits += 1;
|
|
52
|
-
return [...r.entries()].map(([s, i]) => ({
|
|
53
|
-
page: s,
|
|
54
|
-
views: i.views,
|
|
55
|
-
bounceRate: i.entries ? i.bounces / i.entries * 100 : 0,
|
|
56
|
-
exitRate: i.views ? i.exits / i.views * 100 : 0
|
|
57
|
-
})).sort((s, i) => i.views - s.views);
|
|
58
|
-
}
|
|
59
|
-
function ae(t, r = 8) {
|
|
60
|
-
const n = /* @__PURE__ */ new Map();
|
|
61
|
-
for (const s of t) {
|
|
62
|
-
const i = s.slice(0, 4), g = i.join(">"), b = n.get(g) ?? { steps: i, users: 0, conv: 0 };
|
|
63
|
-
b.users += 1, s.includes("/signup") && (b.conv += 1), n.set(g, b);
|
|
64
|
-
}
|
|
65
|
-
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, r);
|
|
66
|
-
}
|
|
67
|
-
function se(t) {
|
|
68
|
-
const r = /* @__PURE__ */ new Map();
|
|
69
|
-
for (const n of t)
|
|
70
|
-
for (let s = 0; s < n.length - 1; s++) {
|
|
71
|
-
const i = r.get(n[s]) ?? /* @__PURE__ */ new Map();
|
|
72
|
-
i.set(n[s + 1], (i.get(n[s + 1]) ?? 0) + 1), r.set(n[s], i);
|
|
73
|
-
}
|
|
74
|
-
return [...r.entries()].map(([n, s]) => {
|
|
75
|
-
const i = [...s.values()].reduce((g, b) => g + b, 0);
|
|
76
|
-
return {
|
|
77
|
-
from: n,
|
|
78
|
-
total: i,
|
|
79
|
-
destinations: [...s.entries()].map(([g, b]) => ({ to: g, pct: b / i * 100 })).sort((g, b) => b.pct - g.pct)
|
|
80
|
-
};
|
|
81
|
-
}).sort((n, s) => s.total - n.total);
|
|
82
|
-
}
|
|
83
|
-
const oe = (t, r) => t.length ? t.filter((n) => n.some((s) => r.includes(s))).length / t.length * 100 : 0, ne = {
|
|
84
|
-
id: "jm1",
|
|
85
|
-
name: "New customer journey",
|
|
86
|
-
stages: [
|
|
87
|
-
{ id: "st1", name: "Awareness", emotion: "curious", pages: ["/home"] },
|
|
88
|
-
{ id: "st2", name: "Consideration", emotion: "analytical", pages: ["/pricing", "/features"] },
|
|
89
|
-
{ id: "st3", name: "Sign up", emotion: "confident", pages: ["/signup"] },
|
|
90
|
-
{ id: "st4", name: "Activation", emotion: "engaged", pages: ["/dashboard"] },
|
|
91
|
-
{ id: "st5", name: "Purchase", emotion: "satisfied", pages: ["/checkout"] }
|
|
92
|
-
]
|
|
93
|
-
}, re = [
|
|
94
|
-
{ id: "nav", label: "Navigation Analysis" },
|
|
95
|
-
{ id: "paths", label: "Paths" },
|
|
96
|
-
{ id: "flows", label: "Userflows" },
|
|
97
|
-
{ id: "maps", label: "Journey Maps" }
|
|
98
|
-
], W = { curious: "#adc6ff", analytical: "#7c3aed", confident: "#4edea3", engaged: "#d2bbff", satisfied: "#ffcc6b", cautious: "#ffb4ab" }, ie = (t) => t.split("/").filter(Boolean).pop() ?? t, le = (t) => t > 25 ? "#ffb4ab" : t > 15 ? "#ffcc6b" : "#4edea3", ce = () => {
|
|
99
|
-
var d;
|
|
100
|
-
const [t, r] = y("nav"), [n, s] = y(ee), [i, g] = y(ne), b = S(() => te(n), [n]), v = S(() => ae(n), [n]), f = S(() => se(n), [n]), m = b.reduce((u, c) => u + c.views, 0), p = n.length, l = n.filter((u) => u.length === 1).length;
|
|
101
|
-
return /* @__PURE__ */ a(
|
|
102
|
-
I,
|
|
103
|
-
{
|
|
104
|
-
title: "User Journey",
|
|
105
|
-
subtitle: "One stream of page views feeds every view below.",
|
|
106
|
-
actions: /* @__PURE__ */ e("button", { className: "btn primary", onClick: () => s((u) => [...u, ...G(50, Math.random)]), children: "+ Simulate 50 sessions" }),
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ a("div", { className: "stats", children: [
|
|
109
|
-
/* @__PURE__ */ e(C, { label: "Sessions", value: p.toLocaleString(), color: "#6366f1" }),
|
|
110
|
-
/* @__PURE__ */ e(C, { label: "Page views", value: m.toLocaleString(), color: "#0ea5e9" }),
|
|
111
|
-
/* @__PURE__ */ e(C, { label: "Bounce rate", value: `${p ? (l / p * 100).toFixed(1) : 0}%`, color: "#f59e0b" }),
|
|
112
|
-
/* @__PURE__ */ e(C, { label: "Top page", value: ((d = b[0]) == null ? void 0 : d.page) ?? "—", color: "#10b981" })
|
|
113
|
-
] }),
|
|
114
|
-
/* @__PURE__ */ e(q, { items: re, value: t, onChange: r }),
|
|
115
|
-
t === "nav" && /* @__PURE__ */ a("table", { className: "table", children: [
|
|
116
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
|
|
117
|
-
/* @__PURE__ */ e("th", { children: "Page" }),
|
|
118
|
-
/* @__PURE__ */ e("th", { children: "Views" }),
|
|
119
|
-
/* @__PURE__ */ e("th", { children: "Share" }),
|
|
120
|
-
/* @__PURE__ */ e("th", { children: "Bounce rate" }),
|
|
121
|
-
/* @__PURE__ */ e("th", { children: "Exit rate" })
|
|
122
|
-
] }) }),
|
|
123
|
-
/* @__PURE__ */ e("tbody", { children: b.map((u) => /* @__PURE__ */ a("tr", { children: [
|
|
124
|
-
/* @__PURE__ */ e("td", { className: "mono", children: u.page }),
|
|
125
|
-
/* @__PURE__ */ e("td", { className: "mono", children: u.views }),
|
|
126
|
-
/* @__PURE__ */ e("td", { style: { minWidth: 120 }, children: /* @__PURE__ */ e(E, { pct: u.views / m * 100 }) }),
|
|
127
|
-
/* @__PURE__ */ a("td", { className: "mono", style: { color: le(u.bounceRate) }, children: [
|
|
128
|
-
u.bounceRate.toFixed(1),
|
|
129
|
-
"%"
|
|
130
|
-
] }),
|
|
131
|
-
/* @__PURE__ */ a("td", { className: "mono", children: [
|
|
132
|
-
u.exitRate.toFixed(1),
|
|
133
|
-
"%"
|
|
134
|
-
] })
|
|
135
|
-
] }, u.page)) })
|
|
136
|
-
] }),
|
|
137
|
-
t === "paths" && /* @__PURE__ */ e("div", { className: "grid", children: v.map((u, c) => /* @__PURE__ */ a("div", { className: "card", children: [
|
|
138
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
139
|
-
/* @__PURE__ */ a("span", { className: "pill passive", children: [
|
|
140
|
-
"#",
|
|
141
|
-
c + 1
|
|
142
|
-
] }),
|
|
143
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
144
|
-
/* @__PURE__ */ a("span", { className: "mono small", children: [
|
|
145
|
-
u.convRate.toFixed(1),
|
|
146
|
-
"% reach signup"
|
|
147
|
-
] })
|
|
148
|
-
] }),
|
|
149
|
-
/* @__PURE__ */ e("div", { className: "steps", title: u.steps.join(" → "), children: u.steps.map((w, o) => /* @__PURE__ */ a(V.Fragment, { children: [
|
|
150
|
-
o > 0 && /* @__PURE__ */ e("span", { className: "muted", children: "→" }),
|
|
151
|
-
/* @__PURE__ */ e("span", { className: "chip static", children: ie(w) })
|
|
152
|
-
] }, o)) }),
|
|
153
|
-
/* @__PURE__ */ a("div", { className: "small muted", children: [
|
|
154
|
-
u.users,
|
|
155
|
-
" users"
|
|
156
|
-
] }),
|
|
157
|
-
/* @__PURE__ */ e(E, { pct: u.convRate, color: "#10b981" })
|
|
158
|
-
] }, u.steps.join(">"))) }),
|
|
159
|
-
t === "flows" && /* @__PURE__ */ e("div", { className: "grid", children: f.map((u) => /* @__PURE__ */ a("div", { className: "card", children: [
|
|
160
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
161
|
-
/* @__PURE__ */ e("strong", { className: "mono", children: u.from }),
|
|
162
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
163
|
-
/* @__PURE__ */ a("span", { className: "small muted", children: [
|
|
164
|
-
u.total,
|
|
165
|
-
" transitions"
|
|
166
|
-
] })
|
|
167
|
-
] }),
|
|
168
|
-
u.destinations.slice(0, 4).map((c) => /* @__PURE__ */ a("div", { children: [
|
|
169
|
-
/* @__PURE__ */ a("div", { className: "row small", children: [
|
|
170
|
-
/* @__PURE__ */ a("span", { className: "mono", children: [
|
|
171
|
-
"→ ",
|
|
172
|
-
c.to
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
175
|
-
/* @__PURE__ */ a("span", { className: "mono", children: [
|
|
176
|
-
c.pct.toFixed(0),
|
|
177
|
-
"%"
|
|
178
|
-
] })
|
|
179
|
-
] }),
|
|
180
|
-
/* @__PURE__ */ e(E, { pct: c.pct })
|
|
181
|
-
] }, c.to))
|
|
182
|
-
] }, u.from)) }),
|
|
183
|
-
t === "maps" && /* @__PURE__ */ e(de, { map: i, setMap: g, sessions: n })
|
|
184
|
-
]
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
}, de = ({ map: t, setMap: r, sessions: n }) => {
|
|
188
|
-
const [s, i] = y(""), [g, b] = y("curious"), [v, f] = y([]), [m, p] = y(""), l = () => {
|
|
189
|
-
if (!s.trim()) return p("Stage name is required.");
|
|
190
|
-
if (v.length === 0) return p("Pick at least one touchpoint page.");
|
|
191
|
-
const d = { id: M("st"), name: s.trim(), emotion: g, pages: v };
|
|
192
|
-
r({ ...t, stages: [...t.stages, d] }), i(""), f([]), p("");
|
|
193
|
-
};
|
|
194
|
-
return /* @__PURE__ */ a("div", { className: "stack", children: [
|
|
195
|
-
/* @__PURE__ */ e("input", { className: "input", value: t.name, onChange: (d) => r({ ...t, name: d.target.value }), "aria-label": "Journey name" }),
|
|
196
|
-
/* @__PURE__ */ a("div", { className: "stages", children: [
|
|
197
|
-
t.stages.map((d, u) => {
|
|
198
|
-
const c = oe(n, d.pages), w = W[d.emotion] ?? "#7c3aed";
|
|
199
|
-
return /* @__PURE__ */ a("div", { className: "card stage", children: [
|
|
200
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
201
|
-
/* @__PURE__ */ e("span", { className: "badge", style: { background: `${w}30`, color: w }, children: u + 1 }),
|
|
202
|
-
/* @__PURE__ */ e("strong", { children: d.name }),
|
|
203
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
204
|
-
/* @__PURE__ */ e("button", { className: "btn danger", "aria-label": `Remove ${d.name}`, onClick: () => r({ ...t, stages: t.stages.filter((o) => o.id !== d.id) }), children: "✕" })
|
|
205
|
-
] }),
|
|
206
|
-
d.pages.map((o) => /* @__PURE__ */ a("div", { className: "small mono muted", children: [
|
|
207
|
-
"✓ ",
|
|
208
|
-
o
|
|
209
|
-
] }, o)),
|
|
210
|
-
/* @__PURE__ */ a("div", { className: "small", style: { color: w }, children: [
|
|
211
|
-
"Emotion: ",
|
|
212
|
-
d.emotion
|
|
213
|
-
] }),
|
|
214
|
-
/* @__PURE__ */ e(E, { pct: c }),
|
|
215
|
-
/* @__PURE__ */ a("div", { className: "small mono muted", children: [
|
|
216
|
-
c.toFixed(0),
|
|
217
|
-
"% reach"
|
|
218
|
-
] })
|
|
219
|
-
] }, d.id);
|
|
220
|
-
}),
|
|
221
|
-
t.stages.length === 0 && /* @__PURE__ */ e("div", { className: "muted", children: "No stages yet. Add one below." })
|
|
222
|
-
] }),
|
|
223
|
-
/* @__PURE__ */ a("div", { className: "card form", children: [
|
|
224
|
-
/* @__PURE__ */ e("strong", { children: "Add stage" }),
|
|
225
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
226
|
-
/* @__PURE__ */ e("input", { className: "input", placeholder: "Stage name", value: s, onChange: (d) => i(d.target.value) }),
|
|
227
|
-
/* @__PURE__ */ e("select", { className: "input slim", value: g, onChange: (d) => b(d.target.value), children: Object.keys(W).map((d) => /* @__PURE__ */ e("option", { children: d }, d)) })
|
|
228
|
-
] }),
|
|
229
|
-
/* @__PURE__ */ e("div", { className: "scale", children: z.map((d) => /* @__PURE__ */ e("button", { type: "button", className: v.includes(d) ? "chip active" : "chip", onClick: () => f((u) => u.includes(d) ? u.filter((c) => c !== d) : [...u, d]), children: d }, d)) }),
|
|
230
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
231
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
232
|
-
m && /* @__PURE__ */ e("span", { className: "error", children: m }),
|
|
233
|
-
/* @__PURE__ */ e("button", { className: "btn primary", onClick: l, children: "+ Add stage" })
|
|
234
|
-
] })
|
|
235
|
-
] })
|
|
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" })
|
|
236
25
|
] });
|
|
237
|
-
}, F = (t) => new Date(Date.UTC(2026, 10, 6) - t * 864e5).toISOString(), he = [
|
|
238
|
-
{
|
|
239
|
-
id: "s1",
|
|
240
|
-
name: "Q4 Product Satisfaction",
|
|
241
|
-
description: "How do users feel about the product right now?",
|
|
242
|
-
status: "active",
|
|
243
|
-
target: 100,
|
|
244
|
-
createdAt: F(30),
|
|
245
|
-
questions: [
|
|
246
|
-
{ id: "s1q1", type: "nps", text: "How likely are you to recommend us to a colleague?", required: !0 },
|
|
247
|
-
{ id: "s1q2", type: "rating", text: "How satisfied are you with the product?", required: !0 },
|
|
248
|
-
{ id: "s1q3", type: "multiple_choice", text: "Which feature do you use most?", required: !1, options: ["Feature Flags", "Experiments", "Segments", "Audit Log"] },
|
|
249
|
-
{ id: "s1q4", type: "open_text", text: "What is one thing we should improve?", required: !1 }
|
|
250
|
-
]
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
id: "s2",
|
|
254
|
-
name: "Onboarding Experience",
|
|
255
|
-
description: "First-week feedback from new accounts.",
|
|
256
|
-
status: "draft",
|
|
257
|
-
target: 50,
|
|
258
|
-
createdAt: F(5),
|
|
259
|
-
questions: [
|
|
260
|
-
{ id: "s2q1", type: "nps", text: "How likely are you to recommend our onboarding?", required: !0 },
|
|
261
|
-
{ id: "s2q2", type: "open_text", text: "What was confusing?", required: !1 }
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
], _ = ["Love the rollout controls", "Dashboards load slowly", "Needs better docs", "Great support", "Too many clicks to create a flag"];
|
|
265
|
-
function ue() {
|
|
266
|
-
const t = B(7);
|
|
267
|
-
return Array.from({ length: 36 }, (r, n) => {
|
|
268
|
-
const s = Math.min(10, Math.floor(t() * t() * 4 + t() * 8 + 3));
|
|
269
|
-
return {
|
|
270
|
-
id: `r${n}`,
|
|
271
|
-
surveyId: "s1",
|
|
272
|
-
userId: `user_${100 + n}`,
|
|
273
|
-
createdAt: F(Math.floor(t() * 28)),
|
|
274
|
-
answers: [
|
|
275
|
-
{ questionId: "s1q1", value: s },
|
|
276
|
-
{ questionId: "s1q2", value: Math.max(1, Math.min(5, Math.round(s / 2))) },
|
|
277
|
-
{ questionId: "s1q3", value: ["Feature Flags", "Experiments", "Segments", "Audit Log"][Math.floor(t() * 4)] },
|
|
278
|
-
{ questionId: "s1q4", value: _[Math.floor(t() * _.length)] }
|
|
279
|
-
]
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
26
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var i;
|
|
299
|
-
return (i = s.answers.find((g) => g.questionId === n.id)) == null ? void 0 : i.value;
|
|
300
|
-
}).filter((s) => typeof s == "number") : [];
|
|
301
|
-
}
|
|
302
|
-
const me = ["nps", "rating", "multiple_choice", "open_text"], Q = (t) => new Date(t).toLocaleDateString(void 0, { day: "2-digit", month: "short", year: "numeric" }), pe = () => {
|
|
303
|
-
const [t, r] = y(he), [n, s] = y(ue), [i, g] = y({ name: "list" }), b = (l) => t.find((d) => d.id === l), v = () => g({ name: "list" });
|
|
304
|
-
if (i.name === "create")
|
|
305
|
-
return /* @__PURE__ */ e(
|
|
306
|
-
ge,
|
|
307
|
-
{
|
|
308
|
-
onCancel: v,
|
|
309
|
-
onSave: (l) => {
|
|
310
|
-
r((d) => [l, ...d]), v();
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
if (i.name === "take") {
|
|
315
|
-
const l = b(i.id);
|
|
316
|
-
return l ? /* @__PURE__ */ e(
|
|
317
|
-
ve,
|
|
318
|
-
{
|
|
319
|
-
survey: l,
|
|
320
|
-
onCancel: v,
|
|
321
|
-
onSubmit: (d) => {
|
|
322
|
-
s((u) => [{ id: M("r"), surveyId: l.id, userId: `user_${900 + u.length}`, createdAt: (/* @__PURE__ */ new Date()).toISOString(), answers: d }, ...u]), g({ name: "results", id: l.id });
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
) : null;
|
|
326
|
-
}
|
|
327
|
-
if (i.name === "results") {
|
|
328
|
-
const l = b(i.id);
|
|
329
|
-
return l ? /* @__PURE__ */ e(be, { survey: l, responses: n.filter((d) => d.surveyId === l.id), onBack: v, onTake: () => g({ name: "take", id: l.id }) }) : null;
|
|
330
|
-
}
|
|
331
|
-
const f = n.length, m = t.filter((l) => l.status === "active").length, p = $(t.flatMap((l) => J(l, n)));
|
|
332
|
-
return /* @__PURE__ */ a(
|
|
333
|
-
I,
|
|
334
|
-
{
|
|
335
|
-
title: "Surveys",
|
|
336
|
-
subtitle: "Create, run and measure user surveys.",
|
|
337
|
-
actions: /* @__PURE__ */ e("button", { className: "btn primary", onClick: () => g({ name: "create" }), children: "+ Create Survey" }),
|
|
338
|
-
children: [
|
|
339
|
-
/* @__PURE__ */ a("div", { className: "stats", children: [
|
|
340
|
-
/* @__PURE__ */ e(C, { label: "Total surveys", value: t.length, color: "#6366f1" }),
|
|
341
|
-
/* @__PURE__ */ e(C, { label: "Active", value: m, color: "#10b981" }),
|
|
342
|
-
/* @__PURE__ */ e(C, { label: "Total responses", value: f }),
|
|
343
|
-
/* @__PURE__ */ e(C, { label: "Overall NPS", value: p ? p.score : "—", color: "#f59e0b" })
|
|
344
|
-
] }),
|
|
345
|
-
/* @__PURE__ */ a("table", { className: "table", children: [
|
|
346
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
|
|
347
|
-
/* @__PURE__ */ e("th", { children: "Survey" }),
|
|
348
|
-
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
349
|
-
/* @__PURE__ */ e("th", { children: "Progress" }),
|
|
350
|
-
/* @__PURE__ */ e("th", { children: "NPS" }),
|
|
351
|
-
/* @__PURE__ */ e("th", { children: "Created" }),
|
|
352
|
-
/* @__PURE__ */ e("th", {})
|
|
353
|
-
] }) }),
|
|
354
|
-
/* @__PURE__ */ e("tbody", { children: t.map((l) => {
|
|
355
|
-
const d = n.filter((c) => c.surveyId === l.id).length, u = $(J(l, n));
|
|
356
|
-
return /* @__PURE__ */ a("tr", { children: [
|
|
357
|
-
/* @__PURE__ */ a("td", { children: [
|
|
358
|
-
/* @__PURE__ */ e("strong", { children: l.name }),
|
|
359
|
-
/* @__PURE__ */ a("div", { className: "muted small", children: [
|
|
360
|
-
l.questions.length,
|
|
361
|
-
" questions"
|
|
362
|
-
] })
|
|
363
|
-
] }),
|
|
364
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
365
|
-
"select",
|
|
366
|
-
{
|
|
367
|
-
className: "input slim",
|
|
368
|
-
value: l.status,
|
|
369
|
-
onChange: (c) => r((w) => w.map((o) => o.id === l.id ? { ...o, status: c.target.value } : o)),
|
|
370
|
-
children: ["draft", "active", "paused", "closed"].map((c) => /* @__PURE__ */ e("option", { children: c }, c))
|
|
371
|
-
}
|
|
372
|
-
) }),
|
|
373
|
-
/* @__PURE__ */ a("td", { style: { minWidth: 140 }, children: [
|
|
374
|
-
/* @__PURE__ */ a("div", { className: "small mono", children: [
|
|
375
|
-
d,
|
|
376
|
-
" / ",
|
|
377
|
-
l.target
|
|
378
|
-
] }),
|
|
379
|
-
/* @__PURE__ */ e(E, { pct: d / l.target * 100 })
|
|
380
|
-
] }),
|
|
381
|
-
/* @__PURE__ */ e("td", { className: "mono", children: u ? u.score : "—" }),
|
|
382
|
-
/* @__PURE__ */ e("td", { className: "muted small", children: Q(l.createdAt) }),
|
|
383
|
-
/* @__PURE__ */ a("td", { className: "right", children: [
|
|
384
|
-
/* @__PURE__ */ e("button", { className: "btn", onClick: () => g({ name: "results", id: l.id }), children: "Results" }),
|
|
385
|
-
" ",
|
|
386
|
-
/* @__PURE__ */ e("button", { className: "btn", disabled: l.status !== "active", title: l.status !== "active" ? "Set status to active to collect answers" : "", onClick: () => g({ name: "take", id: l.id }), children: "Take" }),
|
|
387
|
-
" ",
|
|
388
|
-
/* @__PURE__ */ e(
|
|
389
|
-
"button",
|
|
390
|
-
{
|
|
391
|
-
className: "btn danger",
|
|
392
|
-
onClick: () => {
|
|
393
|
-
window.confirm(`Delete "${l.name}" and its responses?`) && (r((c) => c.filter((w) => w.id !== l.id)), s((c) => c.filter((w) => w.surveyId !== l.id)));
|
|
394
|
-
},
|
|
395
|
-
children: "Delete"
|
|
396
|
-
}
|
|
397
|
-
)
|
|
398
|
-
] })
|
|
399
|
-
] }, l.id);
|
|
400
|
-
}) })
|
|
401
|
-
] })
|
|
402
|
-
]
|
|
403
|
-
}
|
|
404
|
-
);
|
|
405
|
-
}, ge = ({ onSave: t, onCancel: r }) => {
|
|
406
|
-
const [n, s] = y(""), [i, g] = y(""), [b, v] = y(100), [f, m] = y([{ id: M("q"), type: "nps", text: "How likely are you to recommend us?", required: !0 }]), [p, l] = y(""), d = (c, w) => m((o) => o.map((h) => h.id === c ? { ...h, ...w } : h)), u = () => {
|
|
407
|
-
if (!n.trim()) return l("Survey name is required.");
|
|
408
|
-
if (f.length === 0) return l("Add at least one question.");
|
|
409
|
-
if (f.some((c) => !c.text.trim())) return l("Every question needs text.");
|
|
410
|
-
if (f.some((c) => c.type === "multiple_choice" && (c.options ?? []).filter((w) => w.trim()).length < 2)) return l("Multiple choice needs at least two options.");
|
|
411
|
-
t({
|
|
412
|
-
id: M("s"),
|
|
413
|
-
name: n.trim(),
|
|
414
|
-
description: i.trim(),
|
|
415
|
-
status: "active",
|
|
416
|
-
target: b,
|
|
417
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
418
|
-
questions: f.map((c) => ({ ...c, text: c.text.trim(), options: c.type === "multiple_choice" ? (c.options ?? []).filter((w) => w.trim()) : void 0 }))
|
|
419
|
-
});
|
|
420
|
-
};
|
|
421
|
-
return /* @__PURE__ */ a(I, { title: "Create Survey", subtitle: "Build a new survey.", actions: /* @__PURE__ */ e("button", { className: "btn", onClick: r, children: "Back" }), children: [
|
|
422
|
-
/* @__PURE__ */ a("div", { className: "card form", children: [
|
|
423
|
-
/* @__PURE__ */ a("label", { children: [
|
|
424
|
-
"Name",
|
|
425
|
-
/* @__PURE__ */ e("input", { className: "input", value: n, onChange: (c) => s(c.target.value), placeholder: "e.g. Q1 Product Satisfaction" })
|
|
426
|
-
] }),
|
|
427
|
-
/* @__PURE__ */ a("label", { children: [
|
|
428
|
-
"Description",
|
|
429
|
-
/* @__PURE__ */ e("input", { className: "input", value: i, onChange: (c) => g(c.target.value) })
|
|
430
|
-
] }),
|
|
431
|
-
/* @__PURE__ */ a("label", { children: [
|
|
432
|
-
"Target responses",
|
|
433
|
-
/* @__PURE__ */ e("input", { className: "input narrow", type: "number", min: 1, value: b, onChange: (c) => v(Math.max(1, parseInt(c.target.value, 10) || 1)) })
|
|
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 →" })
|
|
434
42
|
] })
|
|
435
43
|
] }),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
")
|
|
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 →" })
|
|
55
|
+
] })
|
|
440
56
|
] }),
|
|
441
|
-
|
|
442
|
-
/* @__PURE__ */
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
(c.options ?? []).map((o, h) => /* @__PURE__ */ e("input", { className: "input slim", value: o, onChange: (N) => d(c.id, { options: (c.options ?? []).map((x, D) => D === h ? N.target.value : x) }) }, h)),
|
|
458
|
-
/* @__PURE__ */ e("button", { className: "btn", onClick: () => d(c.id, { options: [...c.options ?? [], `Option ${(c.options ?? []).length + 1}`] }), children: "+ Add option" })
|
|
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 →" })
|
|
459
73
|
] })
|
|
460
|
-
] }
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */ e("
|
|
463
|
-
/* @__PURE__ */ e("
|
|
464
|
-
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const [s, i] = y({}), [g, b] = y(""), v = (m, p) => i((l) => ({ ...l, [m]: p })), f = () => {
|
|
470
|
-
const m = t.questions.find((p) => p.required && (s[p.id] === void 0 || s[p.id] === ""));
|
|
471
|
-
if (m) return b(`"${m.text}" is required.`);
|
|
472
|
-
b(""), r(t.questions.filter((p) => s[p.id] !== void 0 && s[p.id] !== "").map((p) => ({ questionId: p.id, value: s[p.id] })));
|
|
473
|
-
};
|
|
474
|
-
return /* @__PURE__ */ a(I, { title: t.name, subtitle: t.description || "Answer the questions below.", actions: /* @__PURE__ */ e("button", { className: "btn", onClick: n, children: "Cancel" }), children: [
|
|
475
|
-
t.questions.map((m, p) => /* @__PURE__ */ a("div", { className: "card form", children: [
|
|
476
|
-
/* @__PURE__ */ a("strong", { children: [
|
|
477
|
-
p + 1,
|
|
478
|
-
". ",
|
|
479
|
-
m.text,
|
|
480
|
-
m.required && /* @__PURE__ */ e("span", { className: "error", children: " *" })
|
|
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."
|
|
481
83
|
] }),
|
|
482
|
-
|
|
483
|
-
m.type === "rating" && /* @__PURE__ */ e("div", { className: "scale", children: [1, 2, 3, 4, 5].map((l) => /* @__PURE__ */ a("button", { className: s[m.id] === l ? "chip active" : "chip", onClick: () => v(m.id, l), children: [
|
|
484
|
-
l,
|
|
485
|
-
" ★"
|
|
486
|
-
] }, l)) }),
|
|
487
|
-
m.type === "multiple_choice" && /* @__PURE__ */ e("div", { className: "scale", children: (m.options ?? []).map((l) => /* @__PURE__ */ e("button", { className: s[m.id] === l ? "chip active" : "chip", onClick: () => v(m.id, l), children: l }, l)) }),
|
|
488
|
-
m.type === "open_text" && /* @__PURE__ */ e("textarea", { className: "input", rows: 2, value: String(s[m.id] ?? ""), onChange: (l) => v(m.id, l.target.value) })
|
|
489
|
-
] }, m.id)),
|
|
490
|
-
/* @__PURE__ */ a("div", { className: "row", children: [
|
|
491
|
-
/* @__PURE__ */ e("span", { className: "grow" }),
|
|
492
|
-
g && /* @__PURE__ */ e("span", { className: "error", children: g }),
|
|
493
|
-
/* @__PURE__ */ e("button", { className: "btn primary", onClick: f, children: "Submit response" })
|
|
84
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: t, children: "Done" })
|
|
494
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) })
|
|
495
103
|
] });
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
{
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
/* @__PURE__ */ e("td", { className: "muted small", children: Q(v.createdAt) })
|
|
538
|
-
] }, v.id);
|
|
539
|
-
})
|
|
540
|
-
] })
|
|
541
|
-
] })
|
|
542
|
-
]
|
|
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 = [
|
|
138
|
+
{
|
|
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);
|
|
543
145
|
}
|
|
544
|
-
|
|
545
|
-
}, Me = () => {
|
|
546
|
-
const [t, r] = y("survey");
|
|
547
|
-
return /* @__PURE__ */ a("div", { className: "shell", children: [
|
|
548
|
-
/* @__PURE__ */ a("header", { className: "topbar", children: [
|
|
549
|
-
/* @__PURE__ */ e("strong", { children: "POC" }),
|
|
550
|
-
/* @__PURE__ */ e(q, { items: [{ id: "survey", label: "Survey" }, { id: "journey", label: "User Journey" }], value: t, onChange: r })
|
|
551
|
-
] }),
|
|
552
|
-
/* @__PURE__ */ e("main", { children: t === "survey" ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(ce, {}) })
|
|
553
|
-
] });
|
|
554
|
-
}, A = [
|
|
146
|
+
},
|
|
555
147
|
{
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
"A journey map describes an experience from the user's point of view, for example “New User Onboarding”. It is split into <strong>stages</strong> in order (Discover, Sign up, First flag…). Inside each stage you list the <strong>touchpoints</strong>, the places the user meets the product, and tag how the user feels with an <strong>emotion</strong>.",
|
|
564
|
-
"Unlike the other three pages, which are generated from tracked traffic, Journey Maps are authored by your team. They give context to the numbers on Paths, User Flows and Navigation Analysis."
|
|
565
|
-
],
|
|
566
|
-
questions: ["Where in the experience do users feel cautious or frustrated?", "Which stage has the lowest completion?", "Which touchpoints belong to each stage?"],
|
|
567
|
-
header: "Title “Journey Maps”, subtitle “analytics · visual journey maps with emotional context”. Actions: Refresh (refetches the list) and Create journey (opens the Create Journey modal).",
|
|
568
|
-
stats: [["Total journeys", "Map", "Count of all journey maps"], ["Total stages", "Layers", "Stages across all loaded maps"], ["Avg completion", "CheckCircle2", "Average stage completion %, “—” when there are no stages"]],
|
|
569
|
-
controls: [
|
|
570
|
-
"Cards instead of a table: one card per journey map, showing its stages with the emotion colour",
|
|
571
|
-
"Infinite loading with a cursor (page size 20)",
|
|
572
|
-
"Search and status are sent to the API as <code>search</code> and <code>status</code>",
|
|
573
|
-
"Delete icon on each card opens a “Delete journey map?” confirmation; the card disappears instantly and comes back if the call fails",
|
|
574
|
-
"Create journey opens the modal described below"
|
|
575
|
-
],
|
|
576
|
-
columns: null,
|
|
577
|
-
states: ["<strong>Loading:</strong> a skeleton of cards (<code>JourneySkeleton</code>); stat cards show “—”", "<strong>Error:</strong> “Failed to load journey maps” with a retry (Refresh) action", "<strong>Empty:</strong> “No journey maps yet”, with a hint to create one to visualise user experiences with emotional context"],
|
|
578
|
-
colors: [
|
|
579
|
-
"Stage chip: emotion colour as text, the same colour at about 15% opacity as background; falls back to accent <code>#7c3aed</code>",
|
|
580
|
-
"Emotion presets and colours: Curious <code>#adc6ff</code>, Engaged <code>#7c3aed</code>, Excited <code>#4edea3</code>, Satisfied <code>#ffcc6b</code>, Loyal <code>#d2bbff</code>, Cautious <code>#ffcc6b</code>, Confident <code>#4edea3</code>, Analytical <code>#7c3aed</code>"
|
|
581
|
-
],
|
|
582
|
-
extraTitle: "Create Journey modal",
|
|
583
|
-
extra: [
|
|
584
|
-
"<strong>Name</strong> (placeholder “e.g. New User Onboarding”) and <strong>Description</strong> (“Describe this journey…”)",
|
|
585
|
-
"<strong>Stages</strong>: add as many as needed. Each has a name (“Stage 1 name”), one emotion preset and one or more touchpoints",
|
|
586
|
-
"Each new stage starts as Curious with one empty touchpoint",
|
|
587
|
-
"Saving calls <code>createMap</code>, refreshes the list and shows a success toast; a failure shows an error toast and keeps the modal data"
|
|
588
|
-
],
|
|
589
|
-
api: [["GET", "/JSON/events/GetJourneyMapsQuery.json", "listMaps({cursor, pageSize, search, status})"], ["POST", "/journeys/maps", "createMap({name, description, stages[]})"], ["DELETE", "/journeys/maps/:id", "deleteMap(id)"]],
|
|
590
|
-
types: [["JourneyMapItem", "id, name, description, userCount, avgTime, status, createdAt, updatedAt, stages[]"], ["JourneyStageItem", "id, position, name, emotion, emotionColor, completionPct, touchpoints[]"], ["JourneyTouchpointItem", "id, position, label"]],
|
|
591
|
-
hooks: "useJourneyMaps, useCreateJourneyMap, useDeleteJourneyMap"
|
|
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
|
+
}
|
|
592
155
|
},
|
|
593
156
|
{
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
"This page answers “how is each page performing?”. Every row is one page path, with how often it was viewed, how long people stay, how many leave after one page (<strong>bounce</strong>) and how many leave the product from it (<strong>exit</strong>).",
|
|
602
|
-
"The four stat cards summarise the whole list, and the table lets you find the pages that need attention by sorting on bounce or exit."
|
|
603
|
-
],
|
|
604
|
-
questions: ["Which pages get the most views?", "Which pages lose users (high bounce or exit rate)?", "Is a page getting better or worse over time (trend)?"],
|
|
605
|
-
header: "Title “Navigation Analysis”, subtitle “Page performance and navigation patterns.”. Secondary action: Refresh.",
|
|
606
|
-
stats: [["Total pages", "Navigation", "Number of tracked pages"], ["Total views", "Eye", "Sum of views, shown short (1,200 → 1.2K)"], ["Avg bounce rate", "LogOut", "Average bounce %; the card colour follows the bounce rule below"], ["Top page", "Star", "Page with the most views"]],
|
|
607
|
-
controls: [
|
|
608
|
-
"Search by page path",
|
|
609
|
-
"Sort: Views high→low, Bounce rate high→low, Exit rate high→low, Page A–Z",
|
|
610
|
-
"Filter Trend: All, Improving, Declining, Stable",
|
|
611
|
-
"Filter Bounce: All, High (> 25%), Medium (15–25%), Low (≤ 15%)",
|
|
612
|
-
"Table sits in the page's split layout, which can show a 320px detail drawer on wide screens"
|
|
613
|
-
],
|
|
614
|
-
columns: [["Page", "pagePath", "UJNavPageCell"], ["Views", "viewCount", "UJNavViewsCell"], ["Avg time", "avgTimeFormatted", "UJNavAvgTimeCell"], ["Bounce rate", "bounceRate", "UJBounceCell"], ["Exit rate", "exitRate", "UJExitRateCell"], ["Trend", "trend", "UJTrendCell"]],
|
|
615
|
-
states: ["<strong>Loading:</strong> the DataTable shows its loading state; stat cards show “—”", "<strong>Empty:</strong> “No navigation data yet.”"],
|
|
616
|
-
colors: [
|
|
617
|
-
"Bounce rule: above 25% red <code>#ffb4ab</code>, above 15% amber <code>#ffcc6b</code>, otherwise green <code>#4edea3</code>",
|
|
618
|
-
"Bounce cell is a small bar (width = rate, capped at 100%) plus the percentage in the same colour",
|
|
619
|
-
"Trend: improving = trending-up icon in the success colour, declining = trending-down in the soft danger colour, stable = a muted dash",
|
|
620
|
-
"Exit rate is plain muted text"
|
|
621
|
-
],
|
|
622
|
-
extraTitle: null,
|
|
623
|
-
extra: null,
|
|
624
|
-
api: [["GET", "/JSON/events/GetNavigationAnalysisQuery.json", "getNavigation({sortBy, sortOrder})"]],
|
|
625
|
-
types: [["NavigationPageItem", "id, pagePath, viewCount, avgTimeFormatted, bounceRate, exitRate, trend (up | down | stable), date"], ["NavigationSummary", "totalPages, totalViews, avgBounceRate, topPage"], ["NavigationAnalysisResponse", "pages[], summary"]],
|
|
626
|
-
hooks: "useNavigationAnalysis (with useTableData / useTableConfig)"
|
|
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
|
+
}
|
|
627
164
|
},
|
|
628
165
|
{
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
"A <strong>path</strong> is the exact sequence of pages a group of users visited, for example <code>home → flags → create</code>. The page ranks paths so you can see which routes are popular and which ones actually end in a conversion.",
|
|
637
|
-
"You can read the data two ways: as a dense <strong>Table</strong> for comparing numbers, or as a <strong>List</strong> of cards that is faster to scan. Both views share the same search, sort and filters and the same selected path."
|
|
638
|
-
],
|
|
639
|
-
questions: ["What are the most common routes through the product?", "Which route converts best?", "Do the popular paths also convert, or do they just take a lot of time?"],
|
|
640
|
-
header: "Title “Paths”, subtitle “Top user navigation paths.”. Secondary action: Refresh. A Table / List toggle sits above the content.",
|
|
641
|
-
stats: [["Total paths", "Route", "Number of distinct paths"], ["Users in paths", "Users", "Total users, shown in thousands (K)"], ["Best conversion", "MousePointer", "Highest conversion % among paths"]],
|
|
642
|
-
controls: [
|
|
643
|
-
"Table / List toggle: the table uses the shared DataTable, the list is a scrollable card grid in the accent colour <code>#7c3aed</code>",
|
|
644
|
-
"Search by path",
|
|
645
|
-
"Sort: Users high→low, Conversion high→low, Avg time longest first",
|
|
646
|
-
"Filter Conversion: High (≥ 50%), Medium (20–50%), Low (< 20%)",
|
|
647
|
-
"List cards show a pulsing status dot, a conversion pill, short step names (first 3, then +N) and a sparkline when trend data exists; the full path is in the tooltip",
|
|
648
|
-
"Click a row or card to select it; the selected card gets an accent border"
|
|
649
|
-
],
|
|
650
|
-
columns: [["Path", "steps", "UJPathStepsCell"], ["Users", "userCount", "UJPathUsersCell"], ["Conversion", "convRate", "UJPathConvCell"], ["Avg time", "avgTimeFormatted", "UJPathAvgTimeCell"]],
|
|
651
|
-
states: ["<strong>Loading:</strong> “Loading…” in the list view; the table shows its loading state", "<strong>Empty:</strong> “No path data yet.”"],
|
|
652
|
-
colors: [
|
|
653
|
-
"Step dots cycle green, blue, purple (<code>78, 222, 163</code>, <code>173, 198, 255</code>, <code>210, 187, 255</code>)",
|
|
654
|
-
"Conversion bar and text use the colour supplied with each path (<code>color</code> field)",
|
|
655
|
-
"The active card uses the accent border and a light accent background"
|
|
656
|
-
],
|
|
657
|
-
extraTitle: null,
|
|
658
|
-
extra: null,
|
|
659
|
-
api: [["GET", "/JSON/events/GetPathsQuery.json", "getPaths({sortBy, sortOrder})"]],
|
|
660
|
-
types: [["UserPathItem (PathRow)", "id, pathLabel, color, userCount, convRate, avgTimeFormatted, steps[], date"], ["PathsSummary", "totalPaths, totalUsers, bestConvRate, bestConvPath"], ["PathsResponse", "paths[], summary"]],
|
|
661
|
-
hooks: "usePaths"
|
|
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
|
+
}
|
|
662
173
|
},
|
|
663
174
|
{
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
"
|
|
680
|
-
|
|
681
|
-
"Filter Top destination share: High (≥ 60%), Medium (30–60%), Low (< 30%)",
|
|
682
|
-
"List cards show the page name, its top destination and a bar per destination with a tooltip “page · percentage”"
|
|
683
|
-
],
|
|
684
|
-
columns: [["From page", "fromPage", "UJFlowFromCell"], ["Top destinations", "destinations", "UJFlowDestsCell"], ["Destinations", "destinationCount", "UJFlowCountCell"], ["Top share", "topPercentage", "UJFlowShareCell"]],
|
|
685
|
-
states: ["<strong>Loading:</strong> stat cards show “—” and the view shows its loading state", "<strong>Empty:</strong> the stat cards stay empty and the avg top share shows “—” when there are no flows"],
|
|
686
|
-
colors: [
|
|
687
|
-
"Top share rule: 60% or more purple <code>#7c3aed</code>, 30% or more indigo <code>#6366f1</code>, otherwise sky <code>#0ea5e9</code>",
|
|
688
|
-
"Destination bars cycle green, blue, purple like the path steps"
|
|
689
|
-
],
|
|
690
|
-
extraTitle: null,
|
|
691
|
-
extra: null,
|
|
692
|
-
api: [["GET", "/JSON/events/GetUserFlowsQuery.json", "getFlows()"]],
|
|
693
|
-
types: [["UserFlowItem", "fromPage, destinations[]"], ["FlowDestination", "toPage, percentage, position"], ["FlowRow", "id, fromPage, destinations (sorted high→low), destinationCount, topDestination, topPercentage, destinationsText"]],
|
|
694
|
-
hooks: "useFlows"
|
|
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
|
+
}
|
|
695
192
|
}
|
|
696
|
-
]
|
|
697
|
-
|
|
698
|
-
[
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
[
|
|
714
|
-
|
|
715
|
-
],
|
|
716
|
-
|
|
717
|
-
[
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
/* @__PURE__ */ e("p", { className: "ujd-lead", children: t.lead }),
|
|
776
|
-
/* @__PURE__ */ a("div", { className: "ujd-callout", children: [
|
|
777
|
-
/* @__PURE__ */ e("strong", { children: "Route" }),
|
|
778
|
-
" ",
|
|
779
|
-
/* @__PURE__ */ e("code", { children: t.route }),
|
|
780
|
-
" · ",
|
|
781
|
-
/* @__PURE__ */ e("strong", { children: "Menu" }),
|
|
782
|
-
" ",
|
|
783
|
-
t.nav
|
|
784
|
-
] }),
|
|
785
|
-
n("what", "What this page is", /* @__PURE__ */ a(j, { children: [
|
|
786
|
-
t.explain.map((s, i) => /* @__PURE__ */ e(R, { as: "p", html: s }, i)),
|
|
787
|
-
/* @__PURE__ */ e("p", { children: /* @__PURE__ */ e("strong", { children: "Questions it helps answer" }) }),
|
|
788
|
-
/* @__PURE__ */ e("ul", { children: t.questions.map((s) => /* @__PURE__ */ e("li", { children: s }, s)) })
|
|
789
|
-
] })),
|
|
790
|
-
n("header", "Header", /* @__PURE__ */ e(R, { as: "p", html: t.header })),
|
|
791
|
-
n("stats", "Stat cards", /* @__PURE__ */ e(k, { head: ["Label", "Icon", "Shows"], rows: t.stats.map((s) => [s[0], P(s[1]), s[2]]) })),
|
|
792
|
-
n("controls", "Controls and behaviour", /* @__PURE__ */ e(O, { items: t.controls })),
|
|
793
|
-
t.columns && n("columns", "Table columns", /* @__PURE__ */ e(k, { head: ["Column", "Field", "Cell renderer"], rows: t.columns.map((s) => [s[0], P(s[1]), P(s[2])]) })),
|
|
794
|
-
t.extra && n("modal", t.extraTitle ?? "Details", /* @__PURE__ */ e(O, { items: t.extra })),
|
|
795
|
-
n("states", "Loading, empty and error states", /* @__PURE__ */ e(O, { items: t.states })),
|
|
796
|
-
n("colors", "Colours on this page", /* @__PURE__ */ a(j, { children: [
|
|
797
|
-
/* @__PURE__ */ e(O, { items: t.colors }),
|
|
798
|
-
/* @__PURE__ */ a("p", { className: "ujd-small", children: [
|
|
799
|
-
"All surface, border and text colours switch with the theme; see ",
|
|
800
|
-
/* @__PURE__ */ e("a", { "data-go": "theming", children: "Dark / light theme" }),
|
|
801
|
-
"."
|
|
802
|
-
] })
|
|
803
|
-
] })),
|
|
804
|
-
n("data", "Data and API", /* @__PURE__ */ a(j, { children: [
|
|
805
|
-
/* @__PURE__ */ e("div", { className: "ujd-table-wrap", children: /* @__PURE__ */ a("table", { className: "ujd-table", children: [
|
|
806
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
|
|
807
|
-
/* @__PURE__ */ e("th", { children: "Method" }),
|
|
808
|
-
/* @__PURE__ */ e("th", { children: "Endpoint" }),
|
|
809
|
-
/* @__PURE__ */ e("th", { children: "Client call" })
|
|
810
|
-
] }) }),
|
|
811
|
-
/* @__PURE__ */ e("tbody", { children: t.api.map((s, i) => /* @__PURE__ */ a("tr", { children: [
|
|
812
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `ujd-verb ${Ae(s[0])}`, children: s[0] }) }),
|
|
813
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: s[1] }) }),
|
|
814
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: s[2] }) })
|
|
815
|
-
] }, i)) })
|
|
816
|
-
] }) }),
|
|
817
|
-
/* @__PURE__ */ e(k, { head: ["Type", "Fields"], rows: t.types.map((s) => [P(s[0]), s[1]]) }),
|
|
818
|
-
/* @__PURE__ */ a("p", { className: "ujd-small", children: [
|
|
819
|
-
"Hooks: ",
|
|
820
|
-
/* @__PURE__ */ e("code", { children: t.hooks })
|
|
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();
|
|
217
|
+
};
|
|
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 };
|
|
233
|
+
}
|
|
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
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ e("button", { className: "xbtn", onClick: o, "aria-label": "Close tutorial", children: "×" })
|
|
246
|
+
] }),
|
|
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" })
|
|
255
|
+
] }),
|
|
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 →" })
|
|
264
|
+
] }),
|
|
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"
|
|
821
272
|
] })
|
|
822
|
-
] })
|
|
273
|
+
] })
|
|
823
274
|
] });
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
{ title: "Shared", links: [["shared-components", "Components"], ["shared-hooks", "Hooks and loading"], ["shared-cells", "Cell renderers"]] },
|
|
845
|
-
{ title: "Theme and design", links: [["theming", "Dark / light theme"], ["theme-switch", "Switching the theme"], ["theme-preview", "Side by side"], ["theme-tokens", "Theme tokens"], ["theme-cards", "Card tokens"], ["theme-colors", "Status colours"], ["theme-typography", "Typography"], ["theme-custom", "Customising"]] },
|
|
846
|
-
{ title: "More", links: [["responsive", "Layout and responsive"], ["accessibility", "Accessibility"], ["faq", "Troubleshooting and FAQ"], ["glossary", "Glossary"]] }
|
|
847
|
-
], []), d = S(() => {
|
|
848
|
-
const o = [["introduction", "Introduction", 0], ["overview", "Overview", 0], ["how-it-works", "How it works", 1], ["quick-start", "Quick start", 0], ["add-a-page", "Adding a new page", 1], ["contents", "Contents", 0]];
|
|
849
|
-
return l.slice(1, 1 + A.length).forEach((h, N) => h.links.forEach((x, D) => o.push([x[0], D === 0 ? h.title : x[1], D === 0 ? 0 : 1]))), o.push(["shared", "Shared pieces", 0], ["shared-components", "Components", 1], ["shared-hooks", "Hooks and loading", 1], ["shared-cells", "Cell renderers", 1]), l[l.length - 2].links.forEach((h, N) => o.push([h[0], h[1], N === 0 ? 0 : 1])), l[l.length - 1].links.forEach((h) => o.push([h[0], h[1], 0])), o;
|
|
850
|
-
}, [l]), u = Y((o) => {
|
|
851
|
-
var N;
|
|
852
|
-
const h = (N = s.current) == null ? void 0 : N.querySelector(`#${CSS.escape(o)}`);
|
|
853
|
-
h && (h.scrollIntoView({ behavior: "smooth", block: "start" }), v(o));
|
|
854
|
-
}, []), c = (o) => {
|
|
855
|
-
const h = o.target.closest("[data-go]");
|
|
856
|
-
h && (o.preventDefault(), u(h.dataset.go));
|
|
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);
|
|
857
295
|
};
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}), { rootMargin: "-10% 0px -80% 0px" });
|
|
864
|
-
return o.querySelectorAll("main [id]").forEach((N) => h.observe(N)), () => h.disconnect();
|
|
865
|
-
}, []), U(() => {
|
|
866
|
-
const o = l.find((h) => h.links.some((N) => N[0] === b));
|
|
867
|
-
o && m((h) => h[o.title] ? h : { ...h, [o.title]: !0 });
|
|
868
|
-
}, [b, l]);
|
|
869
|
-
const w = ({ id: o, children: h }) => /* @__PURE__ */ e("a", { href: `#${o}`, onClick: (N) => {
|
|
870
|
-
N.preventDefault(), u(o);
|
|
871
|
-
}, children: h });
|
|
872
|
-
return /* @__PURE__ */ a("div", { ref: s, className: `ujd ${n ?? ""}`, "data-theme": i, onClick: c, children: [
|
|
873
|
-
/* @__PURE__ */ a("nav", { className: "ujd-nav", children: [
|
|
874
|
-
/* @__PURE__ */ a("a", { className: "ujd-brand", href: "#introduction", onClick: (o) => {
|
|
875
|
-
o.preventDefault(), u("introduction");
|
|
876
|
-
}, children: [
|
|
877
|
-
"⎇ Sonnaga ",
|
|
878
|
-
/* @__PURE__ */ e("span", { children: "Docs" })
|
|
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" })
|
|
879
301
|
] }),
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */ e("a", { className: "ujd-btn ujd-hide-sm", href: r, target: "_blank", rel: "noreferrer", children: "View on GitHub" }),
|
|
882
|
-
/* @__PURE__ */ e("button", { className: "ujd-btn", "aria-label": "Toggle theme", onClick: () => p(i === "dark" ? "light" : "dark"), children: i === "dark" ? "☀️" : "🌙" })
|
|
883
|
-
] })
|
|
302
|
+
/* @__PURE__ */ e("button", { className: "btn", onClick: E, children: "▶ Start tutorial" })
|
|
884
303
|
] }),
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */ e("
|
|
889
|
-
|
|
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" })
|
|
890
309
|
] }),
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
310
|
+
/* @__PURE__ */ e("span", { className: "badge", children: "SAMPLE DATA" })
|
|
311
|
+
] }),
|
|
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))
|
|
899
320
|
] }),
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
/* @__PURE__ */ e("em", { children: "how do people move through the product, and where do they succeed or drop off?" })
|
|
906
|
-
] }),
|
|
907
|
-
/* @__PURE__ */ e(k, { head: ["Page", "Angle", "Unit of data"], rows: fe }),
|
|
908
|
-
/* @__PURE__ */ a("div", { className: "ujd-callout", children: [
|
|
909
|
-
/* @__PURE__ */ e("strong", { children: "Suggested reading order." }),
|
|
910
|
-
" Start with Navigation Analysis to find weak pages, use Paths and User Flows to see how users reach and leave them, then record what you learn in a Journey Map."
|
|
911
|
-
] }),
|
|
912
|
-
/* @__PURE__ */ e("h3", { id: "how-it-works", children: "How it works" }),
|
|
913
|
-
/* @__PURE__ */ a("ol", { children: [
|
|
914
|
-
/* @__PURE__ */ a("li", { children: [
|
|
915
|
-
"The page mounts and its hook (for example ",
|
|
916
|
-
/* @__PURE__ */ e("code", { children: "usePaths" }),
|
|
917
|
-
") requests data through ",
|
|
918
|
-
/* @__PURE__ */ e("code", { children: "journeysApi" }),
|
|
919
|
-
"."
|
|
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" })
|
|
920
326
|
] }),
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
|
|
923
|
-
/* @__PURE__ */ e("
|
|
924
|
-
". The summary feeds the stat cards and the rows feed the table or list."
|
|
327
|
+
/* @__PURE__ */ n("div", { className: "stat w", children: [
|
|
328
|
+
/* @__PURE__ */ e("b", { children: w("WARN") }),
|
|
329
|
+
/* @__PURE__ */ e("span", { children: "Warnings" })
|
|
925
330
|
] }),
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
|
|
928
|
-
/* @__PURE__ */ e("
|
|
929
|
-
|
|
930
|
-
] }),
|
|
931
|
-
/* @__PURE__ */ e("li", { children: "Theme variables decide every colour, so nothing is re-drawn when the theme changes." })
|
|
331
|
+
/* @__PURE__ */ n("div", { className: "stat", children: [
|
|
332
|
+
/* @__PURE__ */ e("b", { children: p.length }),
|
|
333
|
+
/* @__PURE__ */ e("span", { children: "Total lines" })
|
|
334
|
+
] })
|
|
932
335
|
] }),
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
/* @__PURE__ */ e("
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
", ",
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
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))
|
|
948
360
|
] })
|
|
949
361
|
] }),
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */ e("
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
/* @__PURE__ */ e("code", { children: "routes.ts" }),
|
|
959
|
-
" lazy-loads each page behind ",
|
|
960
|
-
/* @__PURE__ */ e("code", { children: "withPageLoader" }),
|
|
961
|
-
". Every page has the same shape: a ",
|
|
962
|
-
/* @__PURE__ */ e("strong", { children: "Header" }),
|
|
963
|
-
", a row of ",
|
|
964
|
-
/* @__PURE__ */ e("strong", { children: "StatCards" }),
|
|
965
|
-
", then the content."
|
|
966
|
-
] }),
|
|
967
|
-
/* @__PURE__ */ e("pre", { children: /* @__PURE__ */ e("code", { children: Se }) }),
|
|
968
|
-
/* @__PURE__ */ e("h3", { id: "add-a-page", children: "Adding a new page" }),
|
|
969
|
-
/* @__PURE__ */ a("ol", { children: [
|
|
970
|
-
/* @__PURE__ */ a("li", { children: [
|
|
971
|
-
"Create ",
|
|
972
|
-
/* @__PURE__ */ e("code", { children: "pages/MyPage/MyPage.tsx" }),
|
|
973
|
-
" and ",
|
|
974
|
-
/* @__PURE__ */ e("code", { children: "index.ts" }),
|
|
975
|
-
"."
|
|
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
|
|
976
370
|
] }),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
"
|
|
979
|
-
|
|
980
|
-
", ",
|
|
981
|
-
/* @__PURE__ */ e("code", { children: "StatCard" }),
|
|
982
|
-
" and ",
|
|
983
|
-
/* @__PURE__ */ e("code", { children: "DataTable" }),
|
|
984
|
-
", and take the wrapper and grid classes from ",
|
|
985
|
-
/* @__PURE__ */ e("code", { children: "userjourneyPage.module.scss" }),
|
|
986
|
-
"."
|
|
371
|
+
/* @__PURE__ */ n("div", { className: "box", children: [
|
|
372
|
+
/* @__PURE__ */ e("b", { children: "What it means" }),
|
|
373
|
+
k.d.meaning
|
|
987
374
|
] }),
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
". Every column's ",
|
|
992
|
-
/* @__PURE__ */ e("code", { children: "cellType" }),
|
|
993
|
-
" must match a renderer name exactly."
|
|
375
|
+
/* @__PURE__ */ n("div", { className: "box", children: [
|
|
376
|
+
/* @__PURE__ */ e("b", { children: "Suggested fix" }),
|
|
377
|
+
k.d.fix
|
|
994
378
|
] }),
|
|
995
|
-
/* @__PURE__ */
|
|
996
|
-
"
|
|
997
|
-
/* @__PURE__ */ e("
|
|
998
|
-
" and the menu item in ",
|
|
999
|
-
/* @__PURE__ */ e("code", { children: "nav.ts" }),
|
|
1000
|
-
". A page missing from either shows a 404 or no menu entry."
|
|
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 })
|
|
1001
382
|
] })
|
|
1002
383
|
] })
|
|
1003
|
-
] })
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
384
|
+
] })
|
|
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: [
|
|
393
|
+
/* @__PURE__ */ e("strong", { children: "POC" }),
|
|
394
|
+
/* @__PURE__ */ e(xe, { items: [{ id: "logs", label: "Logs" }, { id: "feedback", label: "Feedback" }], value: t, onChange: a })
|
|
395
|
+
] }),
|
|
396
|
+
/* @__PURE__ */ e("main", { children: t === "logs" ? /* @__PURE__ */ e(Se, {}) : /* @__PURE__ */ e(ye, {}) })
|
|
397
|
+
] });
|
|
398
|
+
}, G = (t, a) => {
|
|
399
|
+
try {
|
|
400
|
+
return t();
|
|
401
|
+
} catch {
|
|
402
|
+
return a;
|
|
403
|
+
}
|
|
404
|
+
}, ne = (t) => Math.random().toString(36).slice(2, 2 + t), X = () => location.pathname + location.hash, je = ".sj, [data-sj-ignore]", Te = () => ({
|
|
405
|
+
pages: {},
|
|
406
|
+
scrollMs: 0,
|
|
407
|
+
clicks: 0,
|
|
408
|
+
nav: 0,
|
|
409
|
+
heat: {},
|
|
410
|
+
steps: {},
|
|
411
|
+
started: 0,
|
|
412
|
+
completed: 0,
|
|
413
|
+
skipped: 0,
|
|
414
|
+
drops: {},
|
|
415
|
+
log: []
|
|
416
|
+
});
|
|
417
|
+
class Ee {
|
|
418
|
+
constructor(a) {
|
|
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) };
|
|
422
|
+
}
|
|
423
|
+
get cfg() {
|
|
424
|
+
return { ...this.getCfg(), ...this.overrides };
|
|
425
|
+
}
|
|
426
|
+
configure(a) {
|
|
427
|
+
this.overrides = { ...this.overrides, ...a };
|
|
428
|
+
}
|
|
429
|
+
emit() {
|
|
430
|
+
this.version++, this.subs.forEach((a) => a());
|
|
431
|
+
}
|
|
432
|
+
onNavigate(a) {
|
|
433
|
+
return this.navSubs.add(a), () => {
|
|
434
|
+
this.navSubs.delete(a);
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/* ---- data ---- */
|
|
438
|
+
page(a = X()) {
|
|
439
|
+
return this.state.pages[a] || (this.state.pages[a] = { ms: 0, scrollMs: 0, depth: 0, clicks: 0, views: 0, m: {} });
|
|
440
|
+
}
|
|
441
|
+
save() {
|
|
442
|
+
G(() => sessionStorage.setItem("sjState", JSON.stringify({ ...this.state, log: this.state.log.slice(0, 40) })), void 0);
|
|
443
|
+
}
|
|
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;
|
|
447
|
+
}
|
|
448
|
+
track(a, i = {}) {
|
|
449
|
+
const s = { sid: this.sid, uid: this.uid, type: a, t: Date.now(), page: X(), ...i };
|
|
450
|
+
this.q.push(s), this.state.log.unshift(s), this.state.log.length > 60 && this.state.log.pop();
|
|
451
|
+
const o = this.cfg.onEvent;
|
|
452
|
+
o && G(() => o(s), void 0);
|
|
453
|
+
}
|
|
454
|
+
payload(a) {
|
|
455
|
+
const i = this.state;
|
|
456
|
+
return JSON.stringify({
|
|
457
|
+
sessionId: this.sid,
|
|
458
|
+
userId: this.uid,
|
|
459
|
+
tourId: this.cfg.tourId || "default",
|
|
460
|
+
url: location.href,
|
|
461
|
+
viewport: [innerWidth, innerHeight],
|
|
462
|
+
doc: [document.documentElement.scrollWidth, document.documentElement.scrollHeight],
|
|
463
|
+
events: a,
|
|
464
|
+
summary: {
|
|
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
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
flush(a = !1) {
|
|
475
|
+
if (this.save(), !this.q.length) return;
|
|
476
|
+
const i = this.q;
|
|
477
|
+
this.q = [];
|
|
478
|
+
const s = this.cfg;
|
|
479
|
+
if (!s.endpoint) {
|
|
480
|
+
this.state.log.unshift({ type: "flush (dry-run)", t: Date.now(), n: `${i.length} events` });
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
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");
|
|
486
|
+
}).catch(() => {
|
|
487
|
+
this.q = i.concat(this.q).slice(-500);
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
/* ---- tour funnel ---- */
|
|
491
|
+
tourStart(a, i) {
|
|
492
|
+
i || this.state.started++, this.track(i ? "tour_resume" : "tour_start", { steps: a });
|
|
493
|
+
}
|
|
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();
|
|
497
|
+
}
|
|
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();
|
|
500
|
+
}
|
|
501
|
+
/* ---- passive listeners; returns a cleanup function (safe under React StrictMode) ---- */
|
|
502
|
+
attach() {
|
|
503
|
+
const a = this.state;
|
|
504
|
+
this.prev = X();
|
|
505
|
+
let i = performance.now();
|
|
506
|
+
this.booted || (this.booted = !0, this.page().views++, this.track("session_start", { ua: navigator.userAgent.slice(0, 60), ref: document.referrer }));
|
|
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);
|
|
515
|
+
s.push(() => {
|
|
516
|
+
clearInterval(u), clearInterval(T), clearInterval(g);
|
|
517
|
+
}), o(window, "scroll", () => {
|
|
518
|
+
this.scrolling = !0, clearTimeout(this.scrollTimer), this.scrollTimer = window.setTimeout(() => {
|
|
519
|
+
this.scrolling = !1;
|
|
520
|
+
}, 160);
|
|
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 }));
|
|
524
|
+
}));
|
|
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));
|
|
536
|
+
}, !0);
|
|
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()));
|
|
540
|
+
};
|
|
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;
|
|
546
|
+
}, s.push(() => {
|
|
547
|
+
history[d] = l;
|
|
548
|
+
});
|
|
549
|
+
}), o(window, "popstate", N), o(window, "hashchange", N), o(document, "visibilitychange", () => {
|
|
550
|
+
document.hidden && this.flush(!0);
|
|
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());
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
const te = (t) => !!t && t.isConnected && t.getClientRects().length > 0;
|
|
558
|
+
function Ce(t) {
|
|
559
|
+
var s;
|
|
560
|
+
const a = t.dataset, i = (t.getAttribute("aria-label") || t.getAttribute("title") || t.textContent || "").trim().replace(/\s+/g, " ");
|
|
561
|
+
return {
|
|
562
|
+
el: t,
|
|
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),
|
|
565
|
+
placement: a.sjPlace || "auto"
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function Le(t) {
|
|
569
|
+
const a = (s) => !s.page || s.page === location.pathname;
|
|
570
|
+
let i;
|
|
571
|
+
if (t.steps)
|
|
572
|
+
i = t.steps.map((s) => ({
|
|
573
|
+
...s,
|
|
574
|
+
placement: s.placement ?? "auto",
|
|
575
|
+
el: s.target && a(s) ? document.querySelector(s.target) : null,
|
|
576
|
+
wait: !!s.target && a(s)
|
|
577
|
+
}));
|
|
578
|
+
else {
|
|
579
|
+
let s = [...document.querySelectorAll("[data-sj-title],[data-sj-step]")];
|
|
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);
|
|
581
|
+
}
|
|
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;
|
|
583
|
+
}
|
|
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;
|
|
593
|
+
}
|
|
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);
|
|
604
|
+
}
|
|
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(() => {
|
|
610
|
+
if (!t) return;
|
|
611
|
+
k();
|
|
612
|
+
const x = window.setTimeout(k, 380), r = window.setTimeout(k, 700);
|
|
613
|
+
return () => {
|
|
614
|
+
clearTimeout(x), clearTimeout(r);
|
|
615
|
+
};
|
|
616
|
+
}, [t, o, k]), $(() => {
|
|
617
|
+
if (!t) return;
|
|
618
|
+
addEventListener("scroll", O, { passive: !0 }), addEventListener("resize", O);
|
|
619
|
+
const x = T.onNavigate(O);
|
|
620
|
+
return () => {
|
|
621
|
+
removeEventListener("scroll", O), removeEventListener("resize", O), x(), cancelAnimationFrame(m.current);
|
|
622
|
+
};
|
|
623
|
+
}, [t, O, T]), $(() => {
|
|
624
|
+
var x;
|
|
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(
|
|
638
|
+
"div",
|
|
639
|
+
{
|
|
640
|
+
ref: h,
|
|
641
|
+
className: "sj-pop",
|
|
642
|
+
role: "dialog",
|
|
643
|
+
"aria-modal": "true",
|
|
644
|
+
"aria-live": "polite",
|
|
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" },
|
|
647
|
+
children: [
|
|
648
|
+
/* @__PURE__ */ e("i", { className: "sj-arr" }),
|
|
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: "×" })
|
|
655
|
+
] })
|
|
1013
656
|
] }),
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
|
|
1016
|
-
|
|
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" })
|
|
664
|
+
] })
|
|
1017
665
|
] })
|
|
1018
|
-
]
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
666
|
+
]
|
|
667
|
+
}
|
|
668
|
+
)
|
|
669
|
+
] }),
|
|
670
|
+
document.body
|
|
671
|
+
);
|
|
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);
|
|
687
|
+
}
|
|
688
|
+
};
|
|
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);
|
|
693
|
+
};
|
|
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);
|
|
698
|
+
if (!t) throw new Error("useJourney must be used inside <JourneyProvider>");
|
|
699
|
+
return t;
|
|
700
|
+
}
|
|
701
|
+
function Ae() {
|
|
702
|
+
const { tracker: t } = ie();
|
|
703
|
+
return pe(t.subscribe, t.getVersion, t.getVersion), t.state;
|
|
704
|
+
}
|
|
705
|
+
const _ = (t, a) => {
|
|
706
|
+
try {
|
|
707
|
+
return t();
|
|
708
|
+
} catch {
|
|
709
|
+
return a;
|
|
710
|
+
}
|
|
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);
|
|
718
|
+
}, []);
|
|
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 });
|
|
725
|
+
}, [s]);
|
|
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;
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
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) {
|
|
741
|
+
window.setTimeout(() => {
|
|
742
|
+
c.current && r(v, L + 1);
|
|
743
|
+
}, 100);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
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);
|
|
749
|
+
}
|
|
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;
|
|
752
|
+
});
|
|
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();
|
|
771
|
+
};
|
|
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(() => ({
|
|
775
|
+
tracker: s,
|
|
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: [
|
|
789
|
+
a,
|
|
790
|
+
b.length > 0 && /* @__PURE__ */ e(
|
|
791
|
+
Re,
|
|
792
|
+
{
|
|
793
|
+
open: l,
|
|
794
|
+
anim: w,
|
|
795
|
+
theme: N,
|
|
796
|
+
steps: b,
|
|
797
|
+
index: p,
|
|
798
|
+
startLabel: t == null ? void 0 : t.startLabel,
|
|
799
|
+
tracker: s,
|
|
800
|
+
onNext: y,
|
|
801
|
+
onBack: P,
|
|
802
|
+
onSkip: M,
|
|
803
|
+
onTheme: () => d(N === "dark" ? "light" : "dark")
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
A && /* @__PURE__ */ e(Me, { tracker: s })
|
|
807
|
+
] });
|
|
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';
|
|
809
|
+
|
|
810
|
+
<JourneyProvider
|
|
811
|
+
config={{
|
|
812
|
+
endpoint: '/api/journey/events',
|
|
813
|
+
theme: 'auto', // auto | light | dark
|
|
814
|
+
welcome: { title: 'Welcome', body: 'Quick tour?' },
|
|
815
|
+
steps: [
|
|
816
|
+
{ target: '#menu', title: 'Menu',
|
|
817
|
+
body: 'Your navigation.', placement: 'bottom' },
|
|
818
|
+
{ target: '#billing', page: '/billing',
|
|
819
|
+
title: 'Billing', body: 'Next page.' },
|
|
820
|
+
],
|
|
821
|
+
}}
|
|
822
|
+
>
|
|
823
|
+
<App />
|
|
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: [
|
|
828
|
+
/* @__PURE__ */ e("strong", { children: "Journey insights" }),
|
|
829
|
+
/* @__PURE__ */ e("button", { className: "nw-x", onClick: a, "aria-label": "Close", children: "×" })
|
|
830
|
+
] }),
|
|
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)) }),
|
|
837
|
+
/* @__PURE__ */ e("h4", { children: "Time per page" }),
|
|
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),
|
|
842
|
+
" · ",
|
|
843
|
+
p.depth,
|
|
844
|
+
"% deep"
|
|
845
|
+
] })
|
|
846
|
+
] }, m)),
|
|
847
|
+
/* @__PURE__ */ e("h4", { children: "Walkthrough funnel and drop-offs" }),
|
|
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,
|
|
852
|
+
". ",
|
|
853
|
+
p.title
|
|
1035
854
|
] }),
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
|
|
1038
|
-
"
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
855
|
+
/* @__PURE__ */ n("span", { children: [
|
|
856
|
+
p.views,
|
|
857
|
+
"× · ",
|
|
858
|
+
ee(p.ms),
|
|
859
|
+
o.drops[+m] ? /* @__PURE__ */ n(V, { children: [
|
|
860
|
+
" · ",
|
|
861
|
+
/* @__PURE__ */ n("b", { className: "nw-warn", children: [
|
|
862
|
+
o.drops[+m],
|
|
863
|
+
" dropped"
|
|
864
|
+
] })
|
|
865
|
+
] }) : null
|
|
1045
866
|
] })
|
|
1046
867
|
] }),
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
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: [
|
|
870
|
+
/* @__PURE__ */ e("span", { children: "No tour data yet" }),
|
|
871
|
+
/* @__PURE__ */ e("span", {})
|
|
872
|
+
] }),
|
|
873
|
+
/* @__PURE__ */ e("h4", { children: "Heatmap" }),
|
|
874
|
+
/* @__PURE__ */ e("button", { className: "nw-btn", onClick: i, children: "Toggle heatmap overlay" })
|
|
875
|
+
] }),
|
|
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 || ""),
|
|
880
|
+
" · ",
|
|
881
|
+
new Date(m.t).toLocaleTimeString()
|
|
882
|
+
] })
|
|
883
|
+
] }, `${m.t}-${p}`)),
|
|
884
|
+
u === "c" && /* @__PURE__ */ n(V, { children: [
|
|
885
|
+
/* @__PURE__ */ e("h4", { children: "Install in a React app" }),
|
|
886
|
+
/* @__PURE__ */ e("pre", { children: Fe }),
|
|
887
|
+
/* @__PURE__ */ n("p", { children: [
|
|
888
|
+
"No ",
|
|
889
|
+
/* @__PURE__ */ e("code", { children: "steps" }),
|
|
890
|
+
"? Add ",
|
|
891
|
+
/* @__PURE__ */ e("code", { children: "data-sj-title" }),
|
|
892
|
+
", ",
|
|
893
|
+
/* @__PURE__ */ e("code", { children: "data-sj-body" }),
|
|
894
|
+
", ",
|
|
895
|
+
/* @__PURE__ */ e("code", { children: "data-sj-place" }),
|
|
896
|
+
" and ",
|
|
897
|
+
/* @__PURE__ */ e("code", { children: "data-sj-step" }),
|
|
898
|
+
" to any element, or it falls back to the page’s header, nav, sections and footer. A step with ",
|
|
899
|
+
/* @__PURE__ */ e("code", { children: "page" }),
|
|
900
|
+
" continues the tour after navigating."
|
|
901
|
+
] }),
|
|
902
|
+
/* @__PURE__ */ e("h4", { children: "Backend endpoint" }),
|
|
903
|
+
/* @__PURE__ */ e("input", { placeholder: "/api/journey/events", onChange: (m) => s({ endpoint: m.target.value.trim() }) }),
|
|
904
|
+
/* @__PURE__ */ n("p", { children: [
|
|
905
|
+
"Run ",
|
|
906
|
+
/* @__PURE__ */ e("code", { children: "node server.js" }),
|
|
907
|
+
", open ",
|
|
908
|
+
/* @__PURE__ */ e("code", { children: "http://localhost:4000/?api=/api/journey/events" }),
|
|
909
|
+
". Without an endpoint it runs in dry-run mode and the Events tab shows each flush."
|
|
910
|
+
] })
|
|
911
|
+
] })
|
|
912
|
+
] });
|
|
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: [
|
|
918
|
+
/* @__PURE__ */ e("i", { children: "◆" }),
|
|
919
|
+
" Northwind"
|
|
920
|
+
] }),
|
|
921
|
+
/* @__PURE__ */ n("nav", { className: "nw-nav", children: [
|
|
922
|
+
/* @__PURE__ */ e("a", { href: "#features", children: "Features" }),
|
|
923
|
+
/* @__PURE__ */ e("a", { href: "#pricing", children: "Pricing" }),
|
|
924
|
+
/* @__PURE__ */ e("a", { href: "#contact", children: "Contact" })
|
|
925
|
+
] }),
|
|
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" })
|
|
927
|
+
] }),
|
|
928
|
+
/* @__PURE__ */ n("main", { className: "nw-wrap", children: [
|
|
929
|
+
/* @__PURE__ */ n("section", { className: "nw-hero", children: [
|
|
930
|
+
/* @__PURE__ */ e("h1", { children: "Ship products people actually finish onboarding." }),
|
|
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." }),
|
|
932
|
+
/* @__PURE__ */ n("div", { className: "nw-acts", children: [
|
|
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" }),
|
|
934
|
+
/* @__PURE__ */ e("a", { className: "nw-btn", href: "#features", children: "See features" })
|
|
935
|
+
] })
|
|
936
|
+
] }),
|
|
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: [
|
|
938
|
+
/* @__PURE__ */ e("h2", { children: "Features" }),
|
|
939
|
+
/* @__PURE__ */ n("div", { className: "nw-grid", children: [
|
|
940
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
941
|
+
/* @__PURE__ */ e("h3", { children: "Live analytics" }),
|
|
942
|
+
/* @__PURE__ */ e("p", { children: "Page time, scroll depth and clicks, collected as people browse." })
|
|
1079
943
|
] }),
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
|
|
1082
|
-
/* @__PURE__ */ e("
|
|
1083
|
-
" must be imported once in the global entry. Every card class then reads these variables."
|
|
944
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
945
|
+
/* @__PURE__ */ e("h3", { children: "Heatmaps" }),
|
|
946
|
+
/* @__PURE__ */ e("p", { children: "See where attention gathers and where it never reaches." })
|
|
1084
947
|
] }),
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
|
|
1087
|
-
/* @__PURE__ */ e("
|
|
1088
|
-
|
|
948
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
949
|
+
/* @__PURE__ */ e("h3", { children: "Guided tours" }),
|
|
950
|
+
/* @__PURE__ */ e("p", { children: "Spotlight any element with a popup that repositions itself." })
|
|
951
|
+
] })
|
|
952
|
+
] })
|
|
953
|
+
] }),
|
|
954
|
+
/* @__PURE__ */ n("section", { id: "pricing", children: [
|
|
955
|
+
/* @__PURE__ */ e("h2", { children: "Pricing" }),
|
|
956
|
+
/* @__PURE__ */ n("div", { className: "nw-grid", children: [
|
|
957
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
958
|
+
/* @__PURE__ */ e("h3", { children: "Starter" }),
|
|
959
|
+
/* @__PURE__ */ e("div", { className: "nw-big", children: "$0" }),
|
|
960
|
+
/* @__PURE__ */ e("p", { children: "For side projects." })
|
|
1089
961
|
] }),
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
/* @__PURE__ */ a("p", { children: [
|
|
1095
|
-
/* @__PURE__ */ e("code", { children: "modules/common/typography.css" }),
|
|
1096
|
-
" defines one type scale and font stack for all pages (Inter, then system fonts; monospace for code)."
|
|
962
|
+
/* @__PURE__ */ n("div", { className: "nw-card", children: [
|
|
963
|
+
/* @__PURE__ */ e("h3", { children: "Team" }),
|
|
964
|
+
/* @__PURE__ */ e("div", { className: "nw-big", children: "$29" }),
|
|
965
|
+
/* @__PURE__ */ e("p", { children: "For growing teams." })
|
|
1097
966
|
] }),
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
/* @__PURE__ */ e("
|
|
1102
|
-
/* @__PURE__ */ a("li", { children: [
|
|
1103
|
-
"Use ",
|
|
1104
|
-
/* @__PURE__ */ e("code", { children: "color-mix" }),
|
|
1105
|
-
" with ",
|
|
1106
|
-
/* @__PURE__ */ e("code", { children: "--th-ov-base" }),
|
|
1107
|
-
" for subtle overlays so they work in both themes."
|
|
1108
|
-
] }),
|
|
1109
|
-
/* @__PURE__ */ e("li", { children: "Check both themes after every change: text contrast, borders on cards and the selected-row tint." }),
|
|
1110
|
-
/* @__PURE__ */ a("li", { children: [
|
|
1111
|
-
"For a client brand colour, replace the accent ",
|
|
1112
|
-
/* @__PURE__ */ e("code", { children: "#7c3aed" }),
|
|
1113
|
-
" in one place (in the Bootstrap pages, ",
|
|
1114
|
-
/* @__PURE__ */ e("code", { children: "--bs-primary" }),
|
|
1115
|
-
" and ",
|
|
1116
|
-
/* @__PURE__ */ e("code", { children: "--acc" }),
|
|
1117
|
-
")."
|
|
1118
|
-
] })
|
|
1119
|
-
] })
|
|
1120
|
-
] }),
|
|
1121
|
-
/* @__PURE__ */ a("section", { id: "responsive", children: [
|
|
1122
|
-
/* @__PURE__ */ e("h2", { children: "Layout and responsive behaviour" }),
|
|
1123
|
-
/* @__PURE__ */ a("ul", { children: [
|
|
1124
|
-
/* @__PURE__ */ e("li", { children: "The page wrapper is a column with a 16px gap and 20px padding." }),
|
|
1125
|
-
/* @__PURE__ */ e("li", { children: "Stat cards use an auto-fit grid, at least 210px wide each, so they wrap on small screens." }),
|
|
1126
|
-
/* @__PURE__ */ e("li", { children: "The table and the optional detail drawer sit side by side; the 320px drawer only appears at 1280px and wider." }),
|
|
1127
|
-
/* @__PURE__ */ e("li", { children: "This documentation hides the right-hand “On this page” list below 1200px and the sidebar below 992px." }),
|
|
1128
|
-
/* @__PURE__ */ e("li", { children: "Wide tables scroll inside their own container so the page itself never scrolls sideways." })
|
|
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: [
|
|
968
|
+
/* @__PURE__ */ e("h3", { children: "Scale" }),
|
|
969
|
+
/* @__PURE__ */ e("div", { className: "nw-big", children: "$99" }),
|
|
970
|
+
/* @__PURE__ */ e("p", { children: "Unlimited journeys and exports." })
|
|
1129
971
|
] })
|
|
1130
|
-
] })
|
|
1131
|
-
/* @__PURE__ */ a("section", { id: "accessibility", children: [
|
|
1132
|
-
/* @__PURE__ */ e("h2", { children: "Accessibility" }),
|
|
1133
|
-
/* @__PURE__ */ a("ul", { children: [
|
|
1134
|
-
/* @__PURE__ */ a("li", { children: [
|
|
1135
|
-
"Table / List toggle buttons expose ",
|
|
1136
|
-
/* @__PURE__ */ e("code", { children: "aria-pressed" }),
|
|
1137
|
-
"."
|
|
1138
|
-
] }),
|
|
1139
|
-
/* @__PURE__ */ a("li", { children: [
|
|
1140
|
-
"Icon-only buttons such as delete and refresh have an ",
|
|
1141
|
-
/* @__PURE__ */ e("code", { children: "aria-label" }),
|
|
1142
|
-
" and a tooltip."
|
|
1143
|
-
] }),
|
|
1144
|
-
/* @__PURE__ */ e("li", { children: "Meaning is never carried by colour alone: bounce and share also show a percentage, and trend also uses an icon." }),
|
|
1145
|
-
/* @__PURE__ */ e("li", { children: "Full paths are available in tooltips where the UI shows short step names." })
|
|
1146
|
-
] })
|
|
1147
|
-
] }),
|
|
1148
|
-
/* @__PURE__ */ a("section", { id: "faq", children: [
|
|
1149
|
-
/* @__PURE__ */ e("h2", { children: "Troubleshooting and FAQ" }),
|
|
1150
|
-
/* @__PURE__ */ e(k, { head: ["Question", "Answer"], rows: Te })
|
|
1151
|
-
] }),
|
|
1152
|
-
/* @__PURE__ */ a("section", { id: "glossary", children: [
|
|
1153
|
-
/* @__PURE__ */ e("h2", { children: "Glossary" }),
|
|
1154
|
-
/* @__PURE__ */ e(k, { head: ["Term", "Meaning"], rows: xe })
|
|
1155
|
-
] }),
|
|
1156
|
-
/* @__PURE__ */ e("div", { style: { height: "30vh" } })
|
|
972
|
+
] })
|
|
1157
973
|
] }),
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */ e("
|
|
1160
|
-
/* @__PURE__ */ e("
|
|
974
|
+
/* @__PURE__ */ n("section", { id: "contact", children: [
|
|
975
|
+
/* @__PURE__ */ e("h2", { children: "Contact" }),
|
|
976
|
+
/* @__PURE__ */ e("div", { className: "nw-card", children: /* @__PURE__ */ e("p", { children: "hello@northwind.example: we reply within a day." }) })
|
|
1161
977
|
] })
|
|
1162
|
-
] })
|
|
978
|
+
] }),
|
|
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" }),
|
|
980
|
+
/* @__PURE__ */ n("div", { className: "nw-dock", "data-sj-ignore": !0, children: [
|
|
981
|
+
/* @__PURE__ */ e("button", { onClick: t, children: "▶ Tour" }),
|
|
982
|
+
/* @__PURE__ */ e("button", { onClick: () => a(i === "dark" ? "light" : "dark"), children: "◐ Theme" }),
|
|
983
|
+
/* @__PURE__ */ e("button", { onClick: () => o((u) => !u), children: "▤ Insights" })
|
|
984
|
+
] }),
|
|
985
|
+
/* @__PURE__ */ e(Oe, { open: s, onClose: () => o(!1) })
|
|
1163
986
|
] });
|
|
1164
|
-
}
|
|
987
|
+
}, He = ({ endpoint: t, config: a }) => /* @__PURE__ */ e(
|
|
988
|
+
Ie,
|
|
989
|
+
{
|
|
990
|
+
config: {
|
|
991
|
+
endpoint: t ?? new URLSearchParams(location.search).get("api") ?? "",
|
|
992
|
+
theme: "auto",
|
|
993
|
+
welcome: { title: "Welcome to Northwind", body: "Take a 30-second tour of the key parts of this site. Skip any time, or use the arrow keys." },
|
|
994
|
+
outro: { title: "You’re all set", body: "Open Insights to see the time, scroll depth, clicks and heatmap this session just generated." },
|
|
995
|
+
...a
|
|
996
|
+
},
|
|
997
|
+
children: /* @__PURE__ */ e($e, {})
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1165
1000
|
export {
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
J as npsScores,
|
|
1175
|
-
ae as pathStats,
|
|
1176
|
-
G as simulate,
|
|
1177
|
-
oe as stageReach
|
|
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
|
|
1178
1009
|
};
|