@riverbankcms/sdk 0.85.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PreviewEditorSidebar-4PH35ZIE.mjs → PreviewEditorSidebar-EVRS3C7T.mjs} +3 -3
- package/dist/{PreviewEditorUI-WHMCRJGM.mjs → PreviewEditorUI-54WD4IGE.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-ZALZDJEK.mjs +8 -0
- package/dist/_dts/api/src/endpoints.d.ts +58 -14
- package/dist/_dts/api/src/index.d.ts +3 -0
- package/dist/_dts/api/src/launchReadiness.d.ts +3 -3
- package/dist/_dts/api/src/mailchimpIntegration.d.ts +215 -0
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +35 -15
- package/dist/_dts/api/src/siteInfrastructure.d.ts +0 -14
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -13
- package/dist/_dts/api/src/types.d.ts +6 -3
- package/dist/_dts/blocks/src/PageRenderer.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +42 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/faq.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +42 -42
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup-destination.d.ts +300 -0
- package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +63 -3
- package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -288
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -288
- package/dist/_dts/blocks/src/system/fragments/library/newsletterForm.d.ts +53 -1
- package/dist/_dts/blocks/src/system/manifest/richTextSchema.d.ts +27 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +23 -23
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +10 -2
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +32 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +5 -1
- package/dist/_dts/blocks/src/system/runtime/shared/utils/formatting.d.ts +1 -1
- package/dist/_dts/content-model/src/referenceFields.d.ts +1 -1
- package/dist/_dts/core/src/currency-format.d.ts +37 -2
- package/dist/_dts/core/src/event-pricing.d.ts +24 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +549 -18
- package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +3 -1
- package/dist/_dts/sdk/src/client/types.d.ts +9 -0
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -0
- package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +3 -9
- package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +1 -1
- package/dist/_dts/sdk/src/manifest/three-pass-converter.d.ts +7 -18
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +3 -1
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +7 -3
- package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +4 -24
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +45 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -9
- package/dist/_dts/theme-core/src/schema.d.ts +11 -11
- package/dist/{chunk-ZR2GQK2A.mjs → chunk-7KOO7RPP.mjs} +953 -315
- package/dist/{chunk-OCGTXHSO.mjs → chunk-ER4UIW4X.mjs} +7 -7
- package/dist/{chunk-WFPYN7KA.mjs → chunk-HVOBXA3Y.mjs} +2 -2
- package/dist/{chunk-NFWGLRZZ.mjs → chunk-K3JWH6HE.mjs} +37 -3
- package/dist/{chunk-4QNLOTES.mjs → chunk-O4LVYUVH.mjs} +58 -14
- package/dist/{chunk-PYDHOMEO.mjs → chunk-YDMBIIS5.mjs} +1 -1
- package/dist/cli/index.mjs +408 -109
- package/dist/client/{accordion-2UZPBMYM.mjs → accordion-PT5CGW5N.mjs} +2 -2
- package/dist/client/{bookingForm-36CWQUMV.mjs → bookingForm-2HLRTEYS.mjs} +7 -7
- package/dist/client/bookings.mjs +51 -6
- package/dist/client/{carousel-QH77HR6X.mjs → carousel-Z2LKYSWA.mjs} +3 -3
- package/dist/client/cart-ND5IK4A6.mjs +18 -0
- package/dist/client/checkout-EYUSGAY7.mjs +18 -0
- package/dist/client/{chunk-SYIJ5JO2.mjs → chunk-6DVPO44G.mjs} +1 -1
- package/dist/client/{chunk-3C2VTPWI.mjs → chunk-BAWHZ5GM.mjs} +176 -13
- package/dist/client/{chunk-52CGCQ7B.mjs → chunk-BL66UWGD.mjs} +10 -80
- package/dist/client/{chunk-VGDBVNOO.mjs → chunk-DIRW2LNG.mjs} +241 -210
- package/dist/client/{chunk-UDNSI5PY.mjs → chunk-GOFO7HRH.mjs} +1 -2
- package/dist/client/{chunk-ZKUO52W3.mjs → chunk-H4MHEXYS.mjs} +1 -1
- package/dist/client/{chunk-ZE5G642V.mjs → chunk-LI2C6M5O.mjs} +75 -1
- package/dist/client/{chunk-3DTWLTXM.mjs → chunk-MHBEWDT7.mjs} +117 -3
- package/dist/client/{chunk-4OXKTA3D.mjs → chunk-O5JNI3E4.mjs} +2 -2
- package/dist/client/{chunk-XSV6KW4D.mjs → chunk-S4G65LGR.mjs} +1 -1
- package/dist/client/{chunk-DVNUDUVT.mjs → chunk-WBQG7VJA.mjs} +4 -1
- package/dist/client/{chunk-F5VRX5Y6.mjs → chunk-WCVK4MBJ.mjs} +1 -1
- package/dist/client/{chunk-7UCLJ5SP.mjs → chunk-X7GVFB7Y.mjs} +4 -7
- package/dist/client/client.mjs +2125 -1403
- package/dist/client/{courseRegistration-TMKU6ABO.mjs → courseRegistration-H3AZBUEG.mjs} +7 -7
- package/dist/client/{eventCalendar-G6TI32X6.mjs → eventCalendar-FPKJGLGS.mjs} +10 -11
- package/dist/client/{eventCombined-SCKEMNAR.mjs → eventCombined-QCGIZBUY.mjs} +10 -11
- package/dist/client/{eventDetails-XPIFXXPK.mjs → eventDetails-HIT3BJWU.mjs} +10 -11
- package/dist/client/{eventListing-7QFMEMGT.mjs → eventListing-R4HNWJDN.mjs} +10 -11
- package/dist/client/{eventRegistration-TOODSZUI.mjs → eventRegistration-Q7BYY5HF.mjs} +10 -11
- package/dist/client/{form-MTCMVCZT.mjs → form-NI6YOG6S.mjs} +3 -3
- package/dist/client/{headerSection-Y5TMR3TW.mjs → headerSection-SDYGII36.mjs} +4 -4
- package/dist/client/hooks.mjs +1682 -1412
- package/dist/client/{locationMap-RH2LG7FZ.mjs → locationMap-BDETEUQD.mjs} +3 -4
- package/dist/client/{newsletterForm-PCAIPFMA.mjs → newsletterForm-EKYIU67X.mjs} +70 -22
- package/dist/client/{productDetail-OIGDR4YE.mjs → productDetail-5UTGNN76.mjs} +8 -9
- package/dist/client/{productList-4MA5S2CX.mjs → productList-7YA5KXZQ.mjs} +8 -9
- package/dist/client/rendering/client.mjs +753 -329
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3786 -3034
- package/dist/client/shop-AIMUMZYC.mjs +20 -0
- package/dist/preview-next/before-render.mjs +58 -14
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/editor-chrome.css +56 -9
- package/dist/preview-next/middleware.mjs +58 -14
- package/dist/{sdk-runtime-QLOCYKVU.mjs → sdk-runtime-NW472WNT.mjs} +6 -6
- package/dist/server/components.mjs +1518 -1015
- package/dist/server/config-validation.mjs +1719 -1461
- package/dist/server/config.mjs +1719 -1461
- package/dist/server/data.mjs +1683 -1413
- package/dist/server/index.mjs +79 -17
- package/dist/server/next.mjs +1902 -1311
- package/dist/server/page-converter.mjs +2193 -1169
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1709 -1209
- package/dist/server/rendering.mjs +1894 -1347
- package/dist/server/routing.mjs +1872 -1499
- package/dist/server/server.mjs +1571 -1264
- package/dist/server/theme-bridge.mjs +234 -0
- package/dist/styles/index.css +232 -0
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-4FGSVUYI.mjs +0 -8
- package/dist/client/cart-X4YK4FTW.mjs +0 -19
- package/dist/client/checkout-OM2BEPWD.mjs +0 -19
- package/dist/client/chunk-I2MMZO53.mjs +0 -6
- package/dist/client/shop-WXSYV5QO.mjs +0 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { parseAspectRatioValue, parseColorTokenParts, toBookingTimeZone,
|
|
2
|
+
import { parseAspectRatioValue, parseColorTokenParts, toBookingTimeZone, formatBookingDate, toScheduledBookingDateTime, formatBookingTime, toScheduledBookingDateRange, formatBookingDateParts, formatEventPricing, ImagePresets, getBookingLocalDateKey, publicEventPricingType, formatCurrencyAmount, getCurrentResolveImageUrlContext, renderVideo, renderAudio, resolveMediaNodeResponsiveImage, MediaPlaceholder, computeMediaTransformStyle, rgbColorValue } from './chunk-LI2C6M5O.mjs';
|
|
3
3
|
import z2, { z } from 'zod';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { createContext, forwardRef, useContext, createElement } from 'react';
|
|
@@ -138,6 +138,92 @@ var mediaSchema = z2.discriminatedUnion("type", [
|
|
|
138
138
|
spreadsheetMediaSchema,
|
|
139
139
|
archiveMediaSchema
|
|
140
140
|
]);
|
|
141
|
+
|
|
142
|
+
// ../blocks/src/lib/typeGuards.ts
|
|
143
|
+
function isRecord(value) {
|
|
144
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ../blocks/src/system/manifest/richTextSchema.ts
|
|
148
|
+
var TipTapMarkSchema = z.object({
|
|
149
|
+
type: z.string(),
|
|
150
|
+
attrs: z.record(z.string(), z.unknown()).optional()
|
|
151
|
+
});
|
|
152
|
+
var TipTapNodeSchema = z.lazy(
|
|
153
|
+
() => z.object({
|
|
154
|
+
type: z.string(),
|
|
155
|
+
content: z.array(TipTapNodeSchema).optional(),
|
|
156
|
+
text: z.string().optional(),
|
|
157
|
+
attrs: z.record(z.string(), z.unknown()).optional(),
|
|
158
|
+
marks: z.array(TipTapMarkSchema).optional()
|
|
159
|
+
})
|
|
160
|
+
);
|
|
161
|
+
z.union([
|
|
162
|
+
// Canonical: TipTap document directly
|
|
163
|
+
TipTapNodeSchema,
|
|
164
|
+
// Legacy (read-tolerance only): wrapped in { doc: {...} }
|
|
165
|
+
z.object({
|
|
166
|
+
doc: TipTapNodeSchema
|
|
167
|
+
})
|
|
168
|
+
]);
|
|
169
|
+
var RichTextDocSchema = z.object({
|
|
170
|
+
type: z.literal("doc"),
|
|
171
|
+
content: z.array(TipTapNodeSchema)
|
|
172
|
+
});
|
|
173
|
+
function unwrapRichTextRoot(value) {
|
|
174
|
+
if (!isRecord(value)) return value;
|
|
175
|
+
if (!("doc" in value)) return value;
|
|
176
|
+
const inner = value.doc;
|
|
177
|
+
if (isRecord(inner) && inner.type === "doc") return inner;
|
|
178
|
+
return value;
|
|
179
|
+
}
|
|
180
|
+
function createHardBreakNode() {
|
|
181
|
+
return { type: "hardBreak" };
|
|
182
|
+
}
|
|
183
|
+
function parseRichTextInlineMarkdown(text2) {
|
|
184
|
+
const out = [];
|
|
185
|
+
const pushText = (value, marks) => {
|
|
186
|
+
if (!value) return;
|
|
187
|
+
out.push(
|
|
188
|
+
marks && marks.length > 0 ? { type: "text", text: value, marks } : { type: "text", text: value }
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
let rest = text2;
|
|
192
|
+
while (rest.length > 0) {
|
|
193
|
+
const start = rest.indexOf("**");
|
|
194
|
+
if (start === -1) {
|
|
195
|
+
pushText(rest);
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
const end = rest.indexOf("**", start + 2);
|
|
199
|
+
if (end === -1) {
|
|
200
|
+
pushText(rest);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
pushText(rest.slice(0, start));
|
|
204
|
+
pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
|
|
205
|
+
rest = rest.slice(end + 2);
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
function parseRichTextParagraphInlineMarkdown(text2) {
|
|
210
|
+
return text2.split("\n").flatMap((line, index) => {
|
|
211
|
+
const lineNodes = parseRichTextInlineMarkdown(line.trim());
|
|
212
|
+
return index === 0 ? lineNodes : [createHardBreakNode(), ...lineNodes];
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function createRichTextDocFromMarkdown(markdown) {
|
|
216
|
+
const normalized = markdown.replace(/\r\n/g, "\n").trim();
|
|
217
|
+
if (!normalized) return { type: "doc", content: [] };
|
|
218
|
+
const paragraphs = normalized.split(/\n{2,}/).map((paragraph) => paragraph.trim()).filter(Boolean);
|
|
219
|
+
return {
|
|
220
|
+
type: "doc",
|
|
221
|
+
content: paragraphs.map((paragraph) => {
|
|
222
|
+
const inline = parseRichTextParagraphInlineMarkdown(paragraph);
|
|
223
|
+
return inline.length > 0 ? { type: "paragraph", content: inline } : { type: "paragraph" };
|
|
224
|
+
})
|
|
225
|
+
};
|
|
226
|
+
}
|
|
141
227
|
var bookingDepositRefundPolicySchema = z.enum([
|
|
142
228
|
"refundable",
|
|
143
229
|
"non_refundable"
|
|
@@ -293,7 +379,13 @@ z.discriminatedUnion("kind", [
|
|
|
293
379
|
z.object({ kind: z.literal("free"), currency: z.string() }),
|
|
294
380
|
z.object({ kind: z.literal("exact"), amount: z.number(), currency: z.string() }),
|
|
295
381
|
z.object({ kind: z.literal("from"), amount: z.number(), currency: z.string() }),
|
|
296
|
-
z.object({ kind: z.literal("
|
|
382
|
+
z.object({ kind: z.literal("range"), minAmount: z.number(), maxAmount: z.number(), currency: z.string() }),
|
|
383
|
+
z.object({
|
|
384
|
+
kind: z.literal("mixed"),
|
|
385
|
+
paidFromAmount: z.number(),
|
|
386
|
+
paidToAmount: z.number(),
|
|
387
|
+
currency: z.string()
|
|
388
|
+
}),
|
|
297
389
|
z.object({ kind: z.literal("unavailable"), currency: z.string() }),
|
|
298
390
|
z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
|
|
299
391
|
]);
|
|
@@ -301,7 +393,13 @@ var publicEventTicketTypePriceDisplaySchema = z.union([
|
|
|
301
393
|
z.object({ kind: z.literal("free"), currency: z.string() }),
|
|
302
394
|
z.object({ kind: z.literal("exact"), amount: z.number(), currency: z.string() }),
|
|
303
395
|
z.object({ kind: z.literal("from"), amount: z.number(), currency: z.string() }),
|
|
304
|
-
z.object({ kind: z.literal("
|
|
396
|
+
z.object({ kind: z.literal("range"), minAmount: z.number(), maxAmount: z.number(), currency: z.string() }),
|
|
397
|
+
z.object({
|
|
398
|
+
kind: z.literal("mixed"),
|
|
399
|
+
paidFromAmount: z.number(),
|
|
400
|
+
paidToAmount: z.number(),
|
|
401
|
+
currency: z.string()
|
|
402
|
+
}),
|
|
305
403
|
z.object({ kind: z.literal("unavailable"), currency: z.string() })
|
|
306
404
|
]);
|
|
307
405
|
var publicEventAttendanceModeSchema = z.enum(["in_person", "online"]);
|
|
@@ -386,6 +484,9 @@ var publicEventSchema = z.object({
|
|
|
386
484
|
seriesId: z.string(),
|
|
387
485
|
title: z.string(),
|
|
388
486
|
description: z.string().nullable(),
|
|
487
|
+
content: z.object({
|
|
488
|
+
body: RichTextDocSchema.nullable().optional()
|
|
489
|
+
}).optional(),
|
|
389
490
|
presentation: z.object({
|
|
390
491
|
cardTitleOverride: z.string().nullable().optional(),
|
|
391
492
|
summary: z.string().nullable().optional(),
|
|
@@ -4312,12 +4413,12 @@ function resolveBookingSiteId(siteId, form) {
|
|
|
4312
4413
|
return siteId || form?.siteId || "";
|
|
4313
4414
|
}
|
|
4314
4415
|
function normalizeBookingFormConfig(form) {
|
|
4315
|
-
if (!
|
|
4416
|
+
if (!isRecord2(form)) return null;
|
|
4316
4417
|
const id = readNonEmptyString(form.id);
|
|
4317
4418
|
const name = readNonEmptyString(form.name);
|
|
4318
4419
|
if (!id || !name) return null;
|
|
4319
|
-
const schemaSource =
|
|
4320
|
-
const settingsSource =
|
|
4420
|
+
const schemaSource = isRecord2(form.schema) ? form.schema : isRecord2(form.schemaJson) ? form.schemaJson : null;
|
|
4421
|
+
const settingsSource = isRecord2(form.settings) ? form.settings : isRecord2(form.settingsJson) ? form.settingsJson : null;
|
|
4321
4422
|
return {
|
|
4322
4423
|
id,
|
|
4323
4424
|
name,
|
|
@@ -4341,10 +4442,10 @@ function normalizeBookingServices(services) {
|
|
|
4341
4442
|
if (Array.isArray(services)) {
|
|
4342
4443
|
return services.filter(isBookingFormService).map(normalizeService);
|
|
4343
4444
|
}
|
|
4344
|
-
if (
|
|
4445
|
+
if (isRecord2(services) && "services" in services) {
|
|
4345
4446
|
return Array.isArray(services.services) ? services.services.filter(isBookingFormService).map(normalizeService) : [];
|
|
4346
4447
|
}
|
|
4347
|
-
return
|
|
4448
|
+
return isRecord2(services) ? Object.values(services).filter(isBookingFormService).map(normalizeService) : [];
|
|
4348
4449
|
}
|
|
4349
4450
|
function normalizeBookingSchema(value) {
|
|
4350
4451
|
if (!value) return void 0;
|
|
@@ -4356,7 +4457,7 @@ function normalizeBookingSchema(value) {
|
|
|
4356
4457
|
};
|
|
4357
4458
|
}
|
|
4358
4459
|
function readBookingFormField(value) {
|
|
4359
|
-
if (!
|
|
4460
|
+
if (!isRecord2(value)) return null;
|
|
4360
4461
|
const id = readNonEmptyString(value.id);
|
|
4361
4462
|
const label = readNonEmptyString(value.label);
|
|
4362
4463
|
const type = readBookingFieldType(value.type);
|
|
@@ -4402,7 +4503,7 @@ function readBookingFieldOptions(value) {
|
|
|
4402
4503
|
return options.length > 0 ? options : void 0;
|
|
4403
4504
|
}
|
|
4404
4505
|
function readBookingFieldOption(value) {
|
|
4405
|
-
if (!
|
|
4506
|
+
if (!isRecord2(value)) return null;
|
|
4406
4507
|
const optionValue = readNonEmptyString(value.value);
|
|
4407
4508
|
const label = readNonEmptyString(value.label);
|
|
4408
4509
|
return optionValue && label ? { value: optionValue, label } : null;
|
|
@@ -4419,7 +4520,7 @@ function normalizeBookingSettings(value) {
|
|
|
4419
4520
|
};
|
|
4420
4521
|
}
|
|
4421
4522
|
function isBookingFormService(value) {
|
|
4422
|
-
return
|
|
4523
|
+
return isRecord2(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
|
|
4423
4524
|
}
|
|
4424
4525
|
function collectBookingCustomFields(data) {
|
|
4425
4526
|
const customFields = {};
|
|
@@ -4449,7 +4550,7 @@ function readStringArray(value) {
|
|
|
4449
4550
|
const strings = value.filter((item) => typeof item === "string");
|
|
4450
4551
|
return strings.length > 0 ? strings : void 0;
|
|
4451
4552
|
}
|
|
4452
|
-
function
|
|
4553
|
+
function isRecord2(value) {
|
|
4453
4554
|
return typeof value === "object" && value !== null;
|
|
4454
4555
|
}
|
|
4455
4556
|
function getBookingServicePaymentSelectionMode(service) {
|
|
@@ -5248,15 +5349,15 @@ function getLocalMinuteOfDay(isoTimestamp, timeZone) {
|
|
|
5248
5349
|
const date = new Date(isoTimestamp);
|
|
5249
5350
|
if (Number.isNaN(date.getTime())) return NaN;
|
|
5250
5351
|
if (!isValidTimeZone(timeZone)) return NaN;
|
|
5251
|
-
const parts = new Intl.DateTimeFormat("en-
|
|
5352
|
+
const parts = new Intl.DateTimeFormat("en-GB", {
|
|
5252
5353
|
timeZone,
|
|
5253
5354
|
hour: "2-digit",
|
|
5254
5355
|
minute: "2-digit",
|
|
5255
|
-
hour12: false,
|
|
5256
5356
|
hourCycle: "h23"
|
|
5257
5357
|
}).formatToParts(date);
|
|
5258
|
-
const
|
|
5358
|
+
const hourPart = Number(parts.find((part) => part.type === "hour")?.value);
|
|
5259
5359
|
const minute = Number(parts.find((part) => part.type === "minute")?.value);
|
|
5360
|
+
const hour = hourPart === 24 ? 0 : hourPart;
|
|
5260
5361
|
if (Number.isNaN(hour) || Number.isNaN(minute)) return NaN;
|
|
5261
5362
|
return hour * MINUTES_PER_HOUR + minute;
|
|
5262
5363
|
}
|
|
@@ -5559,141 +5660,6 @@ function groupItemsByDate(items, accessors) {
|
|
|
5559
5660
|
return grouped;
|
|
5560
5661
|
}
|
|
5561
5662
|
|
|
5562
|
-
// ../blocks/src/system/blocks/courses/shared/pricing.ts
|
|
5563
|
-
function isSaleWindowOpen(option, now) {
|
|
5564
|
-
if (!option.isActive) {
|
|
5565
|
-
return false;
|
|
5566
|
-
}
|
|
5567
|
-
if (option.saleStartsAt && new Date(option.saleStartsAt) > now) {
|
|
5568
|
-
return false;
|
|
5569
|
-
}
|
|
5570
|
-
if (option.saleEndsAt && new Date(option.saleEndsAt) < now) {
|
|
5571
|
-
return false;
|
|
5572
|
-
}
|
|
5573
|
-
return true;
|
|
5574
|
-
}
|
|
5575
|
-
function toExactOrFreeDisplay(amount, currency) {
|
|
5576
|
-
if (amount <= 0) {
|
|
5577
|
-
return { kind: "free", currency };
|
|
5578
|
-
}
|
|
5579
|
-
return { kind: "exact", amount, currency };
|
|
5580
|
-
}
|
|
5581
|
-
function getSelectableCoursePricingOptionsForNow(course, now) {
|
|
5582
|
-
if (!course.pricing || course.pricing.pricingStrategy !== "tiered") {
|
|
5583
|
-
return [];
|
|
5584
|
-
}
|
|
5585
|
-
return [...course.pricing.options].filter((option) => isSaleWindowOpen(option, now)).sort((left, right) => {
|
|
5586
|
-
if (left.sortOrder !== right.sortOrder) {
|
|
5587
|
-
return left.sortOrder - right.sortOrder;
|
|
5588
|
-
}
|
|
5589
|
-
if (left.priceAmount !== right.priceAmount) {
|
|
5590
|
-
return left.priceAmount - right.priceAmount;
|
|
5591
|
-
}
|
|
5592
|
-
return left.name.localeCompare(right.name);
|
|
5593
|
-
});
|
|
5594
|
-
}
|
|
5595
|
-
function resolveCoursePricingState(course, selectedPricingOptionId, nowInput = {}) {
|
|
5596
|
-
const currency = course.pricing?.currency ?? course.currency;
|
|
5597
|
-
if (!course.pricing) {
|
|
5598
|
-
const legacyAmount = course.priceCents ?? 0;
|
|
5599
|
-
return {
|
|
5600
|
-
currency,
|
|
5601
|
-
display: toExactOrFreeDisplay(legacyAmount, currency),
|
|
5602
|
-
selectableOptions: [],
|
|
5603
|
-
requiresSelection: false,
|
|
5604
|
-
selectedOption: null,
|
|
5605
|
-
selectedPriceAmount: legacyAmount,
|
|
5606
|
-
selectedRequiresPayment: legacyAmount > 0,
|
|
5607
|
-
hasPaidSelection: legacyAmount > 0,
|
|
5608
|
-
hasFreeSelection: legacyAmount <= 0
|
|
5609
|
-
};
|
|
5610
|
-
}
|
|
5611
|
-
switch (course.pricing.pricingStrategy) {
|
|
5612
|
-
case "free":
|
|
5613
|
-
return {
|
|
5614
|
-
currency,
|
|
5615
|
-
display: { kind: "free", currency },
|
|
5616
|
-
selectableOptions: [],
|
|
5617
|
-
requiresSelection: false,
|
|
5618
|
-
selectedOption: null,
|
|
5619
|
-
selectedPriceAmount: 0,
|
|
5620
|
-
selectedRequiresPayment: false,
|
|
5621
|
-
hasPaidSelection: false,
|
|
5622
|
-
hasFreeSelection: true
|
|
5623
|
-
};
|
|
5624
|
-
case "single": {
|
|
5625
|
-
const amount = course.pricing.singlePriceAmount ?? 0;
|
|
5626
|
-
return {
|
|
5627
|
-
currency,
|
|
5628
|
-
display: toExactOrFreeDisplay(amount, currency),
|
|
5629
|
-
selectableOptions: [],
|
|
5630
|
-
requiresSelection: false,
|
|
5631
|
-
selectedOption: null,
|
|
5632
|
-
selectedPriceAmount: amount,
|
|
5633
|
-
selectedRequiresPayment: amount > 0,
|
|
5634
|
-
hasPaidSelection: amount > 0,
|
|
5635
|
-
hasFreeSelection: amount <= 0
|
|
5636
|
-
};
|
|
5637
|
-
}
|
|
5638
|
-
case "tiered": {
|
|
5639
|
-
const selectableOptions = getSelectableCoursePricingOptionsForNow(
|
|
5640
|
-
course,
|
|
5641
|
-
resolvePlanningDateInput(nowInput)
|
|
5642
|
-
);
|
|
5643
|
-
const selectedOption = (selectedPricingOptionId ? selectableOptions.find((option) => option.id === selectedPricingOptionId) : null) ?? (selectableOptions.length === 1 ? selectableOptions[0] ?? null : null);
|
|
5644
|
-
const lowestAmount = selectableOptions.reduce((lowest, option) => {
|
|
5645
|
-
if (lowest === null || option.priceAmount < lowest) {
|
|
5646
|
-
return option.priceAmount;
|
|
5647
|
-
}
|
|
5648
|
-
return lowest;
|
|
5649
|
-
}, null);
|
|
5650
|
-
const display = lowestAmount === null ? { kind: "unavailable", currency } : selectableOptions.length > 1 && lowestAmount > 0 ? { kind: "from", amount: lowestAmount, currency } : toExactOrFreeDisplay(lowestAmount, currency);
|
|
5651
|
-
return {
|
|
5652
|
-
currency,
|
|
5653
|
-
display,
|
|
5654
|
-
selectableOptions,
|
|
5655
|
-
requiresSelection: selectableOptions.length > 1,
|
|
5656
|
-
selectedOption,
|
|
5657
|
-
selectedPriceAmount: selectedOption?.priceAmount ?? null,
|
|
5658
|
-
selectedRequiresPayment: (selectedOption?.priceAmount ?? 0) > 0,
|
|
5659
|
-
hasPaidSelection: selectableOptions.some((option) => option.priceAmount > 0),
|
|
5660
|
-
hasFreeSelection: selectableOptions.some((option) => option.priceAmount === 0)
|
|
5661
|
-
};
|
|
5662
|
-
}
|
|
5663
|
-
}
|
|
5664
|
-
}
|
|
5665
|
-
function formatCoursePriceDisplay(display, locale) {
|
|
5666
|
-
switch (display.kind) {
|
|
5667
|
-
case "free":
|
|
5668
|
-
return "Free";
|
|
5669
|
-
case "unavailable":
|
|
5670
|
-
return "Pricing unavailable";
|
|
5671
|
-
case "exact":
|
|
5672
|
-
return formatCourseCurrencyAmount(display.amount, display.currency, { locale });
|
|
5673
|
-
case "from":
|
|
5674
|
-
return `From ${formatCourseCurrencyAmount(display.amount, display.currency, { locale })}`;
|
|
5675
|
-
}
|
|
5676
|
-
}
|
|
5677
|
-
function formatCourseCurrencyAmount(amount, currency, options) {
|
|
5678
|
-
const {
|
|
5679
|
-
locale = "en-US",
|
|
5680
|
-
minimumFractionDigits,
|
|
5681
|
-
maximumFractionDigits
|
|
5682
|
-
} = options ?? {};
|
|
5683
|
-
return new Intl.NumberFormat(locale, {
|
|
5684
|
-
style: "currency",
|
|
5685
|
-
currency: currency.toUpperCase(),
|
|
5686
|
-
...minimumFractionDigits === void 0 ? {} : { minimumFractionDigits },
|
|
5687
|
-
...maximumFractionDigits === void 0 ? {} : { maximumFractionDigits }
|
|
5688
|
-
}).format(amount / 100);
|
|
5689
|
-
}
|
|
5690
|
-
function formatCoursePriceAmount(amount, currency, locale) {
|
|
5691
|
-
return formatCoursePriceDisplay(
|
|
5692
|
-
amount > 0 ? { kind: "exact", amount, currency } : { kind: "free", currency },
|
|
5693
|
-
locale
|
|
5694
|
-
);
|
|
5695
|
-
}
|
|
5696
|
-
|
|
5697
5663
|
// ../blocks/src/system/runtime/nodes/events/shared/eventCapacity.ts
|
|
5698
5664
|
function getEventAvailability(event) {
|
|
5699
5665
|
if (event.capacity == null) {
|
|
@@ -5748,22 +5714,22 @@ function resolveRuntimeEventPricing(event) {
|
|
|
5748
5714
|
function readCurrency(value) {
|
|
5749
5715
|
return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
|
|
5750
5716
|
}
|
|
5751
|
-
function
|
|
5717
|
+
function isRecord3(value) {
|
|
5752
5718
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5753
5719
|
}
|
|
5754
5720
|
function isPublicEventPricing(value) {
|
|
5755
|
-
if (!
|
|
5721
|
+
if (!isRecord3(value) || typeof value.kind !== "string") return false;
|
|
5756
5722
|
return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
|
|
5757
5723
|
}
|
|
5758
5724
|
function isPublicEventTicketType(value) {
|
|
5759
|
-
return
|
|
5725
|
+
return isRecord3(value) && typeof value.id === "string";
|
|
5760
5726
|
}
|
|
5761
5727
|
function readTicketTypePriceDisplay(value, currency) {
|
|
5762
5728
|
const display = readLegacyPriceDisplay(value, currency);
|
|
5763
5729
|
return display.kind === "course" ? { kind: "unavailable", currency } : display;
|
|
5764
5730
|
}
|
|
5765
5731
|
function readLegacyPriceDisplay(value, currency) {
|
|
5766
|
-
if (!
|
|
5732
|
+
if (!isRecord3(value) || typeof value.kind !== "string") {
|
|
5767
5733
|
return { kind: "unavailable", currency };
|
|
5768
5734
|
}
|
|
5769
5735
|
const displayCurrency = readCurrency(value.currency);
|
|
@@ -5782,16 +5748,27 @@ function readLegacyPriceDisplay(value, currency) {
|
|
|
5782
5748
|
amount: readAmount(value.amount) ?? 0,
|
|
5783
5749
|
currency: displayCurrency
|
|
5784
5750
|
} : { kind: "unavailable", currency };
|
|
5751
|
+
case "range": {
|
|
5752
|
+
const minAmount = readAmount(value.minAmount);
|
|
5753
|
+
const maxAmount = readAmount(value.maxAmount);
|
|
5754
|
+
return minAmount !== null && maxAmount !== null ? {
|
|
5755
|
+
kind: "range",
|
|
5756
|
+
minAmount,
|
|
5757
|
+
maxAmount,
|
|
5758
|
+
currency: displayCurrency
|
|
5759
|
+
} : { kind: "unavailable", currency };
|
|
5760
|
+
}
|
|
5785
5761
|
case "mixed":
|
|
5786
5762
|
return readAmount(value.paidFromAmount) !== null ? {
|
|
5787
5763
|
kind: "mixed",
|
|
5788
5764
|
paidFromAmount: readAmount(value.paidFromAmount) ?? 0,
|
|
5765
|
+
paidToAmount: readAmount(value.paidToAmount) ?? readAmount(value.paidFromAmount) ?? 0,
|
|
5789
5766
|
currency: displayCurrency
|
|
5790
5767
|
} : { kind: "unavailable", currency };
|
|
5791
5768
|
case "unavailable":
|
|
5792
5769
|
return { kind: "unavailable", currency: displayCurrency };
|
|
5793
5770
|
case "course":
|
|
5794
|
-
return
|
|
5771
|
+
return isRecord3(value.display) ? {
|
|
5795
5772
|
kind: "course",
|
|
5796
5773
|
display: readCoursePriceDisplay(value.display, displayCurrency)
|
|
5797
5774
|
} : {
|
|
@@ -5943,45 +5920,11 @@ function groupEventsByDate(events) {
|
|
|
5943
5920
|
}
|
|
5944
5921
|
return map;
|
|
5945
5922
|
}
|
|
5946
|
-
function formatCompactCurrencyAmount(amount, currency) {
|
|
5947
|
-
return formatCourseCurrencyAmount(amount, currency, {
|
|
5948
|
-
minimumFractionDigits: 0,
|
|
5949
|
-
maximumFractionDigits: 2
|
|
5950
|
-
});
|
|
5951
|
-
}
|
|
5952
|
-
function formatCourseEventPriceDisplay(display) {
|
|
5953
|
-
if (display.kind !== "course") {
|
|
5954
|
-
return "Course";
|
|
5955
|
-
}
|
|
5956
|
-
if (display.display.kind === "exact" || display.display.kind === "from") {
|
|
5957
|
-
const amountLabel = formatCompactCurrencyAmount(
|
|
5958
|
-
display.display.amount,
|
|
5959
|
-
display.display.currency
|
|
5960
|
-
);
|
|
5961
|
-
return display.display.kind === "from" ? `Course (From ${amountLabel})` : `Course (${amountLabel})`;
|
|
5962
|
-
}
|
|
5963
|
-
return "Course";
|
|
5964
|
-
}
|
|
5965
|
-
function formatPublicEventPriceDisplay(display) {
|
|
5966
|
-
switch (display.kind) {
|
|
5967
|
-
case "free":
|
|
5968
|
-
return "Free";
|
|
5969
|
-
case "exact":
|
|
5970
|
-
return formatCompactCurrencyAmount(display.amount, display.currency);
|
|
5971
|
-
case "from":
|
|
5972
|
-
return `From ${formatCompactCurrencyAmount(display.amount, display.currency)}`;
|
|
5973
|
-
case "mixed":
|
|
5974
|
-
return `Free / From ${formatCompactCurrencyAmount(display.paidFromAmount, display.currency)}`;
|
|
5975
|
-
case "unavailable":
|
|
5976
|
-
return "Pricing unavailable";
|
|
5977
|
-
case "course":
|
|
5978
|
-
return formatCourseEventPriceDisplay(display);
|
|
5979
|
-
}
|
|
5980
|
-
}
|
|
5981
5923
|
function formatEventPrice(event) {
|
|
5982
|
-
return
|
|
5983
|
-
|
|
5984
|
-
|
|
5924
|
+
return formatEventPricing(resolveRuntimeEventPricing(event), { decimals: "auto" });
|
|
5925
|
+
}
|
|
5926
|
+
function formatEventPriceDisplay(pricing) {
|
|
5927
|
+
return formatEventPricing(pricing, { decimals: "auto" });
|
|
5985
5928
|
}
|
|
5986
5929
|
function resolveEventCta(event, buttonText) {
|
|
5987
5930
|
const { isFull: isSoldOut } = getEventAvailability(event);
|
|
@@ -7246,6 +7189,7 @@ var eventRegistrationSourceSchema = z.object({
|
|
|
7246
7189
|
successMessage: z.string().optional(),
|
|
7247
7190
|
waitlistMessage: z.string().optional(),
|
|
7248
7191
|
buttonVariant: registrationButtonVariantSchema.optional(),
|
|
7192
|
+
overlayEnabled: z.boolean().optional(),
|
|
7249
7193
|
spamProtectionEnabled: z.boolean().optional(),
|
|
7250
7194
|
stage: previewStageSchema.optional(),
|
|
7251
7195
|
supportEmail: z.string().optional()
|
|
@@ -7269,6 +7213,7 @@ var eventRegistrationHydrationSchema = z.object({
|
|
|
7269
7213
|
successMessage: z.string().optional(),
|
|
7270
7214
|
waitlistMessage: z.string().optional(),
|
|
7271
7215
|
buttonVariant: registrationButtonVariantSchema.optional(),
|
|
7216
|
+
overlayEnabled: z.boolean().optional(),
|
|
7272
7217
|
spamProtectionEnabled: z.boolean().optional(),
|
|
7273
7218
|
supportEmail: z.string().optional()
|
|
7274
7219
|
});
|
|
@@ -7384,13 +7329,14 @@ var eventRegistrationBlockRuntime = defineClientOwnedBlockRuntime({
|
|
|
7384
7329
|
successMessage: source.successMessage,
|
|
7385
7330
|
waitlistMessage: source.waitlistMessage,
|
|
7386
7331
|
buttonVariant: source.buttonVariant,
|
|
7332
|
+
overlayEnabled: source.overlayEnabled,
|
|
7387
7333
|
spamProtectionEnabled: source.spamProtectionEnabled,
|
|
7388
7334
|
supportEmail: source.supportEmail
|
|
7389
7335
|
}
|
|
7390
7336
|
})
|
|
7391
7337
|
});
|
|
7392
7338
|
function normalizeEventRegistrationEventInput(value) {
|
|
7393
|
-
if (!
|
|
7339
|
+
if (!isRecord4(value)) {
|
|
7394
7340
|
return value;
|
|
7395
7341
|
}
|
|
7396
7342
|
return {
|
|
@@ -7398,7 +7344,7 @@ function normalizeEventRegistrationEventInput(value) {
|
|
|
7398
7344
|
pricing: resolveRuntimeEventPricing(value)
|
|
7399
7345
|
};
|
|
7400
7346
|
}
|
|
7401
|
-
function
|
|
7347
|
+
function isRecord4(value) {
|
|
7402
7348
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7403
7349
|
}
|
|
7404
7350
|
var eventRegistrationInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
@@ -7662,6 +7608,60 @@ var giftingInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
|
7662
7608
|
})
|
|
7663
7609
|
});
|
|
7664
7610
|
|
|
7611
|
+
// ../blocks/src/system/blocks/newsletter-signup-destination.ts
|
|
7612
|
+
function parseNewsletterSignupBlockId(value) {
|
|
7613
|
+
const trimmed = parseTrimmedString(value);
|
|
7614
|
+
return trimmed && BLOCK_ID_PATTERN.test(trimmed) ? trimmed : null;
|
|
7615
|
+
}
|
|
7616
|
+
function parseSignedNewsletterDestinationRef(value) {
|
|
7617
|
+
const trimmed = parseTrimmedString(value);
|
|
7618
|
+
return trimmed && SIGNED_DESTINATION_REF_PATTERN.test(trimmed) ? trimmed : null;
|
|
7619
|
+
}
|
|
7620
|
+
function parseNewsletterSignupDestinationProvider(value) {
|
|
7621
|
+
return value === "riverbank" || value === "mailchimp" ? value : null;
|
|
7622
|
+
}
|
|
7623
|
+
function buildNewsletterSignupBlockRef(blockId) {
|
|
7624
|
+
const parsed = parseNewsletterSignupBlockId(blockId);
|
|
7625
|
+
return parsed ? { tag: "block_ref", blockId: parsed } : null;
|
|
7626
|
+
}
|
|
7627
|
+
function normalizeNewsletterSignupEditorValuesForDestination(values) {
|
|
7628
|
+
const destinationProvider = parseNewsletterSignupDestinationProvider(values.destinationProvider) ?? "riverbank";
|
|
7629
|
+
if (destinationProvider === "mailchimp") {
|
|
7630
|
+
return {
|
|
7631
|
+
destinationProvider,
|
|
7632
|
+
mailchimpAudienceId: values.mailchimpAudienceId,
|
|
7633
|
+
mailchimpTags: values.mailchimpTags
|
|
7634
|
+
};
|
|
7635
|
+
}
|
|
7636
|
+
return {
|
|
7637
|
+
destinationProvider,
|
|
7638
|
+
listId: values.listId,
|
|
7639
|
+
tags: values.tags
|
|
7640
|
+
};
|
|
7641
|
+
}
|
|
7642
|
+
function deriveNewsletterSignupRuntimeSource(values) {
|
|
7643
|
+
const normalized = normalizeNewsletterSignupEditorValuesForDestination(values);
|
|
7644
|
+
if (normalized.destinationProvider === "mailchimp") {
|
|
7645
|
+
return {
|
|
7646
|
+
destinationProvider: "mailchimp",
|
|
7647
|
+
listId: null,
|
|
7648
|
+
tags: null
|
|
7649
|
+
};
|
|
7650
|
+
}
|
|
7651
|
+
return {
|
|
7652
|
+
destinationProvider: "riverbank",
|
|
7653
|
+
listId: parseTrimmedString(normalized.listId),
|
|
7654
|
+
tags: parseTrimmedString(normalized.tags)
|
|
7655
|
+
};
|
|
7656
|
+
}
|
|
7657
|
+
var BLOCK_ID_PATTERN = /^[A-Za-z0-9._:-]{1,200}$/;
|
|
7658
|
+
var SIGNED_DESTINATION_REF_PATTERN = /^[A-Za-z0-9._~-]{16,1000}$/;
|
|
7659
|
+
function parseTrimmedString(value) {
|
|
7660
|
+
if (typeof value !== "string") return null;
|
|
7661
|
+
const trimmed = value.trim();
|
|
7662
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
7663
|
+
}
|
|
7664
|
+
|
|
7665
7665
|
// ../blocks/src/system/runtime/nodes/newsletter-form.types.ts
|
|
7666
7666
|
function getPresetFields(preset, options) {
|
|
7667
7667
|
const includePhone = Boolean(options?.includePhone);
|
|
@@ -7714,6 +7714,7 @@ function withOptionalPhone(fields, includePhone) {
|
|
|
7714
7714
|
|
|
7715
7715
|
// ../blocks/src/system/runtime/nodes/newsletter-form.interactive.ts
|
|
7716
7716
|
var newsletterPresetSchema = z.enum(["emailOnly", "emailName", "emailFirstLast", "emailNameCompany"]);
|
|
7717
|
+
var newsletterDestinationProviderSchema = z.enum(["riverbank", "mailchimp"]);
|
|
7717
7718
|
var newsletterFieldSchema = z.object({
|
|
7718
7719
|
id: z.string(),
|
|
7719
7720
|
type: z.enum(["email", "text"]),
|
|
@@ -7721,10 +7722,24 @@ var newsletterFieldSchema = z.object({
|
|
|
7721
7722
|
required: z.boolean(),
|
|
7722
7723
|
placeholder: z.string().optional()
|
|
7723
7724
|
});
|
|
7725
|
+
var newsletterSignupBlockIdSchema = z.string().trim().min(1).transform(parseRequiredNewsletterSignupBlockId);
|
|
7726
|
+
var signedNewsletterDestinationRefSchema = z.string().trim().min(1).transform(parseRequiredSignedNewsletterDestinationRef);
|
|
7727
|
+
var newsletterPublicDestinationRefSchema = z.discriminatedUnion("tag", [
|
|
7728
|
+
z.object({
|
|
7729
|
+
tag: z.literal("block_ref"),
|
|
7730
|
+
blockId: newsletterSignupBlockIdSchema
|
|
7731
|
+
}),
|
|
7732
|
+
z.object({
|
|
7733
|
+
tag: z.literal("signed_destination_ref"),
|
|
7734
|
+
token: signedNewsletterDestinationRefSchema
|
|
7735
|
+
})
|
|
7736
|
+
]);
|
|
7724
7737
|
var newsletterSourceSchema = z.object({
|
|
7738
|
+
blockId: z.string().nullable().optional(),
|
|
7725
7739
|
siteId: z.string().optional(),
|
|
7726
7740
|
apiBaseUrl: z.string().optional(),
|
|
7727
7741
|
listId: z.string().nullable().optional(),
|
|
7742
|
+
destinationProvider: newsletterDestinationProviderSchema.nullable().optional(),
|
|
7728
7743
|
preset: newsletterPresetSchema.optional(),
|
|
7729
7744
|
includePhone: z.boolean().optional(),
|
|
7730
7745
|
buttonLabel: z.string().nullable().optional(),
|
|
@@ -7743,6 +7758,7 @@ var newsletterDisplaySchema = z.object({
|
|
|
7743
7758
|
fields: z.array(newsletterFieldSchema)
|
|
7744
7759
|
});
|
|
7745
7760
|
var newsletterHydrationSchema = z.object({
|
|
7761
|
+
destinationRef: newsletterPublicDestinationRefSchema.nullable().optional(),
|
|
7746
7762
|
listId: z.string().nullable().optional(),
|
|
7747
7763
|
preset: newsletterPresetSchema,
|
|
7748
7764
|
includePhone: z.boolean(),
|
|
@@ -7776,16 +7792,20 @@ var newsletterFormBlockRuntime = defineProgressiveBlockRuntime({
|
|
|
7776
7792
|
source: createZodCodec(newsletterSourceSchema),
|
|
7777
7793
|
render: createZodCodec(newsletterRenderSchema)
|
|
7778
7794
|
},
|
|
7779
|
-
buildRender: (source) =>
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7795
|
+
buildRender: (source) => {
|
|
7796
|
+
const runtimeSource = deriveNewsletterSignupRuntimeSource(source);
|
|
7797
|
+
return {
|
|
7798
|
+
display: buildNewsletterDisplay(source),
|
|
7799
|
+
hydration: {
|
|
7800
|
+
destinationRef: buildNewsletterSignupBlockRef(source.blockId),
|
|
7801
|
+
listId: runtimeSource.listId,
|
|
7802
|
+
preset: source.preset ?? "emailOnly",
|
|
7803
|
+
includePhone: source.includePhone ?? false,
|
|
7804
|
+
tags: runtimeSource.tags,
|
|
7805
|
+
spamProtectionEnabled: source.spamProtectionEnabled
|
|
7806
|
+
}
|
|
7807
|
+
};
|
|
7808
|
+
}
|
|
7789
7809
|
});
|
|
7790
7810
|
var newsletterFormInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
7791
7811
|
runtime: newsletterFormBlockRuntime,
|
|
@@ -7797,6 +7817,20 @@ var newsletterFormInteractiveIslandPropsCodec = createInteractiveIslandCodec({
|
|
|
7797
7817
|
apiBaseUrl: value.apiBaseUrl
|
|
7798
7818
|
})
|
|
7799
7819
|
});
|
|
7820
|
+
function parseRequiredNewsletterSignupBlockId(value) {
|
|
7821
|
+
const parsed = parseNewsletterSignupBlockId(value);
|
|
7822
|
+
if (!parsed) {
|
|
7823
|
+
throw new Error("Newsletter signup block destination ref requires blockId");
|
|
7824
|
+
}
|
|
7825
|
+
return parsed;
|
|
7826
|
+
}
|
|
7827
|
+
function parseRequiredSignedNewsletterDestinationRef(value) {
|
|
7828
|
+
const parsed = parseSignedNewsletterDestinationRef(value);
|
|
7829
|
+
if (!parsed) {
|
|
7830
|
+
throw new Error("Newsletter signup signed destination ref requires token");
|
|
7831
|
+
}
|
|
7832
|
+
return parsed;
|
|
7833
|
+
}
|
|
7800
7834
|
var publicProductVariantSchema = z.object({
|
|
7801
7835
|
id: z.string(),
|
|
7802
7836
|
title: z.string(),
|
|
@@ -8074,10 +8108,7 @@ function resolveSelectedProduct(products, contentEntry, productSlug) {
|
|
|
8074
8108
|
|
|
8075
8109
|
// ../blocks/src/system/runtime/nodes/commerce/shared/display.ts
|
|
8076
8110
|
function formatCommercePrice(cents, currency) {
|
|
8077
|
-
return
|
|
8078
|
-
style: "currency",
|
|
8079
|
-
currency: currency.toUpperCase()
|
|
8080
|
-
}).format(cents / 100);
|
|
8111
|
+
return formatCurrencyAmount(cents, currency);
|
|
8081
8112
|
}
|
|
8082
8113
|
function getPassesHeading(passes, explicitHeading) {
|
|
8083
8114
|
if (explicitHeading) return explicitHeading;
|
|
@@ -8758,4 +8789,4 @@ lucide-react/dist/esm/lucide-react.mjs:
|
|
|
8758
8789
|
*)
|
|
8759
8790
|
*/
|
|
8760
8791
|
|
|
8761
|
-
export { BOOKING_FORM_DATA_RESERVED_KEYS, ChevronLeft, ChevronRight, CreditCard, DateTimeTile, EMPTY_COMMERCE_CART_STATE, EmptyState, EventCard, EventCompactRow, MAX_EVENTS_PER_DAY, MONTH_NAMES, Sparkles, Star, Ticket, WIZARD_STEPS, addMonths, assertNever11, buildCalendarViewport, buildCartDisplay, buildEventCalendarListingRender, buildEventRuntimeFilters, buildPassCartItem, buildProductCardDisplay, buildProductCartItem, buildProductDetailDisplay, buildTimetableModel, clearWorkflowFeedback, defineIslandPropsDecoder, deriveBookingFormViewState, deriveCommerceCheckoutState, err2, findEventByOccurrenceId, findPreSelectedEvent, formatBookingSubmissionPreparationError, formatCommercePrice,
|
|
8792
|
+
export { BOOKING_FORM_DATA_RESERVED_KEYS, ChevronLeft, ChevronRight, CreditCard, DateTimeTile, EMPTY_COMMERCE_CART_STATE, EmptyState, EventCard, EventCompactRow, MAX_EVENTS_PER_DAY, MONTH_NAMES, Sparkles, Star, Ticket, WIZARD_STEPS, addMonths, assertNever11, buildCalendarViewport, buildCartDisplay, buildEventCalendarListingRender, buildEventRuntimeFilters, buildPassCartItem, buildProductCardDisplay, buildProductCartItem, buildProductDetailDisplay, buildTimetableModel, clearWorkflowFeedback, createRichTextDocFromMarkdown, defineIslandPropsDecoder, deriveBookingFormViewState, deriveCommerceCheckoutState, err2, findEventByOccurrenceId, findPreSelectedEvent, formatBookingSubmissionPreparationError, formatCommercePrice, formatDate, formatDateKey, formatEventDateParts, formatEventPrice, formatEventPriceDisplay, formatEventTeacherLine, formatInterval, formatTime, getBookingRedirectStateFromLocation, getBookingSuccessMessage, getCardOrientation, getContainerClass, getEventAvailability, getEventRuntimeFiltersKey, getOrderedDayNames, getShopDisplayForItems, getStepNumber, getThreeMonthRange, getWizardStepsForContext, groupEventsByDate, isEventContentType, isRecord, isToday, logger, normalizeCsvIds, normalizeCsvString, normalizeEventBlockKind, normalizeOptionalId, ok, okWith2, parseStoredCommerceCartState, prepareBookingSubmission, productItemKey, reduceCommerceCart, reportWorkflowError, reportWorkflowSuccess, resolveAppointmentCheckoutVerificationState, resolveBookingPaymentStep, resolveBookingSiteId, resolveDefaultBookingServiceId, resolveDiscountContext, resolveEventRequiresPayment, resolveRegistrationTarget, resolveRuntimeEventPricing, shiftCalendarAnchorDate, themeButtonClassName, toRegistrationEvents, toSelectedCollectionOptionKind, unwrapRichTextRoot };
|