@riverbankcms/sdk 0.85.0 → 0.89.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 (166) hide show
  1. package/dist/{PreviewEditorSidebar-4PH35ZIE.mjs → PreviewEditorSidebar-JDR64FEC.mjs} +3 -3
  2. package/dist/{PreviewEditorUI-WHMCRJGM.mjs → PreviewEditorUI-67TMJMAF.mjs} +3 -3
  3. package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +8 -0
  4. package/dist/_dts/api/src/accessAdmin.d.ts +7 -0
  5. package/dist/_dts/api/src/endpoints.d.ts +66 -14
  6. package/dist/_dts/api/src/index.d.ts +5 -2
  7. package/dist/_dts/api/src/launchReadiness.d.ts +3 -3
  8. package/dist/_dts/api/src/mailchimpIntegration.d.ts +215 -0
  9. package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +35 -15
  10. package/dist/_dts/api/src/siteInfrastructure.d.ts +0 -14
  11. package/dist/_dts/api/src/siteManagementEndpoints.d.ts +5 -1
  12. package/dist/_dts/api/src/siteMembers.d.ts +6 -1
  13. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -13
  14. package/dist/_dts/api/src/types.d.ts +7 -4
  15. package/dist/_dts/blocks/src/PageRenderer.d.ts +1 -0
  16. package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +4 -0
  17. package/dist/_dts/blocks/src/index.d.ts +2 -1
  18. package/dist/_dts/blocks/src/system/blocks/appointment-booking.d.ts +288 -288
  19. package/dist/_dts/blocks/src/system/blocks/blog-listing.d.ts +288 -288
  20. package/dist/_dts/blocks/src/system/blocks/cart.d.ts +288 -288
  21. package/dist/_dts/blocks/src/system/blocks/checkout.d.ts +288 -288
  22. package/dist/_dts/blocks/src/system/blocks/collection.d.ts +288 -288
  23. package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +42 -0
  24. package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -0
  25. package/dist/_dts/blocks/src/system/blocks/faq.d.ts +288 -288
  26. package/dist/_dts/blocks/src/system/blocks/gifting.d.ts +288 -288
  27. package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +1 -1
  28. package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +42 -42
  29. package/dist/_dts/blocks/src/system/blocks/newsletter-signup-destination.d.ts +300 -0
  30. package/dist/_dts/blocks/src/system/blocks/newsletter-signup.d.ts +63 -3
  31. package/dist/_dts/blocks/src/system/blocks/product-detail.d.ts +288 -288
  32. package/dist/_dts/blocks/src/system/blocks/product-list.d.ts +288 -288
  33. package/dist/_dts/blocks/src/system/blocks/shop.d.ts +288 -288
  34. package/dist/_dts/blocks/src/system/fragments/library/newsletterForm.d.ts +53 -1
  35. package/dist/_dts/blocks/src/system/icons/cta.d.ts +3 -3
  36. package/dist/_dts/blocks/src/system/icons/index.d.ts +1 -0
  37. package/dist/_dts/blocks/src/system/icons/registry.d.ts +2 -2
  38. package/dist/_dts/blocks/src/system/icons/semantic.d.ts +3 -3
  39. package/dist/_dts/blocks/src/system/icons/svg.d.ts +72 -0
  40. package/dist/_dts/blocks/src/system/manifest/richTextSchema.d.ts +27 -0
  41. package/dist/_dts/blocks/src/system/manifest/schema.d.ts +23 -23
  42. package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +11 -2
  43. package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +24 -0
  44. package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +12 -0
  45. package/dist/_dts/blocks/src/system/runtime/hooks/loadStateError.d.ts +1 -0
  46. package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.d.ts +1 -1
  47. package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableDates.state.d.ts +55 -0
  48. package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.state.d.ts +39 -0
  49. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFormConfig.d.ts +4 -27
  50. package/dist/_dts/blocks/src/system/runtime/hooks/useBookingFormConfig.state.d.ts +40 -0
  51. package/dist/_dts/blocks/src/system/runtime/hooks/useCalendarEvents.state.d.ts +20 -0
  52. package/dist/_dts/blocks/src/system/runtime/hooks/useEventFilters.state.d.ts +31 -0
  53. package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.d.ts +3 -3
  54. package/dist/_dts/blocks/src/system/runtime/hooks/useEventPagination.state.d.ts +39 -0
  55. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +1 -0
  56. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +4 -0
  57. package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
  58. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventPaginatedListView.client.d.ts +1 -1
  59. package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/utils.d.ts +11 -1
  60. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.client.state.d.ts +24 -2
  61. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.interactive.d.ts +15 -0
  62. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.server.d.ts +1 -1
  63. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.submission.d.ts +32 -0
  64. package/dist/_dts/blocks/src/system/runtime/nodes/newsletter-form.types.d.ts +5 -1
  65. package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.d.ts +24 -0
  66. package/dist/_dts/blocks/src/system/runtime/shared/components/ModalShell.d.ts +5 -1
  67. package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.state.d.ts +35 -0
  68. package/dist/_dts/blocks/src/system/runtime/shared/utils/formatting.d.ts +1 -1
  69. package/dist/_dts/content-model/src/entry-slots/types.d.ts +54 -0
  70. package/dist/_dts/content-model/src/referenceFields.d.ts +1 -1
  71. package/dist/_dts/core/src/branded.d.ts +7 -0
  72. package/dist/_dts/core/src/currency-format.d.ts +37 -2
  73. package/dist/_dts/core/src/event-pricing.d.ts +24 -0
  74. package/dist/_dts/core/src/index.d.ts +1 -0
  75. package/dist/_dts/core/src/site-route-target.d.ts +40 -0
  76. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +705 -17
  77. package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +3 -1
  78. package/dist/_dts/media-core/src/fileDomain.d.ts +4 -0
  79. package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +160 -0
  80. package/dist/_dts/sdk/src/client/types.d.ts +35 -1
  81. package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
  82. package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -0
  83. package/dist/_dts/sdk/src/data/prefetchBlockData.d.ts +3 -9
  84. package/dist/_dts/sdk/src/index.d.ts +3 -1
  85. package/dist/_dts/sdk/src/manifest/passes/pass1-fields.d.ts +1 -1
  86. package/dist/_dts/sdk/src/manifest/three-pass-converter.d.ts +7 -18
  87. package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +2 -0
  88. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +3 -1
  89. package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +7 -3
  90. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +4 -24
  91. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +45 -0
  92. package/dist/_dts/sdk/src/version.d.ts +1 -1
  93. package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
  94. package/dist/_dts/theme-core/src/mock-themes/all.d.ts +9 -9
  95. package/dist/_dts/theme-core/src/schema.d.ts +11 -11
  96. package/dist/{chunk-PYDHOMEO.mjs → chunk-7N46MZHI.mjs} +1 -1
  97. package/dist/{chunk-ZR2GQK2A.mjs → chunk-7YUAXONX.mjs} +1880 -588
  98. package/dist/{chunk-4QNLOTES.mjs → chunk-F645A5UV.mjs} +76 -14
  99. package/dist/{chunk-OCGTXHSO.mjs → chunk-HKJQERFR.mjs} +7 -7
  100. package/dist/{chunk-NFWGLRZZ.mjs → chunk-TGBJWKMP.mjs} +37 -3
  101. package/dist/{chunk-WFPYN7KA.mjs → chunk-ZQRBLCW5.mjs} +2 -2
  102. package/dist/cli/index.mjs +1075 -126
  103. package/dist/client/{accordion-2UZPBMYM.mjs → accordion-MUCVNGQ7.mjs} +2 -2
  104. package/dist/client/{bookingForm-36CWQUMV.mjs → bookingForm-PKD6EFIE.mjs} +193 -77
  105. package/dist/client/bookings.mjs +487 -197
  106. package/dist/client/{carousel-QH77HR6X.mjs → carousel-3TKQSNJC.mjs} +4 -3
  107. package/dist/client/cart-6XHSZK23.mjs +19 -0
  108. package/dist/client/checkout-FVSPM6FI.mjs +19 -0
  109. package/dist/client/{chunk-ZE5G642V.mjs → chunk-25W2EQUN.mjs} +75 -1
  110. package/dist/client/chunk-6N7YRNYU.mjs +183 -0
  111. package/dist/client/{chunk-4OXKTA3D.mjs → chunk-7DH35FGA.mjs} +2 -2
  112. package/dist/client/{chunk-3C2VTPWI.mjs → chunk-CQKKFEQD.mjs} +363 -66
  113. package/dist/client/{chunk-7UCLJ5SP.mjs → chunk-EY42X22F.mjs} +4 -7
  114. package/dist/client/{chunk-SYIJ5JO2.mjs → chunk-FHU6PFPM.mjs} +1 -1
  115. package/dist/client/{chunk-ZKUO52W3.mjs → chunk-LQFDYWPJ.mjs} +1 -1
  116. package/dist/client/chunk-RSQWWUAD.mjs +390 -0
  117. package/dist/client/{chunk-UDNSI5PY.mjs → chunk-STJ2NCQM.mjs} +2 -3
  118. package/dist/client/{chunk-VGDBVNOO.mjs → chunk-UQFY4AHX.mjs} +511 -406
  119. package/dist/client/{chunk-F5VRX5Y6.mjs → chunk-VGLXACVK.mjs} +1 -1
  120. package/dist/client/{chunk-DVNUDUVT.mjs → chunk-WBQG7VJA.mjs} +4 -1
  121. package/dist/client/{chunk-52CGCQ7B.mjs → chunk-ZJZZA5EP.mjs} +10 -80
  122. package/dist/client/{chunk-XSV6KW4D.mjs → chunk-ZT5XE7FK.mjs} +1 -1
  123. package/dist/client/client.mjs +5820 -4782
  124. package/dist/client/{courseRegistration-TMKU6ABO.mjs → courseRegistration-ATZSYDHM.mjs} +7 -7
  125. package/dist/client/{eventCalendar-G6TI32X6.mjs → eventCalendar-6T2UGKKP.mjs} +11 -11
  126. package/dist/client/{eventCombined-SCKEMNAR.mjs → eventCombined-Q4VANXVF.mjs} +11 -11
  127. package/dist/client/{eventDetails-XPIFXXPK.mjs → eventDetails-DW37E7VW.mjs} +11 -11
  128. package/dist/client/{eventListing-7QFMEMGT.mjs → eventListing-XURTSAUW.mjs} +11 -11
  129. package/dist/client/{eventRegistration-TOODSZUI.mjs → eventRegistration-MRKEVAXW.mjs} +11 -11
  130. package/dist/client/{form-MTCMVCZT.mjs → form-WZZFFGMU.mjs} +3 -3
  131. package/dist/client/{headerSection-Y5TMR3TW.mjs → headerSection-EQYVQBLM.mjs} +4 -4
  132. package/dist/client/hooks.mjs +1700 -1412
  133. package/dist/client/{locationMap-RH2LG7FZ.mjs → locationMap-MFF5VAZR.mjs} +3 -4
  134. package/dist/client/{newsletterForm-PCAIPFMA.mjs → newsletterForm-JQ77UYIE.mjs} +127 -43
  135. package/dist/client/{productDetail-OIGDR4YE.mjs → productDetail-25LMT3IZ.mjs} +9 -9
  136. package/dist/client/{productList-4MA5S2CX.mjs → productList-5ABEMKUG.mjs} +9 -9
  137. package/dist/client/rendering/client.mjs +3884 -3722
  138. package/dist/client/rendering/islands.mjs +19 -19
  139. package/dist/client/rendering.mjs +6774 -6331
  140. package/dist/client/shop-OMMQZ6YO.mjs +21 -0
  141. package/dist/preview-next/before-render.mjs +76 -14
  142. package/dist/preview-next/client/runtime.mjs +5 -5
  143. package/dist/preview-next/editor-chrome.css +56 -9
  144. package/dist/preview-next/middleware.mjs +76 -14
  145. package/dist/{sdk-runtime-QLOCYKVU.mjs → sdk-runtime-WNLBZ3ZH.mjs} +6 -6
  146. package/dist/server/components.mjs +2579 -2548
  147. package/dist/server/config-validation.mjs +1737 -1461
  148. package/dist/server/config.mjs +1737 -1461
  149. package/dist/server/data.mjs +1701 -1413
  150. package/dist/server/index.mjs +1048 -400
  151. package/dist/server/next.mjs +3602 -2858
  152. package/dist/server/page-converter.mjs +2193 -1169
  153. package/dist/server/prebuild.mjs +1 -1
  154. package/dist/server/rendering/server.mjs +2770 -2742
  155. package/dist/server/rendering.mjs +2961 -2886
  156. package/dist/server/routing.mjs +2186 -1508
  157. package/dist/server/server.mjs +2237 -1287
  158. package/dist/server/theme-bridge.mjs +260 -0
  159. package/dist/styles/index.css +258 -0
  160. package/package.json +2 -1
  161. package/dist/SdkPreviewModeRuntime-4FGSVUYI.mjs +0 -8
  162. package/dist/client/cart-X4YK4FTW.mjs +0 -19
  163. package/dist/client/checkout-OM2BEPWD.mjs +0 -19
  164. package/dist/client/chunk-3DTWLTXM.mjs +0 -204
  165. package/dist/client/chunk-I2MMZO53.mjs +0 -6
  166. package/dist/client/shop-WXSYV5QO.mjs +0 -21
@@ -109,6 +109,57 @@ var init_collections = __esm({
109
109
  }
110
110
  });
111
111
 
112
+ // ../core/src/assert-never.ts
113
+ function assertNever(value, message = "Unexpected variant") {
114
+ throw new Error(`${message}: ${String(value)}`);
115
+ }
116
+ var init_assert_never = __esm({
117
+ "../core/src/assert-never.ts"() {
118
+ }
119
+ });
120
+
121
+ // ../core/src/currency-format.ts
122
+ function resolveCurrencyLocale(currencyCode, override) {
123
+ return CURRENCY_LOCALE_BY_CODE[currencyCode] ?? "en";
124
+ }
125
+ function formatCurrencyAmount(amountCents, currency, options) {
126
+ const currencyCode = currency.toUpperCase();
127
+ const locale = resolveCurrencyLocale(currencyCode);
128
+ try {
129
+ const exactFormatter = new Intl.NumberFormat(locale, {
130
+ style: "currency",
131
+ currency: currencyCode
132
+ });
133
+ const fractionDigits = options?.decimals === "auto" ? {
134
+ minimumFractionDigits: 0,
135
+ maximumFractionDigits: exactFormatter.resolvedOptions().maximumFractionDigits
136
+ } : {};
137
+ return new Intl.NumberFormat(locale, {
138
+ style: "currency",
139
+ currency: currencyCode,
140
+ ...fractionDigits
141
+ }).format(amountCents / 100);
142
+ } catch {
143
+ return `${(amountCents / 100).toFixed(2)} ${currencyCode}`;
144
+ }
145
+ }
146
+ var CURRENCY_LOCALE_BY_CODE;
147
+ var init_currency_format = __esm({
148
+ "../core/src/currency-format.ts"() {
149
+ CURRENCY_LOCALE_BY_CODE = {
150
+ USD: "en-US",
151
+ GBP: "en-GB",
152
+ EUR: "de-DE",
153
+ AUD: "en-AU",
154
+ CAD: "en-CA",
155
+ NZD: "en-NZ",
156
+ JPY: "ja-JP",
157
+ CNY: "zh-CN",
158
+ CHF: "de-CH"
159
+ };
160
+ }
161
+ });
162
+
112
163
  // ../core/src/event-pricing.ts
113
164
  function publicEventPricingType(pricing) {
114
165
  switch (pricing.kind) {
@@ -129,6 +180,7 @@ function isFreePublicEventPriceDisplay(display) {
129
180
  return display.display.kind === "free";
130
181
  case "exact":
131
182
  case "from":
183
+ case "range":
132
184
  case "mixed":
133
185
  case "unavailable":
134
186
  return false;
@@ -343,15 +395,6 @@ var init_business_address = __esm({
343
395
  }
344
396
  });
345
397
 
346
- // ../core/src/assert-never.ts
347
- function assertNever(value, message = "Unexpected variant") {
348
- throw new Error(`${message}: ${String(value)}`);
349
- }
350
- var init_assert_never = __esm({
351
- "../core/src/assert-never.ts"() {
352
- }
353
- });
354
-
355
398
  // ../core/src/narrow-result.ts
356
399
  var init_narrow_result = __esm({
357
400
  "../core/src/narrow-result.ts"() {
@@ -454,12 +497,6 @@ var init_csv_types = __esm({
454
497
  }
455
498
  });
456
499
 
457
- // ../core/src/currency-format.ts
458
- var init_currency_format = __esm({
459
- "../core/src/currency-format.ts"() {
460
- }
461
- });
462
-
463
500
  // ../core/src/email-format.ts
464
501
  var init_email_format = __esm({
465
502
  "../core/src/email-format.ts"() {
@@ -490,6 +527,12 @@ var init_stable_json = __esm({
490
527
  }
491
528
  });
492
529
 
530
+ // ../core/src/site-route-target.ts
531
+ var init_site_route_target = __esm({
532
+ "../core/src/site-route-target.ts"() {
533
+ }
534
+ });
535
+
493
536
  // ../core/src/index.ts
494
537
  var init_src = __esm({
495
538
  "../core/src/index.ts"() {
@@ -536,6 +579,7 @@ var init_src = __esm({
536
579
  init_string();
537
580
  init_uuid();
538
581
  init_stable_json();
582
+ init_site_route_target();
539
583
  }
540
584
  });
541
585
 
@@ -17955,15 +17999,53 @@ var init_newsletterForm = __esm({
17955
17999
  title: "Newsletter Form",
17956
18000
  description: "Newsletter subscription form with preset field configurations.",
17957
18001
  fields: [
18002
+ {
18003
+ id: "destinationProvider",
18004
+ type: "select",
18005
+ label: "Send signups to",
18006
+ description: "Choose where new subscribers from this form should go.",
18007
+ defaultValue: "riverbank",
18008
+ required: true,
18009
+ ui: { intent: "behavior" },
18010
+ options: [
18011
+ { value: "riverbank", label: "Riverbank newsletter" }
18012
+ ]
18013
+ },
17958
18014
  {
17959
18015
  id: "listId",
17960
18016
  type: "reference",
17961
18017
  label: "Newsletter list",
17962
18018
  description: "Select the list new subscribers should be added to.",
17963
- required: true,
18019
+ required: false,
17964
18020
  referenceKind: "newsletterList",
17965
18021
  allowManualEntry: false,
17966
- ui: { intent: "behavior" }
18022
+ ui: {
18023
+ intent: "behavior",
18024
+ visibleWhen: { field: "destinationProvider", equals: "riverbank" }
18025
+ }
18026
+ },
18027
+ {
18028
+ id: "mailchimpAudienceId",
18029
+ type: "reference",
18030
+ label: "Mailchimp audience",
18031
+ description: "Choose the Mailchimp audience for new subscribers.",
18032
+ required: false,
18033
+ referenceKind: "mailchimpAudience",
18034
+ allowManualEntry: false,
18035
+ ui: {
18036
+ intent: "behavior",
18037
+ visibleWhen: { field: "destinationProvider", equals: "mailchimp" }
18038
+ }
18039
+ },
18040
+ {
18041
+ id: "mailchimpTags",
18042
+ type: "text",
18043
+ label: "Mailchimp tags",
18044
+ description: "Optional tags to apply in Mailchimp, separated by commas or semicolons.",
18045
+ ui: {
18046
+ intent: "behavior",
18047
+ visibleWhen: { field: "destinationProvider", equals: "mailchimp" }
18048
+ }
17967
18049
  },
17968
18050
  {
17969
18051
  id: "preset",
@@ -18010,13 +18092,18 @@ var init_newsletterForm = __esm({
18010
18092
  id: "tags",
18011
18093
  type: "text",
18012
18094
  label: "Tags (optional)",
18013
- description: "Optional tags to apply on subscribe (comma or semicolon separated)."
18095
+ description: "Optional tags to apply on subscribe (comma or semicolon separated).",
18096
+ ui: {
18097
+ intent: "behavior",
18098
+ visibleWhen: { field: "destinationProvider", equals: "riverbank" }
18099
+ }
18014
18100
  }
18015
18101
  ],
18016
18102
  layout: [
18017
18103
  el(
18018
18104
  "newsletter-form",
18019
18105
  withApiBindings({
18106
+ destinationProvider: { $bind: { from: "destinationProvider" } },
18020
18107
  listId: { $bind: { from: "listId" } },
18021
18108
  preset: { $bind: { from: "preset" } },
18022
18109
  includePhone: { $bind: { from: "includePhone" } },
@@ -18522,6 +18609,83 @@ var init_media2 = __esm({
18522
18609
  ]);
18523
18610
  }
18524
18611
  });
18612
+ function createHardBreakNode() {
18613
+ return { type: "hardBreak" };
18614
+ }
18615
+ function parseRichTextInlineMarkdown(text2) {
18616
+ const out = [];
18617
+ const pushText = (value, marks) => {
18618
+ if (!value) return;
18619
+ out.push(
18620
+ marks && marks.length > 0 ? { type: "text", text: value, marks } : { type: "text", text: value }
18621
+ );
18622
+ };
18623
+ let rest = text2;
18624
+ while (rest.length > 0) {
18625
+ const start = rest.indexOf("**");
18626
+ if (start === -1) {
18627
+ pushText(rest);
18628
+ break;
18629
+ }
18630
+ const end = rest.indexOf("**", start + 2);
18631
+ if (end === -1) {
18632
+ pushText(rest);
18633
+ break;
18634
+ }
18635
+ pushText(rest.slice(0, start));
18636
+ pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
18637
+ rest = rest.slice(end + 2);
18638
+ }
18639
+ return out;
18640
+ }
18641
+ function parseRichTextParagraphInlineMarkdown(text2) {
18642
+ return text2.split("\n").flatMap((line, index) => {
18643
+ const lineNodes = parseRichTextInlineMarkdown(line.trim());
18644
+ return index === 0 ? lineNodes : [createHardBreakNode(), ...lineNodes];
18645
+ });
18646
+ }
18647
+ function createRichTextDocFromMarkdown(markdown) {
18648
+ const normalized = markdown.replace(/\r\n/g, "\n").trim();
18649
+ if (!normalized) return { type: "doc", content: [] };
18650
+ const paragraphs = normalized.split(/\n{2,}/).map((paragraph) => paragraph.trim()).filter(Boolean);
18651
+ return {
18652
+ type: "doc",
18653
+ content: paragraphs.map((paragraph) => {
18654
+ const inline2 = parseRichTextParagraphInlineMarkdown(paragraph);
18655
+ return inline2.length > 0 ? { type: "paragraph", content: inline2 } : { type: "paragraph" };
18656
+ })
18657
+ };
18658
+ }
18659
+ var TipTapMarkSchema, TipTapNodeSchema, RichTextDocSchema;
18660
+ var init_richTextSchema = __esm({
18661
+ "../blocks/src/system/manifest/richTextSchema.ts"() {
18662
+ TipTapMarkSchema = z.object({
18663
+ type: z.string(),
18664
+ attrs: z.record(z.string(), z.unknown()).optional()
18665
+ });
18666
+ TipTapNodeSchema = z.lazy(
18667
+ () => z.object({
18668
+ type: z.string(),
18669
+ content: z.array(TipTapNodeSchema).optional(),
18670
+ text: z.string().optional(),
18671
+ attrs: z.record(z.string(), z.unknown()).optional(),
18672
+ marks: z.array(TipTapMarkSchema).optional()
18673
+ })
18674
+ );
18675
+ z.union([
18676
+ // Canonical: TipTap document directly
18677
+ TipTapNodeSchema,
18678
+ // Legacy (read-tolerance only): wrapped in { doc: {...} }
18679
+ z.object({
18680
+ doc: TipTapNodeSchema
18681
+ })
18682
+ ]);
18683
+ RichTextDocSchema = z.object({
18684
+ type: z.literal("doc"),
18685
+ content: z.array(TipTapNodeSchema)
18686
+ });
18687
+ }
18688
+ });
18525
18689
  var bookingDepositRefundPolicySchema, bookingInstalmentPlanSchema, bookingFlexibleBalanceDueDateRuleSchema, bookingFlexibleBalanceConfigSchema, blockBookingPaymentCollectionOptionSchema, blockBookingPaymentTermsSchema;
18526
18690
  var init_bookingPaymentTerms = __esm({
18527
18691
  "../blocks/src/system/blocks/shared/bookingPaymentTerms.ts"() {
@@ -18660,6 +18824,7 @@ var eventPresetSchema, eventScheduleScopeSchema, eventDestinationModeSchema, eve
18660
18824
  var init_schemas2 = __esm({
18661
18825
  "../blocks/src/system/blocks/events/shared/schemas.ts"() {
18662
18826
  init_media2();
18827
+ init_richTextSchema();
18663
18828
  init_bookingPaymentTerms();
18664
18829
  init_schemas();
18665
18830
  eventPresetSchema = z.enum(["event", "class", "workshop", "retreat", "performance"]);
@@ -18692,7 +18857,13 @@ var init_schemas2 = __esm({
18692
18857
  z.object({ kind: z.literal("free"), currency: z.string() }),
18693
18858
  z.object({ kind: z.literal("exact"), amount: z.number(), currency: z.string() }),
18694
18859
  z.object({ kind: z.literal("from"), amount: z.number(), currency: z.string() }),
18695
- z.object({ kind: z.literal("mixed"), paidFromAmount: z.number(), currency: z.string() }),
18860
+ z.object({ kind: z.literal("range"), minAmount: z.number(), maxAmount: z.number(), currency: z.string() }),
18861
+ z.object({
18862
+ kind: z.literal("mixed"),
18863
+ paidFromAmount: z.number(),
18864
+ paidToAmount: z.number(),
18865
+ currency: z.string()
18866
+ }),
18696
18867
  z.object({ kind: z.literal("unavailable"), currency: z.string() }),
18697
18868
  z.object({ kind: z.literal("course"), display: publicCoursePriceDisplaySchema })
18698
18869
  ]);
@@ -18700,7 +18871,13 @@ var init_schemas2 = __esm({
18700
18871
  z.object({ kind: z.literal("free"), currency: z.string() }),
18701
18872
  z.object({ kind: z.literal("exact"), amount: z.number(), currency: z.string() }),
18702
18873
  z.object({ kind: z.literal("from"), amount: z.number(), currency: z.string() }),
18703
- z.object({ kind: z.literal("mixed"), paidFromAmount: z.number(), currency: z.string() }),
18874
+ z.object({ kind: z.literal("range"), minAmount: z.number(), maxAmount: z.number(), currency: z.string() }),
18875
+ z.object({
18876
+ kind: z.literal("mixed"),
18877
+ paidFromAmount: z.number(),
18878
+ paidToAmount: z.number(),
18879
+ currency: z.string()
18880
+ }),
18704
18881
  z.object({ kind: z.literal("unavailable"), currency: z.string() })
18705
18882
  ]);
18706
18883
  publicEventAttendanceModeSchema = z.enum(["in_person", "online"]);
@@ -18785,6 +18962,9 @@ var init_schemas2 = __esm({
18785
18962
  seriesId: z.string(),
18786
18963
  title: z.string(),
18787
18964
  description: z.string().nullable(),
18965
+ content: z.object({
18966
+ body: RichTextDocSchema.nullable().optional()
18967
+ }).optional(),
18788
18968
  presentation: z.object({
18789
18969
  cardTitleOverride: z.string().nullable().optional(),
18790
18970
  summary: z.string().nullable().optional(),
@@ -19167,10 +19347,21 @@ function readLegacyPriceDisplay(value, currency) {
19167
19347
  amount: readAmount(value.amount) ?? 0,
19168
19348
  currency: displayCurrency
19169
19349
  } : { kind: "unavailable", currency };
19350
+ case "range": {
19351
+ const minAmount = readAmount(value.minAmount);
19352
+ const maxAmount = readAmount(value.maxAmount);
19353
+ return minAmount !== null && maxAmount !== null ? {
19354
+ kind: "range",
19355
+ minAmount,
19356
+ maxAmount,
19357
+ currency: displayCurrency
19358
+ } : { kind: "unavailable", currency };
19359
+ }
19170
19360
  case "mixed":
19171
19361
  return readAmount(value.paidFromAmount) !== null ? {
19172
19362
  kind: "mixed",
19173
19363
  paidFromAmount: readAmount(value.paidFromAmount) ?? 0,
19364
+ paidToAmount: readAmount(value.paidToAmount) ?? readAmount(value.paidFromAmount) ?? 0,
19174
19365
  currency: displayCurrency
19175
19366
  } : { kind: "unavailable", currency };
19176
19367
  case "unavailable":
@@ -19425,6 +19616,7 @@ var init_event_registration_interactive = __esm({
19425
19616
  successMessage: z.string().optional(),
19426
19617
  waitlistMessage: z.string().optional(),
19427
19618
  buttonVariant: registrationButtonVariantSchema.optional(),
19619
+ overlayEnabled: z.boolean().optional(),
19428
19620
  spamProtectionEnabled: z.boolean().optional(),
19429
19621
  stage: previewStageSchema.optional(),
19430
19622
  supportEmail: z.string().optional()
@@ -19448,6 +19640,7 @@ var init_event_registration_interactive = __esm({
19448
19640
  successMessage: z.string().optional(),
19449
19641
  waitlistMessage: z.string().optional(),
19450
19642
  buttonVariant: registrationButtonVariantSchema.optional(),
19643
+ overlayEnabled: z.boolean().optional(),
19451
19644
  spamProtectionEnabled: z.boolean().optional(),
19452
19645
  supportEmail: z.string().optional()
19453
19646
  });
@@ -19480,6 +19673,7 @@ var init_event_registration_interactive = __esm({
19480
19673
  successMessage: source.successMessage,
19481
19674
  waitlistMessage: source.waitlistMessage,
19482
19675
  buttonVariant: source.buttonVariant,
19676
+ overlayEnabled: source.overlayEnabled,
19483
19677
  spamProtectionEnabled: source.spamProtectionEnabled,
19484
19678
  supportEmail: source.supportEmail
19485
19679
  }
@@ -20503,10 +20697,7 @@ var init_shop_commerce_shared = __esm({
20503
20697
 
20504
20698
  // ../blocks/src/system/runtime/nodes/commerce/shared/display.ts
20505
20699
  function formatCommercePrice(cents, currency) {
20506
- return new Intl.NumberFormat("en-US", {
20507
- style: "currency",
20508
- currency: currency.toUpperCase()
20509
- }).format(cents / 100);
20700
+ return formatCurrencyAmount(cents, currency);
20510
20701
  }
20511
20702
  function getPassesHeading(passes, explicitHeading) {
20512
20703
  if (explicitHeading) return explicitHeading;
@@ -20700,6 +20891,7 @@ function formatValidity(days) {
20700
20891
  }
20701
20892
  var init_display = __esm({
20702
20893
  "../blocks/src/system/runtime/nodes/commerce/shared/display.ts"() {
20894
+ init_src();
20703
20895
  init_creditProducts();
20704
20896
  init_shop_commerce_shared();
20705
20897
  }
@@ -21162,6 +21354,65 @@ var init_gifting_interactive = __esm({
21162
21354
  }
21163
21355
  });
21164
21356
 
21357
+ // ../blocks/src/system/blocks/newsletter-signup-destination.ts
21358
+ function parseNewsletterSignupBlockId(value) {
21359
+ const trimmed = parseTrimmedString(value);
21360
+ return trimmed && BLOCK_ID_PATTERN.test(trimmed) ? trimmed : null;
21361
+ }
21362
+ function parseSignedNewsletterDestinationRef(value) {
21363
+ const trimmed = parseTrimmedString(value);
21364
+ return trimmed && SIGNED_DESTINATION_REF_PATTERN.test(trimmed) ? trimmed : null;
21365
+ }
21366
+ function parseNewsletterSignupDestinationProvider(value) {
21367
+ return value === "riverbank" || value === "mailchimp" ? value : null;
21368
+ }
21369
+ function buildNewsletterSignupBlockRef(blockId) {
21370
+ const parsed = parseNewsletterSignupBlockId(blockId);
21371
+ return parsed ? { tag: "block_ref", blockId: parsed } : null;
21372
+ }
21373
+ function normalizeNewsletterSignupEditorValuesForDestination(values) {
21374
+ const destinationProvider = parseNewsletterSignupDestinationProvider(values.destinationProvider) ?? "riverbank";
21375
+ if (destinationProvider === "mailchimp") {
21376
+ return {
21377
+ destinationProvider,
21378
+ mailchimpAudienceId: values.mailchimpAudienceId,
21379
+ mailchimpTags: values.mailchimpTags
21380
+ };
21381
+ }
21382
+ return {
21383
+ destinationProvider,
21384
+ listId: values.listId,
21385
+ tags: values.tags
21386
+ };
21387
+ }
21388
+ function deriveNewsletterSignupRuntimeSource(values) {
21389
+ const normalized = normalizeNewsletterSignupEditorValuesForDestination(values);
21390
+ if (normalized.destinationProvider === "mailchimp") {
21391
+ return {
21392
+ destinationProvider: "mailchimp",
21393
+ listId: null,
21394
+ tags: null
21395
+ };
21396
+ }
21397
+ return {
21398
+ destinationProvider: "riverbank",
21399
+ listId: parseTrimmedString(normalized.listId),
21400
+ tags: parseTrimmedString(normalized.tags)
21401
+ };
21402
+ }
21403
+ function parseTrimmedString(value) {
21404
+ if (typeof value !== "string") return null;
21405
+ const trimmed = value.trim();
21406
+ return trimmed.length > 0 ? trimmed : null;
21407
+ }
21408
+ var BLOCK_ID_PATTERN, SIGNED_DESTINATION_REF_PATTERN;
21409
+ var init_newsletter_signup_destination = __esm({
21410
+ "../blocks/src/system/blocks/newsletter-signup-destination.ts"() {
21411
+ BLOCK_ID_PATTERN = /^[A-Za-z0-9._:-]{1,200}$/;
21412
+ SIGNED_DESTINATION_REF_PATTERN = /^[A-Za-z0-9._~-]{16,1000}$/;
21413
+ }
21414
+ });
21415
+
21165
21416
  // ../blocks/src/system/runtime/nodes/newsletter-form.types.ts
21166
21417
  function getPresetFields(preset2, options) {
21167
21418
  const includePhone = Boolean(options?.includePhone);
@@ -21227,13 +21478,29 @@ function buildNewsletterDisplay(source) {
21227
21478
  fields: getPresetFields(preset2, { includePhone })
21228
21479
  };
21229
21480
  }
21230
- var newsletterPresetSchema, newsletterFieldSchema, newsletterSourceSchema, newsletterDisplaySchema, newsletterHydrationSchema, newsletterRenderSchema, newsletterFormBlockRuntime;
21481
+ function parseRequiredNewsletterSignupBlockId(value) {
21482
+ const parsed = parseNewsletterSignupBlockId(value);
21483
+ if (!parsed) {
21484
+ throw new Error("Newsletter signup block destination ref requires blockId");
21485
+ }
21486
+ return parsed;
21487
+ }
21488
+ function parseRequiredSignedNewsletterDestinationRef(value) {
21489
+ const parsed = parseSignedNewsletterDestinationRef(value);
21490
+ if (!parsed) {
21491
+ throw new Error("Newsletter signup signed destination ref requires token");
21492
+ }
21493
+ return parsed;
21494
+ }
21495
+ var newsletterPresetSchema, newsletterDestinationProviderSchema, newsletterFieldSchema, newsletterSignupBlockIdSchema, signedNewsletterDestinationRefSchema, newsletterPublicDestinationRefSchema, newsletterSourceSchema, newsletterDisplaySchema, newsletterHydrationSchema, newsletterRenderSchema, newsletterFormBlockRuntime;
21231
21496
  var init_newsletter_form_interactive = __esm({
21232
21497
  "../blocks/src/system/runtime/nodes/newsletter-form.interactive.ts"() {
21233
21498
  init_islands();
21234
21499
  init_runtime();
21500
+ init_newsletter_signup_destination();
21235
21501
  init_newsletter_form_types();
21236
21502
  newsletterPresetSchema = z.enum(["emailOnly", "emailName", "emailFirstLast", "emailNameCompany"]);
21503
+ newsletterDestinationProviderSchema = z.enum(["riverbank", "mailchimp"]);
21237
21504
  newsletterFieldSchema = z.object({
21238
21505
  id: z.string(),
21239
21506
  type: z.enum(["email", "text"]),
@@ -21241,10 +21508,24 @@ var init_newsletter_form_interactive = __esm({
21241
21508
  required: z.boolean(),
21242
21509
  placeholder: z.string().optional()
21243
21510
  });
21511
+ newsletterSignupBlockIdSchema = z.string().trim().min(1).transform(parseRequiredNewsletterSignupBlockId);
21512
+ signedNewsletterDestinationRefSchema = z.string().trim().min(1).transform(parseRequiredSignedNewsletterDestinationRef);
21513
+ newsletterPublicDestinationRefSchema = z.discriminatedUnion("tag", [
21514
+ z.object({
21515
+ tag: z.literal("block_ref"),
21516
+ blockId: newsletterSignupBlockIdSchema
21517
+ }),
21518
+ z.object({
21519
+ tag: z.literal("signed_destination_ref"),
21520
+ token: signedNewsletterDestinationRefSchema
21521
+ })
21522
+ ]);
21244
21523
  newsletterSourceSchema = z.object({
21524
+ blockId: z.string().nullable().optional(),
21245
21525
  siteId: z.string().optional(),
21246
21526
  apiBaseUrl: z.string().optional(),
21247
21527
  listId: z.string().nullable().optional(),
21528
+ destinationProvider: newsletterDestinationProviderSchema.nullable().optional(),
21248
21529
  preset: newsletterPresetSchema.optional(),
21249
21530
  includePhone: z.boolean().optional(),
21250
21531
  buttonLabel: z.string().nullable().optional(),
@@ -21263,6 +21544,7 @@ var init_newsletter_form_interactive = __esm({
21263
21544
  fields: z.array(newsletterFieldSchema)
21264
21545
  });
21265
21546
  newsletterHydrationSchema = z.object({
21547
+ destinationRef: newsletterPublicDestinationRefSchema.nullable().optional(),
21266
21548
  listId: z.string().nullable().optional(),
21267
21549
  preset: newsletterPresetSchema,
21268
21550
  includePhone: z.boolean(),
@@ -21283,16 +21565,20 @@ var init_newsletter_form_interactive = __esm({
21283
21565
  source: createZodCodec(newsletterSourceSchema),
21284
21566
  render: createZodCodec(newsletterRenderSchema)
21285
21567
  },
21286
- buildRender: (source) => ({
21287
- display: buildNewsletterDisplay(source),
21288
- hydration: {
21289
- listId: source.listId,
21290
- preset: source.preset ?? "emailOnly",
21291
- includePhone: source.includePhone ?? false,
21292
- tags: source.tags ?? null,
21293
- spamProtectionEnabled: source.spamProtectionEnabled
21294
- }
21295
- })
21568
+ buildRender: (source) => {
21569
+ const runtimeSource = deriveNewsletterSignupRuntimeSource(source);
21570
+ return {
21571
+ display: buildNewsletterDisplay(source),
21572
+ hydration: {
21573
+ destinationRef: buildNewsletterSignupBlockRef(source.blockId),
21574
+ listId: runtimeSource.listId,
21575
+ preset: source.preset ?? "emailOnly",
21576
+ includePhone: source.includePhone ?? false,
21577
+ tags: runtimeSource.tags,
21578
+ spamProtectionEnabled: source.spamProtectionEnabled
21579
+ }
21580
+ };
21581
+ }
21296
21582
  });
21297
21583
  }
21298
21584
  });
@@ -22309,6 +22595,64 @@ var ENDPOINT_DEFINITIONS = {
22309
22595
  auth: "user",
22310
22596
  responseKind: "json"
22311
22597
  },
22598
+ listMailchimpAudiences: {
22599
+ path: "/sites/{siteId}/integrations/mailchimp/audiences",
22600
+ method: "GET",
22601
+ tags: [TAG_TEMPLATES.site],
22602
+ auth: "user",
22603
+ responseKind: "json",
22604
+ errors: ["auth:forbidden", "server:internal_error"]
22605
+ },
22606
+ getMailchimpSignupSyncHealth: {
22607
+ path: "/sites/{siteId}/integrations/mailchimp/signup-sync-health",
22608
+ method: "GET",
22609
+ tags: [TAG_TEMPLATES.site],
22610
+ auth: "user",
22611
+ responseKind: "json",
22612
+ errors: ["auth:forbidden", "server:internal_error"]
22613
+ },
22614
+ getMailchimpConnection: {
22615
+ path: "/sites/{siteId}/integrations/mailchimp/connection",
22616
+ method: "GET",
22617
+ tags: [TAG_TEMPLATES.site],
22618
+ auth: "user",
22619
+ responseKind: "json",
22620
+ errors: ["auth:forbidden", "server:internal_error"]
22621
+ },
22622
+ startMailchimpOAuth: {
22623
+ path: "/sites/{siteId}/integrations/mailchimp/oauth/start",
22624
+ method: "POST",
22625
+ tags: [TAG_TEMPLATES.site],
22626
+ auth: "user",
22627
+ responseKind: "json",
22628
+ demoMutation: DEMO_MUTATION_BLOCKED_DISABLED,
22629
+ errors: ["auth:forbidden", "validation:invalid_input", "server:internal_error"]
22630
+ },
22631
+ refreshMailchimpAudiences: {
22632
+ path: "/sites/{siteId}/integrations/mailchimp/audiences/refresh",
22633
+ method: "POST",
22634
+ tags: [TAG_TEMPLATES.site],
22635
+ auth: "user",
22636
+ responseKind: "json",
22637
+ demoMutation: DEMO_MUTATION_BLOCKED_DISABLED,
22638
+ errors: ["auth:forbidden", "server:internal_error"]
22639
+ },
22640
+ disconnectMailchimp: {
22641
+ path: "/sites/{siteId}/integrations/mailchimp/disconnect",
22642
+ method: "POST",
22643
+ tags: [TAG_TEMPLATES.site],
22644
+ auth: "user",
22645
+ responseKind: "json",
22646
+ demoMutation: DEMO_MUTATION_BLOCKED_DISABLED,
22647
+ errors: ["auth:forbidden", "server:internal_error"]
22648
+ },
22649
+ mailchimpOAuthCallback: {
22650
+ path: "/auth/mailchimp/callback",
22651
+ method: "GET",
22652
+ auth: "public",
22653
+ responseKind: "void",
22654
+ errors: []
22655
+ },
22312
22656
  createNewsletterList: {
22313
22657
  path: "/sites/{siteId}/newsletter/lists",
22314
22658
  method: "POST",
@@ -23310,6 +23654,24 @@ var ENDPOINT_DEFINITIONS = {
23310
23654
  auth: "user",
23311
23655
  responseKind: "json"
23312
23656
  },
23657
+ resendSiteInvitation: {
23658
+ path: "/sites/{siteId}/members/invitations/{invitationId}/resend",
23659
+ method: "POST",
23660
+ errors: [
23661
+ "auth:forbidden",
23662
+ "resource:not_found",
23663
+ "validation:invalid_input",
23664
+ "external:service_error",
23665
+ "server:internal_error"
23666
+ ],
23667
+ tags: [
23668
+ "site-{siteId}",
23669
+ "site-members-{siteId}",
23670
+ "site-invite-{invitationId}"
23671
+ ],
23672
+ auth: "user",
23673
+ responseKind: "json"
23674
+ },
23313
23675
  transferSiteOwnership: {
23314
23676
  path: "/sites/{siteId}/members/transfer-ownership",
23315
23677
  method: "POST",
@@ -24533,20 +24895,6 @@ var ENDPOINT_DEFINITIONS = {
24533
24895
  auth: "user",
24534
24896
  responseKind: "json"
24535
24897
  },
24536
- instagramUploadZip: {
24537
- path: "/instagram/upload-zip",
24538
- method: "POST",
24539
- tags: ["instagram-import"],
24540
- auth: "user",
24541
- responseKind: "json"
24542
- },
24543
- createInstagramZipUploadUrl: {
24544
- path: "/instagram/upload-zip-url",
24545
- method: "POST",
24546
- tags: ["instagram-import"],
24547
- auth: "user",
24548
- responseKind: "json"
24549
- },
24550
24898
  getAnalyticsReport: {
24551
24899
  path: "/sites/{siteId}/analytics/report",
24552
24900
  method: "GET",
@@ -35102,6 +35450,12 @@ var eventRegistrationManifest = createBlockManifest({
35102
35450
  buttonVariant: {
35103
35451
  $bind: { from: "content.buttonVariant", fallback: "primary" }
35104
35452
  },
35453
+ overlayEnabled: {
35454
+ $bind: {
35455
+ from: "$root.eventRegistrationOverlayEnabled",
35456
+ fallback: false
35457
+ }
35458
+ },
35105
35459
  // Event data from loader
35106
35460
  events: { $bind: { from: "data.events" } },
35107
35461
  // Stage for preview mode (allows registering for draft events)
@@ -41872,6 +42226,7 @@ var SUPPORTED_LOADER_ENDPOINTS = [
41872
42226
  ];
41873
42227
 
41874
42228
  // ../blocks/src/index.ts
42229
+ init_richTextSchema();
41875
42230
  init_booking_form_reserved_fields();
41876
42231
  init_colorStyles();
41877
42232
 
@@ -44125,21 +44480,6 @@ var titleSourceValueSchema = z.union([
44125
44480
  z.array(z.string().min(1)).min(1)
44126
44481
  ]);
44127
44482
 
44128
- // src/data/prefetchBlockData.ts
44129
- var SUPPORTED_LOADER_ENDPOINTS2 = [
44130
- "listPublishedEntries",
44131
- "getPublishedEntryPreview",
44132
- "listPublicEvents",
44133
- "listPublicCourses",
44134
- "listPublicTeamMembers",
44135
- "listPublicProducts",
44136
- "listPublicPasses",
44137
- "listPublicMemberships",
44138
- "getPublicFormById",
44139
- "getPublicBookingServices",
44140
- "getPublicEventDetails"
44141
- ];
44142
-
44143
44483
  // src/config/validation.ts
44144
44484
  var sdkThemePaletteSchema2 = z.record(z.string(), z.string());
44145
44485
  var sdkThemeConfigSchema2 = z.object({
@@ -44188,7 +44528,7 @@ var siteStyleConfigSchema = z.object({
44188
44528
  sectionOptions: sectionOptionsSchema,
44189
44529
  containerOptions: containerOptionsSchema
44190
44530
  }).optional();
44191
- var sdkLoaderEndpointSchema2 = z.enum(SUPPORTED_LOADER_ENDPOINTS2);
44531
+ var sdkLoaderEndpointSchema2 = z.enum(SUPPORTED_LOADER_ENDPOINTS);
44192
44532
  var allowedTransformIds = new Set(builtinTransformDefinitions.map((transform) => transform.id));
44193
44533
  var loaderTransformStepSchema = z.object({
44194
44534
  id: z.string().refine((id) => allowedTransformIds.has(id), {
@@ -64856,7 +65196,7 @@ var SimpleCache = class {
64856
65196
  };
64857
65197
 
64858
65198
  // src/version.ts
64859
- var SDK_VERSION = "0.85.0";
65199
+ var SDK_VERSION = "0.89.1";
64860
65200
 
64861
65201
  // src/client/error.ts
64862
65202
  var RiverbankApiError = class _RiverbankApiError extends Error {
@@ -65013,6 +65353,476 @@ function attachResilienceStatusToError(error, resilienceStatus) {
65013
65353
  return target;
65014
65354
  }
65015
65355
 
65356
+ // src/public-api/runtime.ts
65357
+ var PUBLIC_ENDPOINT_NAMES2 = [
65358
+ "getSite",
65359
+ "getContentByPath",
65360
+ "listPublishedEntries",
65361
+ "getPublishedEntryPreview",
65362
+ "getPublicFormById",
65363
+ "listPublicForms",
65364
+ "getPublicBookingServices",
65365
+ "getPublicChallenge",
65366
+ "listPublicEvents",
65367
+ "batchBlockLoaders",
65368
+ "listPublicCourses",
65369
+ "listPublicTeamMembers",
65370
+ "listPublicProducts",
65371
+ "listPublicPasses",
65372
+ "listPublicMemberships",
65373
+ "resolveEntrySubroute",
65374
+ "resolveEventOccurrence",
65375
+ "checkRedirect",
65376
+ "getRoutableContent",
65377
+ "getPublicRoutableContent",
65378
+ "getPublicSitemapRoutes"
65379
+ ];
65380
+ var API_ENDPOINTS2 = Object.freeze({
65381
+ getSite: {
65382
+ path: "/sites",
65383
+ method: "GET",
65384
+ revalidate: 900,
65385
+ tags: ["riverbank:site", "riverbank:site:id:{id}", "riverbank:site:slug:{slug}", "riverbank:site:domain:{domain}"],
65386
+ auth: "public",
65387
+ responseKind: "json"
65388
+ },
65389
+ getContentByPath: {
65390
+ path: "/sites/{siteId}/pages",
65391
+ method: "GET",
65392
+ tags: ["riverbank:site:{siteId}:routable-content"],
65393
+ auth: "public",
65394
+ responseKind: "json"
65395
+ },
65396
+ listPublishedEntries: {
65397
+ path: "/public/content/{siteId}/{type}/entries",
65398
+ method: "GET",
65399
+ revalidate: 60,
65400
+ tags: ["content-{siteId}-{type}"],
65401
+ auth: "public",
65402
+ responseKind: "json"
65403
+ },
65404
+ getPublishedEntryPreview: {
65405
+ path: "/public/content/{siteId}/{type}/{slug}/preview",
65406
+ method: "GET",
65407
+ revalidate: 60,
65408
+ tags: ["content-{siteId}-{type}-{slug}"],
65409
+ auth: "public",
65410
+ responseKind: "json"
65411
+ },
65412
+ getPublicFormById: {
65413
+ path: "/public/forms/{formId}",
65414
+ method: "GET",
65415
+ revalidate: 60,
65416
+ tags: ["riverbank:form:{formId}"],
65417
+ auth: "public",
65418
+ responseKind: "json"
65419
+ },
65420
+ listPublicForms: {
65421
+ path: "/public/sites/{siteId}/forms",
65422
+ method: "GET",
65423
+ revalidate: 60,
65424
+ tags: ["riverbank:site:{siteId}:forms"],
65425
+ auth: "public",
65426
+ responseKind: "json"
65427
+ },
65428
+ getPublicBookingServices: {
65429
+ path: "/public/bookings/services",
65430
+ method: "GET",
65431
+ revalidate: 60,
65432
+ tags: ["site-{siteId}"],
65433
+ auth: "public",
65434
+ responseKind: "json"
65435
+ },
65436
+ getPublicChallenge: {
65437
+ path: "/public/challenge",
65438
+ method: "GET",
65439
+ auth: "public",
65440
+ responseKind: "text"
65441
+ },
65442
+ listPublicEvents: {
65443
+ path: "/public/sites/{siteId}/events",
65444
+ method: "GET",
65445
+ revalidate: 60,
65446
+ tags: ["riverbank:site:{siteId}:public-events"],
65447
+ auth: "public",
65448
+ responseKind: "json"
65449
+ },
65450
+ batchBlockLoaders: {
65451
+ path: "/public/sites/{siteId}/block-loaders/batch",
65452
+ method: "POST",
65453
+ auth: "public",
65454
+ responseKind: "json"
65455
+ },
65456
+ listPublicCourses: {
65457
+ path: "/public/sites/{siteId}/courses",
65458
+ method: "GET",
65459
+ revalidate: 60,
65460
+ tags: ["riverbank:site:{siteId}:public-courses"],
65461
+ auth: "public",
65462
+ responseKind: "json"
65463
+ },
65464
+ listPublicTeamMembers: {
65465
+ path: "/public/sites/{siteId}/team-members",
65466
+ method: "GET",
65467
+ revalidate: 60,
65468
+ tags: ["riverbank:site:{siteId}:public-team-members"],
65469
+ auth: "public",
65470
+ responseKind: "json"
65471
+ },
65472
+ listPublicProducts: {
65473
+ path: "/public/sites/{siteId}/products",
65474
+ method: "GET",
65475
+ revalidate: 300,
65476
+ tags: ["riverbank:site:{siteId}:public-products"],
65477
+ auth: "public",
65478
+ responseKind: "json"
65479
+ },
65480
+ listPublicPasses: {
65481
+ path: "/public/sites/{siteId}/bookings/products/passes",
65482
+ method: "GET",
65483
+ revalidate: 300,
65484
+ tags: ["riverbank:site:{siteId}:public-passes"],
65485
+ auth: "public",
65486
+ responseKind: "json"
65487
+ },
65488
+ listPublicMemberships: {
65489
+ path: "/public/sites/{siteId}/bookings/products/memberships",
65490
+ method: "GET",
65491
+ revalidate: 300,
65492
+ tags: ["riverbank:site:{siteId}:public-memberships"],
65493
+ auth: "public",
65494
+ responseKind: "json"
65495
+ },
65496
+ resolveEntrySubroute: {
65497
+ path: "/public/sites/{siteId}/routing/subroutes/resolve",
65498
+ method: "GET",
65499
+ revalidate: 60,
65500
+ tags: ["site-{siteId}", "entry-subroute"],
65501
+ auth: "public",
65502
+ responseKind: "json"
65503
+ },
65504
+ resolveEventOccurrence: {
65505
+ path: "/public/sites/{siteId}/events/occurrences/resolve",
65506
+ method: "GET",
65507
+ revalidate: 60,
65508
+ tags: ["riverbank:site:{siteId}:public-events", "event-occurrence"],
65509
+ auth: "public",
65510
+ responseKind: "json"
65511
+ },
65512
+ checkRedirect: {
65513
+ path: "/public/content/redirect",
65514
+ method: "GET",
65515
+ revalidate: 86400,
65516
+ tags: ["redirect"],
65517
+ auth: "public",
65518
+ responseKind: "json"
65519
+ },
65520
+ getRoutableContent: {
65521
+ path: "/sites/{siteId}/routable-content",
65522
+ method: "GET",
65523
+ revalidate: 60,
65524
+ tags: ["riverbank:site:{siteId}:routable-content"],
65525
+ auth: "user",
65526
+ responseKind: "json"
65527
+ },
65528
+ getPublicRoutableContent: {
65529
+ path: "/public/sites/{siteId}/routable-content",
65530
+ method: "GET",
65531
+ revalidate: 60,
65532
+ tags: ["riverbank:site:{siteId}:routable-content"],
65533
+ auth: "public",
65534
+ responseKind: "json"
65535
+ },
65536
+ getPublicSitemapRoutes: {
65537
+ path: "/public/sites/{siteId}/sitemap",
65538
+ method: "GET",
65539
+ revalidate: 60,
65540
+ tags: ["riverbank:site:{siteId}:routable-content", "riverbank:site:{siteId}:settings"],
65541
+ auth: "public",
65542
+ responseKind: "json"
65543
+ }
65544
+ });
65545
+
65546
+ // src/client/runtimeCachePolicy.ts
65547
+ var DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION = 1;
65548
+ var DEFAULT_STALE_TTL_SEC = 24 * 60 * 60;
65549
+ var DEFAULT_MEMORY_TTL_SEC = 60;
65550
+ var RUNTIME_CACHE_DURABILITY_OVERRIDES = {
65551
+ getSite: {
65552
+ kind: "durable-public-stale",
65553
+ staleTtlSec: DEFAULT_STALE_TTL_SEC
65554
+ },
65555
+ getContentByPath: {
65556
+ kind: "durable-public-stale",
65557
+ staleTtlSec: DEFAULT_STALE_TTL_SEC
65558
+ },
65559
+ listPublishedEntries: {
65560
+ kind: "memory-only",
65561
+ reason: "durable_rollout_pending"
65562
+ },
65563
+ getPublishedEntryPreview: {
65564
+ kind: "memory-only",
65565
+ reason: "durable_rollout_pending"
65566
+ },
65567
+ getPublicFormById: {
65568
+ kind: "memory-only",
65569
+ reason: "durable_rollout_pending"
65570
+ },
65571
+ listPublicForms: {
65572
+ kind: "memory-only",
65573
+ reason: "durable_rollout_pending"
65574
+ },
65575
+ getPublicBookingServices: {
65576
+ kind: "live-only",
65577
+ reason: "safety_sensitive_booking"
65578
+ },
65579
+ getPublicChallenge: {
65580
+ kind: "live-only",
65581
+ reason: "challenge_endpoint"
65582
+ },
65583
+ listPublicEvents: {
65584
+ kind: "memory-only",
65585
+ reason: "durable_rollout_pending"
65586
+ },
65587
+ batchBlockLoaders: {
65588
+ kind: "live-only",
65589
+ reason: "opaque_batch_loader"
65590
+ },
65591
+ listPublicCourses: {
65592
+ kind: "memory-only",
65593
+ reason: "durable_rollout_pending"
65594
+ },
65595
+ listPublicTeamMembers: {
65596
+ kind: "memory-only",
65597
+ reason: "durable_rollout_pending"
65598
+ },
65599
+ listPublicProducts: {
65600
+ kind: "memory-only",
65601
+ reason: "durable_rollout_pending"
65602
+ },
65603
+ listPublicPasses: {
65604
+ kind: "live-only",
65605
+ reason: "safety_sensitive_booking"
65606
+ },
65607
+ listPublicMemberships: {
65608
+ kind: "live-only",
65609
+ reason: "safety_sensitive_booking"
65610
+ },
65611
+ resolveEntrySubroute: {
65612
+ kind: "memory-only",
65613
+ reason: "durable_rollout_pending"
65614
+ },
65615
+ resolveEventOccurrence: {
65616
+ kind: "memory-only",
65617
+ reason: "durable_rollout_pending"
65618
+ },
65619
+ checkRedirect: {
65620
+ kind: "memory-only",
65621
+ reason: "durable_rollout_pending"
65622
+ },
65623
+ getRoutableContent: {
65624
+ kind: "live-only",
65625
+ reason: "auth_required"
65626
+ },
65627
+ getPublicRoutableContent: {
65628
+ kind: "memory-only",
65629
+ reason: "durable_rollout_pending"
65630
+ },
65631
+ getPublicSitemapRoutes: {
65632
+ kind: "memory-only",
65633
+ reason: "durable_rollout_pending"
65634
+ }
65635
+ };
65636
+ var PUBLIC_ENDPOINT_NAME_SET = new Set(PUBLIC_ENDPOINT_NAMES2);
65637
+ function isPublicEndpointName(endpoint) {
65638
+ return PUBLIC_ENDPOINT_NAME_SET.has(endpoint);
65639
+ }
65640
+ function isTruthyParam(value) {
65641
+ return value === true || value === "true" || value === 1 || value === "1";
65642
+ }
65643
+ function isPreviewRequest(endpoint, params) {
65644
+ if (endpoint === "getContentByPath") {
65645
+ return isTruthyParam(params.preview);
65646
+ }
65647
+ if (endpoint === "listPublishedEntries" || endpoint === "resolveEntrySubroute" || endpoint === "resolveEventOccurrence") {
65648
+ return params.stage === "preview";
65649
+ }
65650
+ return false;
65651
+ }
65652
+ function getEndpointFreshTtlSec(endpoint) {
65653
+ return API_ENDPOINTS2[endpoint].revalidate ?? DEFAULT_MEMORY_TTL_SEC;
65654
+ }
65655
+ function assertNever5(value) {
65656
+ throw new Error(`Unhandled runtime cache policy override: ${String(value)}`);
65657
+ }
65658
+ function resolveKnownEndpointPolicy(endpoint, params) {
65659
+ if (isPreviewRequest(endpoint, params)) {
65660
+ return { kind: "live-only", endpoint, reason: "preview_request" };
65661
+ }
65662
+ if (endpoint === "getSite" && isTruthyParam(params.force)) {
65663
+ return { kind: "live-only", endpoint, reason: "force_refresh" };
65664
+ }
65665
+ const override = RUNTIME_CACHE_DURABILITY_OVERRIDES[endpoint];
65666
+ if (override.kind === "live-only") {
65667
+ return { kind: "live-only", endpoint, reason: override.reason };
65668
+ }
65669
+ const endpointDefinition = API_ENDPOINTS2[endpoint];
65670
+ if (endpointDefinition.method !== "GET") {
65671
+ return { kind: "live-only", endpoint, reason: "non_get_request" };
65672
+ }
65673
+ if (endpointDefinition.auth === "user") {
65674
+ return { kind: "live-only", endpoint, reason: "auth_required" };
65675
+ }
65676
+ switch (override.kind) {
65677
+ case "durable-public-stale":
65678
+ return {
65679
+ kind: "durable-public-stale",
65680
+ endpoint,
65681
+ freshTtlSec: getEndpointFreshTtlSec(endpoint),
65682
+ staleTtlSec: override.staleTtlSec
65683
+ };
65684
+ case "memory-only":
65685
+ return {
65686
+ kind: "memory-only",
65687
+ endpoint,
65688
+ freshTtlSec: getEndpointFreshTtlSec(endpoint),
65689
+ reason: override.reason
65690
+ };
65691
+ default:
65692
+ return assertNever5(override);
65693
+ }
65694
+ }
65695
+ function resolveRuntimeCachePolicy(input) {
65696
+ if (input.method && input.method.toUpperCase() !== "GET") {
65697
+ return {
65698
+ kind: "live-only",
65699
+ endpoint: input.endpoint,
65700
+ reason: "non_get_request"
65701
+ };
65702
+ }
65703
+ if (!isPublicEndpointName(input.endpoint)) {
65704
+ return {
65705
+ kind: "live-only",
65706
+ endpoint: input.endpoint,
65707
+ reason: "unknown_endpoint"
65708
+ };
65709
+ }
65710
+ return resolveKnownEndpointPolicy(input.endpoint, input.params ?? {});
65711
+ }
65712
+ function toNonEmptyString(value) {
65713
+ if (value === null || value === void 0) return null;
65714
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
65715
+ return null;
65716
+ }
65717
+ const normalized = String(value).trim();
65718
+ return normalized.length > 0 ? normalized : null;
65719
+ }
65720
+ function normalizeRuntimePublicPath(value) {
65721
+ const raw = toNonEmptyString(value) ?? "/";
65722
+ const withoutQuery = raw.split(/[?#]/, 1)[0] ?? "/";
65723
+ const withLeadingSlash = withoutQuery.startsWith("/") ? withoutQuery : `/${withoutQuery}`;
65724
+ const collapsed = withLeadingSlash.replace(/\/{2,}/g, "/");
65725
+ const withoutTrailingSlash = collapsed.length > 1 ? collapsed.replace(/\/+$/g, "") : collapsed;
65726
+ return withoutTrailingSlash || "/";
65727
+ }
65728
+ function normalizeRuntimeHostname(value) {
65729
+ const trimmed = value.trim().toLowerCase();
65730
+ const url = /^[a-z][a-z0-9+.-]*:\/\//.test(trimmed) ? new URL(trimmed) : new URL(`http://${trimmed}`);
65731
+ return url.hostname.replace(/\.$/, "");
65732
+ }
65733
+ function normalizeScalar(value) {
65734
+ return value.trim().toLowerCase();
65735
+ }
65736
+ function encodeKeyPart(key, value) {
65737
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
65738
+ }
65739
+ function unsafeAsPublishedRuntimeCacheKey(value) {
65740
+ return value;
65741
+ }
65742
+ function buildPublishedRuntimeCacheKey(endpoint, normalizedParams) {
65743
+ const encodedParams = Object.entries(normalizedParams).sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => encodeKeyPart(key, value)).join(":");
65744
+ return unsafeAsPublishedRuntimeCacheKey(
65745
+ `published-runtime:v1:${endpoint}:${encodedParams}`
65746
+ );
65747
+ }
65748
+ function selectSiteRuntimeIdentity(params) {
65749
+ const slug = toNonEmptyString(params.slug);
65750
+ if (slug !== null) return { slug: normalizeScalar(slug) };
65751
+ const domain = toNonEmptyString(params.domain);
65752
+ if (domain !== null) return { domain: normalizeRuntimeHostname(domain) };
65753
+ const id = toNonEmptyString(params.id);
65754
+ if (id !== null) return { id: normalizeScalar(id) };
65755
+ return null;
65756
+ }
65757
+ function deriveGetSiteKey(params) {
65758
+ const identity = selectSiteRuntimeIdentity(params);
65759
+ if (identity === null) {
65760
+ return {
65761
+ ok: false,
65762
+ error: {
65763
+ kind: "missing_site_identity",
65764
+ acceptedParams: ["slug", "domain", "id"]
65765
+ }
65766
+ };
65767
+ }
65768
+ const normalizedParams = {
65769
+ ...identity,
65770
+ currentPath: normalizeRuntimePublicPath(params.currentPath)
65771
+ };
65772
+ return {
65773
+ ok: true,
65774
+ endpoint: "getSite",
65775
+ key: buildPublishedRuntimeCacheKey("getSite", normalizedParams),
65776
+ normalizedParams
65777
+ };
65778
+ }
65779
+ function deriveGetContentByPathKey(params) {
65780
+ const siteId = toNonEmptyString(params.siteId);
65781
+ if (siteId === null) {
65782
+ return {
65783
+ ok: false,
65784
+ error: {
65785
+ kind: "missing_required_param",
65786
+ endpoint: "getContentByPath",
65787
+ param: "siteId"
65788
+ }
65789
+ };
65790
+ }
65791
+ const normalizedParams = {
65792
+ siteId: normalizeScalar(siteId),
65793
+ path: normalizeRuntimePublicPath(params.path)
65794
+ };
65795
+ return {
65796
+ ok: true,
65797
+ endpoint: "getContentByPath",
65798
+ key: buildPublishedRuntimeCacheKey("getContentByPath", normalizedParams),
65799
+ normalizedParams
65800
+ };
65801
+ }
65802
+ var DURABLE_RUNTIME_CACHE_KEY_DERIVERS = {
65803
+ getSite: deriveGetSiteKey,
65804
+ getContentByPath: deriveGetContentByPathKey
65805
+ };
65806
+ function derivePublishedRuntimeCacheKey(input) {
65807
+ const policy = resolveRuntimeCachePolicy({
65808
+ endpoint: input.endpoint,
65809
+ method: "GET",
65810
+ params: input.params
65811
+ });
65812
+ if (policy.kind !== "durable-public-stale") {
65813
+ return {
65814
+ ok: false,
65815
+ error: { kind: "not_durable_eligible", policy }
65816
+ };
65817
+ }
65818
+ switch (input.endpoint) {
65819
+ case "getSite":
65820
+ return DURABLE_RUNTIME_CACHE_KEY_DERIVERS.getSite(input.params);
65821
+ case "getContentByPath":
65822
+ return DURABLE_RUNTIME_CACHE_KEY_DERIVERS.getContentByPath(input.params);
65823
+ }
65824
+ }
65825
+
65016
65826
  // src/client/resilience.ts
65017
65827
  var DEFAULT_RETRY_CONFIG2 = {
65018
65828
  maxAttempts: 3,
@@ -65322,12 +66132,57 @@ setSdkVersion(SDK_VERSION);
65322
66132
  var DEFAULT_BROWSER_TIMEOUT_MS = 5e3;
65323
66133
  var DEFAULT_SERVER_TIMEOUT_MS = 8e3;
65324
66134
  var MAX_GET_ENTRIES_BY_IDENTIFIERS_REFS = 50;
66135
+ function isDurableRuntimeCacheTier(cacheTier) {
66136
+ return cacheTier === "durable-fresh" || cacheTier === "durable-stale";
66137
+ }
66138
+ function isDegradedResilienceStatus(source, details) {
66139
+ return source === "stale" || source === "error" || isDurableRuntimeCacheTier(details.cacheTier) && details.error !== void 0;
66140
+ }
65325
66141
  function generateRequestId2() {
65326
66142
  return `req-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
65327
66143
  }
65328
66144
  function toRecord(value) {
65329
66145
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
65330
66146
  }
66147
+ function getRuntimePayloadSiteId(value) {
66148
+ const site = toRecord(value).site;
66149
+ if (!site || typeof site !== "object" || Array.isArray(site)) {
66150
+ return null;
66151
+ }
66152
+ const id = site.id;
66153
+ return typeof id === "string" && id.trim().length > 0 ? id : null;
66154
+ }
66155
+ function getRiverbankErrorInfo(error) {
66156
+ if (error instanceof RiverbankApiError) {
66157
+ return { code: error.code, message: error.message, status: error.status };
66158
+ }
66159
+ if (error instanceof Error) {
66160
+ return { message: error.message };
66161
+ }
66162
+ return { message: String(error) };
66163
+ }
66164
+ function planPublishedRuntimeCache(input) {
66165
+ const policy = resolveRuntimeCachePolicy({
66166
+ endpoint: input.endpoint,
66167
+ method: "GET",
66168
+ params: input.params
66169
+ });
66170
+ if (policy.kind !== "durable-public-stale") {
66171
+ return null;
66172
+ }
66173
+ const keyResult = derivePublishedRuntimeCacheKey(input);
66174
+ if (!keyResult.ok) {
66175
+ return null;
66176
+ }
66177
+ return {
66178
+ cacheKey: keyResult.key,
66179
+ endpoint: keyResult.endpoint,
66180
+ normalizedParams: keyResult.normalizedParams,
66181
+ freshTtlSec: policy.freshTtlSec,
66182
+ staleTtlSec: policy.staleTtlSec,
66183
+ siteId: input.siteId ?? null
66184
+ };
66185
+ }
65331
66186
  function normalizeEntryIdentifierRefs(identifiers) {
65332
66187
  const trimmed = identifiers.map((identifier) => identifier.trim()).filter((identifier) => identifier.length > 0);
65333
66188
  if (trimmed.length === 0) {
@@ -65561,6 +66416,8 @@ function createRiverbankClient(config2) {
65561
66416
  source,
65562
66417
  isPreview: details.isPreview,
65563
66418
  cacheKey: details.cacheKey,
66419
+ cacheTier: details.cacheTier,
66420
+ durableCache: details.durableCache,
65564
66421
  error: details.error,
65565
66422
  staleAgeSec: details.staleAgeSec,
65566
66423
  prebuildAgeSec: details.prebuildAgeSec,
@@ -65570,7 +66427,7 @@ function createRiverbankClient(config2) {
65570
66427
  };
65571
66428
  lastStatus = status;
65572
66429
  config2.resilience?.onStatusChange?.(status);
65573
- const nowDegraded = source === "stale" || source === "error";
66430
+ const nowDegraded = isDegradedResilienceStatus(source, details);
65574
66431
  if (nowDegraded !== isDegraded) {
65575
66432
  isDegraded = nowDegraded;
65576
66433
  config2.resilience?.onDegradedMode?.(nowDegraded, status);
@@ -65580,6 +66437,80 @@ function createRiverbankClient(config2) {
65580
66437
  resilience: status
65581
66438
  };
65582
66439
  }
66440
+ async function tryPublishedRuntimeCacheFallback(plan, statusDetails, errorInfo) {
66441
+ const reader = config2.publishedRuntimeCache?.read;
66442
+ if (!plan || !reader) {
66443
+ return null;
66444
+ }
66445
+ try {
66446
+ const result = await reader({
66447
+ cacheKey: plan.cacheKey,
66448
+ endpoint: plan.endpoint,
66449
+ payloadSchemaVersion: DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION
66450
+ });
66451
+ if (result.kind === "miss") {
66452
+ return {
66453
+ kind: "miss",
66454
+ diagnostic: {
66455
+ outcome: "miss",
66456
+ reason: result.reason
66457
+ }
66458
+ };
66459
+ }
66460
+ if (result.kind === "error") {
66461
+ return {
66462
+ kind: "error",
66463
+ diagnostic: {
66464
+ outcome: "error",
66465
+ error: result.error
66466
+ }
66467
+ };
66468
+ }
66469
+ return {
66470
+ kind: "hit",
66471
+ result: emitStatus(
66472
+ result.freshness === "fresh" ? "cache" : "stale",
66473
+ result.payload,
66474
+ statusDetails({
66475
+ error: errorInfo,
66476
+ staleAgeSec: result.staleAgeSec,
66477
+ cacheTier: result.freshness === "fresh" ? "durable-fresh" : "durable-stale"
66478
+ })
66479
+ )
66480
+ };
66481
+ } catch (error) {
66482
+ return {
66483
+ kind: "error",
66484
+ diagnostic: {
66485
+ outcome: "error",
66486
+ error: {
66487
+ kind: "adapter_exception",
66488
+ message: error instanceof Error ? error.message : String(error)
66489
+ }
66490
+ }
66491
+ };
66492
+ }
66493
+ }
66494
+ async function writePublishedRuntimeCache(plan, payload) {
66495
+ const writer = config2.publishedRuntimeCache?.write;
66496
+ if (!plan || !writer) {
66497
+ return;
66498
+ }
66499
+ try {
66500
+ await writer({
66501
+ cacheKey: plan.cacheKey,
66502
+ endpoint: plan.endpoint,
66503
+ normalizedParams: plan.normalizedParams,
66504
+ payload,
66505
+ siteId: plan.siteId ?? getRuntimePayloadSiteId(payload),
66506
+ freshTtlSec: plan.freshTtlSec,
66507
+ staleTtlSec: plan.staleTtlSec,
66508
+ payloadSchemaVersion: DEFAULT_PUBLISHED_RUNTIME_CACHE_PAYLOAD_SCHEMA_VERSION,
66509
+ writeReason: "live_success"
66510
+ });
66511
+ } catch {
66512
+ }
66513
+ }
65583
66514
  async function resilientFetch(cacheKey, fetcher, options) {
65584
66515
  const requestId = generateRequestId2();
65585
66516
  const startTime = Date.now();
@@ -65595,7 +66526,11 @@ function createRiverbankClient(config2) {
65595
66526
  if (cacheEnabled && !options.force) {
65596
66527
  const fresh = cache.getFresh(cacheKey);
65597
66528
  if (fresh !== null) {
65598
- return emitStatus("cache", fresh, statusDetails());
66529
+ return emitStatus(
66530
+ "cache",
66531
+ fresh,
66532
+ statusDetails({ cacheTier: "memory-fresh" })
66533
+ );
65599
66534
  }
65600
66535
  }
65601
66536
  if (resilienceEnabled && circuitBreaker.isOpen()) {
@@ -65607,6 +66542,7 @@ function createRiverbankClient(config2) {
65607
66542
  stale.value,
65608
66543
  statusDetails({
65609
66544
  staleAgeSec: stale.staleAgeSec,
66545
+ cacheTier: "memory-stale",
65610
66546
  error: {
65611
66547
  code: "circuit_open",
65612
66548
  message: "Circuit breaker is open"
@@ -65615,6 +66551,15 @@ function createRiverbankClient(config2) {
65615
66551
  );
65616
66552
  }
65617
66553
  }
66554
+ const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(
66555
+ options.publishedRuntimeCache,
66556
+ statusDetails,
66557
+ { code: "circuit_open", message: "Circuit breaker is open" }
66558
+ ) : null;
66559
+ const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
66560
+ if (durableFallback?.kind === "hit") {
66561
+ return durableFallback.result;
66562
+ }
65618
66563
  if (allowFallbacks && !isPreview && options.prebuildFallback) {
65619
66564
  const prebuildResult = options.prebuildFallback();
65620
66565
  if (prebuildResult) {
@@ -65623,6 +66568,8 @@ function createRiverbankClient(config2) {
65623
66568
  prebuildResult.data,
65624
66569
  statusDetails({
65625
66570
  prebuildAgeSec: prebuildResult.prebuildAgeSec,
66571
+ cacheTier: "prebuild",
66572
+ durableCache,
65626
66573
  error: {
65627
66574
  code: "circuit_open",
65628
66575
  message: "Circuit breaker is open"
@@ -65636,6 +66583,7 @@ function createRiverbankClient(config2) {
65636
66583
  "error",
65637
66584
  null,
65638
66585
  statusDetails({
66586
+ durableCache,
65639
66587
  error: { code: "circuit_open", message: "Circuit breaker is open" }
65640
66588
  })
65641
66589
  );
@@ -65676,6 +66624,9 @@ function createRiverbankClient(config2) {
65676
66624
  if (cacheEnabled) {
65677
66625
  cache.set(cacheKey, data);
65678
66626
  }
66627
+ if (allowFallbacks && !isPreview) {
66628
+ await writePublishedRuntimeCache(options.publishedRuntimeCache, data);
66629
+ }
65679
66630
  return emitStatus("live", data, statusDetails());
65680
66631
  } catch (error) {
65681
66632
  if (resilienceEnabled && error instanceof Error) {
@@ -65684,44 +66635,47 @@ function createRiverbankClient(config2) {
65684
66635
  if (allowFallbacks && !isPreview && staleIfError && cacheEnabled) {
65685
66636
  const stale = cache.getStale(cacheKey);
65686
66637
  if (stale) {
65687
- const errorInfo2 = error instanceof RiverbankApiError ? {
65688
- code: error.code,
65689
- message: error.message,
65690
- status: error.status
65691
- } : { message: error.message };
66638
+ const errorInfo2 = getRiverbankErrorInfo(error);
65692
66639
  return emitStatus(
65693
66640
  "stale",
65694
66641
  stale.value,
65695
66642
  statusDetails({
65696
66643
  staleAgeSec: stale.staleAgeSec,
66644
+ cacheTier: "memory-stale",
65697
66645
  error: errorInfo2
65698
66646
  })
65699
66647
  );
65700
66648
  }
65701
66649
  }
66650
+ const errorInfo = getRiverbankErrorInfo(error);
66651
+ const durableFallback = allowFallbacks && !isPreview ? await tryPublishedRuntimeCacheFallback(
66652
+ options.publishedRuntimeCache,
66653
+ statusDetails,
66654
+ errorInfo
66655
+ ) : null;
66656
+ const durableCache = durableFallback?.kind === "miss" || durableFallback?.kind === "error" ? durableFallback.diagnostic : void 0;
66657
+ if (durableFallback?.kind === "hit") {
66658
+ return durableFallback.result;
66659
+ }
65702
66660
  if (allowFallbacks && !isPreview && options.prebuildFallback) {
65703
66661
  const prebuildResult = options.prebuildFallback();
65704
66662
  if (prebuildResult) {
65705
- const errorInfo2 = error instanceof RiverbankApiError ? {
65706
- code: error.code,
65707
- message: error.message,
65708
- status: error.status
65709
- } : { message: error.message };
65710
66663
  return emitStatus(
65711
66664
  "prebuild",
65712
66665
  prebuildResult.data,
65713
66666
  statusDetails({
65714
66667
  prebuildAgeSec: prebuildResult.prebuildAgeSec,
65715
- error: errorInfo2
66668
+ cacheTier: "prebuild",
66669
+ durableCache,
66670
+ error: errorInfo
65716
66671
  })
65717
66672
  );
65718
66673
  }
65719
66674
  }
65720
- const errorInfo = error instanceof RiverbankApiError ? { code: error.code, message: error.message, status: error.status } : { message: error.message };
65721
66675
  const failure = emitStatus(
65722
66676
  "error",
65723
66677
  null,
65724
- statusDetails({ error: errorInfo })
66678
+ statusDetails({ error: errorInfo, durableCache })
65725
66679
  );
65726
66680
  throw attachResilienceStatusToError(error, failure.resilience);
65727
66681
  }
@@ -65771,8 +66725,12 @@ function createRiverbankClient(config2) {
65771
66725
  );
65772
66726
  }
65773
66727
  const siteIdentifier = slug || domain || id;
65774
- const cacheKey = `site:${siteIdentifier ?? "unknown"}:${currentPath ?? ""}`;
65775
66728
  const siteId = id || slug || domain;
66729
+ const publishedRuntimeCache = planPublishedRuntimeCache({
66730
+ endpoint: "getSite",
66731
+ params: { slug, domain, id, currentPath, force }
66732
+ });
66733
+ const cacheKey = publishedRuntimeCache?.cacheKey ?? `site:${siteIdentifier ?? "unknown"}:${currentPath ?? ""}`;
65776
66734
  return resilientFetch(
65777
66735
  cacheKey,
65778
66736
  async (sig) => {
@@ -65795,13 +66753,19 @@ function createRiverbankClient(config2) {
65795
66753
  {
65796
66754
  signal,
65797
66755
  force,
66756
+ publishedRuntimeCache,
65798
66757
  prebuildFallback: prebuildLoader && siteId ? () => prebuildLoader.loadSite(siteId) : void 0
65799
66758
  }
65800
66759
  );
65801
66760
  }
65802
66761
  async function getPageWithResilienceInternal(params) {
65803
66762
  const { siteId, path: path27, preview = false, signal } = params;
65804
- const cacheKey = `page:${siteId}:${path27}:${preview}`;
66763
+ const publishedRuntimeCache = planPublishedRuntimeCache({
66764
+ endpoint: "getContentByPath",
66765
+ params: { siteId, path: path27, preview },
66766
+ siteId
66767
+ });
66768
+ const cacheKey = publishedRuntimeCache?.cacheKey ?? `page:${siteId}:${path27}:${preview}`;
65805
66769
  return resilientFetch(
65806
66770
  cacheKey,
65807
66771
  async (sig) => {
@@ -65814,6 +66778,7 @@ function createRiverbankClient(config2) {
65814
66778
  {
65815
66779
  preview,
65816
66780
  signal,
66781
+ publishedRuntimeCache,
65817
66782
  // Prebuild fallback only for published pages (not preview)
65818
66783
  prebuildFallback: prebuildLoader && !preview ? () => prebuildLoader.loadPage(siteId, path27) : void 0
65819
66784
  }
@@ -66010,10 +66975,16 @@ function createRiverbankClient(config2) {
66010
66975
  limit,
66011
66976
  from,
66012
66977
  to,
66978
+ afterStartsAt,
66979
+ afterId,
66013
66980
  stage,
66014
66981
  categoryIds,
66015
66982
  venueId,
66983
+ staffMemberId,
66016
66984
  kind,
66985
+ eventSurface,
66986
+ eventPresets,
66987
+ scheduleScope,
66017
66988
  entryId,
66018
66989
  seriesId,
66019
66990
  includeOccurrenceId,
@@ -66022,7 +66993,7 @@ function createRiverbankClient(config2) {
66022
66993
  if (!siteId) {
66023
66994
  throw new Error("listPublicEvents() requires siteId");
66024
66995
  }
66025
- const cacheKey = `public-events:${siteId}:${limit ?? ""}:${from ?? ""}:${to ?? ""}:${stage ?? ""}:${categoryIds ?? ""}:${venueId ?? ""}:${kind ?? ""}:${entryId ?? ""}:${seriesId ?? ""}:${includeOccurrenceId ?? ""}`;
66996
+ const cacheKey = `public-events:${siteId}:${limit ?? ""}:${from ?? ""}:${to ?? ""}:${afterStartsAt ?? ""}:${afterId ?? ""}:${stage ?? ""}:${categoryIds ?? ""}:${venueId ?? ""}:${staffMemberId ?? ""}:${kind ?? ""}:${eventSurface ?? ""}:${eventPresets ?? ""}:${scheduleScope ?? ""}:${entryId ?? ""}:${seriesId ?? ""}:${includeOccurrenceId ?? ""}`;
66026
66997
  return resilientFetchData(
66027
66998
  cacheKey,
66028
66999
  async (sig) => {
@@ -66031,10 +67002,16 @@ function createRiverbankClient(config2) {
66031
67002
  ...typeof limit === "number" && { limit: String(limit) },
66032
67003
  ...from && { from },
66033
67004
  ...to && { to },
67005
+ ...afterStartsAt && { afterStartsAt },
67006
+ ...afterId && { afterId },
66034
67007
  ...stage && { stage },
66035
67008
  ...categoryIds && { categoryIds },
66036
67009
  ...venueId && { venueId },
67010
+ ...staffMemberId && { staffMemberId },
66037
67011
  ...kind && { kind },
67012
+ ...eventSurface && { eventSurface },
67013
+ ...eventPresets && { eventPresets },
67014
+ ...scheduleScope && { scheduleScope },
66038
67015
  ...entryId && { entryId },
66039
67016
  ...seriesId && { seriesId },
66040
67017
  ...includeOccurrenceId && { includeOccurrenceId }
@@ -66061,6 +67038,9 @@ function createRiverbankClient(config2) {
66061
67038
  venueId,
66062
67039
  staffMemberId,
66063
67040
  kind,
67041
+ eventSurface,
67042
+ eventPresets,
67043
+ scheduleScope,
66064
67044
  entryId,
66065
67045
  seriesId,
66066
67046
  includeOccurrenceId,
@@ -66069,7 +67049,7 @@ function createRiverbankClient(config2) {
66069
67049
  if (!siteId) {
66070
67050
  throw new Error("getPublicEventDetails() requires siteId");
66071
67051
  }
66072
- const cacheKey = `public-event-details:${siteId}:${limit ?? ""}:${from ?? ""}:${to ?? ""}:${afterStartsAt ?? ""}:${afterId ?? ""}:${stage ?? ""}:${categoryIds ?? ""}:${venueId ?? ""}:${staffMemberId ?? ""}:${kind ?? ""}:${entryId ?? ""}:${seriesId ?? ""}:${includeOccurrenceId ?? ""}`;
67052
+ const cacheKey = `public-event-details:${siteId}:${limit ?? ""}:${from ?? ""}:${to ?? ""}:${afterStartsAt ?? ""}:${afterId ?? ""}:${stage ?? ""}:${categoryIds ?? ""}:${venueId ?? ""}:${staffMemberId ?? ""}:${kind ?? ""}:${eventSurface ?? ""}:${eventPresets ?? ""}:${scheduleScope ?? ""}:${entryId ?? ""}:${seriesId ?? ""}:${includeOccurrenceId ?? ""}`;
66073
67053
  return resilientFetchData(
66074
67054
  cacheKey,
66075
67055
  async (sig) => {
@@ -66092,6 +67072,9 @@ function createRiverbankClient(config2) {
66092
67072
  ...venueId && { venueId },
66093
67073
  ...staffMemberId && { staffMemberId },
66094
67074
  ...kind && { kind },
67075
+ ...eventSurface && { eventSurface },
67076
+ ...eventPresets && { eventPresets },
67077
+ ...scheduleScope && { scheduleScope },
66095
67078
  ...entryId && { entryId },
66096
67079
  ...seriesId && { seriesId },
66097
67080
  ...includeOccurrenceId && { includeOccurrenceId }
@@ -69582,11 +70565,12 @@ Your task: Analyze the HTML/JSX markup and identify ALL pieces of content that s
69582
70565
 
69583
70566
  1. **Use richText for formatted lists and multi-line content:**
69584
70567
  - Opening hours \u2192 single richText with formatted list (not 6 separate text fields)
69585
- - Address with line breaks \u2192 single richText (not address1, address2, city, postcode)
70568
+ - Address with line breaks \u2192 single richText with hard line breaks / Shift+Enter between lines (not address1, address2, city, postcode)
69586
70569
  - Feature lists, specs, ingredients \u2192 richText with bullet list
69587
70570
 
69588
- RichText supports: paragraphs, bold, italic, bullet lists, numbered lists, links.
70571
+ RichText supports: paragraphs, hard line breaks, bold, italic, bullet lists, numbered lists, links.
69589
70572
  The CMS editor can format content naturally without rigid field structure.
70573
+ For line-oriented content like addresses, opening hours, and contact details, keep one logical paragraph and use hard line breaks between lines. In the CMS editor, authors create those line breaks with Shift+Enter; Enter creates a new paragraph.
69590
70574
 
69591
70575
  2. **Use repeaters only when items need individual editing/reordering:**
69592
70576
  - Testimonials with avatar + name + quote \u2192 repeater (each item is distinct)
@@ -69598,8 +70582,8 @@ Your task: Analyze the HTML/JSX markup and identify ALL pieces of content that s
69598
70582
  \u274C socialInstagram, socialFacebook, socialTwitter (proliferating similar fields)
69599
70583
  \u274C address1, address2, city, state, zip (5 fields for one address)
69600
70584
 
69601
- \u2705 openingHours: single richText field with formatted content
69602
- \u2705 address: single richText field with line breaks
70585
+ \u2705 openingHours: single richText field with formatted content / hard line breaks
70586
+ \u2705 address: single richText field with hard line breaks (Shift+Enter in the editor)
69603
70587
  \u2705 socialLinks: repeater with { platform, url } IF user needs to add/remove links
69604
70588
 
69605
70589
  ## Field Type Rules
@@ -69629,7 +70613,7 @@ Your task: Analyze the HTML/JSX markup and identify ALL pieces of content that s
69629
70613
 
69630
70614
  ### When to use each type:
69631
70615
  - Single value \u2192 simple field (text, richText, media, link)
69632
- - Formatted list where structure is static \u2192 richText (opening hours, address)
70616
+ - Formatted list where structure is static \u2192 richText (opening hours, address; use hard line breaks / Shift+Enter for line-oriented text)
69633
70617
  - List where items can be added/removed/reordered \u2192 repeater
69634
70618
  - Related fields that belong together \u2192 group
69635
70619
 
@@ -70041,43 +71025,8 @@ Do NOT include [data-block=...] in selectors - we add that automatically.
70041
71025
  var DEFAULT_MANIFEST_MODEL = process.env.RIVERBANK_MANIFEST_MODEL || "gpt-5-mini";
70042
71026
 
70043
71027
  // src/manifest/three-pass-converter.ts
70044
- function parseInlineMarkdown(text2) {
70045
- const out = [];
70046
- const pushText = (value, marks) => {
70047
- if (!value) return;
70048
- out.push(
70049
- marks && marks.length > 0 ? { type: "text", text: value, marks } : { type: "text", text: value }
70050
- );
70051
- };
70052
- let rest = text2;
70053
- while (rest.length > 0) {
70054
- const start = rest.indexOf("**");
70055
- if (start === -1) {
70056
- pushText(rest);
70057
- break;
70058
- }
70059
- const end = rest.indexOf("**", start + 2);
70060
- if (end === -1) {
70061
- pushText(rest);
70062
- break;
70063
- }
70064
- pushText(rest.slice(0, start));
70065
- pushText(rest.slice(start + 2, end), [{ type: "bold" }]);
70066
- rest = rest.slice(end + 2);
70067
- }
70068
- return out;
70069
- }
70070
71028
  function stringToTipTapDoc(text2) {
70071
- const normalized = text2.replace(/\r\n/g, "\n").trim();
70072
- if (!normalized) return { type: "doc", content: [] };
70073
- const paragraphs = normalized.split(/\n{2,}/).map((p) => p.trim()).filter(Boolean);
70074
- return {
70075
- type: "doc",
70076
- content: paragraphs.map((p) => {
70077
- const inline2 = parseInlineMarkdown(p);
70078
- return inline2.length > 0 ? { type: "paragraph", content: inline2 } : { type: "paragraph" };
70079
- })
70080
- };
71029
+ return createRichTextDocFromMarkdown(text2);
70081
71030
  }
70082
71031
  function coerceRichTextDefaultValue(value) {
70083
71032
  if (value === null || value === void 0) {