@riverbankcms/sdk 0.90.0 → 0.90.1

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 (80) hide show
  1. package/dist/{PreviewEditorSidebar-KVXNF3VW.mjs → PreviewEditorSidebar-FNFRVSIM.mjs} +2 -2
  2. package/dist/{PreviewEditorUI-J3JN5Z7T.mjs → PreviewEditorUI-3WXJFQXG.mjs} +2 -2
  3. package/dist/SdkPreviewModeRuntime-2UCIMKUB.mjs +8 -0
  4. package/dist/_dts/api/src/bookingConfig.d.ts +3 -0
  5. package/dist/_dts/api/src/event-listing-destination.d.ts +59 -0
  6. package/dist/_dts/api/src/index.d.ts +4 -0
  7. package/dist/_dts/api/src/navigation/dashboardSettingsNav.d.ts +0 -1
  8. package/dist/_dts/api/src/navigation.d.ts +2 -0
  9. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +3 -1
  10. package/dist/_dts/api/src/settings/permissions.d.ts +273 -0
  11. package/dist/_dts/api/src/types.d.ts +1 -0
  12. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +60 -2
  13. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +12 -1
  14. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +9 -9
  15. package/dist/_dts/blocks/src/system/blocks/team-members.d.ts +1 -1
  16. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +5 -0
  17. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
  18. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/destination.d.ts +8 -0
  19. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/pricing.d.ts +3 -0
  20. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +7 -0
  21. package/dist/_dts/core/src/event-pricing.d.ts +12 -2
  22. package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
  23. package/dist/_dts/sdk/src/rendering/islands/types.d.ts +11 -1
  24. package/dist/_dts/sdk/src/version.d.ts +1 -1
  25. package/dist/{chunk-PMBB6MQ7.mjs → chunk-CR2VX432.mjs} +297 -117
  26. package/dist/{chunk-AEOYWPE4.mjs → chunk-FA6LVZ7C.mjs} +5 -5
  27. package/dist/{chunk-RQ3XZ4SJ.mjs → chunk-H6TT5ZXI.mjs} +1 -1
  28. package/dist/{chunk-GSPFFUVB.mjs → chunk-SYYJZPKU.mjs} +1 -1
  29. package/dist/cli/index.mjs +160 -103
  30. package/dist/client/{accordion-GXQNWQ6O.mjs → accordion-4K7VGZ3I.mjs} +2 -2
  31. package/dist/client/{bookingForm-STLUJ36H.mjs → bookingForm-3QXA3CIS.mjs} +5 -5
  32. package/dist/client/bookings.mjs +1154 -556
  33. package/dist/client/{carousel-CVRN6EPP.mjs → carousel-BEJKNGQ7.mjs} +3 -3
  34. package/dist/client/{cart-IYIBA5CL.mjs → cart-44BBM6XG.mjs} +6 -6
  35. package/dist/client/{checkout-O3BGM4GS.mjs → checkout-THMHEYKF.mjs} +6 -6
  36. package/dist/client/{chunk-25W2EQUN.mjs → chunk-3H5CLFKT.mjs} +8 -0
  37. package/dist/client/{chunk-MFPKS6QS.mjs → chunk-4COPESPO.mjs} +5 -5
  38. package/dist/client/{chunk-4RTFGHZN.mjs → chunk-5AJIMWKS.mjs} +6 -3
  39. package/dist/client/{chunk-6DPXDOIL.mjs → chunk-B4H6QMPY.mjs} +93 -22
  40. package/dist/client/{chunk-VFHZLZAC.mjs → chunk-DQIRKNZE.mjs} +1 -1
  41. package/dist/client/{chunk-7DH35FGA.mjs → chunk-EJBHK74Y.mjs} +1 -1
  42. package/dist/client/{chunk-DAS5CIER.mjs → chunk-JV7ZNAOU.mjs} +118 -20
  43. package/dist/client/{chunk-FHU6PFPM.mjs → chunk-KNTLBQ3N.mjs} +1 -1
  44. package/dist/client/{chunk-Z62JYS5O.mjs → chunk-PEDNDLPB.mjs} +2 -2
  45. package/dist/client/{chunk-NBFRJ5NB.mjs → chunk-SLY6UDAS.mjs} +2 -2
  46. package/dist/client/{chunk-D3ETC2SU.mjs → chunk-ZIAF2DA4.mjs} +1 -1
  47. package/dist/client/client.mjs +272 -83
  48. package/dist/client/{courseRegistration-2D3ACMJR.mjs → courseRegistration-URX7RCCK.mjs} +5 -5
  49. package/dist/client/{eventCalendar-QY4UZUFF.mjs → eventCalendar-GTENOQCE.mjs} +8 -8
  50. package/dist/client/{eventCombined-RRCDKJC2.mjs → eventCombined-EZVB72MF.mjs} +8 -8
  51. package/dist/client/{eventDetails-YO335BUT.mjs → eventDetails-CH4BJR5Z.mjs} +8 -8
  52. package/dist/client/{eventListing-PXA6GFQ3.mjs → eventListing-4BVOI5HS.mjs} +8 -8
  53. package/dist/client/{eventRegistration-2ZHEDDXO.mjs → eventRegistration-37LPIKIE.mjs} +8 -8
  54. package/dist/client/{form-ZS6KX4U2.mjs → form-FX3Y54YK.mjs} +2 -2
  55. package/dist/client/{headerSection-QK5SLIIB.mjs → headerSection-UOZZGVYL.mjs} +3 -3
  56. package/dist/client/hooks.mjs +86 -35
  57. package/dist/client/{locationMap-GFNIUD2X.mjs → locationMap-VSIPKV35.mjs} +3 -3
  58. package/dist/client/{newsletterForm-PGLTTCUG.mjs → newsletterForm-6FRJKNAF.mjs} +2 -2
  59. package/dist/client/{productDetail-OPBE5ZPI.mjs → productDetail-6AHMLXCO.mjs} +6 -6
  60. package/dist/client/{productList-NI72Q62Z.mjs → productList-M2CYIZVH.mjs} +6 -6
  61. package/dist/client/rendering/client.mjs +231 -42
  62. package/dist/client/rendering/islands.mjs +19 -19
  63. package/dist/client/rendering.mjs +273 -84
  64. package/dist/client/{shop-3ZQPEWYI.mjs → shop-AUOT6GEX.mjs} +6 -6
  65. package/dist/preview-next/client/runtime.mjs +3 -3
  66. package/dist/{sdk-runtime-FSHXCWDS.mjs → sdk-runtime-6GPJNLU6.mjs} +4 -4
  67. package/dist/server/components.mjs +136 -58
  68. package/dist/server/config-validation.mjs +78 -27
  69. package/dist/server/config.mjs +78 -27
  70. package/dist/server/data.mjs +86 -35
  71. package/dist/server/index.mjs +1 -1
  72. package/dist/server/next.mjs +157 -79
  73. package/dist/server/page-converter.mjs +72 -21
  74. package/dist/server/prebuild.mjs +1 -1
  75. package/dist/server/rendering/server.mjs +148 -70
  76. package/dist/server/rendering.mjs +152 -74
  77. package/dist/server/routing.mjs +121 -44
  78. package/dist/server/server.mjs +95 -44
  79. package/package.json +2 -2
  80. package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +0 -8
@@ -270,6 +270,8 @@ function publicEventPricingType(pricing) {
270
270
  case "ticket_types":
271
271
  case "course":
272
272
  return isFreePublicEventPriceDisplay(pricing.display) ? "free" : "paid";
273
+ case "external":
274
+ return "external";
273
275
  }
274
276
  }
275
277
  function publicEventPricingCurrency(pricing) {
@@ -281,6 +283,8 @@ function publicEventPricingCurrency(pricing) {
281
283
  return pricing.currency;
282
284
  case "course":
283
285
  return pricing.display.display.currency;
286
+ case "external":
287
+ return null;
284
288
  }
285
289
  }
286
290
  function publicEventScalarPrice(pricing) {
@@ -295,6 +299,7 @@ function publicEventPricingMode(pricing) {
295
299
  return "ticket_types";
296
300
  case "drop_in":
297
301
  case "course":
302
+ case "external":
298
303
  return void 0;
299
304
  }
300
305
  }
@@ -312,6 +317,7 @@ function isFreePublicEventPriceDisplay(display) {
312
317
  case "range":
313
318
  case "mixed":
314
319
  case "unavailable":
320
+ case "external":
315
321
  return false;
316
322
  }
317
323
  }
@@ -342,6 +348,8 @@ function formatBookingPriceDisplay(display, options = {}) {
342
348
  return display.paidToAmount > display.paidFromAmount ? `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)} - ${formatCurrencyAmount(display.paidToAmount, display.currency, options)}` : `Free / ${formatCurrencyAmount(display.paidFromAmount, display.currency, options)}`;
343
349
  case "unavailable":
344
350
  return "Pricing unavailable";
351
+ case "external":
352
+ return display.label;
345
353
  case "course":
346
354
  return formatCoursePriceDisplayLabel(display.display, options);
347
355
  default:
@@ -2075,7 +2083,7 @@ var init_schemas = __esm({
2075
2083
 
2076
2084
  // ../blocks/src/system/blocks/events/shared/schemas.ts
2077
2085
  import { z as z6 } from "zod";
2078
- var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
2086
+ var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, publicEventDestinationSchema, eventVenueSchema, eventCategorySchema, pricingTypeSchema, accessRestrictionSchema, eventPricingModeSchema, publicCoursePriceDisplaySchema, publicEventPriceDisplaySchema, publicEventTicketTypePriceDisplaySchema, publicEventAttendanceModeSchema, publicEventAttendanceModeAvailabilitySchema, publicEventTicketTypeAvailabilitySchema, publicEventTicketTypeSchema, publicEventPricingSchema, publicTeamMemberSummarySchema, publicEventSchema, publicEventsArraySchema;
2079
2087
  var init_schemas2 = __esm({
2080
2088
  "../blocks/src/system/blocks/events/shared/schemas.ts"() {
2081
2089
  "use strict";
@@ -2086,6 +2094,18 @@ var init_schemas2 = __esm({
2086
2094
  eventPresetSchema = z6.enum(["event", "class", "workshop", "retreat", "performance"]);
2087
2095
  eventScheduleScopeSchema = z6.enum(["recurring", "oneOff"]);
2088
2096
  eventDestinationModeSchema = z6.enum(["cms-managed", "system-managed"]);
2097
+ publicEventDestinationSchema = z6.discriminatedUnion("kind", [
2098
+ z6.object({
2099
+ kind: z6.literal("native"),
2100
+ mode: eventDestinationModeSchema,
2101
+ path: z6.string()
2102
+ }),
2103
+ z6.object({
2104
+ kind: z6.literal("external"),
2105
+ url: z6.string(),
2106
+ label: z6.string()
2107
+ })
2108
+ ]);
2089
2109
  eventVenueSchema = z6.object({
2090
2110
  id: z6.string(),
2091
2111
  name: z6.string(),
@@ -2100,7 +2120,7 @@ var init_schemas2 = __esm({
2100
2120
  name: z6.string(),
2101
2121
  color: z6.string().nullable()
2102
2122
  });
2103
- pricingTypeSchema = z6.enum(["free", "paid"]);
2123
+ pricingTypeSchema = z6.enum(["free", "paid", "external"]);
2104
2124
  accessRestrictionSchema = z6.enum(["none", "category"]);
2105
2125
  eventPricingModeSchema = z6.enum(["single", "ticket_types"]);
2106
2126
  publicCoursePriceDisplaySchema = z6.discriminatedUnion("kind", [
@@ -2121,6 +2141,7 @@ var init_schemas2 = __esm({
2121
2141
  currency: z6.string()
2122
2142
  }),
2123
2143
  z6.object({ kind: z6.literal("unavailable"), currency: z6.string() }),
2144
+ z6.object({ kind: z6.literal("external"), label: z6.string() }),
2124
2145
  z6.object({ kind: z6.literal("course"), display: publicCoursePriceDisplaySchema })
2125
2146
  ]);
2126
2147
  publicEventTicketTypePriceDisplaySchema = z6.union([
@@ -2199,6 +2220,10 @@ var init_schemas2 = __esm({
2199
2220
  z6.object({
2200
2221
  kind: z6.literal("course"),
2201
2222
  display: z6.object({ kind: z6.literal("course"), display: publicCoursePriceDisplaySchema })
2223
+ }),
2224
+ z6.object({
2225
+ kind: z6.literal("external"),
2226
+ display: z6.object({ kind: z6.literal("external"), label: z6.string() })
2202
2227
  })
2203
2228
  ]);
2204
2229
  publicTeamMemberSummarySchema = z6.object({
@@ -2227,7 +2252,8 @@ var init_schemas2 = __esm({
2227
2252
  image: mediaSchema.nullable().optional()
2228
2253
  }).optional(),
2229
2254
  slug: z6.string(),
2230
- path: z6.string(),
2255
+ path: z6.string().nullable(),
2256
+ destination: publicEventDestinationSchema,
2231
2257
  requiresRegistration: z6.boolean(),
2232
2258
  deliveryMode: z6.enum(["in_person", "online", "hybrid"]),
2233
2259
  attendanceModes: z6.array(publicEventAttendanceModeAvailabilitySchema),
@@ -24880,11 +24906,45 @@ var init_eventCapacity = __esm({
24880
24906
  }
24881
24907
  });
24882
24908
 
24909
+ // ../blocks/src/system/runtime/nodes/events/shared/destination.ts
24910
+ function isRecord5(value) {
24911
+ return typeof value === "object" && value !== null && !Array.isArray(value);
24912
+ }
24913
+ function isRuntimeEventDestination(value) {
24914
+ if (!isRecord5(value) || typeof value.kind !== "string") return false;
24915
+ if (value.kind === "native") {
24916
+ return (value.mode === "cms-managed" || value.mode === "system-managed") && typeof value.path === "string";
24917
+ }
24918
+ return value.kind === "external" && typeof value.url === "string" && typeof value.label === "string";
24919
+ }
24920
+ function resolveRuntimeEventDestination(event) {
24921
+ if (isRuntimeEventDestination(event.destination)) {
24922
+ return event.destination;
24923
+ }
24924
+ return {
24925
+ kind: "native",
24926
+ mode: event.eventDestinationMode === "system-managed" ? "system-managed" : "cms-managed",
24927
+ path: typeof event.path === "string" ? event.path : ""
24928
+ };
24929
+ }
24930
+ var init_destination = __esm({
24931
+ "../blocks/src/system/runtime/nodes/events/shared/destination.ts"() {
24932
+ "use strict";
24933
+ }
24934
+ });
24935
+
24883
24936
  // ../blocks/src/system/runtime/nodes/events/shared/pricing.ts
24884
24937
  function resolveRuntimeEventPricing(event) {
24885
24938
  if (isPublicEventPricing(event.pricing)) {
24886
24939
  return event.pricing;
24887
24940
  }
24941
+ const destination = resolveRuntimeEventDestination(event);
24942
+ if (destination.kind === "external") {
24943
+ return {
24944
+ kind: "external",
24945
+ display: { kind: "external", label: "External registration" }
24946
+ };
24947
+ }
24888
24948
  const legacy = event;
24889
24949
  const currency = readCurrency(legacy.currency);
24890
24950
  if (event.requiresRegistration === false) {
@@ -24921,22 +24981,22 @@ function resolveRuntimeEventPricing(event) {
24921
24981
  function readCurrency(value) {
24922
24982
  return typeof value === "string" && value.trim().length > 0 ? value : DEFAULT_EVENT_CURRENCY;
24923
24983
  }
24924
- function isRecord5(value) {
24984
+ function isRecord6(value) {
24925
24985
  return typeof value === "object" && value !== null && !Array.isArray(value);
24926
24986
  }
24927
24987
  function isPublicEventPricing(value) {
24928
- if (!isRecord5(value) || typeof value.kind !== "string") return false;
24929
- return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course";
24988
+ if (!isRecord6(value) || typeof value.kind !== "string") return false;
24989
+ return value.kind === "drop_in" || value.kind === "free_registration" || value.kind === "single_paid" || value.kind === "ticket_types" || value.kind === "course" || value.kind === "external";
24930
24990
  }
24931
24991
  function isPublicEventTicketType(value) {
24932
- return isRecord5(value) && typeof value.id === "string";
24992
+ return isRecord6(value) && typeof value.id === "string";
24933
24993
  }
24934
24994
  function readTicketTypePriceDisplay(value, currency) {
24935
24995
  const display = readLegacyPriceDisplay(value, currency);
24936
- return display.kind === "course" ? { kind: "unavailable", currency } : display;
24996
+ return display.kind === "course" || display.kind === "external" ? { kind: "unavailable", currency } : display;
24937
24997
  }
24938
24998
  function readLegacyPriceDisplay(value, currency) {
24939
- if (!isRecord5(value) || typeof value.kind !== "string") {
24999
+ if (!isRecord6(value) || typeof value.kind !== "string") {
24940
25000
  return { kind: "unavailable", currency };
24941
25001
  }
24942
25002
  const displayCurrency = readCurrency(value.currency);
@@ -24975,7 +25035,7 @@ function readLegacyPriceDisplay(value, currency) {
24975
25035
  case "unavailable":
24976
25036
  return { kind: "unavailable", currency: displayCurrency };
24977
25037
  case "course":
24978
- return isRecord5(value.display) ? {
25038
+ return isRecord6(value.display) ? {
24979
25039
  kind: "course",
24980
25040
  display: readCoursePriceDisplay(value.display, displayCurrency)
24981
25041
  } : {
@@ -25013,6 +25073,7 @@ var DEFAULT_EVENT_CURRENCY;
25013
25073
  var init_pricing = __esm({
25014
25074
  "../blocks/src/system/runtime/nodes/events/shared/pricing.ts"() {
25015
25075
  "use strict";
25076
+ init_destination();
25016
25077
  DEFAULT_EVENT_CURRENCY = "USD";
25017
25078
  }
25018
25079
  });
@@ -25135,16 +25196,28 @@ function formatEventPrice(event) {
25135
25196
  function formatEventPriceDisplay(pricing) {
25136
25197
  return formatEventPricing(pricing, { decimals: "auto" });
25137
25198
  }
25199
+ function resolveEventHref(event) {
25200
+ const destination = resolveRuntimeEventDestination(event);
25201
+ return destination.kind === "external" ? destination.url : destination.path;
25202
+ }
25203
+ function resolveEventLinkProps(event) {
25204
+ const href = resolveEventHref(event);
25205
+ const destination = resolveRuntimeEventDestination(event);
25206
+ return destination.kind === "external" ? { href, target: "_blank", rel: "noopener noreferrer" } : { href };
25207
+ }
25138
25208
  function resolveEventCta(event, buttonText) {
25139
25209
  const { isFull: isSoldOut } = getEventAvailability(event);
25140
- const defaultButtonText = event.kind === "course_session" ? "Book course" : "Book";
25210
+ const destination = resolveRuntimeEventDestination(event);
25211
+ const isExternal = destination.kind === "external";
25212
+ const defaultButtonText = isExternal ? destination.label : event.kind === "course_session" ? "Book course" : "Book";
25141
25213
  const effectiveButtonText = buttonText ?? defaultButtonText;
25142
- if (isSoldOut) {
25143
- return { label: "Sold out", href: event.path, hidden: true };
25214
+ const href = resolveEventHref(event);
25215
+ if (!isExternal && isSoldOut) {
25216
+ return { label: "Sold out", href, external: false, hidden: true };
25144
25217
  }
25145
25218
  const enrollmentOpen = event.kind === "course_session" ? event.course?.enrollmentOpen !== false : true;
25146
25219
  const label = !enrollmentOpen ? "Registration closed" : effectiveButtonText;
25147
- return { label, href: event.path, hidden: false };
25220
+ return { label, href, external: isExternal, hidden: false };
25148
25221
  }
25149
25222
  var COLUMN_CLASSES;
25150
25223
  var init_utils3 = __esm({
@@ -25153,6 +25226,7 @@ var init_utils3 = __esm({
25153
25226
  init_src();
25154
25227
  init_src3();
25155
25228
  init_eventCapacity();
25229
+ init_destination();
25156
25230
  init_pricing();
25157
25231
  init_src3();
25158
25232
  init_src3();
@@ -26690,6 +26764,8 @@ var init_EventCard = __esm({
26690
26764
  "a",
26691
26765
  {
26692
26766
  href: cta.href,
26767
+ target: cta.external ? "_blank" : void 0,
26768
+ rel: cta.external ? "noopener noreferrer" : void 0,
26693
26769
  className: `${buttonClass} event-card-cta`,
26694
26770
  children: cta.label
26695
26771
  }
@@ -27026,10 +27102,19 @@ var init_EventCompactRow = __esm({
27026
27102
  formattedTime,
27027
27103
  /* @__PURE__ */ jsx8("span", { className: "event-compact-row-action-price", children: price })
27028
27104
  ] }),
27029
- cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6("a", { href: cta.href, className: `${buttonClass} event-compact-row-cta`, children: [
27030
- /* @__PURE__ */ jsx8("span", { children: cta.label }),
27031
- /* @__PURE__ */ jsx8(ArrowRightIcon, { "aria-hidden": "true" })
27032
- ] })
27105
+ cta.hidden ? /* @__PURE__ */ jsx8("span", { className: "event-compact-row-status", children: cta.label }) : /* @__PURE__ */ jsxs6(
27106
+ "a",
27107
+ {
27108
+ href: cta.href,
27109
+ target: cta.external ? "_blank" : void 0,
27110
+ rel: cta.external ? "noopener noreferrer" : void 0,
27111
+ className: `${buttonClass} event-compact-row-cta`,
27112
+ children: [
27113
+ /* @__PURE__ */ jsx8("span", { children: cta.label }),
27114
+ /* @__PURE__ */ jsx8(ArrowRightIcon, { "aria-hidden": "true" })
27115
+ ]
27116
+ }
27117
+ )
27033
27118
  ] })
27034
27119
  ] })
27035
27120
  ] });
@@ -27932,7 +28017,7 @@ function resolveEventRequiresPayment(input) {
27932
28017
  if (!input.event) {
27933
28018
  return false;
27934
28019
  }
27935
- return publicEventPricingType(resolveRuntimeEventPricing(input.event)) !== "free";
28020
+ return publicEventPricingType(resolveRuntimeEventPricing(input.event)) === "paid";
27936
28021
  }
27937
28022
  function resolveDiscountContext(input) {
27938
28023
  const selection = input.paymentSelection.method ? input.paymentSelection : null;
@@ -28064,15 +28149,16 @@ function buildEventRegistrationShellBodyText(stepLabels) {
28064
28149
  return "Preparing dates, tickets, and booking details.";
28065
28150
  }
28066
28151
  function normalizeEventRegistrationEventInput(value) {
28067
- if (!isRecord6(value)) {
28152
+ if (!isRecord7(value)) {
28068
28153
  return value;
28069
28154
  }
28070
28155
  return {
28071
28156
  ...value,
28157
+ destination: resolveRuntimeEventDestination(value),
28072
28158
  pricing: resolveRuntimeEventPricing(value)
28073
28159
  };
28074
28160
  }
28075
- function isRecord6(value) {
28161
+ function isRecord7(value) {
28076
28162
  return typeof value === "object" && value !== null && !Array.isArray(value);
28077
28163
  }
28078
28164
  function buildEventRegistrationInteractiveIslandProps(props2) {
@@ -28098,6 +28184,7 @@ var init_event_registration_interactive = __esm({
28098
28184
  init_event_registration_shared();
28099
28185
  init_events();
28100
28186
  init_pricing();
28187
+ init_destination();
28101
28188
  init_islands();
28102
28189
  init_runtime();
28103
28190
  init_contract_schemas();
@@ -28565,7 +28652,7 @@ function deriveNewsletterSignupRuntimeSource(values) {
28565
28652
  };
28566
28653
  }
28567
28654
  function sanitizeNewsletterSignupPublicContent(content) {
28568
- if (!isRecord7(content)) return content;
28655
+ if (!isRecord8(content)) return content;
28569
28656
  const provider = parseNewsletterSignupDestinationProvider(content.destinationProvider) ?? getProviderFromExplicitDestination(content.destination);
28570
28657
  const {
28571
28658
  destination: _destination,
@@ -28584,7 +28671,7 @@ function sanitizeNewsletterSignupPublicContent(content) {
28584
28671
  return mutablePublicContent;
28585
28672
  }
28586
28673
  function getProviderFromExplicitDestination(destination) {
28587
- if (!isRecord7(destination) || typeof destination.tag !== "string") return null;
28674
+ if (!isRecord8(destination) || typeof destination.tag !== "string") return null;
28588
28675
  if (destination.tag === "riverbank_list") return "riverbank";
28589
28676
  if (destination.tag === "mailchimp_audience") return "mailchimp";
28590
28677
  return null;
@@ -28594,7 +28681,7 @@ function parseTrimmedString(value) {
28594
28681
  const trimmed = value.trim();
28595
28682
  return trimmed.length > 0 ? trimmed : null;
28596
28683
  }
28597
- function isRecord7(value) {
28684
+ function isRecord8(value) {
28598
28685
  return typeof value === "object" && value !== null;
28599
28686
  }
28600
28687
  var BLOCK_ID_PATTERN, SIGNED_DESTINATION_REF_PATTERN;
@@ -31391,7 +31478,7 @@ var init_embla_carousel_autoplay_esm = __esm({
31391
31478
  function isObject(subject) {
31392
31479
  return Object.prototype.toString.call(subject) === "[object Object]";
31393
31480
  }
31394
- function isRecord8(subject) {
31481
+ function isRecord9(subject) {
31395
31482
  return isObject(subject) || Array.isArray(subject);
31396
31483
  }
31397
31484
  function canUseDOM() {
@@ -31408,7 +31495,7 @@ function areOptionsEqual(optionsA, optionsB) {
31408
31495
  const valueA = optionsA[key];
31409
31496
  const valueB = optionsB[key];
31410
31497
  if (typeof valueA === "function") return `${valueA}` === `${valueB}`;
31411
- if (!isRecord8(valueA) || !isRecord8(valueB)) return valueA === valueB;
31498
+ if (!isRecord9(valueA) || !isRecord9(valueB)) return valueA === valueB;
31412
31499
  return areOptionsEqual(valueA, valueB);
31413
31500
  });
31414
31501
  }
@@ -34264,7 +34351,7 @@ function encodePublicProductCategorySelector(selector) {
34264
34351
  };
34265
34352
  }
34266
34353
  }
34267
- function isRecord9(value) {
34354
+ function isRecord10(value) {
34268
34355
  return typeof value === "object" && value !== null;
34269
34356
  }
34270
34357
  function isJsonResponseContentType(contentType) {
@@ -34287,10 +34374,10 @@ async function parseJsonBody(response) {
34287
34374
  }
34288
34375
  }
34289
34376
  function getBlockApiErrorDetails(data) {
34290
- if (!isRecord9(data)) {
34377
+ if (!isRecord10(data)) {
34291
34378
  return {};
34292
34379
  }
34293
- const nestedError = isRecord9(data.error) ? data.error : void 0;
34380
+ const nestedError = isRecord10(data.error) ? data.error : void 0;
34294
34381
  const message = typeof nestedError?.message === "string" ? nestedError.message : typeof data.message === "string" ? data.message : void 0;
34295
34382
  const code = typeof nestedError?.code === "string" ? nestedError.code : typeof data.code === "string" ? data.code : void 0;
34296
34383
  return { message, code };
@@ -39229,8 +39316,10 @@ function buildBookingPaymentOptionViewModel(input) {
39229
39316
  totalAmountCents: input.totalCents,
39230
39317
  config: input.option.config
39231
39318
  });
39319
+ const remainingBalance = Math.max(0, input.totalCents - dueToday);
39232
39320
  const formattedTotal = formatPrice(input.totalCents, input.currency, input.locale);
39233
39321
  const formattedDueToday = formatPrice(dueToday, input.currency, input.locale);
39322
+ const formattedRemainingBalance = formatPrice(remainingBalance, input.currency, input.locale);
39234
39323
  const dueAt = resolveFlexibleBalanceDueAt({
39235
39324
  bookingStartAt: input.bookingStartAt ?? (/* @__PURE__ */ new Date()).toISOString(),
39236
39325
  dueDateRule: input.option.config.dueDateRule
@@ -39247,6 +39336,7 @@ function buildBookingPaymentOptionViewModel(input) {
39247
39336
  summaryRows: [
39248
39337
  { label: "Total", value: formattedTotal },
39249
39338
  { label: "Due today", value: formattedDueToday },
39339
+ { label: "Remaining balance", value: formattedRemainingBalance },
39250
39340
  { label: "Balance due by", value: formatScheduleDate(dueAt, input.locale) },
39251
39341
  {
39252
39342
  label: "Deposit policy",
@@ -44377,6 +44467,33 @@ function toEventDirectPaymentOption(option, mode) {
44377
44467
  );
44378
44468
  }
44379
44469
  }
44470
+ function resolveEventRegistrationDirectPaymentSelection(input) {
44471
+ if (input.selection.method !== "stripe") {
44472
+ return { kind: "not-stripe" };
44473
+ }
44474
+ const fallbackOption = input.options[0];
44475
+ if (!fallbackOption) {
44476
+ return { kind: "unavailable" };
44477
+ }
44478
+ const requestedKind = input.selection.collectionOptionKind;
44479
+ const selectedOption = requestedKind == null ? input.options.find((option) => option.kind === "upfront") : input.options.find((option) => option.kind === requestedKind);
44480
+ if (selectedOption) {
44481
+ return {
44482
+ kind: "valid",
44483
+ selection: {
44484
+ method: "stripe",
44485
+ collectionOptionKind: selectedOption.kind
44486
+ }
44487
+ };
44488
+ }
44489
+ return {
44490
+ kind: "invalid",
44491
+ fallbackSelection: {
44492
+ method: "stripe",
44493
+ collectionOptionKind: fallbackOption.kind
44494
+ }
44495
+ };
44496
+ }
44380
44497
  var DEFAULT_EVENT_DIRECT_PAYMENT_OPTION;
44381
44498
  var init_eventPaymentOptions = __esm({
44382
44499
  "../blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.ts"() {
@@ -44436,6 +44553,9 @@ function formatDirectPaymentOptionDetail(option) {
44436
44553
  balanceDueBy ? `Balance due by: ${balanceDueBy.value}` : null
44437
44554
  ].filter((part) => Boolean(part)).join(" \xB7 ");
44438
44555
  }
44556
+ function isDirectPaymentOptionSelected(option, selectionState) {
44557
+ return selectionState.kind === "valid" && selectionState.selection.collectionOptionKind === option.kind;
44558
+ }
44439
44559
  var PaymentSelectionStep;
44440
44560
  var init_PaymentSelectionStep = __esm({
44441
44561
  "../blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.tsx"() {
@@ -44464,8 +44584,28 @@ var init_PaymentSelectionStep = __esm({
44464
44584
  }) => {
44465
44585
  const occurrenceId = occurrenceContext?.id ?? event?.registrationOccurrenceId;
44466
44586
  const selectedMethod = selectedSelection.method;
44587
+ const totalPrice = eligibility?.price ? eligibility.price * ticketsCount : 0;
44588
+ const canShowDirectPaymentOptions = Boolean(
44589
+ eligibility?.eligible && eligibility.canPayDirectly && eligibility.price
44590
+ );
44591
+ const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventRegistrationPaymentOptionsViewModel({
44592
+ eventTitle: event?.title ?? "Event",
44593
+ paymentTerms: event?.paymentTerms,
44594
+ totalPriceCents: totalPrice,
44595
+ currency: eligibility.currency,
44596
+ startsAt: occurrenceContext?.startsAt ?? event?.startsAt
44597
+ }).options : [];
44598
+ const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
44599
+ options: directPaymentOptions,
44600
+ selection: selectedSelection
44601
+ });
44602
+ const directPaymentFallbackSelection = directPaymentSelectionState.kind === "invalid" ? directPaymentSelectionState.fallbackSelection : null;
44603
+ const directPaymentFallbackKind = directPaymentFallbackSelection?.collectionOptionKind;
44467
44604
  const canContinue = (() => {
44468
44605
  if (!selectedMethod) return false;
44606
+ if (selectedMethod === "stripe") {
44607
+ return directPaymentSelectionState.kind === "valid";
44608
+ }
44469
44609
  if (selectedMethod === "pass") return Boolean(selectedSelection.passId);
44470
44610
  if (selectedMethod === "membership")
44471
44611
  return Boolean(selectedSelection.membershipId);
@@ -44475,6 +44615,13 @@ var init_PaymentSelectionStep = __esm({
44475
44615
  return Boolean(selectedSelection.bundleMembershipId);
44476
44616
  return true;
44477
44617
  })();
44618
+ useEffect12(() => {
44619
+ if (!directPaymentFallbackKind) return;
44620
+ onSelectionChange({
44621
+ method: "stripe",
44622
+ collectionOptionKind: directPaymentFallbackKind
44623
+ });
44624
+ }, [directPaymentFallbackKind, onSelectionChange]);
44478
44625
  const getButtonText = useCallback7(() => {
44479
44626
  if (selectedMethod === "stripe") return "Continue to Payment";
44480
44627
  if (selectedMethod === "pass_bundle" || selectedMethod === "membership_bundle") {
@@ -44574,25 +44721,20 @@ var init_PaymentSelectionStep = __esm({
44574
44721
  ] }) })
44575
44722
  ] });
44576
44723
  }
44577
- const totalPrice = eligibility.price ? eligibility.price * ticketsCount : 0;
44578
- const directPaymentOptions = buildEventRegistrationPaymentOptionsViewModel({
44579
- eventTitle: event?.title ?? "Event",
44580
- paymentTerms: event?.paymentTerms,
44581
- totalPriceCents: totalPrice,
44582
- currency: eligibility.currency,
44583
- startsAt: occurrenceContext?.startsAt ?? event?.startsAt
44584
- }).options;
44585
44724
  const isMultiTicket = areEntitlementsDisabledForTicketCount(ticketsCount);
44586
44725
  return /* @__PURE__ */ jsxs33("div", { className: "er-stack", children: [
44587
44726
  /* @__PURE__ */ jsx47("h3", { className: "er-title", children: "Payment Options" }),
44588
44727
  /* @__PURE__ */ jsxs33("div", { className: "er-payment-tiles", children: [
44589
- eligibility.canPayDirectly && eligibility.price && /* @__PURE__ */ jsx47(Fragment9, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx47(
44728
+ canShowDirectPaymentOptions && /* @__PURE__ */ jsx47(Fragment9, { children: directPaymentOptions.map((option) => /* @__PURE__ */ jsx47(
44590
44729
  PaymentTile,
44591
44730
  {
44592
44731
  icon: /* @__PURE__ */ jsx47(CreditCard, { size: 24, "aria-hidden": "true" }),
44593
44732
  label: option.label,
44594
44733
  detail: formatDirectPaymentOptionDetail(option),
44595
- selected: selectedMethod === "stripe" && (selectedSelection.collectionOptionKind ?? "upfront") === option.kind,
44734
+ selected: isDirectPaymentOptionSelected(
44735
+ option,
44736
+ directPaymentSelectionState
44737
+ ),
44596
44738
  onClick: () => onSelectionChange({
44597
44739
  method: "stripe",
44598
44740
  collectionOptionKind: option.kind
@@ -45117,6 +45259,24 @@ import { Fragment as Fragment12, jsx as jsx55, jsxs as jsxs39 } from "react/jsx-
45117
45259
  function isProductMethod(method) {
45118
45260
  return method !== null && ["pass", "membership", "pass_bundle", "membership_bundle"].includes(method);
45119
45261
  }
45262
+ function getSummaryRow(option, label) {
45263
+ return option.summaryRows.find((row) => row.label === label)?.value ?? null;
45264
+ }
45265
+ function getSelectedDirectPaymentOption(input) {
45266
+ const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
45267
+ if (!summaryEvent || input.wizard.paymentSelection.method !== "stripe") {
45268
+ return null;
45269
+ }
45270
+ const options = buildEventRegistrationPaymentOptionsViewModel({
45271
+ eventTitle: summaryEvent.title,
45272
+ paymentTerms: summaryEvent.paymentTerms,
45273
+ totalPriceCents: input.totalCents,
45274
+ currency: input.currency,
45275
+ startsAt: input.wizard.occurrenceContext?.startsAt ?? summaryEvent.startsAt
45276
+ }).options;
45277
+ const requestedKind = input.wizard.paymentSelection.collectionOptionKind ?? "upfront";
45278
+ return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
45279
+ }
45120
45280
  function EventRegistrationSummaryBar(props2) {
45121
45281
  const { wizard } = props2;
45122
45282
  const summaryEvent = wizard.selectedEvent ?? wizard.preSelectedEvent;
@@ -45131,6 +45291,18 @@ function EventRegistrationSummaryBar(props2) {
45131
45291
  const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
45132
45292
  const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
45133
45293
  const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
45294
+ const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
45295
+ wizard,
45296
+ totalCents: discountedTotalCents,
45297
+ currency: summaryCurrency
45298
+ });
45299
+ const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
45300
+ total: getSummaryRow(selectedDirectPaymentOption, "Total"),
45301
+ dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
45302
+ remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
45303
+ balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
45304
+ depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
45305
+ } : null;
45134
45306
  if (!summaryTitle) return null;
45135
45307
  const productMethod = isProductMethod(wizard.paymentSelection.method);
45136
45308
  return /* @__PURE__ */ jsxs39(Fragment12, { children: [
@@ -45174,6 +45346,22 @@ function EventRegistrationSummaryBar(props2) {
45174
45346
  summaryPrice > 0 && /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-pricing", children: productMethod ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
45175
45347
  /* @__PURE__ */ jsx55("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(summaryPrice * wizard.ticketsCount, summaryCurrency) }),
45176
45348
  /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-included", children: wizard.paymentSelection.method === "pass" || wizard.paymentSelection.method === "pass_bundle" ? "1 pass credit" : "Included in membership" })
45349
+ ] }) : flexibleBalanceSummary ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
45350
+ flexibleBalanceSummary.total ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
45351
+ "Total: ",
45352
+ flexibleBalanceSummary.total
45353
+ ] }) : null,
45354
+ /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-price", children: flexibleBalanceSummary.dueToday ?? formatPrice(discountedTotalCents, summaryCurrency) }),
45355
+ /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-included", children: "Payable now" }),
45356
+ flexibleBalanceSummary.remainingBalance ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
45357
+ "Remaining balance: ",
45358
+ flexibleBalanceSummary.remainingBalance,
45359
+ flexibleBalanceSummary.balanceDueBy ? ` due by ${flexibleBalanceSummary.balanceDueBy}` : ""
45360
+ ] }) : null,
45361
+ flexibleBalanceSummary.depositPolicy ? /* @__PURE__ */ jsxs39("div", { className: "er-summary-bar-product-detail", children: [
45362
+ "Deposit: ",
45363
+ flexibleBalanceSummary.depositPolicy
45364
+ ] }) : null
45177
45365
  ] }) : autoAppliedDiscount && autoAppliedDiscountCents > 0 ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
45178
45366
  /* @__PURE__ */ jsx55("span", { className: "er-summary-bar-price er-summary-bar-price--struck", children: formatPrice(subtotalCents, summaryCurrency) }),
45179
45367
  /* @__PURE__ */ jsx55("div", { className: "er-summary-bar-price", children: formatPrice(discountedTotalCents, summaryCurrency) }),
@@ -45192,6 +45380,7 @@ var init_EventRegistrationSummaryBar = __esm({
45192
45380
  "use client";
45193
45381
  init_src();
45194
45382
  init_utils5();
45383
+ init_eventPaymentOptions();
45195
45384
  }
45196
45385
  });
45197
45386
 
@@ -47336,7 +47525,7 @@ function EventDetailsView({
47336
47525
  "a",
47337
47526
  {
47338
47527
  className: "rb-tile rb-tile--interactive",
47339
- href: e.path,
47528
+ ...resolveEventLinkProps(e),
47340
47529
  children: /* @__PURE__ */ jsx62(
47341
47530
  DateTimeTile,
47342
47531
  {
@@ -48882,7 +49071,7 @@ var init_AgendaEventCard = __esm({
48882
49071
  showCapacity,
48883
49072
  onClick
48884
49073
  }) => {
48885
- const eventUrl = event.path;
49074
+ const eventLinkProps = resolveEventLinkProps(event);
48886
49075
  const categoryColor = event.eventCategory?.color || "rgb(var(--tb-accent))";
48887
49076
  const price = formatEventPrice(event);
48888
49077
  const { available, isFull } = getEventAvailability(event);
@@ -48943,7 +49132,7 @@ var init_AgendaEventCard = __esm({
48943
49132
  }
48944
49133
  );
48945
49134
  }
48946
- return /* @__PURE__ */ jsx72("a", { href: eventUrl, className: "event-agenda-card", children: cardContent });
49135
+ return /* @__PURE__ */ jsx72("a", { ...eventLinkProps, className: "event-agenda-card", children: cardContent });
48947
49136
  };
48948
49137
  }
48949
49138
  });
@@ -55803,14 +55992,14 @@ function getSemanticIconComponent(name) {
55803
55992
 
55804
55993
  // ../blocks/src/system/icons/value.ts
55805
55994
  var NO_BLOCK_ICON_VALUE = { kind: "none" };
55806
- function isRecord10(value) {
55995
+ function isRecord11(value) {
55807
55996
  return typeof value === "object" && value !== null && !Array.isArray(value);
55808
55997
  }
55809
55998
  function parseBlockIconValue(value) {
55810
55999
  if (isSemanticIconId(value)) {
55811
56000
  return { kind: "semantic", iconId: value };
55812
56001
  }
55813
- if (!isRecord10(value)) {
56002
+ if (!isRecord11(value)) {
55814
56003
  return NO_BLOCK_ICON_VALUE;
55815
56004
  }
55816
56005
  switch (value.kind) {
@@ -55901,7 +56090,7 @@ function buildGeneratedBlockIconRenderAssetLookupFromUnknown(value) {
55901
56090
  }
55902
56091
  const inputs = [];
55903
56092
  for (const [index, item] of value.entries()) {
55904
- if (!isRecord10(item)) {
56093
+ if (!isRecord11(item)) {
55905
56094
  return { kind: "invalid_asset_entry", index, reason: "not_object" };
55906
56095
  }
55907
56096
  const setId = parseGeneratedIconSetId(item.setId);
@@ -64323,7 +64512,7 @@ function inferLegacyOfferingsPreviewGroupOrder(overrides) {
64323
64512
  return keys.length >= 2 ? keys : [];
64324
64513
  }
64325
64514
  function normalizeOfferingsPreviewContentForWrite(value) {
64326
- if (!isRecord11(value)) return null;
64515
+ if (!isRecord12(value)) return null;
64327
64516
  const groupOrderValue = value.groupOrder;
64328
64517
  if (Array.isArray(groupOrderValue)) {
64329
64518
  const normalized = normalizeOfferingsPreviewGroupOrder(groupOrderValue);
@@ -64336,7 +64525,7 @@ function normalizeOfferingsPreviewContentForWrite(value) {
64336
64525
  return { ...value, groupOrder: [] };
64337
64526
  }
64338
64527
  const legacyOrder = inferLegacyOfferingsPreviewGroupOrder(
64339
- Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord11) : []
64528
+ Array.isArray(value.groupOverrides) ? value.groupOverrides.filter(isRecord12) : []
64340
64529
  );
64341
64530
  return legacyOrder.length > 0 ? { ...value, groupOrder: legacyOrder } : value;
64342
64531
  }
@@ -64390,7 +64579,7 @@ function uniqueOfferingsPreviewSourceKeys(values) {
64390
64579
  }
64391
64580
  return keys;
64392
64581
  }
64393
- function isRecord11(value) {
64582
+ function isRecord12(value) {
64394
64583
  return typeof value === "object" && value !== null && !Array.isArray(value);
64395
64584
  }
64396
64585
  function mergeOrderedKeysWithDefaults(orderedKeys, defaultKeys) {
@@ -64852,7 +65041,7 @@ function isOfferingsPreviewItemLimit(value) {
64852
65041
  return value === "1" || value === "2" || value === "3" || value === "4" || value === "5" || value === "6" || value === null;
64853
65042
  }
64854
65043
  function normalizeOfferingsPreviewGroupOverride(value) {
64855
- if (!isRecord12(value)) return [];
65044
+ if (!isRecord13(value)) return [];
64856
65045
  const override = {};
64857
65046
  if (isOfferingsPreviewSourceKey(value.sourceKey) || value.sourceKey === null) {
64858
65047
  override.sourceKey = value.sourceKey;
@@ -64884,12 +65073,12 @@ function isButtonVariant(value) {
64884
65073
  return value === "primary" || value === "secondary" || value === "outline" || value === "link" || value === null;
64885
65074
  }
64886
65075
  function normalizeCardStylesContent(value) {
64887
- return isRecord12(value) || value === null ? value : void 0;
65076
+ return isRecord13(value) || value === null ? value : void 0;
64888
65077
  }
64889
65078
  function normalizeSectionStylesContent(value) {
64890
- return isRecord12(value) || value === null ? value : void 0;
65079
+ return isRecord13(value) || value === null ? value : void 0;
64891
65080
  }
64892
- function isRecord12(value) {
65081
+ function isRecord13(value) {
64893
65082
  return typeof value === "object" && value !== null && !Array.isArray(value);
64894
65083
  }
64895
65084
 
@@ -69028,7 +69217,7 @@ import React33 from "react";
69028
69217
  init_src();
69029
69218
  var LINKED_CONTENT_ENTRY_META_KEY = "__rbLinkedContentEntry";
69030
69219
  function coerceLinkedContentEntriesPayload(payload) {
69031
- if (!isRecord13(payload)) return payload;
69220
+ if (!isRecord14(payload)) return payload;
69032
69221
  const response = payload;
69033
69222
  if (!Array.isArray(response.entries)) return payload;
69034
69223
  const contentType = parsePublicContentTypeMeta(response.contentType);
@@ -69036,16 +69225,16 @@ function coerceLinkedContentEntriesPayload(payload) {
69036
69225
  return response.entries.map((entry) => enrichLinkedContentEntry(entry, contentType));
69037
69226
  }
69038
69227
  function getLinkedContentEntryMeta(value) {
69039
- if (!isRecord13(value)) return null;
69228
+ if (!isRecord14(value)) return null;
69040
69229
  const candidate = value[LINKED_CONTENT_ENTRY_META_KEY];
69041
69230
  return isLinkedContentEntryMeta(candidate) ? candidate : null;
69042
69231
  }
69043
69232
  function buildLinkedContentEditTarget(input) {
69044
69233
  const { entry, sourceBlockId, sourceBlockKind, itemIndex } = input;
69045
- if (!isRecord13(entry)) return null;
69234
+ if (!isRecord14(entry)) return null;
69046
69235
  const meta = getLinkedContentEntryMeta(entry);
69047
69236
  if (!meta || meta.support.kind !== "supported") return null;
69048
- const content = isRecord13(entry.content) ? entry.content : {};
69237
+ const content = isRecord14(entry.content) ? entry.content : {};
69049
69238
  return {
69050
69239
  kind: "linked-content-entry",
69051
69240
  entryId: meta.entryId,
@@ -69095,12 +69284,12 @@ function resolveLinkedEntryInlineFieldEligibility(input) {
69095
69284
  };
69096
69285
  }
69097
69286
  function enrichLinkedContentEntry(entry, contentType) {
69098
- if (!isRecord13(entry)) return entry;
69287
+ if (!isRecord14(entry)) return entry;
69099
69288
  const entryId = typeof entry.id === "string" ? entry.id : null;
69100
69289
  if (!entryId) return entry;
69101
69290
  const title = typeof entry.title === "string" && entry.title.trim().length > 0 ? entry.title : entryId;
69102
69291
  const optimisticHash = typeof entry.optimisticHash === "string" && entry.optimisticHash.length > 0 ? entry.optimisticHash : null;
69103
- const content = isRecord13(entry.content) ? entry.content : {};
69292
+ const content = isRecord14(entry.content) ? entry.content : {};
69104
69293
  const meta = {
69105
69294
  kind: "linked-content-entry",
69106
69295
  entryId,
@@ -69196,7 +69385,7 @@ function capitalize(value) {
69196
69385
  return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
69197
69386
  }
69198
69387
  function parsePublicContentTypeMeta(value) {
69199
- if (!isRecord13(value)) return null;
69388
+ if (!isRecord14(value)) return null;
69200
69389
  if (typeof value.key !== "string" || value.key.trim().length === 0) return null;
69201
69390
  return {
69202
69391
  key: value.key,
@@ -69206,7 +69395,7 @@ function parsePublicContentTypeMeta(value) {
69206
69395
  };
69207
69396
  }
69208
69397
  function parsePublicContentTypeLinkedEntryEditing(value) {
69209
- if (!isRecord13(value) || typeof value.kind !== "string") return null;
69398
+ if (!isRecord14(value) || typeof value.kind !== "string") return null;
69210
69399
  switch (value.kind) {
69211
69400
  case "generic":
69212
69401
  return { kind: "generic" };
@@ -69220,7 +69409,7 @@ function parsePublicContentTypeLinkedEntryEditing(value) {
69220
69409
  }
69221
69410
  }
69222
69411
  function parsePublicContentTypeFieldMeta(value) {
69223
- if (!isRecord13(value)) return [];
69412
+ if (!isRecord14(value)) return [];
69224
69413
  if (typeof value.id !== "string" || typeof value.type !== "string") return [];
69225
69414
  return [{
69226
69415
  id: value.id,
@@ -69235,14 +69424,14 @@ function parseStringArray(value) {
69235
69424
  return value.filter((item) => typeof item === "string");
69236
69425
  }
69237
69426
  function isLinkedContentEntryMeta(value) {
69238
- if (!isRecord13(value)) return false;
69427
+ if (!isRecord14(value)) return false;
69239
69428
  if (value.kind !== "linked-content-entry") return false;
69240
69429
  if (typeof value.entryId !== "string") return false;
69241
69430
  if (typeof value.contentTypeKey !== "string") return false;
69242
69431
  if (typeof value.contentTypeLabel !== "string") return false;
69243
69432
  if (typeof value.title !== "string") return false;
69244
69433
  if (!(value.optimisticHash === null || typeof value.optimisticHash === "string")) return false;
69245
- if (!isRecord13(value.contentType)) return false;
69434
+ if (!isRecord14(value.contentType)) return false;
69246
69435
  if (!isLinkedEntryFieldSourceArray(value.fieldSources)) return false;
69247
69436
  return isLinkedContentEditSupport(value.support);
69248
69437
  }
@@ -69250,7 +69439,7 @@ function isLinkedEntryFieldSourceArray(value) {
69250
69439
  return Array.isArray(value) && value.every(isLinkedEntryFieldSource);
69251
69440
  }
69252
69441
  function isLinkedEntryFieldSource(value) {
69253
- if (!isRecord13(value)) return false;
69442
+ if (!isRecord14(value)) return false;
69254
69443
  if (typeof value.displayPath !== "string") return false;
69255
69444
  switch (value.kind) {
69256
69445
  case "content-field":
@@ -69276,7 +69465,7 @@ function isLinkedEntryInlineFieldReadOnlyReason(value) {
69276
69465
  }
69277
69466
  }
69278
69467
  function isLinkedContentEditSupport(value) {
69279
- if (!isRecord13(value) || typeof value.kind !== "string") return false;
69468
+ if (!isRecord14(value) || typeof value.kind !== "string") return false;
69280
69469
  switch (value.kind) {
69281
69470
  case "supported":
69282
69471
  return true;
@@ -69288,7 +69477,7 @@ function isLinkedContentEditSupport(value) {
69288
69477
  return false;
69289
69478
  }
69290
69479
  }
69291
- function isRecord13(value) {
69480
+ function isRecord14(value) {
69292
69481
  return typeof value === "object" && value !== null && !Array.isArray(value);
69293
69482
  }
69294
69483
 
@@ -71937,7 +72126,7 @@ function renderCalendarSsr(display) {
71937
72126
  dayEvents.slice(0, MAX_EVENTS_PER_DAY).map((event) => /* @__PURE__ */ jsxs90(
71938
72127
  "a",
71939
72128
  {
71940
- href: event.path,
72129
+ ...resolveEventLinkProps(event),
71941
72130
  className: "event-calendar-event",
71942
72131
  title: `${event.title} at ${formatTime(event.startsAt, { timeZone: getEventTimeZone(event) })}`,
71943
72132
  children: [
@@ -72065,7 +72254,7 @@ function renderTimetableSsr(display) {
72065
72254
  day.events.length === 0 ? /* @__PURE__ */ jsx143("p", { className: "event-timetable-day-empty", children: "No classes" }) : day.events.map((cell) => /* @__PURE__ */ jsxs90(
72066
72255
  "a",
72067
72256
  {
72068
- href: cell.event.path,
72257
+ ...resolveEventLinkProps(cell.event),
72069
72258
  className: "event-timetable-event",
72070
72259
  title: `${cell.event.title}, ${cell.timeLabel}`,
72071
72260
  style: {
@@ -72853,14 +73042,14 @@ function isDecoratedHeadingBlockKind(blockKind) {
72853
73042
  return blockKind === "block.intro" || blockKind === "block.feature-cards" || blockKind === "block.testimonials" || blockKind === "block.faq";
72854
73043
  }
72855
73044
  function readVariant(blockContent) {
72856
- if (!isRecord14(blockContent)) return void 0;
73045
+ if (!isRecord15(blockContent)) return void 0;
72857
73046
  const variant = blockContent.variant;
72858
73047
  return typeof variant === "string" ? variant : void 0;
72859
73048
  }
72860
73049
  function isFaqDecoratedVariant(variant) {
72861
73050
  return variant === "default" || variant === "question-columns";
72862
73051
  }
72863
- function isRecord14(value) {
73052
+ function isRecord15(value) {
72864
73053
  return typeof value === "object" && value !== null && !Array.isArray(value);
72865
73054
  }
72866
73055
  function buildHeadingDecorationWrapperClassName(className) {
@@ -97969,7 +98158,7 @@ function preset(id, verticalId, canonicalBehaviour, label, pluralLabel, descript
97969
98158
  }
97970
98159
 
97971
98160
  // ../api/src/utils/isRecord.ts
97972
- function isRecord15(value) {
98161
+ function isRecord16(value) {
97973
98162
  return typeof value === "object" && value !== null && !Array.isArray(value);
97974
98163
  }
97975
98164
 
@@ -98276,7 +98465,7 @@ function sanitizeMarks(marks) {
98276
98465
  if (mark.type === "bold" || mark.type === "strong" || mark.type === "italic" || mark.type === "em") {
98277
98466
  return [{ type: mark.type }];
98278
98467
  }
98279
- if (mark.type === "link" && isRecord15(mark.attrs) && typeof mark.attrs.href === "string") {
98468
+ if (mark.type === "link" && isRecord16(mark.attrs) && typeof mark.attrs.href === "string") {
98280
98469
  const attrs = { href: mark.attrs.href };
98281
98470
  if (typeof mark.attrs.target === "string" && mark.attrs.target.trim().length > 0) {
98282
98471
  attrs.target = mark.attrs.target;
@@ -98291,10 +98480,10 @@ function sanitizeMarks(marks) {
98291
98480
  return sanitized.length > 0 ? sanitized : void 0;
98292
98481
  }
98293
98482
  function unwrapRichTextValue(value) {
98294
- if (isRecord15(value) && isRecord15(value.doc)) {
98483
+ if (isRecord16(value) && isRecord16(value.doc)) {
98295
98484
  return unwrapRichTextValue(value.doc);
98296
98485
  }
98297
- if (isRecord15(value) && value.type === "doc") {
98486
+ if (isRecord16(value) && value.type === "doc") {
98298
98487
  return {
98299
98488
  type: "doc",
98300
98489
  content: Array.isArray(value.content) ? value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) : []
@@ -98303,7 +98492,7 @@ function unwrapRichTextValue(value) {
98303
98492
  return EMPTY_SITE_BANNER_BODY;
98304
98493
  }
98305
98494
  function isTipTapNodeLike(value) {
98306
- return isRecord15(value) && typeof value.type === "string";
98495
+ return isRecord16(value) && typeof value.type === "string";
98307
98496
  }
98308
98497
  function coerceTipTapNode(value) {
98309
98498
  return {
@@ -98311,9 +98500,9 @@ function coerceTipTapNode(value) {
98311
98500
  ...Array.isArray(value.content) ? { content: value.content.filter(isTipTapNodeLike).map(coerceTipTapNode) } : {},
98312
98501
  ...typeof value.text === "string" ? { text: value.text } : {},
98313
98502
  ...Array.isArray(value.marks) ? {
98314
- marks: value.marks.filter((mark) => isRecord15(mark) && typeof mark.type === "string").map((mark) => ({
98503
+ marks: value.marks.filter((mark) => isRecord16(mark) && typeof mark.type === "string").map((mark) => ({
98315
98504
  type: mark.type,
98316
- ...isRecord15(mark.attrs) ? { attrs: mark.attrs } : {}
98505
+ ...isRecord16(mark.attrs) ? { attrs: mark.attrs } : {}
98317
98506
  }))
98318
98507
  } : {}
98319
98508
  };
@@ -98483,7 +98672,7 @@ var ENTRY_REF_KEYS = [
98483
98672
  "entryId",
98484
98673
  "slug"
98485
98674
  ];
98486
- function isRecord16(value) {
98675
+ function isRecord17(value) {
98487
98676
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
98488
98677
  }
98489
98678
  function extractManualEntryRef(item) {
@@ -98491,7 +98680,7 @@ function extractManualEntryRef(item) {
98491
98680
  const trimmed = item.trim();
98492
98681
  return trimmed.length > 0 ? trimmed : null;
98493
98682
  }
98494
- if (!isRecord16(item)) return null;
98683
+ if (!isRecord17(item)) return null;
98495
98684
  for (const key of ENTRY_REF_KEYS) {
98496
98685
  const raw = item[key];
98497
98686
  if (typeof raw === "string" && raw.trim().length > 0) {
@@ -99012,7 +99201,7 @@ function collectMediaAssetSidecar(mediaAssets) {
99012
99201
  return Array.isArray(mediaAssets) && mediaAssets.length > 0 ? mediaAssets : void 0;
99013
99202
  }
99014
99203
  function convertPageResponseBlock(block) {
99015
- if (!isRecord17(block)) {
99204
+ if (!isRecord18(block)) {
99016
99205
  throw new Error("Invalid block format in page API response");
99017
99206
  }
99018
99207
  if (typeof block.id !== "string" && block.id !== null) {
@@ -99043,20 +99232,20 @@ function buildPageOutline(input) {
99043
99232
  blocks: input.blocks.map(convertPageResponseBlock)
99044
99233
  };
99045
99234
  }
99046
- function isRecord17(value) {
99235
+ function isRecord18(value) {
99047
99236
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
99048
99237
  }
99049
99238
  function readContentRecord(value) {
99050
- return isRecord17(value) ? value : void 0;
99239
+ return isRecord18(value) ? value : void 0;
99051
99240
  }
99052
99241
  function readNestedContentRecord(value) {
99053
- if (!isRecord17(value)) return null;
99242
+ if (!isRecord18(value)) return null;
99054
99243
  return readContentRecord(value.data) ?? null;
99055
99244
  }
99056
99245
  function sanitizeSdkRuntimeBlockContent(blockKind, content) {
99057
99246
  if (blockKind !== "block.newsletter-signup") return content;
99058
99247
  const sanitized = sanitizeNewsletterSignupPublicContent(content);
99059
- return isRecord17(sanitized) ? sanitized : {};
99248
+ return isRecord18(sanitized) ? sanitized : {};
99060
99249
  }
99061
99250
  function sanitizeNullableSdkRuntimeBlockContent(blockKind, content) {
99062
99251
  return content ? sanitizeSdkRuntimeBlockContent(blockKind, content) : null;