@burdenoff/microfe-atheletebridge 2026.1103.2 → 2026.1107.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts +6 -0
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.d.ts.map +1 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +23 -11
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -1
- package/dist/atheletebridge/components/registration/entryRules.d.ts +2 -0
- package/dist/atheletebridge/components/registration/entryRules.d.ts.map +1 -1
- package/dist/atheletebridge/components/registration/entryRules.js +2 -1
- package/dist/atheletebridge/components/registration/entryRules.js.map +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts +2 -2
- package/dist/atheletebridge/hooks/useRegistrationApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.js +1 -1
- package/dist/atheletebridge/hooks/useRegistrationApi.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +4 -2
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +132 -107
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/types/registration.d.ts +11 -0
- package/dist/atheletebridge/types/registration.d.ts.map +1 -1
- package/dist/atheletebridge/utils/registration.d.ts +19 -0
- package/dist/atheletebridge/utils/registration.d.ts.map +1 -1
- package/dist/atheletebridge/utils/registration.js +28 -1
- package/dist/atheletebridge/utils/registration.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,16 +6,16 @@ import { ErrorState as i, LoadingState as a } from "../../components/LoadingStat
|
|
|
6
6
|
import { FormField as o, fieldInputClass as s } from "../../components/form.js";
|
|
7
7
|
import { useRecordRegistrationPayment as c, useRefundRegistrationPayment as l, useRegistrationForm as u, useRegistrationPayments as d, useRegistrationSubmission as f, useReviewRegistration as p, useVoidRegistrationPayment as m } from "../../hooks/useRegistrationApi.js";
|
|
8
8
|
import { formatMoney as h, minorToInput as g, parseMoney as _ } from "../../utils/money.js";
|
|
9
|
-
import { PAYMENT_METHODS as v, paymentMethodLabel as y } from "../../utils/registration.js";
|
|
10
|
-
import { useState as
|
|
11
|
-
import { ArrowLeft as
|
|
12
|
-
import { useParams as
|
|
13
|
-
import { jsx as
|
|
9
|
+
import { PAYMENT_METHODS as v, paymentMethodLabel as y, rosterNotice as b } from "../../utils/registration.js";
|
|
10
|
+
import { useState as x } from "react";
|
|
11
|
+
import { AlertTriangle as S, ArrowLeft as C, Ban as w, Check as T, Loader2 as E, Plus as D, RotateCcw as O, Users as k, X as A } from "lucide-react";
|
|
12
|
+
import { useParams as j } from "react-router";
|
|
13
|
+
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
14
14
|
//#region src/atheletebridge/pages/registrations/RegistrationSubmissionPage.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let t = p(), [n, i] =
|
|
18
|
-
if (e.status === "WITHDRAWN") return /* @__PURE__ */
|
|
15
|
+
var P = "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50", F = "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50", I = (e, t) => e instanceof Error ? e.message : t;
|
|
16
|
+
function L({ submission: e }) {
|
|
17
|
+
let t = p(), [n, i] = x(e.reviewNotes ?? ""), [a, c] = x(null);
|
|
18
|
+
if (e.status === "WITHDRAWN") return /* @__PURE__ */ M("p", {
|
|
19
19
|
className: "text-sm text-text-secondary",
|
|
20
20
|
children: "The family withdrew this registration."
|
|
21
21
|
});
|
|
@@ -28,17 +28,17 @@ function P({ submission: e }) {
|
|
|
28
28
|
notes: n.trim() || void 0
|
|
29
29
|
});
|
|
30
30
|
} catch (e) {
|
|
31
|
-
c(
|
|
31
|
+
c(I(e, "Could not save the decision."));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ N("div", {
|
|
35
35
|
className: "space-y-3",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ M(o, {
|
|
38
38
|
label: "Review notes",
|
|
39
39
|
htmlFor: "reviewNotes",
|
|
40
40
|
hint: "Visible to club staff only.",
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ M("textarea", {
|
|
42
42
|
id: "reviewNotes",
|
|
43
43
|
rows: 2,
|
|
44
44
|
className: s,
|
|
@@ -46,27 +46,27 @@ function P({ submission: e }) {
|
|
|
46
46
|
onChange: (e) => i(e.target.value)
|
|
47
47
|
})
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ N("div", {
|
|
50
50
|
className: "flex flex-wrap gap-2",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ N("button", {
|
|
52
52
|
type: "button",
|
|
53
|
-
className:
|
|
53
|
+
className: F,
|
|
54
54
|
disabled: t.isPending || e.status === "ACCEPTED",
|
|
55
55
|
onClick: () => void l("ACCEPT"),
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
}), /* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ M(T, { className: "h-4 w-4" }), " Accept"]
|
|
57
|
+
}), /* @__PURE__ */ N("button", {
|
|
58
58
|
type: "button",
|
|
59
|
-
className:
|
|
59
|
+
className: P,
|
|
60
60
|
disabled: t.isPending || e.status === "DECLINED",
|
|
61
61
|
onClick: () => void l("DECLINE"),
|
|
62
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ M(A, { className: "h-4 w-4" }), " Decline"]
|
|
63
63
|
})]
|
|
64
64
|
}),
|
|
65
|
-
e.reviewedAt && /* @__PURE__ */
|
|
65
|
+
e.reviewedAt && /* @__PURE__ */ N("p", {
|
|
66
66
|
className: "text-xs text-text-secondary",
|
|
67
67
|
children: ["Last reviewed ", r(e.reviewedAt)]
|
|
68
68
|
}),
|
|
69
|
-
a && /* @__PURE__ */
|
|
69
|
+
a && /* @__PURE__ */ M("p", {
|
|
70
70
|
role: "alert",
|
|
71
71
|
className: "text-sm text-status-error-text",
|
|
72
72
|
children: a
|
|
@@ -74,9 +74,36 @@ function P({ submission: e }) {
|
|
|
74
74
|
]
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
return /* @__PURE__ */
|
|
77
|
+
function R({ submission: t, formTeamId: n }) {
|
|
78
|
+
let { navigateTo: r } = e(), i = b(t);
|
|
79
|
+
if (!i) return t.status !== "ACCEPTED" || t.rosterOutcome || !n ? null : /* @__PURE__ */ M("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
className: `${P} mt-4 w-full justify-center`,
|
|
82
|
+
onClick: () => r(`/teams/${n}`),
|
|
83
|
+
children: "Open the team roster to add this athlete"
|
|
84
|
+
});
|
|
85
|
+
let a = i.tone === "success";
|
|
86
|
+
return /* @__PURE__ */ N("div", {
|
|
87
|
+
role: "status",
|
|
88
|
+
"data-testid": "registration-roster-notice",
|
|
89
|
+
className: `mt-4 space-y-2 rounded-lg border p-3 text-sm ${a ? "border-status-success-border bg-status-success-bg-subtle text-status-success-text" : "border-status-warning-border bg-status-warning-bg-subtle text-status-warning-text"}`,
|
|
90
|
+
children: [/* @__PURE__ */ N("p", {
|
|
91
|
+
className: "flex items-start gap-2",
|
|
92
|
+
children: [M(a ? T : S, {
|
|
93
|
+
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
94
|
+
"aria-hidden": "true"
|
|
95
|
+
}), /* @__PURE__ */ M("span", { children: i.message })]
|
|
96
|
+
}), i.teamId && /* @__PURE__ */ N("button", {
|
|
97
|
+
type: "button",
|
|
98
|
+
className: `${P} w-full justify-center`,
|
|
99
|
+
onClick: () => r(`/teams/${i.teamId}`),
|
|
100
|
+
children: [/* @__PURE__ */ M(k, { className: "h-4 w-4" }), " Open the team roster"]
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function z({ submission: e }) {
|
|
105
|
+
let t = c(), [n, r] = x(g(e.amountOutstanding, e.currency)), [i, a] = x("CASH"), [l, u] = x(""), [d, f] = x(null);
|
|
106
|
+
return /* @__PURE__ */ N("form", {
|
|
80
107
|
onSubmit: async (r) => {
|
|
81
108
|
r.preventDefault(), f(null);
|
|
82
109
|
let a = _(n, e.currency);
|
|
@@ -92,16 +119,16 @@ function F({ submission: e }) {
|
|
|
92
119
|
reference: l.trim() || void 0
|
|
93
120
|
}), u("");
|
|
94
121
|
} catch (e) {
|
|
95
|
-
f(
|
|
122
|
+
f(I(e, "Could not record the payment."));
|
|
96
123
|
}
|
|
97
124
|
},
|
|
98
125
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-[9rem_12rem_1fr_auto]",
|
|
99
126
|
"aria-label": "Record a payment",
|
|
100
127
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ M(o, {
|
|
102
129
|
label: `Amount (${e.currency})`,
|
|
103
130
|
htmlFor: "paymentAmount",
|
|
104
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ M("input", {
|
|
105
132
|
id: "paymentAmount",
|
|
106
133
|
inputMode: "decimal",
|
|
107
134
|
className: s,
|
|
@@ -109,24 +136,24 @@ function F({ submission: e }) {
|
|
|
109
136
|
onChange: (e) => r(e.target.value)
|
|
110
137
|
})
|
|
111
138
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ M(o, {
|
|
113
140
|
label: "Method",
|
|
114
141
|
htmlFor: "paymentMethod",
|
|
115
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ M("select", {
|
|
116
143
|
id: "paymentMethod",
|
|
117
144
|
className: s,
|
|
118
145
|
value: i,
|
|
119
146
|
onChange: (e) => a(e.target.value),
|
|
120
|
-
children: v.map((e) => /* @__PURE__ */
|
|
147
|
+
children: v.map((e) => /* @__PURE__ */ M("option", {
|
|
121
148
|
value: e,
|
|
122
149
|
children: y(e)
|
|
123
150
|
}, e))
|
|
124
151
|
})
|
|
125
152
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ M(o, {
|
|
127
154
|
label: "Reference",
|
|
128
155
|
htmlFor: "paymentReference",
|
|
129
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ M("input", {
|
|
130
157
|
id: "paymentReference",
|
|
131
158
|
className: s,
|
|
132
159
|
value: l,
|
|
@@ -134,20 +161,20 @@ function F({ submission: e }) {
|
|
|
134
161
|
placeholder: "Receipt / bank / cheque no."
|
|
135
162
|
})
|
|
136
163
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ M("div", {
|
|
138
165
|
className: "flex items-end",
|
|
139
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ N("button", {
|
|
140
167
|
type: "submit",
|
|
141
|
-
className:
|
|
168
|
+
className: F,
|
|
142
169
|
disabled: t.isPending,
|
|
143
170
|
children: [
|
|
144
|
-
t.isPending ? /* @__PURE__ */
|
|
171
|
+
t.isPending ? /* @__PURE__ */ M(E, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ M(D, { className: "h-4 w-4" }),
|
|
145
172
|
" ",
|
|
146
173
|
"Record"
|
|
147
174
|
]
|
|
148
175
|
})
|
|
149
176
|
}),
|
|
150
|
-
d && /* @__PURE__ */
|
|
177
|
+
d && /* @__PURE__ */ M("p", {
|
|
151
178
|
role: "alert",
|
|
152
179
|
className: "text-sm text-status-error-text sm:col-span-4",
|
|
153
180
|
children: d
|
|
@@ -155,8 +182,8 @@ function F({ submission: e }) {
|
|
|
155
182
|
]
|
|
156
183
|
});
|
|
157
184
|
}
|
|
158
|
-
function
|
|
159
|
-
let t = m(), i = l(), [a, o] =
|
|
185
|
+
function B({ payment: e }) {
|
|
186
|
+
let t = m(), i = l(), [a, o] = x(null), s = e.amount - e.refundedAmount, c = async () => {
|
|
160
187
|
let n = window.prompt("Why is this payment being voided?");
|
|
161
188
|
if (n?.trim()) {
|
|
162
189
|
o(null);
|
|
@@ -166,7 +193,7 @@ function I({ payment: e }) {
|
|
|
166
193
|
reason: n.trim()
|
|
167
194
|
});
|
|
168
195
|
} catch (e) {
|
|
169
|
-
o(
|
|
196
|
+
o(I(e, "Could not void the payment."));
|
|
170
197
|
}
|
|
171
198
|
}
|
|
172
199
|
}, u = async () => {
|
|
@@ -191,26 +218,26 @@ function I({ payment: e }) {
|
|
|
191
218
|
reason: r.trim()
|
|
192
219
|
});
|
|
193
220
|
} catch (e) {
|
|
194
|
-
o(
|
|
221
|
+
o(I(e, "Could not record the refund."));
|
|
195
222
|
}
|
|
196
223
|
}
|
|
197
224
|
}, d = t.isPending || i.isPending;
|
|
198
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ N("li", {
|
|
199
226
|
className: "space-y-1 px-4 py-3",
|
|
200
227
|
"data-testid": "registration-payment",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ N("div", {
|
|
202
229
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ N("span", {
|
|
204
231
|
className: "min-w-0",
|
|
205
232
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ N("span", {
|
|
207
234
|
className: "block text-sm font-medium tabular-nums text-text-primary",
|
|
208
|
-
children: [h(e.amount, e.currency), e.refundedAmount > 0 && /* @__PURE__ */
|
|
235
|
+
children: [h(e.amount, e.currency), e.refundedAmount > 0 && /* @__PURE__ */ N("span", {
|
|
209
236
|
className: "ml-2 text-xs text-text-secondary",
|
|
210
237
|
children: ["refunded ", h(e.refundedAmount, e.currency)]
|
|
211
238
|
})]
|
|
212
239
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ N("span", {
|
|
214
241
|
className: "block text-xs text-text-secondary",
|
|
215
242
|
children: [
|
|
216
243
|
y(e.method),
|
|
@@ -219,59 +246,59 @@ function I({ payment: e }) {
|
|
|
219
246
|
e.reference ? ` · ${e.reference}` : ""
|
|
220
247
|
]
|
|
221
248
|
}),
|
|
222
|
-
e.voidReason && /* @__PURE__ */
|
|
249
|
+
e.voidReason && /* @__PURE__ */ N("span", {
|
|
223
250
|
className: "block text-xs text-text-secondary",
|
|
224
251
|
children: ["Voided: ", e.voidReason]
|
|
225
252
|
}),
|
|
226
|
-
e.refundReason && /* @__PURE__ */
|
|
253
|
+
e.refundReason && /* @__PURE__ */ N("span", {
|
|
227
254
|
className: "block text-xs text-text-secondary",
|
|
228
255
|
children: ["Refund: ", e.refundReason]
|
|
229
256
|
})
|
|
230
257
|
]
|
|
231
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ N("span", {
|
|
232
259
|
className: "flex items-center gap-2",
|
|
233
260
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
e.status !== "VOIDED" && s > 0 && /* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ M(n, { status: e.status }),
|
|
262
|
+
e.status !== "VOIDED" && s > 0 && /* @__PURE__ */ N("button", {
|
|
236
263
|
type: "button",
|
|
237
|
-
className:
|
|
264
|
+
className: P,
|
|
238
265
|
disabled: d,
|
|
239
266
|
onClick: () => void u(),
|
|
240
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ M(O, { className: "h-4 w-4" }), " Refund"]
|
|
241
268
|
}),
|
|
242
|
-
e.status === "RECORDED" && e.refundedAmount === 0 && /* @__PURE__ */
|
|
269
|
+
e.status === "RECORDED" && e.refundedAmount === 0 && /* @__PURE__ */ N("button", {
|
|
243
270
|
type: "button",
|
|
244
|
-
className:
|
|
271
|
+
className: P,
|
|
245
272
|
disabled: d,
|
|
246
273
|
onClick: () => void c(),
|
|
247
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ M(w, { className: "h-4 w-4" }), " Void"]
|
|
248
275
|
})
|
|
249
276
|
]
|
|
250
277
|
})]
|
|
251
|
-
}), a && /* @__PURE__ */
|
|
278
|
+
}), a && /* @__PURE__ */ M("p", {
|
|
252
279
|
role: "alert",
|
|
253
280
|
className: "text-sm text-status-error-text",
|
|
254
281
|
children: a
|
|
255
282
|
})]
|
|
256
283
|
});
|
|
257
284
|
}
|
|
258
|
-
function
|
|
285
|
+
function V({ submission: e }) {
|
|
259
286
|
let t = d(e.id);
|
|
260
|
-
return t.isError ? null : /* @__PURE__ */
|
|
287
|
+
return t.isError ? null : /* @__PURE__ */ N("section", {
|
|
261
288
|
className: "space-y-4 rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
262
289
|
"aria-label": "Payments",
|
|
263
290
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ N("div", {
|
|
265
292
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ M("h2", {
|
|
267
294
|
className: "text-base font-semibold text-text-primary",
|
|
268
295
|
children: "Payments"
|
|
269
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ N("span", {
|
|
270
297
|
className: "text-sm text-text-secondary",
|
|
271
298
|
children: [
|
|
272
299
|
"Paid",
|
|
273
300
|
" ",
|
|
274
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ M("strong", {
|
|
275
302
|
className: "tabular-nums text-text-primary",
|
|
276
303
|
children: h(e.amountPaid, e.currency)
|
|
277
304
|
}),
|
|
@@ -280,103 +307,103 @@ function L({ submission: e }) {
|
|
|
280
307
|
h(e.amountDue, e.currency),
|
|
281
308
|
" ·",
|
|
282
309
|
" ",
|
|
283
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ N("span", {
|
|
284
311
|
"data-testid": "submission-outstanding",
|
|
285
312
|
children: [h(e.amountOutstanding, e.currency), " outstanding"]
|
|
286
313
|
})
|
|
287
314
|
]
|
|
288
315
|
})]
|
|
289
316
|
}),
|
|
290
|
-
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */
|
|
291
|
-
t.isLoading ? /* @__PURE__ */
|
|
317
|
+
e.amountOutstanding > 0 && e.status !== "WITHDRAWN" && /* @__PURE__ */ M(z, { submission: e }, `${e.id}-${e.amountOutstanding}`),
|
|
318
|
+
t.isLoading ? /* @__PURE__ */ M(a, { label: "Loading payments…" }) : (t.data ?? []).length === 0 ? /* @__PURE__ */ M("p", {
|
|
292
319
|
className: "text-sm text-text-secondary",
|
|
293
320
|
children: "No payments recorded yet."
|
|
294
|
-
}) : /* @__PURE__ */
|
|
321
|
+
}) : /* @__PURE__ */ M("ul", {
|
|
295
322
|
className: "divide-y divide-border-seam rounded-lg border border-border-seam",
|
|
296
|
-
children: (t.data ?? []).map((e) => /* @__PURE__ */
|
|
323
|
+
children: (t.data ?? []).map((e) => /* @__PURE__ */ M(B, { payment: e }, e.id))
|
|
297
324
|
})
|
|
298
325
|
]
|
|
299
326
|
});
|
|
300
327
|
}
|
|
301
|
-
function
|
|
302
|
-
let { id: o, submissionId: s } =
|
|
303
|
-
if (l.isLoading) return /* @__PURE__ */
|
|
328
|
+
function H() {
|
|
329
|
+
let { id: o, submissionId: s } = j(), { navigateTo: c } = e(), l = f(s), d = u(o);
|
|
330
|
+
if (l.isLoading) return /* @__PURE__ */ M(t, {
|
|
304
331
|
title: "Registration",
|
|
305
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ M(a, { label: "Loading registration…" })
|
|
306
333
|
});
|
|
307
|
-
if (l.isError || !l.data) return /* @__PURE__ */
|
|
334
|
+
if (l.isError || !l.data) return /* @__PURE__ */ M(t, {
|
|
308
335
|
title: "Registration",
|
|
309
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ M(i, {
|
|
310
337
|
title: "Registration not found",
|
|
311
338
|
message: "This registration does not exist or you do not have access to it.",
|
|
312
339
|
onRetry: () => c(o ? `/registrations/${o}` : "/registrations")
|
|
313
340
|
})
|
|
314
341
|
});
|
|
315
342
|
let p = l.data, m = d.data?.fields ?? [], g = d.data?.fees ?? [], _ = (e) => m.find((t) => t.key === e)?.label ?? e, v = [...m.map((e) => e.key).filter((e) => e in p.answers), ...Object.keys(p.answers).filter((e) => !m.some((t) => t.key === e))];
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
title: /* @__PURE__ */
|
|
343
|
+
return /* @__PURE__ */ M(t, {
|
|
344
|
+
title: /* @__PURE__ */ N("span", {
|
|
318
345
|
className: "flex flex-wrap items-center gap-3",
|
|
319
346
|
children: [
|
|
320
347
|
p.participantName,
|
|
321
348
|
" ",
|
|
322
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ M(n, { status: p.status }),
|
|
323
350
|
" ",
|
|
324
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ M(n, { status: p.paymentStatus })
|
|
325
352
|
]
|
|
326
353
|
}),
|
|
327
354
|
description: `${p.formTitle} · submitted ${r(p.submittedAt)} · ${p.source === "STAFF_ENTRY" ? "entered by staff" : "via share link"}`,
|
|
328
|
-
actions: /* @__PURE__ */
|
|
355
|
+
actions: /* @__PURE__ */ N("button", {
|
|
329
356
|
type: "button",
|
|
330
|
-
className:
|
|
357
|
+
className: P,
|
|
331
358
|
onClick: () => c(`/registrations/${p.formId}`),
|
|
332
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ M(C, { className: "h-4 w-4" }), " Back to form"]
|
|
333
360
|
}),
|
|
334
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ N("div", {
|
|
335
362
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[1fr_22rem]",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ N("div", {
|
|
337
364
|
className: "space-y-6",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ N("section", {
|
|
339
366
|
className: "rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
340
367
|
"aria-label": "Answers",
|
|
341
368
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ M("h2", {
|
|
343
370
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
344
371
|
children: "Details"
|
|
345
372
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ N("dl", {
|
|
347
374
|
className: "grid grid-cols-1 gap-x-6 gap-y-3 text-sm sm:grid-cols-2",
|
|
348
375
|
children: [[
|
|
349
376
|
["Contact", p.contactName],
|
|
350
377
|
["Email", p.contactEmail],
|
|
351
378
|
["Phone", p.contactPhone],
|
|
352
379
|
["Waiver accepted", p.waiverAcceptedAt ? r(p.waiverAcceptedAt) : null]
|
|
353
|
-
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */
|
|
380
|
+
].filter(([, e]) => e).map(([e, t]) => /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
354
381
|
className: "text-xs text-text-secondary",
|
|
355
382
|
children: e
|
|
356
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ M("dd", {
|
|
357
384
|
className: "text-text-primary",
|
|
358
385
|
children: t
|
|
359
386
|
})] }, e)), v.map((e) => {
|
|
360
387
|
let t = p.answers[e];
|
|
361
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ N("div", { children: [/* @__PURE__ */ M("dt", {
|
|
362
389
|
className: "text-xs text-text-secondary",
|
|
363
390
|
children: _(e)
|
|
364
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ M("dd", {
|
|
365
392
|
className: "text-text-primary",
|
|
366
393
|
children: typeof t == "boolean" ? t ? "Yes" : "No" : String(t)
|
|
367
394
|
})] }, e);
|
|
368
395
|
})]
|
|
369
396
|
}),
|
|
370
|
-
g.length > 0 && /* @__PURE__ */
|
|
397
|
+
g.length > 0 && /* @__PURE__ */ N("div", {
|
|
371
398
|
className: "mt-4 border-t border-border-seam pt-3",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ M("p", {
|
|
373
400
|
className: "mb-2 text-xs text-text-secondary",
|
|
374
401
|
children: "Fees"
|
|
375
|
-
}), /* @__PURE__ */
|
|
402
|
+
}), /* @__PURE__ */ M("ul", {
|
|
376
403
|
className: "space-y-1 text-sm",
|
|
377
|
-
children: g.filter((e) => p.selectedFeeIds.includes(e.id)).map((e) => /* @__PURE__ */
|
|
404
|
+
children: g.filter((e) => p.selectedFeeIds.includes(e.id)).map((e) => /* @__PURE__ */ N("li", {
|
|
378
405
|
className: "flex justify-between text-text-primary",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ M("span", { children: e.name }), /* @__PURE__ */ M("span", {
|
|
380
407
|
className: "tabular-nums",
|
|
381
408
|
children: h(e.amount, p.currency)
|
|
382
409
|
})]
|
|
@@ -384,21 +411,19 @@ function R() {
|
|
|
384
411
|
})]
|
|
385
412
|
})
|
|
386
413
|
]
|
|
387
|
-
}), /* @__PURE__ */
|
|
388
|
-
}), /* @__PURE__ */
|
|
414
|
+
}), /* @__PURE__ */ M(V, { submission: p })]
|
|
415
|
+
}), /* @__PURE__ */ N("section", {
|
|
389
416
|
className: "h-fit rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
390
417
|
"aria-label": "Review",
|
|
391
418
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ M("h2", {
|
|
393
420
|
className: "mb-3 text-base font-semibold text-text-primary",
|
|
394
421
|
children: "Review"
|
|
395
422
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
onClick: () => c(`/teams/${d.data?.teamId}`),
|
|
401
|
-
children: "Open the team roster to add this athlete"
|
|
423
|
+
/* @__PURE__ */ M(L, { submission: p }, p.id),
|
|
424
|
+
/* @__PURE__ */ M(R, {
|
|
425
|
+
submission: p,
|
|
426
|
+
formTeamId: d.data?.teamId ?? null
|
|
402
427
|
})
|
|
403
428
|
]
|
|
404
429
|
})]
|
|
@@ -406,6 +431,6 @@ function R() {
|
|
|
406
431
|
});
|
|
407
432
|
}
|
|
408
433
|
//#endregion
|
|
409
|
-
export {
|
|
434
|
+
export { H as RegistrationSubmissionPage };
|
|
410
435
|
|
|
411
436
|
//# sourceMappingURL=RegistrationSubmissionPage.js.map
|