@tribe-nest/forge 3.64.0 → 3.67.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 (40) hide show
  1. package/package.json +1 -1
  2. package/src/data/queries/useCoachingAvailability.ts +18 -6
  3. package/src/data/queries/useMyBookings.ts +7 -0
  4. package/src/data/queries/useWebsite.ts +42 -11
  5. package/src/data/queries/useWebsiteAgent.ts +136 -6
  6. package/src/i18n/de.json +63 -0
  7. package/src/i18n/en.json +63 -0
  8. package/src/provider/ForgeProvider.tsx +7 -1
  9. package/src/types/models.ts +13 -0
  10. package/src/ui/format/_tests/ticketPrice.spec.ts +58 -0
  11. package/src/ui/format/bookingPricing.ts +55 -0
  12. package/src/ui/format/ticketPrice.ts +52 -0
  13. package/src/ui/headless/agent/_tests/callChallenge.spec.ts +85 -0
  14. package/src/ui/headless/agent/_tests/useAgentCall.spec.tsx +213 -0
  15. package/src/ui/headless/agent/callChallenge.ts +72 -0
  16. package/src/ui/headless/agent/useAgentCall.ts +189 -0
  17. package/src/ui/headless/agent/useAgentCallRoom.ts +113 -0
  18. package/src/ui/headless/agent/useAiAgent.ts +8 -20
  19. package/src/ui/headless/agent/visitorId.ts +20 -0
  20. package/src/ui/headless/coaching/useCoachingBooking.ts +139 -13
  21. package/src/ui/index.ts +24 -0
  22. package/src/ui/styled/AccountDashboard.tsx +11 -3
  23. package/src/ui/styled/AiAgentCallRoom.tsx +76 -0
  24. package/src/ui/styled/AiAgentWidget.tsx +276 -21
  25. package/src/ui/styled/BookingPriceSummary.tsx +57 -0
  26. package/src/ui/styled/CoachingBooking.tsx +36 -158
  27. package/src/ui/styled/CoachingConfirmation.tsx +13 -2
  28. package/src/ui/styled/CoachingDetail.tsx +8 -2
  29. package/src/ui/styled/CoachingSlotPicker.tsx +874 -0
  30. package/src/ui/styled/CookieConsent.tsx +13 -9
  31. package/src/ui/styled/EventDetail.tsx +29 -6
  32. package/src/ui/styled/EventTickets.tsx +35 -11
  33. package/src/ui/styled/MusicLinkPage.tsx +6 -3
  34. package/src/ui/styled/_tests/CoachingMultiSession.spec.tsx +299 -0
  35. package/src/ui/styled/_tests/FreeTickets.spec.tsx +242 -0
  36. package/src/ui/styled/broadcast/BroadcastTicketPurchase.tsx +18 -4
  37. package/src/ui/styled/forge-utilities.css +0 -5
  38. package/src/ui/styled/seating/EventSeatPicker.tsx +2 -0
  39. package/src/ui/styled/seating/SeatLegend.tsx +3 -1
  40. package/src/utils/structuredData.ts +4 -1
@@ -158,14 +158,25 @@ export function CoachingConfirmation({
158
158
  <div className="cf-rise" style={{ padding: "28px 32px 12px", animationDelay: "0.38s" }}>
159
159
  {data && (
160
160
  <dl style={{ display: "grid", gridTemplateColumns: "1fr auto", rowGap: 14, columnGap: 16, margin: 0 }}>
161
- {data.sessionStartTime && (
161
+ {data.sessions && data.sessions.length > 1 ? (
162
+ // A package or several sessions: every time the buyer committed to.
163
+ data.sessions.map((session, index) => (
164
+ <ConfirmationRow
165
+ key={session.startTime}
166
+ label={t("forge.coaching_confirmation.row_session_n", { index: index + 1, count: data.sessions!.length })}
167
+ value={formatSession(session.startTime)}
168
+ accent
169
+ strong={index === 0}
170
+ />
171
+ ))
172
+ ) : data.sessionStartTime ? (
162
173
  <ConfirmationRow
163
174
  label={t("forge.coaching_confirmation.row_session")}
164
175
  value={formatSession(data.sessionStartTime)}
165
176
  accent
166
177
  strong
167
178
  />
168
- )}
179
+ ) : null}
169
180
  {data.durationMinutes ? (
170
181
  <ConfirmationRow
171
182
  label={t("forge.coaching_confirmation.row_duration")}
@@ -1,3 +1,5 @@
1
+ import { BookingPriceSummary } from "./BookingPriceSummary";
2
+ import { bookingGrossAmount, bookingSessionRange } from "../format/bookingPricing";
1
3
  import { Clock } from "lucide-react";
2
4
  import type { CoachingProduct } from "../../types/models";
3
5
  import { useGetCoachingProduct } from "../../data/queries/useCoachingProducts";
@@ -43,7 +45,11 @@ export function CoachingDetail({
43
45
  const fmt = useAmountFormatter(formatAmount);
44
46
  const pricesIncludeTax = usePricesIncludeTax();
45
47
  const { data: product, isLoading } = useGetCoachingProduct(slug, { initialData: initialCoaching });
46
- useMetaViewContent(product ? { id: product.id, name: product.title, value: product.price } : null);
48
+ useMetaViewContent(
49
+ product
50
+ ? { id: product.id, name: product.title, value: bookingGrossAmount(product, bookingSessionRange(product).min) }
51
+ : null,
52
+ );
47
53
 
48
54
  if (isLoading) return <Loading fullPage />;
49
55
  if (!product) return <p>{t("forge.coaching_detail.not_found")}</p>;
@@ -93,7 +99,7 @@ export function CoachingDetail({
93
99
  }}
94
100
  >
95
101
  <span style={{ fontWeight: 600 }}>
96
- <PriceDisplay amount={Number(product.price)} pricesIncludeTax={pricesIncludeTax} formatAmount={fmt} mutedColor={tokens.text} captionStyle={{ opacity: 0.65 }} />
102
+ <BookingPriceSummary product={product} fmt={fmt} pricesIncludeTax={pricesIncludeTax} mutedColor={tokens.text} />
97
103
  </span>
98
104
  <CoachingBooking slug={slug} formatAmount={fmt} finalisePath={finalisePath} onComplete={onComplete} />
99
105
  {/* S.6 — next to the price and the button, so the terms are readable