@riverbankcms/sdk 0.96.0 → 0.98.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 +20 -1
- package/dist/{PreviewEditorSidebar-46VT4QVU.mjs → PreviewEditorSidebar-CG3SSJND.mjs} +3 -3
- package/dist/{PreviewEditorUI-JD75GE5F.mjs → PreviewEditorUI-RHNGKAAU.mjs} +3 -3
- package/dist/SdkPreviewModeRuntime-OV5PNJBB.mjs +8 -0
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +35 -1
- package/dist/_dts/api/src/bookingOperations.d.ts +246 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +109 -40
- package/dist/_dts/api/src/endpoints.d.ts +80 -0
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/public/endpoints.d.ts +1 -1
- package/dist/_dts/api/src/publicExperienceEndpoints.d.ts +10 -0
- package/dist/_dts/api/src/sdkContracts.d.ts +2 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +2 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +7 -1
- package/dist/_dts/blocks/src/PageRenderer.d.ts +2 -1
- package/dist/_dts/blocks/src/bindings/types.d.ts +0 -4
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +7 -0
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -0
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +12 -12
- package/dist/_dts/blocks/src/primitives/content/primitives.d.ts +4 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/events/shared/layout.d.ts +2 -0
- package/dist/_dts/blocks/src/system/blocks/index.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/weekly-slot-availability.d.ts +34 -0
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +1 -0
- package/dist/_dts/blocks/src/system/constants/blockKinds.d.ts +1 -1
- package/dist/_dts/blocks/src/system/customize/facets.d.ts +2 -2
- package/dist/_dts/blocks/src/system/data/loaderEndpoints.d.ts +1 -1
- package/dist/_dts/blocks/src/system/data/prefetchBlockData.d.ts +4 -1
- package/dist/_dts/blocks/src/system/node/builder.d.ts +2 -0
- package/dist/_dts/blocks/src/system/node/schema.d.ts +13 -0
- package/dist/_dts/blocks/src/system/node/validation-constants.d.ts +1 -1
- package/dist/_dts/blocks/src/system/registry.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/api/client.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/api/endpoints.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/api/types.d.ts +24 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.d.ts +7 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useAvailableSlots.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +5 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/hooks.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +8 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +133 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.d.ts +9 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.d.ts +14 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.server.d.ts +10 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/weekly-slot-availability.view.d.ts +11 -0
- package/dist/_dts/blocks/src/system/runtime/resolver.d.ts +31 -1
- package/dist/_dts/blocks/src/system/runtime/shared/useWaitlistClaim.d.ts +5 -0
- package/dist/_dts/blocks/src/utils/date-formatting.d.ts +1 -1
- package/dist/_dts/content-editor/src/primitives/PreviewInlineTextEditor.d.ts +1 -1
- package/dist/_dts/content-editor/src/primitives/PreviewRichTextEditor.d.ts +1 -1
- package/dist/_dts/content-model/src/templates/defaults.d.ts +5 -5
- package/dist/_dts/content-model/src/templates/types.d.ts +2 -6
- package/dist/_dts/core/src/branded.d.ts +8 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +505 -2
- package/dist/_dts/field-primitives/src/bindings/index.d.ts +8 -0
- package/dist/_dts/sdk/src/cli/commands/push/publishGuidance.d.ts +15 -0
- package/dist/_dts/sdk/src/cli/commands/push/scopes/commandBackedDatedOfferingScope.d.ts +2 -1
- package/dist/_dts/sdk/src/cli/commands/push/scopes/types.d.ts +3 -1
- package/dist/_dts/sdk/src/cli/commands/push/stale-resolution.d.ts +9 -3
- package/dist/_dts/sdk/src/cli/commands/push/workflowPlan.d.ts +34 -0
- package/dist/_dts/sdk/src/cli/commands/setup.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/config-loader.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/content/metadataStore.d.ts +29 -0
- package/dist/_dts/sdk/src/cli/content/reader.d.ts +16 -14
- package/dist/_dts/sdk/src/cli/content/writer.d.ts +6 -4
- package/dist/_dts/sdk/src/cli/env-scope.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/helpers.d.ts +6 -7
- package/dist/_dts/sdk/src/cli/merge-remote/entryMergePush.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/merge-remote/pageMergePush.d.ts +2 -0
- package/dist/_dts/sdk/src/cli/push-config.d.ts +13 -2
- package/dist/_dts/sdk/src/cli/setup/setupPlan.d.ts +51 -0
- package/dist/_dts/sdk/src/cli/site-commands/commandRuntime.d.ts +21 -0
- package/dist/_dts/sdk/src/client/runtimeCachePolicy.d.ts +1 -1
- package/dist/_dts/sdk/src/client/types.d.ts +18 -2
- package/dist/_dts/sdk/src/config/types.d.ts +1 -1
- package/dist/_dts/sdk/src/config/validation.d.ts +3 -0
- package/dist/_dts/sdk/src/contracts/bindings.d.ts +3 -7
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +13 -0
- package/dist/_dts/sdk/src/next/route-outcome-proxy.d.ts +3 -3
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +174 -78
- package/dist/_dts/sdk/src/public-api/runtime.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/helpers/bindings.d.ts +4 -4
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +52 -1
- package/dist/_dts/sdk/src/rendering/hooks/usePage.d.ts +2 -2
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +18 -66
- package/dist/_dts/sdk/src/types/block-kinds.d.ts +1 -1
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/{chunk-EL55VV6Q.mjs → chunk-6WDBXCPX.mjs} +31 -10
- package/dist/{chunk-XMATDBXO.mjs → chunk-DBRI3PQF.mjs} +731 -180
- package/dist/{chunk-VHIMXQ7Z.mjs → chunk-H24OU7WG.mjs} +2 -2
- package/dist/{chunk-4TLTV7OB.mjs → chunk-PKDPQHB5.mjs} +2 -2
- package/dist/{chunk-VTPPVAOL.mjs → chunk-QPXE2OUZ.mjs} +1 -1
- package/dist/{chunk-7ED5UNHL.mjs → chunk-V2BYFSPW.mjs} +109 -0
- package/dist/cli/index.mjs +2131 -1033
- package/dist/cli/init-docs/content/cli-reference.md +29 -1
- package/dist/cli/init-docs/content/getting-started.md +8 -0
- package/dist/cli/init-docs/content/workflow-agent-safe-sync.md +3 -1
- package/dist/cli/init-docs/content/workflow-preview-mode.md +6 -0
- package/dist/cli/init-docs/content/workflow-remote-setup.md +51 -0
- package/dist/client/{accordion-GUNXIIZR.mjs → accordion-Q2BDNL53.mjs} +1 -1
- package/dist/client/{bookingForm-AOU4VHP5.mjs → bookingForm-ZMP4P7EK.mjs} +16 -6
- package/dist/client/bookings.mjs +98 -18
- package/dist/client/{carousel-4QSX2JPC.mjs → carousel-LW3UXPWO.mjs} +1 -1
- package/dist/client/{cart-JKN6C4ZB.mjs → cart-Z6D3KS6K.mjs} +5 -5
- package/dist/client/{checkout-YY6YMITW.mjs → checkout-YMT2QJQM.mjs} +5 -5
- package/dist/client/{chunk-6H27K6AA.mjs → chunk-26ZBRXFR.mjs} +9 -3
- package/dist/client/{chunk-VJROUYOQ.mjs → chunk-DRRQ7QSL.mjs} +2 -2
- package/dist/client/{chunk-BFCJZODD.mjs → chunk-ET2MDQQT.mjs} +4 -4
- package/dist/client/{chunk-H7A6PUGM.mjs → chunk-HBQEAOG4.mjs} +1 -1
- package/dist/client/{chunk-CPKMJVBD.mjs → chunk-IEOECM7U.mjs} +62 -43
- package/dist/client/{chunk-TNGL2WJF.mjs → chunk-KDP7ZRZV.mjs} +16 -0
- package/dist/client/{chunk-GWCRCJLB.mjs → chunk-R4XK3CKR.mjs} +12 -1
- package/dist/client/{chunk-A3YN7M3G.mjs → chunk-SK2BMD22.mjs} +2 -2
- package/dist/client/{chunk-SY543WZ3.mjs → chunk-XNTHVZ25.mjs} +1 -1
- package/dist/client/client.mjs +3729 -3054
- package/dist/client/{courseRegistration-UU2KMPSQ.mjs → courseRegistration-DGKCMC77.mjs} +4 -4
- package/dist/client/{eventCalendar-WIVNS2TM.mjs → eventCalendar-74Z2NNFM.mjs} +7 -7
- package/dist/client/{eventCombined-P3G5MW4J.mjs → eventCombined-GK2ODOX2.mjs} +7 -7
- package/dist/client/{eventDetails-2VHJ2RDG.mjs → eventDetails-MONAGT3N.mjs} +7 -7
- package/dist/client/{eventListing-TGO6JI3R.mjs → eventListing-SKGAO6PS.mjs} +7 -7
- package/dist/client/{eventRegistration-B46HEJES.mjs → eventRegistration-6KISGXRD.mjs} +7 -7
- package/dist/client/{form-VKRTFUNQ.mjs → form-FXPRTXHI.mjs} +2 -2
- package/dist/client/{headerSection-XUX4ZJLO.mjs → headerSection-7NAN5WNB.mjs} +2 -2
- package/dist/client/hooks.mjs +1661 -1334
- package/dist/client/{locationMap-NQFI5MJO.mjs → locationMap-UERN74U4.mjs} +2 -2
- package/dist/client/{newsletterForm-P2GETCQK.mjs → newsletterForm-SGWXMJ7U.mjs} +2 -2
- package/dist/client/{productDetail-7NQ7O5IF.mjs → productDetail-HN3HWZQZ.mjs} +5 -5
- package/dist/client/{productList-RX6ZJ7BL.mjs → productList-YT22Z5UR.mjs} +5 -5
- package/dist/client/rendering/client.mjs +2208 -1922
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +1497 -811
- package/dist/client/{shop-BHN5AKY6.mjs → shop-TKEDNWUS.mjs} +5 -5
- package/dist/preview-next/before-render.mjs +109 -0
- package/dist/preview-next/client/runtime.mjs +5 -5
- package/dist/preview-next/middleware.mjs +109 -0
- package/dist/{sdk-runtime-X2LXQ5IC.mjs → sdk-runtime-LWNYCQF2.mjs} +6 -6
- package/dist/server/components.mjs +2351 -1872
- package/dist/server/config-template-validation.mjs +6 -2
- package/dist/server/config-validation.mjs +1861 -1561
- package/dist/server/config.mjs +1861 -1561
- package/dist/server/data.mjs +1647 -1331
- package/dist/server/index.mjs +208 -9
- package/dist/server/next/middleware.mjs +2 -2
- package/dist/server/next.mjs +2572 -1878
- package/dist/server/page-converter.mjs +1461 -1276
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +2372 -1875
- package/dist/server/rendering.mjs +2557 -1941
- package/dist/server/routing.mjs +1716 -1353
- package/dist/server/server.mjs +1911 -1380
- package/package.json +1 -1
- package/dist/SdkPreviewModeRuntime-MJUSYUFB.mjs +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { unwrapResponse, ApiRequestError, ApiEnvelopeError, extractApiEnvelopeErrorDetails } from './chunk-
|
|
2
|
+
import { unwrapResponse, ApiRequestError, ApiEnvelopeError, extractApiEnvelopeErrorDetails } from './chunk-V2BYFSPW.mjs';
|
|
3
3
|
import { __commonJS, __export, __toESM } from './chunk-R7POPVJR.mjs';
|
|
4
4
|
import * as React61 from 'react';
|
|
5
5
|
import React61__default, { createContext, forwardRef, useContext, createElement, useRef, useMemo, useEffect, useState, useCallback, useImperativeHandle, useLayoutEffect, memo, createRef, Component as Component$1, useDebugValue, useId as useId$1, useSyncExternalStore, isValidElement, cloneElement, useReducer, startTransition } from 'react';
|
|
6
|
-
import
|
|
6
|
+
import z42, { z } from 'zod';
|
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import deepEqual2 from 'fast-deep-equal';
|
|
9
9
|
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
@@ -30992,10 +30992,20 @@ var repeatSchema = z.object({
|
|
|
30992
30992
|
direction: z.enum(["asc", "desc"]).default("asc")
|
|
30993
30993
|
}).optional()
|
|
30994
30994
|
});
|
|
30995
|
+
var conditionalAuthoringPresenceSchema = z.discriminatedUnion("kind", [
|
|
30996
|
+
z.object({ kind: z.literal("visitor-only") }),
|
|
30997
|
+
z.object({
|
|
30998
|
+
kind: z.literal("recover-empty-when-active"),
|
|
30999
|
+
placeholder: z.string().min(1).optional()
|
|
31000
|
+
})
|
|
31001
|
+
]);
|
|
30995
31002
|
var conditionSchema = z.object({
|
|
30996
31003
|
when: bindingSchema,
|
|
30997
31004
|
equals: z.unknown().optional(),
|
|
30998
|
-
not: z.boolean().default(false)
|
|
31005
|
+
not: z.boolean().default(false),
|
|
31006
|
+
authoringPresence: conditionalAuthoringPresenceSchema.default({
|
|
31007
|
+
kind: "visitor-only"
|
|
31008
|
+
})
|
|
30999
31009
|
});
|
|
31000
31010
|
var dataScopeSchema = z.object({
|
|
31001
31011
|
name: z.string().min(1),
|
|
@@ -36966,44 +36976,44 @@ var styleTagsSchema = z.object({
|
|
|
36966
36976
|
motion: z.enum(STYLE_AXIS_VALUES.motion).optional(),
|
|
36967
36977
|
era: z.enum(STYLE_AXIS_VALUES.era).optional()
|
|
36968
36978
|
});
|
|
36969
|
-
var hotspotSchema =
|
|
36970
|
-
x:
|
|
36971
|
-
y:
|
|
36972
|
-
radius:
|
|
36973
|
-
});
|
|
36974
|
-
var rotationSchema =
|
|
36975
|
-
var rectSchema =
|
|
36976
|
-
var aspectCropSchema =
|
|
36977
|
-
aspect:
|
|
36978
|
-
rect:
|
|
36979
|
-
hotspot:
|
|
36980
|
-
rotation:
|
|
36981
|
-
});
|
|
36982
|
-
var transformSchema =
|
|
36983
|
-
aspectCrops:
|
|
36979
|
+
var hotspotSchema = z42.object({
|
|
36980
|
+
x: z42.number().min(0).max(1),
|
|
36981
|
+
y: z42.number().min(0).max(1),
|
|
36982
|
+
radius: z42.number().optional()
|
|
36983
|
+
});
|
|
36984
|
+
var rotationSchema = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
|
|
36985
|
+
var rectSchema = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
|
|
36986
|
+
var aspectCropSchema = z42.object({
|
|
36987
|
+
aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
|
|
36988
|
+
rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema.optional()),
|
|
36989
|
+
hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema.optional()),
|
|
36990
|
+
rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema.optional())
|
|
36991
|
+
});
|
|
36992
|
+
var transformSchema = z42.object({
|
|
36993
|
+
aspectCrops: z42.preprocess((value) => {
|
|
36984
36994
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
36985
36995
|
return void 0;
|
|
36986
36996
|
}
|
|
36987
36997
|
return value;
|
|
36988
|
-
},
|
|
36998
|
+
}, z42.record(z42.string(), aspectCropSchema.catch({}))).optional(),
|
|
36989
36999
|
rect: rectSchema.optional(),
|
|
36990
37000
|
hotspot: hotspotSchema.optional(),
|
|
36991
37001
|
rotation: rotationSchema.optional()
|
|
36992
37002
|
});
|
|
36993
|
-
var mediaSchema =
|
|
36994
|
-
type:
|
|
36995
|
-
purpose:
|
|
36996
|
-
placeholder:
|
|
36997
|
-
assetId:
|
|
36998
|
-
identifier:
|
|
36999
|
-
src:
|
|
37000
|
-
alt:
|
|
37001
|
-
filename:
|
|
37002
|
-
mimeType:
|
|
37003
|
-
width:
|
|
37004
|
-
height:
|
|
37005
|
-
storageBucket:
|
|
37006
|
-
storagePath:
|
|
37003
|
+
var mediaSchema = z42.object({
|
|
37004
|
+
type: z42.enum(["image", "video", "audio", "document", "spreadsheet", "archive"]),
|
|
37005
|
+
purpose: z42.string().optional(),
|
|
37006
|
+
placeholder: z42.boolean().default(true).optional(),
|
|
37007
|
+
assetId: z42.string().optional(),
|
|
37008
|
+
identifier: z42.string().optional(),
|
|
37009
|
+
src: z42.string().optional(),
|
|
37010
|
+
alt: z42.string().optional(),
|
|
37011
|
+
filename: z42.string().optional(),
|
|
37012
|
+
mimeType: z42.string().optional(),
|
|
37013
|
+
width: z42.number().optional(),
|
|
37014
|
+
height: z42.number().optional(),
|
|
37015
|
+
storageBucket: z42.string().optional(),
|
|
37016
|
+
storagePath: z42.string().optional(),
|
|
37007
37017
|
transform: transformSchema.optional()
|
|
37008
37018
|
});
|
|
37009
37019
|
|
|
@@ -50203,7 +50213,8 @@ function when(path, options) {
|
|
|
50203
50213
|
$when: {
|
|
50204
50214
|
when: { from: path },
|
|
50205
50215
|
...options?.equals !== void 0 ? { equals: options.equals } : {},
|
|
50206
|
-
...options?.not ? { not: true } : {}
|
|
50216
|
+
...options?.not ? { not: true } : {},
|
|
50217
|
+
...options?.authoringPresence ? { authoringPresence: options.authoringPresence } : {}
|
|
50207
50218
|
}
|
|
50208
50219
|
});
|
|
50209
50220
|
}
|
|
@@ -60212,72 +60223,239 @@ var appointmentBookingBlockDefinition = {
|
|
|
60212
60223
|
}
|
|
60213
60224
|
}
|
|
60214
60225
|
};
|
|
60226
|
+
var weeklySlotAvailabilityManifest = createBlockManifest({
|
|
60227
|
+
id: "block.weekly-slot-availability",
|
|
60228
|
+
version: "1.0.0",
|
|
60229
|
+
title: "Weekly Slot Availability",
|
|
60230
|
+
titleSource: "heading",
|
|
60231
|
+
description: "Shows available recurring appointment slot patterns",
|
|
60232
|
+
skipSectionStyles: true,
|
|
60233
|
+
additionalFields: [
|
|
60234
|
+
{
|
|
60235
|
+
id: "serviceId",
|
|
60236
|
+
type: "reference",
|
|
60237
|
+
label: "Appointment service",
|
|
60238
|
+
description: "Choose which appointment service to show availability for",
|
|
60239
|
+
required: true,
|
|
60240
|
+
referenceKind: "appointmentService",
|
|
60241
|
+
allowManualEntry: false,
|
|
60242
|
+
ui: { intent: "behavior" }
|
|
60243
|
+
},
|
|
60244
|
+
{
|
|
60245
|
+
id: "resourceId",
|
|
60246
|
+
type: "reference",
|
|
60247
|
+
label: "Appointment resource",
|
|
60248
|
+
description: "Optionally narrow the availability to one practitioner or room",
|
|
60249
|
+
required: false,
|
|
60250
|
+
referenceKind: "appointmentResource",
|
|
60251
|
+
allowManualEntry: false,
|
|
60252
|
+
ui: { intent: "behavior" }
|
|
60253
|
+
},
|
|
60254
|
+
{
|
|
60255
|
+
id: "horizonWeeks",
|
|
60256
|
+
type: "select",
|
|
60257
|
+
label: "Look ahead",
|
|
60258
|
+
required: false,
|
|
60259
|
+
multiple: false,
|
|
60260
|
+
defaultValue: "4",
|
|
60261
|
+
options: [
|
|
60262
|
+
{ value: "1", label: "1 week" },
|
|
60263
|
+
{ value: "2", label: "2 weeks" },
|
|
60264
|
+
{ value: "4", label: "4 weeks" }
|
|
60265
|
+
],
|
|
60266
|
+
ui: { intent: "behavior" }
|
|
60267
|
+
},
|
|
60268
|
+
{
|
|
60269
|
+
id: "timezone",
|
|
60270
|
+
type: "text",
|
|
60271
|
+
label: "Timezone",
|
|
60272
|
+
description: "Leave blank to use the visitor timezone when the block loads",
|
|
60273
|
+
required: false,
|
|
60274
|
+
multiline: false,
|
|
60275
|
+
defaultValue: "",
|
|
60276
|
+
maxLength: 64,
|
|
60277
|
+
ui: { intent: "behavior" }
|
|
60278
|
+
},
|
|
60279
|
+
{
|
|
60280
|
+
id: "heading",
|
|
60281
|
+
type: "text",
|
|
60282
|
+
label: "Heading",
|
|
60283
|
+
required: false,
|
|
60284
|
+
multiline: false,
|
|
60285
|
+
defaultValue: "Weekly availability"
|
|
60286
|
+
},
|
|
60287
|
+
{
|
|
60288
|
+
id: "description",
|
|
60289
|
+
type: "richText",
|
|
60290
|
+
label: "Description",
|
|
60291
|
+
required: false
|
|
60292
|
+
},
|
|
60293
|
+
{
|
|
60294
|
+
id: "emptyMessage",
|
|
60295
|
+
type: "text",
|
|
60296
|
+
label: "Empty message",
|
|
60297
|
+
required: false,
|
|
60298
|
+
multiline: true,
|
|
60299
|
+
defaultValue: "No regular weekly openings are currently available.",
|
|
60300
|
+
maxLength: 180
|
|
60301
|
+
},
|
|
60302
|
+
{
|
|
60303
|
+
id: "ctaText",
|
|
60304
|
+
type: "text",
|
|
60305
|
+
label: "Enquiry button text",
|
|
60306
|
+
required: false,
|
|
60307
|
+
multiline: false,
|
|
60308
|
+
defaultValue: "Enquire about this slot",
|
|
60309
|
+
maxLength: 60
|
|
60310
|
+
},
|
|
60311
|
+
{
|
|
60312
|
+
id: "ctaUrl",
|
|
60313
|
+
type: "url",
|
|
60314
|
+
label: "Enquiry URL",
|
|
60315
|
+
required: false,
|
|
60316
|
+
ui: { intent: "behavior" }
|
|
60317
|
+
},
|
|
60318
|
+
sectionStylesField({
|
|
60319
|
+
id: "_sectionStyles",
|
|
60320
|
+
label: "Section styles"
|
|
60321
|
+
})
|
|
60322
|
+
],
|
|
60323
|
+
styleTokens: { background: "surface", typography: "body", spacing: "md" },
|
|
60324
|
+
behaviours: {
|
|
60325
|
+
supportsThemeSwitching: true,
|
|
60326
|
+
inlineEditing: false,
|
|
60327
|
+
animation: false,
|
|
60328
|
+
paletteHidden: false
|
|
60329
|
+
},
|
|
60330
|
+
category: "interactive",
|
|
60331
|
+
tags: ["booking", "appointment", "calendar", "weekly", "availability"],
|
|
60332
|
+
icon: "CalendarDays",
|
|
60333
|
+
layout: [
|
|
60334
|
+
styledSection({
|
|
60335
|
+
children: sectionContainer([
|
|
60336
|
+
text({ as: "h2" }, bind("content.heading"), when("content.heading")),
|
|
60337
|
+
richText({}, bind("content.description"), when("content.description")),
|
|
60338
|
+
el(
|
|
60339
|
+
"weekly-slot-availability",
|
|
60340
|
+
withApiBindings({
|
|
60341
|
+
serviceId: { $bind: { from: "content.serviceId" } },
|
|
60342
|
+
resourceId: { $bind: { from: "content.resourceId", fallback: null } },
|
|
60343
|
+
horizonWeeks: { $bind: { from: "content.horizonWeeks", fallback: "4" } },
|
|
60344
|
+
timezone: { $bind: { from: "content.timezone", fallback: null } },
|
|
60345
|
+
availability: { $bind: { from: "data.availability", fallback: null } },
|
|
60346
|
+
emptyMessage: { $bind: { from: "content.emptyMessage", fallback: null } },
|
|
60347
|
+
ctaText: { $bind: { from: "content.ctaText", fallback: null } },
|
|
60348
|
+
ctaUrl: { $bind: { from: "content.ctaUrl", fallback: null } }
|
|
60349
|
+
})
|
|
60350
|
+
)
|
|
60351
|
+
], {
|
|
60352
|
+
gap: "lg"
|
|
60353
|
+
}),
|
|
60354
|
+
baseClass: "",
|
|
60355
|
+
spacing: "spacious"
|
|
60356
|
+
})
|
|
60357
|
+
]
|
|
60358
|
+
});
|
|
60359
|
+
var weeklySlotAvailabilityOptionSchema = z.object({
|
|
60360
|
+
id: z.string(),
|
|
60361
|
+
resourceId: z.string(),
|
|
60362
|
+
weekday: z.number(),
|
|
60363
|
+
weekdayLabel: z.string(),
|
|
60364
|
+
startTime: z.string(),
|
|
60365
|
+
endTime: z.string(),
|
|
60366
|
+
nextDate: z.string(),
|
|
60367
|
+
availableWeeks: z.number()
|
|
60368
|
+
});
|
|
60369
|
+
var weeklySlotAvailabilityDataSchema = z.object({
|
|
60370
|
+
slots: z.array(weeklySlotAvailabilityOptionSchema),
|
|
60371
|
+
horizonWeeks: z.number(),
|
|
60372
|
+
timezone: z.string(),
|
|
60373
|
+
startDate: z.string(),
|
|
60374
|
+
endDate: z.string()
|
|
60375
|
+
});
|
|
60376
|
+
var weeklySlotAvailabilityBlockDefinition = {
|
|
60377
|
+
manifest: weeklySlotAvailabilityManifest,
|
|
60378
|
+
dataSchemas: { availability: weeklySlotAvailabilityDataSchema.optional() },
|
|
60379
|
+
dataLoaders: {
|
|
60380
|
+
availability: {
|
|
60381
|
+
endpoint: "getPublicWeeklySlotAvailability",
|
|
60382
|
+
params: {
|
|
60383
|
+
siteId: { $bind: { from: "$root.siteId" } },
|
|
60384
|
+
serviceId: { $bind: { from: "content.serviceId" } },
|
|
60385
|
+
resourceId: { $bind: { from: "content.resourceId", fallback: void 0 } },
|
|
60386
|
+
horizonWeeks: { $bind: { from: "content.horizonWeeks", fallback: "4" } },
|
|
60387
|
+
timezone: { $bind: { from: "content.timezone", fallback: void 0 } }
|
|
60388
|
+
},
|
|
60389
|
+
mode: "server"
|
|
60390
|
+
}
|
|
60391
|
+
}
|
|
60392
|
+
};
|
|
60215
60393
|
var PUBLIC_DOWNLOAD_MEDIA_TYPES = [
|
|
60216
60394
|
"document",
|
|
60217
60395
|
"spreadsheet",
|
|
60218
60396
|
"archive",
|
|
60219
60397
|
"audio"
|
|
60220
60398
|
];
|
|
60221
|
-
var hotspotSchema2 =
|
|
60222
|
-
x:
|
|
60223
|
-
y:
|
|
60224
|
-
radius:
|
|
60225
|
-
});
|
|
60226
|
-
var rotationSchema2 =
|
|
60227
|
-
var rectSchema2 =
|
|
60228
|
-
var aspectCropSchema2 =
|
|
60229
|
-
aspect:
|
|
60230
|
-
rect:
|
|
60231
|
-
hotspot:
|
|
60232
|
-
rotation:
|
|
60233
|
-
});
|
|
60234
|
-
var transformSchema2 =
|
|
60235
|
-
aspectCrops:
|
|
60399
|
+
var hotspotSchema2 = z42.object({
|
|
60400
|
+
x: z42.number().min(0).max(1),
|
|
60401
|
+
y: z42.number().min(0).max(1),
|
|
60402
|
+
radius: z42.number().optional()
|
|
60403
|
+
});
|
|
60404
|
+
var rotationSchema2 = z42.union([z42.literal(0), z42.literal(90), z42.literal(180), z42.literal(270)]);
|
|
60405
|
+
var rectSchema2 = z42.tuple([z42.number(), z42.number(), z42.number(), z42.number()]);
|
|
60406
|
+
var aspectCropSchema2 = z42.object({
|
|
60407
|
+
aspect: z42.preprocess((value) => value == null ? void 0 : value, z42.string().optional()),
|
|
60408
|
+
rect: z42.preprocess((value) => value == null ? void 0 : value, rectSchema2.optional()),
|
|
60409
|
+
hotspot: z42.preprocess((value) => value == null ? void 0 : value, hotspotSchema2.optional()),
|
|
60410
|
+
rotation: z42.preprocess((value) => value == null ? void 0 : value, rotationSchema2.optional())
|
|
60411
|
+
});
|
|
60412
|
+
var transformSchema2 = z42.object({
|
|
60413
|
+
aspectCrops: z42.preprocess((value) => {
|
|
60236
60414
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
60237
60415
|
return void 0;
|
|
60238
60416
|
}
|
|
60239
60417
|
return value;
|
|
60240
|
-
},
|
|
60418
|
+
}, z42.record(z42.string(), aspectCropSchema2.catch({}))).optional(),
|
|
60241
60419
|
rect: rectSchema2.optional(),
|
|
60242
60420
|
hotspot: hotspotSchema2.optional(),
|
|
60243
60421
|
rotation: rotationSchema2.optional()
|
|
60244
60422
|
});
|
|
60245
|
-
var mediaPosterSchema =
|
|
60246
|
-
|
|
60247
|
-
tag:
|
|
60248
|
-
assetId:
|
|
60249
|
-
storageBucket:
|
|
60250
|
-
storagePath:
|
|
60423
|
+
var mediaPosterSchema = z42.discriminatedUnion("tag", [
|
|
60424
|
+
z42.object({
|
|
60425
|
+
tag: z42.literal("storage"),
|
|
60426
|
+
assetId: z42.string().optional(),
|
|
60427
|
+
storageBucket: z42.string().min(1),
|
|
60428
|
+
storagePath: z42.string().min(1)
|
|
60251
60429
|
}),
|
|
60252
|
-
|
|
60253
|
-
tag:
|
|
60254
|
-
assetId:
|
|
60255
|
-
src:
|
|
60430
|
+
z42.object({
|
|
60431
|
+
tag: z42.literal("external-src"),
|
|
60432
|
+
assetId: z42.string().optional(),
|
|
60433
|
+
src: z42.string().url()
|
|
60256
60434
|
})
|
|
60257
60435
|
]);
|
|
60258
|
-
var mediaBaseSchema =
|
|
60259
|
-
purpose:
|
|
60260
|
-
placeholder:
|
|
60261
|
-
assetId:
|
|
60262
|
-
identifier:
|
|
60263
|
-
src:
|
|
60264
|
-
alt:
|
|
60265
|
-
filename:
|
|
60266
|
-
mimeType:
|
|
60267
|
-
width:
|
|
60268
|
-
height:
|
|
60269
|
-
storageBucket:
|
|
60270
|
-
storagePath:
|
|
60436
|
+
var mediaBaseSchema = z42.object({
|
|
60437
|
+
purpose: z42.string().optional(),
|
|
60438
|
+
placeholder: z42.boolean().default(true).optional(),
|
|
60439
|
+
assetId: z42.string().optional(),
|
|
60440
|
+
identifier: z42.string().optional(),
|
|
60441
|
+
src: z42.string().optional(),
|
|
60442
|
+
alt: z42.string().optional(),
|
|
60443
|
+
filename: z42.string().optional(),
|
|
60444
|
+
mimeType: z42.string().optional(),
|
|
60445
|
+
width: z42.number().optional(),
|
|
60446
|
+
height: z42.number().optional(),
|
|
60447
|
+
storageBucket: z42.string().optional(),
|
|
60448
|
+
storagePath: z42.string().optional(),
|
|
60271
60449
|
poster: mediaPosterSchema.optional(),
|
|
60272
60450
|
transform: transformSchema2.optional()
|
|
60273
60451
|
});
|
|
60274
|
-
var imageMediaSchema = mediaBaseSchema.extend({ type:
|
|
60275
|
-
var videoMediaSchema = mediaBaseSchema.extend({ type:
|
|
60276
|
-
var audioMediaSchema = mediaBaseSchema.extend({ type:
|
|
60277
|
-
var documentMediaSchema = mediaBaseSchema.extend({ type:
|
|
60278
|
-
var spreadsheetMediaSchema = mediaBaseSchema.extend({ type:
|
|
60279
|
-
var archiveMediaSchema = mediaBaseSchema.extend({ type:
|
|
60280
|
-
var mediaSchema2 =
|
|
60452
|
+
var imageMediaSchema = mediaBaseSchema.extend({ type: z42.literal("image") });
|
|
60453
|
+
var videoMediaSchema = mediaBaseSchema.extend({ type: z42.literal("video") });
|
|
60454
|
+
var audioMediaSchema = mediaBaseSchema.extend({ type: z42.literal("audio") });
|
|
60455
|
+
var documentMediaSchema = mediaBaseSchema.extend({ type: z42.literal("document") });
|
|
60456
|
+
var spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z42.literal("spreadsheet") });
|
|
60457
|
+
var archiveMediaSchema = mediaBaseSchema.extend({ type: z42.literal("archive") });
|
|
60458
|
+
var mediaSchema2 = z42.discriminatedUnion("type", [
|
|
60281
60459
|
imageMediaSchema,
|
|
60282
60460
|
videoMediaSchema,
|
|
60283
60461
|
audioMediaSchema,
|
|
@@ -60921,6 +61099,34 @@ function normalizeEventStaffMemberId(value) {
|
|
|
60921
61099
|
const trimmed = value.trim();
|
|
60922
61100
|
return trimmed ? trimmed : null;
|
|
60923
61101
|
}
|
|
61102
|
+
|
|
61103
|
+
// ../blocks/src/system/blocks/events/shared/layout.ts
|
|
61104
|
+
var recoverEmptyHeadingWhenActive = {
|
|
61105
|
+
kind: "recover-empty-when-active",
|
|
61106
|
+
placeholder: "Add heading"
|
|
61107
|
+
};
|
|
61108
|
+
var recoverEmptyDescriptionWhenActive = {
|
|
61109
|
+
kind: "recover-empty-when-active",
|
|
61110
|
+
placeholder: "Add description"
|
|
61111
|
+
};
|
|
61112
|
+
function eventSectionHeaderLayoutNodes() {
|
|
61113
|
+
return [
|
|
61114
|
+
text(
|
|
61115
|
+
{ as: "h2" },
|
|
61116
|
+
bind("content.heading"),
|
|
61117
|
+
when("content.heading", {
|
|
61118
|
+
authoringPresence: recoverEmptyHeadingWhenActive
|
|
61119
|
+
})
|
|
61120
|
+
),
|
|
61121
|
+
richText(
|
|
61122
|
+
{ className: "rb-prose rb-max-w-none" },
|
|
61123
|
+
bind("content.description"),
|
|
61124
|
+
when("content.description", {
|
|
61125
|
+
authoringPresence: recoverEmptyDescriptionWhenActive
|
|
61126
|
+
})
|
|
61127
|
+
)
|
|
61128
|
+
];
|
|
61129
|
+
}
|
|
60924
61130
|
var publicPassProductSchema = z.object({
|
|
60925
61131
|
id: z.string(),
|
|
60926
61132
|
productUseCase: z.enum(["event_pass", "appointment_package"]).default("event_pass"),
|
|
@@ -62565,18 +62771,7 @@ var eventSpotlightFields = [
|
|
|
62565
62771
|
var eventSpotlightLayout = [
|
|
62566
62772
|
styledSection({
|
|
62567
62773
|
children: sectionContainer([
|
|
62568
|
-
|
|
62569
|
-
text(
|
|
62570
|
-
{ as: "h2" },
|
|
62571
|
-
bind("content.heading"),
|
|
62572
|
-
when("content.heading")
|
|
62573
|
-
),
|
|
62574
|
-
// Optional description
|
|
62575
|
-
richText(
|
|
62576
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
62577
|
-
bind("content.description"),
|
|
62578
|
-
when("content.description")
|
|
62579
|
-
),
|
|
62774
|
+
...eventSectionHeaderLayoutNodes(),
|
|
62580
62775
|
// Event spotlight component
|
|
62581
62776
|
el("event-spotlight", {
|
|
62582
62777
|
events: { $bind: { from: "data.events" } },
|
|
@@ -65278,18 +65473,7 @@ var eventListingAdditionalFields = [
|
|
|
65278
65473
|
var eventListingLayout = [
|
|
65279
65474
|
styledSection({
|
|
65280
65475
|
children: sectionContainer([
|
|
65281
|
-
|
|
65282
|
-
text(
|
|
65283
|
-
{ as: "h2" },
|
|
65284
|
-
bind("content.heading"),
|
|
65285
|
-
when("content.heading")
|
|
65286
|
-
),
|
|
65287
|
-
// Optional description
|
|
65288
|
-
richText(
|
|
65289
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
65290
|
-
bind("content.description"),
|
|
65291
|
-
when("content.description")
|
|
65292
|
-
),
|
|
65476
|
+
...eventSectionHeaderLayoutNodes(),
|
|
65293
65477
|
// Event listing component with pagination
|
|
65294
65478
|
el("event-listing", withApiBindings({
|
|
65295
65479
|
events: { $bind: { from: "data.events" } },
|
|
@@ -65629,14 +65813,7 @@ var eventCalendarLayout = [
|
|
|
65629
65813
|
styledSection({
|
|
65630
65814
|
children: sectionContainer(
|
|
65631
65815
|
[
|
|
65632
|
-
|
|
65633
|
-
text({ as: "h2" }, bind("content.heading"), when("content.heading")),
|
|
65634
|
-
// Optional description
|
|
65635
|
-
richText(
|
|
65636
|
-
{ className: "rb-prose rb-max-w-none" },
|
|
65637
|
-
bind("content.description"),
|
|
65638
|
-
when("content.description")
|
|
65639
|
-
),
|
|
65816
|
+
...eventSectionHeaderLayoutNodes(),
|
|
65640
65817
|
// Event calendar component (handles all display modes)
|
|
65641
65818
|
el(
|
|
65642
65819
|
"event-calendar",
|
|
@@ -71612,6 +71789,10 @@ var systemBlockDefinitionsRaw = [
|
|
|
71612
71789
|
flow: conversionFlow,
|
|
71613
71790
|
layoutProfiles: [layoutProfile({ variantKey: "default", family: "form", weight: "standard" })]
|
|
71614
71791
|
})),
|
|
71792
|
+
withDesignCapability("block.weekly-slot-availability", weeklySlotAvailabilityBlockDefinition, sectionOnly(), defineBlockDesignMetadata({
|
|
71793
|
+
flow: offeringsFlow,
|
|
71794
|
+
layoutProfiles: [layoutProfile({ variantKey: "default", family: "stack", weight: "standard" })]
|
|
71795
|
+
})),
|
|
71615
71796
|
withDesignCapability("block.event-registration", eventRegistrationBlockDefinition, sectionOnly(), defineBlockDesignMetadata({
|
|
71616
71797
|
flow: conversionFlow,
|
|
71617
71798
|
layoutProfiles: [layoutProfile({ variantKey: "default", family: "form", weight: "standard" })]
|
|
@@ -76530,6 +76711,80 @@ function cardTreatmentClass(value) {
|
|
|
76530
76711
|
}
|
|
76531
76712
|
}
|
|
76532
76713
|
var offerings_preview_default = OfferingsPreviewNode;
|
|
76714
|
+
function pluralizeWeeks(count3) {
|
|
76715
|
+
return count3 === 1 ? "1 upcoming week" : `${count3} upcoming weeks`;
|
|
76716
|
+
}
|
|
76717
|
+
function buildSlotCtaUrl(ctaUrl, slot) {
|
|
76718
|
+
const placeholderOrigin = "https://weekly-slot-availability.local";
|
|
76719
|
+
const isAbsoluteUrl = /^[a-z][a-z\d+.-]*:/i.test(ctaUrl);
|
|
76720
|
+
try {
|
|
76721
|
+
const parsed = new URL(ctaUrl, placeholderOrigin);
|
|
76722
|
+
parsed.searchParams.set("slotId", slot.id);
|
|
76723
|
+
parsed.searchParams.set("weekday", String(slot.weekday));
|
|
76724
|
+
parsed.searchParams.set("startTime", slot.startTime);
|
|
76725
|
+
parsed.searchParams.set("endTime", slot.endTime);
|
|
76726
|
+
parsed.searchParams.set("resourceId", slot.resourceId);
|
|
76727
|
+
parsed.searchParams.set("nextDate", slot.nextDate);
|
|
76728
|
+
if (isAbsoluteUrl) {
|
|
76729
|
+
return parsed.toString();
|
|
76730
|
+
}
|
|
76731
|
+
return `${parsed.pathname}${parsed.search}${parsed.hash}`;
|
|
76732
|
+
} catch {
|
|
76733
|
+
return ctaUrl;
|
|
76734
|
+
}
|
|
76735
|
+
}
|
|
76736
|
+
function buildSlotCtaLabel(ctaText, slot) {
|
|
76737
|
+
return `${ctaText}: ${slot.weekdayLabel} ${slot.startTime} to ${slot.endTime}`;
|
|
76738
|
+
}
|
|
76739
|
+
function WeeklySlotAvailabilityView({
|
|
76740
|
+
availability,
|
|
76741
|
+
loading = false,
|
|
76742
|
+
error,
|
|
76743
|
+
emptyMessage,
|
|
76744
|
+
ctaText,
|
|
76745
|
+
ctaUrl
|
|
76746
|
+
}) {
|
|
76747
|
+
const slots = availability?.slots ?? [];
|
|
76748
|
+
const resolvedEmptyMessage = emptyMessage ?? "No regular weekly openings are currently available.";
|
|
76749
|
+
const resolvedCtaText = ctaText ?? "Enquire about this slot";
|
|
76750
|
+
const resolvedCtaUrl = typeof ctaUrl === "string" ? ctaUrl.trim() : "";
|
|
76751
|
+
return /* @__PURE__ */ jsxs("div", { className: "weekly-slot-availability", children: [
|
|
76752
|
+
loading ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__status", children: "Loading availability..." }) : null,
|
|
76753
|
+
error ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__status", role: "status", children: error }) : null,
|
|
76754
|
+
!loading && !error && slots.length === 0 ? /* @__PURE__ */ jsx("p", { className: "weekly-slot-availability__empty", children: resolvedEmptyMessage }) : null,
|
|
76755
|
+
slots.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "weekly-slot-availability__list", children: slots.map((slot) => /* @__PURE__ */ jsxs("li", { className: "weekly-slot-availability__item", children: [
|
|
76756
|
+
/* @__PURE__ */ jsxs("div", { className: "weekly-slot-availability__time", children: [
|
|
76757
|
+
/* @__PURE__ */ jsx("span", { className: "weekly-slot-availability__weekday", children: slot.weekdayLabel }),
|
|
76758
|
+
/* @__PURE__ */ jsxs("span", { className: "weekly-slot-availability__range", children: [
|
|
76759
|
+
slot.startTime,
|
|
76760
|
+
" - ",
|
|
76761
|
+
slot.endTime
|
|
76762
|
+
] })
|
|
76763
|
+
] }),
|
|
76764
|
+
/* @__PURE__ */ jsxs("p", { className: "weekly-slot-availability__meta", children: [
|
|
76765
|
+
"Available in ",
|
|
76766
|
+
pluralizeWeeks(slot.availableWeeks),
|
|
76767
|
+
". Next open date",
|
|
76768
|
+
" ",
|
|
76769
|
+
slot.nextDate,
|
|
76770
|
+
"."
|
|
76771
|
+
] }),
|
|
76772
|
+
resolvedCtaUrl ? /* @__PURE__ */ jsx(
|
|
76773
|
+
"a",
|
|
76774
|
+
{
|
|
76775
|
+
className: "weekly-slot-availability__cta",
|
|
76776
|
+
href: buildSlotCtaUrl(resolvedCtaUrl, slot),
|
|
76777
|
+
"aria-label": buildSlotCtaLabel(resolvedCtaText, slot),
|
|
76778
|
+
children: resolvedCtaText
|
|
76779
|
+
}
|
|
76780
|
+
) : null
|
|
76781
|
+
] }, slot.id)) }) : null
|
|
76782
|
+
] });
|
|
76783
|
+
}
|
|
76784
|
+
function WeeklySlotAvailabilitySSR(props2) {
|
|
76785
|
+
return /* @__PURE__ */ jsx(WeeklySlotAvailabilityView, { ...props2 });
|
|
76786
|
+
}
|
|
76787
|
+
var weekly_slot_availability_server_default = WeeklySlotAvailabilitySSR;
|
|
76533
76788
|
function VariantSelectView(props2) {
|
|
76534
76789
|
const { options, selectedVariantId, disabled = false, onChange } = props2;
|
|
76535
76790
|
if (options.length === 0) return null;
|
|
@@ -78164,6 +78419,7 @@ var serverComponentRegistry = {
|
|
|
78164
78419
|
"event-spotlight": EventSpotlight,
|
|
78165
78420
|
"event-combined": EventCombinedSSR,
|
|
78166
78421
|
"offerings-preview": offerings_preview_default,
|
|
78422
|
+
"weekly-slot-availability": weekly_slot_availability_server_default,
|
|
78167
78423
|
...runtimeBackedBlockServerRegistry
|
|
78168
78424
|
};
|
|
78169
78425
|
|
|
@@ -78299,10 +78555,32 @@ function previewEditableTargetToPath(target) {
|
|
|
78299
78555
|
return assertNever(target);
|
|
78300
78556
|
}
|
|
78301
78557
|
}
|
|
78558
|
+
function previewEditableTargetToFieldKey(target) {
|
|
78559
|
+
if (target.kind !== "block-field") return null;
|
|
78560
|
+
return {
|
|
78561
|
+
kind: "block-field",
|
|
78562
|
+
blockId: blockIdFromEditorPath(target.path),
|
|
78563
|
+
fieldPath: target.fieldPath
|
|
78564
|
+
};
|
|
78565
|
+
}
|
|
78566
|
+
function blockIdFromEditorPath(path) {
|
|
78567
|
+
const match2 = /^blocks\.([^.]+)\./.exec(path);
|
|
78568
|
+
return match2?.[1] ?? "";
|
|
78569
|
+
}
|
|
78302
78570
|
function previewEditableTargetFieldConstraints(target, context) {
|
|
78303
78571
|
if (target.kind !== "block-field") return void 0;
|
|
78304
78572
|
return context.fieldConstraints?.[target.fieldPath] ?? context.fieldConstraints?.[stripNumericPathSegments(target.fieldPath)];
|
|
78305
78573
|
}
|
|
78574
|
+
function propsWithAuthoringPlaceholder(props2, node) {
|
|
78575
|
+
const authoringPresence = conditionalAuthoringPresenceFor(node.$when?.authoringPresence);
|
|
78576
|
+
if (authoringPresence.kind !== "recover-empty-when-active") return props2;
|
|
78577
|
+
if (!authoringPresence.placeholder || typeof props2.placeholder === "string") return props2;
|
|
78578
|
+
return {
|
|
78579
|
+
...props2,
|
|
78580
|
+
placeholder: authoringPresence.placeholder,
|
|
78581
|
+
ariaLabel: typeof props2.ariaLabel === "string" ? props2.ariaLabel : authoringPresence.placeholder
|
|
78582
|
+
};
|
|
78583
|
+
}
|
|
78306
78584
|
function isIdentityBinding(binding) {
|
|
78307
78585
|
return binding.transforms.length === 0 && binding.fallback === void 0 && binding.coerce === void 0 && binding.pick === "value";
|
|
78308
78586
|
}
|
|
@@ -78527,6 +78805,62 @@ function coerceBindingValue(value, binding) {
|
|
|
78527
78805
|
}
|
|
78528
78806
|
}
|
|
78529
78807
|
}
|
|
78808
|
+
function conditionalAuthoringPresenceFor(value) {
|
|
78809
|
+
return value ?? { kind: "visitor-only" };
|
|
78810
|
+
}
|
|
78811
|
+
function conditionalValuePresence(nodeType, value) {
|
|
78812
|
+
switch (nodeType) {
|
|
78813
|
+
case "text":
|
|
78814
|
+
return isTextConditionValueEmpty(value) ? { kind: "empty" } : { kind: "present" };
|
|
78815
|
+
case "richText":
|
|
78816
|
+
return isRichTextConditionValueEmpty(value) ? { kind: "empty" } : { kind: "present" };
|
|
78817
|
+
default:
|
|
78818
|
+
return value ? { kind: "present" } : { kind: "empty" };
|
|
78819
|
+
}
|
|
78820
|
+
}
|
|
78821
|
+
function isTextConditionValueEmpty(value) {
|
|
78822
|
+
const inlineText = parseInlineTextFromUnknown(value);
|
|
78823
|
+
if (inlineText.ok) {
|
|
78824
|
+
return inlineTextToPlainText(inlineText.value).trim().length === 0;
|
|
78825
|
+
}
|
|
78826
|
+
if (typeof value === "string") return value.trim().length === 0;
|
|
78827
|
+
if (value === null || value === void 0) return true;
|
|
78828
|
+
return !value;
|
|
78829
|
+
}
|
|
78830
|
+
function isRichTextConditionValueEmpty(value) {
|
|
78831
|
+
const root = unwrapRichTextRoot(value);
|
|
78832
|
+
if (typeof root === "string") return root.trim().length === 0;
|
|
78833
|
+
if (!isTipTapNode(root)) return root === null || root === void 0 || !root;
|
|
78834
|
+
return richTextPlainText(root).trim().length === 0;
|
|
78835
|
+
}
|
|
78836
|
+
function isTipTapNode(value) {
|
|
78837
|
+
return isPlainObject3(value) && typeof value.type === "string";
|
|
78838
|
+
}
|
|
78839
|
+
function richTextPlainText(node) {
|
|
78840
|
+
const ownText = typeof node.text === "string" ? node.text : "";
|
|
78841
|
+
const childText = (node.content ?? []).map(richTextPlainText).join("");
|
|
78842
|
+
return ownText + childText;
|
|
78843
|
+
}
|
|
78844
|
+
function planConditionalNodeRender(input) {
|
|
78845
|
+
if (input.conditionMatched) {
|
|
78846
|
+
return { kind: "render", reason: "condition-passed" };
|
|
78847
|
+
}
|
|
78848
|
+
if (input.authoringPresence.kind !== "recover-empty-when-active" || !input.conditionUsesPresenceSemantics || input.conditionPresence.kind !== "empty") {
|
|
78849
|
+
return { kind: "skip", reason: "condition-failed" };
|
|
78850
|
+
}
|
|
78851
|
+
if (!input.editableTarget) {
|
|
78852
|
+
return { kind: "skip", reason: "not-editable" };
|
|
78853
|
+
}
|
|
78854
|
+
if (!previewAuthoringFieldsEqual(input.editableTarget, input.authoringContext?.activeField ?? null)) {
|
|
78855
|
+
return { kind: "skip", reason: "inactive-authoring-context" };
|
|
78856
|
+
}
|
|
78857
|
+
return { kind: "render", reason: "authoring-presence" };
|
|
78858
|
+
}
|
|
78859
|
+
function previewAuthoringFieldsEqual(left, right) {
|
|
78860
|
+
return Boolean(
|
|
78861
|
+
right && left.kind === right.kind && left.blockId === right.blockId && left.fieldPath === right.fieldPath
|
|
78862
|
+
);
|
|
78863
|
+
}
|
|
78530
78864
|
function resolveBindingValue(binding, context) {
|
|
78531
78865
|
const fullPath = binding.from;
|
|
78532
78866
|
const segments = splitPath(fullPath);
|
|
@@ -78591,9 +78925,23 @@ function shouldRenderNode(node, context) {
|
|
|
78591
78925
|
const binding = parseBinding(node.$when.when, "$when");
|
|
78592
78926
|
const value = resolveBindingValue(binding, context);
|
|
78593
78927
|
const equals = node.$when.equals;
|
|
78594
|
-
const
|
|
78595
|
-
const
|
|
78596
|
-
|
|
78928
|
+
const conditionPresence = conditionalValuePresence(node.type, value);
|
|
78929
|
+
const usesPresenceSemantics = typeof equals === "undefined" && !node.$when.not;
|
|
78930
|
+
const matches2 = typeof equals === "undefined" ? conditionPresence.kind === "present" : value === equals;
|
|
78931
|
+
const conditionMatched = node.$when.not ? !matches2 : matches2;
|
|
78932
|
+
const parsedNodeBinding = node.$bind ? parseBinding(node.$bind, "$bind") : void 0;
|
|
78933
|
+
const editableTarget = node.type === "text" || node.type === "richText" ? previewEditableTargetToFieldKey(
|
|
78934
|
+
derivePreviewTextEditableTarget(parsedNodeBinding, context)
|
|
78935
|
+
) : null;
|
|
78936
|
+
const decision = planConditionalNodeRender({
|
|
78937
|
+
conditionMatched,
|
|
78938
|
+
conditionPresence,
|
|
78939
|
+
conditionUsesPresenceSemantics: usesPresenceSemantics,
|
|
78940
|
+
authoringPresence: conditionalAuthoringPresenceFor(node.$when.authoringPresence),
|
|
78941
|
+
editableTarget,
|
|
78942
|
+
authoringContext: context.previewAuthoring
|
|
78943
|
+
});
|
|
78944
|
+
return decision.kind === "render";
|
|
78597
78945
|
}
|
|
78598
78946
|
function applyScopes(node, context) {
|
|
78599
78947
|
if (!node.$scopes) return context;
|
|
@@ -78743,25 +79091,26 @@ function derivePreviewTextEditableTarget(parsedBinding, context) {
|
|
|
78743
79091
|
}
|
|
78744
79092
|
function injectEditorPath(props2, node, parsedBinding, context) {
|
|
78745
79093
|
if (node.type !== "text" && node.type !== "richText") return props2;
|
|
79094
|
+
const propsWithPlaceholder = propsWithAuthoringPlaceholder(props2, node);
|
|
78746
79095
|
const linkedEntryField = derivePreviewLinkedEntryFieldBinding(
|
|
78747
79096
|
node,
|
|
78748
79097
|
parsedBinding,
|
|
78749
79098
|
context
|
|
78750
79099
|
);
|
|
78751
79100
|
if (linkedEntryField) {
|
|
78752
|
-
return { ...
|
|
79101
|
+
return { ...propsWithPlaceholder, linkedEntryField };
|
|
78753
79102
|
}
|
|
78754
79103
|
const editableTarget = derivePreviewTextEditableTarget(parsedBinding, context);
|
|
78755
79104
|
const path = previewEditableTargetToPath(editableTarget);
|
|
78756
|
-
if (!path) return
|
|
79105
|
+
if (!path) return propsWithPlaceholder;
|
|
78757
79106
|
if (node.type === "text") {
|
|
78758
79107
|
const constraints = previewEditableTargetFieldConstraints(
|
|
78759
79108
|
editableTarget,
|
|
78760
79109
|
context
|
|
78761
79110
|
);
|
|
78762
|
-
return constraints ? { ...
|
|
79111
|
+
return constraints ? { ...propsWithPlaceholder, path, ...constraints } : { ...propsWithPlaceholder, path };
|
|
78763
79112
|
}
|
|
78764
|
-
return { ...
|
|
79113
|
+
return { ...propsWithPlaceholder, path };
|
|
78765
79114
|
}
|
|
78766
79115
|
function injectMediaSlotPath(props2, node, parsedBinding, context) {
|
|
78767
79116
|
if (!parsedBinding) return props2;
|
|
@@ -78853,7 +79202,8 @@ function resolveNode2(node, context, indexFallback) {
|
|
|
78853
79202
|
blockKind: context.blockKind,
|
|
78854
79203
|
blockContent: context.blockContent,
|
|
78855
79204
|
...node.type === "media" && context.imageResolveContext ? { imageResolveContext: context.imageResolveContext } : {},
|
|
78856
|
-
fragmentRegistry: context.fragmentRegistry
|
|
79205
|
+
fragmentRegistry: context.fragmentRegistry,
|
|
79206
|
+
previewAuthoring: context.previewAuthoring
|
|
78857
79207
|
};
|
|
78858
79208
|
const element = React61__default.createElement(component, elementProps, ...children);
|
|
78859
79209
|
if (headingDecorationPlan.kind === "skip") {
|
|
@@ -79218,7 +79568,8 @@ function makeDefaultBlockComponent(args) {
|
|
|
79218
79568
|
blockBindings,
|
|
79219
79569
|
editableRouteMetadataFieldIds,
|
|
79220
79570
|
fragmentRegistry: fragmentRegistry2,
|
|
79221
|
-
imageResolveContext
|
|
79571
|
+
imageResolveContext,
|
|
79572
|
+
previewAuthoring
|
|
79222
79573
|
}) {
|
|
79223
79574
|
const perfEnv = globalThis.process?.env;
|
|
79224
79575
|
const perfEnabled = perfEnv?.DEBUG_PERF === "1" && typeof window === "undefined";
|
|
@@ -79278,7 +79629,8 @@ function makeDefaultBlockComponent(args) {
|
|
|
79278
79629
|
editableRouteMetadataFieldIds,
|
|
79279
79630
|
fragmentRegistry: fragmentRegistry2,
|
|
79280
79631
|
fieldConstraints,
|
|
79281
|
-
imageResolveContext
|
|
79632
|
+
imageResolveContext,
|
|
79633
|
+
previewAuthoring
|
|
79282
79634
|
});
|
|
79283
79635
|
if (perfStart) {
|
|
79284
79636
|
const durationMs = Date.now() - perfStart;
|
|
@@ -83274,7 +83626,8 @@ function PageRenderer({
|
|
|
83274
83626
|
routeMap,
|
|
83275
83627
|
blockOverrides,
|
|
83276
83628
|
sdkConfig,
|
|
83277
|
-
customBlocks
|
|
83629
|
+
customBlocks,
|
|
83630
|
+
previewAuthoring
|
|
83278
83631
|
}) {
|
|
83279
83632
|
const imageResolveContext = React61.useMemo(
|
|
83280
83633
|
() => resolvePageRendererImageResolveContext(dataContext),
|
|
@@ -83313,7 +83666,8 @@ function PageRenderer({
|
|
|
83313
83666
|
blockOverrides,
|
|
83314
83667
|
sdkConfig,
|
|
83315
83668
|
customBlocks,
|
|
83316
|
-
imageResolveContext
|
|
83669
|
+
imageResolveContext,
|
|
83670
|
+
previewAuthoring
|
|
83317
83671
|
};
|
|
83318
83672
|
if (!shouldUseWrapper) {
|
|
83319
83673
|
return /* @__PURE__ */ jsx(MemoBlockSection, { ...blockSectionProps }, blockKey);
|
|
@@ -83434,7 +83788,8 @@ var MemoBlockSection = React61.memo(
|
|
|
83434
83788
|
blockOverrides,
|
|
83435
83789
|
sdkConfig,
|
|
83436
83790
|
customBlocks,
|
|
83437
|
-
imageResolveContext
|
|
83791
|
+
imageResolveContext,
|
|
83792
|
+
previewAuthoring
|
|
83438
83793
|
}) {
|
|
83439
83794
|
const perfEnv = globalThis.process?.env?.DEBUG_PERF;
|
|
83440
83795
|
const perfStart = perfEnv === "1" && typeof window === "undefined" ? Date.now() : 0;
|
|
@@ -83653,7 +84008,8 @@ var MemoBlockSection = React61.memo(
|
|
|
83653
84008
|
editableRouteMetadataFieldIds: dataContext?.editableRouteMetadataFieldIds ?? void 0,
|
|
83654
84009
|
viewModelOverrides: rootContext,
|
|
83655
84010
|
fragmentRegistry: fragmentRegistry2,
|
|
83656
|
-
imageResolveContext: resolvedImageResolveContext
|
|
84011
|
+
imageResolveContext: resolvedImageResolveContext,
|
|
84012
|
+
previewAuthoring
|
|
83657
84013
|
}
|
|
83658
84014
|
);
|
|
83659
84015
|
}
|
|
@@ -83674,7 +84030,7 @@ var MemoBlockSection = React61.memo(
|
|
|
83674
84030
|
}
|
|
83675
84031
|
},
|
|
83676
84032
|
(prev, next) => {
|
|
83677
|
-
return prev.block === next.block && prev.registry === next.registry && prev.dataContext === next.dataContext && prev.themeTokens === next.themeTokens && prev.themeConfig === next.themeConfig && prev.routeMap === next.routeMap && prev.usePlaceholders === next.usePlaceholders && prev.wrapBlock === next.wrapBlock && prev.blockOverrides === next.blockOverrides && prev.sdkConfig === next.sdkConfig && prev.customBlocks === next.customBlocks && prev.imageResolveContext === next.imageResolveContext;
|
|
84033
|
+
return prev.block === next.block && prev.registry === next.registry && prev.dataContext === next.dataContext && prev.themeTokens === next.themeTokens && prev.themeConfig === next.themeConfig && prev.routeMap === next.routeMap && prev.usePlaceholders === next.usePlaceholders && prev.wrapBlock === next.wrapBlock && prev.blockOverrides === next.blockOverrides && prev.sdkConfig === next.sdkConfig && prev.customBlocks === next.customBlocks && prev.imageResolveContext === next.imageResolveContext && prev.previewAuthoring === next.previewAuthoring;
|
|
83678
84034
|
}
|
|
83679
84035
|
);
|
|
83680
84036
|
function fallback(message2) {
|
|
@@ -95407,14 +95763,21 @@ function coercePayload(payload) {
|
|
|
95407
95763
|
|
|
95408
95764
|
// ../blocks/src/system/data/prefetchBlockData.ts
|
|
95409
95765
|
async function prefetchBlockData(page, context, options) {
|
|
95410
|
-
const {
|
|
95766
|
+
const {
|
|
95767
|
+
apiClient,
|
|
95768
|
+
isValidEndpoint,
|
|
95769
|
+
onError,
|
|
95770
|
+
getCustomBlockLoaders,
|
|
95771
|
+
getBlockDefinition: getBlockDefinition2 = getBlockDefinition,
|
|
95772
|
+
resolveParamsBindings: resolveParamsBindings2 = resolveParamsBindings
|
|
95773
|
+
} = options;
|
|
95411
95774
|
const results = {};
|
|
95412
95775
|
const tasks = [];
|
|
95413
95776
|
for (const block of page.blocks) {
|
|
95414
95777
|
const blockId = block.id;
|
|
95415
95778
|
if (!blockId) continue;
|
|
95416
95779
|
let loaders;
|
|
95417
|
-
const def =
|
|
95780
|
+
const def = getBlockDefinition2(block.kind);
|
|
95418
95781
|
if (def) {
|
|
95419
95782
|
loaders = normalizeDataLoaders(def);
|
|
95420
95783
|
} else if (getCustomBlockLoaders) {
|
|
@@ -95437,14 +95800,14 @@ async function prefetchBlockData(page, context, options) {
|
|
|
95437
95800
|
continue;
|
|
95438
95801
|
}
|
|
95439
95802
|
if (typeof loader.when !== "undefined") {
|
|
95440
|
-
const resolvedWhen =
|
|
95803
|
+
const resolvedWhen = resolveParamsBindings2(loader.when, vm, {
|
|
95441
95804
|
blockKind: block.kind
|
|
95442
95805
|
});
|
|
95443
95806
|
if (resolvedWhen !== true) {
|
|
95444
95807
|
continue;
|
|
95445
95808
|
}
|
|
95446
95809
|
}
|
|
95447
|
-
const rawParams =
|
|
95810
|
+
const rawParams = resolveParamsBindings2(loader.params, vm, {
|
|
95448
95811
|
blockKind: block.kind
|
|
95449
95812
|
});
|
|
95450
95813
|
const params = normalizeParams(rawParams);
|
|
@@ -95487,7 +95850,8 @@ var SUPPORTED_LOADER_ENDPOINTS = [
|
|
|
95487
95850
|
"listPublicPasses",
|
|
95488
95851
|
"listPublicMemberships",
|
|
95489
95852
|
"getPublicFormById",
|
|
95490
|
-
"getPublicBookingServices"
|
|
95853
|
+
"getPublicBookingServices",
|
|
95854
|
+
"getPublicWeeklySlotAvailability"
|
|
95491
95855
|
];
|
|
95492
95856
|
function isSupportedLoaderEndpoint(endpoint) {
|
|
95493
95857
|
return SUPPORTED_LOADER_ENDPOINTS.includes(endpoint);
|
|
@@ -95639,6 +96003,10 @@ function normalizeLoaderParams(endpoint, params, context) {
|
|
|
95639
96003
|
ensureSiteId(out, context);
|
|
95640
96004
|
return out;
|
|
95641
96005
|
}
|
|
96006
|
+
if (endpoint === "getPublicWeeklySlotAvailability") {
|
|
96007
|
+
ensureSiteId(out, context);
|
|
96008
|
+
return out;
|
|
96009
|
+
}
|
|
95642
96010
|
if (endpoint === "listPublicEvents") {
|
|
95643
96011
|
ensureSiteId(out, context);
|
|
95644
96012
|
return out;
|
|
@@ -126749,6 +127117,10 @@ var BOOKINGS = {
|
|
|
126749
127117
|
path: "/public/bookings/availability/slots",
|
|
126750
127118
|
method: "GET"
|
|
126751
127119
|
},
|
|
127120
|
+
getWeeklySlotAvailability: {
|
|
127121
|
+
path: "/public/bookings/weekly-slot-availability",
|
|
127122
|
+
method: "GET"
|
|
127123
|
+
},
|
|
126752
127124
|
getAvailableDates: {
|
|
126753
127125
|
path: "/public/bookings/availability/dates",
|
|
126754
127126
|
method: "GET"
|
|
@@ -127291,6 +127663,18 @@ function createBlockApi(config) {
|
|
|
127291
127663
|
}
|
|
127292
127664
|
});
|
|
127293
127665
|
},
|
|
127666
|
+
async getWeeklySlotAvailability(params) {
|
|
127667
|
+
const sid = requireSiteId();
|
|
127668
|
+
return request(BOOKINGS.getWeeklySlotAvailability, {
|
|
127669
|
+
query: {
|
|
127670
|
+
siteId: sid,
|
|
127671
|
+
serviceId: params.serviceId,
|
|
127672
|
+
resourceId: params.resourceId,
|
|
127673
|
+
horizonWeeks: params.horizonWeeks,
|
|
127674
|
+
timezone: params.timezone
|
|
127675
|
+
}
|
|
127676
|
+
});
|
|
127677
|
+
},
|
|
127294
127678
|
async getAvailableDates(params) {
|
|
127295
127679
|
const sid = requireSiteId();
|
|
127296
127680
|
return request(BOOKINGS.getAvailableDates, {
|
|
@@ -130334,8 +130718,18 @@ function usePolling(config) {
|
|
|
130334
130718
|
}
|
|
130335
130719
|
|
|
130336
130720
|
// ../blocks/src/system/runtime/hooks/useAppointmentCheckoutVerification.ts
|
|
130721
|
+
var appointmentCheckoutVerificationDeps = {
|
|
130722
|
+
useBlockApi,
|
|
130723
|
+
usePolling
|
|
130724
|
+
};
|
|
130337
130725
|
function useAppointmentCheckoutVerification(config) {
|
|
130338
|
-
|
|
130726
|
+
return useAppointmentCheckoutVerificationWithDeps(
|
|
130727
|
+
config,
|
|
130728
|
+
appointmentCheckoutVerificationDeps
|
|
130729
|
+
);
|
|
130730
|
+
}
|
|
130731
|
+
function useAppointmentCheckoutVerificationWithDeps(config, deps) {
|
|
130732
|
+
const api = deps.useBlockApi();
|
|
130339
130733
|
const pollingConfig = useMemo(() => {
|
|
130340
130734
|
if (!config) return null;
|
|
130341
130735
|
return {
|
|
@@ -130346,7 +130740,7 @@ function useAppointmentCheckoutVerification(config) {
|
|
|
130346
130740
|
interval: config.pollInterval
|
|
130347
130741
|
};
|
|
130348
130742
|
}, [api, config]);
|
|
130349
|
-
const polling = usePolling(pollingConfig);
|
|
130743
|
+
const polling = deps.usePolling(pollingConfig);
|
|
130350
130744
|
const state = resolveAppointmentCheckoutVerificationState({
|
|
130351
130745
|
config,
|
|
130352
130746
|
pollingStatus: polling.status,
|
|
@@ -132561,8 +132955,14 @@ function existingRegistrationLookupReducer(state, action) {
|
|
|
132561
132955
|
}
|
|
132562
132956
|
|
|
132563
132957
|
// ../blocks/src/system/runtime/nodes/event-registration/hooks.ts
|
|
132958
|
+
var eventRegistrationHooksDeps = {
|
|
132959
|
+
useBlockApi
|
|
132960
|
+
};
|
|
132564
132961
|
function usePortalAuth() {
|
|
132565
|
-
|
|
132962
|
+
return usePortalAuthWithDeps(eventRegistrationHooksDeps);
|
|
132963
|
+
}
|
|
132964
|
+
function usePortalAuthWithDeps(deps) {
|
|
132965
|
+
const api = deps.useBlockApi();
|
|
132566
132966
|
const [authState, setAuthState] = useState("checking");
|
|
132567
132967
|
const [profile, setProfile] = useState(null);
|
|
132568
132968
|
useEffect(() => {
|
|
@@ -132610,7 +133010,10 @@ function usePortalAuth() {
|
|
|
132610
133010
|
};
|
|
132611
133011
|
}
|
|
132612
133012
|
function useEligibility(params) {
|
|
132613
|
-
|
|
133013
|
+
return useEligibilityWithDeps(params, eventRegistrationHooksDeps);
|
|
133014
|
+
}
|
|
133015
|
+
function useEligibilityWithDeps(params, deps) {
|
|
133016
|
+
const api = deps.useBlockApi();
|
|
132614
133017
|
const ticketSelectionsKey = JSON.stringify(normalizeTicketSelectionLines(params.ticketSelections));
|
|
132615
133018
|
const [state, dispatch] = useReducer(
|
|
132616
133019
|
eligibilityLookupReducer,
|
|
@@ -132679,7 +133082,16 @@ function useExistingEventRegistration({
|
|
|
132679
133082
|
isAuthenticated,
|
|
132680
133083
|
occurrenceId
|
|
132681
133084
|
}) {
|
|
132682
|
-
|
|
133085
|
+
return useExistingEventRegistrationWithDeps(
|
|
133086
|
+
{ isAuthenticated, occurrenceId },
|
|
133087
|
+
eventRegistrationHooksDeps
|
|
133088
|
+
);
|
|
133089
|
+
}
|
|
133090
|
+
function useExistingEventRegistrationWithDeps({
|
|
133091
|
+
isAuthenticated,
|
|
133092
|
+
occurrenceId
|
|
133093
|
+
}, deps) {
|
|
133094
|
+
const api = deps.useBlockApi();
|
|
132683
133095
|
const [state, dispatch] = useReducer(
|
|
132684
133096
|
existingRegistrationLookupReducer,
|
|
132685
133097
|
initialExistingRegistrationLookupState
|
|
@@ -133015,9 +133427,6 @@ function SlidingScaleAmountField(props2) {
|
|
|
133015
133427
|
}
|
|
133016
133428
|
function TicketTypeQuantityRows(props2) {
|
|
133017
133429
|
const totalSelectedQuantity = getTicketSelectionTotal(props2.ticketSelections);
|
|
133018
|
-
const selectedTicketTypes = props2.ticketTypes.filter(
|
|
133019
|
-
(ticketType) => getTicketLineQuantity(props2.ticketSelections, ticketType.id) > 0
|
|
133020
|
-
);
|
|
133021
133430
|
return /* @__PURE__ */ jsxs("div", { className: "er-ticket-lines", children: [
|
|
133022
133431
|
/* @__PURE__ */ jsx("div", { className: "er-ticket-line-list", role: "list", "aria-label": "Tickets", children: props2.ticketTypes.map((ticketType) => {
|
|
133023
133432
|
const quantity = getTicketLineQuantity(props2.ticketSelections, ticketType.id);
|
|
@@ -133076,22 +133485,7 @@ function TicketTypeQuantityRows(props2) {
|
|
|
133076
133485
|
availabilityLabel: props2.availableSpots != null ? `${props2.availableSpots} spots available` : null
|
|
133077
133486
|
}
|
|
133078
133487
|
),
|
|
133079
|
-
|
|
133080
|
-
/* @__PURE__ */ jsxs("div", { className: "er-ticket-line-summary-title", children: [
|
|
133081
|
-
totalSelectedQuantity,
|
|
133082
|
-
" ticket",
|
|
133083
|
-
totalSelectedQuantity === 1 ? "" : "s",
|
|
133084
|
-
" selected"
|
|
133085
|
-
] }),
|
|
133086
|
-
/* @__PURE__ */ jsx("ul", { className: "er-ticket-line-summary-list", children: selectedTicketTypes.map((ticketType) => {
|
|
133087
|
-
const quantity = getTicketLineQuantity(props2.ticketSelections, ticketType.id);
|
|
133088
|
-
return /* @__PURE__ */ jsxs("li", { children: [
|
|
133089
|
-
quantity,
|
|
133090
|
-
" x ",
|
|
133091
|
-
ticketType.name
|
|
133092
|
-
] }, ticketType.id);
|
|
133093
|
-
}) })
|
|
133094
|
-
] }) : props2.hasAvailableTicketTypes ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "Choose at least one ticket to continue." }) : /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "No ticket types are currently available." })
|
|
133488
|
+
totalSelectedQuantity === 0 && props2.hasAvailableTicketTypes ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "Choose at least one ticket to continue." }) : totalSelectedQuantity === 0 ? /* @__PURE__ */ jsx("p", { className: "er-text er-text--muted", children: "No ticket types are currently available." }) : null
|
|
133095
133489
|
] });
|
|
133096
133490
|
}
|
|
133097
133491
|
function getAttendanceModeDetail(attendanceMode) {
|
|
@@ -134303,7 +134697,6 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
134303
134697
|
const autoAppliedDiscount = wizard.discountCode.trim().length > 0 ? null : wizard.autoAppliedDiscount;
|
|
134304
134698
|
const autoAppliedDiscountCents = Math.max(0, autoAppliedDiscount?.computedAmountCents ?? 0);
|
|
134305
134699
|
const discountedTotalCents = Math.max(0, subtotalCents - autoAppliedDiscountCents);
|
|
134306
|
-
const selectedLineSummary = (wizard.ticketSelectionSummaryLines ?? []).filter((line) => line.ticketTypeId !== null).map((line) => `${line.quantity} x ${line.label}`).join(", ");
|
|
134307
134700
|
const selectedDirectPaymentOption = getSelectedDirectPaymentOption({
|
|
134308
134701
|
wizard,
|
|
134309
134702
|
totalCents: discountedTotalCents,
|
|
@@ -134340,10 +134733,6 @@ function EventRegistrationSummaryBar(props2) {
|
|
|
134340
134733
|
/* @__PURE__ */ jsx("h4", { className: "er-summary-bar-event", children: summaryTitle }),
|
|
134341
134734
|
/* @__PURE__ */ jsxs("span", { className: "er-summary-bar-meta", children: [
|
|
134342
134735
|
summaryDate && formatEventDateTime(summaryDate, { timeZone: summaryTimeZone }),
|
|
134343
|
-
selectedLineSummary ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
134344
|
-
" \xB7 ",
|
|
134345
|
-
selectedLineSummary
|
|
134346
|
-
] }) : null,
|
|
134347
134736
|
wizard.step !== "select-event" && wizard.step !== "select-tickets" && wizard.ticketsCount > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
134348
134737
|
" \xB7 ",
|
|
134349
134738
|
wizard.ticketsCount,
|
|
@@ -134485,6 +134874,9 @@ function getWaitlistClaimTokenFromUrl() {
|
|
|
134485
134874
|
const token = new URLSearchParams(window.location.search).get("waitlist_claim")?.trim() ?? "";
|
|
134486
134875
|
return token.length > 0 ? token : null;
|
|
134487
134876
|
}
|
|
134877
|
+
var useWaitlistClaimDeps = {
|
|
134878
|
+
useBlockApi
|
|
134879
|
+
};
|
|
134488
134880
|
function subscribeToWaitlistClaimToken(callback) {
|
|
134489
134881
|
if (typeof window === "undefined") {
|
|
134490
134882
|
return () => {
|
|
@@ -134500,7 +134892,10 @@ function getWaitlistClaimTokenSnapshot() {
|
|
|
134500
134892
|
return getWaitlistClaimTokenFromUrl();
|
|
134501
134893
|
}
|
|
134502
134894
|
function useWaitlistClaim() {
|
|
134503
|
-
|
|
134895
|
+
return useWaitlistClaimWithDeps(useWaitlistClaimDeps);
|
|
134896
|
+
}
|
|
134897
|
+
function useWaitlistClaimWithDeps(deps) {
|
|
134898
|
+
const api = deps.useBlockApi();
|
|
134504
134899
|
const token = useSyncExternalStore(
|
|
134505
134900
|
subscribeToWaitlistClaimToken,
|
|
134506
134901
|
getWaitlistClaimTokenSnapshot,
|
|
@@ -134545,8 +134940,14 @@ function useWaitlistClaim() {
|
|
|
134545
134940
|
isLoading: isWaitlistClaimLoading(state)
|
|
134546
134941
|
};
|
|
134547
134942
|
}
|
|
134943
|
+
var paymentVerificationDeps = {
|
|
134944
|
+
useBlockApi
|
|
134945
|
+
};
|
|
134548
134946
|
function usePaymentVerification(config) {
|
|
134549
|
-
|
|
134947
|
+
return usePaymentVerificationWithDeps(config, paymentVerificationDeps);
|
|
134948
|
+
}
|
|
134949
|
+
function usePaymentVerificationWithDeps(config, deps) {
|
|
134950
|
+
const api = deps.useBlockApi();
|
|
134550
134951
|
const pollingConfig = useMemo(() => {
|
|
134551
134952
|
if (!config) return null;
|
|
134552
134953
|
return {
|
|
@@ -134656,7 +135057,13 @@ function useEventRegistrationStripeReturn(options) {
|
|
|
134656
135057
|
}
|
|
134657
135058
|
|
|
134658
135059
|
// ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.ts
|
|
135060
|
+
var eventRegistrationSubmitDeps = {
|
|
135061
|
+
savePendingRegistration
|
|
135062
|
+
};
|
|
134659
135063
|
function useEventRegistrationSubmit(options) {
|
|
135064
|
+
return useEventRegistrationSubmitWithDeps(options, eventRegistrationSubmitDeps);
|
|
135065
|
+
}
|
|
135066
|
+
function useEventRegistrationSubmitWithDeps(options, deps) {
|
|
134660
135067
|
return async (method, passId, membershipId, selection, submitOptions) => {
|
|
134661
135068
|
const submitOccurrenceId = options.registrationTarget?.occurrenceId;
|
|
134662
135069
|
if (!submitOccurrenceId) {
|
|
@@ -134745,7 +135152,7 @@ function useEventRegistrationSubmit(options) {
|
|
|
134745
135152
|
}
|
|
134746
135153
|
const siteId = options.api.config.siteId;
|
|
134747
135154
|
if (siteId && submitOccurrenceId) {
|
|
134748
|
-
savePendingRegistration(siteId, submitOccurrenceId, {
|
|
135155
|
+
deps.savePendingRegistration(siteId, submitOccurrenceId, {
|
|
134749
135156
|
attendeeId: result.attendeeId,
|
|
134750
135157
|
formData: options.formData,
|
|
134751
135158
|
ticketSelections,
|
|
@@ -134801,6 +135208,15 @@ function useEventRegistrationSubmit(options) {
|
|
|
134801
135208
|
}
|
|
134802
135209
|
|
|
134803
135210
|
// ../blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.ts
|
|
135211
|
+
var eventRegistrationWizardDeps = {
|
|
135212
|
+
usePortalAuth,
|
|
135213
|
+
useEligibility,
|
|
135214
|
+
useExistingEventRegistration,
|
|
135215
|
+
useWaitlistClaim,
|
|
135216
|
+
useEventRegistrationStripeReturn,
|
|
135217
|
+
useEventRegistrationSubmit,
|
|
135218
|
+
useDiscountCodeUi
|
|
135219
|
+
};
|
|
134804
135220
|
function parseCurrencyInputToCents(value) {
|
|
134805
135221
|
const trimmed = value.trim();
|
|
134806
135222
|
if (!trimmed) return null;
|
|
@@ -134831,6 +135247,9 @@ function getSlidingScaleSelectionMessage(input) {
|
|
|
134831
135247
|
return null;
|
|
134832
135248
|
}
|
|
134833
135249
|
function useEventRegistrationWizard(options) {
|
|
135250
|
+
return useEventRegistrationWizardWithDeps(options, eventRegistrationWizardDeps);
|
|
135251
|
+
}
|
|
135252
|
+
function useEventRegistrationWizardWithDeps(options, deps) {
|
|
134834
135253
|
const api = useBlockApi();
|
|
134835
135254
|
const registrationEvents = useMemo(
|
|
134836
135255
|
() => toRegistrationEvents(options.events ?? []),
|
|
@@ -134880,8 +135299,8 @@ function useEventRegistrationWizard(options) {
|
|
|
134880
135299
|
const [registrationResult, setRegistrationResult] = useState(null);
|
|
134881
135300
|
const [errorMessage, setErrorMessage] = useState("");
|
|
134882
135301
|
const [altchaSolution, setAltchaSolution] = useState(null);
|
|
134883
|
-
const { authState: portalAuthState, profile: portalProfile } = usePortalAuth();
|
|
134884
|
-
const waitlistClaim = useWaitlistClaim();
|
|
135302
|
+
const { authState: portalAuthState, profile: portalProfile } = deps.usePortalAuth();
|
|
135303
|
+
const waitlistClaim = deps.useWaitlistClaim();
|
|
134885
135304
|
const [showMagicLinkModal, setShowMagicLinkModal] = useState(false);
|
|
134886
135305
|
const [pendingAttendeeId, setPendingAttendeeId] = useState(null);
|
|
134887
135306
|
const [paymentStepState, setPaymentStepState] = useState({
|
|
@@ -134946,7 +135365,7 @@ function useEventRegistrationWizard(options) {
|
|
|
134946
135365
|
if (flowState.ticketsCount === ticketsCount) return;
|
|
134947
135366
|
dispatchFlow({ type: "set-tickets-count", ticketsCount });
|
|
134948
135367
|
}, [flowState.ticketsCount, ticketsCount]);
|
|
134949
|
-
const eligibilityResult = useEligibility({
|
|
135368
|
+
const eligibilityResult = deps.useEligibility({
|
|
134950
135369
|
enabled: portalAuthState === "authenticated" || step === "enter-details" || step === "select-payment",
|
|
134951
135370
|
occurrenceId,
|
|
134952
135371
|
attendanceMode: selectedAttendanceMode,
|
|
@@ -134954,7 +135373,7 @@ function useEventRegistrationWizard(options) {
|
|
|
134954
135373
|
selectedSlidingAmount: parseCurrencyInputToCents(selectedSlidingAmountInput),
|
|
134955
135374
|
email: formData.email
|
|
134956
135375
|
});
|
|
134957
|
-
const existingRegistrationResult = useExistingEventRegistration({
|
|
135376
|
+
const existingRegistrationResult = deps.useExistingEventRegistration({
|
|
134958
135377
|
isAuthenticated: portalAuthState === "authenticated",
|
|
134959
135378
|
occurrenceId
|
|
134960
135379
|
});
|
|
@@ -135048,7 +135467,7 @@ function useEventRegistrationWizard(options) {
|
|
|
135048
135467
|
useEffect(() => {
|
|
135049
135468
|
dispatchFlow({ type: "eligibility-updated", eligibility });
|
|
135050
135469
|
}, [eligibility]);
|
|
135051
|
-
const verification = useEventRegistrationStripeReturn({
|
|
135470
|
+
const verification = deps.useEventRegistrationStripeReturn({
|
|
135052
135471
|
api,
|
|
135053
135472
|
events: registrationEvents,
|
|
135054
135473
|
occurrenceId,
|
|
@@ -135312,10 +135731,10 @@ function useEventRegistrationWizard(options) {
|
|
|
135312
135731
|
if (discountContext?.type !== "event") return void 0;
|
|
135313
135732
|
return ticketSelectionSubtotalCents;
|
|
135314
135733
|
}, [discountContext, ticketSelectionSubtotalCents]);
|
|
135315
|
-
const discountUi = useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
|
|
135734
|
+
const discountUi = deps.useDiscountCodeUi({ api, discountContext, subtotalCents: discountSubtotalCents });
|
|
135316
135735
|
const selectionMethod = paymentSelection.method;
|
|
135317
135736
|
const shouldShowDiscountToggle = discountContext !== null && discountUi.manualCodeEntryAllowed && (selectionMethod === "stripe" || selectionMethod === "pass_bundle" || selectionMethod === "membership_bundle");
|
|
135318
|
-
const handleSubmit = useEventRegistrationSubmit({
|
|
135737
|
+
const handleSubmit = deps.useEventRegistrationSubmit({
|
|
135319
135738
|
api,
|
|
135320
135739
|
registrationTarget,
|
|
135321
135740
|
selectedAttendanceMode,
|
|
@@ -144107,6 +144526,114 @@ function NewsletterFormClient({
|
|
|
144107
144526
|
}
|
|
144108
144527
|
var newsletter_form_client_default = NewsletterFormClient;
|
|
144109
144528
|
|
|
144529
|
+
// ../blocks/src/system/runtime/nodes/weekly-slot-availability.client.state.ts
|
|
144530
|
+
function normalizeWeeklySlotAvailabilityHorizonWeeks(value) {
|
|
144531
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
144532
|
+
return value;
|
|
144533
|
+
}
|
|
144534
|
+
if (typeof value === "string" && value.trim()) {
|
|
144535
|
+
const parsed = Number.parseInt(value, 10);
|
|
144536
|
+
if (Number.isFinite(parsed)) {
|
|
144537
|
+
return parsed;
|
|
144538
|
+
}
|
|
144539
|
+
}
|
|
144540
|
+
return 4;
|
|
144541
|
+
}
|
|
144542
|
+
|
|
144543
|
+
// ../blocks/src/system/runtime/nodes/weekly-slot-availability.client.controller.ts
|
|
144544
|
+
function resolveWeeklySlotAvailabilityTimezone(value) {
|
|
144545
|
+
return value?.trim() || getRuntimeTimeZone();
|
|
144546
|
+
}
|
|
144547
|
+
function useWeeklySlotAvailabilityLoadState(api, input) {
|
|
144548
|
+
const { serviceId, resourceId, horizonWeeks, timezone, availability: initialAvailability } = input;
|
|
144549
|
+
const hasExplicitTimezone = Boolean(timezone?.trim());
|
|
144550
|
+
const canUseInitialAvailability = Boolean(
|
|
144551
|
+
initialAvailability && hasExplicitTimezone
|
|
144552
|
+
);
|
|
144553
|
+
const [availability, setAvailability] = React61.useState(
|
|
144554
|
+
initialAvailability ?? null
|
|
144555
|
+
);
|
|
144556
|
+
const [loading, setLoading] = React61.useState(
|
|
144557
|
+
() => Boolean(serviceId) && !initialAvailability
|
|
144558
|
+
);
|
|
144559
|
+
const [error, setError] = React61.useState(null);
|
|
144560
|
+
React61.useEffect(() => {
|
|
144561
|
+
if (!serviceId) {
|
|
144562
|
+
setAvailability(null);
|
|
144563
|
+
setLoading(false);
|
|
144564
|
+
setError(null);
|
|
144565
|
+
return;
|
|
144566
|
+
}
|
|
144567
|
+
if (canUseInitialAvailability) {
|
|
144568
|
+
setAvailability(initialAvailability ?? null);
|
|
144569
|
+
setLoading(false);
|
|
144570
|
+
setError(null);
|
|
144571
|
+
return;
|
|
144572
|
+
}
|
|
144573
|
+
let active = true;
|
|
144574
|
+
setLoading(true);
|
|
144575
|
+
setError(null);
|
|
144576
|
+
api.getWeeklySlotAvailability({
|
|
144577
|
+
serviceId,
|
|
144578
|
+
resourceId: resourceId ?? void 0,
|
|
144579
|
+
horizonWeeks: normalizeWeeklySlotAvailabilityHorizonWeeks(horizonWeeks),
|
|
144580
|
+
timezone: resolveWeeklySlotAvailabilityTimezone(timezone)
|
|
144581
|
+
}).then((result) => {
|
|
144582
|
+
if (!active) return;
|
|
144583
|
+
setAvailability(result);
|
|
144584
|
+
}).catch(() => {
|
|
144585
|
+
if (!active) return;
|
|
144586
|
+
setError("Availability could not be loaded right now.");
|
|
144587
|
+
}).finally(() => {
|
|
144588
|
+
if (!active) return;
|
|
144589
|
+
setLoading(false);
|
|
144590
|
+
});
|
|
144591
|
+
return () => {
|
|
144592
|
+
active = false;
|
|
144593
|
+
};
|
|
144594
|
+
}, [
|
|
144595
|
+
api,
|
|
144596
|
+
serviceId,
|
|
144597
|
+
resourceId,
|
|
144598
|
+
horizonWeeks,
|
|
144599
|
+
timezone,
|
|
144600
|
+
initialAvailability,
|
|
144601
|
+
canUseInitialAvailability
|
|
144602
|
+
]);
|
|
144603
|
+
return { availability, loading, error };
|
|
144604
|
+
}
|
|
144605
|
+
function WeeklySlotAvailabilityClient({
|
|
144606
|
+
serviceId,
|
|
144607
|
+
resourceId,
|
|
144608
|
+
horizonWeeks,
|
|
144609
|
+
timezone,
|
|
144610
|
+
availability: initialAvailability,
|
|
144611
|
+
emptyMessage,
|
|
144612
|
+
ctaText,
|
|
144613
|
+
ctaUrl
|
|
144614
|
+
}) {
|
|
144615
|
+
const api = useBlockApi();
|
|
144616
|
+
const { availability, loading, error } = useWeeklySlotAvailabilityLoadState(api, {
|
|
144617
|
+
serviceId,
|
|
144618
|
+
resourceId,
|
|
144619
|
+
horizonWeeks,
|
|
144620
|
+
timezone,
|
|
144621
|
+
availability: initialAvailability
|
|
144622
|
+
});
|
|
144623
|
+
return /* @__PURE__ */ jsx(
|
|
144624
|
+
WeeklySlotAvailabilityView,
|
|
144625
|
+
{
|
|
144626
|
+
availability,
|
|
144627
|
+
loading,
|
|
144628
|
+
error,
|
|
144629
|
+
emptyMessage,
|
|
144630
|
+
ctaText,
|
|
144631
|
+
ctaUrl
|
|
144632
|
+
}
|
|
144633
|
+
);
|
|
144634
|
+
}
|
|
144635
|
+
var weekly_slot_availability_client_default = WeeklySlotAvailabilityClient;
|
|
144636
|
+
|
|
144110
144637
|
// ../blocks/src/system/runtime/components/registry.client.tsx
|
|
144111
144638
|
function isRecord20(value) {
|
|
144112
144639
|
return typeof value === "object" && value !== null;
|
|
@@ -144247,7 +144774,8 @@ var clientComponentRegistryEntries = {
|
|
|
144247
144774
|
"booking-form": defineExplicitAdapterClientEntry(BookingFormNodeClient, { produces: "island-props" }),
|
|
144248
144775
|
"event-details": defineExplicitAdapterClientEntry(EventDetailsIslandClient, { produces: "client-props" }),
|
|
144249
144776
|
"location-map": defineExplicitAdapterClientEntry(LocationMapIslandClient, { produces: "client-props" }),
|
|
144250
|
-
"event-combined": defineExplicitAdapterClientEntry(EventCombinedIslandClient, { produces: "client-props" })
|
|
144777
|
+
"event-combined": defineExplicitAdapterClientEntry(EventCombinedIslandClient, { produces: "client-props" }),
|
|
144778
|
+
"weekly-slot-availability": defineSourcePropsClientEntry(weekly_slot_availability_client_default)
|
|
144251
144779
|
};
|
|
144252
144780
|
var clientComponentRegistry = buildClientRegistryFromEntries(
|
|
144253
144781
|
serverComponentRegistry,
|
|
@@ -149642,7 +150170,8 @@ var riverbankSiteConfigInputSchema = z.object({
|
|
|
149642
150170
|
}).strict();
|
|
149643
150171
|
z.object({
|
|
149644
150172
|
config: riverbankSiteConfigInputSchema,
|
|
149645
|
-
forceContentTypes: z.boolean().optional()
|
|
150173
|
+
forceContentTypes: z.boolean().optional(),
|
|
150174
|
+
mode: z.enum(["apply", "preview"]).optional()
|
|
149646
150175
|
}).strict();
|
|
149647
150176
|
var LAUNCH_REQUIREMENT_OVERRIDE_DEFINITIONS = {
|
|
149648
150177
|
configure_appointments: {
|
|
@@ -184702,7 +185231,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
184702
185231
|
return x === y2 && (x !== 0 || 1 / x === 1 / y2) || x !== x && y2 !== y2;
|
|
184703
185232
|
}
|
|
184704
185233
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
184705
|
-
var
|
|
185234
|
+
var useState98 = React$1.useState, useEffect103 = React$1.useEffect, useLayoutEffect11 = React$1.useLayoutEffect, useDebugValue2 = React$1.useDebugValue;
|
|
184706
185235
|
var didWarnOld18Alpha = false;
|
|
184707
185236
|
var didWarnUncachedGetSnapshot = false;
|
|
184708
185237
|
function useSyncExternalStore7(subscribe, getSnapshot, getServerSnapshot) {
|
|
@@ -184724,7 +185253,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
184724
185253
|
}
|
|
184725
185254
|
}
|
|
184726
185255
|
}
|
|
184727
|
-
var _useState =
|
|
185256
|
+
var _useState = useState98({
|
|
184728
185257
|
inst: {
|
|
184729
185258
|
value,
|
|
184730
185259
|
getSnapshot
|
|
@@ -184739,7 +185268,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
184739
185268
|
});
|
|
184740
185269
|
}
|
|
184741
185270
|
}, [subscribe, value, getSnapshot]);
|
|
184742
|
-
|
|
185271
|
+
useEffect103(function() {
|
|
184743
185272
|
if (checkIfSnapshotChanged(inst)) {
|
|
184744
185273
|
forceUpdate({
|
|
184745
185274
|
inst
|
|
@@ -185004,7 +185533,7 @@ function requireWithSelector_development() {
|
|
|
185004
185533
|
}
|
|
185005
185534
|
var objectIs = typeof Object.is === "function" ? Object.is : is;
|
|
185006
185535
|
var useSyncExternalStore7 = shim2.useSyncExternalStore;
|
|
185007
|
-
var useRef84 = React$1.useRef,
|
|
185536
|
+
var useRef84 = React$1.useRef, useEffect103 = React$1.useEffect, useMemo95 = React$1.useMemo, useDebugValue2 = React$1.useDebugValue;
|
|
185008
185537
|
function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
185009
185538
|
var instRef = useRef84(null);
|
|
185010
185539
|
var inst;
|
|
@@ -185061,7 +185590,7 @@ function requireWithSelector_development() {
|
|
|
185061
185590
|
return [getSnapshotWithSelector, getServerSnapshotWithSelector];
|
|
185062
185591
|
}, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
|
|
185063
185592
|
var value = useSyncExternalStore7(subscribe, getSelection2, getServerSelection);
|
|
185064
|
-
|
|
185593
|
+
useEffect103(function() {
|
|
185065
185594
|
inst.hasValue = true;
|
|
185066
185595
|
inst.value = value;
|
|
185067
185596
|
}, [value]);
|
|
@@ -185920,6 +186449,8 @@ function PreviewTextEditor(props2) {
|
|
|
185920
186449
|
children,
|
|
185921
186450
|
className,
|
|
185922
186451
|
maxLength,
|
|
186452
|
+
placeholder = "Add text",
|
|
186453
|
+
ariaLabel,
|
|
185923
186454
|
as: Comp = "span"
|
|
185924
186455
|
} = props2;
|
|
185925
186456
|
const { isEditingMode } = useEditor();
|
|
@@ -185936,6 +186467,8 @@ function PreviewTextEditor(props2) {
|
|
|
185936
186467
|
const [lastSyncedVersion, setLastSyncedVersion] = useState(version2);
|
|
185937
186468
|
const [isFocused, setIsFocused] = useState(false);
|
|
185938
186469
|
const normalizedValue = normalizeValue(value, fallbackValue);
|
|
186470
|
+
const isEmpty = normalizedValue.trim().length === 0;
|
|
186471
|
+
const accessibleLabel = ariaLabel ?? placeholder;
|
|
185939
186472
|
const handleSetValue = useCallback(
|
|
185940
186473
|
(nextValue) => {
|
|
185941
186474
|
setValue(limitTextLength(nextValue, maxLength));
|
|
@@ -185968,6 +186501,7 @@ function PreviewTextEditor(props2) {
|
|
|
185968
186501
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
185969
186502
|
/* @__PURE__ */ jsx("style", { children: `
|
|
185970
186503
|
[data-rb-preview-text-editor] {
|
|
186504
|
+
min-width: 1ch;
|
|
185971
186505
|
outline: 1px dashed transparent;
|
|
185972
186506
|
outline-offset: 2px;
|
|
185973
186507
|
transition: outline-color 160ms ease, background-color 160ms ease;
|
|
@@ -185980,12 +186514,18 @@ function PreviewTextEditor(props2) {
|
|
|
185980
186514
|
outline: 1px dashed rgba(156, 163, 175, 0.75) !important;
|
|
185981
186515
|
outline-offset: 2px !important;
|
|
185982
186516
|
}
|
|
186517
|
+
[data-rb-preview-text-editor][data-rb-preview-text-empty="true"]::before {
|
|
186518
|
+
content: attr(data-placeholder);
|
|
186519
|
+
color: rgba(148, 163, 184, 0.86);
|
|
186520
|
+
}
|
|
185983
186521
|
` }),
|
|
185984
186522
|
/* @__PURE__ */ jsx(
|
|
185985
186523
|
Comp,
|
|
185986
186524
|
{
|
|
185987
186525
|
"data-rb-preview-text-editor": true,
|
|
186526
|
+
"data-rb-preview-text-empty": isEmpty ? "true" : void 0,
|
|
185988
186527
|
"data-rb-preview-text-linked-focus": isLinkedSidebarFocus ? "true" : void 0,
|
|
186528
|
+
"data-placeholder": placeholder,
|
|
185989
186529
|
ref: (node) => {
|
|
185990
186530
|
editableRef.current = node;
|
|
185991
186531
|
if (!node) return;
|
|
@@ -185995,6 +186535,9 @@ function PreviewTextEditor(props2) {
|
|
|
185995
186535
|
},
|
|
185996
186536
|
contentEditable: true,
|
|
185997
186537
|
suppressContentEditableWarning: true,
|
|
186538
|
+
role: "textbox",
|
|
186539
|
+
"aria-multiline": "false",
|
|
186540
|
+
"aria-label": accessibleLabel,
|
|
185998
186541
|
className: `rounded px-1 transition-colors focus:bg-white/10 focus-visible:bg-white/10 ${isLinkedSidebarFocus || isFocused ? "bg-white/5" : ""} ${className ?? ""}`,
|
|
185999
186542
|
onInput: (event) => {
|
|
186000
186543
|
const nextValue = readLimitedEditableText(event.currentTarget);
|
|
@@ -186063,6 +186606,8 @@ function PreviewInlineTextEditor({
|
|
|
186063
186606
|
onBlockFieldFocus,
|
|
186064
186607
|
className,
|
|
186065
186608
|
maxLength,
|
|
186609
|
+
placeholder = "Add heading",
|
|
186610
|
+
ariaLabel,
|
|
186066
186611
|
as: Comp = "span"
|
|
186067
186612
|
}) {
|
|
186068
186613
|
const { isEditingMode } = useEditor();
|
|
@@ -186091,7 +186636,8 @@ function PreviewInlineTextEditor({
|
|
|
186091
186636
|
onChange: handleChange,
|
|
186092
186637
|
as: Comp,
|
|
186093
186638
|
maxLength,
|
|
186094
|
-
placeholder
|
|
186639
|
+
placeholder,
|
|
186640
|
+
ariaLabel: ariaLabel ?? placeholder,
|
|
186095
186641
|
toolbarTone: "dark",
|
|
186096
186642
|
className: `rounded px-1 transition-colors focus:bg-white/10 focus-visible:bg-white/10 ${isLinkedSidebarFocus || isFocused ? "bg-white/5" : ""} ${className ?? ""}`,
|
|
186097
186643
|
onFocus: () => {
|
|
@@ -186109,7 +186655,9 @@ var PreviewRichTextEditorInner = ({
|
|
|
186109
186655
|
onBlockFieldFocus,
|
|
186110
186656
|
className = "",
|
|
186111
186657
|
doc: doc3,
|
|
186112
|
-
variant
|
|
186658
|
+
variant,
|
|
186659
|
+
placeholder = "Add description",
|
|
186660
|
+
ariaLabel
|
|
186113
186661
|
}) => {
|
|
186114
186662
|
const bindingInput = linkedEntryField?.write ?? path;
|
|
186115
186663
|
if (!bindingInput) {
|
|
@@ -186179,7 +186727,9 @@ var PreviewRichTextEditorInner = ({
|
|
|
186179
186727
|
"div",
|
|
186180
186728
|
{
|
|
186181
186729
|
"data-rb-preview-richtext-editor": true,
|
|
186730
|
+
"data-placeholder": placeholder,
|
|
186182
186731
|
"data-rb-preview-richtext-linked-focus": isLinkedSidebarFocus ? "true" : void 0,
|
|
186732
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
186183
186733
|
className: `relative w-full min-w-0 ${className}`,
|
|
186184
186734
|
onMouseEnter: () => setIsHovered(true),
|
|
186185
186735
|
onMouseLeave: () => setIsHovered(false),
|
|
@@ -186211,6 +186761,7 @@ var PreviewRichTextEditorInner = ({
|
|
|
186211
186761
|
className: `relative w-full min-h-[30px] rounded border border-dashed ${showAffordance ? "border-slate-400/75 bg-white/5" : "border-transparent bg-transparent"}`,
|
|
186212
186762
|
contentClassName: "cursor-text",
|
|
186213
186763
|
placeholderClassName: "text-gray-400",
|
|
186764
|
+
placeholderText: placeholder,
|
|
186214
186765
|
toolbarAlwaysVisible: false,
|
|
186215
186766
|
toolbarTone: "dark",
|
|
186216
186767
|
toolbarPortalToChrome: false,
|