@sonordev/site-kit 3.0.5 → 3.2.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/AGENTS.md +107 -0
- package/agent-manifest.json +377 -0
- package/dist/AnalyticsProvider-CD635CHQ.mjs +8 -0
- package/dist/{AnalyticsProvider-MLT26JRP.mjs.map → AnalyticsProvider-CD635CHQ.mjs.map} +1 -1
- package/dist/AnalyticsProvider-WK2Z6AIN.js +29 -0
- package/dist/{AnalyticsProvider-WTOGN7LV.js.map → AnalyticsProvider-WK2Z6AIN.js.map} +1 -1
- package/dist/BlogPostFaqSection-4AD2NIGG.js +13 -0
- package/dist/{BlogPostFaqSection-H556RV62.js.map → BlogPostFaqSection-4AD2NIGG.js.map} +1 -1
- package/dist/{BlogPostFaqSection-VSHOKKUD.mjs → BlogPostFaqSection-TU6YEC7P.mjs} +3 -3
- package/dist/{BlogPostFaqSection-VSHOKKUD.mjs.map → BlogPostFaqSection-TU6YEC7P.mjs.map} +1 -1
- package/dist/ChatWidget-AIOOZY6H.js +17 -0
- package/dist/{ChatWidget-MAL7FB4M.js.map → ChatWidget-AIOOZY6H.js.map} +1 -1
- package/dist/ChatWidget-UAAWDBNS.mjs +8 -0
- package/dist/{ChatWidget-QPZTPSPE.mjs.map → ChatWidget-UAAWDBNS.mjs.map} +1 -1
- package/dist/EngageWidget-EZ5T6H3K.mjs +7 -0
- package/dist/{EngageWidget-IPBUA4DW.mjs.map → EngageWidget-EZ5T6H3K.mjs.map} +1 -1
- package/dist/EngageWidget-RWVWW56C.js +16 -0
- package/dist/{EngageWidget-N3CABK3L.js.map → EngageWidget-RWVWW56C.js.map} +1 -1
- package/dist/{SignalCore-4MDIJUAP.mjs → SignalCore-4B4RNYLV.mjs} +60 -47
- package/dist/SignalCore-4B4RNYLV.mjs.map +1 -0
- package/dist/{SignalCore-ZMFUE3N4.js → SignalCore-AECW2JFP.js} +60 -47
- package/dist/SignalCore-AECW2JFP.js.map +1 -0
- package/dist/SitemapSync-AICU4SSV.js +15 -0
- package/dist/{SitemapSync-FUCH6Y6J.js.map → SitemapSync-AICU4SSV.js.map} +1 -1
- package/dist/SitemapSync-CIZCAZXK.mjs +6 -0
- package/dist/{SitemapSync-LCSPRAWU.mjs.map → SitemapSync-CIZCAZXK.mjs.map} +1 -1
- package/dist/analytics/index.js +11 -9
- package/dist/analytics/index.mjs +4 -2
- package/dist/blog/index.js +12 -12
- package/dist/blog/index.mjs +2 -2
- package/dist/blog/server-ui.js +5 -5
- package/dist/blog/server-ui.mjs +1 -1
- package/dist/brand.css +8 -3
- package/dist/{chunk-QTWA44S3.mjs → chunk-2WYEJOGA.mjs} +7 -8
- package/dist/chunk-2WYEJOGA.mjs.map +1 -0
- package/dist/{chunk-AN4ATCYQ.mjs → chunk-45QHDA7Q.mjs} +3 -3
- package/dist/{chunk-AN4ATCYQ.mjs.map → chunk-45QHDA7Q.mjs.map} +1 -1
- package/dist/{chunk-RI6JZUAE.js → chunk-4FBV5BJW.js} +7 -8
- package/dist/chunk-4FBV5BJW.js.map +1 -0
- package/dist/{chunk-YJWKHCOB.js → chunk-4NTMIU6V.js} +13 -11
- package/dist/chunk-4NTMIU6V.js.map +1 -0
- package/dist/{chunk-YFGKIKXA.mjs → chunk-57QV6NIY.mjs} +3 -3
- package/dist/{chunk-YFGKIKXA.mjs.map → chunk-57QV6NIY.mjs.map} +1 -1
- package/dist/chunk-5OWZUNNE.js +102 -0
- package/dist/chunk-5OWZUNNE.js.map +1 -0
- package/dist/{chunk-EUDTPXUI.mjs → chunk-6HPNFWSC.mjs} +3 -3
- package/dist/{chunk-EUDTPXUI.mjs.map → chunk-6HPNFWSC.mjs.map} +1 -1
- package/dist/{chunk-FT5JNCD4.mjs → chunk-AB2VYIYU.mjs} +11 -11
- package/dist/{chunk-FT5JNCD4.mjs.map → chunk-AB2VYIYU.mjs.map} +1 -1
- package/dist/{chunk-I5TJIESQ.js → chunk-BMKZHXWQ.js} +11 -11
- package/dist/{chunk-I5TJIESQ.js.map → chunk-BMKZHXWQ.js.map} +1 -1
- package/dist/{chunk-KHFNPPOX.mjs → chunk-DSRPKUQI.mjs} +6 -6
- package/dist/{chunk-KHFNPPOX.mjs.map → chunk-DSRPKUQI.mjs.map} +1 -1
- package/dist/chunk-EAASMIWX.js +258 -0
- package/dist/chunk-EAASMIWX.js.map +1 -0
- package/dist/{chunk-T4QBSRA4.mjs → chunk-EIWRPGOK.mjs} +37 -60
- package/dist/chunk-EIWRPGOK.mjs.map +1 -0
- package/dist/{chunk-O7E6QVK3.js → chunk-GCDVKOSM.js} +3 -3
- package/dist/{chunk-O7E6QVK3.js.map → chunk-GCDVKOSM.js.map} +1 -1
- package/dist/{chunk-KMZ527EM.mjs → chunk-GN62H6EG.mjs} +34 -8
- package/dist/chunk-GN62H6EG.mjs.map +1 -0
- package/dist/{chunk-UJQYSVYV.js → chunk-GQF6QAQS.js} +4 -4
- package/dist/{chunk-UJQYSVYV.js.map → chunk-GQF6QAQS.js.map} +1 -1
- package/dist/{chunk-MLJXELPA.js → chunk-HAZN43I6.js} +60 -94
- package/dist/chunk-HAZN43I6.js.map +1 -0
- package/dist/chunk-LZSCCJ4O.mjs +253 -0
- package/dist/chunk-LZSCCJ4O.mjs.map +1 -0
- package/dist/{chunk-TCVHI3JP.mjs → chunk-N2HR2E4Z.mjs} +60 -92
- package/dist/chunk-N2HR2E4Z.mjs.map +1 -0
- package/dist/{chunk-VCWSSGCU.js → chunk-NAVDN4AE.js} +7 -7
- package/dist/{chunk-VCWSSGCU.js.map → chunk-NAVDN4AE.js.map} +1 -1
- package/dist/chunk-NDHFU4HV.mjs +97 -0
- package/dist/chunk-NDHFU4HV.mjs.map +1 -0
- package/dist/{chunk-PST3NOEM.mjs → chunk-O237KKCX.mjs} +4 -4
- package/dist/{chunk-PST3NOEM.mjs.map → chunk-O237KKCX.mjs.map} +1 -1
- package/dist/{chunk-5AESOLXS.mjs → chunk-OTY7EWET.mjs} +13 -11
- package/dist/chunk-OTY7EWET.mjs.map +1 -0
- package/dist/chunk-Q2NBD54V.js +69 -0
- package/dist/chunk-Q2NBD54V.js.map +1 -0
- package/dist/{chunk-DGHPOWLU.js → chunk-R5A64DCX.js} +8 -8
- package/dist/{chunk-DGHPOWLU.js.map → chunk-R5A64DCX.js.map} +1 -1
- package/dist/{chunk-3YQCPLGP.mjs → chunk-RFIWVH3D.mjs} +41 -79
- package/dist/chunk-RFIWVH3D.mjs.map +1 -0
- package/dist/{chunk-NNZDHLXN.js → chunk-S3YQGTBF.js} +35 -9
- package/dist/chunk-S3YQGTBF.js.map +1 -0
- package/dist/{chunk-IBDVZ6BF.js → chunk-SLWTG2LJ.js} +69 -74
- package/dist/chunk-SLWTG2LJ.js.map +1 -0
- package/dist/chunk-SN2O72UF.mjs +6 -0
- package/dist/chunk-SN2O72UF.mjs.map +1 -0
- package/dist/{chunk-65SMJBHW.mjs → chunk-T2DEEKVQ.mjs} +69 -74
- package/dist/chunk-T2DEEKVQ.mjs.map +1 -0
- package/dist/{chunk-3GCEFS73.js → chunk-TE3W5REY.js} +39 -62
- package/dist/chunk-TE3W5REY.js.map +1 -0
- package/dist/{chunk-IFVMZFNT.js → chunk-TVCCZ7NR.js} +41 -79
- package/dist/chunk-TVCCZ7NR.js.map +1 -0
- package/dist/{chunk-EBJ4S5DU.js → chunk-UT2CF4FC.js} +4 -4
- package/dist/{chunk-EBJ4S5DU.js.map → chunk-UT2CF4FC.js.map} +1 -1
- package/dist/chunk-V6NVBFEP.js +54 -0
- package/dist/chunk-V6NVBFEP.js.map +1 -0
- package/dist/chunk-WRZQS7O4.js +8 -0
- package/dist/chunk-WRZQS7O4.js.map +1 -0
- package/dist/chunk-WZHWWOUC.js +51 -0
- package/dist/chunk-WZHWWOUC.js.map +1 -0
- package/dist/chunk-X3S6KXAP.mjs +47 -0
- package/dist/chunk-X3S6KXAP.mjs.map +1 -0
- package/dist/chunk-X4OPM3SK.mjs +43 -0
- package/dist/chunk-X4OPM3SK.mjs.map +1 -0
- package/dist/chunk-ZPLN537Q.mjs +57 -0
- package/dist/chunk-ZPLN537Q.mjs.map +1 -0
- package/dist/cli/index.js +8986 -1276
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +8972 -1280
- package/dist/cli/index.mjs.map +1 -1
- package/dist/commerce/index.js +50 -48
- package/dist/commerce/index.mjs +5 -3
- package/dist/engage/index.js +11 -8
- package/dist/engage/index.js.map +1 -1
- package/dist/engage/index.mjs +8 -5
- package/dist/engage/index.mjs.map +1 -1
- package/dist/fleet/contract.d.mts +99 -0
- package/dist/fleet/contract.d.ts +99 -0
- package/dist/fleet/contract.js +53 -0
- package/dist/fleet/contract.js.map +1 -0
- package/dist/fleet/contract.mjs +4 -0
- package/dist/fleet/contract.mjs.map +1 -0
- package/dist/fleet/index.d.mts +89 -0
- package/dist/fleet/index.d.ts +89 -0
- package/dist/fleet/index.js +74 -0
- package/dist/fleet/index.js.map +1 -0
- package/dist/fleet/index.mjs +9 -0
- package/dist/fleet/index.mjs.map +1 -0
- package/dist/forms/contract.d.mts +69 -0
- package/dist/forms/contract.d.ts +69 -0
- package/dist/forms/contract.js +33 -0
- package/dist/forms/contract.js.map +1 -0
- package/dist/forms/contract.mjs +4 -0
- package/dist/forms/contract.mjs.map +1 -0
- package/dist/forms/index.js +21 -17
- package/dist/forms/index.js.map +1 -1
- package/dist/forms/index.mjs +14 -10
- package/dist/forms/index.mjs.map +1 -1
- package/dist/forms/styles.css +10 -8
- package/dist/images/index.js +10 -8
- package/dist/images/index.mjs +3 -1
- package/dist/index.js +98 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/dist/layout/client.d.mts +8 -1
- package/dist/layout/client.d.ts +8 -1
- package/dist/layout/client.js +8 -3
- package/dist/layout/client.mjs +7 -2
- package/dist/layout/index.d.mts +7 -1
- package/dist/layout/index.d.ts +7 -1
- package/dist/layout/index.js +57 -4
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/index.mjs +56 -3
- package/dist/layout/index.mjs.map +1 -1
- package/dist/maps/index.js +9 -18
- package/dist/maps/index.js.map +1 -1
- package/dist/maps/index.mjs +9 -18
- package/dist/maps/index.mjs.map +1 -1
- package/dist/portfolio/contract.d.mts +61 -0
- package/dist/portfolio/contract.d.ts +61 -0
- package/dist/portfolio/contract.js +43 -0
- package/dist/portfolio/contract.js.map +1 -0
- package/dist/portfolio/contract.mjs +38 -0
- package/dist/portfolio/contract.mjs.map +1 -0
- package/dist/seo/client.js +4 -2
- package/dist/seo/client.mjs +3 -1
- package/dist/seo/index.js +4 -2
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +3 -1
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-pages/contract.d.mts +62 -0
- package/dist/seo-pages/contract.d.ts +62 -0
- package/dist/seo-pages/contract.js +48 -0
- package/dist/seo-pages/contract.js.map +1 -0
- package/dist/seo-pages/contract.mjs +44 -0
- package/dist/seo-pages/contract.mjs.map +1 -0
- package/dist/signal/index.js +11 -11
- package/dist/signal/index.mjs +2 -2
- package/dist/sites/contract.d.mts +57 -0
- package/dist/sites/contract.d.ts +57 -0
- package/dist/sites/contract.js +37 -0
- package/dist/sites/contract.js.map +1 -0
- package/dist/sites/contract.mjs +4 -0
- package/dist/sites/contract.mjs.map +1 -0
- package/package.json +44 -4
- package/skills/site-kit/SKILL.md +66 -0
- package/dist/AnalyticsProvider-MLT26JRP.mjs +0 -6
- package/dist/AnalyticsProvider-WTOGN7LV.js +0 -27
- package/dist/BlogPostFaqSection-H556RV62.js +0 -13
- package/dist/ChatWidget-MAL7FB4M.js +0 -14
- package/dist/ChatWidget-QPZTPSPE.mjs +0 -5
- package/dist/EngageWidget-IPBUA4DW.mjs +0 -5
- package/dist/EngageWidget-N3CABK3L.js +0 -14
- package/dist/SignalCore-4MDIJUAP.mjs.map +0 -1
- package/dist/SignalCore-ZMFUE3N4.js.map +0 -1
- package/dist/SitemapSync-FUCH6Y6J.js +0 -13
- package/dist/SitemapSync-LCSPRAWU.mjs +0 -4
- package/dist/chunk-3GCEFS73.js.map +0 -1
- package/dist/chunk-3YQCPLGP.mjs.map +0 -1
- package/dist/chunk-5AESOLXS.mjs.map +0 -1
- package/dist/chunk-65SMJBHW.mjs.map +0 -1
- package/dist/chunk-IBDVZ6BF.js.map +0 -1
- package/dist/chunk-IFVMZFNT.js.map +0 -1
- package/dist/chunk-KMZ527EM.mjs.map +0 -1
- package/dist/chunk-MLJXELPA.js.map +0 -1
- package/dist/chunk-NNZDHLXN.js.map +0 -1
- package/dist/chunk-QTWA44S3.mjs.map +0 -1
- package/dist/chunk-RI6JZUAE.js.map +0 -1
- package/dist/chunk-T4QBSRA4.mjs.map +0 -1
- package/dist/chunk-TCVHI3JP.mjs.map +0 -1
- package/dist/chunk-YJWKHCOB.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkSLWTG2LJ_js = require('./chunk-SLWTG2LJ.js');
|
|
5
|
+
var chunkEAASMIWX_js = require('./chunk-EAASMIWX.js');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var React5 = require('react');
|
|
7
8
|
|
|
@@ -107,18 +108,15 @@ function getApiKey() {
|
|
|
107
108
|
async function apiPost(endpoint, body = {}) {
|
|
108
109
|
const { apiUrl, apiKey } = getApiConfig();
|
|
109
110
|
if (!apiKey) {
|
|
110
|
-
console.
|
|
111
|
+
console.warn("[Commerce] No API key configured");
|
|
111
112
|
return null;
|
|
112
113
|
}
|
|
113
114
|
try {
|
|
114
|
-
const response = await
|
|
115
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}${endpoint}`, {
|
|
115
116
|
method: "POST",
|
|
116
|
-
headers: {
|
|
117
|
-
"Content-Type": "application/json",
|
|
118
|
-
"x-api-key": apiKey
|
|
119
|
-
},
|
|
117
|
+
headers: { "Content-Type": "application/json" },
|
|
120
118
|
body: JSON.stringify(body)
|
|
121
|
-
});
|
|
119
|
+
}, { apiKey });
|
|
122
120
|
if (!response.ok) {
|
|
123
121
|
const text = await response.text();
|
|
124
122
|
let body2 = null;
|
|
@@ -127,12 +125,12 @@ async function apiPost(endpoint, body = {}) {
|
|
|
127
125
|
} catch {
|
|
128
126
|
body2 = text;
|
|
129
127
|
}
|
|
130
|
-
console.
|
|
128
|
+
console.warn(`[Commerce] API error:`, response.status, response.statusText || "Unknown", body2);
|
|
131
129
|
return null;
|
|
132
130
|
}
|
|
133
131
|
return await response.json();
|
|
134
132
|
} catch (error) {
|
|
135
|
-
console.
|
|
133
|
+
console.warn("[Commerce] Network error:", error);
|
|
136
134
|
return null;
|
|
137
135
|
}
|
|
138
136
|
}
|
|
@@ -272,14 +270,11 @@ async function fetchActiveProcessor() {
|
|
|
272
270
|
const { apiUrl, apiKey } = getApiConfig();
|
|
273
271
|
if (!apiKey) return null;
|
|
274
272
|
try {
|
|
275
|
-
const response = await
|
|
273
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/processor`, {
|
|
276
274
|
method: "POST",
|
|
277
|
-
headers: {
|
|
278
|
-
"Content-Type": "application/json",
|
|
279
|
-
"x-api-key": apiKey
|
|
280
|
-
},
|
|
275
|
+
headers: { "Content-Type": "application/json" },
|
|
281
276
|
body: JSON.stringify({})
|
|
282
|
-
});
|
|
277
|
+
}, { apiKey });
|
|
283
278
|
if (!response.ok) return null;
|
|
284
279
|
const data = await response.json();
|
|
285
280
|
return data?.processor || null;
|
|
@@ -291,12 +286,9 @@ async function registerForEvent(eventId, scheduleId, customer) {
|
|
|
291
286
|
const { apiUrl, apiKey } = getApiConfig();
|
|
292
287
|
const analyticsSessionId = typeof sessionStorage !== "undefined" ? sessionStorage.getItem("_sk_sid") : null;
|
|
293
288
|
try {
|
|
294
|
-
const response = await
|
|
289
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/register`, {
|
|
295
290
|
method: "POST",
|
|
296
|
-
headers: {
|
|
297
|
-
"Content-Type": "application/json",
|
|
298
|
-
"x-api-key": apiKey
|
|
299
|
-
},
|
|
291
|
+
headers: { "Content-Type": "application/json" },
|
|
300
292
|
body: JSON.stringify({
|
|
301
293
|
offeringId: eventId,
|
|
302
294
|
scheduleId,
|
|
@@ -304,7 +296,7 @@ async function registerForEvent(eventId, scheduleId, customer) {
|
|
|
304
296
|
analyticsSessionId
|
|
305
297
|
// Pass for conversion tracking
|
|
306
298
|
})
|
|
307
|
-
});
|
|
299
|
+
}, { apiKey, retries: 0 });
|
|
308
300
|
if (!response.ok) {
|
|
309
301
|
const error = await response.json();
|
|
310
302
|
return { success: false, error: error.message || "Registration failed" };
|
|
@@ -322,14 +314,11 @@ async function registerForEvent(eventId, scheduleId, customer) {
|
|
|
322
314
|
async function validateDiscountCode(code, subtotal, offeringIds = []) {
|
|
323
315
|
const { apiUrl, apiKey } = getApiConfig();
|
|
324
316
|
try {
|
|
325
|
-
const response = await
|
|
317
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/discount/validate`, {
|
|
326
318
|
method: "POST",
|
|
327
|
-
headers: {
|
|
328
|
-
"Content-Type": "application/json",
|
|
329
|
-
"x-api-key": apiKey
|
|
330
|
-
},
|
|
319
|
+
headers: { "Content-Type": "application/json" },
|
|
331
320
|
body: JSON.stringify({ code, subtotal, offeringIds })
|
|
332
|
-
});
|
|
321
|
+
}, { apiKey });
|
|
333
322
|
if (!response.ok) {
|
|
334
323
|
const body = await response.json().catch(() => ({}));
|
|
335
324
|
return { valid: false, message: body?.message || "Invalid discount code" };
|
|
@@ -343,14 +332,11 @@ async function fetchProcessorConfig() {
|
|
|
343
332
|
const { apiUrl, apiKey } = getApiConfig();
|
|
344
333
|
if (!apiKey) return null;
|
|
345
334
|
try {
|
|
346
|
-
const response = await
|
|
335
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/processor-config`, {
|
|
347
336
|
method: "POST",
|
|
348
|
-
headers: {
|
|
349
|
-
"Content-Type": "application/json",
|
|
350
|
-
"x-api-key": apiKey
|
|
351
|
-
},
|
|
337
|
+
headers: { "Content-Type": "application/json" },
|
|
352
338
|
body: JSON.stringify({})
|
|
353
|
-
});
|
|
339
|
+
}, { apiKey });
|
|
354
340
|
if (!response.ok) return null;
|
|
355
341
|
return await response.json();
|
|
356
342
|
} catch {
|
|
@@ -362,17 +348,14 @@ async function createPaymentIntent(options) {
|
|
|
362
348
|
const apiKey = getApiKey();
|
|
363
349
|
const sessionId = typeof sessionStorage !== "undefined" ? sessionStorage.getItem("_sk_sid") : null;
|
|
364
350
|
try {
|
|
365
|
-
const response = await
|
|
351
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/create-payment-intent`, {
|
|
366
352
|
method: "POST",
|
|
367
|
-
headers: {
|
|
368
|
-
"Content-Type": "application/json",
|
|
369
|
-
"x-api-key": apiKey
|
|
370
|
-
},
|
|
353
|
+
headers: { "Content-Type": "application/json" },
|
|
371
354
|
body: JSON.stringify({
|
|
372
355
|
...options,
|
|
373
356
|
analyticsSessionId: sessionId
|
|
374
357
|
})
|
|
375
|
-
});
|
|
358
|
+
}, { apiKey, retries: 0 });
|
|
376
359
|
const data = await response.json();
|
|
377
360
|
if (!response.ok) throw new Error(data.message || "Failed to create payment intent");
|
|
378
361
|
return data;
|
|
@@ -385,12 +368,9 @@ async function createCheckoutSession(optionsOrOfferingId, legacyOptions) {
|
|
|
385
368
|
const options = typeof optionsOrOfferingId === "string" ? { offeringId: optionsOrOfferingId, ...legacyOptions } : optionsOrOfferingId;
|
|
386
369
|
const analyticsSessionId = typeof sessionStorage !== "undefined" ? sessionStorage.getItem("_sk_sid") : null;
|
|
387
370
|
try {
|
|
388
|
-
const response = await
|
|
371
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/checkout`, {
|
|
389
372
|
method: "POST",
|
|
390
|
-
headers: {
|
|
391
|
-
"Content-Type": "application/json",
|
|
392
|
-
"x-api-key": apiKey
|
|
393
|
-
},
|
|
373
|
+
headers: { "Content-Type": "application/json" },
|
|
394
374
|
body: JSON.stringify({
|
|
395
375
|
...options,
|
|
396
376
|
analyticsSessionId,
|
|
@@ -398,7 +378,7 @@ async function createCheckoutSession(optionsOrOfferingId, legacyOptions) {
|
|
|
398
378
|
successUrl: options.successUrl || (typeof window !== "undefined" ? window.location.href : ""),
|
|
399
379
|
cancelUrl: options.cancelUrl || (typeof window !== "undefined" ? window.location.href : "")
|
|
400
380
|
})
|
|
401
|
-
});
|
|
381
|
+
}, { apiKey, retries: 0 });
|
|
402
382
|
if (!response.ok) {
|
|
403
383
|
const text = await response.text();
|
|
404
384
|
let body = {};
|
|
@@ -408,8 +388,8 @@ async function createCheckoutSession(optionsOrOfferingId, legacyOptions) {
|
|
|
408
388
|
}
|
|
409
389
|
const errObj = body?.error && typeof body.error === "object" ? body.error : body;
|
|
410
390
|
const message = (typeof body?.message === "string" ? body.message : null) || (typeof errObj?.message === "string" ? errObj.message : null) || (typeof errObj?.detail === "string" ? errObj.detail : null) || (typeof body?.error === "string" ? body.error : null) || "Payment could not be processed. Please try again or use a different card.";
|
|
411
|
-
if (typeof console !== "undefined"
|
|
412
|
-
console.
|
|
391
|
+
if (typeof console !== "undefined") {
|
|
392
|
+
console.warn("[Commerce] Checkout failed:", response.status, message, body);
|
|
413
393
|
}
|
|
414
394
|
return { success: false, error: message };
|
|
415
395
|
}
|
|
@@ -693,7 +673,7 @@ function OfferingList({
|
|
|
693
673
|
}
|
|
694
674
|
setOfferings(data);
|
|
695
675
|
} catch (e) {
|
|
696
|
-
console.
|
|
676
|
+
console.warn("Failed to load offerings:", e);
|
|
697
677
|
setError("Failed to load items.");
|
|
698
678
|
} finally {
|
|
699
679
|
setLoading(false);
|
|
@@ -1181,7 +1161,7 @@ function ProductEmbed({
|
|
|
1181
1161
|
}
|
|
1182
1162
|
setProduct(data);
|
|
1183
1163
|
} catch (e) {
|
|
1184
|
-
console.
|
|
1164
|
+
console.warn("Failed to load product:", e);
|
|
1185
1165
|
} finally {
|
|
1186
1166
|
setLoading(false);
|
|
1187
1167
|
}
|
|
@@ -3107,7 +3087,7 @@ function ProductDetail({
|
|
|
3107
3087
|
const [checkoutError, setCheckoutError] = React5.useState(null);
|
|
3108
3088
|
const [showStickyBar, setShowStickyBar] = React5.useState(false);
|
|
3109
3089
|
const buyButtonRef = React5.useRef(null);
|
|
3110
|
-
const analytics =
|
|
3090
|
+
const analytics = chunkSLWTG2LJ_js.useAnalyticsOptional();
|
|
3111
3091
|
React5.useEffect(() => {
|
|
3112
3092
|
if (propProduct) {
|
|
3113
3093
|
setProduct(propProduct);
|
|
@@ -3958,7 +3938,7 @@ function ProductGrid({
|
|
|
3958
3938
|
setProducts(data);
|
|
3959
3939
|
setTotal(count);
|
|
3960
3940
|
} catch (e) {
|
|
3961
|
-
console.
|
|
3941
|
+
console.warn("Failed to load products:", e);
|
|
3962
3942
|
} finally {
|
|
3963
3943
|
setLoading(false);
|
|
3964
3944
|
}
|
|
@@ -4478,7 +4458,7 @@ function CheckoutForm({
|
|
|
4478
4458
|
const [discountResult, setDiscountResult] = React5.useState(null);
|
|
4479
4459
|
const [applyingDiscount, setApplyingDiscount] = React5.useState(false);
|
|
4480
4460
|
const isProduct = offering.type === "product";
|
|
4481
|
-
const analytics =
|
|
4461
|
+
const analytics = chunkSLWTG2LJ_js.useAnalyticsOptional();
|
|
4482
4462
|
React5.useEffect(() => {
|
|
4483
4463
|
fetchProcessorConfig().then((config) => {
|
|
4484
4464
|
if (config?.processor) setProcessor(config.processor);
|
|
@@ -7127,26 +7107,23 @@ function EventsWidget({
|
|
|
7127
7107
|
setLoading(true);
|
|
7128
7108
|
setError(null);
|
|
7129
7109
|
try {
|
|
7130
|
-
const response = await
|
|
7110
|
+
const response = await chunkEAASMIWX_js.sonorFetch(`${apiUrl}/api/public/commerce/events`, {
|
|
7131
7111
|
method: "POST",
|
|
7132
|
-
headers: {
|
|
7133
|
-
"Content-Type": "application/json",
|
|
7134
|
-
"x-api-key": apiKey
|
|
7135
|
-
},
|
|
7112
|
+
headers: { "Content-Type": "application/json" },
|
|
7136
7113
|
body: JSON.stringify({
|
|
7137
7114
|
type: "event",
|
|
7138
7115
|
category,
|
|
7139
7116
|
limit: limit * 2
|
|
7140
7117
|
// Fetch extra for calendar view
|
|
7141
7118
|
})
|
|
7142
|
-
});
|
|
7119
|
+
}, { apiKey });
|
|
7143
7120
|
if (!response.ok) {
|
|
7144
7121
|
throw new Error("Failed to fetch events");
|
|
7145
7122
|
}
|
|
7146
7123
|
const data = await response.json();
|
|
7147
7124
|
setEvents(data.events || []);
|
|
7148
7125
|
} catch (err) {
|
|
7149
|
-
console.
|
|
7126
|
+
console.warn("Error loading events:", err);
|
|
7150
7127
|
setError("Unable to load events. Please try again later.");
|
|
7151
7128
|
} finally {
|
|
7152
7129
|
setLoading(false);
|
|
@@ -7809,5 +7786,5 @@ exports.registerForEvent = registerForEvent;
|
|
|
7809
7786
|
exports.useEventModal = useEventModal;
|
|
7810
7787
|
exports.validateAddress = validateAddress;
|
|
7811
7788
|
exports.validateDiscountCode = validateDiscountCode;
|
|
7812
|
-
//# sourceMappingURL=chunk-
|
|
7813
|
-
//# sourceMappingURL=chunk-
|
|
7789
|
+
//# sourceMappingURL=chunk-TE3W5REY.js.map
|
|
7790
|
+
//# sourceMappingURL=chunk-TE3W5REY.js.map
|