@riverbankcms/sdk 0.89.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -4
- package/dist/{PreviewEditorSidebar-JDR64FEC.mjs → PreviewEditorSidebar-KVXNF3VW.mjs} +3 -3
- package/dist/{PreviewEditorUI-67TMJMAF.mjs → PreviewEditorUI-J3JN5Z7T.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-UBL6MSNP.mjs +8 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +216 -0
- package/dist/_dts/altcha/src/AltchaWidget.d.ts +1 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +2 -0
- package/dist/_dts/api/src/bookingRecords.d.ts +4 -2
- package/dist/_dts/api/src/bookings.d.ts +3 -1
- package/dist/_dts/api/src/index.d.ts +6 -5
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +15 -5
- package/dist/_dts/api/src/request.d.ts +21 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +3 -1
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/types.d.ts +3 -1
- package/dist/_dts/api/src/url.d.ts +6 -3
- package/dist/_dts/block-form/src/utils/visibleWhen.d.ts +1 -0
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailCard.d.ts +5 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/RepeaterThumbnailGrid.d.ts +9 -1
- package/dist/_dts/block-form/src/widgets/RepeaterField/components/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +7 -11
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +6 -0
- package/dist/_dts/blocks/src/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +14 -6
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +4 -4
- package/dist/_dts/blocks/src/system/blocks/hero.d.ts +0 -2
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +3 -3
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +8 -0
- package/dist/_dts/blocks/src/system/constants/events.d.ts +4 -1
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +17 -5
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +51 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/course-registration/useCourseRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/logic.d.ts +1 -17
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.client.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details.server.d.ts +5 -9
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.d.ts +4 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.d.ts +50 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCalendar.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/EventCombined.interactive.d.ts +11 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/calendarViewOptions.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventProductEligibility.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shared/contract-schemas.d.ts +5 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/shop-checkout-form.d.ts +2 -2
- package/dist/_dts/content-model/src/entry-slots/index.d.ts +1 -0
- package/dist/_dts/content-model/src/entry-slots/sdkBlocks.d.ts +21 -0
- package/dist/_dts/content-model/src/entry-slots/types.d.ts +7 -0
- package/dist/_dts/core/src/money-input.d.ts +18 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +50 -0
- package/dist/_dts/media-editor/src/MediaEditor.d.ts +2 -1
- package/dist/_dts/media-editor/src/fieldUi.d.ts +6 -0
- package/dist/_dts/media-editor/src/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/PreviewThemedSiteDocument.d.ts +3 -2
- package/dist/_dts/preview-next/src/client/preview/SiteChromeEditableSurface.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/themeRuntime.d.ts +6 -0
- package/dist/_dts/preview-next/src/client/sdk/SdkPreviewMode.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/pull-dated-offering-scope.d.ts +10 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +12 -5
- package/dist/_dts/sdk/src/client/management/types.d.ts +6 -55
- package/dist/_dts/sdk/src/components.d.ts +1 -0
- package/dist/_dts/sdk/src/config/field-definitions.d.ts +3 -1
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +3 -1
- package/dist/_dts/sdk/src/next/types.d.ts +8 -11
- package/dist/_dts/sdk/src/preview-next/client/index.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/blocks-theme-scope.d.ts +2 -1
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +8 -7
- package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +5 -6
- package/dist/_dts/sdk/src/rendering/index.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/server.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/themeRuntime.d.ts +26 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/site-commands/src/commands.d.ts +18 -0
- package/dist/_dts/theme-core/src/ResponsiveScope.d.ts +12 -0
- package/dist/_dts/theme-core/src/accordions/types.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/types.d.ts +5 -5
- package/dist/_dts/theme-core/src/cards/types.d.ts +2 -2
- package/dist/_dts/theme-core/src/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +21 -21
- package/dist/_dts/theme-core/src/schema.d.ts +18 -18
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/logoBranding.d.ts +4 -4
- package/dist/_dts/theme-core/src/themeRuntime.d.ts +11 -0
- package/dist/{chunk-HKJQERFR.mjs → chunk-AEOYWPE4.mjs} +91 -55
- package/dist/{chunk-F645A5UV.mjs → chunk-BOQXMCSP.mjs} +129 -101
- package/dist/{chunk-ZQRBLCW5.mjs → chunk-GSPFFUVB.mjs} +2 -2
- package/dist/{chunk-7YUAXONX.mjs → chunk-PMBB6MQ7.mjs} +1280 -774
- package/dist/{chunk-TGBJWKMP.mjs → chunk-RQ3XZ4SJ.mjs} +9 -1
- package/dist/{chunk-7N46MZHI.mjs → chunk-UG7I7S7W.mjs} +1 -1
- package/dist/cli/index.mjs +899 -531
- package/dist/cli/init-docs/content/cli-reference.md +6 -1
- package/dist/cli/init-docs/content/content-management.md +27 -0
- package/dist/client/{accordion-MUCVNGQ7.mjs → accordion-GXQNWQ6O.mjs} +1 -1
- package/dist/client/{bookingForm-PKD6EFIE.mjs → bookingForm-STLUJ36H.mjs} +25 -270
- package/dist/client/bookings.mjs +432 -269
- package/dist/client/{carousel-3TKQSNJC.mjs → carousel-CVRN6EPP.mjs} +1 -1
- package/dist/client/{cart-6XHSZK23.mjs → cart-IYIBA5CL.mjs} +5 -6
- package/dist/client/{checkout-FVSPM6FI.mjs → checkout-O3BGM4GS.mjs} +5 -6
- package/dist/client/chunk-4RTFGHZN.mjs +433 -0
- package/dist/client/{chunk-UQFY4AHX.mjs → chunk-6DPXDOIL.mjs} +65 -28
- package/dist/client/{chunk-ZT5XE7FK.mjs → chunk-D3ETC2SU.mjs} +1 -1
- package/dist/client/{chunk-CQKKFEQD.mjs → chunk-DAS5CIER.mjs} +274 -105
- package/dist/client/{chunk-SDIYSQAY.mjs → chunk-HIHOQGIP.mjs} +2 -3
- package/dist/client/{chunk-ZJZZA5EP.mjs → chunk-MFPKS6QS.mjs} +11 -14
- package/dist/client/{chunk-EY42X22F.mjs → chunk-NBFRJ5NB.mjs} +156 -4
- package/dist/client/{chunk-VGLXACVK.mjs → chunk-VFHZLZAC.mjs} +1 -1
- package/dist/client/{chunk-STJ2NCQM.mjs → chunk-WHZQDPBZ.mjs} +19 -1
- package/dist/client/{chunk-RSQWWUAD.mjs → chunk-Z62JYS5O.mjs} +3 -3
- package/dist/client/client.mjs +3292 -2827
- package/dist/client/{courseRegistration-ATZSYDHM.mjs → courseRegistration-2D3ACMJR.mjs} +18 -56
- package/dist/client/{eventCalendar-6T2UGKKP.mjs → eventCalendar-QY4UZUFF.mjs} +8 -9
- package/dist/client/{eventCombined-Q4VANXVF.mjs → eventCombined-RRCDKJC2.mjs} +8 -9
- package/dist/client/{eventDetails-DW37E7VW.mjs → eventDetails-YO335BUT.mjs} +8 -9
- package/dist/client/{eventListing-XURTSAUW.mjs → eventListing-PXA6GFQ3.mjs} +8 -9
- package/dist/client/{eventRegistration-MRKEVAXW.mjs → eventRegistration-2ZHEDDXO.mjs} +8 -9
- package/dist/client/{form-WZZFFGMU.mjs → form-ZS6KX4U2.mjs} +6 -6
- package/dist/client/{headerSection-EQYVQBLM.mjs → headerSection-QK5SLIIB.mjs} +2 -2
- package/dist/client/hooks.mjs +1084 -1029
- package/dist/client/{locationMap-MFF5VAZR.mjs → locationMap-GFNIUD2X.mjs} +2 -2
- package/dist/client/{newsletterForm-JQ77UYIE.mjs → newsletterForm-PGLTTCUG.mjs} +4 -4
- package/dist/client/{productDetail-25LMT3IZ.mjs → productDetail-OPBE5ZPI.mjs} +5 -6
- package/dist/client/{productList-5ABEMKUG.mjs → productList-NI72Q62Z.mjs} +5 -6
- package/dist/client/rendering/client.mjs +2692 -2285
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +2611 -2156
- package/dist/client/{shop-OMMQZ6YO.mjs → shop-3ZQPEWYI.mjs} +5 -6
- package/dist/client/spam-protection.mjs +4 -5
- package/dist/preview-next/before-render.mjs +2 -2
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/{sdk-runtime-WNLBZ3ZH.mjs → sdk-runtime-FSHXCWDS.mjs} +6 -6
- package/dist/server/components.mjs +1722 -1453
- package/dist/server/config-validation.mjs +1316 -1261
- package/dist/server/config.mjs +1316 -1261
- package/dist/server/data.mjs +1084 -1029
- package/dist/server/index.mjs +135 -100
- package/dist/server/navigation.mjs +20 -30
- package/dist/server/next.mjs +1782 -1500
- package/dist/server/page-converter.mjs +1009 -946
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +1722 -1453
- package/dist/server/rendering.mjs +1728 -1459
- package/dist/server/routing.mjs +1127 -1045
- package/dist/server/server.mjs +1219 -1129
- package/dist/server/theme-bridge.mjs +8 -5
- package/package.json +2 -2
- package/dist/SdkPreviewModeRuntime-ZBEMRV7N.mjs +0 -8
- package/dist/client/chunk-LQFDYWPJ.mjs +0 -184
- package/dist/client/chunk-ZFHRN6W2.mjs +0 -66
package/dist/client/bookings.mjs
CHANGED
|
@@ -3931,6 +3931,24 @@ function useBlockApi() {
|
|
|
3931
3931
|
return client;
|
|
3932
3932
|
}
|
|
3933
3933
|
|
|
3934
|
+
// ../blocks/src/system/runtime/api/types.ts
|
|
3935
|
+
function discountAvailabilityHasDiscounts(availability) {
|
|
3936
|
+
return availability.type !== "none";
|
|
3937
|
+
}
|
|
3938
|
+
function discountAvailabilityAllowsManualEntry(availability) {
|
|
3939
|
+
return "manualCodeEntryAllowed" in availability && availability.manualCodeEntryAllowed;
|
|
3940
|
+
}
|
|
3941
|
+
function getAutoAppliedDiscountPreview(availability) {
|
|
3942
|
+
switch (availability.type) {
|
|
3943
|
+
case "none":
|
|
3944
|
+
case "manual":
|
|
3945
|
+
return null;
|
|
3946
|
+
case "auto":
|
|
3947
|
+
case "auto_and_manual":
|
|
3948
|
+
return availability.autoAppliedDiscount;
|
|
3949
|
+
}
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3934
3952
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
3935
3953
|
function r(e) {
|
|
3936
3954
|
var t, f, n = "";
|
|
@@ -5861,8 +5879,8 @@ function SpinnerNode({
|
|
|
5861
5879
|
}
|
|
5862
5880
|
|
|
5863
5881
|
// ../frontend-state/dist/index.mjs
|
|
5864
|
-
var IDLE_FEEDBACK = idleFeedback();
|
|
5865
|
-
function idleFeedback() {
|
|
5882
|
+
var IDLE_FEEDBACK$2 = idleFeedback$3();
|
|
5883
|
+
function idleFeedback$3() {
|
|
5866
5884
|
return { tag: "idle" };
|
|
5867
5885
|
}
|
|
5868
5886
|
function clearWorkflowFeedback(state) {
|
|
@@ -5887,18 +5905,30 @@ function idleSubmissionFeedback() {
|
|
|
5887
5905
|
return { tag: "idle" };
|
|
5888
5906
|
}
|
|
5889
5907
|
function errorSubmissionFeedback(message) {
|
|
5890
|
-
return {
|
|
5908
|
+
return {
|
|
5909
|
+
tag: "error",
|
|
5910
|
+
message
|
|
5911
|
+
};
|
|
5891
5912
|
}
|
|
5892
5913
|
function successSubmissionFeedback(message) {
|
|
5893
|
-
return {
|
|
5914
|
+
return {
|
|
5915
|
+
tag: "success",
|
|
5916
|
+
message
|
|
5917
|
+
};
|
|
5894
5918
|
}
|
|
5895
|
-
function
|
|
5896
|
-
return {
|
|
5919
|
+
function okWith(data) {
|
|
5920
|
+
return {
|
|
5921
|
+
ok: true,
|
|
5922
|
+
data
|
|
5923
|
+
};
|
|
5897
5924
|
}
|
|
5898
5925
|
function err2(error) {
|
|
5899
|
-
return {
|
|
5926
|
+
return {
|
|
5927
|
+
ok: false,
|
|
5928
|
+
error
|
|
5929
|
+
};
|
|
5900
5930
|
}
|
|
5901
|
-
function
|
|
5931
|
+
function assertNever4(value, message) {
|
|
5902
5932
|
throw new Error(message ?? `Unexpected value: ${String(value)}`);
|
|
5903
5933
|
}
|
|
5904
5934
|
|
|
@@ -6053,7 +6083,7 @@ function deriveBookingFormViewState(input) {
|
|
|
6053
6083
|
resourceName: input.verificationState.resourceName
|
|
6054
6084
|
};
|
|
6055
6085
|
default:
|
|
6056
|
-
return
|
|
6086
|
+
return assertNever4(input.verificationState);
|
|
6057
6087
|
}
|
|
6058
6088
|
}
|
|
6059
6089
|
function resolveBookingSiteId(siteId, form) {
|
|
@@ -6223,7 +6253,7 @@ function getBookingServicePaymentSelectionMode(service) {
|
|
|
6223
6253
|
case "flexible_balance":
|
|
6224
6254
|
return "implicit_flexible_balance";
|
|
6225
6255
|
default:
|
|
6226
|
-
return
|
|
6256
|
+
return assertNever4(onlyKind);
|
|
6227
6257
|
}
|
|
6228
6258
|
}
|
|
6229
6259
|
if (allowedKinds.length === 2 && allowedKinds.includes("upfront") && (allowedKinds.includes("deferred_manual") || allowedKinds.includes("instalment_plan") || allowedKinds.includes("flexible_balance"))) {
|
|
@@ -6425,7 +6455,7 @@ function formatBookingSubmissionPreparationError(error) {
|
|
|
6425
6455
|
case "service-missing-duration":
|
|
6426
6456
|
return `Service "${error.serviceTitle}" is missing duration. Please update the service in the dashboard to include a duration (e.g., 30 minutes).`;
|
|
6427
6457
|
default:
|
|
6428
|
-
return
|
|
6458
|
+
return assertNever4(error);
|
|
6429
6459
|
}
|
|
6430
6460
|
}
|
|
6431
6461
|
function getBookingSuccessMessage(successMessage) {
|
|
@@ -11844,7 +11874,7 @@ function findEventByOccurrenceId(events, occurrenceId) {
|
|
|
11844
11874
|
function findPreSelectedEvent(input) {
|
|
11845
11875
|
const occurrenceContext = input.occurrenceContext;
|
|
11846
11876
|
if (!occurrenceContext) {
|
|
11847
|
-
return null;
|
|
11877
|
+
return input.scopedEvents.length === 1 ? input.scopedEvents[0] ?? null : null;
|
|
11848
11878
|
}
|
|
11849
11879
|
const contextDate = getBookingLocalDateKey(toScheduledBookingDateTime({
|
|
11850
11880
|
startsAt: occurrenceContext.startsAt,
|
|
@@ -11950,11 +11980,10 @@ function FeedbackMessage({
|
|
|
11950
11980
|
}
|
|
11951
11981
|
|
|
11952
11982
|
// ../blocks/src/system/runtime/nodes/booking-form.client.tsx
|
|
11953
|
-
import React3, { useRef as
|
|
11983
|
+
import React3, { useRef as useRef8, useState as useState2 } from "react";
|
|
11954
11984
|
|
|
11955
11985
|
// ../altcha/src/AltchaWidget.tsx
|
|
11956
|
-
import { useEffect, useRef } from "react";
|
|
11957
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
11986
|
+
import { createElement, useEffect, useRef } from "react";
|
|
11958
11987
|
function AltchaWidget({
|
|
11959
11988
|
challengeUrl,
|
|
11960
11989
|
onSolutionChange,
|
|
@@ -11998,7 +12027,7 @@ function AltchaWidget({
|
|
|
11998
12027
|
}
|
|
11999
12028
|
};
|
|
12000
12029
|
}, [challengeUrl, auto, hidelogo, className, onSolutionChange]);
|
|
12001
|
-
return
|
|
12030
|
+
return createElement("div", { ref: containerRef });
|
|
12002
12031
|
}
|
|
12003
12032
|
|
|
12004
12033
|
// ../altcha/src/client.ts
|
|
@@ -12007,13 +12036,13 @@ function isSpamProtectionEnabled() {
|
|
|
12007
12036
|
}
|
|
12008
12037
|
|
|
12009
12038
|
// ../blocks/src/system/runtime/components/booking/SuccessMessage.tsx
|
|
12010
|
-
import { Fragment, jsx as
|
|
12039
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
12011
12040
|
var SuccessMessage = ({
|
|
12012
12041
|
message,
|
|
12013
12042
|
resourceName,
|
|
12014
12043
|
className
|
|
12015
12044
|
}) => {
|
|
12016
|
-
return /* @__PURE__ */
|
|
12045
|
+
return /* @__PURE__ */ jsx4(
|
|
12017
12046
|
FeedbackMessage,
|
|
12018
12047
|
{
|
|
12019
12048
|
tone: "success",
|
|
@@ -12021,7 +12050,7 @@ var SuccessMessage = ({
|
|
|
12021
12050
|
role: "alert",
|
|
12022
12051
|
live: "polite",
|
|
12023
12052
|
children: /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
12024
|
-
/* @__PURE__ */
|
|
12053
|
+
/* @__PURE__ */ jsx4("p", { className: "ab-text", children: message }),
|
|
12025
12054
|
resourceName ? /* @__PURE__ */ jsxs3("p", { className: "ab-text ab-text--muted", children: [
|
|
12026
12055
|
"Practitioner: ",
|
|
12027
12056
|
resourceName
|
|
@@ -12037,9 +12066,9 @@ import React2, {
|
|
|
12037
12066
|
useEffect as useEffect6,
|
|
12038
12067
|
useLayoutEffect,
|
|
12039
12068
|
useMemo as useMemo2,
|
|
12040
|
-
useReducer as
|
|
12041
|
-
useRef as
|
|
12042
|
-
useState
|
|
12069
|
+
useReducer as useReducer5,
|
|
12070
|
+
useRef as useRef6,
|
|
12071
|
+
useState
|
|
12043
12072
|
} from "react";
|
|
12044
12073
|
|
|
12045
12074
|
// ../../node_modules/.pnpm/altcha-lib@1.4.1/node_modules/altcha-lib/dist/helpers.js
|
|
@@ -12240,7 +12269,7 @@ function availableDatesReducer(state, action) {
|
|
|
12240
12269
|
case "load-failed":
|
|
12241
12270
|
return { tag: "error", data: state.data, message: action.message };
|
|
12242
12271
|
default:
|
|
12243
|
-
return
|
|
12272
|
+
return assertNever4(action);
|
|
12244
12273
|
}
|
|
12245
12274
|
}
|
|
12246
12275
|
|
|
@@ -12364,7 +12393,7 @@ function getAvailableSlots(state) {
|
|
|
12364
12393
|
case "error":
|
|
12365
12394
|
return state.slots;
|
|
12366
12395
|
default:
|
|
12367
|
-
return
|
|
12396
|
+
return assertNever4(state);
|
|
12368
12397
|
}
|
|
12369
12398
|
}
|
|
12370
12399
|
function hasLoadedAvailableSlots(state) {
|
|
@@ -12378,7 +12407,7 @@ function hasLoadedAvailableSlots(state) {
|
|
|
12378
12407
|
case "loaded":
|
|
12379
12408
|
return true;
|
|
12380
12409
|
default:
|
|
12381
|
-
return
|
|
12410
|
+
return assertNever4(state);
|
|
12382
12411
|
}
|
|
12383
12412
|
}
|
|
12384
12413
|
function isLoadingAvailableSlots(state) {
|
|
@@ -12412,7 +12441,7 @@ function availableSlotsReducer(state, action) {
|
|
|
12412
12441
|
message: action.message
|
|
12413
12442
|
};
|
|
12414
12443
|
default:
|
|
12415
|
-
return
|
|
12444
|
+
return assertNever4(action);
|
|
12416
12445
|
}
|
|
12417
12446
|
}
|
|
12418
12447
|
|
|
@@ -12521,7 +12550,7 @@ function bookingSubmissionReducer(state, action) {
|
|
|
12521
12550
|
case "feedback-cleared":
|
|
12522
12551
|
return clearWorkflowFeedback(state);
|
|
12523
12552
|
default:
|
|
12524
|
-
return
|
|
12553
|
+
return assertNever4(action);
|
|
12525
12554
|
}
|
|
12526
12555
|
}
|
|
12527
12556
|
function selectIsSubmitting(state) {
|
|
@@ -12565,7 +12594,7 @@ function useBookingSubmission(_siteId) {
|
|
|
12565
12594
|
type: "submission-succeeded",
|
|
12566
12595
|
message: response.type === "checkout_redirect" ? "Redirecting to secure checkout..." : "Booking submitted successfully."
|
|
12567
12596
|
});
|
|
12568
|
-
return
|
|
12597
|
+
return okWith(response);
|
|
12569
12598
|
} catch (error) {
|
|
12570
12599
|
console.error("Booking submission error:", error);
|
|
12571
12600
|
const message = error instanceof Error ? error.message : "Failed to book appointment";
|
|
@@ -12586,65 +12615,157 @@ function useBookingSubmission(_siteId) {
|
|
|
12586
12615
|
}
|
|
12587
12616
|
|
|
12588
12617
|
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.ts
|
|
12589
|
-
import { useEffect as useEffect5,
|
|
12618
|
+
import { useEffect as useEffect5, useReducer as useReducer4, useRef as useRef5 } from "react";
|
|
12619
|
+
|
|
12620
|
+
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.state.ts
|
|
12621
|
+
var initialDiscountCodeUiState = {
|
|
12622
|
+
discountUiOpen: false,
|
|
12623
|
+
discountCode: "",
|
|
12624
|
+
availability: { tag: "disabled" }
|
|
12625
|
+
};
|
|
12626
|
+
function getDiscountContextKey(context) {
|
|
12627
|
+
if (!context) return "disabled";
|
|
12628
|
+
switch (context.type) {
|
|
12629
|
+
case "event":
|
|
12630
|
+
return [
|
|
12631
|
+
context.type,
|
|
12632
|
+
context.eventSeriesId,
|
|
12633
|
+
context.eventCategoryId ?? "",
|
|
12634
|
+
context.ticketsCount ?? ""
|
|
12635
|
+
].join(":");
|
|
12636
|
+
case "appointment":
|
|
12637
|
+
return [context.type, context.serviceId].join(":");
|
|
12638
|
+
case "course":
|
|
12639
|
+
return [context.type, context.courseId].join(":");
|
|
12640
|
+
case "pass":
|
|
12641
|
+
return [context.type, context.passId].join(":");
|
|
12642
|
+
case "membership":
|
|
12643
|
+
return [context.type, context.membershipId].join(":");
|
|
12644
|
+
case "product":
|
|
12645
|
+
return [context.type, context.productId, context.productCategoryId ?? ""].join(":");
|
|
12646
|
+
}
|
|
12647
|
+
}
|
|
12648
|
+
function buildDiscountAvailabilityRequestPlan(options) {
|
|
12649
|
+
if (!options.discountContext) {
|
|
12650
|
+
return { ok: false, key: "disabled" };
|
|
12651
|
+
}
|
|
12652
|
+
const subtotalCents = options.subtotalCents;
|
|
12653
|
+
const key = [
|
|
12654
|
+
getDiscountContextKey(options.discountContext),
|
|
12655
|
+
subtotalCents ?? ""
|
|
12656
|
+
].join("|");
|
|
12657
|
+
return {
|
|
12658
|
+
ok: true,
|
|
12659
|
+
key,
|
|
12660
|
+
request: {
|
|
12661
|
+
context: options.discountContext,
|
|
12662
|
+
...subtotalCents !== void 0 ? { subtotalCents } : {}
|
|
12663
|
+
}
|
|
12664
|
+
};
|
|
12665
|
+
}
|
|
12666
|
+
function discountAvailabilityStateFromResponse(response) {
|
|
12667
|
+
if (!discountAvailabilityHasDiscounts(response)) {
|
|
12668
|
+
return { tag: "unavailable" };
|
|
12669
|
+
}
|
|
12670
|
+
return {
|
|
12671
|
+
tag: "available",
|
|
12672
|
+
manualCodeEntryAllowed: discountAvailabilityAllowsManualEntry(response),
|
|
12673
|
+
autoAppliedDiscount: getAutoAppliedDiscountPreview(response)
|
|
12674
|
+
};
|
|
12675
|
+
}
|
|
12676
|
+
function discountCodeUiReducer(state, event) {
|
|
12677
|
+
switch (event.type) {
|
|
12678
|
+
case "availability-disabled":
|
|
12679
|
+
return initialDiscountCodeUiState;
|
|
12680
|
+
case "availability-loading":
|
|
12681
|
+
return {
|
|
12682
|
+
...state,
|
|
12683
|
+
availability: { tag: "loading" }
|
|
12684
|
+
};
|
|
12685
|
+
case "availability-loaded": {
|
|
12686
|
+
const availability = discountAvailabilityStateFromResponse(event.response);
|
|
12687
|
+
if (availability.tag !== "available" || !availability.manualCodeEntryAllowed) {
|
|
12688
|
+
return {
|
|
12689
|
+
...state,
|
|
12690
|
+
discountUiOpen: false,
|
|
12691
|
+
discountCode: "",
|
|
12692
|
+
availability
|
|
12693
|
+
};
|
|
12694
|
+
}
|
|
12695
|
+
return {
|
|
12696
|
+
...state,
|
|
12697
|
+
availability
|
|
12698
|
+
};
|
|
12699
|
+
}
|
|
12700
|
+
case "availability-failed":
|
|
12701
|
+
return {
|
|
12702
|
+
...state,
|
|
12703
|
+
discountUiOpen: false,
|
|
12704
|
+
discountCode: "",
|
|
12705
|
+
availability: { tag: "error" }
|
|
12706
|
+
};
|
|
12707
|
+
case "discount-code-changed":
|
|
12708
|
+
return {
|
|
12709
|
+
...state,
|
|
12710
|
+
discountCode: event.code
|
|
12711
|
+
};
|
|
12712
|
+
case "discount-ui-open-changed":
|
|
12713
|
+
return {
|
|
12714
|
+
...state,
|
|
12715
|
+
discountUiOpen: event.isOpen
|
|
12716
|
+
};
|
|
12717
|
+
}
|
|
12718
|
+
}
|
|
12719
|
+
|
|
12720
|
+
// ../blocks/src/system/runtime/nodes/event-registration/useDiscountCodeUi.ts
|
|
12721
|
+
function useStableDiscountAvailabilityRequestPlan(options) {
|
|
12722
|
+
const nextPlan = buildDiscountAvailabilityRequestPlan(options);
|
|
12723
|
+
const planRef = useRef5(nextPlan);
|
|
12724
|
+
if (planRef.current.key !== nextPlan.key) {
|
|
12725
|
+
planRef.current = nextPlan;
|
|
12726
|
+
}
|
|
12727
|
+
return planRef.current;
|
|
12728
|
+
}
|
|
12590
12729
|
function useDiscountCodeUi(options) {
|
|
12591
|
-
const [
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
const
|
|
12596
|
-
const [discountsAvailableLoading, setDiscountsAvailableLoading] = useState(false);
|
|
12730
|
+
const [state, dispatch] = useReducer4(
|
|
12731
|
+
discountCodeUiReducer,
|
|
12732
|
+
initialDiscountCodeUiState
|
|
12733
|
+
);
|
|
12734
|
+
const requestPlan = useStableDiscountAvailabilityRequestPlan(options);
|
|
12597
12735
|
useEffect5(() => {
|
|
12598
12736
|
let cancelled = false;
|
|
12599
12737
|
async function checkDiscountAvailability() {
|
|
12600
|
-
if (!
|
|
12601
|
-
|
|
12602
|
-
setManualCodeEntryAllowed(false);
|
|
12603
|
-
setAutoAppliedDiscount(null);
|
|
12604
|
-
setDiscountsAvailableLoading(false);
|
|
12605
|
-
setDiscountUiOpen(false);
|
|
12606
|
-
setDiscountCode("");
|
|
12738
|
+
if (!requestPlan.ok) {
|
|
12739
|
+
dispatch({ type: "availability-disabled" });
|
|
12607
12740
|
return;
|
|
12608
12741
|
}
|
|
12609
|
-
|
|
12742
|
+
dispatch({ type: "availability-loading" });
|
|
12610
12743
|
try {
|
|
12611
|
-
const res = await options.api.getDiscountsAvailable(
|
|
12612
|
-
context: options.discountContext,
|
|
12613
|
-
subtotalCents: options.subtotalCents
|
|
12614
|
-
});
|
|
12744
|
+
const res = await options.api.getDiscountsAvailable(requestPlan.request);
|
|
12615
12745
|
if (cancelled) return;
|
|
12616
|
-
|
|
12617
|
-
setManualCodeEntryAllowed(res.manualCodeEntryAllowed);
|
|
12618
|
-
setAutoAppliedDiscount(res.autoAppliedDiscount);
|
|
12619
|
-
if (!res.hasDiscounts || !res.manualCodeEntryAllowed) {
|
|
12620
|
-
setDiscountUiOpen(false);
|
|
12621
|
-
setDiscountCode("");
|
|
12622
|
-
}
|
|
12746
|
+
dispatch({ type: "availability-loaded", response: res });
|
|
12623
12747
|
} catch {
|
|
12624
12748
|
if (cancelled) return;
|
|
12625
|
-
|
|
12626
|
-
setManualCodeEntryAllowed(false);
|
|
12627
|
-
setAutoAppliedDiscount(null);
|
|
12628
|
-
setDiscountUiOpen(false);
|
|
12629
|
-
setDiscountCode("");
|
|
12630
|
-
} finally {
|
|
12631
|
-
if (!cancelled) setDiscountsAvailableLoading(false);
|
|
12749
|
+
dispatch({ type: "availability-failed" });
|
|
12632
12750
|
}
|
|
12633
12751
|
}
|
|
12634
12752
|
void checkDiscountAvailability();
|
|
12635
12753
|
return () => {
|
|
12636
12754
|
cancelled = true;
|
|
12637
12755
|
};
|
|
12638
|
-
}, [options.api,
|
|
12756
|
+
}, [options.api, requestPlan]);
|
|
12757
|
+
const availability = state.availability;
|
|
12758
|
+
const isAvailable = availability.tag === "available";
|
|
12759
|
+
const manualCodeEntryAllowed = isAvailable ? availability.manualCodeEntryAllowed : false;
|
|
12639
12760
|
return {
|
|
12640
|
-
discountUiOpen,
|
|
12641
|
-
setDiscountUiOpen,
|
|
12642
|
-
discountCode,
|
|
12643
|
-
setDiscountCode,
|
|
12644
|
-
discountsAvailable,
|
|
12761
|
+
discountUiOpen: state.discountUiOpen,
|
|
12762
|
+
setDiscountUiOpen: (isOpen) => dispatch({ type: "discount-ui-open-changed", isOpen }),
|
|
12763
|
+
discountCode: state.discountCode,
|
|
12764
|
+
setDiscountCode: (code) => dispatch({ type: "discount-code-changed", code }),
|
|
12765
|
+
discountsAvailable: isAvailable,
|
|
12645
12766
|
manualCodeEntryAllowed,
|
|
12646
|
-
autoAppliedDiscount,
|
|
12647
|
-
discountsAvailableLoading
|
|
12767
|
+
autoAppliedDiscount: isAvailable ? availability.autoAppliedDiscount : null,
|
|
12768
|
+
discountsAvailableLoading: availability.tag === "loading"
|
|
12648
12769
|
};
|
|
12649
12770
|
}
|
|
12650
12771
|
|
|
@@ -12827,7 +12948,7 @@ function buildBookingPaymentOptionViewModel(input) {
|
|
|
12827
12948
|
};
|
|
12828
12949
|
}
|
|
12829
12950
|
default:
|
|
12830
|
-
return
|
|
12951
|
+
return assertNever4(input.option);
|
|
12831
12952
|
}
|
|
12832
12953
|
}
|
|
12833
12954
|
function buildInstalmentSchedulePreview(input) {
|
|
@@ -12884,7 +13005,7 @@ function buildInstalmentSchedulePreview(input) {
|
|
|
12884
13005
|
})));
|
|
12885
13006
|
}
|
|
12886
13007
|
default:
|
|
12887
|
-
return
|
|
13008
|
+
return assertNever4(input.option.plan);
|
|
12888
13009
|
}
|
|
12889
13010
|
}
|
|
12890
13011
|
function getPaymentCadenceLabel(plan) {
|
|
@@ -13111,7 +13232,7 @@ function bookingFlowReducer(state, event) {
|
|
|
13111
13232
|
case "reset":
|
|
13112
13233
|
return event.initial;
|
|
13113
13234
|
default:
|
|
13114
|
-
return
|
|
13235
|
+
return assertNever4(event);
|
|
13115
13236
|
}
|
|
13116
13237
|
}
|
|
13117
13238
|
function clearAvailabilityFeedback(feedback) {
|
|
@@ -13240,7 +13361,7 @@ function validateBookingStep(input) {
|
|
|
13240
13361
|
return Object.keys(errors).length > 0 ? { ok: false, errors: createFieldBookingValidationErrors(errors) } : { ok: true };
|
|
13241
13362
|
}
|
|
13242
13363
|
default:
|
|
13243
|
-
return
|
|
13364
|
+
return assertNever4(input.stepId);
|
|
13244
13365
|
}
|
|
13245
13366
|
}
|
|
13246
13367
|
function validateBookingFields(input) {
|
|
@@ -13601,7 +13722,7 @@ function resolveAppointmentPackagesModel(input) {
|
|
|
13601
13722
|
};
|
|
13602
13723
|
}
|
|
13603
13724
|
default:
|
|
13604
|
-
return
|
|
13725
|
+
return assertNever4(input.state);
|
|
13605
13726
|
}
|
|
13606
13727
|
}
|
|
13607
13728
|
function toHeadlessEligibleAppointmentPackage(appointmentPackage) {
|
|
@@ -13706,12 +13827,12 @@ function useHeadlessBookingFlow(options) {
|
|
|
13706
13827
|
}),
|
|
13707
13828
|
[defaultResourceId, defaultServiceId, options.initialData]
|
|
13708
13829
|
);
|
|
13709
|
-
const [state, dispatch] =
|
|
13830
|
+
const [state, dispatch] = useReducer5(bookingFlowReducer, initialState);
|
|
13710
13831
|
const api = useBlockApi();
|
|
13711
|
-
const [resourcesState, setResourcesState] =
|
|
13712
|
-
const resourcesRequestIdRef =
|
|
13713
|
-
const [appointmentPackages, setAppointmentPackages] =
|
|
13714
|
-
const appointmentPackagesRequestIdRef =
|
|
13832
|
+
const [resourcesState, setResourcesState] = useState({ tag: "idle" });
|
|
13833
|
+
const resourcesRequestIdRef = useRef6(0);
|
|
13834
|
+
const [appointmentPackages, setAppointmentPackages] = useState({ tag: "idle" });
|
|
13835
|
+
const appointmentPackagesRequestIdRef = useRef6(0);
|
|
13715
13836
|
const selectedServiceId = state.selectedServiceId ?? defaultServiceId;
|
|
13716
13837
|
const selectedResourceId = state.selectedResourceId ?? defaultResourceId;
|
|
13717
13838
|
const selectedService = options.services.find((service) => service.id === selectedServiceId) ?? null;
|
|
@@ -13948,14 +14069,17 @@ function useHeadlessBookingFlow(options) {
|
|
|
13948
14069
|
state.selectedDate,
|
|
13949
14070
|
state.selectedSlot
|
|
13950
14071
|
]);
|
|
13951
|
-
const appointmentDiscountContext =
|
|
14072
|
+
const appointmentDiscountContext = useMemo2(
|
|
14073
|
+
() => selectedService && (selectedService.priceAmount ?? 0) > 0 ? { type: "appointment", serviceId: selectedService.id } : null,
|
|
14074
|
+
[selectedService?.id, selectedService?.priceAmount]
|
|
14075
|
+
);
|
|
13952
14076
|
const discountUi = useDiscountCodeUi({
|
|
13953
14077
|
api,
|
|
13954
14078
|
discountContext: appointmentDiscountContext,
|
|
13955
14079
|
subtotalCents: selectedService?.priceAmount ?? 0
|
|
13956
14080
|
});
|
|
13957
14081
|
const { submit, clearFeedback } = useBookingSubmission(options.siteId);
|
|
13958
|
-
const submittingRef =
|
|
14082
|
+
const submittingRef = useRef6(false);
|
|
13959
14083
|
const latestRef = useLatestRef({
|
|
13960
14084
|
state,
|
|
13961
14085
|
data,
|
|
@@ -14272,7 +14396,7 @@ function resolvePaymentMode(input) {
|
|
|
14272
14396
|
return resolveBookingPaymentStep(input);
|
|
14273
14397
|
}
|
|
14274
14398
|
function useLatestRef(value) {
|
|
14275
|
-
const ref =
|
|
14399
|
+
const ref = useRef6(value);
|
|
14276
14400
|
useLayoutEffect(() => {
|
|
14277
14401
|
ref.current = value;
|
|
14278
14402
|
}, [value]);
|
|
@@ -14283,7 +14407,7 @@ function useLatestRef(value) {
|
|
|
14283
14407
|
import { useMemo as useMemo3 } from "react";
|
|
14284
14408
|
|
|
14285
14409
|
// ../blocks/src/system/runtime/hooks/usePolling.ts
|
|
14286
|
-
import { useEffect as useEffect7, useCallback as useCallback4, useReducer as
|
|
14410
|
+
import { useEffect as useEffect7, useCallback as useCallback4, useReducer as useReducer6, useRef as useRef7 } from "react";
|
|
14287
14411
|
|
|
14288
14412
|
// ../blocks/src/system/runtime/hooks/usePolling.state.ts
|
|
14289
14413
|
function createInitialPollingState() {
|
|
@@ -14340,7 +14464,7 @@ function pollingReducer(state, action) {
|
|
|
14340
14464
|
case "timeout":
|
|
14341
14465
|
return state;
|
|
14342
14466
|
default:
|
|
14343
|
-
return
|
|
14467
|
+
return assertNever4(state);
|
|
14344
14468
|
}
|
|
14345
14469
|
case "polling-timed-out":
|
|
14346
14470
|
return {
|
|
@@ -14349,7 +14473,7 @@ function pollingReducer(state, action) {
|
|
|
14349
14473
|
error: new Error("Polling timed out")
|
|
14350
14474
|
};
|
|
14351
14475
|
default:
|
|
14352
|
-
return
|
|
14476
|
+
return assertNever4(action);
|
|
14353
14477
|
}
|
|
14354
14478
|
}
|
|
14355
14479
|
|
|
@@ -14357,17 +14481,17 @@ function pollingReducer(state, action) {
|
|
|
14357
14481
|
var DEFAULT_MAX_ATTEMPTS = 10;
|
|
14358
14482
|
var DEFAULT_POLL_INTERVAL = 1e3;
|
|
14359
14483
|
function usePolling(config) {
|
|
14360
|
-
const [state, dispatch] =
|
|
14484
|
+
const [state, dispatch] = useReducer6(
|
|
14361
14485
|
pollingReducer,
|
|
14362
14486
|
void 0,
|
|
14363
14487
|
createInitialPollingState
|
|
14364
14488
|
);
|
|
14365
|
-
const attemptsRef =
|
|
14366
|
-
const timeoutRef =
|
|
14367
|
-
const isPollingRef =
|
|
14368
|
-
const isActiveRef =
|
|
14369
|
-
const generationRef =
|
|
14370
|
-
const configRef =
|
|
14489
|
+
const attemptsRef = useRef7(0);
|
|
14490
|
+
const timeoutRef = useRef7(null);
|
|
14491
|
+
const isPollingRef = useRef7(false);
|
|
14492
|
+
const isActiveRef = useRef7(false);
|
|
14493
|
+
const generationRef = useRef7(0);
|
|
14494
|
+
const configRef = useRef7(config);
|
|
14371
14495
|
configRef.current = config;
|
|
14372
14496
|
const cleanup = useCallback4(() => {
|
|
14373
14497
|
isActiveRef.current = false;
|
|
@@ -14491,7 +14615,7 @@ function useAppointmentCheckoutVerification(config) {
|
|
|
14491
14615
|
}
|
|
14492
14616
|
|
|
14493
14617
|
// ../blocks/src/system/runtime/components/booking/DatePicker.tsx
|
|
14494
|
-
import { jsx as
|
|
14618
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
14495
14619
|
var DatePicker = ({
|
|
14496
14620
|
value,
|
|
14497
14621
|
onChange,
|
|
@@ -14506,21 +14630,21 @@ var DatePicker = ({
|
|
|
14506
14630
|
return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
|
|
14507
14631
|
/* @__PURE__ */ jsxs4("label", { className: "ab-label", children: [
|
|
14508
14632
|
"Select Date",
|
|
14509
|
-
required && /* @__PURE__ */
|
|
14633
|
+
required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
|
|
14510
14634
|
] }),
|
|
14511
|
-
/* @__PURE__ */
|
|
14512
|
-
/* @__PURE__ */
|
|
14635
|
+
/* @__PURE__ */ jsx5("div", { className: "ab-skeleton" }),
|
|
14636
|
+
/* @__PURE__ */ jsx5("p", { className: "ab-text ab-text--muted ab-text--sm", children: "Loading available dates..." })
|
|
14513
14637
|
] });
|
|
14514
14638
|
}
|
|
14515
14639
|
if (isEmpty) {
|
|
14516
14640
|
return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
|
|
14517
14641
|
/* @__PURE__ */ jsxs4("label", { className: "ab-label", children: [
|
|
14518
14642
|
"Select Date",
|
|
14519
|
-
required && /* @__PURE__ */
|
|
14643
|
+
required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
|
|
14520
14644
|
] }),
|
|
14521
|
-
/* @__PURE__ */
|
|
14645
|
+
/* @__PURE__ */ jsx5(FeedbackMessage, { tone: "warning", className: "ab-alert ab-alert--warning", role: "status", children: /* @__PURE__ */ jsxs4("p", { className: "ab-text", children: [
|
|
14522
14646
|
"No available dates in this period.",
|
|
14523
|
-
hasMore && onLoadMore && /* @__PURE__ */
|
|
14647
|
+
hasMore && onLoadMore && /* @__PURE__ */ jsx5(
|
|
14524
14648
|
"button",
|
|
14525
14649
|
{
|
|
14526
14650
|
type: "button",
|
|
@@ -14535,7 +14659,7 @@ var DatePicker = ({
|
|
|
14535
14659
|
return /* @__PURE__ */ jsxs4("div", { className: "ab-stack--sm", children: [
|
|
14536
14660
|
/* @__PURE__ */ jsxs4("label", { htmlFor: "booking-date", className: "ab-label", children: [
|
|
14537
14661
|
"Select Date",
|
|
14538
|
-
required && /* @__PURE__ */
|
|
14662
|
+
required && /* @__PURE__ */ jsx5("span", { className: "ab-required", children: "*" })
|
|
14539
14663
|
] }),
|
|
14540
14664
|
/* @__PURE__ */ jsxs4(
|
|
14541
14665
|
"select",
|
|
@@ -14546,12 +14670,12 @@ var DatePicker = ({
|
|
|
14546
14670
|
required,
|
|
14547
14671
|
className: "ab-select",
|
|
14548
14672
|
children: [
|
|
14549
|
-
/* @__PURE__ */
|
|
14550
|
-
dateOptions.map((date) => /* @__PURE__ */
|
|
14673
|
+
/* @__PURE__ */ jsx5("option", { value: "", children: "Choose a date..." }),
|
|
14674
|
+
dateOptions.map((date) => /* @__PURE__ */ jsx5("option", { value: date, children: formatDate(date) }, date))
|
|
14551
14675
|
]
|
|
14552
14676
|
}
|
|
14553
14677
|
),
|
|
14554
|
-
hasMore && onLoadMore && /* @__PURE__ */
|
|
14678
|
+
hasMore && onLoadMore && /* @__PURE__ */ jsx5(
|
|
14555
14679
|
"button",
|
|
14556
14680
|
{
|
|
14557
14681
|
type: "button",
|
|
@@ -14564,7 +14688,7 @@ var DatePicker = ({
|
|
|
14564
14688
|
};
|
|
14565
14689
|
|
|
14566
14690
|
// ../blocks/src/system/runtime/components/booking/TimeSlotSelector.tsx
|
|
14567
|
-
import { jsx as
|
|
14691
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
14568
14692
|
var TimeSlotSelector = ({
|
|
14569
14693
|
value,
|
|
14570
14694
|
onChange,
|
|
@@ -14575,9 +14699,9 @@ var TimeSlotSelector = ({
|
|
|
14575
14699
|
return /* @__PURE__ */ jsxs5("div", { className: "ab-stack--sm", children: [
|
|
14576
14700
|
/* @__PURE__ */ jsxs5("label", { htmlFor: "booking-slot", className: "ab-label", children: [
|
|
14577
14701
|
"Select Time",
|
|
14578
|
-
required && /* @__PURE__ */
|
|
14702
|
+
required && /* @__PURE__ */ jsx6("span", { className: "ab-required", children: "*" })
|
|
14579
14703
|
] }),
|
|
14580
|
-
isLoading ? /* @__PURE__ */
|
|
14704
|
+
isLoading ? /* @__PURE__ */ jsx6(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "Loading available times..." }) : slots.length === 0 ? /* @__PURE__ */ jsx6(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info ab-center", role: "status", children: "No available times for this date" }) : /* @__PURE__ */ jsxs5(
|
|
14581
14705
|
"select",
|
|
14582
14706
|
{
|
|
14583
14707
|
id: "booking-slot",
|
|
@@ -14586,8 +14710,8 @@ var TimeSlotSelector = ({
|
|
|
14586
14710
|
required,
|
|
14587
14711
|
className: "ab-select",
|
|
14588
14712
|
children: [
|
|
14589
|
-
/* @__PURE__ */
|
|
14590
|
-
slots.map((slot) => /* @__PURE__ */
|
|
14713
|
+
/* @__PURE__ */ jsx6("option", { value: "", children: "Choose a time..." }),
|
|
14714
|
+
slots.map((slot) => /* @__PURE__ */ jsx6("option", { value: slot.startAt, children: formatTime(slot.startAt) }, slot.startAt))
|
|
14591
14715
|
]
|
|
14592
14716
|
}
|
|
14593
14717
|
)
|
|
@@ -14596,7 +14720,7 @@ var TimeSlotSelector = ({
|
|
|
14596
14720
|
|
|
14597
14721
|
// ../blocks/src/system/runtime/shared/components/DiscountCodeDisclosure.tsx
|
|
14598
14722
|
import { useId } from "react";
|
|
14599
|
-
import { jsx as
|
|
14723
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
14600
14724
|
var BLOCK_DISCOUNT_CODE_DISCLOSURE_CLASSES = {
|
|
14601
14725
|
"course-registration": {
|
|
14602
14726
|
root: "cr-discount",
|
|
@@ -14672,10 +14796,10 @@ function DiscountCodeDisclosure({
|
|
|
14672
14796
|
onApply();
|
|
14673
14797
|
};
|
|
14674
14798
|
const feedbackClassName = feedback ? `${classes.feedback} status-${feedback.tone}` : classes.feedback;
|
|
14675
|
-
return /* @__PURE__ */
|
|
14676
|
-
/* @__PURE__ */
|
|
14799
|
+
return /* @__PURE__ */ jsx7("div", { className: classes.root, children: !isOpen ? /* @__PURE__ */ jsx7("button", { type: "button", className: classes.toggle, onClick: onOpen, children: toggleLabel }) : /* @__PURE__ */ jsxs6("div", { className: classes.form, children: [
|
|
14800
|
+
/* @__PURE__ */ jsx7("label", { htmlFor: inputId, className: classes.label, children: label }),
|
|
14677
14801
|
/* @__PURE__ */ jsxs6("div", { className: classes.row, children: [
|
|
14678
|
-
/* @__PURE__ */
|
|
14802
|
+
/* @__PURE__ */ jsx7(
|
|
14679
14803
|
"input",
|
|
14680
14804
|
{
|
|
14681
14805
|
id: inputId,
|
|
@@ -14688,7 +14812,7 @@ function DiscountCodeDisclosure({
|
|
|
14688
14812
|
disabled: disabled || isApplying
|
|
14689
14813
|
}
|
|
14690
14814
|
),
|
|
14691
|
-
onApply ? /* @__PURE__ */
|
|
14815
|
+
onApply ? /* @__PURE__ */ jsx7(
|
|
14692
14816
|
"button",
|
|
14693
14817
|
{
|
|
14694
14818
|
type: "button",
|
|
@@ -14698,7 +14822,7 @@ function DiscountCodeDisclosure({
|
|
|
14698
14822
|
children: isApplying ? "Applying..." : applyLabel
|
|
14699
14823
|
}
|
|
14700
14824
|
) : null,
|
|
14701
|
-
/* @__PURE__ */
|
|
14825
|
+
/* @__PURE__ */ jsx7(
|
|
14702
14826
|
"button",
|
|
14703
14827
|
{
|
|
14704
14828
|
type: "button",
|
|
@@ -14709,8 +14833,8 @@ function DiscountCodeDisclosure({
|
|
|
14709
14833
|
}
|
|
14710
14834
|
)
|
|
14711
14835
|
] }),
|
|
14712
|
-
/* @__PURE__ */
|
|
14713
|
-
feedback ? /* @__PURE__ */
|
|
14836
|
+
/* @__PURE__ */ jsx7("p", { className: classes.hint, children: hint }),
|
|
14837
|
+
feedback ? /* @__PURE__ */ jsx7(
|
|
14714
14838
|
"p",
|
|
14715
14839
|
{
|
|
14716
14840
|
className: feedbackClassName,
|
|
@@ -14722,7 +14846,7 @@ function DiscountCodeDisclosure({
|
|
|
14722
14846
|
}
|
|
14723
14847
|
|
|
14724
14848
|
// ../blocks/src/system/runtime/shared/components/FieldValidationMessage.tsx
|
|
14725
|
-
import { jsx as
|
|
14849
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
14726
14850
|
function getFieldValidationControlProps({
|
|
14727
14851
|
message,
|
|
14728
14852
|
messageId,
|
|
@@ -14741,7 +14865,7 @@ function FieldValidationMessage({
|
|
|
14741
14865
|
className,
|
|
14742
14866
|
live = "assertive"
|
|
14743
14867
|
}) {
|
|
14744
|
-
return /* @__PURE__ */
|
|
14868
|
+
return /* @__PURE__ */ jsx8(
|
|
14745
14869
|
"p",
|
|
14746
14870
|
{
|
|
14747
14871
|
id,
|
|
@@ -14756,7 +14880,7 @@ function FieldValidationMessage({
|
|
|
14756
14880
|
}
|
|
14757
14881
|
|
|
14758
14882
|
// ../blocks/src/system/runtime/nodes/booking-form.default-ui.tsx
|
|
14759
|
-
import { Fragment as Fragment2, jsx as
|
|
14883
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
14760
14884
|
var paymentOptionLayoutStyle = {
|
|
14761
14885
|
alignItems: "flex-start",
|
|
14762
14886
|
display: "flex",
|
|
@@ -14785,20 +14909,20 @@ function HeadlessBookingDefaultForm({
|
|
|
14785
14909
|
}
|
|
14786
14910
|
};
|
|
14787
14911
|
if (!currentStep) {
|
|
14788
|
-
return /* @__PURE__ */
|
|
14912
|
+
return /* @__PURE__ */ jsx9("div", { className: "rb-text-center rb-py-12", children: /* @__PURE__ */ jsx9("p", { className: "status-muted", children: "No steps available" }) });
|
|
14789
14913
|
}
|
|
14790
14914
|
return /* @__PURE__ */ jsxs7("div", { className: "multi-step-form", children: [
|
|
14791
|
-
/* @__PURE__ */
|
|
14915
|
+
/* @__PURE__ */ jsx9("div", { className: "rb-mb-8", children: /* @__PURE__ */ jsx9(
|
|
14792
14916
|
DefaultBookingProgress,
|
|
14793
14917
|
{
|
|
14794
14918
|
steps: booking.steps,
|
|
14795
14919
|
currentIndex: currentStepIndex
|
|
14796
14920
|
}
|
|
14797
14921
|
) }),
|
|
14798
|
-
/* @__PURE__ */
|
|
14799
|
-
/* @__PURE__ */
|
|
14922
|
+
/* @__PURE__ */ jsx9("div", { className: "step-content", children: /* @__PURE__ */ jsx9(DefaultBookingStepContent, { booking }) }),
|
|
14923
|
+
/* @__PURE__ */ jsx9(DefaultBookingErrorSummary, { errors: currentStep.errors }),
|
|
14800
14924
|
/* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-gap-3 rb-mt-8", children: [
|
|
14801
|
-
!isFirstStep ? /* @__PURE__ */
|
|
14925
|
+
!isFirstStep ? /* @__PURE__ */ jsx9(
|
|
14802
14926
|
"button",
|
|
14803
14927
|
{
|
|
14804
14928
|
type: "button",
|
|
@@ -14807,7 +14931,7 @@ function HeadlessBookingDefaultForm({
|
|
|
14807
14931
|
children: "Back"
|
|
14808
14932
|
}
|
|
14809
14933
|
) : null,
|
|
14810
|
-
/* @__PURE__ */
|
|
14934
|
+
/* @__PURE__ */ jsx9(
|
|
14811
14935
|
"button",
|
|
14812
14936
|
{
|
|
14813
14937
|
type: "button",
|
|
@@ -14821,7 +14945,7 @@ function HeadlessBookingDefaultForm({
|
|
|
14821
14945
|
extraClassName: "rb-flex-1"
|
|
14822
14946
|
}),
|
|
14823
14947
|
children: isSubmitting ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
14824
|
-
/* @__PURE__ */
|
|
14948
|
+
/* @__PURE__ */ jsx9(
|
|
14825
14949
|
SpinnerNode,
|
|
14826
14950
|
{
|
|
14827
14951
|
size: "sm",
|
|
@@ -14835,22 +14959,22 @@ function HeadlessBookingDefaultForm({
|
|
|
14835
14959
|
}
|
|
14836
14960
|
)
|
|
14837
14961
|
] }),
|
|
14838
|
-
/* @__PURE__ */
|
|
14839
|
-
/* @__PURE__ */
|
|
14840
|
-
/* @__PURE__ */
|
|
14962
|
+
/* @__PURE__ */ jsx9(DefaultBookingDiscount, { booking }),
|
|
14963
|
+
/* @__PURE__ */ jsx9(DefaultBookingFeedback, { booking }),
|
|
14964
|
+
/* @__PURE__ */ jsx9(DefaultBookingAltcha, { booking })
|
|
14841
14965
|
] });
|
|
14842
14966
|
}
|
|
14843
14967
|
function DefaultBookingProgress({
|
|
14844
14968
|
steps,
|
|
14845
14969
|
currentIndex
|
|
14846
14970
|
}) {
|
|
14847
|
-
return /* @__PURE__ */
|
|
14971
|
+
return /* @__PURE__ */ jsx9("div", { className: "rb-flex rb-items-center rb-justify-between", children: steps.map((step, index) => {
|
|
14848
14972
|
const isActive = index === currentIndex;
|
|
14849
14973
|
const isCompleted = index < currentIndex;
|
|
14850
14974
|
const isLast = index === steps.length - 1;
|
|
14851
14975
|
return /* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-items-center rb-flex-1", children: [
|
|
14852
14976
|
/* @__PURE__ */ jsxs7("div", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-default", children: [
|
|
14853
|
-
/* @__PURE__ */
|
|
14977
|
+
/* @__PURE__ */ jsx9(
|
|
14854
14978
|
"div",
|
|
14855
14979
|
{
|
|
14856
14980
|
className: `
|
|
@@ -14861,7 +14985,7 @@ function DefaultBookingProgress({
|
|
|
14861
14985
|
children: isCompleted ? "\u2713" : index + 1
|
|
14862
14986
|
}
|
|
14863
14987
|
),
|
|
14864
|
-
/* @__PURE__ */
|
|
14988
|
+
/* @__PURE__ */ jsx9(
|
|
14865
14989
|
"span",
|
|
14866
14990
|
{
|
|
14867
14991
|
className: `
|
|
@@ -14872,7 +14996,7 @@ function DefaultBookingProgress({
|
|
|
14872
14996
|
}
|
|
14873
14997
|
)
|
|
14874
14998
|
] }),
|
|
14875
|
-
!isLast ? /* @__PURE__ */
|
|
14999
|
+
!isLast ? /* @__PURE__ */ jsx9("div", { className: "step-connector rb-ml-2 rb-mr-2 rb-hidden rb-sm-block" }) : null
|
|
14876
15000
|
] }, step.id);
|
|
14877
15001
|
}) });
|
|
14878
15002
|
}
|
|
@@ -14883,15 +15007,15 @@ function DefaultBookingStepContent({
|
|
|
14883
15007
|
if (!stepId) return null;
|
|
14884
15008
|
switch (stepId) {
|
|
14885
15009
|
case "service-selection":
|
|
14886
|
-
return /* @__PURE__ */
|
|
15010
|
+
return /* @__PURE__ */ jsx9(DefaultServiceSelectionStep, { booking });
|
|
14887
15011
|
case "datetime-selection":
|
|
14888
|
-
return /* @__PURE__ */
|
|
15012
|
+
return /* @__PURE__ */ jsx9(DefaultDateTimeSelectionStep, { booking });
|
|
14889
15013
|
case "payment-selection":
|
|
14890
|
-
return /* @__PURE__ */
|
|
15014
|
+
return /* @__PURE__ */ jsx9(HeadlessBookingPaymentSelectionStep, { booking });
|
|
14891
15015
|
case "custom-fields":
|
|
14892
|
-
return /* @__PURE__ */
|
|
15016
|
+
return /* @__PURE__ */ jsx9(DefaultDynamicFields, { fields: booking.fields.items, booking });
|
|
14893
15017
|
default:
|
|
14894
|
-
return
|
|
15018
|
+
return assertNever4(stepId);
|
|
14895
15019
|
}
|
|
14896
15020
|
}
|
|
14897
15021
|
function DefaultServiceSelectionStep({
|
|
@@ -14906,14 +15030,14 @@ function DefaultServiceSelectionStep({
|
|
|
14906
15030
|
const allowAnyResource = !booking.resources.requiresSelection;
|
|
14907
15031
|
return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
|
|
14908
15032
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
14909
|
-
/* @__PURE__ */
|
|
14910
|
-
/* @__PURE__ */
|
|
15033
|
+
/* @__PURE__ */ jsx9("h2", { className: "ab-title", children: "Select Service" }),
|
|
15034
|
+
/* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: "Choose the service you'd like to book" })
|
|
14911
15035
|
] }),
|
|
14912
15036
|
showServiceSelect ? /* @__PURE__ */ jsxs7("div", { className: "ab-stack--sm", children: [
|
|
14913
|
-
/* @__PURE__ */
|
|
14914
|
-
/* @__PURE__ */
|
|
15037
|
+
/* @__PURE__ */ jsx9("label", { className: "ab-subtitle", children: "Service" }),
|
|
15038
|
+
/* @__PURE__ */ jsx9("div", { className: "ab-grid", children: services.map((service) => {
|
|
14915
15039
|
const isSelected = selectedServiceId === service.id;
|
|
14916
|
-
return /* @__PURE__ */
|
|
15040
|
+
return /* @__PURE__ */ jsx9(
|
|
14917
15041
|
"button",
|
|
14918
15042
|
{
|
|
14919
15043
|
type: "button",
|
|
@@ -14921,14 +15045,14 @@ function DefaultServiceSelectionStep({
|
|
|
14921
15045
|
className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
|
|
14922
15046
|
children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
|
|
14923
15047
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
14924
|
-
/* @__PURE__ */
|
|
14925
|
-
service.description ? /* @__PURE__ */
|
|
15048
|
+
/* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: service.title }),
|
|
15049
|
+
service.description ? /* @__PURE__ */ jsx9("div", { className: "ab-text ab-text--muted", children: service.description }) : null,
|
|
14926
15050
|
service.durationMinutes ? /* @__PURE__ */ jsxs7("div", { className: "ab-text ab-text--muted", children: [
|
|
14927
15051
|
service.durationMinutes,
|
|
14928
15052
|
" minutes"
|
|
14929
15053
|
] }) : null
|
|
14930
15054
|
] }),
|
|
14931
|
-
isSelected ? /* @__PURE__ */
|
|
15055
|
+
isSelected ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
|
|
14932
15056
|
] })
|
|
14933
15057
|
},
|
|
14934
15058
|
service.id
|
|
@@ -14936,41 +15060,41 @@ function DefaultServiceSelectionStep({
|
|
|
14936
15060
|
}) })
|
|
14937
15061
|
] }) : null,
|
|
14938
15062
|
booking.resources.state.tag === "loading" ? /* @__PURE__ */ jsxs7("div", { className: "ab-center", children: [
|
|
14939
|
-
/* @__PURE__ */
|
|
14940
|
-
/* @__PURE__ */
|
|
15063
|
+
/* @__PURE__ */ jsx9(SpinnerNode, { size: "md", srLabel: "Loading practitioners" }),
|
|
15064
|
+
/* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: "Loading practitioners..." })
|
|
14941
15065
|
] }) : null,
|
|
14942
|
-
booking.resources.state.tag === "error" ? /* @__PURE__ */
|
|
14943
|
-
showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */
|
|
15066
|
+
booking.resources.state.tag === "error" ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.resources.state.message }) : null,
|
|
15067
|
+
showResourceSelect && booking.resources.state.tag === "loaded" && resources.length === 0 ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "No practitioners are available for this service right now." }) : null,
|
|
14944
15068
|
showResourceSelect && booking.resources.state.tag !== "loading" && (allowAnyResource || resources.length > 0) ? /* @__PURE__ */ jsxs7("div", { className: "ab-stack--sm", children: [
|
|
14945
15069
|
/* @__PURE__ */ jsxs7("label", { className: "ab-subtitle", children: [
|
|
14946
15070
|
"Practitioner",
|
|
14947
15071
|
booking.resources.requiresSelection ? "" : " (Optional)"
|
|
14948
15072
|
] }),
|
|
14949
|
-
/* @__PURE__ */
|
|
15073
|
+
/* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: allowAnyResource ? 'Choose a specific practitioner or select "Any Available"' : "Choose the practitioner you'd like to book" }),
|
|
14950
15074
|
/* @__PURE__ */ jsxs7("div", { className: "ab-grid", children: [
|
|
14951
|
-
allowAnyResource ? /* @__PURE__ */
|
|
15075
|
+
allowAnyResource ? /* @__PURE__ */ jsx9(
|
|
14952
15076
|
"button",
|
|
14953
15077
|
{
|
|
14954
15078
|
type: "button",
|
|
14955
15079
|
onClick: () => booking.actions.selectResource(null),
|
|
14956
15080
|
className: `ab-card ${!selectedResourceId ? "ab-card--selected" : ""}`,
|
|
14957
15081
|
children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
|
|
14958
|
-
/* @__PURE__ */
|
|
14959
|
-
!selectedResourceId ? /* @__PURE__ */
|
|
15082
|
+
/* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: "Any Available" }),
|
|
15083
|
+
!selectedResourceId ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
|
|
14960
15084
|
] })
|
|
14961
15085
|
}
|
|
14962
15086
|
) : null,
|
|
14963
15087
|
resources.map((resource) => {
|
|
14964
15088
|
const isSelected = selectedResourceId === resource.id;
|
|
14965
|
-
return /* @__PURE__ */
|
|
15089
|
+
return /* @__PURE__ */ jsx9(
|
|
14966
15090
|
"button",
|
|
14967
15091
|
{
|
|
14968
15092
|
type: "button",
|
|
14969
15093
|
onClick: () => booking.actions.selectResource(resource.id),
|
|
14970
15094
|
className: `ab-card ${isSelected ? "ab-card--selected" : ""}`,
|
|
14971
15095
|
children: /* @__PURE__ */ jsxs7("div", { className: "ab-row--between", children: [
|
|
14972
|
-
/* @__PURE__ */
|
|
14973
|
-
isSelected ? /* @__PURE__ */
|
|
15096
|
+
/* @__PURE__ */ jsx9("div", { className: "ab-subtitle", children: resource.label }),
|
|
15097
|
+
isSelected ? /* @__PURE__ */ jsx9(SelectedCheck, {}) : null
|
|
14974
15098
|
] })
|
|
14975
15099
|
},
|
|
14976
15100
|
resource.id
|
|
@@ -14993,16 +15117,16 @@ function DefaultDateTimeSelectionStep({
|
|
|
14993
15117
|
const error = booking.availability.datesState.tag === "error" ? booking.availability.datesState.message : booking.availability.slotsState.tag === "error" ? booking.availability.slotsState.message : null;
|
|
14994
15118
|
return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
|
|
14995
15119
|
singleService ? /* @__PURE__ */ jsxs7("div", { className: "ab-info-box", children: [
|
|
14996
|
-
/* @__PURE__ */
|
|
14997
|
-
singleService.description ? /* @__PURE__ */
|
|
15120
|
+
/* @__PURE__ */ jsx9("h3", { className: "ab-subtitle", children: singleService.title }),
|
|
15121
|
+
singleService.description ? /* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: singleService.description }) : null,
|
|
14998
15122
|
singleService.durationMinutes ? /* @__PURE__ */ jsxs7("p", { className: "ab-text ab-text--muted", children: [
|
|
14999
15123
|
"Duration: ",
|
|
15000
15124
|
singleService.durationMinutes,
|
|
15001
15125
|
" minutes"
|
|
15002
15126
|
] }) : null
|
|
15003
15127
|
] }) : null,
|
|
15004
|
-
error ? /* @__PURE__ */
|
|
15005
|
-
/* @__PURE__ */
|
|
15128
|
+
error ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: error }) : null,
|
|
15129
|
+
/* @__PURE__ */ jsx9(
|
|
15006
15130
|
DatePicker,
|
|
15007
15131
|
{
|
|
15008
15132
|
value: selectedDate,
|
|
@@ -15014,7 +15138,7 @@ function DefaultDateTimeSelectionStep({
|
|
|
15014
15138
|
onLoadMore: booking.availability.loadMoreDates
|
|
15015
15139
|
}
|
|
15016
15140
|
),
|
|
15017
|
-
selectedDate ? /* @__PURE__ */
|
|
15141
|
+
selectedDate ? /* @__PURE__ */ jsx9(
|
|
15018
15142
|
TimeSlotSelector,
|
|
15019
15143
|
{
|
|
15020
15144
|
value: selectedSlotStart,
|
|
@@ -15037,19 +15161,19 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15037
15161
|
const service = booking.services.selected;
|
|
15038
15162
|
const viewModel = booking.payment.selection;
|
|
15039
15163
|
if (booking.payment.kind === "unsupported") {
|
|
15040
|
-
return /* @__PURE__ */
|
|
15164
|
+
return /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: booking.payment.errorMessage });
|
|
15041
15165
|
}
|
|
15042
15166
|
if (!service || !viewModel) {
|
|
15043
|
-
return /* @__PURE__ */
|
|
15167
|
+
return /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: "Payment options are unavailable for this service right now." });
|
|
15044
15168
|
}
|
|
15045
15169
|
const packageOptions = booking.payment.appointmentPackages.items;
|
|
15046
15170
|
const hasPackageOptions = packageOptions.length > 0;
|
|
15047
15171
|
return /* @__PURE__ */ jsxs7("div", { className: "ab-stack", children: [
|
|
15048
15172
|
/* @__PURE__ */ jsxs7("div", { className: "ab-info-box", children: [
|
|
15049
|
-
/* @__PURE__ */
|
|
15050
|
-
/* @__PURE__ */
|
|
15173
|
+
/* @__PURE__ */ jsx9("h3", { className: "ab-subtitle", children: viewModel.sectionTitle }),
|
|
15174
|
+
/* @__PURE__ */ jsx9("p", { className: "ab-text ab-text--muted", children: service.title })
|
|
15051
15175
|
] }),
|
|
15052
|
-
booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */
|
|
15176
|
+
booking.payment.appointmentPackages.state.tag === "loading" ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: "Checking package credits..." }) : null,
|
|
15053
15177
|
booking.payment.appointmentPackages.state.tag === "error" ? /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: [
|
|
15054
15178
|
booking.payment.appointmentPackages.state.message,
|
|
15055
15179
|
" You can continue with the normal payment option."
|
|
@@ -15057,7 +15181,7 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15057
15181
|
/* @__PURE__ */ jsxs7("div", { className: "ab-stack", role: "list", "aria-label": "Payment options", children: [
|
|
15058
15182
|
packageOptions.map((appointmentPackage) => {
|
|
15059
15183
|
const isSelected = booking.payment.selectedAppointmentPackageId === appointmentPackage.customerPassId;
|
|
15060
|
-
return /* @__PURE__ */
|
|
15184
|
+
return /* @__PURE__ */ jsx9(
|
|
15061
15185
|
"button",
|
|
15062
15186
|
{
|
|
15063
15187
|
type: "button",
|
|
@@ -15070,7 +15194,7 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15070
15194
|
appointmentPackage.customerPassId
|
|
15071
15195
|
),
|
|
15072
15196
|
"aria-pressed": isSelected,
|
|
15073
|
-
children: /* @__PURE__ */
|
|
15197
|
+
children: /* @__PURE__ */ jsx9(
|
|
15074
15198
|
PaymentOptionContent,
|
|
15075
15199
|
{
|
|
15076
15200
|
id: appointmentPackage.customerPassId,
|
|
@@ -15089,12 +15213,12 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15089
15213
|
viewModel.options.map((option) => {
|
|
15090
15214
|
const isSelected = !booking.payment.selectedAppointmentPackageId && (booking.payment.selectedCollectionOptionKind === option.kind || viewModel.mode === "single_option");
|
|
15091
15215
|
if (viewModel.mode === "single_option" && !hasPackageOptions) {
|
|
15092
|
-
return /* @__PURE__ */
|
|
15216
|
+
return /* @__PURE__ */ jsx9(
|
|
15093
15217
|
"div",
|
|
15094
15218
|
{
|
|
15095
15219
|
className: "ab-card",
|
|
15096
15220
|
style: paymentOptionLayoutStyle,
|
|
15097
|
-
children: /* @__PURE__ */
|
|
15221
|
+
children: /* @__PURE__ */ jsx9(
|
|
15098
15222
|
PaymentOptionContent,
|
|
15099
15223
|
{
|
|
15100
15224
|
id: option.kind,
|
|
@@ -15108,7 +15232,7 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15108
15232
|
option.kind
|
|
15109
15233
|
);
|
|
15110
15234
|
}
|
|
15111
|
-
return /* @__PURE__ */
|
|
15235
|
+
return /* @__PURE__ */ jsx9(
|
|
15112
15236
|
"button",
|
|
15113
15237
|
{
|
|
15114
15238
|
type: "button",
|
|
@@ -15119,7 +15243,7 @@ function HeadlessBookingPaymentSelectionStep({
|
|
|
15119
15243
|
style: paymentOptionLayoutStyle,
|
|
15120
15244
|
onClick: () => booking.actions.selectPaymentOption(option.kind),
|
|
15121
15245
|
"aria-pressed": isSelected,
|
|
15122
|
-
children: /* @__PURE__ */
|
|
15246
|
+
children: /* @__PURE__ */ jsx9(
|
|
15123
15247
|
PaymentOptionContent,
|
|
15124
15248
|
{
|
|
15125
15249
|
id: option.kind,
|
|
@@ -15144,21 +15268,21 @@ function PaymentOptionContent({
|
|
|
15144
15268
|
title
|
|
15145
15269
|
}) {
|
|
15146
15270
|
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
15147
|
-
/* @__PURE__ */
|
|
15148
|
-
/* @__PURE__ */
|
|
15149
|
-
/* @__PURE__ */
|
|
15271
|
+
/* @__PURE__ */ jsx9("span", { children: title }),
|
|
15272
|
+
/* @__PURE__ */ jsx9("span", { className: "ab-text ab-text--muted", children: description }),
|
|
15273
|
+
/* @__PURE__ */ jsx9("div", { className: "ab-stack", style: summaryStackStyle, children: summaryRows.map((row) => /* @__PURE__ */ jsxs7("span", { className: "ab-text ab-text--muted", children: [
|
|
15150
15274
|
row.label,
|
|
15151
15275
|
": ",
|
|
15152
15276
|
row.value
|
|
15153
15277
|
] }, `${id}-${row.label}`)) }),
|
|
15154
|
-
helperText ? /* @__PURE__ */
|
|
15278
|
+
helperText ? /* @__PURE__ */ jsx9("span", { className: "ab-text ab-text--muted", children: helperText }) : null
|
|
15155
15279
|
] });
|
|
15156
15280
|
}
|
|
15157
15281
|
function DefaultDynamicFields({
|
|
15158
15282
|
booking,
|
|
15159
15283
|
fields
|
|
15160
15284
|
}) {
|
|
15161
|
-
return /* @__PURE__ */
|
|
15285
|
+
return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-6", children: fields.map((field) => /* @__PURE__ */ jsx9(DefaultDynamicField, { booking, field }, field.id)) });
|
|
15162
15286
|
}
|
|
15163
15287
|
function DefaultDynamicField({
|
|
15164
15288
|
booking,
|
|
@@ -15171,10 +15295,10 @@ function DefaultDynamicField({
|
|
|
15171
15295
|
return /* @__PURE__ */ jsxs7("div", { className: "rb-space-y-2", children: [
|
|
15172
15296
|
/* @__PURE__ */ jsxs7("label", { id: field.labelId, htmlFor: field.inputId, className: "form-label", children: [
|
|
15173
15297
|
field.label,
|
|
15174
|
-
field.required ? /* @__PURE__ */
|
|
15298
|
+
field.required ? /* @__PURE__ */ jsx9("span", { className: "required-marker", children: "*" }) : null
|
|
15175
15299
|
] }),
|
|
15176
|
-
field.helpText ? /* @__PURE__ */
|
|
15177
|
-
/* @__PURE__ */
|
|
15300
|
+
field.helpText ? /* @__PURE__ */ jsx9("p", { id: field.helpTextId ?? void 0, className: "rb-caption status-muted", children: field.helpText }) : null,
|
|
15301
|
+
/* @__PURE__ */ jsx9(
|
|
15178
15302
|
DefaultFieldInput,
|
|
15179
15303
|
{
|
|
15180
15304
|
field,
|
|
@@ -15186,7 +15310,7 @@ function DefaultDynamicField({
|
|
|
15186
15310
|
describedBy
|
|
15187
15311
|
}
|
|
15188
15312
|
),
|
|
15189
|
-
error ? /* @__PURE__ */
|
|
15313
|
+
error ? /* @__PURE__ */ jsx9(
|
|
15190
15314
|
FieldValidationMessage,
|
|
15191
15315
|
{
|
|
15192
15316
|
id: errorId ?? `${field.inputId}-error`,
|
|
@@ -15220,7 +15344,7 @@ function DefaultFieldInput({
|
|
|
15220
15344
|
};
|
|
15221
15345
|
switch (field.type) {
|
|
15222
15346
|
case "textarea":
|
|
15223
|
-
return /* @__PURE__ */
|
|
15347
|
+
return /* @__PURE__ */ jsx9(
|
|
15224
15348
|
"textarea",
|
|
15225
15349
|
{
|
|
15226
15350
|
...commonProps,
|
|
@@ -15235,7 +15359,7 @@ function DefaultFieldInput({
|
|
|
15235
15359
|
);
|
|
15236
15360
|
case "select":
|
|
15237
15361
|
if (field.field.multiple) {
|
|
15238
|
-
return /* @__PURE__ */
|
|
15362
|
+
return /* @__PURE__ */ jsx9(
|
|
15239
15363
|
"select",
|
|
15240
15364
|
{
|
|
15241
15365
|
...commonProps,
|
|
@@ -15248,7 +15372,7 @@ function DefaultFieldInput({
|
|
|
15248
15372
|
},
|
|
15249
15373
|
multiple: true,
|
|
15250
15374
|
className: "form-select rb-h-32",
|
|
15251
|
-
children: field.field.options?.map((option) => /* @__PURE__ */
|
|
15375
|
+
children: field.field.options?.map((option) => /* @__PURE__ */ jsx9("option", { value: option.value, children: option.label }, option.value))
|
|
15252
15376
|
}
|
|
15253
15377
|
);
|
|
15254
15378
|
}
|
|
@@ -15260,14 +15384,14 @@ function DefaultFieldInput({
|
|
|
15260
15384
|
onChange: (event) => onChange(event.target.value),
|
|
15261
15385
|
className: "form-select",
|
|
15262
15386
|
children: [
|
|
15263
|
-
/* @__PURE__ */
|
|
15264
|
-
field.field.options?.map((option) => /* @__PURE__ */
|
|
15387
|
+
/* @__PURE__ */ jsx9("option", { value: "", children: "Select an option..." }),
|
|
15388
|
+
field.field.options?.map((option) => /* @__PURE__ */ jsx9("option", { value: option.value, children: option.label }, option.value))
|
|
15265
15389
|
]
|
|
15266
15390
|
}
|
|
15267
15391
|
);
|
|
15268
15392
|
case "radio":
|
|
15269
|
-
return /* @__PURE__ */
|
|
15270
|
-
/* @__PURE__ */
|
|
15393
|
+
return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-2", children: field.field.options?.map((option) => /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
|
|
15394
|
+
/* @__PURE__ */ jsx9(
|
|
15271
15395
|
"input",
|
|
15272
15396
|
{
|
|
15273
15397
|
type: "radio",
|
|
@@ -15281,13 +15405,13 @@ function DefaultFieldInput({
|
|
|
15281
15405
|
className: "form-radio"
|
|
15282
15406
|
}
|
|
15283
15407
|
),
|
|
15284
|
-
/* @__PURE__ */
|
|
15408
|
+
/* @__PURE__ */ jsx9("span", { className: "rb-caption", children: option.label })
|
|
15285
15409
|
] }, option.value)) });
|
|
15286
15410
|
case "checkbox":
|
|
15287
15411
|
if (field.field.options && field.field.options.length > 1) {
|
|
15288
15412
|
const checkedValues = toStringArray(value);
|
|
15289
|
-
return /* @__PURE__ */
|
|
15290
|
-
/* @__PURE__ */
|
|
15413
|
+
return /* @__PURE__ */ jsx9("div", { className: "rb-space-y-2", children: field.field.options.map((option) => /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
|
|
15414
|
+
/* @__PURE__ */ jsx9(
|
|
15291
15415
|
"input",
|
|
15292
15416
|
{
|
|
15293
15417
|
type: "checkbox",
|
|
@@ -15304,11 +15428,11 @@ function DefaultFieldInput({
|
|
|
15304
15428
|
className: "form-checkbox"
|
|
15305
15429
|
}
|
|
15306
15430
|
),
|
|
15307
|
-
/* @__PURE__ */
|
|
15431
|
+
/* @__PURE__ */ jsx9("span", { className: "rb-caption", children: option.label })
|
|
15308
15432
|
] }, option.value)) });
|
|
15309
15433
|
}
|
|
15310
15434
|
return /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-center rb-gap-2 rb-cursor-pointer", children: [
|
|
15311
|
-
/* @__PURE__ */
|
|
15435
|
+
/* @__PURE__ */ jsx9(
|
|
15312
15436
|
"input",
|
|
15313
15437
|
{
|
|
15314
15438
|
type: "checkbox",
|
|
@@ -15322,11 +15446,11 @@ function DefaultFieldInput({
|
|
|
15322
15446
|
className: "form-checkbox"
|
|
15323
15447
|
}
|
|
15324
15448
|
),
|
|
15325
|
-
/* @__PURE__ */
|
|
15449
|
+
/* @__PURE__ */ jsx9("span", { className: "rb-caption", children: field.field.placeholder || field.label })
|
|
15326
15450
|
] });
|
|
15327
15451
|
case "booking_requirement_consent":
|
|
15328
15452
|
return /* @__PURE__ */ jsxs7("label", { className: "rb-flex rb-items-start rb-gap-2 rb-cursor-pointer", children: [
|
|
15329
|
-
/* @__PURE__ */
|
|
15453
|
+
/* @__PURE__ */ jsx9(
|
|
15330
15454
|
"input",
|
|
15331
15455
|
{
|
|
15332
15456
|
type: "checkbox",
|
|
@@ -15340,10 +15464,10 @@ function DefaultFieldInput({
|
|
|
15340
15464
|
className: "form-checkbox rb-mt-0.5"
|
|
15341
15465
|
}
|
|
15342
15466
|
),
|
|
15343
|
-
/* @__PURE__ */
|
|
15467
|
+
/* @__PURE__ */ jsx9("span", { className: "rb-caption", children: field.field.placeholder || field.label })
|
|
15344
15468
|
] });
|
|
15345
15469
|
case "number":
|
|
15346
|
-
return /* @__PURE__ */
|
|
15470
|
+
return /* @__PURE__ */ jsx9(
|
|
15347
15471
|
"input",
|
|
15348
15472
|
{
|
|
15349
15473
|
...commonProps,
|
|
@@ -15357,7 +15481,7 @@ function DefaultFieldInput({
|
|
|
15357
15481
|
}
|
|
15358
15482
|
);
|
|
15359
15483
|
case "date":
|
|
15360
|
-
return /* @__PURE__ */
|
|
15484
|
+
return /* @__PURE__ */ jsx9(
|
|
15361
15485
|
"input",
|
|
15362
15486
|
{
|
|
15363
15487
|
...commonProps,
|
|
@@ -15370,7 +15494,7 @@ function DefaultFieldInput({
|
|
|
15370
15494
|
}
|
|
15371
15495
|
);
|
|
15372
15496
|
case "time":
|
|
15373
|
-
return /* @__PURE__ */
|
|
15497
|
+
return /* @__PURE__ */ jsx9(
|
|
15374
15498
|
"input",
|
|
15375
15499
|
{
|
|
15376
15500
|
...commonProps,
|
|
@@ -15384,7 +15508,7 @@ function DefaultFieldInput({
|
|
|
15384
15508
|
case "email":
|
|
15385
15509
|
case "tel":
|
|
15386
15510
|
case "url":
|
|
15387
|
-
return /* @__PURE__ */
|
|
15511
|
+
return /* @__PURE__ */ jsx9(
|
|
15388
15512
|
"input",
|
|
15389
15513
|
{
|
|
15390
15514
|
...commonProps,
|
|
@@ -15409,7 +15533,7 @@ function DefaultBookingDiscount({
|
|
|
15409
15533
|
const shouldShowDiscountSection = !booking.payment.selectedAppointmentPackageId && !booking.discount.loading && (booking.discount.manualCodeEntryAllowed || Boolean(booking.discount.autoAppliedDiscount));
|
|
15410
15534
|
if (!shouldShowDiscountSection) return null;
|
|
15411
15535
|
return /* @__PURE__ */ jsxs7("div", { className: "rb-mt-6", children: [
|
|
15412
|
-
booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */
|
|
15536
|
+
booking.discount.manualCodeEntryAllowed ? /* @__PURE__ */ jsx9(
|
|
15413
15537
|
DiscountCodeDisclosure,
|
|
15414
15538
|
{
|
|
15415
15539
|
surface: "theme-form",
|
|
@@ -15423,7 +15547,7 @@ function DefaultBookingDiscount({
|
|
|
15423
15547
|
}
|
|
15424
15548
|
}
|
|
15425
15549
|
) : null,
|
|
15426
|
-
booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */
|
|
15550
|
+
booking.discount.autoAppliedDiscount && booking.discount.code.trim().length === 0 ? /* @__PURE__ */ jsx9(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mt-4", role: "status", children: /* @__PURE__ */ jsxs7("p", { className: "ab-text", children: [
|
|
15427
15551
|
"Discount available: ",
|
|
15428
15552
|
booking.discount.autoAppliedDiscount.publicLabel,
|
|
15429
15553
|
" ",
|
|
@@ -15436,8 +15560,8 @@ function DefaultBookingFeedback({
|
|
|
15436
15560
|
}) {
|
|
15437
15561
|
if (booking.feedback.kind !== "error") return null;
|
|
15438
15562
|
return /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: [
|
|
15439
|
-
/* @__PURE__ */
|
|
15440
|
-
/* @__PURE__ */
|
|
15563
|
+
/* @__PURE__ */ jsx9("p", { className: "ab-text", children: booking.feedback.message }),
|
|
15564
|
+
/* @__PURE__ */ jsx9(
|
|
15441
15565
|
"button",
|
|
15442
15566
|
{
|
|
15443
15567
|
type: "button",
|
|
@@ -15452,7 +15576,7 @@ function DefaultBookingAltcha({
|
|
|
15452
15576
|
booking
|
|
15453
15577
|
}) {
|
|
15454
15578
|
if (!booking.spamProtection.enabled) return null;
|
|
15455
|
-
return /* @__PURE__ */
|
|
15579
|
+
return /* @__PURE__ */ jsx9("div", { className: "ab-altcha", children: /* @__PURE__ */ jsx9(
|
|
15456
15580
|
AltchaWidget,
|
|
15457
15581
|
{
|
|
15458
15582
|
challengeUrl: booking.spamProtection.challenge.url,
|
|
@@ -15465,12 +15589,12 @@ function DefaultBookingErrorSummary({
|
|
|
15465
15589
|
}) {
|
|
15466
15590
|
if (!hasBookingValidationErrors(errors)) return null;
|
|
15467
15591
|
return /* @__PURE__ */ jsxs7(FeedbackMessage, { tone: "error", className: "rb-mt-6 alert alert-error", role: "alert", children: [
|
|
15468
|
-
errors.formError ? /* @__PURE__ */
|
|
15469
|
-
Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */
|
|
15592
|
+
errors.formError ? /* @__PURE__ */ jsx9("p", { className: "rb-caption", children: /* @__PURE__ */ jsx9("strong", { children: errors.formError }) }) : null,
|
|
15593
|
+
Object.entries(errors.fieldErrors).map(([key, message]) => /* @__PURE__ */ jsx9("p", { className: "rb-caption", children: message }, key))
|
|
15470
15594
|
] });
|
|
15471
15595
|
}
|
|
15472
15596
|
function SelectedCheck() {
|
|
15473
|
-
return /* @__PURE__ */
|
|
15597
|
+
return /* @__PURE__ */ jsx9("div", { className: "ab-check", children: /* @__PURE__ */ jsx9(
|
|
15474
15598
|
"svg",
|
|
15475
15599
|
{
|
|
15476
15600
|
fill: "none",
|
|
@@ -15479,7 +15603,7 @@ function SelectedCheck() {
|
|
|
15479
15603
|
strokeWidth: "2",
|
|
15480
15604
|
viewBox: "0 0 24 24",
|
|
15481
15605
|
stroke: "currentColor",
|
|
15482
|
-
children: /* @__PURE__ */
|
|
15606
|
+
children: /* @__PURE__ */ jsx9("path", { d: "M5 13l4 4L19 7" })
|
|
15483
15607
|
}
|
|
15484
15608
|
) });
|
|
15485
15609
|
}
|
|
@@ -15546,7 +15670,7 @@ function consumeSearchParam(paramName) {
|
|
|
15546
15670
|
}
|
|
15547
15671
|
|
|
15548
15672
|
// ../blocks/src/system/runtime/nodes/booking-form.client.tsx
|
|
15549
|
-
import { jsx as
|
|
15673
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
15550
15674
|
var PORTAL_REBOOK_QUERY_PARAM = "rebook";
|
|
15551
15675
|
var PORTAL_REBOOK_QUERY_VALUE = "1";
|
|
15552
15676
|
var REBOOK_COMPLETION_MODE_VERIFIED_CHECKOUT = "verified_checkout";
|
|
@@ -15583,8 +15707,8 @@ var BookingFormClient = ({
|
|
|
15583
15707
|
const initialServiceId = render.hydration.serviceId ?? defaultServiceId ?? void 0;
|
|
15584
15708
|
const initialResourceId = render.hydration.resourceId ?? void 0;
|
|
15585
15709
|
const isPortalRebook = render.hydration.rebookContext?.kind === "portal_rebook";
|
|
15586
|
-
const hasLoggedRebookCompletionRef =
|
|
15587
|
-
const [redirectState] =
|
|
15710
|
+
const hasLoggedRebookCompletionRef = useRef8(false);
|
|
15711
|
+
const [redirectState] = useState2(
|
|
15588
15712
|
() => getBookingRedirectStateFromLocation(getBookingRedirectLocationSnapshot())
|
|
15589
15713
|
);
|
|
15590
15714
|
const showSpamProtection = render.hydration.spamProtectionEnabled ?? isSpamProtectionEnabled();
|
|
@@ -15664,13 +15788,13 @@ var BookingFormClient = ({
|
|
|
15664
15788
|
viewState.kind
|
|
15665
15789
|
]);
|
|
15666
15790
|
if (render.display.state === "missing" || !form || !render.hydration.formId) {
|
|
15667
|
-
return /* @__PURE__ */
|
|
15791
|
+
return /* @__PURE__ */ jsx10(
|
|
15668
15792
|
FeedbackMessage,
|
|
15669
15793
|
{
|
|
15670
15794
|
tone: "error",
|
|
15671
15795
|
className: `ab-alert ab-alert--error ${render.display.className ?? ""}`.trim(),
|
|
15672
15796
|
role: "alert",
|
|
15673
|
-
children: /* @__PURE__ */
|
|
15797
|
+
children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: render.display.message ?? "Booking form not found. Please check your configuration." })
|
|
15674
15798
|
}
|
|
15675
15799
|
);
|
|
15676
15800
|
}
|
|
@@ -15690,7 +15814,7 @@ var BookingFormClient = ({
|
|
|
15690
15814
|
}
|
|
15691
15815
|
};
|
|
15692
15816
|
if (viewState.kind === "success") {
|
|
15693
|
-
return /* @__PURE__ */
|
|
15817
|
+
return /* @__PURE__ */ jsx10(
|
|
15694
15818
|
SuccessMessage,
|
|
15695
15819
|
{
|
|
15696
15820
|
message: getBookingSuccessMessage(render.display.successMessage),
|
|
@@ -15700,19 +15824,19 @@ var BookingFormClient = ({
|
|
|
15700
15824
|
);
|
|
15701
15825
|
}
|
|
15702
15826
|
if (viewState.kind === "verifying") {
|
|
15703
|
-
return /* @__PURE__ */
|
|
15827
|
+
return /* @__PURE__ */ jsx10(
|
|
15704
15828
|
"div",
|
|
15705
15829
|
{
|
|
15706
15830
|
id: bookingAnchorId,
|
|
15707
15831
|
className: render.display.className ?? void 0,
|
|
15708
|
-
children: /* @__PURE__ */
|
|
15832
|
+
children: /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info", role: "status", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: viewState.message }) })
|
|
15709
15833
|
}
|
|
15710
15834
|
);
|
|
15711
15835
|
}
|
|
15712
15836
|
return /* @__PURE__ */ jsxs8("div", { id: bookingAnchorId, className: render.display.className ?? void 0, children: [
|
|
15713
|
-
render.hydration.noticeMessage ? /* @__PURE__ */
|
|
15714
|
-
viewState.kind === "error" ? /* @__PURE__ */
|
|
15715
|
-
/* @__PURE__ */
|
|
15837
|
+
render.hydration.noticeMessage ? /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "info", className: "ab-alert ab-alert--info rb-mb-4", role: "status", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: render.hydration.noticeMessage }) }) : null,
|
|
15838
|
+
viewState.kind === "error" ? /* @__PURE__ */ jsx10(FeedbackMessage, { tone: "error", className: "ab-alert ab-alert--error", role: "alert", children: /* @__PURE__ */ jsx10("p", { className: "ab-text", children: viewState.message }) }) : null,
|
|
15839
|
+
/* @__PURE__ */ jsx10(HeadlessBookingDefaultForm, { booking, onSubmit: handleComplete })
|
|
15716
15840
|
] });
|
|
15717
15841
|
};
|
|
15718
15842
|
|
|
@@ -15729,12 +15853,18 @@ function createInitialRegistrationFlowState(hasPreSelectedContext) {
|
|
|
15729
15853
|
};
|
|
15730
15854
|
}
|
|
15731
15855
|
function selectionEquals(a, b2) {
|
|
15732
|
-
return a.method === b2.method && a.passId === b2.passId && a.membershipId === b2.membershipId && a.bundlePassId === b2.bundlePassId && a.bundleMembershipId === b2.bundleMembershipId && a.productName === b2.productName && a.productDescription === b2.productDescription && a.productPrice === b2.productPrice && a.productCurrency === b2.productCurrency && a.productInterval === b2.productInterval;
|
|
15856
|
+
return a.method === b2.method && a.passId === b2.passId && a.membershipId === b2.membershipId && a.bundlePassId === b2.bundlePassId && a.bundleMembershipId === b2.bundleMembershipId && a.productName === b2.productName && a.productDescription === b2.productDescription && a.productPrice === b2.productPrice && a.productCurrency === b2.productCurrency && a.productInterval === b2.productInterval && a.collectionOptionKind === b2.collectionOptionKind;
|
|
15733
15857
|
}
|
|
15734
15858
|
function withDefaultSelection(selection) {
|
|
15735
15859
|
if (!selection || !selection.method) {
|
|
15736
15860
|
return { method: null };
|
|
15737
15861
|
}
|
|
15862
|
+
if (selection.method === "stripe") {
|
|
15863
|
+
return {
|
|
15864
|
+
...selection,
|
|
15865
|
+
collectionOptionKind: selection.collectionOptionKind ?? "upfront"
|
|
15866
|
+
};
|
|
15867
|
+
}
|
|
15738
15868
|
return selection;
|
|
15739
15869
|
}
|
|
15740
15870
|
function computeAutoSelection(input) {
|
|
@@ -15760,7 +15890,7 @@ function computeAutoSelection(input) {
|
|
|
15760
15890
|
}
|
|
15761
15891
|
}
|
|
15762
15892
|
if (eligibility.canPayDirectly && eligibility.price) {
|
|
15763
|
-
return { method: "stripe" };
|
|
15893
|
+
return { method: "stripe", collectionOptionKind: "upfront" };
|
|
15764
15894
|
}
|
|
15765
15895
|
return { method: null };
|
|
15766
15896
|
}
|
|
@@ -15778,11 +15908,17 @@ function isSelectionValid(input) {
|
|
|
15778
15908
|
case "pass":
|
|
15779
15909
|
return isAuthenticated && ticketsCount === 1 && !!selection.passId && eligibility.eligiblePasses.some((pass) => pass.id === selection.passId);
|
|
15780
15910
|
case "membership":
|
|
15781
|
-
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
15911
|
+
return isAuthenticated && ticketsCount === 1 && !!selection.membershipId && eligibility.eligibleMemberships.some(
|
|
15912
|
+
(membership) => membership.id === selection.membershipId
|
|
15913
|
+
);
|
|
15782
15914
|
case "pass_bundle":
|
|
15783
|
-
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
15915
|
+
return ticketsCount === 1 && !!selection.bundlePassId && eligibility.availablePasses.some(
|
|
15916
|
+
(pass) => pass.id === selection.bundlePassId
|
|
15917
|
+
);
|
|
15784
15918
|
case "membership_bundle":
|
|
15785
|
-
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
15919
|
+
return ticketsCount === 1 && !!selection.bundleMembershipId && eligibility.availableMemberships.some(
|
|
15920
|
+
(membership) => membership.id === selection.bundleMembershipId
|
|
15921
|
+
);
|
|
15786
15922
|
default:
|
|
15787
15923
|
return false;
|
|
15788
15924
|
}
|
|
@@ -15829,9 +15965,15 @@ function registrationFlowReducer(state, action) {
|
|
|
15829
15965
|
ticketsCount: Math.max(1, action.ticketsCount)
|
|
15830
15966
|
});
|
|
15831
15967
|
case "set-authenticated":
|
|
15832
|
-
return normalizeRegistrationFlowState({
|
|
15968
|
+
return normalizeRegistrationFlowState({
|
|
15969
|
+
...state,
|
|
15970
|
+
isAuthenticated: action.isAuthenticated
|
|
15971
|
+
});
|
|
15833
15972
|
case "eligibility-updated":
|
|
15834
|
-
return normalizeRegistrationFlowState({
|
|
15973
|
+
return normalizeRegistrationFlowState({
|
|
15974
|
+
...state,
|
|
15975
|
+
eligibility: action.eligibility
|
|
15976
|
+
});
|
|
15835
15977
|
case "set-manual-payment-selection":
|
|
15836
15978
|
return normalizeRegistrationFlowState({
|
|
15837
15979
|
...state,
|
|
@@ -15843,7 +15985,7 @@ function registrationFlowReducer(state, action) {
|
|
|
15843
15985
|
return normalizeRegistrationFlowState({
|
|
15844
15986
|
...state,
|
|
15845
15987
|
passOptOut: true,
|
|
15846
|
-
paymentSelection: { method: "stripe" },
|
|
15988
|
+
paymentSelection: { method: "stripe", collectionOptionKind: "upfront" },
|
|
15847
15989
|
selectionSource: "manual"
|
|
15848
15990
|
});
|
|
15849
15991
|
case "event-changed":
|
|
@@ -15961,7 +16103,10 @@ function toHeadlessPaymentSelection(selection) {
|
|
|
15961
16103
|
case "free":
|
|
15962
16104
|
return { method: "free" };
|
|
15963
16105
|
case "stripe":
|
|
15964
|
-
return {
|
|
16106
|
+
return {
|
|
16107
|
+
method: "stripe",
|
|
16108
|
+
collectionOptionKind: selection.collectionOptionKind
|
|
16109
|
+
};
|
|
15965
16110
|
case "pass":
|
|
15966
16111
|
if (!selection.passId) return { method: "none" };
|
|
15967
16112
|
return {
|
|
@@ -15999,7 +16144,10 @@ function toInternalPaymentSelection(selection) {
|
|
|
15999
16144
|
case "free":
|
|
16000
16145
|
return { method: "free" };
|
|
16001
16146
|
case "stripe":
|
|
16002
|
-
return {
|
|
16147
|
+
return {
|
|
16148
|
+
method: "stripe",
|
|
16149
|
+
collectionOptionKind: selection.collectionOptionKind ?? "upfront"
|
|
16150
|
+
};
|
|
16003
16151
|
case "pass":
|
|
16004
16152
|
return {
|
|
16005
16153
|
method: "pass",
|
|
@@ -16029,7 +16177,10 @@ function toInternalPaymentSelection(selection) {
|
|
|
16029
16177
|
function resolveEventRegistrationSubmitPlan(input) {
|
|
16030
16178
|
const selection = input.paymentSelection.method ? input.paymentSelection : void 0;
|
|
16031
16179
|
if (input.canJoinWaitlist) {
|
|
16032
|
-
return {
|
|
16180
|
+
return {
|
|
16181
|
+
ok: true,
|
|
16182
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
16183
|
+
};
|
|
16033
16184
|
}
|
|
16034
16185
|
switch (input.paymentSelection.method) {
|
|
16035
16186
|
case "pass":
|
|
@@ -16044,19 +16195,28 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
16044
16195
|
return input.paymentSelection.membershipId ? {
|
|
16045
16196
|
ok: true,
|
|
16046
16197
|
args: withOptionalSelection(
|
|
16047
|
-
{
|
|
16198
|
+
{
|
|
16199
|
+
method: "membership",
|
|
16200
|
+
membershipId: input.paymentSelection.membershipId
|
|
16201
|
+
},
|
|
16048
16202
|
selection
|
|
16049
16203
|
)
|
|
16050
16204
|
} : missingPaymentSelection();
|
|
16051
16205
|
case "free":
|
|
16052
|
-
return {
|
|
16206
|
+
return {
|
|
16207
|
+
ok: true,
|
|
16208
|
+
args: withOptionalSelection({ method: "free" }, selection)
|
|
16209
|
+
};
|
|
16053
16210
|
case null:
|
|
16054
16211
|
return input.eventRequiresPayment ? missingPaymentSelection() : { ok: true, args: { method: "free" } };
|
|
16055
16212
|
case "pass_bundle":
|
|
16056
16213
|
return input.paymentSelection.bundlePassId ? {
|
|
16057
16214
|
ok: true,
|
|
16058
16215
|
args: withOptionalSelection(
|
|
16059
|
-
{
|
|
16216
|
+
{
|
|
16217
|
+
method: "pass_bundle",
|
|
16218
|
+
passId: input.paymentSelection.bundlePassId
|
|
16219
|
+
},
|
|
16060
16220
|
selection
|
|
16061
16221
|
)
|
|
16062
16222
|
} : missingPaymentSelection();
|
|
@@ -16072,7 +16232,10 @@ function resolveEventRegistrationSubmitPlan(input) {
|
|
|
16072
16232
|
)
|
|
16073
16233
|
} : missingPaymentSelection();
|
|
16074
16234
|
case "stripe":
|
|
16075
|
-
return {
|
|
16235
|
+
return {
|
|
16236
|
+
ok: true,
|
|
16237
|
+
args: withOptionalSelection({ method: "stripe" }, selection)
|
|
16238
|
+
};
|
|
16076
16239
|
}
|
|
16077
16240
|
}
|
|
16078
16241
|
function resolveHeadlessEventRegistrationStatus(wizard) {
|
|
@@ -16234,7 +16397,7 @@ function findSelectedTicketType(input) {
|
|
|
16234
16397
|
}
|
|
16235
16398
|
|
|
16236
16399
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.ts
|
|
16237
|
-
import { useState as
|
|
16400
|
+
import { useState as useState3, useEffect as useEffect8, useCallback as useCallback5, useRef as useRef9, useReducer as useReducer7 } from "react";
|
|
16238
16401
|
|
|
16239
16402
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.state.ts
|
|
16240
16403
|
var initialEligibilityLookupState = {
|
|
@@ -16265,7 +16428,7 @@ function eligibilityLookupReducer(state, action) {
|
|
|
16265
16428
|
error: action.message
|
|
16266
16429
|
};
|
|
16267
16430
|
default:
|
|
16268
|
-
return
|
|
16431
|
+
return assertNever4(action);
|
|
16269
16432
|
}
|
|
16270
16433
|
}
|
|
16271
16434
|
var initialExistingRegistrationLookupState = {
|
|
@@ -16287,15 +16450,15 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
16287
16450
|
registration: action.registration
|
|
16288
16451
|
};
|
|
16289
16452
|
default:
|
|
16290
|
-
return
|
|
16453
|
+
return assertNever4(action);
|
|
16291
16454
|
}
|
|
16292
16455
|
}
|
|
16293
16456
|
|
|
16294
16457
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.ts
|
|
16295
16458
|
function usePortalAuth() {
|
|
16296
16459
|
const api = useBlockApi();
|
|
16297
|
-
const [authState, setAuthState] =
|
|
16298
|
-
const [profile, setProfile] =
|
|
16460
|
+
const [authState, setAuthState] = useState3("checking");
|
|
16461
|
+
const [profile, setProfile] = useState3(null);
|
|
16299
16462
|
useEffect8(() => {
|
|
16300
16463
|
let cancelled = false;
|
|
16301
16464
|
async function checkPortalAuth() {
|
|
@@ -16342,11 +16505,11 @@ function usePortalAuth() {
|
|
|
16342
16505
|
}
|
|
16343
16506
|
function useEligibility(params) {
|
|
16344
16507
|
const api = useBlockApi();
|
|
16345
|
-
const [state, dispatch] =
|
|
16508
|
+
const [state, dispatch] = useReducer7(
|
|
16346
16509
|
eligibilityLookupReducer,
|
|
16347
16510
|
initialEligibilityLookupState
|
|
16348
16511
|
);
|
|
16349
|
-
const requestIdRef =
|
|
16512
|
+
const requestIdRef = useRef9(0);
|
|
16350
16513
|
useEffect8(() => {
|
|
16351
16514
|
let cancelled = false;
|
|
16352
16515
|
async function fetchEligibility() {
|
|
@@ -16401,11 +16564,11 @@ function useExistingEventRegistration({
|
|
|
16401
16564
|
occurrenceId
|
|
16402
16565
|
}) {
|
|
16403
16566
|
const api = useBlockApi();
|
|
16404
|
-
const [state, dispatch] =
|
|
16567
|
+
const [state, dispatch] = useReducer7(
|
|
16405
16568
|
existingRegistrationLookupReducer,
|
|
16406
16569
|
initialExistingRegistrationLookupState
|
|
16407
16570
|
);
|
|
16408
|
-
const requestIdRef =
|
|
16571
|
+
const requestIdRef = useRef9(0);
|
|
16409
16572
|
useEffect8(() => {
|
|
16410
16573
|
let cancelled = false;
|
|
16411
16574
|
async function fetchExistingRegistration() {
|
|
@@ -16608,7 +16771,7 @@ function cleanupStaleRegistrations() {
|
|
|
16608
16771
|
}
|
|
16609
16772
|
|
|
16610
16773
|
// ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.ts
|
|
16611
|
-
import { useCallback as useCallback6, useEffect as useEffect11, useMemo as useMemo6, useReducer as
|
|
16774
|
+
import { useCallback as useCallback6, useEffect as useEffect11, useMemo as useMemo6, useReducer as useReducer9, useState as useState4 } from "react";
|
|
16612
16775
|
|
|
16613
16776
|
// ../blocks/src/system/runtime/nodes/event-registration/validation.ts
|
|
16614
16777
|
function validateFormData2(formData) {
|
|
@@ -16625,7 +16788,7 @@ function validateFormData2(formData) {
|
|
|
16625
16788
|
}
|
|
16626
16789
|
|
|
16627
16790
|
// ../blocks/src/system/runtime/shared/useWaitlistClaim.ts
|
|
16628
|
-
import { useEffect as useEffect9, useReducer as
|
|
16791
|
+
import { useEffect as useEffect9, useReducer as useReducer8, useSyncExternalStore } from "react";
|
|
16629
16792
|
|
|
16630
16793
|
// ../blocks/src/system/runtime/shared/useWaitlistClaim.state.ts
|
|
16631
16794
|
var DEFAULT_WAITLIST_CLAIM_ERROR = "Failed to resolve waitlist claim";
|
|
@@ -16731,7 +16894,7 @@ function useWaitlistClaim() {
|
|
|
16731
16894
|
getWaitlistClaimTokenSnapshot,
|
|
16732
16895
|
() => null
|
|
16733
16896
|
);
|
|
16734
|
-
const [state, dispatch] =
|
|
16897
|
+
const [state, dispatch] = useReducer8(
|
|
16735
16898
|
waitlistClaimReducer,
|
|
16736
16899
|
Boolean(token),
|
|
16737
16900
|
createInitialWaitlistClaimState
|
|
@@ -17055,7 +17218,7 @@ function useEventRegistrationWizard(options) {
|
|
|
17055
17218
|
[scopedEvents, options.occurrenceContext]
|
|
17056
17219
|
);
|
|
17057
17220
|
const hasPreSelectedContext = !!(options.occurrenceContext || preSelectedEvent);
|
|
17058
|
-
const [flowState, dispatchFlow] =
|
|
17221
|
+
const [flowState, dispatchFlow] = useReducer9(
|
|
17059
17222
|
registrationFlowReducer,
|
|
17060
17223
|
hasPreSelectedContext,
|
|
17061
17224
|
createInitialRegistrationFlowState
|
|
@@ -17063,24 +17226,24 @@ function useEventRegistrationWizard(options) {
|
|
|
17063
17226
|
const step = flowState.step;
|
|
17064
17227
|
const ticketsCount = flowState.ticketsCount;
|
|
17065
17228
|
const paymentSelection = flowState.paymentSelection;
|
|
17066
|
-
const [selectedEvent, setSelectedEvent] =
|
|
17067
|
-
const [formData, setFormData] =
|
|
17068
|
-
const [errors, setErrors] =
|
|
17069
|
-
const [guests, setGuests] =
|
|
17070
|
-
const [guestErrors, setGuestErrors] =
|
|
17071
|
-
const [guestSectionShake, setGuestSectionShake] =
|
|
17072
|
-
const [selectedAttendanceMode, setSelectedAttendanceMode] =
|
|
17229
|
+
const [selectedEvent, setSelectedEvent] = useState4(preSelectedEvent ?? null);
|
|
17230
|
+
const [formData, setFormData] = useState4({ name: "", email: "", phone: "", notes: "" });
|
|
17231
|
+
const [errors, setErrors] = useState4({});
|
|
17232
|
+
const [guests, setGuests] = useState4([]);
|
|
17233
|
+
const [guestErrors, setGuestErrors] = useState4({});
|
|
17234
|
+
const [guestSectionShake, setGuestSectionShake] = useState4(false);
|
|
17235
|
+
const [selectedAttendanceMode, setSelectedAttendanceMode] = useState4(
|
|
17073
17236
|
preSelectedEvent?.deliveryMode === "online" ? "online" : preSelectedEvent?.deliveryMode === "in_person" ? "in_person" : null
|
|
17074
17237
|
);
|
|
17075
|
-
const [selectedTicketTypeId, setSelectedTicketTypeId] =
|
|
17076
|
-
const [registrationResult, setRegistrationResult] =
|
|
17077
|
-
const [errorMessage, setErrorMessage] =
|
|
17078
|
-
const [altchaSolution, setAltchaSolution] =
|
|
17238
|
+
const [selectedTicketTypeId, setSelectedTicketTypeId] = useState4(null);
|
|
17239
|
+
const [registrationResult, setRegistrationResult] = useState4(null);
|
|
17240
|
+
const [errorMessage, setErrorMessage] = useState4("");
|
|
17241
|
+
const [altchaSolution, setAltchaSolution] = useState4(null);
|
|
17079
17242
|
const { authState: portalAuthState, profile: portalProfile } = usePortalAuth();
|
|
17080
17243
|
const waitlistClaim = useWaitlistClaim();
|
|
17081
|
-
const [showMagicLinkModal, setShowMagicLinkModal] =
|
|
17082
|
-
const [pendingAttendeeId, setPendingAttendeeId] =
|
|
17083
|
-
const [paymentStepState, setPaymentStepState] =
|
|
17244
|
+
const [showMagicLinkModal, setShowMagicLinkModal] = useState4(false);
|
|
17245
|
+
const [pendingAttendeeId, setPendingAttendeeId] = useState4(null);
|
|
17246
|
+
const [paymentStepState, setPaymentStepState] = useState4({
|
|
17084
17247
|
status: "loading",
|
|
17085
17248
|
canContinue: false,
|
|
17086
17249
|
buttonText: "Continue",
|
|
@@ -18277,10 +18440,10 @@ function buildResponsiveScopeRulePatternSource() {
|
|
|
18277
18440
|
}
|
|
18278
18441
|
|
|
18279
18442
|
// ../theme-core/src/ThemeScopeCore.tsx
|
|
18280
|
-
import { jsx as
|
|
18443
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
18281
18444
|
|
|
18282
18445
|
// ../theme-core/src/ClientThemeScope.tsx
|
|
18283
|
-
import { jsx as
|
|
18446
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
18284
18447
|
|
|
18285
18448
|
// ../blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.ts
|
|
18286
18449
|
import React4, { useCallback as useCallback7, useMemo as useMemo8 } from "react";
|
|
@@ -18554,7 +18717,7 @@ function resolvePaymentModel(wizard) {
|
|
|
18554
18717
|
}
|
|
18555
18718
|
|
|
18556
18719
|
// ../blocks/src/system/runtime/hooks/useBookingFormConfig.ts
|
|
18557
|
-
import { useEffect as useEffect12, useReducer as
|
|
18720
|
+
import { useEffect as useEffect12, useReducer as useReducer10 } from "react";
|
|
18558
18721
|
|
|
18559
18722
|
// ../blocks/src/system/runtime/hooks/useBookingFormConfig.state.ts
|
|
18560
18723
|
var EMPTY_SNAPSHOT = Object.freeze({
|
|
@@ -18609,7 +18772,7 @@ function bookingFormConfigReducer(state, action) {
|
|
|
18609
18772
|
previous: toBookingFormConfigSnapshot(state)
|
|
18610
18773
|
};
|
|
18611
18774
|
default:
|
|
18612
|
-
return
|
|
18775
|
+
return assertNever4(action);
|
|
18613
18776
|
}
|
|
18614
18777
|
}
|
|
18615
18778
|
function selectBookingFormConfig(state) {
|
|
@@ -18635,14 +18798,14 @@ function toBookingFormConfigSnapshot(state) {
|
|
|
18635
18798
|
services: state.services
|
|
18636
18799
|
};
|
|
18637
18800
|
default:
|
|
18638
|
-
return
|
|
18801
|
+
return assertNever4(state);
|
|
18639
18802
|
}
|
|
18640
18803
|
}
|
|
18641
18804
|
|
|
18642
18805
|
// ../blocks/src/system/runtime/hooks/useBookingFormConfig.ts
|
|
18643
18806
|
function useBookingFormConfig(siteId, formId) {
|
|
18644
18807
|
const api = useBlockApi();
|
|
18645
|
-
const [state, dispatch] =
|
|
18808
|
+
const [state, dispatch] = useReducer10(
|
|
18646
18809
|
bookingFormConfigReducer,
|
|
18647
18810
|
void 0,
|
|
18648
18811
|
createInitialBookingFormConfigState
|