riverbankcms 0.36.0 → 0.37.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.
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { $ as walkAndCollectImageAttrs, $t as flatInkParametersSchema, A as parseSiteChromeBackgroundColorToken, An as buildEntryScaffold, Ar as createContentEntryRef, At as getMimeType, B as sectionStylesOverrideSchema, Bn as isResolvedInternalLinkEntityType, Bt as footerPreferencesSchema, C as blockOrderIdentifiersForCommand, Cn as bookingPaymentCollectionOptionSchema, Cr as makeBoundaryId, Ct as parseCanonicalMediaIdentifier, D as pagePathForCommand, Dn as RichTextDocSchema, Dr as createBlockRef, Dt as deriveVideoSlotPolicy, E as pageIdentifierForCommand, Er as ianaTimezoneSchema, F as defaultHeaderBrandPreferences, Fn as entryLinkSchema$1, Fr as createNavigationRef, G as headerInteractionQuietPalette, Gn as parseGradientPresetId, Gt as cardVariantRoleValues, H as skinBookingBarSchema, Hn as pageLinkSchema$1, Hr as __toESM, Ht as boxlessCardVariantValue, In as externalLinkSchema$1, Ir as createPageRef, It as classifyKnownMimeType, J as boxBackgroundOverlaySchema, Jn as asHeaderLayoutId, Jt as surfaceCardRoleValues, K as blockCustomCssRuleSchema, Kt as itemRoleValues, L as cardStylesOverrideSchema, Ln as internalLinkSchema, Lt as managementMediaLibraryUploadLimitForMimeType, M as defaultHeaderPreferences, Mn as findUnfilledSentinels, Mr as createEventSeriesRef, N as defaultHeaderNavPreferences, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Nr as createFooterRef, Nt as parseRelativeStoragePath, O as hasConfiguredBookingVertical, On as isRichTextDoc, Or as createBlocksRef, Ot as resolveVideoSelectionIntentForMediaField, P as defaultHeaderBrandPresentation, Pn as customLinkSchema$1, Pr as createFormRef, Pt as FILE_SIZE_LIMITS, Q as summarizePortableMediaReferences, Qt as flatInkHoverTreatmentSchema, R as containerStylesOverrideSchema, Rn as internalResolvedLinkSchema, Rr as createVenueRef, Rt as parseSafeDownloadFilename, S as blockIdentifierForCommand, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, T as pageIdentifierForBlockCommand, Tn as eventCommandScheduleSchema, U as headerVariantValues, Un as ICON_PICKER_PRESETS, Ut as cardRoleSchema, V as themeSchema, Vn as linkSchema, Vr as __commonJSMin, Vt as getFontWidthRange, W as headerInteractionPaletteValues, Wn as gradientPresetIdValues, Wt as cardRoleValues, X as runtimeBoxBackgroundSchema, Xn as bookingPageLookIdValues, Xt as buttonStyleSelectionSchema, Y as boxBackgroundSchema, Yn as asHeaderStyleId, Yt as BUTTON_STYLE_IDS, Z as collectPortableMediaReferencesFromContent, Zt as editorialLinkParametersSchema, _ as mapEventCommandContent, _n as paletteTokenNameSchema, _t as resolveManagedMediaReference, an as buttonVariantIdSchema, ar as arrangementModes, at as parseAspectRatioValue, bn as changeBookingQuestionsInputSchema, br as asLayoutVariantKey, bt as mediaTypeDiscriminants, c as isEventVisibility, cn as parseOpaqueButtonColourToken, cr as headingDecorationColorTokenValues, ct as getDirectImageUrlForSiteScopedPath, d as venueManagementFields, dn as hexColorSchema, dr as visibleHeadingDecorationFamilyValues, dt as imageMediaSchema, en as quietArrowParametersSchema, er as pageDesignEditorBackgroundOverrideOwner, et as deleteEnvSpecificKeys, f as sortRecord, fn as normalizePaletteHex, fr as asAppearancePresetId, ft as mediaSchema, g as resolveEventSeriesWaitlistMapping, gn as paletteModeSchema, gr as asDesignBlockId, gt as buildRenderableMediaAssetIndex, hn as paletteColorsSchema, hr as asBoundaryOptionId, ht as videoMediaSchema, i as sdkEventUpsertOptionalFieldSchemas, in as buttonSystemSchema, ir as VARIANT_ROLES, it as isExplicitRectCrop, j as backgroundAppearanceColorTokenNames, jn as validateEntryInstance, jr as createEventCategoryRef, jt as asRecord, k as headerPreferencesSchema, kn as sanitizeHref, kr as createCommandRef, ln as PALETTE_TOKEN_NAMES, lr as isArrangementMode, lt as getImageUrl, mn as paletteColorsFromEntries, mr as asBlockOrderIndex, mt as runtimeMediaSchema, nn as buttonEffectApplicationSchema, nr as siteChromeBackgroundOverrideOwner, nt as rotateNormalizedPoint, o as classifySdkEventBookingOffer, on as buttonVisualStatesSchema, or as eventListTreatmentValues, ot as resolveMediaTransformForAspect, p as stableStringify, pn as paletteColorEntries, pr as asBlockContentVersionId, pt as persistableMediaSchema, q as customCssRuleSchema, qn as asFooterLookId, qt as openCardRoleValue, rn as buttonPressOffsetSchema, rt as normalizeWidthCandidates, sn as opaqueButtonColourTokenSchema, sr as eyebrowTreatmentValues, st as getDirectImageUrlForRelativePath, t as classifySdkEventTiming, tn as squareOutlineParametersSchema, tr as parseBookingPageLookId, tt as looksLikeUuid, u as eventCategoryManagementFields, un as blockColorTokenNames, ur as tileTreatmentValues, ut as isSiteScopedDirectImageStoragePath, vn as parseColorTokenParts, vr as asDesignPageId, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wn as bookingPaymentTermsSchema, wt as parseMediaIdentifier, x as eventManagementTiming, xr as asPageFlowPresetId, xt as mediaIdentifierSchema, yn as parseThemeColorToken, yr as asDesignSystemTemplateId, z as headerPositioningValues, zn as internalRouteOnlyLinkSchema, zr as refSlug, zt as defaultFooterPreferences } from "../sdk-event-upsert-n4in1E4v.mjs";
3
- import { $ as footerLayoutForLookId, $t as resolveBookingDisplayContext, B as parseManagementKey, Bt as deriveTotalTicketQuantity, Cn as publicEventPricingDisplay, Ct as mapDrawingSchema, Dn as resolveExactOrFreePriceDisplay, En as publicEventPricingType, F as orderedLiveRunSessions, Fr as blockInteractionContextSchema, G as parseMailingListRuntimeContext, Gt as hasBookingClosed, H as parseMailingListBlockId, Hn as formatDurationUnitLabel, Ht as bookingCutOffHoursBetween, I as resolveWholeSeriesBookingPhase, In as toNonNegativeCents, Jn as parseSiteTermsVersionId, Jt as formatDateTime, K as assessMailingListTargeting, Kt as formatDate, L as resolveWholeSeriesRunLifecycle, M as CANCELLED_SESSION_STATUS, Mt as getBookingInstalmentPlanIntervalCount, N as firstLiveRunSessionStartMs, Nr as err, Nt as getBookingInstalmentProtectedDepositAmountCents, On as resolvePricingOptionsPriceDisplay, P as nextLiveRunSessionStartMs, Pr as ok, Q as parseFooterCompositionV1, Qt as inferSiteDateLocale, R as createSecret, S as EVENT_PRESET_VALUES, Sn as publicEventPricingCurrency, Sr as parseUserId, St as trimmedStringOrNull, T as WHOLE_SERIES_EVENT_PRESET_VALUES, Tn as publicEventPricingStrategy, Tr as parseEventSeriesId, Tt as buildBookingUtcDateWindow, U as parseMailingListContentVersionId, Ut as formatBookingClosedTime, V as slugify, Vn as assertNever, W as parseMailingListSignedSourceToken, Wn as unsafeAsDemoCapability, Wt as formatBookingCutOffHours, X as DEFAULT_MAILING_LIST_SUCCESS_MESSAGE, Xt as formatTime$1, Y as DEFAULT_MAILING_LIST_PRIVACY_NOTE, Yt as formatDateTimeRange, Zt as formatTimeRange, _n as parsePageSurfaceSubject, _t as parseLocationValue, a as authoredValuesEqual, an as getBookingLocalDateKey, ar as unsafeAsMediaAssetId, at as formatOpeningHoursRows, b as resolveSiteVerticalBookingConfig, bn as formatEventPricing, br as parseApiKeyId, bt as toLocationCoordinates, d as formatCreditProductUnits, dn as parseUtcIsoDateTimeString, dt as decideLocationSave, en as toScheduledBookingDateTime, et as parseMailingListPlacementTargeting, fn as toUtcIsoDateTimeString, ft as stableJsonStringify, gt as normalizeLocationAddressText, h as NAVIGATION_LOCATIONS, hn as toBookingTimeZone, ht as locationValueSchema, i as isRecord$27, in as formatLocalScheduleTime, it as richTextHasText, jn as mapReadonlyNonEmptyArray, l as creditProductUnitNoun, ln as parseBookingLocalDate, mn as resolveBookingTimeZoneId, mt as EVENT_ADDRESS_AFTER_BOOKING_LABEL, nn as compareLocalScheduleDates, nt as planMailingListChoicePresentation, on as getLocalScheduleDate, pn as resolveBookingBusinessTimeZone, pt as locationMapLinks, qt as formatDateRange, rn as formatLocalScheduleDate, rt as isCanonicalRichTextDoc, sn as getLocalScheduleTime, sr as unsafeAsPositiveByteCount, st as parseWeeklyOpeningHours, tt as DEFAULT_MAILING_LIST_TARGETING, u as formatCreditProductPayment, un as parseLocalScheduleTime, vn as EVENT_PRESET_VOCABULARY, vt as projectPublicLocation, wn as publicEventPricingOptions, wt as selectCategoryView, xn as isPublicEventPricingOptionDisplayable, xr as parseSiteId, yn as formatBookingPriceDisplay, yt as publicLocationSchema, z as exposeSecret, zn as formatCurrencyAmount } from "../src-DHIn60_q.mjs";
4
- import { $ as walkLocalContentMedia, $n as extractApiErrorMessage, $r as ApiEnvelopeError, $t as commandContexts, A as formatDiffSummary, An as isLocalConfigured, Ar as getBookingLaterInstalments, At as navigationIdentityMap, B as formatFieldChange, Bn as DEFAULT_MEDIA_FIELD_KINDS, Br as publicProductSchema, Bt as ACCOUNT_SITE_SEARCH_MAX_LENGTH, C as reportFromOutcomes, Cn as ErrorCodes, Cr as planFlexibleBalanceCreditFirst, Ct as listFiles, D as calculateDiff, Dr as resolveAvailableBookingCollectionOptions, Dt as isMediaValue, E as createEmptySyncResult, En as CliExit, Er as repriceBookingCollectionOptions, Et as writeJsonFileAtomic, F as buildJsonDiff, Fn as cardListKnobBlocks, Fr as eventCalendarListLayoutValues, Ft as createBearerAccountApi, G as applyLocalMediaPush, Gn as MAX_REPEATER_GRID_COLUMNS, Gr as calendarMonthWindowSchema, Gt as createPushConfigCommand, H as revalidateLocalMediaPushPlan, Hn as blockContentSourceSchema, Hr as purchasablePublicPassProductSchema, Ht as navigationCommandItemToManagementInput, I as hasPageOperations, In as lookKnobBlocks, Ir as publicMapLocationResultSchema, It as ACCOUNT_SITE_CURSOR_MAX_LENGTH, J as readStableBinaryFile, Jn as resolveRepeaterGridColumnFieldId, Jr as eventSurfacePresetValues, Jt as revalidatePushConfigPlan, K as prepareLocalMediaForPush, Kn as isAcceptedRepeaterGridSpan, Kr as calendarSourceCursorSchema, Kt as loadPushConfigTarget, L as pageMetadataForUpsert, Ln as NodeSchema, Lr as publicVenueMapLocationSchema, Lt as ACCOUNT_SITE_LIST_LIMIT_DEFAULT, M as findChangedFieldsWithValues, Mn as loadSdkEnvironment, Mr as eventCalendarDefaultViewValues, Mt as convertPulledNavigationToLocal, N as formatHumanDiff, Nn as cardListBlockParts, Nr as eventCalendarDisplayModeValues, Nt as convertPulledPagesToLocal, O as calculateFooterDiff, On as getEnvPrefix, Or as resolveBookingCollectionOptionFacts, Ot as duplicateNavigationIdentityMessage, P as calculatePullDiff, Pn as cardListFamilyBlocks, Pr as eventCalendarListLayoutCompatibleDisplayModeValues, Pt as AccountApiMalformedResponseError, Q as normalizeMediaValueToIdentifierOnly, Qn as ManagementApiError, Qr as publicEventLoaderQuerySchemaShape, Qt as CommandFailure, Rn as NodeTreeSchema, Rr as publicMembershipProductSchema, Rt as ACCOUNT_SITE_LIST_LIMIT_MAX, S as planCliCommandBatchForBindings, Sn as withRiverbankEnv, Sr as planCheckoutPaymentFlow, St as fileExists, T as executeResidualSettingsSyncPlan, Tn as transportSuggestion, Tr as isBookingCollectionEquivalentToUpfront, Tt as writeJsonFile, Un as blockRequiredFeatureSchema, Ur as CALENDAR_SSR_PAGE_SIZE, Ut as normalizeNavigationConfigItemForCommand, V as formatFieldPath, Vn as blockCategoryEnum, Vr as purchasablePublicMembershipProductSchema, Vt as ACCOUNT_SITE_TITLE_MAX_LENGTH, W as syncLocalMediaForPull, Wn as fieldSchema$1, Wr as calendarMonthDate, Wt as applyPushConfigPlan, X as sha256, Xn as resolveRepeaterGridSpanFieldId, Xr as monthNumber, Xt as deriveCmsApiUrlFromDashboardUrl, Y as writeBinaryFileAtomic, Yn as resolveRepeaterGridRowFieldId, Yr as eventSurfaceScopeValues, Yt as createBearerAPIClient, Z as normalizeMediaIdentifierInput, Zn as visibilityLevels, Zr as normalizeCalendarFilterId, Zt as mapEnvironmentExecutionOutcomesJson, _ as commandExecutionToReport, _n as executeEnvironmentPlan, _r as nextCombinationHint, _t as metadataTargetFromEnvironment, a as executeEntryCommandPlanAsReport, an as confirmAction, ar as linkPayloadSchema, at as readAllMeta, b as executeCompiledCliCommandPlanAsReport, bn as planEnvironmentWriteAuthorization, br as checkoutCopy, bt as writeMetadataRecordMap, c as titleFromEntryData, cn as formatDateShort, cr as pageDesignIntentSchemaVersion, ct as readFooterMeta, d as unsafeAsCliEntryIdentifier, dn as managementClientFor, dr as areEventBookingRequirementsIdentical, dt as readPagesMeta, ei as unwrapResponse, en as defineCommand, er as normalizeApiError, et as buildStorageUrl, f as unsafeAsCliFormSlug, fn as mapEntryForOutput, fr as eventBookingConsentContentKey, ft as readSettingsMeta, g as commandCompileFailureToReport, gn as runWithInvocation, gr as checkoutStatusArms, gt as metadataFilePath, h as mutationCounterForEffect, hn as resolveCommandPath, hr as resolveSelectionAttendanceMode, ht as ensureMetadataDir, i as entrySiteCommandTypes, in as bindRequestTimeout, ir as sdkSettingsUpdateSchema, it as readEntries, j as hasPendingChanges, jn as isRemoteConfigured, jr as MAX_EVENT_BOOKING_SELECTION_ITEMS, jt as convertPulledFooterToLocal, k as formatDiffDetail, kn as getEnvironmentDebugInfo, kr as getStripeMinimumChargeRequirement, kt as navigationIdentity, l as unsafeAsCliBlockIdentifier, ln as handleCommandError, lr as sdkConfiguredBookingVerticalConfigSchema, lt as readFormsMeta, m as commandReportToSyncResult, mn as parseJsonData, mr as decideSelectionAttendance, mt as writeMediaManifest, n as entryCommandCompileErrorToReport, nn as registerCommand, nr as ApiRequestError, nt as extractMediaIdentifiers, o as executeEntryCommandPlanAsSyncResult, on as createOutputForCommand, or as portablePageDesignSchema, ot as readEventCategoriesMeta, p as unsafeAsCliPageIdentifier, pn as parseJsonArray, pr as INCOMPATIBLE_ATTENDANCE_MESSAGE, pt as readVenuesMeta, q as admitBinaryWriteDestination, qn as parseRepeaterGridInteger, qr as eventScheduleScopeValues, qt as preparePushConfigTarget, r as entryCommandReportToSyncResult, rn as renderedByOwner, rr as sdkEventScheduleSchema, rt as findLegacyEntryFiles, s as syncResultForEntryCommandCompileError, sn as currentInvocationEnvelope, sr as pageDesignDecisionsV2Schema, st as readEventsMeta, t as compileEntryPushCommands, tn as defineCommandGroup, tr as isRecord$2, tt as downloadMedia, u as unsafeAsCliContentTypeKey, un as loadManagementTarget, ur as API_ENDPOINTS, ut as readNavigationMeta, v as commandReportHasFailures, vn as parseEnvironmentSelection, vr as planSelectionCombinationPrices, vt as readMetadataFile, w as mergeManySyncResults, wn as formatError, wr as flexibleBalanceDueDay, wt as readJsonFile, x as formatManagementError, xn as requireEnvironmentWriteAuthorization, xr as unsafeAsPositiveCheckoutQuantity, xt as ensureDir, y as executeCliCommandPlan, yn as planEnvironmentExecution, yr as eventRegistrationErrors, yt as writeMetadataFile, z as buildFieldChanges, zn as bindingSchema, zr as publicPassProductSchema, zt as ACCOUNT_SITE_LIST_LIMIT_MIN } from "../entryCommands-Cx1aj859.mjs";
5
- import { r as CLI_VERSION, t as loadConfigFile } from "../load-config-k3XF8V97.mjs";
6
- import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-Dj2LtxCt.mjs";
7
- import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-D-bOngd3.mjs";
2
+ import { $ as walkAndCollectImageAttrs, $t as flatInkParametersSchema, A as parseSiteChromeBackgroundColorToken, An as buildEntryScaffold, Ar as createContentEntryRef, At as getMimeType, B as sectionStylesOverrideSchema, Bn as isResolvedInternalLinkEntityType, Bt as footerPreferencesSchema, C as blockOrderIdentifiersForCommand, Cn as bookingPaymentCollectionOptionSchema, Cr as makeBoundaryId, Ct as parseCanonicalMediaIdentifier, D as pagePathForCommand, Dn as RichTextDocSchema, Dr as createBlockRef, Dt as deriveVideoSlotPolicy, E as pageIdentifierForCommand, Er as ianaTimezoneSchema, F as defaultHeaderBrandPreferences, Fn as entryLinkSchema$1, Fr as createNavigationRef, G as headerInteractionQuietPalette, Gn as parseGradientPresetId, Gt as cardVariantRoleValues, H as skinBookingBarSchema, Hn as pageLinkSchema$1, Hr as __toESM, Ht as boxlessCardVariantValue, In as externalLinkSchema$1, Ir as createPageRef, It as classifyKnownMimeType, J as boxBackgroundOverlaySchema, Jn as asHeaderLayoutId, Jt as surfaceCardRoleValues, K as blockCustomCssRuleSchema, Kt as itemRoleValues, L as cardStylesOverrideSchema, Ln as internalLinkSchema, Lt as managementMediaLibraryUploadLimitForMimeType, M as defaultHeaderPreferences, Mn as findUnfilledSentinels, Mr as createEventSeriesRef, N as defaultHeaderNavPreferences, Nn as RESOLVED_INTERNAL_LINK_ENTITY_TYPES, Nr as createFooterRef, Nt as parseRelativeStoragePath, O as hasConfiguredBookingVertical, On as isRichTextDoc, Or as createBlocksRef, Ot as resolveVideoSelectionIntentForMediaField, P as defaultHeaderBrandPresentation, Pn as customLinkSchema$1, Pr as createFormRef, Pt as FILE_SIZE_LIMITS, Q as summarizePortableMediaReferences, Qt as flatInkHoverTreatmentSchema, R as containerStylesOverrideSchema, Rn as internalResolvedLinkSchema, Rr as createVenueRef, Rt as parseSafeDownloadFilename, S as blockIdentifierForCommand, Sr as asSiteStyleId, St as buildMediaIdentifierFromFilename, T as pageIdentifierForBlockCommand, Tn as eventCommandScheduleSchema, U as headerVariantValues, Un as ICON_PICKER_PRESETS, Ut as cardRoleSchema, V as themeSchema, Vn as linkSchema, Vr as __commonJSMin, Vt as getFontWidthRange, W as headerInteractionPaletteValues, Wn as gradientPresetIdValues, Wt as cardRoleValues, X as runtimeBoxBackgroundSchema, Xn as bookingPageLookIdValues, Xt as buttonStyleSelectionSchema, Y as boxBackgroundSchema, Yn as asHeaderStyleId, Yt as BUTTON_STYLE_IDS, Z as collectPortableMediaReferencesFromContent, Zt as editorialLinkParametersSchema, _ as mapEventCommandContent, _n as paletteTokenNameSchema, _t as resolveManagedMediaReference, an as buttonVariantIdSchema, ar as arrangementModes, at as parseAspectRatioValue, bn as changeBookingQuestionsInputSchema, br as asLayoutVariantKey, bt as mediaTypeDiscriminants, c as isEventVisibility, cn as parseOpaqueButtonColourToken, cr as headingDecorationColorTokenValues, ct as getDirectImageUrlForSiteScopedPath, d as venueManagementFields, dn as hexColorSchema, dr as visibleHeadingDecorationFamilyValues, dt as imageMediaSchema, en as quietArrowParametersSchema, er as pageDesignEditorBackgroundOverrideOwner, et as deleteEnvSpecificKeys, f as sortRecord, fn as normalizePaletteHex, fr as asAppearancePresetId, ft as mediaSchema, g as resolveEventSeriesWaitlistMapping, gn as paletteModeSchema, gr as asDesignBlockId, gt as buildRenderableMediaAssetIndex, hn as paletteColorsSchema, hr as asBoundaryOptionId, ht as videoMediaSchema, i as sdkEventUpsertOptionalFieldSchemas, in as buttonSystemSchema, ir as VARIANT_ROLES, it as isExplicitRectCrop, j as backgroundAppearanceColorTokenNames, jn as validateEntryInstance, jr as createEventCategoryRef, jt as asRecord, k as headerPreferencesSchema, kn as sanitizeHref, kr as createCommandRef, ln as PALETTE_TOKEN_NAMES, lr as isArrangementMode, lt as getImageUrl, mn as paletteColorsFromEntries, mr as asBlockOrderIndex, mt as runtimeMediaSchema, nn as buttonEffectApplicationSchema, nr as siteChromeBackgroundOverrideOwner, nt as rotateNormalizedPoint, o as classifySdkEventBookingOffer, on as buttonVisualStatesSchema, or as eventListTreatmentValues, ot as resolveMediaTransformForAspect, p as stableStringify, pn as paletteColorEntries, pr as asBlockContentVersionId, pt as persistableMediaSchema, q as customCssRuleSchema, qn as asFooterLookId, qt as openCardRoleValue, rn as buttonPressOffsetSchema, rt as normalizeWidthCandidates, sn as opaqueButtonColourTokenSchema, sr as eyebrowTreatmentValues, st as getDirectImageUrlForRelativePath, t as classifySdkEventTiming, tn as squareOutlineParametersSchema, tr as parseBookingPageLookId, tt as looksLikeUuid, u as eventCategoryManagementFields, un as blockColorTokenNames, ur as tileTreatmentValues, ut as isSiteScopedDirectImageStoragePath, vn as parseColorTokenParts, vr as asDesignPageId, vt as PUBLIC_FILE_FIELD_KINDS, w as entryIdentifierForCommand, wn as bookingPaymentTermsSchema, wt as parseMediaIdentifier, x as eventManagementTiming, xr as asPageFlowPresetId, xt as mediaIdentifierSchema, yn as parseThemeColorToken, yr as asDesignSystemTemplateId, z as headerPositioningValues, zn as internalRouteOnlyLinkSchema, zr as refSlug, zt as defaultFooterPreferences } from "../sdk-event-upsert-BL6uAz53.mjs";
3
+ import { $ as parseFooterCompositionV1, $t as inferSiteDateLocale, B as exposeSecret, Bn as formatCurrencyAmount, Cn as publicEventPricingCurrency, Ct as trimmedStringOrNull, Dn as publicEventPricingType, En as publicEventPricingStrategy, Er as parseUserId, Et as buildBookingUtcDateWindow, F as orderedLiveRunSessions, G as parseMailingListSignedSourceToken, Gn as unsafeAsDemoCapability, Gt as formatBookingCutOffHours, H as slugify, Hn as assertNever, I as resolveWholeSeriesBookingPhase, Ir as err, Jt as formatDateRange, K as parseMailingListRuntimeContext, Kt as hasBookingClosed, L as resolveWholeSeriesPaymentDates, Ln as toNonNegativeCents, Lr as ok, M as CANCELLED_SESSION_STATUS, Mn as mapReadonlyNonEmptyArray, N as firstLiveRunSessionStartMs, Nt as getBookingInstalmentPlanIntervalCount, On as resolveExactOrFreePriceDisplay, P as nextLiveRunSessionStartMs, Pt as getBookingInstalmentProtectedDepositAmountCents, Qt as formatTimeRange, R as resolveWholeSeriesRunLifecycle, Rr as blockInteractionContextSchema, S as EVENT_PRESET_VALUES, Sn as isPublicEventPricingOptionDisplayable, T as WHOLE_SERIES_EVENT_PRESET_VALUES, Tn as publicEventPricingOptions, Tr as parseSiteId, Tt as selectCategoryView, U as parseMailingListBlockId, Un as formatDurationUnitLabel, Ut as bookingCutOffHoursBetween, V as parseManagementKey, Vt as deriveTotalTicketQuantity, W as parseMailingListContentVersionId, Wt as formatBookingClosedTime, X as DEFAULT_MAILING_LIST_PRIVACY_NOTE, Xn as parseSiteTermsVersionId, Xt as formatDateTimeRange, Yt as formatDateTime, Z as DEFAULT_MAILING_LIST_SUCCESS_MESSAGE, Zt as formatTime$1, _t as normalizeLocationAddressText, a as authoredValuesEqual, an as formatLocalScheduleTime, at as richTextHasText, b as resolveSiteVerticalBookingConfig, bn as formatBookingPriceDisplay, bt as publicLocationSchema, cn as getLocalScheduleTime, ct as parseWeeklyOpeningHours, d as formatCreditProductUnits, dn as parseLocalScheduleTime, en as resolveBookingDisplayContext, et as footerLayoutForLookId, fn as parseUtcIsoDateTimeString, ft as decideLocationSave, gn as toBookingTimeZone, gt as locationValueSchema, h as NAVIGATION_LOCATIONS, hn as resolveBookingTimeZoneId, ht as EVENT_ADDRESS_AFTER_BOOKING_LABEL, i as isRecord$27, in as formatLocalScheduleDate, it as isCanonicalRichTextDoc, kn as resolvePricingOptionsPriceDisplay, kr as parseEventSeriesId, l as creditProductUnitNoun, lr as unsafeAsPositiveByteCount, mn as resolveBookingBusinessTimeZone, mt as locationMapLinks, nt as DEFAULT_MAILING_LIST_TARGETING, on as getBookingLocalDateKey, ot as formatOpeningHoursRows, pn as toUtcIsoDateTimeString, pt as stableJsonStringify, q as assessMailingListTargeting, qt as formatDate, rn as compareLocalScheduleDates, rt as planMailingListChoicePresentation, sn as getLocalScheduleDate, sr as unsafeAsMediaAssetId, tn as toScheduledBookingDateTime, tt as parseMailingListPlacementTargeting, u as formatCreditProductPayment, un as parseBookingLocalDate, vn as parsePageSurfaceSubject, vt as parseLocationValue, wn as publicEventPricingDisplay, wr as parseApiKeyId, wt as mapDrawingSchema, xn as formatEventPricing, xt as toLocationCoordinates, yn as EVENT_PRESET_VOCABULARY, yt as projectPublicLocation, z as createSecret } from "../src-ClX_VLD6.mjs";
4
+ import { $ as walkLocalContentMedia, $n as extractApiErrorMessage, $r as publicVenueMapLocationSchema, $t as commandContexts, A as formatDiffSummary, An as isLocalConfigured, Ar as planSelectionCombinationPrices, At as navigationIdentityMap, B as formatFieldChange, Bn as DEFAULT_MEDIA_FIELD_KINDS, Br as flexibleBalanceDueDay, Bt as ACCOUNT_SITE_SEARCH_MAX_LENGTH, C as reportFromOutcomes, Cn as ErrorCodes, Cr as reviewedStay, Ct as listFiles, D as calculateDiff, Dr as roomSetupSchema, Dt as isMediaValue, E as createEmptySyncResult, En as CliExit, Er as roomOccupancySchema, Et as writeJsonFileAtomic, F as buildJsonDiff, Fn as cardListKnobBlocks, Fr as checkoutCopy, Ft as createBearerAccountApi, G as applyLocalMediaPush, Gn as MAX_REPEATER_GRID_COLUMNS, Gr as getStripeMinimumChargeRequirement, Gt as createPushConfigCommand, H as revalidateLocalMediaPushPlan, Hn as blockContentSourceSchema, Hr as repriceBookingCollectionOptions, Ht as navigationCommandItemToManagementInput, I as hasPageOperations, In as lookKnobBlocks, Ir as unsafeAsPositiveCheckoutQuantity, It as ACCOUNT_SITE_CURSOR_MAX_LENGTH, J as readStableBinaryFile, Jn as resolveRepeaterGridColumnFieldId, Jr as eventCalendarDefaultViewValues, Jt as revalidatePushConfigPlan, K as prepareLocalMediaForPush, Kn as isAcceptedRepeaterGridSpan, Kr as getBookingLaterInstalments, Kt as loadPushConfigTarget, L as pageMetadataForUpsert, Ln as NodeSchema, Lr as planCheckoutPaymentFlow, Lt as ACCOUNT_SITE_LIST_LIMIT_DEFAULT, M as findChangedFieldsWithValues, Mn as loadSdkEnvironment, Mr as placementProblemText, Mt as convertPulledNavigationToLocal, N as formatHumanDiff, Nn as cardListBlockParts, Nr as stayLineText, Nt as convertPulledPagesToLocal, O as calculateFooterDiff, On as getEnvPrefix, Or as sharedRoomArrangementSchema, Ot as duplicateNavigationIdentityMessage, P as calculatePullDiff, Pn as cardListFamilyBlocks, Pr as stayNoteText, Pt as AccountApiMalformedResponseError, Q as normalizeMediaValueToIdentifierOnly, Qn as ManagementApiError, Qr as publicMapLocationResultSchema, Qt as CommandFailure, Rn as NodeTreeSchema, Rr as planFlexibleBalanceCreditFirst, Rt as ACCOUNT_SITE_LIST_LIMIT_MAX, S as planCliCommandBatchForBindings, Sn as withRiverbankEnv, Sr as placeBooking, St as fileExists, T as executeResidualSettingsSyncPlan, Tn as transportSuggestion, Tr as roomChoicesSchema, Tt as writeJsonFile, Un as blockRequiredFeatureSchema, Ur as resolveAvailableBookingCollectionOptions, Ut as normalizeNavigationConfigItemForCommand, V as formatFieldPath, Vn as blockCategoryEnum, Vr as isBookingCollectionEquivalentToUpfront, Vt as ACCOUNT_SITE_TITLE_MAX_LENGTH, W as syncLocalMediaForPull, Wn as fieldSchema$1, Wr as resolveBookingCollectionOptionFacts, Wt as applyPushConfigPlan, X as sha256, Xn as resolveRepeaterGridSpanFieldId, Xr as eventCalendarListLayoutCompatibleDisplayModeValues, Xt as deriveCmsApiUrlFromDashboardUrl, Y as writeBinaryFileAtomic, Yn as resolveRepeaterGridRowFieldId, Yr as eventCalendarDisplayModeValues, Yt as createBearerAPIClient, Z as normalizeMediaIdentifierInput, Zn as visibilityLevels, Zr as eventCalendarListLayoutValues, Zt as mapEnvironmentExecutionOutcomesJson, _ as commandExecutionToReport, _n as executeEnvironmentPlan, _r as placesLeftText, _t as metadataTargetFromEnvironment, a as executeEntryCommandPlanAsReport, ai as CALENDAR_SSR_PAGE_SIZE, an as confirmAction, ar as linkPayloadSchema, at as readAllMeta, b as executeCompiledCliCommandPlanAsReport, bn as planEnvironmentWriteAuthorization, br as sameRoomOption, bt as writeMetadataRecordMap, c as titleFromEntryData, ci as calendarSourceCursorSchema, cn as formatDateShort, cr as pageDesignIntentSchemaVersion, ct as readFooterMeta, d as unsafeAsCliEntryIdentifier, di as eventSurfaceScopeValues, dn as managementClientFor, dr as areEventBookingRequirementsIdentical, dt as readPagesMeta, ei as publicMembershipProductSchema, en as defineCommand, er as normalizeApiError, et as buildStorageUrl, f as unsafeAsCliFormSlug, fi as monthNumber, fn as mapEntryForOutput, fr as eventBookingConsentContentKey, ft as readSettingsMeta, g as commandCompileFailureToReport, gi as unwrapResponse, gn as runWithInvocation, gr as checkoutStatusArms, gt as metadataFilePath, h as mutationCounterForEffect, hi as ApiEnvelopeError, hn as resolveCommandPath, hr as resolveSelectionAttendanceMode, ht as ensureMetadataDir, i as entrySiteCommandTypes, ii as purchasablePublicPassProductSchema, in as bindRequestTimeout, ir as sdkSettingsUpdateSchema, it as readEntries, j as hasPendingChanges, jn as isRemoteConfigured, jr as eventRegistrationErrors, jt as convertPulledFooterToLocal, k as formatDiffDetail, kn as getEnvironmentDebugInfo, kr as nextCombinationHint, kt as navigationIdentity, l as unsafeAsCliBlockIdentifier, li as eventScheduleScopeValues, ln as handleCommandError, lr as sdkConfiguredBookingVerticalConfigSchema, lt as readFormsMeta, m as commandReportToSyncResult, mi as publicEventLoaderQuerySchemaShape, mn as parseJsonData, mr as decideSelectionAttendance, mt as writeMediaManifest, n as entryCommandCompileErrorToReport, ni as publicProductSchema, nn as registerCommand, nr as ApiRequestError, nt as extractMediaIdentifiers, o as executeEntryCommandPlanAsSyncResult, oi as calendarMonthDate, on as createOutputForCommand, or as portablePageDesignSchema, ot as readEventCategoriesMeta, p as unsafeAsCliPageIdentifier, pi as normalizeCalendarFilterId, pn as parseJsonArray, pr as INCOMPATIBLE_ATTENDANCE_MESSAGE, pt as readVenuesMeta, q as admitBinaryWriteDestination, qn as parseRepeaterGridInteger, qr as MAX_EVENT_BOOKING_SELECTION_ITEMS, qt as preparePushConfigTarget, r as entryCommandReportToSyncResult, ri as purchasablePublicMembershipProductSchema, rn as renderedByOwner, rr as sdkEventScheduleSchema, rt as findLegacyEntryFiles, s as syncResultForEntryCommandCompileError, si as calendarMonthWindowSchema, sn as currentInvocationEnvelope, sr as pageDesignDecisionsV2Schema, st as readEventsMeta, t as compileEntryPushCommands, ti as publicPassProductSchema, tn as defineCommandGroup, tr as isRecord$2, tt as downloadMedia, u as unsafeAsCliContentTypeKey, ui as eventSurfacePresetValues, un as loadManagementTarget, ur as API_ENDPOINTS, ut as readNavigationMeta, v as commandReportHasFailures, vn as parseEnvironmentSelection, vr as roomKindOptions, vt as readMetadataFile, w as mergeManySyncResults, wn as formatError, wr as reviewedRoomsSchema, wt as readJsonFile, x as formatManagementError, xn as requireEnvironmentWriteAuthorization, xr as countSoFar, xt as ensureDir, y as executeCliCommandPlan, yn as planEnvironmentExecution, yr as roomsOfferSharing, yt as writeMetadataFile, z as buildFieldChanges, zn as bindingSchema, zr as bookingCollectionDatesOpen, zt as ACCOUNT_SITE_LIST_LIMIT_MIN } from "../entryCommands-CXGj-eca.mjs";
5
+ import { r as CLI_VERSION, t as loadConfigFile } from "../load-config-Bhh-kYhx.mjs";
6
+ import { t as eventUpsertInputSchema } from "../eventUpsertInputSchema-DZdxyRB6.mjs";
7
+ import { a as prepareScaffoldExecution, c as LOCAL_PACKAGE_VENDOR_DIR, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, n as createScaffoldCompletion, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan } from "../plan-FPq8qKNu.mjs";
8
8
  import { config } from "dotenv";
9
9
  import { z } from "zod";
10
10
  import { Command, CommanderError } from "commander";
@@ -13660,6 +13660,24 @@ const blockAppearancePresets = [
13660
13660
  },
13661
13661
  styleFallback: [id$1("media-text-photo-beside-text")]
13662
13662
  }),
13663
+ defineArrangementLook("media-text-quote-beside-circle", "media-text", "Quote beside a round photo", "circle-beside", ["imagePosition"], {
13664
+ mediaFrame: { default: {
13665
+ kind: "fixed",
13666
+ aspectRatio: "1/1",
13667
+ borderRadius: "50%"
13668
+ } },
13669
+ thumbnail: sketch.page([sketch.middle([sketch.photo("medium", "circle")], [
13670
+ sketch.title(.6),
13671
+ sketch.quote("small"),
13672
+ sketch.text(2),
13673
+ sketch.text(1, .5)
13674
+ ])]),
13675
+ forcedKnobs: {
13676
+ imageShape: "circle",
13677
+ aspectRatio: "1/1"
13678
+ },
13679
+ styleFallback: [id$1("media-text-circle-beside-text"), id$1("media-text-photo-beside-text")]
13680
+ }),
13663
13681
  defineArrangementLook("hero-photo-beside-text", "hero", "Photo beside the text", "split", heroKnobs, {
13664
13682
  photoUse: "beside",
13665
13683
  thumbnail: sketch.page([sketch.middle([
@@ -14391,6 +14409,24 @@ const blockAppearancePresets = [
14391
14409
  }),
14392
14410
  blockKinds: ["block.team-members"]
14393
14411
  },
14412
+ {
14413
+ ...defineCardListLook("team-members-person-rows", "One person per row, with facts", "stack", [
14414
+ "media",
14415
+ "title",
14416
+ "text",
14417
+ "facts"
14418
+ ], ["showPhotos"], {
14419
+ thumbnail: sketch.page([sketch.down(2, [sketch.row(sketch.weight(2, [sketch.photo("medium", "circle"), sketch.card([sketch.text(3, .7)])]), sketch.weight(3, [
14420
+ sketch.title(.4, "small"),
14421
+ sketch.title(.6),
14422
+ sketch.text(4)
14423
+ ]))])]),
14424
+ teamBiography: "profile",
14425
+ teamFacts: "person",
14426
+ styleFallback: [id$1("team-members-portrait-bio")]
14427
+ }),
14428
+ blockKinds: ["block.team-members"]
14429
+ },
14394
14430
  {
14395
14431
  ...defineCardListLook("team-members-ruled-names", "Names in a ruled list", "index", [
14396
14432
  "title",
@@ -32829,6 +32865,11 @@ const loomLooks = {
32829
32865
  treatment: "team-ruled-names",
32830
32866
  roleMap: loomRoles
32831
32867
  },
32868
+ {
32869
+ id: id("team-members-person-rows"),
32870
+ treatment: "team-person",
32871
+ roleMap: loomRoles
32872
+ },
32832
32873
  {
32833
32874
  id: id("shop-price-cards"),
32834
32875
  treatment: "shop-price-cards",
@@ -32884,6 +32925,11 @@ const poiseOffers = [
32884
32925
  roleMap: poiseRoles,
32885
32926
  itemRoles: { items: "card" }
32886
32927
  },
32928
+ {
32929
+ id: id("team-members-person-rows"),
32930
+ treatment: "team-person",
32931
+ roleMap: poiseRoles
32932
+ },
32887
32933
  {
32888
32934
  id: id("shop-price-cards-featured"),
32889
32935
  treatment: "prices-featured",
@@ -33325,6 +33371,11 @@ const havenOffers = [
33325
33371
  roleMap: havenRoles,
33326
33372
  itemRoles: { container: "card" }
33327
33373
  },
33374
+ {
33375
+ id: id("team-members-person-rows"),
33376
+ treatment: "team-person",
33377
+ roleMap: havenRoles
33378
+ },
33328
33379
  {
33329
33380
  id: id("shop-price-cards-featured"),
33330
33381
  treatment: "prices-featured",
@@ -33846,6 +33897,11 @@ const brookOffers = [
33846
33897
  treatment: "team-names",
33847
33898
  roleMap: brookRoles
33848
33899
  },
33900
+ {
33901
+ id: id("team-members-person-rows"),
33902
+ treatment: "team-person",
33903
+ roleMap: brookRoles
33904
+ },
33849
33905
  {
33850
33906
  id: id("shop-price-cards"),
33851
33907
  treatment: "prices",
@@ -34460,6 +34516,11 @@ const orbitOffers = [
34460
34516
  treatment: "media-circle",
34461
34517
  roleMap: orbitRoles
34462
34518
  },
34519
+ {
34520
+ id: id("media-text-quote-beside-circle"),
34521
+ treatment: "media-quote",
34522
+ roleMap: orbitRoles
34523
+ },
34463
34524
  {
34464
34525
  id: id("media-text-photo-beside-text"),
34465
34526
  treatment: "media-beside",
@@ -34480,6 +34541,12 @@ const orbitOffers = [
34480
34541
  treatment: "team-names",
34481
34542
  roleMap: orbitRoles
34482
34543
  },
34544
+ {
34545
+ id: id("team-members-person-rows"),
34546
+ treatment: "team-person",
34547
+ slotRoles: { facts: "card" },
34548
+ roleMap: orbitRoles
34549
+ },
34483
34550
  {
34484
34551
  id: id("shop-price-cards"),
34485
34552
  treatment: "prices",
@@ -34705,6 +34772,21 @@ const orbitOffers = [
34705
34772
  treatment: "faq-open",
34706
34773
  roleMap: orbitRoles
34707
34774
  },
34775
+ {
34776
+ id: id("list-ticked-points"),
34777
+ treatment: "list-ticks",
34778
+ roleMap: orbitRoles
34779
+ },
34780
+ {
34781
+ id: id("list-two-columns"),
34782
+ treatment: "list-columns",
34783
+ roleMap: orbitRoles
34784
+ },
34785
+ {
34786
+ id: id("list-headed-cards"),
34787
+ treatment: "list-cards",
34788
+ roleMap: orbitRoles
34789
+ },
34708
34790
  {
34709
34791
  id: id("cta-text-in-panel"),
34710
34792
  treatment: "cta-panel",
@@ -37672,7 +37754,10 @@ const curatedSiteStyles = [
37672
37754
  defineCuratedSiteStyle({
37673
37755
  id: "site-style:orbit",
37674
37756
  name: "Orbit",
37675
- offering: { kind: "lab" },
37757
+ offering: {
37758
+ kind: "client",
37759
+ siteSlugs: ["danu"]
37760
+ },
37676
37761
  description: "Round photos with a ring around them, three dots above each heading, white rounded cards and pill buttons, with arcs where your bands of colour begin and end. For dance schools, movement classes and community studios.",
37677
37762
  generationBrief: "Use warm, lively words in sentence case for the text, and keep headings short, because they are set in capitals. Say plainly who a class is for and that beginners are welcome, give real times, prices and places, and avoid fitness slogans and promises about results.",
37678
37763
  headingDecoration: noHeadingDecoration,
@@ -37826,6 +37911,11 @@ function withTeamLooks(looks, roleMap) {
37826
37911
  treatment: "team-names",
37827
37912
  roleMap
37828
37913
  },
37914
+ {
37915
+ id: id("team-members-person-rows"),
37916
+ treatment: "team-person",
37917
+ roleMap
37918
+ },
37829
37919
  ...looks.offers
37830
37920
  ]
37831
37921
  };
@@ -49800,6 +49890,13 @@ const opaquePanels = [
49800
49890
  token: "surface"
49801
49891
  }
49802
49892
  },
49893
+ {
49894
+ selector: ":where([data-block='event-registration']) .er-room-photos",
49895
+ paint: {
49896
+ kind: "solid",
49897
+ token: "surface"
49898
+ }
49899
+ },
49803
49900
  {
49804
49901
  selector: ":where([data-block='event-calendar']) .event-agenda-card",
49805
49902
  paint: {
@@ -67851,7 +67948,6 @@ const publicEventDestinationSchema = z.discriminatedUnion("kind", [z.object({
67851
67948
  const eventVenueSchema = z.object({
67852
67949
  area: z.string().nullable().optional(),
67853
67950
  addressWithBooking: z.boolean().optional(),
67854
- drawing: z.lazy(() => mapDrawingSchema).optional().catch(undefined),
67855
67951
  id: z.string(),
67856
67952
  name: z.string(),
67857
67953
  address: z.string().nullable(),
@@ -68037,6 +68133,34 @@ const publicWholeSeriesRunSchema = z.object({
68037
68133
  /**
68038
68134
  * Zod schema for the fields shared by both booking scopes.
68039
68135
  */
68136
+ /** An event's rooms as placement reads them. Nothing here says who has booked. */
68137
+ const publicEventRoomsSchema = z.object({
68138
+ seriesId: z.string(),
68139
+ arrangement: sharedRoomArrangementSchema,
68140
+ kinds: z.array(z.object({
68141
+ id: z.string(),
68142
+ name: z.string(),
68143
+ sleeps: z.number().int().positive(),
68144
+ description: z.string(),
68145
+ photos: z.array(z.object({
68146
+ src: z.string(),
68147
+ alt: z.string()
68148
+ })),
68149
+ prices: z.array(z.object({
68150
+ pricingOptionId: z.string(),
68151
+ peopleInRoom: z.number().int().positive().nullable(),
68152
+ priceName: z.string()
68153
+ }))
68154
+ })),
68155
+ rooms: z.array(z.object({
68156
+ id: z.string(),
68157
+ kindId: z.string(),
68158
+ setup: roomSetupSchema,
68159
+ occupancy: roomOccupancySchema,
68160
+ freePlaces: z.number().int().nonnegative()
68161
+ })),
68162
+ linkedOptionIds: z.array(z.string())
68163
+ });
68040
68164
  const publicEventBaseSchema = z.object({
68041
68165
  eventPreset: eventPresetSchema.optional(),
68042
68166
  eventDestinationMode: eventDestinationModeSchema.optional(),
@@ -68114,7 +68238,8 @@ const publicEventBaseSchema = z.object({
68114
68238
  acceptsPasses: z.boolean(),
68115
68239
  acceptsMemberships: z.boolean(),
68116
68240
  allowsMultipleBooking: z.boolean().default(false),
68117
- combinationPrices: z.array(combinationOfferSchema).default([])
68241
+ combinationPrices: z.array(combinationOfferSchema).default([]),
68242
+ rooms: publicEventRoomsSchema.optional()
68118
68243
  });
68119
68244
  /**
68120
68245
  * Zod schema for public event data.
@@ -68215,27 +68340,21 @@ function formatEventStartingPrice(pricing) {
68215
68340
  }
68216
68341
  }
68217
68342
  /**
68218
- * A short note on booking with a deposit, said next to the price so the
68219
- * option isn't first seen at checkout: "or a £40 deposit to book", or "with a
68220
- * £40 deposit to book" when paying in full isn't offered. Null when no option
68221
- * starts with a deposit (equal instalments have none).
68343
+ * A short note on how booking is paid, said next to the price so it isn't
68344
+ * first seen at checkout: "or a £40 deposit to book", or "with a £40 deposit
68345
+ * to book" when paying in full isn't offered, with the balance's due day when
68346
+ * there is one. Once it's too late for the deposit the event offers, "paid in
68347
+ * full when you book". Null when the event never offers a deposit.
68222
68348
  */
68223
- function formatEventDepositNote(pricing, paymentTerms, start) {
68224
- const currency = publicEventPricingCurrency(pricing);
68225
- if (!currency) return null;
68226
- const deposit = paymentTerms.allowedOptions.map((option) => {
68227
- switch (option.kind) {
68228
- case "flexible_balance": return option.config.upfrontAmountCents;
68229
- case "instalment_plan": return getBookingInstalmentProtectedDepositAmountCents(option.plan);
68230
- case "upfront":
68231
- case "deferred_manual": return null;
68232
- }
68233
- }).find((amount) => amount !== null && amount > 0);
68234
- if (deposit === undefined) return null;
68235
- const payInFull = paymentTerms.allowedOptions.some((option) => option.kind === "upfront");
68236
- const flexible = paymentTerms.allowedOptions.find((option) => option.kind === "flexible_balance");
68237
- const dueBy = flexible && start ? `, the rest due by ${formatDueDay(flexibleBalanceDueDay(flexible.config, start.startsAt, start.timeZone))}` : "";
68238
- return `${payInFull ? "or" : "with"} a ${formatEventPriceAmount(deposit, currency)} deposit to book${dueBy}`;
68349
+ function formatEventDepositNote(offer) {
68350
+ switch (offer.kind) {
68351
+ case "none": return null;
68352
+ case "paid_in_full": return "paid in full when you book";
68353
+ case "deposit": {
68354
+ const dueBy = offer.balanceDueDay ? `, the rest due by ${formatDueDay(offer.balanceDueDay)}` : "";
68355
+ return `${offer.payInFullOffered ? "or" : "with"} a ${formatEventPriceAmount(offer.amountCents, offer.currency)} deposit to book${dueBy}`;
68356
+ }
68357
+ }
68239
68358
  }
68240
68359
  /** A calendar day ("2026-11-12") as "12 Nov 2026"; it has no time zone to convert. */
68241
68360
  function formatDueDay(day) {
@@ -77770,9 +77889,11 @@ const carouselCardsLayout = (arrangement) => arrangementCardsLayout(el("carousel
77770
77889
  }]
77771
77890
  }]));
77772
77891
  const leadSupportLayout = arrangementCardsLayout(el("div", lookSlot("items"), [leadCard]));
77892
+ const comingUpCardHook = { "data-has-coming-up": { $bind: { from: "card.comingUp" } } };
77773
77893
  const indexRow = el("li", {
77774
77894
  ...lookSlot("item"),
77775
- ...featuredCardHook
77895
+ ...featuredCardHook,
77896
+ ...comingUpCardHook
77776
77897
  }, [
77777
77898
  el("div", {
77778
77899
  ...lookSlot("numeral"),
@@ -77907,6 +78028,21 @@ const featureCardsConfig = {
77907
78028
  }
77908
78029
  }
77909
78030
  },
78031
+ {
78032
+ id: "comingUp",
78033
+ type: "boolean",
78034
+ label: "Coming up",
78035
+ description: "For something that hasn't happened yet. On a timeline, these come after a Now marker and are drawn in outline.",
78036
+ required: false,
78037
+ defaultValue: false,
78038
+ ui: {
78039
+ intent: "content",
78040
+ visibleWhen: {
78041
+ field: "$root.blockLook",
78042
+ equals: "feature-cards-timeline"
78043
+ }
78044
+ }
78045
+ },
77910
78046
  {
77911
78047
  id: "label",
77912
78048
  type: "text",
@@ -80870,6 +81006,102 @@ function formatEventTeacherLine(event) {
80870
81006
  return names$1 ? `with ${names$1}` : null;
80871
81007
  }
80872
81008
 
81009
+ //#endregion
81010
+ //#region ../blocks/src/system/runtime/nodes/events/domain/depositOffer.ts
81011
+ const NO_DEPOSIT = { kind: "none" };
81012
+ /**
81013
+ * True when the terms offer a deposit and every deposit option has run out of
81014
+ * time for these dates (commerce's `bookingCollectionDatesOpen`): a flexible balance whose due day has passed (in the
81015
+ * site's time zone), or an instalment plan that can no longer finish before
81016
+ * its deadline (a course's last session when it says so). Dates only: whether
81017
+ * a total can take a deposit is the commerce resolver's decision, not this one.
81018
+ */
81019
+ function depositDeadlinesPassed(paymentTerms, dates) {
81020
+ const deposits = depositOptions(paymentTerms);
81021
+ return deposits.length > 0 && deposits.every((option) => !bookingCollectionDatesOpen(option, dates));
81022
+ }
81023
+ /** Whether the terms include an option that starts with a deposit. */
81024
+ function termsOfferDeposit(paymentTerms) {
81025
+ return depositOptions(paymentTerms).length > 0;
81026
+ }
81027
+ /**
81028
+ * The event page's deposit note for an event, decided on dates and the prices
81029
+ * shown. A course's dates come from its live sessions, as the server reads
81030
+ * them for the booking panel; a single date starts when it starts.
81031
+ */
81032
+ function resolvePublicEventDepositOffer(event, input) {
81033
+ const prices = paidPriceSpan(event.pricing);
81034
+ const terms = event.paymentTerms;
81035
+ const payInFullOffered = terms.allowedOptions.some((option) => option.kind === "upfront");
81036
+ const applies = (option) => prices !== null && (depositCents(option) ?? Infinity) < (payInFullOffered ? prices.highestCents : prices.lowestCents);
81037
+ const deposits = depositOptions(terms).filter(applies);
81038
+ if (!prices || deposits.length === 0) return NO_DEPOSIT;
81039
+ const dates = {
81040
+ ...input.sessions ? resolveWholeSeriesPaymentDates({
81041
+ sessions: input.sessions,
81042
+ paymentTerms: terms
81043
+ }) : { bookingStartAt: event.startsAt },
81044
+ timeZone: event.siteTimeZone,
81045
+ nowIso: input.nowIso
81046
+ };
81047
+ const open$1 = deposits.find((option) => bookingCollectionDatesOpen(option, dates));
81048
+ if (!open$1) {
81049
+ return terms.allowedOptions.some((option) => option.kind === "deferred_manual") ? NO_DEPOSIT : { kind: "paid_in_full" };
81050
+ }
81051
+ return {
81052
+ kind: "deposit",
81053
+ amountCents: depositCents(open$1) ?? 0,
81054
+ currency: prices.currency,
81055
+ payInFullOffered,
81056
+ balanceDueDay: open$1.kind === "flexible_balance" && dates.bookingStartAt ? flexibleBalanceDueDay(open$1.config, dates.bookingStartAt, dates.timeZone) : null
81057
+ };
81058
+ }
81059
+ const DEPOSIT_KINDS = new Set(["flexible_balance", "instalment_plan"]);
81060
+ /**
81061
+ * The payment step's sentence when the visitor's booking is paid in full
81062
+ * although the terms offer a deposit, perhaps advertised on a cached page.
81063
+ * `offeredKinds` are the ways to pay the step shows (the live, repriced
81064
+ * decision); `dates.nowIso` should be a live clock. Too late when the
81065
+ * deposit's dates have passed; otherwise it went for an amount reason, which
81066
+ * isn't the visitor's to fix, so the sentence only says how it's paid.
81067
+ */
81068
+ function paidInFullNote(input) {
81069
+ if (!termsOfferDeposit(input.paymentTerms) || input.offeredKinds.length === 0) return null;
81070
+ if (input.offeredKinds.some((kind) => DEPOSIT_KINDS.has(kind) || kind === "deferred_manual")) return null;
81071
+ return depositDeadlinesPassed(input.paymentTerms, input.dates) ? "It’s too close to the date for a deposit, so this is paid in full now." : "This booking is paid in full when you book.";
81072
+ }
81073
+ function depositOptions(paymentTerms) {
81074
+ return paymentTerms.allowedOptions.filter((option) => depositCents(option) !== null);
81075
+ }
81076
+ /** A deposit is an amount taken up front that's less than the whole; equal instalments have none. */
81077
+ function depositCents(option) {
81078
+ switch (option.kind) {
81079
+ case "flexible_balance": return positive(option.config.upfrontAmountCents);
81080
+ case "instalment_plan": return positive(getBookingInstalmentProtectedDepositAmountCents(option.plan));
81081
+ case "upfront":
81082
+ case "deferred_manual": return null;
81083
+ }
81084
+ }
81085
+ const positive = (amount) => amount !== null && amount > 0 ? amount : null;
81086
+ /** The cheapest and dearest paid place shown; null when nothing shown is paid. */
81087
+ function paidPriceSpan(pricing) {
81088
+ const display = publicEventPricingDisplay(pricing);
81089
+ const span = (lowestCents, highestCents) => highestCents > 0 ? {
81090
+ lowestCents: Math.max(lowestCents, 0),
81091
+ highestCents,
81092
+ currency: "currency" in display ? display.currency : ""
81093
+ } : null;
81094
+ switch (display.kind) {
81095
+ case "exact": return span(display.amount, display.amount);
81096
+ case "from": return span(display.amount, Infinity);
81097
+ case "range": return span(display.minAmount, display.maxAmount);
81098
+ case "mixed": return span(display.paidFromAmount, display.paidToAmount);
81099
+ case "free":
81100
+ case "unavailable":
81101
+ case "external": return null;
81102
+ }
81103
+ }
81104
+
80873
81105
  //#endregion
80874
81106
  //#region ../blocks/src/system/runtime/nodes/events/domain/quickDates.ts
80875
81107
  const QUICK_EVENT_DATE_LIMIT = 4;
@@ -81432,6 +81664,19 @@ function decideBookingQuestionsRestoration(source) {
81432
81664
  answerMode: draft.answerMode
81433
81665
  });
81434
81666
  }
81667
+ if (source.kind === "tab_draft") {
81668
+ const { draft, identity } = source;
81669
+ const answers = tabDraftAnswersStillAsked(draft, source.current);
81670
+ if (Object.keys(answers).length === 0) return null;
81671
+ return decided({
81672
+ scope: {
81673
+ identity,
81674
+ requirementId: draft.requirementId
81675
+ },
81676
+ edits: answers,
81677
+ answerMode: "answers"
81678
+ });
81679
+ }
81435
81680
  const { snapshot: snapshot$1, currentIdentity } = source;
81436
81681
  if (!isBookingQuestionsOwner(snapshot$1.owner, currentIdentity)) return null;
81437
81682
  const scope = {
@@ -81461,6 +81706,64 @@ function restoreBookingQuestionsAnswers(state, restoration) {
81461
81706
  answerMode: restoration.answerMode
81462
81707
  };
81463
81708
  }
81709
+ const scalarQuestionTypes = [
81710
+ "text",
81711
+ "email",
81712
+ "textarea",
81713
+ "select",
81714
+ "radio",
81715
+ "checkbox",
81716
+ "tel",
81717
+ "url",
81718
+ "number",
81719
+ "date",
81720
+ "time"
81721
+ ];
81722
+ const plainAnswerSchema = z.union([
81723
+ z.string(),
81724
+ z.number(),
81725
+ z.boolean(),
81726
+ z.null(),
81727
+ z.array(z.string())
81728
+ ]);
81729
+ const bookingQuestionsTabDraftSchema = z.object({
81730
+ requirementId: z.string().min(1),
81731
+ answers: z.record(z.string(), z.object({
81732
+ type: z.enum(scalarQuestionTypes),
81733
+ value: plainAnswerSchema
81734
+ }))
81735
+ });
81736
+ function questionSet(presentation$1) {
81737
+ return presentation$1.kind === "none" || presentation$1.kind === "unavailable" ? null : presentation$1.set;
81738
+ }
81739
+ function scalarQuestions(presentation$1) {
81740
+ const set = questionSet(presentation$1);
81741
+ return new Map((set?.sections ?? []).flatMap((section$2) => section$2.items).flatMap((item) => item.type === "document_upload" ? [] : [[item.id, item.type]]));
81742
+ }
81743
+ /** The booker's own answers to the set they were shown, to keep in this tab; null when there's nothing to keep. */
81744
+ function toBookingQuestionsTabDraft(state, shown) {
81745
+ const requirementId = bookingQuestionsRequirementId(shown);
81746
+ if (!state.scope || requirementId === null || state.scope.requirementId !== requirementId || state.answerMode === "keep_existing") return null;
81747
+ const types = scalarQuestions(shown);
81748
+ const answers = Object.fromEntries(Object.entries(state.edits).flatMap(([id$2, value]) => {
81749
+ const type = types.get(id$2);
81750
+ const plain$1 = plainAnswerSchema.safeParse(value);
81751
+ return type && plain$1.success ? [[id$2, {
81752
+ type,
81753
+ value: plain$1.data
81754
+ }]] : [];
81755
+ }));
81756
+ return Object.keys(answers).length > 0 ? {
81757
+ requirementId,
81758
+ answers
81759
+ } : null;
81760
+ }
81761
+ /** Kept answers whose question is still asked, as the same kind of question, in the same set. */
81762
+ function tabDraftAnswersStillAsked(draft, current) {
81763
+ if (bookingQuestionsRequirementId(current) !== draft.requirementId) return {};
81764
+ const types = scalarQuestions(current);
81765
+ return Object.fromEntries(Object.entries(draft.answers).filter(([id$2, answer]) => types.get(id$2) === answer.type).map(([id$2, answer]) => [id$2, answer.value]));
81766
+ }
81464
81767
 
81465
81768
  //#endregion
81466
81769
  //#region ../blocks/src/system/runtime/shared/signInReturnDrafts.ts
@@ -81765,15 +82068,6 @@ function getRegistrationOccurrenceId(target) {
81765
82068
  function shouldLoadRegistrationOptions(authState, step) {
81766
82069
  return authState === "authenticated" || step === "select-tickets" || step === "enter-details" || step === "select-payment";
81767
82070
  }
81768
- function getEligibilityFlowFlags(input) {
81769
- const hasPass = (input.eligibility?.eligiblePasses.length ?? 0) > 0;
81770
- const hasMembership = (input.eligibility?.eligibleMemberships.length ?? 0) > 0;
81771
- return {
81772
- hasEligibility: hasPass || hasMembership,
81773
- hasMembershipEligibility: hasMembership,
81774
- isMembershipFastTrack: input.portalAuthState === "authenticated" && hasMembership && input.ticketsCount === 1 && input.paymentMethod === "membership"
81775
- };
81776
- }
81777
82071
  /** Prefer refreshed capacity, including a known zero; fall back while options load. */
81778
82072
  function getTicketSelectionRemainingPlaces(input) {
81779
82073
  const availability = input.eligibility?.availability;
@@ -81806,7 +82100,7 @@ function resolveHeldTicketPlaces(current, invitation, paymentHold) {
81806
82100
  const held = invitation.kind === "ready" ? {
81807
82101
  selectionId: invitation.restoration.event?.selectionId ?? current.selectionId,
81808
82102
  attendanceMode: invitation.restoration.attendanceMode,
81809
- lines: invitation.restoration.ticketSelections
82103
+ lines: invitation.restoration.claimed.kind === "reservedTickets" ? invitation.restoration.claimed.ticketSelections : []
81810
82104
  } : paymentHold;
81811
82105
  return getHeldPlacesBySelection(current, held);
81812
82106
  }
@@ -82284,9 +82578,20 @@ function consumeSearchParams(paramNames) {
82284
82578
  return values;
82285
82579
  }
82286
82580
 
82581
+ //#endregion
82582
+ //#region ../blocks/src/system/runtime/shared/utils/email.ts
82583
+ /**
82584
+ * The public booking, checkout and discount endpoints check addresses with
82585
+ * zod's email rule, so the forms use the same one: an address a form accepts
82586
+ * is never refused later, after the visitor has moved on.
82587
+ */
82588
+ const emailAddressSchema = z.string().trim().email().max(320);
82589
+ function isEmailAddress(value) {
82590
+ return emailAddressSchema.safeParse(value).success;
82591
+ }
82592
+
82287
82593
  //#endregion
82288
82594
  //#region ../blocks/src/system/runtime/shared/utils/validation.ts
82289
- const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
82290
82595
  /**
82291
82596
  * Validate registration form data.
82292
82597
  *
@@ -82303,7 +82608,7 @@ function validateFormData$1(data) {
82303
82608
  }
82304
82609
  if (!data.email.trim()) {
82305
82610
  errors.email = "Email is required";
82306
- } else if (!EMAIL_REGEX.test(data.email.trim())) {
82611
+ } else if (!isEmailAddress(data.email)) {
82307
82612
  errors.email = "Please enter a valid email";
82308
82613
  }
82309
82614
  return errors;
@@ -83947,6 +84252,13 @@ const BOOKING_DATE_PRESENTATIONS = {
83947
84252
  year: "omit"
83948
84253
  }
83949
84254
  },
84255
+ dayMonth: {
84256
+ kind: "date",
84257
+ options: {
84258
+ date: "short",
84259
+ year: "omit"
84260
+ }
84261
+ },
83950
84262
  dayLong: {
83951
84263
  kind: "date",
83952
84264
  options: {
@@ -84086,49 +84398,13 @@ function scheduleInput(event, occurrence) {
84086
84398
  deliveryMode: event.deliveryMode
84087
84399
  };
84088
84400
  }
84089
- /** Tooltip text shown when pass/membership redemptions are unavailable for multi-ticket bookings. */
84090
- const ENTITLEMENT_SINGLE_TICKET_TOOLTIP = "Only available for single-ticket bookings";
84091
- /** Passes and memberships can only be redeemed for single-ticket registrations. */
84092
- function areEntitlementsDisabledForTicketCount(ticketsCount) {
84093
- return ticketsCount > 1;
84094
- }
84095
- /**
84096
- * Describe what redeeming a pass costs the customer.
84097
- *
84098
- * The balance is what they hold *before* this booking, so "1 of 5" means four
84099
- * are left afterwards. Spelling out the balance is what stops people missing
84100
- * that a credit is being spent at all.
84101
- *
84102
- * Always one credit: passes are only redeemable for single-ticket bookings,
84103
- * per {@link areEntitlementsDisabledForTicketCount}.
84104
- *
84105
- * @param creditsRemaining - Credits on the pass before this booking, if known
84106
- */
84107
- function formatPassCreditUsageLabel(creditsRemaining) {
84108
- if (typeof creditsRemaining !== "number" || creditsRemaining <= 0) {
84109
- return `Uses ${formatCreditProductUnits("event_pass", 1)} from your pass`;
84110
- }
84111
- if (creditsRemaining === 1) {
84112
- return `Uses your last ${creditProductUnitNoun("event_pass", 1)}`;
84113
- }
84114
- return `Uses 1 of your ${formatCreditProductUnits("event_pass", creditsRemaining)}`;
84115
- }
84116
84401
  function transformRegistrationOptionsResponse(response) {
84117
- const eligiblePasses = response.entitlements.passes.map((pass) => ({
84118
- id: pass.customerPassId,
84119
- passName: pass.passName,
84120
- creditsRemaining: pass.creditsRemaining
84121
- }));
84122
- const eligibleMemberships = response.entitlements.memberships.map((membership) => ({
84123
- id: membership.customerMembershipId,
84124
- membershipName: membership.membershipName
84125
- }));
84126
- const eventAcceptsPasses = response.entitlements.requiresLoginForPasses || eligiblePasses.length > 0 || response.entitlements.availableForPurchase.passes.length > 0;
84127
- const eventAcceptsMemberships = response.entitlements.requiresLoginForMemberships || eligibleMemberships.length > 0 || response.entitlements.availableForPurchase.memberships.length > 0;
84402
+ const entitlements = registrationEntitlements(response.entitlements);
84128
84403
  const monetaryPaymentAvailable = hasMonetaryPaymentOption(response);
84129
84404
  return {
84130
84405
  discountPreview: response.discountPreview,
84131
84406
  availability: response.availability,
84407
+ ...siteOnlinePayments(response),
84132
84408
  registration: response.registration,
84133
84409
  paymentOptions: response.paymentOptions,
84134
84410
  isFree: response.paymentOptions.some((option) => option.kind === "free"),
@@ -84148,19 +84424,16 @@ function transformRegistrationOptionsResponse(response) {
84148
84424
  currency: response.pricing.currency
84149
84425
  })),
84150
84426
  ticketTypes: response.pricing.options,
84427
+ ...response.rooms ? { rooms: response.rooms } : {},
84151
84428
  price: response.pricing.subtotalCents,
84152
84429
  currency: response.pricing.currency,
84153
- requiresAuthForCredit: response.entitlements.requiresLoginForCredit ?? false,
84154
- requiresAuthForPasses: response.entitlements.requiresLoginForPasses,
84155
- requiresAuthForMemberships: response.entitlements.requiresLoginForMemberships,
84156
- eligiblePasses,
84157
- eligibleMemberships,
84158
- eventAcceptsPasses,
84159
- eventAcceptsMemberships,
84160
- availablePasses: [...response.entitlements.availableForPurchase.passes],
84161
- availableMemberships: [...response.entitlements.availableForPurchase.memberships]
84430
+ ...entitlements
84162
84431
  };
84163
84432
  }
84433
+ /** Older servers don't say whether the site takes cards; the block then assumes it does. */
84434
+ function siteOnlinePayments(response) {
84435
+ return response.onlinePayments ? { onlinePayments: response.onlinePayments } : {};
84436
+ }
84164
84437
  function customerCredit(credit) {
84165
84438
  if (!credit) return null;
84166
84439
  return {
@@ -84236,6 +84509,32 @@ function findSelectedTicketType(input) {
84236
84509
  selectedAttendanceMode: input.selectedAttendanceMode
84237
84510
  }).find((ticketType) => ticketType.pricingOptionId === input.selectedPricingOptionId) ?? null;
84238
84511
  }
84512
+ /** The server's entitlement decision, adapted once for the payment step. */
84513
+ function registrationEntitlements(entitlements) {
84514
+ const eligiblePasses = entitlements.passes.map((pass) => ({
84515
+ id: pass.customerPassId,
84516
+ passName: pass.passName,
84517
+ creditsRemaining: pass.creditsRemaining
84518
+ }));
84519
+ const eligibleMemberships = entitlements.memberships.map((membership) => ({
84520
+ id: membership.customerMembershipId,
84521
+ membershipName: membership.membershipName
84522
+ }));
84523
+ const eventAcceptsPasses = entitlements.requiresLoginForPasses || eligiblePasses.length > 0 || entitlements.availableForPurchase.passes.length > 0;
84524
+ const eventAcceptsMemberships = entitlements.requiresLoginForMemberships || eligibleMemberships.length > 0 || entitlements.availableForPurchase.memberships.length > 0;
84525
+ return {
84526
+ requiresAuthForCredit: entitlements.requiresLoginForCredit ?? false,
84527
+ requiresAuthForPasses: entitlements.requiresLoginForPasses,
84528
+ requiresAuthForMemberships: entitlements.requiresLoginForMemberships,
84529
+ unavailableEntitlements: entitlements.unavailableEntitlements ?? [],
84530
+ eligiblePasses,
84531
+ eligibleMemberships,
84532
+ eventAcceptsPasses,
84533
+ eventAcceptsMemberships,
84534
+ availablePasses: [...entitlements.availableForPurchase.passes],
84535
+ availableMemberships: [...entitlements.availableForPurchase.memberships]
84536
+ };
84537
+ }
84239
84538
 
84240
84539
  //#endregion
84241
84540
  //#region ../blocks/src/system/runtime/nodes/event-registration/combinationPrices.state.ts
@@ -84477,6 +84776,7 @@ function paymentSubtotal(subtotalCents, reductions) {
84477
84776
  }
84478
84777
  /** "4 dates, 1 place on each", above the list. */
84479
84778
  function paymentCaption(several, items$1, places) {
84779
+ if (items$1 === 1) return plural$1(places, "place");
84480
84780
  const noun = several === "runs" ? "run" : "date";
84481
84781
  return `${plural$1(items$1, noun)}, ${plural$1(places, "place")} on each`;
84482
84782
  }
@@ -84675,6 +84975,7 @@ function sameOffering(events) {
84675
84975
  function registrationSelectionMode(input) {
84676
84976
  const { events } = input;
84677
84977
  if (input.hasPreSelectedContext || events.length < 2) return SINGLE;
84978
+ if (events.some((event) => event.rooms)) return SINGLE;
84678
84979
  if (!events.every((event) => event.allowsMultipleBooking)) return SINGLE;
84679
84980
  const firstSeriesId = events[0]?.seriesId;
84680
84981
  if (events.every((event) => event.registrationSubject.kind === "occurrence" && event.seriesId === firstSeriesId)) {
@@ -84821,12 +85122,16 @@ function severalConfirmationSentence(kind, email) {
84821
85122
  }
84822
85123
  const SEVERAL_BOOKINGS_ACCOUNT_NOTE = "You can see and manage your bookings in your account.";
84823
85124
  /**
84824
- * Why passes and memberships, and the first item's deposit or instalments
84825
- * when it had them, aren't offered while several items are ticked.
85125
+ * What several items can't use. Runs can't use passes, memberships, or the
85126
+ * first run's deposit or instalments. Dates can use a pass or membership
85127
+ * (issue 1767, set 6), which the payment step's own options explain, so only a
85128
+ * deposit or instalments need saying; otherwise there's no note.
84826
85129
  */
84827
85130
  function selectionEntitlementNote(kind, hadDepositOrInstalments) {
84828
- const what = hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships";
84829
- return `${what} can be used when you book one ${kind === "dates" ? "date" : "run"} at a time.`;
85131
+ switch (kind) {
85132
+ case "dates": return hadDepositOrInstalments ? "Deposits and instalments can be used when you book one date at a time." : null;
85133
+ case "runs": return `${hadDepositOrInstalments ? "Deposits, instalments, class passes and memberships" : "Class passes and memberships"} can be used when you book one run at a time.`;
85134
+ }
84830
85135
  }
84831
85136
  const NO_RUN_PRICING_CHOICES = {};
84832
85137
  /** Runs whose price needs a choice get their own section on the tickets step. */
@@ -84923,7 +85228,7 @@ function severalRunsChoiceMessage(input) {
84923
85228
  }
84924
85229
  function selectionTicketInputs(input) {
84925
85230
  const priced = pricedTicketInputs(input);
84926
- const ticketsCount = input.invitation.kind === "ready" ? input.invitation.restoration.ticketsCount : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
85231
+ const ticketsCount = input.invitation.kind === "ready" && input.invitation.restoration.claimed.kind === "reservedTickets" ? input.invitation.restoration.claimed.places : priced.usesTicketLines ? getTicketSelectionTotal(priced.lines) : input.placeCount;
84927
85232
  return {
84928
85233
  ...priced,
84929
85234
  ticketsCount
@@ -85084,6 +85389,19 @@ function selectionCostsNothing(several, input) {
85084
85389
 
85085
85390
  //#endregion
85086
85391
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationPaymentReturn.ts
85392
+ /** On an event with rooms, what was asked for: the room lines come from placement, not from here. */
85393
+ function roomsRestoration(pending) {
85394
+ const { rooms } = pending;
85395
+ return rooms ? {
85396
+ ticketLines: rooms.dayLines,
85397
+ roomChoices: rooms.choices,
85398
+ reviewedRooms: rooms.reviewed ?? []
85399
+ } : {
85400
+ ticketLines: pending.ticketSelections,
85401
+ roomChoices: [],
85402
+ reviewedRooms: []
85403
+ };
85404
+ }
85087
85405
  /**
85088
85406
  * The server owns submitted answers and consent; payment recovery only restores choices.
85089
85407
  */
@@ -85091,7 +85409,7 @@ function paymentReturnRestoration(pending, events) {
85091
85409
  return {
85092
85410
  selection: findSelection(pending.selectedEventIds, events),
85093
85411
  runChoices: pending.runChoices ?? NO_RUN_PRICING_CHOICES,
85094
- ticketLines: pending.ticketSelections,
85412
+ ...roomsRestoration(pending),
85095
85413
  placeCount: getTicketSelectionTotal(pending.ticketSelections),
85096
85414
  formData: {
85097
85415
  ...pending.formData,
@@ -85412,6 +85730,8 @@ const draftFields = z.object({
85412
85730
  pricingOptionId: z.string().nullable(),
85413
85731
  quantity: z.number().int().positive()
85414
85732
  })),
85733
+ roomChoices: roomChoicesSchema.default([]),
85734
+ reviewedRooms: reviewedRoomsSchema.default([]),
85415
85735
  ticketsCount: z.number().int().positive(),
85416
85736
  selectedSlidingAmountInput: z.string(),
85417
85737
  formData: z.object({
@@ -85450,6 +85770,8 @@ function toEventSignInDraft(source, attempt) {
85450
85770
  runChoices: draft.runChoices,
85451
85771
  selectedAttendanceMode: draft.selectedAttendanceMode,
85452
85772
  ticketSelections: draft.selectedTicketLines,
85773
+ roomChoices: draft.roomChoices,
85774
+ reviewedRooms: draft.reviewedRooms,
85453
85775
  ticketsCount: flow.placeCount,
85454
85776
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput,
85455
85777
  formData,
@@ -85528,6 +85850,8 @@ function restoreEventSignInDraft(state, restoration) {
85528
85850
  runChoices: draft.runChoices,
85529
85851
  selectedAttendanceMode: draft.selectedAttendanceMode,
85530
85852
  selectedTicketLines: draft.ticketSelections.map((line) => ({ ...line })),
85853
+ roomChoices: draft.roomChoices,
85854
+ reviewedRooms: draft.reviewedRooms,
85531
85855
  selectedSlidingAmountInput: draft.selectedSlidingAmountInput
85532
85856
  }
85533
85857
  };
@@ -85858,15 +86182,16 @@ function oneBooking(result, context) {
85858
86182
  ...row("Where", arrival),
85859
86183
  ...facts$1.rows
85860
86184
  ],
85861
- payment: facts$1.payment,
86185
+ payment: withSubmissionPayment(facts$1.payment, result.submissionPayment),
85862
86186
  calendar: bookingCalendar(event, result.outcome),
85863
- several: null
86187
+ several: null,
86188
+ creditsLeftSentence: null
85864
86189
  };
85865
86190
  }
85866
86191
  /**
85867
86192
  * Several bookings made together: a line for each, in order, then the places
85868
- * each one has and what was paid in all. The finished card and bar keep the
85869
- * first booking's facts; there's no single calendar entry for them all.
86193
+ * each one has and what was paid in all. The finished card and bar say how
86194
+ * many were booked, from the first; there's no single calendar entry for them all.
85870
86195
  */
85871
86196
  function severalBookings(result, outcomes, context) {
85872
86197
  const several = outcomes[0]?.identity.scope === "occurrence" ? "dates" : "runs";
@@ -85875,11 +86200,27 @@ function severalBookings(result, outcomes, context) {
85875
86200
  return event ? [bookedItemRow(several, event)] : [];
85876
86201
  });
85877
86202
  return {
85878
- entry: oneBooking(result, context).entry,
85879
- summary: [...items$1, ...placesOnEachRow(several, outcomes)],
85880
- payment: severalPayment(outcomes),
86203
+ entry: severalEntry(several, outcomes, oneBooking(result, context).entry, context),
86204
+ summary: [
86205
+ ...items$1,
86206
+ ...placesOnEachRow(several, outcomes),
86207
+ ...severalFundingRow(outcomes)
86208
+ ],
86209
+ payment: withSubmissionPayment({ kind: "none" }, result.submissionPayment),
85881
86210
  calendar: null,
85882
- several
86211
+ several,
86212
+ creditsLeftSentence: creditsLeftSentence(outcomes, result.passCreditsRemaining)
86213
+ };
86214
+ }
86215
+ /** "3 dates from Mon 9 Nov" on the card and bar, with the first booking's places. */
86216
+ function severalEntry(several, outcomes, first, context) {
86217
+ const firstEvent = outcomes[0] ? findBookedEvent(context.events, outcomes[0].identity) : null;
86218
+ const count = `${outcomes.length} ${several === "runs" ? "runs" : "dates"}`;
86219
+ const when$1 = firstEvent ? `${count} from ${formatBookingWhen(firstEvent, "day")}` : count;
86220
+ return {
86221
+ ...first,
86222
+ when: when$1,
86223
+ shortWhen: when$1
85883
86224
  };
85884
86225
  }
85885
86226
  /** Runs by name and dates; dates by day, both with their times. */
@@ -85901,27 +86242,84 @@ function placesOnEachRow(several, outcomes) {
85901
86242
  value: `${places} on each ${several === "runs" ? "run" : "date"}`
85902
86243
  }] : [];
85903
86244
  }
85904
- /**
85905
- * What several bookings cost together. They're always paid up front by card
85906
- * or free, so anything else (or a booking whose details didn't load) shows
85907
- * no payment rather than a partial sum.
85908
- */
85909
- function severalPayment(outcomes) {
85910
- const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
85911
- if (payments.length !== outcomes.length) return { kind: "none" };
85912
- const paid = payments.flatMap((payment) => payment.kind === "monetary" && payment.balance.kind === "settled" ? [payment] : []);
85913
- const free = payments.filter((payment) => payment.kind === "free" || payment.kind === "waived");
85914
- const currency = paid[0]?.currency;
85915
- if (paid.length + free.length !== payments.length || paid.some((payment) => payment.currency !== currency)) return { kind: "none" };
85916
- const total = paid.reduce((sum, payment) => sum + payment.amountPaidCents, 0);
85917
- return {
86245
+ /** A checkout's cash comes from its order; booking funding and debt keep their own rows. */
86246
+ function withSubmissionPayment(payment, submission) {
86247
+ if (submission === undefined) return payment;
86248
+ const rows = submission ? [
86249
+ ...row("Paid", submission.amountPaidCents > 0 ? formatPrice(submission.amountPaidCents, submission.currency) : null),
86250
+ ...row("From account credit", submission.creditCents > 0 ? formatPrice(submission.creditCents, submission.currency) : null),
86251
+ ...submission.purchasedItems.map((item) => ({
86252
+ label: item.name,
86253
+ value: formatPrice(item.priceCents, submission.currency)
86254
+ }))
86255
+ ] : [];
86256
+ const retained = confirmationPaymentRows(payment).filter((item) => item.label !== "Paid" && item.label !== "Still to pay");
86257
+ return payment.kind === "due" ? {
86258
+ ...payment,
86259
+ paidRows: [...retained, ...rows]
86260
+ } : {
85918
86261
  kind: "settled",
85919
- rows: currency && total > 0 ? [{
85920
- label: "Paid",
85921
- value: formatPrice(total, currency)
85922
- }] : []
86262
+ rows: [...retained, ...rows]
85923
86263
  };
85924
86264
  }
86265
+ /** How one date was paid, as the finished screen groups them. */
86266
+ function fundingGroup(payment) {
86267
+ switch (payment.kind) {
86268
+ case "pass": return `with your ${payment.passName?.trim() || "class pass"}`;
86269
+ case "membership": return `with your ${payment.membershipName?.trim() || "membership"}`;
86270
+ case "monetary": switch (payment.paymentMethod) {
86271
+ case "stripe": return "paid by card";
86272
+ case "store_credit": return "paid with account credit";
86273
+ case "mixed": return "paid by card and account credit";
86274
+ case "manual": return null;
86275
+ default: return assertNever(payment.paymentMethod);
86276
+ }
86277
+ case "free":
86278
+ case "waived": return "free of charge";
86279
+ case "manual_due":
86280
+ case "managed_balance_due": return null;
86281
+ default: return assertNever(payment);
86282
+ }
86283
+ }
86284
+ function detailedPayments(outcomes) {
86285
+ const payments = outcomes.flatMap((outcome) => outcome.kind === "detailsAvailable" ? [outcome.payment] : []);
86286
+ return payments.length === outcomes.length ? payments : null;
86287
+ }
86288
+ /**
86289
+ * Several dates where a pass or membership covered some: a Payment row with
86290
+ * each way they were paid and how many dates it paid for, as one date's
86291
+ * Payment row says how it was paid. Dates paid only with money keep the total alone.
86292
+ */
86293
+ function severalFundingRow(outcomes) {
86294
+ const payments = detailedPayments(outcomes);
86295
+ return row("Payment", payments ? fundingGroupLines(payments).join(", ") : null);
86296
+ }
86297
+ /**
86298
+ * The pass's balance once several dates are booked. A covered booking's
86299
+ * receipt says it once every date had settled, so it's shown even when a
86300
+ * date's details didn't load; a booking finished through checkout has it on
86301
+ * each date's payment instead.
86302
+ */
86303
+ function creditsLeftSentence(outcomes, receiptBalance) {
86304
+ const payments = detailedPayments(outcomes);
86305
+ const left = receiptBalance ?? (payments ? passBalanceOnDates(payments) : null);
86306
+ return left === null ? null : `You have ${left} ${left === 1 ? "credit" : "credits"} left on your pass.`;
86307
+ }
86308
+ /** How many dates each way paid for, when a pass or membership paid for any. */
86309
+ function fundingGroupLines(payments) {
86310
+ if (!payments.some((payment) => payment.kind === "pass" || payment.kind === "membership")) return [];
86311
+ const groups = payments.flatMap((payment) => {
86312
+ const group = fundingGroup(payment);
86313
+ return group === null ? [] : [group];
86314
+ });
86315
+ if (groups.length !== payments.length) return [];
86316
+ const counts = groups.reduce((dates, group) => dates.set(group, (dates.get(group) ?? 0) + 1), new Map());
86317
+ return [...counts].map(([group, count]) => `${count} ${count === 1 ? "date" : "dates"} ${group}`);
86318
+ }
86319
+ function passBalanceOnDates(payments) {
86320
+ const balances = payments.flatMap((payment) => payment.kind === "pass" && payment.passCreditsRemaining !== undefined ? [payment.passCreditsRemaining] : []);
86321
+ return balances.length > 0 ? Math.min(...balances) : null;
86322
+ }
85925
86323
  function waitlistedBooking(context) {
85926
86324
  const event = context.draftEvent;
85927
86325
  const dates = entryFacts(withOccurrenceTitle(event, context.occurrenceContext), context.occurrenceContext);
@@ -85933,7 +86331,8 @@ function waitlistedBooking(context) {
85933
86331
  summary: scheduleRows(event, dates.shortWhen, "venue", context.display),
85934
86332
  payment: { kind: "none" },
85935
86333
  calendar: null,
85936
- several: null
86334
+ several: null,
86335
+ creditsLeftSentence: null
85937
86336
  };
85938
86337
  }
85939
86338
  /**
@@ -86030,6 +86429,256 @@ function isWaitlistClaimLoading(state) {
86030
86429
  return state.kind === "resolving";
86031
86430
  }
86032
86431
 
86432
+ //#endregion
86433
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationRooms.state.ts
86434
+ /**
86435
+ * The room offer for what's selected: the freshest facts we have, or the page's
86436
+ * own. The last booking options that had rooms in them are kept while no options
86437
+ * are being asked for, because a choice that no longer fits has no lines to ask
86438
+ * with, and falling back to the page's older facts would make it fit again. Facts
86439
+ * about another event are ignored.
86440
+ */
86441
+ function selectRoomOffer(selection, roomFacts) {
86442
+ const page = selection[0]?.rooms ?? null;
86443
+ return page && roomFacts?.seriesId === page.seriesId ? roomFacts : page;
86444
+ }
86445
+ function decideRoomStay(offer, choices) {
86446
+ if (offer === null) return { kind: "none" };
86447
+ return choices.length === 0 ? { kind: "empty" } : placeBooking(offer, choices);
86448
+ }
86449
+ function stayIsPlaced(stay) {
86450
+ return stay.kind === "placed";
86451
+ }
86452
+ function stayFailure(stay) {
86453
+ return stay.kind === "none" || stay.kind === "empty" || stayIsPlaced(stay) ? null : stay;
86454
+ }
86455
+ /** What the booking charges for: the places without a room, then what placement decided. */
86456
+ function bookingLines(dayLines, stay) {
86457
+ return stayIsPlaced(stay) ? [...dayLines, ...stay.ticketLines] : dayLines;
86458
+ }
86459
+ const draftRoomStay = (draft, roomFacts) => decideRoomStay(selectRoomOffer(draft.selection, roomFacts), draft.roomChoices);
86460
+ /** Whether the rooms the guest chose still fit the latest facts. Nothing chosen, or no rooms, always does. */
86461
+ function draftRoomsStillPlace(draft, roomFacts) {
86462
+ return stayFailure(draftRoomStay(draft, roomFacts)) === null;
86463
+ }
86464
+ /** The same derivation, from the draft and the options it was last checked against. */
86465
+ function draftBookingLines(draft, roomFacts) {
86466
+ return bookingLines(draft.selectedTicketLines, draftRoomStay(draft, roomFacts));
86467
+ }
86468
+ /**
86469
+ * The stay the guest is agreeing to by carrying on. The server compares the booking
86470
+ * with this, so it must be what they saw here, not what placement says by the time
86471
+ * they've signed in or paid.
86472
+ */
86473
+ function withReviewedRooms(draft, roomFacts) {
86474
+ const stay = draftRoomStay(draft, roomFacts);
86475
+ return stayIsPlaced(stay) ? {
86476
+ ...draft,
86477
+ reviewedRooms: reviewedStay(stay)
86478
+ } : draft;
86479
+ }
86480
+ /** Room prices are chosen through rooms, so they're never listed as flat tickets. */
86481
+ function dayOptionsOf(options, offer) {
86482
+ if (offer === null) return options;
86483
+ return options.filter((option) => !offer.linkedOptionIds.includes(option.pricingOptionId));
86484
+ }
86485
+ /**
86486
+ * What goes with the booking on an event with rooms: always the rooms the guest asked
86487
+ * for, whatever placement here last said. Placement on this page is only a preview;
86488
+ * the server places for real, and when the rooms have gone it refuses with a room
86489
+ * reason that takes the guest back to choose again. Someone staying only for the day
86490
+ * sends the rooms part empty. A line for a room's price outside the rooms (a custom
86491
+ * renderer listing the ticket types) sends nothing, so the server's clear refusal
86492
+ * explains it.
86493
+ */
86494
+ function roomSubmission(offer, choices, dayLines, reviewed) {
86495
+ if (offer === null) return undefined;
86496
+ if (dayLines.some((line) => line.pricingOptionId !== null && offer.linkedOptionIds.includes(line.pricingOptionId))) return undefined;
86497
+ return {
86498
+ request: choices.length === 0 ? {
86499
+ choices: [],
86500
+ reviewed: []
86501
+ } : {
86502
+ choices,
86503
+ reviewed
86504
+ },
86505
+ dayLines
86506
+ };
86507
+ }
86508
+ const NO_DEFAULT_TICKETS = [];
86509
+ /** What a sole ticket type can be picked from by default. An event with rooms has no default: its guests choose. */
86510
+ function defaultTicketOptions(offer, options) {
86511
+ return offer ? NO_DEFAULT_TICKETS : options;
86512
+ }
86513
+ /** What's still needed before the guest can carry on, or null. */
86514
+ function roomChoiceMessage(stay, dayLines) {
86515
+ if (stay.kind === "empty") return dayLines.length > 0 ? null : ADD_A_PLACE;
86516
+ const failure = stayFailure(stay);
86517
+ return failure ? placementProblemText(failure, "guest") : null;
86518
+ }
86519
+ /** The refusals the guest can put right from the rooms step, with fresh facts. */
86520
+ function isRoomChoiceRefusal(reason) {
86521
+ return reason === "roomNotEnoughPlaces" || reason === "roomNeedsMorePeople" || reason === "roomStayChanged" || reason === "roomOptionsChanged";
86522
+ }
86523
+ const ADD_A_PLACE = "Add a place to see your total.";
86524
+ /** The sticky bar's short form of the split-rooms note, for a guest who can't see the note yet. */
86525
+ const SPLIT_ROOMS_SHORT = "You'd be in separate rooms";
86526
+ const NO_TOTAL_YET = "We can't work out your total yet.";
86527
+ const TOTAL_SO_FAR = "Your total so far.";
86528
+ const TAKE_IT_OFF = "Take it off, then choose another room.";
86529
+ const PRICES_ARE = "Prices are per person, for the whole retreat.";
86530
+ const SHARING_INTRO = {
86531
+ together: `Add a place for each person. If you choose the same shared option in the same kind of room, we'll put you together when there's one free. ${PRICES_ARE}`,
86532
+ separate: `Add a place for each person. People booking together are usually given separate rooms on this retreat. ${PRICES_ARE}`,
86533
+ organiser: `Add a place for each person. The organiser decides who shares with whom. ${PRICES_ARE}`
86534
+ };
86535
+ function roomChooserIntro(offer) {
86536
+ return roomsOfferSharing(offer) ? SHARING_INTRO[offer.arrangement] : `Add a place for each person. ${PRICES_ARE}`;
86537
+ }
86538
+ const peopleIn = (lines) => lines.reduce((sum, line) => sum + line.quantity, 0);
86539
+ const peopleChoosing = (choices) => choices.reduce((sum, choice) => sum + choice.people, 0);
86540
+ function kindViews(input) {
86541
+ const details = new Map(input.offer.kinds.map((kind) => [kind.id, kind]));
86542
+ const amountOf = (id$2) => input.options.find((option) => option.pricingOptionId === id$2)?.priceAmount;
86543
+ return roomKindOptions(input.offer, input.choices, "guest").flatMap((kind) => {
86544
+ const detail = details.get(kind.kindId);
86545
+ if (!detail) return [];
86546
+ const options = kind.options.flatMap((option) => {
86547
+ const priceCents = amountOf(option.pricingOptionId);
86548
+ if (priceCents === undefined) return [];
86549
+ return [{
86550
+ key: option.key,
86551
+ choice: option.choice,
86552
+ title: option.title,
86553
+ detail: option.detail,
86554
+ priceCents,
86555
+ each: option.each,
86556
+ people: option.people,
86557
+ maxPeople: Math.min(option.mostPeople, input.maxTickets - (input.everyone - option.people)),
86558
+ placesLeft: placesLeftText(option, detail.sleeps),
86559
+ gone: option.people > 0 && option.mostPeople === 0
86560
+ }];
86561
+ });
86562
+ return [{
86563
+ kindId: kind.kindId,
86564
+ name: kind.kindName,
86565
+ description: detail.description,
86566
+ photos: detail.photos,
86567
+ options,
86568
+ fullyBooked: options.every((option) => option.gone)
86569
+ }];
86570
+ });
86571
+ }
86572
+ function totalOf(lines, options) {
86573
+ if (lines.length === 0) return null;
86574
+ return lines.reduce((total, line) => {
86575
+ const amount = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.priceAmount;
86576
+ return total === null || amount === undefined ? null : total + amount * line.quantity;
86577
+ }, 0);
86578
+ }
86579
+ function lastDayText(saleEndsAt, timeZone) {
86580
+ const instant = Date.parse(saleEndsAt);
86581
+ if (Number.isNaN(instant)) return null;
86582
+ return new Intl.DateTimeFormat(inferSiteDateLocale(timeZone), {
86583
+ day: "numeric",
86584
+ month: "long",
86585
+ year: "numeric",
86586
+ timeZone
86587
+ }).format(new Date(instant - 1));
86588
+ }
86589
+ /** The soonest a chosen room's named price ends. A room with only one price has nothing to say. */
86590
+ function priceNoteOf(stay, offer, options, timeZone) {
86591
+ if (!stayIsPlaced(stay)) return null;
86592
+ const prices = offer.kinds.flatMap((kind) => kind.prices);
86593
+ const ending = stay.ticketLines.flatMap((line) => {
86594
+ const priceName = prices.find((price$1) => price$1.pricingOptionId === line.pricingOptionId)?.priceName;
86595
+ const saleEndsAt = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.saleEndsAt;
86596
+ return priceName && saleEndsAt ? [{
86597
+ priceName,
86598
+ saleEndsAt
86599
+ }] : [];
86600
+ }).sort((left, right) => Date.parse(left.saleEndsAt) - Date.parse(right.saleEndsAt))[0];
86601
+ const lastDay = ending ? lastDayText(ending.saleEndsAt, timeZone) : null;
86602
+ return ending && lastDay ? `${ending.priceName} price until ${lastDay}` : null;
86603
+ }
86604
+ function stayLinesOf(stay, dayLines, options) {
86605
+ const rooms = stayIsPlaced(stay) ? stay.stay.map((line) => stayLineText(line, "guest")) : [];
86606
+ const day = dayLines.flatMap((line) => {
86607
+ const name = options.find((option) => option.pricingOptionId === line.pricingOptionId)?.name;
86608
+ return name ? [`${line.quantity} × ${name}`] : [];
86609
+ });
86610
+ return [...rooms, ...day];
86611
+ }
86612
+ /** What's stopping the booking, with the next step when a chosen place has gone. */
86613
+ function failureNotice(failure) {
86614
+ switch (failure.kind) {
86615
+ case "not_enough_places": return `${placementProblemText(failure, "guest")} ${TAKE_IT_OFF}`;
86616
+ case "option_unavailable": return `That room option isn't available any more. ${TAKE_IT_OFF}`;
86617
+ case "whole_room_needs_more_people": return placementProblemText(failure, "guest");
86618
+ }
86619
+ }
86620
+ function takeOffFor(failure, offer, choices) {
86621
+ if (!failure || failure.kind === "whole_room_needs_more_people") return null;
86622
+ const name = offer.kinds.find((kind) => kind.id === failure.kindId)?.name;
86623
+ return {
86624
+ label: name ? `Take off the ${name}` : "Take off that room",
86625
+ choices: choicesLeftAfterTakingOff(failure.kindId, offer, choices)
86626
+ };
86627
+ }
86628
+ /** Only what no longer fits comes off. A kind can have other choices that still do, like a men's bed beside a women's. */
86629
+ function choicesLeftAfterTakingOff(kindId, offer, choices) {
86630
+ const options = roomKindOptions(offer, choices, "guest").find((kind) => kind.kindId === kindId)?.options ?? [];
86631
+ const stillFits = (choice) => options.some((option) => sameRoomOption(option.choice, choice) && option.people <= option.mostPeople);
86632
+ const left = choices.filter((choice) => choice.kindId !== kindId || stillFits(choice));
86633
+ return left.length < choices.length ? left : choices.filter((choice) => choice.kindId !== kindId);
86634
+ }
86635
+ /** The people and money the summary can stand behind, however far the booking has got. */
86636
+ function bookingSoFar(offer, choices, stay, dayLines, options) {
86637
+ const counted = stayFailure(stay) ? countSoFar(offer, choices) : null;
86638
+ const people = peopleIn(dayLines) + (counted ? counted.people : peopleChoosing(choices));
86639
+ const totalCents = totalOf(counted ? [...dayLines, ...counted.ticketLines] : bookingLines(dayLines, stay), options);
86640
+ const stillAdding = stayFailure(stay)?.kind === "whole_room_needs_more_people";
86641
+ const totalNote = people === 0 ? null : totalCents === null ? NO_TOTAL_YET : stillAdding ? TOTAL_SO_FAR : null;
86642
+ return {
86643
+ people,
86644
+ totalCents,
86645
+ totalNote
86646
+ };
86647
+ }
86648
+ /** Why it can't go ahead, the note when nothing's stopping it, and the stay a refusal asks them to agree to. */
86649
+ function stayMessages(stay, refusal, stayLines) {
86650
+ const failure = stayFailure(stay);
86651
+ const notice = failure ? failureNotice(failure) : refusal || null;
86652
+ const notes = stayIsPlaced(stay) ? stay.notes : [];
86653
+ const note = notice === null ? notes[0] : undefined;
86654
+ return {
86655
+ notice,
86656
+ noticeStay: notice !== null && notes.length > 0 ? stayLines : [],
86657
+ note: note ? stayNoteText(note, "guest") : null,
86658
+ splitWarning: note ? SPLIT_ROOMS_SHORT : null
86659
+ };
86660
+ }
86661
+ /** The chooser, as a pure reading of the draft and the freshest room facts. */
86662
+ function presentRoomChooser(input) {
86663
+ const { offer, choices, stay, dayLines, options } = input;
86664
+ const stayLines = stayLinesOf(stay, dayLines, options);
86665
+ return {
86666
+ intro: roomChooserIntro(offer),
86667
+ kinds: kindViews({
86668
+ offer,
86669
+ choices,
86670
+ options,
86671
+ maxTickets: input.maxTickets,
86672
+ everyone: peopleChoosing(choices) + peopleIn(dayLines)
86673
+ }),
86674
+ stayLines,
86675
+ ...stayMessages(stay, input.refusal, stayLines),
86676
+ takeOff: takeOffFor(stayFailure(stay), offer, choices),
86677
+ ...bookingSoFar(offer, choices, stay, dayLines, options),
86678
+ priceNote: priceNoteOf(stay, offer, options, input.timeZone)
86679
+ };
86680
+ }
86681
+
86033
86682
  //#endregion
86034
86683
  //#region ../frontend-state/dist/index.mjs
86035
86684
  const FIELD_ORDER = [
@@ -87831,7 +88480,7 @@ function createInitialRegistrationFormData() {
87831
88480
  function validateFormData(formData, requiresConsent = false) {
87832
88481
  return {
87833
88482
  ...!formData.name.trim() ? { name: "Name is required" } : {},
87834
- ...!formData.email.trim() ? { email: "Email is required" } : !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email) ? { email: "Invalid email address" } : {},
88483
+ ...!formData.email.trim() ? { email: "Email is required" } : !isEmailAddress(formData.email) ? { email: "Invalid email address" } : {},
87835
88484
  ...requiresConsent && formData.consentAccepted !== true ? { consentAccepted: "Please read and accept the agreement before continuing." } : {}
87836
88485
  };
87837
88486
  }
@@ -87840,123 +88489,6 @@ function registrationQuestionsMessage(questionFieldErrors, errorMessage$1) {
87840
88489
  return Object.keys(questionFieldErrors).length > 0 ? errorMessage$1 : "";
87841
88490
  }
87842
88491
 
87843
- //#endregion
87844
- //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
87845
- function createRegistrationDraftData(event) {
87846
- const defaults = event ? getEventSelectionDefaults(event) : null;
87847
- return {
87848
- selection: event ? [event] : [],
87849
- runChoices: NO_RUN_PRICING_CHOICES,
87850
- formData: createInitialRegistrationFormData(),
87851
- guests: [],
87852
- selectedAttendanceMode: defaults?.attendanceMode ?? null,
87853
- selectedTicketLines: [],
87854
- selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
87855
- bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
87856
- runRequirements: NO_RUN_REQUIREMENTS
87857
- };
87858
- }
87859
- function updated(current, value) {
87860
- return typeof value === "function" ? value(current) : value;
87861
- }
87862
- function editRegistrationDraft(draft, edit) {
87863
- switch (edit.field) {
87864
- case "selection": {
87865
- const selection = updated(draft.selection, edit.value);
87866
- return {
87867
- ...draft,
87868
- selection,
87869
- selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
87870
- };
87871
- }
87872
- case "runChoices": return {
87873
- ...draft,
87874
- runChoices: updated(draft.runChoices, edit.value)
87875
- };
87876
- case "formData": return {
87877
- ...draft,
87878
- formData: updated(draft.formData, edit.value)
87879
- };
87880
- case "guests": return {
87881
- ...draft,
87882
- guests: updated(draft.guests, edit.value)
87883
- };
87884
- case "selectedAttendanceMode": return {
87885
- ...draft,
87886
- selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
87887
- };
87888
- case "selectedTicketLines": return {
87889
- ...draft,
87890
- selectedTicketLines: updated(draft.selectedTicketLines, edit.value)
87891
- };
87892
- case "selectedSlidingAmountInput": return {
87893
- ...draft,
87894
- selectedSlidingAmountInput: updated(draft.selectedSlidingAmountInput, edit.value)
87895
- };
87896
- default: return assertNever$4(edit);
87897
- }
87898
- }
87899
- /** Ready invitations own their reserved selection; identity fields remain editable. */
87900
- function canEditInvitedDraft(invitation, edit) {
87901
- return invitation.kind !== "ready" || edit.field === "formData" || edit.field === "guests";
87902
- }
87903
- function beginWaitlistInvitation(credential) {
87904
- return credential ? {
87905
- kind: "resolving",
87906
- request: { credential }
87907
- } : { kind: "none" };
87908
- }
87909
- /** A source notification is not a new attempt when its credential is unchanged. */
87910
- function receiveWaitlistInvitation(invitation, credential) {
87911
- const current = invitation.kind === "none" ? null : invitation.request.credential;
87912
- return current === credential ? invitation : beginWaitlistInvitation(credential);
87913
- }
87914
- function restoreRegistrationDraft(draft, claim, restoration) {
87915
- return {
87916
- bookingQuestions: draft.bookingQuestions,
87917
- runRequirements: NO_RUN_REQUIREMENTS,
87918
- selection: restoration.event ? [restoration.event] : draft.selection,
87919
- runChoices: NO_RUN_PRICING_CHOICES,
87920
- selectedAttendanceMode: restoration.attendanceMode,
87921
- selectedTicketLines: [...restoration.ticketSelections],
87922
- selectedSlidingAmountInput: restoration.slidingAmountInput ?? draft.selectedSlidingAmountInput,
87923
- formData: {
87924
- ...draft.formData,
87925
- email: claim.prefill.email,
87926
- name: claim.prefill.name,
87927
- phone: claim.prefill.phone ?? "",
87928
- notes: claim.prefill.notes ?? ""
87929
- },
87930
- guests: claim.prefill.guests.map((guest) => ({
87931
- name: guest.name,
87932
- email: guest.email ?? "",
87933
- phone: guest.phone ?? ""
87934
- }))
87935
- };
87936
- }
87937
- function invitationSubmission(invitation) {
87938
- switch (invitation.kind) {
87939
- case "none": return {
87940
- kind: "available",
87941
- credential: null
87942
- };
87943
- case "ready": return {
87944
- kind: "available",
87945
- credential: invitation.request.credential
87946
- };
87947
- case "resolving": return {
87948
- kind: "blocked",
87949
- message: "Please wait while we check your waiting list invitation."
87950
- };
87951
- case "portal-login-required":
87952
- case "error": return {
87953
- kind: "blocked",
87954
- message: invitation.message
87955
- };
87956
- default: return assertNever$4(invitation);
87957
- }
87958
- }
87959
-
87960
88492
  //#endregion
87961
88493
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDerivations.ts
87962
88494
  /** Public requests share subject identity without copying the run's display sessions. */
@@ -88035,18 +88567,6 @@ function resolveDiscountContext(input) {
88035
88567
  if (!input.event) {
88036
88568
  return null;
88037
88569
  }
88038
- if (selection?.method === "pass_bundle" && selection.bundlePassId) {
88039
- return {
88040
- type: "pass",
88041
- passId: selection.bundlePassId
88042
- };
88043
- }
88044
- if (selection?.method === "membership_bundle" && selection.bundleMembershipId) {
88045
- return {
88046
- type: "membership",
88047
- membershipId: selection.bundleMembershipId
88048
- };
88049
- }
88050
88570
  if (!input.eventRequiresPayment) {
88051
88571
  return null;
88052
88572
  }
@@ -88088,6 +88608,8 @@ function buildRegistrationSelectionRequest(input) {
88088
88608
 
88089
88609
  //#endregion
88090
88610
  //#region ../blocks/src/system/runtime/nodes/event-registration/waitlistClaimRestoration.ts
88611
+ /** A date's waiting list is joined one place at a time, and its offer holds that one place. */
88612
+ const DATE_OFFER_PLACES = 1;
88091
88613
  function findClaimEvent(subject, events) {
88092
88614
  switch (subject.kind) {
88093
88615
  case "event_occurrence": return findEventByOccurrenceId(events, subject.occurrenceId);
@@ -88096,24 +88618,37 @@ function findClaimEvent(subject, events) {
88096
88618
  }
88097
88619
  }
88098
88620
  /** Reserved quantities and amounts have one interpretation across restoration and submission. */
88099
- function claimedSelection(subject) {
88621
+ function claimedPlaces(subject) {
88100
88622
  switch (subject.kind) {
88101
88623
  case "event_occurrence": return {
88102
- ticketSelections: [{
88103
- pricingOptionId: null,
88104
- quantity: 1
88105
- }],
88106
- ticketsCount: 1,
88107
- slidingAmountInput: null
88624
+ kind: "anyTicket",
88625
+ places: DATE_OFFER_PLACES
88108
88626
  };
88109
88627
  case "whole_series": return {
88628
+ kind: "reservedTickets",
88629
+ places: subject.seatCount,
88110
88630
  ticketSelections: subject.ticketSelections,
88111
- ticketsCount: subject.seatCount,
88112
88631
  slidingAmountInput: subject.selectedSlidingAmount === null ? null : formatCentsAsCurrencyInput(subject.selectedSlidingAmount)
88113
88632
  };
88114
88633
  default: return assertNever$4(subject);
88115
88634
  }
88116
88635
  }
88636
+ /** The tickets they're booking: the reserved ones, or what they've chosen for the places held. */
88637
+ function claimTicketSelections(claimed, chosen) {
88638
+ return claimed.kind === "reservedTickets" ? claimed.ticketSelections : chosen;
88639
+ }
88640
+ /**
88641
+ * What to quote while they haven't chosen a ticket yet: the places held, with no ticket. The
88642
+ * answer says which tickets have room for them, which the page's own figures can't, since
88643
+ * they count the held place as taken.
88644
+ */
88645
+ function claimQuoteSelections(claimed, chosen) {
88646
+ const lines = claimTicketSelections(claimed, chosen);
88647
+ return lines.length > 0 ? lines : [{
88648
+ pricingOptionId: null,
88649
+ quantity: claimed.places
88650
+ }];
88651
+ }
88117
88652
  function resolveWaitlistClaimRestoration(input) {
88118
88653
  if (input.events.kind !== "ready") return { kind: "awaitingEvents" };
88119
88654
  const { subject } = input.claim;
@@ -88123,18 +88658,162 @@ function resolveWaitlistClaimRestoration(input) {
88123
88658
  kind: "ready",
88124
88659
  event,
88125
88660
  attendanceMode: subject.attendanceMode,
88126
- ...claimedSelection(subject)
88661
+ claimed: claimedPlaces(subject)
88127
88662
  } : {
88128
88663
  kind: "different-event",
88129
88664
  message: "This waiting list invitation is for a different event. Please open the link in your invitation email."
88130
88665
  };
88131
88666
  }
88667
+ /**
88668
+ * What this visitor books and quotes, and how many places they can ask for. An invitation books
88669
+ * only the places it holds; anyone else chooses freely, up to the block's own limit.
88670
+ */
88671
+ function invitationBooking(invitation, chosen, blockLimit) {
88672
+ if (invitation.kind !== "ready") return {
88673
+ ticketSelections: [...chosen],
88674
+ quoteSelections: chosen,
88675
+ maxTicketsNum: blockLimit
88676
+ };
88677
+ const { claimed } = invitation.restoration;
88678
+ return {
88679
+ ticketSelections: [...claimTicketSelections(claimed, chosen)],
88680
+ quoteSelections: claimQuoteSelections(claimed, chosen),
88681
+ maxTicketsNum: claimed.places
88682
+ };
88683
+ }
88132
88684
  /** A place held on a run or date that's closed is still theirs, so it stays on the list they see. */
88133
88685
  function withOfferedEvent(choices, invitation) {
88134
88686
  const offered$1 = invitation.kind === "ready" ? invitation.restoration.event : null;
88135
88687
  return offered$1 && !choices.some((event) => event.selectionId === offered$1.selectionId) ? [offered$1, ...choices] : choices;
88136
88688
  }
88137
88689
 
88690
+ //#endregion
88691
+ //#region ../blocks/src/system/runtime/nodes/event-registration/registrationDraft.state.ts
88692
+ function createRegistrationDraftData(event) {
88693
+ const defaults = event ? getEventSelectionDefaults(event) : null;
88694
+ return {
88695
+ selection: event ? [event] : [],
88696
+ runChoices: NO_RUN_PRICING_CHOICES,
88697
+ formData: createInitialRegistrationFormData(),
88698
+ guests: [],
88699
+ selectedAttendanceMode: defaults?.attendanceMode ?? null,
88700
+ selectedTicketLines: [],
88701
+ roomChoices: [],
88702
+ reviewedRooms: [],
88703
+ selectedSlidingAmountInput: defaults?.slidingAmountInput ?? "",
88704
+ bookingQuestions: EMPTY_BOOKING_QUESTIONS_ANSWERS,
88705
+ runRequirements: NO_RUN_REQUIREMENTS
88706
+ };
88707
+ }
88708
+ function updated(current, value) {
88709
+ return typeof value === "function" ? value(current) : value;
88710
+ }
88711
+ function editRegistrationDraft(draft, edit) {
88712
+ switch (edit.field) {
88713
+ case "selection": {
88714
+ const selection = updated(draft.selection, edit.value);
88715
+ return {
88716
+ ...draft,
88717
+ selection,
88718
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection), draft.selectedAttendanceMode)
88719
+ };
88720
+ }
88721
+ case "runChoices": return {
88722
+ ...draft,
88723
+ runChoices: updated(draft.runChoices, edit.value)
88724
+ };
88725
+ case "formData": return {
88726
+ ...draft,
88727
+ formData: updated(draft.formData, edit.value)
88728
+ };
88729
+ case "guests": return {
88730
+ ...draft,
88731
+ guests: updated(draft.guests, edit.value)
88732
+ };
88733
+ case "selectedAttendanceMode": return {
88734
+ ...draft,
88735
+ selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(draft.selection), updated(draft.selectedAttendanceMode, edit.value))
88736
+ };
88737
+ case "selectedTicketLines": return {
88738
+ ...draft,
88739
+ selectedTicketLines: updated(draft.selectedTicketLines, edit.value)
88740
+ };
88741
+ case "roomChoices": return {
88742
+ ...draft,
88743
+ roomChoices: updated(draft.roomChoices, edit.value),
88744
+ reviewedRooms: []
88745
+ };
88746
+ case "selectedSlidingAmountInput": return {
88747
+ ...draft,
88748
+ selectedSlidingAmountInput: updated(draft.selectedSlidingAmountInput, edit.value)
88749
+ };
88750
+ default: return assertNever$4(edit);
88751
+ }
88752
+ }
88753
+ /** Ready invitations own their reserved selection; identity fields remain editable. */
88754
+ function canEditInvitedDraft(invitation, edit) {
88755
+ if (invitation.kind !== "ready" || edit.field === "formData" || edit.field === "guests") return true;
88756
+ return invitation.restoration.claimed.kind === "anyTicket" && (edit.field === "selectedTicketLines" || edit.field === "selectedSlidingAmountInput");
88757
+ }
88758
+ function beginWaitlistInvitation(credential) {
88759
+ return credential ? {
88760
+ kind: "resolving",
88761
+ request: { credential }
88762
+ } : { kind: "none" };
88763
+ }
88764
+ /** A source notification is not a new attempt when its credential is unchanged. */
88765
+ function receiveWaitlistInvitation(invitation, credential) {
88766
+ const current = invitation.kind === "none" ? null : invitation.request.credential;
88767
+ return current === credential ? invitation : beginWaitlistInvitation(credential);
88768
+ }
88769
+ function restoreRegistrationDraft(draft, claim, restoration) {
88770
+ return {
88771
+ bookingQuestions: draft.bookingQuestions,
88772
+ runRequirements: NO_RUN_REQUIREMENTS,
88773
+ selection: restoration.event ? [restoration.event] : draft.selection,
88774
+ runChoices: NO_RUN_PRICING_CHOICES,
88775
+ selectedAttendanceMode: restoration.attendanceMode,
88776
+ selectedTicketLines: [...claimTicketSelections(restoration.claimed, [])],
88777
+ roomChoices: [],
88778
+ reviewedRooms: [],
88779
+ selectedSlidingAmountInput: (restoration.claimed.kind === "reservedTickets" ? restoration.claimed.slidingAmountInput : null) ?? draft.selectedSlidingAmountInput,
88780
+ formData: {
88781
+ ...draft.formData,
88782
+ email: claim.prefill.email,
88783
+ name: claim.prefill.name,
88784
+ phone: claim.prefill.phone ?? "",
88785
+ notes: claim.prefill.notes ?? ""
88786
+ },
88787
+ guests: claim.prefill.guests.map((guest) => ({
88788
+ name: guest.name,
88789
+ email: guest.email ?? "",
88790
+ phone: guest.phone ?? ""
88791
+ }))
88792
+ };
88793
+ }
88794
+ function invitationSubmission(invitation) {
88795
+ switch (invitation.kind) {
88796
+ case "none": return {
88797
+ kind: "available",
88798
+ credential: null
88799
+ };
88800
+ case "ready": return {
88801
+ kind: "available",
88802
+ credential: invitation.request.credential
88803
+ };
88804
+ case "resolving": return {
88805
+ kind: "blocked",
88806
+ message: "Please wait while we check your waiting list invitation."
88807
+ };
88808
+ case "portal-login-required":
88809
+ case "error": return {
88810
+ kind: "blocked",
88811
+ message: invitation.message
88812
+ };
88813
+ default: return assertNever$4(invitation);
88814
+ }
88815
+ }
88816
+
88138
88817
  //#endregion
88139
88818
  //#region ../blocks/src/system/runtime/nodes/event-registration/registrationBrowserDraft.ts
88140
88819
  const browserDraftSteps = [
@@ -88143,11 +88822,22 @@ const browserDraftSteps = [
88143
88822
  "enter-details",
88144
88823
  "select-payment"
88145
88824
  ];
88146
- /**
88147
- * An allowlist: free text, questions, agreement and payment authority never go to storage.
88148
- * The discount code is its text only, never a price or amount, and the server checks it again on restore.
88825
+ /** How long this tab's draft is kept after it was last saved; older drafts are ignored and cleared. */
88826
+ const BROWSER_DRAFT_LIFETIME_MS = 3 * 60 * 60 * 1e3;
88827
+ /**
88828
+ * An allowlist of what the booker typed or chose, kept in this tab only, for
88829
+ * `BROWSER_DRAFT_LIFETIME_MS`: the selection and tickets, their contact
88830
+ * details, the guests' names and contact details, and their answers to the
88831
+ * questions, by question ID (`BookingQuestionsTabDraft`: plain answers only,
88832
+ * never file uploads, and dropped on restore if the question has gone or
88833
+ * changed kind), once for the selection or per run when runs ask their own.
88834
+ * `owner` is whoever was signed in (or nobody) when it was saved: contact,
88835
+ * guests and answers come back only to that same visitor. Notes, the terms agreement, payment choices and anything
88836
+ * else payment-related never go to storage. The discount code is its text
88837
+ * only, never a price or amount, and the server checks it again on restore.
88149
88838
  */
88150
88839
  const registrationBrowserDraftSchema = z.object({
88840
+ owner: bookingQuestionsOwnerSchema,
88151
88841
  step: z.enum(browserDraftSteps),
88152
88842
  selectedEventIds: z.array(z.string()),
88153
88843
  placeCount: z.number().int().positive(),
@@ -88166,15 +88856,23 @@ const registrationBrowserDraftSchema = z.object({
88166
88856
  email: z.string(),
88167
88857
  phone: z.string()
88168
88858
  }),
88169
- discountCode: z.string().default("")
88859
+ discountCode: z.string().default(""),
88860
+ guests: z.array(z.object({
88861
+ name: z.string(),
88862
+ email: z.string().nullable(),
88863
+ phone: z.string().nullable()
88864
+ })).default([]),
88865
+ questions: bookingQuestionsTabDraftSchema.nullable().default(null),
88866
+ runQuestions: z.record(z.string(), bookingQuestionsTabDraftSchema).default({})
88170
88867
  });
88171
88868
  function isBrowserDraftStep(step) {
88172
88869
  return browserDraftSteps.some((candidate$1) => candidate$1 === step);
88173
88870
  }
88174
- function registrationBrowserDraft(flow, discountCode) {
88871
+ function registrationBrowserDraft(flow, discountCode, identity) {
88175
88872
  if (!isBrowserDraftStep(flow.step)) return null;
88176
88873
  const { draft } = flow;
88177
88874
  return {
88875
+ owner: bookingQuestionsOwnerOf(identity),
88178
88876
  step: flow.step,
88179
88877
  selectedEventIds: draft.selection.map((event) => event.selectionId),
88180
88878
  placeCount: flow.placeCount,
@@ -88187,7 +88885,44 @@ function registrationBrowserDraft(flow, discountCode) {
88187
88885
  email: draft.formData.email,
88188
88886
  phone: draft.formData.phone
88189
88887
  },
88190
- discountCode
88888
+ discountCode,
88889
+ guests: draft.guests.map(({ name, email, phone }) => ({
88890
+ name,
88891
+ email,
88892
+ phone
88893
+ })),
88894
+ ...questionsDrafts(draft.selection, draft.bookingQuestions, draft.runRequirements, identity)
88895
+ };
88896
+ }
88897
+ /** Who asks the questions: one event for the whole selection, or each run for itself. */
88898
+ function questionAskers(selection) {
88899
+ const layout$1 = decideSelectionRequirementsLayout(selection);
88900
+ return layout$1.kind === "per_run" ? {
88901
+ kind: "per_run",
88902
+ runs: layout$1.runs
88903
+ } : {
88904
+ kind: "once",
88905
+ event: primarySelectionItem(selection)
88906
+ };
88907
+ }
88908
+ /** Only answers typed as the visitor signed in now are kept, so the draft's one stamp covers them. */
88909
+ function answersDraft(answers, event, identity) {
88910
+ if ((answers.scope?.identity ?? null) !== identity) return null;
88911
+ const shown = answers.refreshed?.targetKey === event.seriesId ? answers.refreshed.presentation : event.bookingQuestions;
88912
+ return toBookingQuestionsTabDraft(answers, shown);
88913
+ }
88914
+ function questionsDrafts(selection, answers, runs, identity) {
88915
+ const askers = questionAskers(selection);
88916
+ if (askers.kind === "once") return {
88917
+ questions: askers.event ? answersDraft(answers, askers.event, identity) : null,
88918
+ runQuestions: {}
88919
+ };
88920
+ return {
88921
+ questions: null,
88922
+ runQuestions: Object.fromEntries(askers.runs.flatMap((run) => {
88923
+ const kept = answersDraft(runAnswers(runs, run.seriesId).questions, run, identity);
88924
+ return kept ? [[run.seriesId, kept]] : [];
88925
+ }))
88191
88926
  };
88192
88927
  }
88193
88928
  /** A code belongs to its selection: it only comes back when that whole selection does. */
@@ -88195,13 +88930,14 @@ function restorableBrowserDraftCode(saved, events) {
88195
88930
  return findSelection(saved.selectedEventIds, events).length === saved.selectedEventIds.length ? saved.discountCode : "";
88196
88931
  }
88197
88932
  /** Restore against current events, never a saved price/capacity or a partial selection. */
88198
- function restoreRegistrationBrowserDraft(state, saved, events) {
88933
+ function restoreRegistrationBrowserDraft(state, saved, events, identity) {
88199
88934
  if (state.invitation.kind !== "none" || !isBrowserDraftStep(state.step)) return state;
88200
88935
  const selection = findSelection(saved.selectedEventIds, events);
88201
- const contact$1 = {
88936
+ const theirs = isBookingQuestionsOwner(saved.owner, identity);
88937
+ const contact$1 = theirs ? {
88202
88938
  ...state.draft.formData,
88203
88939
  ...saved.contact
88204
- };
88940
+ } : state.draft.formData;
88205
88941
  if (selection.length !== saved.selectedEventIds.length) return {
88206
88942
  ...state,
88207
88943
  draft: {
@@ -88209,6 +88945,8 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88209
88945
  formData: contact$1
88210
88946
  }
88211
88947
  };
88948
+ const restoredSelection = selection.length ? selection : state.draft.selection;
88949
+ const questions = theirs ? restoredQuestions(state.draft, saved, restoredSelection, identity) : {};
88212
88950
  return {
88213
88951
  ...state,
88214
88952
  step: saved.step === "select-payment" ? "enter-details" : saved.step,
@@ -88216,7 +88954,9 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88216
88954
  draft: {
88217
88955
  ...state.draft,
88218
88956
  formData: contact$1,
88219
- selection: selection.length ? selection : state.draft.selection,
88957
+ guests: theirs ? saved.guests.map((guest) => ({ ...guest })) : state.draft.guests,
88958
+ ...questions,
88959
+ selection: restoredSelection,
88220
88960
  selectedTicketLines: saved.selectedTicketLines,
88221
88961
  selectedSlidingAmountInput: saved.selectedSlidingAmountInput,
88222
88962
  selectedAttendanceMode: resolveSelectionAttendanceMode(decideSelectionAttendance(selection.length ? selection : state.draft.selection), saved.selectedAttendanceMode),
@@ -88224,6 +88964,27 @@ function restoreRegistrationBrowserDraft(state, saved, events) {
88224
88964
  }
88225
88965
  };
88226
88966
  }
88967
+ /** Answers come back against the questions as they're asked now, never as they were saved. */
88968
+ function restoredQuestions(current, saved, selection, identity) {
88969
+ const restore = (answers, draft, event) => draft ? restoreBookingQuestionsAnswers(answers, decideBookingQuestionsRestoration({
88970
+ kind: "tab_draft",
88971
+ draft,
88972
+ identity,
88973
+ current: event.bookingQuestions
88974
+ })) : answers;
88975
+ const askers = questionAskers(selection);
88976
+ if (askers.kind === "once") return askers.event ? { bookingQuestions: restore(current.bookingQuestions, saved.questions, askers.event) } : {};
88977
+ return { runRequirements: askers.runs.reduce((runs, run) => {
88978
+ const answers = runAnswers(runs, run.seriesId);
88979
+ return {
88980
+ ...runs,
88981
+ [run.seriesId]: {
88982
+ ...answers,
88983
+ questions: restore(answers.questions, saved.runQuestions[run.seriesId], run)
88984
+ }
88985
+ };
88986
+ }, current.runRequirements) };
88987
+ }
88227
88988
 
88228
88989
  //#endregion
88229
88990
  //#region ../blocks/src/system/runtime/shared/bookingPaymentOptions.ts
@@ -88556,6 +89317,17 @@ function buildSelectedSiteCreditPreview(input) {
88556
89317
  });
88557
89318
  }
88558
89319
 
89320
+ //#endregion
89321
+ //#region ../blocks/src/system/runtime/shared/onlineBookingUnavailable.ts
89322
+ /**
89323
+ * Said, for events and appointments alike, when a booking needs a card
89324
+ * payment the site can't take yet, so the client books with the business
89325
+ * instead. Shown with the business's published contact details.
89326
+ */
89327
+ function onlineBookingUnavailableMessage(businessName) {
89328
+ return `You can’t book this online yet. Please contact ${businessName?.trim() || "the organiser"} to book your place.`;
89329
+ }
89330
+
88559
89331
  //#endregion
88560
89332
  //#region ../blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.ts
88561
89333
  const DEFAULT_EVENT_REGISTRATION_MAX_TICKETS = 5;
@@ -88583,13 +89355,6 @@ function toHeadlessPaymentSelection(selection) {
88583
89355
  method: "stripe",
88584
89356
  collectionOptionKind: selection.collectionOptionKind
88585
89357
  };
88586
- case "pass":
88587
- if (!selection.passId) return { method: "none" };
88588
- return {
88589
- method: "pass",
88590
- passId: selection.passId,
88591
- ...selection.productName ? { productName: selection.productName } : {}
88592
- };
88593
89358
  case "membership":
88594
89359
  if (!selection.membershipId) return { method: "none" };
88595
89360
  return {
@@ -88597,20 +89362,6 @@ function toHeadlessPaymentSelection(selection) {
88597
89362
  membershipId: selection.membershipId,
88598
89363
  ...selection.productName ? { productName: selection.productName } : {}
88599
89364
  };
88600
- case "pass_bundle":
88601
- if (!selection.bundlePassId) return { method: "none" };
88602
- return {
88603
- method: "pass_bundle",
88604
- passId: selection.bundlePassId,
88605
- ...selection.productName ? { productName: selection.productName } : {}
88606
- };
88607
- case "membership_bundle":
88608
- if (!selection.bundleMembershipId) return { method: "none" };
88609
- return {
88610
- method: "membership_bundle",
88611
- membershipId: selection.bundleMembershipId,
88612
- ...selection.productName ? { productName: selection.productName } : {}
88613
- };
88614
89365
  }
88615
89366
  }
88616
89367
  function toInternalPaymentSelection(selection) {
@@ -88621,26 +89372,11 @@ function toInternalPaymentSelection(selection) {
88621
89372
  method: "stripe",
88622
89373
  collectionOptionKind: selection.collectionOptionKind
88623
89374
  };
88624
- case "pass": return {
88625
- method: "pass",
88626
- passId: selection.passId,
88627
- ...selection.productName ? { productName: selection.productName } : {}
88628
- };
88629
89375
  case "membership": return {
88630
89376
  method: "membership",
88631
89377
  membershipId: selection.membershipId,
88632
89378
  ...selection.productName ? { productName: selection.productName } : {}
88633
89379
  };
88634
- case "pass_bundle": return {
88635
- method: "pass_bundle",
88636
- bundlePassId: selection.passId,
88637
- ...selection.productName ? { productName: selection.productName } : {}
88638
- };
88639
- case "membership_bundle": return {
88640
- method: "membership_bundle",
88641
- bundleMembershipId: selection.membershipId,
88642
- ...selection.productName ? { productName: selection.productName } : {}
88643
- };
88644
89380
  }
88645
89381
  }
88646
89382
  function resolveEventRegistrationSubmitPlan(input) {
@@ -88665,13 +89401,7 @@ function toSubmitArgs(selection) {
88665
89401
  switch (selection.method) {
88666
89402
  case "stripe":
88667
89403
  case "free": return { method: selection.method };
88668
- case "pass":
88669
- case "pass_bundle": return {
88670
- method: selection.method,
88671
- passId: selection.passId
88672
- };
88673
- case "membership":
88674
- case "membership_bundle": return {
89404
+ case "membership": return {
88675
89405
  method: selection.method,
88676
89406
  membershipId: selection.membershipId
88677
89407
  };
@@ -88772,7 +89502,7 @@ function resolveHeadlessEventRegistrationView(wizard) {
88772
89502
  }
88773
89503
  }
88774
89504
  function deriveEventRegistrationSteps(input) {
88775
- const needsPaymentStep = input.eventRequiresPayment && input.paymentSelection.method !== "pass" && input.paymentSelection.method !== "membership";
89505
+ const needsPaymentStep = input.eventRequiresPayment && input.paymentSelection.method !== "membership";
88776
89506
  const ids = [
88777
89507
  ...!input.hasPreSelectedContext ? ["select-event"] : [],
88778
89508
  "select-tickets",
@@ -88844,9 +89574,27 @@ function resolveRegistrationAdmission(input) {
88844
89574
  reason: "alreadyWaitlisted",
88845
89575
  message: "You're already on the waitlist for this event."
88846
89576
  };
88847
- return admissionFromAvailability(availability, input.isAuthenticated);
89577
+ const admission = admissionFromAvailability(availability, input.isAuthenticated, input.businessName);
89578
+ return admission.kind === "open" && input.severalRunsNeedCard ? admissionWithCardDue(input.eligibility.onlinePayments, input.businessName) : admission;
89579
+ }
89580
+ /** Several runs whose total has to go to card payment (issue 1725), priced from every run. */
89581
+ function severalRunsNeedCard(several, payment) {
89582
+ return several === "runs" && payment.kind === "several" && payment.due === "card";
89583
+ }
89584
+ /** An open selection that has to go to card payment, which the site may not be able to take. */
89585
+ function admissionWithCardDue(onlinePayments, businessName) {
89586
+ return onlinePayments?.kind === "unavailable" ? cannotBookOnline(businessName, onlinePayments.organiserContact) : { kind: "open" };
88848
89587
  }
88849
- function admissionFromAvailability(availability, isAuthenticated) {
89588
+ /** The site can't take this payment now, so the client books with the business instead. */
89589
+ function cannotBookOnline(businessName, contact$1) {
89590
+ return {
89591
+ kind: "closed",
89592
+ reason: "unavailable",
89593
+ message: onlineBookingUnavailableMessage(businessName),
89594
+ ...contact$1 ? { contact: contact$1 } : {}
89595
+ };
89596
+ }
89597
+ function admissionFromAvailability(availability, isAuthenticated, businessName) {
88850
89598
  switch (availability.kind) {
88851
89599
  case "available": return { kind: "open" };
88852
89600
  case "waitlist": return {
@@ -88858,11 +89606,7 @@ function admissionFromAvailability(availability, isAuthenticated) {
88858
89606
  kind: "fullyBooked",
88859
89607
  placesLeft: Math.max(0, availability.remainingPlaces ?? 0)
88860
89608
  };
88861
- case "paymentUnavailable": return {
88862
- kind: "closed",
88863
- reason: "unavailable",
88864
- message: "Payment options are not available for this event."
88865
- };
89609
+ case "paymentUnavailable": return cannotBookOnline(businessName, availability.organiserContact);
88866
89610
  case "selectionRequired": return { kind: "open" };
88867
89611
  case "bookingClosed": return {
88868
89612
  kind: "closed",
@@ -88902,6 +89646,22 @@ function settledRemainingPlaces(eligibility) {
88902
89646
  const availability = eligibility?.availability;
88903
89647
  return availability?.kind === "available" ? availability.remainingPlaces ?? null : null;
88904
89648
  }
89649
+ /** The primary button's words while admission is closed, where it shows at all (`registrationStopsHere`). */
89650
+ function closedAdmissionLabel(reason) {
89651
+ switch (reason) {
89652
+ case "alreadyWaitlisted": return "Already on waitlist";
89653
+ case "optionsUnavailable": return "Couldn’t load times";
89654
+ case "unavailable": return "Can’t book online";
89655
+ }
89656
+ }
89657
+ /**
89658
+ * This can't be booked online at all (the site can't take the payment, or
89659
+ * registration is closed): the notice says why and who to contact, so the
89660
+ * form shows no places to choose and no button to press.
89661
+ */
89662
+ function registrationStopsHere(admission) {
89663
+ return admission.kind === "closed" && admission.reason === "unavailable";
89664
+ }
88905
89665
  function resolveRegistrationAvailabilityBlocker(admission) {
88906
89666
  switch (admission.kind) {
88907
89667
  case "open":
@@ -89021,7 +89781,7 @@ function resolveRegistrationTicketContinuation(input) {
89021
89781
  };
89022
89782
  case "closed": return {
89023
89783
  kind: "blocked",
89024
- label: input.admission.reason === "alreadyWaitlisted" ? "Already on waitlist" : input.admission.reason === "optionsUnavailable" ? "Availability unavailable" : "Registration unavailable",
89784
+ label: closedAdmissionLabel(input.admission.reason),
89025
89785
  pending: false,
89026
89786
  message: input.admission.message
89027
89787
  };
@@ -89253,8 +90013,8 @@ function selectionPaymentPresentation(payment, eligibility) {
89253
90013
  /**
89254
90014
  * Label for the button that acts on the chosen payment method.
89255
90015
  *
89256
- * A pass redemption spends a credit the moment it is pressed, so the label
89257
- * names the pass instead of describing the step.
90016
+ * Dates paid with a pass or membership take their button from the funding
90017
+ * option instead.
89258
90018
  */
89259
90019
  function resolvePaymentButtonText(method, siteCreditPreview, eligibility, selectedDirectOption) {
89260
90020
  switch (method) {
@@ -89269,9 +90029,6 @@ function resolvePaymentButtonText(method, siteCreditPreview, eligibility, select
89269
90029
  }
89270
90030
  return `Book with ${formatPrice(siteCreditPreview.appliedCreditCents, eligibility.currency)} site credit`;
89271
90031
  }
89272
- case "pass": return "Book using class pass";
89273
- case "pass_bundle":
89274
- case "membership_bundle": return "Buy and book";
89275
90032
  case "free":
89276
90033
  case "membership":
89277
90034
  case null: return "Book your place";
@@ -89280,10 +90037,7 @@ function resolvePaymentButtonText(method, siteCreditPreview, eligibility, select
89280
90037
  function canContinueWithPaymentSelection(selection, directPaymentSelection) {
89281
90038
  switch (selection.method) {
89282
90039
  case "stripe": return directPaymentSelection.kind === "valid";
89283
- case "pass": return Boolean(selection.passId);
89284
90040
  case "membership": return Boolean(selection.membershipId);
89285
- case "pass_bundle": return Boolean(selection.bundlePassId);
89286
- case "membership_bundle": return Boolean(selection.bundleMembershipId);
89287
90041
  case "free": return true;
89288
90042
  case null: return false;
89289
90043
  }
@@ -89348,7 +90102,7 @@ function resetRegistrationDraft(session, hasPreSelectedContext) {
89348
90102
  completedOutcomes: session.completedOutcomes,
89349
90103
  spentClaim: session.spentClaim,
89350
90104
  eligibility: null,
89351
- passOptOut: false,
90105
+ roomFacts: null,
89352
90106
  paymentSelection: { method: null },
89353
90107
  selectionSource: "auto"
89354
90108
  };
@@ -89363,10 +90117,7 @@ function paymentSelectionIdentity(selection) {
89363
90117
  case null:
89364
90118
  case "free": return [selection.method, undefined];
89365
90119
  case "stripe": return [selection.method, selection.collectionOptionKind];
89366
- case "pass": return [selection.method, selection.passId];
89367
90120
  case "membership": return [selection.method, selection.membershipId];
89368
- case "pass_bundle": return [selection.method, selection.bundlePassId];
89369
- case "membership_bundle": return [selection.method, selection.bundleMembershipId];
89370
90121
  }
89371
90122
  }
89372
90123
  function normalizePaymentSelection(selection) {
@@ -89383,7 +90134,7 @@ function flowTicketsCount(state) {
89383
90134
  const { ticketsCount } = selectionTicketInputs({
89384
90135
  several: severalItemsOf(state.draft.selection),
89385
90136
  primary: state.draft.selection[0] ?? null,
89386
- lines: state.draft.selectedTicketLines,
90137
+ lines: draftBookingLines(state.draft, state.roomFacts),
89387
90138
  slidingAmountInput: state.draft.selectedSlidingAmountInput,
89388
90139
  placeCount: state.placeCount,
89389
90140
  runChoices: state.draft.runChoices,
@@ -89399,50 +90150,37 @@ function flowSelectionPayment(state) {
89399
90150
  eligibility: state.eligibility
89400
90151
  });
89401
90152
  }
89402
- /** Passes, memberships and bundles cover one item for one person. */
89403
- function entitlementsAllowed(state) {
89404
- return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null;
90153
+ /**
90154
+ * A membership covers one run for one person, so it's chosen for the visitor
90155
+ * then. Dates are paid with the server's funding options instead (issue 1767).
90156
+ */
90157
+ function membershipAllowed(state) {
90158
+ return flowTicketsCount(state) === 1 && severalItemsOf(state.draft.selection) === null && state.draft.selection[0]?.registrationSubject.kind === "wholeSeries";
89405
90159
  }
89406
90160
  function computeAutoSelection(state) {
89407
- const { isAuthenticated, eligibility, passOptOut } = state;
90161
+ const { isAuthenticated, eligibility } = state;
89408
90162
  if (!eligibility) return { method: null };
89409
90163
  const payment = flowSelectionPayment(state);
89410
90164
  if (payment.kind === "several") return payment.due === "nothing" ? { method: "free" } : { method: null };
89411
90165
  if (eligibility.isFree) return { method: "free" };
89412
- if (isAuthenticated && entitlementsAllowed(state)) {
89413
- const membership = eligibility.eligibleMemberships[0];
89414
- if (membership) {
89415
- return {
89416
- method: "membership",
89417
- membershipId: membership.id,
89418
- productName: membership.membershipName
89419
- };
89420
- }
89421
- const pass = eligibility.eligiblePasses[0];
89422
- if (pass && !passOptOut) {
89423
- return {
89424
- method: "pass",
89425
- passId: pass.id,
89426
- productName: pass.passName
89427
- };
89428
- }
89429
- }
89430
- return { method: null };
90166
+ const membership = isAuthenticated && membershipAllowed(state) ? eligibility.eligibleMemberships[0] : undefined;
90167
+ return membership ? {
90168
+ method: "membership",
90169
+ membershipId: membership.id,
90170
+ productName: membership.membershipName
90171
+ } : { method: null };
89431
90172
  }
89432
90173
  function isSelectionValid(input) {
89433
90174
  const { selection, isAuthenticated, eligibility } = input;
89434
90175
  if (!selection.method) return false;
89435
90176
  if (input.payment.kind === "several") return isSeveralItemsSelectionValid(selection, input.payment.due);
89436
90177
  if (!eligibility) {
89437
- return selection.method === "stripe" || selection.method === "pass_bundle" || selection.method === "membership_bundle";
90178
+ return selection.method === "stripe";
89438
90179
  }
89439
90180
  switch (selection.method) {
89440
90181
  case "free": return eligibility.isFree;
89441
90182
  case "stripe": return isCardSelectionValid(selection, eligibility);
89442
- case "pass":
89443
- case "membership":
89444
- case "pass_bundle":
89445
- case "membership_bundle": return input.entitlementsAllowed && isEntitlementSelectionValid(selection, eligibility, isAuthenticated);
90183
+ case "membership": return input.membershipAllowed && isAuthenticated && eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
89446
90184
  default: return false;
89447
90185
  }
89448
90186
  }
@@ -89461,22 +90199,13 @@ function isCardSelectionValid(selection, eligibility) {
89461
90199
  if (!eligibility.requiresPayment || !eligibility.price) return false;
89462
90200
  return getApprovedDirectPaymentCollectionOptionKinds(eligibility.paymentOptions).includes(selection.collectionOptionKind);
89463
90201
  }
89464
- function isEntitlementSelectionValid(selection, eligibility, isAuthenticated) {
89465
- if ((selection.method === "pass" || selection.method === "membership") && !isAuthenticated) return false;
89466
- switch (selection.method) {
89467
- case "pass": return eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
89468
- case "membership": return eligibility.eligibleMemberships.some((membership) => membership.id === selection.membershipId);
89469
- case "pass_bundle": return eligibility.availablePasses.some((pass) => pass.id === selection.bundlePassId);
89470
- case "membership_bundle": return eligibility.availableMemberships.some((membership) => membership.id === selection.bundleMembershipId);
89471
- }
89472
- }
89473
90202
  function normalizeRegistrationFlowState(state) {
89474
90203
  const autoSelection = computeAutoSelection(state);
89475
90204
  const canKeepManualSelection = state.step !== "select-tickets" && state.selectionSource === "manual" && isSelectionValid({
89476
90205
  selection: state.paymentSelection,
89477
90206
  isAuthenticated: state.isAuthenticated,
89478
90207
  eligibility: state.eligibility,
89479
- entitlementsAllowed: entitlementsAllowed(state),
90208
+ membershipAllowed: membershipAllowed(state),
89480
90209
  payment: flowSelectionPayment(state)
89481
90210
  });
89482
90211
  const nextSelection = canKeepManualSelection ? state.paymentSelection : autoSelection;
@@ -89541,12 +90270,13 @@ function restorePaymentReturn(state, restoration) {
89541
90270
  selection: restoration.selection.length > 0 ? restoration.selection : state.draft.selection,
89542
90271
  runChoices: restoration.runChoices,
89543
90272
  selectedTicketLines: restoration.ticketLines.map((line) => ({ ...line })),
90273
+ roomChoices: restoration.roomChoices,
90274
+ reviewedRooms: restoration.reviewedRooms,
89544
90275
  selectedAttendanceMode: restoration.attendanceMode,
89545
90276
  selectedSlidingAmountInput: restoration.slidingAmountInput
89546
90277
  },
89547
90278
  paymentSelection: normalizePaymentSelection(restoration.paymentSelection),
89548
- selectionSource: "manual",
89549
- passOptOut: passOptOutAfterManualSelection(state, restoration.paymentSelection)
90279
+ selectionSource: "manual"
89550
90280
  };
89551
90281
  return isRegistrationLocked(state.step) ? restored : normalizeRegistrationFlowState(restored);
89552
90282
  }
@@ -89559,12 +90289,12 @@ function synchronizeRegistrationAuthentication(state, isAuthenticated) {
89559
90289
  return isRegistrationLocked(state.step) ? updated$1 : normalizeRegistrationFlowState(updated$1);
89560
90290
  }
89561
90291
  function isPaymentChoiceAction(action) {
89562
- return action.type === "set-manual-payment-selection" || action.type === "use-card-instead-of-pass" || action.type === "use-pass";
90292
+ return action.type === "set-manual-payment-selection";
89563
90293
  }
89564
90294
  /** Active navigation and draft updates share the same selection normalization. */
89565
90295
  function reduceActiveRegistration(state, action) {
89566
90296
  switch (action.type) {
89567
- case "browser-draft-restored": return normalizeRegistrationFlowState(restoreRegistrationBrowserDraft(state, action.draft, action.events));
90297
+ case "browser-draft-restored": return normalizeRegistrationFlowState(restoreRegistrationBrowserDraft(state, action.draft, action.events, action.identity));
89568
90298
  case "claim-arrived": {
89569
90299
  if (isSameWaitlistClaim(action.credential, state.spentClaim)) return state;
89570
90300
  const invitation = receiveWaitlistInvitation(state.invitation, action.credential);
@@ -89589,7 +90319,8 @@ function reduceActiveRegistration(state, action) {
89589
90319
  case "sign-in-draft-restored": return normalizeRegistrationFlowState(restoreEventSignInDraft(state, action.restoration));
89590
90320
  case "tickets-completed": return state.step === "select-tickets" ? normalizeRegistrationFlowState({
89591
90321
  ...state,
89592
- step: "enter-details"
90322
+ step: "enter-details",
90323
+ draft: withReviewedRooms(state.draft, state.roomFacts)
89593
90324
  }) : state;
89594
90325
  case "set-step": return isRegistrationLocked(action.step) ? {
89595
90326
  ...state,
@@ -89601,7 +90332,7 @@ function reduceActiveRegistration(state, action) {
89601
90332
  });
89602
90333
  case "reset": return resetRegistrationDraft(state, action.hasPreSelectedContext);
89603
90334
  case "set-tickets-count":
89604
- case "eligibility-updated": return normalizeRegistrationFlowState(updateRegistrationDraft(state, action));
90335
+ case "eligibility-updated": return normalizeRegistrationFlowState(backToRoomsWhenTheyveGone(updateRegistrationDraft(state, action)));
89605
90336
  case "event-continued": return action.navigation === "advance" ? {
89606
90337
  ...state,
89607
90338
  step: "select-tickets"
@@ -89653,6 +90384,7 @@ function applyRunRequirementsAction(state, action) {
89653
90384
  const SELECTION_FIELDS = new Set([
89654
90385
  "selection",
89655
90386
  "selectedTicketLines",
90387
+ "roomChoices",
89656
90388
  "runChoices"
89657
90389
  ]);
89658
90390
  function applyDraftEdit(state, edit) {
@@ -89701,6 +90433,20 @@ function isRegistrationLocked(step) {
89701
90433
  "payment-status"
89702
90434
  ].includes(step);
89703
90435
  }
90436
+ /** Steps after the rooms are chosen and before anything's submitted, where fresher room facts can still send the guest back. */
90437
+ const BEFORE_SUBMITTING = new Set(["enter-details", "select-payment"]);
90438
+ /**
90439
+ * Someone else took the room while this guest was on their details or payment. Their
90440
+ * choices stay as they were, and they go back to the rooms, which say what changed,
90441
+ * rather than carrying on with a booking that no longer has its room.
90442
+ */
90443
+ function backToRoomsWhenTheyveGone(state) {
90444
+ if (!BEFORE_SUBMITTING.has(state.step) || draftRoomsStillPlace(state.draft, state.roomFacts)) return state;
90445
+ return {
90446
+ ...state,
90447
+ step: "select-tickets"
90448
+ };
90449
+ }
89704
90450
  /** Draft edits change inputs; the existing selection owner normalizes their consequences. */
89705
90451
  function updateRegistrationDraft(state, action) {
89706
90452
  switch (action.type) {
@@ -89710,71 +90456,26 @@ function updateRegistrationDraft(state, action) {
89710
90456
  };
89711
90457
  case "eligibility-updated": return {
89712
90458
  ...state,
89713
- eligibility: action.eligibility
90459
+ eligibility: action.eligibility,
90460
+ roomFacts: action.eligibility?.rooms ?? state.roomFacts
89714
90461
  };
89715
90462
  default: return assertNever$4(action);
89716
90463
  }
89717
90464
  }
89718
- /**
89719
- * The pass the customer turned down, while it would otherwise cover this booking.
89720
- *
89721
- * The opt-out lasts for the whole booking; it only matters while a pass would
89722
- * be chosen automatically, so this is what offers the way back to it.
89723
- */
89724
- function getDeclinedPass(state) {
89725
- const paysDirectly = state.paymentSelection.method === "stripe" || state.paymentSelection.method === null;
89726
- return state.passOptOut && paysDirectly ? getOfferedPass(state) : null;
89727
- }
89728
- /** The pass auto-selection picks for this booking when the customer hasn't opted out. */
89729
- function getOfferedPass(state) {
89730
- const offered$1 = computeAutoSelection({
89731
- ...state,
89732
- passOptOut: false
89733
- });
89734
- return offered$1.method === "pass" ? offered$1 : null;
89735
- }
89736
- /**
89737
- * A manual card choice only opts out of a pass that was on offer; choosing the
89738
- * pass itself opts back in.
89739
- */
89740
- function passOptOutAfterManualSelection(state, selection) {
89741
- switch (selection.method) {
89742
- case "stripe": return state.passOptOut || getOfferedPass(state) !== null;
89743
- case "pass": return false;
89744
- case null:
89745
- case "free":
89746
- case "membership":
89747
- case "pass_bundle":
89748
- case "membership_bundle": return state.passOptOut;
89749
- }
89750
- }
90465
+ /** A run's membership books without a payment step. */
89751
90466
  function isEntitlementSelection(selection) {
89752
- return selection.method === "pass" || selection.method === "membership";
90467
+ return selection.method === "membership";
89753
90468
  }
89754
90469
  function requiresPaymentStep(params) {
89755
90470
  if (!params.eventRequiresPayment) return false;
89756
90471
  return !isEntitlementSelection(params.paymentSelection);
89757
90472
  }
89758
90473
  function reduceRegistrationPaymentChoice(state, action) {
89759
- switch (action.type) {
89760
- case "set-manual-payment-selection": return normalizeRegistrationFlowState({
89761
- ...state,
89762
- paymentSelection: normalizePaymentSelection(action.selection),
89763
- selectionSource: "manual",
89764
- passOptOut: passOptOutAfterManualSelection(state, action.selection)
89765
- });
89766
- case "use-card-instead-of-pass": return normalizeRegistrationFlowState({
89767
- ...state,
89768
- passOptOut: true,
89769
- paymentSelection: { method: null },
89770
- selectionSource: "manual"
89771
- });
89772
- case "use-pass": return normalizeRegistrationFlowState({
89773
- ...state,
89774
- passOptOut: false,
89775
- selectionSource: "auto"
89776
- });
89777
- }
90474
+ return normalizeRegistrationFlowState({
90475
+ ...state,
90476
+ paymentSelection: normalizePaymentSelection(action.selection),
90477
+ selectionSource: "manual"
90478
+ });
89778
90479
  }
89779
90480
  /** Only explicit navigation leaves a completed booking; draft refreshes retain it. */
89780
90481
  function reduceCompletedRegistration(state, action) {
@@ -89805,9 +90506,7 @@ function reduceCompletedRegistration(state, action) {
89805
90506
  case "tickets-completed":
89806
90507
  case "set-tickets-count":
89807
90508
  case "eligibility-updated":
89808
- case "set-manual-payment-selection":
89809
- case "use-card-instead-of-pass":
89810
- case "use-pass": return state;
90509
+ case "set-manual-payment-selection": return state;
89811
90510
  default: return assertNever$4(action);
89812
90511
  }
89813
90512
  }
@@ -89845,7 +90544,7 @@ function applyWaitlistClaimLookup(state, action) {
89845
90544
  case "awaitingEvents": return state;
89846
90545
  case "ready": return normalizeRegistrationFlowState({
89847
90546
  ...state,
89848
- placeCount: restoration.ticketsCount,
90547
+ placeCount: restoration.claimed.places,
89849
90548
  draft: restoreRegistrationDraft(state.draft, lookup.claim, restoration),
89850
90549
  invitation: {
89851
90550
  kind: "ready",
@@ -89995,6 +90694,7 @@ const REGISTRATION_STEP_LABELS = [
89995
90694
  "Dates",
89996
90695
  "Tickets",
89997
90696
  "Places",
90697
+ "Rooms",
89998
90698
  "Your details",
89999
90699
  "How you’ll pay",
90000
90700
  "Payment"
@@ -90015,7 +90715,8 @@ function registrationStepLabelContext(scopedEvents, bookedEvent) {
90015
90715
  const several = scopedEvents.every((event) => event.allowsMultipleBooking === true);
90016
90716
  return {
90017
90717
  eventSelection: mode === "date" && several ? "dates" : severalRuns(scopedEvents) ? "runs" : mode,
90018
- booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries"
90718
+ booksWholeSeries: bookedEvent?.registrationSubject.kind === "wholeSeries",
90719
+ booksRooms: Boolean((bookedEvent ?? (scopedEvents.length === 1 ? scopedEvents[0] : null))?.rooms)
90019
90720
  };
90020
90721
  }
90021
90722
  /** One label owner for the live progress and the server placeholder. */
@@ -90027,7 +90728,9 @@ function registrationStepLabel(step, context) {
90027
90728
  case "runs": return "Choose what to book";
90028
90729
  case "event": return "Event";
90029
90730
  }
90030
- case "select-tickets": return context.booksWholeSeries ? "Places" : "Tickets";
90731
+ case "select-tickets":
90732
+ if (context.booksRooms) return "Rooms";
90733
+ return context.booksWholeSeries ? "Places" : "Tickets";
90031
90734
  case "enter-details": return "Your details";
90032
90735
  case "select-payment": return "How you’ll pay";
90033
90736
  case "payment": return "Payment";
@@ -91299,7 +92002,7 @@ function buildEventRegistrationShellBodyText(stepLabels) {
91299
92002
  if (stepLabels.includes("How you’ll pay")) {
91300
92003
  return "Preparing tickets, details, and payment options.";
91301
92004
  }
91302
- if (stepLabels[0] === "Tickets" || stepLabels[0] === "Places") {
92005
+ if (stepLabels[0] === "Tickets" || stepLabels[0] === "Places" || stepLabels[0] === "Rooms") {
91303
92006
  return "Preparing tickets and booking details.";
91304
92007
  }
91305
92008
  return "Preparing dates, tickets, and booking details.";
@@ -95208,208 +95911,11 @@ function cardItemSlotParents(arrangement) {
95208
95911
  "item-media": "item",
95209
95912
  dates: body,
95210
95913
  date,
95211
- availability: body
95914
+ availability: body,
95915
+ facts: body
95212
95916
  };
95213
95917
  }
95214
95918
 
95215
- //#endregion
95216
- //#region ../blocks/src/system/runtime/nodes/svg.tsx
95217
- /**
95218
- * Strict SVG-`transform` validator.
95219
- *
95220
- * Accepts only a whitespace/comma-separated list of the geometric transform
95221
- * functions (`translate`/`rotate`/`scale`/`skewX`/`skewY`/`matrix`) whose
95222
- * arguments are plain numbers. This deliberately rejects anything else —
95223
- * `url(...)`, CSS functions, `javascript:`, angle/length units, stray letters —
95224
- * so a persisted custom-block tree can't smuggle an executable or exfiltrating
95225
- * value into the attribute.
95226
- */
95227
- const TRANSFORM_NUMBER = String.raw`-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?`;
95228
- const TRANSFORM_ARGS = String.raw`${TRANSFORM_NUMBER}(?:[\s,]+${TRANSFORM_NUMBER})*`;
95229
- const TRANSFORM_FN = String.raw`(?:translate|rotate|scale|skewX|skewY|matrix)\(\s*${TRANSFORM_ARGS}\s*\)`;
95230
- const SAFE_TRANSFORM_RE = new RegExp(String.raw`^\s*${TRANSFORM_FN}(?:[\s,]*${TRANSFORM_FN})*\s*$`);
95231
- function safeTransform(value) {
95232
- if (typeof value !== "string") return undefined;
95233
- const trimmed = value.trim();
95234
- if (trimmed.length === 0) return undefined;
95235
- return SAFE_TRANSFORM_RE.test(trimmed) ? trimmed : undefined;
95236
- }
95237
- /**
95238
- * Turn paint props into a CSS style object. Colour values pass through as-is so
95239
- * they may reference theme tokens via `var()`, which only resolves in a CSS
95240
- * property context (not in a bare presentation attribute).
95241
- */
95242
- function paintStyle(shape) {
95243
- const style = {};
95244
- if (shape.fill !== undefined) style.fill = shape.fill;
95245
- if (shape.stroke !== undefined) style.stroke = shape.stroke;
95246
- if (shape.strokeWidth !== undefined) style.strokeWidth = shape.strokeWidth;
95247
- if (shape.fillOpacity !== undefined) style.fillOpacity = shape.fillOpacity;
95248
- if (shape.strokeOpacity !== undefined) style.strokeOpacity = shape.strokeOpacity;
95249
- if (shape.strokeLinecap !== undefined) style.strokeLinecap = shape.strokeLinecap;
95250
- if (shape.strokeLinejoin !== undefined) style.strokeLinejoin = shape.strokeLinejoin;
95251
- if (shape.strokeDasharray !== undefined) style.strokeDasharray = shape.strokeDasharray;
95252
- return style;
95253
- }
95254
- function renderShape(shape, key) {
95255
- const style = paintStyle(shape);
95256
- const transform = safeTransform(shape.transform);
95257
- switch (shape.kind) {
95258
- case "text": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", {
95259
- className: shape.className,
95260
- x: shape.x,
95261
- y: shape.y,
95262
- transform,
95263
- children: shape.text
95264
- }, key);
95265
- case "path": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
95266
- d: shape.d,
95267
- className: shape.className,
95268
- fillRule: shape.fillRule,
95269
- style,
95270
- transform
95271
- }, key);
95272
- case "ellipse": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ellipse", {
95273
- cx: shape.cx,
95274
- cy: shape.cy,
95275
- rx: shape.rx,
95276
- ry: shape.ry,
95277
- style,
95278
- transform
95279
- }, key);
95280
- case "circle": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
95281
- cx: shape.cx,
95282
- cy: shape.cy,
95283
- r: shape.r,
95284
- style,
95285
- transform
95286
- }, key);
95287
- case "rect": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
95288
- x: shape.x,
95289
- y: shape.y,
95290
- className: shape.className,
95291
- width: shape.width,
95292
- height: shape.height,
95293
- rx: shape.rx,
95294
- ry: shape.ry,
95295
- style,
95296
- transform
95297
- }, key);
95298
- case "line": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
95299
- x1: shape.x1,
95300
- y1: shape.y1,
95301
- x2: shape.x2,
95302
- y2: shape.y2,
95303
- style,
95304
- transform
95305
- }, key);
95306
- default: return null;
95307
- }
95308
- }
95309
- const SvgNode = ({ blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, viewBox, width, height, className, style, ariaHidden = true, ariaLabel, shapes }) => {
95310
- const safeShapes = Array.isArray(shapes) ? shapes : [];
95311
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
95312
- viewBox,
95313
- width,
95314
- height,
95315
- className,
95316
- style,
95317
- "aria-hidden": ariaHidden || undefined,
95318
- role: ariaLabel ? "img" : undefined,
95319
- "aria-label": ariaLabel,
95320
- xmlns: "http://www.w3.org/2000/svg",
95321
- fill: "none",
95322
- children: safeShapes.map((shape, index) => renderShape(shape, index))
95323
- });
95324
- };
95325
-
95326
- //#endregion
95327
- //#region ../blocks/src/system/runtime/nodes/shared/MapDrawingSvg.tsx
95328
- const PIN_PATH = "M0 0C-3.5-9-13-15-13-25A13 13 0 1 1 13-25C13-15 3.5-9 0 0ZM0-20.5A4.5 4.5 0 1 0 0-29.5A4.5 4.5 0 1 0 0-20.5Z";
95329
- const commands = (points) => points.map(([x$1, y$1], index) => `${index ? "L" : "M"}${x$1} ${y$1}`).join(" ");
95330
- function pathShape(path$3) {
95331
- return path$3.kind === "polygon" ? {
95332
- kind: "path",
95333
- className: path$3.className,
95334
- fillRule: path$3.fillRule,
95335
- d: path$3.rings.map((ring) => `${commands(ring)} Z`).join(" ")
95336
- } : {
95337
- kind: "path",
95338
- className: path$3.className,
95339
- d: commands(path$3.points)
95340
- };
95341
- }
95342
- function labelShapes(label$1) {
95343
- const [x$1, y$1] = label$1.point, transform = `rotate(${label$1.angle} ${x$1} ${y$1})`;
95344
- return [label$1.haloClassName, label$1.className].map((className) => ({
95345
- kind: "text",
95346
- className,
95347
- x: x$1,
95348
- y: y$1,
95349
- transform,
95350
- text: label$1.text
95351
- }));
95352
- }
95353
- /** The drawing the renderer below would show, or null when there's nothing it can draw. */
95354
- function readableMapDrawing(drawing) {
95355
- const parsed = mapDrawingSchema.safeParse(drawing);
95356
- return parsed.success ? parsed.data : null;
95357
- }
95358
- /** Untrusted standalone callers retain boundary admission. */
95359
- function MapDrawingSvg(props$1) {
95360
- const drawing = readableMapDrawing(props$1.drawing);
95361
- return drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdmittedMapDrawingSvg, {
95362
- ...props$1,
95363
- drawing
95364
- }) : null;
95365
- }
95366
- /** Render an already admitted value without allocating another validation copy. */
95367
- function AdmittedMapDrawingSvg(props$1) {
95368
- const drawing = props$1.drawing;
95369
- const name = props$1.wider ? "wider" : "neighbourhood", frame = drawing.frames[name];
95370
- const shapes = [
95371
- {
95372
- kind: "rect",
95373
- className: frame.backgroundClass,
95374
- x: 0,
95375
- y: 0,
95376
- width: 800,
95377
- height: 800
95378
- },
95379
- ...frame.paths.map(pathShape),
95380
- ...frame.labels.flatMap(labelShapes),
95381
- {
95382
- kind: "path",
95383
- className: frame.pin.className,
95384
- fillRule: "evenodd",
95385
- d: PIN_PATH,
95386
- transform: `translate(${frame.pin.point.join(" ")})`
95387
- }
95388
- ];
95389
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", {
95390
- className: `rb-map-drawing ${props$1.className ?? ""}`.trim(),
95391
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
95392
- className: "rb-map-drawing-crop",
95393
- style: cropHeightStyle(Math.max(255, props$1.height ?? 320), props$1.heightAs ?? "fixed"),
95394
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SvgNode, {
95395
- className: `map-${name}`,
95396
- viewBox: frame.viewBox.join(" "),
95397
- shapes,
95398
- ariaHidden: false,
95399
- ariaLabel: props$1.label ? `Map showing ${props$1.label}` : "Map showing the arrival pin"
95400
- })
95401
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figcaption", { children: ["© ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
95402
- href: "https://www.openstreetmap.org/copyright",
95403
- target: "_blank",
95404
- rel: "noreferrer",
95405
- children: "OpenStreetMap contributors"
95406
- })] })]
95407
- });
95408
- }
95409
- function cropHeightStyle(height, heightAs) {
95410
- return heightAs === "minimum" ? { minHeight: height } : { height };
95411
- }
95412
-
95413
95919
  //#endregion
95414
95920
  //#region ../blocks/src/system/runtime/nodes/events/shared/EventCard.tsx
95415
95921
  /**
@@ -95466,7 +95972,7 @@ const EventCard = ({ event, cardRole = "default", buttonVariant = "primary", but
95466
95972
  formattedTime,
95467
95973
  hasImage,
95468
95974
  headingLevel: cardHeadingLevel,
95469
- mapSlot: resolveVenueMapSlot(event.venue, mapSlot),
95975
+ mapSlot,
95470
95976
  priceText,
95471
95977
  showMap,
95472
95978
  showSummary,
@@ -95478,13 +95984,6 @@ const EventCard = ({ event, cardRole = "default", buttonVariant = "primary", but
95478
95984
  })]
95479
95985
  });
95480
95986
  };
95481
- function resolveVenueMapSlot(venue, override) {
95482
- return override ?? (venue?.drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MapDrawingSvg, {
95483
- drawing: venue.drawing,
95484
- label: venue.name,
95485
- height: 255
95486
- }) : null);
95487
- }
95488
95987
  function EventCardMedia(props$1) {
95489
95988
  if (props$1.lookPresentation.lookSlots !== undefined) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventLookDate, {
95490
95989
  event: props$1.event,
@@ -103956,7 +104455,11 @@ const teamMemberDataSchema = z.object({
103956
104455
  photo: teamMemberPhotoSchema,
103957
104456
  profilePath: z.string().nullable(),
103958
104457
  specialties: z.array(z.string()).optional(),
103959
- profileBio: RichTextDocSchema.nullable().optional()
104458
+ profileBio: RichTextDocSchema.nullable().optional(),
104459
+ facts: z.array(z.object({
104460
+ label: z.string(),
104461
+ value: z.string()
104462
+ })).readonly().optional()
103960
104463
  });
103961
104464
  const teamMembersDataSchema = z.array(teamMemberDataSchema);
103962
104465
  const dynamicSourceWhen = { equals: "site_staff" };
@@ -104129,6 +104632,7 @@ const cardListVariant = styledSection({
104129
104632
  el("team-members", {
104130
104633
  ...cardListPresentationBindings,
104131
104634
  biographySource: { $bind: { from: "content._effectiveLook.look.structure.teamBiography" } },
104635
+ teamFacts: { $bind: { from: "content._effectiveLook.look.structure.teamFacts" } },
104132
104636
  onePerson: { $bind: { from: "content.onePerson" } },
104133
104637
  cardBiography: { $bind: { from: "content.cardBiography" } },
104134
104638
  source: { $bind: {
@@ -106339,6 +106843,7 @@ function presentPublicBlock(block) {
106339
106843
  id: block.id,
106340
106844
  kind: block.kind,
106341
106845
  purpose: block.purpose,
106846
+ ...block.identifier ? { identifier: block.identifier } : {},
106342
106847
  ...block.contentVersionId ? { contentVersionId: block.contentVersionId } : {},
106343
106848
  ...block.draftContentId !== undefined ? { draftContentId: block.draftContentId } : {},
106344
106849
  publishedPlacement: block.publishedPlacement,
@@ -107259,7 +107764,7 @@ function eventHeaderContent(selection, show) {
107259
107764
  label: "Time",
107260
107765
  value: timeRange
107261
107766
  },
107262
- ...show.cost ? (item.facts ?? []).filter(({ label: label$1 }) => label$1 === "Price").map((fact) => withDepositNote(fact, event)) : [],
107767
+ ...show.cost ? (item.facts ?? []).filter(({ label: label$1 }) => label$1 === "Price").map((fact) => withDepositNote(fact, selection)) : [],
107263
107768
  ...groupSize === null ? [] : [{
107264
107769
  label: "Group size",
107265
107770
  value: groupSize
@@ -107268,9 +107773,9 @@ function eventHeaderContent(selection, show) {
107268
107773
  action: headerAction(selection, item.action)
107269
107774
  };
107270
107775
  }
107271
- /** The page states a deposit option beside the price, so it isn't first seen at checkout. */
107272
- function withDepositNote(fact, event) {
107273
- const note = formatEventDepositNote(event.pricing, event.paymentTerms, event);
107776
+ /** The page says how booking is paid beside the price, so a deposit isn't first seen (or missed) at checkout. */
107777
+ function withDepositNote(fact, selection) {
107778
+ const note = formatEventDepositNote(selection.depositOffer);
107274
107779
  return note ? {
107275
107780
  ...fact,
107276
107781
  value: `${fact.value}, ${note}`
@@ -109283,6 +109788,204 @@ function LocationMapActions(props$1) {
109283
109788
  }) }) : null;
109284
109789
  }
109285
109790
 
109791
+ //#endregion
109792
+ //#region ../blocks/src/system/runtime/nodes/svg.tsx
109793
+ /**
109794
+ * Strict SVG-`transform` validator.
109795
+ *
109796
+ * Accepts only a whitespace/comma-separated list of the geometric transform
109797
+ * functions (`translate`/`rotate`/`scale`/`skewX`/`skewY`/`matrix`) whose
109798
+ * arguments are plain numbers. This deliberately rejects anything else —
109799
+ * `url(...)`, CSS functions, `javascript:`, angle/length units, stray letters —
109800
+ * so a persisted custom-block tree can't smuggle an executable or exfiltrating
109801
+ * value into the attribute.
109802
+ */
109803
+ const TRANSFORM_NUMBER = String.raw`-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?`;
109804
+ const TRANSFORM_ARGS = String.raw`${TRANSFORM_NUMBER}(?:[\s,]+${TRANSFORM_NUMBER})*`;
109805
+ const TRANSFORM_FN = String.raw`(?:translate|rotate|scale|skewX|skewY|matrix)\(\s*${TRANSFORM_ARGS}\s*\)`;
109806
+ const SAFE_TRANSFORM_RE = new RegExp(String.raw`^\s*${TRANSFORM_FN}(?:[\s,]*${TRANSFORM_FN})*\s*$`);
109807
+ function safeTransform(value) {
109808
+ if (typeof value !== "string") return undefined;
109809
+ const trimmed = value.trim();
109810
+ if (trimmed.length === 0) return undefined;
109811
+ return SAFE_TRANSFORM_RE.test(trimmed) ? trimmed : undefined;
109812
+ }
109813
+ /**
109814
+ * Turn paint props into a CSS style object. Colour values pass through as-is so
109815
+ * they may reference theme tokens via `var()`, which only resolves in a CSS
109816
+ * property context (not in a bare presentation attribute).
109817
+ */
109818
+ function paintStyle(shape) {
109819
+ const style = {};
109820
+ if (shape.fill !== undefined) style.fill = shape.fill;
109821
+ if (shape.stroke !== undefined) style.stroke = shape.stroke;
109822
+ if (shape.strokeWidth !== undefined) style.strokeWidth = shape.strokeWidth;
109823
+ if (shape.fillOpacity !== undefined) style.fillOpacity = shape.fillOpacity;
109824
+ if (shape.strokeOpacity !== undefined) style.strokeOpacity = shape.strokeOpacity;
109825
+ if (shape.strokeLinecap !== undefined) style.strokeLinecap = shape.strokeLinecap;
109826
+ if (shape.strokeLinejoin !== undefined) style.strokeLinejoin = shape.strokeLinejoin;
109827
+ if (shape.strokeDasharray !== undefined) style.strokeDasharray = shape.strokeDasharray;
109828
+ return style;
109829
+ }
109830
+ function renderShape(shape, key) {
109831
+ const style = paintStyle(shape);
109832
+ const transform = safeTransform(shape.transform);
109833
+ switch (shape.kind) {
109834
+ case "text": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("text", {
109835
+ className: shape.className,
109836
+ x: shape.x,
109837
+ y: shape.y,
109838
+ transform,
109839
+ children: shape.text
109840
+ }, key);
109841
+ case "path": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
109842
+ d: shape.d,
109843
+ className: shape.className,
109844
+ fillRule: shape.fillRule,
109845
+ style,
109846
+ transform
109847
+ }, key);
109848
+ case "ellipse": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ellipse", {
109849
+ cx: shape.cx,
109850
+ cy: shape.cy,
109851
+ rx: shape.rx,
109852
+ ry: shape.ry,
109853
+ style,
109854
+ transform
109855
+ }, key);
109856
+ case "circle": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", {
109857
+ cx: shape.cx,
109858
+ cy: shape.cy,
109859
+ r: shape.r,
109860
+ style,
109861
+ transform
109862
+ }, key);
109863
+ case "rect": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
109864
+ x: shape.x,
109865
+ y: shape.y,
109866
+ className: shape.className,
109867
+ width: shape.width,
109868
+ height: shape.height,
109869
+ rx: shape.rx,
109870
+ ry: shape.ry,
109871
+ style,
109872
+ transform
109873
+ }, key);
109874
+ case "line": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", {
109875
+ x1: shape.x1,
109876
+ y1: shape.y1,
109877
+ x2: shape.x2,
109878
+ y2: shape.y2,
109879
+ style,
109880
+ transform
109881
+ }, key);
109882
+ default: return null;
109883
+ }
109884
+ }
109885
+ const SvgNode = ({ blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, viewBox, width, height, className, style, ariaHidden = true, ariaLabel, shapes }) => {
109886
+ const safeShapes = Array.isArray(shapes) ? shapes : [];
109887
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
109888
+ viewBox,
109889
+ width,
109890
+ height,
109891
+ className,
109892
+ style,
109893
+ "aria-hidden": ariaHidden || undefined,
109894
+ role: ariaLabel ? "img" : undefined,
109895
+ "aria-label": ariaLabel,
109896
+ xmlns: "http://www.w3.org/2000/svg",
109897
+ fill: "none",
109898
+ children: safeShapes.map((shape, index) => renderShape(shape, index))
109899
+ });
109900
+ };
109901
+
109902
+ //#endregion
109903
+ //#region ../blocks/src/system/runtime/nodes/shared/MapDrawingSvg.tsx
109904
+ const PIN_PATH = "M0 0C-3.5-9-13-15-13-25A13 13 0 1 1 13-25C13-15 3.5-9 0 0ZM0-20.5A4.5 4.5 0 1 0 0-29.5A4.5 4.5 0 1 0 0-20.5Z";
109905
+ const commands = (points) => points.map(([x$1, y$1], index) => `${index ? "L" : "M"}${x$1} ${y$1}`).join(" ");
109906
+ function pathShape(path$3) {
109907
+ return path$3.kind === "polygon" ? {
109908
+ kind: "path",
109909
+ className: path$3.className,
109910
+ fillRule: path$3.fillRule,
109911
+ d: path$3.rings.map((ring) => `${commands(ring)} Z`).join(" ")
109912
+ } : {
109913
+ kind: "path",
109914
+ className: path$3.className,
109915
+ d: commands(path$3.points)
109916
+ };
109917
+ }
109918
+ function labelShapes(label$1) {
109919
+ const [x$1, y$1] = label$1.point, transform = `rotate(${label$1.angle} ${x$1} ${y$1})`;
109920
+ return [label$1.haloClassName, label$1.className].map((className) => ({
109921
+ kind: "text",
109922
+ className,
109923
+ x: x$1,
109924
+ y: y$1,
109925
+ transform,
109926
+ text: label$1.text
109927
+ }));
109928
+ }
109929
+ /** The drawing the renderer below would show, or null when there's nothing it can draw. */
109930
+ function readableMapDrawing(drawing) {
109931
+ const parsed = mapDrawingSchema.safeParse(drawing);
109932
+ return parsed.success ? parsed.data : null;
109933
+ }
109934
+ /** Untrusted standalone callers retain boundary admission. */
109935
+ function MapDrawingSvg(props$1) {
109936
+ const drawing = readableMapDrawing(props$1.drawing);
109937
+ return drawing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdmittedMapDrawingSvg, {
109938
+ ...props$1,
109939
+ drawing
109940
+ }) : null;
109941
+ }
109942
+ /** Render an already admitted value without allocating another validation copy. */
109943
+ function AdmittedMapDrawingSvg(props$1) {
109944
+ const drawing = props$1.drawing;
109945
+ const name = props$1.wider ? "wider" : "neighbourhood", frame = drawing.frames[name];
109946
+ const shapes = [
109947
+ {
109948
+ kind: "rect",
109949
+ className: frame.backgroundClass,
109950
+ x: 0,
109951
+ y: 0,
109952
+ width: 800,
109953
+ height: 800
109954
+ },
109955
+ ...frame.paths.map(pathShape),
109956
+ ...frame.labels.flatMap(labelShapes),
109957
+ {
109958
+ kind: "path",
109959
+ className: frame.pin.className,
109960
+ fillRule: "evenodd",
109961
+ d: PIN_PATH,
109962
+ transform: `translate(${frame.pin.point.join(" ")})`
109963
+ }
109964
+ ];
109965
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figure", {
109966
+ className: `rb-map-drawing ${props$1.className ?? ""}`.trim(),
109967
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
109968
+ className: "rb-map-drawing-crop",
109969
+ style: cropHeightStyle(Math.max(255, props$1.height ?? 320), props$1.heightAs ?? "fixed"),
109970
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SvgNode, {
109971
+ className: `map-${name}`,
109972
+ viewBox: frame.viewBox.join(" "),
109973
+ shapes,
109974
+ ariaHidden: false,
109975
+ ariaLabel: props$1.label ? `Map showing ${props$1.label}` : "Map showing the arrival pin"
109976
+ })
109977
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("figcaption", { children: ["© ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
109978
+ href: "https://www.openstreetmap.org/copyright",
109979
+ target: "_blank",
109980
+ rel: "noreferrer",
109981
+ children: "OpenStreetMap contributors"
109982
+ })] })]
109983
+ });
109984
+ }
109985
+ function cropHeightStyle(height, heightAs) {
109986
+ return heightAs === "minimum" ? { minHeight: height } : { height };
109987
+ }
109988
+
109286
109989
  //#endregion
109287
109990
  //#region ../blocks/src/system/runtime/nodes/location-map.view.tsx
109288
109991
  function OpeningHoursTable({ hours: hours$1, lookLayout }) {
@@ -110863,21 +111566,55 @@ const teamMemberCardSchema = z.object({
110863
111566
  photo: runtimeMediaSchema.refine((value) => value.type === "image").nullish(),
110864
111567
  summary: z.string().nullish(),
110865
111568
  profilePath: z.string().nullish(),
110866
- specialties: z.unknown().transform(parseTeamMemberSpecialties)
111569
+ specialties: z.unknown().transform(parseTeamMemberSpecialties),
111570
+ facts: z.array(z.object({
111571
+ label: z.string(),
111572
+ value: z.string()
111573
+ })).nullish()
110867
111574
  });
110868
- /** Staff and manual members meet at one boundary; Look data chooses biography length. */
110869
- function teamMemberCardContent(member$1, index, biographySource, cardBiography) {
110870
- const biography = cardBiography === "any" ? cardText(teamMemberCardBiography(member$1)) : biographySource === "profile" && member$1.profileBio ? member$1.profileBio : member$1.bio;
110871
- const href = sanitizeHref(member$1.profilePath);
111575
+ /**
111576
+ * Staff and manual members meet at one boundary, and this is the one place
111577
+ * that decides what a person's card says and where. Look data chooses the bio's
111578
+ * length, and whether the facts are the person's own quick facts (with the role
111579
+ * above the name, after the bio, and no link to a profile) or the role on its own.
111580
+ */
111581
+ function teamMemberCards(members, choices = {}) {
110872
111582
  return {
111583
+ items: members.map((member$1, index) => teamMemberCardContent(member$1, index, choices)),
111584
+ bodyParts: choices.teamFacts === "person" ? [
111585
+ "title",
111586
+ "text",
111587
+ "facts"
111588
+ ] : [
111589
+ "title",
111590
+ "facts",
111591
+ "text",
111592
+ "chips",
111593
+ "action"
111594
+ ]
111595
+ };
111596
+ }
111597
+ function teamMemberCardContent(member$1, index, choices) {
111598
+ const biography = cardBiographyFor(member$1, choices);
111599
+ const role = member$1.role ? [{
111600
+ label: "Role",
111601
+ value: member$1.role
111602
+ }] : [];
111603
+ const card = {
110873
111604
  id: member$1.id ?? `member-${index}`,
110874
111605
  title: member$1.name,
110875
111606
  media: member$1.photo,
110876
- ...typeof biography === "string" ? { text: biography } : { textDocument: biography ?? undefined },
110877
- facts: member$1.role ? [{
110878
- label: "Role",
110879
- value: member$1.role
110880
- }] : [],
111607
+ ...typeof biography === "string" ? { text: biography } : { textDocument: biography ?? undefined }
111608
+ };
111609
+ if (choices.teamFacts === "person") return {
111610
+ ...card,
111611
+ eyebrowFacts: role,
111612
+ facts: member$1.facts ?? []
111613
+ };
111614
+ const href = sanitizeHref(member$1.profilePath);
111615
+ return {
111616
+ ...card,
111617
+ facts: role,
110881
111618
  chips: member$1.specialties,
110882
111619
  ...href ? { action: {
110883
111620
  label: `About ${member$1.name}`,
@@ -110885,6 +111622,10 @@ function teamMemberCardContent(member$1, index, biographySource, cardBiography)
110885
111622
  } } : {}
110886
111623
  };
110887
111624
  }
111625
+ function cardBiographyFor(member$1, choices) {
111626
+ if (choices.cardBiography === "any") return cardText(teamMemberCardBiography(member$1));
111627
+ return choices.biographySource === "profile" && member$1.profileBio ? member$1.profileBio : member$1.bio;
111628
+ }
110888
111629
  function cardText(biography) {
110889
111630
  if (!biography) return null;
110890
111631
  return biography.kind === "document" ? biography.document : biography.paragraphs.join("\n\n");
@@ -110960,18 +111701,13 @@ function TeamMembersNode(props$1) {
110960
111701
  ...about,
110961
111702
  props: props$1
110962
111703
  });
111704
+ const cards = teamMemberCards(parsed.data, props$1);
110963
111705
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardListItems, {
110964
111706
  Carousel: props$1.Carousel,
110965
- items: parsed.data.map((member$1, index) => teamMemberCardContent(member$1, index, props$1.biographySource, props$1.cardBiography)),
111707
+ items: cards.items,
110966
111708
  presentation: {
110967
111709
  ...props$1,
110968
- bodyParts: [
110969
- "title",
110970
- "facts",
110971
- "text",
110972
- "chips",
110973
- "action"
110974
- ]
111710
+ bodyParts: cards.bodyParts
110975
111711
  },
110976
111712
  Title: props$1.sectionHeading?.trim() ? "h3" : "h2",
110977
111713
  carouselLabels: {
@@ -110994,7 +111730,21 @@ function BookingPanelArrangement({ pageKind, children }) {
110994
111730
 
110995
111731
  //#endregion
110996
111732
  //#region ../blocks/src/system/runtime/nodes/booking-form.service-pricing.ts
111733
+ /**
111734
+ * The amounts the client can choose for a sliding-scale service. A site that
111735
+ * can't take cards yet (the server says `pending_stripe_setup`) can only take
111736
+ * the free end of the scale online, so a scale that starts at nothing narrows
111737
+ * to nothing; one that starts higher stays as it is and needs a card.
111738
+ */
110997
111739
  function getBookingServiceSlidingScale(service) {
111740
+ const scale$1 = configuredSlidingScale(service);
111741
+ return scale$1 && scale$1.minAmount === 0 && service?.paymentTermsAvailability?.kind === "pending_stripe_setup" ? {
111742
+ ...scale$1,
111743
+ maxAmount: 0,
111744
+ suggestedAmount: 0
111745
+ } : scale$1;
111746
+ }
111747
+ function configuredSlidingScale(service) {
110998
111748
  const pricing = service?.pricing;
110999
111749
  if (!pricing || pricing.pricingStrategy !== "sliding_scale" || pricing.slidingMinAmount === null || pricing.slidingMinAmount === undefined || pricing.slidingMaxAmount === null || pricing.slidingMaxAmount === undefined) {
111000
111750
  return null;
@@ -111039,11 +111789,15 @@ function resolveBookingPurchasablePackages(enabled, state) {
111039
111789
  }
111040
111790
  }
111041
111791
  function resolveBookingPaymentAvailability(perSession, held, purchase) {
111042
- if (perSession || held.items.length > 0 || purchase.kind === "ready" && purchase.items.length > 0) return { kind: "available" };
111792
+ if (perSession || heldPackagesOffered(held) || purchase.kind === "ready" && purchase.items.length > 0) return { kind: "available" };
111043
111793
  if (held.kind === "loading" || held.kind === "idle" || purchase.kind === "loading") return { kind: "loading" };
111044
111794
  if (held.kind === "error" || purchase.kind === "error") return { kind: "load_error" };
111045
111795
  return { kind: "no_choices" };
111046
111796
  }
111797
+ /** Packages held with one team member count: the payment step offers to book with them. */
111798
+ function heldPackagesOffered(held) {
111799
+ return held.items.length > 0 || held.kind === "ready" && held.heldWithTeamMembers.length > 0;
111800
+ }
111047
111801
  /** Disclose the package's purchase price; server settlement may require a review for discounts or credit. */
111048
111802
  function bookingPackagePurchaseTerms(product, promisedDiscountId) {
111049
111803
  return {
@@ -111085,10 +111839,20 @@ function resolveBookingPackageSources(service, enabled, bearerAuth) {
111085
111839
  const packageOnly = service?.onlinePaymentChoices?.perSession === false;
111086
111840
  return {
111087
111841
  packageOnly,
111088
- held: resolveHeldPackageSource(service, service?.onlinePaymentChoices?.heldPackage !== false && (enabled || packageOnly), bearerAuth),
111842
+ held: resolveHeldPackageSource(service, serviceOffersHeldPackages(service, enabled || packageOnly, bearerAuth), bearerAuth),
111089
111843
  canBuy: service?.onlinePaymentChoices?.buyPackage === true
111090
111844
  };
111091
111845
  }
111846
+ /**
111847
+ * Whether the client's own packages are offered for this service at all.
111848
+ * Forms turn packages on once the client is signed in, so signed out, a
111849
+ * service that says it takes them still counts: signing in may let them pay
111850
+ * with one.
111851
+ */
111852
+ function serviceOffersHeldPackages(service, enabled, bearerAuth) {
111853
+ const heldPackage = service?.onlinePaymentChoices?.heldPackage;
111854
+ return heldPackage !== false && (enabled || !bearerAuth && heldPackage === true);
111855
+ }
111092
111856
  function resolveHeldPackageSource(service, enabled, bearerAuth) {
111093
111857
  if (!enabled) return "disabled";
111094
111858
  if (!heldPackageServiceEligible(service)) return "missing-priced-service";
@@ -111109,7 +111873,7 @@ function bookingPackageRequestKey(enabled, serviceId, resourceId) {
111109
111873
  function applyBookingPaymentAdmission(services, unrestrictedHeldServiceId) {
111110
111874
  return services.map((service) => {
111111
111875
  const choices = service.onlinePaymentChoices;
111112
- if (service.requiresApproval) return {
111876
+ if (service.requiresApproval || service.onlinePaymentChoices?.perSession !== false && !getBookingServiceSlidingScale(service) && (service.priceAmount ?? 0) === 0) return {
111113
111877
  ...service,
111114
111878
  onlinePaymentChoices: {
111115
111879
  perSession: true,
@@ -111573,7 +112337,8 @@ function resolveBookingPaymentStep(input) {
111573
112337
  kind: "unavailable",
111574
112338
  mode: "unsupported",
111575
112339
  service,
111576
- errorMessage: "Online payments are not set up for this service yet."
112340
+ reason: "cardPaymentsUnavailable",
112341
+ errorMessage: "Card payments aren’t set up for this service yet."
111577
112342
  };
111578
112343
  const [first, ...rest] = resolveAvailableBookingCollectionOptions({
111579
112344
  paymentTerms: service.paymentTerms ?? { allowedOptions: [{ kind: "upfront" }] },
@@ -111587,11 +112352,27 @@ function resolveBookingPaymentStep(input) {
111587
112352
  kind: "unavailable",
111588
112353
  mode: "unsupported",
111589
112354
  service,
112355
+ reason: "paymentOptionsUnavailable",
111590
112356
  errorMessage: "This service has a payment configuration that cannot be booked right now."
111591
112357
  };
111592
112358
  const availableOptions = [first, ...rest];
111593
112359
  return resolveReadyBookingPayment(service, availableOptions, input.data.selectedCollectionOptionKind);
111594
112360
  }
112361
+ /**
112362
+ * The same decision at the least the client can choose to pay, whatever
112363
+ * they've typed so far: whether some per-session choice can go ahead at all.
112364
+ * A sliding scale that starts at nothing is free at its low end.
112365
+ */
112366
+ function resolveLowestBookingPaymentStep(input) {
112367
+ const slidingScale = getBookingServiceSlidingScale(resolveBookingSelectedService(input));
112368
+ return resolveBookingPaymentStep(slidingScale ? {
112369
+ ...input,
112370
+ data: {
112371
+ ...input.data,
112372
+ selectedSlidingAmountInput: formatCentsAsCurrencyInput(slidingScale.minAmount)
112373
+ }
112374
+ } : input);
112375
+ }
111595
112376
  function resolveReadyBookingPayment(service, availableOptions, requestedKind) {
111596
112377
  const [first, ...rest] = availableOptions;
111597
112378
  const current = toSelectedCollectionOptionKind(requestedKind);
@@ -111632,7 +112413,7 @@ function prepareBookingSubmission(input) {
111632
112413
  value: {
111633
112414
  ...common,
111634
112415
  kind: "package_purchase",
111635
- purchasePassId: input.data.packagePurchase.package.id,
112416
+ passProductId: input.data.packagePurchase.package.id,
111636
112417
  discountCode: toTrimmedString(input.data.discountCode),
111637
112418
  shownTerms: input.shownTerms ?? bookingPackagePurchaseTerms(input.data.packagePurchase.package, input.promisedDiscountId)
111638
112419
  }
@@ -111860,6 +112641,7 @@ function resolveMissingBookingPaymentStep(input) {
111860
112641
  kind: "unavailable",
111861
112642
  mode: "unsupported",
111862
112643
  service: null,
112644
+ reason: "paymentOptionsUnavailable",
111863
112645
  errorMessage: "Payment options are unavailable for the selected service right now."
111864
112646
  } : {
111865
112647
  kind: "unselected",
@@ -112027,6 +112809,7 @@ function normalizeAppointmentBookingServices(input) {
112027
112809
  requiresApproval: service.requiresApproval,
112028
112810
  onlinePaymentMode: service.onlinePaymentMode,
112029
112811
  onlinePaymentChoices: service.onlinePaymentChoices,
112812
+ ...service.onlinePayments ? { onlinePayments: service.onlinePayments } : {},
112030
112813
  pricing: service.pricing,
112031
112814
  priceAmount: service.priceAmount,
112032
112815
  priceCurrency: service.priceCurrency,
@@ -112135,6 +112918,13 @@ const bookingServiceSchema = z.object({
112135
112918
  buyPackage: z.boolean(),
112136
112919
  anyAvailable: z.boolean()
112137
112920
  }).optional(),
112921
+ onlinePayments: z.discriminatedUnion("kind", [z.object({ kind: z.literal("available") }), z.object({
112922
+ kind: z.literal("unavailable"),
112923
+ organiserContact: z.object({
112924
+ email: z.string().nullable(),
112925
+ phone: z.string().nullable()
112926
+ }).optional()
112927
+ })]).optional(),
112138
112928
  pricing: z.custom().optional(),
112139
112929
  priceAmount: z.number().nullable().optional(),
112140
112930
  priceCurrency: z.string().nullable().optional(),
@@ -112547,7 +113337,11 @@ function selectEventDetails(args) {
112547
113337
  selected,
112548
113338
  run,
112549
113339
  sessions: run.sessions,
112550
- timeZone
113340
+ timeZone,
113341
+ depositOffer: resolvePublicEventDepositOffer(selected, {
113342
+ nowIso: args.nowIso,
113343
+ sessions: run.sessions
113344
+ })
112551
113345
  };
112552
113346
  }
112553
113347
  if (!isOrdinaryEvent(selected)) return emptySelection(timeZone);
@@ -112556,7 +113350,8 @@ function selectEventDetails(args) {
112556
113350
  mode: mode === "selected" ? "selected" : "next",
112557
113351
  selected,
112558
113352
  otherDates: otherDates.filter(isOrdinaryEvent),
112559
- timeZone
113353
+ timeZone,
113354
+ depositOffer: resolvePublicEventDepositOffer(selected, { nowIso: args.nowIso })
112560
113355
  };
112561
113356
  }
112562
113357
 
@@ -112677,7 +113472,8 @@ function formatTicketTypePrice(ticketType, currency) {
112677
113472
  return formatBookingPriceDisplay(resolveExactOrFreePriceDisplay(ticketType.priceAmount, currency), { decimals: "auto" });
112678
113473
  }
112679
113474
  function getDisplayablePricingOptions(event) {
112680
- return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).sort((left, right) => left.sortOrder - right.sortOrder) : [];
113475
+ const roomPriceIds = event.rooms?.linkedOptionIds ?? [];
113476
+ return event.pricing.kind === "tiered" ? event.pricing.options.filter(isPublicEventPricingOptionDisplayable).filter((option) => !roomPriceIds.includes(option.id)).sort((left, right) => left.sortOrder - right.sortOrder) : [];
112681
113477
  }
112682
113478
  function TicketTypePriceList({ ticketTypes, currency }) {
112683
113479
  if (ticketTypes.length === 0) return null;
@@ -113005,7 +113801,8 @@ function EventVenueMap({ venue, drawing, showMap, mapHeight, mapClassName }) {
113005
113801
  });
113006
113802
  }
113007
113803
  /** One pricing projection governs the selected panel, including drop-in and whole-series behavior. */
113008
- function selectedEventPricing(event, showCost) {
113804
+ function selectedEventPricing(selection, showCost) {
113805
+ const event = selection.selected;
113009
113806
  const isDropIn = isDropInEvent(event);
113010
113807
  const wholeSeriesPricing = wholeSeriesPricingOf(event);
113011
113808
  const showEventCost = showCost && !isDropIn && wholeSeriesPricing === null;
@@ -113013,7 +113810,7 @@ function selectedEventPricing(event, showCost) {
113013
113810
  isDropIn,
113014
113811
  wholeSeriesPricingDisplay: showCost ? wholeSeriesPricing : null,
113015
113812
  eventCostLabel: showEventCost ? formatEventPrice(event) : null,
113016
- depositNote: showCost && !isDropIn ? paidDepositNote(event) : null,
113813
+ depositNote: showCost && !isDropIn && isPaid(event) ? formatEventDepositNote(selection.depositOffer) : null,
113017
113814
  eventPricingCurrency: publicEventPricingCurrency(event.pricing),
113018
113815
  ticketTypes: showEventCost && isPaid(event) ? getDisplayablePricingOptions(event) : []
113019
113816
  };
@@ -113021,14 +113818,13 @@ function selectedEventPricing(event, showCost) {
113021
113818
  const isDropInEvent = (event) => event.bookingScope === "single_occurrence" && event.requiresRegistration === false;
113022
113819
  const wholeSeriesPricingOf = (event) => event.bookingScope === "whole_series" && event.pricing.kind !== "external" ? event.pricing : null;
113023
113820
  const isPaid = (event) => publicEventPricingType(event.pricing) !== "free";
113024
- const paidDepositNote = (event) => isPaid(event) ? formatEventDepositNote(event.pricing, event.paymentTerms, event) : null;
113025
113821
  function SelectedEventDetailsView(props$1) {
113026
113822
  const { selection, showVenue, showMap, showOtherDates, showTitle, showDescription, showCapacity, mapHeight, mapClassName, acceptedItems } = props$1;
113027
113823
  const selected = selection.selected;
113028
113824
  const venue = showVenue ? selected.venue : undefined;
113029
113825
  const online = eventOnlinePlaceShown(selected, showVenue);
113030
113826
  const addressAfterBooking = addressAfterBookingShown(selected, showVenue);
113031
- const pricing = selectedEventPricing(selected, props$1.showCost);
113827
+ const pricing = selectedEventPricing(selection, props$1.showCost);
113032
113828
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
113033
113829
  className: "rb-flex rb-flex-col rb-gap-6 rb-text-left",
113034
113830
  children: [
@@ -113161,7 +113957,7 @@ function headerPanelContent(props$1) {
113161
113957
  const venue = props$1.showVenue ? selection.selected.venue : undefined;
113162
113958
  const online = eventOnlinePlaceShown(selection.selected, props$1.showVenue);
113163
113959
  const teamMembers = selection.selected.teamMembers ?? [];
113164
- const pricing = headerPanelPricing(props$1, selection.selected);
113960
+ const pricing = headerPanelPricing(props$1, selection);
113165
113961
  const scheduled = selection.kind === "wholeSeries" ? selection.sessions.length : selection.otherDates.length;
113166
113962
  return {
113167
113963
  venue,
@@ -113179,8 +113975,8 @@ function headerPanelContent(props$1) {
113179
113975
  * discount, or passes that also admit. Decided from the same projection
113180
113976
  * `EventPricingDetails` renders, so a panel is only drawn when it will show something.
113181
113977
  */
113182
- function headerPanelPricing(props$1, event) {
113183
- const pricing = selectedEventPricing(event, props$1.showCost ?? true);
113978
+ function headerPanelPricing(props$1, selection) {
113979
+ const pricing = selectedEventPricing(selection, props$1.showCost ?? true);
113184
113980
  if (pricing.isDropIn) return null;
113185
113981
  const detail = {
113186
113982
  ...pricing,
@@ -131852,7 +132648,7 @@ async function loadConfig(configPath, output) {
131852
132648
  return { errorMessage: "No config path provided." };
131853
132649
  }
131854
132650
  try {
131855
- const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-D7f6MXJV.mjs");
132651
+ const { loadConfigFile: loadConfigFile$1 } = await import("../load-config-DTT9jeYi.mjs");
131856
132652
  const rawConfig = await loadConfigFile$1(configPath);
131857
132653
  const parsed = z.safeParse(riverbankSiteConfigSchema, rawConfig);
131858
132654
  if (!parsed.success) {
@@ -144829,6 +145625,7 @@ const CUSTOMER_PASS_REFUND_INVALID_CODES = [...MANAGED_PRODUCT_REFUND_INVALID_CO
144829
145625
  const CUSTOMER_PASS_REFUND_FAILED_CODES = [
144830
145626
  "not_found",
144831
145627
  "credit_refunds_disabled",
145628
+ "ending_dates_changed",
144832
145629
  "payment_intent_lookup_failed",
144833
145630
  ...CANONICAL_ADMIN_REFUND_FAILURE_CODES
144834
145631
  ];
@@ -144872,7 +145669,7 @@ function classifyCustomerPassRefundCode(code) {
144872
145669
  if (CUSTOMER_PASS_REFUND_INVALID_CODES.includes(code)) {
144873
145670
  return "invalid";
144874
145671
  }
144875
- if (CANONICAL_REFUND_CONFLICT_CODES.includes(code)) {
145672
+ if (code === "ending_dates_changed" || CANONICAL_REFUND_CONFLICT_CODES.includes(code)) {
144876
145673
  return "conflict";
144877
145674
  }
144878
145675
  return "failed";
@@ -147569,6 +148366,7 @@ function toPublicBookingServiceCatalogueItem(service, categoryId) {
147569
148366
  requiresApproval: service.requiresApproval,
147570
148367
  ...service.onlinePaymentMode === undefined ? {} : { onlinePaymentMode: service.onlinePaymentMode },
147571
148368
  ...service.onlinePaymentChoices === undefined ? {} : { onlinePaymentChoices: service.onlinePaymentChoices },
148369
+ ...service.onlinePayments === undefined ? {} : { onlinePayments: service.onlinePayments },
147572
148370
  id: service.id,
147573
148371
  asksSiteTerms: service.asksSiteTerms,
147574
148372
  siteId: service.siteId,