@burdenoff/microfe-eventfullymanaged 2026.1123.6 → 2026.1124.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.
- package/dist/eventfullymanaged/EventfullyManagedRoutes.js +58 -54
- package/dist/eventfullymanaged/EventfullyManagedRoutes.js.map +1 -1
- package/dist/eventfullymanaged/components/ActionMenu.js +19 -19
- package/dist/eventfullymanaged/components/EntityFormShell.js +9 -9
- package/dist/eventfullymanaged/components/EntityTagsField.js +13 -13
- package/dist/eventfullymanaged/components/EntityTagsField.js.map +1 -1
- package/dist/eventfullymanaged/components/ImageUploadField.js +5 -5
- package/dist/eventfullymanaged/components/Pagination.js +7 -7
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js +51 -51
- package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js.map +1 -1
- package/dist/eventfullymanaged/pages/certificates/CertificateAccess.d.ts +7 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateAccess.js +29 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateAccess.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.d.ts +7 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js +264 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatePdfDownload.d.ts +4 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatePdfDownload.js +31 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatePdfDownload.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateScheduleDialog.d.ts +6 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateScheduleDialog.js +76 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateScheduleDialog.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.d.ts +8 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.js +271 -0
- package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.js.map +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatesPage.d.ts +1 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatesPage.js +121 -0
- package/dist/eventfullymanaged/pages/certificates/CertificatesPage.js.map +1 -0
- package/dist/eventfullymanaged/pages/dashboard/DashboardPage.js +26 -26
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js +150 -148
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js +100 -100
- package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js +19 -19
- package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/leads/LeadCaptureDialog.js +16 -16
- package/dist/eventfullymanaged/pages/leads/LeadCaptureDialog.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js +103 -103
- package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +15 -15
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js +12 -12
- package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js +80 -80
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js +14 -14
- package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventsPage.js +121 -121
- package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/IntegrationsPage.js +57 -57
- package/dist/eventfullymanaged/pages/modules/IntegrationsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/KioskPage.js +241 -241
- package/dist/eventfullymanaged/pages/modules/KioskPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/NetworkingPage.js +120 -120
- package/dist/eventfullymanaged/pages/modules/NetworkingPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js +17 -17
- package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/RegistrationPage.js +61 -61
- package/dist/eventfullymanaged/pages/modules/RegistrationPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/RoadmapPanel.js +23 -23
- package/dist/eventfullymanaged/pages/modules/RoadmapPanel.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js +17 -17
- package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/SponsorLeadsPage.js +11 -11
- package/dist/eventfullymanaged/pages/modules/VenueResourcesPage.js +13 -13
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js +108 -108
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/registration/PromoCodeFormPage.js +22 -22
- package/dist/eventfullymanaged/pages/registration/PromoCodeFormPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/registration/RegisterAttendeePage.js +45 -45
- package/dist/eventfullymanaged/pages/speakers/SpeakersPage.js +24 -24
- package/dist/eventfullymanaged/pages/speakers/SpeakersPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js +37 -37
- package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js +23 -23
- package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +123 -123
- package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js +37 -37
- package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/venues/VenueFormPage.js +25 -25
- package/dist/eventfullymanaged/pages/venues/VenueListPage.js +26 -26
- package/dist/eventfullymanaged/pages/venues/VenueListPage.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +468 -0
- package/dist/generated/wspace-operations.js +215 -11
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +30060 -1503
- package/dist/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js +19 -0
- package/dist/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js.map +1 -0
- package/dist/node_modules/@apollo/client/react/hooks/useLazyQuery.js +110 -0
- package/dist/node_modules/@apollo/client/react/hooks/useLazyQuery.js.map +1 -0
- package/dist/utils/pageContext.js +5 -0
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@ import { notify as l } from "../../lib/toast.js";
|
|
|
7
7
|
import { useEffect as u, useMemo as d, useState as f } from "react";
|
|
8
8
|
import { useParams as p } from "react-router";
|
|
9
9
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { Badge as g, Input as _, Select as v, SelectContent as y, SelectItem as b, SelectTrigger as x, SelectValue as S, Switch as C, Textarea as w } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { BadgePercent as T, Ticket as E } from "lucide-react";
|
|
12
12
|
// src/eventfullymanaged/pages/registration/PromoCodeFormPage.tsx
|
|
13
13
|
var D = {
|
|
14
14
|
eventId: "",
|
|
@@ -126,7 +126,7 @@ function j() {
|
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ m("span", {
|
|
128
128
|
className: "flex h-9 w-9 items-center justify-center rounded-input bg-accent-wash text-action-primary",
|
|
129
|
-
children: /* @__PURE__ */ m(
|
|
129
|
+
children: /* @__PURE__ */ m(E, {
|
|
130
130
|
className: "h-4 w-4",
|
|
131
131
|
"aria-hidden": "true"
|
|
132
132
|
})
|
|
@@ -135,13 +135,13 @@ function j() {
|
|
|
135
135
|
className: "font-mono text-base font-semibold text-text-primary",
|
|
136
136
|
children: B.code.trim() ? B.code.trim().toUpperCase() : "YOURCODE"
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */ m(
|
|
138
|
+
/* @__PURE__ */ m(g, {
|
|
139
139
|
variant: "secondary",
|
|
140
140
|
children: B.discountType === "PERCENT" ? "PERCENT" : "FIXED"
|
|
141
141
|
}),
|
|
142
142
|
/* @__PURE__ */ h("span", {
|
|
143
143
|
className: "inline-flex items-center gap-1 text-sm text-text-secondary",
|
|
144
|
-
children: [/* @__PURE__ */ m(
|
|
144
|
+
children: [/* @__PURE__ */ m(T, {
|
|
145
145
|
className: "h-3.5 w-3.5 text-text-muted",
|
|
146
146
|
"aria-hidden": "true"
|
|
147
147
|
}), B.discountValue.trim() ? B.discountType === "PERCENT" ? `${B.discountValue.trim()}% off` : `${B.discountValue.trim()} off` : "No discount set"]
|
|
@@ -150,7 +150,7 @@ function j() {
|
|
|
150
150
|
className: "text-xs text-text-muted",
|
|
151
151
|
children: ["· ", o(B.startsAt, B.endsAt)]
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */ m(
|
|
153
|
+
/* @__PURE__ */ m(g, {
|
|
154
154
|
variant: B.isActive ? "default" : "secondary",
|
|
155
155
|
className: "ml-auto",
|
|
156
156
|
children: B.isActive ? "Active" : "Inactive"
|
|
@@ -170,13 +170,13 @@ function j() {
|
|
|
170
170
|
children: [/* @__PURE__ */ m("span", {
|
|
171
171
|
className: "font-medium text-text-primary",
|
|
172
172
|
children: "Event"
|
|
173
|
-
}), /* @__PURE__ */ h(
|
|
173
|
+
}), /* @__PURE__ */ h(v, {
|
|
174
174
|
value: B.eventId,
|
|
175
175
|
onValueChange: (e) => H("eventId", e),
|
|
176
|
-
children: [/* @__PURE__ */ m(
|
|
176
|
+
children: [/* @__PURE__ */ m(x, {
|
|
177
177
|
"aria-label": "Event",
|
|
178
|
-
children: /* @__PURE__ */ m(
|
|
179
|
-
}), /* @__PURE__ */ m(
|
|
178
|
+
children: /* @__PURE__ */ m(S, { placeholder: "Select Event" })
|
|
179
|
+
}), /* @__PURE__ */ m(y, { children: U.map((e) => /* @__PURE__ */ m(b, {
|
|
180
180
|
value: e.id,
|
|
181
181
|
children: e.name
|
|
182
182
|
}, e.id)) })]
|
|
@@ -186,7 +186,7 @@ function j() {
|
|
|
186
186
|
children: [/* @__PURE__ */ m("span", {
|
|
187
187
|
className: "font-medium text-text-primary",
|
|
188
188
|
children: "Code"
|
|
189
|
-
}), /* @__PURE__ */ m(
|
|
189
|
+
}), /* @__PURE__ */ m(_, {
|
|
190
190
|
value: B.code,
|
|
191
191
|
onChange: (e) => H("code", e.target.value),
|
|
192
192
|
placeholder: "EARLYBIRD",
|
|
@@ -199,7 +199,7 @@ function j() {
|
|
|
199
199
|
children: [/* @__PURE__ */ m("span", {
|
|
200
200
|
className: "font-medium text-text-primary",
|
|
201
201
|
children: "Description"
|
|
202
|
-
}), /* @__PURE__ */ m(
|
|
202
|
+
}), /* @__PURE__ */ m(w, {
|
|
203
203
|
value: B.description,
|
|
204
204
|
onChange: (e) => H("description", e.target.value),
|
|
205
205
|
rows: 2
|
|
@@ -213,16 +213,16 @@ function j() {
|
|
|
213
213
|
children: [/* @__PURE__ */ m("span", {
|
|
214
214
|
className: "font-medium text-text-primary",
|
|
215
215
|
children: "Discount Type"
|
|
216
|
-
}), /* @__PURE__ */ h(
|
|
216
|
+
}), /* @__PURE__ */ h(v, {
|
|
217
217
|
value: B.discountType,
|
|
218
218
|
onValueChange: (e) => H("discountType", e),
|
|
219
|
-
children: [/* @__PURE__ */ m(
|
|
219
|
+
children: [/* @__PURE__ */ m(x, {
|
|
220
220
|
"aria-label": "Discount Type",
|
|
221
|
-
children: /* @__PURE__ */ m(
|
|
222
|
-
}), /* @__PURE__ */ h(
|
|
221
|
+
children: /* @__PURE__ */ m(S, {})
|
|
222
|
+
}), /* @__PURE__ */ h(y, { children: [/* @__PURE__ */ m(b, {
|
|
223
223
|
value: "PERCENT",
|
|
224
224
|
children: "Percentage (%)"
|
|
225
|
-
}), /* @__PURE__ */ m(
|
|
225
|
+
}), /* @__PURE__ */ m(b, {
|
|
226
226
|
value: "FIXED",
|
|
227
227
|
children: "Fixed amount"
|
|
228
228
|
})] })]
|
|
@@ -235,7 +235,7 @@ function j() {
|
|
|
235
235
|
className: "font-medium text-text-primary",
|
|
236
236
|
children: "Discount Value"
|
|
237
237
|
}),
|
|
238
|
-
/* @__PURE__ */ m(
|
|
238
|
+
/* @__PURE__ */ m(_, {
|
|
239
239
|
type: "number",
|
|
240
240
|
min: "0",
|
|
241
241
|
step: "any",
|
|
@@ -254,7 +254,7 @@ function j() {
|
|
|
254
254
|
children: [/* @__PURE__ */ m("span", {
|
|
255
255
|
className: "font-medium text-text-primary",
|
|
256
256
|
children: "Max Uses"
|
|
257
|
-
}), /* @__PURE__ */ m(
|
|
257
|
+
}), /* @__PURE__ */ m(_, {
|
|
258
258
|
type: "number",
|
|
259
259
|
min: "0",
|
|
260
260
|
value: B.maxUses,
|
|
@@ -271,7 +271,7 @@ function j() {
|
|
|
271
271
|
children: [/* @__PURE__ */ m("span", {
|
|
272
272
|
className: "font-medium text-text-primary",
|
|
273
273
|
children: "Starts At"
|
|
274
|
-
}), /* @__PURE__ */ m(
|
|
274
|
+
}), /* @__PURE__ */ m(_, {
|
|
275
275
|
type: "datetime-local",
|
|
276
276
|
value: B.startsAt,
|
|
277
277
|
onChange: (e) => H("startsAt", e.target.value)
|
|
@@ -281,7 +281,7 @@ function j() {
|
|
|
281
281
|
children: [/* @__PURE__ */ m("span", {
|
|
282
282
|
className: "font-medium text-text-primary",
|
|
283
283
|
children: "Ends At"
|
|
284
|
-
}), /* @__PURE__ */ m(
|
|
284
|
+
}), /* @__PURE__ */ m(_, {
|
|
285
285
|
type: "datetime-local",
|
|
286
286
|
value: B.endsAt,
|
|
287
287
|
onChange: (e) => H("endsAt", e.target.value)
|
|
@@ -299,7 +299,7 @@ function j() {
|
|
|
299
299
|
className: "text-xs text-text-secondary",
|
|
300
300
|
children: "Only active codes can be redeemed at checkout."
|
|
301
301
|
})]
|
|
302
|
-
}), /* @__PURE__ */ m(
|
|
302
|
+
}), /* @__PURE__ */ m(C, {
|
|
303
303
|
checked: B.isActive,
|
|
304
304
|
onCheckedChange: (e) => H("isActive", e)
|
|
305
305
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromoCodeFormPage.js","names":["Badge","Badge$1","emptyState","isoToLocalInput","iso","date","offsetMs","localInputToIso","value","toFormState","promo","PromoCodeFormPage","useParams","isEdit","useMemo","id","useEventfullyManaged","eventsData","useEventsQuery","promoData","usePromoCodesQuery","existing","item","createPromoCode","creating","useCreatePromoCodeMutation","updatePromoCode","updating","useUpdatePromoCodeMutation","form","setForm","useState","onChange","prev","field","events","saving","onSubmit","event","input","response","mutationSucceeded","notify","navigate","error","describeError","valueHint","EntityFormShell","Ticket","BadgePercent","describeValidity","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","eventItem","Input","Textarea","Switch","checked"],"sources":["../../../../src/eventfullymanaged/pages/registration/PromoCodeFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router';\nimport { BadgePercent, Ticket } from 'lucide-react';\nimport {\n Badge,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Switch,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\n\nimport {\n useCreatePromoCodeMutation,\n useEventsQuery,\n usePromoCodesQuery,\n useUpdatePromoCodeMutation,\n type PromoCodeGql,\n} from '../../api/eventApi';\nimport { EntityFormShell } from '../../components/EntityFormShell';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeValidity } from '../../lib/format';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype PromoCodeFormState = {\n eventId: string;\n code: string;\n description: string;\n discountType: string;\n discountValue: string;\n maxUses: string;\n startsAt: string;\n endsAt: string;\n isActive: boolean;\n};\n\nconst emptyState: PromoCodeFormState = {\n eventId: '',\n code: '',\n description: '',\n discountType: 'PERCENT',\n discountValue: '',\n maxUses: '',\n startsAt: '',\n endsAt: '',\n isActive: true,\n};\n\n/** ISO timestamp -> value for <input type=\"datetime-local\"> (local time, minute precision). */\nfunction isoToLocalInput(iso?: string | null): string {\n if (!iso) {\n return '';\n }\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) {\n return '';\n }\n const offsetMs = date.getTimezoneOffset() * 60_000;\n return new Date(date.getTime() - offsetMs).toISOString().slice(0, 16);\n}\n\n/** datetime-local value -> ISO timestamp for the DateTime scalar. */\nfunction localInputToIso(value: string): string | null {\n if (!value) {\n return null;\n }\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n return null;\n }\n return date.toISOString();\n}\n\nfunction toFormState(promo: PromoCodeGql): PromoCodeFormState {\n return {\n eventId: promo.eventId ?? '',\n code: promo.code ?? '',\n description: promo.description ?? '',\n discountType: promo.discountType ?? 'PERCENT',\n discountValue: promo.discountValue ?? '',\n maxUses: promo.maxUses != null ? String(promo.maxUses) : '',\n startsAt: isoToLocalInput(promo.startsAt),\n endsAt: isoToLocalInput(promo.endsAt),\n isActive: promo.isActive ?? true,\n };\n}\n\nexport default function PromoCodeFormPage() {\n const { id = '' } = useParams<{ id: string }>();\n const isEdit = useMemo(() => Boolean(id), [id]);\n const { navigate } = useEventfullyManaged();\n\n const { data: eventsData } = useEventsQuery({ limit: 100, offset: 0 });\n // No by-id promo resolver exists — derive edit initial-state from the list.\n const { data: promoData } = usePromoCodesQuery({ limit: 100, offset: 0 });\n const existing = useMemo(() => (promoData?.promoCodes.items ?? []).find((item) => item.id === id), [promoData, id]);\n\n const [createPromoCode, { loading: creating }] = useCreatePromoCodeMutation();\n const [updatePromoCode, { loading: updating }] = useUpdatePromoCodeMutation();\n const [form, setForm] = useState<PromoCodeFormState>(() => (existing ? toFormState(existing) : emptyState));\n\n useEffect(() => {\n if (existing) {\n setForm(toFormState(existing));\n }\n }, [existing]);\n\n const onChange = <K extends keyof PromoCodeFormState>(field: K, value: PromoCodeFormState[K]) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const events = eventsData?.events.items ?? [];\n const saving = creating || updating;\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n if (!form.eventId) {\n notify.error('Event required', 'Choose the event this promo code applies to.');\n return;\n }\n if (!form.code.trim()) {\n notify.error('Code required', 'Enter the code attendees will type at checkout.');\n return;\n }\n if (!form.discountValue.trim()) {\n notify.error('Discount required', 'Enter a discount value.');\n return;\n }\n\n const input = {\n eventId: form.eventId,\n code: form.code.trim().toUpperCase(),\n description: form.description.trim() || null,\n discountType: form.discountType,\n discountValue: form.discountValue.trim(),\n maxUses: form.maxUses.trim() ? Number(form.maxUses) : null,\n startsAt: localInputToIso(form.startsAt),\n endsAt: localInputToIso(form.endsAt),\n isActive: form.isActive,\n metadata: {},\n };\n\n try {\n if (isEdit) {\n const response = await updatePromoCode({ variables: { id, input } });\n if (!mutationSucceeded(response, response.data?.updatePromoCode?.id, 'Could not update promo code')) {\n return;\n }\n notify.success('Promo code updated', input.code);\n navigate('/registration');\n return;\n }\n\n const response = await createPromoCode({ variables: { input } });\n if (!mutationSucceeded(response, response.data?.createPromoCode?.id, 'Could not create promo code')) {\n return;\n }\n notify.success('Promo code created', input.code);\n navigate('/registration');\n } catch (error) {\n notify.error('Could not save promo code', describeError(error));\n }\n };\n\n const valueHint =\n form.discountType === 'PERCENT' ? 'Percentage off, e.g. 10 for 10%.' : 'Fixed amount off, e.g. 500.';\n\n return (\n <EntityFormShell\n title={isEdit ? 'Edit Promo Code' : 'New Promo Code'}\n description=\"Promo codes let you offer discounts to drive registrations.\"\n purpose=\"Create a discount attendees can apply at checkout. Choose whether it takes a percentage or a fixed amount off, cap how many times it can be used, and set an active window. Deactivate a code to stop it being redeemed without deleting its history.\"\n backLabel=\"Back to Registration\"\n onBack={() => navigate('/registration')}\n onSubmit={onSubmit}\n submitLabel={isEdit ? 'Save Promo Code' : 'Create Promo Code'}\n saving={saving}\n >\n {/* Live preview — mirrors how the code appears on the promo list */}\n <div className=\"rounded-card border border-border-seam bg-bg-surface p-4\">\n <span className=\"text-xs font-medium uppercase tracking-wide text-text-muted\">Preview</span>\n <div className=\"mt-2 flex flex-wrap items-center gap-3\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-input bg-accent-wash text-action-primary\">\n <Ticket className=\"h-4 w-4\" aria-hidden=\"true\" />\n </span>\n <span className=\"font-mono text-base font-semibold text-text-primary\">\n {form.code.trim() ? form.code.trim().toUpperCase() : 'YOURCODE'}\n </span>\n <Badge variant=\"secondary\">{form.discountType === 'PERCENT' ? 'PERCENT' : 'FIXED'}</Badge>\n <span className=\"inline-flex items-center gap-1 text-sm text-text-secondary\">\n <BadgePercent className=\"h-3.5 w-3.5 text-text-muted\" aria-hidden=\"true\" />\n {form.discountValue.trim()\n ? form.discountType === 'PERCENT'\n ? `${form.discountValue.trim()}% off`\n : `${form.discountValue.trim()} off`\n : 'No discount set'}\n </span>\n <span className=\"text-xs text-text-muted\">· {describeValidity(form.startsAt, form.endsAt)}</span>\n <Badge variant={form.isActive ? 'default' : 'secondary'} className=\"ml-auto\">\n {form.isActive ? 'Active' : 'Inactive'}\n </Badge>\n </div>\n <p className=\"mt-2 text-xs text-text-muted\">\n {form.maxUses.trim() ? `Redeemable up to ${form.maxUses.trim()} times.` : 'Unlimited redemptions.'}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Event</span>\n <Select value={form.eventId} onValueChange={(value) => onChange('eventId', value)}>\n <SelectTrigger aria-label=\"Event\">\n <SelectValue placeholder=\"Select Event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((eventItem) => (\n <SelectItem key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Code</span>\n <Input\n value={form.code}\n onChange={(e) => onChange('code', e.target.value)}\n placeholder=\"EARLYBIRD\"\n required\n />\n </label>\n </div>\n\n <label className=\"block space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Description</span>\n <Textarea value={form.description} onChange={(e) => onChange('description', e.target.value)} rows={2} />\n </label>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Discount Type</span>\n <Select value={form.discountType} onValueChange={(value) => onChange('discountType', value)}>\n <SelectTrigger aria-label=\"Discount Type\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"PERCENT\">Percentage (%)</SelectItem>\n <SelectItem value=\"FIXED\">Fixed amount</SelectItem>\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Discount Value</span>\n <Input\n type=\"number\"\n min=\"0\"\n step=\"any\"\n value={form.discountValue}\n onChange={(e) => onChange('discountValue', e.target.value)}\n required\n />\n <span className=\"text-xs text-text-secondary\">{valueHint}</span>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Max Uses</span>\n <Input\n type=\"number\"\n min=\"0\"\n value={form.maxUses}\n onChange={(e) => onChange('maxUses', e.target.value)}\n placeholder=\"Unlimited\"\n />\n </label>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Starts At</span>\n <Input type=\"datetime-local\" value={form.startsAt} onChange={(e) => onChange('startsAt', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Ends At</span>\n <Input type=\"datetime-local\" value={form.endsAt} onChange={(e) => onChange('endsAt', e.target.value)} />\n </label>\n </div>\n\n <div className=\"flex items-center justify-between rounded-input border border-border-default bg-bg-surface px-3 py-2\">\n <div className=\"text-sm\">\n <span className=\"font-medium text-text-primary\">Active</span>\n <p className=\"text-xs text-text-secondary\">Only active codes can be redeemed at checkout.</p>\n </div>\n <Switch checked={form.isActive} onCheckedChange={(checked) => onChange('isActive', checked)} />\n </div>\n </EntityFormShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAME,IAAiC;CACrC,SAAS;CACT,MAAM;CACN,aAAa;CACb,cAAc;CACd,eAAe;CACf,SAAS;CACT,UAAU;CACV,QAAQ;CACR,UAAU;AACZ;AAGA,SAASC,EAAgB,GAA6B;CACpD,IAAI,CAACC,GACH,OAAO;CAET,IAAMC,IAAO,IAAI,KAAKD,CAAG;CACzB,IAAI,OAAO,MAAMC,EAAK,QAAQ,CAAC,GAC7B,OAAO;CAET,IAAMC,IAAWD,EAAK,kBAAkB,IAAI;CAC5C,OAAO,IAAI,KAAKA,EAAK,QAAQ,IAAIC,CAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACtE;AAGA,SAASC,EAAgB,GAA8B;CACrD,IAAI,CAACC,GACH,OAAO;CAET,IAAMH,IAAO,IAAI,KAAKG,CAAK;CAI3B,OAHI,OAAO,MAAMH,EAAK,QAAQ,CAAC,IACtB,OAEFA,EAAK,YAAY;AAC1B;AAEA,SAASI,EAAY,GAAyC;CAC5D,OAAO;EACL,SAASC,EAAM,WAAW;EAC1B,MAAMA,EAAM,QAAQ;EACpB,aAAaA,EAAM,eAAe;EAClC,cAAcA,EAAM,gBAAgB;EACpC,eAAeA,EAAM,iBAAiB;EACtC,SAASA,EAAM,WAAW,OAA+B,KAAxB,OAAOA,EAAM,OAAO;EACrD,UAAUP,EAAgBO,EAAM,QAA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C2B,GAAD;KAAQ,SAAS9B,EAAK;KAAU,kBAAkB,MAAYG,EAAS,YAAY4B,CAAO;IAAI,CAAA,CAC3F;;EACU;;AAErB"}
|
|
1
|
+
{"version":3,"file":"PromoCodeFormPage.js","names":["emptyState","isoToLocalInput","iso","date","offsetMs","localInputToIso","value","toFormState","promo","PromoCodeFormPage","useParams","isEdit","useMemo","id","useEventfullyManaged","eventsData","useEventsQuery","promoData","usePromoCodesQuery","existing","item","createPromoCode","creating","useCreatePromoCodeMutation","updatePromoCode","updating","useUpdatePromoCodeMutation","form","setForm","useState","onChange","prev","field","events","saving","onSubmit","event","input","response","mutationSucceeded","notify","navigate","error","describeError","valueHint","EntityFormShell","Ticket","Badge","BadgePercent","describeValidity","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","eventItem","Input","Textarea","Switch","checked"],"sources":["../../../../src/eventfullymanaged/pages/registration/PromoCodeFormPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/set-state-in-effect */\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router';\nimport { BadgePercent, Ticket } from 'lucide-react';\nimport {\n Badge,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Switch,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\n\nimport {\n useCreatePromoCodeMutation,\n useEventsQuery,\n usePromoCodesQuery,\n useUpdatePromoCodeMutation,\n type PromoCodeGql,\n} from '../../api/eventApi';\nimport { EntityFormShell } from '../../components/EntityFormShell';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeValidity } from '../../lib/format';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype PromoCodeFormState = {\n eventId: string;\n code: string;\n description: string;\n discountType: string;\n discountValue: string;\n maxUses: string;\n startsAt: string;\n endsAt: string;\n isActive: boolean;\n};\n\nconst emptyState: PromoCodeFormState = {\n eventId: '',\n code: '',\n description: '',\n discountType: 'PERCENT',\n discountValue: '',\n maxUses: '',\n startsAt: '',\n endsAt: '',\n isActive: true,\n};\n\n/** ISO timestamp -> value for <input type=\"datetime-local\"> (local time, minute precision). */\nfunction isoToLocalInput(iso?: string | null): string {\n if (!iso) {\n return '';\n }\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) {\n return '';\n }\n const offsetMs = date.getTimezoneOffset() * 60_000;\n return new Date(date.getTime() - offsetMs).toISOString().slice(0, 16);\n}\n\n/** datetime-local value -> ISO timestamp for the DateTime scalar. */\nfunction localInputToIso(value: string): string | null {\n if (!value) {\n return null;\n }\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n return null;\n }\n return date.toISOString();\n}\n\nfunction toFormState(promo: PromoCodeGql): PromoCodeFormState {\n return {\n eventId: promo.eventId ?? '',\n code: promo.code ?? '',\n description: promo.description ?? '',\n discountType: promo.discountType ?? 'PERCENT',\n discountValue: promo.discountValue ?? '',\n maxUses: promo.maxUses != null ? String(promo.maxUses) : '',\n startsAt: isoToLocalInput(promo.startsAt),\n endsAt: isoToLocalInput(promo.endsAt),\n isActive: promo.isActive ?? true,\n };\n}\n\nexport default function PromoCodeFormPage() {\n const { id = '' } = useParams<{ id: string }>();\n const isEdit = useMemo(() => Boolean(id), [id]);\n const { navigate } = useEventfullyManaged();\n\n const { data: eventsData } = useEventsQuery({ limit: 100, offset: 0 });\n // No by-id promo resolver exists — derive edit initial-state from the list.\n const { data: promoData } = usePromoCodesQuery({ limit: 100, offset: 0 });\n const existing = useMemo(() => (promoData?.promoCodes.items ?? []).find((item) => item.id === id), [promoData, id]);\n\n const [createPromoCode, { loading: creating }] = useCreatePromoCodeMutation();\n const [updatePromoCode, { loading: updating }] = useUpdatePromoCodeMutation();\n const [form, setForm] = useState<PromoCodeFormState>(() => (existing ? toFormState(existing) : emptyState));\n\n useEffect(() => {\n if (existing) {\n setForm(toFormState(existing));\n }\n }, [existing]);\n\n const onChange = <K extends keyof PromoCodeFormState>(field: K, value: PromoCodeFormState[K]) => {\n setForm((prev) => ({ ...prev, [field]: value }));\n };\n\n const events = eventsData?.events.items ?? [];\n const saving = creating || updating;\n\n const onSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n if (!form.eventId) {\n notify.error('Event required', 'Choose the event this promo code applies to.');\n return;\n }\n if (!form.code.trim()) {\n notify.error('Code required', 'Enter the code attendees will type at checkout.');\n return;\n }\n if (!form.discountValue.trim()) {\n notify.error('Discount required', 'Enter a discount value.');\n return;\n }\n\n const input = {\n eventId: form.eventId,\n code: form.code.trim().toUpperCase(),\n description: form.description.trim() || null,\n discountType: form.discountType,\n discountValue: form.discountValue.trim(),\n maxUses: form.maxUses.trim() ? Number(form.maxUses) : null,\n startsAt: localInputToIso(form.startsAt),\n endsAt: localInputToIso(form.endsAt),\n isActive: form.isActive,\n metadata: {},\n };\n\n try {\n if (isEdit) {\n const response = await updatePromoCode({ variables: { id, input } });\n if (!mutationSucceeded(response, response.data?.updatePromoCode?.id, 'Could not update promo code')) {\n return;\n }\n notify.success('Promo code updated', input.code);\n navigate('/registration');\n return;\n }\n\n const response = await createPromoCode({ variables: { input } });\n if (!mutationSucceeded(response, response.data?.createPromoCode?.id, 'Could not create promo code')) {\n return;\n }\n notify.success('Promo code created', input.code);\n navigate('/registration');\n } catch (error) {\n notify.error('Could not save promo code', describeError(error));\n }\n };\n\n const valueHint =\n form.discountType === 'PERCENT' ? 'Percentage off, e.g. 10 for 10%.' : 'Fixed amount off, e.g. 500.';\n\n return (\n <EntityFormShell\n title={isEdit ? 'Edit Promo Code' : 'New Promo Code'}\n description=\"Promo codes let you offer discounts to drive registrations.\"\n purpose=\"Create a discount attendees can apply at checkout. Choose whether it takes a percentage or a fixed amount off, cap how many times it can be used, and set an active window. Deactivate a code to stop it being redeemed without deleting its history.\"\n backLabel=\"Back to Registration\"\n onBack={() => navigate('/registration')}\n onSubmit={onSubmit}\n submitLabel={isEdit ? 'Save Promo Code' : 'Create Promo Code'}\n saving={saving}\n >\n {/* Live preview — mirrors how the code appears on the promo list */}\n <div className=\"rounded-card border border-border-seam bg-bg-surface p-4\">\n <span className=\"text-xs font-medium uppercase tracking-wide text-text-muted\">Preview</span>\n <div className=\"mt-2 flex flex-wrap items-center gap-3\">\n <span className=\"flex h-9 w-9 items-center justify-center rounded-input bg-accent-wash text-action-primary\">\n <Ticket className=\"h-4 w-4\" aria-hidden=\"true\" />\n </span>\n <span className=\"font-mono text-base font-semibold text-text-primary\">\n {form.code.trim() ? form.code.trim().toUpperCase() : 'YOURCODE'}\n </span>\n <Badge variant=\"secondary\">{form.discountType === 'PERCENT' ? 'PERCENT' : 'FIXED'}</Badge>\n <span className=\"inline-flex items-center gap-1 text-sm text-text-secondary\">\n <BadgePercent className=\"h-3.5 w-3.5 text-text-muted\" aria-hidden=\"true\" />\n {form.discountValue.trim()\n ? form.discountType === 'PERCENT'\n ? `${form.discountValue.trim()}% off`\n : `${form.discountValue.trim()} off`\n : 'No discount set'}\n </span>\n <span className=\"text-xs text-text-muted\">· {describeValidity(form.startsAt, form.endsAt)}</span>\n <Badge variant={form.isActive ? 'default' : 'secondary'} className=\"ml-auto\">\n {form.isActive ? 'Active' : 'Inactive'}\n </Badge>\n </div>\n <p className=\"mt-2 text-xs text-text-muted\">\n {form.maxUses.trim() ? `Redeemable up to ${form.maxUses.trim()} times.` : 'Unlimited redemptions.'}\n </p>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Event</span>\n <Select value={form.eventId} onValueChange={(value) => onChange('eventId', value)}>\n <SelectTrigger aria-label=\"Event\">\n <SelectValue placeholder=\"Select Event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((eventItem) => (\n <SelectItem key={eventItem.id} value={eventItem.id}>\n {eventItem.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Code</span>\n <Input\n value={form.code}\n onChange={(e) => onChange('code', e.target.value)}\n placeholder=\"EARLYBIRD\"\n required\n />\n </label>\n </div>\n\n <label className=\"block space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Description</span>\n <Textarea value={form.description} onChange={(e) => onChange('description', e.target.value)} rows={2} />\n </label>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-3\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Discount Type</span>\n <Select value={form.discountType} onValueChange={(value) => onChange('discountType', value)}>\n <SelectTrigger aria-label=\"Discount Type\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"PERCENT\">Percentage (%)</SelectItem>\n <SelectItem value=\"FIXED\">Fixed amount</SelectItem>\n </SelectContent>\n </Select>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Discount Value</span>\n <Input\n type=\"number\"\n min=\"0\"\n step=\"any\"\n value={form.discountValue}\n onChange={(e) => onChange('discountValue', e.target.value)}\n required\n />\n <span className=\"text-xs text-text-secondary\">{valueHint}</span>\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Max Uses</span>\n <Input\n type=\"number\"\n min=\"0\"\n value={form.maxUses}\n onChange={(e) => onChange('maxUses', e.target.value)}\n placeholder=\"Unlimited\"\n />\n </label>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Starts At</span>\n <Input type=\"datetime-local\" value={form.startsAt} onChange={(e) => onChange('startsAt', e.target.value)} />\n </label>\n <label className=\"space-y-1 text-sm\">\n <span className=\"font-medium text-text-primary\">Ends At</span>\n <Input type=\"datetime-local\" value={form.endsAt} onChange={(e) => onChange('endsAt', e.target.value)} />\n </label>\n </div>\n\n <div className=\"flex items-center justify-between rounded-input border border-border-default bg-bg-surface px-3 py-2\">\n <div className=\"text-sm\">\n <span className=\"font-medium text-text-primary\">Active</span>\n <p className=\"text-xs text-text-secondary\">Only active codes can be redeemed at checkout.</p>\n </div>\n <Switch checked={form.isActive} onCheckedChange={(checked) => onChange('isActive', checked)} />\n </div>\n </EntityFormShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyCA,IAAMA,IAAiC;CACrC,SAAS;CACT,MAAM;CACN,aAAa;CACb,cAAc;CACd,eAAe;CACf,SAAS;CACT,UAAU;CACV,QAAQ;CACR,UAAU;AACZ;AAGA,SAASC,EAAgB,GAA6B;CACpD,IAAI,CAACC,GACH,OAAO;CAET,IAAMC,IAAO,IAAI,KAAKD,CAAG;CACzB,IAAI,OAAO,MAAMC,EAAK,QAAQ,CAAC,GAC7B,OAAO;CAET,IAAMC,IAAWD,EAAK,kBAAkB,IAAI;CAC5C,OAAO,IAAI,KAAKA,EAAK,QAAQ,IAAIC,CAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACtE;AAGA,SAASC,EAAgB,GAA8B;CACrD,IAAI,CAACC,GACH,OAAO;CAET,IAAMH,IAAO,IAAI,KAAKG,CAAK;CAI3B,OAHI,OAAO,MAAMH,EAAK,QAAQ,CAAC,IACtB,OAEFA,EAAK,YAAY;AAC1B;AAEA,SAASI,EAAY,GAAyC;CAC5D,OAAO;EACL,SAASC,EAAM,WAAW;EAC1B,MAAMA,EAAM,QAAQ;EACpB,aAAaA,EAAM,eAAe;EAClC,cAAcA,EAAM,gBAAgB;EACpC,eAAeA,EAAM,iBAAiB;EACtC,SAASA,EAAM,WAAW,OAA+B,KAAxB,OAAOA,EAAM,OAAO;EACrD,UAAUP,EAAgBO,EAAM,QAAQ;EACxC,QAAQP,EAAgBO,EAAM,MAAM;EACpC,UAAUA,EAAM,YAAY;CAC9B;AACF;AAEA,SAAwBC,IAAoB;CAC1C,IAAM,EAAE,QAAK,OAAOC,EAA0B,GACxCC,IAASC,QAAc,EAAQC,GAAK,CAACA,CAAE,CAAC,GACxC,EAAE,gBA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js";
|
|
6
6
|
import { useMemo as c, useState as l } from "react";
|
|
7
7
|
import { Fragment as ae, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Button as f, GlassCard as p, GradientText as oe, Input as m, PagePurpose as se, Select as ce, SelectContent as le, SelectItem as ue, SelectTrigger as de, SelectValue as fe, Stepper as pe } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { ArrowLeft as h, ArrowRight as me, BadgePercent as he, CalendarDays as ge, Check as _e, CheckCircle2 as ve, Minus as ye, Plus as be, Ticket as g, UserRound as xe } from "lucide-react";
|
|
10
10
|
// src/eventfullymanaged/pages/registration/RegisterAttendeePage.tsx
|
|
11
11
|
var _ = [
|
|
12
12
|
{
|
|
@@ -82,20 +82,20 @@ function v() {
|
|
|
82
82
|
};
|
|
83
83
|
return R ? /* @__PURE__ */ d("div", {
|
|
84
84
|
className: "mx-auto max-w-2xl space-y-6 p-6",
|
|
85
|
-
children: [/* @__PURE__ */ u("div", { children: /* @__PURE__ */ d(
|
|
85
|
+
children: [/* @__PURE__ */ u("div", { children: /* @__PURE__ */ d(f, {
|
|
86
86
|
type: "button",
|
|
87
87
|
variant: "ghost",
|
|
88
88
|
size: "sm",
|
|
89
89
|
onClick: () => v("/registration"),
|
|
90
|
-
children: [/* @__PURE__ */ u(
|
|
91
|
-
}) }), /* @__PURE__ */ d(
|
|
90
|
+
children: [/* @__PURE__ */ u(h, { className: "h-4 w-4" }), "Back to Registration"]
|
|
91
|
+
}) }), /* @__PURE__ */ d(p, {
|
|
92
92
|
treatment: "glass",
|
|
93
93
|
glow: !0,
|
|
94
94
|
className: "p-8 text-center",
|
|
95
95
|
children: [
|
|
96
96
|
/* @__PURE__ */ u("div", {
|
|
97
97
|
className: "mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-status-success-bg-subtle",
|
|
98
|
-
children: /* @__PURE__ */ u(
|
|
98
|
+
children: /* @__PURE__ */ u(ve, {
|
|
99
99
|
className: "h-8 w-8 text-status-success-text",
|
|
100
100
|
"aria-hidden": "true"
|
|
101
101
|
})
|
|
@@ -173,12 +173,12 @@ function v() {
|
|
|
173
173
|
}),
|
|
174
174
|
/* @__PURE__ */ d("div", {
|
|
175
175
|
className: "mt-8 flex flex-col justify-center gap-3 sm:flex-row",
|
|
176
|
-
children: [/* @__PURE__ */ u(
|
|
176
|
+
children: [/* @__PURE__ */ u(f, {
|
|
177
177
|
type: "button",
|
|
178
178
|
variant: "outline",
|
|
179
179
|
onClick: () => v("/registration"),
|
|
180
180
|
children: "Back to Registrations"
|
|
181
|
-
}), /* @__PURE__ */ u(
|
|
181
|
+
}), /* @__PURE__ */ u(f, {
|
|
182
182
|
type: "button",
|
|
183
183
|
onClick: () => {
|
|
184
184
|
z(null), Ze();
|
|
@@ -192,31 +192,31 @@ function v() {
|
|
|
192
192
|
className: "space-y-6 p-6",
|
|
193
193
|
children: [
|
|
194
194
|
/* @__PURE__ */ d("div", { children: [
|
|
195
|
-
/* @__PURE__ */ d(
|
|
195
|
+
/* @__PURE__ */ d(f, {
|
|
196
196
|
type: "button",
|
|
197
197
|
variant: "ghost",
|
|
198
198
|
size: "sm",
|
|
199
199
|
onClick: () => v("/registration"),
|
|
200
|
-
children: [/* @__PURE__ */ u(
|
|
200
|
+
children: [/* @__PURE__ */ u(h, { className: "h-4 w-4" }), "Back to Registration"]
|
|
201
201
|
}),
|
|
202
202
|
/* @__PURE__ */ u("h1", {
|
|
203
203
|
className: "mt-3 text-2xl font-bold text-text-primary",
|
|
204
|
-
children: /* @__PURE__ */ u(
|
|
204
|
+
children: /* @__PURE__ */ u(oe, { children: "Register Attendee" })
|
|
205
205
|
}),
|
|
206
206
|
/* @__PURE__ */ u("p", {
|
|
207
207
|
className: "mt-1 text-sm text-text-secondary",
|
|
208
208
|
children: "Walk through the event, ticket and attendee in a few quick steps."
|
|
209
209
|
})
|
|
210
210
|
] }),
|
|
211
|
-
/* @__PURE__ */ u(
|
|
212
|
-
/* @__PURE__ */ u(
|
|
211
|
+
/* @__PURE__ */ u(se, { 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." }),
|
|
212
|
+
/* @__PURE__ */ u(pe, {
|
|
213
213
|
steps: _,
|
|
214
214
|
active: y,
|
|
215
215
|
onStepClick: qe
|
|
216
216
|
}),
|
|
217
217
|
/* @__PURE__ */ d("div", {
|
|
218
218
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
|
|
219
|
-
children: [/* @__PURE__ */ d(
|
|
219
|
+
children: [/* @__PURE__ */ d(p, {
|
|
220
220
|
treatment: "plain",
|
|
221
221
|
className: "border-border-seam p-5 sm:p-6",
|
|
222
222
|
children: [
|
|
@@ -257,7 +257,7 @@ function v() {
|
|
|
257
257
|
children: [
|
|
258
258
|
/* @__PURE__ */ u("span", {
|
|
259
259
|
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"}`,
|
|
260
|
-
children: /* @__PURE__ */ u(
|
|
260
|
+
children: /* @__PURE__ */ u(ge, {
|
|
261
261
|
className: "h-5 w-5",
|
|
262
262
|
"aria-hidden": "true"
|
|
263
263
|
})
|
|
@@ -266,7 +266,7 @@ function v() {
|
|
|
266
266
|
className: "min-w-0 flex-1 truncate text-sm font-medium text-text-primary",
|
|
267
267
|
children: e.name
|
|
268
268
|
}),
|
|
269
|
-
t ? /* @__PURE__ */ u(
|
|
269
|
+
t ? /* @__PURE__ */ u(_e, {
|
|
270
270
|
className: "h-4 w-4 shrink-0 text-action-primary-bg",
|
|
271
271
|
"aria-hidden": "true"
|
|
272
272
|
}) : null
|
|
@@ -307,10 +307,10 @@ function v() {
|
|
|
307
307
|
children: [/* @__PURE__ */ u("span", {
|
|
308
308
|
className: "text-sm font-semibold text-text-primary",
|
|
309
309
|
children: e.name
|
|
310
|
-
}), t ? /* @__PURE__ */ u(
|
|
310
|
+
}), t ? /* @__PURE__ */ u(_e, {
|
|
311
311
|
className: "h-4 w-4 shrink-0 text-action-primary-bg",
|
|
312
312
|
"aria-hidden": "true"
|
|
313
|
-
}) : /* @__PURE__ */ u(
|
|
313
|
+
}) : /* @__PURE__ */ u(g, {
|
|
314
314
|
className: "h-4 w-4 shrink-0 text-text-muted",
|
|
315
315
|
"aria-hidden": "true"
|
|
316
316
|
})]
|
|
@@ -349,26 +349,26 @@ function v() {
|
|
|
349
349
|
}), /* @__PURE__ */ d("div", {
|
|
350
350
|
className: "flex items-center gap-1",
|
|
351
351
|
children: [
|
|
352
|
-
/* @__PURE__ */ u(
|
|
352
|
+
/* @__PURE__ */ u(f, {
|
|
353
353
|
type: "button",
|
|
354
354
|
variant: "outline",
|
|
355
355
|
size: "icon",
|
|
356
356
|
"aria-label": "Decrease quantity",
|
|
357
357
|
disabled: J <= 1,
|
|
358
358
|
onClick: () => j((e) => Math.max(1, e - 1)),
|
|
359
|
-
children: /* @__PURE__ */ u(
|
|
359
|
+
children: /* @__PURE__ */ u(ye, { className: "h-4 w-4" })
|
|
360
360
|
}),
|
|
361
361
|
/* @__PURE__ */ u("span", {
|
|
362
362
|
className: "w-10 text-center text-base font-semibold tabular-nums text-text-primary",
|
|
363
363
|
children: J
|
|
364
364
|
}),
|
|
365
|
-
/* @__PURE__ */ u(
|
|
365
|
+
/* @__PURE__ */ u(f, {
|
|
366
366
|
type: "button",
|
|
367
367
|
variant: "outline",
|
|
368
368
|
size: "icon",
|
|
369
369
|
"aria-label": "Increase quantity",
|
|
370
370
|
onClick: () => j((e) => e + 1),
|
|
371
|
-
children: /* @__PURE__ */ u(
|
|
371
|
+
children: /* @__PURE__ */ u(be, { className: "h-4 w-4" })
|
|
372
372
|
})
|
|
373
373
|
]
|
|
374
374
|
})]
|
|
@@ -406,13 +406,13 @@ function v() {
|
|
|
406
406
|
children: [/* @__PURE__ */ u("span", {
|
|
407
407
|
className: "font-medium text-text-primary",
|
|
408
408
|
children: "Attendee"
|
|
409
|
-
}), /* @__PURE__ */ d(
|
|
409
|
+
}), /* @__PURE__ */ d(ce, {
|
|
410
410
|
value: E,
|
|
411
411
|
onValueChange: D,
|
|
412
|
-
children: [/* @__PURE__ */ u(
|
|
412
|
+
children: [/* @__PURE__ */ u(de, {
|
|
413
413
|
"aria-label": "Attendee",
|
|
414
|
-
children: /* @__PURE__ */ u(
|
|
415
|
-
}), /* @__PURE__ */ u(
|
|
414
|
+
children: /* @__PURE__ */ u(fe, { placeholder: "Select an attendee" })
|
|
415
|
+
}), /* @__PURE__ */ u(le, { children: H.map((e) => /* @__PURE__ */ d(ue, {
|
|
416
416
|
value: e.id,
|
|
417
417
|
children: [
|
|
418
418
|
e.fullName,
|
|
@@ -429,7 +429,7 @@ function v() {
|
|
|
429
429
|
children: [/* @__PURE__ */ u("span", {
|
|
430
430
|
className: "font-medium text-text-primary",
|
|
431
431
|
children: "Full name"
|
|
432
|
-
}), /* @__PURE__ */ u(
|
|
432
|
+
}), /* @__PURE__ */ u(m, {
|
|
433
433
|
value: O,
|
|
434
434
|
onChange: (e) => Ce(e.target.value),
|
|
435
435
|
placeholder: "Enter full name"
|
|
@@ -440,7 +440,7 @@ function v() {
|
|
|
440
440
|
children: [/* @__PURE__ */ u("span", {
|
|
441
441
|
className: "font-medium text-text-primary",
|
|
442
442
|
children: "Email"
|
|
443
|
-
}), /* @__PURE__ */ u(
|
|
443
|
+
}), /* @__PURE__ */ u(m, {
|
|
444
444
|
type: "email",
|
|
445
445
|
value: k,
|
|
446
446
|
onChange: (e) => A(e.target.value),
|
|
@@ -452,7 +452,7 @@ function v() {
|
|
|
452
452
|
children: [/* @__PURE__ */ u("span", {
|
|
453
453
|
className: "font-medium text-text-primary",
|
|
454
454
|
children: "Company"
|
|
455
|
-
}), /* @__PURE__ */ u(
|
|
455
|
+
}), /* @__PURE__ */ u(m, {
|
|
456
456
|
value: we,
|
|
457
457
|
onChange: (e) => Te(e.target.value),
|
|
458
458
|
placeholder: "Enter company name"
|
|
@@ -463,7 +463,7 @@ function v() {
|
|
|
463
463
|
children: [/* @__PURE__ */ u("span", {
|
|
464
464
|
className: "font-medium text-text-primary",
|
|
465
465
|
children: "Phone"
|
|
466
|
-
}), /* @__PURE__ */ u(
|
|
466
|
+
}), /* @__PURE__ */ u(m, {
|
|
467
467
|
value: Ee,
|
|
468
468
|
onChange: (e) => De(e.target.value),
|
|
469
469
|
placeholder: "Optional"
|
|
@@ -480,7 +480,7 @@ function v() {
|
|
|
480
480
|
}),
|
|
481
481
|
/* @__PURE__ */ d("div", {
|
|
482
482
|
className: "flex flex-col gap-2 sm:flex-row",
|
|
483
|
-
children: [/* @__PURE__ */ u(
|
|
483
|
+
children: [/* @__PURE__ */ u(m, {
|
|
484
484
|
value: M,
|
|
485
485
|
onChange: (e) => {
|
|
486
486
|
N(e.target.value), I("");
|
|
@@ -490,12 +490,12 @@ function v() {
|
|
|
490
490
|
onKeyDown: (e) => {
|
|
491
491
|
e.key === "Enter" && (e.preventDefault(), Xe());
|
|
492
492
|
}
|
|
493
|
-
}), P ? /* @__PURE__ */ u(
|
|
493
|
+
}), P ? /* @__PURE__ */ u(f, {
|
|
494
494
|
type: "button",
|
|
495
495
|
variant: "outline",
|
|
496
496
|
onClick: $,
|
|
497
497
|
children: "Remove"
|
|
498
|
-
}) : /* @__PURE__ */ u(
|
|
498
|
+
}) : /* @__PURE__ */ u(f, {
|
|
499
499
|
type: "button",
|
|
500
500
|
variant: "outline",
|
|
501
501
|
onClick: Xe,
|
|
@@ -506,7 +506,7 @@ function v() {
|
|
|
506
506
|
P ? /* @__PURE__ */ d("span", {
|
|
507
507
|
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",
|
|
508
508
|
children: [
|
|
509
|
-
/* @__PURE__ */ u(
|
|
509
|
+
/* @__PURE__ */ u(he, {
|
|
510
510
|
className: "h-3.5 w-3.5",
|
|
511
511
|
"aria-hidden": "true"
|
|
512
512
|
}),
|
|
@@ -547,7 +547,7 @@ function v() {
|
|
|
547
547
|
/* @__PURE__ */ d("div", {
|
|
548
548
|
className: "flex items-center gap-3 p-3",
|
|
549
549
|
children: [
|
|
550
|
-
/* @__PURE__ */ u(
|
|
550
|
+
/* @__PURE__ */ u(ge, {
|
|
551
551
|
className: "h-4 w-4 text-text-muted",
|
|
552
552
|
"aria-hidden": "true"
|
|
553
553
|
}),
|
|
@@ -564,7 +564,7 @@ function v() {
|
|
|
564
564
|
/* @__PURE__ */ d("div", {
|
|
565
565
|
className: "flex items-center gap-3 p-3",
|
|
566
566
|
children: [
|
|
567
|
-
/* @__PURE__ */ u(
|
|
567
|
+
/* @__PURE__ */ u(g, {
|
|
568
568
|
className: "h-4 w-4 text-text-muted",
|
|
569
569
|
"aria-hidden": "true"
|
|
570
570
|
}),
|
|
@@ -581,7 +581,7 @@ function v() {
|
|
|
581
581
|
/* @__PURE__ */ d("div", {
|
|
582
582
|
className: "flex items-center gap-3 p-3",
|
|
583
583
|
children: [
|
|
584
|
-
/* @__PURE__ */ u(
|
|
584
|
+
/* @__PURE__ */ u(xe, {
|
|
585
585
|
className: "h-4 w-4 text-text-muted",
|
|
586
586
|
"aria-hidden": "true"
|
|
587
587
|
}),
|
|
@@ -607,7 +607,7 @@ function v() {
|
|
|
607
607
|
className: "font-medium text-text-primary",
|
|
608
608
|
children: "Billing account ID (optional)"
|
|
609
609
|
}),
|
|
610
|
-
/* @__PURE__ */ u(
|
|
610
|
+
/* @__PURE__ */ u(m, {
|
|
611
611
|
value: L,
|
|
612
612
|
onChange: (e) => Ae(e.target.value),
|
|
613
613
|
placeholder: "Attach an existing billing account"
|
|
@@ -622,17 +622,17 @@ function v() {
|
|
|
622
622
|
}) : null,
|
|
623
623
|
/* @__PURE__ */ d("div", {
|
|
624
624
|
className: "mt-6 flex items-center justify-between gap-3 border-t border-border-seam pt-4",
|
|
625
|
-
children: [/* @__PURE__ */ d(
|
|
625
|
+
children: [/* @__PURE__ */ d(f, {
|
|
626
626
|
type: "button",
|
|
627
627
|
variant: "ghost",
|
|
628
628
|
onClick: Ye,
|
|
629
629
|
disabled: y === 0 || W,
|
|
630
|
-
children: [/* @__PURE__ */ u(
|
|
631
|
-
}), y < _.length - 1 ? /* @__PURE__ */ d(
|
|
630
|
+
children: [/* @__PURE__ */ u(h, { className: "h-4 w-4" }), "Back"]
|
|
631
|
+
}), y < _.length - 1 ? /* @__PURE__ */ d(f, {
|
|
632
632
|
type: "button",
|
|
633
633
|
onClick: Je,
|
|
634
|
-
children: ["Continue", /* @__PURE__ */ u(
|
|
635
|
-
}) : /* @__PURE__ */ d(
|
|
634
|
+
children: ["Continue", /* @__PURE__ */ u(me, { className: "h-4 w-4" })]
|
|
635
|
+
}) : /* @__PURE__ */ d(f, {
|
|
636
636
|
type: "button",
|
|
637
637
|
onClick: async () => {
|
|
638
638
|
if (!x || !S) s.error("Incomplete", "Pick an event and ticket first.");
|
|
@@ -685,11 +685,11 @@ function v() {
|
|
|
685
685
|
}
|
|
686
686
|
},
|
|
687
687
|
disabled: W,
|
|
688
|
-
children: [/* @__PURE__ */ u(
|
|
688
|
+
children: [/* @__PURE__ */ u(g, { className: "h-4 w-4" }), W ? "Registering…" : "Confirm registration"]
|
|
689
689
|
})]
|
|
690
690
|
})
|
|
691
691
|
]
|
|
692
|
-
}), /* @__PURE__ */ d(
|
|
692
|
+
}), /* @__PURE__ */ d(p, {
|
|
693
693
|
treatment: "glass",
|
|
694
694
|
className: "h-fit p-5 lg:sticky lg:top-6",
|
|
695
695
|
children: [/* @__PURE__ */ u("h2", {
|