glitchgrab 1.60.0 → 1.61.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/dist/index.js +410 -407
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +410 -407
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4026,7 +4026,9 @@ function AssistSheet({
|
|
|
4026
4026
|
backgroundColor: t.bg,
|
|
4027
4027
|
// The "already filed?" card can be taller than the sheet; scroll
|
|
4028
4028
|
// it instead of clipping its buttons off the bottom (#590).
|
|
4029
|
-
|
|
4029
|
+
// The bottom sheet has only a max-height, so a % here resolves
|
|
4030
|
+
// to auto and never scrolls (#596): use the viewport there.
|
|
4031
|
+
...similarSlot ? { maxHeight: narrow ? "55dvh" : "70%", overflowY: "auto" } : {}
|
|
4030
4032
|
},
|
|
4031
4033
|
children: [
|
|
4032
4034
|
phase === "solved" ? /* @__PURE__ */ jsx3(
|
|
@@ -8747,6 +8749,7 @@ var WEEKDAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
|
8747
8749
|
var DAY_MS = 864e5;
|
|
8748
8750
|
var ZONE_PAD_MS = 14 * 36e5;
|
|
8749
8751
|
var WIDE_QUERY = "(min-width: 900px)";
|
|
8752
|
+
var SPLIT_QUERY = "(min-width: 1120px)";
|
|
8750
8753
|
function localZone() {
|
|
8751
8754
|
try {
|
|
8752
8755
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -8853,13 +8856,14 @@ function BookingDialog({
|
|
|
8853
8856
|
}) {
|
|
8854
8857
|
var _a, _b, _c, _d, _e;
|
|
8855
8858
|
const wide = useMediaQuery(WIDE_QUERY, true);
|
|
8859
|
+
const split = useMediaQuery(SPLIT_QUERY, true) && wide;
|
|
8856
8860
|
const t = useMemo3(() => {
|
|
8857
8861
|
if (!open) return LIGHT;
|
|
8858
8862
|
const base = detectDark() ? DARK : LIGHT;
|
|
8859
8863
|
const accent = detectHostAccent();
|
|
8860
8864
|
return accent ? { ...base, ink: accent.accent, onInk: accent.accentText } : base;
|
|
8861
8865
|
}, [open]);
|
|
8862
|
-
const [step, setStep] = useState5("
|
|
8866
|
+
const [step, setStep] = useState5("pick");
|
|
8863
8867
|
const [zone, setZone] = useState5(localZone);
|
|
8864
8868
|
const [twelve, setTwelve] = useState5(prefers12h);
|
|
8865
8869
|
const [month, setMonth] = useState5(() => dayKeyIn(Date.now(), localZone()).slice(0, 7));
|
|
@@ -8874,11 +8878,10 @@ function BookingDialog({
|
|
|
8874
8878
|
const [phone, setPhone] = useState5("");
|
|
8875
8879
|
const [dial, setDial] = useState5(() => defaultDialForZone(localZone()));
|
|
8876
8880
|
const [phoneTouched, setPhoneTouched] = useState5(false);
|
|
8877
|
-
const [
|
|
8881
|
+
const [tried, setTried] = useState5(false);
|
|
8878
8882
|
const [questions, setQuestions] = useState5([]);
|
|
8879
8883
|
const [answers, setAnswers] = useState5({});
|
|
8880
8884
|
const [pageLoaded, setPageLoaded] = useState5(false);
|
|
8881
|
-
const [asked, setAsked] = useState5(false);
|
|
8882
8885
|
const [requireOtp, setRequireOtp] = useState5(true);
|
|
8883
8886
|
const [code, setCode] = useState5("");
|
|
8884
8887
|
const [bookingId, setBookingId] = useState5(null);
|
|
@@ -8938,7 +8941,7 @@ function BookingDialog({
|
|
|
8938
8941
|
useEffect5(() => {
|
|
8939
8942
|
if (!open) return;
|
|
8940
8943
|
const now = localZone();
|
|
8941
|
-
setStep("
|
|
8944
|
+
setStep("pick");
|
|
8942
8945
|
setZone(now);
|
|
8943
8946
|
setMonth(dayKeyIn(Date.now(), now).slice(0, 7));
|
|
8944
8947
|
setSlotsByMonth({});
|
|
@@ -8950,7 +8953,7 @@ function BookingDialog({
|
|
|
8950
8953
|
setPreviewEnded(false);
|
|
8951
8954
|
setAvatarFailed(false);
|
|
8952
8955
|
setPageLoaded(false);
|
|
8953
|
-
|
|
8956
|
+
setTried(false);
|
|
8954
8957
|
}, [open]);
|
|
8955
8958
|
const monthLoaded = month in slotsByMonth;
|
|
8956
8959
|
useEffect5(() => {
|
|
@@ -8980,13 +8983,22 @@ function BookingDialog({
|
|
|
8980
8983
|
const atFirstMonth = month <= today.slice(0, 7);
|
|
8981
8984
|
const pastHorizon = monthLoaded && !error && byDay.size === 0 && !atFirstMonth;
|
|
8982
8985
|
const given = questions.flatMap((q) => q.options.includes(answers[q.id]) ? [{ ...q, answer: answers[q.id] }] : []);
|
|
8983
|
-
const
|
|
8984
|
-
const
|
|
8985
|
-
const
|
|
8986
|
+
const unanswered = questions.filter((q) => q.required && !q.options.includes(answers[q.id]));
|
|
8987
|
+
const phoneError = phoneProblem(dial, phone);
|
|
8988
|
+
const nameMissing = !name.trim();
|
|
8989
|
+
const emailMissing = !email.includes("@");
|
|
8990
|
+
const missing = [
|
|
8991
|
+
...nameMissing ? ["your name"] : [],
|
|
8992
|
+
...phoneError ? ["a valid mobile number"] : [],
|
|
8993
|
+
...emailMissing ? ["your email"] : [],
|
|
8994
|
+
...unanswered.map((q) => `an answer to \u201C${q.label}\u201D`),
|
|
8995
|
+
...selected ? [] : ["a day and time"]
|
|
8996
|
+
];
|
|
8997
|
+
const roomy = step === "pick";
|
|
8986
8998
|
async function startBooking() {
|
|
8987
8999
|
var _a2, _b2, _c2;
|
|
8988
|
-
if (!selected)
|
|
8989
|
-
|
|
9000
|
+
if (missing.length > 0 || !selected) {
|
|
9001
|
+
setTried(true);
|
|
8990
9002
|
setPhoneTouched(true);
|
|
8991
9003
|
return;
|
|
8992
9004
|
}
|
|
@@ -9004,7 +9016,6 @@ function BookingDialog({
|
|
|
9004
9016
|
name,
|
|
9005
9017
|
email,
|
|
9006
9018
|
phone: toE164(dial, phone),
|
|
9007
|
-
note,
|
|
9008
9019
|
answers: Object.fromEntries(given.map((q) => [q.id, q.answer])),
|
|
9009
9020
|
startsAt: selected.startsAt,
|
|
9010
9021
|
// The zone the times were shown in, which is the one the visitor chose.
|
|
@@ -9066,8 +9077,6 @@ function BookingDialog({
|
|
|
9066
9077
|
setBusy(false);
|
|
9067
9078
|
}
|
|
9068
9079
|
}
|
|
9069
|
-
const phoneError = phoneProblem(dial, phone);
|
|
9070
|
-
const canSubmitDetails = Boolean(name.trim() && email.includes("@"));
|
|
9071
9080
|
const selectedEnd = selected ? (_e = selected.endsAt) != null ? _e : new Date(new Date(selected.startsAt).getTime() + page.slotMinutes * 6e4).toISOString() : null;
|
|
9072
9081
|
const monthDate = new Date(keyToUtc(`${month}-01`));
|
|
9073
9082
|
const muted = { color: t.muted };
|
|
@@ -9225,7 +9234,7 @@ function BookingDialog({
|
|
|
9225
9234
|
/* @__PURE__ */ jsx6("div", { style: { fontSize: 20, fontWeight: 600, lineHeight: 1.25, paddingRight: 32, overflowWrap: "anywhere" }, children: page.title }),
|
|
9226
9235
|
page.description && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, lineHeight: 1.5, overflowWrap: "anywhere", ...muted }, children: page.description }),
|
|
9227
9236
|
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 4, fontSize: 14 }, children: [
|
|
9228
|
-
selected && step !== "
|
|
9237
|
+
selected && step !== "pick" && /* @__PURE__ */ jsx6(Row, { icon: "calendar", t, children: /* @__PURE__ */ jsxs6("span", { children: [
|
|
9229
9238
|
new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9230
9239
|
weekday: "long",
|
|
9231
9240
|
month: "long",
|
|
@@ -9240,33 +9249,7 @@ function BookingDialog({
|
|
|
9240
9249
|
selectedEnd && formatTime(selectedEnd, zone, twelve)
|
|
9241
9250
|
] })
|
|
9242
9251
|
] }) }),
|
|
9243
|
-
|
|
9244
|
-
given.map((q) => q.answer).join(" \xB7 "),
|
|
9245
|
-
view === "slots" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9246
|
-
" ",
|
|
9247
|
-
/* @__PURE__ */ jsx6(
|
|
9248
|
-
"button",
|
|
9249
|
-
{
|
|
9250
|
-
type: "button",
|
|
9251
|
-
onClick: () => setAsked(false),
|
|
9252
|
-
className: "gg-bk-link",
|
|
9253
|
-
style: {
|
|
9254
|
-
border: 0,
|
|
9255
|
-
// Room for a thumb without pushing the rows apart.
|
|
9256
|
-
padding: "8px 6px",
|
|
9257
|
-
margin: "-8px 0",
|
|
9258
|
-
background: "transparent",
|
|
9259
|
-
color: t.muted,
|
|
9260
|
-
fontFamily: "inherit",
|
|
9261
|
-
fontSize: 13,
|
|
9262
|
-
textDecoration: "underline",
|
|
9263
|
-
cursor: "pointer"
|
|
9264
|
-
},
|
|
9265
|
-
children: "Change"
|
|
9266
|
-
}
|
|
9267
|
-
)
|
|
9268
|
-
] })
|
|
9269
|
-
] }) }),
|
|
9252
|
+
step !== "pick" && given.length > 0 && /* @__PURE__ */ jsx6(Row, { icon: "check", t, children: given.map((q) => q.answer).join(" \xB7 ") }),
|
|
9270
9253
|
/* @__PURE__ */ jsx6(Row, { icon: "clock", t, children: formatDuration(page.slotMinutes) }),
|
|
9271
9254
|
/* @__PURE__ */ jsx6(Row, { icon: "video", t, children: "Google Meet" }),
|
|
9272
9255
|
/* @__PURE__ */ jsx6(Row, { icon: "globe", t, children: roomy ? (
|
|
@@ -9323,328 +9306,365 @@ function BookingDialog({
|
|
|
9323
9306
|
]
|
|
9324
9307
|
}
|
|
9325
9308
|
);
|
|
9326
|
-
const calendar = /* @__PURE__ */ jsxs6(
|
|
9327
|
-
"div",
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9309
|
+
const calendar = /* @__PURE__ */ jsxs6("div", { style: { padding: wide ? "22px 20px 12px" : "16px 16px 8px", boxSizing: "border-box" }, children: [
|
|
9310
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 14 }, children: [
|
|
9311
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 16, fontWeight: 600 }, children: [
|
|
9312
|
+
monthDate.toLocaleDateString("en-US", { month: "long", timeZone: "UTC" }),
|
|
9313
|
+
" ",
|
|
9314
|
+
/* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: monthDate.getUTCFullYear() })
|
|
9315
|
+
] }),
|
|
9316
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 4 }, children: [
|
|
9317
|
+
/* @__PURE__ */ jsx6(
|
|
9318
|
+
NavButton,
|
|
9319
|
+
{
|
|
9320
|
+
t,
|
|
9321
|
+
label: "Previous month",
|
|
9322
|
+
icon: "left",
|
|
9323
|
+
disabled: atFirstMonth,
|
|
9324
|
+
onClick: () => setMonth(shiftMonth(month, -1))
|
|
9325
|
+
}
|
|
9326
|
+
),
|
|
9327
|
+
/* @__PURE__ */ jsx6(
|
|
9328
|
+
NavButton,
|
|
9329
|
+
{
|
|
9330
|
+
t,
|
|
9331
|
+
label: "Next month",
|
|
9332
|
+
icon: "right",
|
|
9333
|
+
disabled: pastHorizon,
|
|
9334
|
+
onClick: () => setMonth(shiftMonth(month, 1))
|
|
9335
|
+
}
|
|
9336
|
+
)
|
|
9337
|
+
] })
|
|
9338
|
+
] }),
|
|
9339
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))", gap: 4 }, children: [
|
|
9340
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ jsx6(
|
|
9341
|
+
"div",
|
|
9342
|
+
{
|
|
9343
|
+
style: {
|
|
9344
|
+
textAlign: "center",
|
|
9345
|
+
fontSize: 11,
|
|
9346
|
+
fontWeight: 500,
|
|
9347
|
+
letterSpacing: ".08em",
|
|
9348
|
+
textTransform: "uppercase",
|
|
9349
|
+
padding: "6px 0 8px",
|
|
9350
|
+
color: t.text
|
|
9351
|
+
},
|
|
9352
|
+
children: w
|
|
9353
|
+
},
|
|
9354
|
+
w
|
|
9355
|
+
)),
|
|
9356
|
+
grid.map((key) => {
|
|
9357
|
+
const inMonth = key.startsWith(month);
|
|
9358
|
+
const bookable = byDay.has(key);
|
|
9359
|
+
const isSelected = key === day;
|
|
9360
|
+
const dayNum = Number(key.slice(8));
|
|
9361
|
+
if (!inMonth && !bookable) return /* @__PURE__ */ jsx6("div", { "aria-hidden": true }, key);
|
|
9362
|
+
return /* @__PURE__ */ jsxs6(
|
|
9363
|
+
"button",
|
|
9364
|
+
{
|
|
9365
|
+
type: "button",
|
|
9366
|
+
disabled: !bookable,
|
|
9367
|
+
onClick: () => setPickedDay(key),
|
|
9368
|
+
"aria-pressed": isSelected,
|
|
9369
|
+
"aria-label": new Date(keyToUtc(key)).toLocaleDateString("en-US", {
|
|
9370
|
+
weekday: "long",
|
|
9371
|
+
month: "long",
|
|
9372
|
+
day: "numeric",
|
|
9373
|
+
timeZone: "UTC"
|
|
9374
|
+
}),
|
|
9375
|
+
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9376
|
+
style: {
|
|
9377
|
+
position: "relative",
|
|
9378
|
+
// Shorter than square: the times sit under the month now, and
|
|
9379
|
+
// both should fit without scrolling on a laptop.
|
|
9380
|
+
aspectRatio: wide ? "5 / 4" : "1 / 1",
|
|
9381
|
+
minHeight: 36,
|
|
9382
|
+
border: 0,
|
|
9383
|
+
borderRadius: 8,
|
|
9384
|
+
padding: 0,
|
|
9385
|
+
fontFamily: "inherit",
|
|
9386
|
+
fontSize: wide ? 15 : 14,
|
|
9387
|
+
fontWeight: bookable ? 600 : 400,
|
|
9388
|
+
cursor: bookable ? "pointer" : "default",
|
|
9389
|
+
background: isSelected ? t.ink : bookable ? t.open : "transparent",
|
|
9390
|
+
color: isSelected ? t.onInk : bookable ? t.text : t.faint,
|
|
9391
|
+
opacity: monthLoaded ? 1 : 0.5
|
|
9392
|
+
},
|
|
9393
|
+
children: [
|
|
9394
|
+
!inMonth && dayNum === 1 && /* @__PURE__ */ jsx6(
|
|
9395
|
+
"span",
|
|
9396
|
+
{
|
|
9397
|
+
style: {
|
|
9398
|
+
position: "absolute",
|
|
9399
|
+
top: 4,
|
|
9400
|
+
left: 0,
|
|
9401
|
+
right: 0,
|
|
9402
|
+
fontSize: 9,
|
|
9403
|
+
fontWeight: 500,
|
|
9404
|
+
letterSpacing: ".06em",
|
|
9405
|
+
textTransform: "uppercase"
|
|
9406
|
+
},
|
|
9407
|
+
children: new Date(keyToUtc(key)).toLocaleDateString("en-US", { month: "short", timeZone: "UTC" })
|
|
9408
|
+
}
|
|
9409
|
+
),
|
|
9410
|
+
dayNum,
|
|
9411
|
+
key === today && /* @__PURE__ */ jsx6(
|
|
9412
|
+
"span",
|
|
9413
|
+
{
|
|
9414
|
+
"aria-hidden": true,
|
|
9415
|
+
style: {
|
|
9416
|
+
position: "absolute",
|
|
9417
|
+
bottom: 6,
|
|
9418
|
+
left: "50%",
|
|
9419
|
+
width: 4,
|
|
9420
|
+
height: 4,
|
|
9421
|
+
marginLeft: -2,
|
|
9422
|
+
borderRadius: 999,
|
|
9423
|
+
background: isSelected ? t.onInk : t.text
|
|
9424
|
+
}
|
|
9425
|
+
}
|
|
9426
|
+
)
|
|
9427
|
+
]
|
|
9428
|
+
},
|
|
9429
|
+
key
|
|
9430
|
+
);
|
|
9431
|
+
})
|
|
9432
|
+
] })
|
|
9433
|
+
] });
|
|
9434
|
+
const times = /* @__PURE__ */ jsxs6("div", { style: { borderTop: `1px solid ${t.border}`, padding: wide ? "16px 20px 0" : "16px 16px 0", boxSizing: "border-box" }, children: [
|
|
9435
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 14 }, children: [
|
|
9436
|
+
/* @__PURE__ */ jsx6("div", { style: { fontSize: 16, fontWeight: 600, whiteSpace: "nowrap" }, children: day ? /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9437
|
+
new Date(keyToUtc(day)).toLocaleDateString("en-US", { weekday: "short", timeZone: "UTC" }),
|
|
9438
|
+
" ",
|
|
9439
|
+
/* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: ordinal(Number(day.slice(8))) })
|
|
9440
|
+
] }) : /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: "Times" }) }),
|
|
9441
|
+
/* @__PURE__ */ jsx6(
|
|
9442
|
+
"div",
|
|
9443
|
+
{
|
|
9444
|
+
role: "group",
|
|
9445
|
+
"aria-label": "Clock format",
|
|
9446
|
+
style: { display: "flex", padding: 3, borderRadius: 8, background: t.open, flex: "0 0 auto" },
|
|
9447
|
+
children: [true, false].map((h12) => /* @__PURE__ */ jsx6(
|
|
9448
|
+
"button",
|
|
9369
9449
|
{
|
|
9450
|
+
type: "button",
|
|
9451
|
+
"aria-pressed": twelve === h12,
|
|
9452
|
+
onClick: () => setTwelve(h12),
|
|
9370
9453
|
style: {
|
|
9371
|
-
|
|
9372
|
-
|
|
9454
|
+
border: 0,
|
|
9455
|
+
borderRadius: 6,
|
|
9456
|
+
padding: "4px 9px",
|
|
9457
|
+
fontFamily: "inherit",
|
|
9458
|
+
fontSize: 13,
|
|
9373
9459
|
fontWeight: 500,
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9460
|
+
cursor: "pointer",
|
|
9461
|
+
background: twelve === h12 ? t.bg : "transparent",
|
|
9462
|
+
color: twelve === h12 ? t.text : t.muted,
|
|
9463
|
+
boxShadow: twelve === h12 ? "0 1px 2px rgba(0,0,0,.12)" : "none"
|
|
9378
9464
|
},
|
|
9379
|
-
children:
|
|
9465
|
+
children: h12 ? "12h" : "24h"
|
|
9380
9466
|
},
|
|
9381
|
-
|
|
9382
|
-
))
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9467
|
+
String(h12)
|
|
9468
|
+
))
|
|
9469
|
+
}
|
|
9470
|
+
)
|
|
9471
|
+
] }),
|
|
9472
|
+
/* @__PURE__ */ jsxs6(
|
|
9473
|
+
"div",
|
|
9474
|
+
{
|
|
9475
|
+
role: "group",
|
|
9476
|
+
"aria-label": "Times",
|
|
9477
|
+
style: {
|
|
9478
|
+
paddingBottom: 20,
|
|
9479
|
+
display: "grid",
|
|
9480
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(84px, 1fr))",
|
|
9481
|
+
gap: 8
|
|
9482
|
+
},
|
|
9483
|
+
children: [
|
|
9484
|
+
error && /* @__PURE__ */ jsx6("div", { style: { color: t.danger, fontSize: 13, lineHeight: 1.5, gridColumn: "1 / -1" }, children: error }),
|
|
9485
|
+
!monthLoaded && !error && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, gridColumn: "1 / -1", ...muted }, children: "Finding times\u2026" }),
|
|
9486
|
+
monthLoaded && !error && !day && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, lineHeight: 1.5, gridColumn: "1 / -1", ...muted }, children: pastHorizon ? "Nothing can be booked this far ahead yet." : "No times left this month. Try the next one." }),
|
|
9487
|
+
monthLoaded && daySlots.map((slot) => {
|
|
9488
|
+
const on = (selected == null ? void 0 : selected.startsAt) === slot.startsAt;
|
|
9489
|
+
return /* @__PURE__ */ jsx6(
|
|
9390
9490
|
"button",
|
|
9391
9491
|
{
|
|
9392
9492
|
type: "button",
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
day: "numeric",
|
|
9400
|
-
timeZone: "UTC"
|
|
9401
|
-
}),
|
|
9402
|
-
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9493
|
+
"aria-pressed": on,
|
|
9494
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9495
|
+
onClick: () => {
|
|
9496
|
+
setSelected(slot);
|
|
9497
|
+
setError(null);
|
|
9498
|
+
},
|
|
9403
9499
|
style: {
|
|
9404
|
-
|
|
9405
|
-
aspectRatio: "1 / 1",
|
|
9406
|
-
minHeight: 36,
|
|
9407
|
-
border: 0,
|
|
9500
|
+
padding: "10px 8px",
|
|
9408
9501
|
borderRadius: 8,
|
|
9409
|
-
|
|
9502
|
+
border: `1px solid ${on ? t.ink : t.border}`,
|
|
9503
|
+
background: on ? t.ink : t.pane,
|
|
9504
|
+
color: on ? t.onInk : t.text,
|
|
9410
9505
|
fontFamily: "inherit",
|
|
9411
|
-
fontSize:
|
|
9412
|
-
fontWeight:
|
|
9413
|
-
cursor:
|
|
9414
|
-
|
|
9415
|
-
color: isSelected ? t.onInk : bookable ? t.text : t.faint,
|
|
9416
|
-
opacity: monthLoaded ? 1 : 0.5
|
|
9506
|
+
fontSize: 14,
|
|
9507
|
+
fontWeight: 500,
|
|
9508
|
+
cursor: "pointer",
|
|
9509
|
+
textAlign: "center"
|
|
9417
9510
|
},
|
|
9418
|
-
children:
|
|
9419
|
-
!inMonth && dayNum === 1 && /* @__PURE__ */ jsx6(
|
|
9420
|
-
"span",
|
|
9421
|
-
{
|
|
9422
|
-
style: {
|
|
9423
|
-
position: "absolute",
|
|
9424
|
-
top: 4,
|
|
9425
|
-
left: 0,
|
|
9426
|
-
right: 0,
|
|
9427
|
-
fontSize: 9,
|
|
9428
|
-
fontWeight: 500,
|
|
9429
|
-
letterSpacing: ".06em",
|
|
9430
|
-
textTransform: "uppercase"
|
|
9431
|
-
},
|
|
9432
|
-
children: new Date(keyToUtc(key)).toLocaleDateString("en-US", { month: "short", timeZone: "UTC" })
|
|
9433
|
-
}
|
|
9434
|
-
),
|
|
9435
|
-
dayNum,
|
|
9436
|
-
key === today && /* @__PURE__ */ jsx6(
|
|
9437
|
-
"span",
|
|
9438
|
-
{
|
|
9439
|
-
"aria-hidden": true,
|
|
9440
|
-
style: {
|
|
9441
|
-
position: "absolute",
|
|
9442
|
-
bottom: 6,
|
|
9443
|
-
left: "50%",
|
|
9444
|
-
width: 4,
|
|
9445
|
-
height: 4,
|
|
9446
|
-
marginLeft: -2,
|
|
9447
|
-
borderRadius: 999,
|
|
9448
|
-
background: isSelected ? t.onInk : t.text
|
|
9449
|
-
}
|
|
9450
|
-
}
|
|
9451
|
-
)
|
|
9452
|
-
]
|
|
9511
|
+
children: formatTime(slot.startsAt, zone, twelve)
|
|
9453
9512
|
},
|
|
9454
|
-
|
|
9513
|
+
slot.startsAt
|
|
9455
9514
|
);
|
|
9456
9515
|
})
|
|
9457
|
-
]
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
);
|
|
9461
|
-
const
|
|
9516
|
+
]
|
|
9517
|
+
}
|
|
9518
|
+
)
|
|
9519
|
+
] });
|
|
9520
|
+
const details = /* @__PURE__ */ jsxs6(
|
|
9462
9521
|
"div",
|
|
9463
9522
|
{
|
|
9464
9523
|
style: {
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
borderTop: wide ? void 0 : `1px solid ${t.border}`,
|
|
9469
|
-
padding: wide ? "24px 20px 0" : "16px 16px 0",
|
|
9524
|
+
flex: "1 1 auto",
|
|
9525
|
+
minWidth: 0,
|
|
9526
|
+
padding: wide ? "24px 28px" : "20px",
|
|
9470
9527
|
boxSizing: "border-box",
|
|
9528
|
+
overflowY: split ? "auto" : void 0,
|
|
9471
9529
|
display: "flex",
|
|
9472
9530
|
flexDirection: "column",
|
|
9473
|
-
|
|
9531
|
+
gap: 16
|
|
9474
9532
|
},
|
|
9475
9533
|
children: [
|
|
9476
|
-
/* @__PURE__ */
|
|
9477
|
-
|
|
9478
|
-
new Date(keyToUtc(day)).toLocaleDateString("en-US", { weekday: "short", timeZone: "UTC" }),
|
|
9479
|
-
" ",
|
|
9480
|
-
/* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: ordinal(Number(day.slice(8))) })
|
|
9481
|
-
] }) : /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: "Times" }) }),
|
|
9482
|
-
/* @__PURE__ */ jsx6(
|
|
9483
|
-
"div",
|
|
9484
|
-
{
|
|
9485
|
-
role: "group",
|
|
9486
|
-
"aria-label": "Clock format",
|
|
9487
|
-
style: { display: "flex", padding: 3, borderRadius: 8, background: t.open, flex: "0 0 auto" },
|
|
9488
|
-
children: [true, false].map((h12) => /* @__PURE__ */ jsx6(
|
|
9489
|
-
"button",
|
|
9490
|
-
{
|
|
9491
|
-
type: "button",
|
|
9492
|
-
"aria-pressed": twelve === h12,
|
|
9493
|
-
onClick: () => setTwelve(h12),
|
|
9494
|
-
style: {
|
|
9495
|
-
border: 0,
|
|
9496
|
-
borderRadius: 6,
|
|
9497
|
-
padding: "4px 9px",
|
|
9498
|
-
fontFamily: "inherit",
|
|
9499
|
-
fontSize: 13,
|
|
9500
|
-
fontWeight: 500,
|
|
9501
|
-
cursor: "pointer",
|
|
9502
|
-
background: twelve === h12 ? t.bg : "transparent",
|
|
9503
|
-
color: twelve === h12 ? t.text : t.muted,
|
|
9504
|
-
boxShadow: twelve === h12 ? "0 1px 2px rgba(0,0,0,.12)" : "none"
|
|
9505
|
-
},
|
|
9506
|
-
children: h12 ? "12h" : "24h"
|
|
9507
|
-
},
|
|
9508
|
-
String(h12)
|
|
9509
|
-
))
|
|
9510
|
-
}
|
|
9511
|
-
)
|
|
9512
|
-
] }),
|
|
9513
|
-
/* @__PURE__ */ jsxs6(
|
|
9514
|
-
"div",
|
|
9534
|
+
/* @__PURE__ */ jsx6(
|
|
9535
|
+
Field,
|
|
9515
9536
|
{
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9537
|
+
t,
|
|
9538
|
+
label: "Full name",
|
|
9539
|
+
value: name,
|
|
9540
|
+
onChange: setName,
|
|
9541
|
+
autoComplete: "name",
|
|
9542
|
+
error: tried && nameMissing ? "Add your name" : null
|
|
9543
|
+
}
|
|
9544
|
+
),
|
|
9545
|
+
/* @__PURE__ */ jsx6(
|
|
9546
|
+
PhoneField,
|
|
9547
|
+
{
|
|
9548
|
+
t,
|
|
9549
|
+
dial,
|
|
9550
|
+
national: phone,
|
|
9551
|
+
onChange: (nextDial, national) => {
|
|
9552
|
+
setDial(nextDial);
|
|
9553
|
+
setPhone(national);
|
|
9525
9554
|
},
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9555
|
+
onBlur: () => setPhoneTouched(true),
|
|
9556
|
+
error: phoneTouched ? phoneError : null,
|
|
9557
|
+
hint: requireOtp ? "We text a code here to confirm, then a reminder before the call." : "We send a reminder here before the call."
|
|
9558
|
+
}
|
|
9559
|
+
),
|
|
9560
|
+
/* @__PURE__ */ jsx6(
|
|
9561
|
+
Field,
|
|
9562
|
+
{
|
|
9563
|
+
t,
|
|
9564
|
+
label: "Email",
|
|
9565
|
+
value: email,
|
|
9566
|
+
onChange: setEmail,
|
|
9567
|
+
type: "email",
|
|
9568
|
+
autoComplete: "email",
|
|
9569
|
+
error: tried && emailMissing ? "Add an email \u2014 the invite goes there" : null
|
|
9570
|
+
}
|
|
9571
|
+
),
|
|
9572
|
+
!pageLoaded && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, ...muted }, children: "Loading\u2026" }),
|
|
9573
|
+
questions.map((q) => {
|
|
9574
|
+
const gap = tried && unanswered.includes(q);
|
|
9575
|
+
return /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": q.label, children: [
|
|
9576
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 13, fontWeight: 500, overflowWrap: "anywhere" }, children: [
|
|
9577
|
+
q.label,
|
|
9578
|
+
!q.required && /* @__PURE__ */ jsx6("span", { style: { fontWeight: 400, ...muted }, children: " (optional)" })
|
|
9579
|
+
] }),
|
|
9580
|
+
/* @__PURE__ */ jsx6("div", { style: { display: "flex", flexWrap: "wrap", gap: 8, marginTop: 8 }, children: q.options.map((option) => {
|
|
9581
|
+
const on = answers[q.id] === option;
|
|
9582
|
+
return /* @__PURE__ */ jsx6(
|
|
9531
9583
|
"button",
|
|
9532
9584
|
{
|
|
9533
9585
|
type: "button",
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9586
|
+
"aria-pressed": on,
|
|
9587
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9588
|
+
onClick: () => setAnswers((prev) => {
|
|
9589
|
+
if (on && !q.required) {
|
|
9590
|
+
const rest = { ...prev };
|
|
9591
|
+
delete rest[q.id];
|
|
9592
|
+
return rest;
|
|
9593
|
+
}
|
|
9594
|
+
return { ...prev, [q.id]: option };
|
|
9595
|
+
}),
|
|
9540
9596
|
style: {
|
|
9541
|
-
|
|
9542
|
-
|
|
9597
|
+
padding: "7px 12px",
|
|
9598
|
+
minHeight: 36,
|
|
9543
9599
|
borderRadius: 8,
|
|
9544
|
-
border: `1px solid ${t.border}`,
|
|
9545
|
-
background: t.pane,
|
|
9546
|
-
color: t.text,
|
|
9600
|
+
border: `1px solid ${on ? t.ink : gap ? t.danger : t.border}`,
|
|
9601
|
+
background: on ? t.ink : t.pane,
|
|
9602
|
+
color: on ? t.onInk : t.text,
|
|
9547
9603
|
fontFamily: "inherit",
|
|
9548
9604
|
fontSize: 14,
|
|
9549
9605
|
fontWeight: 500,
|
|
9550
9606
|
cursor: "pointer",
|
|
9551
|
-
|
|
9607
|
+
overflowWrap: "anywhere",
|
|
9608
|
+
textAlign: "left"
|
|
9552
9609
|
},
|
|
9553
|
-
children:
|
|
9610
|
+
children: option
|
|
9554
9611
|
},
|
|
9555
|
-
|
|
9556
|
-
)
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9612
|
+
option
|
|
9613
|
+
);
|
|
9614
|
+
}) }),
|
|
9615
|
+
gap && /* @__PURE__ */ jsx6("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: "Pick one" })
|
|
9616
|
+
] }, q.id);
|
|
9617
|
+
})
|
|
9560
9618
|
]
|
|
9561
9619
|
}
|
|
9562
9620
|
);
|
|
9563
|
-
const
|
|
9621
|
+
const pickedLabel = selected ? `${new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9622
|
+
weekday: "short",
|
|
9623
|
+
month: "short",
|
|
9624
|
+
day: "numeric",
|
|
9625
|
+
timeZone: zone
|
|
9626
|
+
})} \xB7 ${formatTime(selected.startsAt, zone, twelve)} \u2013 ${selectedEnd && formatTime(selectedEnd, zone, twelve)}` : null;
|
|
9627
|
+
const footer = /* @__PURE__ */ jsxs6(
|
|
9564
9628
|
"div",
|
|
9565
9629
|
{
|
|
9566
9630
|
style: {
|
|
9567
|
-
|
|
9568
|
-
|
|
9631
|
+
borderTop: `1px solid ${t.border}`,
|
|
9632
|
+
padding: wide ? "14px 28px" : "14px 16px",
|
|
9569
9633
|
display: "flex",
|
|
9634
|
+
flexWrap: "wrap",
|
|
9570
9635
|
alignItems: "center",
|
|
9571
|
-
justifyContent: "
|
|
9572
|
-
|
|
9573
|
-
|
|
9636
|
+
justifyContent: "space-between",
|
|
9637
|
+
gap: "10px 16px",
|
|
9638
|
+
background: t.bg,
|
|
9639
|
+
// Stacked, the dialog scrolls as one page; the button stays in reach.
|
|
9640
|
+
position: wide ? void 0 : "sticky",
|
|
9641
|
+
// Past the overlay's 12px padding, so nothing shows under the bar.
|
|
9642
|
+
bottom: wide ? void 0 : -12
|
|
9574
9643
|
},
|
|
9575
|
-
children:
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
style: {
|
|
9582
|
-
flex: "1 1 auto",
|
|
9583
|
-
minWidth: 0,
|
|
9584
|
-
padding: wide ? "28px 32px" : "20px",
|
|
9585
|
-
boxSizing: "border-box",
|
|
9586
|
-
overflowY: wide ? "auto" : void 0
|
|
9587
|
-
},
|
|
9588
|
-
children: /* @__PURE__ */ jsxs6("div", { style: { maxWidth: 520, display: "flex", flexDirection: "column", gap: 22 }, children: [
|
|
9589
|
-
/* @__PURE__ */ jsxs6("div", { children: [
|
|
9590
|
-
/* @__PURE__ */ jsx6("div", { style: { fontSize: 16, fontWeight: 600 }, children: questions.length === 1 ? "One question first" : "A few questions first" }),
|
|
9591
|
-
/* @__PURE__ */ jsx6("div", { style: { fontSize: 13, lineHeight: 1.5, marginTop: 4, ...muted }, children: "So the right person takes your demo." })
|
|
9592
|
-
] }),
|
|
9593
|
-
questions.map((q) => /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": q.label, children: [
|
|
9594
|
-
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 14, fontWeight: 500, overflowWrap: "anywhere" }, children: [
|
|
9595
|
-
q.label,
|
|
9596
|
-
!q.required && /* @__PURE__ */ jsx6("span", { style: { fontWeight: 400, ...muted }, children: " (optional)" })
|
|
9644
|
+
children: [
|
|
9645
|
+
/* @__PURE__ */ jsx6("div", { style: { flex: "1 1 240px", minWidth: 0, fontSize: 13, lineHeight: 1.5 }, children: error ? /* @__PURE__ */ jsx6("div", { role: "alert", style: { color: t.danger }, children: error }) : previewEnded ? /* @__PURE__ */ jsx6("div", { style: muted, children: "End of the preview \u2014 a prospect would be booked here. Nothing was booked and no code was sent." }) : /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9646
|
+
pickedLabel ? /* @__PURE__ */ jsx6("div", { style: { fontWeight: 600 }, children: pickedLabel }) : !tried && /* @__PURE__ */ jsxs6("div", { style: muted, children: [
|
|
9647
|
+
"Pick a day and a time ",
|
|
9648
|
+
split ? "on the right" : "below",
|
|
9649
|
+
"."
|
|
9597
9650
|
] }),
|
|
9598
|
-
/* @__PURE__ */
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
padding: "9px 14px",
|
|
9616
|
-
minHeight: 40,
|
|
9617
|
-
borderRadius: 8,
|
|
9618
|
-
border: `1px solid ${on ? t.ink : t.border}`,
|
|
9619
|
-
background: on ? t.ink : t.pane,
|
|
9620
|
-
color: on ? t.onInk : t.text,
|
|
9621
|
-
fontFamily: "inherit",
|
|
9622
|
-
fontSize: 14,
|
|
9623
|
-
fontWeight: 500,
|
|
9624
|
-
cursor: "pointer",
|
|
9625
|
-
overflowWrap: "anywhere",
|
|
9626
|
-
textAlign: "left"
|
|
9627
|
-
},
|
|
9628
|
-
children: option
|
|
9629
|
-
},
|
|
9630
|
-
option
|
|
9631
|
-
);
|
|
9632
|
-
}) })
|
|
9633
|
-
] }, q.id)),
|
|
9634
|
-
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "8px 12px", marginTop: 2 }, children: [
|
|
9635
|
-
/* @__PURE__ */ jsx6(
|
|
9636
|
-
"button",
|
|
9637
|
-
{
|
|
9638
|
-
type: "button",
|
|
9639
|
-
onClick: () => setAsked(true),
|
|
9640
|
-
disabled: !canContinue,
|
|
9641
|
-
style: { ...primaryStyle(t, !canContinue), whiteSpace: "nowrap" },
|
|
9642
|
-
children: "See available times"
|
|
9643
|
-
}
|
|
9644
|
-
),
|
|
9645
|
-
!canContinue && /* @__PURE__ */ jsx6("span", { style: { fontSize: 12, ...muted }, children: "Pick one for each to continue" })
|
|
9646
|
-
] })
|
|
9647
|
-
] })
|
|
9651
|
+
tried && missing.length > 0 && /* @__PURE__ */ jsxs6("div", { role: "alert", style: { color: t.danger }, children: [
|
|
9652
|
+
"Still needed: ",
|
|
9653
|
+
missing.join(", ")
|
|
9654
|
+
] })
|
|
9655
|
+
] }) }),
|
|
9656
|
+
/* @__PURE__ */ jsx6(
|
|
9657
|
+
"button",
|
|
9658
|
+
{
|
|
9659
|
+
type: "button",
|
|
9660
|
+
onClick: startBooking,
|
|
9661
|
+
disabled: busy,
|
|
9662
|
+
"aria-disabled": missing.length > 0,
|
|
9663
|
+
style: { ...primaryStyle(t, busy || missing.length > 0), cursor: busy ? "default" : "pointer", whiteSpace: "nowrap" },
|
|
9664
|
+
children: requireOtp ? busy ? "Sending code\u2026" : "Send verification code" : busy ? "Booking\u2026" : "Book demo"
|
|
9665
|
+
}
|
|
9666
|
+
)
|
|
9667
|
+
]
|
|
9648
9668
|
}
|
|
9649
9669
|
);
|
|
9650
9670
|
const form = /* @__PURE__ */ jsx6(
|
|
@@ -9659,54 +9679,15 @@ function BookingDialog({
|
|
|
9659
9679
|
},
|
|
9660
9680
|
children: /* @__PURE__ */ jsxs6("div", { style: { maxWidth: 440, display: "flex", flexDirection: "column", gap: 14 }, children: [
|
|
9661
9681
|
error && /* @__PURE__ */ jsx6("div", { style: { color: t.danger, fontSize: 13, lineHeight: 1.5 }, children: error }),
|
|
9662
|
-
previewEnded && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, lineHeight: 1.5, ...muted }, children: "End of the preview \u2014 a prospect would be booked here. Nothing was booked and no code was sent." }),
|
|
9663
|
-
step === "details" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9664
|
-
/* @__PURE__ */ jsx6(Field, { t, label: "Your name", value: name, onChange: setName, autoComplete: "name" }),
|
|
9665
|
-
/* @__PURE__ */ jsx6(Field, { t, label: "Email", value: email, onChange: setEmail, type: "email", autoComplete: "email" }),
|
|
9666
|
-
/* @__PURE__ */ jsx6(
|
|
9667
|
-
PhoneField,
|
|
9668
|
-
{
|
|
9669
|
-
t,
|
|
9670
|
-
dial,
|
|
9671
|
-
national: phone,
|
|
9672
|
-
onChange: (nextDial, national) => {
|
|
9673
|
-
setDial(nextDial);
|
|
9674
|
-
setPhone(national);
|
|
9675
|
-
},
|
|
9676
|
-
onBlur: () => setPhoneTouched(true),
|
|
9677
|
-
error: phoneTouched ? phoneError : null,
|
|
9678
|
-
hint: requireOtp ? "We send a code here to confirm, then a reminder before the call." : "We send a reminder here before the call."
|
|
9679
|
-
}
|
|
9680
|
-
),
|
|
9681
|
-
/* @__PURE__ */ jsx6(Field, { t, label: "Anything we should know? (optional)", value: note, onChange: setNote, multiline: true }),
|
|
9682
|
-
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 4 }, children: [
|
|
9683
|
-
/* @__PURE__ */ jsx6(
|
|
9684
|
-
"button",
|
|
9685
|
-
{
|
|
9686
|
-
type: "button",
|
|
9687
|
-
className: "gg-bk-ghost",
|
|
9688
|
-
onClick: () => {
|
|
9689
|
-
setError(null);
|
|
9690
|
-
setStep("slots");
|
|
9691
|
-
},
|
|
9692
|
-
style: secondaryStyle(t),
|
|
9693
|
-
children: "Back"
|
|
9694
|
-
}
|
|
9695
|
-
),
|
|
9696
|
-
/* @__PURE__ */ jsx6(
|
|
9697
|
-
"button",
|
|
9698
|
-
{
|
|
9699
|
-
type: "button",
|
|
9700
|
-
onClick: startBooking,
|
|
9701
|
-
disabled: !canSubmitDetails || busy,
|
|
9702
|
-
style: primaryStyle(t, !canSubmitDetails || busy),
|
|
9703
|
-
children: requireOtp ? busy ? "Sending code\u2026" : "Send verification code" : busy ? "Booking\u2026" : "Book demo"
|
|
9704
|
-
}
|
|
9705
|
-
)
|
|
9706
|
-
] })
|
|
9707
|
-
] }),
|
|
9708
9682
|
step === "code" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9709
|
-
/* @__PURE__ */ jsx6("div", { style: { fontSize:
|
|
9683
|
+
/* @__PURE__ */ jsx6("div", { style: { fontSize: 16, fontWeight: 600 }, children: "Verify your mobile" }),
|
|
9684
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 14, lineHeight: 1.5, ...muted }, children: [
|
|
9685
|
+
"We texted a code to +",
|
|
9686
|
+
dial,
|
|
9687
|
+
" ",
|
|
9688
|
+
phone,
|
|
9689
|
+
". Your slot is held for 10 minutes."
|
|
9690
|
+
] }),
|
|
9710
9691
|
/* @__PURE__ */ jsx6(Field, { t, label: "Code", value: code, onChange: setCode, autoComplete: "one-time-code", inputMode: "numeric" }),
|
|
9711
9692
|
/* @__PURE__ */ jsx6("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 4 }, children: /* @__PURE__ */ jsx6(
|
|
9712
9693
|
"button",
|
|
@@ -9721,6 +9702,11 @@ function BookingDialog({
|
|
|
9721
9702
|
] }),
|
|
9722
9703
|
step === "done" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9723
9704
|
/* @__PURE__ */ jsx6("div", { style: { fontSize: 20, fontWeight: 600 }, children: "You're booked." }),
|
|
9705
|
+
pickedLabel && /* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: 8, fontSize: 14 }, children: [
|
|
9706
|
+
/* @__PURE__ */ jsx6(Row, { icon: "calendar", t, children: pickedLabel }),
|
|
9707
|
+
/* @__PURE__ */ jsx6(Row, { icon: "globe", t, children: zone }),
|
|
9708
|
+
/* @__PURE__ */ jsx6(Row, { icon: "video", t, children: "Google Meet" })
|
|
9709
|
+
] }),
|
|
9724
9710
|
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 14, lineHeight: 1.6, ...muted }, children: [
|
|
9725
9711
|
"A calendar invite is on its way to ",
|
|
9726
9712
|
email,
|
|
@@ -9764,7 +9750,6 @@ function BookingDialog({
|
|
|
9764
9750
|
.gg-bk-day:hover { box-shadow: inset 0 0 0 1.5px ${t.ink}; }
|
|
9765
9751
|
.gg-bk-slot:hover { border-color: ${t.ink} !important; }
|
|
9766
9752
|
.gg-bk-ghost:hover { background: ${t.open} !important; }
|
|
9767
|
-
.gg-bk-link:hover { color: ${t.text} !important; }
|
|
9768
9753
|
.gg-bk-root button:focus-visible, .gg-bk-root a:focus-visible,
|
|
9769
9754
|
.gg-bk-root span:has(> select:focus-visible), .gg-bk-root input:focus-visible, .gg-bk-root textarea:focus-visible {
|
|
9770
9755
|
outline: 2px solid ${t.ink}; outline-offset: 2px;
|
|
@@ -9778,10 +9763,11 @@ function BookingDialog({
|
|
|
9778
9763
|
"aria-label": page.title,
|
|
9779
9764
|
className: "gg-bk-root",
|
|
9780
9765
|
style: {
|
|
9781
|
-
width: roomy ? "min(
|
|
9782
|
-
//
|
|
9783
|
-
//
|
|
9784
|
-
|
|
9766
|
+
width: roomy ? "min(1180px, 100%)" : "min(820px, 100%)",
|
|
9767
|
+
// The one screen holds a month grid and a form side by side; a fixed
|
|
9768
|
+
// height keeps it from jumping between months, and each column
|
|
9769
|
+
// scrolls inside it. The code and done steps are short.
|
|
9770
|
+
height: wide && roomy ? "min(720px, calc(100vh - 48px))" : void 0,
|
|
9785
9771
|
minHeight: wide && !roomy ? 420 : void 0,
|
|
9786
9772
|
margin: wide ? void 0 : "auto 0",
|
|
9787
9773
|
display: "flex",
|
|
@@ -9791,16 +9777,48 @@ function BookingDialog({
|
|
|
9791
9777
|
border: `1px solid ${t.border}`,
|
|
9792
9778
|
borderRadius: 14,
|
|
9793
9779
|
boxShadow: "0 24px 64px rgba(0,0,0,.35)",
|
|
9794
|
-
|
|
9780
|
+
// Stacked, the footer sticks to the bottom of the scrolling overlay,
|
|
9781
|
+
// which `overflow: hidden` here would cut off.
|
|
9782
|
+
overflow: wide ? "hidden" : "clip",
|
|
9795
9783
|
boxSizing: "border-box",
|
|
9796
9784
|
textAlign: "left",
|
|
9797
9785
|
lineHeight: 1.4
|
|
9798
9786
|
},
|
|
9799
9787
|
children: [
|
|
9800
9788
|
summary,
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9789
|
+
roomy ? /* @__PURE__ */ jsxs6("div", { style: { flex: "1 1 auto", minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
9790
|
+
/* @__PURE__ */ jsxs6(
|
|
9791
|
+
"div",
|
|
9792
|
+
{
|
|
9793
|
+
style: {
|
|
9794
|
+
flex: "1 1 auto",
|
|
9795
|
+
minHeight: 0,
|
|
9796
|
+
display: "flex",
|
|
9797
|
+
flexDirection: split ? "row" : "column",
|
|
9798
|
+
// A tablet-wide dialog stacks the two and scrolls them as one.
|
|
9799
|
+
overflowY: wide && !split ? "auto" : void 0
|
|
9800
|
+
},
|
|
9801
|
+
children: [
|
|
9802
|
+
details,
|
|
9803
|
+
/* @__PURE__ */ jsxs6(
|
|
9804
|
+
"div",
|
|
9805
|
+
{
|
|
9806
|
+
style: {
|
|
9807
|
+
flex: split ? "0 0 420px" : void 0,
|
|
9808
|
+
borderLeft: split ? `1px solid ${t.border}` : void 0,
|
|
9809
|
+
borderTop: split ? void 0 : `1px solid ${t.border}`,
|
|
9810
|
+
overflowY: split ? "auto" : void 0
|
|
9811
|
+
},
|
|
9812
|
+
children: [
|
|
9813
|
+
calendar,
|
|
9814
|
+
times
|
|
9815
|
+
]
|
|
9816
|
+
}
|
|
9817
|
+
)
|
|
9818
|
+
]
|
|
9819
|
+
}
|
|
9820
|
+
),
|
|
9821
|
+
footer
|
|
9804
9822
|
] }) : form,
|
|
9805
9823
|
!wide && credit
|
|
9806
9824
|
]
|
|
@@ -9824,19 +9842,6 @@ function primaryStyle(t, disabled) {
|
|
|
9824
9842
|
cursor: disabled ? "default" : "pointer"
|
|
9825
9843
|
};
|
|
9826
9844
|
}
|
|
9827
|
-
function secondaryStyle(t) {
|
|
9828
|
-
return {
|
|
9829
|
-
padding: "10px 16px",
|
|
9830
|
-
borderRadius: 8,
|
|
9831
|
-
border: 0,
|
|
9832
|
-
background: "transparent",
|
|
9833
|
-
color: t.text,
|
|
9834
|
-
fontFamily: "inherit",
|
|
9835
|
-
fontSize: 14,
|
|
9836
|
-
fontWeight: 500,
|
|
9837
|
-
cursor: "pointer"
|
|
9838
|
-
};
|
|
9839
|
-
}
|
|
9840
9845
|
function Row({ icon, t, children }) {
|
|
9841
9846
|
return /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "flex-start", gap: 10, color: t.text, minWidth: 0 }, children: [
|
|
9842
9847
|
/* @__PURE__ */ jsx6("span", { style: { color: t.muted, flex: "0 0 auto", marginTop: 1 }, children: /* @__PURE__ */ jsx6(Icon, { name: icon }) }),
|
|
@@ -9926,40 +9931,38 @@ function Field({
|
|
|
9926
9931
|
value,
|
|
9927
9932
|
onChange,
|
|
9928
9933
|
type = "text",
|
|
9929
|
-
hint,
|
|
9930
9934
|
autoComplete,
|
|
9931
9935
|
inputMode,
|
|
9932
|
-
|
|
9936
|
+
error
|
|
9933
9937
|
}) {
|
|
9934
|
-
const inputStyle = {
|
|
9935
|
-
display: "block",
|
|
9936
|
-
width: "100%",
|
|
9937
|
-
boxSizing: "border-box",
|
|
9938
|
-
marginTop: 6,
|
|
9939
|
-
padding: "9px 12px",
|
|
9940
|
-
background: t.input,
|
|
9941
|
-
color: t.text,
|
|
9942
|
-
border: `1px solid ${t.border}`,
|
|
9943
|
-
borderRadius: 8,
|
|
9944
|
-
fontFamily: "inherit",
|
|
9945
|
-
fontSize: 14,
|
|
9946
|
-
outline: "none",
|
|
9947
|
-
resize: "vertical"
|
|
9948
|
-
};
|
|
9949
9938
|
return /* @__PURE__ */ jsxs6("label", { style: { display: "block", fontSize: 13, fontWeight: 500, color: t.text }, children: [
|
|
9950
9939
|
label,
|
|
9951
|
-
|
|
9940
|
+
/* @__PURE__ */ jsx6(
|
|
9952
9941
|
"input",
|
|
9953
9942
|
{
|
|
9954
9943
|
type,
|
|
9955
9944
|
value,
|
|
9956
9945
|
autoComplete,
|
|
9957
9946
|
inputMode,
|
|
9947
|
+
"aria-invalid": Boolean(error),
|
|
9958
9948
|
onChange: (e) => onChange(e.target.value),
|
|
9959
|
-
style:
|
|
9949
|
+
style: {
|
|
9950
|
+
display: "block",
|
|
9951
|
+
width: "100%",
|
|
9952
|
+
boxSizing: "border-box",
|
|
9953
|
+
marginTop: 6,
|
|
9954
|
+
padding: "9px 12px",
|
|
9955
|
+
background: t.input,
|
|
9956
|
+
color: t.text,
|
|
9957
|
+
border: `1px solid ${error ? t.danger : t.border}`,
|
|
9958
|
+
borderRadius: 8,
|
|
9959
|
+
fontFamily: "inherit",
|
|
9960
|
+
fontSize: 14,
|
|
9961
|
+
outline: "none"
|
|
9962
|
+
}
|
|
9960
9963
|
}
|
|
9961
9964
|
),
|
|
9962
|
-
|
|
9965
|
+
error && /* @__PURE__ */ jsx6("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: error })
|
|
9963
9966
|
] });
|
|
9964
9967
|
}
|
|
9965
9968
|
function PhoneField({
|