@burdenoff/microfe-eventfullymanaged 2026.716.1 → 2026.719.2

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 (26) hide show
  1. package/README.md +15 -0
  2. package/dist/eventfullymanaged/api/eventApi.d.ts +40 -0
  3. package/dist/eventfullymanaged/api/eventApi.d.ts.map +1 -1
  4. package/dist/eventfullymanaged/api/eventApi.js +147 -117
  5. package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
  6. package/dist/eventfullymanaged/pages/events/SessionFormPage.d.ts.map +1 -1
  7. package/dist/eventfullymanaged/pages/events/SessionFormPage.js +152 -135
  8. package/dist/eventfullymanaged/pages/events/SessionFormPage.js.map +1 -1
  9. package/dist/eventfullymanaged/pages/modules/AnalyticsPage.d.ts.map +1 -1
  10. package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js +154 -117
  11. package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js.map +1 -1
  12. package/dist/eventfullymanaged/pages/modules/CommunicationPage.d.ts.map +1 -1
  13. package/dist/eventfullymanaged/pages/modules/CommunicationPage.js +228 -187
  14. package/dist/eventfullymanaged/pages/modules/CommunicationPage.js.map +1 -1
  15. package/dist/eventfullymanaged/pages/modules/EventsPage.d.ts.map +1 -1
  16. package/dist/eventfullymanaged/pages/modules/EventsPage.js +233 -122
  17. package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
  18. package/dist/eventfullymanaged/pages/registration/RegisterAttendeePage.d.ts.map +1 -1
  19. package/dist/eventfullymanaged/pages/registration/RegisterAttendeePage.js +255 -254
  20. package/dist/eventfullymanaged/pages/registration/RegisterAttendeePage.js.map +1 -1
  21. package/dist/eventfullymanaged/types/index.d.ts.map +1 -1
  22. package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -1
  23. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  24. package/dist/test/setup.d.ts +11 -0
  25. package/dist/test/setup.d.ts.map +1 -0
  26. package/package.json +11 -3
@@ -1,11 +1,11 @@
1
1
  import { useEventfullyManaged as e } from "../../context/EventfullyManagedContext.js";
2
2
  import { notify as t } from "../../lib/toast.js";
3
- import { useAttendeesQuery as n, useCreateAttendeeMutation as r, useCreateRegistrationMutation as i, useEventsQuery as a, usePromoCodesQuery as ee, useTicketTypesQuery as te } from "../../api/eventApi.js";
4
- import { describeError as ne, mutationSucceeded as re } from "../../lib/mutationResult.js";
5
- import { computeDiscount as ie, describeDiscount as ae, formatMoney as o } from "../../lib/format.js";
6
- import { useMemo as s, useState as c } from "react";
7
- import { Fragment as oe, jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { ArrowLeft as d, ArrowRight as se, BadgePercent as ce, CalendarDays as le, Check as f, CheckCircle2 as ue, Minus as de, Plus as fe, Ticket as p, UserRound as pe } from "lucide-react";
3
+ import { useAttendeesQuery as n, useCreateAttendeeMutation as r, useCreateRegistrationMutation as i, useEventsQuery as a, usePromoCodesQuery as o, useTicketTypesQuery as ee } from "../../api/eventApi.js";
4
+ import { describeError as te, mutationSucceeded as ne } from "../../lib/mutationResult.js";
5
+ import { computeDiscount as re, describeDiscount as ie, formatMoney as s } from "../../lib/format.js";
6
+ import { useMemo as c, useState as l } from "react";
7
+ import { Fragment as ae, jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import { ArrowLeft as f, ArrowRight as oe, BadgePercent as se, CalendarDays as ce, Check as le, CheckCircle2 as ue, Minus as de, Plus as fe, Ticket as p, UserRound as pe } from "lucide-react";
9
9
  import { Button as m, GlassCard as h, GradientText as me, Input as g, PagePurpose as he, Select as ge, SelectContent as _e, SelectItem as ve, SelectTrigger as ye, SelectValue as be, Stepper as xe } from "@burdenoff/fe-libs/ui";
10
10
  //#region src/eventfullymanaged/pages/registration/RegisterAttendeePage.tsx
11
11
  var _ = [
@@ -31,38 +31,38 @@ var _ = [
31
31
  }
32
32
  ];
33
33
  function v() {
34
- let { navigate: v } = e(), [y, b] = c(0), [x, Se] = c(""), [S, C] = c(""), [w, T] = c("new"), [E, D] = c(""), [O, k] = c(""), [A, j] = c(""), [Ce, we] = c(""), [Te, Ee] = c(""), [De, M] = c(1), [N, P] = c(""), [F, I] = c(null), [Oe, L] = c(""), [R, ke] = c(""), [z, B] = c(null), { data: Ae, loading: je } = a({
34
+ let { navigate: v } = e(), [y, b] = l(0), [x, S] = l(""), [C, w] = l(""), [T, E] = l("new"), [D, O] = l(""), [k, Se] = l(""), [A, Ce] = l(""), [we, Te] = l(""), [Ee, j] = l(""), [De, M] = l(1), [N, P] = l(""), [F, I] = l(null), [Oe, L] = l(""), [R, ke] = l(""), [z, Ae] = l(null), { data: je, loading: Me } = a({
35
35
  limit: 100,
36
36
  offset: 0
37
- }), { data: Me, loading: Ne } = te({
37
+ }), { data: Ne, loading: Pe } = ee({
38
38
  eventId: x || void 0,
39
39
  limit: 100,
40
40
  offset: 0
41
- }), { data: Pe } = n({
41
+ }), { data: Fe } = n({
42
42
  eventId: x || void 0,
43
43
  limit: 100,
44
44
  offset: 0
45
- }), { data: Fe } = ee({
45
+ }), { data: Ie } = o({
46
46
  eventId: x || void 0,
47
47
  limit: 100,
48
48
  offset: 0
49
- }), V = s(() => Ae?.events.items ?? [], [Ae]), H = s(() => (Me?.ticketTypes.items ?? []).filter((e) => (!x || e.eventId === x) && e.isActive), [Me, x]), U = s(() => (Pe?.attendees.items ?? []).filter((e) => !x || e.eventId === x), [Pe, x]), W = s(() => (Fe?.promoCodes.items ?? []).filter((e) => e.isActive && (!x || e.eventId === x)), [Fe, x]), [Ie, { loading: Le }] = r(), [Re, { loading: ze }] = i(), G = Le || ze, K = s(() => V.find((e) => e.id === x), [V, x]), q = s(() => H.find((e) => e.id === S), [H, S]), J = s(() => U.find((e) => e.id === E), [U, E]), Y = Math.max(1, De), Be = q ? Number(q.price) : 0, X = q?.currency ?? "USD", Z = Number.isFinite(Be) ? Be * Y : 0, Q = F ? ie(Z, F.discountType, Number(F.discountValue)) : 0, Ve = Math.max(Z - Q, 0), $ = Z > 0, He = w === "existing" ? J?.fullName ?? "" : O.trim(), Ue = (e) => {
50
- Se(e), C(""), T("new"), D(""), I(null), P(""), L("");
51
- }, We = (e) => {
49
+ }), B = c(() => je?.events.items ?? [], [je]), V = c(() => (Ne?.ticketTypes.items ?? []).filter((e) => (!x || e.eventId === x) && e.isActive), [Ne, x]), H = c(() => (Fe?.attendees.items ?? []).filter((e) => !x || e.eventId === x), [Fe, x]), U = c(() => (Ie?.promoCodes.items ?? []).filter((e) => e.isActive && (!x || e.eventId === x)), [Ie, x]), [Le, { loading: Re }] = r(), [ze, { loading: Be }] = i(), W = Re || Be, G = c(() => B.find((e) => e.id === x), [B, x]), K = c(() => V.find((e) => e.id === C), [V, C]), q = c(() => H.find((e) => e.id === D), [H, D]), J = Math.max(1, De), Ve = K ? Number(K.price) : 0, Y = K?.currency ?? "USD", X = Number.isFinite(Ve) ? Ve * J : 0, Z = F ? re(X, F.discountType, Number(F.discountValue)) : 0, He = Math.max(X - Z, 0), Q = X > 0, Ue = T === "existing" ? q?.fullName ?? "" : k.trim(), We = (e) => {
50
+ S(e), w(""), E("new"), O(""), I(null), P(""), L("");
51
+ }, Ge = (e) => {
52
52
  switch (e) {
53
53
  case 0: return !!x;
54
- case 1: return !!S;
55
- case 2: return w === "existing" ? !!E : !!(O.trim() && A.trim());
54
+ case 1: return !!C;
55
+ case 2: return T === "existing" ? !!D : !!(k.trim() && A.trim());
56
56
  default: return !0;
57
57
  }
58
- }, Ge = (e) => {
58
+ }, Ke = (e) => {
59
59
  if (e <= y) return !0;
60
- for (let t = 0; t < e; t += 1) if (!We(t)) return !1;
60
+ for (let t = 0; t < e; t += 1) if (!Ge(t)) return !1;
61
61
  return !0;
62
- }, Ke = (e) => {
63
- Ge(e) && b(e);
64
- }, qe = () => {
65
- if (!We(y)) {
62
+ }, qe = (e) => {
63
+ Ke(e) && b(e);
64
+ }, Je = () => {
65
+ if (!Ge(y)) {
66
66
  t.error("One more thing", [
67
67
  "Choose an event to continue.",
68
68
  "Pick a ticket type to continue.",
@@ -71,48 +71,48 @@ function v() {
71
71
  return;
72
72
  }
73
73
  b((e) => Math.min(e + 1, _.length - 1));
74
- }, Je = () => b((e) => Math.max(e - 1, 0)), Ye = () => {
74
+ }, Ye = () => b((e) => Math.max(e - 1, 0)), Xe = () => {
75
75
  let e = N.trim().toUpperCase();
76
76
  if (!e) {
77
77
  I(null), L("");
78
78
  return;
79
79
  }
80
- let n = W.find((t) => t.code.toUpperCase() === e);
80
+ let n = U.find((t) => t.code.toUpperCase() === e);
81
81
  if (!n) {
82
82
  I(null), L("That code is not active for this event.");
83
83
  return;
84
84
  }
85
- I(n), L(""), t.success("Promo applied", ae(n.discountType, n.discountValue, X));
86
- }, Xe = () => {
85
+ I(n), L(""), t.success("Promo applied", ie(n.discountType, n.discountValue, Y));
86
+ }, $ = () => {
87
87
  I(null), P(""), L("");
88
88
  }, Ze = () => {
89
- b(0), Se(""), C(""), T("new"), D(""), k(""), j(""), we(""), Ee(""), M(1), Xe(), ke("");
89
+ b(0), S(""), w(""), E("new"), O(""), Se(""), Ce(""), Te(""), j(""), M(1), $(), ke("");
90
90
  };
91
- return z ? /* @__PURE__ */ u("div", {
91
+ return z ? /* @__PURE__ */ d("div", {
92
92
  className: "mx-auto max-w-2xl space-y-6 p-6",
93
- children: [/* @__PURE__ */ l("div", { children: /* @__PURE__ */ u(m, {
93
+ children: [/* @__PURE__ */ u("div", { children: /* @__PURE__ */ d(m, {
94
94
  type: "button",
95
95
  variant: "ghost",
96
96
  size: "sm",
97
97
  onClick: () => v("/registration"),
98
- children: [/* @__PURE__ */ l(d, { className: "h-4 w-4" }), "Back to Registration"]
99
- }) }), /* @__PURE__ */ u(h, {
98
+ children: [/* @__PURE__ */ u(f, { className: "h-4 w-4" }), "Back to Registration"]
99
+ }) }), /* @__PURE__ */ d(h, {
100
100
  treatment: "glass",
101
101
  glow: !0,
102
102
  className: "p-8 text-center",
103
103
  children: [
104
- /* @__PURE__ */ l("div", {
104
+ /* @__PURE__ */ u("div", {
105
105
  className: "mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-status-success-bg-subtle",
106
- children: /* @__PURE__ */ l(ue, {
106
+ children: /* @__PURE__ */ u(ue, {
107
107
  className: "h-8 w-8 text-status-success-text",
108
108
  "aria-hidden": "true"
109
109
  })
110
110
  }),
111
- /* @__PURE__ */ l("h1", {
111
+ /* @__PURE__ */ u("h1", {
112
112
  className: "mt-4 text-2xl font-bold text-text-primary",
113
113
  children: "Registration confirmed"
114
114
  }),
115
- /* @__PURE__ */ u("p", {
115
+ /* @__PURE__ */ d("p", {
116
116
  className: "mt-2 text-sm text-text-secondary",
117
117
  children: [
118
118
  z.attendeeName,
@@ -121,130 +121,130 @@ function v() {
121
121
  "."
122
122
  ]
123
123
  }),
124
- /* @__PURE__ */ u("dl", {
124
+ /* @__PURE__ */ d("dl", {
125
125
  className: "mx-auto mt-6 max-w-sm space-y-2 rounded-card border border-border-seam bg-bg-surface p-4 text-left text-sm",
126
126
  children: [
127
- /* @__PURE__ */ u("div", {
127
+ /* @__PURE__ */ d("div", {
128
128
  className: "flex justify-between",
129
- children: [/* @__PURE__ */ l("dt", {
129
+ children: [/* @__PURE__ */ u("dt", {
130
130
  className: "text-text-secondary",
131
131
  children: "Ticket"
132
- }), /* @__PURE__ */ u("dd", {
132
+ }), /* @__PURE__ */ d("dd", {
133
133
  className: "font-medium text-text-primary",
134
134
  children: [z.ticketName, z.quantity > 1 ? ` × ${z.quantity}` : ""]
135
135
  })]
136
136
  }),
137
- z.free ? null : /* @__PURE__ */ u(oe, { children: [/* @__PURE__ */ u("div", {
137
+ z.free ? null : /* @__PURE__ */ d(ae, { children: [/* @__PURE__ */ d("div", {
138
138
  className: "flex justify-between",
139
- children: [/* @__PURE__ */ l("dt", {
139
+ children: [/* @__PURE__ */ u("dt", {
140
140
  className: "text-text-secondary",
141
141
  children: "Subtotal"
142
- }), /* @__PURE__ */ l("dd", {
142
+ }), /* @__PURE__ */ u("dd", {
143
143
  className: "tabular-nums text-text-primary",
144
- children: o(z.subtotal, z.currency)
144
+ children: s(z.subtotal, z.currency)
145
145
  })]
146
- }), z.discount > 0 ? /* @__PURE__ */ u("div", {
146
+ }), z.discount > 0 ? /* @__PURE__ */ d("div", {
147
147
  className: "flex justify-between",
148
- children: [/* @__PURE__ */ u("dt", {
148
+ children: [/* @__PURE__ */ d("dt", {
149
149
  className: "text-text-secondary",
150
150
  children: ["Promo", z.promoCode ? ` · ${z.promoCode}` : ""]
151
- }), /* @__PURE__ */ u("dd", {
151
+ }), /* @__PURE__ */ d("dd", {
152
152
  className: "tabular-nums text-status-success-text",
153
- children: ["−", o(z.discount, z.currency)]
153
+ children: ["−", s(z.discount, z.currency)]
154
154
  })]
155
155
  }) : null] }),
156
- /* @__PURE__ */ u("div", {
156
+ /* @__PURE__ */ d("div", {
157
157
  className: "flex justify-between border-t border-border-seam pt-2",
158
- children: [/* @__PURE__ */ l("dt", {
158
+ children: [/* @__PURE__ */ u("dt", {
159
159
  className: "font-semibold text-text-primary",
160
160
  children: "Total"
161
- }), /* @__PURE__ */ l("dd", {
161
+ }), /* @__PURE__ */ u("dd", {
162
162
  className: "font-bold tabular-nums text-text-primary",
163
- children: z.free ? "Free" : o(z.total, z.currency)
163
+ children: z.free ? "Free" : s(z.total, z.currency)
164
164
  })]
165
165
  }),
166
- /* @__PURE__ */ u("div", {
166
+ /* @__PURE__ */ d("div", {
167
167
  className: "flex justify-between",
168
- children: [/* @__PURE__ */ l("dt", {
168
+ children: [/* @__PURE__ */ u("dt", {
169
169
  className: "text-text-secondary",
170
170
  children: "Status"
171
- }), /* @__PURE__ */ l("dd", {
171
+ }), /* @__PURE__ */ u("dd", {
172
172
  className: "font-medium text-text-primary",
173
173
  children: z.status
174
174
  })]
175
175
  })
176
176
  ]
177
177
  }),
178
- z.free ? null : /* @__PURE__ */ l("p", {
178
+ z.free ? null : /* @__PURE__ */ u("p", {
179
179
  className: "mt-3 text-xs text-text-muted",
180
180
  children: "Final pricing and payment are settled by the billing service."
181
181
  }),
182
- /* @__PURE__ */ u("div", {
182
+ /* @__PURE__ */ d("div", {
183
183
  className: "mt-8 flex flex-col justify-center gap-3 sm:flex-row",
184
- children: [/* @__PURE__ */ l(m, {
184
+ children: [/* @__PURE__ */ u(m, {
185
185
  type: "button",
186
186
  variant: "outline",
187
187
  onClick: () => v("/registration"),
188
188
  children: "Back to Registrations"
189
- }), /* @__PURE__ */ l(m, {
189
+ }), /* @__PURE__ */ u(m, {
190
190
  type: "button",
191
191
  onClick: () => {
192
- B(null), Ze();
192
+ Ae(null), Ze();
193
193
  },
194
194
  children: "Register another"
195
195
  })]
196
196
  })
197
197
  ]
198
198
  })]
199
- }) : /* @__PURE__ */ u("div", {
199
+ }) : /* @__PURE__ */ d("div", {
200
200
  className: "space-y-6 p-6",
201
201
  children: [
202
- /* @__PURE__ */ u("div", { children: [
203
- /* @__PURE__ */ u(m, {
202
+ /* @__PURE__ */ d("div", { children: [
203
+ /* @__PURE__ */ d(m, {
204
204
  type: "button",
205
205
  variant: "ghost",
206
206
  size: "sm",
207
207
  onClick: () => v("/registration"),
208
- children: [/* @__PURE__ */ l(d, { className: "h-4 w-4" }), "Back to Registration"]
208
+ children: [/* @__PURE__ */ u(f, { className: "h-4 w-4" }), "Back to Registration"]
209
209
  }),
210
- /* @__PURE__ */ l("h1", {
210
+ /* @__PURE__ */ u("h1", {
211
211
  className: "mt-3 text-2xl font-bold text-text-primary",
212
- children: /* @__PURE__ */ l(me, { children: "Register Attendee" })
212
+ children: /* @__PURE__ */ u(me, { children: "Register Attendee" })
213
213
  }),
214
- /* @__PURE__ */ l("p", {
214
+ /* @__PURE__ */ u("p", {
215
215
  className: "mt-1 text-sm text-text-secondary",
216
216
  children: "Walk through the event, ticket and attendee in a few quick steps."
217
217
  })
218
218
  ] }),
219
- /* @__PURE__ */ l(he, { children: "Register a person for an event against a ticket type. Pick the event and ticket, choose an existing attendee or add a new one, apply a promo code if they have one, then confirm. The order summary previews the price — final pricing and payment are handled by the billing service." }),
220
- /* @__PURE__ */ l(xe, {
219
+ /* @__PURE__ */ u(he, { children: "Register a person for an event against a ticket type. Pick the event and ticket, choose an existing attendee or add a new one, apply a promo code if they have one, then confirm. The order summary previews the price — final pricing and payment are handled by the billing service." }),
220
+ /* @__PURE__ */ u(xe, {
221
221
  steps: _,
222
222
  active: y,
223
- onStepClick: Ke
223
+ onStepClick: qe
224
224
  }),
225
- /* @__PURE__ */ u("div", {
225
+ /* @__PURE__ */ d("div", {
226
226
  className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
227
- children: [/* @__PURE__ */ u(h, {
227
+ children: [/* @__PURE__ */ d(h, {
228
228
  treatment: "plain",
229
229
  className: "border-border-seam p-5 sm:p-6",
230
230
  children: [
231
- y === 0 ? /* @__PURE__ */ u("div", {
231
+ y === 0 ? /* @__PURE__ */ d("div", {
232
232
  className: "space-y-4",
233
- children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
233
+ children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
234
234
  className: "text-lg font-semibold text-text-primary",
235
235
  children: "Which event?"
236
- }), /* @__PURE__ */ l("p", {
236
+ }), /* @__PURE__ */ u("p", {
237
237
  className: "mt-1 text-sm text-text-secondary",
238
238
  children: "Choose the event this attendee is signing up for."
239
- })] }), je ? /* @__PURE__ */ l("p", {
239
+ })] }), Me ? /* @__PURE__ */ u("p", {
240
240
  className: "text-sm text-text-muted",
241
241
  children: "Loading events…"
242
- }) : V.length === 0 ? /* @__PURE__ */ u("div", {
242
+ }) : B.length === 0 ? /* @__PURE__ */ d("div", {
243
243
  className: "rounded-card border border-dashed border-border-default p-6 text-center text-sm text-text-secondary",
244
244
  children: [
245
245
  "No events yet.",
246
246
  " ",
247
- /* @__PURE__ */ l("button", {
247
+ /* @__PURE__ */ u("button", {
248
248
  type: "button",
249
249
  className: "font-medium text-text-link underline-offset-2 hover:underline",
250
250
  onClick: () => v("/events/create"),
@@ -253,28 +253,28 @@ function v() {
253
253
  " ",
254
254
  "first."
255
255
  ]
256
- }) : /* @__PURE__ */ l("div", {
256
+ }) : /* @__PURE__ */ u("div", {
257
257
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
258
- children: V.map((e) => {
258
+ children: B.map((e) => {
259
259
  let t = e.id === x;
260
- return /* @__PURE__ */ u("button", {
260
+ return /* @__PURE__ */ d("button", {
261
261
  type: "button",
262
- onClick: () => Ue(e.id),
262
+ onClick: () => We(e.id),
263
263
  "aria-pressed": t,
264
264
  className: `flex items-center gap-3 rounded-card border p-4 text-left transition-colors ${t ? "border-action-primary-border bg-accent-wash" : "border-border-seam bg-bg-surface hover:border-border-strong"}`,
265
265
  children: [
266
- /* @__PURE__ */ l("span", {
266
+ /* @__PURE__ */ u("span", {
267
267
  className: `flex h-10 w-10 shrink-0 items-center justify-center rounded-input ${t ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-muted"}`,
268
- children: /* @__PURE__ */ l(le, {
268
+ children: /* @__PURE__ */ u(ce, {
269
269
  className: "h-5 w-5",
270
270
  "aria-hidden": "true"
271
271
  })
272
272
  }),
273
- /* @__PURE__ */ l("span", {
273
+ /* @__PURE__ */ u("span", {
274
274
  className: "min-w-0 flex-1 truncate text-sm font-medium text-text-primary",
275
275
  children: e.name
276
276
  }),
277
- t ? /* @__PURE__ */ l(f, {
277
+ t ? /* @__PURE__ */ u(le, {
278
278
  className: "h-4 w-4 shrink-0 text-action-primary-bg",
279
279
  "aria-hidden": "true"
280
280
  }) : null
@@ -283,62 +283,62 @@ function v() {
283
283
  })
284
284
  })]
285
285
  }) : null,
286
- y === 1 ? /* @__PURE__ */ u("div", {
286
+ y === 1 ? /* @__PURE__ */ d("div", {
287
287
  className: "space-y-4",
288
288
  children: [
289
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
289
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
290
290
  className: "text-lg font-semibold text-text-primary",
291
291
  children: "Ticket type"
292
- }), /* @__PURE__ */ l("p", {
292
+ }), /* @__PURE__ */ u("p", {
293
293
  className: "mt-1 text-sm text-text-secondary",
294
294
  children: "Pick the ticket and how many they need."
295
295
  })] }),
296
- Ne ? /* @__PURE__ */ l("p", {
296
+ Pe ? /* @__PURE__ */ u("p", {
297
297
  className: "text-sm text-text-muted",
298
298
  children: "Loading tickets…"
299
- }) : H.length === 0 ? /* @__PURE__ */ l("div", {
299
+ }) : V.length === 0 ? /* @__PURE__ */ u("div", {
300
300
  className: "rounded-card border border-dashed border-border-default p-6 text-center text-sm text-text-secondary",
301
301
  children: "This event has no active ticket types."
302
- }) : /* @__PURE__ */ l("div", {
302
+ }) : /* @__PURE__ */ u("div", {
303
303
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3",
304
- children: H.map((e) => {
305
- let t = e.id === S, n = e.capacity ?? null, r = e.soldCount ?? 0, i = n && n > 0 ? Math.min(100, Math.round(r / n * 100)) : null, a = n != null && r >= n;
306
- return /* @__PURE__ */ u("button", {
304
+ children: V.map((e) => {
305
+ let t = e.id === C, n = e.capacity ?? null, r = e.soldCount ?? 0, i = n && n > 0 ? Math.min(100, Math.round(r / n * 100)) : null, a = n != null && r >= n;
306
+ return /* @__PURE__ */ d("button", {
307
307
  type: "button",
308
308
  disabled: a && !t,
309
- onClick: () => C(e.id),
309
+ onClick: () => w(e.id),
310
310
  "aria-pressed": t,
311
311
  className: `flex flex-col gap-3 rounded-card border p-4 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${t ? "border-action-primary-border bg-accent-wash ring-1 ring-border-focus" : "border-border-seam bg-bg-surface hover:border-border-strong"}`,
312
312
  children: [
313
- /* @__PURE__ */ u("div", {
313
+ /* @__PURE__ */ d("div", {
314
314
  className: "flex items-start justify-between gap-2",
315
- children: [/* @__PURE__ */ l("span", {
315
+ children: [/* @__PURE__ */ u("span", {
316
316
  className: "text-sm font-semibold text-text-primary",
317
317
  children: e.name
318
- }), t ? /* @__PURE__ */ l(f, {
318
+ }), t ? /* @__PURE__ */ u(le, {
319
319
  className: "h-4 w-4 shrink-0 text-action-primary-bg",
320
320
  "aria-hidden": "true"
321
- }) : /* @__PURE__ */ l(p, {
321
+ }) : /* @__PURE__ */ u(p, {
322
322
  className: "h-4 w-4 shrink-0 text-text-muted",
323
323
  "aria-hidden": "true"
324
324
  })]
325
325
  }),
326
- /* @__PURE__ */ l("span", {
326
+ /* @__PURE__ */ u("span", {
327
327
  className: "text-lg font-bold tabular-nums text-text-primary",
328
- children: Number(e.price) > 0 ? o(Number(e.price), e.currency) : "Free"
328
+ children: Number(e.price) > 0 ? s(Number(e.price), e.currency) : "Free"
329
329
  }),
330
- n == null ? /* @__PURE__ */ u("span", {
330
+ n == null ? /* @__PURE__ */ d("span", {
331
331
  className: "text-xs text-text-muted",
332
332
  children: [r, " sold"]
333
- }) : /* @__PURE__ */ u("div", {
333
+ }) : /* @__PURE__ */ d("div", {
334
334
  className: "space-y-1",
335
- children: [/* @__PURE__ */ l("div", {
335
+ children: [/* @__PURE__ */ u("div", {
336
336
  className: "h-1.5 w-full overflow-hidden rounded-full bg-bg-sunken",
337
- children: /* @__PURE__ */ l("div", {
337
+ children: /* @__PURE__ */ u("div", {
338
338
  className: "h-full rounded-full bg-action-primary-bg",
339
339
  style: { width: `${i ?? 0}%` }
340
340
  })
341
- }), /* @__PURE__ */ l("span", {
341
+ }), /* @__PURE__ */ u("span", {
342
342
  className: "text-xs text-text-muted",
343
343
  children: a ? "Sold out" : `${r} / ${n} sold`
344
344
  })]
@@ -347,36 +347,36 @@ function v() {
347
347
  }, e.id);
348
348
  })
349
349
  }),
350
- /* @__PURE__ */ l("div", {
350
+ /* @__PURE__ */ u("div", {
351
351
  className: "flex flex-wrap items-end gap-4 border-t border-border-seam pt-4",
352
- children: /* @__PURE__ */ u("div", {
352
+ children: /* @__PURE__ */ d("div", {
353
353
  className: "space-y-1",
354
- children: [/* @__PURE__ */ l("span", {
354
+ children: [/* @__PURE__ */ u("span", {
355
355
  className: "text-sm font-medium text-text-primary",
356
356
  children: "Quantity"
357
- }), /* @__PURE__ */ u("div", {
357
+ }), /* @__PURE__ */ d("div", {
358
358
  className: "flex items-center gap-1",
359
359
  children: [
360
- /* @__PURE__ */ l(m, {
360
+ /* @__PURE__ */ u(m, {
361
361
  type: "button",
362
362
  variant: "outline",
363
363
  size: "icon",
364
364
  "aria-label": "Decrease quantity",
365
- disabled: Y <= 1,
365
+ disabled: J <= 1,
366
366
  onClick: () => M((e) => Math.max(1, e - 1)),
367
- children: /* @__PURE__ */ l(de, { className: "h-4 w-4" })
367
+ children: /* @__PURE__ */ u(de, { className: "h-4 w-4" })
368
368
  }),
369
- /* @__PURE__ */ l("span", {
369
+ /* @__PURE__ */ u("span", {
370
370
  className: "w-10 text-center text-base font-semibold tabular-nums text-text-primary",
371
- children: Y
371
+ children: J
372
372
  }),
373
- /* @__PURE__ */ l(m, {
373
+ /* @__PURE__ */ u(m, {
374
374
  type: "button",
375
375
  variant: "outline",
376
376
  size: "icon",
377
377
  "aria-label": "Increase quantity",
378
378
  onClick: () => M((e) => e + 1),
379
- children: /* @__PURE__ */ l(fe, { className: "h-4 w-4" })
379
+ children: /* @__PURE__ */ u(fe, { className: "h-4 w-4" })
380
380
  })
381
381
  ]
382
382
  })]
@@ -384,43 +384,43 @@ function v() {
384
384
  })
385
385
  ]
386
386
  }) : null,
387
- y === 2 ? /* @__PURE__ */ u("div", {
387
+ y === 2 ? /* @__PURE__ */ d("div", {
388
388
  className: "space-y-4",
389
389
  children: [
390
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
390
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
391
391
  className: "text-lg font-semibold text-text-primary",
392
392
  children: "Attendee information"
393
- }), /* @__PURE__ */ l("p", {
393
+ }), /* @__PURE__ */ u("p", {
394
394
  className: "mt-1 text-sm text-text-secondary",
395
395
  children: "Add someone new or pick an existing attendee."
396
396
  })] }),
397
- /* @__PURE__ */ u("div", {
397
+ /* @__PURE__ */ d("div", {
398
398
  className: "inline-flex rounded-input border border-border-seam bg-bg-sunken p-1",
399
- children: [/* @__PURE__ */ l("button", {
399
+ children: [/* @__PURE__ */ u("button", {
400
400
  type: "button",
401
- onClick: () => T("new"),
402
- className: `rounded-[calc(var(--radius-input)-2px)] px-3 py-1.5 text-sm font-medium transition-colors ${w === "new" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
401
+ onClick: () => E("new"),
402
+ className: `rounded-[calc(var(--radius-input)-2px)] px-3 py-1.5 text-sm font-medium transition-colors ${T === "new" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
403
403
  children: "New attendee"
404
- }), /* @__PURE__ */ l("button", {
404
+ }), /* @__PURE__ */ u("button", {
405
405
  type: "button",
406
- onClick: () => T("existing"),
407
- disabled: U.length === 0,
408
- className: `rounded-[calc(var(--radius-input)-2px)] px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${w === "existing" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
406
+ onClick: () => E("existing"),
407
+ disabled: H.length === 0,
408
+ className: `rounded-[calc(var(--radius-input)-2px)] px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${T === "existing" ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
409
409
  children: "Existing attendee"
410
410
  })]
411
411
  }),
412
- w === "existing" ? /* @__PURE__ */ u("label", {
412
+ T === "existing" ? /* @__PURE__ */ d("label", {
413
413
  className: "block space-y-1 text-sm",
414
- children: [/* @__PURE__ */ l("span", {
414
+ children: [/* @__PURE__ */ u("span", {
415
415
  className: "font-medium text-text-primary",
416
416
  children: "Attendee"
417
- }), /* @__PURE__ */ u(ge, {
418
- value: E,
419
- onValueChange: D,
420
- children: [/* @__PURE__ */ l(ye, {
417
+ }), /* @__PURE__ */ d(ge, {
418
+ value: D,
419
+ onValueChange: O,
420
+ children: [/* @__PURE__ */ u(ye, {
421
421
  "aria-label": "Attendee",
422
- children: /* @__PURE__ */ l(be, { placeholder: "Select an attendee" })
423
- }), /* @__PURE__ */ l(_e, { children: U.map((e) => /* @__PURE__ */ u(ve, {
422
+ children: /* @__PURE__ */ u(be, { placeholder: "Select an attendee" })
423
+ }), /* @__PURE__ */ u(_e, { children: H.map((e) => /* @__PURE__ */ d(ve, {
424
424
  value: e.id,
425
425
  children: [
426
426
  e.fullName,
@@ -429,66 +429,66 @@ function v() {
429
429
  ]
430
430
  }, e.id)) })]
431
431
  })]
432
- }) : /* @__PURE__ */ u("div", {
432
+ }) : /* @__PURE__ */ d("div", {
433
433
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
434
434
  children: [
435
- /* @__PURE__ */ u("label", {
435
+ /* @__PURE__ */ d("label", {
436
436
  className: "space-y-1 text-sm",
437
- children: [/* @__PURE__ */ l("span", {
437
+ children: [/* @__PURE__ */ u("span", {
438
438
  className: "font-medium text-text-primary",
439
439
  children: "Full name"
440
- }), /* @__PURE__ */ l(g, {
441
- value: O,
442
- onChange: (e) => k(e.target.value),
440
+ }), /* @__PURE__ */ u(g, {
441
+ value: k,
442
+ onChange: (e) => Se(e.target.value),
443
443
  placeholder: "Enter full name"
444
444
  })]
445
445
  }),
446
- /* @__PURE__ */ u("label", {
446
+ /* @__PURE__ */ d("label", {
447
447
  className: "space-y-1 text-sm",
448
- children: [/* @__PURE__ */ l("span", {
448
+ children: [/* @__PURE__ */ u("span", {
449
449
  className: "font-medium text-text-primary",
450
450
  children: "Email"
451
- }), /* @__PURE__ */ l(g, {
451
+ }), /* @__PURE__ */ u(g, {
452
452
  type: "email",
453
453
  value: A,
454
- onChange: (e) => j(e.target.value),
454
+ onChange: (e) => Ce(e.target.value),
455
455
  placeholder: "Enter email address"
456
456
  })]
457
457
  }),
458
- /* @__PURE__ */ u("label", {
458
+ /* @__PURE__ */ d("label", {
459
459
  className: "space-y-1 text-sm",
460
- children: [/* @__PURE__ */ l("span", {
460
+ children: [/* @__PURE__ */ u("span", {
461
461
  className: "font-medium text-text-primary",
462
462
  children: "Company"
463
- }), /* @__PURE__ */ l(g, {
464
- value: Ce,
465
- onChange: (e) => we(e.target.value),
463
+ }), /* @__PURE__ */ u(g, {
464
+ value: we,
465
+ onChange: (e) => Te(e.target.value),
466
466
  placeholder: "Enter company name"
467
467
  })]
468
468
  }),
469
- /* @__PURE__ */ u("label", {
469
+ /* @__PURE__ */ d("label", {
470
470
  className: "space-y-1 text-sm",
471
- children: [/* @__PURE__ */ l("span", {
471
+ children: [/* @__PURE__ */ u("span", {
472
472
  className: "font-medium text-text-primary",
473
473
  children: "Phone"
474
- }), /* @__PURE__ */ l(g, {
475
- value: Te,
476
- onChange: (e) => Ee(e.target.value),
474
+ }), /* @__PURE__ */ u(g, {
475
+ value: Ee,
476
+ onChange: (e) => j(e.target.value),
477
477
  placeholder: "Optional"
478
478
  })]
479
479
  })
480
480
  ]
481
481
  }),
482
- /* @__PURE__ */ u("div", {
482
+ /* @__PURE__ */ d("div", {
483
483
  className: "space-y-2 border-t border-border-seam pt-4",
484
484
  children: [
485
- /* @__PURE__ */ l("span", {
485
+ /* @__PURE__ */ u("span", {
486
486
  className: "text-sm font-medium text-text-primary",
487
487
  children: "Promo code (optional)"
488
488
  }),
489
- /* @__PURE__ */ u("div", {
489
+ /* @__PURE__ */ d("div", {
490
490
  className: "flex flex-col gap-2 sm:flex-row",
491
- children: [/* @__PURE__ */ l(g, {
491
+ children: [/* @__PURE__ */ u(g, {
492
492
  value: N,
493
493
  onChange: (e) => {
494
494
  P(e.target.value), L("");
@@ -496,37 +496,37 @@ function v() {
496
496
  placeholder: "Enter promo code",
497
497
  className: "sm:flex-1",
498
498
  onKeyDown: (e) => {
499
- e.key === "Enter" && (e.preventDefault(), Ye());
499
+ e.key === "Enter" && (e.preventDefault(), Xe());
500
500
  }
501
- }), F ? /* @__PURE__ */ l(m, {
501
+ }), F ? /* @__PURE__ */ u(m, {
502
502
  type: "button",
503
503
  variant: "outline",
504
- onClick: Xe,
504
+ onClick: $,
505
505
  children: "Remove"
506
- }) : /* @__PURE__ */ l(m, {
506
+ }) : /* @__PURE__ */ u(m, {
507
507
  type: "button",
508
508
  variant: "outline",
509
- onClick: Ye,
509
+ onClick: Xe,
510
510
  disabled: !N.trim(),
511
511
  children: "Apply"
512
512
  })]
513
513
  }),
514
- F ? /* @__PURE__ */ u("span", {
514
+ F ? /* @__PURE__ */ d("span", {
515
515
  className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-success-text",
516
516
  children: [
517
- /* @__PURE__ */ l(ce, {
517
+ /* @__PURE__ */ u(se, {
518
518
  className: "h-3.5 w-3.5",
519
519
  "aria-hidden": "true"
520
520
  }),
521
- ae(F.discountType, F.discountValue, X),
521
+ ie(F.discountType, F.discountValue, Y),
522
522
  " applied"
523
523
  ]
524
- }) : Oe ? /* @__PURE__ */ l("span", {
524
+ }) : Oe ? /* @__PURE__ */ u("span", {
525
525
  className: "text-xs text-status-error-text",
526
526
  children: Oe
527
- }) : W.length > 0 ? /* @__PURE__ */ u("div", {
527
+ }) : U.length > 0 ? /* @__PURE__ */ d("div", {
528
528
  className: "flex flex-wrap items-center gap-1.5 text-xs text-text-muted",
529
- children: [/* @__PURE__ */ l("span", { children: "Available:" }), W.slice(0, 4).map((e) => /* @__PURE__ */ l("button", {
529
+ children: [/* @__PURE__ */ u("span", { children: "Available:" }), U.slice(0, 4).map((e) => /* @__PURE__ */ u("button", {
530
530
  type: "button",
531
531
  onClick: () => {
532
532
  P(e.code), I(e), L("");
@@ -539,88 +539,88 @@ function v() {
539
539
  })
540
540
  ]
541
541
  }) : null,
542
- y === 3 ? /* @__PURE__ */ u("div", {
542
+ y === 3 ? /* @__PURE__ */ d("div", {
543
543
  className: "space-y-4",
544
544
  children: [
545
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
545
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
546
546
  className: "text-lg font-semibold text-text-primary",
547
547
  children: "Review & confirm"
548
- }), /* @__PURE__ */ l("p", {
548
+ }), /* @__PURE__ */ u("p", {
549
549
  className: "mt-1 text-sm text-text-secondary",
550
550
  children: "Double-check the details before registering."
551
551
  })] }),
552
- /* @__PURE__ */ u("dl", {
552
+ /* @__PURE__ */ d("dl", {
553
553
  className: "divide-y divide-border-seam rounded-card border border-border-seam bg-bg-surface text-sm",
554
554
  children: [
555
- /* @__PURE__ */ u("div", {
555
+ /* @__PURE__ */ d("div", {
556
556
  className: "flex items-center gap-3 p-3",
557
557
  children: [
558
- /* @__PURE__ */ l(le, {
558
+ /* @__PURE__ */ u(ce, {
559
559
  className: "h-4 w-4 text-text-muted",
560
560
  "aria-hidden": "true"
561
561
  }),
562
- /* @__PURE__ */ l("dt", {
562
+ /* @__PURE__ */ u("dt", {
563
563
  className: "text-text-secondary",
564
564
  children: "Event"
565
565
  }),
566
- /* @__PURE__ */ l("dd", {
566
+ /* @__PURE__ */ u("dd", {
567
567
  className: "ml-auto font-medium text-text-primary",
568
- children: K?.name ?? "—"
568
+ children: G?.name ?? "—"
569
569
  })
570
570
  ]
571
571
  }),
572
- /* @__PURE__ */ u("div", {
572
+ /* @__PURE__ */ d("div", {
573
573
  className: "flex items-center gap-3 p-3",
574
574
  children: [
575
- /* @__PURE__ */ l(p, {
575
+ /* @__PURE__ */ u(p, {
576
576
  className: "h-4 w-4 text-text-muted",
577
577
  "aria-hidden": "true"
578
578
  }),
579
- /* @__PURE__ */ l("dt", {
579
+ /* @__PURE__ */ u("dt", {
580
580
  className: "text-text-secondary",
581
581
  children: "Ticket"
582
582
  }),
583
- /* @__PURE__ */ u("dd", {
583
+ /* @__PURE__ */ d("dd", {
584
584
  className: "ml-auto font-medium text-text-primary",
585
- children: [q?.name ?? "—", Y > 1 ? ` × ${Y}` : ""]
585
+ children: [K?.name ?? "—", J > 1 ? ` × ${J}` : ""]
586
586
  })
587
587
  ]
588
588
  }),
589
- /* @__PURE__ */ u("div", {
589
+ /* @__PURE__ */ d("div", {
590
590
  className: "flex items-center gap-3 p-3",
591
591
  children: [
592
- /* @__PURE__ */ l(pe, {
592
+ /* @__PURE__ */ u(pe, {
593
593
  className: "h-4 w-4 text-text-muted",
594
594
  "aria-hidden": "true"
595
595
  }),
596
- /* @__PURE__ */ l("dt", {
596
+ /* @__PURE__ */ u("dt", {
597
597
  className: "text-text-secondary",
598
598
  children: "Attendee"
599
599
  }),
600
- /* @__PURE__ */ u("dd", {
600
+ /* @__PURE__ */ d("dd", {
601
601
  className: "ml-auto text-right font-medium text-text-primary",
602
- children: [He || "—", /* @__PURE__ */ l("span", {
602
+ children: [Ue || "—", /* @__PURE__ */ u("span", {
603
603
  className: "block text-xs font-normal text-text-secondary",
604
- children: w === "existing" ? J?.email : A.trim()
604
+ children: T === "existing" ? q?.email : A.trim()
605
605
  })]
606
606
  })
607
607
  ]
608
608
  })
609
609
  ]
610
610
  }),
611
- $ ? /* @__PURE__ */ u("label", {
611
+ Q ? /* @__PURE__ */ d("label", {
612
612
  className: "block space-y-1 text-sm",
613
613
  children: [
614
- /* @__PURE__ */ l("span", {
614
+ /* @__PURE__ */ u("span", {
615
615
  className: "font-medium text-text-primary",
616
616
  children: "Billing account ID (optional)"
617
617
  }),
618
- /* @__PURE__ */ l(g, {
618
+ /* @__PURE__ */ u(g, {
619
619
  value: R,
620
620
  onChange: (e) => ke(e.target.value),
621
621
  placeholder: "Attach an existing billing account"
622
622
  }),
623
- /* @__PURE__ */ l("span", {
623
+ /* @__PURE__ */ u("span", {
624
624
  className: "text-xs text-text-secondary",
625
625
  children: "When provided, the charge is attached to this billing account."
626
626
  })
@@ -628,135 +628,136 @@ function v() {
628
628
  }) : null
629
629
  ]
630
630
  }) : null,
631
- /* @__PURE__ */ u("div", {
631
+ /* @__PURE__ */ d("div", {
632
632
  className: "mt-6 flex items-center justify-between gap-3 border-t border-border-seam pt-4",
633
- children: [/* @__PURE__ */ u(m, {
633
+ children: [/* @__PURE__ */ d(m, {
634
634
  type: "button",
635
635
  variant: "ghost",
636
- onClick: Je,
637
- disabled: y === 0 || G,
638
- children: [/* @__PURE__ */ l(d, { className: "h-4 w-4" }), "Back"]
639
- }), y < _.length - 1 ? /* @__PURE__ */ u(m, {
636
+ onClick: Ye,
637
+ disabled: y === 0 || W,
638
+ children: [/* @__PURE__ */ u(f, { className: "h-4 w-4" }), "Back"]
639
+ }), y < _.length - 1 ? /* @__PURE__ */ d(m, {
640
640
  type: "button",
641
- onClick: qe,
642
- children: ["Continue", /* @__PURE__ */ l(se, { className: "h-4 w-4" })]
643
- }) : /* @__PURE__ */ u(m, {
641
+ onClick: Je,
642
+ children: ["Continue", /* @__PURE__ */ u(oe, { className: "h-4 w-4" })]
643
+ }) : /* @__PURE__ */ d(m, {
644
644
  type: "button",
645
645
  onClick: async () => {
646
- if (!x || !S) {
646
+ if (!x || !C) {
647
647
  t.error("Incomplete", "Pick an event and ticket first.");
648
648
  return;
649
649
  }
650
- if (w === "new" && (!O.trim() || !A.trim())) {
650
+ if (T === "new" && (!k.trim() || !A.trim())) {
651
651
  t.error("Attendee required", "Enter a name and email, or pick an existing attendee.");
652
652
  return;
653
653
  }
654
- if (w === "existing" && !E) {
654
+ if (T === "existing" && !D) {
655
655
  t.error("Attendee required", "Select an existing attendee.");
656
656
  return;
657
657
  }
658
658
  try {
659
- let e = E, n = J?.fullName ?? "";
660
- if (w === "new") {
661
- let t = await Ie({ variables: { input: {
659
+ let e = D, n = q?.fullName ?? "";
660
+ if (T === "new") {
661
+ let t = await Le({ variables: { input: {
662
662
  eventId: x,
663
- fullName: O.trim(),
663
+ fullName: k.trim(),
664
664
  email: A.trim(),
665
- company: Ce.trim() || null,
666
- phone: Te.trim() || null,
665
+ company: we.trim() || null,
666
+ phone: Ee.trim() || null,
667
667
  profile: {},
668
668
  metadata: {}
669
669
  } } }), r = t.data?.createAttendee?.id;
670
- if (!re(t, r, "Could not create attendee") || !r) return;
671
- e = r, n = O.trim();
670
+ if (!ne(t, r, "Could not create attendee") || !r) return;
671
+ e = r, n = k.trim();
672
672
  }
673
673
  let r = {};
674
- F && (r.promoCode = F.code), $ && R.trim() && (r.billingAccountId = R.trim());
675
- let i = await Re({ variables: { input: {
674
+ Q && R.trim() && (r.billingAccountId = R.trim());
675
+ let i = await ze({ variables: { input: {
676
676
  eventId: x,
677
677
  attendeeId: e,
678
- ticketTypeId: S,
679
- quantity: Y,
680
- currency: X,
678
+ ticketTypeId: C,
679
+ quantity: J,
680
+ currency: Y,
681
681
  status: "CONFIRMED",
682
+ promoCode: F?.code || void 0,
682
683
  metadata: r
683
684
  } } });
684
- if (!re(i, i.data?.createRegistration?.id, "Could not create registration")) return;
685
- let a = i.data?.createRegistration;
686
- B({
685
+ if (!ne(i, i.data?.createRegistration?.id, F ? "Could not create registration (check that your promo code is still valid)" : "Could not create registration")) return;
686
+ let a = i.data?.createRegistration, o = a?.totalAmount == null ? He : Number(a.totalAmount);
687
+ Ae({
687
688
  attendeeName: n || "Attendee",
688
- eventName: K?.name ?? "Event",
689
- ticketName: q?.name ?? "Ticket",
690
- quantity: Y,
689
+ eventName: G?.name ?? "Event",
690
+ ticketName: K?.name ?? "Ticket",
691
+ quantity: J,
691
692
  status: a?.status ?? "CONFIRMED",
692
- subtotal: Z,
693
- discount: Q,
694
- total: Ve,
695
- currency: X,
693
+ subtotal: X,
694
+ discount: Math.max(X - o, 0),
695
+ total: o,
696
+ currency: Y,
696
697
  promoCode: F?.code ?? null,
697
- free: !$
698
+ free: !Q
698
699
  }), t.success("Registration confirmed", n || void 0);
699
700
  } catch (e) {
700
- t.error("Could not register attendee", ne(e));
701
+ t.error("Could not register attendee", te(e));
701
702
  }
702
703
  },
703
- disabled: G,
704
- children: [/* @__PURE__ */ l(p, { className: "h-4 w-4" }), G ? "Registering…" : "Confirm registration"]
704
+ disabled: W,
705
+ children: [/* @__PURE__ */ u(p, { className: "h-4 w-4" }), W ? "Registering…" : "Confirm registration"]
705
706
  })]
706
707
  })
707
708
  ]
708
- }), /* @__PURE__ */ u(h, {
709
+ }), /* @__PURE__ */ d(h, {
709
710
  treatment: "glass",
710
711
  className: "h-fit p-5 lg:sticky lg:top-6",
711
- children: [/* @__PURE__ */ l("h2", {
712
+ children: [/* @__PURE__ */ u("h2", {
712
713
  className: "text-base font-semibold text-text-primary",
713
714
  children: "Order summary"
714
- }), q ? /* @__PURE__ */ u("div", {
715
+ }), K ? /* @__PURE__ */ d("div", {
715
716
  className: "mt-4 space-y-3 text-sm",
716
717
  children: [
717
- /* @__PURE__ */ u("div", {
718
+ /* @__PURE__ */ d("div", {
718
719
  className: "flex items-start justify-between gap-3",
719
- children: [/* @__PURE__ */ u("span", {
720
+ children: [/* @__PURE__ */ d("span", {
720
721
  className: "min-w-0 text-text-secondary",
721
722
  children: [
722
- K?.name ? `${K.name} — ` : "",
723
- q.name,
724
- Y > 1 ? /* @__PURE__ */ u("span", {
723
+ G?.name ? `${G.name} — ` : "",
724
+ K.name,
725
+ J > 1 ? /* @__PURE__ */ d("span", {
725
726
  className: "text-text-muted",
726
- children: [" × ", Y]
727
+ children: [" × ", J]
727
728
  }) : null
728
729
  ]
729
- }), /* @__PURE__ */ l("span", {
730
+ }), /* @__PURE__ */ u("span", {
730
731
  className: "shrink-0 tabular-nums text-text-primary",
731
- children: Z > 0 ? o(Z, X) : "Free"
732
+ children: X > 0 ? s(X, Y) : "Free"
732
733
  })]
733
734
  }),
734
- F && Q > 0 ? /* @__PURE__ */ u("div", {
735
+ F && Z > 0 ? /* @__PURE__ */ d("div", {
735
736
  className: "flex items-start justify-between gap-3",
736
- children: [/* @__PURE__ */ u("span", {
737
+ children: [/* @__PURE__ */ d("span", {
737
738
  className: "text-text-secondary",
738
739
  children: ["Promo · ", F.code]
739
- }), /* @__PURE__ */ u("span", {
740
+ }), /* @__PURE__ */ d("span", {
740
741
  className: "shrink-0 tabular-nums text-status-success-text",
741
- children: ["−", o(Q, X)]
742
+ children: ["−", s(Z, Y)]
742
743
  })]
743
744
  }) : null,
744
- /* @__PURE__ */ u("div", {
745
+ /* @__PURE__ */ d("div", {
745
746
  className: "flex items-center justify-between border-t border-border-seam pt-3",
746
- children: [/* @__PURE__ */ l("span", {
747
+ children: [/* @__PURE__ */ u("span", {
747
748
  className: "font-semibold text-text-primary",
748
749
  children: "Total"
749
- }), /* @__PURE__ */ l("span", {
750
+ }), /* @__PURE__ */ u("span", {
750
751
  className: "text-lg font-bold tabular-nums text-text-primary",
751
- children: Z > 0 ? o(Ve, X) : "Free"
752
+ children: X > 0 ? s(He, Y) : "Free"
752
753
  })]
753
754
  }),
754
- Z > 0 ? /* @__PURE__ */ l("p", {
755
+ X > 0 ? /* @__PURE__ */ u("p", {
755
756
  className: "text-xs text-text-muted",
756
757
  children: "Final pricing & payment handled by the billing service."
757
758
  }) : null
758
759
  ]
759
- }) : /* @__PURE__ */ l("p", {
760
+ }) : /* @__PURE__ */ u("p", {
760
761
  className: "mt-4 text-sm text-text-muted",
761
762
  children: "Pick a ticket to see the price breakdown. Your order total updates as you go."
762
763
  })]