@riverbankcms/sdk 0.147.0 → 0.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/{PreviewEditorSidebar-DtpB3_sS.mjs → PreviewEditorSidebar-DBKln68M.mjs} +301 -205
- package/dist/{PreviewEditorUI-DxTLgaHo.mjs → PreviewEditorUI-DpRX4Mum.mjs} +68 -63
- package/dist/{PreviewQueryProvider-Dd4dxOiU.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DMMNCngt.mjs → SdkPreviewModeRuntime-DJPmPY-r.mjs} +1247 -541
- package/dist/{SiteChromeCustomizeContext-DQXZXiqS.mjs → SiteChromeCustomizeContext-JYA0cJ_Z.mjs} +209720 -204978
- package/dist/_dts/ai/src/contracts/proposals.d.ts +0 -33
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +0 -3
- package/dist/_dts/api/src/accessAdmin.d.ts +0 -4
- package/dist/_dts/api/src/accountApi.d.ts +1 -1
- package/dist/_dts/api/src/admin.d.ts +22 -22
- package/dist/_dts/api/src/aiPatch.d.ts +2 -2
- package/dist/_dts/api/src/aiPlayground.d.ts +1 -0
- package/dist/_dts/api/src/analytics.d.ts +2 -2
- package/dist/_dts/api/src/apiEndpointTypes.d.ts +2 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +2 -2
- package/dist/_dts/api/src/auth.d.ts +10 -10
- package/dist/_dts/api/src/availability.d.ts +6 -6
- package/dist/_dts/api/src/billing.d.ts +42 -15
- package/dist/_dts/api/src/billingEndpointDefinitions.d.ts +8 -0
- package/dist/_dts/api/src/billingEndpointTypes.d.ts +15 -6
- package/dist/_dts/api/src/blocks.d.ts +15 -14
- package/dist/_dts/api/src/blocksKeys.d.ts +2 -0
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -50
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +9 -11
- package/dist/_dts/api/src/bookingRecords.d.ts +16 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/bookings.d.ts +7 -7
- package/dist/_dts/api/src/calendar.d.ts +9 -9
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +7 -8
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/common/envelope.d.ts +2 -2
- package/dist/_dts/api/src/content-editor.d.ts +2 -2
- package/dist/_dts/api/src/contentEntries.d.ts +17 -48
- package/dist/_dts/api/src/contentRuntime.d.ts +51 -37
- package/dist/_dts/api/src/contentTypes.d.ts +11 -11
- package/dist/_dts/api/src/contentVersionHistoryClient.d.ts +6 -6
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/documentLifecycle.d.ts +67 -0
- package/dist/_dts/api/src/domains.d.ts +16 -16
- package/dist/_dts/api/src/editLeaseEndpoints.d.ts +72 -0
- package/dist/_dts/api/src/emailSettings.d.ts +4 -4
- package/dist/_dts/api/src/endpoints.d.ts +135 -51
- package/dist/_dts/api/src/eventEmailTemplates.d.ts +2 -2
- package/dist/_dts/api/src/eventManagementContracts.d.ts +29 -7
- package/dist/_dts/api/src/eventManagementEndpointDefinitions.d.ts +0 -8
- package/dist/_dts/api/src/eventPageWords.d.ts +7 -12
- package/dist/_dts/api/src/footerSettings.d.ts +6 -6
- package/dist/_dts/api/src/index.d.ts +8 -7
- package/dist/_dts/api/src/indexCoreTypes.d.ts +1 -0
- package/dist/_dts/api/src/indexExtendedTypes.d.ts +1 -1
- package/dist/_dts/api/src/navigation.d.ts +5 -5
- package/dist/_dts/api/src/pageSurfaceEditorEndpoints.d.ts +55 -0
- package/dist/_dts/api/src/pageSurfaceEndpoints.d.ts +28 -7
- package/dist/_dts/api/src/pages.d.ts +7 -7
- package/dist/_dts/api/src/performance.d.ts +1 -1
- package/dist/_dts/api/src/public/index.d.ts +1 -1
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +4 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +6 -29
- package/dist/_dts/api/src/redirects.d.ts +3 -3
- package/dist/_dts/api/src/request.d.ts +11 -2
- package/dist/_dts/api/src/resources.d.ts +4 -4
- package/dist/_dts/api/src/routes.d.ts +8 -3
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -2
- package/dist/_dts/api/src/sdkBlockUpsertContracts.d.ts +21 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +5 -28
- package/dist/_dts/api/src/sdkEventEndpointDefinitions.d.ts +1 -1
- package/dist/_dts/api/src/sdkEventOccurrenceRequestContracts.d.ts +43 -0
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +4 -2
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +9 -2
- package/dist/_dts/api/src/seo.d.ts +4 -4
- package/dist/_dts/api/src/services.d.ts +4 -4
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +15 -8
- package/dist/_dts/api/src/siteMembers.d.ts +10 -10
- package/dist/_dts/api/src/siteOnboarding.d.ts +14 -0
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +7 -3
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +5 -12
- package/dist/_dts/api/src/siteRuntimeEntry.d.ts +31 -0
- package/dist/_dts/billing/src/checkout/platform.d.ts +77 -0
- package/dist/_dts/billing/src/components/index.d.ts +25 -40
- package/dist/_dts/billing/src/membership/index.d.ts +1 -3
- package/dist/_dts/billing/src/plans/entitlements.d.ts +80 -0
- package/dist/_dts/billing/src/plans/registry.d.ts +16 -16
- package/dist/_dts/billing/src/plans/standing.d.ts +9 -2
- package/dist/_dts/billing/src/plans/types.d.ts +5 -15
- package/dist/_dts/billing/src/site-arrangements.d.ts +2 -2
- package/dist/_dts/billing/src/subscriptions/standingEvidence.d.ts +2 -4
- package/dist/_dts/billing/src/subscriptions/store.d.ts +17 -11
- package/dist/_dts/block-form/src/backend/store-backend.d.ts +6 -7
- package/dist/_dts/block-form/src/backend/types.d.ts +7 -0
- package/dist/_dts/block-form/src/widgets/FieldFrame.d.ts +3 -1
- package/dist/_dts/blocks/src/client/events.d.ts +3 -0
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +54 -14
- package/dist/_dts/blocks/src/pageRenderAdmission.d.ts +4 -13
- package/dist/_dts/blocks/src/pageRendererContracts.d.ts +2 -0
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -8
- package/dist/_dts/blocks/src/system/blocks/contact-newsletter.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/event-registration.d.ts +3 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +28 -28
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +7 -2
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/portal.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/shop.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/components/booking/SuccessMessage.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +72 -12
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +36 -6
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessBookingFlow.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/hooks/usePolling.d.ts +7 -48
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.checkout-return-context.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.completion.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.headless.state.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.interactive.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.payment-confirmation.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +17 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-actions.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.submit-handler.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-runtime-sources.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/checkout.server.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationSurface.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/SuccessStep.d.ts +4 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +2 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +9 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventListing.interactive.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/domain/dates.d.ts +37 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.client.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventCard.d.ts +16 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCardPresentations.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +29 -29
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.d.ts +1 -14
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.d.ts +12 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +54 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/blocks/src/system/runtime/shared/components/DemoBookingPortalAccess.d.ts +22 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/DemoPortalSignInLink.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/shared/components/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/demoBookingPassStorage.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/shared/utils/demoPortalMagicLink.d.ts +29 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +1 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +3 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +2 -1
- package/dist/_dts/content-editor/src/components/ContentFieldsForm.d.ts +2 -7
- package/dist/_dts/content-editor/src/controller/EditLeaseController.d.ts +39 -0
- package/dist/_dts/content-editor/src/controller/EditorWriteGate.d.ts +38 -0
- package/dist/_dts/content-editor/src/controller/EntryControllerProvider.d.ts +25 -61
- package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseBanner.d.ts +7 -0
- package/dist/_dts/content-editor/src/controller/LinkedEntryLeaseControllers.d.ts +14 -0
- package/dist/_dts/content-editor/src/controller/deriveEditorUnpublishedState.d.ts +6 -0
- package/dist/_dts/content-editor/src/controller/documentValueBaseline.d.ts +25 -0
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/controller/editLeaseLossSignal.d.ts +6 -0
- package/dist/_dts/content-editor/src/controller/editLeaseNotice.d.ts +28 -0
- package/dist/_dts/content-editor/src/controller/editorClientId.d.ts +2 -0
- package/dist/_dts/content-editor/src/controller/editorEditability.d.ts +38 -0
- package/dist/_dts/content-editor/src/controller/editorLeaseParticipation.d.ts +34 -0
- package/dist/_dts/content-editor/src/controller/normalizedMetadataBaseline.d.ts +29 -0
- package/dist/_dts/content-editor/src/controller/pageSurfaceDocumentBaselines.d.ts +14 -0
- package/dist/_dts/content-editor/src/controller/pageSurfaceLifecycle.d.ts +11 -0
- package/dist/_dts/content-editor/src/controller/planDocumentBaselineRefresh.d.ts +19 -0
- package/dist/_dts/content-editor/src/controller/readDocumentLeaseBaselines.d.ts +19 -0
- package/dist/_dts/content-editor/src/controller/refreshDocumentLeaseBaseline.d.ts +12 -0
- package/dist/_dts/content-editor/src/controller/refreshLinkedEntry.d.ts +17 -0
- package/dist/_dts/content-editor/src/controller/replayRestoredEditorEffects.d.ts +2 -3
- package/dist/_dts/content-editor/src/controller/routeWrites.d.ts +26 -0
- package/dist/_dts/content-editor/src/controller/useAutosaveTriggers.d.ts +16 -17
- package/dist/_dts/content-editor/src/controller/useBlockedPublishPlan.d.ts +6 -2
- package/dist/_dts/content-editor/src/controller/useBlocksList.d.ts +3 -3
- package/dist/_dts/content-editor/src/controller/useEntryValueAutosaves.d.ts +21 -0
- package/dist/_dts/content-editor/src/controller/useInitialEditorUiStore.d.ts +24 -0
- package/dist/_dts/content-editor/src/controller/useServerBaselineReconciliation.d.ts +17 -0
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +1 -1
- package/dist/_dts/content-editor/src/hooks/applyBlockedPublishPlan.d.ts +5 -1
- package/dist/_dts/content-editor/src/hooks/blockDraftLifecycle.d.ts +8 -47
- package/dist/_dts/content-editor/src/hooks/editLeaseMachine.d.ts +120 -0
- package/dist/_dts/content-editor/src/hooks/publishability.d.ts +6 -10
- package/dist/_dts/content-editor/src/hooks/useAutosaveStatus.d.ts +3 -0
- package/dist/_dts/content-editor/src/hooks/useBlockAutosave.d.ts +5 -15
- package/dist/_dts/content-editor/src/hooks/useDebouncedLatestSave.d.ts +7 -5
- package/dist/_dts/content-editor/src/hooks/useEditLease.d.ts +28 -0
- package/dist/_dts/content-editor/src/hooks/useEntryActions.d.ts +25 -39
- package/dist/_dts/content-editor/src/hooks/useEntryMutations.d.ts +17 -19
- package/dist/_dts/content-editor/src/hooks/useLinkedEntryAutosave.d.ts +5 -8
- package/dist/_dts/content-editor/src/hooks/useValueAutosave.d.ts +64 -0
- package/dist/_dts/content-editor/src/hooks/validateBlocksForPublish.d.ts +0 -7
- package/dist/_dts/content-editor/src/index.d.ts +26 -7
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/content-editor/src/linkedEntries/domain.d.ts +12 -0
- package/dist/_dts/content-editor/src/linkedEntries/owner.d.ts +9 -0
- package/dist/_dts/content-editor/src/liveDrafts/draftProjection.d.ts +66 -0
- package/dist/_dts/content-editor/src/liveDrafts/linkedSaveHandovers.d.ts +37 -0
- package/dist/_dts/content-editor/src/liveDrafts/remoteDraftOverlay.d.ts +113 -0
- package/dist/_dts/content-editor/src/liveDrafts/useLiveDrafts.d.ts +32 -0
- package/dist/_dts/content-editor/src/liveDrafts/useRetentionTicks.d.ts +7 -0
- package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +6 -0
- package/dist/_dts/content-editor/src/primitives/shared/storeBinding.d.ts +1 -0
- package/dist/_dts/content-editor/src/services/contentEntryServices.d.ts +96 -19
- package/dist/_dts/content-editor/src/services/editorApiClient.d.ts +13 -0
- package/dist/_dts/content-editor/src/services/index.d.ts +2 -0
- package/dist/_dts/content-editor/src/services/pageSurfaceEditorServices.d.ts +23 -0
- package/dist/_dts/content-editor/src/sync/flushValues.d.ts +13 -0
- package/dist/_dts/content-editor/src/sync/lifecycleFailure.d.ts +51 -0
- package/dist/_dts/content-editor/src/sync/runLifecycle.d.ts +64 -0
- package/dist/_dts/content-editor/src/sync/schedulerValues.d.ts +27 -0
- package/dist/_dts/content-editor/src/sync/sendPlanning.d.ts +104 -0
- package/dist/_dts/content-editor/src/sync/valueSync.d.ts +114 -0
- package/dist/_dts/content-editor/src/ui/blockCollection.d.ts +8 -0
- package/dist/_dts/content-editor/src/ui/documentLifecycle.d.ts +18 -0
- package/dist/_dts/content-editor/src/ui/editorLeaseUiState.d.ts +7 -0
- package/dist/_dts/content-editor/src/ui/editorRefresh.d.ts +82 -0
- package/dist/_dts/content-editor/src/ui/editorSnapshot.d.ts +102 -127
- package/dist/_dts/content-editor/src/ui/editorTransactionState.d.ts +1 -1
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +126 -72
- package/dist/_dts/content-editor/src/ui/editorValueSnapshot.d.ts +18 -0
- package/dist/_dts/content-editor/src/ui/serverBlockAdmission.d.ts +26 -0
- package/dist/_dts/content-editor/src/ui/stores/autosaveStore.d.ts +16 -27
- package/dist/_dts/content-editor/src/ui/stores/blockVersionsStore.d.ts +24 -0
- package/dist/_dts/content-editor/src/ui/stores/linkedEntryLeaseStore.d.ts +54 -0
- package/dist/_dts/content-editor/src/ui/stores/linkedSaveHandoversStore.d.ts +11 -0
- package/dist/_dts/content-editor/src/ui/stores/remoteDraftsStore.d.ts +10 -0
- package/dist/_dts/content-editor/src/ui/stores/types.d.ts +63 -3
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +2 -2
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +1 -1
- package/dist/_dts/content-model/src/content-types/builtin-schemas.d.ts +4 -4
- package/dist/_dts/content-model/src/content-types/builtins.d.ts +4 -4
- package/dist/_dts/content-model/src/definitions/shared.d.ts +11 -2
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/serializeAllowedBlocks.d.ts +2 -0
- package/dist/_dts/content-model/src/metadataConfig.d.ts +10 -38
- package/dist/_dts/content-model/src/templates/defaults.d.ts +0 -1
- package/dist/_dts/content-model/src/types.d.ts +0 -1
- package/dist/_dts/core/src/block-content-identity.d.ts +49 -1
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +15 -0
- package/dist/_dts/core/src/currency-format.d.ts +8 -2
- package/dist/_dts/core/src/demo-lifecycle-status.d.ts +2 -2
- package/dist/_dts/core/src/demo-warm-pool-target.d.ts +8 -0
- package/dist/_dts/core/src/edit-lease.d.ts +60 -0
- package/dist/_dts/core/src/editor-state.d.ts +38 -13
- package/dist/_dts/core/src/editor-value-sync.d.ts +79 -0
- package/dist/_dts/core/src/html-entities.d.ts +6 -0
- package/dist/_dts/core/src/index.d.ts +7 -0
- package/dist/_dts/core/src/uuid.d.ts +7 -5
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +456 -189
- package/dist/_dts/editor/src/EditorProvider.d.ts +5 -0
- package/dist/_dts/editor/src/chrome/EditorChrome.d.ts +14 -0
- package/dist/_dts/editor/src/chrome/EditorStatusBar.d.ts +1 -0
- package/dist/_dts/editor/src/chrome/statusBarPresentation.d.ts +0 -1
- package/dist/_dts/editor/src/index.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +10 -9
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardFrame.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/BlockSettingsModal.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/block-editor/applyExtendedFieldDefaults.d.ts +3 -4
- package/dist/_dts/editor-blocks/src/block-editor/blockDraftBaselineSeed.d.ts +4 -8
- package/dist/_dts/editor-blocks/src/block-editor/editorBlockItem.d.ts +23 -0
- package/dist/_dts/editor-blocks/src/block-editor/generatedIconApplyCoordination.d.ts +2 -7
- package/dist/_dts/editor-blocks/src/block-editor/hooks/applyBlockStructureChange.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/block-editor/hooks/buildInsertBlockHistoryCommand.d.ts +14 -5
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockBaselineSync.d.ts +21 -19
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockCreation.d.ts +2 -10
- package/dist/_dts/editor-blocks/src/block-editor/hooks/useBlockDuplication.d.ts +8 -16
- package/dist/_dts/editor-blocks/src/block-editor/owner.d.ts +6 -16
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +37 -9
- package/dist/_dts/editor-blocks/src/index.d.ts +2 -1
- package/dist/_dts/editor-blocks/src/widgets/entry-picker/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/link/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/mailing-list-targeting/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/reference/loaders.d.ts +1 -1
- package/dist/_dts/editor-blocks/src/widgets/site-option-picker/loaders.d.ts +3 -2
- package/dist/_dts/media-core/src/fileStorage.d.ts +4 -0
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/context.d.ts +1 -1
- package/dist/_dts/media-editor/src/createMediaEditorProvider.d.ts +1 -2
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/media-editor/src/provider.d.ts +3 -2
- package/dist/_dts/media-react/src/hooks/internal/classification.d.ts +1 -1
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +3 -1
- package/dist/_dts/preview-next/src/client/blocks/composer/mergeDrafts.d.ts +8 -3
- package/dist/_dts/preview-next/src/client/blocks/composer/types.d.ts +6 -3
- package/dist/_dts/preview-next/src/client/blocks/linkedEntryRenderOverlay.d.ts +22 -2
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/entryFieldRebinding.d.ts +13 -0
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/index.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/blocks/previewProjection/types.d.ts +11 -1
- package/dist/_dts/preview-next/src/client/blocks/renderPrecedence.d.ts +17 -0
- package/dist/_dts/preview-next/src/client/blocks/useLinkedSaveHandoverRetention.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/EntryEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/EntrySlotBlockEditorPanel.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewAccessBanners.d.ts +7 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +23 -14
- package/dist/_dts/preview-next/src/client/preview/PreviewLeaseEditingMode.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +9 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeAutosave.d.ts +5 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +3 -4
- package/dist/_dts/preview-next/src/client/preview/sdkConfig.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/usePreviewCustomizeWorkflowState.d.ts +4 -0
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/realtime/src/client.d.ts +3 -0
- package/dist/_dts/realtime/src/draftChannel.d.ts +91 -0
- package/dist/_dts/realtime/src/drafts.d.ts +210 -0
- package/dist/_dts/realtime/src/index.d.ts +3 -0
- package/dist/_dts/realtime/src/leaseChangeSubscriptions.d.ts +8 -0
- package/dist/_dts/realtime/src/types.d.ts +113 -0
- package/dist/_dts/realtime/src/useDraftChannel.d.ts +34 -0
- package/dist/_dts/realtime/src/useSiteRealtimeReload.d.ts +27 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +6 -55
- package/dist/_dts/sdk/src/rendering/blocks-page-renderer.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/surfaces/src/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-1n4Ch_u_.mjs → BookingMailingListNote-Cr3EeTP5.mjs} +504 -163
- package/dist/client/DemoBookingPortalAccess-BFGB1Fay.mjs +344 -0
- package/dist/client/{EventCombined.client-C0pgma9y.mjs → EventCombined.client-DKYV0_ft.mjs} +6 -6
- package/dist/client/{EventListing.client-4fhLOvHP.mjs → EventListing.client-B9UIcEYc.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-DScC4F3w.mjs → LeafletStaticMap-CFLPkP0K.mjs} +1 -1
- package/dist/client/{TerminalPanel-B5ZUsYhe.mjs → TerminalPanel-JjmgxEsR.mjs} +1 -1
- package/dist/client/{ThemedButton-DoVIV1Ao.mjs → ThemedButton-CKV1Jh2m.mjs} +1 -1
- package/dist/client/{accordion-CoT5g7zo.mjs → accordion-DXWIfT3T.mjs} +1 -1
- package/dist/client/{bookingForm-BWxB46xD.mjs → bookingForm-CjZgHNvv.mjs} +216 -63
- package/dist/client/bookings.mjs +1187 -692
- package/dist/client/{carousel-DtNYWFd3.mjs → carousel-DSLikmvZ.mjs} +1 -1
- package/dist/client/{cart-z4qZih1Y.mjs → cart-HDjWReFt.mjs} +3 -3
- package/dist/client/{checkout-DpL7euFH.mjs → checkout-CUvRZA3W.mjs} +3 -3
- package/dist/client/{checkoutUrls-BEfR7kVu.mjs → checkoutUrls-CXhko2Rv.mjs} +1 -1
- package/dist/client/client.mjs +2711 -1684
- package/dist/client/{context-C8TinPJc.mjs → context-DFmaZa-Q.mjs} +4 -3
- package/dist/client/{dates-vwwxTeB0.mjs → dates-BBep1JnF.mjs} +56 -11
- package/dist/client/{eventCalendar-DIbHfJXO.mjs → eventCalendar-zEobhxo4.mjs} +9 -9
- package/dist/client/{eventCombined-DoGMJ6cg.mjs → eventCombined-Dp7bz5k-.mjs} +4 -4
- package/dist/client/{eventDetails-BjN9v6a1.mjs → eventDetails-FE-zqTt7.mjs} +4 -4
- package/dist/client/{eventListing-DajjWgOv.mjs → eventListing-BMt5snal.mjs} +4 -4
- package/dist/client/{eventRegistration-DMq9gMA-.mjs → eventRegistration-O6ZxHfOb.mjs} +422 -570
- package/dist/client/{form-Qf6qTbos.mjs → form-DFa1D8vt.mjs} +3 -3
- package/dist/client/{headerSection-D7qJrqFX.mjs → headerSection-CmjHLR-N.mjs} +3 -3
- package/dist/client/hooks.mjs +414 -182
- package/dist/client/{locationMap-CCF9-t_0.mjs → locationMap-BXKP_lGh.mjs} +3 -3
- package/dist/client/{media-CwBGetqC.mjs → media-Cl38iOMI.mjs} +10 -3
- package/dist/client/{newsletterForm-DzCLSP4S.mjs → newsletterForm-CU-HmxGx.mjs} +3 -3
- package/dist/client/{pricing-Cgxv2KLC.mjs → pricing-KEAEsibq.mjs} +1 -1
- package/dist/client/{productDetail-ru9w5GHx.mjs → productDetail-Ckp7MGnt.mjs} +3 -3
- package/dist/client/{productList-zaapKSl-.mjs → productList-D91V0sYa.mjs} +3 -3
- package/dist/client/{propsDecoder-CwvvNOHx.mjs → propsDecoder-DZd6RJeA.mjs} +244 -94
- package/dist/client/rendering/client.mjs +2656 -1705
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +3430 -2352
- package/dist/client/{routeIslandApiConfig-BwVFo0Y4.mjs → routeIslandApiConfig-E1EkhhYY.mjs} +1 -1
- package/dist/client/{shop-mktkXvbV.mjs → shop-4F2jLQPI.mjs} +131 -85
- package/dist/client/{shop-commerce-De7gEnkA.mjs → shop-commerce-BbfCJjB3.mjs} +25 -13
- package/dist/client/{shop-commerce-store-B3MCxIBW.mjs → shop-commerce-store-vicweP2K.mjs} +1 -1
- package/dist/client/{shopShared-TqExh235.mjs → shopShared-DlONJt0T.mjs} +4 -4
- package/dist/client/{useEventFilters-n_OjkIjX.mjs → useEventFilters-COYyL3m7.mjs} +32 -17
- package/dist/preview-next/before-render.mjs +207 -105
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +341 -165
- package/dist/preview-next/middleware.mjs +207 -105
- package/dist/{previewAuthStore-C_EHQ5XA.mjs → previewAuthStore-BBmV7UsW.mjs} +243 -112
- package/dist/{sdk-runtime-BIkJg5y1.mjs → sdk-runtime-CwvFFjB-.mjs} +2 -2
- package/dist/{separator-C9qDP95Z.mjs → separator-ByL72zUT.mjs} +1 -1
- package/dist/server/components.mjs +1839 -1475
- package/dist/server/config-validation.mjs +381 -166
- package/dist/server/config.mjs +381 -166
- package/dist/server/data.mjs +381 -166
- package/dist/server/index.mjs +214 -110
- package/dist/server/next.mjs +663 -351
- package/dist/server/page-converter.mjs +198 -79
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1536 -1169
- package/dist/server/rendering.mjs +2432 -2068
- package/dist/server/routing.mjs +456 -173
- package/dist/server/server.mjs +447 -267
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/billing/src/plans/display.d.ts +0 -15
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.mailing-list-note.d.ts +0 -3
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
- package/dist/_dts/content-editor/src/controller/buildBlockPublishedBaselines.d.ts +0 -4
- package/dist/_dts/content-editor/src/controller/buildPublishSuccessTransition.d.ts +0 -16
- package/dist/_dts/content-editor/src/controller/driver.d.ts +0 -14
- package/dist/_dts/content-editor/src/controller/seedDraftBaselinesFromBlocks.d.ts +0 -7
- package/dist/_dts/content-editor/src/controller/useEntrySyncHelpers.d.ts +0 -29
- package/dist/_dts/content-editor/src/hooks/autosaveScopePlanning.d.ts +0 -26
- package/dist/_dts/content-editor/src/hooks/useSimpleAutosave.d.ts +0 -64
- package/dist/_dts/content-editor/src/hooks/useStoreAutosave.d.ts +0 -48
- package/dist/_dts/content-editor/src/types.d.ts +0 -44
- package/dist/client/DiscountCodeDisclosure-CKJtz0mY.mjs +0 -137
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as buildBookingPaymentSelectionViewModel, i as usePolling, n as BookingConsentAgreement, o as resolveBookingPaymentDueNowCents, r as StepIndicator$1, s as formatPrice, t as BookingMailingListNote } from "./BookingMailingListNote-
|
|
3
|
-
import {
|
|
4
|
-
import { a as canJoinEventWaitlistOnAnyMode, c as formatTicketTypeRemaining, f as getRemainingPlaces, h as selectMostOpenCapacitySource, i as canJoinEventWaitlist, m as selectEventCapacitySource, o as formatEventRemainingPlaces, p as isEventFull, r as formatEventPriceDisplay, s as formatRemainingPlaces, u as getEventAvailability } from "./pricing-
|
|
5
|
-
import { n as useBlockApi, r as BlockApiError, t as BlockApiProvider } from "./context-
|
|
2
|
+
import { a as buildBookingPaymentSelectionViewModel, c as eventRegistrationErrors, d as planCheckoutPaymentFlow, f as planFlexibleBalanceCreditFirst, i as usePolling, l as parseEventRegistrationErrorReason, n as BookingConsentAgreement, o as resolveBookingPaymentDueNowCents, p as useBookingNowIso, r as StepIndicator$1, s as formatPrice, t as BookingMailingListNote, u as getStripeMinimumChargeRequirement } from "./BookingMailingListNote-Cr3EeTP5.mjs";
|
|
3
|
+
import { C as resolveDiscountContext, Cn as formatCurrencyAmount, D as WIZARD_STEPS, E as toRegistrationRequestSubject, M as resolveEventRegistrationScopedEvents, O as getStepNumber, Ot as getRegistrationSuccessCopy, S as findPreSelectedEvent, Sn as publicEventPricingType, T as resolveRegistrationTarget, Wt as assertNever, _ as buildEventRegistrationDisplayFromScopedEvents, b as toWholeSeriesRegistrationEvents, bn as publicEventPricingOptions, en as resolveBookingSignupOffer, fn as toBookingTimeZone, ft as groupPublicEventsByRun, in as formatBookingDateTime, k as getWizardStepsForContext, mn as toScheduledBookingDateTime, nn as formatBookingDate, on as formatBookingTime, t as defineIslandPropsDecoder, v as getRegistrationStartAt, vn as publicEventPricingCurrency, w as resolveEventRequiresPayment, x as findEventByOccurrenceId, xn as publicEventPricingStrategy, y as toRegistrationEvents } from "./propsDecoder-DZd6RJeA.mjs";
|
|
4
|
+
import { a as canJoinEventWaitlistOnAnyMode, c as formatTicketTypeRemaining, f as getRemainingPlaces, h as selectMostOpenCapacitySource, i as canJoinEventWaitlist, m as selectEventCapacitySource, o as formatEventRemainingPlaces, p as isEventFull, r as formatEventPriceDisplay, s as formatRemainingPlaces, u as getEventAvailability } from "./pricing-KEAEsibq.mjs";
|
|
5
|
+
import { n as useBlockApi, r as BlockApiError, t as BlockApiProvider } from "./context-DFmaZa-Q.mjs";
|
|
6
6
|
import { n as isSpamProtectionEnabled, r as AltchaWidget, t as getChallengeUrl } from "./src-B833rYRr.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { a as useDiscountCodeUi, i as CheckIcon, n as StateIcon, r as scrollToBlock, t as TerminalPanel } from "./TerminalPanel-
|
|
9
|
-
import { i as SpinnerNode, t as ThemedButton } from "./ThemedButton-
|
|
7
|
+
import { a as requestDemoPortalMagicLink, f as storeDemoBookingPass, i as buildPortalCallbackUrl, o as DiscountCodeDisclosure, r as CUSTOMER_PORTAL_PATH, t as BookingConfirmation } from "./DemoBookingPortalAccess-BFGB1Fay.mjs";
|
|
8
|
+
import { a as useDiscountCodeUi, i as CheckIcon, n as StateIcon, r as scrollToBlock, t as TerminalPanel } from "./TerminalPanel-JjmgxEsR.mjs";
|
|
9
|
+
import { i as SpinnerNode, n as ThemedButtonLink, t as ThemedButton } from "./ThemedButton-CKV1Jh2m.mjs";
|
|
10
10
|
import { t as FeedbackMessage } from "./FeedbackMessage-CtLvvS_d.mjs";
|
|
11
11
|
import { i as getFieldValidationControlProps, r as FieldValidationMessage } from "./mailingListSignupCopy-DZSHZrm6.mjs";
|
|
12
|
-
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-
|
|
12
|
+
import { t as buildCheckoutReturnUrls } from "./checkoutUrls-CXhko2Rv.mjs";
|
|
13
13
|
import { t as CheckboxChoice } from "./CheckboxChoice-B33MqoUo.mjs";
|
|
14
14
|
import { t as createBodyThemePortalRoot } from "./themePortalRoot-AGs4cE7t.mjs";
|
|
15
15
|
import { n as consumeSearchParams } from "./urlParams-D71VXFGx.mjs";
|
|
16
16
|
import { t as CrossIcon } from "./CrossIcon-Dn1KRKW5.mjs";
|
|
17
17
|
import { t as mountReactIsland } from "./reactMount-SY8AVRof.mjs";
|
|
18
|
-
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-
|
|
18
|
+
import { t as buildRouteIslandApiConfig } from "./routeIslandApiConfig-E1EkhhYY.mjs";
|
|
19
19
|
import { t as createLucideIcon } from "./createLucideIcon-PaLVMov4.mjs";
|
|
20
20
|
import { t as ModalShell } from "./ModalShell-CqkBvBIC.mjs";
|
|
21
21
|
import React, { useCallback, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
22
|
-
import { z } from "zod";
|
|
23
22
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
23
|
import { createPortal } from "react-dom";
|
|
25
|
-
//#region ../core/src/
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function toNonNegativeCents(value) {
|
|
34
|
-
return unsafeAsNonNegativeCents(Math.max(0, Math.trunc(value)));
|
|
24
|
+
//#region ../core/src/uuid.ts
|
|
25
|
+
function generateUuidV4(cryptoSource = globalThis.crypto) {
|
|
26
|
+
if (typeof cryptoSource.randomUUID === "function") return cryptoSource.randomUUID();
|
|
27
|
+
const bytes = cryptoSource.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
28
|
+
bytes[6] = (bytes[6] ?? 0) & 15 | 64;
|
|
29
|
+
bytes[8] = (bytes[8] ?? 0) & 63 | 128;
|
|
30
|
+
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
|
31
|
+
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
35
32
|
}
|
|
36
33
|
//#endregion
|
|
37
34
|
//#region ../blocks/src/system/runtime/shared/components/ClockIcon.tsx
|
|
@@ -202,6 +199,7 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
|
|
|
202
199
|
priceAmount: input.totalPriceCents,
|
|
203
200
|
priceCurrency: input.currency,
|
|
204
201
|
bookingStartAt: input.startsAt,
|
|
202
|
+
nowIso: input.nowIso,
|
|
205
203
|
locale: input.locale
|
|
206
204
|
});
|
|
207
205
|
return {
|
|
@@ -209,7 +207,7 @@ function buildEventRegistrationPaymentOptionsViewModel(input) {
|
|
|
209
207
|
sectionTitle: selection.sectionTitle,
|
|
210
208
|
options: selection.options.flatMap((option, index) => {
|
|
211
209
|
const sourceOption = approvedOptions[index];
|
|
212
|
-
return sourceOption ? [toEventDirectPaymentOption(option, sourceOption, selection.mode, input.totalPriceCents
|
|
210
|
+
return sourceOption ? [toEventDirectPaymentOption(option, sourceOption, selection.mode, input.totalPriceCents)] : [];
|
|
213
211
|
})
|
|
214
212
|
};
|
|
215
213
|
}
|
|
@@ -217,11 +215,10 @@ function selectApprovedEventDirectPaymentOptions(approvedPaymentOptions, payment
|
|
|
217
215
|
const approvedKinds = new Set(getApprovedDirectPaymentCollectionOptionKinds(approvedPaymentOptions));
|
|
218
216
|
return paymentTerms.allowedOptions.filter((option) => approvedKinds.has(option.kind));
|
|
219
217
|
}
|
|
220
|
-
function toEventDirectPaymentOption(option, sourceOption, mode, totalCents
|
|
218
|
+
function toEventDirectPaymentOption(option, sourceOption, mode, totalCents) {
|
|
221
219
|
const configuredPaymentDueNowCents = resolveBookingPaymentDueNowCents({
|
|
222
220
|
option: sourceOption,
|
|
223
|
-
totalCents
|
|
224
|
-
bookingStartAt: startsAt
|
|
221
|
+
totalCents
|
|
225
222
|
});
|
|
226
223
|
switch (option.kind) {
|
|
227
224
|
case "upfront": return {
|
|
@@ -800,7 +797,7 @@ function recoverRegistrationError(action, handlers) {
|
|
|
800
797
|
switch (action) {
|
|
801
798
|
case "none": return;
|
|
802
799
|
case "portal":
|
|
803
|
-
window.location.assign(
|
|
800
|
+
window.location.assign(CUSTOMER_PORTAL_PATH);
|
|
804
801
|
return;
|
|
805
802
|
case "event":
|
|
806
803
|
window.location.assign(window.location.pathname);
|
|
@@ -1146,287 +1143,6 @@ function logoutPortal(anchorId) {
|
|
|
1146
1143
|
form.submit();
|
|
1147
1144
|
}
|
|
1148
1145
|
//#endregion
|
|
1149
|
-
//#region ../commerce/src/purchase/checkoutPaymentFlow.ts
|
|
1150
|
-
function planCheckoutPaymentFlow(options) {
|
|
1151
|
-
const amountDueCents = toNonNegativeCents(options.amountDueCents);
|
|
1152
|
-
const discountCents = toNonNegativeCents(options.discountCents);
|
|
1153
|
-
const availableCreditCents = toNonNegativeCents(options.availableCreditCents);
|
|
1154
|
-
const minimumStripeChargeCents = toNonNegativeCents(options.minimumStripeChargeCents ?? 0);
|
|
1155
|
-
if (amountDueCents <= 0) return {
|
|
1156
|
-
kind: "bypass",
|
|
1157
|
-
bypassReason: discountCents > 0 ? "discount_free" : "free",
|
|
1158
|
-
reserveCreditCents: 0
|
|
1159
|
-
};
|
|
1160
|
-
if (!options.creditCurrencyMatches || availableCreditCents <= 0) return {
|
|
1161
|
-
kind: "stripe",
|
|
1162
|
-
reserveCreditCents: toNonNegativeCents(0)
|
|
1163
|
-
};
|
|
1164
|
-
if (availableCreditCents >= amountDueCents) return {
|
|
1165
|
-
kind: "store_credit_only",
|
|
1166
|
-
reserveCreditCents: amountDueCents
|
|
1167
|
-
};
|
|
1168
|
-
return {
|
|
1169
|
-
kind: "stripe",
|
|
1170
|
-
reserveCreditCents: planMixedPaymentCreditReservation({
|
|
1171
|
-
amountDueCents,
|
|
1172
|
-
availableCreditCents,
|
|
1173
|
-
minimumStripeChargeCents
|
|
1174
|
-
})
|
|
1175
|
-
};
|
|
1176
|
-
}
|
|
1177
|
-
function planMixedPaymentCreditReservation(input) {
|
|
1178
|
-
const chargeAfterFullCredit = input.amountDueCents - input.availableCreditCents;
|
|
1179
|
-
if (input.minimumStripeChargeCents <= 0 || chargeAfterFullCredit <= 0 || chargeAfterFullCredit >= input.minimumStripeChargeCents) return input.availableCreditCents;
|
|
1180
|
-
if (input.amountDueCents < input.minimumStripeChargeCents) return toNonNegativeCents(0);
|
|
1181
|
-
return toNonNegativeCents(input.amountDueCents - input.minimumStripeChargeCents);
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Apply site credit to a flexible-balance booking before card payment.
|
|
1185
|
-
*
|
|
1186
|
-
* Credit first reduces the configured payment due now. Once that payment is
|
|
1187
|
-
* covered, any remaining credit reduces the later balance. If a partial credit
|
|
1188
|
-
* application would leave a positive card charge below Stripe's minimum, less
|
|
1189
|
-
* credit is used so the configured payment can still be collected.
|
|
1190
|
-
*/
|
|
1191
|
-
function planFlexibleBalanceCreditFirst(input) {
|
|
1192
|
-
const totalCents = toNonNegativeCents(input.totalAfterDiscountCents);
|
|
1193
|
-
const configuredDueNowCents = toNonNegativeCents(Math.min(input.configuredPaymentDueNowCents, totalCents));
|
|
1194
|
-
const availableCreditCents = toNonNegativeCents(input.creditCurrencyMatches ? input.availableCreditCents : 0);
|
|
1195
|
-
const minimumStripeChargeCents = toNonNegativeCents(input.minimumStripeChargeCents ?? 0);
|
|
1196
|
-
if (availableCreditCents >= totalCents && totalCents > 0) return {
|
|
1197
|
-
kind: "credit_only",
|
|
1198
|
-
reserveCreditCents: totalCents,
|
|
1199
|
-
cardDueNowCents: toNonNegativeCents(0),
|
|
1200
|
-
laterBalanceCents: toNonNegativeCents(0)
|
|
1201
|
-
};
|
|
1202
|
-
let reserveCreditCents = toNonNegativeCents(Math.min(availableCreditCents, totalCents));
|
|
1203
|
-
if (reserveCreditCents >= configuredDueNowCents) return {
|
|
1204
|
-
kind: "flexible_balance",
|
|
1205
|
-
reserveCreditCents,
|
|
1206
|
-
cardDueNowCents: toNonNegativeCents(0),
|
|
1207
|
-
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents)
|
|
1208
|
-
};
|
|
1209
|
-
const plannedCardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
1210
|
-
if (plannedCardDueNowCents > 0 && plannedCardDueNowCents < minimumStripeChargeCents) {
|
|
1211
|
-
if (configuredDueNowCents < minimumStripeChargeCents) return {
|
|
1212
|
-
kind: "card_below_minimum",
|
|
1213
|
-
reserveCreditCents: toNonNegativeCents(0),
|
|
1214
|
-
cardDueNowCents: configuredDueNowCents,
|
|
1215
|
-
laterBalanceCents: toNonNegativeCents(totalCents - configuredDueNowCents)
|
|
1216
|
-
};
|
|
1217
|
-
reserveCreditCents = toNonNegativeCents(configuredDueNowCents - minimumStripeChargeCents);
|
|
1218
|
-
}
|
|
1219
|
-
const cardDueNowCents = toNonNegativeCents(configuredDueNowCents - reserveCreditCents);
|
|
1220
|
-
return {
|
|
1221
|
-
kind: "flexible_balance",
|
|
1222
|
-
reserveCreditCents,
|
|
1223
|
-
cardDueNowCents,
|
|
1224
|
-
laterBalanceCents: toNonNegativeCents(totalCents - reserveCreditCents - cardDueNowCents)
|
|
1225
|
-
};
|
|
1226
|
-
}
|
|
1227
|
-
//#endregion
|
|
1228
|
-
//#region ../commerce/src/purchase/settlement.ts
|
|
1229
|
-
function normalizeCurrencyCode(raw) {
|
|
1230
|
-
const normalized = raw.trim().toUpperCase();
|
|
1231
|
-
if (!/^[A-Z]{3}$/.test(normalized)) throw new Error(`Invalid currency code: ${raw}`);
|
|
1232
|
-
return normalized;
|
|
1233
|
-
}
|
|
1234
|
-
//#endregion
|
|
1235
|
-
//#region ../commerce/src/purchase/checkoutSessionMetadata.ts
|
|
1236
|
-
const datedOfferingSharedEngineMetadataShape = {
|
|
1237
|
-
datedOfferingEngineContractVersion: z.literal("shared_v1"),
|
|
1238
|
-
datedOfferingEngineRouteKind: z.literal("shared_whole_series_registration"),
|
|
1239
|
-
datedOfferingCapacityHoldId: z.string().uuid(),
|
|
1240
|
-
datedOfferingCapacityHoldAuditRef: z.string().uuid(),
|
|
1241
|
-
customerId: z.string().uuid(),
|
|
1242
|
-
eventSeriesId: z.string().uuid()
|
|
1243
|
-
};
|
|
1244
|
-
z.object(datedOfferingSharedEngineMetadataShape);
|
|
1245
|
-
const orderCheckoutSessionMetadataBaseShape = {
|
|
1246
|
-
type: z.literal("order"),
|
|
1247
|
-
site_id: z.string().uuid(),
|
|
1248
|
-
order_id: z.string().uuid().optional(),
|
|
1249
|
-
customer_email: z.string().email(),
|
|
1250
|
-
customer_name: z.string().optional(),
|
|
1251
|
-
product_id: z.string().uuid().optional(),
|
|
1252
|
-
attendee_id: z.string().uuid().optional(),
|
|
1253
|
-
occurrence_id: z.string().uuid().optional(),
|
|
1254
|
-
tickets_count: z.string().optional(),
|
|
1255
|
-
notes: z.string().optional(),
|
|
1256
|
-
discount_redemption_id: z.string().uuid().optional(),
|
|
1257
|
-
discount_code_id: z.string().uuid().optional(),
|
|
1258
|
-
discount_code: z.string().optional(),
|
|
1259
|
-
discount_public_label: z.string().optional(),
|
|
1260
|
-
credit_reservation_id: z.string().uuid().optional(),
|
|
1261
|
-
credit_reserved_cents: z.string().optional(),
|
|
1262
|
-
discount_code_amount_cents: z.string().optional(),
|
|
1263
|
-
order_payment_reason: z.enum([
|
|
1264
|
-
"instalment_payoff",
|
|
1265
|
-
"flexible_balance_initial",
|
|
1266
|
-
"flexible_balance_paydown"
|
|
1267
|
-
]).optional(),
|
|
1268
|
-
order_payment_plan_id: z.string().uuid().optional(),
|
|
1269
|
-
order_flexible_balance_contract_id: z.string().uuid().optional()
|
|
1270
|
-
};
|
|
1271
|
-
const absentDatedOfferingSharedEngineMetadataShape = {
|
|
1272
|
-
datedOfferingEngineContractVersion: z.never().optional(),
|
|
1273
|
-
datedOfferingEngineRouteKind: z.never().optional(),
|
|
1274
|
-
datedOfferingCapacityHoldId: z.never().optional(),
|
|
1275
|
-
datedOfferingCapacityHoldAuditRef: z.never().optional(),
|
|
1276
|
-
customerId: z.never().optional(),
|
|
1277
|
-
eventSeriesId: z.never().optional()
|
|
1278
|
-
};
|
|
1279
|
-
const LegacyOrderCheckoutSessionMetadataSchema = z.object({
|
|
1280
|
-
...orderCheckoutSessionMetadataBaseShape,
|
|
1281
|
-
...absentDatedOfferingSharedEngineMetadataShape
|
|
1282
|
-
});
|
|
1283
|
-
const SharedDatedOfferingOrderCheckoutSessionMetadataSchema = z.object({
|
|
1284
|
-
...orderCheckoutSessionMetadataBaseShape,
|
|
1285
|
-
...datedOfferingSharedEngineMetadataShape
|
|
1286
|
-
});
|
|
1287
|
-
z.union([SharedDatedOfferingOrderCheckoutSessionMetadataSchema, LegacyOrderCheckoutSessionMetadataSchema]);
|
|
1288
|
-
//#endregion
|
|
1289
|
-
//#region ../commerce/src/purchase/stripeCommissionMetadata.ts
|
|
1290
|
-
/** Reasons are payment evidence, not an independent pricing policy. */
|
|
1291
|
-
const STRIPE_COMMISSION_FREE_REASONS = [
|
|
1292
|
-
"managed_billing",
|
|
1293
|
-
"no_commission_plan",
|
|
1294
|
-
"billing_evidence_invalid",
|
|
1295
|
-
"fee_rounds_to_zero",
|
|
1296
|
-
"payment_not_stripe"
|
|
1297
|
-
];
|
|
1298
|
-
const historicalContext = {
|
|
1299
|
-
currency: z.string().refine((value) => parseCurrencyCode(value) !== null).optional(),
|
|
1300
|
-
sourcePlanId: z.string().trim().min(1).optional()
|
|
1301
|
-
};
|
|
1302
|
-
const percentSchema = z.number().finite().min(0).max(100);
|
|
1303
|
-
z.discriminatedUnion("kind", [
|
|
1304
|
-
z.object({
|
|
1305
|
-
kind: z.literal("commission_free"),
|
|
1306
|
-
reason: z.enum(STRIPE_COMMISSION_FREE_REASONS),
|
|
1307
|
-
...historicalContext
|
|
1308
|
-
}),
|
|
1309
|
-
z.object({
|
|
1310
|
-
kind: z.literal("application_fee_amount"),
|
|
1311
|
-
amountCents: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
1312
|
-
percent: percentSchema,
|
|
1313
|
-
...historicalContext
|
|
1314
|
-
}),
|
|
1315
|
-
z.object({
|
|
1316
|
-
kind: z.literal("application_fee_percent"),
|
|
1317
|
-
percent: percentSchema,
|
|
1318
|
-
...historicalContext
|
|
1319
|
-
})
|
|
1320
|
-
]);
|
|
1321
|
-
toNonNegativeCents(0);
|
|
1322
|
-
//#endregion
|
|
1323
|
-
//#region ../commerce/src/purchase/stripeMinimumCharge.ts
|
|
1324
|
-
const STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY = {
|
|
1325
|
-
GBP: 30,
|
|
1326
|
-
USD: 50,
|
|
1327
|
-
EUR: 50,
|
|
1328
|
-
AED: 200,
|
|
1329
|
-
AUD: 50,
|
|
1330
|
-
BGN: 100,
|
|
1331
|
-
BRL: 50,
|
|
1332
|
-
CAD: 50,
|
|
1333
|
-
CHF: 50,
|
|
1334
|
-
CZK: 1500,
|
|
1335
|
-
DKK: 250,
|
|
1336
|
-
HKD: 400,
|
|
1337
|
-
HUF: 17500,
|
|
1338
|
-
JPY: 50,
|
|
1339
|
-
MXN: 1e3,
|
|
1340
|
-
MYR: 200,
|
|
1341
|
-
NOK: 300,
|
|
1342
|
-
NZD: 50,
|
|
1343
|
-
PLN: 200,
|
|
1344
|
-
RON: 200,
|
|
1345
|
-
SEK: 300,
|
|
1346
|
-
SGD: 50,
|
|
1347
|
-
THB: 1e3
|
|
1348
|
-
};
|
|
1349
|
-
function isStripeMinimumChargeCurrency(currency) {
|
|
1350
|
-
return currency in STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY;
|
|
1351
|
-
}
|
|
1352
|
-
function getStripeMinimumChargeRequirement(rawCurrency) {
|
|
1353
|
-
let currency;
|
|
1354
|
-
try {
|
|
1355
|
-
currency = normalizeCurrencyCode(rawCurrency);
|
|
1356
|
-
} catch {
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
const currencyKey = currency;
|
|
1360
|
-
if (!isStripeMinimumChargeCurrency(currencyKey)) return null;
|
|
1361
|
-
return {
|
|
1362
|
-
currency,
|
|
1363
|
-
minimumAmountCents: STRIPE_MINIMUM_CHARGE_CENTS_BY_CURRENCY[currencyKey]
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
//#endregion
|
|
1367
|
-
//#region ../commerce/src/purchase/event-registration-errors.ts
|
|
1368
|
-
const eventRegistrationErrors = {
|
|
1369
|
-
registrationClosed: {
|
|
1370
|
-
message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.",
|
|
1371
|
-
action: "none"
|
|
1372
|
-
},
|
|
1373
|
-
paymentInvestigationRequired: {
|
|
1374
|
-
message: "We still can’t confirm your payment. Please don’t make another payment. Contact the organiser so they can check your booking.",
|
|
1375
|
-
action: "none"
|
|
1376
|
-
},
|
|
1377
|
-
paymentProviderUnavailable: {
|
|
1378
|
-
message: "We couldn’t reach the payment provider. Please try again in a minute.",
|
|
1379
|
-
action: "retry"
|
|
1380
|
-
},
|
|
1381
|
-
paymentPageUnavailable: {
|
|
1382
|
-
message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.",
|
|
1383
|
-
action: "retry"
|
|
1384
|
-
},
|
|
1385
|
-
paymentUnavailable: {
|
|
1386
|
-
message: "Online payment is not available for this event right now. Please contact the organiser for help with booking.",
|
|
1387
|
-
action: "none"
|
|
1388
|
-
},
|
|
1389
|
-
capacityChanged: {
|
|
1390
|
-
message: "Sorry, there aren’t enough places left for your selection. Please check the available places and choose again.",
|
|
1391
|
-
action: "places"
|
|
1392
|
-
},
|
|
1393
|
-
selectionChanged: {
|
|
1394
|
-
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
1395
|
-
action: "places"
|
|
1396
|
-
},
|
|
1397
|
-
registrationPreparationChanged: {
|
|
1398
|
-
message: "The booking options for this event have changed. Please check the latest options and choose your places again.",
|
|
1399
|
-
action: "places"
|
|
1400
|
-
},
|
|
1401
|
-
registrationAlreadyExists: {
|
|
1402
|
-
message: "You already have a booking for this event. Please check your bookings to see its status. If you need help, contact the organiser.",
|
|
1403
|
-
action: "portal"
|
|
1404
|
-
},
|
|
1405
|
-
holdExpired: {
|
|
1406
|
-
message: "Your reservation has timed out. Please check availability and choose your places again.",
|
|
1407
|
-
action: "start"
|
|
1408
|
-
},
|
|
1409
|
-
waitlistUnavailable: {
|
|
1410
|
-
message: "Sorry, the waiting list place offered in this invitation is no longer available. Please check the event for available places or contact the organiser for help.",
|
|
1411
|
-
action: "event"
|
|
1412
|
-
},
|
|
1413
|
-
paymentContextMismatch: {
|
|
1414
|
-
message: "The payment options for this event have changed. Please check the latest options before continuing.",
|
|
1415
|
-
action: "payment-options"
|
|
1416
|
-
},
|
|
1417
|
-
idempotencyConflict: {
|
|
1418
|
-
message: "You’ve already started booking this event. Please finish in the other tab if it’s still open, or check your booking status before starting again.",
|
|
1419
|
-
action: "portal"
|
|
1420
|
-
},
|
|
1421
|
-
invalidCommitInput: {
|
|
1422
|
-
message: "We couldn’t accept your booking details. Please check the information you entered and try again. If this keeps happening, contact the organiser for help.",
|
|
1423
|
-
action: "details"
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
function parseEventRegistrationErrorReason(value) {
|
|
1427
|
-
return typeof value === "string" && Object.prototype.hasOwnProperty.call(eventRegistrationErrors, value) ? value : null;
|
|
1428
|
-
}
|
|
1429
|
-
//#endregion
|
|
1430
1146
|
//#region ../blocks/src/system/runtime/shared/useWaitlistClaim.state.ts
|
|
1431
1147
|
const DEFAULT_WAITLIST_CLAIM_ERROR = "Online booking is unavailable right now. Please contact the organiser for help with booking.";
|
|
1432
1148
|
function createInitialWaitlistClaimState(hasToken) {
|
|
@@ -1601,11 +1317,50 @@ function useResolvedWaitlistClaim(deps, credential) {
|
|
|
1601
1317
|
* ```
|
|
1602
1318
|
*/
|
|
1603
1319
|
const paymentVerificationDeps = { useBlockApi };
|
|
1320
|
+
function resolvePaymentPollingTarget(config) {
|
|
1321
|
+
const reference = config.reference;
|
|
1322
|
+
return reference.scope === "occurrence" ? {
|
|
1323
|
+
key: `occurrence:${reference.attendeeId}`,
|
|
1324
|
+
reference
|
|
1325
|
+
} : {
|
|
1326
|
+
key: `wholeSeries:${reference.registrationId}`,
|
|
1327
|
+
reference
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
function createPaymentPollingConfig(api, settings) {
|
|
1331
|
+
if (settings === null) return null;
|
|
1332
|
+
const target = resolvePaymentPollingTarget(settings);
|
|
1333
|
+
return {
|
|
1334
|
+
restartKey: target.key,
|
|
1335
|
+
pollFn: () => api.getEventRegistrationStatus(target.reference),
|
|
1336
|
+
isComplete: (result) => result.paymentStatus === "completed" || result.paymentStatus === "not_required",
|
|
1337
|
+
isFailed: (result) => result.paymentStatus === "failed" || result.paymentStatus === "refunded",
|
|
1338
|
+
maxAttempts: settings.maxAttempts,
|
|
1339
|
+
interval: settings.pollInterval
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
function getPaymentVerificationError(polling, paymentStatus) {
|
|
1343
|
+
if (polling.status === "timeout") return "Could not verify payment. If you were charged, please contact support.";
|
|
1344
|
+
if (polling.status === "failed" && paymentStatus !== null) return paymentStatus === "refunded" ? "Payment was refunded. Please contact support." : "Payment was declined. Please try again.";
|
|
1345
|
+
return polling.error?.message ?? null;
|
|
1346
|
+
}
|
|
1347
|
+
function mapPaymentVerificationResult(polling) {
|
|
1348
|
+
const paymentStatus = polling.result?.paymentStatus ?? null;
|
|
1349
|
+
return {
|
|
1350
|
+
status: polling.status,
|
|
1351
|
+
paymentStatus,
|
|
1352
|
+
attendeeStatus: polling.result?.attendeeStatus ?? null,
|
|
1353
|
+
waitlistPosition: polling.result?.waitlistPosition ?? null,
|
|
1354
|
+
error: getPaymentVerificationError(polling, paymentStatus),
|
|
1355
|
+
retry: polling.retry
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1604
1358
|
/**
|
|
1605
1359
|
* Hook for polling payment status after Stripe redirects.
|
|
1606
1360
|
*
|
|
1607
1361
|
* Pass config to start polling, or null to stop/idle.
|
|
1608
|
-
* The hook handles cleanup on unmount and
|
|
1362
|
+
* The hook handles cleanup on unmount and starts a new cycle when the status
|
|
1363
|
+
* reference changes.
|
|
1609
1364
|
*
|
|
1610
1365
|
* @param config - Configuration for polling, or null to stop
|
|
1611
1366
|
* @returns Verification result with status, data, and retry function
|
|
@@ -1614,30 +1369,7 @@ function usePaymentVerification(config) {
|
|
|
1614
1369
|
return usePaymentVerificationWithDeps(config, paymentVerificationDeps);
|
|
1615
1370
|
}
|
|
1616
1371
|
function usePaymentVerificationWithDeps(config, deps) {
|
|
1617
|
-
|
|
1618
|
-
const polling = usePolling(useMemo(() => {
|
|
1619
|
-
if (!config) return null;
|
|
1620
|
-
return {
|
|
1621
|
-
pollFn: () => api.getEventRegistrationStatus(config.reference),
|
|
1622
|
-
isComplete: (result) => result.paymentStatus === "completed" || result.paymentStatus === "not_required",
|
|
1623
|
-
isFailed: (result) => result.paymentStatus === "failed" || result.paymentStatus === "refunded",
|
|
1624
|
-
maxAttempts: config.maxAttempts,
|
|
1625
|
-
interval: config.pollInterval
|
|
1626
|
-
};
|
|
1627
|
-
}, [api, config]));
|
|
1628
|
-
const paymentStatus = polling.result?.paymentStatus ?? null;
|
|
1629
|
-
let errorMessage = null;
|
|
1630
|
-
if (polling.status === "timeout") errorMessage = "Could not verify payment. If you were charged, please contact support.";
|
|
1631
|
-
else if (polling.status === "failed" && paymentStatus) errorMessage = paymentStatus === "refunded" ? "Payment was refunded. Please contact support." : "Payment was declined. Please try again.";
|
|
1632
|
-
else if (polling.error) errorMessage = polling.error.message;
|
|
1633
|
-
return {
|
|
1634
|
-
status: polling.status,
|
|
1635
|
-
paymentStatus,
|
|
1636
|
-
attendeeStatus: polling.result?.attendeeStatus ?? null,
|
|
1637
|
-
waitlistPosition: polling.result?.waitlistPosition ?? null,
|
|
1638
|
-
error: errorMessage,
|
|
1639
|
-
retry: polling.retry
|
|
1640
|
-
};
|
|
1372
|
+
return mapPaymentVerificationResult(usePolling(createPaymentPollingConfig(deps.useBlockApi(), config)));
|
|
1641
1373
|
}
|
|
1642
1374
|
//#endregion
|
|
1643
1375
|
//#region ../blocks/src/system/runtime/nodes/event-registration/constants.ts
|
|
@@ -2010,20 +1742,9 @@ function registrationErrorPresentation(error) {
|
|
|
2010
1742
|
function wantsMailingListSignup(options) {
|
|
2011
1743
|
return options.mailingListSignup !== null && options.formData.mailingListOptIn === true;
|
|
2012
1744
|
}
|
|
2013
|
-
function createClientCommandId(cryptoSource = {
|
|
2014
|
-
randomUUID: globalThis.crypto.randomUUID?.bind(globalThis.crypto),
|
|
2015
|
-
getRandomValues: (bytes) => globalThis.crypto.getRandomValues(bytes)
|
|
2016
|
-
}) {
|
|
2017
|
-
if (cryptoSource.randomUUID) return cryptoSource.randomUUID();
|
|
2018
|
-
const bytes = cryptoSource.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
2019
|
-
bytes[6] = (bytes[6] ?? 0) & 15 | 64;
|
|
2020
|
-
bytes[8] = (bytes[8] ?? 0) & 63 | 128;
|
|
2021
|
-
const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
|
|
2022
|
-
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
2023
|
-
}
|
|
2024
1745
|
const eventRegistrationSubmitDeps = {
|
|
2025
1746
|
savePendingRegistration,
|
|
2026
|
-
createClientCommandId
|
|
1747
|
+
createClientCommandId: generateUuidV4
|
|
2027
1748
|
};
|
|
2028
1749
|
function useEventRegistrationSubmit(options) {
|
|
2029
1750
|
return useEventRegistrationSubmitWithDeps(options, eventRegistrationSubmitDeps);
|
|
@@ -2103,6 +1824,7 @@ function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
|
2103
1824
|
};
|
|
2104
1825
|
}
|
|
2105
1826
|
async function completeRegistrationSubmission(options, deps, prepared, result, submitOptions) {
|
|
1827
|
+
if (result.demoBookingPass) storeDemoBookingPass(options.formData.email, result.demoBookingPass);
|
|
2106
1828
|
switch (result.kind) {
|
|
2107
1829
|
case "paymentStatusRequired":
|
|
2108
1830
|
options.setPaymentStatusRecovery({
|
|
@@ -2125,6 +1847,7 @@ async function completeRegistrationSubmission(options, deps, prepared, result, s
|
|
|
2125
1847
|
status: "waitlist",
|
|
2126
1848
|
title: "Added to waitlist",
|
|
2127
1849
|
message: result.waitlist.message,
|
|
1850
|
+
emailFollowupMessage: result.waitlist.emailFollowupMessage,
|
|
2128
1851
|
mailingListSignupNote: result.mailingListSignupNote
|
|
2129
1852
|
});
|
|
2130
1853
|
break;
|
|
@@ -2587,13 +2310,15 @@ const eventRegistrationWizardDeps = {
|
|
|
2587
2310
|
useWaitlistClaim,
|
|
2588
2311
|
useEventRegistrationStripeReturn,
|
|
2589
2312
|
useEventRegistrationSubmit,
|
|
2590
|
-
useDiscountCodeUi
|
|
2313
|
+
useDiscountCodeUi,
|
|
2314
|
+
useBookingNowIso
|
|
2591
2315
|
};
|
|
2592
2316
|
function useEventRegistrationWizard(options) {
|
|
2593
2317
|
return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
|
|
2594
2318
|
}
|
|
2595
2319
|
function useEventRegistrationWizardWithDeps(options, deps) {
|
|
2596
2320
|
const api = useBlockApi();
|
|
2321
|
+
const nowIso = deps.useBookingNowIso();
|
|
2597
2322
|
const registrationEvents = useMemo(() => [...toRegistrationEvents(options.events ?? []), ...toWholeSeriesRegistrationEvents(options.events ?? [])], [options.events]);
|
|
2598
2323
|
const scopedEvents = useMemo(() => {
|
|
2599
2324
|
return resolveEventRegistrationScopedEvents(registrationEvents, {
|
|
@@ -3124,6 +2849,7 @@ function useEventRegistrationWizardWithDeps(options, deps) {
|
|
|
3124
2849
|
});
|
|
3125
2850
|
return {
|
|
3126
2851
|
api,
|
|
2852
|
+
nowIso,
|
|
3127
2853
|
anchorId: options.anchorId,
|
|
3128
2854
|
occurrenceContext: options.occurrenceContext,
|
|
3129
2855
|
registrationTarget,
|
|
@@ -3250,6 +2976,118 @@ function useEventCheckoutHandoffRestoreWithDeps(active, deps) {
|
|
|
3250
2976
|
}, [active, deps]);
|
|
3251
2977
|
}
|
|
3252
2978
|
//#endregion
|
|
2979
|
+
//#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationBookingLayer.tsx
|
|
2980
|
+
function BookingEntry(props) {
|
|
2981
|
+
const base = props.variant === "teaser" ? "er-booking-teaser" : "er-booking-bar";
|
|
2982
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
2983
|
+
className: `${base}__info`,
|
|
2984
|
+
children: [
|
|
2985
|
+
/* @__PURE__ */ jsx("span", {
|
|
2986
|
+
className: `${base}__title`,
|
|
2987
|
+
children: "Book this event"
|
|
2988
|
+
}),
|
|
2989
|
+
props.summary && /* @__PURE__ */ jsx("span", {
|
|
2990
|
+
className: `${base}__meta`,
|
|
2991
|
+
children: props.summary
|
|
2992
|
+
}),
|
|
2993
|
+
props.variant === "teaser" && props.ticketCurrency && props.ticketTypes.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
2994
|
+
className: "er-booking-teaser__tickets",
|
|
2995
|
+
children: props.ticketTypes.map((ticketType) => /* @__PURE__ */ jsxs("div", {
|
|
2996
|
+
className: "er-booking-teaser__ticket",
|
|
2997
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2998
|
+
className: "er-booking-teaser__ticket-name",
|
|
2999
|
+
children: ticketType.name
|
|
3000
|
+
}), /* @__PURE__ */ jsx("strong", { children: props.formatTicketPrice(ticketType) })]
|
|
3001
|
+
}, ticketType.pricingOptionId))
|
|
3002
|
+
}) : null
|
|
3003
|
+
]
|
|
3004
|
+
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
3005
|
+
type: "button",
|
|
3006
|
+
variant: props.buttonVariant,
|
|
3007
|
+
size: "md",
|
|
3008
|
+
extraClassName: `${base}__cta`,
|
|
3009
|
+
label: "Book now",
|
|
3010
|
+
onClick: props.onOpen
|
|
3011
|
+
})] });
|
|
3012
|
+
}
|
|
3013
|
+
function EventRegistrationBookingLayer(props) {
|
|
3014
|
+
const entryProps = {
|
|
3015
|
+
summary: [props.priceLabel, props.availabilityLabel].filter(Boolean).join(" · "),
|
|
3016
|
+
ticketTypes: props.ticketTypes,
|
|
3017
|
+
ticketCurrency: props.ticketCurrency,
|
|
3018
|
+
buttonVariant: props.buttonVariant,
|
|
3019
|
+
formatTicketPrice: props.formatTicketPrice,
|
|
3020
|
+
onOpen: props.onOpen
|
|
3021
|
+
};
|
|
3022
|
+
const floatingBar = !props.overlayOpen && props.isWizardStep ? /* @__PURE__ */ jsx("div", {
|
|
3023
|
+
className: "er-booking-bar",
|
|
3024
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
3025
|
+
className: "er-booking-bar__inner",
|
|
3026
|
+
children: /* @__PURE__ */ jsx(BookingEntry, {
|
|
3027
|
+
...entryProps,
|
|
3028
|
+
variant: "bar"
|
|
3029
|
+
})
|
|
3030
|
+
})
|
|
3031
|
+
}) : null;
|
|
3032
|
+
const floatingLayer = props.portalRoot ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
3033
|
+
className: props.registrationRootClassName,
|
|
3034
|
+
"data-block": "event-registration",
|
|
3035
|
+
children: floatingBar
|
|
3036
|
+
}), props.portalRoot) : floatingBar;
|
|
3037
|
+
const overlayLayer = props.overlayOpen ? /* @__PURE__ */ jsx(ModalShell, {
|
|
3038
|
+
title: "Book this event",
|
|
3039
|
+
titleId: "event-registration-booking-title",
|
|
3040
|
+
onClose: props.onClose,
|
|
3041
|
+
portal: props.portalRoot != null,
|
|
3042
|
+
portalRoot: props.portalRoot,
|
|
3043
|
+
portalWrapperClassName: props.registrationRootClassName,
|
|
3044
|
+
portalWrapperProps: { "data-block": "event-registration" },
|
|
3045
|
+
overlayClassName: "er-booking-overlay",
|
|
3046
|
+
modalClassName: "er-booking-overlay__panel",
|
|
3047
|
+
renderHeader: ({ closeButtonRef, onClose, title, titleId }) => /* @__PURE__ */ jsxs("div", {
|
|
3048
|
+
className: "er-booking-overlay__header",
|
|
3049
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
3050
|
+
className: "er-booking-overlay__title",
|
|
3051
|
+
id: titleId,
|
|
3052
|
+
children: title
|
|
3053
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
3054
|
+
ref: closeButtonRef,
|
|
3055
|
+
type: "button",
|
|
3056
|
+
className: "er-booking-overlay__close",
|
|
3057
|
+
onClick: onClose,
|
|
3058
|
+
"aria-label": "Close booking",
|
|
3059
|
+
children: "×"
|
|
3060
|
+
})]
|
|
3061
|
+
}),
|
|
3062
|
+
children: props.overlaySurface
|
|
3063
|
+
}) : null;
|
|
3064
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3065
|
+
props.isWizardStep && /* @__PURE__ */ jsx("div", {
|
|
3066
|
+
className: "er-booking-teaser",
|
|
3067
|
+
children: /* @__PURE__ */ jsx(BookingEntry, {
|
|
3068
|
+
...entryProps,
|
|
3069
|
+
variant: "teaser"
|
|
3070
|
+
})
|
|
3071
|
+
}),
|
|
3072
|
+
floatingLayer,
|
|
3073
|
+
overlayLayer
|
|
3074
|
+
] });
|
|
3075
|
+
}
|
|
3076
|
+
//#endregion
|
|
3077
|
+
//#region ../blocks/src/system/runtime/shared/components/DemoPortalSignInLink.tsx
|
|
3078
|
+
function DemoPortalSignInLink(props) {
|
|
3079
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
3080
|
+
/* @__PURE__ */ jsx("h3", { children: "Your sign-in link" }),
|
|
3081
|
+
/* @__PURE__ */ jsx("p", { children: "In the demo we don’t send emails, so here’s the link we’d have sent you." }),
|
|
3082
|
+
/* @__PURE__ */ jsx(ThemedButtonLink, {
|
|
3083
|
+
variant: "default",
|
|
3084
|
+
size: "md",
|
|
3085
|
+
label: "Sign in to the portal",
|
|
3086
|
+
href: props.url
|
|
3087
|
+
})
|
|
3088
|
+
] });
|
|
3089
|
+
}
|
|
3090
|
+
//#endregion
|
|
3253
3091
|
//#region ../blocks/src/system/runtime/nodes/shared/MagicLinkForm.state.ts
|
|
3254
3092
|
const initialMagicLinkSubmissionState = Object.freeze({ tag: "idle" });
|
|
3255
3093
|
function magicLinkSubmissionReducer(state, action) {
|
|
@@ -3260,6 +3098,14 @@ function magicLinkSubmissionReducer(state, action) {
|
|
|
3260
3098
|
case "submit-succeeded":
|
|
3261
3099
|
if (state.tag !== "submitting") return state;
|
|
3262
3100
|
return { tag: "success" };
|
|
3101
|
+
case "submit-demo-link": return state.tag === "submitting" ? {
|
|
3102
|
+
tag: "demo_link",
|
|
3103
|
+
url: action.url
|
|
3104
|
+
} : state;
|
|
3105
|
+
case "submit-demo-refused": return state.tag === "submitting" ? {
|
|
3106
|
+
tag: "demo_refused",
|
|
3107
|
+
message: action.message
|
|
3108
|
+
} : state;
|
|
3263
3109
|
case "submit-failed":
|
|
3264
3110
|
if (state.tag !== "submitting") return state;
|
|
3265
3111
|
return {
|
|
@@ -3278,110 +3124,168 @@ function getMagicLinkError(state) {
|
|
|
3278
3124
|
}
|
|
3279
3125
|
//#endregion
|
|
3280
3126
|
//#region ../blocks/src/system/runtime/nodes/shared/MagicLinkForm.tsx
|
|
3281
|
-
function
|
|
3282
|
-
return props.themed ? /* @__PURE__ */ jsx(ThemedButton, {
|
|
3283
|
-
type: props.type,
|
|
3284
|
-
variant: props.variant,
|
|
3285
|
-
size: "md",
|
|
3286
|
-
label: props.label,
|
|
3287
|
-
disabled: props.disabled,
|
|
3288
|
-
onClick: props.onClick
|
|
3289
|
-
}) : /* @__PURE__ */ jsx("button", {
|
|
3290
|
-
type: props.type,
|
|
3291
|
-
className: props.className,
|
|
3292
|
-
disabled: props.disabled,
|
|
3293
|
-
onClick: props.onClick,
|
|
3294
|
-
children: props.label
|
|
3295
|
-
});
|
|
3296
|
-
}
|
|
3297
|
-
/**
|
|
3298
|
-
* Reusable magic link login form.
|
|
3299
|
-
* Used by Customer Portal and Event Registration blocks.
|
|
3300
|
-
*/
|
|
3301
|
-
function MagicLinkForm({ initialEmail = "", title, subtitle, buttonText = "Send login link", successMessage = "Check your email for a login link to sign in.", onSuccess, classPrefix = "er", compact = false }) {
|
|
3127
|
+
function MagicLinkForm(props) {
|
|
3302
3128
|
const api = useBlockApi();
|
|
3303
|
-
const [email, setEmail] = useState(initialEmail);
|
|
3304
|
-
const [
|
|
3305
|
-
const loading = isMagicLinkSubmitting(
|
|
3306
|
-
const
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
email: normalizedEmail,
|
|
3316
|
-
redirectUrl: `${window.location.origin}/api/portal/callback?redirect_to=${encodeURIComponent(redirectTo)}`
|
|
3317
|
-
});
|
|
3318
|
-
dispatchSubmission({ type: "submit-succeeded" });
|
|
3319
|
-
onSuccess?.();
|
|
3320
|
-
} catch (err) {
|
|
3321
|
-
console.error("Magic link error:", err);
|
|
3322
|
-
dispatchSubmission({
|
|
3323
|
-
type: "submit-failed",
|
|
3324
|
-
message: getMagicLinkErrorMessage(err)
|
|
3325
|
-
});
|
|
3326
|
-
}
|
|
3327
|
-
};
|
|
3328
|
-
const handleReset = () => {
|
|
3329
|
-
setEmail("");
|
|
3330
|
-
dispatchSubmission({ type: "reset" });
|
|
3129
|
+
const [email, setEmail] = useState(props.initialEmail ?? "");
|
|
3130
|
+
const [state, dispatch] = useReducer(magicLinkSubmissionReducer, initialMagicLinkSubmissionState);
|
|
3131
|
+
const loading = isMagicLinkSubmitting(state);
|
|
3132
|
+
const handleSubmit = (event) => {
|
|
3133
|
+
submitMagicLink({
|
|
3134
|
+
event,
|
|
3135
|
+
email,
|
|
3136
|
+
loading,
|
|
3137
|
+
api,
|
|
3138
|
+
dispatch,
|
|
3139
|
+
onSuccess: props.onSuccess
|
|
3140
|
+
});
|
|
3331
3141
|
};
|
|
3332
|
-
if (
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
type: "
|
|
3340
|
-
|
|
3341
|
-
className: `${classPrefix}-modal-btn ${classPrefix}-modal-btn--secondary`,
|
|
3342
|
-
label: "Try a different email",
|
|
3343
|
-
onClick: handleReset
|
|
3344
|
-
})]
|
|
3142
|
+
if (state.tag === "success" || state.tag === "demo_link") return /* @__PURE__ */ jsx(MagicLinkSuccess, {
|
|
3143
|
+
state,
|
|
3144
|
+
classPrefix: props.classPrefix ?? "er",
|
|
3145
|
+
compact: props.compact ?? false,
|
|
3146
|
+
successMessage: props.successMessage ?? "Check your email for a login link to sign in.",
|
|
3147
|
+
onReset: () => {
|
|
3148
|
+
setEmail("");
|
|
3149
|
+
dispatch({ type: "reset" });
|
|
3150
|
+
}
|
|
3345
3151
|
});
|
|
3152
|
+
return /* @__PURE__ */ jsx(MagicLinkFormView, {
|
|
3153
|
+
classPrefix: props.classPrefix ?? "er",
|
|
3154
|
+
compact: props.compact ?? false,
|
|
3155
|
+
email,
|
|
3156
|
+
error: getMagicLinkError(state),
|
|
3157
|
+
loading,
|
|
3158
|
+
title: props.title,
|
|
3159
|
+
subtitle: props.subtitle,
|
|
3160
|
+
buttonText: props.buttonText ?? "Send login link",
|
|
3161
|
+
state,
|
|
3162
|
+
onEmailChange: setEmail,
|
|
3163
|
+
onSubmit: handleSubmit
|
|
3164
|
+
});
|
|
3165
|
+
}
|
|
3166
|
+
function MagicLinkFormView(props) {
|
|
3167
|
+
const classPrefix = props.classPrefix;
|
|
3346
3168
|
return /* @__PURE__ */ jsxs("form", {
|
|
3347
|
-
onSubmit:
|
|
3169
|
+
onSubmit: props.onSubmit,
|
|
3348
3170
|
className: `${classPrefix}-magic-link-form`,
|
|
3349
3171
|
children: [
|
|
3350
|
-
title
|
|
3172
|
+
props.title ? /* @__PURE__ */ jsx("h3", {
|
|
3351
3173
|
className: `${classPrefix}-magic-link-title`,
|
|
3352
|
-
children: title
|
|
3353
|
-
}),
|
|
3354
|
-
subtitle
|
|
3174
|
+
children: props.title
|
|
3175
|
+
}) : null,
|
|
3176
|
+
props.subtitle ? /* @__PURE__ */ jsx("p", {
|
|
3355
3177
|
className: `${classPrefix}-portal-auth-text`,
|
|
3356
|
-
children: subtitle
|
|
3357
|
-
}),
|
|
3178
|
+
children: props.subtitle
|
|
3179
|
+
}) : null,
|
|
3358
3180
|
/* @__PURE__ */ jsx("input", {
|
|
3359
3181
|
type: "email",
|
|
3360
3182
|
className: classPrefix === "cp" ? "cp-input" : `${classPrefix}-form__input`,
|
|
3361
3183
|
placeholder: "your@email.com",
|
|
3362
|
-
value: email,
|
|
3363
|
-
onChange: (
|
|
3364
|
-
autoFocus: !compact,
|
|
3184
|
+
value: props.email,
|
|
3185
|
+
onChange: (event) => props.onEmailChange(event.target.value),
|
|
3186
|
+
autoFocus: !props.compact,
|
|
3365
3187
|
required: true,
|
|
3366
|
-
disabled: loading
|
|
3188
|
+
disabled: props.loading
|
|
3367
3189
|
}),
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3190
|
+
/* @__PURE__ */ jsx(MagicLinkFormFeedback, {
|
|
3191
|
+
classPrefix,
|
|
3192
|
+
error: props.error,
|
|
3193
|
+
state: props.state
|
|
3371
3194
|
}),
|
|
3372
3195
|
/* @__PURE__ */ jsx(MagicLinkButton, {
|
|
3373
3196
|
themed: classPrefix === "cp",
|
|
3374
3197
|
type: "submit",
|
|
3375
3198
|
variant: "primary",
|
|
3376
3199
|
className: `${classPrefix}-modal-btn`,
|
|
3377
|
-
label: loading ? "Sending..." : buttonText,
|
|
3378
|
-
disabled: !email.trim() || loading
|
|
3200
|
+
label: props.loading ? "Sending..." : props.buttonText,
|
|
3201
|
+
disabled: !props.email.trim() || props.loading
|
|
3379
3202
|
})
|
|
3380
3203
|
]
|
|
3381
3204
|
});
|
|
3382
3205
|
}
|
|
3206
|
+
function MagicLinkFormFeedback(props) {
|
|
3207
|
+
if (!props.error && props.state.tag !== "demo_refused") return null;
|
|
3208
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [props.error ? /* @__PURE__ */ jsx("p", {
|
|
3209
|
+
className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--error`,
|
|
3210
|
+
children: props.error
|
|
3211
|
+
}) : null, props.state.tag === "demo_refused" ? /* @__PURE__ */ jsx("p", {
|
|
3212
|
+
role: "alert",
|
|
3213
|
+
className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--error`,
|
|
3214
|
+
children: props.state.message
|
|
3215
|
+
}) : null] });
|
|
3216
|
+
}
|
|
3217
|
+
function MagicLinkSuccess(props) {
|
|
3218
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3219
|
+
className: `${props.classPrefix}-magic-link-success`,
|
|
3220
|
+
children: [props.state.tag === "success" ? /* @__PURE__ */ jsx("p", {
|
|
3221
|
+
className: `${props.classPrefix}-portal-auth-text ${props.classPrefix}-portal-auth-text--success`,
|
|
3222
|
+
children: props.successMessage
|
|
3223
|
+
}) : /* @__PURE__ */ jsx(DemoPortalSignInLink, { url: props.state.url }), !props.compact ? /* @__PURE__ */ jsx(MagicLinkButton, {
|
|
3224
|
+
themed: props.classPrefix === "cp",
|
|
3225
|
+
type: "button",
|
|
3226
|
+
variant: "secondary",
|
|
3227
|
+
className: `${props.classPrefix}-modal-btn ${props.classPrefix}-modal-btn--secondary`,
|
|
3228
|
+
label: "Try a different email",
|
|
3229
|
+
onClick: props.onReset
|
|
3230
|
+
}) : null]
|
|
3231
|
+
});
|
|
3232
|
+
}
|
|
3233
|
+
function MagicLinkButton(props) {
|
|
3234
|
+
return props.themed ? /* @__PURE__ */ jsx(ThemedButton, {
|
|
3235
|
+
type: props.type,
|
|
3236
|
+
variant: props.variant,
|
|
3237
|
+
size: "md",
|
|
3238
|
+
label: props.label,
|
|
3239
|
+
disabled: props.disabled,
|
|
3240
|
+
onClick: props.onClick
|
|
3241
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
3242
|
+
type: props.type,
|
|
3243
|
+
className: props.className,
|
|
3244
|
+
disabled: props.disabled,
|
|
3245
|
+
onClick: props.onClick,
|
|
3246
|
+
children: props.label
|
|
3247
|
+
});
|
|
3248
|
+
}
|
|
3249
|
+
async function submitMagicLink(input) {
|
|
3250
|
+
input.event.preventDefault();
|
|
3251
|
+
const email = input.email.trim().toLowerCase();
|
|
3252
|
+
if (!email || input.loading) return;
|
|
3253
|
+
input.dispatch({ type: "submit-started" });
|
|
3254
|
+
try {
|
|
3255
|
+
const result = await requestDemoPortalMagicLink({
|
|
3256
|
+
email,
|
|
3257
|
+
redirectUrl: getMagicLinkRedirectUrl(),
|
|
3258
|
+
send: (request) => input.api.sendMagicLink(request)
|
|
3259
|
+
});
|
|
3260
|
+
input.dispatch(magicLinkActionForResult(result));
|
|
3261
|
+
if (result.kind === "email_sent") input.onSuccess?.();
|
|
3262
|
+
} catch (error) {
|
|
3263
|
+
console.error("Magic link error:", error);
|
|
3264
|
+
input.dispatch({
|
|
3265
|
+
type: "submit-failed",
|
|
3266
|
+
message: getMagicLinkErrorMessage(error)
|
|
3267
|
+
});
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
function magicLinkActionForResult(result) {
|
|
3271
|
+
switch (result.kind) {
|
|
3272
|
+
case "email_sent": return { type: "submit-succeeded" };
|
|
3273
|
+
case "demo_sign_in": return {
|
|
3274
|
+
type: "submit-demo-link",
|
|
3275
|
+
url: result.url
|
|
3276
|
+
};
|
|
3277
|
+
case "refused": return {
|
|
3278
|
+
type: "submit-demo-refused",
|
|
3279
|
+
message: result.message
|
|
3280
|
+
};
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
function getMagicLinkRedirectUrl() {
|
|
3284
|
+
const redirectTo = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
3285
|
+
return buildPortalCallbackUrl(window.location.origin, redirectTo);
|
|
3286
|
+
}
|
|
3383
3287
|
function getMagicLinkErrorMessage(error) {
|
|
3384
|
-
return error instanceof
|
|
3288
|
+
return error instanceof BlockApiError ? error.message : "We couldn’t send the sign-in link. Please try again.";
|
|
3385
3289
|
}
|
|
3386
3290
|
//#endregion
|
|
3387
3291
|
//#region ../blocks/src/system/runtime/nodes/event-registration/ErrorStep.tsx
|
|
@@ -3494,6 +3398,16 @@ function resolveEntitlementSummaryCopy(method, passCreditsRemaining) {
|
|
|
3494
3398
|
function getSummaryRow(option, label) {
|
|
3495
3399
|
return option.summaryRows.find((row) => row.label === label)?.value ?? null;
|
|
3496
3400
|
}
|
|
3401
|
+
function getFlexibleBalanceSummary(option) {
|
|
3402
|
+
if (option?.kind !== "flexible_balance") return null;
|
|
3403
|
+
return {
|
|
3404
|
+
total: getSummaryRow(option, "Total"),
|
|
3405
|
+
dueToday: getSummaryRow(option, "Due today"),
|
|
3406
|
+
remainingBalance: getSummaryRow(option, "Remaining balance"),
|
|
3407
|
+
balanceDueBy: getSummaryRow(option, "Balance due by"),
|
|
3408
|
+
depositPolicy: getSummaryRow(option, "Deposit policy")
|
|
3409
|
+
};
|
|
3410
|
+
}
|
|
3497
3411
|
function getSelectedDirectPaymentOption(input) {
|
|
3498
3412
|
const summaryEvent = input.wizard.selectedEvent ?? input.wizard.preSelectedEvent;
|
|
3499
3413
|
const eligibility = input.wizard.eligibility;
|
|
@@ -3504,7 +3418,8 @@ function getSelectedDirectPaymentOption(input) {
|
|
|
3504
3418
|
paymentTerms: eligibility.paymentTerms,
|
|
3505
3419
|
totalPriceCents: input.totalCents,
|
|
3506
3420
|
currency: input.currency,
|
|
3507
|
-
startsAt: getRegistrationStartAt(summaryEvent, input.wizard.occurrenceContext)
|
|
3421
|
+
startsAt: getRegistrationStartAt(summaryEvent, input.wizard.occurrenceContext),
|
|
3422
|
+
nowIso: input.wizard.nowIso
|
|
3508
3423
|
}).options;
|
|
3509
3424
|
const requestedKind = input.wizard.paymentSelection.collectionOptionKind;
|
|
3510
3425
|
return options.find((option) => option.kind === requestedKind) ?? options.find((option) => option.kind === "upfront") ?? options[0] ?? null;
|
|
@@ -3554,18 +3469,11 @@ function EventRegistrationSummaryBar(props) {
|
|
|
3554
3469
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
3555
3470
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
3556
3471
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
3557
|
-
const
|
|
3472
|
+
const flexibleBalanceSummary = getFlexibleBalanceSummary(getSelectedDirectPaymentOption({
|
|
3558
3473
|
wizard,
|
|
3559
3474
|
totalCents: discountedTotalCents,
|
|
3560
3475
|
currency: summaryCurrency
|
|
3561
|
-
});
|
|
3562
|
-
const flexibleBalanceSummary = selectedDirectPaymentOption?.kind === "flexible_balance" ? {
|
|
3563
|
-
total: getSummaryRow(selectedDirectPaymentOption, "Total"),
|
|
3564
|
-
dueToday: getSummaryRow(selectedDirectPaymentOption, "Due today"),
|
|
3565
|
-
remainingBalance: getSummaryRow(selectedDirectPaymentOption, "Remaining balance"),
|
|
3566
|
-
balanceDueBy: getSummaryRow(selectedDirectPaymentOption, "Balance due by"),
|
|
3567
|
-
depositPolicy: getSummaryRow(selectedDirectPaymentOption, "Deposit policy")
|
|
3568
|
-
} : null;
|
|
3476
|
+
}));
|
|
3569
3477
|
const scheduleSummary = summaryEvent ? getScheduleSummary(wizard, summaryEvent) : null;
|
|
3570
3478
|
const bookingUnit = summaryEvent?.registrationSubject.kind === "wholeSeries" ? "place" : "ticket";
|
|
3571
3479
|
const productMethod = isProductMethod(wizard.paymentSelection.method);
|
|
@@ -3690,19 +3598,19 @@ function isExistingRegistrationBlocking$1(wizard) {
|
|
|
3690
3598
|
}
|
|
3691
3599
|
function resolveTicketSelectionContinueLabel(input) {
|
|
3692
3600
|
if (input.isCheckingExistingRegistration) return "Checking registration...";
|
|
3601
|
+
if (input.ticketTypeSelectionBlocked) return "Choose a ticket";
|
|
3693
3602
|
if (input.registrationOptionsPending) return "Checking availability...";
|
|
3694
3603
|
if (input.registrationOptionsFailed) return "Availability unavailable";
|
|
3695
3604
|
if (input.hasExistingRegistration) return resolveExistingRegistrationLabel(input.wizard);
|
|
3696
|
-
if (input.ticketTypeSelectionBlocked) return "Choose a ticket";
|
|
3697
3605
|
return "Continue";
|
|
3698
3606
|
}
|
|
3699
3607
|
function SelectTicketsActions(props) {
|
|
3700
3608
|
const { wizard } = props;
|
|
3701
|
-
const
|
|
3609
|
+
const ticketTypeSelectionBlocked = wizard.ticketTypeSelectionRequired && !wizard.hasValidTicketSelection;
|
|
3610
|
+
const registrationOptionsPending = !ticketTypeSelectionBlocked && ["idle", "loading"].includes(wizard.registrationOptionsState.tag);
|
|
3702
3611
|
const registrationOptionsFailed = wizard.registrationOptionsState.tag === "failed";
|
|
3703
3612
|
const isCheckingExistingRegistration = wizard.portalAuthState === "authenticated" && wizard.existingRegistrationLoading;
|
|
3704
3613
|
const hasExistingRegistration = isExistingRegistrationBlocking$1(wizard);
|
|
3705
|
-
const ticketTypeSelectionBlocked = wizard.ticketTypeSelectionRequired && !wizard.hasValidTicketSelection;
|
|
3706
3614
|
const isContinueDisabled = registrationOptionsPending || registrationOptionsFailed || isCheckingExistingRegistration || hasExistingRegistration || ticketTypeSelectionBlocked;
|
|
3707
3615
|
const continueLabel = resolveTicketSelectionContinueLabel({
|
|
3708
3616
|
wizard,
|
|
@@ -5011,6 +4919,17 @@ function canContinueWithPaymentSelection(selection, directPaymentSelection) {
|
|
|
5011
4919
|
case null: return false;
|
|
5012
4920
|
}
|
|
5013
4921
|
}
|
|
4922
|
+
function buildEventDirectPaymentOptions(input) {
|
|
4923
|
+
return buildEventRegistrationPaymentOptionsViewModel({
|
|
4924
|
+
eventTitle: input.event?.title ?? "Event",
|
|
4925
|
+
approvedPaymentOptions: input.eligibility.paymentOptions,
|
|
4926
|
+
paymentTerms: input.eligibility.paymentTerms,
|
|
4927
|
+
totalPriceCents: input.totalPriceCents,
|
|
4928
|
+
currency: input.eligibility.currency,
|
|
4929
|
+
startsAt: getRegistrationStartAt(input.event, input.occurrenceContext),
|
|
4930
|
+
nowIso: input.nowIso
|
|
4931
|
+
}).options;
|
|
4932
|
+
}
|
|
5014
4933
|
/**
|
|
5015
4934
|
* Payment Selection Step
|
|
5016
4935
|
*
|
|
@@ -5018,19 +4937,18 @@ function canContinueWithPaymentSelection(selection, directPaymentSelection) {
|
|
|
5018
4937
|
* Fetches eligible passes/memberships using the user's email.
|
|
5019
4938
|
* Also shows available passes/memberships for purchase (upsell).
|
|
5020
4939
|
*/
|
|
5021
|
-
const PaymentSelectionStep = ({ event, occurrenceContext, ticketsCount, email, isAuthenticated = false, creditState = { kind: "not_authenticated" }, directPaymentTotalCents, manualDiscountPending = false, selectedSelection, onSelectionChange, eligibility, eligibilityLoading, eligibilityError = null, onRequestLogin, onStateChange }) => {
|
|
4940
|
+
const PaymentSelectionStep = ({ event, occurrenceContext, ticketsCount, email, isAuthenticated = false, creditState = { kind: "not_authenticated" }, directPaymentTotalCents, manualDiscountPending = false, selectedSelection, onSelectionChange, eligibility, eligibilityLoading, eligibilityError = null, onRequestLogin, onStateChange, nowIso }) => {
|
|
5022
4941
|
const occurrenceId = occurrenceContext?.id ?? (event?.registrationSubject.kind === "occurrence" ? event.registrationSubject.occurrenceId : "");
|
|
5023
4942
|
const selectedMethod = selectedSelection.method;
|
|
5024
4943
|
const totalPrice = directPaymentTotalCents;
|
|
5025
4944
|
const canShowDirectPaymentOptions = Boolean(eligibility?.requiresPayment && eligibility.price);
|
|
5026
|
-
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ?
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
4945
|
+
const directPaymentOptions = eligibility && canShowDirectPaymentOptions ? buildEventDirectPaymentOptions({
|
|
4946
|
+
event,
|
|
4947
|
+
occurrenceContext,
|
|
4948
|
+
eligibility,
|
|
5030
4949
|
totalPriceCents: totalPrice,
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
}).options : [];
|
|
4950
|
+
nowIso
|
|
4951
|
+
}) : [];
|
|
5034
4952
|
const directPaymentSelectionState = resolveEventRegistrationDirectPaymentSelection({
|
|
5035
4953
|
options: directPaymentOptions,
|
|
5036
4954
|
selection: selectedSelection
|
|
@@ -5263,6 +5181,22 @@ function AttendeeDetailsContent(props) {
|
|
|
5263
5181
|
})
|
|
5264
5182
|
] });
|
|
5265
5183
|
}
|
|
5184
|
+
function EventDiscountCodeDisclosure(props) {
|
|
5185
|
+
const { wizard } = props;
|
|
5186
|
+
if (wizard.discountsAvailableLoading || !wizard.shouldShowDiscountToggle) return null;
|
|
5187
|
+
return /* @__PURE__ */ jsx(DiscountCodeDisclosure, {
|
|
5188
|
+
surface: "event-registration",
|
|
5189
|
+
isOpen: wizard.discountUiOpen,
|
|
5190
|
+
code: wizard.discountCode,
|
|
5191
|
+
onOpen: () => wizard.setDiscountUiOpen(true),
|
|
5192
|
+
onChange: wizard.setDiscountCode,
|
|
5193
|
+
onRemove: () => {
|
|
5194
|
+
wizard.setDiscountCode("");
|
|
5195
|
+
wizard.setDiscountUiOpen(false);
|
|
5196
|
+
},
|
|
5197
|
+
id: "er-discount-code"
|
|
5198
|
+
});
|
|
5199
|
+
}
|
|
5266
5200
|
function PaymentSelectionContent(props) {
|
|
5267
5201
|
const { wizard } = props;
|
|
5268
5202
|
const subtotalCents = wizard.ticketSelectionSubtotalCents;
|
|
@@ -5296,19 +5230,9 @@ function PaymentSelectionContent(props) {
|
|
|
5296
5230
|
eligibilityLoading: wizard.eligibilityLoading,
|
|
5297
5231
|
eligibilityError: wizard.eligibilityError,
|
|
5298
5232
|
onRequestLogin: () => wizard.setShowMagicLinkModal(true),
|
|
5299
|
-
onStateChange: wizard.handlePaymentStepStateChange
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
isOpen: wizard.discountUiOpen,
|
|
5303
|
-
code: wizard.discountCode,
|
|
5304
|
-
onOpen: () => wizard.setDiscountUiOpen(true),
|
|
5305
|
-
onChange: wizard.setDiscountCode,
|
|
5306
|
-
onRemove: () => {
|
|
5307
|
-
wizard.setDiscountCode("");
|
|
5308
|
-
wizard.setDiscountUiOpen(false);
|
|
5309
|
-
},
|
|
5310
|
-
id: "er-discount-code"
|
|
5311
|
-
}) : null] });
|
|
5233
|
+
onStateChange: wizard.handlePaymentStepStateChange,
|
|
5234
|
+
nowIso: wizard.nowIso
|
|
5235
|
+
}), /* @__PURE__ */ jsx(EventDiscountCodeDisclosure, { wizard })] });
|
|
5312
5236
|
}
|
|
5313
5237
|
function EventRegistrationWizardContent(props) {
|
|
5314
5238
|
const { wizard } = props;
|
|
@@ -5490,8 +5414,8 @@ function StepIndicator(props) {
|
|
|
5490
5414
|
*
|
|
5491
5415
|
* Displays registration confirmation with a success icon and message.
|
|
5492
5416
|
*/
|
|
5493
|
-
const SuccessStep = ({ title,
|
|
5494
|
-
return /* @__PURE__ */ jsx(TerminalPanel, {
|
|
5417
|
+
const SuccessStep = ({ title, copy, variant = "success", mailingListSignupNote, context = "booking", demoEmailSuppressed = false, customerEmail }) => {
|
|
5418
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(TerminalPanel, {
|
|
5495
5419
|
tone: variant === "info" ? "info" : "success",
|
|
5496
5420
|
className: "er-center",
|
|
5497
5421
|
iconClassName: "er-icon",
|
|
@@ -5531,12 +5455,18 @@ const SuccessStep = ({ title, message, variant = "success", mailingListSignupNot
|
|
|
5531
5455
|
})
|
|
5532
5456
|
}),
|
|
5533
5457
|
title: title ?? (variant === "info" ? "Already Registered" : "Registration Confirmed!"),
|
|
5534
|
-
body:
|
|
5458
|
+
body: /* @__PURE__ */ jsx(BookingConfirmation, {
|
|
5459
|
+
demoEmailSuppressed,
|
|
5460
|
+
email: customerEmail,
|
|
5461
|
+
copy,
|
|
5462
|
+
messagePresentation: { kind: "plain" },
|
|
5463
|
+
noteClassName: "er-text--muted"
|
|
5464
|
+
}),
|
|
5535
5465
|
secondaryBody: mailingListSignupNote ? /* @__PURE__ */ jsx(BookingMailingListNote, {
|
|
5536
5466
|
note: mailingListSignupNote,
|
|
5537
5467
|
context
|
|
5538
5468
|
}) : void 0
|
|
5539
|
-
});
|
|
5469
|
+
}) });
|
|
5540
5470
|
};
|
|
5541
5471
|
//#endregion
|
|
5542
5472
|
//#region ../blocks/src/system/runtime/nodes/event-registration/VerifyingPaymentStep.tsx
|
|
@@ -5708,7 +5638,8 @@ function EventRegistrationTerminalState(props) {
|
|
|
5708
5638
|
}) : null;
|
|
5709
5639
|
case "success": return /* @__PURE__ */ jsx(EventRegistrationSuccess, {
|
|
5710
5640
|
wizard,
|
|
5711
|
-
fallbackMessage: props.successMessage
|
|
5641
|
+
fallbackMessage: props.successMessage,
|
|
5642
|
+
demoEmailSuppressed: props.demoEmailSuppressed
|
|
5712
5643
|
});
|
|
5713
5644
|
case "error": return /* @__PURE__ */ jsx(ErrorStep, {
|
|
5714
5645
|
message: wizard.errorMessage,
|
|
@@ -5725,12 +5656,15 @@ function EventRegistrationTerminalState(props) {
|
|
|
5725
5656
|
function EventRegistrationSuccess(props) {
|
|
5726
5657
|
const result = props.wizard.registrationResult;
|
|
5727
5658
|
if (!result) return null;
|
|
5659
|
+
const copy = getRegistrationSuccessCopy(result, props.fallbackMessage);
|
|
5728
5660
|
return /* @__PURE__ */ jsx(SuccessStep, {
|
|
5729
5661
|
title: result.title,
|
|
5730
5662
|
variant: result.variant,
|
|
5731
|
-
|
|
5663
|
+
copy,
|
|
5732
5664
|
mailingListSignupNote: result.mailingListSignupNote,
|
|
5733
|
-
context: result.status === "waitlist" ? "waitlist" : "booking"
|
|
5665
|
+
context: result.status === "waitlist" ? "waitlist" : "booking",
|
|
5666
|
+
demoEmailSuppressed: props.demoEmailSuppressed,
|
|
5667
|
+
customerEmail: props.wizard.formData.email
|
|
5734
5668
|
});
|
|
5735
5669
|
}
|
|
5736
5670
|
function EventRegistrationSurface(props) {
|
|
@@ -5778,109 +5712,12 @@ function EventRegistrationSurface(props) {
|
|
|
5778
5712
|
}), /* @__PURE__ */ jsx(EventRegistrationTerminalState, {
|
|
5779
5713
|
wizard,
|
|
5780
5714
|
supportEmail: props.supportEmail,
|
|
5781
|
-
successMessage: props.successMessage
|
|
5715
|
+
successMessage: props.successMessage,
|
|
5716
|
+
demoEmailSuppressed: props.demoEmailSuppressed
|
|
5782
5717
|
})]
|
|
5783
5718
|
});
|
|
5784
5719
|
}
|
|
5785
5720
|
//#endregion
|
|
5786
|
-
//#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationBookingLayer.tsx
|
|
5787
|
-
function BookingEntry(props) {
|
|
5788
|
-
const base = props.variant === "teaser" ? "er-booking-teaser" : "er-booking-bar";
|
|
5789
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
5790
|
-
className: `${base}__info`,
|
|
5791
|
-
children: [
|
|
5792
|
-
/* @__PURE__ */ jsx("span", {
|
|
5793
|
-
className: `${base}__title`,
|
|
5794
|
-
children: "Book this event"
|
|
5795
|
-
}),
|
|
5796
|
-
props.summary && /* @__PURE__ */ jsx("span", {
|
|
5797
|
-
className: `${base}__meta`,
|
|
5798
|
-
children: props.summary
|
|
5799
|
-
}),
|
|
5800
|
-
props.variant === "teaser" && props.ticketCurrency && props.ticketTypes.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
5801
|
-
className: "er-booking-teaser__tickets",
|
|
5802
|
-
children: props.ticketTypes.map((ticketType) => /* @__PURE__ */ jsxs("div", {
|
|
5803
|
-
className: "er-booking-teaser__ticket",
|
|
5804
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
5805
|
-
className: "er-booking-teaser__ticket-name",
|
|
5806
|
-
children: ticketType.name
|
|
5807
|
-
}), /* @__PURE__ */ jsx("strong", { children: props.formatTicketPrice(ticketType) })]
|
|
5808
|
-
}, ticketType.pricingOptionId))
|
|
5809
|
-
}) : null
|
|
5810
|
-
]
|
|
5811
|
-
}), /* @__PURE__ */ jsx(ThemedButton, {
|
|
5812
|
-
type: "button",
|
|
5813
|
-
variant: props.buttonVariant,
|
|
5814
|
-
size: "md",
|
|
5815
|
-
extraClassName: `${base}__cta`,
|
|
5816
|
-
label: "Book now",
|
|
5817
|
-
onClick: props.onOpen
|
|
5818
|
-
})] });
|
|
5819
|
-
}
|
|
5820
|
-
function EventRegistrationBookingLayer(props) {
|
|
5821
|
-
const entryProps = {
|
|
5822
|
-
summary: [props.priceLabel, props.availabilityLabel].filter(Boolean).join(" · "),
|
|
5823
|
-
ticketTypes: props.ticketTypes,
|
|
5824
|
-
ticketCurrency: props.ticketCurrency,
|
|
5825
|
-
buttonVariant: props.buttonVariant,
|
|
5826
|
-
formatTicketPrice: props.formatTicketPrice,
|
|
5827
|
-
onOpen: props.onOpen
|
|
5828
|
-
};
|
|
5829
|
-
const floatingBar = !props.overlayOpen && props.isWizardStep ? /* @__PURE__ */ jsx("div", {
|
|
5830
|
-
className: "er-booking-bar",
|
|
5831
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
5832
|
-
className: "er-booking-bar__inner",
|
|
5833
|
-
children: /* @__PURE__ */ jsx(BookingEntry, {
|
|
5834
|
-
...entryProps,
|
|
5835
|
-
variant: "bar"
|
|
5836
|
-
})
|
|
5837
|
-
})
|
|
5838
|
-
}) : null;
|
|
5839
|
-
const floatingLayer = props.portalRoot ? createPortal(/* @__PURE__ */ jsx("div", {
|
|
5840
|
-
className: props.registrationRootClassName,
|
|
5841
|
-
"data-block": "event-registration",
|
|
5842
|
-
children: floatingBar
|
|
5843
|
-
}), props.portalRoot) : floatingBar;
|
|
5844
|
-
const overlayLayer = props.overlayOpen ? /* @__PURE__ */ jsx(ModalShell, {
|
|
5845
|
-
title: "Book this event",
|
|
5846
|
-
titleId: "event-registration-booking-title",
|
|
5847
|
-
onClose: props.onClose,
|
|
5848
|
-
portal: props.portalRoot != null,
|
|
5849
|
-
portalRoot: props.portalRoot,
|
|
5850
|
-
portalWrapperClassName: props.registrationRootClassName,
|
|
5851
|
-
portalWrapperProps: { "data-block": "event-registration" },
|
|
5852
|
-
overlayClassName: "er-booking-overlay",
|
|
5853
|
-
modalClassName: "er-booking-overlay__panel",
|
|
5854
|
-
renderHeader: ({ closeButtonRef, onClose, title, titleId }) => /* @__PURE__ */ jsxs("div", {
|
|
5855
|
-
className: "er-booking-overlay__header",
|
|
5856
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
5857
|
-
className: "er-booking-overlay__title",
|
|
5858
|
-
id: titleId,
|
|
5859
|
-
children: title
|
|
5860
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
5861
|
-
ref: closeButtonRef,
|
|
5862
|
-
type: "button",
|
|
5863
|
-
className: "er-booking-overlay__close",
|
|
5864
|
-
onClick: onClose,
|
|
5865
|
-
"aria-label": "Close booking",
|
|
5866
|
-
children: "×"
|
|
5867
|
-
})]
|
|
5868
|
-
}),
|
|
5869
|
-
children: props.overlaySurface
|
|
5870
|
-
}) : null;
|
|
5871
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5872
|
-
props.isWizardStep && /* @__PURE__ */ jsx("div", {
|
|
5873
|
-
className: "er-booking-teaser",
|
|
5874
|
-
children: /* @__PURE__ */ jsx(BookingEntry, {
|
|
5875
|
-
...entryProps,
|
|
5876
|
-
variant: "teaser"
|
|
5877
|
-
})
|
|
5878
|
-
}),
|
|
5879
|
-
floatingLayer,
|
|
5880
|
-
overlayLayer
|
|
5881
|
-
] });
|
|
5882
|
-
}
|
|
5883
|
-
//#endregion
|
|
5884
5721
|
//#region ../blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizard.tsx
|
|
5885
5722
|
const EVENT_PORTAL_AUTH_COPY = {
|
|
5886
5723
|
membership: {
|
|
@@ -5893,6 +5730,16 @@ const EVENT_PORTAL_AUTH_COPY = {
|
|
|
5893
5730
|
buttonText: "Email me a login link to continue →"
|
|
5894
5731
|
}
|
|
5895
5732
|
};
|
|
5733
|
+
function getPortalAuthCopy(waitlistClaimRequiresPortalLogin, loginMessage, demoEmailSuppressed) {
|
|
5734
|
+
const defaultCopy = waitlistClaimRequiresPortalLogin ? {
|
|
5735
|
+
...EVENT_PORTAL_AUTH_COPY["waitlist-claim"],
|
|
5736
|
+
description: loginMessage ?? "Log in to continue with your waitlist claim."
|
|
5737
|
+
} : EVENT_PORTAL_AUTH_COPY.membership;
|
|
5738
|
+
return demoEmailSuppressed && !waitlistClaimRequiresPortalLogin ? {
|
|
5739
|
+
...defaultCopy,
|
|
5740
|
+
buttonText: "Get a sign-in link →"
|
|
5741
|
+
} : defaultCopy;
|
|
5742
|
+
}
|
|
5896
5743
|
function getActiveTicketTypes(event) {
|
|
5897
5744
|
return event?.pricing.kind === "tiered" ? event.pricing.options.filter((ticketType) => ticketType.isActive).sort((left, right) => left.sortOrder - right.sortOrder).map(({ id, ...ticketType }) => ({
|
|
5898
5745
|
...ticketType,
|
|
@@ -5940,11 +5787,18 @@ function useConfiguredEventRegistrationWizard(props) {
|
|
|
5940
5787
|
});
|
|
5941
5788
|
}
|
|
5942
5789
|
function EventRegistrationWizard(props) {
|
|
5943
|
-
const
|
|
5790
|
+
const wizard = useConfiguredEventRegistrationWizard(props);
|
|
5791
|
+
return /* @__PURE__ */ jsx(EventRegistrationWizardView, {
|
|
5792
|
+
...props,
|
|
5793
|
+
wizard
|
|
5794
|
+
});
|
|
5795
|
+
}
|
|
5796
|
+
function EventRegistrationWizardView(viewProps) {
|
|
5797
|
+
const { wizard, ...props } = viewProps;
|
|
5798
|
+
const { showVenue = true, showCapacity = true, successMessage, buttonText = "Complete Registration", buttonVariant = "primary", className, spamProtectionEnabled, supportEmail } = props;
|
|
5944
5799
|
const showSpamProtection = spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
5945
5800
|
const registrationRootClassName = `event-registration ${className || ""}`;
|
|
5946
5801
|
const registrationRootRef = React.useRef(null);
|
|
5947
|
-
const wizard = useConfiguredEventRegistrationWizard(props);
|
|
5948
5802
|
useEventCheckoutHandoffRestore(wizard.step === "redirecting");
|
|
5949
5803
|
const [bookingOverlayOpen, setBookingOverlayOpen] = useState(false);
|
|
5950
5804
|
const [floatingPortalRoot, setFloatingPortalRoot] = useState(null);
|
|
@@ -6010,10 +5864,7 @@ function EventRegistrationWizard(props) {
|
|
|
6010
5864
|
const summaryPriceLabel = summaryEvent ? formatEventPriceDisplay(summaryEvent.pricing) : null;
|
|
6011
5865
|
const summaryAvailabilityLabel = getAvailabilityLabel(summaryEvent, wizard.selectedAttendanceMode);
|
|
6012
5866
|
const waitlistClaimRequiresPortalLogin = wizard.waitlistClaim.requiresPortalLogin && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking";
|
|
6013
|
-
const portalAuthCopy = waitlistClaimRequiresPortalLogin
|
|
6014
|
-
...EVENT_PORTAL_AUTH_COPY["waitlist-claim"],
|
|
6015
|
-
description: wizard.waitlistClaim.loginMessage ?? "Log in to continue with your waitlist claim."
|
|
6016
|
-
} : EVENT_PORTAL_AUTH_COPY.membership;
|
|
5867
|
+
const portalAuthCopy = getPortalAuthCopy(waitlistClaimRequiresPortalLogin, wizard.waitlistClaim.loginMessage, props.demoEmailSuppressed);
|
|
6017
5868
|
const showPortalAuthPrompt = waitlistClaimRequiresPortalLogin || wizard.step === "select-tickets" && wizard.portalAuthState !== "authenticated" && wizard.portalAuthState !== "checking" && summaryEventPricingType !== "free";
|
|
6018
5869
|
const renderRegistrationSurface = (variant) => /* @__PURE__ */ jsx(EventRegistrationSurface, {
|
|
6019
5870
|
variant,
|
|
@@ -6030,7 +5881,8 @@ function EventRegistrationWizard(props) {
|
|
|
6030
5881
|
buttonText,
|
|
6031
5882
|
buttonVariant,
|
|
6032
5883
|
supportEmail,
|
|
6033
|
-
successMessage
|
|
5884
|
+
successMessage,
|
|
5885
|
+
demoEmailSuppressed: props.demoEmailSuppressed
|
|
6034
5886
|
});
|
|
6035
5887
|
const isEmbedded = (className ?? "").includes("event-registration--embedded");
|
|
6036
5888
|
const overlayEnabled = props.overlayEnabled === true;
|