@riverbankcms/sdk 0.70.0 → 0.70.3

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 (61) hide show
  1. package/README.md +29 -0
  2. package/dist/_dts/ai/src/contracts/commandExposure.d.ts +8 -0
  3. package/dist/_dts/ai/src/contracts/feedback.d.ts +55 -0
  4. package/dist/_dts/ai/src/contracts/proposals.d.ts +34764 -0
  5. package/dist/_dts/ai/src/contracts.d.ts +5 -0
  6. package/dist/_dts/ai/src/designer/rfc6902.d.ts +16 -0
  7. package/dist/_dts/ai/src/designer/themePatch.d.ts +50 -0
  8. package/dist/_dts/api/src/aiPlayground.d.ts +1 -1
  9. package/dist/_dts/api/src/appointmentSetup.d.ts +19 -0
  10. package/dist/_dts/api/src/availability.d.ts +84 -2
  11. package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +10 -1
  12. package/dist/_dts/api/src/contentRuntime.d.ts +1 -0
  13. package/dist/_dts/api/src/endpoints.d.ts +29 -0
  14. package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +4 -0
  15. package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +29 -1
  16. package/dist/_dts/api/src/types.d.ts +1 -1
  17. package/dist/_dts/billing/src/components/index.d.ts +41 -0
  18. package/dist/_dts/db/src/generated/supabase/database.types.d.ts +219 -0
  19. package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
  20. package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -1
  21. package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +2 -1
  22. package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -1
  23. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -1
  24. package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +1 -0
  25. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +8 -0
  26. package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +1 -0
  27. package/dist/_dts/sdk/src/cli/commands/delete.d.ts +3 -0
  28. package/dist/_dts/sdk/src/cli/commands/style.d.ts +37 -0
  29. package/dist/_dts/sdk/src/cli/helpers.d.ts +8 -33
  30. package/dist/_dts/sdk/src/cli/site-commands/oneOffCommands.d.ts +81 -0
  31. package/dist/_dts/sdk/src/client/management/index.d.ts +2 -1
  32. package/dist/_dts/sdk/src/client/management/theme.d.ts +3 -1
  33. package/dist/_dts/sdk/src/client/management/types.d.ts +23 -0
  34. package/dist/_dts/sdk/src/components.d.ts +2 -1
  35. package/dist/_dts/sdk/src/next/types.d.ts +4 -2
  36. package/dist/_dts/sdk/src/public-api/contracts.d.ts +1 -0
  37. package/dist/_dts/sdk/src/rendering/index.d.ts +2 -1
  38. package/dist/_dts/sdk/src/rendering/overrideResolution.d.ts +10 -0
  39. package/dist/_dts/sdk/src/rendering/overrides.d.ts +12 -0
  40. package/dist/_dts/sdk/src/version.d.ts +1 -1
  41. package/dist/_dts/site-commands/src/commands.d.ts +25 -7
  42. package/dist/_dts/site-commands/src/metadata.d.ts +2 -2
  43. package/dist/cli/index.mjs +844 -108
  44. package/dist/client/client.mjs +256 -202
  45. package/dist/client/hooks.mjs +55 -1
  46. package/dist/client/rendering.mjs +25467 -25403
  47. package/dist/preview-next/before-render.mjs +39 -0
  48. package/dist/preview-next/client/runtime.mjs +160 -39
  49. package/dist/preview-next/middleware.mjs +39 -0
  50. package/dist/server/components.mjs +65 -1
  51. package/dist/server/config-validation.mjs +55 -1
  52. package/dist/server/config.mjs +55 -1
  53. package/dist/server/data.mjs +55 -1
  54. package/dist/server/index.mjs +40 -1
  55. package/dist/server/next.mjs +137 -4
  56. package/dist/server/prebuild.mjs +1 -1
  57. package/dist/server/rendering/server.mjs +55 -1
  58. package/dist/server/rendering.mjs +65 -1
  59. package/dist/server/routing.mjs +56 -2
  60. package/dist/server/server.mjs +56 -2
  61. package/package.json +4 -3
@@ -1231,6 +1231,24 @@ var ENDPOINT_DEFINITIONS = {
1231
1231
  "server:internal_error"
1232
1232
  ]
1233
1233
  },
1234
+ setServiceSpecificAvailability: {
1235
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
1236
+ method: "PUT",
1237
+ auth: "user",
1238
+ responseKind: "json",
1239
+ errors: [
1240
+ "validation:invalid_input",
1241
+ "resource:not_found",
1242
+ "server:internal_error"
1243
+ ]
1244
+ },
1245
+ deleteServiceSpecificAvailability: {
1246
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
1247
+ method: "DELETE",
1248
+ auth: "user",
1249
+ responseKind: "json",
1250
+ errors: ["resource:not_found", "server:internal_error"]
1251
+ },
1234
1252
  listBlackouts: {
1235
1253
  path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
1236
1254
  method: "GET",
@@ -2866,6 +2884,20 @@ var ENDPOINT_DEFINITIONS = {
2866
2884
  auth: "user",
2867
2885
  responseKind: "json"
2868
2886
  },
2887
+ applySiteStyleSelection: {
2888
+ path: "/sites/{siteId}/theme/style-selection/apply",
2889
+ method: "POST",
2890
+ tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
2891
+ auth: "user",
2892
+ errors: [
2893
+ "validation:invalid_input",
2894
+ "auth:forbidden",
2895
+ "resource:not_found",
2896
+ "resource:conflict",
2897
+ "server:internal_error"
2898
+ ],
2899
+ responseKind: "json"
2900
+ },
2869
2901
  saveSiteChromeLookSelection: {
2870
2902
  path: "/sites/{siteId}/theme/site-chrome-look",
2871
2903
  method: "POST",
@@ -5609,6 +5641,13 @@ var ENDPOINT_DEFINITIONS = {
5609
5641
  auth: "service",
5610
5642
  responseKind: "json"
5611
5643
  },
5644
+ sdkApplySiteStyleSelection: {
5645
+ path: "/sdk/{siteId}/theme/style-selection/apply",
5646
+ method: "POST",
5647
+ auth: "service",
5648
+ responseKind: "json",
5649
+ errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
5650
+ },
5612
5651
  sdkUpsertFooter: {
5613
5652
  path: "/sdk/{siteId}/footer",
5614
5653
  method: "POST",
@@ -1399,6 +1399,24 @@ var init_endpoints = __esm({
1399
1399
  "server:internal_error"
1400
1400
  ]
1401
1401
  },
1402
+ setServiceSpecificAvailability: {
1403
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
1404
+ method: "PUT",
1405
+ auth: "user",
1406
+ responseKind: "json",
1407
+ errors: [
1408
+ "validation:invalid_input",
1409
+ "resource:not_found",
1410
+ "server:internal_error"
1411
+ ]
1412
+ },
1413
+ deleteServiceSpecificAvailability: {
1414
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
1415
+ method: "DELETE",
1416
+ auth: "user",
1417
+ responseKind: "json",
1418
+ errors: ["resource:not_found", "server:internal_error"]
1419
+ },
1402
1420
  listBlackouts: {
1403
1421
  path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
1404
1422
  method: "GET",
@@ -3034,6 +3052,20 @@ var init_endpoints = __esm({
3034
3052
  auth: "user",
3035
3053
  responseKind: "json"
3036
3054
  },
3055
+ applySiteStyleSelection: {
3056
+ path: "/sites/{siteId}/theme/style-selection/apply",
3057
+ method: "POST",
3058
+ tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
3059
+ auth: "user",
3060
+ errors: [
3061
+ "validation:invalid_input",
3062
+ "auth:forbidden",
3063
+ "resource:not_found",
3064
+ "resource:conflict",
3065
+ "server:internal_error"
3066
+ ],
3067
+ responseKind: "json"
3068
+ },
3037
3069
  saveSiteChromeLookSelection: {
3038
3070
  path: "/sites/{siteId}/theme/site-chrome-look",
3039
3071
  method: "POST",
@@ -5777,6 +5809,13 @@ var init_endpoints = __esm({
5777
5809
  auth: "service",
5778
5810
  responseKind: "json"
5779
5811
  },
5812
+ sdkApplySiteStyleSelection: {
5813
+ path: "/sdk/{siteId}/theme/style-selection/apply",
5814
+ method: "POST",
5815
+ auth: "service",
5816
+ responseKind: "json",
5817
+ errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
5818
+ },
5780
5819
  sdkUpsertFooter: {
5781
5820
  path: "/sdk/{siteId}/footer",
5782
5821
  method: "POST",
@@ -94503,6 +94542,13 @@ function RichTextToolbar({
94503
94542
  }
94504
94543
  return toolbarEl;
94505
94544
  }
94545
+ function shouldHandleRichTextActivationKey(container, target) {
94546
+ if (!(target instanceof HTMLElement)) return true;
94547
+ if (target === container) return true;
94548
+ return !target.closest(
94549
+ '[contenteditable="true"], .ProseMirror, input, textarea, select, button, a[href]'
94550
+ );
94551
+ }
94506
94552
  function RichTextEditorSurface({
94507
94553
  editor,
94508
94554
  config,
@@ -94526,7 +94572,7 @@ function RichTextEditorSurface({
94526
94572
  role: "button",
94527
94573
  tabIndex: 0,
94528
94574
  onKeyDown: (event) => {
94529
- if (event.key === "Enter" || event.key === " ") {
94575
+ if ((event.key === "Enter" || event.key === " ") && shouldHandleRichTextActivationKey(event.currentTarget, event.target)) {
94530
94576
  event.preventDefault();
94531
94577
  onClick();
94532
94578
  }
@@ -186527,7 +186573,7 @@ var init_bookingVerticals = __esm({
186527
186573
  );
186528
186574
  }
186529
186575
  });
186530
- var APPOINTMENT_SETUP_MAX_MINUTES, appointmentSetupRefSchema, appointmentSetupVenueChoiceSchema, appointmentSetupPaymentDraftSchema, appointmentSetupServiceAssignmentDraftSchema, appointmentSetupServiceDraftSchema, appointmentSetupPractitionerDraftSchema, appointmentSetupWeeklyWindowDraftSchema, appointmentSetupAvailabilityDraftSchema, APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX, APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX, appointmentSetupBookingNoticeSchema;
186576
+ var APPOINTMENT_SETUP_MAX_MINUTES, appointmentSetupRefSchema, appointmentSetupVenueChoiceSchema, appointmentSetupPaymentDraftSchema, appointmentSetupServiceAssignmentDraftSchema, appointmentSetupServiceDraftSchema, appointmentSetupPractitionerDraftSchema, appointmentSetupWeeklyWindowDraftSchema, appointmentSetupStartTimePolicyDraftSchema, appointmentSetupAvailabilityDraftSchema, APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX, APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX, appointmentSetupBookingNoticeSchema;
186531
186577
  var init_appointmentSetup = __esm({
186532
186578
  "../api/src/appointmentSetup.ts"() {
186533
186579
  init_envelope();
@@ -186606,11 +186652,26 @@ var init_appointmentSetup = __esm({
186606
186652
  startTime: z.string(),
186607
186653
  endTime: z.string()
186608
186654
  });
186655
+ appointmentSetupStartTimePolicyDraftSchema = z.discriminatedUnion("kind", [
186656
+ z.object({ kind: z.literal("automatic_spacing") }),
186657
+ z.object({
186658
+ kind: z.literal("regular_interval"),
186659
+ intervalMinutes: z.union([
186660
+ z.literal(10),
186661
+ z.literal(15),
186662
+ z.literal(20),
186663
+ z.literal(30),
186664
+ z.literal(45),
186665
+ z.literal(60)
186666
+ ])
186667
+ })
186668
+ ]);
186609
186669
  appointmentSetupAvailabilityDraftSchema = z.object({
186610
186670
  kind: z.literal("weekly_windows"),
186611
186671
  resourceRef: appointmentSetupRefSchema,
186612
186672
  serviceRef: appointmentSetupRefSchema.nullable(),
186613
- windows: z.array(appointmentSetupWeeklyWindowDraftSchema)
186673
+ windows: z.array(appointmentSetupWeeklyWindowDraftSchema),
186674
+ startTimePolicy: appointmentSetupStartTimePolicyDraftSchema.optional()
186614
186675
  });
186615
186676
  APPOINTMENT_DEFAULT_MIN_LEAD_MINUTES_MAX = 28 * 24 * 60;
186616
186677
  APPOINTMENT_DEFAULT_MAX_BOOKING_NOTICE_MINUTES_MAX = 10 * 365 * 24 * 60;
@@ -207537,7 +207598,7 @@ function appendPaletteOverrideScopeNotice(notices, input) {
207537
207598
  return [...notices, { kind }];
207538
207599
  }
207539
207600
  function selectionSnapshotsEqual(a2, b3) {
207540
- return a2.siteStyleId === b3.siteStyleId && a2.selectionUpdatedAt === b3.selectionUpdatedAt && a2.headerLookId === b3.headerLookId && a2.footerLookId === b3.footerLookId && a2.buttonPersonalityId === b3.buttonPersonalityId && a2.paletteVariantId === b3.paletteVariantId && paletteOverridesEqual(a2.paletteOverrides, b3.paletteOverrides);
207601
+ return a2.siteStyleId === b3.siteStyleId && a2.selectionVersion === b3.selectionVersion && a2.selectionUpdatedAt === b3.selectionUpdatedAt && a2.headerLookId === b3.headerLookId && a2.footerLookId === b3.footerLookId && a2.buttonPersonalityId === b3.buttonPersonalityId && a2.paletteVariantId === b3.paletteVariantId && paletteOverridesEqual(a2.paletteOverrides, b3.paletteOverrides);
207541
207602
  }
207542
207603
  function paletteOverridesEqual(a2, b3) {
207543
207604
  if (a2 === b3) return true;
@@ -207706,6 +207767,24 @@ var init_siteChromeLookRows = __esm({
207706
207767
  }
207707
207768
  });
207708
207769
 
207770
+ // ../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts
207771
+ function buildApplySiteStyleSelectionBody(input) {
207772
+ return {
207773
+ siteStyleId: input.previewed.siteStyleId,
207774
+ buttonPersonalityId: input.previewed.buttonPersonalityId,
207775
+ paletteVariantId: input.previewed.paletteVariantId,
207776
+ paletteOverrides: input.previewed.paletteOverrides,
207777
+ headerLookId: input.previewed.headerLookId,
207778
+ footerLookId: input.previewed.footerLookId,
207779
+ baseSelectionVersion: input.base.selectionVersion,
207780
+ selectionId: input.selectionId ?? null
207781
+ };
207782
+ }
207783
+ var init_styleConfiguratorApplyPayload = __esm({
207784
+ "../preview-next/src/client/preview/styleConfiguratorApplyPayload.ts"() {
207785
+ }
207786
+ });
207787
+
207709
207788
  // ../preview-next/src/client/preview/styleConfiguratorSnapshot.ts
207710
207789
  function resolveStyleConfiguratorInitialSnapshot(input) {
207711
207790
  const themeSiteStyleId = siteStyleIdFromTheme(input.theme);
@@ -207725,6 +207804,7 @@ function resolveStyleConfiguratorInitialSnapshot(input) {
207725
207804
  const paletteChanged = input.initialSelections.paletteVariantId !== null && compiled.resolvedSelections.paletteVariantId !== input.initialSelections.paletteVariantId;
207726
207805
  return {
207727
207806
  siteStyleId: siteStyle.id,
207807
+ selectionVersion: input.initialSelections.selectionVersion ?? 0,
207728
207808
  selectionUpdatedAt: input.initialSelections.selectionUpdatedAt ?? null,
207729
207809
  headerLookId: compiled.requestedSelections.headerLookId,
207730
207810
  footerLookId: compiled.requestedSelections.footerLookId,
@@ -207742,8 +207822,8 @@ function StyleConfigurator({
207742
207822
  siteId,
207743
207823
  apiClient,
207744
207824
  theme,
207745
- themeId,
207746
207825
  selectionId,
207826
+ selectionVersion = null,
207747
207827
  selectionUpdatedAt,
207748
207828
  initialSelections,
207749
207829
  headerSelectionContext,
@@ -207759,12 +207839,13 @@ function StyleConfigurator({
207759
207839
  theme,
207760
207840
  initialSelections: {
207761
207841
  ...initialSelections,
207842
+ selectionVersion: initialSelections.selectionVersion ?? selectionVersion ?? 0,
207762
207843
  selectionUpdatedAt: initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
207763
207844
  },
207764
207845
  headerSelectionContext,
207765
207846
  footerSelectionContext
207766
207847
  }),
207767
- [footerSelectionContext, headerSelectionContext, theme, initialSelections, selectionUpdatedAt]
207848
+ [footerSelectionContext, headerSelectionContext, theme, initialSelections, selectionUpdatedAt, selectionVersion]
207768
207849
  );
207769
207850
  const [state, setState2] = useState(
207770
207851
  () => baseSnapshot ? createStyleConfiguratorState(baseSnapshot) : null
@@ -207904,23 +207985,22 @@ function StyleConfigurator({
207904
207985
  headerSelectionContext,
207905
207986
  footerSelectionContext
207906
207987
  });
207907
- const body = {
207908
- theme: compiled.theme,
207909
- themeId: themeId ?? null,
207910
- selectionId: selectionId ?? null,
207911
- buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
207912
- paletteVariantId: compiled.resolvedSelections.paletteVariantId,
207913
- paletteOverrides: previewed.paletteOverrides,
207914
- headerLookId: previewed.headerLookId,
207915
- footerLookId: previewed.footerLookId
207916
- };
207988
+ const body = buildApplySiteStyleSelectionBody({
207989
+ base: live.base,
207990
+ previewed: {
207991
+ ...previewed,
207992
+ buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
207993
+ paletteVariantId: compiled.resolvedSelections.paletteVariantId
207994
+ },
207995
+ selectionId
207996
+ });
207917
207997
  await runnerRef.current.run({
207918
207998
  optimistic: () => {
207919
207999
  setState2((current) => current ? markApplySaving(current) : current);
207920
208000
  },
207921
208001
  network: async () => {
207922
208002
  const response = await apiClient({
207923
- endpoint: "saveSiteTheme",
208003
+ endpoint: "applySiteStyleSelection",
207924
208004
  params: { siteId },
207925
208005
  body
207926
208006
  });
@@ -207930,12 +208010,13 @@ function StyleConfigurator({
207930
208010
  setState2(
207931
208011
  (current) => current ? markApplySaved(current, {
207932
208012
  siteStyleId: previewed.siteStyleId,
208013
+ selectionVersion: saved.selectionVersion,
207933
208014
  selectionUpdatedAt: saved.selectionUpdatedAt ?? previewed.selectionUpdatedAt ?? null,
207934
- buttonPersonalityId: saved.buttonPersonalityId ?? compiled.resolvedSelections.buttonPersonalityId,
207935
- paletteVariantId: saved.paletteVariantId ?? compiled.resolvedSelections.paletteVariantId,
208015
+ buttonPersonalityId: saved.buttonPersonalityId,
208016
+ paletteVariantId: saved.paletteVariantId,
207936
208017
  paletteOverrides: saved.paletteOverrides ?? null,
207937
- headerLookId: saved.headerLookId ?? previewed.headerLookId,
207938
- footerLookId: saved.footerLookId ?? previewed.footerLookId
208018
+ headerLookId: saved.headerLookId,
208019
+ footerLookId: saved.footerLookId
207939
208020
  }) : current
207940
208021
  );
207941
208022
  startRefreshTransition(() => {
@@ -207943,7 +208024,13 @@ function StyleConfigurator({
207943
208024
  });
207944
208025
  },
207945
208026
  onError: (error) => {
207946
- const message2 = error instanceof Error ? error.message : "Unable to apply your selection.";
208027
+ const applyError = classifyStyleApplyError(error);
208028
+ if (applyError.kind === "stale") {
208029
+ startRefreshTransition(() => {
208030
+ router.refresh();
208031
+ });
208032
+ }
208033
+ const message2 = applyError.message;
207947
208034
  setState2((current) => current ? markApplyFailed(current, message2) : current);
207948
208035
  }
207949
208036
  });
@@ -207954,8 +208041,7 @@ function StyleConfigurator({
207954
208041
  router,
207955
208042
  selectionId,
207956
208043
  siteId,
207957
- startRefreshTransition,
207958
- themeId
208044
+ startRefreshTransition
207959
208045
  ]);
207960
208046
  if (!state || !baseSnapshot) {
207961
208047
  return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Loading design controls..." });
@@ -208307,6 +208393,25 @@ function PickerOption({ selected, label, description, swatch, onSelect, disabled
208307
208393
  }
208308
208394
  ) });
208309
208395
  }
208396
+ function classifyStyleApplyError(error) {
208397
+ if (isRecord16(error)) {
208398
+ const status = error.status;
208399
+ const code = error.code;
208400
+ if (status === 409 || code === "resource:conflict") {
208401
+ return {
208402
+ kind: "stale",
208403
+ message: "This design changed elsewhere. Refreshing the latest version now."
208404
+ };
208405
+ }
208406
+ }
208407
+ return {
208408
+ kind: "other",
208409
+ message: error instanceof Error ? error.message : "Unable to apply your selection."
208410
+ };
208411
+ }
208412
+ function isRecord16(value) {
208413
+ return typeof value === "object" && value !== null;
208414
+ }
208310
208415
  function WarningNotice({ warnings, onDismiss }) {
208311
208416
  return /* @__PURE__ */ jsxs("div", { role: "status", className: "rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning-foreground", children: [
208312
208417
  /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: warnings.map((warning, index2) => /* @__PURE__ */ jsx("li", { children: describeWarning(warning) }, `${warning.kind}-${index2}`)) }),
@@ -208355,6 +208460,7 @@ var init_StyleConfigurator = __esm({
208355
208460
  init_siteStyleAccess();
208356
208461
  init_themeOverlay();
208357
208462
  init_siteChromeLookRows();
208463
+ init_styleConfiguratorApplyPayload();
208358
208464
  init_styleConfiguratorSnapshot();
208359
208465
  }
208360
208466
  });
@@ -208609,6 +208715,7 @@ function PreviewEditorSidebar({
208609
208715
  theme,
208610
208716
  themeId = null,
208611
208717
  themeSelectionId = null,
208718
+ themeSelectionVersion = null,
208612
208719
  themeSelectionUpdatedAt = null,
208613
208720
  themeSelectionButtonPersonalityId = null,
208614
208721
  themeSelectionPaletteVariantId = null,
@@ -208764,8 +208871,10 @@ function PreviewEditorSidebar({
208764
208871
  theme,
208765
208872
  themeId,
208766
208873
  selectionId: themeSelectionId,
208874
+ selectionVersion: themeSelectionVersion,
208767
208875
  selectionUpdatedAt: themeSelectionUpdatedAt,
208768
208876
  initialSelections: {
208877
+ selectionVersion: themeSelectionVersion,
208769
208878
  selectionUpdatedAt: themeSelectionUpdatedAt,
208770
208879
  buttonPersonalityId: themeSelectionButtonPersonalityId,
208771
208880
  paletteVariantId: themeSelectionPaletteVariantId,
@@ -211021,25 +211130,25 @@ var INITIAL_ONBOARDING_CONFIRMATION_STATE = {
211021
211130
  resendFeedback: null,
211022
211131
  statusLoadFailed: false
211023
211132
  };
211024
- function isRecord16(value) {
211133
+ function isRecord17(value) {
211025
211134
  return value !== null && typeof value === "object";
211026
211135
  }
211027
211136
  function getErrorMessageFromEnvelope(payload, fallback2) {
211028
- const error = isRecord16(payload) ? payload.error : null;
211029
- const message2 = isRecord16(error) ? error.message : null;
211137
+ const error = isRecord17(payload) ? payload.error : null;
211138
+ const message2 = isRecord17(error) ? error.message : null;
211030
211139
  return typeof message2 === "string" && message2.trim().length > 0 ? message2 : fallback2;
211031
211140
  }
211032
211141
  function isLaunchReadiness(value) {
211033
- return isRecord16(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord16(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
211142
+ return isRecord17(value) && Array.isArray(value.requirements) && typeof value.pendingRequiredCount === "number" && typeof value.pendingRecommendedCount === "number" && typeof value.pendingOptionalCount === "number" && isRecord17(value.goLiveDecision) && (value.goLiveDecision.kind === "allowed" || value.goLiveDecision.kind === "blocked");
211034
211143
  }
211035
211144
  function isOnboardingPreviewStatusResponse(value) {
211036
- return isRecord16(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
211145
+ return isRecord17(value) && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
211037
211146
  }
211038
211147
  function isResendOnboardingPreviewConfirmationResponse(value) {
211039
- return isRecord16(value) && (value.result === "resent" || value.result === "already_confirmed") && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
211148
+ return isRecord17(value) && (value.result === "resent" || value.result === "already_confirmed") && typeof value.dashboardUnlocked === "boolean" && typeof value.requiresEmailConfirmation === "boolean" && isLaunchReadiness(value.launchReadiness);
211040
211149
  }
211041
211150
  function getSuccessData(payload, isData) {
211042
- if (!isRecord16(payload) || payload.success !== true || !isData(payload.data)) {
211151
+ if (!isRecord17(payload) || payload.success !== true || !isData(payload.data)) {
211043
211152
  return null;
211044
211153
  }
211045
211154
  return payload.data;
@@ -211626,6 +211735,7 @@ function SiteChromeCustomizeProvider({
211626
211735
  theme,
211627
211736
  themeId = null,
211628
211737
  selectionId = null,
211738
+ selectionVersion = null,
211629
211739
  selectionUpdatedAt = null,
211630
211740
  initialSelections,
211631
211741
  headerSelectionContext,
@@ -211638,17 +211748,19 @@ function SiteChromeCustomizeProvider({
211638
211748
  const latestSelectionUpdatedAtRef = useRef(
211639
211749
  initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
211640
211750
  );
211751
+ const initialSelectionVersion = initialSelections.selectionVersion ?? selectionVersion ?? 0;
211641
211752
  const baseSnapshot = useMemo(
211642
211753
  () => resolveStyleConfiguratorInitialSnapshot({
211643
211754
  theme,
211644
211755
  initialSelections: {
211645
211756
  ...initialSelections,
211757
+ selectionVersion: initialSelectionVersion,
211646
211758
  selectionUpdatedAt: initialSelections.selectionUpdatedAt ?? selectionUpdatedAt ?? null
211647
211759
  },
211648
211760
  headerSelectionContext,
211649
211761
  footerSelectionContext
211650
211762
  }),
211651
- [footerSelectionContext, headerSelectionContext, initialSelections, selectionUpdatedAt, theme]
211763
+ [footerSelectionContext, headerSelectionContext, initialSelectionVersion, initialSelections, selectionUpdatedAt, theme]
211652
211764
  );
211653
211765
  const [state, setState2] = useState(
211654
211766
  () => baseSnapshot ? createStyleConfiguratorState(baseSnapshot) : null
@@ -211770,6 +211882,7 @@ function SiteChromeCustomizeProvider({
211770
211882
  latestSelectionUpdatedAtRef.current = saved.selectionUpdatedAt ?? latestSelectionUpdatedAtRef.current;
211771
211883
  const persisted = {
211772
211884
  siteStyleId: nextSnapshot.siteStyleId,
211885
+ selectionVersion: nextSnapshot.selectionVersion,
211773
211886
  selectionUpdatedAt: saved.selectionUpdatedAt ?? nextSnapshot.selectionUpdatedAt ?? null,
211774
211887
  buttonPersonalityId: compiled.resolvedSelections.buttonPersonalityId,
211775
211888
  paletteVariantId: compiled.resolvedSelections.paletteVariantId,
@@ -211862,6 +211975,7 @@ function PreviewShellLayout({
211862
211975
  bearerToken,
211863
211976
  themeId = null,
211864
211977
  themeSelectionId = null,
211978
+ themeSelectionVersion = null,
211865
211979
  themeSelectionUpdatedAt = null,
211866
211980
  themeSelectionButtonPersonalityId = null,
211867
211981
  themeSelectionPaletteVariantId = null,
@@ -212159,6 +212273,7 @@ function PreviewShellLayout({
212159
212273
  bearerToken,
212160
212274
  themeId,
212161
212275
  themeSelectionId,
212276
+ themeSelectionVersion,
212162
212277
  themeSelectionUpdatedAt,
212163
212278
  themeSelectionButtonPersonalityId,
212164
212279
  themeSelectionPaletteVariantId,
@@ -212217,8 +212332,10 @@ function PreviewShellLayout({
212217
212332
  theme,
212218
212333
  themeId,
212219
212334
  selectionId: themeSelectionId,
212335
+ selectionVersion: themeSelectionVersion,
212220
212336
  selectionUpdatedAt: themeSelectionUpdatedAt,
212221
212337
  initialSelections: {
212338
+ selectionVersion: themeSelectionVersion,
212222
212339
  selectionUpdatedAt: themeSelectionUpdatedAt,
212223
212340
  buttonPersonalityId: themeSelectionButtonPersonalityId,
212224
212341
  paletteVariantId: themeSelectionPaletteVariantId,
@@ -212245,8 +212362,10 @@ function PreviewShellLayout({
212245
212362
  theme,
212246
212363
  themeId,
212247
212364
  selectionId: themeSelectionId,
212365
+ selectionVersion: themeSelectionVersion,
212248
212366
  selectionUpdatedAt: themeSelectionUpdatedAt,
212249
212367
  initialSelections: {
212368
+ selectionVersion: themeSelectionVersion,
212250
212369
  selectionUpdatedAt: themeSelectionUpdatedAt,
212251
212370
  buttonPersonalityId: themeSelectionButtonPersonalityId,
212252
212371
  paletteVariantId: themeSelectionPaletteVariantId,
@@ -212313,6 +212432,7 @@ function PreviewShell({
212313
212432
  theme,
212314
212433
  themeId = null,
212315
212434
  themeSelectionId = null,
212435
+ themeSelectionVersion = null,
212316
212436
  themeSelectionUpdatedAt = null,
212317
212437
  themeSelectionButtonPersonalityId = null,
212318
212438
  themeSelectionPaletteVariantId = null,
@@ -212396,6 +212516,7 @@ function PreviewShell({
212396
212516
  bearerToken: previewToken,
212397
212517
  themeId,
212398
212518
  themeSelectionId,
212519
+ themeSelectionVersion,
212399
212520
  themeSelectionUpdatedAt,
212400
212521
  themeSelectionButtonPersonalityId,
212401
212522
  themeSelectionPaletteVariantId,
@@ -212448,11 +212569,11 @@ init_src3();
212448
212569
  // ../preview-next/src/client/utils/path.ts
212449
212570
  var PATH_SEPARATOR_REGEX3 = /\./g;
212450
212571
  var BRACKET_ACCESS_REGEX3 = /\[([^\]]+)\]/g;
212451
- function isRecord17(value) {
212572
+ function isRecord18(value) {
212452
212573
  return typeof value === "object" && value !== null && !Array.isArray(value);
212453
212574
  }
212454
212575
  function isPathContainer2(value) {
212455
- return Array.isArray(value) || isRecord17(value);
212576
+ return Array.isArray(value) || isRecord18(value);
212456
212577
  }
212457
212578
  function createPathContainer2(nextIsIndex) {
212458
212579
  return nextIsIndex ? [] : {};
@@ -212652,14 +212773,14 @@ function applyRuntimeContentDecorationProjection(block, content, projection) {
212652
212773
  const blockId = designBlockIdFromBlockItem(block);
212653
212774
  const fields3 = blockId ? projection.fieldsByBlockId.get(blockId) : void 0;
212654
212775
  return applyCompiledRuntimeFieldsToContent(
212655
- isRecord18(content) ? content : {},
212776
+ isRecord19(content) ? content : {},
212656
212777
  fields3
212657
212778
  );
212658
212779
  }
212659
212780
  function designBlockIdFromBlockItem(block) {
212660
212781
  return typeof block.id === "string" && block.id.length > 0 ? asDesignBlockId(block.id) : null;
212661
212782
  }
212662
- function isRecord18(value) {
212783
+ function isRecord19(value) {
212663
212784
  return typeof value === "object" && value !== null && !Array.isArray(value);
212664
212785
  }
212665
212786
 
@@ -212865,7 +212986,7 @@ init_lucide_react();
212865
212986
  var previewCustomizePillButtonClassName = "rounded-full bg-black/80 px-2.5 py-1 text-xs text-white shadow hover:bg-black";
212866
212987
 
212867
212988
  // ../preview-next/src/client/blocks/isRecord.ts
212868
- function isRecord19(value) {
212989
+ function isRecord20(value) {
212869
212990
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
212870
212991
  }
212871
212992
 
@@ -213353,7 +213474,7 @@ function findFirstFieldPath(fields3, data, prefix) {
213353
213474
  }
213354
213475
  const nextPrefix = [...prefix, field.id];
213355
213476
  if (field.type === "group") {
213356
- const groupValue = isRecord19(data) ? data[field.id] : void 0;
213477
+ const groupValue = isRecord20(data) ? data[field.id] : void 0;
213357
213478
  const nested = findFirstFieldPath(
213358
213479
  field.schema.fields,
213359
213480
  groupValue,
@@ -213363,7 +213484,7 @@ function findFirstFieldPath(fields3, data, prefix) {
213363
213484
  continue;
213364
213485
  }
213365
213486
  if (field.type === "repeater" && field.schema) {
213366
- const collection = isRecord19(data) ? data[field.id] : void 0;
213487
+ const collection = isRecord20(data) ? data[field.id] : void 0;
213367
213488
  const items = Array.isArray(collection) ? collection : [];
213368
213489
  if (items.length > 0) {
213369
213490
  const firstItem = items[0];
@@ -1237,6 +1237,24 @@ var ENDPOINT_DEFINITIONS = {
1237
1237
  "server:internal_error"
1238
1238
  ]
1239
1239
  },
1240
+ setServiceSpecificAvailability: {
1241
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability",
1242
+ method: "PUT",
1243
+ auth: "user",
1244
+ responseKind: "json",
1245
+ errors: [
1246
+ "validation:invalid_input",
1247
+ "resource:not_found",
1248
+ "server:internal_error"
1249
+ ]
1250
+ },
1251
+ deleteServiceSpecificAvailability: {
1252
+ path: "/sites/{siteId}/bookings/resources/{resourceId}/service-availability/{scheduleId}",
1253
+ method: "DELETE",
1254
+ auth: "user",
1255
+ responseKind: "json",
1256
+ errors: ["resource:not_found", "server:internal_error"]
1257
+ },
1240
1258
  listBlackouts: {
1241
1259
  path: "/sites/{siteId}/bookings/resources/{resourceId}/blackouts",
1242
1260
  method: "GET",
@@ -2872,6 +2890,20 @@ var ENDPOINT_DEFINITIONS = {
2872
2890
  auth: "user",
2873
2891
  responseKind: "json"
2874
2892
  },
2893
+ applySiteStyleSelection: {
2894
+ path: "/sites/{siteId}/theme/style-selection/apply",
2895
+ method: "POST",
2896
+ tags: [TAG_TEMPLATES.siteCollection, TAG_TEMPLATES.siteTheme],
2897
+ auth: "user",
2898
+ errors: [
2899
+ "validation:invalid_input",
2900
+ "auth:forbidden",
2901
+ "resource:not_found",
2902
+ "resource:conflict",
2903
+ "server:internal_error"
2904
+ ],
2905
+ responseKind: "json"
2906
+ },
2875
2907
  saveSiteChromeLookSelection: {
2876
2908
  path: "/sites/{siteId}/theme/site-chrome-look",
2877
2909
  method: "POST",
@@ -5615,6 +5647,13 @@ var ENDPOINT_DEFINITIONS = {
5615
5647
  auth: "service",
5616
5648
  responseKind: "json"
5617
5649
  },
5650
+ sdkApplySiteStyleSelection: {
5651
+ path: "/sdk/{siteId}/theme/style-selection/apply",
5652
+ method: "POST",
5653
+ auth: "service",
5654
+ responseKind: "json",
5655
+ errors: ["validation:invalid_input", "resource:not_found", "resource:conflict", "server:internal_error"]
5656
+ },
5618
5657
  sdkUpsertFooter: {
5619
5658
  path: "/sdk/{siteId}/footer",
5620
5659
  method: "POST",