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.js
CHANGED
|
@@ -4085,7 +4085,9 @@ function AssistSheet({
|
|
|
4085
4085
|
backgroundColor: t.bg,
|
|
4086
4086
|
// The "already filed?" card can be taller than the sheet; scroll
|
|
4087
4087
|
// it instead of clipping its buttons off the bottom (#590).
|
|
4088
|
-
|
|
4088
|
+
// The bottom sheet has only a max-height, so a % here resolves
|
|
4089
|
+
// to auto and never scrolls (#596): use the viewport there.
|
|
4090
|
+
...similarSlot ? { maxHeight: narrow ? "55dvh" : "70%", overflowY: "auto" } : {}
|
|
4089
4091
|
},
|
|
4090
4092
|
children: [
|
|
4091
4093
|
phase === "solved" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -8806,6 +8808,7 @@ var WEEKDAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
|
8806
8808
|
var DAY_MS = 864e5;
|
|
8807
8809
|
var ZONE_PAD_MS = 14 * 36e5;
|
|
8808
8810
|
var WIDE_QUERY = "(min-width: 900px)";
|
|
8811
|
+
var SPLIT_QUERY = "(min-width: 1120px)";
|
|
8809
8812
|
function localZone() {
|
|
8810
8813
|
try {
|
|
8811
8814
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -8912,13 +8915,14 @@ function BookingDialog({
|
|
|
8912
8915
|
}) {
|
|
8913
8916
|
var _a, _b, _c, _d, _e;
|
|
8914
8917
|
const wide = useMediaQuery(WIDE_QUERY, true);
|
|
8918
|
+
const split = useMediaQuery(SPLIT_QUERY, true) && wide;
|
|
8915
8919
|
const t = (0, import_react5.useMemo)(() => {
|
|
8916
8920
|
if (!open) return LIGHT;
|
|
8917
8921
|
const base = detectDark() ? DARK : LIGHT;
|
|
8918
8922
|
const accent = detectHostAccent();
|
|
8919
8923
|
return accent ? { ...base, ink: accent.accent, onInk: accent.accentText } : base;
|
|
8920
8924
|
}, [open]);
|
|
8921
|
-
const [step, setStep] = (0, import_react5.useState)("
|
|
8925
|
+
const [step, setStep] = (0, import_react5.useState)("pick");
|
|
8922
8926
|
const [zone, setZone] = (0, import_react5.useState)(localZone);
|
|
8923
8927
|
const [twelve, setTwelve] = (0, import_react5.useState)(prefers12h);
|
|
8924
8928
|
const [month, setMonth] = (0, import_react5.useState)(() => dayKeyIn(Date.now(), localZone()).slice(0, 7));
|
|
@@ -8933,11 +8937,10 @@ function BookingDialog({
|
|
|
8933
8937
|
const [phone, setPhone] = (0, import_react5.useState)("");
|
|
8934
8938
|
const [dial, setDial] = (0, import_react5.useState)(() => defaultDialForZone(localZone()));
|
|
8935
8939
|
const [phoneTouched, setPhoneTouched] = (0, import_react5.useState)(false);
|
|
8936
|
-
const [
|
|
8940
|
+
const [tried, setTried] = (0, import_react5.useState)(false);
|
|
8937
8941
|
const [questions, setQuestions] = (0, import_react5.useState)([]);
|
|
8938
8942
|
const [answers, setAnswers] = (0, import_react5.useState)({});
|
|
8939
8943
|
const [pageLoaded, setPageLoaded] = (0, import_react5.useState)(false);
|
|
8940
|
-
const [asked, setAsked] = (0, import_react5.useState)(false);
|
|
8941
8944
|
const [requireOtp, setRequireOtp] = (0, import_react5.useState)(true);
|
|
8942
8945
|
const [code, setCode] = (0, import_react5.useState)("");
|
|
8943
8946
|
const [bookingId, setBookingId] = (0, import_react5.useState)(null);
|
|
@@ -8997,7 +9000,7 @@ function BookingDialog({
|
|
|
8997
9000
|
(0, import_react5.useEffect)(() => {
|
|
8998
9001
|
if (!open) return;
|
|
8999
9002
|
const now = localZone();
|
|
9000
|
-
setStep("
|
|
9003
|
+
setStep("pick");
|
|
9001
9004
|
setZone(now);
|
|
9002
9005
|
setMonth(dayKeyIn(Date.now(), now).slice(0, 7));
|
|
9003
9006
|
setSlotsByMonth({});
|
|
@@ -9009,7 +9012,7 @@ function BookingDialog({
|
|
|
9009
9012
|
setPreviewEnded(false);
|
|
9010
9013
|
setAvatarFailed(false);
|
|
9011
9014
|
setPageLoaded(false);
|
|
9012
|
-
|
|
9015
|
+
setTried(false);
|
|
9013
9016
|
}, [open]);
|
|
9014
9017
|
const monthLoaded = month in slotsByMonth;
|
|
9015
9018
|
(0, import_react5.useEffect)(() => {
|
|
@@ -9039,13 +9042,22 @@ function BookingDialog({
|
|
|
9039
9042
|
const atFirstMonth = month <= today.slice(0, 7);
|
|
9040
9043
|
const pastHorizon = monthLoaded && !error && byDay.size === 0 && !atFirstMonth;
|
|
9041
9044
|
const given = questions.flatMap((q) => q.options.includes(answers[q.id]) ? [{ ...q, answer: answers[q.id] }] : []);
|
|
9042
|
-
const
|
|
9043
|
-
const
|
|
9044
|
-
const
|
|
9045
|
+
const unanswered = questions.filter((q) => q.required && !q.options.includes(answers[q.id]));
|
|
9046
|
+
const phoneError = phoneProblem(dial, phone);
|
|
9047
|
+
const nameMissing = !name.trim();
|
|
9048
|
+
const emailMissing = !email.includes("@");
|
|
9049
|
+
const missing = [
|
|
9050
|
+
...nameMissing ? ["your name"] : [],
|
|
9051
|
+
...phoneError ? ["a valid mobile number"] : [],
|
|
9052
|
+
...emailMissing ? ["your email"] : [],
|
|
9053
|
+
...unanswered.map((q) => `an answer to \u201C${q.label}\u201D`),
|
|
9054
|
+
...selected ? [] : ["a day and time"]
|
|
9055
|
+
];
|
|
9056
|
+
const roomy = step === "pick";
|
|
9045
9057
|
async function startBooking() {
|
|
9046
9058
|
var _a2, _b2, _c2;
|
|
9047
|
-
if (!selected)
|
|
9048
|
-
|
|
9059
|
+
if (missing.length > 0 || !selected) {
|
|
9060
|
+
setTried(true);
|
|
9049
9061
|
setPhoneTouched(true);
|
|
9050
9062
|
return;
|
|
9051
9063
|
}
|
|
@@ -9063,7 +9075,6 @@ function BookingDialog({
|
|
|
9063
9075
|
name,
|
|
9064
9076
|
email,
|
|
9065
9077
|
phone: toE164(dial, phone),
|
|
9066
|
-
note,
|
|
9067
9078
|
answers: Object.fromEntries(given.map((q) => [q.id, q.answer])),
|
|
9068
9079
|
startsAt: selected.startsAt,
|
|
9069
9080
|
// The zone the times were shown in, which is the one the visitor chose.
|
|
@@ -9125,8 +9136,6 @@ function BookingDialog({
|
|
|
9125
9136
|
setBusy(false);
|
|
9126
9137
|
}
|
|
9127
9138
|
}
|
|
9128
|
-
const phoneError = phoneProblem(dial, phone);
|
|
9129
|
-
const canSubmitDetails = Boolean(name.trim() && email.includes("@"));
|
|
9130
9139
|
const selectedEnd = selected ? (_e = selected.endsAt) != null ? _e : new Date(new Date(selected.startsAt).getTime() + page.slotMinutes * 6e4).toISOString() : null;
|
|
9131
9140
|
const monthDate = new Date(keyToUtc(`${month}-01`));
|
|
9132
9141
|
const muted = { color: t.muted };
|
|
@@ -9284,7 +9293,7 @@ function BookingDialog({
|
|
|
9284
9293
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 20, fontWeight: 600, lineHeight: 1.25, paddingRight: 32, overflowWrap: "anywhere" }, children: page.title }),
|
|
9285
9294
|
page.description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 13, lineHeight: 1.5, overflowWrap: "anywhere", ...muted }, children: page.description }),
|
|
9286
9295
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 4, fontSize: 14 }, children: [
|
|
9287
|
-
selected && step !== "
|
|
9296
|
+
selected && step !== "pick" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "calendar", t, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
9288
9297
|
new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9289
9298
|
weekday: "long",
|
|
9290
9299
|
month: "long",
|
|
@@ -9299,33 +9308,7 @@ function BookingDialog({
|
|
|
9299
9308
|
selectedEnd && formatTime(selectedEnd, zone, twelve)
|
|
9300
9309
|
] })
|
|
9301
9310
|
] }) }),
|
|
9302
|
-
|
|
9303
|
-
given.map((q) => q.answer).join(" \xB7 "),
|
|
9304
|
-
view === "slots" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9305
|
-
" ",
|
|
9306
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9307
|
-
"button",
|
|
9308
|
-
{
|
|
9309
|
-
type: "button",
|
|
9310
|
-
onClick: () => setAsked(false),
|
|
9311
|
-
className: "gg-bk-link",
|
|
9312
|
-
style: {
|
|
9313
|
-
border: 0,
|
|
9314
|
-
// Room for a thumb without pushing the rows apart.
|
|
9315
|
-
padding: "8px 6px",
|
|
9316
|
-
margin: "-8px 0",
|
|
9317
|
-
background: "transparent",
|
|
9318
|
-
color: t.muted,
|
|
9319
|
-
fontFamily: "inherit",
|
|
9320
|
-
fontSize: 13,
|
|
9321
|
-
textDecoration: "underline",
|
|
9322
|
-
cursor: "pointer"
|
|
9323
|
-
},
|
|
9324
|
-
children: "Change"
|
|
9325
|
-
}
|
|
9326
|
-
)
|
|
9327
|
-
] })
|
|
9328
|
-
] }) }),
|
|
9311
|
+
step !== "pick" && given.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "check", t, children: given.map((q) => q.answer).join(" \xB7 ") }),
|
|
9329
9312
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "clock", t, children: formatDuration(page.slotMinutes) }),
|
|
9330
9313
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "video", t, children: "Google Meet" }),
|
|
9331
9314
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "globe", t, children: roomy ? (
|
|
@@ -9382,328 +9365,365 @@ function BookingDialog({
|
|
|
9382
9365
|
]
|
|
9383
9366
|
}
|
|
9384
9367
|
);
|
|
9385
|
-
const calendar = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9386
|
-
"div",
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9368
|
+
const calendar = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { padding: wide ? "22px 20px 12px" : "16px 16px 8px", boxSizing: "border-box" }, children: [
|
|
9369
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 14 }, children: [
|
|
9370
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: 16, fontWeight: 600 }, children: [
|
|
9371
|
+
monthDate.toLocaleDateString("en-US", { month: "long", timeZone: "UTC" }),
|
|
9372
|
+
" ",
|
|
9373
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, ...muted }, children: monthDate.getUTCFullYear() })
|
|
9374
|
+
] }),
|
|
9375
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", gap: 4 }, children: [
|
|
9376
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9377
|
+
NavButton,
|
|
9378
|
+
{
|
|
9379
|
+
t,
|
|
9380
|
+
label: "Previous month",
|
|
9381
|
+
icon: "left",
|
|
9382
|
+
disabled: atFirstMonth,
|
|
9383
|
+
onClick: () => setMonth(shiftMonth(month, -1))
|
|
9384
|
+
}
|
|
9385
|
+
),
|
|
9386
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9387
|
+
NavButton,
|
|
9388
|
+
{
|
|
9389
|
+
t,
|
|
9390
|
+
label: "Next month",
|
|
9391
|
+
icon: "right",
|
|
9392
|
+
disabled: pastHorizon,
|
|
9393
|
+
onClick: () => setMonth(shiftMonth(month, 1))
|
|
9394
|
+
}
|
|
9395
|
+
)
|
|
9396
|
+
] })
|
|
9397
|
+
] }),
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))", gap: 4 }, children: [
|
|
9399
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9400
|
+
"div",
|
|
9401
|
+
{
|
|
9402
|
+
style: {
|
|
9403
|
+
textAlign: "center",
|
|
9404
|
+
fontSize: 11,
|
|
9405
|
+
fontWeight: 500,
|
|
9406
|
+
letterSpacing: ".08em",
|
|
9407
|
+
textTransform: "uppercase",
|
|
9408
|
+
padding: "6px 0 8px",
|
|
9409
|
+
color: t.text
|
|
9410
|
+
},
|
|
9411
|
+
children: w
|
|
9412
|
+
},
|
|
9413
|
+
w
|
|
9414
|
+
)),
|
|
9415
|
+
grid.map((key) => {
|
|
9416
|
+
const inMonth = key.startsWith(month);
|
|
9417
|
+
const bookable = byDay.has(key);
|
|
9418
|
+
const isSelected = key === day;
|
|
9419
|
+
const dayNum = Number(key.slice(8));
|
|
9420
|
+
if (!inMonth && !bookable) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "aria-hidden": true }, key);
|
|
9421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9422
|
+
"button",
|
|
9423
|
+
{
|
|
9424
|
+
type: "button",
|
|
9425
|
+
disabled: !bookable,
|
|
9426
|
+
onClick: () => setPickedDay(key),
|
|
9427
|
+
"aria-pressed": isSelected,
|
|
9428
|
+
"aria-label": new Date(keyToUtc(key)).toLocaleDateString("en-US", {
|
|
9429
|
+
weekday: "long",
|
|
9430
|
+
month: "long",
|
|
9431
|
+
day: "numeric",
|
|
9432
|
+
timeZone: "UTC"
|
|
9433
|
+
}),
|
|
9434
|
+
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9435
|
+
style: {
|
|
9436
|
+
position: "relative",
|
|
9437
|
+
// Shorter than square: the times sit under the month now, and
|
|
9438
|
+
// both should fit without scrolling on a laptop.
|
|
9439
|
+
aspectRatio: wide ? "5 / 4" : "1 / 1",
|
|
9440
|
+
minHeight: 36,
|
|
9441
|
+
border: 0,
|
|
9442
|
+
borderRadius: 8,
|
|
9443
|
+
padding: 0,
|
|
9444
|
+
fontFamily: "inherit",
|
|
9445
|
+
fontSize: wide ? 15 : 14,
|
|
9446
|
+
fontWeight: bookable ? 600 : 400,
|
|
9447
|
+
cursor: bookable ? "pointer" : "default",
|
|
9448
|
+
background: isSelected ? t.ink : bookable ? t.open : "transparent",
|
|
9449
|
+
color: isSelected ? t.onInk : bookable ? t.text : t.faint,
|
|
9450
|
+
opacity: monthLoaded ? 1 : 0.5
|
|
9451
|
+
},
|
|
9452
|
+
children: [
|
|
9453
|
+
!inMonth && dayNum === 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9454
|
+
"span",
|
|
9455
|
+
{
|
|
9456
|
+
style: {
|
|
9457
|
+
position: "absolute",
|
|
9458
|
+
top: 4,
|
|
9459
|
+
left: 0,
|
|
9460
|
+
right: 0,
|
|
9461
|
+
fontSize: 9,
|
|
9462
|
+
fontWeight: 500,
|
|
9463
|
+
letterSpacing: ".06em",
|
|
9464
|
+
textTransform: "uppercase"
|
|
9465
|
+
},
|
|
9466
|
+
children: new Date(keyToUtc(key)).toLocaleDateString("en-US", { month: "short", timeZone: "UTC" })
|
|
9467
|
+
}
|
|
9468
|
+
),
|
|
9469
|
+
dayNum,
|
|
9470
|
+
key === today && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9471
|
+
"span",
|
|
9472
|
+
{
|
|
9473
|
+
"aria-hidden": true,
|
|
9474
|
+
style: {
|
|
9475
|
+
position: "absolute",
|
|
9476
|
+
bottom: 6,
|
|
9477
|
+
left: "50%",
|
|
9478
|
+
width: 4,
|
|
9479
|
+
height: 4,
|
|
9480
|
+
marginLeft: -2,
|
|
9481
|
+
borderRadius: 999,
|
|
9482
|
+
background: isSelected ? t.onInk : t.text
|
|
9483
|
+
}
|
|
9484
|
+
}
|
|
9485
|
+
)
|
|
9486
|
+
]
|
|
9487
|
+
},
|
|
9488
|
+
key
|
|
9489
|
+
);
|
|
9490
|
+
})
|
|
9491
|
+
] })
|
|
9492
|
+
] });
|
|
9493
|
+
const times = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { borderTop: `1px solid ${t.border}`, padding: wide ? "16px 20px 0" : "16px 16px 0", boxSizing: "border-box" }, children: [
|
|
9494
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 14 }, children: [
|
|
9495
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 16, fontWeight: 600, whiteSpace: "nowrap" }, children: day ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9496
|
+
new Date(keyToUtc(day)).toLocaleDateString("en-US", { weekday: "short", timeZone: "UTC" }),
|
|
9497
|
+
" ",
|
|
9498
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, ...muted }, children: ordinal(Number(day.slice(8))) })
|
|
9499
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, ...muted }, children: "Times" }) }),
|
|
9500
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9501
|
+
"div",
|
|
9502
|
+
{
|
|
9503
|
+
role: "group",
|
|
9504
|
+
"aria-label": "Clock format",
|
|
9505
|
+
style: { display: "flex", padding: 3, borderRadius: 8, background: t.open, flex: "0 0 auto" },
|
|
9506
|
+
children: [true, false].map((h12) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9507
|
+
"button",
|
|
9428
9508
|
{
|
|
9509
|
+
type: "button",
|
|
9510
|
+
"aria-pressed": twelve === h12,
|
|
9511
|
+
onClick: () => setTwelve(h12),
|
|
9429
9512
|
style: {
|
|
9430
|
-
|
|
9431
|
-
|
|
9513
|
+
border: 0,
|
|
9514
|
+
borderRadius: 6,
|
|
9515
|
+
padding: "4px 9px",
|
|
9516
|
+
fontFamily: "inherit",
|
|
9517
|
+
fontSize: 13,
|
|
9432
9518
|
fontWeight: 500,
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9519
|
+
cursor: "pointer",
|
|
9520
|
+
background: twelve === h12 ? t.bg : "transparent",
|
|
9521
|
+
color: twelve === h12 ? t.text : t.muted,
|
|
9522
|
+
boxShadow: twelve === h12 ? "0 1px 2px rgba(0,0,0,.12)" : "none"
|
|
9437
9523
|
},
|
|
9438
|
-
children:
|
|
9524
|
+
children: h12 ? "12h" : "24h"
|
|
9439
9525
|
},
|
|
9440
|
-
|
|
9441
|
-
))
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9526
|
+
String(h12)
|
|
9527
|
+
))
|
|
9528
|
+
}
|
|
9529
|
+
)
|
|
9530
|
+
] }),
|
|
9531
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9532
|
+
"div",
|
|
9533
|
+
{
|
|
9534
|
+
role: "group",
|
|
9535
|
+
"aria-label": "Times",
|
|
9536
|
+
style: {
|
|
9537
|
+
paddingBottom: 20,
|
|
9538
|
+
display: "grid",
|
|
9539
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(84px, 1fr))",
|
|
9540
|
+
gap: 8
|
|
9541
|
+
},
|
|
9542
|
+
children: [
|
|
9543
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { color: t.danger, fontSize: 13, lineHeight: 1.5, gridColumn: "1 / -1" }, children: error }),
|
|
9544
|
+
!monthLoaded && !error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 13, gridColumn: "1 / -1", ...muted }, children: "Finding times\u2026" }),
|
|
9545
|
+
monthLoaded && !error && !day && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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." }),
|
|
9546
|
+
monthLoaded && daySlots.map((slot) => {
|
|
9547
|
+
const on = (selected == null ? void 0 : selected.startsAt) === slot.startsAt;
|
|
9548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9449
9549
|
"button",
|
|
9450
9550
|
{
|
|
9451
9551
|
type: "button",
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
day: "numeric",
|
|
9459
|
-
timeZone: "UTC"
|
|
9460
|
-
}),
|
|
9461
|
-
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9552
|
+
"aria-pressed": on,
|
|
9553
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9554
|
+
onClick: () => {
|
|
9555
|
+
setSelected(slot);
|
|
9556
|
+
setError(null);
|
|
9557
|
+
},
|
|
9462
9558
|
style: {
|
|
9463
|
-
|
|
9464
|
-
aspectRatio: "1 / 1",
|
|
9465
|
-
minHeight: 36,
|
|
9466
|
-
border: 0,
|
|
9559
|
+
padding: "10px 8px",
|
|
9467
9560
|
borderRadius: 8,
|
|
9468
|
-
|
|
9561
|
+
border: `1px solid ${on ? t.ink : t.border}`,
|
|
9562
|
+
background: on ? t.ink : t.pane,
|
|
9563
|
+
color: on ? t.onInk : t.text,
|
|
9469
9564
|
fontFamily: "inherit",
|
|
9470
|
-
fontSize:
|
|
9471
|
-
fontWeight:
|
|
9472
|
-
cursor:
|
|
9473
|
-
|
|
9474
|
-
color: isSelected ? t.onInk : bookable ? t.text : t.faint,
|
|
9475
|
-
opacity: monthLoaded ? 1 : 0.5
|
|
9565
|
+
fontSize: 14,
|
|
9566
|
+
fontWeight: 500,
|
|
9567
|
+
cursor: "pointer",
|
|
9568
|
+
textAlign: "center"
|
|
9476
9569
|
},
|
|
9477
|
-
children:
|
|
9478
|
-
!inMonth && dayNum === 1 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9479
|
-
"span",
|
|
9480
|
-
{
|
|
9481
|
-
style: {
|
|
9482
|
-
position: "absolute",
|
|
9483
|
-
top: 4,
|
|
9484
|
-
left: 0,
|
|
9485
|
-
right: 0,
|
|
9486
|
-
fontSize: 9,
|
|
9487
|
-
fontWeight: 500,
|
|
9488
|
-
letterSpacing: ".06em",
|
|
9489
|
-
textTransform: "uppercase"
|
|
9490
|
-
},
|
|
9491
|
-
children: new Date(keyToUtc(key)).toLocaleDateString("en-US", { month: "short", timeZone: "UTC" })
|
|
9492
|
-
}
|
|
9493
|
-
),
|
|
9494
|
-
dayNum,
|
|
9495
|
-
key === today && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9496
|
-
"span",
|
|
9497
|
-
{
|
|
9498
|
-
"aria-hidden": true,
|
|
9499
|
-
style: {
|
|
9500
|
-
position: "absolute",
|
|
9501
|
-
bottom: 6,
|
|
9502
|
-
left: "50%",
|
|
9503
|
-
width: 4,
|
|
9504
|
-
height: 4,
|
|
9505
|
-
marginLeft: -2,
|
|
9506
|
-
borderRadius: 999,
|
|
9507
|
-
background: isSelected ? t.onInk : t.text
|
|
9508
|
-
}
|
|
9509
|
-
}
|
|
9510
|
-
)
|
|
9511
|
-
]
|
|
9570
|
+
children: formatTime(slot.startsAt, zone, twelve)
|
|
9512
9571
|
},
|
|
9513
|
-
|
|
9572
|
+
slot.startsAt
|
|
9514
9573
|
);
|
|
9515
9574
|
})
|
|
9516
|
-
]
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
);
|
|
9520
|
-
const
|
|
9575
|
+
]
|
|
9576
|
+
}
|
|
9577
|
+
)
|
|
9578
|
+
] });
|
|
9579
|
+
const details = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9521
9580
|
"div",
|
|
9522
9581
|
{
|
|
9523
9582
|
style: {
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
borderTop: wide ? void 0 : `1px solid ${t.border}`,
|
|
9528
|
-
padding: wide ? "24px 20px 0" : "16px 16px 0",
|
|
9583
|
+
flex: "1 1 auto",
|
|
9584
|
+
minWidth: 0,
|
|
9585
|
+
padding: wide ? "24px 28px" : "20px",
|
|
9529
9586
|
boxSizing: "border-box",
|
|
9587
|
+
overflowY: split ? "auto" : void 0,
|
|
9530
9588
|
display: "flex",
|
|
9531
9589
|
flexDirection: "column",
|
|
9532
|
-
|
|
9590
|
+
gap: 16
|
|
9533
9591
|
},
|
|
9534
9592
|
children: [
|
|
9535
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
9536
|
-
|
|
9537
|
-
new Date(keyToUtc(day)).toLocaleDateString("en-US", { weekday: "short", timeZone: "UTC" }),
|
|
9538
|
-
" ",
|
|
9539
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, ...muted }, children: ordinal(Number(day.slice(8))) })
|
|
9540
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 500, ...muted }, children: "Times" }) }),
|
|
9541
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9542
|
-
"div",
|
|
9543
|
-
{
|
|
9544
|
-
role: "group",
|
|
9545
|
-
"aria-label": "Clock format",
|
|
9546
|
-
style: { display: "flex", padding: 3, borderRadius: 8, background: t.open, flex: "0 0 auto" },
|
|
9547
|
-
children: [true, false].map((h12) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9548
|
-
"button",
|
|
9549
|
-
{
|
|
9550
|
-
type: "button",
|
|
9551
|
-
"aria-pressed": twelve === h12,
|
|
9552
|
-
onClick: () => setTwelve(h12),
|
|
9553
|
-
style: {
|
|
9554
|
-
border: 0,
|
|
9555
|
-
borderRadius: 6,
|
|
9556
|
-
padding: "4px 9px",
|
|
9557
|
-
fontFamily: "inherit",
|
|
9558
|
-
fontSize: 13,
|
|
9559
|
-
fontWeight: 500,
|
|
9560
|
-
cursor: "pointer",
|
|
9561
|
-
background: twelve === h12 ? t.bg : "transparent",
|
|
9562
|
-
color: twelve === h12 ? t.text : t.muted,
|
|
9563
|
-
boxShadow: twelve === h12 ? "0 1px 2px rgba(0,0,0,.12)" : "none"
|
|
9564
|
-
},
|
|
9565
|
-
children: h12 ? "12h" : "24h"
|
|
9566
|
-
},
|
|
9567
|
-
String(h12)
|
|
9568
|
-
))
|
|
9569
|
-
}
|
|
9570
|
-
)
|
|
9571
|
-
] }),
|
|
9572
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9573
|
-
"div",
|
|
9593
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9594
|
+
Field,
|
|
9574
9595
|
{
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9596
|
+
t,
|
|
9597
|
+
label: "Full name",
|
|
9598
|
+
value: name,
|
|
9599
|
+
onChange: setName,
|
|
9600
|
+
autoComplete: "name",
|
|
9601
|
+
error: tried && nameMissing ? "Add your name" : null
|
|
9602
|
+
}
|
|
9603
|
+
),
|
|
9604
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9605
|
+
PhoneField,
|
|
9606
|
+
{
|
|
9607
|
+
t,
|
|
9608
|
+
dial,
|
|
9609
|
+
national: phone,
|
|
9610
|
+
onChange: (nextDial, national) => {
|
|
9611
|
+
setDial(nextDial);
|
|
9612
|
+
setPhone(national);
|
|
9584
9613
|
},
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9614
|
+
onBlur: () => setPhoneTouched(true),
|
|
9615
|
+
error: phoneTouched ? phoneError : null,
|
|
9616
|
+
hint: requireOtp ? "We text a code here to confirm, then a reminder before the call." : "We send a reminder here before the call."
|
|
9617
|
+
}
|
|
9618
|
+
),
|
|
9619
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9620
|
+
Field,
|
|
9621
|
+
{
|
|
9622
|
+
t,
|
|
9623
|
+
label: "Email",
|
|
9624
|
+
value: email,
|
|
9625
|
+
onChange: setEmail,
|
|
9626
|
+
type: "email",
|
|
9627
|
+
autoComplete: "email",
|
|
9628
|
+
error: tried && emailMissing ? "Add an email \u2014 the invite goes there" : null
|
|
9629
|
+
}
|
|
9630
|
+
),
|
|
9631
|
+
!pageLoaded && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 13, ...muted }, children: "Loading\u2026" }),
|
|
9632
|
+
questions.map((q) => {
|
|
9633
|
+
const gap = tried && unanswered.includes(q);
|
|
9634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { role: "group", "aria-label": q.label, children: [
|
|
9635
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: 13, fontWeight: 500, overflowWrap: "anywhere" }, children: [
|
|
9636
|
+
q.label,
|
|
9637
|
+
!q.required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 400, ...muted }, children: " (optional)" })
|
|
9638
|
+
] }),
|
|
9639
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: 8, marginTop: 8 }, children: q.options.map((option) => {
|
|
9640
|
+
const on = answers[q.id] === option;
|
|
9641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9590
9642
|
"button",
|
|
9591
9643
|
{
|
|
9592
9644
|
type: "button",
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9645
|
+
"aria-pressed": on,
|
|
9646
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9647
|
+
onClick: () => setAnswers((prev) => {
|
|
9648
|
+
if (on && !q.required) {
|
|
9649
|
+
const rest = { ...prev };
|
|
9650
|
+
delete rest[q.id];
|
|
9651
|
+
return rest;
|
|
9652
|
+
}
|
|
9653
|
+
return { ...prev, [q.id]: option };
|
|
9654
|
+
}),
|
|
9599
9655
|
style: {
|
|
9600
|
-
|
|
9601
|
-
|
|
9656
|
+
padding: "7px 12px",
|
|
9657
|
+
minHeight: 36,
|
|
9602
9658
|
borderRadius: 8,
|
|
9603
|
-
border: `1px solid ${t.border}`,
|
|
9604
|
-
background: t.pane,
|
|
9605
|
-
color: t.text,
|
|
9659
|
+
border: `1px solid ${on ? t.ink : gap ? t.danger : t.border}`,
|
|
9660
|
+
background: on ? t.ink : t.pane,
|
|
9661
|
+
color: on ? t.onInk : t.text,
|
|
9606
9662
|
fontFamily: "inherit",
|
|
9607
9663
|
fontSize: 14,
|
|
9608
9664
|
fontWeight: 500,
|
|
9609
9665
|
cursor: "pointer",
|
|
9610
|
-
|
|
9666
|
+
overflowWrap: "anywhere",
|
|
9667
|
+
textAlign: "left"
|
|
9611
9668
|
},
|
|
9612
|
-
children:
|
|
9669
|
+
children: option
|
|
9613
9670
|
},
|
|
9614
|
-
|
|
9615
|
-
)
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9671
|
+
option
|
|
9672
|
+
);
|
|
9673
|
+
}) }),
|
|
9674
|
+
gap && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: "Pick one" })
|
|
9675
|
+
] }, q.id);
|
|
9676
|
+
})
|
|
9619
9677
|
]
|
|
9620
9678
|
}
|
|
9621
9679
|
);
|
|
9622
|
-
const
|
|
9680
|
+
const pickedLabel = selected ? `${new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9681
|
+
weekday: "short",
|
|
9682
|
+
month: "short",
|
|
9683
|
+
day: "numeric",
|
|
9684
|
+
timeZone: zone
|
|
9685
|
+
})} \xB7 ${formatTime(selected.startsAt, zone, twelve)} \u2013 ${selectedEnd && formatTime(selectedEnd, zone, twelve)}` : null;
|
|
9686
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9623
9687
|
"div",
|
|
9624
9688
|
{
|
|
9625
9689
|
style: {
|
|
9626
|
-
|
|
9627
|
-
|
|
9690
|
+
borderTop: `1px solid ${t.border}`,
|
|
9691
|
+
padding: wide ? "14px 28px" : "14px 16px",
|
|
9628
9692
|
display: "flex",
|
|
9693
|
+
flexWrap: "wrap",
|
|
9629
9694
|
alignItems: "center",
|
|
9630
|
-
justifyContent: "
|
|
9631
|
-
|
|
9632
|
-
|
|
9695
|
+
justifyContent: "space-between",
|
|
9696
|
+
gap: "10px 16px",
|
|
9697
|
+
background: t.bg,
|
|
9698
|
+
// Stacked, the dialog scrolls as one page; the button stays in reach.
|
|
9699
|
+
position: wide ? void 0 : "sticky",
|
|
9700
|
+
// Past the overlay's 12px padding, so nothing shows under the bar.
|
|
9701
|
+
bottom: wide ? void 0 : -12
|
|
9633
9702
|
},
|
|
9634
|
-
children:
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
style: {
|
|
9641
|
-
flex: "1 1 auto",
|
|
9642
|
-
minWidth: 0,
|
|
9643
|
-
padding: wide ? "28px 32px" : "20px",
|
|
9644
|
-
boxSizing: "border-box",
|
|
9645
|
-
overflowY: wide ? "auto" : void 0
|
|
9646
|
-
},
|
|
9647
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { maxWidth: 520, display: "flex", flexDirection: "column", gap: 22 }, children: [
|
|
9648
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
9649
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 16, fontWeight: 600 }, children: questions.length === 1 ? "One question first" : "A few questions first" }),
|
|
9650
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 13, lineHeight: 1.5, marginTop: 4, ...muted }, children: "So the right person takes your demo." })
|
|
9651
|
-
] }),
|
|
9652
|
-
questions.map((q) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { role: "group", "aria-label": q.label, children: [
|
|
9653
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: 14, fontWeight: 500, overflowWrap: "anywhere" }, children: [
|
|
9654
|
-
q.label,
|
|
9655
|
-
!q.required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontWeight: 400, ...muted }, children: " (optional)" })
|
|
9703
|
+
children: [
|
|
9704
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { flex: "1 1 240px", minWidth: 0, fontSize: 13, lineHeight: 1.5 }, children: error ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { role: "alert", style: { color: t.danger }, children: error }) : previewEnded ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: muted, children: "End of the preview \u2014 a prospect would be booked here. Nothing was booked and no code was sent." }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9705
|
+
pickedLabel ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontWeight: 600 }, children: pickedLabel }) : !tried && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: muted, children: [
|
|
9706
|
+
"Pick a day and a time ",
|
|
9707
|
+
split ? "on the right" : "below",
|
|
9708
|
+
"."
|
|
9656
9709
|
] }),
|
|
9657
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
padding: "9px 14px",
|
|
9675
|
-
minHeight: 40,
|
|
9676
|
-
borderRadius: 8,
|
|
9677
|
-
border: `1px solid ${on ? t.ink : t.border}`,
|
|
9678
|
-
background: on ? t.ink : t.pane,
|
|
9679
|
-
color: on ? t.onInk : t.text,
|
|
9680
|
-
fontFamily: "inherit",
|
|
9681
|
-
fontSize: 14,
|
|
9682
|
-
fontWeight: 500,
|
|
9683
|
-
cursor: "pointer",
|
|
9684
|
-
overflowWrap: "anywhere",
|
|
9685
|
-
textAlign: "left"
|
|
9686
|
-
},
|
|
9687
|
-
children: option
|
|
9688
|
-
},
|
|
9689
|
-
option
|
|
9690
|
-
);
|
|
9691
|
-
}) })
|
|
9692
|
-
] }, q.id)),
|
|
9693
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: "8px 12px", marginTop: 2 }, children: [
|
|
9694
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9695
|
-
"button",
|
|
9696
|
-
{
|
|
9697
|
-
type: "button",
|
|
9698
|
-
onClick: () => setAsked(true),
|
|
9699
|
-
disabled: !canContinue,
|
|
9700
|
-
style: { ...primaryStyle(t, !canContinue), whiteSpace: "nowrap" },
|
|
9701
|
-
children: "See available times"
|
|
9702
|
-
}
|
|
9703
|
-
),
|
|
9704
|
-
!canContinue && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { fontSize: 12, ...muted }, children: "Pick one for each to continue" })
|
|
9705
|
-
] })
|
|
9706
|
-
] })
|
|
9710
|
+
tried && missing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { role: "alert", style: { color: t.danger }, children: [
|
|
9711
|
+
"Still needed: ",
|
|
9712
|
+
missing.join(", ")
|
|
9713
|
+
] })
|
|
9714
|
+
] }) }),
|
|
9715
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9716
|
+
"button",
|
|
9717
|
+
{
|
|
9718
|
+
type: "button",
|
|
9719
|
+
onClick: startBooking,
|
|
9720
|
+
disabled: busy,
|
|
9721
|
+
"aria-disabled": missing.length > 0,
|
|
9722
|
+
style: { ...primaryStyle(t, busy || missing.length > 0), cursor: busy ? "default" : "pointer", whiteSpace: "nowrap" },
|
|
9723
|
+
children: requireOtp ? busy ? "Sending code\u2026" : "Send verification code" : busy ? "Booking\u2026" : "Book demo"
|
|
9724
|
+
}
|
|
9725
|
+
)
|
|
9726
|
+
]
|
|
9707
9727
|
}
|
|
9708
9728
|
);
|
|
9709
9729
|
const form = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -9718,54 +9738,15 @@ function BookingDialog({
|
|
|
9718
9738
|
},
|
|
9719
9739
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { maxWidth: 440, display: "flex", flexDirection: "column", gap: 14 }, children: [
|
|
9720
9740
|
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { color: t.danger, fontSize: 13, lineHeight: 1.5 }, children: error }),
|
|
9721
|
-
previewEnded && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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." }),
|
|
9722
|
-
step === "details" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9723
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Field, { t, label: "Your name", value: name, onChange: setName, autoComplete: "name" }),
|
|
9724
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Field, { t, label: "Email", value: email, onChange: setEmail, type: "email", autoComplete: "email" }),
|
|
9725
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9726
|
-
PhoneField,
|
|
9727
|
-
{
|
|
9728
|
-
t,
|
|
9729
|
-
dial,
|
|
9730
|
-
national: phone,
|
|
9731
|
-
onChange: (nextDial, national) => {
|
|
9732
|
-
setDial(nextDial);
|
|
9733
|
-
setPhone(national);
|
|
9734
|
-
},
|
|
9735
|
-
onBlur: () => setPhoneTouched(true),
|
|
9736
|
-
error: phoneTouched ? phoneError : null,
|
|
9737
|
-
hint: requireOtp ? "We send a code here to confirm, then a reminder before the call." : "We send a reminder here before the call."
|
|
9738
|
-
}
|
|
9739
|
-
),
|
|
9740
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Field, { t, label: "Anything we should know? (optional)", value: note, onChange: setNote, multiline: true }),
|
|
9741
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8, marginTop: 4 }, children: [
|
|
9742
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9743
|
-
"button",
|
|
9744
|
-
{
|
|
9745
|
-
type: "button",
|
|
9746
|
-
className: "gg-bk-ghost",
|
|
9747
|
-
onClick: () => {
|
|
9748
|
-
setError(null);
|
|
9749
|
-
setStep("slots");
|
|
9750
|
-
},
|
|
9751
|
-
style: secondaryStyle(t),
|
|
9752
|
-
children: "Back"
|
|
9753
|
-
}
|
|
9754
|
-
),
|
|
9755
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9756
|
-
"button",
|
|
9757
|
-
{
|
|
9758
|
-
type: "button",
|
|
9759
|
-
onClick: startBooking,
|
|
9760
|
-
disabled: !canSubmitDetails || busy,
|
|
9761
|
-
style: primaryStyle(t, !canSubmitDetails || busy),
|
|
9762
|
-
children: requireOtp ? busy ? "Sending code\u2026" : "Send verification code" : busy ? "Booking\u2026" : "Book demo"
|
|
9763
|
-
}
|
|
9764
|
-
)
|
|
9765
|
-
] })
|
|
9766
|
-
] }),
|
|
9767
9741
|
step === "code" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9768
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize:
|
|
9742
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 16, fontWeight: 600 }, children: "Verify your mobile" }),
|
|
9743
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: 14, lineHeight: 1.5, ...muted }, children: [
|
|
9744
|
+
"We texted a code to +",
|
|
9745
|
+
dial,
|
|
9746
|
+
" ",
|
|
9747
|
+
phone,
|
|
9748
|
+
". Your slot is held for 10 minutes."
|
|
9749
|
+
] }),
|
|
9769
9750
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Field, { t, label: "Code", value: code, onChange: setCode, autoComplete: "one-time-code", inputMode: "numeric" }),
|
|
9770
9751
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
9771
9752
|
"button",
|
|
@@ -9780,6 +9761,11 @@ function BookingDialog({
|
|
|
9780
9761
|
] }),
|
|
9781
9762
|
step === "done" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
9782
9763
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: { fontSize: 20, fontWeight: 600 }, children: "You're booked." }),
|
|
9764
|
+
pickedLabel && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8, fontSize: 14 }, children: [
|
|
9765
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "calendar", t, children: pickedLabel }),
|
|
9766
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "globe", t, children: zone }),
|
|
9767
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Row, { icon: "video", t, children: "Google Meet" })
|
|
9768
|
+
] }),
|
|
9783
9769
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { fontSize: 14, lineHeight: 1.6, ...muted }, children: [
|
|
9784
9770
|
"A calendar invite is on its way to ",
|
|
9785
9771
|
email,
|
|
@@ -9823,7 +9809,6 @@ function BookingDialog({
|
|
|
9823
9809
|
.gg-bk-day:hover { box-shadow: inset 0 0 0 1.5px ${t.ink}; }
|
|
9824
9810
|
.gg-bk-slot:hover { border-color: ${t.ink} !important; }
|
|
9825
9811
|
.gg-bk-ghost:hover { background: ${t.open} !important; }
|
|
9826
|
-
.gg-bk-link:hover { color: ${t.text} !important; }
|
|
9827
9812
|
.gg-bk-root button:focus-visible, .gg-bk-root a:focus-visible,
|
|
9828
9813
|
.gg-bk-root span:has(> select:focus-visible), .gg-bk-root input:focus-visible, .gg-bk-root textarea:focus-visible {
|
|
9829
9814
|
outline: 2px solid ${t.ink}; outline-offset: 2px;
|
|
@@ -9837,10 +9822,11 @@ function BookingDialog({
|
|
|
9837
9822
|
"aria-label": page.title,
|
|
9838
9823
|
className: "gg-bk-root",
|
|
9839
9824
|
style: {
|
|
9840
|
-
width: roomy ? "min(
|
|
9841
|
-
//
|
|
9842
|
-
//
|
|
9843
|
-
|
|
9825
|
+
width: roomy ? "min(1180px, 100%)" : "min(820px, 100%)",
|
|
9826
|
+
// The one screen holds a month grid and a form side by side; a fixed
|
|
9827
|
+
// height keeps it from jumping between months, and each column
|
|
9828
|
+
// scrolls inside it. The code and done steps are short.
|
|
9829
|
+
height: wide && roomy ? "min(720px, calc(100vh - 48px))" : void 0,
|
|
9844
9830
|
minHeight: wide && !roomy ? 420 : void 0,
|
|
9845
9831
|
margin: wide ? void 0 : "auto 0",
|
|
9846
9832
|
display: "flex",
|
|
@@ -9850,16 +9836,48 @@ function BookingDialog({
|
|
|
9850
9836
|
border: `1px solid ${t.border}`,
|
|
9851
9837
|
borderRadius: 14,
|
|
9852
9838
|
boxShadow: "0 24px 64px rgba(0,0,0,.35)",
|
|
9853
|
-
|
|
9839
|
+
// Stacked, the footer sticks to the bottom of the scrolling overlay,
|
|
9840
|
+
// which `overflow: hidden` here would cut off.
|
|
9841
|
+
overflow: wide ? "hidden" : "clip",
|
|
9854
9842
|
boxSizing: "border-box",
|
|
9855
9843
|
textAlign: "left",
|
|
9856
9844
|
lineHeight: 1.4
|
|
9857
9845
|
},
|
|
9858
9846
|
children: [
|
|
9859
9847
|
summary,
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9848
|
+
roomy ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { flex: "1 1 auto", minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
9849
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9850
|
+
"div",
|
|
9851
|
+
{
|
|
9852
|
+
style: {
|
|
9853
|
+
flex: "1 1 auto",
|
|
9854
|
+
minHeight: 0,
|
|
9855
|
+
display: "flex",
|
|
9856
|
+
flexDirection: split ? "row" : "column",
|
|
9857
|
+
// A tablet-wide dialog stacks the two and scrolls them as one.
|
|
9858
|
+
overflowY: wide && !split ? "auto" : void 0
|
|
9859
|
+
},
|
|
9860
|
+
children: [
|
|
9861
|
+
details,
|
|
9862
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
9863
|
+
"div",
|
|
9864
|
+
{
|
|
9865
|
+
style: {
|
|
9866
|
+
flex: split ? "0 0 420px" : void 0,
|
|
9867
|
+
borderLeft: split ? `1px solid ${t.border}` : void 0,
|
|
9868
|
+
borderTop: split ? void 0 : `1px solid ${t.border}`,
|
|
9869
|
+
overflowY: split ? "auto" : void 0
|
|
9870
|
+
},
|
|
9871
|
+
children: [
|
|
9872
|
+
calendar,
|
|
9873
|
+
times
|
|
9874
|
+
]
|
|
9875
|
+
}
|
|
9876
|
+
)
|
|
9877
|
+
]
|
|
9878
|
+
}
|
|
9879
|
+
),
|
|
9880
|
+
footer
|
|
9863
9881
|
] }) : form,
|
|
9864
9882
|
!wide && credit
|
|
9865
9883
|
]
|
|
@@ -9883,19 +9901,6 @@ function primaryStyle(t, disabled) {
|
|
|
9883
9901
|
cursor: disabled ? "default" : "pointer"
|
|
9884
9902
|
};
|
|
9885
9903
|
}
|
|
9886
|
-
function secondaryStyle(t) {
|
|
9887
|
-
return {
|
|
9888
|
-
padding: "10px 16px",
|
|
9889
|
-
borderRadius: 8,
|
|
9890
|
-
border: 0,
|
|
9891
|
-
background: "transparent",
|
|
9892
|
-
color: t.text,
|
|
9893
|
-
fontFamily: "inherit",
|
|
9894
|
-
fontSize: 14,
|
|
9895
|
-
fontWeight: 500,
|
|
9896
|
-
cursor: "pointer"
|
|
9897
|
-
};
|
|
9898
|
-
}
|
|
9899
9904
|
function Row({ icon, t, children }) {
|
|
9900
9905
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 10, color: t.text, minWidth: 0 }, children: [
|
|
9901
9906
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { color: t.muted, flex: "0 0 auto", marginTop: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: icon }) }),
|
|
@@ -9985,40 +9990,38 @@ function Field({
|
|
|
9985
9990
|
value,
|
|
9986
9991
|
onChange,
|
|
9987
9992
|
type = "text",
|
|
9988
|
-
hint,
|
|
9989
9993
|
autoComplete,
|
|
9990
9994
|
inputMode,
|
|
9991
|
-
|
|
9995
|
+
error
|
|
9992
9996
|
}) {
|
|
9993
|
-
const inputStyle = {
|
|
9994
|
-
display: "block",
|
|
9995
|
-
width: "100%",
|
|
9996
|
-
boxSizing: "border-box",
|
|
9997
|
-
marginTop: 6,
|
|
9998
|
-
padding: "9px 12px",
|
|
9999
|
-
background: t.input,
|
|
10000
|
-
color: t.text,
|
|
10001
|
-
border: `1px solid ${t.border}`,
|
|
10002
|
-
borderRadius: 8,
|
|
10003
|
-
fontFamily: "inherit",
|
|
10004
|
-
fontSize: 14,
|
|
10005
|
-
outline: "none",
|
|
10006
|
-
resize: "vertical"
|
|
10007
|
-
};
|
|
10008
9997
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { style: { display: "block", fontSize: 13, fontWeight: 500, color: t.text }, children: [
|
|
10009
9998
|
label,
|
|
10010
|
-
|
|
9999
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
10011
10000
|
"input",
|
|
10012
10001
|
{
|
|
10013
10002
|
type,
|
|
10014
10003
|
value,
|
|
10015
10004
|
autoComplete,
|
|
10016
10005
|
inputMode,
|
|
10006
|
+
"aria-invalid": Boolean(error),
|
|
10017
10007
|
onChange: (e) => onChange(e.target.value),
|
|
10018
|
-
style:
|
|
10008
|
+
style: {
|
|
10009
|
+
display: "block",
|
|
10010
|
+
width: "100%",
|
|
10011
|
+
boxSizing: "border-box",
|
|
10012
|
+
marginTop: 6,
|
|
10013
|
+
padding: "9px 12px",
|
|
10014
|
+
background: t.input,
|
|
10015
|
+
color: t.text,
|
|
10016
|
+
border: `1px solid ${error ? t.danger : t.border}`,
|
|
10017
|
+
borderRadius: 8,
|
|
10018
|
+
fontFamily: "inherit",
|
|
10019
|
+
fontSize: 14,
|
|
10020
|
+
outline: "none"
|
|
10021
|
+
}
|
|
10019
10022
|
}
|
|
10020
10023
|
),
|
|
10021
|
-
|
|
10024
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: error })
|
|
10022
10025
|
] });
|
|
10023
10026
|
}
|
|
10024
10027
|
function PhoneField({
|