@bowlos/reservations 0.3.0 → 0.5.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.
Files changed (48) hide show
  1. package/README.md +34 -7
  2. package/dist/{chunk-4VDDL2CN.js → chunk-E5KVVXSJ.js} +15 -7
  3. package/dist/chunk-E5KVVXSJ.js.map +1 -0
  4. package/dist/{chunk-TCYTNCUL.js → chunk-YICHFUAY.js} +41 -3
  5. package/dist/chunk-YICHFUAY.js.map +1 -0
  6. package/dist/cli.cjs +74 -4
  7. package/dist/cli.cjs.map +1 -1
  8. package/dist/components.cjs +94 -60
  9. package/dist/components.cjs.map +1 -1
  10. package/dist/components.d.cts +41 -7
  11. package/dist/components.d.ts +41 -7
  12. package/dist/components.js +90 -21
  13. package/dist/components.js.map +1 -1
  14. package/dist/index.js +172 -4
  15. package/dist/index.js.map +1 -1
  16. package/dist/{react-B_8H7AyT.d.cts → react-7ruEsubp.d.cts} +5 -2
  17. package/dist/{react-bG9YV_xP.d.ts → react-Cb_NZCXa.d.ts} +5 -2
  18. package/dist/react.cjs +12 -3
  19. package/dist/react.cjs.map +1 -1
  20. package/dist/react.d.cts +2 -2
  21. package/dist/react.d.ts +2 -2
  22. package/dist/react.js +2 -3
  23. package/package.json +4 -3
  24. package/templates/center-site/README.md +85 -0
  25. package/templates/center-site/app/account/page.tsx +19 -0
  26. package/templates/center-site/app/book/checkout-form.tsx +85 -0
  27. package/templates/center-site/app/book/page.tsx +208 -0
  28. package/templates/center-site/app/flash/[slug]/page.tsx +24 -0
  29. package/templates/center-site/app/layout.tsx +21 -0
  30. package/templates/center-site/app/page.tsx +26 -0
  31. package/templates/center-site/app/providers.tsx +43 -0
  32. package/templates/center-site/app/site-header.tsx +30 -0
  33. package/templates/center-site/env.example +23 -0
  34. package/templates/center-site/gitignore +8 -0
  35. package/templates/center-site/lib/bowlos.ts +39 -0
  36. package/templates/center-site/next.config.mjs +8 -0
  37. package/templates/center-site/package.json +26 -0
  38. package/templates/center-site/tsconfig.json +38 -0
  39. package/dist/chunk-4VDDL2CN.js.map +0 -1
  40. package/dist/chunk-T5DDHWEC.js +0 -174
  41. package/dist/chunk-T5DDHWEC.js.map +0 -1
  42. package/dist/chunk-TCYTNCUL.js.map +0 -1
  43. package/dist/chunk-TZTFJVDI.js +0 -41
  44. package/dist/chunk-TZTFJVDI.js.map +0 -1
  45. package/dist/cli.d.cts +0 -1
  46. package/dist/cli.d.ts +0 -1
  47. package/dist/cli.js +0 -106
  48. package/dist/cli.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
3
  import { q as PricingMode, P as PaymentIntentInfo, o as Customer } from './data-DrM0D6Pi.cjs';
4
- import { c as UseAccountResult } from './react-B_8H7AyT.cjs';
4
+ import { c as UseAccountResult } from './react-7ruEsubp.cjs';
5
5
 
6
6
  /**
7
7
  * Themeable design tokens for the `@bowlos/reservations/components` layer.
@@ -61,11 +61,15 @@ interface BookingFlowLabels {
61
61
  releaseHold: string;
62
62
  heldHeading: string;
63
63
  heldBody: string;
64
+ securing: string;
64
65
  paymentHeading: string;
65
66
  confirmedHeading: string;
66
67
  confirmationLabel: string;
67
68
  bookAnother: string;
68
69
  checkingAvailability: string;
70
+ bookingAs: string;
71
+ notYou: string;
72
+ signInHint: string;
69
73
  }
70
74
  interface BookingFlowProps {
71
75
  centerId: string;
@@ -97,16 +101,26 @@ interface BookingFlowProps {
97
101
  singular: string;
98
102
  plural: string;
99
103
  };
104
+ /**
105
+ * Online reservations are pay-to-confirm: after the customer books, the hold
106
+ * advances straight to payment with no "you've placed a hold" intermission
107
+ * (the inventory hold stays internal and just expires if they bail). Default
108
+ * `true`. Set `false` to expose the explicit "Reserve → Continue to payment"
109
+ * two-step instead.
110
+ */
111
+ completeSaleOnly?: boolean;
112
+ /** Where the "Not you?" / "Sign in" links go (e.g. "/account"). */
113
+ accountHref?: string;
100
114
  labels?: Partial<BookingFlowLabels>;
101
115
  className?: string;
102
116
  }
103
117
  /**
104
- * A complete, themeable booking widget: availability + price → reserve (hold) →
105
- * pay (your Stripe slot) → confirm. Built on `useBookingFlow`. Must render
106
- * inside a `<BowlosProvider>`; theme it with `<BowlosTheme>` or `--bowlos-*` CSS
107
- * vars. White-label by design — no BowlOS branding.
118
+ * A complete, themeable booking widget: availability + price → book → pay (your
119
+ * Stripe slot) → confirm. Account-aware (hides Name/Email and books as the
120
+ * signed-in customer) and pay-to-confirm by default. Built on `useBookingFlow`.
121
+ * Must render inside a `<BowlosProvider>`; theme with `<BowlosTheme>`. White-label.
108
122
  */
109
- declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
123
+ declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, completeSaleOnly, accountHref, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
110
124
 
111
125
  /** Visible strings — override any subset for copy/i18n. */
112
126
  interface AuthGateLabels {
@@ -163,6 +177,26 @@ interface AuthGateProps {
163
177
  */
164
178
  declare function AuthGate({ children, labels, className }: AuthGateProps): react_jsx_runtime.JSX.Element;
165
179
 
180
+ /** Visible strings — override for copy/i18n. */
181
+ interface AccountMenuLabels {
182
+ signIn: string;
183
+ signOut: string;
184
+ loading: string;
185
+ }
186
+ interface AccountMenuProps {
187
+ /** Where the signed-in name and the "Sign in" link point. Default "/account". */
188
+ accountHref?: string;
189
+ labels?: Partial<AccountMenuLabels>;
190
+ className?: string;
191
+ }
192
+ /**
193
+ * A drop-in header login indicator. Reads the **shared** session, so it appears
194
+ * the same on every page and updates instantly when the customer signs in or out
195
+ * anywhere. Signed out → a "Sign in" link; signed in → the customer's first name
196
+ * (linking to their account) + a Sign out action. Theme with `<BowlosTheme>`.
197
+ */
198
+ declare function AccountMenu({ accountHref, labels, className }: AccountMenuProps): react_jsx_runtime.JSX.Element;
199
+
166
200
  interface MyReservationSummary {
167
201
  id: string;
168
202
  displayId: string;
@@ -350,4 +384,4 @@ declare function formatCents(cents: number): string;
350
384
  /** A min–max money range, collapsing to one value when they're equal. */
351
385
  declare function formatCentsRange(minCents: number, maxCents: number): string;
352
386
 
353
- export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, type FlashBrand, FlashSale, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
387
+ export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, type FlashBrand, FlashSale, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
3
  import { q as PricingMode, P as PaymentIntentInfo, o as Customer } from './data-DrM0D6Pi.js';
4
- import { c as UseAccountResult } from './react-bG9YV_xP.js';
4
+ import { c as UseAccountResult } from './react-Cb_NZCXa.js';
5
5
 
6
6
  /**
7
7
  * Themeable design tokens for the `@bowlos/reservations/components` layer.
@@ -61,11 +61,15 @@ interface BookingFlowLabels {
61
61
  releaseHold: string;
62
62
  heldHeading: string;
63
63
  heldBody: string;
64
+ securing: string;
64
65
  paymentHeading: string;
65
66
  confirmedHeading: string;
66
67
  confirmationLabel: string;
67
68
  bookAnother: string;
68
69
  checkingAvailability: string;
70
+ bookingAs: string;
71
+ notYou: string;
72
+ signInHint: string;
69
73
  }
70
74
  interface BookingFlowProps {
71
75
  centerId: string;
@@ -97,16 +101,26 @@ interface BookingFlowProps {
97
101
  singular: string;
98
102
  plural: string;
99
103
  };
104
+ /**
105
+ * Online reservations are pay-to-confirm: after the customer books, the hold
106
+ * advances straight to payment with no "you've placed a hold" intermission
107
+ * (the inventory hold stays internal and just expires if they bail). Default
108
+ * `true`. Set `false` to expose the explicit "Reserve → Continue to payment"
109
+ * two-step instead.
110
+ */
111
+ completeSaleOnly?: boolean;
112
+ /** Where the "Not you?" / "Sign in" links go (e.g. "/account"). */
113
+ accountHref?: string;
100
114
  labels?: Partial<BookingFlowLabels>;
101
115
  className?: string;
102
116
  }
103
117
  /**
104
- * A complete, themeable booking widget: availability + price → reserve (hold) →
105
- * pay (your Stripe slot) → confirm. Built on `useBookingFlow`. Must render
106
- * inside a `<BowlosProvider>`; theme it with `<BowlosTheme>` or `--bowlos-*` CSS
107
- * vars. White-label by design — no BowlOS branding.
118
+ * A complete, themeable booking widget: availability + price → book → pay (your
119
+ * Stripe slot) → confirm. Account-aware (hides Name/Email and books as the
120
+ * signed-in customer) and pay-to-confirm by default. Built on `useBookingFlow`.
121
+ * Must render inside a `<BowlosProvider>`; theme with `<BowlosTheme>`. White-label.
108
122
  */
109
- declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
123
+ declare function BookingFlow({ centerId, productId, pricingMode, durationMinutes, defaultDateISO, defaultStartMinuteOfDay, renderPayment, onConfirmed, unitLabel, completeSaleOnly, accountHref, labels, className, }: BookingFlowProps): react_jsx_runtime.JSX.Element;
110
124
 
111
125
  /** Visible strings — override any subset for copy/i18n. */
112
126
  interface AuthGateLabels {
@@ -163,6 +177,26 @@ interface AuthGateProps {
163
177
  */
164
178
  declare function AuthGate({ children, labels, className }: AuthGateProps): react_jsx_runtime.JSX.Element;
165
179
 
180
+ /** Visible strings — override for copy/i18n. */
181
+ interface AccountMenuLabels {
182
+ signIn: string;
183
+ signOut: string;
184
+ loading: string;
185
+ }
186
+ interface AccountMenuProps {
187
+ /** Where the signed-in name and the "Sign in" link point. Default "/account". */
188
+ accountHref?: string;
189
+ labels?: Partial<AccountMenuLabels>;
190
+ className?: string;
191
+ }
192
+ /**
193
+ * A drop-in header login indicator. Reads the **shared** session, so it appears
194
+ * the same on every page and updates instantly when the customer signs in or out
195
+ * anywhere. Signed out → a "Sign in" link; signed in → the customer's first name
196
+ * (linking to their account) + a Sign out action. Theme with `<BowlosTheme>`.
197
+ */
198
+ declare function AccountMenu({ accountHref, labels, className }: AccountMenuProps): react_jsx_runtime.JSX.Element;
199
+
166
200
  interface MyReservationSummary {
167
201
  id: string;
168
202
  displayId: string;
@@ -350,4 +384,4 @@ declare function formatCents(cents: number): string;
350
384
  /** A min–max money range, collapsing to one value when they're equal. */
351
385
  declare function formatCentsRange(minCents: number, maxCents: number): string;
352
386
 
353
- export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, type FlashBrand, FlashSale, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
387
+ export { AccountDashboard, type AccountDashboardLabels, type AccountDashboardProps, AccountMenu, type AccountMenuLabels, type AccountMenuProps, type AccountSection, AuthForm, AuthGate, type AuthGateLabels, type AuthGateProps, type AuthGateRenderContext, BOWLOS_DEFAULT_THEME, BookingFlow, type BookingFlowLabels, type BookingFlowProps, BowlosTheme, type BowlosThemeTokens, type FlashBrand, FlashSale, type FlashSaleItem, type FlashSaleLabels, type FlashSaleProps, type FlashSaleView, type MyCreditEntry, type MyCredits, type MyLoyalty, type MyMembershipSummary, type MyPass, type MyReservationSummary, formatCents, formatCentsRange };
@@ -1,6 +1,5 @@
1
- import { useAvailability, useBookingPreview, useBookingFlow, useAccount, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale } from './chunk-4VDDL2CN.js';
2
- import { availableUnitCount } from './chunk-TZTFJVDI.js';
3
- import './chunk-TCYTNCUL.js';
1
+ import { useAccount, useAvailability, useBookingPreview, useBookingFlow, useMyReservations, useMyMemberships, useMyLoyalty, useMyCredits, useMyPasses, useFlashSale } from './chunk-E5KVVXSJ.js';
2
+ import { availableUnitCount } from './chunk-YICHFUAY.js';
4
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
4
  import { useState, useRef, useEffect, useMemo } from 'react';
6
5
 
@@ -221,19 +220,23 @@ var DEFAULT_LABELS = {
221
220
  quantity: "Quantity",
222
221
  name: "Name",
223
222
  email: "Email",
224
- hold: "Reserve",
225
- holding: "Reserving\u2026",
223
+ hold: "Book",
224
+ holding: "Booking\u2026",
226
225
  continueToPayment: "Continue to payment",
227
226
  preparing: "Preparing\u2026",
228
227
  cancel: "Cancel",
229
228
  releaseHold: "Release hold",
230
- heldHeading: "Reserved",
229
+ heldHeading: "Almost there",
231
230
  heldBody: "We're holding your spot for a few minutes. Continue to payment to confirm.",
231
+ securing: "Securing your spot\u2026",
232
232
  paymentHeading: "Payment",
233
233
  confirmedHeading: "You're booked",
234
234
  confirmationLabel: "Confirmation",
235
235
  bookAnother: "Book another",
236
- checkingAvailability: "Checking availability\u2026"
236
+ checkingAvailability: "Checking availability\u2026",
237
+ bookingAs: "Booking as {name}",
238
+ notYou: "Not you?",
239
+ signInHint: "Sign in to book faster"
237
240
  };
238
241
  function BookingFlow({
239
242
  centerId,
@@ -245,10 +248,16 @@ function BookingFlow({
245
248
  renderPayment,
246
249
  onConfirmed,
247
250
  unitLabel = { singular: "lane", plural: "lanes" },
251
+ completeSaleOnly = true,
252
+ accountHref,
248
253
  labels,
249
254
  className
250
255
  }) {
251
256
  const t = { ...DEFAULT_LABELS, ...labels };
257
+ const account = useAccount();
258
+ const signedIn = account.status === "linked" && account.customer !== null;
259
+ const acctName = account.customer?.fullName ?? "";
260
+ const acctEmail = account.customer?.email ?? "";
252
261
  const [dateISO, setDateISO] = useState(defaultDateISO);
253
262
  const [startMinuteOfDay, setStartMinuteOfDay] = useState(defaultStartMinuteOfDay);
254
263
  const endMinuteOfDay = startMinuteOfDay + durationMinutes;
@@ -272,6 +281,13 @@ function BookingFlow({
272
281
  onConfirmedRef.current?.(flow.reservation);
273
282
  }
274
283
  }, [flow.status, flow.reservation]);
284
+ const prepareRef = useRef(flow.preparePayment);
285
+ prepareRef.current = flow.preparePayment;
286
+ useEffect(() => {
287
+ if (completeSaleOnly && flow.status === "held") {
288
+ void prepareRef.current();
289
+ }
290
+ }, [completeSaleOnly, flow.status]);
275
291
  const bookingArgs = useMemo(
276
292
  () => ({
277
293
  centerId,
@@ -281,9 +297,9 @@ function BookingFlow({
281
297
  endMinuteOfDay,
282
298
  mode: pricingMode,
283
299
  units,
284
- customer: { fullName, email, marketingOptIn: false }
300
+ customer: signedIn ? { fullName: acctName, email: acctEmail, marketingOptIn: false } : { fullName, email, marketingOptIn: false }
285
301
  }),
286
- [centerId, productId, dateISO, startMinuteOfDay, endMinuteOfDay, pricingMode, units, fullName, email]
302
+ [centerId, productId, dateISO, startMinuteOfDay, endMinuteOfDay, pricingMode, units, signedIn, acctName, acctEmail, fullName, email]
287
303
  );
288
304
  const freeUnits = availability.data ? availableUnitCount(availability.data) : null;
289
305
  const quoteCents = preview.data?.totalCentsPerPlan?.[0]?.totalCents ?? null;
@@ -316,6 +332,13 @@ function BookingFlow({
316
332
  ] });
317
333
  }
318
334
  if (flow.status === "held" || flow.status === "preparingPayment") {
335
+ if (completeSaleOnly) {
336
+ return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
337
+ /* @__PURE__ */ jsx("h3", { style: s.heading, children: t.heldHeading }),
338
+ /* @__PURE__ */ jsx("p", { style: s.body, children: t.securing }),
339
+ flow.error && /* @__PURE__ */ jsx("p", { style: s.error, children: flow.error.code })
340
+ ] });
341
+ }
319
342
  const preparing = flow.status === "preparingPayment";
320
343
  return /* @__PURE__ */ jsxs("div", { className, style: s.card, children: [
321
344
  /* @__PURE__ */ jsx("h3", { style: s.heading, children: t.heldHeading }),
@@ -363,19 +386,36 @@ function BookingFlow({
363
386
  }
364
387
  )
365
388
  ] }),
366
- /* @__PURE__ */ jsxs("label", { style: s.label, children: [
367
- t.name,
368
- /* @__PURE__ */ jsx("input", { value: fullName, onChange: (e) => setFullName(e.target.value), style: s.input, required: true })
369
- ] }),
370
- /* @__PURE__ */ jsxs("label", { style: s.label, children: [
371
- t.email,
372
- /* @__PURE__ */ jsx("input", { type: "email", value: email, onChange: (e) => setEmail(e.target.value), style: s.input, required: true })
389
+ signedIn ? /* @__PURE__ */ jsxs("p", { style: s.meta, children: [
390
+ t.bookingAs.replace("{name}", acctName),
391
+ accountHref ? /* @__PURE__ */ jsxs(Fragment, { children: [
392
+ " \xB7 ",
393
+ /* @__PURE__ */ jsx("a", { href: accountHref, style: s.linkBtn, children: t.notYou })
394
+ ] }) : null
395
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
396
+ /* @__PURE__ */ jsxs("label", { style: s.label, children: [
397
+ t.name,
398
+ /* @__PURE__ */ jsx("input", { value: fullName, onChange: (e) => setFullName(e.target.value), style: s.input, required: true })
399
+ ] }),
400
+ /* @__PURE__ */ jsxs("label", { style: s.label, children: [
401
+ t.email,
402
+ /* @__PURE__ */ jsx("input", { type: "email", value: email, onChange: (e) => setEmail(e.target.value), style: s.input, required: true })
403
+ ] }),
404
+ accountHref ? /* @__PURE__ */ jsx("a", { href: accountHref, style: s.linkBtn, children: t.signInHint }) : null
373
405
  ] }),
374
406
  /* @__PURE__ */ jsxs("p", { style: s.meta, "aria-live": "polite", children: [
375
407
  dateISO === "" ? "" : availability.loading ? t.checkingAvailability : freeUnits !== null ? `${freeUnits} ${freeUnits === 1 ? unitLabel.singular : unitLabel.plural} available` : availability.error ? availability.error.code : "",
376
408
  quoteCents !== null ? ` \xB7 ${formatCents(quoteCents)}` : ""
377
409
  ] }),
378
- /* @__PURE__ */ jsx("button", { type: "submit", style: s.primaryBtn, disabled: holding || !fullName || !email || dateISO === "", children: holding ? t.holding : `${t.hold} ${unitNoun}` }),
410
+ /* @__PURE__ */ jsx(
411
+ "button",
412
+ {
413
+ type: "submit",
414
+ style: s.primaryBtn,
415
+ disabled: holding || dateISO === "" || !signedIn && (!fullName || !email),
416
+ children: holding ? t.holding : `${t.hold} ${unitNoun}`
417
+ }
418
+ ),
379
419
  flow.error && /* @__PURE__ */ jsxs("p", { style: s.error, children: [
380
420
  flow.error.code,
381
421
  " \u2014 ",
@@ -509,6 +549,35 @@ function AuthGate({ children, labels, className }) {
509
549
  return /* @__PURE__ */ jsx(AuthForm, { account, labels, className });
510
550
  }
511
551
  var DEFAULT_LABELS3 = {
552
+ signIn: "Sign in",
553
+ signOut: "Sign out",
554
+ loading: "\u2026"
555
+ };
556
+ function AccountMenu({ accountHref = "/account", labels, className }) {
557
+ const t = { ...DEFAULT_LABELS3, ...labels };
558
+ const account = useAccount();
559
+ const s = styles();
560
+ const wrap = {
561
+ display: "inline-flex",
562
+ alignItems: "center",
563
+ gap: "0.625rem",
564
+ fontFamily: token("fontFamily"),
565
+ fontSize: "0.9rem",
566
+ color: token("colorText")
567
+ };
568
+ if (account.status === "loading") {
569
+ return /* @__PURE__ */ jsx("span", { className, style: wrap, children: /* @__PURE__ */ jsx("span", { style: s.muted, children: t.loading }) });
570
+ }
571
+ if (account.status === "linked" && account.customer) {
572
+ const first = account.customer.fullName.split(" ")[0] || account.customer.fullName;
573
+ return /* @__PURE__ */ jsxs("span", { className, style: wrap, children: [
574
+ /* @__PURE__ */ jsx("a", { href: accountHref, style: s.linkBtn, children: first }),
575
+ /* @__PURE__ */ jsx("button", { type: "button", style: s.linkBtn, onClick: () => void account.signOut(), children: t.signOut })
576
+ ] });
577
+ }
578
+ return /* @__PURE__ */ jsx("a", { className, href: accountHref, style: { ...wrap, ...s.linkBtn }, children: t.signIn });
579
+ }
580
+ var DEFAULT_LABELS4 = {
512
581
  welcome: "Welcome, {name}",
513
582
  signOut: "Sign out",
514
583
  reservations: "Reservations",
@@ -552,7 +621,7 @@ function Dashboard({
552
621
  customerName,
553
622
  onSignOut
554
623
  }) {
555
- const t = { ...DEFAULT_LABELS3, ...labels };
624
+ const t = { ...DEFAULT_LABELS4, ...labels };
556
625
  const s = styles();
557
626
  const show = (k) => sections.includes(k);
558
627
  const reservations = useMyReservations(
@@ -669,7 +738,7 @@ function formatDate(value) {
669
738
  if (Number.isNaN(d.getTime())) return String(value);
670
739
  return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
671
740
  }
672
- var DEFAULT_LABELS4 = {
741
+ var DEFAULT_LABELS5 = {
673
742
  loading: "Loading\u2026",
674
743
  unavailable: "This flash sale isn\u2019t available.",
675
744
  ended: "This flash sale has ended.",
@@ -680,7 +749,7 @@ var DEFAULT_LABELS4 = {
680
749
  saleEnded: "Sale ended"
681
750
  };
682
751
  function FlashSale({ slug, onBook, labels, className }) {
683
- const t = { ...DEFAULT_LABELS4, ...labels };
752
+ const t = { ...DEFAULT_LABELS5, ...labels };
684
753
  const account = useAccount();
685
754
  const sale = useFlashSale({ slug });
686
755
  const s = styles();
@@ -760,6 +829,6 @@ function Hero({
760
829
  ] });
761
830
  }
762
831
 
763
- export { AccountDashboard, AuthForm, AuthGate, BOWLOS_DEFAULT_THEME, BookingFlow, BowlosTheme, FlashSale, formatCents, formatCentsRange };
832
+ export { AccountDashboard, AccountMenu, AuthForm, AuthGate, BOWLOS_DEFAULT_THEME, BookingFlow, BowlosTheme, FlashSale, formatCents, formatCentsRange };
764
833
  //# sourceMappingURL=components.js.map
765
834
  //# sourceMappingURL=components.js.map