@jmp-technologies/analytics 0.1.25 → 0.1.27
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 +43 -0
- package/bin/jmp-init.mjs +34 -0
- package/dist/astro/client.cjs +103 -0
- package/dist/astro/client.cjs.map +1 -1
- package/dist/astro/client.d.cts +2 -2
- package/dist/astro/client.d.ts +2 -2
- package/dist/astro/client.js +5 -3
- package/dist/astro/client.js.map +1 -1
- package/dist/astro/content.cjs +271 -1
- package/dist/astro/content.cjs.map +1 -1
- package/dist/astro/content.d.cts +9 -3
- package/dist/astro/content.d.ts +9 -3
- package/dist/astro/content.js +10 -3
- package/dist/astro/integration.cjs +56 -10
- package/dist/astro/integration.cjs.map +1 -1
- package/dist/astro/integration.js +4 -3
- package/dist/astro/integration.js.map +1 -1
- package/dist/astro/middleware.cjs.map +1 -1
- package/dist/astro/middleware.d.cts +2 -2
- package/dist/astro/middleware.d.ts +2 -2
- package/dist/astro/middleware.js +2 -2
- package/dist/astro/register.cjs +56 -10
- package/dist/astro/register.cjs.map +1 -1
- package/dist/astro/register.js +4 -3
- package/dist/{chunk-MOX7RJUU.js → chunk-A4RRTY5D.js} +1 -1
- package/dist/{chunk-MOX7RJUU.js.map → chunk-A4RRTY5D.js.map} +1 -1
- package/dist/{chunk-L67PVZYL.js → chunk-DNYJF7BG.js} +3 -24
- package/dist/chunk-DNYJF7BG.js.map +1 -0
- package/dist/{chunk-5GORAM7J.js → chunk-FNWE2DT5.js} +2 -2
- package/dist/{chunk-7MLPSL6T.js → chunk-HODG4NJQ.js} +2 -2
- package/dist/{chunk-OLWCYWVB.js → chunk-KZ4WVDGL.js} +3 -3
- package/dist/{chunk-AJ33NQVZ.js → chunk-PG3IOI5O.js} +42 -3
- package/dist/chunk-PG3IOI5O.js.map +1 -0
- package/dist/chunk-TCZ6TC2L.js +149 -0
- package/dist/chunk-TCZ6TC2L.js.map +1 -0
- package/dist/{chunk-VRDPVKAN.js → chunk-UVYF33XE.js} +213 -157
- package/dist/chunk-UVYF33XE.js.map +1 -0
- package/dist/chunk-YCVHRMM6.js +28 -0
- package/dist/chunk-YCVHRMM6.js.map +1 -0
- package/dist/{create-jmp-analytics-ClLOMb9p.d.cts → create-jmp-analytics-D4Qw_d6o.d.cts} +1 -1
- package/dist/{create-jmp-analytics-COxo3-yg.d.ts → create-jmp-analytics-DpG5Hdl5.d.ts} +1 -1
- package/dist/index.cjs +213 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -7
- package/dist/index.d.ts +22 -7
- package/dist/index.js +19 -3
- package/dist/next/content.cjs +274 -1
- package/dist/next/content.cjs.map +1 -1
- package/dist/next/content.d.cts +7 -4
- package/dist/next/content.d.ts +7 -4
- package/dist/next/content.js +13 -3
- package/dist/next/content.js.map +1 -1
- package/dist/next/instrumentation.cjs +56 -10
- package/dist/next/instrumentation.cjs.map +1 -1
- package/dist/next/instrumentation.js +3 -2
- package/dist/next/instrumentation.js.map +1 -1
- package/dist/next/landing-capture-script-server.cjs +61 -0
- package/dist/next/landing-capture-script-server.cjs.map +1 -0
- package/dist/next/landing-capture-script-server.d.cts +14 -0
- package/dist/next/landing-capture-script-server.d.ts +14 -0
- package/dist/next/landing-capture-script-server.js +8 -0
- package/dist/next/landing-capture-script-server.js.map +1 -0
- package/dist/next/landing-pages.cjs +659 -0
- package/dist/next/landing-pages.cjs.map +1 -0
- package/dist/next/landing-pages.d.cts +104 -0
- package/dist/next/landing-pages.d.ts +104 -0
- package/dist/next/landing-pages.js +299 -0
- package/dist/next/landing-pages.js.map +1 -0
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.cts +2 -2
- package/dist/next/middleware.d.ts +2 -2
- package/dist/next/middleware.js +2 -2
- package/dist/next/site-root-server.cjs +159 -23
- package/dist/next/site-root-server.cjs.map +1 -1
- package/dist/next/site-root-server.js +9 -4
- package/dist/next/site-root-server.js.map +1 -1
- package/dist/next.cjs +152 -70
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +7 -15
- package/dist/next.d.ts +7 -15
- package/dist/next.js +7 -7
- package/dist/react.cjs +103 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +4 -3
- package/dist/{site-config-BSMVyUjk.d.ts → site-config-CJqYnZm7.d.cts} +6 -3
- package/dist/{site-config-8TTHIW6w.d.cts → site-config-UTzDG-UG.d.ts} +6 -3
- package/dist/{track-page-view-DtxbdM5q.d.ts → track-page-view-CMAqyhD_.d.ts} +1 -1
- package/dist/{track-page-view-BweavmXz.d.cts → track-page-view-tX0Magkd.d.cts} +1 -1
- package/dist/{types-Bk0ST1aH.d.ts → types-B-111Wht.d.cts} +52 -5
- package/dist/{types-Bk0ST1aH.d.cts → types-B-111Wht.d.ts} +52 -5
- package/docs/astro-integration.md +1 -1
- package/package.json +16 -2
- package/dist/chunk-AJ33NQVZ.js.map +0 -1
- package/dist/chunk-L67PVZYL.js.map +0 -1
- package/dist/chunk-VRDPVKAN.js.map +0 -1
- /package/dist/{chunk-5GORAM7J.js.map → chunk-FNWE2DT5.js.map} +0 -0
- /package/dist/{chunk-7MLPSL6T.js.map → chunk-HODG4NJQ.js.map} +0 -0
- /package/dist/{chunk-OLWCYWVB.js.map → chunk-KZ4WVDGL.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3,34 +3,43 @@ import {
|
|
|
3
3
|
DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS,
|
|
4
4
|
JMP_ANALYTICS_SDK_VERSION,
|
|
5
5
|
JMP_TRACKING_CONSENT_STORAGE_KEY,
|
|
6
|
-
buildLandingCaptureInlineScript,
|
|
7
6
|
classifyContactHref,
|
|
8
7
|
createJmpAnalytics,
|
|
9
8
|
createJmpContentClient,
|
|
10
9
|
createJmpContentClientFromServerEnv,
|
|
10
|
+
getDiscoveredContentWrappers,
|
|
11
11
|
getJmpBlogPost,
|
|
12
12
|
getJmpBlogPosts,
|
|
13
13
|
getJmpBrowserAnalyticsConfigFromEnv,
|
|
14
14
|
getJmpFaqs,
|
|
15
|
+
getJmpLandingPageDetail,
|
|
16
|
+
getJmpLandingPageSitemap,
|
|
17
|
+
getJmpLandingPages,
|
|
15
18
|
getJmpRobotsTxt,
|
|
16
19
|
getJmpServerContentConfigFromEnv,
|
|
17
20
|
getJmpSiteProfile,
|
|
18
21
|
getJmpTrustBundle,
|
|
19
22
|
getOrCreateJmpAnalyticsFromBrowserEnv,
|
|
23
|
+
inferTrustWrapperSlots,
|
|
20
24
|
isJmpBrowserAnalyticsEnvConfigured,
|
|
21
25
|
isJmpServerContentEnvConfigured,
|
|
22
26
|
isJmpTrackingConsentGranted,
|
|
27
|
+
markContentWrapper,
|
|
23
28
|
registerJmpContentWrappers,
|
|
29
|
+
resetContentWrapperDiscoveryForTests,
|
|
24
30
|
setJmpTrackingConsent,
|
|
25
31
|
subscribeJmpTrackingConsent
|
|
26
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-UVYF33XE.js";
|
|
33
|
+
import {
|
|
34
|
+
buildLandingCaptureInlineScript
|
|
35
|
+
} from "./chunk-TCZ6TC2L.js";
|
|
27
36
|
import {
|
|
28
37
|
defineJmpSite,
|
|
29
38
|
getJmpContentConfig,
|
|
30
39
|
getJmpSiteDefinition,
|
|
31
40
|
readJmpPublicEnvFromProcess,
|
|
32
41
|
trackJmpServerPageView
|
|
33
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-A4RRTY5D.js";
|
|
34
43
|
export {
|
|
35
44
|
BOOKING_LINK_HOSTS,
|
|
36
45
|
DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS,
|
|
@@ -42,22 +51,29 @@ export {
|
|
|
42
51
|
createJmpContentClient,
|
|
43
52
|
createJmpContentClientFromServerEnv,
|
|
44
53
|
defineJmpSite,
|
|
54
|
+
getDiscoveredContentWrappers,
|
|
45
55
|
getJmpBlogPost,
|
|
46
56
|
getJmpBlogPosts,
|
|
47
57
|
getJmpBrowserAnalyticsConfigFromEnv,
|
|
48
58
|
getJmpContentConfig,
|
|
49
59
|
getJmpFaqs,
|
|
60
|
+
getJmpLandingPageDetail,
|
|
61
|
+
getJmpLandingPageSitemap,
|
|
62
|
+
getJmpLandingPages,
|
|
50
63
|
getJmpRobotsTxt,
|
|
51
64
|
getJmpServerContentConfigFromEnv,
|
|
52
65
|
getJmpSiteDefinition,
|
|
53
66
|
getJmpSiteProfile,
|
|
54
67
|
getJmpTrustBundle,
|
|
55
68
|
getOrCreateJmpAnalyticsFromBrowserEnv,
|
|
69
|
+
inferTrustWrapperSlots,
|
|
56
70
|
isJmpBrowserAnalyticsEnvConfigured,
|
|
57
71
|
isJmpServerContentEnvConfigured,
|
|
58
72
|
isJmpTrackingConsentGranted,
|
|
73
|
+
markContentWrapper,
|
|
59
74
|
readJmpPublicEnvFromProcess,
|
|
60
75
|
registerJmpContentWrappers,
|
|
76
|
+
resetContentWrapperDiscoveryForTests,
|
|
61
77
|
setJmpTrackingConsent,
|
|
62
78
|
subscribeJmpTrackingConsent,
|
|
63
79
|
trackJmpServerPageView
|
package/dist/next/content.cjs
CHANGED
|
@@ -28,6 +28,9 @@ __export(content_exports, {
|
|
|
28
28
|
loadBlogPosts: () => loadBlogPosts2,
|
|
29
29
|
loadFaqBySlug: () => loadFaqBySlug2,
|
|
30
30
|
loadFaqs: () => loadFaqs2,
|
|
31
|
+
loadLandingPageDetail: () => loadLandingPageDetail2,
|
|
32
|
+
loadLandingPageSitemap: () => loadLandingPageSitemap2,
|
|
33
|
+
loadLandingPages: () => loadLandingPages2,
|
|
31
34
|
loadSiteProfile: () => loadSiteProfile2,
|
|
32
35
|
loadTrustBundle: () => loadTrustBundle2,
|
|
33
36
|
resolveSiteContact: () => resolveSiteContact2
|
|
@@ -38,6 +41,9 @@ var import_react = require("react");
|
|
|
38
41
|
// src/landing-capture.ts
|
|
39
42
|
var LANDING_REFERER_COOKIE_MAX_AGE_SEC = 30 * 60;
|
|
40
43
|
|
|
44
|
+
// src/constants.ts
|
|
45
|
+
var JMP_ANALYTICS_SDK_VERSION = "0.1.26";
|
|
46
|
+
|
|
41
47
|
// src/http.ts
|
|
42
48
|
function responseLooksLikeHtml(body) {
|
|
43
49
|
const s = body.trimStart();
|
|
@@ -94,12 +100,136 @@ async function getContentText(config, path) {
|
|
|
94
100
|
return text;
|
|
95
101
|
}
|
|
96
102
|
|
|
103
|
+
// src/content/wrapper-discovery.ts
|
|
104
|
+
var WRAPPER_SLOT_ORDER = [
|
|
105
|
+
"blog",
|
|
106
|
+
"faq",
|
|
107
|
+
"contact",
|
|
108
|
+
"trust",
|
|
109
|
+
"trust.summary",
|
|
110
|
+
"trust.testimonials",
|
|
111
|
+
"trust.reviews",
|
|
112
|
+
"trust.stats",
|
|
113
|
+
"trust.logos",
|
|
114
|
+
"trust.credentials"
|
|
115
|
+
];
|
|
116
|
+
var discovered = /* @__PURE__ */ new Set();
|
|
117
|
+
var syncTimer = null;
|
|
118
|
+
var pendingSyncConfig = null;
|
|
119
|
+
var reportedDedupeKeys = /* @__PURE__ */ new Set();
|
|
120
|
+
var syncHandler = null;
|
|
121
|
+
function markContentWrapper(slot) {
|
|
122
|
+
const normalized = slot.trim().toLowerCase();
|
|
123
|
+
if (!normalized) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
discovered.add(normalized);
|
|
127
|
+
}
|
|
128
|
+
function markTrustBundleWrappers(bundle) {
|
|
129
|
+
for (const slot of inferTrustWrapperSlots(bundle)) {
|
|
130
|
+
discovered.add(slot);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function inferTrustWrapperSlots(bundle) {
|
|
134
|
+
const slots = /* @__PURE__ */ new Set(["trust"]);
|
|
135
|
+
const { summary, testimonials, stats, logos, credentials } = bundle;
|
|
136
|
+
const hasSummary = summary.google_rating != null || summary.google_review_count != null || Boolean(summary.google_reviews_url?.trim()) || Boolean(summary.yelp_url?.trim()) || Boolean(summary.trustpilot_url?.trim()) || Boolean(summary.disclaimer?.trim());
|
|
137
|
+
if (hasSummary) {
|
|
138
|
+
slots.add("trust.summary");
|
|
139
|
+
}
|
|
140
|
+
let hasTestimonials = false;
|
|
141
|
+
let hasReviews = false;
|
|
142
|
+
for (const item of testimonials) {
|
|
143
|
+
const bucket = item.placement?.trim().toLowerCase();
|
|
144
|
+
if (bucket === "reviews") {
|
|
145
|
+
hasReviews = true;
|
|
146
|
+
} else {
|
|
147
|
+
hasTestimonials = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (hasTestimonials) {
|
|
151
|
+
slots.add("trust.testimonials");
|
|
152
|
+
}
|
|
153
|
+
if (hasReviews) {
|
|
154
|
+
slots.add("trust.reviews");
|
|
155
|
+
}
|
|
156
|
+
if (stats.length > 0) {
|
|
157
|
+
slots.add("trust.stats");
|
|
158
|
+
}
|
|
159
|
+
if (logos.length > 0) {
|
|
160
|
+
slots.add("trust.logos");
|
|
161
|
+
}
|
|
162
|
+
if (credentials.length > 0) {
|
|
163
|
+
slots.add("trust.credentials");
|
|
164
|
+
}
|
|
165
|
+
return sortWrapperSlots([...slots]);
|
|
166
|
+
}
|
|
167
|
+
function getDiscoveredContentWrappers() {
|
|
168
|
+
return sortWrapperSlots([...discovered]);
|
|
169
|
+
}
|
|
170
|
+
function resolveContentWrappersForReport(config) {
|
|
171
|
+
const explicit = config.contentWrappers ?? [];
|
|
172
|
+
const auto = getDiscoveredContentWrappers();
|
|
173
|
+
if (config.contentWrapperMode === "manual") {
|
|
174
|
+
return sortWrapperSlots([...explicit]);
|
|
175
|
+
}
|
|
176
|
+
if (config.contentWrapperMode === "explicit-only") {
|
|
177
|
+
return sortWrapperSlots([...explicit]);
|
|
178
|
+
}
|
|
179
|
+
const merged = /* @__PURE__ */ new Set([...explicit, ...auto]);
|
|
180
|
+
return sortWrapperSlots([...merged]);
|
|
181
|
+
}
|
|
182
|
+
function hasReportedContentWrappers(dedupeKey) {
|
|
183
|
+
return reportedDedupeKeys.has(dedupeKey);
|
|
184
|
+
}
|
|
185
|
+
function rememberReportedContentWrappers(dedupeKey) {
|
|
186
|
+
reportedDedupeKeys.add(dedupeKey);
|
|
187
|
+
}
|
|
188
|
+
function setContentWrapperSyncHandler(handler) {
|
|
189
|
+
syncHandler = handler;
|
|
190
|
+
}
|
|
191
|
+
function scheduleContentWrapperSync(config) {
|
|
192
|
+
if (!syncHandler) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
pendingSyncConfig = config;
|
|
196
|
+
if (syncTimer) {
|
|
197
|
+
clearTimeout(syncTimer);
|
|
198
|
+
}
|
|
199
|
+
syncTimer = setTimeout(() => {
|
|
200
|
+
syncTimer = null;
|
|
201
|
+
const cfg = pendingSyncConfig;
|
|
202
|
+
pendingSyncConfig = null;
|
|
203
|
+
if (!cfg || !syncHandler) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
void syncHandler(cfg).catch(() => {
|
|
207
|
+
});
|
|
208
|
+
}, 750);
|
|
209
|
+
}
|
|
210
|
+
function sortWrapperSlots(slots) {
|
|
211
|
+
const order = new Map(WRAPPER_SLOT_ORDER.map((slot, index) => [slot, index]));
|
|
212
|
+
return [...new Set(slots)].sort((a, b) => {
|
|
213
|
+
const ai = order.get(a) ?? 999;
|
|
214
|
+
const bi = order.get(b) ?? 999;
|
|
215
|
+
if (ai !== bi) {
|
|
216
|
+
return ai - bi;
|
|
217
|
+
}
|
|
218
|
+
return a.localeCompare(b);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
97
222
|
// src/content/api.ts
|
|
223
|
+
function afterContentWrapperUse(config) {
|
|
224
|
+
scheduleContentWrapperSync(config);
|
|
225
|
+
}
|
|
98
226
|
async function getJmpBlogPosts(config) {
|
|
99
227
|
const data = await getContent(
|
|
100
228
|
config,
|
|
101
229
|
"/api/content/blog"
|
|
102
230
|
);
|
|
231
|
+
markContentWrapper("blog");
|
|
232
|
+
afterContentWrapperUse(config);
|
|
103
233
|
return data.posts;
|
|
104
234
|
}
|
|
105
235
|
async function getJmpBlogPost(config, slug) {
|
|
@@ -108,6 +238,8 @@ async function getJmpBlogPost(config, slug) {
|
|
|
108
238
|
config,
|
|
109
239
|
`/api/content/blog/${encodeURIComponent(slug)}`
|
|
110
240
|
);
|
|
241
|
+
markContentWrapper("blog");
|
|
242
|
+
afterContentWrapperUse(config);
|
|
111
243
|
return data.post;
|
|
112
244
|
} catch (error) {
|
|
113
245
|
if (error instanceof Error && error.message.includes("HTTP 404")) {
|
|
@@ -121,18 +253,120 @@ async function getJmpFaqs(config) {
|
|
|
121
253
|
config,
|
|
122
254
|
"/api/content/faqs"
|
|
123
255
|
);
|
|
256
|
+
markContentWrapper("faq");
|
|
257
|
+
afterContentWrapperUse(config);
|
|
124
258
|
return data.faqs;
|
|
125
259
|
}
|
|
260
|
+
async function getJmpLandingPages(config, filters) {
|
|
261
|
+
const params = new URLSearchParams();
|
|
262
|
+
if (filters?.kind) {
|
|
263
|
+
params.set("kind", filters.kind);
|
|
264
|
+
}
|
|
265
|
+
if (filters?.locale) {
|
|
266
|
+
params.set("locale", filters.locale);
|
|
267
|
+
}
|
|
268
|
+
const query = params.toString();
|
|
269
|
+
const data = await getContent(
|
|
270
|
+
config,
|
|
271
|
+
`/api/content/landing-pages${query ? `?${query}` : ""}`
|
|
272
|
+
);
|
|
273
|
+
markContentWrapper("landing");
|
|
274
|
+
afterContentWrapperUse(config);
|
|
275
|
+
return data.pages;
|
|
276
|
+
}
|
|
277
|
+
async function getJmpLandingPageDetail(config, kind, slug, locale) {
|
|
278
|
+
const params = new URLSearchParams();
|
|
279
|
+
if (locale) {
|
|
280
|
+
params.set("locale", locale);
|
|
281
|
+
}
|
|
282
|
+
const query = params.toString();
|
|
283
|
+
try {
|
|
284
|
+
const detail = await getContent(
|
|
285
|
+
config,
|
|
286
|
+
`/api/content/landing-pages/${encodeURIComponent(kind)}/${encodeURIComponent(slug)}${query ? `?${query}` : ""}`
|
|
287
|
+
);
|
|
288
|
+
markContentWrapper("landing");
|
|
289
|
+
afterContentWrapperUse(config);
|
|
290
|
+
return detail;
|
|
291
|
+
} catch (error) {
|
|
292
|
+
if (error instanceof Error && error.message.includes("HTTP 404")) {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async function getJmpLandingPageSitemap(config) {
|
|
299
|
+
const data = await getContent(
|
|
300
|
+
config,
|
|
301
|
+
"/api/content/landing-pages/sitemap"
|
|
302
|
+
);
|
|
303
|
+
markContentWrapper("landing");
|
|
304
|
+
afterContentWrapperUse(config);
|
|
305
|
+
return data.entries;
|
|
306
|
+
}
|
|
126
307
|
async function getJmpTrustBundle(config) {
|
|
127
|
-
|
|
308
|
+
const bundle = await getContent(config, "/api/content/trust");
|
|
309
|
+
markTrustBundleWrappers(bundle);
|
|
310
|
+
afterContentWrapperUse(config);
|
|
311
|
+
return bundle;
|
|
128
312
|
}
|
|
129
313
|
async function getJmpSiteProfile(config) {
|
|
130
314
|
const data = await getContent(
|
|
131
315
|
config,
|
|
132
316
|
"/api/content/site"
|
|
133
317
|
);
|
|
318
|
+
markContentWrapper("contact");
|
|
319
|
+
afterContentWrapperUse(config);
|
|
134
320
|
return data.site;
|
|
135
321
|
}
|
|
322
|
+
async function registerJmpContentWrappers(config) {
|
|
323
|
+
const wrappers = resolveContentWrappersForReport(config);
|
|
324
|
+
if (!wrappers.length) {
|
|
325
|
+
return { ok: false, skipped: true };
|
|
326
|
+
}
|
|
327
|
+
const dedupeKey = `${config.trackingKey}:${[...wrappers].sort().join(",")}`;
|
|
328
|
+
if (hasReportedContentWrappers(dedupeKey)) {
|
|
329
|
+
return { ok: true, wrappers };
|
|
330
|
+
}
|
|
331
|
+
const baseUrl = normalizeBaseUrl(config.baseUrl);
|
|
332
|
+
const resolvedFetch = config.fetchImpl ?? (typeof globalThis !== "undefined" && globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
|
|
333
|
+
if (!resolvedFetch) {
|
|
334
|
+
throw new Error(
|
|
335
|
+
"JMP content wrappers: fetch is not available; pass fetchImpl in config"
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
const url = `${baseUrl}/api/content/capabilities`;
|
|
339
|
+
if (config.debug) {
|
|
340
|
+
console.debug("[@jmp-technologies/analytics]", "POST", url, { wrappers });
|
|
341
|
+
}
|
|
342
|
+
const res = await resolvedFetch(url, {
|
|
343
|
+
method: "POST",
|
|
344
|
+
headers: {
|
|
345
|
+
"Content-Type": "application/json",
|
|
346
|
+
"X-JMP-Tracking-Key": config.trackingKey
|
|
347
|
+
},
|
|
348
|
+
body: JSON.stringify({
|
|
349
|
+
wrappers,
|
|
350
|
+
sdkVersion: JMP_ANALYTICS_SDK_VERSION
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
const text = await res.text();
|
|
354
|
+
if (!res.ok) {
|
|
355
|
+
let parsed = {};
|
|
356
|
+
try {
|
|
357
|
+
parsed = JSON.parse(text);
|
|
358
|
+
} catch {
|
|
359
|
+
parsed = { error: text };
|
|
360
|
+
}
|
|
361
|
+
throw new Error(
|
|
362
|
+
[`JMP content wrappers HTTP ${res.status}`, parsed.error, parsed.hint].filter(Boolean).join(" \u2014 ")
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
rememberReportedContentWrappers(dedupeKey);
|
|
366
|
+
const data = JSON.parse(text);
|
|
367
|
+
return { ok: true, wrappers: data.wrappers ?? wrappers };
|
|
368
|
+
}
|
|
369
|
+
setContentWrapperSyncHandler(registerJmpContentWrappers);
|
|
136
370
|
|
|
137
371
|
// src/env-public.ts
|
|
138
372
|
function firstDefined(...values) {
|
|
@@ -321,6 +555,39 @@ async function loadFaqBySlug(slug) {
|
|
|
321
555
|
const items = await loadFaqs();
|
|
322
556
|
return items.find((item) => item.slug === normalized || item.id === normalized) ?? null;
|
|
323
557
|
}
|
|
558
|
+
async function loadLandingPages(filters) {
|
|
559
|
+
const c = getJmpContentConfig();
|
|
560
|
+
if (!c) {
|
|
561
|
+
return [];
|
|
562
|
+
}
|
|
563
|
+
try {
|
|
564
|
+
return await getJmpLandingPages(c, filters);
|
|
565
|
+
} catch {
|
|
566
|
+
return [];
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
async function loadLandingPageDetail(kind, slug, locale) {
|
|
570
|
+
const c = getJmpContentConfig();
|
|
571
|
+
if (!c) {
|
|
572
|
+
return null;
|
|
573
|
+
}
|
|
574
|
+
try {
|
|
575
|
+
return await getJmpLandingPageDetail(c, kind, slug, locale);
|
|
576
|
+
} catch {
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
async function loadLandingPageSitemap() {
|
|
581
|
+
const c = getJmpContentConfig();
|
|
582
|
+
if (!c) {
|
|
583
|
+
return [];
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
return await getJmpLandingPageSitemap(c);
|
|
587
|
+
} catch {
|
|
588
|
+
return [];
|
|
589
|
+
}
|
|
590
|
+
}
|
|
324
591
|
async function loadTrustBundle() {
|
|
325
592
|
const c = getJmpContentConfig();
|
|
326
593
|
if (!c) {
|
|
@@ -355,6 +622,9 @@ var loadBlogPosts2 = (0, import_react.cache)(loadBlogPosts);
|
|
|
355
622
|
var loadBlogPost2 = (0, import_react.cache)(loadBlogPost);
|
|
356
623
|
var loadFaqs2 = (0, import_react.cache)(loadFaqs);
|
|
357
624
|
var loadFaqBySlug2 = loadFaqBySlug;
|
|
625
|
+
var loadLandingPages2 = (0, import_react.cache)(loadLandingPages);
|
|
626
|
+
var loadLandingPageDetail2 = loadLandingPageDetail;
|
|
627
|
+
var loadLandingPageSitemap2 = (0, import_react.cache)(loadLandingPageSitemap);
|
|
358
628
|
var loadTrustBundle2 = (0, import_react.cache)(loadTrustBundle);
|
|
359
629
|
// Annotate the CommonJS export names for ESM import in node:
|
|
360
630
|
0 && (module.exports = {
|
|
@@ -366,6 +636,9 @@ var loadTrustBundle2 = (0, import_react.cache)(loadTrustBundle);
|
|
|
366
636
|
loadBlogPosts,
|
|
367
637
|
loadFaqBySlug,
|
|
368
638
|
loadFaqs,
|
|
639
|
+
loadLandingPageDetail,
|
|
640
|
+
loadLandingPageSitemap,
|
|
641
|
+
loadLandingPages,
|
|
369
642
|
loadSiteProfile,
|
|
370
643
|
loadTrustBundle,
|
|
371
644
|
resolveSiteContact
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next/content.ts","../../src/landing-capture.ts","../../src/http.ts","../../src/content/fetch.ts","../../src/content/api.ts","../../src/env-public.ts","../../src/site-config.ts","../../src/content/site-content.ts"],"sourcesContent":["import { cache } from \"react\"\n\nimport * as siteContent from \"../content/site-content\"\n\nexport type {\n JmpBlogPost,\n JmpFaqItem,\n JmpSiteProfile,\n JmpTestimonial,\n JmpTrustBundle,\n ResolvedSiteContact,\n} from \"../content/site-content\"\n\nexport { getJmpContentConfig } from \"../content/site-content\"\n\nexport const absoluteSiteAssetUrl = siteContent.absoluteSiteAssetUrl\nexport const resolveSiteContact = siteContent.resolveSiteContact\nexport const filterFeaturedTrustQuotes = siteContent.filterFeaturedTrustQuotes\n\nexport const loadSiteProfile = cache(siteContent.loadSiteProfile)\nexport const getResolvedSiteContact = cache(siteContent.getResolvedSiteContact)\nexport const loadBlogPosts = cache(siteContent.loadBlogPosts)\nexport const loadBlogPost = cache(siteContent.loadBlogPost)\nexport const loadFaqs = cache(siteContent.loadFaqs)\nexport const loadFaqBySlug = siteContent.loadFaqBySlug\nexport const loadTrustBundle = cache(siteContent.loadTrustBundle)\n","/** First-party landing attribution captured before React / useEffect (sessionStorage). */\n\nexport const JMP_SESSION_ID_KEY = \"jmp_analytics_sid\"\nexport const JMP_LANDING_REFERER_KEY = \"jmp_analytics_landing_referer\"\n/** Cross-subdomain landing referrer (www ↔ apex share sessionStorage origins). */\nexport const JMP_LANDING_REFERER_COOKIE = \"jmp_lr\"\nexport const JMP_UTM_SESSION_KEY = \"jmp_analytics_utm\"\n\nconst LANDING_REFERER_COOKIE_MAX_AGE_SEC = 30 * 60\n\nexport const JMP_UTM_PARAM_KEYS = [\n \"utm_source\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_content\",\n \"utm_term\",\n] as const\n\nfunction refererHostFromUrl(referer: string): string | null {\n const trimmed = referer.trim()\n try {\n return new URL(trimmed).hostname.replace(/^www\\./i, \"\").toLowerCase()\n } catch {\n try {\n return new URL(`https://${trimmed}`).hostname\n .replace(/^www\\./i, \"\")\n .toLowerCase()\n } catch {\n return null\n }\n }\n}\n\nexport function isExternalReferrerUrl(\n referer: string,\n siteHostname: string\n): boolean {\n const refHost = refererHostFromUrl(referer)\n if (!refHost) {\n return false\n }\n const site = siteHostname.replace(/^www\\./i, \"\").toLowerCase()\n return refHost !== site && !refHost.endsWith(`.${site}`)\n}\n\n/** Apex hostname used for `Domain=.example.com` cookies (www + apex). */\nexport function registrableSiteDomain(siteHostname: string): string | null {\n const site = siteHostname.replace(/^www\\./i, \"\").toLowerCase()\n if (!site || site === \"localhost\" || site.endsWith(\".local\")) {\n return null\n }\n if (!site.includes(\".\")) {\n return null\n }\n return site\n}\n\nexport function readLandingRefererCookie(siteHostname: string): string | null {\n if (typeof document === \"undefined\") {\n return null\n }\n\n const apex = registrableSiteDomain(siteHostname)\n if (!apex) {\n return null\n }\n\n const prefix = `${JMP_LANDING_REFERER_COOKIE}=`\n for (const part of document.cookie.split(\";\")) {\n const trimmed = part.trim()\n if (!trimmed.startsWith(prefix)) {\n continue\n }\n try {\n const value = decodeURIComponent(trimmed.slice(prefix.length)).trim()\n return value.length > 0 ? value : null\n } catch {\n return null\n }\n }\n\n return null\n}\n\nexport function writeLandingRefererCookie(\n referer: string,\n siteHostname: string\n): void {\n if (typeof document === \"undefined\") {\n return\n }\n\n const apex = registrableSiteDomain(siteHostname)\n if (!apex) {\n return\n }\n\n const value = encodeURIComponent(referer.trim().slice(0, 2048))\n const secure =\n typeof window !== \"undefined\" && window.location.protocol === \"https:\"\n ? \"; Secure\"\n : \"\"\n\n document.cookie = `${JMP_LANDING_REFERER_COOKIE}=${value}; Domain=.${apex}; Path=/; Max-Age=${LANDING_REFERER_COOKIE_MAX_AGE_SEC}; SameSite=Lax${secure}`\n}\n\nexport function captureLandingAttribution(siteHostname: string): {\n landingReferer: string | null\n utm: Record<string, string>\n} {\n if (typeof document === \"undefined\" || typeof window === \"undefined\") {\n return { landingReferer: null, utm: {} }\n }\n\n let landingReferer: string | null = null\n let utm: Record<string, string> = {}\n\n try {\n const storedReferer =\n sessionStorage.getItem(JMP_LANDING_REFERER_KEY)?.trim() || null\n const cookieReferer = readLandingRefererCookie(siteHostname)\n const preservedReferer = storedReferer || cookieReferer\n const currentReferer = document.referrer?.trim() || null\n\n if (\n currentReferer &&\n isExternalReferrerUrl(currentReferer, siteHostname)\n ) {\n sessionStorage.setItem(JMP_LANDING_REFERER_KEY, currentReferer)\n writeLandingRefererCookie(currentReferer, siteHostname)\n landingReferer = currentReferer\n } else if (preservedReferer) {\n landingReferer = preservedReferer\n if (!storedReferer) {\n sessionStorage.setItem(JMP_LANDING_REFERER_KEY, preservedReferer)\n }\n }\n\n const params = new URLSearchParams(window.location.search)\n const rawUtm = sessionStorage.getItem(JMP_UTM_SESSION_KEY)\n if (rawUtm) {\n const parsed = JSON.parse(rawUtm) as unknown\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n utm = parsed as Record<string, string>\n }\n }\n\n let updated = false\n for (const key of JMP_UTM_PARAM_KEYS) {\n const value = params.get(key)?.trim()\n if (value) {\n utm[key] = value\n updated = true\n }\n }\n\n if (updated) {\n sessionStorage.setItem(JMP_UTM_SESSION_KEY, JSON.stringify(utm))\n }\n } catch {\n }\n\n return { landingReferer, utm }\n}\n\nexport function getOrCreateSessionIdFromStorage(): string | undefined {\n if (typeof window === \"undefined\" || !globalThis.crypto?.randomUUID) {\n return undefined\n }\n try {\n let id = sessionStorage.getItem(JMP_SESSION_ID_KEY)\n if (!id) {\n id = crypto.randomUUID()\n sessionStorage.setItem(JMP_SESSION_ID_KEY, id)\n }\n return id\n } catch {\n return undefined\n }\n}\n\n/** Inline script for Next.js `beforeInteractive` — capture referrer/UTM only (no network). */\nexport function buildLandingCaptureInlineScript(): string {\n const cookieMaxAge = String(LANDING_REFERER_COOKIE_MAX_AGE_SEC)\n\n return `(function(){try{var h=location.hostname;var ref=document.referrer||'';function rh(u){try{return new URL(u).hostname.replace(/^www\\\\./i,'').toLowerCase()}catch(e){try{return new URL('https://'+u).hostname.replace(/^www\\\\./i,'').toLowerCase()}catch(e2){return null}}}function ext(r){var x=rh(r);if(!x)return false;var s=h.replace(/^www\\\\./i,'').toLowerCase();return x!==s&&x.slice(-('.'+s).length)!==('.'+s)}function apexDom(hn){var s=hn.replace(/^www\\\\./i,'').toLowerCase();if(!s||s==='localhost'||/\\\\.local$/i.test(s)||s.indexOf('.')<0)return null;return s}function readCk(hn){var apex=apexDom(hn);if(!apex)return '';var pre='${JMP_LANDING_REFERER_COOKIE}=';var parts=document.cookie.split(';');for(var i=0;i<parts.length;i++){var t=parts[i].trim();if(t.indexOf(pre)===0){try{return decodeURIComponent(t.slice(pre.length)).trim()}catch(e){return ''}}}return ''}function writeCk(r,hn){var apex=apexDom(hn);if(!apex)return;var sec=location.protocol==='https:'?'; Secure':'';document.cookie='${JMP_LANDING_REFERER_COOKIE}='+encodeURIComponent(r.slice(0,2048))+'; Domain=.'+apex+'; Path=/; Max-Age=${cookieMaxAge}; SameSite=Lax'+sec}var stored=sessionStorage.getItem('${JMP_LANDING_REFERER_KEY}')||'';var ck=readCk(h);var preserved=stored||ck;var lr='';if(ref&&ext(ref)){sessionStorage.setItem('${JMP_LANDING_REFERER_KEY}',ref);writeCk(ref,h);lr=ref}else{lr=preserved||'';if(lr&&!stored)sessionStorage.setItem('${JMP_LANDING_REFERER_KEY}',lr)}var sid=sessionStorage.getItem('${JMP_SESSION_ID_KEY}');if(!sid&&crypto&&crypto.randomUUID){sid=crypto.randomUUID();sessionStorage.setItem('${JMP_SESSION_ID_KEY}',sid)}try{var sp=new URLSearchParams(location.search);var utm={};var updated=false;['utm_source','utm_medium','utm_campaign','utm_content','utm_term'].forEach(function(n){var v=sp.get(n);if(v){utm[n]=v;updated=true}});if(updated)sessionStorage.setItem('${JMP_UTM_SESSION_KEY}',JSON.stringify(utm))}catch(e){}}catch(e){}})();`\n}\n","import type { JmpServerRequestLike } from \"./types\"\n\n/** CDN / Next.js often return HTML error pages; API errors are JSON */\nexport function responseLooksLikeHtml(body: string): boolean {\n const s = body.trimStart()\n return (\n s.startsWith(\"<!\") ||\n s.toLowerCase().startsWith(\"<html\") ||\n (s.startsWith(\"<\") && /<html[\\s>]/i.test(s.slice(0, 500)))\n )\n}\n\nexport function normalizeBaseUrl(baseUrl: string): string {\n return baseUrl.replace(/\\/$/, \"\")\n}\n\nexport function getHeader(\n headers: JmpServerRequestLike[\"headers\"] | undefined,\n key: string\n): string | null {\n if (!headers) {\n return null\n }\n if (typeof (headers as Pick<Headers, \"get\">).get === \"function\") {\n return (headers as Pick<Headers, \"get\">).get(key)\n }\n const record = headers as Record<string, string | string[] | undefined | null>\n const direct = record[key] ?? record[key.toLowerCase()]\n if (Array.isArray(direct)) {\n return direct[0] ?? null\n }\n return direct ?? null\n}\n\nexport function pathFromRequestUrl(url: string | undefined): string {\n if (!url) {\n return \"/\"\n }\n try {\n const u = new URL(url)\n return `${u.pathname}${u.search}`\n } catch {\n return url.startsWith(\"/\") ? url : \"/\"\n }\n}\n\nexport function resolveFetch(\n fetchImpl: typeof fetch | undefined,\n context: string\n): typeof fetch {\n const resolved =\n fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n if (!resolved) {\n throw new Error(`${context}: fetch is not available; pass fetchImpl in config`)\n }\n return resolved\n}\n\ntype ApiErrorJson = {\n error?: string\n code?: string\n hint?: string\n expectedDomain?: string\n}\n\nexport function formatApiErrorMessage(\n status: number,\n text: string,\n prefix: string\n): string {\n if (responseLooksLikeHtml(text)) {\n return `${prefix} HTTP ${status} — response was HTML (not the JSON API). Check baseUrl points at the JMP Analytics dashboard.`\n }\n let parsed: ApiErrorJson = {}\n try {\n parsed = JSON.parse(text) as ApiErrorJson\n } catch {\n parsed = { error: text }\n }\n const detail = parsed.error ?? text\n return [\n `${prefix} HTTP ${status}`,\n parsed.code ? `[${parsed.code}]` : null,\n detail,\n parsed.hint ? `Hint: ${parsed.hint}` : null,\n parsed.expectedDomain\n ? `Domain in JMP admin: ${parsed.expectedDomain}`\n : null,\n ]\n .filter(Boolean)\n .join(\" — \")\n}\n","import { normalizeBaseUrl, resolveFetch, responseLooksLikeHtml } from \"../http\"\nimport type { JmpContentConfig } from \"../types\"\n\nexport async function getContent<T>(\n config: JmpContentConfig,\n path: string\n): Promise<T> {\n const text = await getContentText(config, path)\n\n try {\n return JSON.parse(text) as T\n } catch {\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const url = `${baseUrl}${path}`\n throw new Error(`JMP content HTTP 200 — ${url} returned invalid JSON.`)\n }\n}\n\nexport async function getContentText(\n config: JmpContentConfig,\n path: string\n): Promise<string> {\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const resolvedFetch =\n config.fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n\n if (!resolvedFetch) {\n throw new Error(\"JMP content: fetch is not available; pass fetchImpl in config\")\n }\n\n const url = `${baseUrl}${path}`\n\n if (config.debug) {\n console.debug(\"[@jmp-technologies/analytics]\", \"GET\", url)\n }\n\n const res = await resolvedFetch(url, {\n method: \"GET\",\n headers: {\n \"X-JMP-Tracking-Key\": config.trackingKey,\n },\n })\n\n const text = await res.text()\n\n if (!res.ok) {\n if (responseLooksLikeHtml(text)) {\n throw new Error(\n `JMP content HTTP ${res.status} — ${url} returned HTML (not the JSON API). ` +\n `Set baseUrl to your JMP Analytics dashboard origin.`\n )\n }\n\n let parsed: { error?: string; hint?: string } = {}\n try {\n parsed = JSON.parse(text) as typeof parsed\n } catch {\n parsed = { error: text }\n }\n\n throw new Error(\n [`JMP content HTTP ${res.status}`, parsed.error, parsed.hint]\n .filter(Boolean)\n .join(\" — \")\n )\n }\n\n return text\n}\n","import { JMP_ANALYTICS_SDK_VERSION } from \"../constants\"\nimport { normalizeBaseUrl, resolveFetch } from \"../http\"\nimport type {\n JmpBlogPost,\n JmpContentConfig,\n JmpFaqItem,\n JmpSiteProfile,\n JmpTrustBundle,\n} from \"../types\"\nimport { getContent, getContentText } from \"./fetch\"\n\nexport async function getJmpBlogPosts(\n config: JmpContentConfig\n): Promise<JmpBlogPost[]> {\n const data = await getContent<{ posts: JmpBlogPost[] }>(\n config,\n \"/api/content/blog\"\n )\n return data.posts\n}\n\nexport async function getJmpBlogPost(\n config: JmpContentConfig,\n slug: string\n): Promise<JmpBlogPost | null> {\n try {\n const data = await getContent<{ post: JmpBlogPost }>(\n config,\n `/api/content/blog/${encodeURIComponent(slug)}`\n )\n return data.post\n } catch (error) {\n if (error instanceof Error && error.message.includes(\"HTTP 404\")) {\n return null\n }\n throw error\n }\n}\n\nexport async function getJmpFaqs(\n config: JmpContentConfig\n): Promise<JmpFaqItem[]> {\n const data = await getContent<{ faqs: JmpFaqItem[] }>(\n config,\n \"/api/content/faqs\"\n )\n return data.faqs\n}\n\nexport async function getJmpTrustBundle(\n config: JmpContentConfig\n): Promise<JmpTrustBundle> {\n return getContent<JmpTrustBundle>(config, \"/api/content/trust\")\n}\n\nexport async function getJmpSiteProfile(\n config: JmpContentConfig\n): Promise<JmpSiteProfile> {\n const data = await getContent<{ site: JmpSiteProfile }>(\n config,\n \"/api/content/site\"\n )\n return data.site\n}\n\nexport async function getJmpRobotsTxt(config: JmpContentConfig): Promise<string> {\n return getContentText(config, \"/api/content/robots\")\n}\n\nconst registeredContentWrappers = new Set<string>()\n\nfunction resolveContentWrappersFromConfig(\n config: JmpContentConfig\n): string[] {\n if (config.contentWrappers?.length) {\n return [...config.contentWrappers]\n }\n return []\n}\n\n/**\n * Tell the JMP dashboard which content wrappers this site wires (blog, faq, trust.*, contact).\n * Safe to call on every cold start; dedupes by tracking key + wrapper list.\n */\nexport async function registerJmpContentWrappers(\n config: JmpContentConfig\n): Promise<\n { ok: true; wrappers: string[] } | { ok: false; skipped: true }\n> {\n const wrappers = resolveContentWrappersFromConfig(config)\n if (!wrappers.length) {\n return { ok: false, skipped: true }\n }\n\n const dedupeKey = `${config.trackingKey}:${[...wrappers].sort().join(\",\")}`\n if (registeredContentWrappers.has(dedupeKey)) {\n return { ok: true, wrappers }\n }\n\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const resolvedFetch =\n config.fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n\n if (!resolvedFetch) {\n throw new Error(\n \"JMP content wrappers: fetch is not available; pass fetchImpl in config\"\n )\n }\n\n const url = `${baseUrl}/api/content/capabilities`\n if (config.debug) {\n console.debug(\"[@jmp-technologies/analytics]\", \"POST\", url, { wrappers })\n }\n\n const res = await resolvedFetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-JMP-Tracking-Key\": config.trackingKey,\n },\n body: JSON.stringify({\n wrappers,\n sdkVersion: JMP_ANALYTICS_SDK_VERSION,\n }),\n })\n\n const text = await res.text()\n if (!res.ok) {\n let parsed: { error?: string; hint?: string } = {}\n try {\n parsed = JSON.parse(text) as typeof parsed\n } catch {\n parsed = { error: text }\n }\n throw new Error(\n [`JMP content wrappers HTTP ${res.status}`, parsed.error, parsed.hint]\n .filter(Boolean)\n .join(\" — \")\n )\n }\n\n registeredContentWrappers.add(dedupeKey)\n const data = JSON.parse(text) as { wrappers?: string[] }\n return { ok: true, wrappers: data.wrappers ?? wrappers }\n}\n","/**\n * Public env vars for JMP — supports Next.js (`NEXT_PUBLIC_*`) and Astro (`PUBLIC_*`).\n * Server/build: `process.env`. Astro client bundles: pass overrides from `import.meta.env`.\n */\n\nexport type JmpPublicEnv = {\n analyticsUrl?: string\n trackingKey?: string\n requireConsent?: boolean\n autoContactLinks?: boolean\n}\n\nfunction firstDefined(...values: (string | undefined)[]): string | undefined {\n for (const v of values) {\n if (v) return v\n }\n return undefined\n}\n\n/** Static reads so Next.js / Vite inline `NEXT_PUBLIC_*` into client bundles. */\nfunction readJmpPublicEnvFromProcessEnv(): Omit<JmpPublicEnv, never> {\n if (typeof process === \"undefined\" || !process.env) {\n return {}\n }\n const { env } = process\n const analyticsUrl = firstDefined(\n env.NEXT_PUBLIC_JMP_ANALYTICS_URL,\n env.PUBLIC_JMP_ANALYTICS_URL,\n )\n const trackingKey = firstDefined(\n env.NEXT_PUBLIC_JMP_TRACKING_KEY,\n env.PUBLIC_JMP_TRACKING_KEY,\n )\n const requireConsentRaw = firstDefined(\n env.NEXT_PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT,\n env.PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT,\n )\n const autoContactRaw = firstDefined(\n env.NEXT_PUBLIC_JMP_AUTO_CONTACT_LINKS,\n env.PUBLIC_JMP_AUTO_CONTACT_LINKS,\n )\n\n return {\n analyticsUrl,\n trackingKey,\n requireConsent: requireConsentRaw === \"true\",\n autoContactLinks: autoContactRaw === \"true\",\n }\n}\n\n/** Read dashboard URL + tracking key from Node / build-time env. */\nexport function readJmpPublicEnvFromProcess(\n overrides?: Partial<JmpPublicEnv>,\n): JmpPublicEnv {\n const fromEnv = readJmpPublicEnvFromProcessEnv()\n\n return {\n analyticsUrl: firstDefined(overrides?.analyticsUrl, fromEnv.analyticsUrl),\n trackingKey: firstDefined(overrides?.trackingKey, fromEnv.trackingKey),\n requireConsent: overrides?.requireConsent ?? fromEnv.requireConsent,\n autoContactLinks:\n overrides?.autoContactLinks ?? fromEnv.autoContactLinks,\n }\n}\n\n/** Read from Astro/Vite `import.meta.env` in client scripts. */\nexport function readJmpPublicEnvFromImportMeta(\n meta: Record<string, unknown> | undefined,\n overrides?: Partial<JmpPublicEnv>,\n): JmpPublicEnv {\n const get = (key: string): string | undefined => {\n const v = meta?.[key]\n return typeof v === \"string\" && v.length > 0 ? v : undefined\n }\n\n const analyticsUrl = firstDefined(\n overrides?.analyticsUrl,\n get(\"PUBLIC_JMP_ANALYTICS_URL\"),\n get(\"NEXT_PUBLIC_JMP_ANALYTICS_URL\"),\n )\n const trackingKey = firstDefined(\n overrides?.trackingKey,\n get(\"PUBLIC_JMP_TRACKING_KEY\"),\n get(\"NEXT_PUBLIC_JMP_TRACKING_KEY\"),\n )\n const requireConsentRaw = firstDefined(\n overrides?.requireConsent !== undefined\n ? String(overrides.requireConsent)\n : undefined,\n get(\"PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT\"),\n get(\"NEXT_PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT\"),\n )\n const autoContactRaw = firstDefined(\n overrides?.autoContactLinks !== undefined\n ? String(overrides.autoContactLinks)\n : undefined,\n get(\"PUBLIC_JMP_AUTO_CONTACT_LINKS\"),\n get(\"NEXT_PUBLIC_JMP_AUTO_CONTACT_LINKS\"),\n )\n\n return {\n analyticsUrl,\n trackingKey,\n requireConsent: requireConsentRaw === \"true\",\n autoContactLinks: autoContactRaw === \"true\",\n }\n}\n","import type { JmpContentConfig, JmpContentWrapper } from \"./types\"\nimport { readJmpPublicEnvFromProcess } from \"./env-public\"\n\n/** Per-site values used when the dashboard profile is missing or fields are empty. */\nexport type JmpSiteContactFallback = {\n displayName?: string\n founderName?: string\n email?: string\n phone?: string | null\n linkedin?: string | null\n hours?: string | null\n serviceArea?: string | null\n dashboardDemoUrl?: string\n profilePhotoSrc?: string\n privacyUrl?: string\n termsUrl?: string\n}\n\nexport type JmpSiteDefinition = {\n /** Content tabs this site uses — reported via instrumentation capabilities. */\n contentWrappers: JmpContentWrapper[]\n /**\n * Public site origin (no trailing slash), e.g. `https://example.com`.\n * Used to resolve relative profile image paths in structured data.\n */\n siteUrl?: string\n /**\n * JMP dashboard origin (no trailing slash), e.g. `https://portal.example.com`.\n * Fallback when `NEXT_PUBLIC_JMP_ANALYTICS_URL` is missing from the client bundle.\n */\n analyticsPortalUrl?: string\n contactFallback?: JmpSiteContactFallback\n /**\n * `extras` keys to read from the dashboard site profile (hyphenated keys from admin).\n */\n contactExtraKeys?: {\n founderName?: readonly string[]\n dashboardDemoUrl?: readonly string[]\n profilePhotoSrc?: readonly string[]\n hours?: readonly string[]\n serviceArea?: readonly string[]\n }\n}\n\nlet registeredSite: JmpSiteDefinition | null = null\n\n/**\n * Register site-specific JMP integration options once (typically from `jmp.config.ts`).\n * Call at module load time before server content or instrumentation runs.\n */\nexport function defineJmpSite(definition: JmpSiteDefinition): JmpSiteDefinition {\n registeredSite = definition\n return definition\n}\n\nexport function getJmpSiteDefinition(): JmpSiteDefinition | null {\n return registeredSite\n}\n\n/** Server content + lead config: env vars + wrappers from {@link defineJmpSite}. */\nexport function getJmpContentConfig(): JmpContentConfig | null {\n const { analyticsUrl, trackingKey } = readJmpPublicEnvFromProcess()\n if (!analyticsUrl || !trackingKey) {\n return null\n }\n const site = getJmpSiteDefinition()\n return {\n baseUrl: analyticsUrl,\n trackingKey,\n contentWrappers: site?.contentWrappers ?? undefined,\n }\n}\n","import {\n getJmpBlogPost,\n getJmpBlogPosts,\n getJmpFaqs,\n getJmpSiteProfile,\n getJmpTrustBundle,\n type JmpBlogPost,\n type JmpFaqItem,\n type JmpSiteProfile,\n type JmpTestimonial,\n type JmpTrustBundle,\n} from \"../index\"\nimport { getJmpContentConfig, getJmpSiteDefinition } from \"../site-config\"\n\nexport type {\n JmpBlogPost,\n JmpFaqItem,\n JmpSiteProfile,\n JmpTestimonial,\n JmpTrustBundle,\n}\n\nexport { getJmpContentConfig } from \"../site-config\"\n\nexport type ResolvedSiteContact = {\n displayName: string\n email: string\n founderName: string\n dashboardDemoUrl: string\n profilePhotoSrc: string\n linkedin: string | null\n phone: string | null\n hours: string | null\n serviceArea: string | null\n privacyUrl: string\n termsUrl: string\n cta: { label: string | null; url: string | null }\n}\n\nconst DEFAULT_EXTRA_KEYS = {\n founderName: [\"founder-name\", \"founder_name\"],\n dashboardDemoUrl: [\"dashboard-demo-url\", \"sample-dashboard-url\"],\n profilePhotoSrc: [\"profile-photo-url\", \"profile_photo_url\"],\n hours: [\"hours\", \"business-hours\"],\n serviceArea: [\"service-area\", \"service_area\", \"service-area-text\"],\n} as const\n\nfunction sortBlogPosts(posts: JmpBlogPost[]): JmpBlogPost[] {\n return [...posts].sort((a, b) => {\n const da = a.published_at ?? a.updated_at\n const db = b.published_at ?? b.updated_at\n return db.localeCompare(da)\n })\n}\n\nfunction sortFaqs(items: JmpFaqItem[]): JmpFaqItem[] {\n return [...items].sort((a, b) => a.sort_order - b.sort_order)\n}\n\nfunction readProfileExtra(\n profile: JmpSiteProfile | null,\n keys: readonly string[],\n): string | null {\n for (const key of keys) {\n const value = profile?.extras?.[key]?.trim()\n if (value) {\n return value\n }\n }\n return null\n}\n\n/** Resolve a path or URL against {@link defineJmpSite}'s `siteUrl`. */\nexport function absoluteSiteAssetUrl(src: string): string {\n const trimmed = src.trim()\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n return trimmed\n }\n const siteUrl = getJmpSiteDefinition()?.siteUrl?.replace(/\\/$/, \"\")\n if (!siteUrl) {\n return trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`\n }\n return `${siteUrl}${trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`}`\n}\n\nexport async function loadSiteProfile(): Promise<JmpSiteProfile | null> {\n const config = getJmpContentConfig()\n if (!config) {\n return null\n }\n try {\n return await getJmpSiteProfile(config)\n } catch {\n return null\n }\n}\n\nexport function resolveSiteContact(profile: JmpSiteProfile | null): ResolvedSiteContact {\n const site = getJmpSiteDefinition()\n const fallback = site?.contactFallback ?? {}\n const extraKeys = {\n ...DEFAULT_EXTRA_KEYS,\n ...site?.contactExtraKeys,\n }\n\n const email = profile?.email?.trim() || fallback.email || \"\"\n const linkedin =\n profile?.social?.linkedin?.trim() || fallback.linkedin || null\n const phone = profile?.phone?.trim() || fallback.phone || null\n\n return {\n displayName:\n profile?.display_name?.trim() ||\n profile?.name?.trim() ||\n fallback.displayName ||\n \"\",\n founderName:\n readProfileExtra(profile, extraKeys.founderName ?? []) ||\n fallback.founderName ||\n \"\",\n dashboardDemoUrl:\n readProfileExtra(profile, extraKeys.dashboardDemoUrl ?? []) ||\n fallback.dashboardDemoUrl ||\n \"\",\n profilePhotoSrc:\n readProfileExtra(profile, extraKeys.profilePhotoSrc ?? []) ||\n fallback.profilePhotoSrc ||\n \"\",\n email,\n linkedin,\n phone,\n hours:\n readProfileExtra(profile, extraKeys.hours ?? []) || fallback.hours || null,\n serviceArea:\n readProfileExtra(profile, extraKeys.serviceArea ?? []) ||\n fallback.serviceArea ||\n null,\n privacyUrl: profile?.legal?.privacy_policy_url?.trim() || fallback.privacyUrl || \"/privacy\",\n termsUrl: profile?.legal?.terms_url?.trim() || fallback.termsUrl || \"/terms\",\n cta: {\n label: profile?.cta?.label?.trim() || null,\n url: profile?.cta?.url?.trim() || null,\n },\n }\n}\n\nexport async function getResolvedSiteContact(): Promise<ResolvedSiteContact> {\n const profile = await loadSiteProfile()\n return resolveSiteContact(profile)\n}\n\nexport async function loadBlogPosts(): Promise<JmpBlogPost[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n const posts = await getJmpBlogPosts(c)\n return sortBlogPosts(posts)\n } catch {\n return []\n }\n}\n\nexport async function loadBlogPost(slug: string): Promise<JmpBlogPost | null> {\n const c = getJmpContentConfig()\n if (!c) {\n return null\n }\n try {\n return await getJmpBlogPost(c, slug)\n } catch {\n return null\n }\n}\n\nexport async function loadFaqs(): Promise<JmpFaqItem[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n const faqs = await getJmpFaqs(c)\n return sortFaqs(faqs)\n } catch {\n return []\n }\n}\n\nexport async function loadFaqBySlug(slug: string): Promise<JmpFaqItem | null> {\n const normalized = slug.trim()\n if (!normalized) {\n return null\n }\n const items = await loadFaqs()\n return (\n items.find((item) => item.slug === normalized || item.id === normalized) ?? null\n )\n}\n\nexport async function loadTrustBundle(): Promise<JmpTrustBundle | null> {\n const c = getJmpContentConfig()\n if (!c) {\n return null\n }\n try {\n return await getJmpTrustBundle(c)\n } catch {\n return null\n }\n}\n\nexport function filterFeaturedTrustQuotes(\n testimonials: JmpTestimonial[],\n placement: \"testimonials\" | \"reviews\",\n limit = 2,\n): JmpTestimonial[] {\n return testimonials\n .filter((item) => {\n if (!item.featured) {\n return false\n }\n const bucket = item.placement?.trim().toLowerCase()\n if (placement === \"reviews\") {\n return bucket === \"reviews\"\n }\n return !bucket || bucket === \"testimonials\"\n })\n .sort((a, b) => a.sort_order - b.sort_order)\n .slice(0, limit)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA,gCAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;AAAA,mBAAsB;;;ACQtB,IAAM,qCAAqC,KAAK;;;ACLzC,SAAS,sBAAsB,MAAuB;AAC3D,QAAM,IAAI,KAAK,UAAU;AACzB,SACE,EAAE,WAAW,IAAI,KACjB,EAAE,YAAY,EAAE,WAAW,OAAO,KACjC,EAAE,WAAW,GAAG,KAAK,cAAc,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;AAE5D;AAEO,SAAS,iBAAiB,SAAyB;AACxD,SAAO,QAAQ,QAAQ,OAAO,EAAE;AAClC;;;ACXA,eAAsB,WACpB,QACA,MACY;AACZ,QAAM,OAAO,MAAM,eAAe,QAAQ,IAAI;AAE9C,MAAI;AACF,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K;AAC7B,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,EACT;AACA,QAAM,QAAQ,MAAM,SAAS;AAC7B,SACE,MAAM,KAAK,CAAC,SAAS,KAAK,SAAS,cAAc,KAAK,OAAO,UAAU,KAAK;AAEhF;AAEA,eAAsB,kBAAkD;AACtE,QAAM,IAAI,oBAAoB;AAC9B,MAAI,CAAC,GAAG;AACN,WAAO;AAAA,EACT;AACA,MAAI;AACF,WAAO,MAAM,kBAAkB,CAAC;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,0BACd,cACA,WACA,QAAQ,GACU;AAClB,SAAO,aACJ,OAAO,CAAC,SAAS;AAChB,QAAI,CAAC,KAAK,UAAU;AAClB,aAAO;AAAA,IACT;AACA,UAAM,SAAS,KAAK,WAAW,KAAK,EAAE,YAAY;AAClD,QAAI,cAAc,WAAW;AAC3B,aAAO,WAAW;AAAA,IACpB;AACA,WAAO,CAAC,UAAU,WAAW;AAAA,EAC/B,CAAC,EACA,KAAK,CAAC,GAAG,MAAM,EAAE,aAAa,EAAE,UAAU,EAC1C,MAAM,GAAG,KAAK;AACnB;;;APvNO,IAAMC,wBAAmC;AACzC,IAAMC,sBAAiC;AACvC,IAAMC,6BAAwC;AAE9C,IAAMC,uBAAkB,oBAAkB,eAAe;AACzD,IAAMC,8BAAyB,oBAAkB,sBAAsB;AACvE,IAAMC,qBAAgB,oBAAkB,aAAa;AACrD,IAAMC,oBAAe,oBAAkB,YAAY;AACnD,IAAMC,gBAAW,oBAAkB,QAAQ;AAC3C,IAAMC,iBAA4B;AAClC,IAAMC,uBAAkB,oBAAkB,eAAe;","names":["absoluteSiteAssetUrl","filterFeaturedTrustQuotes","getResolvedSiteContact","loadBlogPost","loadBlogPosts","loadFaqBySlug","loadFaqs","loadSiteProfile","loadTrustBundle","resolveSiteContact","absoluteSiteAssetUrl","resolveSiteContact","filterFeaturedTrustQuotes","loadSiteProfile","getResolvedSiteContact","loadBlogPosts","loadBlogPost","loadFaqs","loadFaqBySlug","loadTrustBundle"]}
|
|
1
|
+
{"version":3,"sources":["../../src/next/content.ts","../../src/landing-capture.ts","../../src/constants.ts","../../src/http.ts","../../src/content/fetch.ts","../../src/content/wrapper-discovery.ts","../../src/content/api.ts","../../src/env-public.ts","../../src/site-config.ts","../../src/content/site-content.ts"],"sourcesContent":["import { cache } from \"react\"\n\nimport * as siteContent from \"../content/site-content\"\n\nexport type {\n JmpBlogPost,\n JmpFaqItem,\n JmpLandingPage,\n JmpLandingPageDetail,\n JmpLandingPageKind,\n JmpLandingPageSitemapEntry,\n JmpSiteProfile,\n JmpTestimonial,\n JmpTrustBundle,\n ResolvedSiteContact,\n} from \"../content/site-content\"\n\nexport { getJmpContentConfig } from \"../content/site-content\"\n\nexport const absoluteSiteAssetUrl = siteContent.absoluteSiteAssetUrl\nexport const resolveSiteContact = siteContent.resolveSiteContact\nexport const filterFeaturedTrustQuotes = siteContent.filterFeaturedTrustQuotes\n\nexport const loadSiteProfile = cache(siteContent.loadSiteProfile)\nexport const getResolvedSiteContact = cache(siteContent.getResolvedSiteContact)\nexport const loadBlogPosts = cache(siteContent.loadBlogPosts)\nexport const loadBlogPost = cache(siteContent.loadBlogPost)\nexport const loadFaqs = cache(siteContent.loadFaqs)\nexport const loadFaqBySlug = siteContent.loadFaqBySlug\nexport const loadLandingPages = cache(siteContent.loadLandingPages)\nexport const loadLandingPageDetail = siteContent.loadLandingPageDetail\nexport const loadLandingPageSitemap = cache(siteContent.loadLandingPageSitemap)\nexport const loadTrustBundle = cache(siteContent.loadTrustBundle)\n","/** First-party landing attribution captured before React / useEffect (sessionStorage). */\n\nexport const JMP_SESSION_ID_KEY = \"jmp_analytics_sid\"\nexport const JMP_LANDING_REFERER_KEY = \"jmp_analytics_landing_referer\"\n/** Cross-subdomain landing referrer (www ↔ apex share sessionStorage origins). */\nexport const JMP_LANDING_REFERER_COOKIE = \"jmp_lr\"\nexport const JMP_UTM_SESSION_KEY = \"jmp_analytics_utm\"\n\nconst LANDING_REFERER_COOKIE_MAX_AGE_SEC = 30 * 60\n\nexport const JMP_UTM_PARAM_KEYS = [\n \"utm_source\",\n \"utm_medium\",\n \"utm_campaign\",\n \"utm_content\",\n \"utm_term\",\n] as const\n\nfunction refererHostFromUrl(referer: string): string | null {\n const trimmed = referer.trim()\n try {\n return new URL(trimmed).hostname.replace(/^www\\./i, \"\").toLowerCase()\n } catch {\n try {\n return new URL(`https://${trimmed}`).hostname\n .replace(/^www\\./i, \"\")\n .toLowerCase()\n } catch {\n return null\n }\n }\n}\n\nexport function isExternalReferrerUrl(\n referer: string,\n siteHostname: string\n): boolean {\n const refHost = refererHostFromUrl(referer)\n if (!refHost) {\n return false\n }\n const site = siteHostname.replace(/^www\\./i, \"\").toLowerCase()\n return refHost !== site && !refHost.endsWith(`.${site}`)\n}\n\n/** Apex hostname used for `Domain=.example.com` cookies (www + apex). */\nexport function registrableSiteDomain(siteHostname: string): string | null {\n const site = siteHostname.replace(/^www\\./i, \"\").toLowerCase()\n if (!site || site === \"localhost\" || site.endsWith(\".local\")) {\n return null\n }\n if (!site.includes(\".\")) {\n return null\n }\n return site\n}\n\nexport function readLandingRefererCookie(siteHostname: string): string | null {\n if (typeof document === \"undefined\") {\n return null\n }\n\n const apex = registrableSiteDomain(siteHostname)\n if (!apex) {\n return null\n }\n\n const prefix = `${JMP_LANDING_REFERER_COOKIE}=`\n for (const part of document.cookie.split(\";\")) {\n const trimmed = part.trim()\n if (!trimmed.startsWith(prefix)) {\n continue\n }\n try {\n const value = decodeURIComponent(trimmed.slice(prefix.length)).trim()\n return value.length > 0 ? value : null\n } catch {\n return null\n }\n }\n\n return null\n}\n\nexport function writeLandingRefererCookie(\n referer: string,\n siteHostname: string\n): void {\n if (typeof document === \"undefined\") {\n return\n }\n\n const apex = registrableSiteDomain(siteHostname)\n if (!apex) {\n return\n }\n\n const value = encodeURIComponent(referer.trim().slice(0, 2048))\n const secure =\n typeof window !== \"undefined\" && window.location.protocol === \"https:\"\n ? \"; Secure\"\n : \"\"\n\n document.cookie = `${JMP_LANDING_REFERER_COOKIE}=${value}; Domain=.${apex}; Path=/; Max-Age=${LANDING_REFERER_COOKIE_MAX_AGE_SEC}; SameSite=Lax${secure}`\n}\n\nexport function captureLandingAttribution(siteHostname: string): {\n landingReferer: string | null\n utm: Record<string, string>\n} {\n if (typeof document === \"undefined\" || typeof window === \"undefined\") {\n return { landingReferer: null, utm: {} }\n }\n\n let landingReferer: string | null = null\n let utm: Record<string, string> = {}\n\n try {\n const storedReferer =\n sessionStorage.getItem(JMP_LANDING_REFERER_KEY)?.trim() || null\n const cookieReferer = readLandingRefererCookie(siteHostname)\n const preservedReferer = storedReferer || cookieReferer\n const currentReferer = document.referrer?.trim() || null\n\n if (\n currentReferer &&\n isExternalReferrerUrl(currentReferer, siteHostname)\n ) {\n sessionStorage.setItem(JMP_LANDING_REFERER_KEY, currentReferer)\n writeLandingRefererCookie(currentReferer, siteHostname)\n landingReferer = currentReferer\n } else if (preservedReferer) {\n landingReferer = preservedReferer\n if (!storedReferer) {\n sessionStorage.setItem(JMP_LANDING_REFERER_KEY, preservedReferer)\n }\n }\n\n const params = new URLSearchParams(window.location.search)\n const rawUtm = sessionStorage.getItem(JMP_UTM_SESSION_KEY)\n if (rawUtm) {\n const parsed = JSON.parse(rawUtm) as unknown\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n utm = parsed as Record<string, string>\n }\n }\n\n let updated = false\n for (const key of JMP_UTM_PARAM_KEYS) {\n const value = params.get(key)?.trim()\n if (value) {\n utm[key] = value\n updated = true\n }\n }\n\n if (updated) {\n sessionStorage.setItem(JMP_UTM_SESSION_KEY, JSON.stringify(utm))\n }\n } catch {\n }\n\n return { landingReferer, utm }\n}\n\nexport function getOrCreateSessionIdFromStorage(): string | undefined {\n if (typeof window === \"undefined\" || !globalThis.crypto?.randomUUID) {\n return undefined\n }\n try {\n let id = sessionStorage.getItem(JMP_SESSION_ID_KEY)\n if (!id) {\n id = crypto.randomUUID()\n sessionStorage.setItem(JMP_SESSION_ID_KEY, id)\n }\n return id\n } catch {\n return undefined\n }\n}\n\n/** Inline script for Next.js `beforeInteractive` — capture referrer/UTM only (no network). */\nexport function buildLandingCaptureInlineScript(): string {\n const cookieMaxAge = String(LANDING_REFERER_COOKIE_MAX_AGE_SEC)\n\n return `(function(){try{var h=location.hostname;var ref=document.referrer||'';function rh(u){try{return new URL(u).hostname.replace(/^www\\\\./i,'').toLowerCase()}catch(e){try{return new URL('https://'+u).hostname.replace(/^www\\\\./i,'').toLowerCase()}catch(e2){return null}}}function ext(r){var x=rh(r);if(!x)return false;var s=h.replace(/^www\\\\./i,'').toLowerCase();return x!==s&&x.slice(-('.'+s).length)!==('.'+s)}function apexDom(hn){var s=hn.replace(/^www\\\\./i,'').toLowerCase();if(!s||s==='localhost'||/\\\\.local$/i.test(s)||s.indexOf('.')<0)return null;return s}function readCk(hn){var apex=apexDom(hn);if(!apex)return '';var pre='${JMP_LANDING_REFERER_COOKIE}=';var parts=document.cookie.split(';');for(var i=0;i<parts.length;i++){var t=parts[i].trim();if(t.indexOf(pre)===0){try{return decodeURIComponent(t.slice(pre.length)).trim()}catch(e){return ''}}}return ''}function writeCk(r,hn){var apex=apexDom(hn);if(!apex)return;var sec=location.protocol==='https:'?'; Secure':'';document.cookie='${JMP_LANDING_REFERER_COOKIE}='+encodeURIComponent(r.slice(0,2048))+'; Domain=.'+apex+'; Path=/; Max-Age=${cookieMaxAge}; SameSite=Lax'+sec}var stored=sessionStorage.getItem('${JMP_LANDING_REFERER_KEY}')||'';var ck=readCk(h);var preserved=stored||ck;var lr='';if(ref&&ext(ref)){sessionStorage.setItem('${JMP_LANDING_REFERER_KEY}',ref);writeCk(ref,h);lr=ref}else{lr=preserved||'';if(lr&&!stored)sessionStorage.setItem('${JMP_LANDING_REFERER_KEY}',lr)}var sid=sessionStorage.getItem('${JMP_SESSION_ID_KEY}');if(!sid&&crypto&&crypto.randomUUID){sid=crypto.randomUUID();sessionStorage.setItem('${JMP_SESSION_ID_KEY}',sid)}try{var sp=new URLSearchParams(location.search);var utm={};var updated=false;['utm_source','utm_medium','utm_campaign','utm_content','utm_term'].forEach(function(n){var v=sp.get(n);if(v){utm[n]=v;updated=true}});if(updated)sessionStorage.setItem('${JMP_UTM_SESSION_KEY}',JSON.stringify(utm))}catch(e){}}catch(e){}})();`\n}\n","/** Published package version — sent with capabilities for admin readiness. */\nexport const JMP_ANALYTICS_SDK_VERSION = \"0.1.26\"\n\n/** `localStorage` key when {@link JmpAnalyticsConfig.requireConsent} is enabled. */\nexport const JMP_TRACKING_CONSENT_STORAGE_KEY = \"jmp_analytics_consent_v1\"\n\n/** Default `pageViewDedupeMs` when resolving browser config from env (Strict Mode / SPA). */\nexport const DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS = 2500\n\n/** Marks links tracked explicitly — skips delegated `autoTrackContactLinks` handler. */\nexport const JMP_TRACKED_LINK_ATTR = \"data-jmp-tracked\"\n","import type { JmpServerRequestLike } from \"./types\"\n\n/** CDN / Next.js often return HTML error pages; API errors are JSON */\nexport function responseLooksLikeHtml(body: string): boolean {\n const s = body.trimStart()\n return (\n s.startsWith(\"<!\") ||\n s.toLowerCase().startsWith(\"<html\") ||\n (s.startsWith(\"<\") && /<html[\\s>]/i.test(s.slice(0, 500)))\n )\n}\n\nexport function normalizeBaseUrl(baseUrl: string): string {\n return baseUrl.replace(/\\/$/, \"\")\n}\n\nexport function getHeader(\n headers: JmpServerRequestLike[\"headers\"] | undefined,\n key: string\n): string | null {\n if (!headers) {\n return null\n }\n if (typeof (headers as Pick<Headers, \"get\">).get === \"function\") {\n return (headers as Pick<Headers, \"get\">).get(key)\n }\n const record = headers as Record<string, string | string[] | undefined | null>\n const direct = record[key] ?? record[key.toLowerCase()]\n if (Array.isArray(direct)) {\n return direct[0] ?? null\n }\n return direct ?? null\n}\n\nexport function pathFromRequestUrl(url: string | undefined): string {\n if (!url) {\n return \"/\"\n }\n try {\n const u = new URL(url)\n return `${u.pathname}${u.search}`\n } catch {\n return url.startsWith(\"/\") ? url : \"/\"\n }\n}\n\nexport function resolveFetch(\n fetchImpl: typeof fetch | undefined,\n context: string\n): typeof fetch {\n const resolved =\n fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n if (!resolved) {\n throw new Error(`${context}: fetch is not available; pass fetchImpl in config`)\n }\n return resolved\n}\n\ntype ApiErrorJson = {\n error?: string\n code?: string\n hint?: string\n expectedDomain?: string\n}\n\nexport function formatApiErrorMessage(\n status: number,\n text: string,\n prefix: string\n): string {\n if (responseLooksLikeHtml(text)) {\n return `${prefix} HTTP ${status} — response was HTML (not the JSON API). Check baseUrl points at the JMP Analytics dashboard.`\n }\n let parsed: ApiErrorJson = {}\n try {\n parsed = JSON.parse(text) as ApiErrorJson\n } catch {\n parsed = { error: text }\n }\n const detail = parsed.error ?? text\n return [\n `${prefix} HTTP ${status}`,\n parsed.code ? `[${parsed.code}]` : null,\n detail,\n parsed.hint ? `Hint: ${parsed.hint}` : null,\n parsed.expectedDomain\n ? `Domain in JMP admin: ${parsed.expectedDomain}`\n : null,\n ]\n .filter(Boolean)\n .join(\" — \")\n}\n","import { normalizeBaseUrl, resolveFetch, responseLooksLikeHtml } from \"../http\"\nimport type { JmpContentConfig } from \"../types\"\n\nexport async function getContent<T>(\n config: JmpContentConfig,\n path: string\n): Promise<T> {\n const text = await getContentText(config, path)\n\n try {\n return JSON.parse(text) as T\n } catch {\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const url = `${baseUrl}${path}`\n throw new Error(`JMP content HTTP 200 — ${url} returned invalid JSON.`)\n }\n}\n\nexport async function getContentText(\n config: JmpContentConfig,\n path: string\n): Promise<string> {\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const resolvedFetch =\n config.fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n\n if (!resolvedFetch) {\n throw new Error(\"JMP content: fetch is not available; pass fetchImpl in config\")\n }\n\n const url = `${baseUrl}${path}`\n\n if (config.debug) {\n console.debug(\"[@jmp-technologies/analytics]\", \"GET\", url)\n }\n\n const res = await resolvedFetch(url, {\n method: \"GET\",\n headers: {\n \"X-JMP-Tracking-Key\": config.trackingKey,\n },\n })\n\n const text = await res.text()\n\n if (!res.ok) {\n if (responseLooksLikeHtml(text)) {\n throw new Error(\n `JMP content HTTP ${res.status} — ${url} returned HTML (not the JSON API). ` +\n `Set baseUrl to your JMP Analytics dashboard origin.`\n )\n }\n\n let parsed: { error?: string; hint?: string } = {}\n try {\n parsed = JSON.parse(text) as typeof parsed\n } catch {\n parsed = { error: text }\n }\n\n throw new Error(\n [`JMP content HTTP ${res.status}`, parsed.error, parsed.hint]\n .filter(Boolean)\n .join(\" — \")\n )\n }\n\n return text\n}\n","import type { JmpContentConfig, JmpContentWrapper, JmpTrustBundle } from \"../types\"\n\n/** Stable report order (matches dashboard `CLIENT_REPORTABLE_WRAPPER_SLOTS`). */\nconst WRAPPER_SLOT_ORDER: readonly string[] = [\n \"blog\",\n \"faq\",\n \"contact\",\n \"trust\",\n \"trust.summary\",\n \"trust.testimonials\",\n \"trust.reviews\",\n \"trust.stats\",\n \"trust.logos\",\n \"trust.credentials\",\n]\n\nconst discovered = new Set<string>()\nlet syncTimer: ReturnType<typeof setTimeout> | null = null\nlet pendingSyncConfig: JmpContentConfig | null = null\n\nconst reportedDedupeKeys = new Set<string>()\nlet syncHandler: ((config: JmpContentConfig) => Promise<unknown>) | null = null\n\nexport function markContentWrapper(slot: JmpContentWrapper | string): void {\n const normalized = slot.trim().toLowerCase()\n if (!normalized) {\n return\n }\n discovered.add(normalized)\n}\n\nexport function markTrustBundleWrappers(bundle: JmpTrustBundle): void {\n for (const slot of inferTrustWrapperSlots(bundle)) {\n discovered.add(slot)\n }\n}\n\nexport function inferTrustWrapperSlots(bundle: JmpTrustBundle): string[] {\n const slots = new Set<string>([\"trust\"])\n const { summary, testimonials, stats, logos, credentials } = bundle\n\n const hasSummary =\n summary.google_rating != null ||\n summary.google_review_count != null ||\n Boolean(summary.google_reviews_url?.trim()) ||\n Boolean(summary.yelp_url?.trim()) ||\n Boolean(summary.trustpilot_url?.trim()) ||\n Boolean(summary.disclaimer?.trim())\n\n if (hasSummary) {\n slots.add(\"trust.summary\")\n }\n\n let hasTestimonials = false\n let hasReviews = false\n for (const item of testimonials) {\n const bucket = item.placement?.trim().toLowerCase()\n if (bucket === \"reviews\") {\n hasReviews = true\n } else {\n hasTestimonials = true\n }\n }\n if (hasTestimonials) {\n slots.add(\"trust.testimonials\")\n }\n if (hasReviews) {\n slots.add(\"trust.reviews\")\n }\n if (stats.length > 0) {\n slots.add(\"trust.stats\")\n }\n if (logos.length > 0) {\n slots.add(\"trust.logos\")\n }\n if (credentials.length > 0) {\n slots.add(\"trust.credentials\")\n }\n\n return sortWrapperSlots([...slots])\n}\n\nexport function getDiscoveredContentWrappers(): string[] {\n return sortWrapperSlots([...discovered])\n}\n\nexport function resolveContentWrappersForReport(\n config: JmpContentConfig\n): string[] {\n const explicit = config.contentWrappers ?? []\n const auto = getDiscoveredContentWrappers()\n\n if (config.contentWrapperMode === \"manual\") {\n return sortWrapperSlots([...explicit])\n }\n\n if (config.contentWrapperMode === \"explicit-only\") {\n return sortWrapperSlots([...explicit])\n }\n\n const merged = new Set<string>([...explicit, ...auto])\n return sortWrapperSlots([...merged])\n}\n\nexport function hasReportedContentWrappers(dedupeKey: string): boolean {\n return reportedDedupeKeys.has(dedupeKey)\n}\n\nexport function rememberReportedContentWrappers(dedupeKey: string): void {\n reportedDedupeKeys.add(dedupeKey)\n}\n\nexport function setContentWrapperSyncHandler(\n handler: (config: JmpContentConfig) => Promise<unknown>\n): void {\n syncHandler = handler\n}\n\n/**\n * Debounced POST after content APIs run (build SSG, first page hit, etc.).\n */\nexport function scheduleContentWrapperSync(config: JmpContentConfig): void {\n if (!syncHandler) {\n return\n }\n pendingSyncConfig = config\n if (syncTimer) {\n clearTimeout(syncTimer)\n }\n syncTimer = setTimeout(() => {\n syncTimer = null\n const cfg = pendingSyncConfig\n pendingSyncConfig = null\n if (!cfg || !syncHandler) {\n return\n }\n void syncHandler(cfg).catch(() => {})\n }, 750)\n}\n\nexport function resetContentWrapperDiscoveryForTests(): void {\n discovered.clear()\n reportedDedupeKeys.clear()\n syncHandler = null\n if (syncTimer) {\n clearTimeout(syncTimer)\n syncTimer = null\n }\n pendingSyncConfig = null\n}\n\nfunction sortWrapperSlots(slots: string[]): string[] {\n const order = new Map(WRAPPER_SLOT_ORDER.map((slot, index) => [slot, index]))\n return [...new Set(slots)].sort((a, b) => {\n const ai = order.get(a) ?? 999\n const bi = order.get(b) ?? 999\n if (ai !== bi) {\n return ai - bi\n }\n return a.localeCompare(b)\n })\n}\n","import { JMP_ANALYTICS_SDK_VERSION } from \"../constants\"\nimport { normalizeBaseUrl, resolveFetch } from \"../http\"\nimport type {\n JmpBlogPost,\n JmpContentConfig,\n JmpFaqItem,\n JmpLandingPage,\n JmpLandingPageDetail,\n JmpLandingPageKind,\n JmpLandingPageSitemapEntry,\n JmpSiteProfile,\n JmpTrustBundle,\n} from \"../types\"\nimport { getContent, getContentText } from \"./fetch\"\nimport {\n hasReportedContentWrappers,\n markContentWrapper,\n markTrustBundleWrappers,\n rememberReportedContentWrappers,\n resolveContentWrappersForReport,\n scheduleContentWrapperSync,\n setContentWrapperSyncHandler,\n} from \"./wrapper-discovery\"\n\nexport {\n getDiscoveredContentWrappers,\n inferTrustWrapperSlots,\n markContentWrapper,\n markTrustBundleWrappers,\n resetContentWrapperDiscoveryForTests,\n} from \"./wrapper-discovery\"\n\nfunction afterContentWrapperUse(config: JmpContentConfig): void {\n scheduleContentWrapperSync(config)\n}\n\nexport async function getJmpBlogPosts(\n config: JmpContentConfig\n): Promise<JmpBlogPost[]> {\n const data = await getContent<{ posts: JmpBlogPost[] }>(\n config,\n \"/api/content/blog\"\n )\n markContentWrapper(\"blog\")\n afterContentWrapperUse(config)\n return data.posts\n}\n\nexport async function getJmpBlogPost(\n config: JmpContentConfig,\n slug: string\n): Promise<JmpBlogPost | null> {\n try {\n const data = await getContent<{ post: JmpBlogPost }>(\n config,\n `/api/content/blog/${encodeURIComponent(slug)}`\n )\n markContentWrapper(\"blog\")\n afterContentWrapperUse(config)\n return data.post\n } catch (error) {\n if (error instanceof Error && error.message.includes(\"HTTP 404\")) {\n return null\n }\n throw error\n }\n}\n\nexport async function getJmpFaqs(\n config: JmpContentConfig\n): Promise<JmpFaqItem[]> {\n const data = await getContent<{ faqs: JmpFaqItem[] }>(\n config,\n \"/api/content/faqs\"\n )\n markContentWrapper(\"faq\")\n afterContentWrapperUse(config)\n return data.faqs\n}\n\nexport async function getJmpLandingPages(\n config: JmpContentConfig,\n filters?: { kind?: JmpLandingPageKind; locale?: string }\n): Promise<JmpLandingPage[]> {\n const params = new URLSearchParams()\n if (filters?.kind) {\n params.set(\"kind\", filters.kind)\n }\n if (filters?.locale) {\n params.set(\"locale\", filters.locale)\n }\n const query = params.toString()\n const data = await getContent<{ pages: JmpLandingPage[] }>(\n config,\n `/api/content/landing-pages${query ? `?${query}` : \"\"}`\n )\n markContentWrapper(\"landing\")\n afterContentWrapperUse(config)\n return data.pages\n}\n\nexport async function getJmpLandingPageDetail(\n config: JmpContentConfig,\n kind: JmpLandingPageKind,\n slug: string,\n locale?: string\n): Promise<JmpLandingPageDetail | null> {\n const params = new URLSearchParams()\n if (locale) {\n params.set(\"locale\", locale)\n }\n const query = params.toString()\n try {\n const detail = await getContent<JmpLandingPageDetail>(\n config,\n `/api/content/landing-pages/${encodeURIComponent(kind)}/${encodeURIComponent(slug)}${query ? `?${query}` : \"\"}`\n )\n markContentWrapper(\"landing\")\n afterContentWrapperUse(config)\n return detail\n } catch (error) {\n if (error instanceof Error && error.message.includes(\"HTTP 404\")) {\n return null\n }\n throw error\n }\n}\n\nexport async function getJmpLandingPageSitemap(\n config: JmpContentConfig\n): Promise<JmpLandingPageSitemapEntry[]> {\n const data = await getContent<{ entries: JmpLandingPageSitemapEntry[] }>(\n config,\n \"/api/content/landing-pages/sitemap\"\n )\n markContentWrapper(\"landing\")\n afterContentWrapperUse(config)\n return data.entries\n}\n\nexport async function getJmpTrustBundle(\n config: JmpContentConfig\n): Promise<JmpTrustBundle> {\n const bundle = await getContent<JmpTrustBundle>(config, \"/api/content/trust\")\n markTrustBundleWrappers(bundle)\n afterContentWrapperUse(config)\n return bundle\n}\n\nexport async function getJmpSiteProfile(\n config: JmpContentConfig\n): Promise<JmpSiteProfile> {\n const data = await getContent<{ site: JmpSiteProfile }>(\n config,\n \"/api/content/site\"\n )\n markContentWrapper(\"contact\")\n afterContentWrapperUse(config)\n return data.site\n}\n\nexport async function getJmpRobotsTxt(config: JmpContentConfig): Promise<string> {\n return getContentText(config, \"/api/content/robots\")\n}\n\n/**\n * Tell the JMP dashboard which content wrappers this site wires (blog, faq, trust.*, contact).\n * Uses auto-discovered slots from content API usage unless `contentWrapperMode` is `manual`.\n * Safe to call on every cold start; dedupes by tracking key + wrapper list.\n */\nexport async function registerJmpContentWrappers(\n config: JmpContentConfig\n): Promise<\n { ok: true; wrappers: string[] } | { ok: false; skipped: true }\n> {\n const wrappers = resolveContentWrappersForReport(config)\n if (!wrappers.length) {\n return { ok: false, skipped: true }\n }\n\n const dedupeKey = `${config.trackingKey}:${[...wrappers].sort().join(\",\")}`\n if (hasReportedContentWrappers(dedupeKey)) {\n return { ok: true, wrappers }\n }\n\n const baseUrl = normalizeBaseUrl(config.baseUrl)\n const resolvedFetch =\n config.fetchImpl ??\n (typeof globalThis !== \"undefined\" && globalThis.fetch\n ? globalThis.fetch.bind(globalThis)\n : undefined)\n\n if (!resolvedFetch) {\n throw new Error(\n \"JMP content wrappers: fetch is not available; pass fetchImpl in config\"\n )\n }\n\n const url = `${baseUrl}/api/content/capabilities`\n if (config.debug) {\n console.debug(\"[@jmp-technologies/analytics]\", \"POST\", url, { wrappers })\n }\n\n const res = await resolvedFetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-JMP-Tracking-Key\": config.trackingKey,\n },\n body: JSON.stringify({\n wrappers,\n sdkVersion: JMP_ANALYTICS_SDK_VERSION,\n }),\n })\n\n const text = await res.text()\n if (!res.ok) {\n let parsed: { error?: string; hint?: string } = {}\n try {\n parsed = JSON.parse(text) as typeof parsed\n } catch {\n parsed = { error: text }\n }\n throw new Error(\n [`JMP content wrappers HTTP ${res.status}`, parsed.error, parsed.hint]\n .filter(Boolean)\n .join(\" — \")\n )\n }\n\n rememberReportedContentWrappers(dedupeKey)\n const data = JSON.parse(text) as { wrappers?: string[] }\n return { ok: true, wrappers: data.wrappers ?? wrappers }\n}\n\nsetContentWrapperSyncHandler(registerJmpContentWrappers)\n","/**\n * Public env vars for JMP — supports Next.js (`NEXT_PUBLIC_*`) and Astro (`PUBLIC_*`).\n * Server/build: `process.env`. Astro client bundles: pass overrides from `import.meta.env`.\n */\n\nexport type JmpPublicEnv = {\n analyticsUrl?: string\n trackingKey?: string\n requireConsent?: boolean\n autoContactLinks?: boolean\n}\n\nfunction firstDefined(...values: (string | undefined)[]): string | undefined {\n for (const v of values) {\n if (v) return v\n }\n return undefined\n}\n\n/** Static reads so Next.js / Vite inline `NEXT_PUBLIC_*` into client bundles. */\nfunction readJmpPublicEnvFromProcessEnv(): Omit<JmpPublicEnv, never> {\n if (typeof process === \"undefined\" || !process.env) {\n return {}\n }\n const { env } = process\n const analyticsUrl = firstDefined(\n env.NEXT_PUBLIC_JMP_ANALYTICS_URL,\n env.PUBLIC_JMP_ANALYTICS_URL,\n )\n const trackingKey = firstDefined(\n env.NEXT_PUBLIC_JMP_TRACKING_KEY,\n env.PUBLIC_JMP_TRACKING_KEY,\n )\n const requireConsentRaw = firstDefined(\n env.NEXT_PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT,\n env.PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT,\n )\n const autoContactRaw = firstDefined(\n env.NEXT_PUBLIC_JMP_AUTO_CONTACT_LINKS,\n env.PUBLIC_JMP_AUTO_CONTACT_LINKS,\n )\n\n return {\n analyticsUrl,\n trackingKey,\n requireConsent: requireConsentRaw === \"true\",\n autoContactLinks: autoContactRaw === \"true\",\n }\n}\n\n/** Read dashboard URL + tracking key from Node / build-time env. */\nexport function readJmpPublicEnvFromProcess(\n overrides?: Partial<JmpPublicEnv>,\n): JmpPublicEnv {\n const fromEnv = readJmpPublicEnvFromProcessEnv()\n\n return {\n analyticsUrl: firstDefined(overrides?.analyticsUrl, fromEnv.analyticsUrl),\n trackingKey: firstDefined(overrides?.trackingKey, fromEnv.trackingKey),\n requireConsent: overrides?.requireConsent ?? fromEnv.requireConsent,\n autoContactLinks:\n overrides?.autoContactLinks ?? fromEnv.autoContactLinks,\n }\n}\n\n/** Read from Astro/Vite `import.meta.env` in client scripts. */\nexport function readJmpPublicEnvFromImportMeta(\n meta: Record<string, unknown> | undefined,\n overrides?: Partial<JmpPublicEnv>,\n): JmpPublicEnv {\n const get = (key: string): string | undefined => {\n const v = meta?.[key]\n return typeof v === \"string\" && v.length > 0 ? v : undefined\n }\n\n const analyticsUrl = firstDefined(\n overrides?.analyticsUrl,\n get(\"PUBLIC_JMP_ANALYTICS_URL\"),\n get(\"NEXT_PUBLIC_JMP_ANALYTICS_URL\"),\n )\n const trackingKey = firstDefined(\n overrides?.trackingKey,\n get(\"PUBLIC_JMP_TRACKING_KEY\"),\n get(\"NEXT_PUBLIC_JMP_TRACKING_KEY\"),\n )\n const requireConsentRaw = firstDefined(\n overrides?.requireConsent !== undefined\n ? String(overrides.requireConsent)\n : undefined,\n get(\"PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT\"),\n get(\"NEXT_PUBLIC_JMP_ANALYTICS_REQUIRE_CONSENT\"),\n )\n const autoContactRaw = firstDefined(\n overrides?.autoContactLinks !== undefined\n ? String(overrides.autoContactLinks)\n : undefined,\n get(\"PUBLIC_JMP_AUTO_CONTACT_LINKS\"),\n get(\"NEXT_PUBLIC_JMP_AUTO_CONTACT_LINKS\"),\n )\n\n return {\n analyticsUrl,\n trackingKey,\n requireConsent: requireConsentRaw === \"true\",\n autoContactLinks: autoContactRaw === \"true\",\n }\n}\n","import type { JmpContentConfig, JmpContentWrapper } from \"./types\"\nimport { readJmpPublicEnvFromProcess } from \"./env-public\"\n\n/** Per-site values used when the dashboard profile is missing or fields are empty. */\nexport type JmpSiteContactFallback = {\n displayName?: string\n founderName?: string\n email?: string\n phone?: string | null\n linkedin?: string | null\n hours?: string | null\n serviceArea?: string | null\n dashboardDemoUrl?: string\n profilePhotoSrc?: string\n privacyUrl?: string\n termsUrl?: string\n}\n\nexport type JmpSiteDefinition = {\n /**\n * Optional override. Wrappers are auto-discovered when content loaders run\n * (`loadBlogPosts`, `loadFaqs`, etc.) and reported to the dashboard.\n */\n contentWrappers?: JmpContentWrapper[]\n /**\n * Public site origin (no trailing slash), e.g. `https://example.com`.\n * Used to resolve relative profile image paths in structured data.\n */\n siteUrl?: string\n /**\n * JMP dashboard origin (no trailing slash), e.g. `https://portal.example.com`.\n * Fallback when `NEXT_PUBLIC_JMP_ANALYTICS_URL` is missing from the client bundle.\n */\n analyticsPortalUrl?: string\n contactFallback?: JmpSiteContactFallback\n /**\n * `extras` keys to read from the dashboard site profile (hyphenated keys from admin).\n */\n contactExtraKeys?: {\n founderName?: readonly string[]\n dashboardDemoUrl?: readonly string[]\n profilePhotoSrc?: readonly string[]\n hours?: readonly string[]\n serviceArea?: readonly string[]\n }\n}\n\nlet registeredSite: JmpSiteDefinition | null = null\n\n/**\n * Register site-specific JMP integration options once (typically from `jmp.config.ts`).\n * Call at module load time before server content or instrumentation runs.\n */\nexport function defineJmpSite(definition: JmpSiteDefinition): JmpSiteDefinition {\n registeredSite = definition\n return definition\n}\n\nexport function getJmpSiteDefinition(): JmpSiteDefinition | null {\n return registeredSite\n}\n\n/** Server content + lead config: env vars + wrappers from {@link defineJmpSite}. */\nexport function getJmpContentConfig(): JmpContentConfig | null {\n const { analyticsUrl, trackingKey } = readJmpPublicEnvFromProcess()\n if (!analyticsUrl || !trackingKey) {\n return null\n }\n const site = getJmpSiteDefinition()\n return {\n baseUrl: analyticsUrl,\n trackingKey,\n contentWrappers: site?.contentWrappers ?? undefined,\n }\n}\n","import {\n getJmpBlogPost,\n getJmpBlogPosts,\n getJmpFaqs,\n getJmpLandingPageDetail,\n getJmpLandingPageSitemap,\n getJmpLandingPages,\n getJmpSiteProfile,\n getJmpTrustBundle,\n type JmpBlogPost,\n type JmpFaqItem,\n type JmpLandingPage,\n type JmpLandingPageDetail,\n type JmpLandingPageKind,\n type JmpLandingPageSitemapEntry,\n type JmpSiteProfile,\n type JmpTestimonial,\n type JmpTrustBundle,\n} from \"../index\"\nimport { getJmpContentConfig, getJmpSiteDefinition } from \"../site-config\"\n\nexport type {\n JmpBlogPost,\n JmpFaqItem,\n JmpLandingPage,\n JmpLandingPageDetail,\n JmpLandingPageKind,\n JmpLandingPageSitemapEntry,\n JmpSiteProfile,\n JmpTestimonial,\n JmpTrustBundle,\n}\n\nexport { getJmpContentConfig } from \"../site-config\"\n\nexport type ResolvedSiteContact = {\n displayName: string\n email: string\n founderName: string\n dashboardDemoUrl: string\n profilePhotoSrc: string\n linkedin: string | null\n phone: string | null\n hours: string | null\n serviceArea: string | null\n privacyUrl: string\n termsUrl: string\n cta: { label: string | null; url: string | null }\n}\n\nconst DEFAULT_EXTRA_KEYS = {\n founderName: [\"founder-name\", \"founder_name\"],\n dashboardDemoUrl: [\"dashboard-demo-url\", \"sample-dashboard-url\"],\n profilePhotoSrc: [\"profile-photo-url\", \"profile_photo_url\"],\n hours: [\"hours\", \"business-hours\"],\n serviceArea: [\"service-area\", \"service_area\", \"service-area-text\"],\n} as const\n\nfunction sortBlogPosts(posts: JmpBlogPost[]): JmpBlogPost[] {\n return [...posts].sort((a, b) => {\n const da = a.published_at ?? a.updated_at\n const db = b.published_at ?? b.updated_at\n return db.localeCompare(da)\n })\n}\n\nfunction sortFaqs(items: JmpFaqItem[]): JmpFaqItem[] {\n return [...items].sort((a, b) => a.sort_order - b.sort_order)\n}\n\nfunction readProfileExtra(\n profile: JmpSiteProfile | null,\n keys: readonly string[],\n): string | null {\n for (const key of keys) {\n const value = profile?.extras?.[key]?.trim()\n if (value) {\n return value\n }\n }\n return null\n}\n\n/** Resolve a path or URL against {@link defineJmpSite}'s `siteUrl`. */\nexport function absoluteSiteAssetUrl(src: string): string {\n const trimmed = src.trim()\n if (trimmed.startsWith(\"http://\") || trimmed.startsWith(\"https://\")) {\n return trimmed\n }\n const siteUrl = getJmpSiteDefinition()?.siteUrl?.replace(/\\/$/, \"\")\n if (!siteUrl) {\n return trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`\n }\n return `${siteUrl}${trimmed.startsWith(\"/\") ? trimmed : `/${trimmed}`}`\n}\n\nexport async function loadSiteProfile(): Promise<JmpSiteProfile | null> {\n const config = getJmpContentConfig()\n if (!config) {\n return null\n }\n try {\n return await getJmpSiteProfile(config)\n } catch {\n return null\n }\n}\n\nexport function resolveSiteContact(profile: JmpSiteProfile | null): ResolvedSiteContact {\n const site = getJmpSiteDefinition()\n const fallback = site?.contactFallback ?? {}\n const extraKeys = {\n ...DEFAULT_EXTRA_KEYS,\n ...site?.contactExtraKeys,\n }\n\n const email = profile?.email?.trim() || fallback.email || \"\"\n const linkedin =\n profile?.social?.linkedin?.trim() || fallback.linkedin || null\n const phone = profile?.phone?.trim() || fallback.phone || null\n\n return {\n displayName:\n profile?.display_name?.trim() ||\n profile?.name?.trim() ||\n fallback.displayName ||\n \"\",\n founderName:\n readProfileExtra(profile, extraKeys.founderName ?? []) ||\n fallback.founderName ||\n \"\",\n dashboardDemoUrl:\n readProfileExtra(profile, extraKeys.dashboardDemoUrl ?? []) ||\n fallback.dashboardDemoUrl ||\n \"\",\n profilePhotoSrc:\n readProfileExtra(profile, extraKeys.profilePhotoSrc ?? []) ||\n fallback.profilePhotoSrc ||\n \"\",\n email,\n linkedin,\n phone,\n hours:\n readProfileExtra(profile, extraKeys.hours ?? []) || fallback.hours || null,\n serviceArea:\n readProfileExtra(profile, extraKeys.serviceArea ?? []) ||\n fallback.serviceArea ||\n null,\n privacyUrl: profile?.legal?.privacy_policy_url?.trim() || fallback.privacyUrl || \"/privacy\",\n termsUrl: profile?.legal?.terms_url?.trim() || fallback.termsUrl || \"/terms\",\n cta: {\n label: profile?.cta?.label?.trim() || null,\n url: profile?.cta?.url?.trim() || null,\n },\n }\n}\n\nexport async function getResolvedSiteContact(): Promise<ResolvedSiteContact> {\n const profile = await loadSiteProfile()\n return resolveSiteContact(profile)\n}\n\nexport async function loadBlogPosts(): Promise<JmpBlogPost[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n const posts = await getJmpBlogPosts(c)\n return sortBlogPosts(posts)\n } catch {\n return []\n }\n}\n\nexport async function loadBlogPost(slug: string): Promise<JmpBlogPost | null> {\n const c = getJmpContentConfig()\n if (!c) {\n return null\n }\n try {\n return await getJmpBlogPost(c, slug)\n } catch {\n return null\n }\n}\n\nexport async function loadFaqs(): Promise<JmpFaqItem[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n const faqs = await getJmpFaqs(c)\n return sortFaqs(faqs)\n } catch {\n return []\n }\n}\n\nexport async function loadFaqBySlug(slug: string): Promise<JmpFaqItem | null> {\n const normalized = slug.trim()\n if (!normalized) {\n return null\n }\n const items = await loadFaqs()\n return (\n items.find((item) => item.slug === normalized || item.id === normalized) ?? null\n )\n}\n\nexport async function loadLandingPages(filters?: {\n kind?: JmpLandingPageKind\n locale?: string\n}): Promise<JmpLandingPage[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n return await getJmpLandingPages(c, filters)\n } catch {\n return []\n }\n}\n\nexport async function loadLandingPageDetail(\n kind: JmpLandingPageKind,\n slug: string,\n locale?: string\n): Promise<JmpLandingPageDetail | null> {\n const c = getJmpContentConfig()\n if (!c) {\n return null\n }\n try {\n return await getJmpLandingPageDetail(c, kind, slug, locale)\n } catch {\n return null\n }\n}\n\nexport async function loadLandingPageSitemap(): Promise<JmpLandingPageSitemapEntry[]> {\n const c = getJmpContentConfig()\n if (!c) {\n return []\n }\n try {\n return await getJmpLandingPageSitemap(c)\n } catch {\n return []\n }\n}\n\nexport async function loadTrustBundle(): Promise<JmpTrustBundle | null> {\n const c = getJmpContentConfig()\n if (!c) {\n return null\n }\n try {\n return await getJmpTrustBundle(c)\n } catch {\n return null\n }\n}\n\nexport function filterFeaturedTrustQuotes(\n testimonials: JmpTestimonial[],\n placement: \"testimonials\" | \"reviews\",\n limit = 2,\n): JmpTestimonial[] {\n return testimonials\n .filter((item) => {\n if (!item.featured) {\n return false\n }\n const bucket = item.placement?.trim().toLowerCase()\n if (placement === \"reviews\") {\n return bucket === \"reviews\"\n }\n return !bucket || bucket === \"testimonials\"\n })\n .sort((a, b) => a.sort_order - b.sort_order)\n .slice(0, limit)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA,gCAAAC;AAAA,EAAA,oBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,gBAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,uBAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;AAAA,mBAAsB;;;ACQtB,IAAM,qCAAqC,KAAK;;;ACPzC,IAAM,4BAA4B;;;ACElC,SAAS,sBAAsB,MAAuB;AAC3D,QAAM,IAAI,KAAK,UAAU;AACzB,SACE,EAAE,WAAW,IAAI,KACjB,EAAE,YAAY,EAAE,WAAW,OAAO,KACjC,EAAE,WAAW,GAAG,KAAK,cAAc,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;AAE5D;AAEO,SAAS,iBAAiB,SAAyB;AACxD,SAA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AAsB;AACvE,IAAMC,uBAAkB,oBAAkB,eAAe;","names":["absoluteSiteAssetUrl","filterFeaturedTrustQuotes","getResolvedSiteContact","loadBlogPost","loadBlogPosts","loadFaqBySlug","loadFaqs","loadLandingPageDetail","loadLandingPageSitemap","loadLandingPages","loadSiteProfile","loadTrustBundle","resolveSiteContact","absoluteSiteAssetUrl","resolveSiteContact","filterFeaturedTrustQuotes","loadSiteProfile","getResolvedSiteContact","loadBlogPosts","loadBlogPost","loadFaqs","loadFaqBySlug","loadLandingPages","loadLandingPageDetail","loadLandingPageSitemap","loadTrustBundle"]}
|
package/dist/next/content.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { absoluteSiteAssetUrl as absoluteSiteAssetUrl$1, filterFeaturedTrustQuotes as filterFeaturedTrustQuotes$1, getResolvedSiteContact as getResolvedSiteContact$1, loadBlogPost as loadBlogPost$1, loadBlogPosts as loadBlogPosts$1, loadFaqBySlug as loadFaqBySlug$1, loadFaqs as loadFaqs$1, loadSiteProfile as loadSiteProfile$1, loadTrustBundle as loadTrustBundle$1, resolveSiteContact as resolveSiteContact$1 } from '../astro/content.cjs';
|
|
1
|
+
import { absoluteSiteAssetUrl as absoluteSiteAssetUrl$1, filterFeaturedTrustQuotes as filterFeaturedTrustQuotes$1, getResolvedSiteContact as getResolvedSiteContact$1, loadBlogPost as loadBlogPost$1, loadBlogPosts as loadBlogPosts$1, loadFaqBySlug as loadFaqBySlug$1, loadFaqs as loadFaqs$1, loadLandingPageDetail as loadLandingPageDetail$1, loadLandingPageSitemap as loadLandingPageSitemap$1, loadLandingPages as loadLandingPages$1, loadSiteProfile as loadSiteProfile$1, loadTrustBundle as loadTrustBundle$1, resolveSiteContact as resolveSiteContact$1 } from '../astro/content.cjs';
|
|
2
2
|
export { ResolvedSiteContact } from '../astro/content.cjs';
|
|
3
|
-
export { J as JmpBlogPost, a as JmpFaqItem, b as
|
|
4
|
-
export { g as getJmpContentConfig } from '../site-config-
|
|
3
|
+
export { J as JmpBlogPost, a as JmpFaqItem, b as JmpLandingPage, c as JmpLandingPageDetail, d as JmpLandingPageKind, e as JmpLandingPageSitemapEntry, f as JmpSiteProfile, g as JmpTestimonial, h as JmpTrustBundle } from '../types-B-111Wht.cjs';
|
|
4
|
+
export { g as getJmpContentConfig } from '../site-config-CJqYnZm7.cjs';
|
|
5
5
|
|
|
6
6
|
declare const absoluteSiteAssetUrl: typeof absoluteSiteAssetUrl$1;
|
|
7
7
|
declare const resolveSiteContact: typeof resolveSiteContact$1;
|
|
@@ -12,6 +12,9 @@ declare const loadBlogPosts: typeof loadBlogPosts$1;
|
|
|
12
12
|
declare const loadBlogPost: typeof loadBlogPost$1;
|
|
13
13
|
declare const loadFaqs: typeof loadFaqs$1;
|
|
14
14
|
declare const loadFaqBySlug: typeof loadFaqBySlug$1;
|
|
15
|
+
declare const loadLandingPages: typeof loadLandingPages$1;
|
|
16
|
+
declare const loadLandingPageDetail: typeof loadLandingPageDetail$1;
|
|
17
|
+
declare const loadLandingPageSitemap: typeof loadLandingPageSitemap$1;
|
|
15
18
|
declare const loadTrustBundle: typeof loadTrustBundle$1;
|
|
16
19
|
|
|
17
|
-
export { absoluteSiteAssetUrl, filterFeaturedTrustQuotes, getResolvedSiteContact, loadBlogPost, loadBlogPosts, loadFaqBySlug, loadFaqs, loadSiteProfile, loadTrustBundle, resolveSiteContact };
|
|
20
|
+
export { absoluteSiteAssetUrl, filterFeaturedTrustQuotes, getResolvedSiteContact, loadBlogPost, loadBlogPosts, loadFaqBySlug, loadFaqs, loadLandingPageDetail, loadLandingPageSitemap, loadLandingPages, loadSiteProfile, loadTrustBundle, resolveSiteContact };
|