@riverbankcms/sdk 0.132.0 → 0.134.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{PreviewEditorSidebar-DKQ5eFK9.mjs → PreviewEditorSidebar-DfRhJPFQ.mjs} +3 -3
  3. package/dist/{PreviewEditorUI-CNTcOjCC.mjs → PreviewEditorUI-Dppxcr_g.mjs} +2 -2
  4. package/dist/{SdkPreviewModeRuntime-DJu3qu33.mjs → SdkPreviewModeRuntime-8CyGCXir.mjs} +46 -15
  5. package/dist/{SiteChromeCustomizeContext-2TzT3vbj.mjs → SiteChromeCustomizeContext-DVMTMvqA.mjs} +497 -169
  6. package/dist/_dts/ai/src/contracts/proposals.d.ts +384 -384
  7. package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +219 -219
  8. package/dist/_dts/api/src/accountApi.d.ts +5 -5
  9. package/dist/_dts/api/src/appointmentEndpointDefinitions.d.ts +1 -1
  10. package/dist/_dts/api/src/bookingOperations.d.ts +2 -14
  11. package/dist/_dts/api/src/bookings.d.ts +2 -2
  12. package/dist/_dts/api/src/contentRuntime.d.ts +1 -1
  13. package/dist/_dts/api/src/courseEndpointDefinitions.d.ts +2 -2
  14. package/dist/_dts/api/src/endpoints.d.ts +3 -3
  15. package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -1
  16. package/dist/_dts/api/src/navigation/contracts.d.ts +9 -6
  17. package/dist/_dts/api/src/navigation/linkResolver.d.ts +6 -2
  18. package/dist/_dts/api/src/navigation/types.d.ts +23 -6
  19. package/dist/_dts/api/src/navigation.d.ts +1 -1
  20. package/dist/_dts/api/src/publicBookingService.d.ts +15 -0
  21. package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +3 -1
  22. package/dist/_dts/api/src/publicExperience/wholeSeriesEndpoints.d.ts +2 -0
  23. package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
  24. package/dist/_dts/api/src/sdkThemeWire.d.ts +50 -50
  25. package/dist/_dts/api/src/siteBanner.d.ts +4 -2
  26. package/dist/_dts/api/src/types.d.ts +1 -1
  27. package/dist/_dts/api/src/webhooks.d.ts +12 -12
  28. package/dist/_dts/blocks/src/client.d.ts +1 -1
  29. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +28 -72
  30. package/dist/_dts/blocks/src/index.d.ts +3 -2
  31. package/dist/_dts/blocks/src/primitives/content/components/RichText.d.ts +2 -2
  32. package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +1 -0
  33. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +36 -14
  34. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +3 -0
  35. package/dist/_dts/blocks/src/system/blocks/events/whole-series/schemas.d.ts +3 -3
  36. package/dist/_dts/blocks/src/system/blocks/events/whole-series/types.d.ts +3 -0
  37. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +4 -4
  38. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +148 -148
  39. package/dist/_dts/blocks/src/system/blocks/offerings-preview/model.d.ts +2 -1
  40. package/dist/_dts/blocks/src/system/blocks/shared/bookingConsent.d.ts +36 -0
  41. package/dist/_dts/blocks/src/system/manifest/hydrateLinks.d.ts +9 -2
  42. package/dist/_dts/blocks/src/system/manifest/resolveBlockData.d.ts +8 -0
  43. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +79 -79
  44. package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -11
  45. package/dist/_dts/blocks/src/system/runtime/api/types/courses.d.ts +2 -0
  46. package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +1 -0
  47. package/dist/_dts/blocks/src/system/runtime/components/multi-step/DynamicFormFields.d.ts +3 -19
  48. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +1 -1
  49. package/dist/_dts/blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.d.ts +2 -0
  50. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.consent.d.ts +10 -0
  51. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.field-values.d.ts +4 -0
  52. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.fields.d.ts +21 -0
  53. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +2 -1
  54. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +38 -144
  55. package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +5 -19
  56. package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +3 -2
  57. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.d.ts +2 -0
  58. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationSurface.d.ts +18 -1
  59. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -4
  60. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/validation.d.ts +2 -1
  61. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/components.d.ts +2 -1
  62. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/whole-series/whole-series-registration.headless.contract.d.ts +2 -0
  63. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +34 -12
  64. package/dist/_dts/blocks/src/system/runtime/shared/components/BookingConsentAgreement.d.ts +7 -0
  65. package/dist/_dts/blocks/src/system/runtime/shared/types.d.ts +1 -0
  66. package/dist/_dts/blocks/src/system/types/link.d.ts +7 -1
  67. package/dist/_dts/content-model/src/content-types/schema.d.ts +4 -4
  68. package/dist/_dts/core/src/booking-consent.d.ts +8 -0
  69. package/dist/_dts/core/src/index.d.ts +1 -0
  70. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +9 -3
  71. package/dist/_dts/db/src/schemas/forms.d.ts +21 -21
  72. package/dist/_dts/db/src/types/jsonb.d.ts +1 -1
  73. package/dist/_dts/editor/src/primitives/rich-text/RichTextEditorSurface.d.ts +2 -1
  74. package/dist/_dts/editor/src/primitives/rich-text/config.d.ts +2 -1
  75. package/dist/_dts/editor/src/primitives/rich-text/toolbar/linkPopoverUtils.d.ts +3 -2
  76. package/dist/_dts/editor/src/primitives/rich-text/useRichTextEditor.d.ts +3 -4
  77. package/dist/_dts/media-core/src/usageScanner.d.ts +1 -1
  78. package/dist/_dts/sdk/src/bookings/types.d.ts +7 -89
  79. package/dist/_dts/sdk/src/config/validation.d.ts +30 -30
  80. package/dist/_dts/sdk/src/contracts/content.d.ts +10 -36
  81. package/dist/_dts/sdk/src/contracts/rendering.d.ts +1 -1
  82. package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +9 -9
  83. package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -19
  84. package/dist/_dts/sdk/src/version.d.ts +1 -1
  85. package/dist/_dts/theme-core/src/accordions/types.d.ts +2 -2
  86. package/dist/_dts/theme-core/src/buttons/types.d.ts +12 -12
  87. package/dist/_dts/theme-core/src/cards/types.d.ts +5 -5
  88. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +72 -72
  89. package/dist/_dts/theme-core/src/navigation/types.d.ts +4 -4
  90. package/dist/_dts/theme-core/src/palette/colors.d.ts +1 -1
  91. package/dist/_dts/theme-core/src/palette/curated/types.d.ts +2 -2
  92. package/dist/_dts/theme-core/src/schema.d.ts +82 -82
  93. package/dist/_dts/theme-core/src/site-styles/cardRoleVocabulary.d.ts +1 -1
  94. package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
  95. package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +4 -4
  96. package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
  97. package/dist/_dts/theme-core/src/tokens/themeColorTokens.d.ts +1 -1
  98. package/dist/_dts/ui/src/badge.d.ts +1 -1
  99. package/dist/_dts/ui/src/button.d.ts +1 -1
  100. package/dist/_dts/ui/src/callout.d.ts +1 -1
  101. package/dist/_dts/ui/src/card.d.ts +1 -1
  102. package/dist/client/{StepIndicator-CGixP_LW.mjs → BookingConsentAgreement-BxgpGEFD.mjs} +26 -4
  103. package/dist/client/{DiscountCodeDisclosure-DO7llLxm.mjs → DiscountCodeDisclosure-CfuPOHD0.mjs} +1 -1
  104. package/dist/client/{EventCombined.client-xID7zN__.mjs → EventCombined.client-DB8Qfzi-.mjs} +3 -3
  105. package/dist/client/{EventListing.client-CriBslp0.mjs → EventListing.client-DD4X8hp4.mjs} +2 -2
  106. package/dist/client/{LeafletStaticMap-DYmHnM8g.mjs → LeafletStaticMap-QhgIBQbv.mjs} +1 -1
  107. package/dist/client/{WholeSeriesRegistrationWizard-BEjzSiOA.mjs → WholeSeriesRegistrationWizard-DwtC7bCs.mjs} +72 -22
  108. package/dist/client/{accordion-CgFbnnnQ.mjs → accordion-DFXpLvwg.mjs} +1 -1
  109. package/dist/client/{bookingForm-dUyGpbxc.mjs → bookingForm-sI05d3lk.mjs} +73 -47
  110. package/dist/client/bookings.mjs +989 -140
  111. package/dist/client/{carousel-BvBwkUzx.mjs → carousel-wjyWTZCh.mjs} +1 -1
  112. package/dist/client/{cart-DiZENT2E.mjs → cart-DCwdpA4i.mjs} +3 -3
  113. package/dist/client/{checkout-Dq13KIgR.mjs → checkout-DTDW3l0R.mjs} +3 -3
  114. package/dist/client/checkoutUrls-DQYC_Br-.mjs +187 -0
  115. package/dist/client/client.mjs +556 -237
  116. package/dist/client/{context-B83PiNzm.mjs → context-TSK1CGx8.mjs} +1 -14
  117. package/dist/client/{courseRegistration-CKC5NmyH.mjs → courseRegistration-A-Tg7qw_.mjs} +3 -3
  118. package/dist/client/{eventCalendar-BF0Jatfw.mjs → eventCalendar-B0Zg-i_w.mjs} +5 -5
  119. package/dist/client/{eventCombined-BuoCF8je.mjs → eventCombined-B8Y2wizd.mjs} +3 -3
  120. package/dist/client/{eventDetails-CKwh0S9s.mjs → eventDetails-DPDOwURJ.mjs} +3 -3
  121. package/dist/client/{eventListing-eUxaWFaB.mjs → eventListing-CjBcmSLn.mjs} +3 -3
  122. package/dist/client/{eventRegistration-CfkNOkPb.mjs → eventRegistration-CK30HsAq.mjs} +111 -64
  123. package/dist/client/{form-C17H1c_H.mjs → form-CUXfsABE.mjs} +2 -2
  124. package/dist/client/{headerSection-DEwUmrtt.mjs → headerSection-N-mN3rjr.mjs} +2 -2
  125. package/dist/client/hooks.mjs +106 -3
  126. package/dist/client/{locationMap-Pf2QwuvW.mjs → locationMap-oiIDQMBt.mjs} +2 -2
  127. package/dist/client/{newsletterForm-BWQAH5Sv.mjs → newsletterForm-CkQ2tTrM.mjs} +2 -2
  128. package/dist/client/{pricing-CVdvbopJ.mjs → pricing-Caa0QWzh.mjs} +1 -1
  129. package/dist/client/{productDetail-BZi1Fa_G.mjs → productDetail-CnidyrsN.mjs} +3 -3
  130. package/dist/client/{productList-qq-55DNk.mjs → productList-CttYcS_S.mjs} +3 -3
  131. package/dist/client/{propsDecoder-BxmqPKdP.mjs → propsDecoder-CeUMxI9a.mjs} +211 -100
  132. package/dist/client/rendering/client.mjs +428 -151
  133. package/dist/client/rendering/islands.mjs +18 -18
  134. package/dist/client/rendering.mjs +643 -324
  135. package/dist/client/{scrollToBlock-B3CcKdtG.mjs → scrollToBlock-lPr1oqxB.mjs} +1 -1
  136. package/dist/client/{shop-DNWJPut5.mjs → shop-DXQtMo2O.mjs} +6 -6
  137. package/dist/client/{shop-commerce-BhvQCosS.mjs → shop-commerce-quDL411J.mjs} +7 -164
  138. package/dist/client/{shop-commerce-store-B04sCNnW.mjs → shop-commerce-store-Dnu-8Iub.mjs} +1 -1
  139. package/dist/client/{shopShared-DNNgZlmW.mjs → shopShared-BWPUURvG.mjs} +3 -3
  140. package/dist/client/{useEventFilters-CUmhE24_.mjs → useEventFilters-DRhWp2_5.mjs} +3 -3
  141. package/dist/client/{usePolling-M5jG675x.mjs → usePolling-UN4WKnaM.mjs} +2 -2
  142. package/dist/preview-next/client/runtime.mjs +3 -3
  143. package/dist/{sdk-runtime-BEXb1wqo.mjs → sdk-runtime-Ca5RD78X.mjs} +1 -1
  144. package/dist/{separator-DGMuip1D.mjs → separator-CMhj6BTi.mjs} +1 -1
  145. package/dist/server/components.mjs +117 -37
  146. package/dist/server/config-validation.mjs +106 -3
  147. package/dist/server/config.mjs +106 -3
  148. package/dist/server/data.mjs +106 -3
  149. package/dist/server/index.mjs +1 -1
  150. package/dist/server/next.mjs +186 -106
  151. package/dist/server/page-converter.mjs +105 -2
  152. package/dist/server/prebuild.mjs +1 -1
  153. package/dist/server/rendering/server.mjs +119 -37
  154. package/dist/server/rendering.mjs +117 -37
  155. package/dist/server/routing.mjs +132 -73
  156. package/dist/server/server.mjs +107 -4
  157. package/dist/server/theme-bridge.mjs +4 -4
  158. package/package.json +2 -2
  159. package/dist/client/checkoutUrls-Ct8Mxna3.mjs +0 -26
@@ -8413,7 +8413,10 @@ var init_booking_date_time = __esmMin((() => {
8413
8413
  LOCAL_DATE_PATTERN = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u;
8414
8414
  DATE_TIME_FORMATTER_CACHE_LIMIT = 100;
8415
8415
  dateTimeFormatterCache = /* @__PURE__ */ new Map();
8416
- })), init_dated_offering_settlement = __esmMin((() => {
8416
+ }));
8417
+ //#endregion
8418
+ //#region ../core/src/booking-consent.ts
8419
+ var init_booking_consent = __esmMin((() => {})), init_dated_offering_settlement = __esmMin((() => {
8417
8420
  init_result$1();
8418
8421
  }));
8419
8422
  var init_person_records = __esmMin((() => {
@@ -8971,6 +8974,7 @@ var init_src$3 = __esmMin((() => {
8971
8974
  init_booking_refunds();
8972
8975
  init_booking_instalments();
8973
8976
  init_booking_date_time();
8977
+ init_booking_consent();
8974
8978
  init_dated_offering_settlement();
8975
8979
  init_person_records();
8976
8980
  init_rectification();
@@ -9031,6 +9035,68 @@ z$1.object({
9031
9035
  monthlyCurrency: z$1.literal("gbp")
9032
9036
  });
9033
9037
  //#endregion
9038
+ //#region ../blocks/src/system/types/link.ts
9039
+ const nullableString = z$1.union([z$1.string().min(1), z$1.null()]);
9040
+ const RESOLVED_INTERNAL_LINK_ENTITY_TYPES = [
9041
+ "page",
9042
+ "content",
9043
+ "pageSurface"
9044
+ ];
9045
+ const resolvedInternalLinkKeys = [
9046
+ "entityId",
9047
+ "entityType",
9048
+ "href",
9049
+ "title",
9050
+ "typeLabel"
9051
+ ];
9052
+ const internalRouteOnlyLinkSchema = z$1.object({
9053
+ kind: z$1.literal("internal"),
9054
+ routeId: z$1.string().min(1)
9055
+ }).passthrough().superRefine((value, ctx) => {
9056
+ if (!resolvedInternalLinkKeys.some((key) => value[key] != null)) return;
9057
+ ctx.addIssue({
9058
+ code: "custom",
9059
+ message: "Internal links with resolved metadata must include entityId, entityType, href, title, and typeLabel"
9060
+ });
9061
+ });
9062
+ const internalResolvedLinkSchema = z$1.object({
9063
+ kind: z$1.literal("internal"),
9064
+ routeId: z$1.string().min(1),
9065
+ entityId: z$1.string().min(1),
9066
+ entityType: z$1.enum(RESOLVED_INTERNAL_LINK_ENTITY_TYPES),
9067
+ href: z$1.string().min(1),
9068
+ title: z$1.string().min(1),
9069
+ typeLabel: z$1.string().min(1),
9070
+ contentTypeKey: nullableString.optional(),
9071
+ contentTypeName: nullableString.optional(),
9072
+ updatedAt: nullableString.optional()
9073
+ }).passthrough();
9074
+ const internalLinkSchema = z$1.union([internalResolvedLinkSchema, internalRouteOnlyLinkSchema]);
9075
+ const externalLinkSchema$1 = z$1.object({
9076
+ kind: z$1.literal("external"),
9077
+ href: z$1.string().min(1)
9078
+ }).passthrough();
9079
+ const customLinkSchema$1 = z$1.object({
9080
+ kind: z$1.literal("url"),
9081
+ href: z$1.string().min(1)
9082
+ }).passthrough();
9083
+ const pageLinkSchema$1 = z$1.object({
9084
+ kind: z$1.literal("page"),
9085
+ identifier: z$1.string().min(1)
9086
+ }).passthrough();
9087
+ const entryLinkSchema$1 = z$1.object({
9088
+ kind: z$1.literal("entry"),
9089
+ contentType: z$1.string().min(1),
9090
+ identifier: z$1.string().min(1)
9091
+ }).passthrough();
9092
+ const linkSchema = z$1.union([
9093
+ internalLinkSchema,
9094
+ externalLinkSchema$1,
9095
+ customLinkSchema$1,
9096
+ pageLinkSchema$1,
9097
+ entryLinkSchema$1
9098
+ ]);
9099
+ //#endregion
9034
9100
  //#region ../api/src/navigation/contracts.ts
9035
9101
  /**
9036
9102
  * Canonical navigation/link Zod contracts.
@@ -9060,7 +9126,7 @@ const internalLinkPayloadSchema = z$1.object({
9060
9126
  kind: z$1.literal("internal"),
9061
9127
  routeId: z$1.string().uuid(),
9062
9128
  entityId: z$1.string().uuid(),
9063
- entityType: z$1.enum(["page", "content"]),
9129
+ entityType: z$1.enum(RESOLVED_INTERNAL_LINK_ENTITY_TYPES),
9064
9130
  href: z$1.string().min(1),
9065
9131
  title: z$1.string().min(1),
9066
9132
  typeLabel: z$1.string().min(1),
@@ -9068,37 +9134,37 @@ const internalLinkPayloadSchema = z$1.object({
9068
9134
  contentTypeName: z$1.string().nullable().optional(),
9069
9135
  updatedAt: z$1.string().nullable().optional()
9070
9136
  }).passthrough();
9071
- const externalLinkSchema$1 = z$1.object({
9137
+ const externalLinkSchema = z$1.object({
9072
9138
  kind: z$1.literal("external"),
9073
9139
  href: z$1.string().url()
9074
9140
  });
9075
- const customLinkSchema$1 = z$1.object({
9141
+ const customLinkSchema = z$1.object({
9076
9142
  kind: z$1.literal("url"),
9077
9143
  href: z$1.string().min(1)
9078
9144
  });
9079
- const pageLinkSchema$1 = z$1.object({
9145
+ const pageLinkSchema = z$1.object({
9080
9146
  kind: z$1.literal("page"),
9081
9147
  identifier: z$1.string().min(1)
9082
9148
  });
9083
- const entryLinkSchema$1 = z$1.object({
9149
+ const entryLinkSchema = z$1.object({
9084
9150
  kind: z$1.literal("entry"),
9085
9151
  contentType: z$1.string().min(1),
9086
9152
  identifier: z$1.string().min(1)
9087
9153
  });
9088
9154
  const linkPayloadSchema = z$1.discriminatedUnion("kind", [
9089
9155
  internalLinkPayloadSchema,
9090
- pageLinkSchema$1,
9091
- entryLinkSchema$1,
9092
- externalLinkSchema$1,
9093
- customLinkSchema$1,
9156
+ pageLinkSchema,
9157
+ entryLinkSchema,
9158
+ externalLinkSchema,
9159
+ customLinkSchema,
9094
9160
  portalLinkPayloadSchema,
9095
9161
  cartLinkPayloadSchema
9096
9162
  ]);
9097
9163
  const navigationLinkInputSchemaOptions = [
9098
- pageLinkSchema$1,
9099
- entryLinkSchema$1,
9100
- externalLinkSchema$1,
9101
- customLinkSchema$1,
9164
+ pageLinkSchema,
9165
+ entryLinkSchema,
9166
+ externalLinkSchema,
9167
+ customLinkSchema,
9102
9168
  portalLinkPayloadSchema,
9103
9169
  cartLinkPayloadSchema
9104
9170
  ];
@@ -18733,63 +18799,6 @@ var init_schema$2 = __esmMin((() => {
18733
18799
  themes: z$1.array(themeSchema).length(3)
18734
18800
  });
18735
18801
  }));
18736
- //#endregion
18737
- //#region ../blocks/src/system/types/link.ts
18738
- const nullableString = z$1.union([z$1.string().min(1), z$1.null()]);
18739
- const resolvedInternalLinkKeys = [
18740
- "entityId",
18741
- "entityType",
18742
- "href",
18743
- "title",
18744
- "typeLabel"
18745
- ];
18746
- const internalRouteOnlyLinkSchema = z$1.object({
18747
- kind: z$1.literal("internal"),
18748
- routeId: z$1.string().min(1)
18749
- }).passthrough().superRefine((value, ctx) => {
18750
- if (!resolvedInternalLinkKeys.some((key) => value[key] != null)) return;
18751
- ctx.addIssue({
18752
- code: "custom",
18753
- message: "Internal links with resolved metadata must include entityId, entityType, href, title, and typeLabel"
18754
- });
18755
- });
18756
- const internalResolvedLinkSchema = z$1.object({
18757
- kind: z$1.literal("internal"),
18758
- routeId: z$1.string().min(1),
18759
- entityId: z$1.string().min(1),
18760
- entityType: z$1.enum(["page", "content"]),
18761
- href: z$1.string().min(1),
18762
- title: z$1.string().min(1),
18763
- typeLabel: z$1.string().min(1),
18764
- contentTypeKey: nullableString.optional(),
18765
- contentTypeName: nullableString.optional(),
18766
- updatedAt: nullableString.optional()
18767
- }).passthrough();
18768
- const internalLinkSchema = z$1.union([internalResolvedLinkSchema, internalRouteOnlyLinkSchema]);
18769
- const externalLinkSchema = z$1.object({
18770
- kind: z$1.literal("external"),
18771
- href: z$1.string().min(1)
18772
- }).passthrough();
18773
- const customLinkSchema = z$1.object({
18774
- kind: z$1.literal("url"),
18775
- href: z$1.string().min(1)
18776
- }).passthrough();
18777
- const pageLinkSchema = z$1.object({
18778
- kind: z$1.literal("page"),
18779
- identifier: z$1.string().min(1)
18780
- }).passthrough();
18781
- const entryLinkSchema = z$1.object({
18782
- kind: z$1.literal("entry"),
18783
- contentType: z$1.string().min(1),
18784
- identifier: z$1.string().min(1)
18785
- }).passthrough();
18786
- const linkSchema = z$1.union([
18787
- internalLinkSchema,
18788
- externalLinkSchema,
18789
- customLinkSchema,
18790
- pageLinkSchema,
18791
- entryLinkSchema
18792
- ]);
18793
18802
  var init_types$10 = __esmMin((() => {}));
18794
18803
  //#endregion
18795
18804
  //#region ../media-core/src/fileSafety.ts
@@ -40934,6 +40943,44 @@ var init_bookingPaymentTerms = __esmMin((() => {
40934
40943
  blockBookingPaymentTermsSchema = z$1.object({ allowedOptions: z$1.array(blockBookingPaymentCollectionOptionSchema).min(1) });
40935
40944
  }));
40936
40945
  //#endregion
40946
+ //#region ../blocks/src/system/blocks/shared/bookingConsent.ts
40947
+ function toBookingRequirementConsentFieldId(requirementId) {
40948
+ return `${BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX}${requirementId}`;
40949
+ }
40950
+ function isBookingRequirementConsentFieldId(value) {
40951
+ return value.startsWith(BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX);
40952
+ }
40953
+ function toBookingRequirementConsentField(consent) {
40954
+ return {
40955
+ id: toBookingRequirementConsentFieldId(consent.requirementId),
40956
+ label: consent.title,
40957
+ type: "booking_requirement_consent",
40958
+ required: true,
40959
+ agreement: consent.agreement,
40960
+ checkboxLabel: consent.checkboxLabel
40961
+ };
40962
+ }
40963
+ var BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX, blockBookingConsentSchema, bookingRequirementConsentFieldSchema, bookingConsentCarrierSchema;
40964
+ var init_bookingConsent = __esmMin((() => {
40965
+ init_richTextSchema();
40966
+ BOOKING_REQUIREMENT_CONSENT_FIELD_PREFIX = "booking_requirement_consent_";
40967
+ blockBookingConsentSchema = z$1.object({
40968
+ requirementId: z$1.string(),
40969
+ title: z$1.string(),
40970
+ agreement: RichTextDocSchema,
40971
+ checkboxLabel: z$1.string()
40972
+ });
40973
+ bookingRequirementConsentFieldSchema = z$1.object({
40974
+ id: z$1.string(),
40975
+ label: z$1.string(),
40976
+ type: z$1.literal("booking_requirement_consent"),
40977
+ required: z$1.literal(true),
40978
+ agreement: RichTextDocSchema,
40979
+ checkboxLabel: z$1.string().min(1)
40980
+ });
40981
+ bookingConsentCarrierSchema = z$1.union([blockBookingConsentSchema, bookingRequirementConsentFieldSchema]);
40982
+ }));
40983
+ //#endregion
40937
40984
  //#region ../blocks/src/system/blocks/events/whole-series/pricing.ts
40938
40985
  function isSaleWindowOpen(option, now) {
40939
40986
  if (!option.isActive) return false;
@@ -41115,6 +41162,7 @@ var init_pricing$3 = __esmMin((() => {
41115
41162
  var wholeSeriesVenueSchema, wholeSeriesSessionSchema, wholeSeriesTeamMemberSummarySchema, wholeSeriesPricingOptionSchema, wholeSeriesPricingSchema, publicWholeSeriesOfferingSchema, publicWholeSeriesOfferingsArraySchema;
41116
41163
  var init_schemas$2 = __esmMin((() => {
41117
41164
  init_bookingPaymentTerms();
41165
+ init_bookingConsent();
41118
41166
  wholeSeriesVenueSchema = z$1.object({
41119
41167
  id: z$1.string(),
41120
41168
  name: z$1.string(),
@@ -41178,6 +41226,7 @@ var init_schemas$2 = __esmMin((() => {
41178
41226
  pricing: wholeSeriesPricingSchema,
41179
41227
  currency: z$1.string(),
41180
41228
  paymentTerms: blockBookingPaymentTermsSchema,
41229
+ consent: blockBookingConsentSchema.nullable(),
41181
41230
  enrollmentCapacity: z$1.number().nullable(),
41182
41231
  acceptsMemberships: z$1.boolean(),
41183
41232
  status: z$1.enum([
@@ -41207,6 +41256,7 @@ var init_schemas$1 = __esmMin((() => {
41207
41256
  init_media$1();
41208
41257
  init_richTextSchema();
41209
41258
  init_bookingPaymentTerms();
41259
+ init_bookingConsent();
41210
41260
  init_whole_series();
41211
41261
  eventPresetSchema = z$1.enum([
41212
41262
  "event",
@@ -41497,6 +41547,7 @@ var init_schemas$1 = __esmMin((() => {
41497
41547
  timeZone: z$1.string(),
41498
41548
  pricing: publicEventPricingSchema,
41499
41549
  paymentTerms: blockBookingPaymentTermsSchema,
41550
+ consent: blockBookingConsentSchema.nullable(),
41500
41551
  accessRestriction: accessRestrictionSchema,
41501
41552
  allowedCategoryIds: z$1.array(z$1.string()),
41502
41553
  requireGuestDetails: z$1.boolean().optional(),
@@ -41877,6 +41928,57 @@ var init_eventScope = __esmMin((() => {
41877
41928
  });
41878
41929
  }));
41879
41930
  //#endregion
41931
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
41932
+ function planEventRegistrationScope(input) {
41933
+ const subject = input.subject;
41934
+ const selectedRunOffering = input.wholeSeriesOffering;
41935
+ if (subject?.kind !== "eventOffering" || !selectedRunOffering) return {
41936
+ kind: "context",
41937
+ events: resolveEventRegistrationScopedEvents(input.events, {
41938
+ occurrenceContext: input.occurrenceContext,
41939
+ subject
41940
+ })
41941
+ };
41942
+ if (!(selectedRunOffering.eventOfferingId === subject.eventOfferingId && subject.availableEventSeriesIds.some((seriesId) => seriesId === selectedRunOffering.eventSeriesId))) return { kind: "invalidSelectedRun" };
41943
+ return {
41944
+ kind: "selectedRun",
41945
+ events: input.events.filter((event) => event.seriesId === selectedRunOffering.eventSeriesId),
41946
+ offering: selectedRunOffering
41947
+ };
41948
+ }
41949
+ function planEventRegistrationSurface(input) {
41950
+ const scope = planEventRegistrationScope(input);
41951
+ if (scope.kind === "invalidSelectedRun") return { kind: "unavailableWholeSeries" };
41952
+ const scopedEvents = scope.events;
41953
+ const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
41954
+ if (scope.kind === "selectedRun") {
41955
+ if (bookingScopes.size !== 1 || !bookingScopes.has("whole_series")) return { kind: "unavailableWholeSeries" };
41956
+ return {
41957
+ kind: "wholeSeries",
41958
+ offerings: [scope.offering]
41959
+ };
41960
+ }
41961
+ if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
41962
+ kind: "occurrence",
41963
+ events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
41964
+ };
41965
+ if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
41966
+ kind: "occurrence",
41967
+ events: scopedEvents
41968
+ };
41969
+ const requiredSeriesIds = new Set(scopedEvents.map((event) => event.seriesId));
41970
+ const wholeSeriesOffering = input.wholeSeriesOffering;
41971
+ const offerings = (wholeSeriesOffering ? [wholeSeriesOffering, ...input.wholeSeriesOfferings.filter((offering) => offering.eventSeriesId !== wholeSeriesOffering.eventSeriesId)] : input.wholeSeriesOfferings).filter((offering) => requiredSeriesIds.has(offering.eventSeriesId));
41972
+ const loadedSeriesIds = new Set(offerings.map((offering) => offering.eventSeriesId));
41973
+ return [...requiredSeriesIds].every((seriesId) => loadedSeriesIds.has(seriesId)) && offerings.length > 0 ? {
41974
+ kind: "wholeSeries",
41975
+ offerings
41976
+ } : { kind: "unavailableWholeSeries" };
41977
+ }
41978
+ var init_registrationSurface = __esmMin((() => {
41979
+ init_eventScope();
41980
+ }));
41981
+ //#endregion
41880
41982
  //#region ../blocks/src/system/runtime/nodes/events/shared/destination.ts
41881
41983
  function isRecord$22(value) {
41882
41984
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -42286,10 +42388,13 @@ function buildEventRegistrationShellStepLabels(source) {
42286
42388
  }) : false).map((step) => shellLabelForRegistrationStep(step, scopedEvents));
42287
42389
  }
42288
42390
  function scopeEventRegistrationEvents(source) {
42289
- return resolveEventRegistrationScopedEvents(toRegistrationEvents(source.events ?? []), {
42391
+ const scope = planEventRegistrationScope({
42392
+ events: toRegistrationEvents(source.events ?? []),
42393
+ wholeSeriesOffering: source.wholeSeriesOffering,
42290
42394
  occurrenceContext: source.occurrenceContext,
42291
42395
  subject: source.subject
42292
42396
  });
42397
+ return scope.kind === "invalidSelectedRun" ? [] : scope.events;
42293
42398
  }
42294
42399
  function shellLabelForRegistrationStep(step, events) {
42295
42400
  switch (step) {
@@ -42347,6 +42452,7 @@ var init_event_registration_interactive = __esmMin((() => {
42347
42452
  init_shop_shared();
42348
42453
  init_event_registration_shared();
42349
42454
  init_eventScope();
42455
+ init_registrationSurface();
42350
42456
  init_pricing$2();
42351
42457
  init_destination();
42352
42458
  init_islands();
@@ -48721,6 +48827,7 @@ function normalizeGroupPresentation(value) {
48721
48827
  function resolveAutoCtaPath(source, routes) {
48722
48828
  const routeByNormalizedPath = /* @__PURE__ */ new Map();
48723
48829
  for (const route of routes ?? []) {
48830
+ if (route.kind === "pageSurface") continue;
48724
48831
  const normalized = normalizeRoutePath(route.path);
48725
48832
  if (normalized && !routeByNormalizedPath.has(normalized)) routeByNormalizedPath.set(normalized, route.path);
48726
48833
  }
@@ -48781,7 +48888,7 @@ const publicRouteCandidatesSchema = z$1.object({ routes: z$1.array(z$1.object({
48781
48888
  entityId: z$1.string(),
48782
48889
  path: z$1.string(),
48783
48890
  title: z$1.string(),
48784
- kind: z$1.enum(["page", "content"]),
48891
+ kind: z$1.enum(RESOLVED_INTERNAL_LINK_ENTITY_TYPES),
48785
48892
  contentTypeKey: z$1.string().nullable().optional()
48786
48893
  })) });
48787
48894
  const groupOverrideFields = [
@@ -55633,7 +55740,7 @@ function normalizeRel(target, rel) {
55633
55740
  tokens.add("noreferrer");
55634
55741
  return Array.from(tokens).join(" ");
55635
55742
  }
55636
- function renderMarks(text, marks, key) {
55743
+ function renderMarks(text, marks, key, linkTarget) {
55637
55744
  if (!marks || marks.length === 0) return text;
55638
55745
  return marks.reduce((acc, mark) => {
55639
55746
  switch (mark.type) {
@@ -55646,7 +55753,8 @@ function renderMarks(text, marks, key) {
55646
55753
  const attrs = mark.attrs ?? {};
55647
55754
  const href = sanitizeHref(attrs.href);
55648
55755
  if (!href) return acc;
55649
- const target = typeof attrs.target === "string" && attrs.target.trim().length > 0 ? attrs.target.trim() : void 0;
55756
+ const storedTarget = typeof attrs.target === "string" && attrs.target.trim().length > 0 ? attrs.target.trim() : void 0;
55757
+ const target = linkTarget === "new-tab" ? "_blank" : storedTarget;
55650
55758
  return /* @__PURE__ */ jsx("a", {
55651
55759
  href,
55652
55760
  target,
@@ -55658,14 +55766,14 @@ function renderMarks(text, marks, key) {
55658
55766
  }
55659
55767
  }, text);
55660
55768
  }
55661
- function renderDoc(node, key, imageResolveContext) {
55769
+ function renderDoc(node, key, imageResolveContext, linkTarget) {
55662
55770
  if (!node || !node.type) return null;
55663
- const children = node.content?.map((child, index) => renderDoc(child, `${key}-${index}`, imageResolveContext));
55771
+ const children = node.content?.map((child, index) => renderDoc(child, `${key}-${index}`, imageResolveContext, linkTarget));
55664
55772
  switch (node.type) {
55665
55773
  case "doc": return /* @__PURE__ */ jsx(Fragment, { children });
55666
55774
  case "paragraph":
55667
55775
  if (!children && !node.text) return /* @__PURE__ */ jsx("p", {}, key);
55668
- return /* @__PURE__ */ jsx("p", { children: children ?? renderMarks(node.text ?? "", node.marks, key) }, key);
55776
+ return /* @__PURE__ */ jsx("p", { children: children ?? renderMarks(node.text ?? "", node.marks, key, linkTarget) }, key);
55669
55777
  case "heading": {
55670
55778
  const headingTag = `h${Math.min(Math.max(node.attrs?.level ?? 2, 1), 6)}`;
55671
55779
  return React.createElement(headingTag, { key }, children);
@@ -55707,13 +55815,13 @@ function renderDoc(node, key, imageResolveContext) {
55707
55815
  decoding: "async"
55708
55816
  }, key);
55709
55817
  }
55710
- case "text": return renderMarks(node.text ?? "", node.marks, key);
55818
+ case "text": return renderMarks(node.text ?? "", node.marks, key, linkTarget);
55711
55819
  default: return null;
55712
55820
  }
55713
55821
  }
55714
- function RichText$1({ as: Comp = "div", className, doc, path }) {
55822
+ function RichText$1({ as: Comp = "div", className, doc, path, linkTarget = "stored" }) {
55715
55823
  const imageResolveContext = getCurrentResolveImageUrlContext() ?? null;
55716
- const content = doc ? renderDoc(doc, "doc", imageResolveContext) : null;
55824
+ const content = doc ? renderDoc(doc, "doc", imageResolveContext, linkTarget) : null;
55717
55825
  const dataAttributes = path ? { "data-builder-richtext": path } : void 0;
55718
55826
  return /* @__PURE__ */ jsx(Comp, {
55719
55827
  className: className?.trim() || DEFAULT_RICH_TEXT_CLASS,
@@ -57003,6 +57111,31 @@ var init_booking_form_reserved_fields = __esmMin((() => {
57003
57111
  BOOKING_FORM_DATA_RESERVED_KEYS = new Set(BOOKING_FORM_DATA_RESERVED_KEY_VALUES);
57004
57112
  }));
57005
57113
  //#endregion
57114
+ //#region ../blocks/src/system/runtime/nodes/booking-form.consent.ts
57115
+ function resolveSelectedAppointmentConsent(service) {
57116
+ return service?.consent ? {
57117
+ kind: "required-for-selected-service",
57118
+ field: toBookingRequirementConsentField(service.consent)
57119
+ } : { kind: "not-applicable" };
57120
+ }
57121
+ function projectSelectedAppointmentConsentIntoForm(form, selectedConsent) {
57122
+ if (!form) return null;
57123
+ const sourceFields = form.schema?.fields ?? [];
57124
+ const baseFields = sourceFields.filter((field) => field.type !== "booking_requirement_consent");
57125
+ const fields = selectedConsent.kind === "required-for-selected-service" ? [...baseFields, selectedConsent.field] : baseFields;
57126
+ if (selectedConsent.kind === "not-applicable" && baseFields.length === sourceFields.length) return form;
57127
+ return {
57128
+ ...form,
57129
+ schema: {
57130
+ ...form.schema,
57131
+ fields
57132
+ }
57133
+ };
57134
+ }
57135
+ var init_booking_form_consent = __esmMin((() => {
57136
+ init_bookingConsent();
57137
+ }));
57138
+ //#endregion
57006
57139
  //#region ../blocks/src/system/runtime/nodes/booking-form.state.ts
57007
57140
  function toTrimmedString(value) {
57008
57141
  const trimmed = value?.trim();
@@ -57185,7 +57318,6 @@ function readBookingFieldType(value) {
57185
57318
  case "select":
57186
57319
  case "radio":
57187
57320
  case "checkbox":
57188
- case "booking_requirement_consent":
57189
57321
  case "tel":
57190
57322
  case "url":
57191
57323
  case "number":
@@ -57220,7 +57352,7 @@ function normalizeBookingSettings(value) {
57220
57352
  };
57221
57353
  }
57222
57354
  function isBookingFormService(value) {
57223
- return isRecord$11(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string";
57355
+ return isRecord$11(value) && typeof value.id === "string" && typeof value.siteId === "string" && typeof value.title === "string" && (value.consent === void 0 || blockBookingConsentSchema.safeParse(value.consent).success);
57224
57356
  }
57225
57357
  function collectBookingCustomFields(data) {
57226
57358
  const customFields = {};
@@ -57466,16 +57598,27 @@ function getBookingSuccessMessage(successMessage) {
57466
57598
  var init_booking_form_state = __esmMin((() => {
57467
57599
  init_dist$1();
57468
57600
  init_src$3();
57601
+ init_bookingConsent();
57469
57602
  init_booking_form_reserved_fields();
57603
+ init_booking_form_consent();
57470
57604
  }));
57471
- var bookingFieldOptionSchema, bookingFieldSchema, bookingSettingsSchema, bookingSourceFormSchema;
57605
+ var bookingFieldOptionSchema, standardBookingFieldRules, standardBookingFieldSchema, bookingFieldSchema, bookingSettingsSchema, bookingSourceFormSchema;
57472
57606
  var init_booking_runtime_sources = __esmMin((() => {
57473
57607
  init_noop();
57474
57608
  bookingFieldOptionSchema = z$1.object({
57475
57609
  value: z$1.string(),
57476
57610
  label: z$1.string()
57477
57611
  });
57478
- bookingFieldSchema = z$1.object({
57612
+ standardBookingFieldRules = {
57613
+ options: z$1.array(bookingFieldOptionSchema).optional(),
57614
+ multiple: z$1.boolean().optional(),
57615
+ minLength: z$1.number().optional(),
57616
+ maxLength: z$1.number().optional(),
57617
+ pattern: z$1.string().optional(),
57618
+ min: z$1.number().optional(),
57619
+ max: z$1.number().optional()
57620
+ };
57621
+ standardBookingFieldSchema = z$1.object({
57479
57622
  id: z$1.string(),
57480
57623
  label: z$1.string(),
57481
57624
  type: z$1.enum([
@@ -57485,7 +57628,6 @@ var init_booking_runtime_sources = __esmMin((() => {
57485
57628
  "select",
57486
57629
  "radio",
57487
57630
  "checkbox",
57488
- "booking_requirement_consent",
57489
57631
  "tel",
57490
57632
  "url",
57491
57633
  "number",
@@ -57495,14 +57637,9 @@ var init_booking_runtime_sources = __esmMin((() => {
57495
57637
  required: z$1.boolean().optional(),
57496
57638
  placeholder: z$1.string().optional(),
57497
57639
  helpText: z$1.string().optional(),
57498
- options: z$1.array(bookingFieldOptionSchema).optional(),
57499
- multiple: z$1.boolean().optional(),
57500
- minLength: z$1.number().optional(),
57501
- maxLength: z$1.number().optional(),
57502
- pattern: z$1.string().optional(),
57503
- min: z$1.number().optional(),
57504
- max: z$1.number().optional()
57640
+ ...standardBookingFieldRules
57505
57641
  });
57642
+ bookingFieldSchema = standardBookingFieldSchema;
57506
57643
  bookingSettingsSchema = z$1.object({
57507
57644
  type: z$1.literal("booking"),
57508
57645
  serviceId: z$1.string().optional(),
@@ -57556,6 +57693,7 @@ var init_booking_form_interactive = __esmMin((() => {
57556
57693
  init_booking_form_state();
57557
57694
  init_booking_runtime_sources();
57558
57695
  init_bookingPaymentTerms();
57696
+ init_bookingConsent();
57559
57697
  blockBookingPaymentTermsAvailabilitySchema = z$1.union([z$1.object({
57560
57698
  kind: z$1.literal("available"),
57561
57699
  paymentTerms: blockBookingPaymentTermsSchema
@@ -57574,7 +57712,8 @@ var init_booking_form_interactive = __esmMin((() => {
57574
57712
  priceAmount: z$1.number().nullable().optional(),
57575
57713
  priceCurrency: z$1.string().nullable().optional(),
57576
57714
  paymentTerms: blockBookingPaymentTermsSchema.optional(),
57577
- paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional()
57715
+ paymentTermsAvailability: blockBookingPaymentTermsAvailabilitySchema.optional(),
57716
+ consent: blockBookingConsentSchema.optional()
57578
57717
  });
57579
57718
  bookingServicesSourceSchema = z$1.union([
57580
57719
  z$1.array(bookingServiceSchema),
@@ -63265,18 +63404,53 @@ init_defineBlock();
63265
63404
  //#endregion
63266
63405
  //#region ../blocks/src/system/manifest/hydrateLinks.ts
63267
63406
  init_typeGuards();
63407
+ init_bookingConsent();
63268
63408
  /**
63269
63409
  * Hydrates link objects within block content using the provided route map. Returns
63270
63410
  * the original content reference when no mutations are required to avoid unnecessary renders.
63271
63411
  */
63272
63412
  function hydrateManifestLinks(manifest, content, routes, pagesByIdentifier, entriesByIdentifier) {
63273
63413
  if (!routes || !manifest?.fields?.length) return content;
63274
- return hydrateValue(content, {
63414
+ return hydrateLinks(content, routes, pagesByIdentifier, entriesByIdentifier);
63415
+ }
63416
+ /** Hydrate identifier-aware links in data loaded after manifest content. */
63417
+ function hydrateLinks(value, routes, pagesByIdentifier, entriesByIdentifier) {
63418
+ return hydrateValue(value, {
63275
63419
  routes,
63276
63420
  pagesByIdentifier,
63277
63421
  entriesByIdentifier
63278
63422
  });
63279
63423
  }
63424
+ /**
63425
+ * Hydrate links only inside resolved booking-consent documents. Loader payloads are
63426
+ * otherwise opaque and may legitimately contain objects that resemble link values.
63427
+ */
63428
+ function hydrateResolvedBookingConsentLinks(value, routes, pagesByIdentifier, entriesByIdentifier) {
63429
+ return hydrateResolvedBookingConsentValue(value, {
63430
+ routes,
63431
+ pagesByIdentifier,
63432
+ entriesByIdentifier
63433
+ });
63434
+ }
63435
+ function hydrateResolvedBookingConsentValue(value, context) {
63436
+ if (Array.isArray(value)) {
63437
+ const hydratedItems = value.map((item) => hydrateResolvedBookingConsentValue(item, context));
63438
+ return hydratedItems.every((item, index) => item === value[index]) ? value : hydratedItems;
63439
+ }
63440
+ if (!isRecord$25(value)) return value;
63441
+ if (isBookingConsentCarrier(value)) {
63442
+ const agreement = hydrateValue(value.agreement, context);
63443
+ return agreement === value.agreement ? value : {
63444
+ ...value,
63445
+ agreement
63446
+ };
63447
+ }
63448
+ const hydratedEntries = Object.entries(value).map(([key, entry]) => [key, hydrateResolvedBookingConsentValue(entry, context)]);
63449
+ return hydratedEntries.every(([key, entry]) => entry === value[key]) ? value : Object.fromEntries(hydratedEntries);
63450
+ }
63451
+ function isBookingConsentCarrier(value) {
63452
+ return bookingConsentCarrierSchema.safeParse(value).success;
63453
+ }
63280
63454
  function hydrateValue(value, context) {
63281
63455
  try {
63282
63456
  if (Array.isArray(value)) {
@@ -63345,6 +63519,14 @@ function hydrateEntryLink(link, context) {
63345
63519
  };
63346
63520
  }
63347
63521
  //#endregion
63522
+ //#region ../blocks/src/system/manifest/resolveBlockData.ts
63523
+ init_typeGuards();
63524
+ function resolveBlockData(blockId, dataLoaders, dataContext, routes) {
63525
+ const raw = blockId ? dataContext?.resolvedData?.[blockId] : void 0;
63526
+ if (isRecord$25(raw)) return routes ? hydrateResolvedBookingConsentLinks(raw, routes, dataContext?.pagesByIdentifier, dataContext?.entriesByIdentifier) : raw;
63527
+ return dataLoaders && typeof dataLoaders === "object" && Object.keys(dataLoaders).length > 0 ? {} : void 0;
63528
+ }
63529
+ //#endregion
63348
63530
  //#region ../blocks/src/sdkBlockTransform.ts
63349
63531
  init_augmentManifest();
63350
63532
  /**
@@ -63950,8 +64132,8 @@ function generateInputCss({ themeId, theme, inputSystem }) {
63950
64132
  const radioSelector = `${rootSelector} .form-radio`;
63951
64133
  const checkableRules = [];
63952
64134
  checkableRules.push("appearance: none");
63953
- checkableRules.push("width: 1rem");
63954
- checkableRules.push("height: 1rem");
64135
+ checkableRules.push("width: 1.125rem");
64136
+ checkableRules.push("height: 1.125rem");
63955
64137
  checkableRules.push("flex-shrink: 0");
63956
64138
  checkableRules.push(`border: ${borderPx} solid ${rgbColorValue(inputSystem.base.border.colorToken)}`);
63957
64139
  if (inputSystem.base.background.type === "transparent") checkableRules.push("background-color: transparent");
@@ -67776,11 +67958,7 @@ const MemoBlockSection = React$1.memo(function MemoBlockSection({ themeResources
67776
67958
  try {
67777
67959
  const routes = routeMap ?? dataContext?.routes;
67778
67960
  const hydratedContent = routes ? hydrateManifestLinks(definition.manifest, data, routes, dataContext?.pagesByIdentifier, dataContext?.entriesByIdentifier) : data;
67779
- const resolved = resolveBlockData({
67780
- block,
67781
- definition,
67782
- dataContext
67783
- });
67961
+ const resolved = resolveBlockData(block.id, definition.dataLoaders, dataContext, routes);
67784
67962
  const hasResolvedData = !!resolved && typeof resolved === "object" && Object.keys(resolved).length > 0;
67785
67963
  const baseProps = {
67786
67964
  content: hydratedContent,
@@ -67870,12 +68048,6 @@ function shouldDebugCustomBlocks() {
67870
68048
  return false;
67871
68049
  }
67872
68050
  }
67873
- function resolveBlockData({ block, definition, dataContext }) {
67874
- const blockId = block.id ?? null;
67875
- const raw = blockId ? dataContext?.resolvedData?.[blockId] : void 0;
67876
- if (isObjectRecord$2(raw)) return { ...raw };
67877
- return definition.dataLoaders && Object.keys(definition.dataLoaders).length > 0 ? {} : void 0;
67878
- }
67879
68051
  /**
67880
68052
  * Resolves block content based on stage priority.
67881
68053
  * For draft/preview: draftContent takes priority over content.
@@ -83427,6 +83599,7 @@ init_media$1();
83427
83599
  init_slotContracts();
83428
83600
  init_typeGuards();
83429
83601
  init_booking_form_reserved_fields();
83602
+ init_bookingConsent();
83430
83603
  init_backgroundContent();
83431
83604
  init_events$2();
83432
83605
  init_colorStyles();
@@ -84815,6 +84988,9 @@ function isNavigationMenuValidationItem(value) {
84815
84988
  return typeof value.label === "string";
84816
84989
  }
84817
84990
  //#endregion
84991
+ //#region ../api/src/navigation/routableLink.ts
84992
+ init_src$3();
84993
+ //#endregion
84818
84994
  //#region ../api/src/navigation/visibility.ts
84819
84995
  /**
84820
84996
  * Navigation Visibility Rules
@@ -144081,20 +144257,7 @@ function createBlockApi(config) {
144081
144257
  const path = buildPath(WHOLE_SERIES.checkout.path, { siteId: sid });
144082
144258
  return request(WHOLE_SERIES.checkout, {
144083
144259
  path,
144084
- body: {
144085
- eventSeriesId: data.eventSeriesId,
144086
- ...data.pricingOptionId ? { pricingOptionId: data.pricingOptionId } : {},
144087
- ...data.selectedSlidingAmount !== void 0 ? { selectedSlidingAmount: data.selectedSlidingAmount } : {},
144088
- email: data.email,
144089
- name: data.name,
144090
- phone: data.phone,
144091
- formData: data.formData,
144092
- altchaSolution: data.altchaSolution,
144093
- discountCode: data.discountCode,
144094
- successUrl: data.successUrl,
144095
- cancelUrl: data.cancelUrl,
144096
- claimToken: data.claimToken
144097
- }
144260
+ body: data
144098
144261
  });
144099
144262
  },
144100
144263
  async getWholeSeriesRegistrationStatus(params) {
@@ -147399,6 +147562,14 @@ var init_SuccessMessage = __esmMin((() => {
147399
147562
  };
147400
147563
  }));
147401
147564
  //#endregion
147565
+ //#region ../blocks/src/system/runtime/hooks/useSelectedAppointmentConsentForm.ts
147566
+ function useSelectedAppointmentConsentForm(form, selectedService) {
147567
+ return useMemo(() => projectSelectedAppointmentConsentIntoForm(form, resolveSelectedAppointmentConsent(selectedService)), [form, selectedService]);
147568
+ }
147569
+ var init_useSelectedAppointmentConsentForm = __esmMin((() => {
147570
+ init_booking_form_consent();
147571
+ }));
147572
+ //#endregion
147402
147573
  //#region ../blocks/src/utils/date-formatting.ts
147403
147574
  function warnRuntimeTimeZoneFallback() {
147404
147575
  if (hasWarnedAboutRuntimeTimeZoneFallback) return;
@@ -148481,6 +148652,23 @@ function clearBookingFieldError(errors, fieldId) {
148481
148652
  }
148482
148653
  var init_booking_form_validationErrors = __esmMin((() => {}));
148483
148654
  //#endregion
148655
+ //#region ../blocks/src/system/runtime/nodes/booking-form.field-values.ts
148656
+ function collectInitialBookingFieldValues(initialData) {
148657
+ const values = {};
148658
+ for (const [key, value] of Object.entries(initialData)) if (!BOOKING_FORM_DATA_RESERVED_KEYS.has(key) && !isBookingRequirementConsentFieldId(key) && isBookingFieldValue(value)) values[key] = value;
148659
+ return values;
148660
+ }
148661
+ function omitBookingConsentEntries(record) {
148662
+ return Object.fromEntries(Object.entries(record).filter(([key]) => !isBookingRequirementConsentFieldId(key)));
148663
+ }
148664
+ function isBookingFieldValue(value) {
148665
+ return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
148666
+ }
148667
+ var init_booking_form_field_values = __esmMin((() => {
148668
+ init_bookingConsent();
148669
+ init_booking_form_reserved_fields();
148670
+ }));
148671
+ //#endregion
148484
148672
  //#region ../blocks/src/system/runtime/nodes/booking-form.headless.state.ts
148485
148673
  function createInitialBookingFlowReducerState(input) {
148486
148674
  const initialData = input.initialData ?? {};
@@ -148491,7 +148679,7 @@ function createInitialBookingFlowReducerState(input) {
148491
148679
  selectedResourceId: toOptionalAppointmentResourceId(toOptionalString(initialData.resourceId) ?? input.defaultResourceId),
148492
148680
  selectedDate: toOptionalString(initialData.selectedDate),
148493
148681
  selectedSlot: null,
148494
- fieldValues: collectInitialFieldValues(initialData),
148682
+ fieldValues: collectInitialBookingFieldValues(initialData),
148495
148683
  touchedFields: {},
148496
148684
  attemptedStepIds: {},
148497
148685
  discountCode: toOptionalString(initialData.discountCode) ?? "",
@@ -148503,14 +148691,6 @@ function createInitialBookingFlowReducerState(input) {
148503
148691
  feedback: { kind: "none" }
148504
148692
  };
148505
148693
  }
148506
- function collectInitialFieldValues(initialData) {
148507
- const values = {};
148508
- for (const [key, value] of Object.entries(initialData)) {
148509
- if (BOOKING_FORM_DATA_RESERVED_KEYS.has(key) || !isBookingFieldValue(value)) continue;
148510
- values[key] = value;
148511
- }
148512
- return values;
148513
- }
148514
148694
  function toOptionalString(value) {
148515
148695
  if (typeof value !== "string") return void 0;
148516
148696
  const trimmed = value.trim();
@@ -148529,9 +148709,6 @@ function toOptionalAppointmentResourceId(value) {
148529
148709
  function toOptionalCustomerPassId(value) {
148530
148710
  return toOptionalBrandedId(value, unsafeAsCustomerPassId);
148531
148711
  }
148532
- function isBookingFieldValue(value) {
148533
- return value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => typeof item === "string");
148534
- }
148535
148712
  /**
148536
148713
  * Send the flow back to the date step when the slot it was holding went away,
148537
148714
  * leaving a scoped feedback message. A completed booking is left alone.
@@ -148553,17 +148730,7 @@ function applyAvailabilitySelectionInvalidation(state, invalidation) {
148553
148730
  }
148554
148731
  function bookingFlowReducer(state, event) {
148555
148732
  switch (event.type) {
148556
- case "service-selected": return {
148557
- ...state,
148558
- selectedServiceId: event.serviceId,
148559
- selectedResourceId: void 0,
148560
- selectedDate: void 0,
148561
- selectedSlot: null,
148562
- selectedAppointmentPackageId: void 0,
148563
- selectedSlidingAmountInput: "",
148564
- selectedCollectionOptionKind: void 0,
148565
- validationErrors: clearBookingFormError(state.validationErrors)
148566
- };
148733
+ case "service-selected": return applyBookingServiceSelection(state, event.serviceId);
148567
148734
  case "resource-selected": return {
148568
148735
  ...state,
148569
148736
  selectedResourceId: event.resourceId ?? void 0,
@@ -148670,6 +148837,24 @@ function bookingFlowReducer(state, event) {
148670
148837
  default: return assertNever$11(event);
148671
148838
  }
148672
148839
  }
148840
+ function applyBookingServiceSelection(state, serviceId) {
148841
+ return {
148842
+ ...state,
148843
+ selectedServiceId: serviceId,
148844
+ selectedResourceId: void 0,
148845
+ selectedDate: void 0,
148846
+ selectedSlot: null,
148847
+ selectedAppointmentPackageId: void 0,
148848
+ selectedSlidingAmountInput: "",
148849
+ selectedCollectionOptionKind: void 0,
148850
+ fieldValues: omitBookingConsentEntries(state.fieldValues),
148851
+ touchedFields: omitBookingConsentEntries(state.touchedFields),
148852
+ validationErrors: {
148853
+ ...clearBookingFormError(state.validationErrors),
148854
+ fieldErrors: omitBookingConsentEntries(state.validationErrors.fieldErrors)
148855
+ }
148856
+ };
148857
+ }
148673
148858
  function clearAvailabilityFeedback(feedback) {
148674
148859
  return feedback.kind === "error" && feedback.scope === "availability" ? { kind: "none" } : feedback;
148675
148860
  }
@@ -148830,7 +149015,8 @@ function validateBookingFields(input) {
148830
149015
  return errors;
148831
149016
  }
148832
149017
  function validateBookingField(field, value) {
148833
- if (field.required && isBlankFieldValue(value)) return `${field.label} is required`;
149018
+ const requiredError = validateRequiredBookingField(field, value);
149019
+ if (requiredError) return requiredError;
148834
149020
  if (isBlankFieldValue(value)) return null;
148835
149021
  const strValue = typeof value === "string" ? value : String(value);
148836
149022
  if (field.type === "email") return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(strValue) ? null : "Please enter a valid email address";
@@ -148859,6 +149045,10 @@ function validateBookingField(field, value) {
148859
149045
  }
148860
149046
  return null;
148861
149047
  }
149048
+ function validateRequiredBookingField(field, value) {
149049
+ if (field.type === "booking_requirement_consent") return value === true ? null : `${field.label} is required`;
149050
+ return field.required && isBlankFieldValue(value) ? `${field.label} is required` : null;
149051
+ }
148862
149052
  function deriveBookingFlowSteps(input) {
148863
149053
  const stepResolution = buildBookingStepResolution({
148864
149054
  form: input.form,
@@ -148930,7 +149120,8 @@ function deriveBookingFieldViews(input) {
148930
149120
  return (input.form?.schema?.fields ?? []).map((field) => {
148931
149121
  const fieldId = unsafeAsBookingFieldId(field.id);
148932
149122
  const inputId = `${input.idPrefix}-${fieldId}`;
148933
- const helpTextId = field.helpText ? `${inputId}-help` : null;
149123
+ const helpText = field.type === "booking_requirement_consent" ? null : field.helpText ?? null;
149124
+ const helpTextId = helpText ? `${inputId}-help` : null;
148934
149125
  const fieldValue = input.values[field.id] ?? null;
148935
149126
  const localError = input.touched?.[field.id] ? validateBookingField(field, fieldValue) : null;
148936
149127
  const error = input.errors[field.id] ?? localError;
@@ -148940,17 +149131,17 @@ function deriveBookingFieldViews(input) {
148940
149131
  field,
148941
149132
  id: fieldId,
148942
149133
  label: field.label,
148943
- type: field.type,
148944
149134
  value: fieldValue,
148945
149135
  required: Boolean(field.required),
148946
149136
  error,
148947
- helpText: field.helpText ?? null,
149137
+ helpText,
148948
149138
  inputId,
148949
149139
  labelId: `${inputId}-label`,
148950
149140
  helpTextId,
148951
149141
  errorId,
148952
149142
  describedBy,
148953
- ariaInvalid: Boolean(error)
149143
+ ariaInvalid: Boolean(error),
149144
+ type: field.type
148954
149145
  };
148955
149146
  });
148956
149147
  }
@@ -149125,6 +149316,7 @@ var init_booking_form_headless_state = __esmMin((() => {
149125
149316
  init_dist$1();
149126
149317
  init_booking_form_state();
149127
149318
  init_booking_form_validationErrors();
149319
+ init_booking_form_field_values();
149128
149320
  unsafeAsBookingFieldId = (id) => id;
149129
149321
  }));
149130
149322
  //#endregion
@@ -149157,6 +149349,7 @@ function useHeadlessBookingFlow(options) {
149157
149349
  const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
149158
149350
  const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
149159
149351
  const selectedService = options.services.find((service) => service.id === selectedServiceId) ?? null;
149352
+ const runtimeForm = useSelectedAppointmentConsentForm(options.form, selectedService);
149160
149353
  const lastSlidingServiceIdRef = useRef(null);
149161
149354
  useEffect(() => {
149162
149355
  const selectedId = selectedService?.id ?? null;
@@ -149197,7 +149390,7 @@ function useHeadlessBookingFlow(options) {
149197
149390
  viewerTimeZone
149198
149391
  ]);
149199
149392
  const stepState = useMemo(() => deriveBookingFlowSteps({
149200
- form: options.form,
149393
+ form: runtimeForm,
149201
149394
  services: options.services,
149202
149395
  data,
149203
149396
  defaultServiceId,
@@ -149213,7 +149406,7 @@ function useHeadlessBookingFlow(options) {
149213
149406
  defaultServiceId,
149214
149407
  defaultResourceId,
149215
149408
  options.enableAppointmentPackages,
149216
- options.form,
149409
+ runtimeForm,
149217
149410
  options.requiresResourceSelection,
149218
149411
  options.requiresServiceSelection,
149219
149412
  options.services,
@@ -149267,13 +149460,13 @@ function useHeadlessBookingFlow(options) {
149267
149460
  state.selectedSlot
149268
149461
  ]);
149269
149462
  const fields = useMemo(() => deriveBookingFieldViews({
149270
- form: options.form,
149463
+ form: runtimeForm,
149271
149464
  values: state.fieldValues,
149272
149465
  errors: state.validationErrors.fieldErrors,
149273
149466
  touched: state.touchedFields,
149274
149467
  idPrefix: `booking-${options.formId}`
149275
149468
  }), [
149276
- options.form,
149469
+ runtimeForm,
149277
149470
  options.formId,
149278
149471
  state.fieldValues,
149279
149472
  state.touchedFields,
@@ -149393,7 +149586,7 @@ function useHeadlessBookingFlow(options) {
149393
149586
  const latestRef = useLatestRef({
149394
149587
  state,
149395
149588
  data,
149396
- form: options.form,
149589
+ form: runtimeForm,
149397
149590
  formId: formKey,
149398
149591
  services: options.services,
149399
149592
  defaultServiceId,
@@ -149645,7 +149838,7 @@ function useHeadlessBookingFlow(options) {
149645
149838
  phase: state.phase
149646
149839
  });
149647
149840
  const view = resolveHeadlessBookingView({
149648
- form: options.form,
149841
+ form: runtimeForm,
149649
149842
  feedback: state.feedback
149650
149843
  });
149651
149844
  const appointmentPackagesModel = resolveAppointmentPackagesModel({
@@ -149769,6 +149962,7 @@ var init_useHeadlessBookingFlow = __esmMin((() => {
149769
149962
  init_src$3();
149770
149963
  init_api();
149771
149964
  init_booking_form_state();
149965
+ init_useSelectedAppointmentConsentForm();
149772
149966
  init_useAvailableDates();
149773
149967
  init_useAvailableSlots();
149774
149968
  init_useBookingSubmission();
@@ -150441,6 +150635,30 @@ function FieldValidationMessage({ id, children, className, live = "assertive" })
150441
150635
  }
150442
150636
  var init_FieldValidationMessage = __esmMin((() => {}));
150443
150637
  //#endregion
150638
+ //#region ../blocks/src/system/runtime/shared/components/BookingConsentAgreement.tsx
150639
+ function BookingConsentAgreement({ agreement, showTitle = true, title, titleId }) {
150640
+ return /* @__PURE__ */ jsxs(Fragment, { children: [showTitle ? /* @__PURE__ */ jsxs("div", {
150641
+ id: titleId,
150642
+ className: "form-label",
150643
+ children: [title, /* @__PURE__ */ jsx("span", {
150644
+ className: "required-marker",
150645
+ children: "*"
150646
+ })]
150647
+ }) : null, /* @__PURE__ */ jsx("div", {
150648
+ role: "group",
150649
+ "aria-label": showTitle ? void 0 : title,
150650
+ "aria-labelledby": showTitle ? titleId : void 0,
150651
+ children: /* @__PURE__ */ jsx(RichText$1, {
150652
+ doc: agreement,
150653
+ linkTarget: "new-tab",
150654
+ className: "rb-prose rb-max-w-none"
150655
+ })
150656
+ })] });
150657
+ }
150658
+ var init_BookingConsentAgreement = __esmMin((() => {
150659
+ init_RichText();
150660
+ }));
150661
+ //#endregion
150444
150662
  //#region ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
150445
150663
  function optionCardClassName(isSelected) {
150446
150664
  return `rb-option-card${isSelected ? " rb-option-card--selected" : ""}`;
@@ -150889,7 +151107,11 @@ function DefaultDynamicField({ booking, field }) {
150889
151107
  return /* @__PURE__ */ jsxs("div", {
150890
151108
  className: "rb-space-y-2",
150891
151109
  children: [
150892
- /* @__PURE__ */ jsxs("label", {
151110
+ field.field.type === "booking_requirement_consent" ? /* @__PURE__ */ jsx(BookingConsentAgreement, {
151111
+ agreement: field.field.agreement,
151112
+ title: field.label,
151113
+ titleId: field.labelId
151114
+ }) : /* @__PURE__ */ jsxs("label", {
150893
151115
  id: field.labelId,
150894
151116
  htmlFor: field.inputId,
150895
151117
  className: "form-label",
@@ -150934,7 +151156,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
150934
151156
  required: field.required,
150935
151157
  ...validationProps
150936
151158
  };
150937
- switch (field.type) {
151159
+ switch (field.field.type) {
150938
151160
  case "textarea": return /* @__PURE__ */ jsx("textarea", {
150939
151161
  ...commonProps,
150940
151162
  value: strValue,
@@ -151048,7 +151270,7 @@ function DefaultFieldInput({ describedBy, error, errorId, field, onBlur, onChang
151048
151270
  className: "form-checkbox rb-mt-0.5"
151049
151271
  }), /* @__PURE__ */ jsx("span", {
151050
151272
  className: "rb-caption",
151051
- children: field.field.placeholder || field.label
151273
+ children: field.field.checkboxLabel
151052
151274
  })]
151053
151275
  });
151054
151276
  case "number": return /* @__PURE__ */ jsx("input", {
@@ -151117,10 +151339,10 @@ function DefaultBookingDiscount({ booking }) {
151117
151339
  children: /* @__PURE__ */ jsxs("p", {
151118
151340
  className: "ab-text",
151119
151341
  children: [
151120
- "Discount available: ",
151121
- booking.discount.autoAppliedDiscount.publicLabel,
151342
+ "Discount available:",
151122
151343
  " ",
151123
- "will apply automatically at checkout."
151344
+ booking.discount.autoAppliedDiscount.publicLabel,
151345
+ " will apply automatically at checkout."
151124
151346
  ]
151125
151347
  })
151126
151348
  }) : null]
@@ -151186,6 +151408,7 @@ var init_booking_form_default_ui = __esmMin((() => {
151186
151408
  init_FeedbackMessage();
151187
151409
  init_DiscountCodeDisclosure();
151188
151410
  init_FieldValidationMessage();
151411
+ init_BookingConsentAgreement();
151189
151412
  }));
151190
151413
  //#endregion
151191
151414
  //#region ../blocks/src/system/runtime/shared/utils/checkoutUrls.ts
@@ -153854,12 +154077,72 @@ var init_GuestDetailsSection = __esmMin((() => {
153854
154077
  }));
153855
154078
  //#endregion
153856
154079
  //#region ../blocks/src/system/runtime/nodes/event-registration/AttendeeDetailsStep.tsx
154080
+ function EventConsentField({ consent, error, formData, idBase, onChange }) {
154081
+ const errorId = `${idBase}-consent-error`;
154082
+ return /* @__PURE__ */ jsxs("div", {
154083
+ className: "er-field",
154084
+ children: [
154085
+ /* @__PURE__ */ jsx(BookingConsentAgreement, {
154086
+ agreement: consent.agreement,
154087
+ title: consent.title,
154088
+ titleId: `${idBase}-consent-title`
154089
+ }),
154090
+ /* @__PURE__ */ jsxs("label", {
154091
+ className: "er-label rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
154092
+ children: [
154093
+ /* @__PURE__ */ jsx("input", {
154094
+ "aria-describedby": error ? errorId : void 0,
154095
+ className: "form-checkbox rb-mt-0.5",
154096
+ checked: formData.consentAccepted === true,
154097
+ onChange: (event) => onChange({
154098
+ ...formData,
154099
+ consentAccepted: event.target.checked
154100
+ }),
154101
+ type: "checkbox"
154102
+ }),
154103
+ consent.checkboxLabel,
154104
+ " ",
154105
+ /* @__PURE__ */ jsx("span", {
154106
+ className: "er-required",
154107
+ children: "*"
154108
+ })
154109
+ ]
154110
+ }),
154111
+ error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
154112
+ id: errorId,
154113
+ className: "er-error",
154114
+ children: error
154115
+ }) : null
154116
+ ]
154117
+ });
154118
+ }
154119
+ function resolveGuestDetailsChangeHandler(requireGuestDetails, ticketsCount, onGuestsChange) {
154120
+ return requireGuestDetails && ticketsCount > 1 && onGuestsChange ? onGuestsChange : null;
154121
+ }
154122
+ function NotesField({ id, onChange, value }) {
154123
+ return /* @__PURE__ */ jsxs("div", {
154124
+ className: "er-field",
154125
+ children: [/* @__PURE__ */ jsx("label", {
154126
+ className: "er-label",
154127
+ htmlFor: id,
154128
+ children: "Notes"
154129
+ }), /* @__PURE__ */ jsx("textarea", {
154130
+ id,
154131
+ value,
154132
+ onChange: (event) => onChange(event.target.value),
154133
+ className: "er-input",
154134
+ placeholder: "Any special requirements or notes (optional)",
154135
+ rows: 3
154136
+ })]
154137
+ });
154138
+ }
153857
154139
  var AttendeeDetailsStep;
153858
154140
  var init_AttendeeDetailsStep = __esmMin((() => {
153859
154141
  init_GuestDetailsSection();
153860
154142
  init_LoggedInAsUser();
153861
154143
  init_FieldValidationMessage();
153862
- AttendeeDetailsStep = ({ formData, onChange, errors, emailLocked = false, onLogout, ticketsCount = 1, requireGuestDetails = false, guests = [], onGuestsChange, guestErrors = {}, guestSectionShake = false, onGuestShakeEnd }) => {
154144
+ init_BookingConsentAgreement();
154145
+ AttendeeDetailsStep = ({ formData, onChange, errors, emailLocked = false, onLogout, ticketsCount = 1, requireGuestDetails = false, guests = [], onGuestsChange, guestErrors = {}, guestSectionShake = false, onGuestShakeEnd, consent }) => {
153863
154146
  const idBase = useId();
153864
154147
  const nameId = `${idBase}-name`;
153865
154148
  const emailId = `${idBase}-email`;
@@ -153875,7 +154158,7 @@ var init_AttendeeDetailsStep = __esmMin((() => {
153875
154158
  message: errors.email,
153876
154159
  messageId: emailErrorId
153877
154160
  });
153878
- const showGuestSection = requireGuestDetails && ticketsCount > 1 && onGuestsChange;
154161
+ const guestDetailsChangeHandler = resolveGuestDetailsChangeHandler(requireGuestDetails, ticketsCount, onGuestsChange);
153879
154162
  return /* @__PURE__ */ jsxs("div", {
153880
154163
  className: "rb-reg-stack er-stack",
153881
154164
  children: [
@@ -153968,29 +154251,26 @@ var init_AttendeeDetailsStep = __esmMin((() => {
153968
154251
  placeholder: "(optional)"
153969
154252
  })]
153970
154253
  }),
153971
- /* @__PURE__ */ jsxs("div", {
153972
- className: "er-field",
153973
- children: [/* @__PURE__ */ jsx("label", {
153974
- className: "er-label",
153975
- htmlFor: notesId,
153976
- children: "Notes"
153977
- }), /* @__PURE__ */ jsx("textarea", {
153978
- id: notesId,
153979
- value: formData.notes,
153980
- onChange: (e) => onChange({
153981
- ...formData,
153982
- notes: e.target.value
153983
- }),
153984
- className: "er-input",
153985
- placeholder: "Any special requirements or notes (optional)",
153986
- rows: 3
153987
- })]
153988
- })
154254
+ /* @__PURE__ */ jsx(NotesField, {
154255
+ id: notesId,
154256
+ value: formData.notes,
154257
+ onChange: (notes) => onChange({
154258
+ ...formData,
154259
+ notes
154260
+ })
154261
+ }),
154262
+ consent ? /* @__PURE__ */ jsx(EventConsentField, {
154263
+ consent,
154264
+ error: errors.consentAccepted,
154265
+ formData,
154266
+ idBase,
154267
+ onChange
154268
+ }) : null
153989
154269
  ] }),
153990
- showGuestSection && /* @__PURE__ */ jsx(GuestDetailsSection, {
154270
+ guestDetailsChangeHandler && /* @__PURE__ */ jsx(GuestDetailsSection, {
153991
154271
  guests,
153992
154272
  errors: guestErrors,
153993
- onChange: onGuestsChange,
154273
+ onChange: guestDetailsChangeHandler,
153994
154274
  shake: guestSectionShake,
153995
154275
  onShakeEnd: onGuestShakeEnd
153996
154276
  })
@@ -154797,6 +155077,9 @@ var init_event_registration = __esmMin((() => {
154797
155077
  }));
154798
155078
  //#endregion
154799
155079
  //#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardContent.tsx
155080
+ function getWizardConsent(wizard) {
155081
+ return (wizard.selectedEvent ?? wizard.preSelectedEvent)?.consent ?? null;
155082
+ }
154800
155083
  function EventRegistrationWizardContent(props) {
154801
155084
  const { wizard } = props;
154802
155085
  const showSpamProtection = props.showSpamProtection ?? isSpamProtectionEnabled();
@@ -154876,7 +155159,8 @@ function EventRegistrationWizardContent(props) {
154876
155159
  onGuestsChange: wizard.setGuests,
154877
155160
  guestErrors: wizard.guestErrors,
154878
155161
  guestSectionShake: wizard.guestSectionShake,
154879
- onGuestShakeEnd: wizard.handleGuestShakeEnd
155162
+ onGuestShakeEnd: wizard.handleGuestShakeEnd,
155163
+ consent: getWizardConsent(wizard)
154880
155164
  }),
154881
155165
  showSpamProtection && /* @__PURE__ */ jsx("div", {
154882
155166
  className: "er-altcha",
@@ -155259,11 +155543,21 @@ var init_EventRegistrationSummaryBar = __esmMin((() => {
155259
155543
  }));
155260
155544
  //#endregion
155261
155545
  //#region ../blocks/src/system/runtime/nodes/event-registration/validation.ts
155262
- function validateFormData(formData) {
155546
+ function createInitialRegistrationFormData() {
155547
+ return {
155548
+ name: "",
155549
+ email: "",
155550
+ phone: "",
155551
+ notes: "",
155552
+ consentAccepted: false
155553
+ };
155554
+ }
155555
+ function validateFormData(formData, requiresConsent = false) {
155263
155556
  const errors = {};
155264
155557
  if (!formData.name.trim()) errors.name = "Name is required";
155265
155558
  if (!formData.email.trim()) errors.email = "Email is required";
155266
155559
  else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) errors.email = "Invalid email address";
155560
+ if (requiresConsent && formData.consentAccepted !== true) errors.consentAccepted = "Please read and accept the agreement before continuing.";
155267
155561
  return errors;
155268
155562
  }
155269
155563
  var init_validation = __esmMin((() => {}));
@@ -155638,6 +155932,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
155638
155932
  name: options.formData.name.trim(),
155639
155933
  phone: options.formData.phone.trim() || void 0,
155640
155934
  notes: options.formData.notes.trim() || void 0,
155935
+ consentAccepted: options.formData.consentAccepted,
155641
155936
  altchaSolution: options.altchaSolution,
155642
155937
  paymentMethod: method,
155643
155938
  customerPassId: method === "pass" ? passId : void 0,
@@ -155773,12 +156068,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
155773
156068
  const step = flowState.step;
155774
156069
  const paymentSelection = flowState.paymentSelection;
155775
156070
  const [selectedEvent, setSelectedEvent] = useState(preSelectedEvent ?? null);
155776
- const [formData, setFormData] = useState({
155777
- name: "",
155778
- email: "",
155779
- phone: "",
155780
- notes: ""
155781
- });
156071
+ const [formData, setFormData] = useState(createInitialRegistrationFormData);
155782
156072
  const [errors, setErrors] = useState({});
155783
156073
  const [guests, setGuests] = useState([]);
155784
156074
  const [guestErrors, setGuestErrors] = useState({});
@@ -156076,7 +156366,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
156076
156366
  guests
156077
156367
  ]);
156078
156368
  const validateForm = () => {
156079
- const newErrors = validateFormData(formData);
156369
+ const newErrors = validateFormData(formData, Boolean(currentEvent?.consent));
156080
156370
  setErrors(newErrors);
156081
156371
  const newGuestErrors = {};
156082
156372
  if (requireGuestDetails && guests.length > 0) {
@@ -156265,6 +156555,10 @@ function useEventRegistrationWizardWithDeps(options, deps) {
156265
156555
  });
156266
156556
  const handleEventSelect = (event) => {
156267
156557
  setSelectedEvent(event);
156558
+ setFormData((current) => ({
156559
+ ...current,
156560
+ consentAccepted: false
156561
+ }));
156268
156562
  const slidingScale = getSlidingScaleForEvent(event);
156269
156563
  setSelectedSlidingAmountInput(slidingScale?.suggestedAmount !== null && slidingScale?.suggestedAmount !== void 0 ? formatCentsAsCurrencyInput$1(slidingScale.suggestedAmount) : "");
156270
156564
  setSelectedAttendanceMode((event.deliveryMode ?? "in_person") === "hybrid" ? null : (event.deliveryMode ?? "in_person") === "online" ? "online" : "in_person");
@@ -157501,6 +157795,7 @@ function validateSubmission(state, setters) {
157501
157795
  message: "Choose an available set of dates to continue."
157502
157796
  };
157503
157797
  const errors = validateFormData$1(state.formData);
157798
+ if (state.selectedRun.consent && state.formData.consentAccepted !== true) errors.consentAccepted = "Please read and accept the agreement before continuing.";
157504
157799
  setters.setErrors(errors);
157505
157800
  if (Object.keys(errors).length > 0) return { kind: "validation-failed" };
157506
157801
  const pricingMessage = getMissingWholeSeriesPricingSelectionMessage(state.pricing);
@@ -157524,6 +157819,7 @@ function registrantPayload(state) {
157524
157819
  name: state.formData.name.trim(),
157525
157820
  phone: state.formData.phone.trim() || void 0,
157526
157821
  formData: { notes: state.formData.notes.trim() || void 0 },
157822
+ consentAccepted: state.formData.consentAccepted,
157527
157823
  altchaSolution: state.altchaSolution,
157528
157824
  claimToken: state.claimToken ?? void 0
157529
157825
  };
@@ -157689,7 +157985,8 @@ var init_useWholeSeriesRegistrationPortal = __esmMin((() => {
157689
157985
  name: "",
157690
157986
  email: "",
157691
157987
  phone: "",
157692
- notes: ""
157988
+ notes: "",
157989
+ consentAccepted: false
157693
157990
  };
157694
157991
  }));
157695
157992
  //#endregion
@@ -158220,19 +158517,65 @@ function WholeSeriesSlidingScaleInput({ pricing, value, onChange }) {
158220
158517
  ]
158221
158518
  });
158222
158519
  }
158223
- function EnrollmentForm({ formData, errors, onChange, isEmailLocked, isLoading, onLogout }) {
158224
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EnrollmentIdentityFields, {
158225
- formData,
158226
- errors,
158227
- onChange,
158228
- isEmailLocked,
158229
- isLoading,
158230
- onLogout
158231
- }), /* @__PURE__ */ jsx(EnrollmentOptionalFields, {
158232
- formData,
158233
- onChange,
158234
- isLoading
158235
- })] });
158520
+ function WholeSeriesConsentField({ consent, error, formData, isLoading, onChange }) {
158521
+ const errorId = "er-whole-series-consent-error";
158522
+ return /* @__PURE__ */ jsxs("div", {
158523
+ className: "er-whole-series-form__field",
158524
+ children: [
158525
+ /* @__PURE__ */ jsx(BookingConsentAgreement, {
158526
+ agreement: consent.agreement,
158527
+ title: consent.title,
158528
+ titleId: "er-whole-series-consent-title"
158529
+ }),
158530
+ /* @__PURE__ */ jsxs("label", {
158531
+ className: "er-whole-series-form__label rb-flex rb-items-start rb-gap-2 rb-cursor-pointer",
158532
+ children: [
158533
+ /* @__PURE__ */ jsx("input", {
158534
+ type: "checkbox",
158535
+ className: "form-checkbox rb-mt-0.5",
158536
+ checked: formData.consentAccepted === true,
158537
+ disabled: isLoading,
158538
+ "aria-describedby": error ? errorId : void 0,
158539
+ onChange: (event) => onChange({
158540
+ ...formData,
158541
+ consentAccepted: event.target.checked
158542
+ })
158543
+ }),
158544
+ consent.checkboxLabel,
158545
+ " *"
158546
+ ]
158547
+ }),
158548
+ error ? /* @__PURE__ */ jsx(FieldValidationMessage, {
158549
+ id: errorId,
158550
+ className: "er-whole-series-form__error",
158551
+ children: error
158552
+ }) : null
158553
+ ]
158554
+ });
158555
+ }
158556
+ function EnrollmentForm({ formData, errors, onChange, isEmailLocked, isLoading, onLogout, consent }) {
158557
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
158558
+ /* @__PURE__ */ jsx(EnrollmentIdentityFields, {
158559
+ formData,
158560
+ errors,
158561
+ onChange,
158562
+ isEmailLocked,
158563
+ isLoading,
158564
+ onLogout
158565
+ }),
158566
+ /* @__PURE__ */ jsx(EnrollmentOptionalFields, {
158567
+ formData,
158568
+ onChange,
158569
+ isLoading
158570
+ }),
158571
+ consent ? /* @__PURE__ */ jsx(WholeSeriesConsentField, {
158572
+ consent,
158573
+ error: errors.consentAccepted,
158574
+ formData,
158575
+ isLoading,
158576
+ onChange
158577
+ }) : null
158578
+ ] });
158236
158579
  }
158237
158580
  function EnrollmentIdentityFields({ formData, errors, onChange, isEmailLocked, isLoading, onLogout }) {
158238
158581
  const nameErrorId = "er-whole-series-name-error";
@@ -158346,6 +158689,7 @@ var init_components = __esmMin((() => {
158346
158689
  init_utils();
158347
158690
  init_LoggedInAsUser();
158348
158691
  init_FieldValidationMessage();
158692
+ init_BookingConsentAgreement();
158349
158693
  }));
158350
158694
  //#endregion
158351
158695
  //#region ../blocks/src/system/runtime/nodes/event-registration/whole-series/WholeSeriesRegistrationActiveSteps.tsx
@@ -158433,7 +158777,8 @@ function RegistrationDetailsForm({ wizard, display }) {
158433
158777
  onChange: wizard.updateFormData,
158434
158778
  isEmailLocked: wizard.portalAuthState === "authenticated" || wizard.waitlistClaim.claim !== null,
158435
158779
  isLoading: wizard.portalAuthState === "checking" || wizard.waitlistClaim.isLoading,
158436
- onLogout: wizard.handleLogout
158780
+ onLogout: wizard.handleLogout,
158781
+ consent: wizard.selectedRun?.consent ?? null
158437
158782
  }),
158438
158783
  /* @__PURE__ */ jsx(PricingFields, { wizard }),
158439
158784
  wizard.showSpamProtection ? /* @__PURE__ */ jsx("div", {
@@ -159033,33 +159378,6 @@ var init_WholeSeriesRegistrationWizard = __esmMin((() => {
159033
159378
  };
159034
159379
  }));
159035
159380
  //#endregion
159036
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationSurface.ts
159037
- function planEventRegistrationSurface(input) {
159038
- const scopedEvents = resolveEventRegistrationScopedEvents(input.events, {
159039
- occurrenceContext: input.occurrenceContext,
159040
- subject: input.subject
159041
- });
159042
- const bookingScopes = new Set(scopedEvents.map((event) => event.bookingScope));
159043
- if (!input.occurrenceContext && !input.subject && bookingScopes.has("single_occurrence")) return {
159044
- kind: "occurrence",
159045
- events: scopedEvents.filter((event) => event.bookingScope === "single_occurrence")
159046
- };
159047
- if (bookingScopes.size === 0 || bookingScopes.has("single_occurrence")) return bookingScopes.has("whole_series") ? { kind: "mixedBookingScopes" } : {
159048
- kind: "occurrence",
159049
- events: scopedEvents
159050
- };
159051
- const requiredSeriesIds = new Set(scopedEvents.map((event) => event.seriesId));
159052
- const offerings = input.wholeSeriesOfferings.filter((offering) => requiredSeriesIds.has(offering.eventSeriesId));
159053
- const loadedSeriesIds = new Set(offerings.map((offering) => offering.eventSeriesId));
159054
- return [...requiredSeriesIds].every((seriesId) => loadedSeriesIds.has(seriesId)) && offerings.length > 0 ? {
159055
- kind: "wholeSeries",
159056
- offerings
159057
- } : { kind: "unavailableWholeSeries" };
159058
- }
159059
- var init_registrationSurface = __esmMin((() => {
159060
- init_eventScope();
159061
- }));
159062
- //#endregion
159063
159381
  //#region ../blocks/src/system/runtime/nodes/event-registration/PastOccurrenceNotice.tsx
159064
159382
  function isPastOccurrence(startsAt) {
159065
159383
  if (!startsAt) return false;
@@ -159125,7 +159443,8 @@ var init_event_registration_client = __esmMin((() => {
159125
159443
  EventRegistrationClient = (clientProps) => {
159126
159444
  const surface = planEventRegistrationSurface({
159127
159445
  events: clientProps.events ?? [],
159128
- wholeSeriesOfferings: clientProps.wholeSeriesOffering ? [clientProps.wholeSeriesOffering] : clientProps.wholeSeriesOfferings ?? [],
159446
+ wholeSeriesOfferings: clientProps.wholeSeriesOfferings ?? [],
159447
+ wholeSeriesOffering: clientProps.wholeSeriesOffering,
159129
159448
  occurrenceContext: clientProps.occurrenceContext,
159130
159449
  subject: clientProps.subject
159131
159450
  });
@@ -164189,7 +164508,7 @@ var SimpleCache = class {
164189
164508
  * 1. This constant
164190
164509
  * 2. The "version" field in package.json
164191
164510
  */
164192
- const SDK_VERSION = "0.132.0";
164511
+ const SDK_VERSION = "0.134.0";
164193
164512
  //#endregion
164194
164513
  //#region src/client/error.ts
164195
164514
  let _Symbol$for;