@riverbankcms/sdk 0.148.0 → 0.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-DBKln68M.mjs} +103 -66
- package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-DpRX4Mum.mjs} +3 -6
- package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-DJPmPY-r.mjs} +95 -67
- package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-JYA0cJ_Z.mjs} +982 -734
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
- package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/endpoints.d.ts +2 -10
- package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
- package/dist/_dts/api/src/index.d.ts +3 -3
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/index.d.ts +1 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +3 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +2 -1
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/edit-lease.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +3 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +297 -36
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-Cr3EeTP5.mjs} +408 -69
- package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-BFGB1Fay.mjs} +2 -2
- package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-DKYV0_ft.mjs} +6 -6
- package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-B9UIcEYc.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CFLPkP0K.mjs} +1 -1
- package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-JjmgxEsR.mjs} +1 -1
- package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-CKV1Jh2m.mjs} +1 -1
- package/dist/client/{accordion-kjvt49rA.mjs → accordion-DXWIfT3T.mjs} +1 -1
- package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-CjZgHNvv.mjs} +11 -8
- package/dist/client/bookings.mjs +424 -320
- package/dist/client/{carousel-f4Zbmicv.mjs → carousel-DSLikmvZ.mjs} +1 -1
- package/dist/client/{cart-DO20An50.mjs → cart-HDjWReFt.mjs} +3 -3
- package/dist/client/{checkout-Du5amDR_.mjs → checkout-CUvRZA3W.mjs} +3 -3
- package/dist/client/client.mjs +963 -866
- package/dist/client/{context-eW97E945.mjs → context-DFmaZa-Q.mjs} +1 -1
- package/dist/client/{dates-jPCirRea.mjs → dates-BBep1JnF.mjs} +2 -2
- package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-zEobhxo4.mjs} +9 -9
- package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-Dp7bz5k-.mjs} +4 -4
- package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-FE-zqTt7.mjs} +4 -4
- package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-BMt5snal.mjs} +4 -4
- package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-O6ZxHfOb.mjs} +67 -342
- package/dist/client/{form-BvpfbQaT.mjs → form-DFa1D8vt.mjs} +3 -3
- package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-CmjHLR-N.mjs} +3 -3
- package/dist/client/hooks.mjs +160 -129
- package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BXKP_lGh.mjs} +3 -3
- package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-CU-HmxGx.mjs} +3 -3
- package/dist/client/{pricing-BES87mrR.mjs → pricing-KEAEsibq.mjs} +1 -1
- package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-Ckp7MGnt.mjs} +3 -3
- package/dist/client/{productList-DE7ngEZJ.mjs → productList-D91V0sYa.mjs} +3 -3
- package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DZd6RJeA.mjs} +155 -77
- package/dist/client/rendering/client.mjs +3356 -3192
- package/dist/client/rendering/islands.mjs +17 -17
- package/dist/client/rendering.mjs +956 -841
- package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-E1EkhhYY.mjs} +1 -1
- package/dist/client/{shop-CJkuySJ3.mjs → shop-4F2jLQPI.mjs} +12 -13
- package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-BbfCJjB3.mjs} +6 -6
- package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-vicweP2K.mjs} +1 -1
- package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DlONJt0T.mjs} +4 -4
- package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-COYyL3m7.mjs} +6 -6
- package/dist/preview-next/before-render.mjs +15 -22
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +149 -82
- package/dist/preview-next/middleware.mjs +15 -22
- package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
- package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-CwvFFjB-.mjs} +2 -2
- package/dist/{separator-CuNhBAhS.mjs → separator-ByL72zUT.mjs} +1 -1
- package/dist/server/components.mjs +167 -131
- package/dist/server/config-validation.mjs +160 -129
- package/dist/server/config.mjs +160 -129
- package/dist/server/data.mjs +160 -129
- package/dist/server/index.mjs +20 -27
- package/dist/server/next.mjs +174 -156
- package/dist/server/page-converter.mjs +145 -65
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +169 -131
- package/dist/server/rendering.mjs +167 -131
- package/dist/server/routing.mjs +165 -118
- package/dist/server/server.mjs +167 -154
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
|
@@ -11644,6 +11644,16 @@ function isRecord$8(value) {
|
|
|
11644
11644
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11645
11645
|
}
|
|
11646
11646
|
//#endregion
|
|
11647
|
+
//#region ../core/src/booking-payment-options.ts
|
|
11648
|
+
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
11649
|
+
function validateBookingPaymentOptionKinds(kinds) {
|
|
11650
|
+
if (kinds.length === 0) return err("no_options");
|
|
11651
|
+
const uniqueKinds = new Set(kinds);
|
|
11652
|
+
if (uniqueKinds.size !== kinds.length) return err("duplicate_kind");
|
|
11653
|
+
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err("incompatible_collection_options");
|
|
11654
|
+
return ok(void 0);
|
|
11655
|
+
}
|
|
11656
|
+
//#endregion
|
|
11647
11657
|
//#region ../core/src/booking-time-zone.ts
|
|
11648
11658
|
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
11649
11659
|
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
@@ -22000,68 +22010,115 @@ function createRichTextDocFromMarkdown(markdown) {
|
|
|
22000
22010
|
};
|
|
22001
22011
|
}
|
|
22002
22012
|
//#endregion
|
|
22003
|
-
//#region ../
|
|
22004
|
-
const
|
|
22005
|
-
const
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
intervalUnit: z.enum([
|
|
22012
|
-
"day",
|
|
22013
|
-
"week",
|
|
22014
|
-
"month"
|
|
22015
|
-
])
|
|
22016
|
-
}),
|
|
22017
|
-
z.object({
|
|
22018
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
22019
|
-
depositAmountCents: z.number().int().min(0),
|
|
22020
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
22021
|
-
instalmentCount: z.number().int().positive(),
|
|
22022
|
-
intervalCount: z.number().int().positive(),
|
|
22023
|
-
intervalUnit: z.enum([
|
|
22024
|
-
"day",
|
|
22025
|
-
"week",
|
|
22026
|
-
"month"
|
|
22027
|
-
])
|
|
22028
|
-
}),
|
|
22029
|
-
z.object({
|
|
22030
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
22031
|
-
instalmentCount: z.number().int().positive(),
|
|
22032
|
-
intervalCount: z.number().int().positive(),
|
|
22033
|
-
intervalUnit: z.enum([
|
|
22034
|
-
"day",
|
|
22035
|
-
"week",
|
|
22036
|
-
"month"
|
|
22037
|
-
])
|
|
22038
|
-
})
|
|
22013
|
+
//#region ../core/src/booking-payment-schemas.ts
|
|
22014
|
+
const stripObject = (shape) => z.object(shape);
|
|
22015
|
+
const strictObject = (shape) => z.strictObject(shape);
|
|
22016
|
+
const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
22017
|
+
const intervalUnitSchema = z.enum([
|
|
22018
|
+
"day",
|
|
22019
|
+
"week",
|
|
22020
|
+
"month"
|
|
22039
22021
|
]);
|
|
22040
|
-
const
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22044
|
-
|
|
22045
|
-
|
|
22046
|
-
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
|
|
22061
|
-
|
|
22062
|
-
|
|
22063
|
-
|
|
22064
|
-
|
|
22022
|
+
const nonNegativeIntegerSchema = z.number().int().nonnegative();
|
|
22023
|
+
const positiveIntegerSchema = z.number().int().positive();
|
|
22024
|
+
function createInstalmentPlanSchema(object) {
|
|
22025
|
+
return z.discriminatedUnion("kind", [
|
|
22026
|
+
object({
|
|
22027
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
22028
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
22029
|
+
depositRefundability: depositRefundPolicySchema,
|
|
22030
|
+
remainderDueCount: positiveIntegerSchema,
|
|
22031
|
+
intervalUnit: intervalUnitSchema
|
|
22032
|
+
}),
|
|
22033
|
+
object({
|
|
22034
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
22035
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
22036
|
+
depositRefundability: depositRefundPolicySchema,
|
|
22037
|
+
instalmentCount: positiveIntegerSchema,
|
|
22038
|
+
intervalCount: positiveIntegerSchema,
|
|
22039
|
+
intervalUnit: intervalUnitSchema
|
|
22040
|
+
}),
|
|
22041
|
+
object({
|
|
22042
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
22043
|
+
instalmentCount: positiveIntegerSchema,
|
|
22044
|
+
intervalCount: positiveIntegerSchema,
|
|
22045
|
+
intervalUnit: intervalUnitSchema
|
|
22046
|
+
})
|
|
22047
|
+
]);
|
|
22048
|
+
}
|
|
22049
|
+
function createFlexibleBalanceSchemas(object) {
|
|
22050
|
+
const dueDateRule = z.discriminatedUnion("kind", [object({
|
|
22051
|
+
kind: z.literal("relative_to_start_date"),
|
|
22052
|
+
daysBeforeStart: positiveIntegerSchema
|
|
22053
|
+
}), object({
|
|
22054
|
+
kind: z.literal("fixed_calendar_date"),
|
|
22055
|
+
dueAt: z.string().datetime()
|
|
22056
|
+
})]);
|
|
22057
|
+
return {
|
|
22058
|
+
dueDateRule,
|
|
22059
|
+
config: object({
|
|
22060
|
+
upfrontAmountCents: nonNegativeIntegerSchema,
|
|
22061
|
+
dueDateRule,
|
|
22062
|
+
depositRefundability: depositRefundPolicySchema
|
|
22063
|
+
})
|
|
22064
|
+
};
|
|
22065
|
+
}
|
|
22066
|
+
const paymentOptionKindsMessages = {
|
|
22067
|
+
no_options: "Choose at least one way for customers to pay.",
|
|
22068
|
+
duplicate_kind: "Choose each payment option only once.",
|
|
22069
|
+
incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
|
|
22070
|
+
};
|
|
22071
|
+
function buildBookingPaymentOptionSchemas(object) {
|
|
22072
|
+
const instalmentPlan = createInstalmentPlanSchema(object);
|
|
22073
|
+
const flexibleBalance = createFlexibleBalanceSchemas(object);
|
|
22074
|
+
const paymentCollectionOption = z.discriminatedUnion("kind", [
|
|
22075
|
+
object({ kind: z.literal("upfront") }),
|
|
22076
|
+
object({ kind: z.literal("deferred_manual") }),
|
|
22077
|
+
object({
|
|
22078
|
+
kind: z.literal("instalment_plan"),
|
|
22079
|
+
plan: instalmentPlan
|
|
22080
|
+
}),
|
|
22081
|
+
object({
|
|
22082
|
+
kind: z.literal("flexible_balance"),
|
|
22083
|
+
config: flexibleBalance.config
|
|
22084
|
+
})
|
|
22085
|
+
]);
|
|
22086
|
+
const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
|
|
22087
|
+
const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
|
|
22088
|
+
if (!result.ok) ctx.addIssue({
|
|
22089
|
+
code: "custom",
|
|
22090
|
+
path: ["allowedOptions"],
|
|
22091
|
+
message: paymentOptionKindsMessages[result.error]
|
|
22092
|
+
});
|
|
22093
|
+
});
|
|
22094
|
+
const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
|
|
22095
|
+
source: z.literal("custom"),
|
|
22096
|
+
paymentTerms
|
|
22097
|
+
})]);
|
|
22098
|
+
return {
|
|
22099
|
+
depositRefundPolicy: depositRefundPolicySchema,
|
|
22100
|
+
instalmentPlan,
|
|
22101
|
+
flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
|
|
22102
|
+
flexibleBalanceConfig: flexibleBalance.config,
|
|
22103
|
+
paymentCollectionOption,
|
|
22104
|
+
paymentTerms,
|
|
22105
|
+
paymentOptionsChoice
|
|
22106
|
+
};
|
|
22107
|
+
}
|
|
22108
|
+
function createBookingPaymentOptionSchemas(mode) {
|
|
22109
|
+
return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
|
|
22110
|
+
}
|
|
22111
|
+
const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
|
|
22112
|
+
bookingPaymentOptionSchemas.depositRefundPolicy;
|
|
22113
|
+
bookingPaymentOptionSchemas.instalmentPlan;
|
|
22114
|
+
bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
|
|
22115
|
+
bookingPaymentOptionSchemas.flexibleBalanceConfig;
|
|
22116
|
+
bookingPaymentOptionSchemas.paymentCollectionOption;
|
|
22117
|
+
const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
|
|
22118
|
+
bookingPaymentOptionSchemas.paymentOptionsChoice;
|
|
22119
|
+
//#endregion
|
|
22120
|
+
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
22121
|
+
const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
|
|
22065
22122
|
//#endregion
|
|
22066
22123
|
//#region ../blocks/src/system/blocks/shared/bookingConsent.ts
|
|
22067
22124
|
const blockBookingConsentSchema = z.object({
|
|
@@ -22663,7 +22720,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
|
|
|
22663
22720
|
/**
|
|
22664
22721
|
* Public membership product for shop display
|
|
22665
22722
|
*/
|
|
22666
|
-
const
|
|
22723
|
+
const publicMembershipProductFields = {
|
|
22667
22724
|
id: z.string(),
|
|
22668
22725
|
name: z.string(),
|
|
22669
22726
|
description: z.string().nullable(),
|
|
@@ -22672,7 +22729,16 @@ const publicMembershipProductSchema = z.object({
|
|
|
22672
22729
|
billingInterval: z.enum(["month", "year"]),
|
|
22673
22730
|
eligibleCategoryIds: z.array(z.string()),
|
|
22674
22731
|
eligibleCategoryNames: z.array(z.string())
|
|
22732
|
+
};
|
|
22733
|
+
const purchasablePublicMembershipProductSchema = z.object({
|
|
22734
|
+
...publicMembershipProductFields,
|
|
22735
|
+
purchaseAvailability: z.literal("purchasable")
|
|
22675
22736
|
});
|
|
22737
|
+
const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
|
|
22738
|
+
...publicMembershipProductFields,
|
|
22739
|
+
purchaseAvailability: z.literal("display_only"),
|
|
22740
|
+
unavailabilityReason: z.literal("online_payments_unavailable")
|
|
22741
|
+
})]);
|
|
22676
22742
|
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
22677
22743
|
//#endregion
|
|
22678
22744
|
//#region ../blocks/src/system/blocks/event-registration.shared.ts
|
|
@@ -28442,7 +28508,7 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
28442
28508
|
product: pass
|
|
28443
28509
|
} : {
|
|
28444
28510
|
kind: "unavailable",
|
|
28445
|
-
label: "Online purchasing
|
|
28511
|
+
label: "Online purchasing is unavailable."
|
|
28446
28512
|
}
|
|
28447
28513
|
};
|
|
28448
28514
|
});
|
|
@@ -28452,7 +28518,14 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
28452
28518
|
description: options.showDescriptions ? membership.description : null,
|
|
28453
28519
|
priceLabel: formatCommercePrice(membership.price, membership.currency),
|
|
28454
28520
|
intervalLabel: formatInterval(membership.billingInterval),
|
|
28455
|
-
|
|
28521
|
+
action: membership.purchaseAvailability === "purchasable" ? {
|
|
28522
|
+
kind: "purchase",
|
|
28523
|
+
label: options.membershipActionLabel,
|
|
28524
|
+
product: membership
|
|
28525
|
+
} : {
|
|
28526
|
+
kind: "unavailable",
|
|
28527
|
+
label: "Online purchasing is unavailable."
|
|
28528
|
+
}
|
|
28456
28529
|
}));
|
|
28457
28530
|
return {
|
|
28458
28531
|
kind: "passes-memberships",
|
|
@@ -28672,7 +28745,14 @@ const membershipCardDisplaySchema = z.object({
|
|
|
28672
28745
|
description: z.string().nullable(),
|
|
28673
28746
|
priceLabel: z.string(),
|
|
28674
28747
|
intervalLabel: z.string(),
|
|
28675
|
-
|
|
28748
|
+
action: z.discriminatedUnion("kind", [z.object({
|
|
28749
|
+
kind: z.literal("purchase"),
|
|
28750
|
+
label: z.string(),
|
|
28751
|
+
product: purchasablePublicMembershipProductSchema
|
|
28752
|
+
}), z.object({
|
|
28753
|
+
kind: z.literal("unavailable"),
|
|
28754
|
+
label: z.string()
|
|
28755
|
+
})])
|
|
28676
28756
|
});
|
|
28677
28757
|
const passesMembershipsDisplaySchema = z.object({
|
|
28678
28758
|
kind: z.literal("passes-memberships"),
|
package/dist/server/prebuild.mjs
CHANGED
|
@@ -390,6 +390,16 @@ function isRecord$22(value) {
|
|
|
390
390
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
391
391
|
}
|
|
392
392
|
//#endregion
|
|
393
|
+
//#region ../core/src/booking-payment-options.ts
|
|
394
|
+
/** Automatic instalments and a flexible balance cannot share one booking offer. */
|
|
395
|
+
function validateBookingPaymentOptionKinds(kinds) {
|
|
396
|
+
if (kinds.length === 0) return err("no_options");
|
|
397
|
+
const uniqueKinds = new Set(kinds);
|
|
398
|
+
if (uniqueKinds.size !== kinds.length) return err("duplicate_kind");
|
|
399
|
+
if (uniqueKinds.has("instalment_plan") && uniqueKinds.has("flexible_balance")) return err("incompatible_collection_options");
|
|
400
|
+
return ok$1(void 0);
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
393
403
|
//#region ../core/src/booking-time-zone.ts
|
|
394
404
|
const TIME_ZONE_VALIDITY_CACHE_LIMIT = 100;
|
|
395
405
|
const timeZoneValidityCache = /* @__PURE__ */ new Map();
|
|
@@ -28767,68 +28777,115 @@ function isRichTextDoc(value) {
|
|
|
28767
28777
|
return RichTextDocSchema.safeParse(value).success;
|
|
28768
28778
|
}
|
|
28769
28779
|
//#endregion
|
|
28770
|
-
//#region ../
|
|
28771
|
-
const
|
|
28772
|
-
const
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
|
|
28778
|
-
intervalUnit: z.enum([
|
|
28779
|
-
"day",
|
|
28780
|
-
"week",
|
|
28781
|
-
"month"
|
|
28782
|
-
])
|
|
28783
|
-
}),
|
|
28784
|
-
z.object({
|
|
28785
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
28786
|
-
depositAmountCents: z.number().int().min(0),
|
|
28787
|
-
depositRefundability: bookingDepositRefundPolicySchema$1,
|
|
28788
|
-
instalmentCount: z.number().int().positive(),
|
|
28789
|
-
intervalCount: z.number().int().positive(),
|
|
28790
|
-
intervalUnit: z.enum([
|
|
28791
|
-
"day",
|
|
28792
|
-
"week",
|
|
28793
|
-
"month"
|
|
28794
|
-
])
|
|
28795
|
-
}),
|
|
28796
|
-
z.object({
|
|
28797
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
28798
|
-
instalmentCount: z.number().int().positive(),
|
|
28799
|
-
intervalCount: z.number().int().positive(),
|
|
28800
|
-
intervalUnit: z.enum([
|
|
28801
|
-
"day",
|
|
28802
|
-
"week",
|
|
28803
|
-
"month"
|
|
28804
|
-
])
|
|
28805
|
-
})
|
|
28806
|
-
]);
|
|
28807
|
-
const bookingFlexibleBalanceDueDateRuleSchema$1 = z.union([z.object({
|
|
28808
|
-
kind: z.literal("relative_to_start_date"),
|
|
28809
|
-
daysBeforeStart: z.number().int().positive()
|
|
28810
|
-
}), z.object({
|
|
28811
|
-
kind: z.literal("fixed_calendar_date"),
|
|
28812
|
-
dueAt: z.string().datetime()
|
|
28813
|
-
})]);
|
|
28814
|
-
const bookingFlexibleBalanceConfigSchema$1 = z.object({
|
|
28815
|
-
upfrontAmountCents: z.number().int().min(0),
|
|
28816
|
-
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema$1,
|
|
28817
|
-
depositRefundability: bookingDepositRefundPolicySchema$1
|
|
28818
|
-
});
|
|
28819
|
-
const blockBookingPaymentCollectionOptionSchema = z.union([
|
|
28820
|
-
z.object({ kind: z.literal("upfront") }),
|
|
28821
|
-
z.object({ kind: z.literal("deferred_manual") }),
|
|
28822
|
-
z.object({
|
|
28823
|
-
kind: z.literal("instalment_plan"),
|
|
28824
|
-
plan: bookingInstalmentPlanSchema$1
|
|
28825
|
-
}),
|
|
28826
|
-
z.object({
|
|
28827
|
-
kind: z.literal("flexible_balance"),
|
|
28828
|
-
config: bookingFlexibleBalanceConfigSchema$1
|
|
28829
|
-
})
|
|
28780
|
+
//#region ../core/src/booking-payment-schemas.ts
|
|
28781
|
+
const stripObject = (shape) => z.object(shape);
|
|
28782
|
+
const strictObject = (shape) => z.strictObject(shape);
|
|
28783
|
+
const depositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
28784
|
+
const intervalUnitSchema = z.enum([
|
|
28785
|
+
"day",
|
|
28786
|
+
"week",
|
|
28787
|
+
"month"
|
|
28830
28788
|
]);
|
|
28831
|
-
const
|
|
28789
|
+
const nonNegativeIntegerSchema = z.number().int().nonnegative();
|
|
28790
|
+
const positiveIntegerSchema = z.number().int().positive();
|
|
28791
|
+
function createInstalmentPlanSchema(object) {
|
|
28792
|
+
return z.discriminatedUnion("kind", [
|
|
28793
|
+
object({
|
|
28794
|
+
kind: z.literal("deposit_plus_one_remainder"),
|
|
28795
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
28796
|
+
depositRefundability: depositRefundPolicySchema,
|
|
28797
|
+
remainderDueCount: positiveIntegerSchema,
|
|
28798
|
+
intervalUnit: intervalUnitSchema
|
|
28799
|
+
}),
|
|
28800
|
+
object({
|
|
28801
|
+
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
28802
|
+
depositAmountCents: nonNegativeIntegerSchema,
|
|
28803
|
+
depositRefundability: depositRefundPolicySchema,
|
|
28804
|
+
instalmentCount: positiveIntegerSchema,
|
|
28805
|
+
intervalCount: positiveIntegerSchema,
|
|
28806
|
+
intervalUnit: intervalUnitSchema
|
|
28807
|
+
}),
|
|
28808
|
+
object({
|
|
28809
|
+
kind: z.literal("equal_scheduled_instalments"),
|
|
28810
|
+
instalmentCount: positiveIntegerSchema,
|
|
28811
|
+
intervalCount: positiveIntegerSchema,
|
|
28812
|
+
intervalUnit: intervalUnitSchema
|
|
28813
|
+
})
|
|
28814
|
+
]);
|
|
28815
|
+
}
|
|
28816
|
+
function createFlexibleBalanceSchemas(object) {
|
|
28817
|
+
const dueDateRule = z.discriminatedUnion("kind", [object({
|
|
28818
|
+
kind: z.literal("relative_to_start_date"),
|
|
28819
|
+
daysBeforeStart: positiveIntegerSchema
|
|
28820
|
+
}), object({
|
|
28821
|
+
kind: z.literal("fixed_calendar_date"),
|
|
28822
|
+
dueAt: z.string().datetime()
|
|
28823
|
+
})]);
|
|
28824
|
+
return {
|
|
28825
|
+
dueDateRule,
|
|
28826
|
+
config: object({
|
|
28827
|
+
upfrontAmountCents: nonNegativeIntegerSchema,
|
|
28828
|
+
dueDateRule,
|
|
28829
|
+
depositRefundability: depositRefundPolicySchema
|
|
28830
|
+
})
|
|
28831
|
+
};
|
|
28832
|
+
}
|
|
28833
|
+
const paymentOptionKindsMessages = {
|
|
28834
|
+
no_options: "Choose at least one way for customers to pay.",
|
|
28835
|
+
duplicate_kind: "Choose each payment option only once.",
|
|
28836
|
+
incompatible_collection_options: "Offer instalments or a deposit with the rest paid later, but not both."
|
|
28837
|
+
};
|
|
28838
|
+
function buildBookingPaymentOptionSchemas(object) {
|
|
28839
|
+
const instalmentPlan = createInstalmentPlanSchema(object);
|
|
28840
|
+
const flexibleBalance = createFlexibleBalanceSchemas(object);
|
|
28841
|
+
const paymentCollectionOption = z.discriminatedUnion("kind", [
|
|
28842
|
+
object({ kind: z.literal("upfront") }),
|
|
28843
|
+
object({ kind: z.literal("deferred_manual") }),
|
|
28844
|
+
object({
|
|
28845
|
+
kind: z.literal("instalment_plan"),
|
|
28846
|
+
plan: instalmentPlan
|
|
28847
|
+
}),
|
|
28848
|
+
object({
|
|
28849
|
+
kind: z.literal("flexible_balance"),
|
|
28850
|
+
config: flexibleBalance.config
|
|
28851
|
+
})
|
|
28852
|
+
]);
|
|
28853
|
+
const paymentTerms = object({ allowedOptions: z.array(paymentCollectionOption) }).superRefine(({ allowedOptions }, ctx) => {
|
|
28854
|
+
const result = validateBookingPaymentOptionKinds(allowedOptions.map(({ kind }) => kind));
|
|
28855
|
+
if (!result.ok) ctx.addIssue({
|
|
28856
|
+
code: "custom",
|
|
28857
|
+
path: ["allowedOptions"],
|
|
28858
|
+
message: paymentOptionKindsMessages[result.error]
|
|
28859
|
+
});
|
|
28860
|
+
});
|
|
28861
|
+
const paymentOptionsChoice = z.discriminatedUnion("source", [z.strictObject({ source: z.literal("default") }), z.strictObject({
|
|
28862
|
+
source: z.literal("custom"),
|
|
28863
|
+
paymentTerms
|
|
28864
|
+
})]);
|
|
28865
|
+
return {
|
|
28866
|
+
depositRefundPolicy: depositRefundPolicySchema,
|
|
28867
|
+
instalmentPlan,
|
|
28868
|
+
flexibleBalanceDueDateRule: flexibleBalance.dueDateRule,
|
|
28869
|
+
flexibleBalanceConfig: flexibleBalance.config,
|
|
28870
|
+
paymentCollectionOption,
|
|
28871
|
+
paymentTerms,
|
|
28872
|
+
paymentOptionsChoice
|
|
28873
|
+
};
|
|
28874
|
+
}
|
|
28875
|
+
function createBookingPaymentOptionSchemas(mode) {
|
|
28876
|
+
return mode === "strict" ? buildBookingPaymentOptionSchemas(strictObject) : buildBookingPaymentOptionSchemas(stripObject);
|
|
28877
|
+
}
|
|
28878
|
+
const bookingPaymentOptionSchemas = createBookingPaymentOptionSchemas("strip");
|
|
28879
|
+
bookingPaymentOptionSchemas.depositRefundPolicy;
|
|
28880
|
+
bookingPaymentOptionSchemas.instalmentPlan;
|
|
28881
|
+
bookingPaymentOptionSchemas.flexibleBalanceDueDateRule;
|
|
28882
|
+
bookingPaymentOptionSchemas.flexibleBalanceConfig;
|
|
28883
|
+
bookingPaymentOptionSchemas.paymentCollectionOption;
|
|
28884
|
+
const bookingPaymentTermsSchema = bookingPaymentOptionSchemas.paymentTerms;
|
|
28885
|
+
bookingPaymentOptionSchemas.paymentOptionsChoice;
|
|
28886
|
+
//#endregion
|
|
28887
|
+
//#region ../blocks/src/system/blocks/shared/bookingPaymentTerms.ts
|
|
28888
|
+
const blockBookingPaymentTermsSchema = bookingPaymentTermsSchema;
|
|
28832
28889
|
//#endregion
|
|
28833
28890
|
//#region ../blocks/src/system/blocks/shared/bookingConsent.ts
|
|
28834
28891
|
const blockBookingConsentSchema = z.object({
|
|
@@ -29798,6 +29855,13 @@ const STRUCTURED_KEYS = /* @__PURE__ */ new Set([
|
|
|
29798
29855
|
"domainOperationProvider",
|
|
29799
29856
|
"domainOperationError",
|
|
29800
29857
|
"domainOperationMetadata",
|
|
29858
|
+
"previewDecision",
|
|
29859
|
+
"previewOutcome",
|
|
29860
|
+
"previewTokenTtlBucket",
|
|
29861
|
+
"previewRefreshCookiePresent",
|
|
29862
|
+
"previewDashboardStatus",
|
|
29863
|
+
"previewProviderResult",
|
|
29864
|
+
"previewUpstreamStatus",
|
|
29801
29865
|
"durationMs",
|
|
29802
29866
|
"duration",
|
|
29803
29867
|
"status",
|
|
@@ -38055,7 +38119,7 @@ const publicPassProductCollectionSchema = z.object({ passes: z.array(publicPassP
|
|
|
38055
38119
|
/**
|
|
38056
38120
|
* Public membership product for shop display
|
|
38057
38121
|
*/
|
|
38058
|
-
const
|
|
38122
|
+
const publicMembershipProductFields = {
|
|
38059
38123
|
id: z.string(),
|
|
38060
38124
|
name: z.string(),
|
|
38061
38125
|
description: z.string().nullable(),
|
|
@@ -38064,7 +38128,16 @@ const publicMembershipProductSchema = z.object({
|
|
|
38064
38128
|
billingInterval: z.enum(["month", "year"]),
|
|
38065
38129
|
eligibleCategoryIds: z.array(z.string()),
|
|
38066
38130
|
eligibleCategoryNames: z.array(z.string())
|
|
38131
|
+
};
|
|
38132
|
+
const purchasablePublicMembershipProductSchema = z.object({
|
|
38133
|
+
...publicMembershipProductFields,
|
|
38134
|
+
purchaseAvailability: z.literal("purchasable")
|
|
38067
38135
|
});
|
|
38136
|
+
const publicMembershipProductSchema = z.discriminatedUnion("purchaseAvailability", [purchasablePublicMembershipProductSchema, z.object({
|
|
38137
|
+
...publicMembershipProductFields,
|
|
38138
|
+
purchaseAvailability: z.literal("display_only"),
|
|
38139
|
+
unavailabilityReason: z.literal("online_payments_unavailable")
|
|
38140
|
+
})]);
|
|
38068
38141
|
const publicMembershipProductCollectionSchema = z.object({ memberships: z.array(publicMembershipProductSchema) });
|
|
38069
38142
|
//#endregion
|
|
38070
38143
|
//#region ../blocks/src/system/blocks/products/shared.ts
|
|
@@ -38305,7 +38378,7 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
38305
38378
|
product: pass
|
|
38306
38379
|
} : {
|
|
38307
38380
|
kind: "unavailable",
|
|
38308
|
-
label: "Online purchasing
|
|
38381
|
+
label: "Online purchasing is unavailable."
|
|
38309
38382
|
}
|
|
38310
38383
|
};
|
|
38311
38384
|
});
|
|
@@ -38315,7 +38388,14 @@ function buildPassesMembershipsDisplay(options) {
|
|
|
38315
38388
|
description: options.showDescriptions ? membership.description : null,
|
|
38316
38389
|
priceLabel: formatCommercePrice(membership.price, membership.currency),
|
|
38317
38390
|
intervalLabel: formatInterval(membership.billingInterval),
|
|
38318
|
-
|
|
38391
|
+
action: membership.purchaseAvailability === "purchasable" ? {
|
|
38392
|
+
kind: "purchase",
|
|
38393
|
+
label: options.membershipActionLabel,
|
|
38394
|
+
product: membership
|
|
38395
|
+
} : {
|
|
38396
|
+
kind: "unavailable",
|
|
38397
|
+
label: "Online purchasing is unavailable."
|
|
38398
|
+
}
|
|
38319
38399
|
}));
|
|
38320
38400
|
return {
|
|
38321
38401
|
kind: "passes-memberships",
|
|
@@ -38535,7 +38615,14 @@ const membershipCardDisplaySchema = z.object({
|
|
|
38535
38615
|
description: z.string().nullable(),
|
|
38536
38616
|
priceLabel: z.string(),
|
|
38537
38617
|
intervalLabel: z.string(),
|
|
38538
|
-
|
|
38618
|
+
action: z.discriminatedUnion("kind", [z.object({
|
|
38619
|
+
kind: z.literal("purchase"),
|
|
38620
|
+
label: z.string(),
|
|
38621
|
+
product: purchasablePublicMembershipProductSchema
|
|
38622
|
+
}), z.object({
|
|
38623
|
+
kind: z.literal("unavailable"),
|
|
38624
|
+
label: z.string()
|
|
38625
|
+
})])
|
|
38539
38626
|
});
|
|
38540
38627
|
const passesMembershipsDisplaySchema = z.object({
|
|
38541
38628
|
kind: z.literal("passes-memberships"),
|
|
@@ -45130,11 +45217,11 @@ function ShopSSR({ blockId, siteId, apiBaseUrl, stage, children, checkoutEndpoin
|
|
|
45130
45217
|
}, pass.id)),
|
|
45131
45218
|
membershipCards: render.display.memberships.map((membership) => /* @__PURE__ */ jsx(MembershipCardView, {
|
|
45132
45219
|
display: membership,
|
|
45133
|
-
action: /* @__PURE__ */ jsx(ThemedButton, {
|
|
45220
|
+
action: membership.action.kind === "unavailable" ? /* @__PURE__ */ jsx(PassPurchaseUnavailable, { label: membership.action.label }) : /* @__PURE__ */ jsx(ThemedButton, {
|
|
45134
45221
|
type: "button",
|
|
45135
45222
|
variant: render.hydration.buttonVariant,
|
|
45136
45223
|
size: "md",
|
|
45137
|
-
label: membership.
|
|
45224
|
+
label: membership.action.label,
|
|
45138
45225
|
disabled: true,
|
|
45139
45226
|
"aria-disabled": "true"
|
|
45140
45227
|
})
|
|
@@ -77969,7 +78056,8 @@ const CLIENT_ERROR_REPORT_LIMITS = {
|
|
|
77969
78056
|
stack: 8e3,
|
|
77970
78057
|
digest: 128,
|
|
77971
78058
|
componentStack: 8e3,
|
|
77972
|
-
sourceLocation: 1024
|
|
78059
|
+
sourceLocation: 1024,
|
|
78060
|
+
navigationAgeMs: 6e4
|
|
77973
78061
|
};
|
|
77974
78062
|
const clientErrorEventSchema = z.enum([
|
|
77975
78063
|
"dashboard:route-error",
|
|
@@ -77986,7 +78074,17 @@ z.object({
|
|
|
77986
78074
|
stack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.stack).nullable(),
|
|
77987
78075
|
digest: z.string().max(CLIENT_ERROR_REPORT_LIMITS.digest).nullable(),
|
|
77988
78076
|
componentStack: z.string().max(CLIENT_ERROR_REPORT_LIMITS.componentStack).nullable(),
|
|
77989
|
-
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable()
|
|
78077
|
+
sourceLocation: z.string().max(CLIENT_ERROR_REPORT_LIMITS.sourceLocation).nullable(),
|
|
78078
|
+
navigation: z.object({
|
|
78079
|
+
fromPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
78080
|
+
toPathname: z.string().regex(/^\/[^?#]*$/).max(CLIENT_ERROR_REPORT_LIMITS.pathname),
|
|
78081
|
+
type: z.enum([
|
|
78082
|
+
"push",
|
|
78083
|
+
"replace",
|
|
78084
|
+
"traverse"
|
|
78085
|
+
]),
|
|
78086
|
+
ageMs: z.number().int().min(0).max(CLIENT_ERROR_REPORT_LIMITS.navigationAgeMs)
|
|
78087
|
+
}).strict().nullable().optional()
|
|
77990
78088
|
}).strict();
|
|
77991
78089
|
({
|
|
77992
78090
|
...SITE_LIFECYCLE_ENDPOINT_DEFINITIONS,
|
|
@@ -78748,6 +78846,7 @@ const CANONICAL_REFUND_PLANNER_ERROR_CODES = [
|
|
|
78748
78846
|
"refund_failed"
|
|
78749
78847
|
];
|
|
78750
78848
|
const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
|
|
78849
|
+
"refund_blocked_by_live_payment_terms",
|
|
78751
78850
|
...CANONICAL_REFUND_PLANNER_ERROR_CODES,
|
|
78752
78851
|
"payment_intent_not_found",
|
|
78753
78852
|
"stripe_error",
|
|
@@ -78763,6 +78862,7 @@ const CANONICAL_ADMIN_REFUND_FAILURE_CODES = [
|
|
|
78763
78862
|
//#endregion
|
|
78764
78863
|
//#region ../api/src/bookingRefundOutcomes.ts
|
|
78765
78864
|
const STANDARD_LINE_ITEM_REFUND_INVALID_CODES = [
|
|
78865
|
+
"refund_blocked_by_live_payment_terms",
|
|
78766
78866
|
"missing_amount",
|
|
78767
78867
|
"invalid_amount",
|
|
78768
78868
|
"amount_exceeds_remaining",
|
|
@@ -79152,68 +79252,6 @@ function parsePublicProductCategorySelector(value) {
|
|
|
79152
79252
|
}
|
|
79153
79253
|
z.enum(["public", "unlisted"], { error: "visibility must be 'public' or 'unlisted'" });
|
|
79154
79254
|
//#endregion
|
|
79155
|
-
//#region ../api/src/bookingPaymentTermSchemas.ts
|
|
79156
|
-
const bookingDepositRefundPolicySchema = z.enum(["refundable", "non_refundable"]);
|
|
79157
|
-
const bookingInstalmentPlanSchema = z.discriminatedUnion("kind", [
|
|
79158
|
-
z.object({
|
|
79159
|
-
kind: z.literal("deposit_plus_one_remainder"),
|
|
79160
|
-
depositAmountCents: z.number().int().nonnegative(),
|
|
79161
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
79162
|
-
remainderDueCount: z.number().int().positive(),
|
|
79163
|
-
intervalUnit: z.enum([
|
|
79164
|
-
"day",
|
|
79165
|
-
"week",
|
|
79166
|
-
"month"
|
|
79167
|
-
])
|
|
79168
|
-
}),
|
|
79169
|
-
z.object({
|
|
79170
|
-
kind: z.literal("deposit_plus_scheduled_instalments"),
|
|
79171
|
-
depositAmountCents: z.number().int().nonnegative(),
|
|
79172
|
-
depositRefundability: bookingDepositRefundPolicySchema,
|
|
79173
|
-
instalmentCount: z.number().int().positive(),
|
|
79174
|
-
intervalCount: z.number().int().positive(),
|
|
79175
|
-
intervalUnit: z.enum([
|
|
79176
|
-
"day",
|
|
79177
|
-
"week",
|
|
79178
|
-
"month"
|
|
79179
|
-
])
|
|
79180
|
-
}),
|
|
79181
|
-
z.object({
|
|
79182
|
-
kind: z.literal("equal_scheduled_instalments"),
|
|
79183
|
-
instalmentCount: z.number().int().positive(),
|
|
79184
|
-
intervalCount: z.number().int().positive(),
|
|
79185
|
-
intervalUnit: z.enum([
|
|
79186
|
-
"day",
|
|
79187
|
-
"week",
|
|
79188
|
-
"month"
|
|
79189
|
-
])
|
|
79190
|
-
})
|
|
79191
|
-
]);
|
|
79192
|
-
const bookingFlexibleBalanceDueDateRuleSchema = z.discriminatedUnion("kind", [z.object({
|
|
79193
|
-
kind: z.literal("relative_to_start_date"),
|
|
79194
|
-
daysBeforeStart: z.number().int().positive()
|
|
79195
|
-
}), z.object({
|
|
79196
|
-
kind: z.literal("fixed_calendar_date"),
|
|
79197
|
-
dueAt: z.string().datetime()
|
|
79198
|
-
})]);
|
|
79199
|
-
const bookingFlexibleBalanceConfigSchema = z.object({
|
|
79200
|
-
upfrontAmountCents: z.number().int().nonnegative(),
|
|
79201
|
-
dueDateRule: bookingFlexibleBalanceDueDateRuleSchema,
|
|
79202
|
-
depositRefundability: bookingDepositRefundPolicySchema
|
|
79203
|
-
});
|
|
79204
|
-
z.discriminatedUnion("kind", [
|
|
79205
|
-
z.object({ kind: z.literal("upfront") }),
|
|
79206
|
-
z.object({ kind: z.literal("deferred_manual") }),
|
|
79207
|
-
z.object({
|
|
79208
|
-
kind: z.literal("instalment_plan"),
|
|
79209
|
-
plan: bookingInstalmentPlanSchema
|
|
79210
|
-
}),
|
|
79211
|
-
z.object({
|
|
79212
|
-
kind: z.literal("flexible_balance"),
|
|
79213
|
-
config: bookingFlexibleBalanceConfigSchema
|
|
79214
|
-
})
|
|
79215
|
-
]);
|
|
79216
|
-
//#endregion
|
|
79217
79255
|
//#region ../api/src/aiPlayground.ts
|
|
79218
79256
|
/**
|
|
79219
79257
|
* RFC-6902 JSON Patch Operations
|