glitchgrab 1.60.0 → 1.61.1
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 +472 -411
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +472 -411
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
// src/origin.ts
|
|
4
|
+
var EXTENSION_RE = /\b(?:chrome|safari|moz|edge)-extension:\/\//;
|
|
5
|
+
var FRAME_RE = /^\s*at\s+(?:.*?\s+\()?(.+?):(\d+):(\d+)\)?\s*$/;
|
|
6
|
+
var MAX_FRAMES = 10;
|
|
7
|
+
function sameOriginAs(file, pageOrigin) {
|
|
8
|
+
if (file.startsWith("/")) return true;
|
|
9
|
+
try {
|
|
10
|
+
return new URL(file).origin === pageOrigin;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function parseFrames(stack, pageOrigin) {
|
|
16
|
+
if (!stack) return [];
|
|
17
|
+
const frames = [];
|
|
18
|
+
for (const raw of stack.split("\n")) {
|
|
19
|
+
const m = FRAME_RE.exec(raw);
|
|
20
|
+
if (!m) continue;
|
|
21
|
+
const file = m[1].replace(/^eval at .*?, /, "");
|
|
22
|
+
frames.push({
|
|
23
|
+
file,
|
|
24
|
+
line: Number(m[2]),
|
|
25
|
+
column: Number(m[3]),
|
|
26
|
+
sameOrigin: sameOriginAs(file, pageOrigin)
|
|
27
|
+
});
|
|
28
|
+
if (frames.length >= MAX_FRAMES) break;
|
|
29
|
+
}
|
|
30
|
+
return frames;
|
|
31
|
+
}
|
|
32
|
+
function classifyOrigin(stack, filename, pageOrigin) {
|
|
33
|
+
var _a, _b, _c;
|
|
34
|
+
const frames = parseFrames(stack, pageOrigin);
|
|
35
|
+
const top = (_c = (_b = (_a = frames[0]) == null ? void 0 : _a.file) != null ? _b : filename) != null ? _c : "";
|
|
36
|
+
const hasExtensionFrame = EXTENSION_RE.test(stack != null ? stack : "") || EXTENSION_RE.test(filename != null ? filename : "");
|
|
37
|
+
let origin;
|
|
38
|
+
if (hasExtensionFrame) origin = "extension";
|
|
39
|
+
else if (!top) origin = "unknown";
|
|
40
|
+
else if (top === "<anonymous>" || /\beval\b/.test(top)) origin = "eval";
|
|
41
|
+
else if (/^(?:blob|data):/.test(top)) origin = "injected";
|
|
42
|
+
else if (!sameOriginAs(top, pageOrigin)) origin = "injected";
|
|
43
|
+
else origin = "app";
|
|
44
|
+
return { origin, frames };
|
|
45
|
+
}
|
|
46
|
+
function originMetadata(stack, filename) {
|
|
47
|
+
try {
|
|
48
|
+
const { origin, frames } = classifyOrigin(stack, filename, window.location.origin);
|
|
49
|
+
return {
|
|
50
|
+
codeOrigin: origin,
|
|
51
|
+
...frames.length ? { frames: JSON.stringify(frames) } : {}
|
|
52
|
+
};
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
3
58
|
// src/provider.tsx
|
|
4
59
|
import {
|
|
5
60
|
createContext,
|
|
@@ -1248,6 +1303,7 @@ function buildCapturedErrorPayload(error, options, cfg, capturedBy = "captureErr
|
|
|
1248
1303
|
...contextMetadata(context),
|
|
1249
1304
|
...(options == null ? void 0 : options.boundary) ? { boundary: options.boundary } : {},
|
|
1250
1305
|
...digest ? { digest } : {},
|
|
1306
|
+
...originMetadata(err == null ? void 0 : err.stack),
|
|
1251
1307
|
...sessionMetadata(cfg.session),
|
|
1252
1308
|
...options == null ? void 0 : options.metadata
|
|
1253
1309
|
}
|
|
@@ -4026,7 +4082,9 @@ function AssistSheet({
|
|
|
4026
4082
|
backgroundColor: t.bg,
|
|
4027
4083
|
// The "already filed?" card can be taller than the sheet; scroll
|
|
4028
4084
|
// it instead of clipping its buttons off the bottom (#590).
|
|
4029
|
-
|
|
4085
|
+
// The bottom sheet has only a max-height, so a % here resolves
|
|
4086
|
+
// to auto and never scrolls (#596): use the viewport there.
|
|
4087
|
+
...similarSlot ? { maxHeight: narrow ? "55dvh" : "70%", overflowY: "auto" } : {}
|
|
4030
4088
|
},
|
|
4031
4089
|
children: [
|
|
4032
4090
|
phase === "solved" ? /* @__PURE__ */ jsx3(
|
|
@@ -8747,6 +8805,7 @@ var WEEKDAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
|
8747
8805
|
var DAY_MS = 864e5;
|
|
8748
8806
|
var ZONE_PAD_MS = 14 * 36e5;
|
|
8749
8807
|
var WIDE_QUERY = "(min-width: 900px)";
|
|
8808
|
+
var SPLIT_QUERY = "(min-width: 1120px)";
|
|
8750
8809
|
function localZone() {
|
|
8751
8810
|
try {
|
|
8752
8811
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -8853,13 +8912,14 @@ function BookingDialog({
|
|
|
8853
8912
|
}) {
|
|
8854
8913
|
var _a, _b, _c, _d, _e;
|
|
8855
8914
|
const wide = useMediaQuery(WIDE_QUERY, true);
|
|
8915
|
+
const split = useMediaQuery(SPLIT_QUERY, true) && wide;
|
|
8856
8916
|
const t = useMemo3(() => {
|
|
8857
8917
|
if (!open) return LIGHT;
|
|
8858
8918
|
const base = detectDark() ? DARK : LIGHT;
|
|
8859
8919
|
const accent = detectHostAccent();
|
|
8860
8920
|
return accent ? { ...base, ink: accent.accent, onInk: accent.accentText } : base;
|
|
8861
8921
|
}, [open]);
|
|
8862
|
-
const [step, setStep] = useState5("
|
|
8922
|
+
const [step, setStep] = useState5("pick");
|
|
8863
8923
|
const [zone, setZone] = useState5(localZone);
|
|
8864
8924
|
const [twelve, setTwelve] = useState5(prefers12h);
|
|
8865
8925
|
const [month, setMonth] = useState5(() => dayKeyIn(Date.now(), localZone()).slice(0, 7));
|
|
@@ -8874,11 +8934,10 @@ function BookingDialog({
|
|
|
8874
8934
|
const [phone, setPhone] = useState5("");
|
|
8875
8935
|
const [dial, setDial] = useState5(() => defaultDialForZone(localZone()));
|
|
8876
8936
|
const [phoneTouched, setPhoneTouched] = useState5(false);
|
|
8877
|
-
const [
|
|
8937
|
+
const [tried, setTried] = useState5(false);
|
|
8878
8938
|
const [questions, setQuestions] = useState5([]);
|
|
8879
8939
|
const [answers, setAnswers] = useState5({});
|
|
8880
8940
|
const [pageLoaded, setPageLoaded] = useState5(false);
|
|
8881
|
-
const [asked, setAsked] = useState5(false);
|
|
8882
8941
|
const [requireOtp, setRequireOtp] = useState5(true);
|
|
8883
8942
|
const [code, setCode] = useState5("");
|
|
8884
8943
|
const [bookingId, setBookingId] = useState5(null);
|
|
@@ -8938,7 +8997,7 @@ function BookingDialog({
|
|
|
8938
8997
|
useEffect5(() => {
|
|
8939
8998
|
if (!open) return;
|
|
8940
8999
|
const now = localZone();
|
|
8941
|
-
setStep("
|
|
9000
|
+
setStep("pick");
|
|
8942
9001
|
setZone(now);
|
|
8943
9002
|
setMonth(dayKeyIn(Date.now(), now).slice(0, 7));
|
|
8944
9003
|
setSlotsByMonth({});
|
|
@@ -8950,7 +9009,7 @@ function BookingDialog({
|
|
|
8950
9009
|
setPreviewEnded(false);
|
|
8951
9010
|
setAvatarFailed(false);
|
|
8952
9011
|
setPageLoaded(false);
|
|
8953
|
-
|
|
9012
|
+
setTried(false);
|
|
8954
9013
|
}, [open]);
|
|
8955
9014
|
const monthLoaded = month in slotsByMonth;
|
|
8956
9015
|
useEffect5(() => {
|
|
@@ -8980,13 +9039,22 @@ function BookingDialog({
|
|
|
8980
9039
|
const atFirstMonth = month <= today.slice(0, 7);
|
|
8981
9040
|
const pastHorizon = monthLoaded && !error && byDay.size === 0 && !atFirstMonth;
|
|
8982
9041
|
const given = questions.flatMap((q) => q.options.includes(answers[q.id]) ? [{ ...q, answer: answers[q.id] }] : []);
|
|
8983
|
-
const
|
|
8984
|
-
const
|
|
8985
|
-
const
|
|
9042
|
+
const unanswered = questions.filter((q) => q.required && !q.options.includes(answers[q.id]));
|
|
9043
|
+
const phoneError = phoneProblem(dial, phone);
|
|
9044
|
+
const nameMissing = !name.trim();
|
|
9045
|
+
const emailMissing = !email.includes("@");
|
|
9046
|
+
const missing = [
|
|
9047
|
+
...nameMissing ? ["your name"] : [],
|
|
9048
|
+
...phoneError ? ["a valid mobile number"] : [],
|
|
9049
|
+
...emailMissing ? ["your email"] : [],
|
|
9050
|
+
...unanswered.map((q) => `an answer to \u201C${q.label}\u201D`),
|
|
9051
|
+
...selected ? [] : ["a day and time"]
|
|
9052
|
+
];
|
|
9053
|
+
const roomy = step === "pick";
|
|
8986
9054
|
async function startBooking() {
|
|
8987
9055
|
var _a2, _b2, _c2;
|
|
8988
|
-
if (!selected)
|
|
8989
|
-
|
|
9056
|
+
if (missing.length > 0 || !selected) {
|
|
9057
|
+
setTried(true);
|
|
8990
9058
|
setPhoneTouched(true);
|
|
8991
9059
|
return;
|
|
8992
9060
|
}
|
|
@@ -9004,7 +9072,6 @@ function BookingDialog({
|
|
|
9004
9072
|
name,
|
|
9005
9073
|
email,
|
|
9006
9074
|
phone: toE164(dial, phone),
|
|
9007
|
-
note,
|
|
9008
9075
|
answers: Object.fromEntries(given.map((q) => [q.id, q.answer])),
|
|
9009
9076
|
startsAt: selected.startsAt,
|
|
9010
9077
|
// The zone the times were shown in, which is the one the visitor chose.
|
|
@@ -9066,8 +9133,6 @@ function BookingDialog({
|
|
|
9066
9133
|
setBusy(false);
|
|
9067
9134
|
}
|
|
9068
9135
|
}
|
|
9069
|
-
const phoneError = phoneProblem(dial, phone);
|
|
9070
|
-
const canSubmitDetails = Boolean(name.trim() && email.includes("@"));
|
|
9071
9136
|
const selectedEnd = selected ? (_e = selected.endsAt) != null ? _e : new Date(new Date(selected.startsAt).getTime() + page.slotMinutes * 6e4).toISOString() : null;
|
|
9072
9137
|
const monthDate = new Date(keyToUtc(`${month}-01`));
|
|
9073
9138
|
const muted = { color: t.muted };
|
|
@@ -9225,7 +9290,7 @@ function BookingDialog({
|
|
|
9225
9290
|
/* @__PURE__ */ jsx6("div", { style: { fontSize: 20, fontWeight: 600, lineHeight: 1.25, paddingRight: 32, overflowWrap: "anywhere" }, children: page.title }),
|
|
9226
9291
|
page.description && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, lineHeight: 1.5, overflowWrap: "anywhere", ...muted }, children: page.description }),
|
|
9227
9292
|
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: 10, marginTop: 4, fontSize: 14 }, children: [
|
|
9228
|
-
selected && step !== "
|
|
9293
|
+
selected && step !== "pick" && /* @__PURE__ */ jsx6(Row, { icon: "calendar", t, children: /* @__PURE__ */ jsxs6("span", { children: [
|
|
9229
9294
|
new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9230
9295
|
weekday: "long",
|
|
9231
9296
|
month: "long",
|
|
@@ -9240,33 +9305,7 @@ function BookingDialog({
|
|
|
9240
9305
|
selectedEnd && formatTime(selectedEnd, zone, twelve)
|
|
9241
9306
|
] })
|
|
9242
9307
|
] }) }),
|
|
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
|
-
] }) }),
|
|
9308
|
+
step !== "pick" && given.length > 0 && /* @__PURE__ */ jsx6(Row, { icon: "check", t, children: given.map((q) => q.answer).join(" \xB7 ") }),
|
|
9270
9309
|
/* @__PURE__ */ jsx6(Row, { icon: "clock", t, children: formatDuration(page.slotMinutes) }),
|
|
9271
9310
|
/* @__PURE__ */ jsx6(Row, { icon: "video", t, children: "Google Meet" }),
|
|
9272
9311
|
/* @__PURE__ */ jsx6(Row, { icon: "globe", t, children: roomy ? (
|
|
@@ -9323,328 +9362,365 @@ function BookingDialog({
|
|
|
9323
9362
|
]
|
|
9324
9363
|
}
|
|
9325
9364
|
);
|
|
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
|
-
|
|
9365
|
+
const calendar = /* @__PURE__ */ jsxs6("div", { style: { padding: wide ? "22px 20px 12px" : "16px 16px 8px", boxSizing: "border-box" }, children: [
|
|
9366
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 14 }, children: [
|
|
9367
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 16, fontWeight: 600 }, children: [
|
|
9368
|
+
monthDate.toLocaleDateString("en-US", { month: "long", timeZone: "UTC" }),
|
|
9369
|
+
" ",
|
|
9370
|
+
/* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: monthDate.getUTCFullYear() })
|
|
9371
|
+
] }),
|
|
9372
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 4 }, children: [
|
|
9373
|
+
/* @__PURE__ */ jsx6(
|
|
9374
|
+
NavButton,
|
|
9375
|
+
{
|
|
9376
|
+
t,
|
|
9377
|
+
label: "Previous month",
|
|
9378
|
+
icon: "left",
|
|
9379
|
+
disabled: atFirstMonth,
|
|
9380
|
+
onClick: () => setMonth(shiftMonth(month, -1))
|
|
9381
|
+
}
|
|
9382
|
+
),
|
|
9383
|
+
/* @__PURE__ */ jsx6(
|
|
9384
|
+
NavButton,
|
|
9385
|
+
{
|
|
9386
|
+
t,
|
|
9387
|
+
label: "Next month",
|
|
9388
|
+
icon: "right",
|
|
9389
|
+
disabled: pastHorizon,
|
|
9390
|
+
onClick: () => setMonth(shiftMonth(month, 1))
|
|
9391
|
+
}
|
|
9392
|
+
)
|
|
9393
|
+
] })
|
|
9394
|
+
] }),
|
|
9395
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, minmax(0, 1fr))", gap: 4 }, children: [
|
|
9396
|
+
WEEKDAYS.map((w) => /* @__PURE__ */ jsx6(
|
|
9397
|
+
"div",
|
|
9398
|
+
{
|
|
9399
|
+
style: {
|
|
9400
|
+
textAlign: "center",
|
|
9401
|
+
fontSize: 11,
|
|
9402
|
+
fontWeight: 500,
|
|
9403
|
+
letterSpacing: ".08em",
|
|
9404
|
+
textTransform: "uppercase",
|
|
9405
|
+
padding: "6px 0 8px",
|
|
9406
|
+
color: t.text
|
|
9407
|
+
},
|
|
9408
|
+
children: w
|
|
9409
|
+
},
|
|
9410
|
+
w
|
|
9411
|
+
)),
|
|
9412
|
+
grid.map((key) => {
|
|
9413
|
+
const inMonth = key.startsWith(month);
|
|
9414
|
+
const bookable = byDay.has(key);
|
|
9415
|
+
const isSelected = key === day;
|
|
9416
|
+
const dayNum = Number(key.slice(8));
|
|
9417
|
+
if (!inMonth && !bookable) return /* @__PURE__ */ jsx6("div", { "aria-hidden": true }, key);
|
|
9418
|
+
return /* @__PURE__ */ jsxs6(
|
|
9419
|
+
"button",
|
|
9420
|
+
{
|
|
9421
|
+
type: "button",
|
|
9422
|
+
disabled: !bookable,
|
|
9423
|
+
onClick: () => setPickedDay(key),
|
|
9424
|
+
"aria-pressed": isSelected,
|
|
9425
|
+
"aria-label": new Date(keyToUtc(key)).toLocaleDateString("en-US", {
|
|
9426
|
+
weekday: "long",
|
|
9427
|
+
month: "long",
|
|
9428
|
+
day: "numeric",
|
|
9429
|
+
timeZone: "UTC"
|
|
9430
|
+
}),
|
|
9431
|
+
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9432
|
+
style: {
|
|
9433
|
+
position: "relative",
|
|
9434
|
+
// Shorter than square: the times sit under the month now, and
|
|
9435
|
+
// both should fit without scrolling on a laptop.
|
|
9436
|
+
aspectRatio: wide ? "5 / 4" : "1 / 1",
|
|
9437
|
+
minHeight: 36,
|
|
9438
|
+
border: 0,
|
|
9439
|
+
borderRadius: 8,
|
|
9440
|
+
padding: 0,
|
|
9441
|
+
fontFamily: "inherit",
|
|
9442
|
+
fontSize: wide ? 15 : 14,
|
|
9443
|
+
fontWeight: bookable ? 600 : 400,
|
|
9444
|
+
cursor: bookable ? "pointer" : "default",
|
|
9445
|
+
background: isSelected ? t.ink : bookable ? t.open : "transparent",
|
|
9446
|
+
color: isSelected ? t.onInk : bookable ? t.text : t.faint,
|
|
9447
|
+
opacity: monthLoaded ? 1 : 0.5
|
|
9448
|
+
},
|
|
9449
|
+
children: [
|
|
9450
|
+
!inMonth && dayNum === 1 && /* @__PURE__ */ jsx6(
|
|
9451
|
+
"span",
|
|
9452
|
+
{
|
|
9453
|
+
style: {
|
|
9454
|
+
position: "absolute",
|
|
9455
|
+
top: 4,
|
|
9456
|
+
left: 0,
|
|
9457
|
+
right: 0,
|
|
9458
|
+
fontSize: 9,
|
|
9459
|
+
fontWeight: 500,
|
|
9460
|
+
letterSpacing: ".06em",
|
|
9461
|
+
textTransform: "uppercase"
|
|
9462
|
+
},
|
|
9463
|
+
children: new Date(keyToUtc(key)).toLocaleDateString("en-US", { month: "short", timeZone: "UTC" })
|
|
9464
|
+
}
|
|
9465
|
+
),
|
|
9466
|
+
dayNum,
|
|
9467
|
+
key === today && /* @__PURE__ */ jsx6(
|
|
9468
|
+
"span",
|
|
9469
|
+
{
|
|
9470
|
+
"aria-hidden": true,
|
|
9471
|
+
style: {
|
|
9472
|
+
position: "absolute",
|
|
9473
|
+
bottom: 6,
|
|
9474
|
+
left: "50%",
|
|
9475
|
+
width: 4,
|
|
9476
|
+
height: 4,
|
|
9477
|
+
marginLeft: -2,
|
|
9478
|
+
borderRadius: 999,
|
|
9479
|
+
background: isSelected ? t.onInk : t.text
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
)
|
|
9483
|
+
]
|
|
9484
|
+
},
|
|
9485
|
+
key
|
|
9486
|
+
);
|
|
9487
|
+
})
|
|
9488
|
+
] })
|
|
9489
|
+
] });
|
|
9490
|
+
const times = /* @__PURE__ */ jsxs6("div", { style: { borderTop: `1px solid ${t.border}`, padding: wide ? "16px 20px 0" : "16px 16px 0", boxSizing: "border-box" }, children: [
|
|
9491
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 14 }, children: [
|
|
9492
|
+
/* @__PURE__ */ jsx6("div", { style: { fontSize: 16, fontWeight: 600, whiteSpace: "nowrap" }, children: day ? /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9493
|
+
new Date(keyToUtc(day)).toLocaleDateString("en-US", { weekday: "short", timeZone: "UTC" }),
|
|
9494
|
+
" ",
|
|
9495
|
+
/* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: ordinal(Number(day.slice(8))) })
|
|
9496
|
+
] }) : /* @__PURE__ */ jsx6("span", { style: { fontWeight: 500, ...muted }, children: "Times" }) }),
|
|
9497
|
+
/* @__PURE__ */ jsx6(
|
|
9498
|
+
"div",
|
|
9499
|
+
{
|
|
9500
|
+
role: "group",
|
|
9501
|
+
"aria-label": "Clock format",
|
|
9502
|
+
style: { display: "flex", padding: 3, borderRadius: 8, background: t.open, flex: "0 0 auto" },
|
|
9503
|
+
children: [true, false].map((h12) => /* @__PURE__ */ jsx6(
|
|
9504
|
+
"button",
|
|
9369
9505
|
{
|
|
9506
|
+
type: "button",
|
|
9507
|
+
"aria-pressed": twelve === h12,
|
|
9508
|
+
onClick: () => setTwelve(h12),
|
|
9370
9509
|
style: {
|
|
9371
|
-
|
|
9372
|
-
|
|
9510
|
+
border: 0,
|
|
9511
|
+
borderRadius: 6,
|
|
9512
|
+
padding: "4px 9px",
|
|
9513
|
+
fontFamily: "inherit",
|
|
9514
|
+
fontSize: 13,
|
|
9373
9515
|
fontWeight: 500,
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9516
|
+
cursor: "pointer",
|
|
9517
|
+
background: twelve === h12 ? t.bg : "transparent",
|
|
9518
|
+
color: twelve === h12 ? t.text : t.muted,
|
|
9519
|
+
boxShadow: twelve === h12 ? "0 1px 2px rgba(0,0,0,.12)" : "none"
|
|
9378
9520
|
},
|
|
9379
|
-
children:
|
|
9521
|
+
children: h12 ? "12h" : "24h"
|
|
9380
9522
|
},
|
|
9381
|
-
|
|
9382
|
-
))
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9523
|
+
String(h12)
|
|
9524
|
+
))
|
|
9525
|
+
}
|
|
9526
|
+
)
|
|
9527
|
+
] }),
|
|
9528
|
+
/* @__PURE__ */ jsxs6(
|
|
9529
|
+
"div",
|
|
9530
|
+
{
|
|
9531
|
+
role: "group",
|
|
9532
|
+
"aria-label": "Times",
|
|
9533
|
+
style: {
|
|
9534
|
+
paddingBottom: 20,
|
|
9535
|
+
display: "grid",
|
|
9536
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(84px, 1fr))",
|
|
9537
|
+
gap: 8
|
|
9538
|
+
},
|
|
9539
|
+
children: [
|
|
9540
|
+
error && /* @__PURE__ */ jsx6("div", { style: { color: t.danger, fontSize: 13, lineHeight: 1.5, gridColumn: "1 / -1" }, children: error }),
|
|
9541
|
+
!monthLoaded && !error && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, gridColumn: "1 / -1", ...muted }, children: "Finding times\u2026" }),
|
|
9542
|
+
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." }),
|
|
9543
|
+
monthLoaded && daySlots.map((slot) => {
|
|
9544
|
+
const on = (selected == null ? void 0 : selected.startsAt) === slot.startsAt;
|
|
9545
|
+
return /* @__PURE__ */ jsx6(
|
|
9390
9546
|
"button",
|
|
9391
9547
|
{
|
|
9392
9548
|
type: "button",
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
day: "numeric",
|
|
9400
|
-
timeZone: "UTC"
|
|
9401
|
-
}),
|
|
9402
|
-
className: bookable && !isSelected ? "gg-bk-day" : void 0,
|
|
9549
|
+
"aria-pressed": on,
|
|
9550
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9551
|
+
onClick: () => {
|
|
9552
|
+
setSelected(slot);
|
|
9553
|
+
setError(null);
|
|
9554
|
+
},
|
|
9403
9555
|
style: {
|
|
9404
|
-
|
|
9405
|
-
aspectRatio: "1 / 1",
|
|
9406
|
-
minHeight: 36,
|
|
9407
|
-
border: 0,
|
|
9556
|
+
padding: "10px 8px",
|
|
9408
9557
|
borderRadius: 8,
|
|
9409
|
-
|
|
9558
|
+
border: `1px solid ${on ? t.ink : t.border}`,
|
|
9559
|
+
background: on ? t.ink : t.pane,
|
|
9560
|
+
color: on ? t.onInk : t.text,
|
|
9410
9561
|
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
|
|
9562
|
+
fontSize: 14,
|
|
9563
|
+
fontWeight: 500,
|
|
9564
|
+
cursor: "pointer",
|
|
9565
|
+
textAlign: "center"
|
|
9417
9566
|
},
|
|
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
|
-
]
|
|
9567
|
+
children: formatTime(slot.startsAt, zone, twelve)
|
|
9453
9568
|
},
|
|
9454
|
-
|
|
9569
|
+
slot.startsAt
|
|
9455
9570
|
);
|
|
9456
9571
|
})
|
|
9457
|
-
]
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
);
|
|
9461
|
-
const
|
|
9572
|
+
]
|
|
9573
|
+
}
|
|
9574
|
+
)
|
|
9575
|
+
] });
|
|
9576
|
+
const details = /* @__PURE__ */ jsxs6(
|
|
9462
9577
|
"div",
|
|
9463
9578
|
{
|
|
9464
9579
|
style: {
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
borderTop: wide ? void 0 : `1px solid ${t.border}`,
|
|
9469
|
-
padding: wide ? "24px 20px 0" : "16px 16px 0",
|
|
9580
|
+
flex: "1 1 auto",
|
|
9581
|
+
minWidth: 0,
|
|
9582
|
+
padding: wide ? "24px 28px" : "20px",
|
|
9470
9583
|
boxSizing: "border-box",
|
|
9584
|
+
overflowY: split ? "auto" : void 0,
|
|
9471
9585
|
display: "flex",
|
|
9472
9586
|
flexDirection: "column",
|
|
9473
|
-
|
|
9587
|
+
gap: 16
|
|
9474
9588
|
},
|
|
9475
9589
|
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",
|
|
9590
|
+
/* @__PURE__ */ jsx6(
|
|
9591
|
+
Field,
|
|
9515
9592
|
{
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9593
|
+
t,
|
|
9594
|
+
label: "Full name",
|
|
9595
|
+
value: name,
|
|
9596
|
+
onChange: setName,
|
|
9597
|
+
autoComplete: "name",
|
|
9598
|
+
error: tried && nameMissing ? "Add your name" : null
|
|
9599
|
+
}
|
|
9600
|
+
),
|
|
9601
|
+
/* @__PURE__ */ jsx6(
|
|
9602
|
+
PhoneField,
|
|
9603
|
+
{
|
|
9604
|
+
t,
|
|
9605
|
+
dial,
|
|
9606
|
+
national: phone,
|
|
9607
|
+
onChange: (nextDial, national) => {
|
|
9608
|
+
setDial(nextDial);
|
|
9609
|
+
setPhone(national);
|
|
9525
9610
|
},
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9611
|
+
onBlur: () => setPhoneTouched(true),
|
|
9612
|
+
error: phoneTouched ? phoneError : null,
|
|
9613
|
+
hint: requireOtp ? "We text a code here to confirm, then a reminder before the call." : "We send a reminder here before the call."
|
|
9614
|
+
}
|
|
9615
|
+
),
|
|
9616
|
+
/* @__PURE__ */ jsx6(
|
|
9617
|
+
Field,
|
|
9618
|
+
{
|
|
9619
|
+
t,
|
|
9620
|
+
label: "Email",
|
|
9621
|
+
value: email,
|
|
9622
|
+
onChange: setEmail,
|
|
9623
|
+
type: "email",
|
|
9624
|
+
autoComplete: "email",
|
|
9625
|
+
error: tried && emailMissing ? "Add an email \u2014 the invite goes there" : null
|
|
9626
|
+
}
|
|
9627
|
+
),
|
|
9628
|
+
!pageLoaded && /* @__PURE__ */ jsx6("div", { style: { fontSize: 13, ...muted }, children: "Loading\u2026" }),
|
|
9629
|
+
questions.map((q) => {
|
|
9630
|
+
const gap = tried && unanswered.includes(q);
|
|
9631
|
+
return /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": q.label, children: [
|
|
9632
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 13, fontWeight: 500, overflowWrap: "anywhere" }, children: [
|
|
9633
|
+
q.label,
|
|
9634
|
+
!q.required && /* @__PURE__ */ jsx6("span", { style: { fontWeight: 400, ...muted }, children: " (optional)" })
|
|
9635
|
+
] }),
|
|
9636
|
+
/* @__PURE__ */ jsx6("div", { style: { display: "flex", flexWrap: "wrap", gap: 8, marginTop: 8 }, children: q.options.map((option) => {
|
|
9637
|
+
const on = answers[q.id] === option;
|
|
9638
|
+
return /* @__PURE__ */ jsx6(
|
|
9531
9639
|
"button",
|
|
9532
9640
|
{
|
|
9533
9641
|
type: "button",
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9642
|
+
"aria-pressed": on,
|
|
9643
|
+
className: on ? void 0 : "gg-bk-slot",
|
|
9644
|
+
onClick: () => setAnswers((prev) => {
|
|
9645
|
+
if (on && !q.required) {
|
|
9646
|
+
const rest = { ...prev };
|
|
9647
|
+
delete rest[q.id];
|
|
9648
|
+
return rest;
|
|
9649
|
+
}
|
|
9650
|
+
return { ...prev, [q.id]: option };
|
|
9651
|
+
}),
|
|
9540
9652
|
style: {
|
|
9541
|
-
|
|
9542
|
-
|
|
9653
|
+
padding: "7px 12px",
|
|
9654
|
+
minHeight: 36,
|
|
9543
9655
|
borderRadius: 8,
|
|
9544
|
-
border: `1px solid ${t.border}`,
|
|
9545
|
-
background: t.pane,
|
|
9546
|
-
color: t.text,
|
|
9656
|
+
border: `1px solid ${on ? t.ink : gap ? t.danger : t.border}`,
|
|
9657
|
+
background: on ? t.ink : t.pane,
|
|
9658
|
+
color: on ? t.onInk : t.text,
|
|
9547
9659
|
fontFamily: "inherit",
|
|
9548
9660
|
fontSize: 14,
|
|
9549
9661
|
fontWeight: 500,
|
|
9550
9662
|
cursor: "pointer",
|
|
9551
|
-
|
|
9663
|
+
overflowWrap: "anywhere",
|
|
9664
|
+
textAlign: "left"
|
|
9552
9665
|
},
|
|
9553
|
-
children:
|
|
9666
|
+
children: option
|
|
9554
9667
|
},
|
|
9555
|
-
|
|
9556
|
-
)
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9668
|
+
option
|
|
9669
|
+
);
|
|
9670
|
+
}) }),
|
|
9671
|
+
gap && /* @__PURE__ */ jsx6("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: "Pick one" })
|
|
9672
|
+
] }, q.id);
|
|
9673
|
+
})
|
|
9560
9674
|
]
|
|
9561
9675
|
}
|
|
9562
9676
|
);
|
|
9563
|
-
const
|
|
9677
|
+
const pickedLabel = selected ? `${new Date(selected.startsAt).toLocaleDateString("en-US", {
|
|
9678
|
+
weekday: "short",
|
|
9679
|
+
month: "short",
|
|
9680
|
+
day: "numeric",
|
|
9681
|
+
timeZone: zone
|
|
9682
|
+
})} \xB7 ${formatTime(selected.startsAt, zone, twelve)} \u2013 ${selectedEnd && formatTime(selectedEnd, zone, twelve)}` : null;
|
|
9683
|
+
const footer = /* @__PURE__ */ jsxs6(
|
|
9564
9684
|
"div",
|
|
9565
9685
|
{
|
|
9566
9686
|
style: {
|
|
9567
|
-
|
|
9568
|
-
|
|
9687
|
+
borderTop: `1px solid ${t.border}`,
|
|
9688
|
+
padding: wide ? "14px 28px" : "14px 16px",
|
|
9569
9689
|
display: "flex",
|
|
9690
|
+
flexWrap: "wrap",
|
|
9570
9691
|
alignItems: "center",
|
|
9571
|
-
justifyContent: "
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
const ask = /* @__PURE__ */ jsx6(
|
|
9579
|
-
"div",
|
|
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
|
|
9692
|
+
justifyContent: "space-between",
|
|
9693
|
+
gap: "10px 16px",
|
|
9694
|
+
background: t.bg,
|
|
9695
|
+
// Stacked, the dialog scrolls as one page; the button stays in reach.
|
|
9696
|
+
position: wide ? void 0 : "sticky",
|
|
9697
|
+
// Past the overlay's 12px padding, so nothing shows under the bar.
|
|
9698
|
+
bottom: wide ? void 0 : -12
|
|
9587
9699
|
},
|
|
9588
|
-
children:
|
|
9589
|
-
/* @__PURE__ */
|
|
9590
|
-
/* @__PURE__ */ jsx6("div", { style: {
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
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)" })
|
|
9700
|
+
children: [
|
|
9701
|
+
/* @__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: [
|
|
9702
|
+
pickedLabel ? /* @__PURE__ */ jsx6("div", { style: { fontWeight: 600 }, children: pickedLabel }) : !tried && /* @__PURE__ */ jsxs6("div", { style: muted, children: [
|
|
9703
|
+
"Pick a day and a time ",
|
|
9704
|
+
split ? "on the right" : "below",
|
|
9705
|
+
"."
|
|
9597
9706
|
] }),
|
|
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
|
-
] })
|
|
9707
|
+
tried && missing.length > 0 && /* @__PURE__ */ jsxs6("div", { role: "alert", style: { color: t.danger }, children: [
|
|
9708
|
+
"Still needed: ",
|
|
9709
|
+
missing.join(", ")
|
|
9710
|
+
] })
|
|
9711
|
+
] }) }),
|
|
9712
|
+
/* @__PURE__ */ jsx6(
|
|
9713
|
+
"button",
|
|
9714
|
+
{
|
|
9715
|
+
type: "button",
|
|
9716
|
+
onClick: startBooking,
|
|
9717
|
+
disabled: busy,
|
|
9718
|
+
"aria-disabled": missing.length > 0,
|
|
9719
|
+
style: { ...primaryStyle(t, busy || missing.length > 0), cursor: busy ? "default" : "pointer", whiteSpace: "nowrap" },
|
|
9720
|
+
children: requireOtp ? busy ? "Sending code\u2026" : "Send verification code" : busy ? "Booking\u2026" : "Book demo"
|
|
9721
|
+
}
|
|
9722
|
+
)
|
|
9723
|
+
]
|
|
9648
9724
|
}
|
|
9649
9725
|
);
|
|
9650
9726
|
const form = /* @__PURE__ */ jsx6(
|
|
@@ -9659,54 +9735,15 @@ function BookingDialog({
|
|
|
9659
9735
|
},
|
|
9660
9736
|
children: /* @__PURE__ */ jsxs6("div", { style: { maxWidth: 440, display: "flex", flexDirection: "column", gap: 14 }, children: [
|
|
9661
9737
|
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
9738
|
step === "code" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9709
|
-
/* @__PURE__ */ jsx6("div", { style: { fontSize:
|
|
9739
|
+
/* @__PURE__ */ jsx6("div", { style: { fontSize: 16, fontWeight: 600 }, children: "Verify your mobile" }),
|
|
9740
|
+
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 14, lineHeight: 1.5, ...muted }, children: [
|
|
9741
|
+
"We texted a code to +",
|
|
9742
|
+
dial,
|
|
9743
|
+
" ",
|
|
9744
|
+
phone,
|
|
9745
|
+
". Your slot is held for 10 minutes."
|
|
9746
|
+
] }),
|
|
9710
9747
|
/* @__PURE__ */ jsx6(Field, { t, label: "Code", value: code, onChange: setCode, autoComplete: "one-time-code", inputMode: "numeric" }),
|
|
9711
9748
|
/* @__PURE__ */ jsx6("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 4 }, children: /* @__PURE__ */ jsx6(
|
|
9712
9749
|
"button",
|
|
@@ -9721,6 +9758,11 @@ function BookingDialog({
|
|
|
9721
9758
|
] }),
|
|
9722
9759
|
step === "done" && /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
9723
9760
|
/* @__PURE__ */ jsx6("div", { style: { fontSize: 20, fontWeight: 600 }, children: "You're booked." }),
|
|
9761
|
+
pickedLabel && /* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: 8, fontSize: 14 }, children: [
|
|
9762
|
+
/* @__PURE__ */ jsx6(Row, { icon: "calendar", t, children: pickedLabel }),
|
|
9763
|
+
/* @__PURE__ */ jsx6(Row, { icon: "globe", t, children: zone }),
|
|
9764
|
+
/* @__PURE__ */ jsx6(Row, { icon: "video", t, children: "Google Meet" })
|
|
9765
|
+
] }),
|
|
9724
9766
|
/* @__PURE__ */ jsxs6("div", { style: { fontSize: 14, lineHeight: 1.6, ...muted }, children: [
|
|
9725
9767
|
"A calendar invite is on its way to ",
|
|
9726
9768
|
email,
|
|
@@ -9764,7 +9806,6 @@ function BookingDialog({
|
|
|
9764
9806
|
.gg-bk-day:hover { box-shadow: inset 0 0 0 1.5px ${t.ink}; }
|
|
9765
9807
|
.gg-bk-slot:hover { border-color: ${t.ink} !important; }
|
|
9766
9808
|
.gg-bk-ghost:hover { background: ${t.open} !important; }
|
|
9767
|
-
.gg-bk-link:hover { color: ${t.text} !important; }
|
|
9768
9809
|
.gg-bk-root button:focus-visible, .gg-bk-root a:focus-visible,
|
|
9769
9810
|
.gg-bk-root span:has(> select:focus-visible), .gg-bk-root input:focus-visible, .gg-bk-root textarea:focus-visible {
|
|
9770
9811
|
outline: 2px solid ${t.ink}; outline-offset: 2px;
|
|
@@ -9778,10 +9819,11 @@ function BookingDialog({
|
|
|
9778
9819
|
"aria-label": page.title,
|
|
9779
9820
|
className: "gg-bk-root",
|
|
9780
9821
|
style: {
|
|
9781
|
-
width: roomy ? "min(
|
|
9782
|
-
//
|
|
9783
|
-
//
|
|
9784
|
-
|
|
9822
|
+
width: roomy ? "min(1180px, 100%)" : "min(820px, 100%)",
|
|
9823
|
+
// The one screen holds a month grid and a form side by side; a fixed
|
|
9824
|
+
// height keeps it from jumping between months, and each column
|
|
9825
|
+
// scrolls inside it. The code and done steps are short.
|
|
9826
|
+
height: wide && roomy ? "min(720px, calc(100vh - 48px))" : void 0,
|
|
9785
9827
|
minHeight: wide && !roomy ? 420 : void 0,
|
|
9786
9828
|
margin: wide ? void 0 : "auto 0",
|
|
9787
9829
|
display: "flex",
|
|
@@ -9791,16 +9833,48 @@ function BookingDialog({
|
|
|
9791
9833
|
border: `1px solid ${t.border}`,
|
|
9792
9834
|
borderRadius: 14,
|
|
9793
9835
|
boxShadow: "0 24px 64px rgba(0,0,0,.35)",
|
|
9794
|
-
|
|
9836
|
+
// Stacked, the footer sticks to the bottom of the scrolling overlay,
|
|
9837
|
+
// which `overflow: hidden` here would cut off.
|
|
9838
|
+
overflow: wide ? "hidden" : "clip",
|
|
9795
9839
|
boxSizing: "border-box",
|
|
9796
9840
|
textAlign: "left",
|
|
9797
9841
|
lineHeight: 1.4
|
|
9798
9842
|
},
|
|
9799
9843
|
children: [
|
|
9800
9844
|
summary,
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9845
|
+
roomy ? /* @__PURE__ */ jsxs6("div", { style: { flex: "1 1 auto", minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
9846
|
+
/* @__PURE__ */ jsxs6(
|
|
9847
|
+
"div",
|
|
9848
|
+
{
|
|
9849
|
+
style: {
|
|
9850
|
+
flex: "1 1 auto",
|
|
9851
|
+
minHeight: 0,
|
|
9852
|
+
display: "flex",
|
|
9853
|
+
flexDirection: split ? "row" : "column",
|
|
9854
|
+
// A tablet-wide dialog stacks the two and scrolls them as one.
|
|
9855
|
+
overflowY: wide && !split ? "auto" : void 0
|
|
9856
|
+
},
|
|
9857
|
+
children: [
|
|
9858
|
+
details,
|
|
9859
|
+
/* @__PURE__ */ jsxs6(
|
|
9860
|
+
"div",
|
|
9861
|
+
{
|
|
9862
|
+
style: {
|
|
9863
|
+
flex: split ? "0 0 420px" : void 0,
|
|
9864
|
+
borderLeft: split ? `1px solid ${t.border}` : void 0,
|
|
9865
|
+
borderTop: split ? void 0 : `1px solid ${t.border}`,
|
|
9866
|
+
overflowY: split ? "auto" : void 0
|
|
9867
|
+
},
|
|
9868
|
+
children: [
|
|
9869
|
+
calendar,
|
|
9870
|
+
times
|
|
9871
|
+
]
|
|
9872
|
+
}
|
|
9873
|
+
)
|
|
9874
|
+
]
|
|
9875
|
+
}
|
|
9876
|
+
),
|
|
9877
|
+
footer
|
|
9804
9878
|
] }) : form,
|
|
9805
9879
|
!wide && credit
|
|
9806
9880
|
]
|
|
@@ -9824,19 +9898,6 @@ function primaryStyle(t, disabled) {
|
|
|
9824
9898
|
cursor: disabled ? "default" : "pointer"
|
|
9825
9899
|
};
|
|
9826
9900
|
}
|
|
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
9901
|
function Row({ icon, t, children }) {
|
|
9841
9902
|
return /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "flex-start", gap: 10, color: t.text, minWidth: 0 }, children: [
|
|
9842
9903
|
/* @__PURE__ */ jsx6("span", { style: { color: t.muted, flex: "0 0 auto", marginTop: 1 }, children: /* @__PURE__ */ jsx6(Icon, { name: icon }) }),
|
|
@@ -9926,40 +9987,38 @@ function Field({
|
|
|
9926
9987
|
value,
|
|
9927
9988
|
onChange,
|
|
9928
9989
|
type = "text",
|
|
9929
|
-
hint,
|
|
9930
9990
|
autoComplete,
|
|
9931
9991
|
inputMode,
|
|
9932
|
-
|
|
9992
|
+
error
|
|
9933
9993
|
}) {
|
|
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
9994
|
return /* @__PURE__ */ jsxs6("label", { style: { display: "block", fontSize: 13, fontWeight: 500, color: t.text }, children: [
|
|
9950
9995
|
label,
|
|
9951
|
-
|
|
9996
|
+
/* @__PURE__ */ jsx6(
|
|
9952
9997
|
"input",
|
|
9953
9998
|
{
|
|
9954
9999
|
type,
|
|
9955
10000
|
value,
|
|
9956
10001
|
autoComplete,
|
|
9957
10002
|
inputMode,
|
|
10003
|
+
"aria-invalid": Boolean(error),
|
|
9958
10004
|
onChange: (e) => onChange(e.target.value),
|
|
9959
|
-
style:
|
|
10005
|
+
style: {
|
|
10006
|
+
display: "block",
|
|
10007
|
+
width: "100%",
|
|
10008
|
+
boxSizing: "border-box",
|
|
10009
|
+
marginTop: 6,
|
|
10010
|
+
padding: "9px 12px",
|
|
10011
|
+
background: t.input,
|
|
10012
|
+
color: t.text,
|
|
10013
|
+
border: `1px solid ${error ? t.danger : t.border}`,
|
|
10014
|
+
borderRadius: 8,
|
|
10015
|
+
fontFamily: "inherit",
|
|
10016
|
+
fontSize: 14,
|
|
10017
|
+
outline: "none"
|
|
10018
|
+
}
|
|
9960
10019
|
}
|
|
9961
10020
|
),
|
|
9962
|
-
|
|
10021
|
+
error && /* @__PURE__ */ jsx6("div", { role: "alert", style: { marginTop: 6, fontSize: 12, fontWeight: 500, color: t.danger }, children: error })
|
|
9963
10022
|
] });
|
|
9964
10023
|
}
|
|
9965
10024
|
function PhoneField({
|
|
@@ -10264,7 +10323,7 @@ function GlitchgrabProviderInner({
|
|
|
10264
10323
|
return matchesIgnorePatterns(message, ignoreErrors);
|
|
10265
10324
|
};
|
|
10266
10325
|
const handleError = (event) => {
|
|
10267
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
10326
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
10268
10327
|
try {
|
|
10269
10328
|
const isOpaqueCrossOrigin = event.message === "Script error." || event.message === "Script error" || !event.error && !event.filename;
|
|
10270
10329
|
if (isOpaqueCrossOrigin) {
|
|
@@ -10303,11 +10362,12 @@ function GlitchgrabProviderInner({
|
|
|
10303
10362
|
visitedPages: JSON.stringify(context.visitedPages),
|
|
10304
10363
|
...contextMetadata(context),
|
|
10305
10364
|
filename: (_e = event.filename) != null ? _e : "",
|
|
10306
|
-
|
|
10307
|
-
|
|
10365
|
+
...originMetadata((_f = event.error) == null ? void 0 : _f.stack, event.filename),
|
|
10366
|
+
lineno: String((_g = event.lineno) != null ? _g : ""),
|
|
10367
|
+
colno: String((_h = event.colno) != null ? _h : ""),
|
|
10308
10368
|
// The root patch could not attach (React internals moved, or a
|
|
10309
10369
|
// root it does not know): still label it and send the DOM context.
|
|
10310
|
-
...isHydrationError((
|
|
10370
|
+
...isHydrationError((_i = event.error) != null ? _i : event.message) ? hydrationMetadata((_j = event.error) != null ? _j : event.message) : {},
|
|
10311
10371
|
...(session == null ? void 0 : session.userId) ? { sessionUserId: session.userId } : {},
|
|
10312
10372
|
...(session == null ? void 0 : session.name) ? { sessionUserName: String(session.name) } : {},
|
|
10313
10373
|
...(session == null ? void 0 : session.email) ? { sessionUserEmail: String(session.email) } : {},
|
|
@@ -10359,6 +10419,7 @@ function GlitchgrabProviderInner({
|
|
|
10359
10419
|
visitedPages: JSON.stringify(context.visitedPages),
|
|
10360
10420
|
...contextMetadata(context),
|
|
10361
10421
|
type: "unhandledrejection",
|
|
10422
|
+
...originMetadata(errStack),
|
|
10362
10423
|
...description.details ? { rejectionReason: description.details } : {},
|
|
10363
10424
|
...(session == null ? void 0 : session.userId) ? { sessionUserId: session.userId } : {},
|
|
10364
10425
|
...(session == null ? void 0 : session.name) ? { sessionUserName: String(session.name) } : {},
|