@riverbankcms/sdk 0.125.0 → 0.126.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{PreviewEditorSidebar-BezDOtQ7.mjs → PreviewEditorSidebar-DcYJxTgc.mjs} +67 -266
- package/dist/{PreviewEditorUI-CgSqmfo2.mjs → PreviewEditorUI-Ctt1yTJr.mjs} +3 -3
- package/dist/{PreviewQueryProvider-BH-3-jSj.mjs → PreviewQueryProvider-DgFDIwvK.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-Co3AHfj0.mjs → SdkPreviewModeRuntime-CvW1vdQ4.mjs} +27 -27
- package/dist/{SiteChromeCustomizeContext-BHF-KANn.mjs → SiteChromeCustomizeContext-C87qlKWw.mjs} +412 -1301
- package/dist/_dts/ai/src/contracts/proposals.d.ts +1354 -202
- package/dist/_dts/api/src/common/envelope.d.ts +1 -1
- package/dist/_dts/api/src/contentRuntime.d.ts +0 -2
- package/dist/_dts/api/src/endpoints.d.ts +0 -7
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +42 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +11 -9
- package/dist/_dts/api/src/siteOperations.d.ts +18 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +1 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +15 -2
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +182 -19
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +1 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +2 -3
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -2
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +3 -12
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -13
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +8 -100
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +1 -4
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorApplyPayload.d.ts +1 -15
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +11 -21
- package/dist/_dts/sdk/src/cli/commands/event.d.ts +2 -2
- package/dist/_dts/sdk/src/cli/commands/eventOccurrenceSchedule.d.ts +12 -0
- package/dist/_dts/sdk/src/cli/commands/push/pushAllExtras.d.ts +6 -0
- package/dist/_dts/sdk/src/cli/commands/style.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/content/legacyEventScheduleShapeError.d.ts +5 -0
- package/dist/_dts/sdk/src/cli/content/localEventSchedule.d.ts +17 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +5 -10
- package/dist/_dts/sdk/src/cli/migrations/events.d.ts +1 -1
- package/dist/_dts/sdk/src/cli/site-commands/eventScheduleCompiler.d.ts +24 -0
- package/dist/_dts/sdk/src/client/management/http.d.ts +1 -1
- package/dist/_dts/sdk/src/client/management/types.d.ts +3 -28
- package/dist/_dts/sdk/src/config/index.d.ts +1 -1
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +5 -20
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commandContract.d.ts +33 -5
- package/dist/_dts/site-commands/src/commandDomain.d.ts +2 -2
- package/dist/_dts/site-commands/src/commands.d.ts +38 -9
- package/dist/_dts/site-commands/src/siteStyleCommandSchema.d.ts +28 -1
- package/dist/_dts/site-commands/src/siteStyleSelectionSchemaBuilder.d.ts +4 -4
- package/dist/_dts/theme-core/src/palette/concretePalette.d.ts +20 -0
- package/dist/_dts/theme-core/src/palette/curated/index.d.ts +2 -17
- package/dist/_dts/theme-core/src/palette/index.d.ts +1 -6
- package/dist/_dts/theme-core/src/palette/schema.d.ts +39 -0
- package/dist/_dts/theme-core/src/schema.d.ts +38 -26
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +4 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +5 -6
- package/dist/cli/index.mjs +612 -522
- package/dist/cli/init-docs/content/cli-reference.md +6 -3
- package/dist/cli/init-docs/content/content-management.md +24 -13
- package/dist/client/{DiscountCodeDisclosure-CyPpekBp.mjs → DiscountCodeDisclosure-DS0AuFWW.mjs} +1 -1
- package/dist/client/{EventCombined.client-zywit-60.mjs → EventCombined.client-DtMxLr7q.mjs} +2 -2
- package/dist/client/{EventListing.client-J2nLhkKT.mjs → EventListing.client-BdLSRNg1.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CSubXWt6.mjs → LeafletStaticMap-BrpC6vsT.mjs} +1 -1
- package/dist/client/{MagicLinkForm-DDLIfiq9.mjs → MagicLinkForm-Bt3IuLMy.mjs} +1 -1
- package/dist/client/{StepIndicator-DE8EvHIp.mjs → StepIndicator-CBYPFVoy.mjs} +2 -2
- package/dist/client/{accordion-Ct5T5NiA.mjs → accordion-BqqwPJWM.mjs} +1 -1
- package/dist/client/{bookingForm-DMxtLPxw.mjs → bookingForm-SneP3yxC.mjs} +5 -6
- package/dist/client/bookings.mjs +190 -24
- package/dist/client/{carousel--FMqgvob.mjs → carousel-BTIR9L3I.mjs} +1 -1
- package/dist/client/{cart-BKX1bWiU.mjs → cart-bqiqd8SX.mjs} +3 -3
- package/dist/client/{checkout-B_jxi4WW.mjs → checkout-WbTFV5v4.mjs} +3 -3
- package/dist/client/client.mjs +156 -220
- package/dist/client/{courseRegistration-DH4MlkRD.mjs → courseRegistration-BcemLAdN.mjs} +6 -7
- package/dist/client/{eventCalendar-BQILwAcL.mjs → eventCalendar-CsxIw0V_.mjs} +4 -4
- package/dist/client/{eventCombined-DFFW_Vmo.mjs → eventCombined-B6XMoHfa.mjs} +2 -2
- package/dist/client/{eventDetails-B045CTSJ.mjs → eventDetails-BJaoPPfo.mjs} +3 -3
- package/dist/client/{eventListing-BDMYNVzS.mjs → eventListing-DgwdYHRT.mjs} +2 -2
- package/dist/client/{eventRegistration-CQ2-BSnB.mjs → eventRegistration-C0O3folu.mjs} +30 -22
- package/dist/client/{form-DJKuyZgN.mjs → form-Bk9txGFt.mjs} +1 -1
- package/dist/client/{headerSection-DeTjfiDo.mjs → headerSection-yIBt0yTv.mjs} +2 -2
- package/dist/client/hooks.mjs +50 -102
- package/dist/client/{locationMap-i2wDA8gB.mjs → locationMap-C-3KIpv-.mjs} +2 -2
- package/dist/client/{newsletterForm-DKiueauk.mjs → newsletterForm-CzB8g8h2.mjs} +1 -1
- package/dist/client/{pricing-C01J3Epx.mjs → pricing-C1QeDes_.mjs} +1 -1
- package/dist/client/{productDetail-Dfc1sZaX.mjs → productDetail-w7SBp5uc.mjs} +3 -3
- package/dist/client/{productList-BXbvXWTF.mjs → productList-D0tGKHGf.mjs} +3 -3
- package/dist/client/{propsDecoder-CIR5DQ1l.mjs → propsDecoder-Bcin2DB3.mjs} +167 -11
- package/dist/client/rendering/client.mjs +219 -276
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +128 -185
- package/dist/client/{useDiscountCodeUi-Bcyh4508.mjs → scrollToBlock-h-o_STf_.mjs} +18 -2
- package/dist/client/{shop-BbNwPKM-.mjs → shop-BGzmL8O_.mjs} +5 -6
- package/dist/client/{shop-commerce-XO-XMFEt.mjs → shop-commerce-lX8QxjX-.mjs} +4 -4
- package/dist/client/{shop-commerce-store-Byh6OUGK.mjs → shop-commerce-store-CEurARtu.mjs} +1 -1
- package/dist/client/{shopShared-Bbq39mwr.mjs → shopShared-DXxH8xxw.mjs} +2 -2
- package/dist/client/{useEventFilters-C8OOJ3el.mjs → useEventFilters-B591g9vd.mjs} +2 -2
- package/dist/client/{usePolling-CyJVo9kF.mjs → usePolling-BvnChV4m.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +0 -7
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +0 -7
- package/dist/{previewAuthStore-CJX21dGi.mjs → previewAuthStore-Dev9CdG9.mjs} +0 -7
- package/dist/{sdk-runtime-BGhyuE-E.mjs → sdk-runtime-M__i3Jce.mjs} +2 -2
- package/dist/{separator-BFs-Kmv5.mjs → separator-VSlnI9bc.mjs} +1 -1
- package/dist/server/components.mjs +87 -139
- package/dist/server/config-validation.mjs +50 -102
- package/dist/server/config.mjs +50 -102
- package/dist/server/data.mjs +50 -102
- package/dist/server/index.mjs +1 -8
- package/dist/server/next.mjs +91 -150
- package/dist/server/page-converter.mjs +50 -102
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +50 -102
- package/dist/server/rendering.mjs +88 -140
- package/dist/server/routing.mjs +71 -147
- package/dist/server/server.mjs +51 -110
- package/dist/server/theme-bridge.mjs +172 -162
- package/dist/server/theme.mjs +167 -11
- package/package.json +1 -1
- package/dist/_dts/theme-core/src/palette/editorState.d.ts +0 -75
- package/dist/_dts/theme-core/src/palette/libraryModel.d.ts +0 -64
- package/dist/_dts/theme-core/src/palette/persistenceReadSource.d.ts +0 -81
- package/dist/_dts/theme-core/src/palette/resolveSelection.d.ts +0 -75
- package/dist/_dts/theme-core/src/palette/selection.d.ts +0 -74
- package/dist/_dts/theme-core/src/palette/sitePalettePersistence.d.ts +0 -34
- package/dist/client/scrollToBlock-C86BYkyV.mjs +0 -17
package/dist/cli/index.mjs
CHANGED
|
@@ -950,7 +950,7 @@ var init_demo_runtime = __esmMin((() => {}));
|
|
|
950
950
|
var init_collections = __esmMin((() => {}));
|
|
951
951
|
//#endregion
|
|
952
952
|
//#region ../core/src/assert-never.ts
|
|
953
|
-
function assertNever$
|
|
953
|
+
function assertNever$24(value, message = "Unexpected variant") {
|
|
954
954
|
throw new Error(`${message}: ${String(value)}`);
|
|
955
955
|
}
|
|
956
956
|
var init_assert_never = __esmMin((() => {}));
|
|
@@ -1062,7 +1062,7 @@ function formatCoursePriceDisplayLabel(display, options) {
|
|
|
1062
1062
|
case "exact": return `Course (${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
1063
1063
|
case "from": return `Course (From ${formatCurrencyAmount(display.amount, display.currency, options)})`;
|
|
1064
1064
|
case "range": return `Course (${formatCurrencyAmount(display.minAmount, display.currency, options)} - ${formatCurrencyAmount(display.maxAmount, display.currency, options)})`;
|
|
1065
|
-
default: return assertNever$
|
|
1065
|
+
default: return assertNever$24(display);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
/**
|
|
@@ -1082,7 +1082,7 @@ function formatBookingPriceDisplay(display, options = {}) {
|
|
|
1082
1082
|
case "unavailable": return "Pricing unavailable";
|
|
1083
1083
|
case "external": return display.label;
|
|
1084
1084
|
case "course": return formatCoursePriceDisplayLabel(display.display, options);
|
|
1085
|
-
default: return assertNever$
|
|
1085
|
+
default: return assertNever$24(display);
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
1088
|
/** Render an event's price directly from its pricing value. */
|
|
@@ -1161,10 +1161,10 @@ function resolveFlexibleBalanceDueAt(input) {
|
|
|
1161
1161
|
switch (input.dueDateRule.kind) {
|
|
1162
1162
|
case "relative_to_start_date": return subtractDaysFromIso(input.bookingStartAt, input.dueDateRule.daysBeforeStart);
|
|
1163
1163
|
case "fixed_calendar_date": return input.dueDateRule.dueAt;
|
|
1164
|
-
default: return assertNever$
|
|
1164
|
+
default: return assertNever$23(input.dueDateRule);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
|
-
function assertNever$
|
|
1167
|
+
function assertNever$23(value) {
|
|
1168
1168
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
1169
1169
|
}
|
|
1170
1170
|
var init_booking_flexible_balance = __esmMin((() => {
|
|
@@ -1178,7 +1178,7 @@ function isDepositBearingBookingInstalmentPlan(plan) {
|
|
|
1178
1178
|
case "deposit_plus_one_remainder":
|
|
1179
1179
|
case "deposit_plus_scheduled_instalments": return true;
|
|
1180
1180
|
case "equal_scheduled_instalments": return false;
|
|
1181
|
-
default: return assertNever$
|
|
1181
|
+
default: return assertNever$22(plan);
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
function getBookingInstalmentDepositRefundability(plan) {
|
|
@@ -1204,7 +1204,7 @@ function addIntervalPreservingMonthAnchor(isoString, intervalCount, intervalUnit
|
|
|
1204
1204
|
date.setUTCDate(date.getUTCDate() + intervalCount * 7);
|
|
1205
1205
|
return date.toISOString();
|
|
1206
1206
|
case "month": return addMonthsPreservingAnchorDay(date, intervalCount).toISOString();
|
|
1207
|
-
default: return assertNever$
|
|
1207
|
+
default: return assertNever$22(intervalUnit);
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
1210
1210
|
function getBookingInstalmentPlanIntervalCount(plan) {
|
|
@@ -1212,7 +1212,7 @@ function getBookingInstalmentPlanIntervalCount(plan) {
|
|
|
1212
1212
|
case "deposit_plus_one_remainder": return plan.remainderDueCount;
|
|
1213
1213
|
case "deposit_plus_scheduled_instalments":
|
|
1214
1214
|
case "equal_scheduled_instalments": return plan.intervalCount;
|
|
1215
|
-
default: return assertNever$
|
|
1215
|
+
default: return assertNever$22(plan);
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
function omitZeroAmountFutureRows(rows) {
|
|
@@ -1228,7 +1228,7 @@ function addMonthsPreservingAnchorDay(date, intervalCount) {
|
|
|
1228
1228
|
nextMonth.setUTCDate(Math.min(anchorDay, lastDayOfTargetMonth));
|
|
1229
1229
|
return nextMonth;
|
|
1230
1230
|
}
|
|
1231
|
-
function assertNever$
|
|
1231
|
+
function assertNever$22(value) {
|
|
1232
1232
|
throw new Error(`Unexpected value: ${String(value)}`);
|
|
1233
1233
|
}
|
|
1234
1234
|
var init_booking_instalments = __esmMin((() => {}));
|
|
@@ -1472,9 +1472,20 @@ function getLocalScheduleDate(date, timeZone) {
|
|
|
1472
1472
|
day: parts.day
|
|
1473
1473
|
};
|
|
1474
1474
|
}
|
|
1475
|
+
function getLocalScheduleTime(date, timeZone) {
|
|
1476
|
+
const parts = getZonedDateTimeParts(date, getSafeTimeZone(timeZone));
|
|
1477
|
+
return {
|
|
1478
|
+
hour: parts.hour,
|
|
1479
|
+
minute: parts.minute,
|
|
1480
|
+
second: parts.second
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1475
1483
|
function formatLocalScheduleDate(date) {
|
|
1476
1484
|
return formatDateKey$1(date);
|
|
1477
1485
|
}
|
|
1486
|
+
function formatLocalScheduleTime(time) {
|
|
1487
|
+
return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}`;
|
|
1488
|
+
}
|
|
1478
1489
|
function addLocalScheduleDays(date, days) {
|
|
1479
1490
|
const utcDate = new Date(Date.UTC(date.year, date.month - 1, date.day + days, 12, 0, 0));
|
|
1480
1491
|
return {
|
|
@@ -8887,13 +8898,6 @@ const API_ENDPOINTS$1 = {
|
|
|
8887
8898
|
auth: "user",
|
|
8888
8899
|
responseKind: "json"
|
|
8889
8900
|
},
|
|
8890
|
-
listSiteThemePalettes: {
|
|
8891
|
-
path: "/sites/{siteId}/theme/palettes",
|
|
8892
|
-
method: "GET",
|
|
8893
|
-
auth: "user",
|
|
8894
|
-
errors: [],
|
|
8895
|
-
responseKind: "json"
|
|
8896
|
-
},
|
|
8897
8901
|
createSiteFontUploadUrl: {
|
|
8898
8902
|
path: "/sites/{siteId}/fonts/upload-url",
|
|
8899
8903
|
method: "POST",
|
|
@@ -10251,7 +10255,7 @@ function navigationAuthoringLinkToCommandLink(link) {
|
|
|
10251
10255
|
badge: link.badge,
|
|
10252
10256
|
label: link.label
|
|
10253
10257
|
};
|
|
10254
|
-
default: return assertNever$
|
|
10258
|
+
default: return assertNever$24(link);
|
|
10255
10259
|
}
|
|
10256
10260
|
}
|
|
10257
10261
|
function portalLabelsForCommand(labels) {
|
|
@@ -10294,7 +10298,7 @@ function navigationReadLinkToLocalLink(item) {
|
|
|
10294
10298
|
badge: link.badge,
|
|
10295
10299
|
label: link.label
|
|
10296
10300
|
};
|
|
10297
|
-
default: return assertNever$
|
|
10301
|
+
default: return assertNever$24(link);
|
|
10298
10302
|
}
|
|
10299
10303
|
}
|
|
10300
10304
|
function internalNavigationLinkToLocalLink(item) {
|
|
@@ -11379,7 +11383,7 @@ const linkSchema = z$1.union([
|
|
|
11379
11383
|
//#endregion
|
|
11380
11384
|
//#region ../blocks/src/system/node/schema.ts
|
|
11381
11385
|
var transformStepSchema, bindingPathSchema, bindingSchema, repeatSchema, conditionalAuthoringPresenceSchema, conditionSchema, dataScopeSchema, nodePropsSchema, nodeSchema, nodeTreeSchema, NodeSchema, NodeTreeSchema;
|
|
11382
|
-
var init_schema$
|
|
11386
|
+
var init_schema$3 = __esmMin((() => {
|
|
11383
11387
|
transformStepSchema = z$1.object({
|
|
11384
11388
|
id: z$1.string().min(1, "Transform requires an identifier"),
|
|
11385
11389
|
options: z$1.record(z$1.string(), z$1.unknown()).optional()
|
|
@@ -11584,7 +11588,7 @@ var init_validation_constants = __esmMin((() => {
|
|
|
11584
11588
|
//#endregion
|
|
11585
11589
|
//#region ../blocks/src/system/node/index.ts
|
|
11586
11590
|
var init_node = __esmMin((() => {
|
|
11587
|
-
init_schema$
|
|
11591
|
+
init_schema$3();
|
|
11588
11592
|
init_typeBasedLayout();
|
|
11589
11593
|
init_validation_constants();
|
|
11590
11594
|
}));
|
|
@@ -11735,7 +11739,7 @@ function createSdkSelectField(input) {
|
|
|
11735
11739
|
}));
|
|
11736
11740
|
}
|
|
11737
11741
|
var visibilityLevels, MEDIA_KINDS, DISPLAY_MEDIA_KINDS$2, DEFAULT_MEDIA_FIELD_KINDS, PUBLIC_FILE_FIELD_KINDS, siteOptionSources, mediaDeliverySchema, selectOptionSchema, selectSourceSchema, visibleWhenPredicateSchema, visibleWhenSchema, uiSchema, baseFieldSchema, textFieldSchema, richTextFieldSchema, inlineTextFieldSchema, mediaFieldSchema, fileFieldSchema, booleanFieldSchema, dateFieldSchema, timeFieldSchema, dateTimeFieldSchema, slugFieldSchema, urlFieldSchema, linkFieldSchema, selectFieldSchema, referenceFieldSchema, itemTypeSchema, repeaterFieldSchema$1, groupFieldSchema$1, modalFieldSchema, numberFieldSchema, tabDefinitionSchema, tabGroupFieldSchema, presetOptionSchema, presetOrCustomFieldSchema, contentTypeSelectFieldSchema, entryPickerFieldSchema, _fieldSchemaInternal, fieldSchema, slotSchema, typographyTokens$1, colorTokens$1, spacingTokens$1, radiusTokens$1, styleTokenSchema, behaviourSchema, quickFieldPrioritySchema, previewCustomizeManifestCurationSchema, blockCategoryEnum$1, blockContentSourceKinds, blockContentSourceSchema;
|
|
11738
|
-
var init_schema$
|
|
11742
|
+
var init_schema$2 = __esmMin((() => {
|
|
11739
11743
|
init_node();
|
|
11740
11744
|
init_repeaterGrid();
|
|
11741
11745
|
init_presets$2();
|
|
@@ -12322,7 +12326,7 @@ var init_schema$1 = __esmMin((() => {
|
|
|
12322
12326
|
}));
|
|
12323
12327
|
//#endregion
|
|
12324
12328
|
//#region ../blocks/src/system/inlineText.ts
|
|
12325
|
-
init_schema$
|
|
12329
|
+
init_schema$2();
|
|
12326
12330
|
const inlineTextMarkSchema = z$1.discriminatedUnion("kind", [
|
|
12327
12331
|
z$1.object({ kind: z$1.literal("strong") }),
|
|
12328
12332
|
z$1.object({ kind: z$1.literal("emphasis") }),
|
|
@@ -13765,7 +13769,7 @@ const ALLOWED_URL_PROTOCOLS = ["http:", "https:"];
|
|
|
13765
13769
|
const DATE_PATTERN = /^(?<year>[1-9]\d{3})-(?<month>\d{2})-(?<day>\d{2})$/;
|
|
13766
13770
|
const TIME_PATTERN = /^(?<hours>[01]\d|2[0-3]):(?<minutes>[0-5]\d)$/;
|
|
13767
13771
|
const DATETIME_PATTERN = /^(?<date>[1-9]\d{3}-\d{2}-\d{2})T(?<time>(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d)(?:\.\d+)?(?<offset>Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
|
|
13768
|
-
function assertNever$
|
|
13772
|
+
function assertNever$16(value) {
|
|
13769
13773
|
throw new Error(`Unhandled field validation variant: ${JSON.stringify(value)}`);
|
|
13770
13774
|
}
|
|
13771
13775
|
function validationContext(options = {}) {
|
|
@@ -13818,7 +13822,7 @@ function fieldIssueToMessage(issue) {
|
|
|
13818
13822
|
case "invalidMedia": return `${issue.label} must be a media object with an identifier`;
|
|
13819
13823
|
case "invalidLink": return `${issue.label} must be a valid link`;
|
|
13820
13824
|
case "invalidReference": return `${issue.label} must reference a valid item`;
|
|
13821
|
-
default: return assertNever$
|
|
13825
|
+
default: return assertNever$16(issue);
|
|
13822
13826
|
}
|
|
13823
13827
|
}
|
|
13824
13828
|
function pluralize(label, count) {
|
|
@@ -13938,7 +13942,7 @@ function deriveFieldValidationPlan(field, path = [field.id]) {
|
|
|
13938
13942
|
case "presetOrCustom":
|
|
13939
13943
|
case "contentTypeSelect":
|
|
13940
13944
|
case "entryPicker": return makePlan("passthrough", "unknown", field, path, false, []);
|
|
13941
|
-
default: return assertNever$
|
|
13945
|
+
default: return assertNever$16(field);
|
|
13942
13946
|
}
|
|
13943
13947
|
}
|
|
13944
13948
|
function deriveFieldValidationPlans(fields, parentPath = []) {
|
|
@@ -14013,7 +14017,7 @@ function resolveSelectConstraintSource(field) {
|
|
|
14013
14017
|
kind: "runtime",
|
|
14014
14018
|
source: source.kind
|
|
14015
14019
|
};
|
|
14016
|
-
default: return assertNever$
|
|
14020
|
+
default: return assertNever$16(source);
|
|
14017
14021
|
}
|
|
14018
14022
|
}
|
|
14019
14023
|
function normalizeStoredContentValues(plans, content, options = {}) {
|
|
@@ -14032,7 +14036,7 @@ function allGroupChildPlans(plan) {
|
|
|
14032
14036
|
switch (plan.childSelection.kind) {
|
|
14033
14037
|
case "all": return plan.childSelection.fields;
|
|
14034
14038
|
case "discriminatedTabs": return plan.childSelection.tabs.flatMap((tab) => tab.fields);
|
|
14035
|
-
default: return assertNever$
|
|
14039
|
+
default: return assertNever$16(plan.childSelection);
|
|
14036
14040
|
}
|
|
14037
14041
|
}
|
|
14038
14042
|
function selectedGroupChildPlans(plan, value) {
|
|
@@ -14065,7 +14069,7 @@ function canonicalizeFieldValueForWrite(plan, value) {
|
|
|
14065
14069
|
case "link":
|
|
14066
14070
|
case "select":
|
|
14067
14071
|
case "passthrough": return value;
|
|
14068
|
-
default: return assertNever$
|
|
14072
|
+
default: return assertNever$16(plan);
|
|
14069
14073
|
}
|
|
14070
14074
|
}
|
|
14071
14075
|
function canonicalizeObjectForWrite(plans, value) {
|
|
@@ -14091,7 +14095,7 @@ function normalizeStoredFieldValueWithContext(plan, value, ctx) {
|
|
|
14091
14095
|
case "link":
|
|
14092
14096
|
case "select":
|
|
14093
14097
|
case "passthrough": return normalizeFieldValue(plan, value, ctx);
|
|
14094
|
-
default: return assertNever$
|
|
14098
|
+
default: return assertNever$16(plan);
|
|
14095
14099
|
}
|
|
14096
14100
|
}
|
|
14097
14101
|
function normalizeStoredObjectChildren(children, value, ctx) {
|
|
@@ -14128,7 +14132,7 @@ function normalizeFieldValue(plan, value, ctx) {
|
|
|
14128
14132
|
case "select":
|
|
14129
14133
|
case "passthrough": return value;
|
|
14130
14134
|
case "media": return value;
|
|
14131
|
-
default: return assertNever$
|
|
14135
|
+
default: return assertNever$16(plan);
|
|
14132
14136
|
}
|
|
14133
14137
|
}
|
|
14134
14138
|
function normalizeObjectChildren(children, value, ctx) {
|
|
@@ -14187,7 +14191,7 @@ function validateNormalizedFieldValue(plan, value, ctx) {
|
|
|
14187
14191
|
case "repeater": return validateRepeaterPlan(plan, value, ctx);
|
|
14188
14192
|
case "group": return validateGroupPlan(plan, value, ctx);
|
|
14189
14193
|
case "passthrough": return [];
|
|
14190
|
-
default: return assertNever$
|
|
14194
|
+
default: return assertNever$16(plan);
|
|
14191
14195
|
}
|
|
14192
14196
|
}
|
|
14193
14197
|
function shouldRequireValue(plan, value, ctx) {
|
|
@@ -14229,7 +14233,7 @@ function validateStringConstraint(plan, constraint, value) {
|
|
|
14229
14233
|
case "timeFormat": return typeof value === "string" && isValidTimeString(value) ? [] : [issue$3(plan, "invalidTime")];
|
|
14230
14234
|
case "datetimeFormat": return typeof value === "string" && isValidDateTimeInstantString(value) ? [] : [issue$3(plan, "invalidDateTime")];
|
|
14231
14235
|
case "slugFormat": return typeof value === "string" && SLUG_PATTERN.test(value) ? [] : [issue$3(plan, "invalidSlug")];
|
|
14232
|
-
default: return assertNever$
|
|
14236
|
+
default: return assertNever$16(constraint);
|
|
14233
14237
|
}
|
|
14234
14238
|
}
|
|
14235
14239
|
function isValidIconPickerValue(value) {
|
|
@@ -14248,7 +14252,7 @@ function validateNumberConstraint(plan, constraint, value) {
|
|
|
14248
14252
|
case "numberType": return [];
|
|
14249
14253
|
case "numberMin": return value < constraint.minimum ? [issue$3(plan, "tooSmall", { minimum: constraint.minimum })] : [];
|
|
14250
14254
|
case "numberMax": return value > constraint.maximum ? [issue$3(plan, "tooLarge", { maximum: constraint.maximum })] : [];
|
|
14251
|
-
default: return assertNever$
|
|
14255
|
+
default: return assertNever$16(constraint);
|
|
14252
14256
|
}
|
|
14253
14257
|
}
|
|
14254
14258
|
function validateSelectPlan(plan, value) {
|
|
@@ -14270,7 +14274,7 @@ function validateRepeaterPlan(plan, value, ctx) {
|
|
|
14270
14274
|
maximum: constraint.maximum,
|
|
14271
14275
|
itemLabel: "item"
|
|
14272
14276
|
})] : [];
|
|
14273
|
-
default: return assertNever$
|
|
14277
|
+
default: return assertNever$16(constraint);
|
|
14274
14278
|
}
|
|
14275
14279
|
}), ...value.flatMap((item, index) => validateRepeaterItem(plan, item, index, ctx))];
|
|
14276
14280
|
}
|
|
@@ -14361,7 +14365,7 @@ function rebaseFieldPlanPath(plan, fromPrefix, toPrefix) {
|
|
|
14361
14365
|
...plan,
|
|
14362
14366
|
path
|
|
14363
14367
|
};
|
|
14364
|
-
default: return assertNever$
|
|
14368
|
+
default: return assertNever$16(plan);
|
|
14365
14369
|
}
|
|
14366
14370
|
}
|
|
14367
14371
|
function validateInlineTextPlan(plan, value) {
|
|
@@ -14408,7 +14412,7 @@ function fieldPlanToObjectPropertyZod(plan, options = {}) {
|
|
|
14408
14412
|
switch (presence.kind) {
|
|
14409
14413
|
case "required": return schema;
|
|
14410
14414
|
case "optional": return schema.optional();
|
|
14411
|
-
default: return assertNever$
|
|
14415
|
+
default: return assertNever$16(presence);
|
|
14412
14416
|
}
|
|
14413
14417
|
}
|
|
14414
14418
|
function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
@@ -14478,7 +14482,7 @@ function addFieldIssueToZodContext(zodCtx, validationIssue, rootPath) {
|
|
|
14478
14482
|
message
|
|
14479
14483
|
});
|
|
14480
14484
|
return;
|
|
14481
|
-
default: assertNever$
|
|
14485
|
+
default: assertNever$16(validationIssue);
|
|
14482
14486
|
}
|
|
14483
14487
|
}
|
|
14484
14488
|
function relativeZodIssuePath(path, rootPath) {
|
|
@@ -14509,7 +14513,7 @@ function findNestedFieldValidationPlan(plan, path) {
|
|
|
14509
14513
|
case "link":
|
|
14510
14514
|
case "select":
|
|
14511
14515
|
case "passthrough": return null;
|
|
14512
|
-
default: return assertNever$
|
|
14516
|
+
default: return assertNever$16(plan);
|
|
14513
14517
|
}
|
|
14514
14518
|
}
|
|
14515
14519
|
function sameFieldPath(left, right) {
|
|
@@ -14550,7 +14554,7 @@ function validateExplicitNullForPushPlan(plan, value, ctx) {
|
|
|
14550
14554
|
case "link":
|
|
14551
14555
|
case "select":
|
|
14552
14556
|
case "passthrough": return [];
|
|
14553
|
-
default: return assertNever$
|
|
14557
|
+
default: return assertNever$16(plan);
|
|
14554
14558
|
}
|
|
14555
14559
|
}
|
|
14556
14560
|
function validateExplicitNullsForPushRepeater(plan, value, ctx) {
|
|
@@ -14742,7 +14746,7 @@ function resolveVariantKey(manifest, content) {
|
|
|
14742
14746
|
//#endregion
|
|
14743
14747
|
//#region ../blocks/src/system/manifest/index.ts
|
|
14744
14748
|
init_augmentManifest();
|
|
14745
|
-
init_schema$
|
|
14749
|
+
init_schema$2();
|
|
14746
14750
|
//#endregion
|
|
14747
14751
|
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
14748
14752
|
function hexToRgb$1(hex) {
|
|
@@ -15007,7 +15011,7 @@ function asDesignSystemTemplateId(value) {
|
|
|
15007
15011
|
function makeBoundaryId(previousBlockId, nextBlockId) {
|
|
15008
15012
|
return asDesignBoundaryId(`boundary:${encodeURIComponent(previousBlockId)}:${encodeURIComponent(nextBlockId)}`);
|
|
15009
15013
|
}
|
|
15010
|
-
function assertNever$
|
|
15014
|
+
function assertNever$15(value, message = "Unhandled Theme V2 variant") {
|
|
15011
15015
|
throw new Error(`${message}: ${String(value)}`);
|
|
15012
15016
|
}
|
|
15013
15017
|
function brandNonEmptyString(value, label) {
|
|
@@ -17578,6 +17582,12 @@ function requirePaletteColorsFromEntries(entries) {
|
|
|
17578
17582
|
if (result.ok) return result.colors;
|
|
17579
17583
|
throw new Error(`Invalid complete palette: ${result.error.kind}`);
|
|
17580
17584
|
}
|
|
17585
|
+
function paletteColorEntries(colors) {
|
|
17586
|
+
return THEME_PALETTE_COLOR_ORDER.map((name) => ({
|
|
17587
|
+
name,
|
|
17588
|
+
hex: colors[name]
|
|
17589
|
+
}));
|
|
17590
|
+
}
|
|
17581
17591
|
function paletteColorFingerprint(colors) {
|
|
17582
17592
|
return PALETTE_TOKEN_NAMES.map((name) => `${name}:${colors[name]}`).join("|");
|
|
17583
17593
|
}
|
|
@@ -17610,11 +17620,26 @@ function parsePaletteValueKey(value) {
|
|
|
17610
17620
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
17611
17621
|
return value;
|
|
17612
17622
|
}
|
|
17613
|
-
var HEX_COLOR_REGEX, NORMALIZABLE_HEX_REGEX, hexColorSchema, paletteModeSchema, PALETTE_VALUE_KEY_PREFIX, paletteColorsSchema, paletteValueKeySchema;
|
|
17623
|
+
var HEX_COLOR_REGEX, NORMALIZABLE_HEX_REGEX, THEME_PALETTE_COLOR_ORDER, hexColorSchema, paletteModeSchema, PALETTE_VALUE_KEY_PREFIX, paletteColorsSchema, paletteValueKeySchema;
|
|
17614
17624
|
var init_colors = __esmMin((() => {
|
|
17615
17625
|
init_themeColorTokens();
|
|
17616
17626
|
HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
17617
17627
|
NORMALIZABLE_HEX_REGEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
17628
|
+
THEME_PALETTE_COLOR_ORDER = [
|
|
17629
|
+
"primary",
|
|
17630
|
+
"secondary",
|
|
17631
|
+
"accent",
|
|
17632
|
+
"success",
|
|
17633
|
+
"warning",
|
|
17634
|
+
"destructive",
|
|
17635
|
+
"background",
|
|
17636
|
+
"surface",
|
|
17637
|
+
"surfaceAlt",
|
|
17638
|
+
"muted",
|
|
17639
|
+
"text",
|
|
17640
|
+
"primaryForeground",
|
|
17641
|
+
"border"
|
|
17642
|
+
];
|
|
17618
17643
|
hexColorSchema = z$1.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
17619
17644
|
paletteModeSchema = z$1.enum(["light", "dark"]);
|
|
17620
17645
|
PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
@@ -17644,8 +17669,18 @@ var init_colors = __esmMin((() => {
|
|
|
17644
17669
|
return z$1.NEVER;
|
|
17645
17670
|
});
|
|
17646
17671
|
}));
|
|
17647
|
-
|
|
17648
|
-
|
|
17672
|
+
function concretePaletteToTheme(palette) {
|
|
17673
|
+
return {
|
|
17674
|
+
colors: paletteColorEntries(palette.colors),
|
|
17675
|
+
meta: { mode: palette.mode }
|
|
17676
|
+
};
|
|
17677
|
+
}
|
|
17678
|
+
var init_concretePalette = __esmMin((() => {
|
|
17679
|
+
init_colors();
|
|
17680
|
+
}));
|
|
17681
|
+
var init_fromVibrant = __esmMin((() => {
|
|
17682
|
+
init_utils$6();
|
|
17683
|
+
}));
|
|
17649
17684
|
//#endregion
|
|
17650
17685
|
//#region ../theme-core/src/site-styles/styleTags.ts
|
|
17651
17686
|
var STYLE_AXIS_VALUES, styleTagsSchema;
|
|
@@ -18935,13 +18970,6 @@ var init_warm_dark = __esmMin((() => {
|
|
|
18935
18970
|
}));
|
|
18936
18971
|
//#endregion
|
|
18937
18972
|
//#region ../theme-core/src/palette/curated/index.ts
|
|
18938
|
-
/**
|
|
18939
|
-
* Curated palette library.
|
|
18940
|
-
*
|
|
18941
|
-
* Authoring keys are readable source aliases. Value keys are derived from the
|
|
18942
|
-
* complete mode and semantic colours and are the only curated identity used at
|
|
18943
|
-
* persistence and runtime boundaries.
|
|
18944
|
-
*/
|
|
18945
18973
|
function admitCuratedPaletteDefinition(definition) {
|
|
18946
18974
|
return {
|
|
18947
18975
|
...definition,
|
|
@@ -18959,9 +18987,8 @@ function requireCuratedPaletteValueKey(authoringKey) {
|
|
|
18959
18987
|
if (!palette) throw new Error(`Unknown curated palette authoring key "${authoringKey}"`);
|
|
18960
18988
|
return palette.valueKey;
|
|
18961
18989
|
}
|
|
18962
|
-
var curatedPalettes, curatedPalettesByValueKey, curatedPalettesByAuthoringKey
|
|
18990
|
+
var curatedPalettes, curatedPalettesByValueKey, curatedPalettesByAuthoringKey;
|
|
18963
18991
|
var init_curated = __esmMin((() => {
|
|
18964
|
-
init_colors();
|
|
18965
18992
|
init_brand_led();
|
|
18966
18993
|
init_high_contrast();
|
|
18967
18994
|
init_soft_natural();
|
|
@@ -18990,105 +19017,6 @@ var init_curated = __esmMin((() => {
|
|
|
18990
19017
|
];
|
|
18991
19018
|
curatedPalettesByValueKey = new Map(curatedPalettes.map((palette) => [palette.valueKey, palette]));
|
|
18992
19019
|
curatedPalettesByAuthoringKey = new Map(curatedPalettes.map((palette) => [palette.authoringKey, palette]));
|
|
18993
|
-
knownCuratedPaletteValueKeySchema = z$1.string().transform((value, ctx) => {
|
|
18994
|
-
const valueKey = parsePaletteValueKey(value);
|
|
18995
|
-
if (!valueKey) {
|
|
18996
|
-
ctx.addIssue({
|
|
18997
|
-
code: "custom",
|
|
18998
|
-
message: "Invalid canonical palette value key"
|
|
18999
|
-
});
|
|
19000
|
-
return z$1.NEVER;
|
|
19001
|
-
}
|
|
19002
|
-
const palette = findCuratedPalette(valueKey);
|
|
19003
|
-
if (!palette) {
|
|
19004
|
-
ctx.addIssue({
|
|
19005
|
-
code: "custom",
|
|
19006
|
-
message: "Unknown curated palette value key"
|
|
19007
|
-
});
|
|
19008
|
-
return z$1.NEVER;
|
|
19009
|
-
}
|
|
19010
|
-
return palette.valueKey;
|
|
19011
|
-
});
|
|
19012
|
-
}));
|
|
19013
|
-
var init_resolveSelection = __esmMin((() => {
|
|
19014
|
-
init_curated();
|
|
19015
|
-
})), sitePaletteIdSchema, sitePaletteVersionSchema, paletteSelectionSchema, onboardingPaletteOriginSchema, curatedForkPaletteOriginSchema, manualPaletteOriginSchema, legacyCustomizedPaletteOriginSchema, sitePaletteOriginSchema, editorSitePaletteOriginSchema, paletteCommandSchema;
|
|
19016
|
-
var init_selection$1 = __esmMin((() => {
|
|
19017
|
-
init_colors();
|
|
19018
|
-
init_curated();
|
|
19019
|
-
sitePaletteIdSchema = z$1.string().uuid().transform((value) => value);
|
|
19020
|
-
sitePaletteVersionSchema = z$1.number().int().nonnegative().transform((value) => value);
|
|
19021
|
-
paletteSelectionSchema = z$1.discriminatedUnion("kind", [z$1.object({
|
|
19022
|
-
kind: z$1.literal("curated"),
|
|
19023
|
-
valueKey: knownCuratedPaletteValueKeySchema
|
|
19024
|
-
}), z$1.object({
|
|
19025
|
-
kind: z$1.literal("site"),
|
|
19026
|
-
paletteId: sitePaletteIdSchema
|
|
19027
|
-
})]);
|
|
19028
|
-
onboardingPaletteOriginSchema = z$1.object({
|
|
19029
|
-
kind: z$1.literal("onboarding"),
|
|
19030
|
-
sourceKey: z$1.string().min(1).nullable()
|
|
19031
|
-
});
|
|
19032
|
-
curatedForkPaletteOriginSchema = z$1.object({
|
|
19033
|
-
kind: z$1.literal("curated-fork"),
|
|
19034
|
-
sourceValueKey: paletteValueKeySchema
|
|
19035
|
-
});
|
|
19036
|
-
manualPaletteOriginSchema = z$1.object({ kind: z$1.literal("manual") });
|
|
19037
|
-
legacyCustomizedPaletteOriginSchema = z$1.object({
|
|
19038
|
-
kind: z$1.literal("legacy-customized"),
|
|
19039
|
-
sourceKey: z$1.string().min(1).nullable()
|
|
19040
|
-
});
|
|
19041
|
-
sitePaletteOriginSchema = z$1.discriminatedUnion("kind", [
|
|
19042
|
-
onboardingPaletteOriginSchema,
|
|
19043
|
-
curatedForkPaletteOriginSchema,
|
|
19044
|
-
manualPaletteOriginSchema,
|
|
19045
|
-
legacyCustomizedPaletteOriginSchema
|
|
19046
|
-
]);
|
|
19047
|
-
editorSitePaletteOriginSchema = z$1.discriminatedUnion("kind", [z$1.object({
|
|
19048
|
-
kind: z$1.literal("curated-fork"),
|
|
19049
|
-
sourceValueKey: knownCuratedPaletteValueKeySchema
|
|
19050
|
-
}), manualPaletteOriginSchema]);
|
|
19051
|
-
z$1.object({
|
|
19052
|
-
id: sitePaletteIdSchema,
|
|
19053
|
-
colors: paletteColorsSchema,
|
|
19054
|
-
mode: paletteModeSchema,
|
|
19055
|
-
origin: sitePaletteOriginSchema,
|
|
19056
|
-
version: sitePaletteVersionSchema
|
|
19057
|
-
});
|
|
19058
|
-
paletteCommandSchema = z$1.discriminatedUnion("kind", [
|
|
19059
|
-
z$1.object({ kind: z$1.literal("preserve") }),
|
|
19060
|
-
z$1.object({
|
|
19061
|
-
kind: z$1.literal("select"),
|
|
19062
|
-
selection: paletteSelectionSchema
|
|
19063
|
-
}),
|
|
19064
|
-
z$1.object({
|
|
19065
|
-
kind: z$1.literal("create-site"),
|
|
19066
|
-
colors: paletteColorsSchema,
|
|
19067
|
-
mode: paletteModeSchema,
|
|
19068
|
-
origin: editorSitePaletteOriginSchema
|
|
19069
|
-
}),
|
|
19070
|
-
z$1.object({
|
|
19071
|
-
kind: z$1.literal("update-site"),
|
|
19072
|
-
paletteId: sitePaletteIdSchema,
|
|
19073
|
-
expectedVersion: sitePaletteVersionSchema,
|
|
19074
|
-
colors: paletteColorsSchema,
|
|
19075
|
-
mode: paletteModeSchema
|
|
19076
|
-
})
|
|
19077
|
-
]);
|
|
19078
|
-
}));
|
|
19079
|
-
var init_persistenceReadSource = __esmMin((() => {
|
|
19080
|
-
init_curated();
|
|
19081
|
-
init_colors();
|
|
19082
|
-
init_resolveSelection();
|
|
19083
|
-
init_selection$1();
|
|
19084
|
-
}));
|
|
19085
|
-
var init_sitePalettePersistence = __esmMin((() => {
|
|
19086
|
-
init_curated();
|
|
19087
|
-
init_colors();
|
|
19088
|
-
init_selection$1();
|
|
19089
|
-
}));
|
|
19090
|
-
var init_fromVibrant = __esmMin((() => {
|
|
19091
|
-
init_utils$6();
|
|
19092
19020
|
}));
|
|
19093
19021
|
//#endregion
|
|
19094
19022
|
//#region ../theme-core/src/palette/index.ts
|
|
@@ -19104,12 +19032,7 @@ var init_palette = __esmMin((() => {
|
|
|
19104
19032
|
init_paletteAccess();
|
|
19105
19033
|
init_extractPalette();
|
|
19106
19034
|
init_colors();
|
|
19107
|
-
|
|
19108
|
-
init_libraryModel();
|
|
19109
|
-
init_persistenceReadSource();
|
|
19110
|
-
init_resolveSelection();
|
|
19111
|
-
init_selection$1();
|
|
19112
|
-
init_sitePalettePersistence();
|
|
19035
|
+
init_concretePalette();
|
|
19113
19036
|
init_fromVibrant();
|
|
19114
19037
|
init_suggestRecipes();
|
|
19115
19038
|
init_allRecipes();
|
|
@@ -19446,7 +19369,7 @@ function applyNavTypography(style, typography) {
|
|
|
19446
19369
|
textSize: "sm",
|
|
19447
19370
|
letterSpacing: "wider"
|
|
19448
19371
|
};
|
|
19449
|
-
default: return assertNever$
|
|
19372
|
+
default: return assertNever$15(typography, "Unhandled header nav typography");
|
|
19450
19373
|
}
|
|
19451
19374
|
}
|
|
19452
19375
|
function underlineNavLinkStyle(colorToken, underlineColorToken, typography = "plain") {
|
|
@@ -19475,7 +19398,7 @@ function themedHeaderShadow(theme) {
|
|
|
19475
19398
|
case "low": return { elevation: "sm" };
|
|
19476
19399
|
case "medium": return { elevation: "md" };
|
|
19477
19400
|
case "high": return { elevation: "lg" };
|
|
19478
|
-
default: return assertNever$
|
|
19401
|
+
default: return assertNever$15(theme.shadow.elevation, "Unhandled theme shadow elevation");
|
|
19479
19402
|
}
|
|
19480
19403
|
}
|
|
19481
19404
|
function solidBrandHeader(theme) {
|
|
@@ -23820,6 +23743,38 @@ var init_media$2 = __esmMin((() => {
|
|
|
23820
23743
|
transform: transformSchema$1.optional()
|
|
23821
23744
|
});
|
|
23822
23745
|
}));
|
|
23746
|
+
//#endregion
|
|
23747
|
+
//#region ../theme-core/src/palette/schema.ts
|
|
23748
|
+
var colourHexString, paletteColorSchema, paletteMetaSchema, paletteSchema;
|
|
23749
|
+
var init_schema$1 = __esmMin((() => {
|
|
23750
|
+
init_colors();
|
|
23751
|
+
colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
23752
|
+
paletteColorSchema = z$1.object({
|
|
23753
|
+
name: z$1.string().min(1),
|
|
23754
|
+
hex: colourHexString
|
|
23755
|
+
});
|
|
23756
|
+
paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
|
|
23757
|
+
paletteSchema = z$1.object({
|
|
23758
|
+
colors: z$1.array(paletteColorSchema),
|
|
23759
|
+
meta: paletteMetaSchema
|
|
23760
|
+
}).transform((palette, ctx) => {
|
|
23761
|
+
const colors = paletteColorsFromEntries(palette.colors);
|
|
23762
|
+
if (!colors.ok) {
|
|
23763
|
+
ctx.addIssue({
|
|
23764
|
+
code: "custom",
|
|
23765
|
+
message: `Invalid complete palette: ${colors.error.kind}`
|
|
23766
|
+
});
|
|
23767
|
+
return z$1.NEVER;
|
|
23768
|
+
}
|
|
23769
|
+
return {
|
|
23770
|
+
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
23771
|
+
name: String(name),
|
|
23772
|
+
hex: String(hex)
|
|
23773
|
+
})),
|
|
23774
|
+
meta: palette.meta
|
|
23775
|
+
};
|
|
23776
|
+
});
|
|
23777
|
+
}));
|
|
23823
23778
|
var init_foregroundRoles = __esmMin((() => {}));
|
|
23824
23779
|
//#endregion
|
|
23825
23780
|
//#region ../theme-core/src/surfaces/foregroundContract.ts
|
|
@@ -26681,9 +26636,10 @@ function normaliseHeaderNavFontRole(header) {
|
|
|
26681
26636
|
navFontRole: navTypography
|
|
26682
26637
|
} : rest;
|
|
26683
26638
|
}
|
|
26684
|
-
var axesSchema,
|
|
26639
|
+
var axesSchema, typographyStyleSchema, bodyTypographyStyleSchema, headingSizeSchema, headingTypographyOverridesSchema, headingTypographyStyleSchema, proseLinkUnderlineStyleSchema, proseLinkUnderlineThicknessSchema, proseLinkUnderlineOffsetSchema, proseLinkStyleSchema, semanticSpacingSchema, boxRoundedSchema, boxBackgroundOverlaySchema, boxBackgroundSchema, noHeadingDecorationSchema, visibleHeadingDecorationSchema, headingDecorationSchema, headingDecorationOverrideSchema, accordionIconTreatmentSchema, sectionStylesOverrideSchema, containerStylesOverrideSchema, cardBorderOverrideSchema, cardStylesOverrideSchema, blockStyleOverridesSchema, blockThemeOverrideSchema, typographyScaleSchema, eyebrowTypographyStyleSchema, typographySchema, spaceSchema, corners, shadow, border, motion, inputStyle, headerVariant, headerPositioning, headerNavStyle, navFontWeight, headerMaxWidth, headerBarFrame, headerContainerSchema, headerBorderSchema, logoStyleSchema, headerLogoTextSchema, navEffectsSchema, dropdownStyleSchema, headerCtaGapSchema, headerCtaTreatmentSchema, navContainerSchema, headerBackgroundSchema, headerSchema, footerVariant, footerMaxWidth, footerMode, footerNavLayoutMode, footerNavLayoutAlign, footerSpacing, footerLogoPlacement, footerLogoSize, footerLogoMaxHeight, footerBottomTextLinkStyleSchema, footerBottomBarSchema, footerNavLayoutSchema, footerLogoSchema, footerSchema, containerPaddingPresetSchema, layoutSchema, heroTypographySizeSchema, heroTypographyLineHeightSchema, heroResponsiveTypographySchema, heroTypographySchema, heroSchema, bodyTextIntroTypographySizeSchema, bodyTextSchema, gradientsSchema, testimonialQuoteTreatmentSchema, themeSchema;
|
|
26685
26640
|
var init_schema = __esmMin((() => {
|
|
26686
26641
|
init_media$2();
|
|
26642
|
+
init_schema$1();
|
|
26687
26643
|
init_buttons();
|
|
26688
26644
|
init_cards();
|
|
26689
26645
|
init_types$9();
|
|
@@ -26726,16 +26682,6 @@ var init_schema = __esmMin((() => {
|
|
|
26726
26682
|
"expressive"
|
|
26727
26683
|
])
|
|
26728
26684
|
});
|
|
26729
|
-
colourHexString = z$1.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
26730
|
-
paletteColorSchema = z$1.object({
|
|
26731
|
-
name: z$1.string().min(1),
|
|
26732
|
-
hex: colourHexString
|
|
26733
|
-
});
|
|
26734
|
-
paletteMetaSchema = z$1.object({ mode: z$1.enum(["light", "dark"]) });
|
|
26735
|
-
paletteSchema = z$1.object({
|
|
26736
|
-
colors: z$1.array(paletteColorSchema),
|
|
26737
|
-
meta: paletteMetaSchema
|
|
26738
|
-
});
|
|
26739
26685
|
typographyStyleSchema = z$1.object({
|
|
26740
26686
|
family: z$1.string().min(1),
|
|
26741
26687
|
weight: z$1.enum([
|
|
@@ -27728,7 +27674,6 @@ var init_runtimeCompiler = __esmMin((() => {
|
|
|
27728
27674
|
init_modern_minimal();
|
|
27729
27675
|
init_expandPalette();
|
|
27730
27676
|
init_styles();
|
|
27731
|
-
init_colors();
|
|
27732
27677
|
init_designState();
|
|
27733
27678
|
init_types$15();
|
|
27734
27679
|
init_accessibleSurfaces();
|
|
@@ -29604,7 +29549,7 @@ var init_siteStyleThemeCompiler = __esmMin((() => {
|
|
|
29604
29549
|
init_curatedSiteStyles();
|
|
29605
29550
|
init_runtimeCompiler();
|
|
29606
29551
|
init_curated();
|
|
29607
|
-
|
|
29552
|
+
init_concretePalette();
|
|
29608
29553
|
}));
|
|
29609
29554
|
var init_previewCustomization = __esmMin((() => {
|
|
29610
29555
|
init_types$15();
|
|
@@ -29614,7 +29559,7 @@ var init_previewCompiler = __esmMin((() => {
|
|
|
29614
29559
|
init_onColor();
|
|
29615
29560
|
init_tokens();
|
|
29616
29561
|
init_curated();
|
|
29617
|
-
|
|
29562
|
+
init_concretePalette();
|
|
29618
29563
|
init_curatedSiteStyles();
|
|
29619
29564
|
init_resolver();
|
|
29620
29565
|
init_types$15();
|
|
@@ -30976,7 +30921,7 @@ function devValidate(node) {
|
|
|
30976
30921
|
}
|
|
30977
30922
|
var section$1, headerSection, stack, inline, accordion, accordionItem, carousel, text, richText, icon, media, fileDownload, videoEmbed, spinner, button, link, form, bookingForm, eventRegistration, shop, productList, productDetail, cart, checkout$1, gifting, courseRegistration;
|
|
30978
30923
|
var init_builder$1 = __esmMin((() => {
|
|
30979
|
-
init_schema$
|
|
30924
|
+
init_schema$3();
|
|
30980
30925
|
init_types$6();
|
|
30981
30926
|
init_env();
|
|
30982
30927
|
section$1 = (props, children, ...mods) => el("section", props, children, ...mods);
|
|
@@ -32614,7 +32559,7 @@ function scopeContentPath(path, scope) {
|
|
|
32614
32559
|
}
|
|
32615
32560
|
var FRAGMENT_ID_PATTERN, FIELD_ID_PATTERN, dataLoaderSchema, fragmentDataSchema, fragmentConfigSchema, FragmentConfigError;
|
|
32616
32561
|
var init_types$5 = __esmMin((() => {
|
|
32617
|
-
init_schema$
|
|
32562
|
+
init_schema$2();
|
|
32618
32563
|
init_node();
|
|
32619
32564
|
FRAGMENT_ID_PATTERN = /^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$/i;
|
|
32620
32565
|
FIELD_ID_PATTERN = /^[a-z][a-zA-Z0-9_-]*$/;
|
|
@@ -35548,7 +35493,7 @@ function deriveComponentName(id) {
|
|
|
35548
35493
|
return `${id.replace(/^block\./, "").replace(/-/g, ".").replace(/([a-z])([A-Z])/g, "$1.$2").toLowerCase()}.default`;
|
|
35549
35494
|
}
|
|
35550
35495
|
var init_defineBlock = __esmMin((() => {
|
|
35551
|
-
init_schema$
|
|
35496
|
+
init_schema$2();
|
|
35552
35497
|
init_fragments();
|
|
35553
35498
|
init_augmentManifest();
|
|
35554
35499
|
}));
|
|
@@ -36244,7 +36189,7 @@ const blogPostBlockDefinition = {
|
|
|
36244
36189
|
//#region ../blocks/src/system/blocks/blog-listing.ts
|
|
36245
36190
|
init_defineBlock();
|
|
36246
36191
|
init_boxStyles$1();
|
|
36247
|
-
init_schema$
|
|
36192
|
+
init_schema$2();
|
|
36248
36193
|
init_builder$1();
|
|
36249
36194
|
init_fragments$1();
|
|
36250
36195
|
init_colorStyles();
|
|
@@ -37993,7 +37938,7 @@ function planSiteChromePlacement(positioning) {
|
|
|
37993
37938
|
headerRootClassName: "rb-fixed rb-top-0 rb-left-0 rb-right-0",
|
|
37994
37939
|
standaloneShellClassName: "fixed left-0 right-0 top-0 z-40 w-full"
|
|
37995
37940
|
};
|
|
37996
|
-
default: return assertNever$
|
|
37941
|
+
default: return assertNever$15(positioning);
|
|
37997
37942
|
}
|
|
37998
37943
|
}
|
|
37999
37944
|
function splitSiteChromePlacementClasses(className) {
|
|
@@ -39216,7 +39161,7 @@ const siteFooterBlockDefinition = { manifest: createBlockManifest({
|
|
|
39216
39161
|
}) };
|
|
39217
39162
|
//#endregion
|
|
39218
39163
|
//#region ../blocks/src/system/blocks/testimonials.tsx
|
|
39219
|
-
init_schema$
|
|
39164
|
+
init_schema$2();
|
|
39220
39165
|
init_fragments$1();
|
|
39221
39166
|
init_styledSection();
|
|
39222
39167
|
init_boxStyles$1();
|
|
@@ -39427,7 +39372,7 @@ const testimonialsBlockDefinition = {
|
|
|
39427
39372
|
//#endregion
|
|
39428
39373
|
//#region ../blocks/src/system/blocks/columns.ts
|
|
39429
39374
|
init_fragments();
|
|
39430
|
-
init_schema$
|
|
39375
|
+
init_schema$2();
|
|
39431
39376
|
init_defineBlock();
|
|
39432
39377
|
init_node();
|
|
39433
39378
|
init_builder$1();
|
|
@@ -39685,7 +39630,7 @@ function repeaterFragmentLayout(args) {
|
|
|
39685
39630
|
//#endregion
|
|
39686
39631
|
//#region ../blocks/src/system/blocks/collection.ts
|
|
39687
39632
|
init_fragments();
|
|
39688
|
-
init_schema$
|
|
39633
|
+
init_schema$2();
|
|
39689
39634
|
init_defineBlock();
|
|
39690
39635
|
init_builder$1();
|
|
39691
39636
|
init_fragments$1();
|
|
@@ -47085,7 +47030,7 @@ var init_EventCalendar_interactive = __esmMin((() => {
|
|
|
47085
47030
|
}));
|
|
47086
47031
|
//#endregion
|
|
47087
47032
|
//#region ../blocks/src/system/blocks/events/event-calendar.ts
|
|
47088
|
-
init_schema$
|
|
47033
|
+
init_schema$2();
|
|
47089
47034
|
init_builder$1();
|
|
47090
47035
|
init_styledSection();
|
|
47091
47036
|
init_fragments$1();
|
|
@@ -48518,10 +48463,10 @@ function preferredPathsForSource(source) {
|
|
|
48518
48463
|
case "workshop": return ["/workshops", "/workshop"];
|
|
48519
48464
|
case "retreat": return ["/retreats", "/retreat"];
|
|
48520
48465
|
case "performance": return ["/performances", "/performance"];
|
|
48521
|
-
default: return assertNever$
|
|
48466
|
+
default: return assertNever$24(source.preset, "Unhandled offerings preview event preset");
|
|
48522
48467
|
}
|
|
48523
48468
|
case "course": return ["/courses", "/course"];
|
|
48524
|
-
default: return assertNever$
|
|
48469
|
+
default: return assertNever$24(source, "Unhandled offerings preview source");
|
|
48525
48470
|
}
|
|
48526
48471
|
}
|
|
48527
48472
|
function normalizeRoutePath(value) {
|
|
@@ -48948,7 +48893,7 @@ function isRecord$36(value) {
|
|
|
48948
48893
|
}
|
|
48949
48894
|
//#endregion
|
|
48950
48895
|
//#region ../blocks/src/system/blocks/embed.ts
|
|
48951
|
-
init_schema$
|
|
48896
|
+
init_schema$2();
|
|
48952
48897
|
init_builder$1();
|
|
48953
48898
|
init_fragments$1();
|
|
48954
48899
|
init_defineBlock();
|
|
@@ -49219,7 +49164,7 @@ const embedBlockDefinition = {
|
|
|
49219
49164
|
};
|
|
49220
49165
|
//#endregion
|
|
49221
49166
|
//#region ../blocks/src/system/blocks/image-gallery.ts
|
|
49222
|
-
init_schema$
|
|
49167
|
+
init_schema$2();
|
|
49223
49168
|
init_builder$1();
|
|
49224
49169
|
init_colorStyles();
|
|
49225
49170
|
init_defineBlock();
|
|
@@ -50012,7 +49957,7 @@ const imageGalleryBlockDefinition = { manifest: createBlockManifest({
|
|
|
50012
49957
|
}) };
|
|
50013
49958
|
//#endregion
|
|
50014
49959
|
//#region ../blocks/src/system/blocks/video-grid.ts
|
|
50015
|
-
init_schema$
|
|
49960
|
+
init_schema$2();
|
|
50016
49961
|
init_builder$1();
|
|
50017
49962
|
init_fragments$1();
|
|
50018
49963
|
init_colorStyles();
|
|
@@ -52869,7 +52814,7 @@ const newsletterSignupBlockDefinition = {
|
|
|
52869
52814
|
//#endregion
|
|
52870
52815
|
//#region ../blocks/src/system/blocks/team-members.ts
|
|
52871
52816
|
init_fragments();
|
|
52872
|
-
init_schema$
|
|
52817
|
+
init_schema$2();
|
|
52873
52818
|
init_defineBlock();
|
|
52874
52819
|
init_builder$1();
|
|
52875
52820
|
init_fragments$1();
|
|
@@ -53412,7 +53357,7 @@ var init_location_map_shared = __esmMin((() => {
|
|
|
53412
53357
|
}));
|
|
53413
53358
|
//#endregion
|
|
53414
53359
|
//#region ../blocks/src/system/blocks/location-map.ts
|
|
53415
|
-
init_schema$
|
|
53360
|
+
init_schema$2();
|
|
53416
53361
|
init_builder$1();
|
|
53417
53362
|
init_fragments$1();
|
|
53418
53363
|
init_defineBlock();
|
|
@@ -58029,7 +57974,7 @@ function eventSeriesIdsForSubject(subject) {
|
|
|
58029
57974
|
switch (subject.kind) {
|
|
58030
57975
|
case "eventSeries": return [subject.eventSeriesId];
|
|
58031
57976
|
case "eventOffering": return subject.availableEventSeriesIds;
|
|
58032
|
-
default: return assertNever$
|
|
57977
|
+
default: return assertNever$24(subject);
|
|
58033
57978
|
}
|
|
58034
57979
|
}
|
|
58035
57980
|
var init_course_page_surface_scope = __esmMin((() => {
|
|
@@ -58789,7 +58734,7 @@ function renderOfferingGroupItems(presentation, items, options) {
|
|
|
58789
58734
|
children: items.map((item) => renderOfferingCompactItem(item, options))
|
|
58790
58735
|
})
|
|
58791
58736
|
});
|
|
58792
|
-
default: return assertNever$
|
|
58737
|
+
default: return assertNever$24(presentation, "Unhandled offerings preview presentation");
|
|
58793
58738
|
}
|
|
58794
58739
|
}
|
|
58795
58740
|
function compareCoursesByNextSession(left, right) {
|
|
@@ -58834,7 +58779,7 @@ function featuredSummaryDetails(item) {
|
|
|
58834
58779
|
const summary = deriveCourseScheduleSummary(item.course);
|
|
58835
58780
|
return summary ? formatFeaturedSummary(summary, item.course.venue?.name ?? null) : null;
|
|
58836
58781
|
}
|
|
58837
|
-
default: return assertNever$
|
|
58782
|
+
default: return assertNever$24(item, "Unhandled offerings preview item");
|
|
58838
58783
|
}
|
|
58839
58784
|
}
|
|
58840
58785
|
function formatFeaturedSummary(summary, venue) {
|
|
@@ -58843,7 +58788,7 @@ function formatFeaturedSummary(summary, venue) {
|
|
|
58843
58788
|
case "multi-day-span": return detailsFromOccurrences(summary.occurrence, summary.occurrence, venue, null, null, true);
|
|
58844
58789
|
case "fixed-recurring-run": return detailsFromOccurrences(summary.first, summary.last, venue, summary.recurrenceLabel, null);
|
|
58845
58790
|
case "irregular-multi-session-run": return detailsFromOccurrences(summary.first, summary.last, venue, null, `${summary.sessionCount} dates`);
|
|
58846
|
-
default: return assertNever$
|
|
58791
|
+
default: return assertNever$24(summary, "Unhandled offerings preview schedule summary");
|
|
58847
58792
|
}
|
|
58848
58793
|
}
|
|
58849
58794
|
function detailsFromOccurrences(first, last, venue, recurrence, sessionCount, spanUsesEndDate = false) {
|
|
@@ -59242,7 +59187,7 @@ function bookingActionContent(input) {
|
|
|
59242
59187
|
children: input.buttonText
|
|
59243
59188
|
});
|
|
59244
59189
|
case "unavailable": return null;
|
|
59245
|
-
default: return assertNever$
|
|
59190
|
+
default: return assertNever$24(input.booking);
|
|
59246
59191
|
}
|
|
59247
59192
|
}
|
|
59248
59193
|
function RecurringSchedule({ schedule, buttonText = "Book", buttonVariant = "primary", showVenue = true, emptyMessage = "Regular schedule details will be added shortly." }) {
|
|
@@ -61462,7 +61407,7 @@ function previewEditableTargetToPath(target) {
|
|
|
61462
61407
|
case "current-entry-field":
|
|
61463
61408
|
case "current-entry-metadata": return target.path;
|
|
61464
61409
|
case "read-only": return;
|
|
61465
|
-
default: return assertNever$
|
|
61410
|
+
default: return assertNever$24(target);
|
|
61466
61411
|
}
|
|
61467
61412
|
}
|
|
61468
61413
|
function previewEditableTargetToFieldKey(target) {
|
|
@@ -62515,7 +62460,7 @@ function collectNestedPreviewFieldConstraintEntries(field, path) {
|
|
|
62515
62460
|
case "text":
|
|
62516
62461
|
case "time":
|
|
62517
62462
|
case "url": return [];
|
|
62518
|
-
default: return assertNever$
|
|
62463
|
+
default: return assertNever$24(field);
|
|
62519
62464
|
}
|
|
62520
62465
|
}
|
|
62521
62466
|
function makeDefaultBlockComponent(args) {
|
|
@@ -63665,7 +63610,7 @@ function sourceLabel(source) {
|
|
|
63665
63610
|
case "managed-database": return "DB";
|
|
63666
63611
|
case "sdk-synced": return "SDK-synced DB";
|
|
63667
63612
|
case "sdk-config": return "SDK config";
|
|
63668
|
-
default: return assertNever$
|
|
63613
|
+
default: return assertNever$24(source);
|
|
63669
63614
|
}
|
|
63670
63615
|
}
|
|
63671
63616
|
//#endregion
|
|
@@ -70702,6 +70647,47 @@ async function writeMediaManifest(contentDir, manifest) {
|
|
|
70702
70647
|
return manifestPath;
|
|
70703
70648
|
}
|
|
70704
70649
|
//#endregion
|
|
70650
|
+
//#region src/cli/content/legacyEventScheduleShapeError.ts
|
|
70651
|
+
var LegacyEventScheduleShapeError = class extends Error {
|
|
70652
|
+
constructor(filePath) {
|
|
70653
|
+
super(`${filePath}: legacy event "schedule" is no longer supported. Preserve local edits, run "riverbankcms pull events", then reapply those edits to preset, bookingScope, and occurrences.`);
|
|
70654
|
+
this.filePath = filePath;
|
|
70655
|
+
this.code = "legacy_event_schedule_shape";
|
|
70656
|
+
this.name = "LegacyEventScheduleShapeError";
|
|
70657
|
+
}
|
|
70658
|
+
};
|
|
70659
|
+
//#endregion
|
|
70660
|
+
//#region src/cli/content/localEventSchedule.ts
|
|
70661
|
+
const localEventScheduleIdentitySchema = z$1.object({
|
|
70662
|
+
preset: z$1.enum([
|
|
70663
|
+
"event",
|
|
70664
|
+
"class",
|
|
70665
|
+
"course",
|
|
70666
|
+
"workshop",
|
|
70667
|
+
"retreat",
|
|
70668
|
+
"performance"
|
|
70669
|
+
]),
|
|
70670
|
+
bookingScope: z$1.enum(["single_occurrence", "whole_series"]),
|
|
70671
|
+
occurrences: z$1.array(z$1.object({
|
|
70672
|
+
startsAt: z$1.string().datetime({ offset: true }),
|
|
70673
|
+
endsAt: z$1.string().datetime({ offset: true }),
|
|
70674
|
+
timeZone: z$1.string().min(1)
|
|
70675
|
+
}))
|
|
70676
|
+
});
|
|
70677
|
+
var InvalidLocalEventScheduleIdentityError = class extends Error {
|
|
70678
|
+
constructor(filePath, details) {
|
|
70679
|
+
super(`${filePath}: invalid event schedule identity: ${details}`);
|
|
70680
|
+
this.filePath = filePath;
|
|
70681
|
+
this.code = "invalid_local_event_schedule_identity";
|
|
70682
|
+
this.name = "InvalidLocalEventScheduleIdentityError";
|
|
70683
|
+
}
|
|
70684
|
+
};
|
|
70685
|
+
function parseLocalEventScheduleIdentity(value, filePath) {
|
|
70686
|
+
const parsed = localEventScheduleIdentitySchema.safeParse(value);
|
|
70687
|
+
if (!parsed.success) throw new InvalidLocalEventScheduleIdentityError(filePath, parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; "));
|
|
70688
|
+
return parsed.data;
|
|
70689
|
+
}
|
|
70690
|
+
//#endregion
|
|
70705
70691
|
//#region src/cli/content/reader.ts
|
|
70706
70692
|
/**
|
|
70707
70693
|
* Content File Reader
|
|
@@ -70953,12 +70939,17 @@ async function readEventsWithFilePaths(contentDir) {
|
|
|
70953
70939
|
const events = [];
|
|
70954
70940
|
const files = await listFiles(eventsDir, ".json");
|
|
70955
70941
|
for (const filePath of files) try {
|
|
70956
|
-
const
|
|
70942
|
+
const raw = await readJsonFile(filePath);
|
|
70943
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new InvalidLocalEventScheduleIdentityError(filePath, "expected an object");
|
|
70944
|
+
if ("schedule" in raw) throw new LegacyEventScheduleShapeError(filePath);
|
|
70945
|
+
const scheduleIdentity = parseLocalEventScheduleIdentity(raw, filePath);
|
|
70957
70946
|
events.push({
|
|
70958
|
-
...
|
|
70947
|
+
...raw,
|
|
70948
|
+
...scheduleIdentity,
|
|
70959
70949
|
filePath
|
|
70960
70950
|
});
|
|
70961
70951
|
} catch (error) {
|
|
70952
|
+
if (error instanceof LegacyEventScheduleShapeError || error instanceof InvalidLocalEventScheduleIdentityError) throw error;
|
|
70962
70953
|
console.warn(`Warning: Could not parse ${filePath}:`, error);
|
|
70963
70954
|
}
|
|
70964
70955
|
return events;
|
|
@@ -74737,7 +74728,9 @@ function mapEventToComparable(e) {
|
|
|
74737
74728
|
slug: e.slug,
|
|
74738
74729
|
status: e.status,
|
|
74739
74730
|
visibility: e.visibility,
|
|
74740
|
-
|
|
74731
|
+
preset: e.preset,
|
|
74732
|
+
bookingScope: e.bookingScope,
|
|
74733
|
+
occurrences: e.occurrences,
|
|
74741
74734
|
capacity: e.capacity,
|
|
74742
74735
|
pricing: e.pricing,
|
|
74743
74736
|
paymentTerms: e.paymentTerms,
|
|
@@ -76530,6 +76523,14 @@ function normalizeEventPaymentTermsForCompare(paymentTerms) {
|
|
|
76530
76523
|
const result = classifySdkEventPaymentTerms(paymentTerms);
|
|
76531
76524
|
if (result.ok) return result.paymentTerms;
|
|
76532
76525
|
}
|
|
76526
|
+
var IncompatibleEventPullContractError = class extends Error {
|
|
76527
|
+
constructor(identifier, cause) {
|
|
76528
|
+
super(`Remote event "${identifier}" does not expose the canonical preset, bookingScope, and occurrences contract. Deploy the matching Riverbank API before using this SDK. ${cause.message}`);
|
|
76529
|
+
this.identifier = identifier;
|
|
76530
|
+
this.code = "incompatible_event_pull_contract";
|
|
76531
|
+
this.name = "IncompatibleEventPullContractError";
|
|
76532
|
+
}
|
|
76533
|
+
};
|
|
76533
76534
|
function normalizeVenueAddress(value) {
|
|
76534
76535
|
const obj = isRecord$9(value) ? value : {};
|
|
76535
76536
|
return {
|
|
@@ -76577,19 +76578,23 @@ function normalizeEventCategoryForCompare(category) {
|
|
|
76577
76578
|
}
|
|
76578
76579
|
function normalizeRemoteEventForCompare(event) {
|
|
76579
76580
|
const obj = isRecord$9(event) ? event : {};
|
|
76580
|
-
const
|
|
76581
|
+
const identifier = stringValue(obj.identifier, "<unknown>");
|
|
76582
|
+
let scheduleIdentity;
|
|
76583
|
+
try {
|
|
76584
|
+
scheduleIdentity = parseLocalEventScheduleIdentity(obj, `remote event "${identifier}"`);
|
|
76585
|
+
} catch (error) {
|
|
76586
|
+
if (error instanceof InvalidLocalEventScheduleIdentityError) throw new IncompatibleEventPullContractError(identifier, error);
|
|
76587
|
+
throw error;
|
|
76588
|
+
}
|
|
76581
76589
|
return {
|
|
76582
|
-
identifier
|
|
76590
|
+
identifier,
|
|
76583
76591
|
title: String(obj.title),
|
|
76584
76592
|
slug: String(obj.slug),
|
|
76585
76593
|
status: obj.status === "active" || obj.status === "draft" || obj.status === "archived" || obj.status === "cancelled" || obj.status === "completed" ? obj.status : "draft",
|
|
76586
76594
|
visibility: obj.visibility === "public" || obj.visibility === "private" || obj.visibility === "unlisted" ? obj.visibility : "private",
|
|
76587
|
-
|
|
76588
|
-
|
|
76589
|
-
|
|
76590
|
-
defaultStartTime: stringValue(schedule.defaultStartTime, "09:00:00"),
|
|
76591
|
-
durationMinutes: typeof schedule.durationMinutes === "number" ? schedule.durationMinutes : 60
|
|
76592
|
-
},
|
|
76595
|
+
preset: scheduleIdentity.preset,
|
|
76596
|
+
bookingScope: scheduleIdentity.bookingScope,
|
|
76597
|
+
occurrences: [...scheduleIdentity.occurrences],
|
|
76593
76598
|
capacity: nullishToNull(typeof obj.capacity === "number" ? obj.capacity : void 0),
|
|
76594
76599
|
pricing: normalizeEventPricingForCompare(obj.pricing),
|
|
76595
76600
|
paymentTerms: normalizeEventPaymentTermsForCompare(obj.paymentTerms),
|
|
@@ -76603,14 +76608,16 @@ function normalizeRemoteEventForCompare(event) {
|
|
|
76603
76608
|
};
|
|
76604
76609
|
}
|
|
76605
76610
|
function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
76606
|
-
const local =
|
|
76611
|
+
const local = localEvent;
|
|
76607
76612
|
const base = remoteEvent ? normalizeRemoteEventForCompare(remoteEvent) : normalizeRemoteEventForCompare({
|
|
76608
76613
|
identifier: local.identifier,
|
|
76609
76614
|
title: local.title,
|
|
76610
76615
|
slug: local.slug,
|
|
76611
76616
|
status: local.status ?? "draft",
|
|
76612
76617
|
visibility: local.visibility ?? "private",
|
|
76613
|
-
|
|
76618
|
+
preset: local.preset,
|
|
76619
|
+
bookingScope: local.bookingScope,
|
|
76620
|
+
occurrences: local.occurrences,
|
|
76614
76621
|
pricing: local.pricing ?? {},
|
|
76615
76622
|
paymentTerms: local.paymentTerms,
|
|
76616
76623
|
capacity: local.capacity ?? null,
|
|
@@ -76622,7 +76629,6 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
76622
76629
|
presentation: local.presentation ?? null,
|
|
76623
76630
|
tags: local.tags ?? []
|
|
76624
76631
|
});
|
|
76625
|
-
const schedule = isRecord$9(local.schedule) ? local.schedule : {};
|
|
76626
76632
|
return {
|
|
76627
76633
|
...base,
|
|
76628
76634
|
identifier: stringValue(local.identifier, base.identifier),
|
|
@@ -76630,12 +76636,9 @@ function normalizeLocalEventAgainstRemoteForCompare(localEvent, remoteEvent) {
|
|
|
76630
76636
|
slug: stringValue(local.slug, base.slug),
|
|
76631
76637
|
status: local.status === void 0 ? base.status : local.status === "active" || local.status === "draft" || local.status === "archived" || local.status === "cancelled" || local.status === "completed" ? local.status : "draft",
|
|
76632
76638
|
visibility: local.visibility === void 0 ? base.visibility : local.visibility === "public" || local.visibility === "private" || local.visibility === "unlisted" ? local.visibility : "private",
|
|
76633
|
-
|
|
76634
|
-
|
|
76635
|
-
|
|
76636
|
-
defaultStartTime: schedule.defaultStartTime === void 0 ? base.schedule.defaultStartTime : stringValue(schedule.defaultStartTime, base.schedule.defaultStartTime),
|
|
76637
|
-
durationMinutes: schedule.durationMinutes === void 0 ? base.schedule.durationMinutes : typeof schedule.durationMinutes === "number" ? schedule.durationMinutes : base.schedule.durationMinutes
|
|
76638
|
-
},
|
|
76639
|
+
preset: local.preset,
|
|
76640
|
+
bookingScope: local.bookingScope,
|
|
76641
|
+
occurrences: [...local.occurrences],
|
|
76639
76642
|
capacity: local.capacity === void 0 ? base.capacity : nullishToNull(typeof local.capacity === "number" ? local.capacity : void 0),
|
|
76640
76643
|
pricing: local.pricing === void 0 ? base.pricing : normalizeEventPricingForCompare(local.pricing),
|
|
76641
76644
|
paymentTerms: local.paymentTerms === void 0 ? base.paymentTerms : normalizeEventPaymentTermsForCompare(local.paymentTerms),
|
|
@@ -77206,12 +77209,13 @@ const navigationMenuRoles = [
|
|
|
77206
77209
|
"footer",
|
|
77207
77210
|
"legal-policy"
|
|
77208
77211
|
];
|
|
77209
|
-
const
|
|
77212
|
+
const eventPresets = [
|
|
77213
|
+
"event",
|
|
77210
77214
|
"class",
|
|
77215
|
+
"course",
|
|
77211
77216
|
"workshop",
|
|
77212
77217
|
"retreat",
|
|
77213
|
-
"performance"
|
|
77214
|
-
"custom"
|
|
77218
|
+
"performance"
|
|
77215
77219
|
];
|
|
77216
77220
|
const offeringVisibilities = [
|
|
77217
77221
|
"draft",
|
|
@@ -77295,7 +77299,7 @@ function createSiteStyleSelectionChangeSchema(parts) {
|
|
|
77295
77299
|
}).strict(),
|
|
77296
77300
|
z$1.object({
|
|
77297
77301
|
kind: z$1.literal("set-palette"),
|
|
77298
|
-
|
|
77302
|
+
palette: parts.palette
|
|
77299
77303
|
}).strict(),
|
|
77300
77304
|
z$1.object({
|
|
77301
77305
|
kind: z$1.literal("set-typography"),
|
|
@@ -77329,13 +77333,12 @@ function validateUniqueSiteStyleSelectionChanges(input, ctx) {
|
|
|
77329
77333
|
//#endregion
|
|
77330
77334
|
//#region ../site-commands/src/siteStyleCommandSchema.ts
|
|
77331
77335
|
init_buttons();
|
|
77332
|
-
init_palette();
|
|
77333
77336
|
const siteStyleRefSchema = z$1.string().regex(/^site-style:[a-z0-9][a-z0-9-]*$/u).transform((value) => value);
|
|
77334
77337
|
const catalogIdSchema = z$1.string().trim().min(1);
|
|
77335
77338
|
const selectionChangeSchema = createSiteStyleSelectionChangeSchema({
|
|
77336
77339
|
siteStyleId: siteStyleRefSchema,
|
|
77337
77340
|
buttonStyleSelection: buttonStyleSelectionSchema,
|
|
77338
|
-
|
|
77341
|
+
palette: paletteSchema,
|
|
77339
77342
|
typography: typographySchema,
|
|
77340
77343
|
headerLookId: catalogIdSchema,
|
|
77341
77344
|
headerLayoutId: catalogIdSchema,
|
|
@@ -77959,8 +77962,8 @@ const upsertEventSeriesCommandSchema = z$1.object({
|
|
|
77959
77962
|
slug: z$1.string().min(1),
|
|
77960
77963
|
path: z$1.string().startsWith("/").nullable().optional(),
|
|
77961
77964
|
title: z$1.string().min(1),
|
|
77962
|
-
|
|
77963
|
-
bookingScope: z$1.enum(["single_occurrence", "whole_series"])
|
|
77965
|
+
preset: z$1.enum(eventPresets),
|
|
77966
|
+
bookingScope: z$1.enum(["single_occurrence", "whole_series"]),
|
|
77964
77967
|
status: z$1.enum([
|
|
77965
77968
|
"draft",
|
|
77966
77969
|
"active",
|
|
@@ -79556,7 +79559,7 @@ function commandRefContributions(command) {
|
|
|
79556
79559
|
field: "input.contentEntryRef"
|
|
79557
79560
|
}] : []
|
|
79558
79561
|
};
|
|
79559
|
-
default: return assertNever$
|
|
79562
|
+
default: return assertNever$24(command);
|
|
79560
79563
|
}
|
|
79561
79564
|
}
|
|
79562
79565
|
function passRedemptionSubjectRefContribution(subject) {
|
|
@@ -79569,7 +79572,7 @@ function passRedemptionSubjectRefContribution(subject) {
|
|
|
79569
79572
|
ref: subject.eventRegistrationRef,
|
|
79570
79573
|
field: "input.subject.eventRegistrationRef"
|
|
79571
79574
|
};
|
|
79572
|
-
default: return assertNever$
|
|
79575
|
+
default: return assertNever$24(subject);
|
|
79573
79576
|
}
|
|
79574
79577
|
}
|
|
79575
79578
|
function portalOrderSubjectRefContribution(subject) {
|
|
@@ -79582,7 +79585,7 @@ function portalOrderSubjectRefContribution(subject) {
|
|
|
79582
79585
|
ref: subject.courseEnrollmentRef,
|
|
79583
79586
|
field: "input.subject.courseEnrollmentRef"
|
|
79584
79587
|
};
|
|
79585
|
-
default: return assertNever$
|
|
79588
|
+
default: return assertNever$24(subject);
|
|
79586
79589
|
}
|
|
79587
79590
|
}
|
|
79588
79591
|
function collectOfferingRequires(input, intervals, intervalPath) {
|
|
@@ -80236,7 +80239,7 @@ function stableStringify(value) {
|
|
|
80236
80239
|
case "object":
|
|
80237
80240
|
case "string": return JSON.stringify(sorted);
|
|
80238
80241
|
}
|
|
80239
|
-
return assertNever$
|
|
80242
|
+
return assertNever$24(sorted);
|
|
80240
80243
|
}
|
|
80241
80244
|
function sortValue(value) {
|
|
80242
80245
|
if (Array.isArray(value)) return value.map(sortValue);
|
|
@@ -80475,7 +80478,7 @@ function appliedSubjectFromOutcome(outcome) {
|
|
|
80475
80478
|
case "skipped_by_stop_policy":
|
|
80476
80479
|
case "compile_failed":
|
|
80477
80480
|
case "preflight_failed": return [];
|
|
80478
|
-
default: assertNever$
|
|
80481
|
+
default: assertNever$24(outcome);
|
|
80479
80482
|
}
|
|
80480
80483
|
}
|
|
80481
80484
|
function failureFromOutcome(outcome) {
|
|
@@ -80494,7 +80497,7 @@ function failureFromOutcome(outcome) {
|
|
|
80494
80497
|
};
|
|
80495
80498
|
case "applied":
|
|
80496
80499
|
case "skipped_by_stop_policy": return null;
|
|
80497
|
-
default: assertNever$
|
|
80500
|
+
default: assertNever$24(outcome);
|
|
80498
80501
|
}
|
|
80499
80502
|
}
|
|
80500
80503
|
function appliedCommand(command) {
|
|
@@ -80510,154 +80513,61 @@ function reportSubjectForCommandRef(subjectsByCommandRef, commandRef) {
|
|
|
80510
80513
|
throw new Error(`Internal command planning error: missing report subject for ${commandRef}.`);
|
|
80511
80514
|
}
|
|
80512
80515
|
//#endregion
|
|
80513
|
-
//#region
|
|
80514
|
-
|
|
80515
|
-
|
|
80516
|
-
|
|
80517
|
-
|
|
80518
|
-
return {
|
|
80519
|
-
|
|
80520
|
-
|
|
80521
|
-
|
|
80522
|
-
|
|
80523
|
-
|
|
80524
|
-
|
|
80525
|
-
|
|
80526
|
-
}
|
|
80527
|
-
|
|
80528
|
-
|
|
80529
|
-
|
|
80530
|
-
|
|
80531
|
-
|
|
80532
|
-
}
|
|
80533
|
-
function timePart(hours, minutes, seconds = "00") {
|
|
80534
|
-
return `${hours}:${minutes}:${seconds}`;
|
|
80535
|
-
}
|
|
80536
|
-
function parseSdkEventDateTime(value) {
|
|
80537
|
-
const explicitMatch = explicitOffsetDateTimeRegex.exec(value);
|
|
80538
|
-
if (explicitMatch) {
|
|
80539
|
-
const [, yearRaw, monthRaw, dayRaw, hours, minutes, seconds = "00", fraction] = explicitMatch;
|
|
80540
|
-
if (!yearRaw || !monthRaw || !dayRaw || !hours || !minutes) return null;
|
|
80541
|
-
if (!isValidDateParts(Number(yearRaw), Number(monthRaw), Number(dayRaw)) || !isZeroFraction(fraction)) return null;
|
|
80542
|
-
const epochMs = Date.parse(value);
|
|
80543
|
-
if (!Number.isFinite(epochMs)) return null;
|
|
80544
|
-
return {
|
|
80545
|
-
epochMs,
|
|
80546
|
-
date: datePart(yearRaw, monthRaw, dayRaw),
|
|
80547
|
-
time: timePart(hours, minutes, seconds),
|
|
80548
|
-
iso: new Date(epochMs).toISOString()
|
|
80549
|
-
};
|
|
80516
|
+
//#region src/cli/site-commands/eventScheduleCompiler.ts
|
|
80517
|
+
init_src$3();
|
|
80518
|
+
function compileExplicitEventSchedule(event) {
|
|
80519
|
+
if (event.occurrences.length === 0) return unsupported$1(event, `Event ${event.identifier} has no occurrences; event pushes require at least one explicit occurrence.`);
|
|
80520
|
+
const timeZone = event.occurrences[0]?.timeZone;
|
|
80521
|
+
if (!timeZone || event.occurrences.some((occurrence) => occurrence.timeZone !== timeZone)) return unsupported$1(event, `Event ${event.identifier} contains mixed occurrence timezones; one event series must use one IANA timezone.`);
|
|
80522
|
+
if (!isIanaTimeZone(timeZone)) return unsupported$1(event, `Event ${event.identifier} uses invalid IANA timezone "${timeZone}".`);
|
|
80523
|
+
const occurrences = [];
|
|
80524
|
+
const seenStartsAt = /* @__PURE__ */ new Set();
|
|
80525
|
+
for (const occurrence of event.occurrences) {
|
|
80526
|
+
const start = parseUtcIsoDateTimeString(occurrence.startsAt);
|
|
80527
|
+
const end = parseUtcIsoDateTimeString(occurrence.endsAt);
|
|
80528
|
+
if (!start.ok || !end.ok || Date.parse(end.value) <= Date.parse(start.value)) return unsupported$1(event, `Event ${event.identifier} contains an invalid occurrence; startsAt and endsAt must be offset-aware ISO datetimes with endsAt after startsAt.`);
|
|
80529
|
+
if (seenStartsAt.has(start.value)) return unsupported$1(event, `Event ${event.identifier} contains duplicate occurrence startsAt values; each session must start at a unique instant.`);
|
|
80530
|
+
seenStartsAt.add(start.value);
|
|
80531
|
+
occurrences.push({
|
|
80532
|
+
startAt: start.value,
|
|
80533
|
+
endAt: end.value
|
|
80534
|
+
});
|
|
80550
80535
|
}
|
|
80551
|
-
|
|
80552
|
-
|
|
80553
|
-
|
|
80554
|
-
|
|
80555
|
-
const year = Number(yearRaw);
|
|
80556
|
-
const month = Number(monthRaw);
|
|
80557
|
-
const day = Number(dayRaw);
|
|
80558
|
-
if (!isValidDateParts(year, month, day) || !isZeroFraction(fraction)) return null;
|
|
80559
|
-
const epochMs = Date.UTC(year, month - 1, day, Number(hours), Number(minutes), Number(seconds));
|
|
80560
|
-
return {
|
|
80561
|
-
epochMs,
|
|
80562
|
-
date: datePart(yearRaw, monthRaw, dayRaw),
|
|
80563
|
-
time: timePart(hours, minutes, seconds),
|
|
80564
|
-
iso: new Date(epochMs).toISOString()
|
|
80565
|
-
};
|
|
80566
|
-
}
|
|
80567
|
-
function durationMinutesBetween(startsAt, endsAt) {
|
|
80568
|
-
if (endsAt.epochMs <= startsAt.epochMs) return null;
|
|
80569
|
-
const durationMs = endsAt.epochMs - startsAt.epochMs;
|
|
80570
|
-
if (durationMs % 6e4 !== 0) return null;
|
|
80571
|
-
return durationMs / 6e4;
|
|
80572
|
-
}
|
|
80573
|
-
function exceedsMaxDuration(durationMinutes, options) {
|
|
80574
|
-
return options.maxDurationMinutes !== void 0 && durationMinutes > options.maxDurationMinutes;
|
|
80536
|
+
return ok$3({
|
|
80537
|
+
timeZone,
|
|
80538
|
+
occurrences
|
|
80539
|
+
});
|
|
80575
80540
|
}
|
|
80576
|
-
function
|
|
80577
|
-
return
|
|
80541
|
+
function scheduleFromExplicitEventOccurrence(occurrence) {
|
|
80542
|
+
return scheduleFromCommandOccurrence({
|
|
80543
|
+
startAt: occurrence.startsAt,
|
|
80544
|
+
endAt: occurrence.endsAt
|
|
80545
|
+
}, occurrence.timeZone);
|
|
80578
80546
|
}
|
|
80579
|
-
function
|
|
80580
|
-
|
|
80581
|
-
|
|
80582
|
-
|
|
80583
|
-
|
|
80584
|
-
|
|
80585
|
-
if (input.durationMinutes !== void 0 && input.durationMinutes !== null) {
|
|
80586
|
-
if (input.durationMinutes < 1) issues.push(issue(["durationMinutes"], "durationMinutes must be at least 1"));
|
|
80587
|
-
else if (exceedsMaxDuration(input.durationMinutes, options)) issues.push(issue(["durationMinutes"], maxDurationMessage(options)));
|
|
80547
|
+
function isIanaTimeZone(value) {
|
|
80548
|
+
try {
|
|
80549
|
+
new Intl.DateTimeFormat("en-GB", { timeZone: value });
|
|
80550
|
+
return true;
|
|
80551
|
+
} catch {
|
|
80552
|
+
return false;
|
|
80588
80553
|
}
|
|
80589
|
-
if (issues.length > 0) return {
|
|
80590
|
-
ok: false,
|
|
80591
|
-
issues
|
|
80592
|
-
};
|
|
80593
|
-
return {
|
|
80594
|
-
ok: true,
|
|
80595
|
-
kind: "canonical",
|
|
80596
|
-
canonical: {
|
|
80597
|
-
recurrenceRule: input.recurrenceRule ?? null,
|
|
80598
|
-
startDate: input.startDate,
|
|
80599
|
-
defaultStartTime: input.defaultStartTime ?? "09:00:00",
|
|
80600
|
-
durationMinutes: input.durationMinutes ?? 60
|
|
80601
|
-
}
|
|
80602
|
-
};
|
|
80603
80554
|
}
|
|
80604
|
-
function
|
|
80605
|
-
const
|
|
80606
|
-
const hasStartsAt = input.startsAt !== void 0 && input.startsAt !== null;
|
|
80607
|
-
const hasEndsAt = input.endsAt !== void 0 && input.endsAt !== null;
|
|
80608
|
-
const hasDateTimeDuration = hasStartsAt && input.durationMinutes !== void 0 && input.durationMinutes !== null;
|
|
80609
|
-
const hasCanonicalStart = input.startDate !== void 0 || input.defaultStartTime !== void 0;
|
|
80610
|
-
if (!hasStartsAt && !hasEndsAt) return classifyCanonicalSchedule(input, options);
|
|
80611
|
-
if (hasStartsAt && hasCanonicalStart) issues.push(issue(["startsAt"], "Use either startsAt or startDate/defaultStartTime, not both"));
|
|
80612
|
-
if (input.recurrenceRule) issues.push(issue(["recurrenceRule"], "startsAt schedules are only supported for one-off events"));
|
|
80613
|
-
if (!hasStartsAt) issues.push(issue(["startsAt"], "startsAt is required when endsAt is provided"));
|
|
80614
|
-
if (!hasEndsAt && !hasDateTimeDuration) issues.push(issue(["endsAt"], "Provide either endsAt or durationMinutes with startsAt"));
|
|
80615
|
-
if (hasEndsAt && hasDateTimeDuration) issues.push(issue(["endsAt"], "Use either endsAt or durationMinutes with startsAt, not both"));
|
|
80616
|
-
const startsAt = typeof input.startsAt === "string" ? parseSdkEventDateTime(input.startsAt) : null;
|
|
80617
|
-
const endsAt = typeof input.endsAt === "string" ? parseSdkEventDateTime(input.endsAt) : null;
|
|
80618
|
-
if (hasStartsAt && !startsAt) issues.push(issue(["startsAt"], "Invalid datetime format. Use ISO datetime format, e.g. 2026-06-01T10:00:00Z"));
|
|
80619
|
-
if (hasEndsAt && !endsAt) issues.push(issue(["endsAt"], "Invalid datetime format. Use ISO datetime format, e.g. 2026-06-07T10:00:00Z"));
|
|
80620
|
-
if (startsAt && endsAt) {
|
|
80621
|
-
const durationMinutes = durationMinutesBetween(startsAt, endsAt);
|
|
80622
|
-
if (durationMinutes === null) issues.push(issue(["endsAt"], "endsAt must be after startsAt and align to a whole minute"));
|
|
80623
|
-
else if (exceedsMaxDuration(durationMinutes, options)) issues.push(issue(["endsAt"], maxDurationMessage(options)));
|
|
80624
|
-
if (issues.length === 0 && durationMinutes !== null) return {
|
|
80625
|
-
ok: true,
|
|
80626
|
-
kind: "start-end",
|
|
80627
|
-
canonical: {
|
|
80628
|
-
recurrenceRule: null,
|
|
80629
|
-
startDate: startsAt.date,
|
|
80630
|
-
defaultStartTime: startsAt.time,
|
|
80631
|
-
durationMinutes
|
|
80632
|
-
},
|
|
80633
|
-
startsAtIso: startsAt.iso,
|
|
80634
|
-
endsAtIso: endsAt.iso
|
|
80635
|
-
};
|
|
80636
|
-
}
|
|
80637
|
-
if (startsAt && hasDateTimeDuration && input.durationMinutes !== void 0 && input.durationMinutes !== null) {
|
|
80638
|
-
if (input.durationMinutes < 1) issues.push(issue(["durationMinutes"], "durationMinutes must be at least 1"));
|
|
80639
|
-
else if (exceedsMaxDuration(input.durationMinutes, options)) issues.push(issue(["durationMinutes"], maxDurationMessage(options)));
|
|
80640
|
-
if (issues.length === 0) {
|
|
80641
|
-
const endsAtMs = startsAt.epochMs + input.durationMinutes * 6e4;
|
|
80642
|
-
return {
|
|
80643
|
-
ok: true,
|
|
80644
|
-
kind: "start-duration",
|
|
80645
|
-
canonical: {
|
|
80646
|
-
recurrenceRule: null,
|
|
80647
|
-
startDate: startsAt.date,
|
|
80648
|
-
defaultStartTime: startsAt.time,
|
|
80649
|
-
durationMinutes: input.durationMinutes
|
|
80650
|
-
},
|
|
80651
|
-
startsAtIso: startsAt.iso,
|
|
80652
|
-
endsAtIso: new Date(endsAtMs).toISOString()
|
|
80653
|
-
};
|
|
80654
|
-
}
|
|
80655
|
-
}
|
|
80555
|
+
function scheduleFromCommandOccurrence(occurrence, timeZone) {
|
|
80556
|
+
const start = new Date(occurrence.startAt);
|
|
80656
80557
|
return {
|
|
80657
|
-
|
|
80658
|
-
|
|
80558
|
+
recurrenceRule: null,
|
|
80559
|
+
startDate: formatLocalScheduleDate(getLocalScheduleDate(start, timeZone)),
|
|
80560
|
+
defaultStartTime: formatLocalScheduleTime(getLocalScheduleTime(start, timeZone)),
|
|
80561
|
+
durationMinutes: Math.round((Date.parse(occurrence.endAt) - Date.parse(occurrence.startAt)) / 6e4)
|
|
80659
80562
|
};
|
|
80660
80563
|
}
|
|
80564
|
+
function unsupported$1(event, message) {
|
|
80565
|
+
return err$3({
|
|
80566
|
+
code: "unsupported_local_shape",
|
|
80567
|
+
identifier: event.identifier,
|
|
80568
|
+
message
|
|
80569
|
+
});
|
|
80570
|
+
}
|
|
80661
80571
|
//#endregion
|
|
80662
80572
|
//#region src/cli/site-commands/datedOfferingCommands.ts
|
|
80663
80573
|
init_src$3();
|
|
@@ -80824,9 +80734,8 @@ function eventCategoryCommand(category) {
|
|
|
80824
80734
|
}
|
|
80825
80735
|
function eventSeriesCommand(event) {
|
|
80826
80736
|
if (event.identifier !== event.slug) return unsupported(event.identifier, `Event identifier "${event.identifier}" must match slug "${event.slug}".`);
|
|
80827
|
-
|
|
80828
|
-
|
|
80829
|
-
if (!occurrence.ok) return occurrence;
|
|
80737
|
+
const schedule = compileExplicitEventSchedule(event);
|
|
80738
|
+
if (!schedule.ok) return schedule;
|
|
80830
80739
|
const pricing = eventPricing(event);
|
|
80831
80740
|
if (!pricing.ok) return pricing;
|
|
80832
80741
|
const content = event.content ? {
|
|
@@ -80845,11 +80754,11 @@ function eventSeriesCommand(event) {
|
|
|
80845
80754
|
slug: event.slug,
|
|
80846
80755
|
path: event.path,
|
|
80847
80756
|
title: event.title,
|
|
80848
|
-
|
|
80849
|
-
bookingScope:
|
|
80757
|
+
preset: event.preset,
|
|
80758
|
+
bookingScope: event.bookingScope,
|
|
80850
80759
|
status: event.status === "completed" ? void 0 : event.status,
|
|
80851
80760
|
visibility: offeringVisibility(event.visibility, event.status),
|
|
80852
|
-
timezone:
|
|
80761
|
+
timezone: schedule.value.timeZone,
|
|
80853
80762
|
venueIdentifier: event.venueRef ?? void 0,
|
|
80854
80763
|
categoryIdentifier: event.categoryRef ?? void 0,
|
|
80855
80764
|
formIdentifier: event.formRef ?? void 0,
|
|
@@ -80858,7 +80767,7 @@ function eventSeriesCommand(event) {
|
|
|
80858
80767
|
priceDisplay: pricing.value.priceDisplay ?? void 0,
|
|
80859
80768
|
acceptsPasses: pricing.value.acceptsPasses,
|
|
80860
80769
|
acceptsMemberships: pricing.value.acceptsMemberships,
|
|
80861
|
-
occurrences:
|
|
80770
|
+
occurrences: schedule.value.occurrences,
|
|
80862
80771
|
content,
|
|
80863
80772
|
settings: event.settings,
|
|
80864
80773
|
paymentTerms: event.paymentTerms,
|
|
@@ -80868,23 +80777,6 @@ function eventSeriesCommand(event) {
|
|
|
80868
80777
|
}
|
|
80869
80778
|
});
|
|
80870
80779
|
}
|
|
80871
|
-
function eventOccurrence(event) {
|
|
80872
|
-
const scheduleClassification = classifySdkEventSchedule(event.schedule ?? {});
|
|
80873
|
-
if (!scheduleClassification.ok) return unsupported(event.identifier, `Event ${event.identifier} has an invalid schedule: ${scheduleClassification.issues.map((validationIssue) => validationIssue.message).join("; ")}`);
|
|
80874
|
-
if (scheduleClassification.kind === "start-end" || scheduleClassification.kind === "start-duration") return ok$3({
|
|
80875
|
-
startAt: scheduleClassification.startsAtIso,
|
|
80876
|
-
endAt: scheduleClassification.endsAtIso
|
|
80877
|
-
});
|
|
80878
|
-
const startDate = event.schedule?.startDate;
|
|
80879
|
-
if (!startDate) return unsupported(event.identifier, `Event ${event.identifier} is missing schedule.startDate; command-backed event pushes require a concrete occurrence.`);
|
|
80880
|
-
const startTime = event.schedule?.defaultStartTime ?? "09:00:00";
|
|
80881
|
-
const durationMinutes = event.schedule?.durationMinutes ?? 60;
|
|
80882
|
-
const startAt = toUtcIso(startDate, startTime);
|
|
80883
|
-
return ok$3({
|
|
80884
|
-
startAt,
|
|
80885
|
-
endAt: new Date(Date.parse(startAt) + durationMinutes * 6e4).toISOString()
|
|
80886
|
-
});
|
|
80887
|
-
}
|
|
80888
80780
|
function eventPricing(event) {
|
|
80889
80781
|
const pricing = classifySdkEventPricing(event.pricing);
|
|
80890
80782
|
if (!pricing.ok) return unsupported(event.identifier, `Event ${event.identifier} has invalid pricing: ${pricing.issues[0]?.message ?? "invalid pricing"}.`);
|
|
@@ -80917,7 +80809,7 @@ function eventPricing(event) {
|
|
|
80917
80809
|
acceptsPasses: pricing.pricing.acceptsPasses,
|
|
80918
80810
|
acceptsMemberships: pricing.pricing.acceptsMemberships
|
|
80919
80811
|
});
|
|
80920
|
-
default: return assertNever$
|
|
80812
|
+
default: return assertNever$24(pricing.pricing);
|
|
80921
80813
|
}
|
|
80922
80814
|
}
|
|
80923
80815
|
function venueUpsertInput(command) {
|
|
@@ -80930,10 +80822,17 @@ function eventSeriesUpsertInput(command) {
|
|
|
80930
80822
|
identifier: command.input.slug,
|
|
80931
80823
|
title: command.input.title,
|
|
80932
80824
|
slug: command.input.slug,
|
|
80825
|
+
preset: command.input.preset,
|
|
80826
|
+
bookingScope: command.input.bookingScope,
|
|
80827
|
+
occurrences: command.input.occurrences.map((item) => ({
|
|
80828
|
+
startsAt: item.startAt,
|
|
80829
|
+
endsAt: item.endAt,
|
|
80830
|
+
timeZone: command.input.timezone
|
|
80831
|
+
})),
|
|
80933
80832
|
path: command.input.path,
|
|
80934
80833
|
status: command.input.status,
|
|
80935
80834
|
visibility: managementVisibility(command.input.visibility),
|
|
80936
|
-
schedule:
|
|
80835
|
+
schedule: scheduleFromCommandOccurrence(occurrence, command.input.timezone),
|
|
80937
80836
|
capacity: capacityLimit(command.input.capacity),
|
|
80938
80837
|
pricing: eventPricingInput(command.input),
|
|
80939
80838
|
...command.input.paymentTerms === void 0 ? {} : { paymentTerms: command.input.paymentTerms },
|
|
@@ -80978,7 +80877,7 @@ function eventPricingInput(input) {
|
|
|
80978
80877
|
};
|
|
80979
80878
|
case "manual_payment":
|
|
80980
80879
|
case "external": throw new Error(`Unsupported event pricing mode reached SDK mapper: ${input.pricing.kind}`);
|
|
80981
|
-
default: return assertNever$
|
|
80880
|
+
default: return assertNever$24(input.pricing);
|
|
80982
80881
|
}
|
|
80983
80882
|
}
|
|
80984
80883
|
function increment(result, counter) {
|
|
@@ -80992,7 +80891,7 @@ function increment(result, counter) {
|
|
|
80992
80891
|
case "deleted":
|
|
80993
80892
|
result.deleted++;
|
|
80994
80893
|
return;
|
|
80995
|
-
default: assertNever$
|
|
80894
|
+
default: assertNever$24(counter);
|
|
80996
80895
|
}
|
|
80997
80896
|
}
|
|
80998
80897
|
async function applyDatedOfferingCommand(client, command) {
|
|
@@ -81021,7 +80920,7 @@ async function applyDatedOfferingCommand(client, command) {
|
|
|
81021
80920
|
case "deleteEventSeries":
|
|
81022
80921
|
await client.events.delete(command.input.identifier);
|
|
81023
80922
|
return;
|
|
81024
|
-
default: assertNever$
|
|
80923
|
+
default: assertNever$24(command);
|
|
81025
80924
|
}
|
|
81026
80925
|
}
|
|
81027
80926
|
function capacity(value) {
|
|
@@ -81045,21 +80944,9 @@ function managementVisibility(visibility) {
|
|
|
81045
80944
|
case "unlisted": return "unlisted";
|
|
81046
80945
|
case "listed":
|
|
81047
80946
|
case "published": return "public";
|
|
81048
|
-
default: return assertNever$
|
|
80947
|
+
default: return assertNever$24(visibility);
|
|
81049
80948
|
}
|
|
81050
80949
|
}
|
|
81051
|
-
function scheduleFromOccurrence(occurrence) {
|
|
81052
|
-
return {
|
|
81053
|
-
recurrenceRule: null,
|
|
81054
|
-
startDate: occurrence.startAt.slice(0, 10),
|
|
81055
|
-
defaultStartTime: occurrence.startAt.slice(11, 19),
|
|
81056
|
-
durationMinutes: Math.round((Date.parse(occurrence.endAt) - Date.parse(occurrence.startAt)) / 6e4)
|
|
81057
|
-
};
|
|
81058
|
-
}
|
|
81059
|
-
function toUtcIso(date, time) {
|
|
81060
|
-
const normalizedTime = time.length === 5 ? `${time}:00` : time;
|
|
81061
|
-
return (/* @__PURE__ */ new Date(`${date}T${normalizedTime}Z`)).toISOString();
|
|
81062
|
-
}
|
|
81063
80950
|
function unsupported(identifier, message) {
|
|
81064
80951
|
return err$3({
|
|
81065
80952
|
code: "unsupported_local_shape",
|
|
@@ -81090,7 +80977,7 @@ function commandReportToSyncResult(input) {
|
|
|
81090
80977
|
input.recordFailure(result, outcome.identifier, outcome.message, outcome.subject);
|
|
81091
80978
|
break;
|
|
81092
80979
|
case "skipped_by_stop_policy": break;
|
|
81093
|
-
default: assertNever$
|
|
80980
|
+
default: assertNever$24(outcome);
|
|
81094
80981
|
}
|
|
81095
80982
|
result.warnings.push(...input.report.warnings);
|
|
81096
80983
|
return result;
|
|
@@ -81162,7 +81049,7 @@ async function executeEntryCommandPlan(input) {
|
|
|
81162
81049
|
case "deleteContentEntry":
|
|
81163
81050
|
await input.client.entries.delete(command.input.contentTypeKey, entryIdentifierForCommand(command));
|
|
81164
81051
|
return;
|
|
81165
|
-
default: assertNever$
|
|
81052
|
+
default: assertNever$24(command);
|
|
81166
81053
|
}
|
|
81167
81054
|
}
|
|
81168
81055
|
});
|
|
@@ -81322,7 +81209,7 @@ function incrementEntrySuccess(result, subject) {
|
|
|
81322
81209
|
case "deleted":
|
|
81323
81210
|
result.entries.deleted++;
|
|
81324
81211
|
return;
|
|
81325
|
-
default: assertNever$
|
|
81212
|
+
default: assertNever$24(subject.counter);
|
|
81326
81213
|
}
|
|
81327
81214
|
}
|
|
81328
81215
|
function reportSubject(input) {
|
|
@@ -81385,7 +81272,7 @@ async function executeFormCommandPlan(input) {
|
|
|
81385
81272
|
settings: command.input.settings ?? {}
|
|
81386
81273
|
});
|
|
81387
81274
|
return;
|
|
81388
|
-
default: assertNever$
|
|
81275
|
+
default: assertNever$24(commandType);
|
|
81389
81276
|
}
|
|
81390
81277
|
}
|
|
81391
81278
|
});
|
|
@@ -81464,7 +81351,7 @@ function incrementFormSuccess(result, subject) {
|
|
|
81464
81351
|
case "updated":
|
|
81465
81352
|
result.forms.updated++;
|
|
81466
81353
|
return;
|
|
81467
|
-
default: assertNever$
|
|
81354
|
+
default: assertNever$24(subject.counter);
|
|
81468
81355
|
}
|
|
81469
81356
|
}
|
|
81470
81357
|
function recordFormFailure(result, identifier, message) {
|
|
@@ -81509,7 +81396,7 @@ async function executeFooterCommandPlan(input) {
|
|
|
81509
81396
|
if (command.input.bottomText !== void 0 && command.input.bottomText !== null && !isRichTextDoc(command.input.bottomText)) throw new Error("Footer bottomText must be a canonical TipTap document");
|
|
81510
81397
|
await input.client.footer.upsert({ bottomText: command.input.bottomText });
|
|
81511
81398
|
return;
|
|
81512
|
-
default: assertNever$
|
|
81399
|
+
default: assertNever$24(commandType);
|
|
81513
81400
|
}
|
|
81514
81401
|
}
|
|
81515
81402
|
});
|
|
@@ -81632,7 +81519,7 @@ async function executeNavigationCommandPlan(input) {
|
|
|
81632
81519
|
});
|
|
81633
81520
|
return;
|
|
81634
81521
|
}
|
|
81635
|
-
default: assertNever$
|
|
81522
|
+
default: assertNever$24(commandType);
|
|
81636
81523
|
}
|
|
81637
81524
|
}
|
|
81638
81525
|
});
|
|
@@ -81659,7 +81546,7 @@ function navigationCompileErrorIdentifier(error) {
|
|
|
81659
81546
|
case "missing_local_navigation_menu": return error.name;
|
|
81660
81547
|
case "duplicate_navigation_identity": return error.identity;
|
|
81661
81548
|
case "command_validation_failed": return "command-validation";
|
|
81662
|
-
default: return assertNever$
|
|
81549
|
+
default: return assertNever$24(error);
|
|
81663
81550
|
}
|
|
81664
81551
|
}
|
|
81665
81552
|
function navigationCommandExecutionToReport(input) {
|
|
@@ -81704,7 +81591,7 @@ function navigationCommandRole$1(command) {
|
|
|
81704
81591
|
case "header": return "primary";
|
|
81705
81592
|
case "footer": return "footer";
|
|
81706
81593
|
case void 0: return;
|
|
81707
|
-
default: return assertNever$
|
|
81594
|
+
default: return assertNever$24(command.input.location);
|
|
81708
81595
|
}
|
|
81709
81596
|
}
|
|
81710
81597
|
function incrementNavigationSuccess(result, subject) {
|
|
@@ -81715,7 +81602,7 @@ function incrementNavigationSuccess(result, subject) {
|
|
|
81715
81602
|
case "updated":
|
|
81716
81603
|
result.navigation.updated++;
|
|
81717
81604
|
return;
|
|
81718
|
-
default: assertNever$
|
|
81605
|
+
default: assertNever$24(subject.counter);
|
|
81719
81606
|
}
|
|
81720
81607
|
}
|
|
81721
81608
|
function recordNavigationFailure(result, identifier, message) {
|
|
@@ -81994,7 +81881,7 @@ async function executePageCommandPlan(input) {
|
|
|
81994
81881
|
case "unpublishPage":
|
|
81995
81882
|
await input.client.pages.unpublish(pageIdentifierForCommand(command));
|
|
81996
81883
|
return;
|
|
81997
|
-
default: assertNever$
|
|
81884
|
+
default: assertNever$24(command);
|
|
81998
81885
|
}
|
|
81999
81886
|
}
|
|
82000
81887
|
});
|
|
@@ -82096,7 +81983,7 @@ function preflightFailureFromPageCompileError(input) {
|
|
|
82096
81983
|
},
|
|
82097
81984
|
warnings: []
|
|
82098
81985
|
};
|
|
82099
|
-
default: assertNever$
|
|
81986
|
+
default: assertNever$24(input.error);
|
|
82100
81987
|
}
|
|
82101
81988
|
}
|
|
82102
81989
|
function pageCommandReportToSyncResult(report) {
|
|
@@ -82311,7 +82198,7 @@ function validateLocalBlock(input) {
|
|
|
82311
82198
|
case "builtin_found":
|
|
82312
82199
|
case "custom_found":
|
|
82313
82200
|
case "extension_only_custom_found": break;
|
|
82314
|
-
default: assertNever$
|
|
82201
|
+
default: assertNever$24(resolution);
|
|
82315
82202
|
}
|
|
82316
82203
|
const validation = validateBlockData(input.data, resolution.manifest, resolution.kind === "builtin_found" || resolution.kind === "custom_found" ? [...resolution.extensionFields] : void 0);
|
|
82317
82204
|
const warnings = formatValidationResult(input.pageIdentifier, input.blockIdentifier, input.kind, validation);
|
|
@@ -82338,7 +82225,7 @@ function incrementPageSuccess(result, subject) {
|
|
|
82338
82225
|
case "block":
|
|
82339
82226
|
incrementBlockCounter(result, subject.counter);
|
|
82340
82227
|
return;
|
|
82341
|
-
default: assertNever$
|
|
82228
|
+
default: assertNever$24(subject);
|
|
82342
82229
|
}
|
|
82343
82230
|
}
|
|
82344
82231
|
function pageCommandDisplayIdentifier(command) {
|
|
@@ -82349,7 +82236,7 @@ function pageCommandDisplayIdentifier(command) {
|
|
|
82349
82236
|
case "upsertPageBlock":
|
|
82350
82237
|
case "deletePageBlock": return [pageIdentifierForBlockCommand(command), blockIdentifierForCommand(command)].join("/");
|
|
82351
82238
|
case "reorderPageBlocks": return `${pageIdentifierForBlockCommand(command)}/blocks`;
|
|
82352
|
-
default: assertNever$
|
|
82239
|
+
default: assertNever$24(command);
|
|
82353
82240
|
}
|
|
82354
82241
|
}
|
|
82355
82242
|
function recordPageFailure(result, identifier, message, subject) {
|
|
@@ -82383,7 +82270,7 @@ function incrementPageCounter(result, counter) {
|
|
|
82383
82270
|
case "unpublished":
|
|
82384
82271
|
result.pages.unpublished++;
|
|
82385
82272
|
return;
|
|
82386
|
-
default: assertNever$
|
|
82273
|
+
default: assertNever$24(counter);
|
|
82387
82274
|
}
|
|
82388
82275
|
}
|
|
82389
82276
|
function incrementBlockCounter(result, counter) {
|
|
@@ -82398,7 +82285,7 @@ function incrementBlockCounter(result, counter) {
|
|
|
82398
82285
|
result.blocks.deleted++;
|
|
82399
82286
|
return;
|
|
82400
82287
|
case "reordered": return;
|
|
82401
|
-
default: assertNever$
|
|
82288
|
+
default: assertNever$24(counter);
|
|
82402
82289
|
}
|
|
82403
82290
|
}
|
|
82404
82291
|
function pageReportSubject(input) {
|
|
@@ -82440,7 +82327,7 @@ function compileContentPushExecutionPlan(plan, input, dependencies = {}) {
|
|
|
82440
82327
|
});
|
|
82441
82328
|
break;
|
|
82442
82329
|
}
|
|
82443
|
-
default: assertNever$
|
|
82330
|
+
default: assertNever$24(step);
|
|
82444
82331
|
}
|
|
82445
82332
|
return ok$3({
|
|
82446
82333
|
kind: "compiled-sync-steps",
|
|
@@ -82494,7 +82381,7 @@ async function executeCommandSurfaceAsReport(surface, input) {
|
|
|
82494
82381
|
onBeforeExecute: input.onNavigationCommandCount
|
|
82495
82382
|
})
|
|
82496
82383
|
};
|
|
82497
|
-
default: assertNever$
|
|
82384
|
+
default: assertNever$24(surface);
|
|
82498
82385
|
}
|
|
82499
82386
|
}
|
|
82500
82387
|
function preflightCommandSurfaceAsReport(surface, input) {
|
|
@@ -82519,7 +82406,7 @@ function preflightCommandSurfaceAsReport(surface, input) {
|
|
|
82519
82406
|
surface: "navigation",
|
|
82520
82407
|
report: reportFromOutcomes({ outcomes: [] })
|
|
82521
82408
|
};
|
|
82522
|
-
default: assertNever$
|
|
82409
|
+
default: assertNever$24(surface);
|
|
82523
82410
|
}
|
|
82524
82411
|
}
|
|
82525
82412
|
function skippedRemainingCommandReports(steps) {
|
|
@@ -82531,7 +82418,7 @@ function commandSurfaceReportToSyncResult(report) {
|
|
|
82531
82418
|
case "page": return pageCommandReportToSyncResult(report.report);
|
|
82532
82419
|
case "form": return formCommandReportToSyncResult(report.report);
|
|
82533
82420
|
case "navigation": return navigationCommandReportToSyncResult(report.report);
|
|
82534
|
-
default: assertNever$
|
|
82421
|
+
default: assertNever$24(report);
|
|
82535
82422
|
}
|
|
82536
82423
|
}
|
|
82537
82424
|
function commandSurfaceReportHasFailures(report) {
|
|
@@ -82581,7 +82468,7 @@ function compileCommandSurface(surface, input) {
|
|
|
82581
82468
|
local: input.local
|
|
82582
82469
|
})
|
|
82583
82470
|
};
|
|
82584
|
-
default: assertNever$
|
|
82471
|
+
default: assertNever$24(surface);
|
|
82585
82472
|
}
|
|
82586
82473
|
}
|
|
82587
82474
|
function commandSurfaceCompileSuccess(surface) {
|
|
@@ -82614,7 +82501,7 @@ function commandSurfaceCompileSuccess(surface) {
|
|
|
82614
82501
|
surface: "navigation",
|
|
82615
82502
|
report: navigationCommandCompileErrorToReport(surface.compileResult.error)
|
|
82616
82503
|
}));
|
|
82617
|
-
default: assertNever$
|
|
82504
|
+
default: assertNever$24(surface);
|
|
82618
82505
|
}
|
|
82619
82506
|
}
|
|
82620
82507
|
function contentPushReportWithCommandReport(commandReport) {
|
|
@@ -82644,7 +82531,7 @@ function skippedCommandSurfaceReport(surface) {
|
|
|
82644
82531
|
surface: "navigation",
|
|
82645
82532
|
report: reportFromOutcomes({ outcomes: skippedOutcomes(surface.compileValue.reportedCommands, navigationSkippedIdentifier) })
|
|
82646
82533
|
};
|
|
82647
|
-
default: assertNever$
|
|
82534
|
+
default: assertNever$24(surface);
|
|
82648
82535
|
}
|
|
82649
82536
|
}
|
|
82650
82537
|
function skippedOutcomes(reportedCommands, identifierForSubject) {
|
|
@@ -82663,7 +82550,7 @@ function pageSkippedIdentifier(subject) {
|
|
|
82663
82550
|
switch (subject.resource) {
|
|
82664
82551
|
case "page": return subject.identifier;
|
|
82665
82552
|
case "block": return `${subject.pageIdentifier}/${subject.identifier}`;
|
|
82666
|
-
default: assertNever$
|
|
82553
|
+
default: assertNever$24(subject);
|
|
82667
82554
|
}
|
|
82668
82555
|
}
|
|
82669
82556
|
function formSkippedIdentifier(subject) {
|
|
@@ -82798,7 +82685,7 @@ function planContentPushExecution(input) {
|
|
|
82798
82685
|
case "pages": return pageCommandRouting(input.diff).kind === "command_backed" ? syncPlanWithSteps([commandSurfaceStep("page", "continue")]) : syncPlanWithResidualOnly(input);
|
|
82799
82686
|
case "settings": return syncPlanWithResidualOnly(input);
|
|
82800
82687
|
case "all": return pushAllExecutionPlan(input);
|
|
82801
|
-
default: assertNever$
|
|
82688
|
+
default: assertNever$24(input.pushScope);
|
|
82802
82689
|
}
|
|
82803
82690
|
}
|
|
82804
82691
|
function pushAllExecutionPlan(input) {
|
|
@@ -82934,7 +82821,7 @@ async function executePushExecutionSteps(steps, input, dependencies) {
|
|
|
82934
82821
|
}
|
|
82935
82822
|
break;
|
|
82936
82823
|
}
|
|
82937
|
-
default: assertNever$
|
|
82824
|
+
default: assertNever$24(step);
|
|
82938
82825
|
}
|
|
82939
82826
|
return {
|
|
82940
82827
|
commandReports,
|
|
@@ -84648,7 +84535,7 @@ function entryDiffForDecision(decision, remoteEntries) {
|
|
|
84648
84535
|
case "conflict":
|
|
84649
84536
|
case "preserve_remote":
|
|
84650
84537
|
case "unchanged": return null;
|
|
84651
|
-
default: assertNever$
|
|
84538
|
+
default: assertNever$24(decision);
|
|
84652
84539
|
}
|
|
84653
84540
|
}
|
|
84654
84541
|
function remoteEntryForDecision(decision, remoteEntries) {
|
|
@@ -86708,7 +86595,7 @@ async function applyOneOffEntryCommand(command, client) {
|
|
|
86708
86595
|
case "deleteContentEntry":
|
|
86709
86596
|
await client.entries.delete(command.input.contentTypeKey, entryIdentifierForCommand(command));
|
|
86710
86597
|
return;
|
|
86711
|
-
default: assertNever$
|
|
86598
|
+
default: assertNever$24(command);
|
|
86712
86599
|
}
|
|
86713
86600
|
}
|
|
86714
86601
|
async function applyOneOffEntryCommandReturningEntry(command, client) {
|
|
@@ -86742,7 +86629,7 @@ async function applyOneOffPageCommand(command, client) {
|
|
|
86742
86629
|
case "deletePageBlock":
|
|
86743
86630
|
await client.blocks.delete(pageIdentifierForBlockCommand(command), blockIdentifierForCommand(command));
|
|
86744
86631
|
return;
|
|
86745
|
-
default: assertNever$
|
|
86632
|
+
default: assertNever$24(command);
|
|
86746
86633
|
}
|
|
86747
86634
|
}
|
|
86748
86635
|
async function applyOneOffPageCommandReturningPage(command, client) {
|
|
@@ -86821,7 +86708,7 @@ function oneOffEntryCommandBinding(mutation) {
|
|
|
86821
86708
|
counter: "unpublished"
|
|
86822
86709
|
}
|
|
86823
86710
|
};
|
|
86824
|
-
default: assertNever$
|
|
86711
|
+
default: assertNever$24(mutation);
|
|
86825
86712
|
}
|
|
86826
86713
|
}
|
|
86827
86714
|
function oneOffPageCommandBinding(mutation) {
|
|
@@ -86870,7 +86757,7 @@ function oneOffPageCommandBinding(mutation) {
|
|
|
86870
86757
|
counter: "unpublished"
|
|
86871
86758
|
}
|
|
86872
86759
|
};
|
|
86873
|
-
default: assertNever$
|
|
86760
|
+
default: assertNever$24(mutation);
|
|
86874
86761
|
}
|
|
86875
86762
|
}
|
|
86876
86763
|
function oneOffBlockCommandBinding(mutation) {
|
|
@@ -86919,7 +86806,7 @@ function oneOffBlockCommandBinding(mutation) {
|
|
|
86919
86806
|
}
|
|
86920
86807
|
};
|
|
86921
86808
|
}
|
|
86922
|
-
default: assertNever$
|
|
86809
|
+
default: assertNever$24(mutation);
|
|
86923
86810
|
}
|
|
86924
86811
|
}
|
|
86925
86812
|
function oneOffNavigationCommandBinding(mutation) {
|
|
@@ -86958,7 +86845,7 @@ function navigationCommandRole(command) {
|
|
|
86958
86845
|
case "header": return "primary";
|
|
86959
86846
|
case "footer": return "footer";
|
|
86960
86847
|
case void 0: return;
|
|
86961
|
-
default: return assertNever$
|
|
86848
|
+
default: return assertNever$24(command.input.location);
|
|
86962
86849
|
}
|
|
86963
86850
|
}
|
|
86964
86851
|
function isManagementPage(value) {
|
|
@@ -144811,15 +144698,20 @@ var init_usePaymentVerification = __esmMin((() => {
|
|
|
144811
144698
|
//#endregion
|
|
144812
144699
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.ts
|
|
144813
144700
|
function useEventRegistrationStripeReturn(options) {
|
|
144701
|
+
return useEventRegistrationStripeReturnWithDeps(options, eventRegistrationStripeReturnDeps);
|
|
144702
|
+
}
|
|
144703
|
+
function useEventRegistrationStripeReturnWithDeps(options, deps) {
|
|
144814
144704
|
const { api, events, occurrenceId, pendingAttendeeId, setErrorMessage, setFormData, setPaymentSelection, setPendingAttendeeId, setRegistrationResult, setSelectedEvent, setSelectedAttendanceMode, setTicketSelections, setStep, setTicketsCount, step } = options;
|
|
144815
|
-
const
|
|
144705
|
+
const verificationConfig = useMemo(() => step === "verifying-payment" && pendingAttendeeId ? { transactionId: pendingAttendeeId } : null, [step, pendingAttendeeId]);
|
|
144706
|
+
const verification = deps.usePaymentVerification(verificationConfig);
|
|
144816
144707
|
useEffect(() => {
|
|
144817
|
-
cleanupStaleRegistrations();
|
|
144818
|
-
const registrationStatus = consumeSearchParam("registration");
|
|
144819
|
-
if (
|
|
144708
|
+
deps.cleanupStaleRegistrations();
|
|
144709
|
+
const registrationStatus = deps.consumeSearchParam("registration");
|
|
144710
|
+
if (registrationStatus !== "cancelled" && registrationStatus !== "success") return;
|
|
144711
|
+
deps.scrollToBlock(EVENT_REGISTRATION_ANCHOR_ID);
|
|
144820
144712
|
const siteId = api.config.siteId;
|
|
144821
144713
|
if (!siteId) return;
|
|
144822
|
-
const pending = getPendingRegistration(siteId, occurrenceId || void 0);
|
|
144714
|
+
const pending = deps.getPendingRegistration(siteId, occurrenceId || void 0);
|
|
144823
144715
|
if (!pending) return;
|
|
144824
144716
|
setFormData(pending.formData);
|
|
144825
144717
|
setTicketSelections(pending.ticketSelections);
|
|
@@ -144839,7 +144731,7 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
144839
144731
|
useEffect(() => {
|
|
144840
144732
|
if (verification.status === "completed") {
|
|
144841
144733
|
const siteId = api.config.siteId;
|
|
144842
|
-
if (siteId && occurrenceId) clearPendingRegistration(siteId, occurrenceId);
|
|
144734
|
+
if (siteId && occurrenceId) deps.clearPendingRegistration(siteId, occurrenceId);
|
|
144843
144735
|
setRegistrationResult({ status: "confirmed" });
|
|
144844
144736
|
setStep("success");
|
|
144845
144737
|
} else if (verification.status === "failed") {
|
|
@@ -144859,11 +144751,21 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
144859
144751
|
]);
|
|
144860
144752
|
return verification;
|
|
144861
144753
|
}
|
|
144754
|
+
var eventRegistrationStripeReturnDeps;
|
|
144862
144755
|
var init_useEventRegistrationStripeReturn = __esmMin((() => {
|
|
144863
144756
|
init_usePaymentVerification();
|
|
144864
144757
|
init_shared();
|
|
144758
|
+
init_constants();
|
|
144865
144759
|
init_sessionStorage();
|
|
144866
144760
|
init_ticketSelectionLines();
|
|
144761
|
+
eventRegistrationStripeReturnDeps = {
|
|
144762
|
+
usePaymentVerification,
|
|
144763
|
+
consumeSearchParam,
|
|
144764
|
+
scrollToBlock,
|
|
144765
|
+
cleanupStaleRegistrations,
|
|
144766
|
+
clearPendingRegistration,
|
|
144767
|
+
getPendingRegistration
|
|
144768
|
+
};
|
|
144867
144769
|
}));
|
|
144868
144770
|
//#endregion
|
|
144869
144771
|
//#region ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
|
|
@@ -144955,13 +144857,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
144955
144857
|
if (!result.alreadyRegistered && result.status === "confirmed" && result.pendingPayment && (method === "stripe" || method === "pass_bundle" || method === "membership_bundle")) {
|
|
144956
144858
|
options.setPendingAttendeeId(result.attendeeId);
|
|
144957
144859
|
options.setStep("redirecting");
|
|
144958
|
-
const
|
|
144959
|
-
const successParams = new URLSearchParams(currentUrl.search);
|
|
144960
|
-
successParams.set("registration", "success");
|
|
144961
|
-
const successUrl = `${currentUrl.origin}${currentUrl.pathname}?${successParams.toString()}${currentUrl.hash}`;
|
|
144962
|
-
const cancelParams = new URLSearchParams(currentUrl.search);
|
|
144963
|
-
cancelParams.set("registration", "cancelled");
|
|
144964
|
-
const cancelUrl = `${currentUrl.origin}${currentUrl.pathname}?${cancelParams.toString()}${currentUrl.hash}`;
|
|
144860
|
+
const { successUrl, cancelUrl } = buildCheckoutReturnUrls("registration", EVENT_REGISTRATION_ANCHOR_ID);
|
|
144965
144861
|
const checkoutType = method === "pass_bundle" ? "pass_bundle" : method === "membership_bundle" ? "membership_bundle" : "event";
|
|
144966
144862
|
const checkoutResult = await options.api.createEventCheckout({
|
|
144967
144863
|
attendeeId: result.attendeeId,
|
|
@@ -145026,6 +144922,8 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
145026
144922
|
}
|
|
145027
144923
|
var eventRegistrationSubmitDeps;
|
|
145028
144924
|
var init_useEventRegistrationSubmit = __esmMin((() => {
|
|
144925
|
+
init_shared();
|
|
144926
|
+
init_constants();
|
|
145029
144927
|
init_sessionStorage();
|
|
145030
144928
|
init_ticketSelectionLines();
|
|
145031
144929
|
eventRegistrationSubmitDeps = { savePendingRegistration };
|
|
@@ -151967,7 +151865,7 @@ function PassesMembershipsController({ render }) {
|
|
|
151967
151865
|
case "redirect":
|
|
151968
151866
|
window.location.href = result.checkoutUrl;
|
|
151969
151867
|
return;
|
|
151970
|
-
default: return assertNever$
|
|
151868
|
+
default: return assertNever$24(result);
|
|
151971
151869
|
}
|
|
151972
151870
|
} catch (submitError) {
|
|
151973
151871
|
dispatch({
|
|
@@ -152846,7 +152744,7 @@ init_media();
|
|
|
152846
152744
|
init_src$3();
|
|
152847
152745
|
//#endregion
|
|
152848
152746
|
//#region ../blocks/src/rendering/server.ts
|
|
152849
|
-
init_schema$
|
|
152747
|
+
init_schema$2();
|
|
152850
152748
|
//#endregion
|
|
152851
152749
|
//#region ../theme-core/src/index.ts
|
|
152852
152750
|
init_schema();
|
|
@@ -152973,7 +152871,7 @@ var SimpleCache = class {
|
|
|
152973
152871
|
* 1. This constant
|
|
152974
152872
|
* 2. The "version" field in package.json
|
|
152975
152873
|
*/
|
|
152976
|
-
const SDK_VERSION = "0.
|
|
152874
|
+
const SDK_VERSION = "0.126.0";
|
|
152977
152875
|
//#endregion
|
|
152978
152876
|
//#region src/client/error.ts
|
|
152979
152877
|
/**
|
|
@@ -159930,6 +159828,211 @@ const envStatusCommand = new Command("status").description("Show which environme
|
|
|
159930
159828
|
}));
|
|
159931
159829
|
const envCommand = new Command("env").description("Environment configuration and status").addCommand(envStatusCommand);
|
|
159932
159830
|
//#endregion
|
|
159831
|
+
//#region ../api/src/sdk-event-schedule.ts
|
|
159832
|
+
const timeRegex = /^([01]\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/;
|
|
159833
|
+
const explicitOffsetDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(\.\d{1,3})?(Z|[+-]([01]\d|2[0-3]):[0-5]\d)$/;
|
|
159834
|
+
const localDateTimeRegex = /^(\d{4})-(\d{2})-(\d{2})T([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?(\.\d{1,3})?$/;
|
|
159835
|
+
function issue(path, message) {
|
|
159836
|
+
return {
|
|
159837
|
+
path,
|
|
159838
|
+
message
|
|
159839
|
+
};
|
|
159840
|
+
}
|
|
159841
|
+
function isValidDateParts(year, month, day) {
|
|
159842
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
159843
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
159844
|
+
}
|
|
159845
|
+
function isZeroFraction(fraction) {
|
|
159846
|
+
return fraction === void 0 || /^\.0+$/.test(fraction);
|
|
159847
|
+
}
|
|
159848
|
+
function datePart(year, month, day) {
|
|
159849
|
+
return `${year}-${month}-${day}`;
|
|
159850
|
+
}
|
|
159851
|
+
function timePart(hours, minutes, seconds = "00") {
|
|
159852
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
159853
|
+
}
|
|
159854
|
+
function parseSdkEventDateTime(value) {
|
|
159855
|
+
const explicitMatch = explicitOffsetDateTimeRegex.exec(value);
|
|
159856
|
+
if (explicitMatch) {
|
|
159857
|
+
const [, yearRaw, monthRaw, dayRaw, hours, minutes, seconds = "00", fraction] = explicitMatch;
|
|
159858
|
+
if (!yearRaw || !monthRaw || !dayRaw || !hours || !minutes) return null;
|
|
159859
|
+
if (!isValidDateParts(Number(yearRaw), Number(monthRaw), Number(dayRaw)) || !isZeroFraction(fraction)) return null;
|
|
159860
|
+
const epochMs = Date.parse(value);
|
|
159861
|
+
if (!Number.isFinite(epochMs)) return null;
|
|
159862
|
+
return {
|
|
159863
|
+
epochMs,
|
|
159864
|
+
date: datePart(yearRaw, monthRaw, dayRaw),
|
|
159865
|
+
time: timePart(hours, minutes, seconds),
|
|
159866
|
+
iso: new Date(epochMs).toISOString()
|
|
159867
|
+
};
|
|
159868
|
+
}
|
|
159869
|
+
const localMatch = localDateTimeRegex.exec(value);
|
|
159870
|
+
if (!localMatch) return null;
|
|
159871
|
+
const [, yearRaw, monthRaw, dayRaw, hours, minutes, seconds = "00", fraction] = localMatch;
|
|
159872
|
+
if (!yearRaw || !monthRaw || !dayRaw || !hours || !minutes) return null;
|
|
159873
|
+
const year = Number(yearRaw);
|
|
159874
|
+
const month = Number(monthRaw);
|
|
159875
|
+
const day = Number(dayRaw);
|
|
159876
|
+
if (!isValidDateParts(year, month, day) || !isZeroFraction(fraction)) return null;
|
|
159877
|
+
const epochMs = Date.UTC(year, month - 1, day, Number(hours), Number(minutes), Number(seconds));
|
|
159878
|
+
return {
|
|
159879
|
+
epochMs,
|
|
159880
|
+
date: datePart(yearRaw, monthRaw, dayRaw),
|
|
159881
|
+
time: timePart(hours, minutes, seconds),
|
|
159882
|
+
iso: new Date(epochMs).toISOString()
|
|
159883
|
+
};
|
|
159884
|
+
}
|
|
159885
|
+
function durationMinutesBetween(startsAt, endsAt) {
|
|
159886
|
+
if (endsAt.epochMs <= startsAt.epochMs) return null;
|
|
159887
|
+
const durationMs = endsAt.epochMs - startsAt.epochMs;
|
|
159888
|
+
if (durationMs % 6e4 !== 0) return null;
|
|
159889
|
+
return durationMs / 6e4;
|
|
159890
|
+
}
|
|
159891
|
+
function exceedsMaxDuration(durationMinutes, options) {
|
|
159892
|
+
return options.maxDurationMinutes !== void 0 && durationMinutes > options.maxDurationMinutes;
|
|
159893
|
+
}
|
|
159894
|
+
function maxDurationMessage(options) {
|
|
159895
|
+
return options.maxDurationDays === void 0 ? "Duration is above the allowed maximum" : `Duration must be ${options.maxDurationDays} days or less`;
|
|
159896
|
+
}
|
|
159897
|
+
function classifyCanonicalSchedule(input, options) {
|
|
159898
|
+
const issues = [];
|
|
159899
|
+
if (options.requireCanonicalFields && input.recurrenceRule === void 0) issues.push(issue(["recurrenceRule"], "recurrenceRule is required"));
|
|
159900
|
+
if (input.defaultStartTime !== void 0 && input.defaultStartTime !== null && !timeRegex.test(input.defaultStartTime)) issues.push(issue(["defaultStartTime"], "Invalid time format (HH:MM or HH:MM:SS)"));
|
|
159901
|
+
if (options.requireCanonicalFields && !input.defaultStartTime) issues.push(issue(["defaultStartTime"], "defaultStartTime is required"));
|
|
159902
|
+
if (options.requireCanonicalFields && input.durationMinutes === void 0) issues.push(issue(["durationMinutes"], "durationMinutes is required"));
|
|
159903
|
+
if (input.durationMinutes !== void 0 && input.durationMinutes !== null) {
|
|
159904
|
+
if (input.durationMinutes < 1) issues.push(issue(["durationMinutes"], "durationMinutes must be at least 1"));
|
|
159905
|
+
else if (exceedsMaxDuration(input.durationMinutes, options)) issues.push(issue(["durationMinutes"], maxDurationMessage(options)));
|
|
159906
|
+
}
|
|
159907
|
+
if (issues.length > 0) return {
|
|
159908
|
+
ok: false,
|
|
159909
|
+
issues
|
|
159910
|
+
};
|
|
159911
|
+
return {
|
|
159912
|
+
ok: true,
|
|
159913
|
+
kind: "canonical",
|
|
159914
|
+
canonical: {
|
|
159915
|
+
recurrenceRule: input.recurrenceRule ?? null,
|
|
159916
|
+
startDate: input.startDate,
|
|
159917
|
+
defaultStartTime: input.defaultStartTime ?? "09:00:00",
|
|
159918
|
+
durationMinutes: input.durationMinutes ?? 60
|
|
159919
|
+
}
|
|
159920
|
+
};
|
|
159921
|
+
}
|
|
159922
|
+
function classifySdkEventSchedule(input, options = {}) {
|
|
159923
|
+
const issues = [];
|
|
159924
|
+
const hasStartsAt = input.startsAt !== void 0 && input.startsAt !== null;
|
|
159925
|
+
const hasEndsAt = input.endsAt !== void 0 && input.endsAt !== null;
|
|
159926
|
+
const hasDateTimeDuration = hasStartsAt && input.durationMinutes !== void 0 && input.durationMinutes !== null;
|
|
159927
|
+
const hasCanonicalStart = input.startDate !== void 0 || input.defaultStartTime !== void 0;
|
|
159928
|
+
if (!hasStartsAt && !hasEndsAt) return classifyCanonicalSchedule(input, options);
|
|
159929
|
+
if (hasStartsAt && hasCanonicalStart) issues.push(issue(["startsAt"], "Use either startsAt or startDate/defaultStartTime, not both"));
|
|
159930
|
+
if (input.recurrenceRule) issues.push(issue(["recurrenceRule"], "startsAt schedules are only supported for one-off events"));
|
|
159931
|
+
if (!hasStartsAt) issues.push(issue(["startsAt"], "startsAt is required when endsAt is provided"));
|
|
159932
|
+
if (!hasEndsAt && !hasDateTimeDuration) issues.push(issue(["endsAt"], "Provide either endsAt or durationMinutes with startsAt"));
|
|
159933
|
+
if (hasEndsAt && hasDateTimeDuration) issues.push(issue(["endsAt"], "Use either endsAt or durationMinutes with startsAt, not both"));
|
|
159934
|
+
const startsAt = typeof input.startsAt === "string" ? parseSdkEventDateTime(input.startsAt) : null;
|
|
159935
|
+
const endsAt = typeof input.endsAt === "string" ? parseSdkEventDateTime(input.endsAt) : null;
|
|
159936
|
+
if (hasStartsAt && !startsAt) issues.push(issue(["startsAt"], "Invalid datetime format. Use ISO datetime format, e.g. 2026-06-01T10:00:00Z"));
|
|
159937
|
+
if (hasEndsAt && !endsAt) issues.push(issue(["endsAt"], "Invalid datetime format. Use ISO datetime format, e.g. 2026-06-07T10:00:00Z"));
|
|
159938
|
+
if (startsAt && endsAt) {
|
|
159939
|
+
const durationMinutes = durationMinutesBetween(startsAt, endsAt);
|
|
159940
|
+
if (durationMinutes === null) issues.push(issue(["endsAt"], "endsAt must be after startsAt and align to a whole minute"));
|
|
159941
|
+
else if (exceedsMaxDuration(durationMinutes, options)) issues.push(issue(["endsAt"], maxDurationMessage(options)));
|
|
159942
|
+
if (issues.length === 0 && durationMinutes !== null) return {
|
|
159943
|
+
ok: true,
|
|
159944
|
+
kind: "start-end",
|
|
159945
|
+
canonical: {
|
|
159946
|
+
recurrenceRule: null,
|
|
159947
|
+
startDate: startsAt.date,
|
|
159948
|
+
defaultStartTime: startsAt.time,
|
|
159949
|
+
durationMinutes
|
|
159950
|
+
},
|
|
159951
|
+
startsAtIso: startsAt.iso,
|
|
159952
|
+
endsAtIso: endsAt.iso
|
|
159953
|
+
};
|
|
159954
|
+
}
|
|
159955
|
+
if (startsAt && hasDateTimeDuration && input.durationMinutes !== void 0 && input.durationMinutes !== null) {
|
|
159956
|
+
if (input.durationMinutes < 1) issues.push(issue(["durationMinutes"], "durationMinutes must be at least 1"));
|
|
159957
|
+
else if (exceedsMaxDuration(input.durationMinutes, options)) issues.push(issue(["durationMinutes"], maxDurationMessage(options)));
|
|
159958
|
+
if (issues.length === 0) {
|
|
159959
|
+
const endsAtMs = startsAt.epochMs + input.durationMinutes * 6e4;
|
|
159960
|
+
return {
|
|
159961
|
+
ok: true,
|
|
159962
|
+
kind: "start-duration",
|
|
159963
|
+
canonical: {
|
|
159964
|
+
recurrenceRule: null,
|
|
159965
|
+
startDate: startsAt.date,
|
|
159966
|
+
defaultStartTime: startsAt.time,
|
|
159967
|
+
durationMinutes: input.durationMinutes
|
|
159968
|
+
},
|
|
159969
|
+
startsAtIso: startsAt.iso,
|
|
159970
|
+
endsAtIso: new Date(endsAtMs).toISOString()
|
|
159971
|
+
};
|
|
159972
|
+
}
|
|
159973
|
+
}
|
|
159974
|
+
return {
|
|
159975
|
+
ok: false,
|
|
159976
|
+
issues
|
|
159977
|
+
};
|
|
159978
|
+
}
|
|
159979
|
+
//#endregion
|
|
159980
|
+
//#region ../api/src/sdk-event-upsert.ts
|
|
159981
|
+
const sdkEventOccurrenceInputSchema = z$1.object({
|
|
159982
|
+
startsAt: z$1.string().datetime({ offset: true }),
|
|
159983
|
+
endsAt: z$1.string().datetime({ offset: true }),
|
|
159984
|
+
timeZone: z$1.string().min(1).refine((value) => {
|
|
159985
|
+
try {
|
|
159986
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
159987
|
+
return true;
|
|
159988
|
+
} catch {
|
|
159989
|
+
return false;
|
|
159990
|
+
}
|
|
159991
|
+
}, "Invalid IANA timezone")
|
|
159992
|
+
}).refine(({ startsAt, endsAt }) => Date.parse(endsAt) > Date.parse(startsAt), {
|
|
159993
|
+
path: ["endsAt"],
|
|
159994
|
+
message: "endsAt must be after startsAt"
|
|
159995
|
+
});
|
|
159996
|
+
const sdkEventUpsertOptionalFieldSchemas = {
|
|
159997
|
+
path: z$1.string().startsWith("/", "path must start with /").nullable().optional(),
|
|
159998
|
+
status: z$1.enum([
|
|
159999
|
+
"draft",
|
|
160000
|
+
"active",
|
|
160001
|
+
"archived",
|
|
160002
|
+
"cancelled",
|
|
160003
|
+
"completed"
|
|
160004
|
+
]).optional(),
|
|
160005
|
+
visibility: z$1.enum([
|
|
160006
|
+
"private",
|
|
160007
|
+
"public",
|
|
160008
|
+
"unlisted"
|
|
160009
|
+
]).optional(),
|
|
160010
|
+
preset: z$1.enum([
|
|
160011
|
+
"event",
|
|
160012
|
+
"class",
|
|
160013
|
+
"course",
|
|
160014
|
+
"workshop",
|
|
160015
|
+
"retreat",
|
|
160016
|
+
"performance"
|
|
160017
|
+
]).optional(),
|
|
160018
|
+
bookingScope: z$1.enum(["single_occurrence", "whole_series"]).optional(),
|
|
160019
|
+
occurrences: z$1.array(sdkEventOccurrenceInputSchema).min(1).optional(),
|
|
160020
|
+
capacity: z$1.number().int().positive().nullable().optional()
|
|
160021
|
+
};
|
|
160022
|
+
//#endregion
|
|
160023
|
+
//#region src/cli/commands/eventOccurrenceSchedule.ts
|
|
160024
|
+
function portableEventScheduleOutput(event) {
|
|
160025
|
+
return {
|
|
160026
|
+
schedule: event.schedule,
|
|
160027
|
+
preset: event.preset,
|
|
160028
|
+
bookingScope: event.bookingScope,
|
|
160029
|
+
occurrences: event.occurrences
|
|
160030
|
+
};
|
|
160031
|
+
}
|
|
160032
|
+
function canCancelEventStatus(status) {
|
|
160033
|
+
return status === "draft" || status === "active";
|
|
160034
|
+
}
|
|
160035
|
+
//#endregion
|
|
159933
160036
|
//#region src/cli/commands/event.ts
|
|
159934
160037
|
const eventScheduleInputSchema = z$1.object({
|
|
159935
160038
|
recurrenceRule: z$1.string().nullable().optional(),
|
|
@@ -160000,21 +160103,8 @@ const eventUpsertInputSchema = z$1.object({
|
|
|
160000
160103
|
identifier: z$1.string().min(1).optional(),
|
|
160001
160104
|
title: z$1.string().min(1, "title is required"),
|
|
160002
160105
|
slug: z$1.string().min(1).optional(),
|
|
160003
|
-
|
|
160004
|
-
|
|
160005
|
-
"draft",
|
|
160006
|
-
"active",
|
|
160007
|
-
"archived",
|
|
160008
|
-
"cancelled",
|
|
160009
|
-
"completed"
|
|
160010
|
-
]).optional(),
|
|
160011
|
-
visibility: z$1.enum([
|
|
160012
|
-
"private",
|
|
160013
|
-
"public",
|
|
160014
|
-
"unlisted"
|
|
160015
|
-
]).optional(),
|
|
160016
|
-
schedule: eventScheduleInputSchema,
|
|
160017
|
-
capacity: z$1.number().int().positive().nullable().optional(),
|
|
160106
|
+
...sdkEventUpsertOptionalFieldSchemas,
|
|
160107
|
+
schedule: eventScheduleInputSchema.optional(),
|
|
160018
160108
|
pricing: eventPricingInputSchema.optional(),
|
|
160019
160109
|
paymentTerms: eventPaymentTermsInputSchema.optional(),
|
|
160020
160110
|
venueRef: z$1.string().nullable().optional(),
|
|
@@ -160025,6 +160115,17 @@ const eventUpsertInputSchema = z$1.object({
|
|
|
160025
160115
|
presentation: z$1.record(z$1.string(), z$1.unknown()).nullable().optional(),
|
|
160026
160116
|
tags: z$1.array(z$1.string()).optional(),
|
|
160027
160117
|
blocks: sdkEntrySlotBlocksInputSchema.optional()
|
|
160118
|
+
}).superRefine((input, ctx) => {
|
|
160119
|
+
if (input.occurrences && !input.bookingScope) ctx.addIssue({
|
|
160120
|
+
code: "custom",
|
|
160121
|
+
path: ["bookingScope"],
|
|
160122
|
+
message: "bookingScope is required when occurrences are provided"
|
|
160123
|
+
});
|
|
160124
|
+
if (new Set(input.occurrences?.map((occurrence) => occurrence.timeZone)).size > 1) ctx.addIssue({
|
|
160125
|
+
code: "custom",
|
|
160126
|
+
path: ["occurrences"],
|
|
160127
|
+
message: "all occurrences must use the same timeZone"
|
|
160128
|
+
});
|
|
160028
160129
|
});
|
|
160029
160130
|
const formatEventRow = (event) => [
|
|
160030
160131
|
event.identifier,
|
|
@@ -160038,23 +160139,25 @@ function toEventUpsertInput(identifier, raw) {
|
|
|
160038
160139
|
if (parsedIdentifier && parsedIdentifier !== identifier) throw new Error(`Identifier mismatch: argument "${identifier}" does not match payload identifier "${parsedIdentifier}".`);
|
|
160039
160140
|
const parsedStatus = parsed.status;
|
|
160040
160141
|
const status = parsedStatus === "completed" ? void 0 : parsedStatus;
|
|
160142
|
+
const firstOccurrence = parsed.occurrences?.[0];
|
|
160143
|
+
const schedule = parsed.schedule ?? (firstOccurrence ? scheduleFromExplicitEventOccurrence(firstOccurrence) : null);
|
|
160144
|
+
if (!schedule) throw new Error("schedule is required when no explicit occurrences are provided");
|
|
160041
160145
|
return {
|
|
160042
160146
|
...parsed,
|
|
160043
160147
|
identifier,
|
|
160044
160148
|
slug: parsed.slug ?? identifier,
|
|
160045
|
-
status
|
|
160149
|
+
status,
|
|
160150
|
+
schedule
|
|
160046
160151
|
};
|
|
160047
160152
|
}
|
|
160048
160153
|
function buildCancelledEventUpsertInput(current) {
|
|
160049
|
-
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, contentUpdatedAt: _contentUpdatedAt, ...rest } = current;
|
|
160154
|
+
const { id: _id, createdAt: _createdAt, updatedAt: _updatedAt, contentUpdatedAt: _contentUpdatedAt, occurrences, ...rest } = current;
|
|
160050
160155
|
return {
|
|
160051
160156
|
...rest,
|
|
160157
|
+
...occurrences.length > 0 ? { occurrences } : {},
|
|
160052
160158
|
status: "cancelled"
|
|
160053
160159
|
};
|
|
160054
160160
|
}
|
|
160055
|
-
function canCancelEventStatus(status) {
|
|
160056
|
-
return status === "draft" || status === "active";
|
|
160057
|
-
}
|
|
160058
160161
|
const upsertCommand = new Command("upsert").description("Create or update an event series").argument("<identifier>", "Event identifier").option("--data <json>", "Event payload as JSON string").option("--file <path>", "Path to JSON file with event payload").action(withErrorHandling(async (identifier, options, command) => {
|
|
160059
160162
|
const { output, client } = createCommandContext(command);
|
|
160060
160163
|
const raw = await parseJsonData(options);
|
|
@@ -160079,7 +160182,7 @@ const getCommand = createGetCommand({
|
|
|
160079
160182
|
slug: event.slug,
|
|
160080
160183
|
status: event.status,
|
|
160081
160184
|
visibility: event.visibility,
|
|
160082
|
-
|
|
160185
|
+
...portableEventScheduleOutput(event),
|
|
160083
160186
|
capacity: event.capacity,
|
|
160084
160187
|
pricing: event.pricing,
|
|
160085
160188
|
paymentTerms: event.paymentTerms,
|
|
@@ -160526,17 +160629,10 @@ async function readLegacyEventEntries(contentDir) {
|
|
|
160526
160629
|
return entries;
|
|
160527
160630
|
}
|
|
160528
160631
|
async function readCanonicalEventsWithPaths(contentDir) {
|
|
160529
|
-
|
|
160530
|
-
|
|
160531
|
-
|
|
160532
|
-
|
|
160533
|
-
const event = await readJsonFile(filePath);
|
|
160534
|
-
events.push({
|
|
160535
|
-
event,
|
|
160536
|
-
filePath
|
|
160537
|
-
});
|
|
160538
|
-
}
|
|
160539
|
-
return events;
|
|
160632
|
+
return (await readEventsWithFilePaths(contentDir)).map(({ filePath, ...event }) => ({
|
|
160633
|
+
event,
|
|
160634
|
+
filePath
|
|
160635
|
+
}));
|
|
160540
160636
|
}
|
|
160541
160637
|
function findCandidateEvents(legacy, eventsByIdentifier, eventsBySlug) {
|
|
160542
160638
|
const byIdentifier = eventsByIdentifier.get(legacy.entry.identifier);
|
|
@@ -161099,15 +161195,19 @@ function buildStyleSelectionApplyInputFromOptions(options) {
|
|
|
161099
161195
|
headerLayoutId: siteStyle?.defaultHeaderSelection.layoutId ?? guaranteedFallbackHeaderLayoutId,
|
|
161100
161196
|
headerStyleId: siteStyle?.defaultHeaderSelection.styleId ?? guaranteedFallbackHeaderStyleId,
|
|
161101
161197
|
footerLookId: null
|
|
161102
|
-
},
|
|
161198
|
+
}, parsePalette(options.palette), baseSelectionVersion, options.selectionId ?? null);
|
|
161103
161199
|
}
|
|
161104
161200
|
/** Builds the complete first-theme command without reading current selection state. */
|
|
161105
161201
|
function buildStyleSelectionInitializeCommandFromOptions(options) {
|
|
161106
161202
|
const siteStyle = getCuratedSiteStyle(asSiteStyleId(options.siteStyleId));
|
|
161107
161203
|
if (!siteStyle) throw new Error(`Unknown curated site style: ${options.siteStyleId}`);
|
|
161108
|
-
return buildApplySiteStyleSelectionCommand(buildStyleSelectionInputFromOptions(options, styleSelectionInitializationDefaults(siteStyle),
|
|
161204
|
+
return buildApplySiteStyleSelectionCommand(buildStyleSelectionInputFromOptions(options, styleSelectionInitializationDefaults(siteStyle), parseInitializationPalette(options.palette, siteStyle), 0, null));
|
|
161109
161205
|
}
|
|
161110
|
-
function buildStyleSelectionInputFromOptions(options, defaults,
|
|
161206
|
+
function buildStyleSelectionInputFromOptions(options, defaults, palette, baseSelectionVersion, selectionId) {
|
|
161207
|
+
const paletteChange = palette ? [{
|
|
161208
|
+
kind: "set-palette",
|
|
161209
|
+
palette
|
|
161210
|
+
}] : [];
|
|
161111
161211
|
return {
|
|
161112
161212
|
siteStyleRef: options.siteStyleId,
|
|
161113
161213
|
changes: [
|
|
@@ -161119,10 +161219,7 @@ function buildStyleSelectionInputFromOptions(options, defaults, paletteCommand,
|
|
|
161119
161219
|
kind: "set-button-style",
|
|
161120
161220
|
buttonStyleSelection: parseButtonStyleSelection(options, defaults)
|
|
161121
161221
|
},
|
|
161122
|
-
|
|
161123
|
-
kind: "set-palette",
|
|
161124
|
-
command: paletteCommand
|
|
161125
|
-
},
|
|
161222
|
+
...paletteChange,
|
|
161126
161223
|
{
|
|
161127
161224
|
kind: "set-typography",
|
|
161128
161225
|
typography: parseTypography(options.typography, defaults.typography)
|
|
@@ -161185,24 +161282,17 @@ function parseTypography(value, fallback) {
|
|
|
161185
161282
|
}
|
|
161186
161283
|
return typographySchema.parse(parsed);
|
|
161187
161284
|
}
|
|
161188
|
-
function
|
|
161189
|
-
if (value === void 0 || value.trim() === "") return
|
|
161190
|
-
return
|
|
161285
|
+
function parsePalette(value) {
|
|
161286
|
+
if (value === void 0 || value.trim() === "") return null;
|
|
161287
|
+
return paletteSchema.parse(JSON.parse(value));
|
|
161191
161288
|
}
|
|
161192
|
-
function
|
|
161289
|
+
function parseInitializationPalette(value, siteStyle) {
|
|
161193
161290
|
if (value === void 0 || value.trim() === "") {
|
|
161194
161291
|
const palette = findCuratedPalette(defaultPaletteForSiteStyle(siteStyle));
|
|
161195
161292
|
if (!palette) throw new Error(`Missing default palette for curated site style: ${siteStyle.id}`);
|
|
161196
|
-
return
|
|
161197
|
-
kind: "create-site",
|
|
161198
|
-
colors: palette.colors,
|
|
161199
|
-
mode: palette.mode,
|
|
161200
|
-
origin: { kind: "manual" }
|
|
161201
|
-
};
|
|
161293
|
+
return concretePaletteToTheme(palette);
|
|
161202
161294
|
}
|
|
161203
|
-
|
|
161204
|
-
if (command.kind !== "create-site" || command.origin.kind !== "manual") throw new Error("--palette-command for style init must be a complete manual create-site command");
|
|
161205
|
-
return command;
|
|
161295
|
+
return paletteSchema.parse(JSON.parse(value));
|
|
161206
161296
|
}
|
|
161207
161297
|
function buildStyleCatalogListRows(styles = curatedSiteStyles, options = {}) {
|
|
161208
161298
|
return (options.siteStyleId ? styles.filter((style) => String(style.id) === options.siteStyleId) : styles).map((style) => ({
|
|
@@ -161300,7 +161390,7 @@ const listCommand = new Command("list").description("List curated site styles an
|
|
|
161300
161390
|
"Footer Looks"
|
|
161301
161391
|
], rows.map(formatStyleCatalogListRow));
|
|
161302
161392
|
}));
|
|
161303
|
-
const applyCommand = new Command("apply").description("Apply a curated site-style selection").requiredOption("--site-style-id <id>", "Site style ID, e.g. site-style:calm-studio").requiredOption("--base-selection-version <version>", "Current style selection version").option("--selection-id <id>", "Current style selection row ID").option("--button-style-id <id>", "Button style ID").option("--button-style-parameters <json>", "Button style parameter object as JSON").option("--palette
|
|
161393
|
+
const applyCommand = new Command("apply").description("Apply a curated site-style selection").requiredOption("--site-style-id <id>", "Site style ID, e.g. site-style:calm-studio").requiredOption("--base-selection-version <version>", "Current style selection version").option("--selection-id <id>", "Current style selection row ID").option("--button-style-id <id>", "Button style ID").option("--button-style-parameters <json>", "Button style parameter object as JSON").option("--palette <json>", "Complete theme palette JSON").option("--typography <json>", "Complete typography JSON (defaults to the site style typography)").option("--header-look-id <id>", "Legacy header look bridge ID").option("--header-layout-id <id>", "Header layout ID").option("--header-style-id <id>", "Header style ID").option("--footer-look-id <id>", "Footer look ID").action(withErrorHandling(async (options, command) => {
|
|
161304
161394
|
const { output, client } = createCommandContext(command);
|
|
161305
161395
|
const input = buildStyleSelectionApplyInputFromOptions(options);
|
|
161306
161396
|
const commandIr = buildApplySiteStyleSelectionCommand(input);
|
|
@@ -161314,12 +161404,12 @@ const applyCommand = new Command("apply").description("Apply a curated site-styl
|
|
|
161314
161404
|
savedAt: result.savedAt
|
|
161315
161405
|
});
|
|
161316
161406
|
}));
|
|
161317
|
-
const initCommand = new Command("init").description("Initialize a fresh SDK site with a curated site style").requiredOption("--site-style-id <id>", "Site style ID, e.g. site-style:calm-studio").option("--button-style-id <id>", "Button style ID").option("--button-style-parameters <json>", "Button style parameter object as JSON").option("--palette
|
|
161407
|
+
const initCommand = new Command("init").description("Initialize a fresh SDK site with a curated site style").requiredOption("--site-style-id <id>", "Site style ID, e.g. site-style:calm-studio").option("--button-style-id <id>", "Button style ID").option("--button-style-parameters <json>", "Button style parameter object as JSON").option("--palette <json>", "Complete theme palette JSON").option("--typography <json>", "Complete typography JSON (defaults to the site style typography)").option("--header-look-id <id>", "Legacy header look bridge ID").option("--header-layout-id <id>", "Header layout ID").option("--header-style-id <id>", "Header style ID").option("--footer-look-id <id>", "Footer look ID").action(withErrorHandling(executeStyleInit));
|
|
161318
161408
|
const styleCommand = new Command("style").description("Manage curated site styles").addHelpText("after", `
|
|
161319
161409
|
Examples:
|
|
161320
161410
|
$ riverbankcms style init --site-style-id site-style:calm-studio
|
|
161321
161411
|
$ riverbankcms style apply --site-style-id site-style:calm-studio --base-selection-version 3
|
|
161322
|
-
$ riverbankcms style apply --site-style-id site-style:calm-studio --base-selection-version 3 --palette
|
|
161412
|
+
$ riverbankcms style apply --site-style-id site-style:calm-studio --base-selection-version 3 --palette '{"colors":[...],"meta":{"mode":"light"}}'
|
|
161323
161413
|
`).addCommand(listCommand).addCommand(initCommand).addCommand(applyCommand);
|
|
161324
161414
|
//#endregion
|
|
161325
161415
|
//#region src/cli/commands/webhooks.ts
|
|
@@ -161387,7 +161477,7 @@ function envPatchLabel(tag) {
|
|
|
161387
161477
|
case "append-key": return "added RIVERBANK_WEBHOOK_SECRET to .env.local";
|
|
161388
161478
|
case "replace-key": return "updated RIVERBANK_WEBHOOK_SECRET in .env.local";
|
|
161389
161479
|
case "unchanged": return "left .env.local unchanged";
|
|
161390
|
-
default: return assertNever$
|
|
161480
|
+
default: return assertNever$24(tag);
|
|
161391
161481
|
}
|
|
161392
161482
|
}
|
|
161393
161483
|
function planHumanResultOutput(input) {
|
|
@@ -162062,7 +162152,7 @@ function formatAuthority(authority) {
|
|
|
162062
162152
|
case "dashboard_admin": return "dashboard admin";
|
|
162063
162153
|
case "cms_repo_script": return "CMS repo script";
|
|
162064
162154
|
case "sdk_management_key": return "SDK management key";
|
|
162065
|
-
default: return assertNever$
|
|
162155
|
+
default: return assertNever$24(authority);
|
|
162066
162156
|
}
|
|
162067
162157
|
}
|
|
162068
162158
|
function formatOperation(operation) {
|
|
@@ -162083,7 +162173,7 @@ function formatStep(step, index) {
|
|
|
162083
162173
|
lines.push(" Commands:");
|
|
162084
162174
|
step.commands.forEach((command) => lines.push(` ${command}`));
|
|
162085
162175
|
return lines;
|
|
162086
|
-
default: return assertNever$
|
|
162176
|
+
default: return assertNever$24(step);
|
|
162087
162177
|
}
|
|
162088
162178
|
}
|
|
162089
162179
|
function formatSdkSetupPlan(plan) {
|