@alfadocs/ui-kit 1.73.3 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/alia-sidebar-CsTRAxC8.js +1323 -0
- package/dist/_chunks/{anamnesis-summary-rows-BedVmSAB.js → anamnesis-summary-rows-vNDyE5HW.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-DW_qkGo1.js → antenatal-schedule-timeline-BGewPfEX.js} +18 -18
- package/dist/_chunks/{appointment-timeline-CKwMXUid.js → appointment-timeline-1-Za2miy.js} +2 -2
- package/dist/_chunks/{ar-pLopgMbL.js → ar-C4YQVTH6.js} +2 -2
- package/dist/_chunks/{auth-form-parts-DHv6LVV2.js → auth-form-parts-B3GWChvG.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-DG5JWB2p.js → balance-badge-cell-B49xgL6H.js} +2 -2
- package/dist/_chunks/{booking-4BCeh7OY.js → booking-sq9sa29d.js} +8 -8
- package/dist/_chunks/brand-mark-DLk9kD8g.js +63 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-Lji2y0qJ.js → calendar-appointment-editor-dialog-CctI6mpd.js} +8 -8
- package/dist/_chunks/{cycle-calculator-Ycp3li61.js → cycle-calculator-HO3s5InI.js} +5 -5
- package/dist/_chunks/{date-picker-KcoNNsM0.js → date-picker-CdhXlgVI.js} +4 -4
- package/dist/_chunks/{date-picker-variants-DN37Oj5-.js → date-picker-variants-Dt6UbonG.js} +25 -25
- package/dist/_chunks/{date-range-picker-CjcjUJLW.js → date-range-picker-B_j4VQlV.js} +5 -5
- package/dist/_chunks/{date-time-picker-BVQNZ4yC.js → date-time-picker-n-yrlMJq.js} +3 -3
- package/dist/_chunks/{de-lVkJRPnh.js → de-B1B3PIgY.js} +2 -2
- package/dist/_chunks/{due-date-calculator-B0gyOijA.js → due-date-calculator-CDWTSblh.js} +6 -6
- package/dist/_chunks/{el-CHzxNWPj.js → el-iLqGpapg.js} +16 -16
- package/dist/_chunks/{en-GB-CwxYmmhU.js → en-GB-CxPRQbD6.js} +6 -6
- package/dist/_chunks/{es-Ck-oxbHW.js → es-Bg1oqwDs.js} +2 -2
- package/dist/_chunks/{forgot-password-form-D6kB72OD.js → forgot-password-form-BSOZVrZG.js} +3 -3
- package/dist/_chunks/{format-D-1gTdHF.js → format--x5jypvH.js} +13 -13
- package/dist/_chunks/{fr-fWRnDcSD.js → fr-DpGxyOGI.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-Bu_a-K9z.js → gestational-age-calculator-CTHeJJdb.js} +7 -7
- package/dist/_chunks/{hcg-doubling-BnopYgd-.js → hcg-doubling-BBk-a33g.js} +11 -11
- package/dist/_chunks/{hi-B5uX0h3V.js → hi-3Dtsksrw.js} +2 -2
- package/dist/_chunks/{isSameWeek-u81Z-J7h.js → isSameWeek-DyVftHWi.js} +2 -2
- package/dist/_chunks/{it-DBoNIelY.js → it-Cp0CA13d.js} +3 -3
- package/dist/_chunks/{ja-Du8gfg8p.js → ja-9FOyR1lb.js} +22 -22
- package/dist/_chunks/{kit-extensions-DgBi3tsK.js → kit-extensions-sNTZWkoo.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-BDxxpfJM.js → link-cell-renderer-B0riA_h_.js} +2 -2
- package/dist/_chunks/{login-dev-card-pnJbVaoQ.js → login-dev-card-DRxTPkE9.js} +3 -3
- package/dist/_chunks/{nl-BCBwxYi8.js → nl-sfx-zJgR.js} +2 -2
- package/dist/_chunks/{notes-panel-C_QshXyI.js → notes-panel-CxjMovCh.js} +2 -2
- package/dist/_chunks/{parse-UB4FJGNA.js → parse-B0s7bY4d.js} +3 -3
- package/dist/_chunks/{parseISO-y3LncvfO.js → parseISO-DZZ5a-zK.js} +2 -2
- package/dist/_chunks/{patient-details-Cd_dCqkg.js → patient-details-Dgd_tocD.js} +2 -2
- package/dist/_chunks/{patient-field-row-D6Ftm46u.js → patient-field-row-BFVlJnS9.js} +3 -3
- package/dist/_chunks/{patient-summary-card-BSOHR4Ol.js → patient-summary-card-BTKvFUmh.js} +2 -2
- package/dist/_chunks/{phone-input-O9camxkq.js → phone-input-EwVuqFik.js} +74 -74
- package/dist/_chunks/{pl-HwLM6gPs.js → pl-BLh7KO-s.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-CvNFirHt.js → pregnancy-dating-JBAUbM40.js} +7 -7
- package/dist/_chunks/{pt-BxhT5ZQH.js → pt-CPKOrOLj.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-ESnkuDfH.js → radiograph-panel.agent-DQh2SX8G.js} +3 -3
- package/dist/_chunks/registration-form-B6qqeXP1.js +1310 -0
- package/dist/_chunks/{rich-text-editor-BXFgcvBW.js → rich-text-editor-BZTyxQBd.js} +1683 -1673
- package/dist/_chunks/{ro-Do9W55ae.js → ro-Dc-oNqbF.js} +2 -2
- package/dist/_chunks/{ru-PDBX5gdf.js → ru-BtNpDZRR.js} +3 -3
- package/dist/_chunks/send-registration-link-form-pO2bGjGa.js +409 -0
- package/dist/_chunks/{slot-grid-uA9j7Nik.js → slot-grid-Bb13H9Rl.js} +3 -3
- package/dist/_chunks/{sq-DnvsgyIh.js → sq-D4c7olaV.js} +2 -2
- package/dist/_chunks/subDays-DKISP2nE.js +8 -0
- package/dist/_chunks/{sv-CpFSK8xS.js → sv-Bf_dHPvh.js} +2 -2
- package/dist/_chunks/{task-editor-BTeUFGUX.js → task-editor-CRhfwP9T.js} +2 -2
- package/dist/_chunks/{tr-DW4oQYHT.js → tr-xqQ6cbGY.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-BWbOiLVw.js → use-appointment-details-read-BFslxbRr.js} +2 -2
- package/dist/_chunks/use-field-match-C8ug3sdQ.js +30 -0
- package/dist/_chunks/use-registration-submit-CLGHxwoT.js +112 -0
- package/dist/_chunks/{zh-CN-QGEs29fQ.js → zh-CN-C657DBCO.js} +3 -3
- package/dist/agent-catalog.json +87 -3
- package/dist/agent-i18n/en.json +9 -2
- package/dist/alia-asteroid-icon/index.js +52 -0
- package/dist/aws-transcribe/index.js +320 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-field-match.d.ts +2 -2
- package/dist/i18n/locales/ar.d.ts +36 -0
- package/dist/i18n/locales/ar.js +38 -2
- package/dist/i18n/locales/de.d.ts +36 -0
- package/dist/i18n/locales/de.js +38 -2
- package/dist/i18n/locales/el.d.ts +36 -0
- package/dist/i18n/locales/el.js +38 -2
- package/dist/i18n/locales/en.d.ts +36 -0
- package/dist/i18n/locales/en.js +38 -2
- package/dist/i18n/locales/es.d.ts +36 -0
- package/dist/i18n/locales/es.js +38 -2
- package/dist/i18n/locales/fr.d.ts +36 -0
- package/dist/i18n/locales/fr.js +38 -2
- package/dist/i18n/locales/hi.d.ts +36 -0
- package/dist/i18n/locales/hi.js +38 -2
- package/dist/i18n/locales/it.d.ts +36 -0
- package/dist/i18n/locales/it.js +38 -2
- package/dist/i18n/locales/ja.d.ts +36 -0
- package/dist/i18n/locales/ja.js +38 -2
- package/dist/i18n/locales/nl.d.ts +36 -0
- package/dist/i18n/locales/nl.js +38 -2
- package/dist/i18n/locales/pl.d.ts +36 -0
- package/dist/i18n/locales/pl.js +38 -2
- package/dist/i18n/locales/pt.d.ts +36 -0
- package/dist/i18n/locales/pt.js +38 -2
- package/dist/i18n/locales/ro.d.ts +36 -0
- package/dist/i18n/locales/ro.js +38 -2
- package/dist/i18n/locales/ru.d.ts +36 -0
- package/dist/i18n/locales/ru.js +38 -2
- package/dist/i18n/locales/sq.d.ts +36 -0
- package/dist/i18n/locales/sq.js +38 -2
- package/dist/i18n/locales/sv.d.ts +36 -0
- package/dist/i18n/locales/sv.js +38 -2
- package/dist/i18n/locales/tr.d.ts +36 -0
- package/dist/i18n/locales/tr.js +38 -2
- package/dist/i18n/locales/zh.d.ts +36 -0
- package/dist/i18n/locales/zh.js +38 -2
- package/dist/index.js +296 -292
- package/dist/locales/ar.json +38 -2
- package/dist/locales/de.json +38 -2
- package/dist/locales/el.json +38 -2
- package/dist/locales/en.json +38 -2
- package/dist/locales/es.json +38 -2
- package/dist/locales/fr.json +38 -2
- package/dist/locales/hi.json +38 -2
- package/dist/locales/it.json +38 -2
- package/dist/locales/ja.json +38 -2
- package/dist/locales/nl.json +38 -2
- package/dist/locales/pl.json +38 -2
- package/dist/locales/pt.json +38 -2
- package/dist/locales/ro.json +38 -2
- package/dist/locales/ru.json +38 -2
- package/dist/locales/sq.json +38 -2
- package/dist/locales/sv.json +38 -2
- package/dist/locales/tr.json +38 -2
- package/dist/locales/zh.json +38 -2
- package/dist/patterns/alia-assistant/alia-types.d.ts +22 -0
- package/dist/patterns/alia-assistant/index.js +7 -6
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/registration-form/index.d.ts +1 -0
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/registration-form/registration-form.d.ts +43 -0
- package/dist/patterns/registration-form/registration-verification.d.ts +38 -0
- package/dist/patterns/registration-form/use-contact-verification.d.ts +107 -0
- package/dist/patterns/registration-form/verification-requests.d.ts +9 -0
- package/dist/patterns/send-registration-link-form/index.d.ts +3 -0
- package/dist/patterns/send-registration-link-form/index.js +6 -0
- package/dist/patterns/send-registration-link-form/send-registration-link-form.d.ts +80 -0
- package/dist/speech/aws-transcribe.d.ts +65 -0
- package/dist/speech/event-stream.d.ts +13 -0
- package/dist/tokens.css +1 -1
- package/package.json +13 -1
- package/dist/_chunks/alia-sidebar-DZoyUFW8.js +0 -1290
- package/dist/_chunks/registration-form-BGSVMAga.js +0 -819
- package/dist/_chunks/subDays-xH7cpN6B.js +0 -8
- package/dist/_chunks/use-field-match-pdbEnKvO.js +0 -28
- package/dist/_chunks/use-registration-submit-eWAECgUC.js +0 -171
|
@@ -0,0 +1,1310 @@
|
|
|
1
|
+
import { jsx as s, jsxs as g, Fragment as er } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as R, useEffect as S, useCallback as ge, forwardRef as hn, useId as Ce, useMemo as vn, Fragment as gn } from "react";
|
|
3
|
+
import { useTranslation as le, Trans as Sr } from "react-i18next";
|
|
4
|
+
import { c as V } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { parsePhoneNumberFromString as Cn } from "libphonenumber-js/min";
|
|
6
|
+
import { i as Ze, E as Er } from "./email-input-C7THAwh2.js";
|
|
7
|
+
import { A as ce } from "./alert-9kEwDza3.js";
|
|
8
|
+
import { B as oe } from "./button-DohK_Ak_.js";
|
|
9
|
+
import { C as kr } from "./card-BA4Ig_kn.js";
|
|
10
|
+
import { C as wn } from "./checkbox-BjDv-r3o.js";
|
|
11
|
+
import { D as bn } from "./dev-bypass-button-B7ePcJcg.js";
|
|
12
|
+
import { E as Nn } from "./error-summary-mGxIyDAY.js";
|
|
13
|
+
import { F as z } from "./form-field-Ani72sVY.js";
|
|
14
|
+
import { L as Ir } from "./list-CNnn7DOD.js";
|
|
15
|
+
import { P as Rr } from "./password-input-BokZ_rnT.js";
|
|
16
|
+
import { u as yn } from "./use-password-requirements-C8DdwPEy.js";
|
|
17
|
+
import { P as Fn } from "./phone-input-EwVuqFik.js";
|
|
18
|
+
import { R as xn } from "./recaptcha-widget-CsvwlYTE.js";
|
|
19
|
+
import { S as Sn } from "./select-4S-eYZUf.js";
|
|
20
|
+
import { S as Ar } from "./state-backed-text-input-Cgh4ms3p.js";
|
|
21
|
+
import { i as Kr } from "./is-development-CLUAnsU7.js";
|
|
22
|
+
import { u as Lr } from "./use-state-backed-input-DhRQo6gM.js";
|
|
23
|
+
import { a as Xr, i as En } from "./safe-href-5dbsfbQn.js";
|
|
24
|
+
import { u as qr } from "./use-field-match-C8ug3sdQ.js";
|
|
25
|
+
import { B as kn } from "./brand-mark-DLk9kD8g.js";
|
|
26
|
+
import { u as In, b as Rn, a as An } from "./use-registration-submit-CLGHxwoT.js";
|
|
27
|
+
import { O as Ln } from "./otp-input-CGMu30_e.js";
|
|
28
|
+
import { C as qn } from "./circle-check-BN6rz4NV.js";
|
|
29
|
+
import { P as Jr } from "./pencil-B1sKKyuT.js";
|
|
30
|
+
import { C as Pn } from "./check-DrFSN__t.js";
|
|
31
|
+
import { C as Tn } from "./circle-alert-rGDZ73Wh.js";
|
|
32
|
+
const Dn = [
|
|
33
|
+
"invalid",
|
|
34
|
+
"expired",
|
|
35
|
+
"rate_limited",
|
|
36
|
+
"error"
|
|
37
|
+
], we = { ok: !1, reason: "error" }, Pr = (n) => typeof n == "number" && Number.isFinite(n) && n >= 0 ? n : void 0;
|
|
38
|
+
function Bn(n) {
|
|
39
|
+
if (typeof n != "object" || n === null) return null;
|
|
40
|
+
const r = n;
|
|
41
|
+
if (typeof r.ok != "boolean") return null;
|
|
42
|
+
const c = { ok: r.ok };
|
|
43
|
+
typeof r.message == "string" && (c.message = r.message), Dn.includes(r.reason) && (c.reason = r.reason);
|
|
44
|
+
const t = Pr(r.retryAfterSeconds);
|
|
45
|
+
t !== void 0 && (c.retryAfterSeconds = t);
|
|
46
|
+
const d = Pr(r.resendAfterSeconds);
|
|
47
|
+
return d !== void 0 && (c.resendAfterSeconds = d), typeof r.devCode == "string" && (c.devCode = r.devCode), typeof r.value == "string" && (c.value = r.value), c;
|
|
48
|
+
}
|
|
49
|
+
function On(n) {
|
|
50
|
+
const r = n.headers.get("Retry-After");
|
|
51
|
+
if (!(!r || !/^\d+$/.test(r.trim())))
|
|
52
|
+
return Number(r.trim());
|
|
53
|
+
}
|
|
54
|
+
async function Tr(n, r) {
|
|
55
|
+
if (!Xr(n))
|
|
56
|
+
return Kr() && console.warn(
|
|
57
|
+
`RegistrationForm: verification URL "${n}" is not a path or an address on this site, so no request was sent.`
|
|
58
|
+
), we;
|
|
59
|
+
try {
|
|
60
|
+
const c = await fetch(n, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
credentials: "same-origin",
|
|
63
|
+
headers: {
|
|
64
|
+
"Content-Type": "application/json",
|
|
65
|
+
Accept: "application/json",
|
|
66
|
+
"X-Requested-With": "XMLHttpRequest"
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify(r)
|
|
69
|
+
}), t = c.status === 429;
|
|
70
|
+
if (!t && (c.status < 200 || c.status >= 500))
|
|
71
|
+
return we;
|
|
72
|
+
let d = null;
|
|
73
|
+
try {
|
|
74
|
+
d = await c.json();
|
|
75
|
+
} catch {
|
|
76
|
+
d = null;
|
|
77
|
+
}
|
|
78
|
+
const w = Bn(d);
|
|
79
|
+
if (t) {
|
|
80
|
+
const l = w ?? { ok: !1 }, a = l.retryAfterSeconds ?? On(c) ?? void 0;
|
|
81
|
+
return {
|
|
82
|
+
...l,
|
|
83
|
+
ok: !1,
|
|
84
|
+
reason: "rate_limited",
|
|
85
|
+
...a !== void 0 ? { retryAfterSeconds: a } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return w ? c.status >= 400 ? w.ok ? we : { ...w, reason: w.reason ?? "error" } : w : we;
|
|
89
|
+
} catch {
|
|
90
|
+
return we;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function Dr(n) {
|
|
94
|
+
if ("sendUrl" in n && n.sendUrl !== void 0) {
|
|
95
|
+
const { sendUrl: r, verifyUrl: c } = n;
|
|
96
|
+
return {
|
|
97
|
+
onSendCode: (t) => Tr(r, { value: t }),
|
|
98
|
+
onVerifyCode: (t, d) => Tr(c, { value: t, code: d })
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
onSendCode: n.onSendCode,
|
|
103
|
+
onVerifyCode: n.onVerifyCode
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const Br = 6, Mn = 30, Or = (n) => ({
|
|
107
|
+
reason: n.reason ?? "error",
|
|
108
|
+
message: n.message
|
|
109
|
+
});
|
|
110
|
+
function Mr({
|
|
111
|
+
config: n,
|
|
112
|
+
value: r
|
|
113
|
+
}) {
|
|
114
|
+
const c = (n == null ? void 0 : n.codeLength) ?? Br, [t, d] = C("idle"), [w, l] = C(""), [a, b] = C(
|
|
115
|
+
null
|
|
116
|
+
), [ee, N] = C(0), [U, E] = C(), [q, B] = C(""), W = R({ config: n, value: r });
|
|
117
|
+
W.current = { config: n, value: r };
|
|
118
|
+
const A = R(0), [k] = C(
|
|
119
|
+
() => (n == null ? void 0 : n.verified) === !0 ? r : null
|
|
120
|
+
), [G, O] = C(!1), K = (n == null ? void 0 : n.verified) === !0 && !G, X = K || t === "verified", J = R(!1);
|
|
121
|
+
S(() => {
|
|
122
|
+
var v, p;
|
|
123
|
+
t === "verified" && !J.current && (J.current = !0, (p = (v = W.current.config) == null ? void 0 : v.onVerifiedChange) == null || p.call(v, !0));
|
|
124
|
+
}, [t]), S(() => {
|
|
125
|
+
if (ee <= 0) return;
|
|
126
|
+
const v = setTimeout(() => N((p) => p - 1), 1e3);
|
|
127
|
+
return () => clearTimeout(v);
|
|
128
|
+
}, [ee]);
|
|
129
|
+
const I = (v, p) => v.trim().toLowerCase() === p.trim().toLowerCase();
|
|
130
|
+
S(() => {
|
|
131
|
+
G && k !== null && I(r, k) && O(!1);
|
|
132
|
+
}, [r]);
|
|
133
|
+
const P = ge(() => {
|
|
134
|
+
A.current += 1, d((v) => v === "verified" ? v : "idle"), l(""), b(null), E(void 0), B(""), N(0);
|
|
135
|
+
}, []);
|
|
136
|
+
S(() => {
|
|
137
|
+
t !== "verified" && (t === "sent" || t === "verifying" || t === "sending") && r !== q && P();
|
|
138
|
+
}, [r, q, t, P]);
|
|
139
|
+
const be = R(r);
|
|
140
|
+
S(() => {
|
|
141
|
+
be.current !== r && (be.current = r, t === "idle" && b(null));
|
|
142
|
+
}, [r, t]);
|
|
143
|
+
const Ie = ge(() => {
|
|
144
|
+
const { config: v, value: p } = W.current;
|
|
145
|
+
if (!v) return;
|
|
146
|
+
const te = A.current += 1;
|
|
147
|
+
d("sending"), b(null), l(""), B(p), Dr(v).onSendCode(p).then(
|
|
148
|
+
(x) => x,
|
|
149
|
+
() => ({ ok: !1, reason: "error" })
|
|
150
|
+
).then((x) => {
|
|
151
|
+
if (te === A.current) {
|
|
152
|
+
if (x.ok) {
|
|
153
|
+
d("sent"), E(x.devCode), N(x.resendAfterSeconds ?? Mn);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
d("idle"), B(""), b(Or(x)), x.reason === "rate_limited" && x.retryAfterSeconds && N(x.retryAfterSeconds);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}, []), y = ge(
|
|
160
|
+
(v) => {
|
|
161
|
+
const { config: p, value: te } = W.current;
|
|
162
|
+
if (!p) return;
|
|
163
|
+
const x = p.codeLength ?? Br, Ne = v ?? w;
|
|
164
|
+
if (Ne.length !== x) return;
|
|
165
|
+
const Re = A.current += 1;
|
|
166
|
+
d("verifying"), b(null), Dr(p).onVerifyCode(te, Ne).then(
|
|
167
|
+
(m) => m,
|
|
168
|
+
() => ({ ok: !1, reason: "error" })
|
|
169
|
+
).then((m) => {
|
|
170
|
+
if (Re === A.current) {
|
|
171
|
+
if (m.ok) {
|
|
172
|
+
d("verified"), l(""), E(void 0), N(0);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
d("sent"), l(""), b(Or(m)), m.reason === "rate_limited" && m.retryAfterSeconds && N(m.retryAfterSeconds), m.reason === "expired" && N(0);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
[w]
|
|
180
|
+
), me = K && (n == null ? void 0 : n.allowChange) === !0, M = ge(() => {
|
|
181
|
+
A.current += 1, O(!0), d("idle"), l(""), b(null), E(void 0), B(""), N(0);
|
|
182
|
+
}, []), fe = ge((v) => {
|
|
183
|
+
l(v), b((p) => p && null);
|
|
184
|
+
}, []);
|
|
185
|
+
return {
|
|
186
|
+
enabled: n !== void 0,
|
|
187
|
+
status: K ? "verified" : t,
|
|
188
|
+
verified: X,
|
|
189
|
+
codeLength: c,
|
|
190
|
+
code: w,
|
|
191
|
+
setCode: fe,
|
|
192
|
+
failure: a,
|
|
193
|
+
cooldown: ee,
|
|
194
|
+
devCode: U,
|
|
195
|
+
sentTo: q,
|
|
196
|
+
send: Ie,
|
|
197
|
+
verify: y,
|
|
198
|
+
reset: P,
|
|
199
|
+
changeable: me,
|
|
200
|
+
unlock: M
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function Yr(n) {
|
|
204
|
+
const { t: r } = le("ui");
|
|
205
|
+
if (n) {
|
|
206
|
+
if (n.message) return n.message;
|
|
207
|
+
switch (n.reason) {
|
|
208
|
+
case "invalid":
|
|
209
|
+
return r("registrationForm.verification.invalidCode");
|
|
210
|
+
case "expired":
|
|
211
|
+
return r("registrationForm.verification.expiredCode");
|
|
212
|
+
case "rate_limited":
|
|
213
|
+
return r("registrationForm.verification.rateLimited");
|
|
214
|
+
default:
|
|
215
|
+
return r("registrationForm.verification.sendFailed");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function _r(n) {
|
|
220
|
+
const r = Yr(n.failure);
|
|
221
|
+
return n.status === "idle" ? r : void 0;
|
|
222
|
+
}
|
|
223
|
+
function jr({
|
|
224
|
+
state: n,
|
|
225
|
+
canSend: r
|
|
226
|
+
}) {
|
|
227
|
+
const { t: c } = le("ui"), t = n.status === "sending";
|
|
228
|
+
if (n.status !== "idle" && !t) return null;
|
|
229
|
+
const d = n.cooldown > 0;
|
|
230
|
+
return /* @__PURE__ */ s(
|
|
231
|
+
oe,
|
|
232
|
+
{
|
|
233
|
+
type: "button",
|
|
234
|
+
intent: "secondary",
|
|
235
|
+
loading: t,
|
|
236
|
+
disabled: !r,
|
|
237
|
+
"aria-disabled": d || void 0,
|
|
238
|
+
"data-action": "send-code",
|
|
239
|
+
className: "ds:shrink-0",
|
|
240
|
+
onClick: () => {
|
|
241
|
+
d || n.send();
|
|
242
|
+
},
|
|
243
|
+
children: t ? c("registrationForm.verification.sendingCode") : d ? c("registrationForm.verification.resendIn", {
|
|
244
|
+
seconds: n.cooldown
|
|
245
|
+
}) : c("registrationForm.verification.sendCode")
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function Hr({
|
|
250
|
+
field: n,
|
|
251
|
+
state: r,
|
|
252
|
+
canChange: c = !0,
|
|
253
|
+
changeWhenVerified: t = !1,
|
|
254
|
+
onUnlocked: d,
|
|
255
|
+
onVerified: w
|
|
256
|
+
}) {
|
|
257
|
+
const { t: l } = le("ui"), a = R(null), b = Yr(r.failure), ee = r.status === "sent" || r.status === "verifying", N = r.status === "verifying", U = r.code.length === r.codeLength, E = () => {
|
|
258
|
+
var I, P;
|
|
259
|
+
return (P = (I = a.current) == null ? void 0 : I.querySelector("input")) == null ? void 0 : P.focus();
|
|
260
|
+
}, q = R(r.status), B = R(r.failure);
|
|
261
|
+
S(() => {
|
|
262
|
+
const I = q.current;
|
|
263
|
+
q.current = r.status, r.status === "sent" && I === "sending" && E(), r.status === "sent" && I === "verifying" && r.failure && E(), r.status === "verified" && I === "verifying" && w();
|
|
264
|
+
}, [r.status]), S(() => {
|
|
265
|
+
r.failure && r.failure !== B.current && r.status === "sent" && E(), B.current = r.failure;
|
|
266
|
+
}, [r.failure, r.status]);
|
|
267
|
+
const [W, A] = C(""), k = r.cooldown > 0, G = R(!1);
|
|
268
|
+
S(() => {
|
|
269
|
+
k && !G.current ? A(
|
|
270
|
+
l("registrationForm.verification.resendIn", {
|
|
271
|
+
seconds: r.cooldown
|
|
272
|
+
})
|
|
273
|
+
) : !k && G.current && A(l("registrationForm.verification.resendCode")), G.current = k;
|
|
274
|
+
}, [k, l]);
|
|
275
|
+
const O = n === "email", K = O ? l("registrationForm.verification.codeSentEmail", {
|
|
276
|
+
value: r.sentTo
|
|
277
|
+
}) : l("registrationForm.verification.codeSentPhone", {
|
|
278
|
+
value: r.sentTo
|
|
279
|
+
}), X = l(O ? "registrationForm.verification.changeEmail" : "registrationForm.verification.changePhone"), J = l(O ? "registrationForm.verification.verifiedEmail" : "registrationForm.verification.verifiedPhone");
|
|
280
|
+
return /* @__PURE__ */ g(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
ref: a,
|
|
284
|
+
"data-slot": "verification",
|
|
285
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
286
|
+
children: [
|
|
287
|
+
/* @__PURE__ */ s("div", { role: "status", className: r.verified ? void 0 : "ds:sr-only", children: r.verified ? /* @__PURE__ */ g("p", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-success", children: [
|
|
288
|
+
/* @__PURE__ */ s(qn, { "aria-hidden": "true", className: "ds:size-4 ds:shrink-0" }),
|
|
289
|
+
/* @__PURE__ */ s("span", { children: J })
|
|
290
|
+
] }) : W }),
|
|
291
|
+
t && r.changeable && /* @__PURE__ */ s(
|
|
292
|
+
oe,
|
|
293
|
+
{
|
|
294
|
+
type: "button",
|
|
295
|
+
intent: "secondary",
|
|
296
|
+
startIcon: /* @__PURE__ */ s(Jr, { "aria-hidden": "true" }),
|
|
297
|
+
"data-action": "change-value",
|
|
298
|
+
className: "ds:self-start",
|
|
299
|
+
onClick: () => {
|
|
300
|
+
r.unlock(), d == null || d();
|
|
301
|
+
},
|
|
302
|
+
children: X
|
|
303
|
+
}
|
|
304
|
+
),
|
|
305
|
+
ee && /* @__PURE__ */ g(er, { children: [
|
|
306
|
+
/* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: K }),
|
|
307
|
+
r.devCode && /* @__PURE__ */ s(ce, { variant: "info", announce: "off", children: /* @__PURE__ */ s(ce.Description, { children: l("registrationForm.verification.devCode", {
|
|
308
|
+
code: r.devCode
|
|
309
|
+
}) }) }),
|
|
310
|
+
/* @__PURE__ */ s(
|
|
311
|
+
z,
|
|
312
|
+
{
|
|
313
|
+
label: l("registrationForm.verification.codeLabel"),
|
|
314
|
+
error: b,
|
|
315
|
+
children: /* @__PURE__ */ s(
|
|
316
|
+
Ln,
|
|
317
|
+
{
|
|
318
|
+
length: r.codeLength,
|
|
319
|
+
mode: "numeric",
|
|
320
|
+
webOtp: n === "phone",
|
|
321
|
+
value: r.code,
|
|
322
|
+
onChange: r.setCode,
|
|
323
|
+
onComplete: (I) => r.verify(I),
|
|
324
|
+
disabled: N
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
/* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
330
|
+
/* @__PURE__ */ s(
|
|
331
|
+
oe,
|
|
332
|
+
{
|
|
333
|
+
type: "button",
|
|
334
|
+
intent: "primary",
|
|
335
|
+
size: "md",
|
|
336
|
+
loading: N,
|
|
337
|
+
"aria-disabled": !U || void 0,
|
|
338
|
+
"data-action": "verify-code",
|
|
339
|
+
onClick: () => {
|
|
340
|
+
U && r.verify();
|
|
341
|
+
},
|
|
342
|
+
children: l(N ? "registrationForm.verification.verifying" : "registrationForm.verification.verify")
|
|
343
|
+
}
|
|
344
|
+
),
|
|
345
|
+
/* @__PURE__ */ s(
|
|
346
|
+
oe,
|
|
347
|
+
{
|
|
348
|
+
type: "button",
|
|
349
|
+
intent: "outline",
|
|
350
|
+
size: "md",
|
|
351
|
+
disabled: N,
|
|
352
|
+
"aria-disabled": k || void 0,
|
|
353
|
+
"data-action": "resend-code",
|
|
354
|
+
onClick: () => {
|
|
355
|
+
k || r.send();
|
|
356
|
+
},
|
|
357
|
+
children: k ? l("registrationForm.verification.resendIn", {
|
|
358
|
+
seconds: r.cooldown
|
|
359
|
+
}) : l("registrationForm.verification.resendCode")
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
c && /* @__PURE__ */ s(
|
|
363
|
+
oe,
|
|
364
|
+
{
|
|
365
|
+
type: "button",
|
|
366
|
+
intent: "link",
|
|
367
|
+
size: "md",
|
|
368
|
+
disabled: N,
|
|
369
|
+
"data-action": "change-value",
|
|
370
|
+
onClick: r.reset,
|
|
371
|
+
children: X
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
] })
|
|
375
|
+
] })
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
function _n({
|
|
381
|
+
field: n,
|
|
382
|
+
state: r,
|
|
383
|
+
onUnlocked: c
|
|
384
|
+
}) {
|
|
385
|
+
const { t } = le("ui");
|
|
386
|
+
return /* @__PURE__ */ g(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
"data-slot": "change-slot",
|
|
390
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ s(
|
|
393
|
+
"span",
|
|
394
|
+
{
|
|
395
|
+
"aria-hidden": "true",
|
|
396
|
+
className: "type-label ds:invisible ds:hidden ds:@[544px]/registration:block",
|
|
397
|
+
children: " "
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ s(
|
|
401
|
+
oe,
|
|
402
|
+
{
|
|
403
|
+
type: "button",
|
|
404
|
+
intent: "secondary",
|
|
405
|
+
startIcon: /* @__PURE__ */ s(Jr, { "aria-hidden": "true" }),
|
|
406
|
+
"data-action": "change-value",
|
|
407
|
+
className: "ds:self-start",
|
|
408
|
+
onClick: () => {
|
|
409
|
+
r.unlock(), c();
|
|
410
|
+
},
|
|
411
|
+
children: t(n === "email" ? "registrationForm.verification.changeEmail" : "registrationForm.verification.changePhone")
|
|
412
|
+
}
|
|
413
|
+
)
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
const $r = [
|
|
419
|
+
"firstName",
|
|
420
|
+
"lastName",
|
|
421
|
+
"email",
|
|
422
|
+
"emailConfirm",
|
|
423
|
+
"password",
|
|
424
|
+
"passwordConfirm",
|
|
425
|
+
"phone",
|
|
426
|
+
"branch",
|
|
427
|
+
"terms"
|
|
428
|
+
], jn = V(
|
|
429
|
+
"ds:@container/registration ds:w-full ds:text-start ds:text-[var(--foreground)]"
|
|
430
|
+
), Hn = V(
|
|
431
|
+
"ds:grid ds:grid-cols-1 ds:items-start ds:gap-[var(--spacing-md)]",
|
|
432
|
+
{
|
|
433
|
+
variants: {
|
|
434
|
+
columns: {
|
|
435
|
+
/** A field alone in its row takes the full width. */
|
|
436
|
+
one: "",
|
|
437
|
+
/** Two fields side by side once the card is wide enough. */
|
|
438
|
+
two: "ds:@[544px]/registration:grid-cols-2"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
defaultVariants: { columns: "two" }
|
|
442
|
+
}
|
|
443
|
+
), $n = V("ds:relative ds:flex ds:gap-[var(--spacing-sm)]", {
|
|
444
|
+
variants: {
|
|
445
|
+
logo: {
|
|
446
|
+
/** A centred column under the mark. */
|
|
447
|
+
true: "ds:flex-col ds:items-center",
|
|
448
|
+
/** The heading at the start edge, the shortcut at the end. */
|
|
449
|
+
false: "ds:items-start ds:justify-between"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
defaultVariants: { logo: !0 }
|
|
453
|
+
}), zn = V(
|
|
454
|
+
"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
455
|
+
{
|
|
456
|
+
variants: {
|
|
457
|
+
centred: { true: "ds:items-center ds:text-center", false: "" }
|
|
458
|
+
},
|
|
459
|
+
defaultVariants: { centred: !0 }
|
|
460
|
+
}
|
|
461
|
+
), Un = V("ds:shrink-0", {
|
|
462
|
+
variants: {
|
|
463
|
+
corner: { true: "ds:absolute ds:top-0 ds:end-0", false: "" }
|
|
464
|
+
},
|
|
465
|
+
defaultVariants: { corner: !0 }
|
|
466
|
+
}), Wn = V(
|
|
467
|
+
"ds:rounded-[var(--radius-sm)] ds:underline ds:underline-offset-4 ds:text-[var(--foreground)] ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
468
|
+
{
|
|
469
|
+
variants: {
|
|
470
|
+
weight: { normal: "", strong: "ds:font-semibold" }
|
|
471
|
+
},
|
|
472
|
+
defaultVariants: { weight: "normal" }
|
|
473
|
+
}
|
|
474
|
+
), Gn = V(
|
|
475
|
+
"ds:focus-visible:outline-solid ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
|
|
476
|
+
), Kn = V(
|
|
477
|
+
"ds:text-destructive ds:ms-[var(--spacing-xs)]"
|
|
478
|
+
), Xn = {
|
|
479
|
+
minLength: 12,
|
|
480
|
+
uppercase: !0,
|
|
481
|
+
lowercase: !0,
|
|
482
|
+
digit: !0,
|
|
483
|
+
charset: "ascii"
|
|
484
|
+
}, Jn = "Alfadocs", Yn = /<(terms|privacy)>([\s\S]*?)<\/\1>/, Qn = /<\/?(?!(?:terms|privacy)\b)[a-z][^>]*>/gi, Ve = (n) => n && En(n) ? n : void 0, zr = (n) => Object.values(n).some(Boolean), Ur = (n) => {
|
|
485
|
+
var r;
|
|
486
|
+
return ((r = Cn(n)) == null ? void 0 : r.isPossible()) ?? !1;
|
|
487
|
+
};
|
|
488
|
+
function ke({
|
|
489
|
+
href: n,
|
|
490
|
+
newTab: r = !1,
|
|
491
|
+
weight: c,
|
|
492
|
+
action: t,
|
|
493
|
+
children: d
|
|
494
|
+
}) {
|
|
495
|
+
const { t: w } = le("ui");
|
|
496
|
+
return /* @__PURE__ */ g(
|
|
497
|
+
"a",
|
|
498
|
+
{
|
|
499
|
+
href: n,
|
|
500
|
+
target: r ? "_blank" : void 0,
|
|
501
|
+
rel: r ? "noopener noreferrer" : void 0,
|
|
502
|
+
"data-action": t,
|
|
503
|
+
className: Wn({ weight: c }),
|
|
504
|
+
children: [
|
|
505
|
+
d,
|
|
506
|
+
r && /* @__PURE__ */ s("span", { className: "ds:sr-only", children: w("link.opensInNewTab") })
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
function Wr({ children: n }) {
|
|
512
|
+
return /* @__PURE__ */ s(er, { children: n });
|
|
513
|
+
}
|
|
514
|
+
function Gr(n) {
|
|
515
|
+
if (n.enabled)
|
|
516
|
+
return n.verified ? "verified" : n.status === "sent" || n.status === "verifying" ? "sent" : "idle";
|
|
517
|
+
}
|
|
518
|
+
const Zn = [
|
|
519
|
+
["firstName", "lastName"],
|
|
520
|
+
["email", "emailConfirm"],
|
|
521
|
+
["password", "passwordConfirm"],
|
|
522
|
+
["phone", "branch"]
|
|
523
|
+
];
|
|
524
|
+
function Vn(n) {
|
|
525
|
+
const r = [];
|
|
526
|
+
for (const c of Zn) {
|
|
527
|
+
const t = c.filter(n);
|
|
528
|
+
if (t.length === 0) continue;
|
|
529
|
+
const d = r[r.length - 1];
|
|
530
|
+
t.length === 1 && (d == null ? void 0 : d.length) === 1 ? d.push(t[0]) : r.push(t);
|
|
531
|
+
}
|
|
532
|
+
return r;
|
|
533
|
+
}
|
|
534
|
+
const es = hn(
|
|
535
|
+
({
|
|
536
|
+
title: n,
|
|
537
|
+
description: r,
|
|
538
|
+
headingLevel: c = 2,
|
|
539
|
+
showLogo: t = !0,
|
|
540
|
+
logoMotion: d = "assemble",
|
|
541
|
+
children: w,
|
|
542
|
+
fields: l,
|
|
543
|
+
initialValues: a,
|
|
544
|
+
errors: b,
|
|
545
|
+
emailReadOnly: ee = !1,
|
|
546
|
+
emailDescription: N,
|
|
547
|
+
blockPaste: U,
|
|
548
|
+
blockCopy: E,
|
|
549
|
+
branches: q,
|
|
550
|
+
passwordPolicy: B = Xn,
|
|
551
|
+
termsHref: W,
|
|
552
|
+
privacyHref: A,
|
|
553
|
+
termsLabel: k,
|
|
554
|
+
termsDescription: G,
|
|
555
|
+
termsLabelText: O,
|
|
556
|
+
termsDescriptionText: K,
|
|
557
|
+
notice: X,
|
|
558
|
+
benefits: J,
|
|
559
|
+
loginHref: I,
|
|
560
|
+
recaptchaSiteKey: P,
|
|
561
|
+
submitLabel: be,
|
|
562
|
+
submitting: Ie = !1,
|
|
563
|
+
devBypass: y,
|
|
564
|
+
onSubmit: me,
|
|
565
|
+
fieldNames: M,
|
|
566
|
+
action: fe,
|
|
567
|
+
hiddenFields: v,
|
|
568
|
+
verification: p,
|
|
569
|
+
requireVerification: te = !0,
|
|
570
|
+
className: x,
|
|
571
|
+
...Ne
|
|
572
|
+
}, Re) => {
|
|
573
|
+
const { t: m, i18n: rr } = le("ui"), nr = Ce(), Qr = Ce(), T = (e) => `${Qr}-${e}`, sr = Ce(), or = Ce(), tr = Ce(), Y = M !== void 0, Zr = !!(q && q.length > 0), [Vr] = C(() => !!(a != null && a.email)), Q = ee && Vr, f = (e) => e === "email" || e === "password" ? !0 : l && !l.includes(e) ? !1 : e === "branch" ? Zr : e === "emailConfirm" ? !Q && !pe : !0, [i, Ae] = C(() => ({
|
|
574
|
+
firstName: (a == null ? void 0 : a.firstName) ?? "",
|
|
575
|
+
lastName: (a == null ? void 0 : a.lastName) ?? "",
|
|
576
|
+
email: (a == null ? void 0 : a.email) ?? "",
|
|
577
|
+
emailConfirm: (a == null ? void 0 : a.emailConfirm) ?? "",
|
|
578
|
+
password: "",
|
|
579
|
+
passwordConfirm: "",
|
|
580
|
+
phone: (a == null ? void 0 : a.phone) ?? "",
|
|
581
|
+
branch: (a == null ? void 0 : a.branch) ?? "",
|
|
582
|
+
terms: (a == null ? void 0 : a.terms) ?? !1
|
|
583
|
+
})), [Le, ir] = C(
|
|
584
|
+
() => Ur((a == null ? void 0 : a.phone) ?? "")
|
|
585
|
+
), [en, qe] = C(() => ({
|
|
586
|
+
email: !!(a != null && a.email)
|
|
587
|
+
})), [ue, ar] = C(!1), [Pe, Te] = C(
|
|
588
|
+
() => b ?? {}
|
|
589
|
+
), _ = Mr({
|
|
590
|
+
config: p == null ? void 0 : p.email,
|
|
591
|
+
value: i.email
|
|
592
|
+
}), re = Mr({
|
|
593
|
+
config: f("phone") ? p == null ? void 0 : p.phone : void 0,
|
|
594
|
+
value: i.phone
|
|
595
|
+
}), pe = _.verified, De = re.verified, ye = $r.filter(f), dr = !Q && pe && _.changeable, Be = te && _.enabled && !pe, Oe = te && re.enabled && !De, rn = _r(_), nn = _r(re), D = (e, o) => {
|
|
596
|
+
Ae((u) => ({ ...u, [e]: o })), Te(
|
|
597
|
+
(u) => u[e] ? { ...u, [e]: void 0 } : u
|
|
598
|
+
);
|
|
599
|
+
}, ie = (e) => qe(
|
|
600
|
+
(o) => o[e] ? o : { ...o, [e]: !0 }
|
|
601
|
+
), cr = () => {
|
|
602
|
+
Ae((e) => ({
|
|
603
|
+
...e,
|
|
604
|
+
password: "",
|
|
605
|
+
passwordConfirm: ""
|
|
606
|
+
})), qe((e) => ({
|
|
607
|
+
...e,
|
|
608
|
+
password: !1,
|
|
609
|
+
passwordConfirm: !1
|
|
610
|
+
}));
|
|
611
|
+
}, ae = (e) => ({
|
|
612
|
+
blockPaste: (U == null ? void 0 : U.includes(e)) ?? !1,
|
|
613
|
+
blockCopy: (E == null ? void 0 : E.includes(e)) ?? !1
|
|
614
|
+
}), lr = yn(B), Me = qr({
|
|
615
|
+
value: i.email,
|
|
616
|
+
confirmValue: i.emailConfirm,
|
|
617
|
+
kind: "email",
|
|
618
|
+
submitted: ue
|
|
619
|
+
}), _e = qr({
|
|
620
|
+
value: i.password,
|
|
621
|
+
confirmValue: i.passwordConfirm,
|
|
622
|
+
kind: "password",
|
|
623
|
+
submitted: ue
|
|
624
|
+
}), mr = {
|
|
625
|
+
firstName: f("firstName") && i.firstName.trim() === "",
|
|
626
|
+
lastName: f("lastName") && i.lastName.trim() === "",
|
|
627
|
+
// The user cannot fix a locked address, so the server judges it.
|
|
628
|
+
email: !Q && !Ze(i.email) || Be,
|
|
629
|
+
emailConfirm: f("emailConfirm") && (i.emailConfirm === "" || !Me.matches),
|
|
630
|
+
password: i.password === "" || !lr.every((e) => e.test(i.password)),
|
|
631
|
+
passwordConfirm: f("passwordConfirm") && (i.passwordConfirm === "" || !_e.matches),
|
|
632
|
+
phone: f("phone") && (i.phone === "" || !Le || Oe),
|
|
633
|
+
branch: f("branch") && i.branch === "",
|
|
634
|
+
terms: f("terms") && !i.terms
|
|
635
|
+
}, je = (e) => ue || e !== "terms" && en[e] === !0, j = m("registrationForm.required"), H = {
|
|
636
|
+
firstName: m("registrationForm.firstName"),
|
|
637
|
+
lastName: m("registrationForm.lastName"),
|
|
638
|
+
email: m("registrationForm.email"),
|
|
639
|
+
emailConfirm: m("registrationForm.emailConfirm"),
|
|
640
|
+
password: m("registrationForm.password"),
|
|
641
|
+
passwordConfirm: m("registrationForm.passwordConfirm"),
|
|
642
|
+
phone: m("registrationForm.phone"),
|
|
643
|
+
branch: m("registrationForm.branch")
|
|
644
|
+
}, ne = (e, o) => je(e) && mr[e] ? o : void 0, sn = {
|
|
645
|
+
firstName: ne("firstName", j),
|
|
646
|
+
lastName: ne("lastName", j),
|
|
647
|
+
email: je("email") && !Q && !Ze(i.email) ? i.email === "" ? j : m("inputs.email.invalid") : ue && Be ? m("registrationForm.verification.emailRequired") : void 0,
|
|
648
|
+
emailConfirm: i.emailConfirm === "" ? ne("emailConfirm", j) : Me.error,
|
|
649
|
+
password: ne(
|
|
650
|
+
"password",
|
|
651
|
+
i.password === "" ? j : m("registrationForm.passwordInvalid")
|
|
652
|
+
),
|
|
653
|
+
passwordConfirm: i.passwordConfirm === "" ? ne("passwordConfirm", j) : _e.error,
|
|
654
|
+
phone: je("phone") && f("phone") && (i.phone === "" || !Le) ? i.phone === "" ? j : m("registrationForm.phoneInvalid") : ue && Oe ? m("registrationForm.verification.phoneRequired") : void 0,
|
|
655
|
+
branch: ne("branch", j),
|
|
656
|
+
terms: ne("terms", m("registrationForm.termsRequired"))
|
|
657
|
+
}, on = {
|
|
658
|
+
email: rn,
|
|
659
|
+
phone: nn
|
|
660
|
+
}, L = (e) => Pe[e] ?? on[e] ?? sn[e], se = R({}), $ = vn(() => {
|
|
661
|
+
const e = (o) => (u) => {
|
|
662
|
+
se.current[o] = u;
|
|
663
|
+
};
|
|
664
|
+
return {
|
|
665
|
+
firstName: e("firstName"),
|
|
666
|
+
lastName: e("lastName"),
|
|
667
|
+
email: e("email"),
|
|
668
|
+
emailConfirm: e("emailConfirm"),
|
|
669
|
+
password: e("password"),
|
|
670
|
+
passwordConfirm: e("passwordConfirm"),
|
|
671
|
+
phone: e("phone"),
|
|
672
|
+
branch: e("branch"),
|
|
673
|
+
terms: e("terms")
|
|
674
|
+
};
|
|
675
|
+
}, []), fr = Lr(i.email, $.email), ur = Lr(
|
|
676
|
+
i.emailConfirm,
|
|
677
|
+
$.emailConfirm
|
|
678
|
+
), pr = R(null), hr = (e) => ye.find((o) => e[o]) ?? (zr(e) ? "form" : void 0), [vr] = C(
|
|
679
|
+
() => ye.some((e) => !!(b != null && b[e]))
|
|
680
|
+
), F = In(ye, L, vr), [Fe, He] = C(() => {
|
|
681
|
+
const e = vr ? void 0 : hr(b ?? {});
|
|
682
|
+
return e ? { target: e } : null;
|
|
683
|
+
});
|
|
684
|
+
S(() => {
|
|
685
|
+
var e, o;
|
|
686
|
+
Fe && (Fe.target === "form" ? (e = pr.current) == null || e.focus() : (o = se.current[Fe.target]) == null || o.focus());
|
|
687
|
+
}, [Fe]);
|
|
688
|
+
const $e = f("phone");
|
|
689
|
+
S(() => {
|
|
690
|
+
const e = se.current.phone;
|
|
691
|
+
if (!$e || !e) return;
|
|
692
|
+
const o = () => qe(
|
|
693
|
+
(u) => u.phone ? u : { ...u, phone: !0 }
|
|
694
|
+
);
|
|
695
|
+
return e.addEventListener("blur", o), () => e.removeEventListener("blur", o);
|
|
696
|
+
}, [$e]);
|
|
697
|
+
const ze = R(null), Ue = R(null), [gr, tn] = C(null);
|
|
698
|
+
S(() => {
|
|
699
|
+
var e;
|
|
700
|
+
gr && ((e = ze.current) == null || e.requestSubmit());
|
|
701
|
+
}, [gr]);
|
|
702
|
+
const an = () => {
|
|
703
|
+
var o;
|
|
704
|
+
const e = y == null ? void 0 : y.values;
|
|
705
|
+
if (e) {
|
|
706
|
+
const u = Q || pe ? void 0 : e.email, h = {};
|
|
707
|
+
f("firstName") && e.firstName !== void 0 && (h.firstName = e.firstName), f("lastName") && e.lastName !== void 0 && (h.lastName = e.lastName), u !== void 0 && (h.email = u), f("emailConfirm") && u !== void 0 && (h.emailConfirm = u), e.password !== void 0 && (h.password = e.password), f("passwordConfirm") && e.password !== void 0 && (h.passwordConfirm = e.password), f("phone") && !De && e.phone !== void 0 && (h.phone = e.phone), f("branch") && e.branch !== void 0 && (h.branch = e.branch), f("terms") && e.terms !== void 0 && (h.terms = e.terms), Ae((de) => ({ ...de, ...h })), h.phone !== void 0 && ir(Ur(h.phone)), Te((de) => {
|
|
708
|
+
const ve = { ...de };
|
|
709
|
+
for (const Ee of Object.keys(h))
|
|
710
|
+
ve[Ee] = void 0;
|
|
711
|
+
return ve;
|
|
712
|
+
}), y.submit && tn({});
|
|
713
|
+
}
|
|
714
|
+
(o = y == null ? void 0 : y.onClick) == null || o.call(y);
|
|
715
|
+
}, he = Rn({
|
|
716
|
+
errors: b,
|
|
717
|
+
submitting: Ie,
|
|
718
|
+
native: Y,
|
|
719
|
+
captcha: !!P,
|
|
720
|
+
firstProblem: () => ye.find((e) => mr[e]),
|
|
721
|
+
onRefused: (e) => {
|
|
722
|
+
ar(!0), F.open(() => He({ target: e }));
|
|
723
|
+
},
|
|
724
|
+
deliver: (e) => {
|
|
725
|
+
var u;
|
|
726
|
+
if (Y) {
|
|
727
|
+
Ue.current && e && (Ue.current.value = e), (u = ze.current) == null || u.submit();
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
const o = (h) => f(h) ? i[h] : "";
|
|
731
|
+
me == null || me({
|
|
732
|
+
firstName: o("firstName"),
|
|
733
|
+
lastName: o("lastName"),
|
|
734
|
+
email: i.email,
|
|
735
|
+
emailConfirm: o("emailConfirm"),
|
|
736
|
+
password: i.password,
|
|
737
|
+
passwordConfirm: o("passwordConfirm"),
|
|
738
|
+
phone: o("phone"),
|
|
739
|
+
branch: o("branch"),
|
|
740
|
+
terms: f("terms") && i.terms,
|
|
741
|
+
captchaToken: e
|
|
742
|
+
});
|
|
743
|
+
},
|
|
744
|
+
onAnswer: (e) => {
|
|
745
|
+
const o = e;
|
|
746
|
+
Te(o), zr(o) && (cr(), ar(!1), F.open(() => {
|
|
747
|
+
const u = hr(o);
|
|
748
|
+
u && He({ target: u });
|
|
749
|
+
}));
|
|
750
|
+
},
|
|
751
|
+
// The page came back from the browser's cache as it was left:
|
|
752
|
+
// the passwords must not come back with it.
|
|
753
|
+
onRestore: cr
|
|
754
|
+
}), { busy: We, captchaFailed: Ge } = he;
|
|
755
|
+
S(() => {
|
|
756
|
+
Ge && He({ target: "form" });
|
|
757
|
+
}, [Ge]);
|
|
758
|
+
const Z = (e) => Y ? M[e] : e, dn = `h${c}`, Ke = Ve(W), Xe = Ve(A), Cr = Ve(I), wr = (e) => {
|
|
759
|
+
const o = e.replace(Qn, "").split(Yn);
|
|
760
|
+
return o.map((u, h) => {
|
|
761
|
+
if (h % 3 !== 0) return null;
|
|
762
|
+
const de = o[h + 1], ve = o[h + 2], Ee = de === "terms" ? Ke : Xe;
|
|
763
|
+
return /* @__PURE__ */ g(gn, { children: [
|
|
764
|
+
u,
|
|
765
|
+
de === void 0 ? null : Ee ? /* @__PURE__ */ s(ke, { href: Ee, newTab: !0, children: ve }) : ve
|
|
766
|
+
] }, h);
|
|
767
|
+
});
|
|
768
|
+
}, cn = k ?? (O ? wr(O) : void 0), Je = G ?? (K ? wr(K) : void 0), Ye = (J == null ? void 0 : J.filter(Boolean)) ?? [], ln = !!X || Ye.length > 0 || !!w, mn = Y && fe && Xr(fe) ? fe : void 0, xe = [
|
|
769
|
+
Pe.form,
|
|
770
|
+
...$r.filter((e) => !f(e)).map(
|
|
771
|
+
(e) => Pe[e]
|
|
772
|
+
),
|
|
773
|
+
Ge ? m("inputs.recaptcha.error") : void 0
|
|
774
|
+
].filter(Boolean).join(" ") || void 0, fn = An(
|
|
775
|
+
xe,
|
|
776
|
+
F.listed.length > 0
|
|
777
|
+
), Se = L("terms"), un = [
|
|
778
|
+
Je ? or : void 0,
|
|
779
|
+
Se ? sr : void 0
|
|
780
|
+
].filter(Boolean).join(" ") || void 0, br = new Set(Object.values(M ?? {})), Nr = Y ? Object.entries(v ?? {}) : [], Qe = Nr.filter(([e]) => br.has(e)).map(([e]) => e).join(", ");
|
|
781
|
+
S(() => {
|
|
782
|
+
Qe && Kr() && console.warn(
|
|
783
|
+
`RegistrationForm: hiddenFields "${Qe}" is also named in fieldNames and was left out. The form's own field wins.`
|
|
784
|
+
);
|
|
785
|
+
}, [Qe]);
|
|
786
|
+
const yr = Q || pe, Fr = /* @__PURE__ */ s(
|
|
787
|
+
Er,
|
|
788
|
+
{
|
|
789
|
+
ref: fr.ref,
|
|
790
|
+
name: Z("email"),
|
|
791
|
+
errorMessage: null,
|
|
792
|
+
disableBuiltInValidation: yr,
|
|
793
|
+
readOnly: yr,
|
|
794
|
+
onChange: fr.quiet((e) => D("email", e.target.value)),
|
|
795
|
+
onBlur: () => ie("email"),
|
|
796
|
+
...ae("email")
|
|
797
|
+
}
|
|
798
|
+
), xr = /* @__PURE__ */ s(
|
|
799
|
+
Fn,
|
|
800
|
+
{
|
|
801
|
+
ref: $.phone,
|
|
802
|
+
name: Y ? void 0 : "phone",
|
|
803
|
+
value: i.phone,
|
|
804
|
+
readOnly: De,
|
|
805
|
+
onChange: (e, o) => {
|
|
806
|
+
D("phone", e), ir(o.isPossible);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
), pn = (e) => {
|
|
810
|
+
switch (e) {
|
|
811
|
+
case "firstName":
|
|
812
|
+
return /* @__PURE__ */ s(
|
|
813
|
+
z,
|
|
814
|
+
{
|
|
815
|
+
id: T(e),
|
|
816
|
+
label: H.firstName,
|
|
817
|
+
required: !0,
|
|
818
|
+
error: L("firstName"),
|
|
819
|
+
announceError: !F.lists("firstName"),
|
|
820
|
+
"data-field": "firstName",
|
|
821
|
+
children: /* @__PURE__ */ s(
|
|
822
|
+
Ar,
|
|
823
|
+
{
|
|
824
|
+
ref: $.firstName,
|
|
825
|
+
name: Z("firstName"),
|
|
826
|
+
autoComplete: "given-name",
|
|
827
|
+
value: i.firstName,
|
|
828
|
+
onChange: (o) => D("firstName", o.target.value),
|
|
829
|
+
onBlur: () => ie("firstName"),
|
|
830
|
+
...ae("firstName")
|
|
831
|
+
}
|
|
832
|
+
)
|
|
833
|
+
},
|
|
834
|
+
e
|
|
835
|
+
);
|
|
836
|
+
case "lastName":
|
|
837
|
+
return /* @__PURE__ */ s(
|
|
838
|
+
z,
|
|
839
|
+
{
|
|
840
|
+
id: T(e),
|
|
841
|
+
label: H.lastName,
|
|
842
|
+
required: !0,
|
|
843
|
+
error: L("lastName"),
|
|
844
|
+
announceError: !F.lists("lastName"),
|
|
845
|
+
"data-field": "lastName",
|
|
846
|
+
children: /* @__PURE__ */ s(
|
|
847
|
+
Ar,
|
|
848
|
+
{
|
|
849
|
+
ref: $.lastName,
|
|
850
|
+
name: Z("lastName"),
|
|
851
|
+
autoComplete: "family-name",
|
|
852
|
+
value: i.lastName,
|
|
853
|
+
onChange: (o) => D("lastName", o.target.value),
|
|
854
|
+
onBlur: () => ie("lastName"),
|
|
855
|
+
...ae("lastName")
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
},
|
|
859
|
+
e
|
|
860
|
+
);
|
|
861
|
+
case "email":
|
|
862
|
+
return /* @__PURE__ */ s(
|
|
863
|
+
z,
|
|
864
|
+
{
|
|
865
|
+
id: T(e),
|
|
866
|
+
label: H.email,
|
|
867
|
+
required: !Q,
|
|
868
|
+
description: N,
|
|
869
|
+
error: L("email"),
|
|
870
|
+
announceError: !F.lists("email"),
|
|
871
|
+
"data-field": "email",
|
|
872
|
+
"data-verification": Gr(_),
|
|
873
|
+
children: _.enabled ? /* @__PURE__ */ g("div", { className: "ds:@container/verify ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
874
|
+
/* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-sm)] ds:@[384px]/verify:flex-row", children: [
|
|
875
|
+
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:w-full ds:@[384px]/verify:w-auto ds:@[384px]/verify:flex-1", children: Fr }),
|
|
876
|
+
/* @__PURE__ */ s(
|
|
877
|
+
jr,
|
|
878
|
+
{
|
|
879
|
+
state: _,
|
|
880
|
+
canSend: Ze(i.email)
|
|
881
|
+
}
|
|
882
|
+
)
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ s(
|
|
885
|
+
Hr,
|
|
886
|
+
{
|
|
887
|
+
field: "email",
|
|
888
|
+
state: _,
|
|
889
|
+
canChange: !Q,
|
|
890
|
+
onVerified: () => {
|
|
891
|
+
var o;
|
|
892
|
+
return (o = se.current.email) == null ? void 0 : o.focus();
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
)
|
|
896
|
+
] }) : Fr
|
|
897
|
+
},
|
|
898
|
+
e
|
|
899
|
+
);
|
|
900
|
+
case "emailConfirm":
|
|
901
|
+
return dr ? /* @__PURE__ */ s(
|
|
902
|
+
_n,
|
|
903
|
+
{
|
|
904
|
+
field: "email",
|
|
905
|
+
state: _,
|
|
906
|
+
onUnlocked: () => {
|
|
907
|
+
var o;
|
|
908
|
+
D("emailConfirm", ""), (o = se.current.email) == null || o.focus();
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
e
|
|
912
|
+
) : /* @__PURE__ */ s(
|
|
913
|
+
z,
|
|
914
|
+
{
|
|
915
|
+
id: T(e),
|
|
916
|
+
label: H.emailConfirm,
|
|
917
|
+
required: !0,
|
|
918
|
+
error: L("emailConfirm"),
|
|
919
|
+
announceError: !F.lists("emailConfirm"),
|
|
920
|
+
"data-field": "emailConfirm",
|
|
921
|
+
children: /* @__PURE__ */ s(
|
|
922
|
+
Er,
|
|
923
|
+
{
|
|
924
|
+
ref: ur.ref,
|
|
925
|
+
name: Z("emailConfirm"),
|
|
926
|
+
disableBuiltInValidation: !0,
|
|
927
|
+
onChange: ur.quiet(
|
|
928
|
+
(o) => D("emailConfirm", o.target.value)
|
|
929
|
+
),
|
|
930
|
+
onBlur: () => {
|
|
931
|
+
ie("emailConfirm"), Me.confirmProps.onBlur();
|
|
932
|
+
},
|
|
933
|
+
...ae("emailConfirm")
|
|
934
|
+
}
|
|
935
|
+
)
|
|
936
|
+
},
|
|
937
|
+
e
|
|
938
|
+
);
|
|
939
|
+
case "password":
|
|
940
|
+
return /* @__PURE__ */ s(
|
|
941
|
+
z,
|
|
942
|
+
{
|
|
943
|
+
id: T(e),
|
|
944
|
+
label: H.password,
|
|
945
|
+
required: !0,
|
|
946
|
+
error: L("password"),
|
|
947
|
+
announceError: !F.lists("password"),
|
|
948
|
+
"data-field": "password",
|
|
949
|
+
children: /* @__PURE__ */ s(
|
|
950
|
+
Rr,
|
|
951
|
+
{
|
|
952
|
+
ref: $.password,
|
|
953
|
+
name: Z("password") ?? "",
|
|
954
|
+
autoComplete: "new-password",
|
|
955
|
+
requirements: lr,
|
|
956
|
+
value: i.password,
|
|
957
|
+
onChange: (o) => D("password", o.target.value),
|
|
958
|
+
onBlur: () => ie("password"),
|
|
959
|
+
...ae("password")
|
|
960
|
+
}
|
|
961
|
+
)
|
|
962
|
+
},
|
|
963
|
+
e
|
|
964
|
+
);
|
|
965
|
+
case "passwordConfirm":
|
|
966
|
+
return /* @__PURE__ */ s(
|
|
967
|
+
z,
|
|
968
|
+
{
|
|
969
|
+
id: T(e),
|
|
970
|
+
label: H.passwordConfirm,
|
|
971
|
+
required: !0,
|
|
972
|
+
error: L("passwordConfirm"),
|
|
973
|
+
announceError: !F.lists("passwordConfirm"),
|
|
974
|
+
"data-field": "passwordConfirm",
|
|
975
|
+
children: /* @__PURE__ */ s(
|
|
976
|
+
Rr,
|
|
977
|
+
{
|
|
978
|
+
ref: $.passwordConfirm,
|
|
979
|
+
name: Z("passwordConfirm") ?? "",
|
|
980
|
+
autoComplete: "new-password",
|
|
981
|
+
value: i.passwordConfirm,
|
|
982
|
+
onChange: (o) => D("passwordConfirm", o.target.value),
|
|
983
|
+
onBlur: () => {
|
|
984
|
+
ie("passwordConfirm"), _e.confirmProps.onBlur();
|
|
985
|
+
},
|
|
986
|
+
...ae("passwordConfirm")
|
|
987
|
+
}
|
|
988
|
+
)
|
|
989
|
+
},
|
|
990
|
+
e
|
|
991
|
+
);
|
|
992
|
+
case "phone":
|
|
993
|
+
return /* @__PURE__ */ s(
|
|
994
|
+
z,
|
|
995
|
+
{
|
|
996
|
+
id: T(e),
|
|
997
|
+
label: H.phone,
|
|
998
|
+
required: !0,
|
|
999
|
+
error: L("phone"),
|
|
1000
|
+
announceError: !F.lists("phone"),
|
|
1001
|
+
"data-field": "phone",
|
|
1002
|
+
"data-verification": Gr(re),
|
|
1003
|
+
children: re.enabled ? /* @__PURE__ */ g("div", { className: "ds:@container/verify ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1004
|
+
/* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-sm)] ds:@[384px]/verify:flex-row", children: [
|
|
1005
|
+
/* @__PURE__ */ s("div", { className: "ds:min-w-0 ds:w-full ds:@[384px]/verify:w-auto ds:@[384px]/verify:flex-1", children: xr }),
|
|
1006
|
+
/* @__PURE__ */ s(
|
|
1007
|
+
jr,
|
|
1008
|
+
{
|
|
1009
|
+
state: re,
|
|
1010
|
+
canSend: i.phone !== "" && Le
|
|
1011
|
+
}
|
|
1012
|
+
)
|
|
1013
|
+
] }),
|
|
1014
|
+
/* @__PURE__ */ s(
|
|
1015
|
+
Hr,
|
|
1016
|
+
{
|
|
1017
|
+
field: "phone",
|
|
1018
|
+
state: re,
|
|
1019
|
+
changeWhenVerified: !0,
|
|
1020
|
+
onUnlocked: () => {
|
|
1021
|
+
var o;
|
|
1022
|
+
return (o = se.current.phone) == null ? void 0 : o.focus();
|
|
1023
|
+
},
|
|
1024
|
+
onVerified: () => {
|
|
1025
|
+
var o;
|
|
1026
|
+
return (o = se.current.phone) == null ? void 0 : o.focus();
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
)
|
|
1030
|
+
] }) : xr
|
|
1031
|
+
},
|
|
1032
|
+
e
|
|
1033
|
+
);
|
|
1034
|
+
case "branch":
|
|
1035
|
+
return /* @__PURE__ */ s(
|
|
1036
|
+
z,
|
|
1037
|
+
{
|
|
1038
|
+
id: T(e),
|
|
1039
|
+
label: H.branch,
|
|
1040
|
+
required: !0,
|
|
1041
|
+
error: L("branch"),
|
|
1042
|
+
announceError: !F.lists("branch"),
|
|
1043
|
+
"data-field": "branch",
|
|
1044
|
+
children: /* @__PURE__ */ s(
|
|
1045
|
+
Sn,
|
|
1046
|
+
{
|
|
1047
|
+
ref: $.branch,
|
|
1048
|
+
name: Z("branch"),
|
|
1049
|
+
options: q ?? [],
|
|
1050
|
+
value: i.branch,
|
|
1051
|
+
onValueChange: (o) => D("branch", o)
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
},
|
|
1055
|
+
e
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
return /* @__PURE__ */ s(
|
|
1060
|
+
"div",
|
|
1061
|
+
{
|
|
1062
|
+
ref: Re,
|
|
1063
|
+
...Ne,
|
|
1064
|
+
"data-component": "registration-form",
|
|
1065
|
+
className: jn({ className: x }),
|
|
1066
|
+
children: /* @__PURE__ */ s(kr, { variant: "elevated", children: /* @__PURE__ */ g(kr.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
1067
|
+
/* @__PURE__ */ g("div", { className: $n({ logo: t }), children: [
|
|
1068
|
+
/* @__PURE__ */ g("div", { className: zn({ centred: t }), children: [
|
|
1069
|
+
t && /* @__PURE__ */ s(kn, { motion: d, label: Jn }),
|
|
1070
|
+
/* @__PURE__ */ s(dn, { id: nr, className: "type-title-card", children: n ?? m("registrationForm.title") }),
|
|
1071
|
+
r && /* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: r })
|
|
1072
|
+
] }),
|
|
1073
|
+
y && (y.values || y.onClick) && /* @__PURE__ */ s("div", { className: Un({ corner: t }), children: /* @__PURE__ */ s(
|
|
1074
|
+
bn,
|
|
1075
|
+
{
|
|
1076
|
+
label: y.label,
|
|
1077
|
+
onClick: an
|
|
1078
|
+
}
|
|
1079
|
+
) })
|
|
1080
|
+
] }),
|
|
1081
|
+
ln ? /* @__PURE__ */ g(
|
|
1082
|
+
"div",
|
|
1083
|
+
{
|
|
1084
|
+
"data-slot": "host-content",
|
|
1085
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1086
|
+
children: [
|
|
1087
|
+
X ? /* @__PURE__ */ s(ce, { variant: "info", announce: "off", children: /* @__PURE__ */ s(ce.Description, { children: X }) }) : null,
|
|
1088
|
+
Ye.length > 0 ? /* @__PURE__ */ s(Ir, { density: "compact", children: Ye.map((e, o) => /* @__PURE__ */ s(
|
|
1089
|
+
Ir.Item,
|
|
1090
|
+
{
|
|
1091
|
+
leading: /* @__PURE__ */ s(Pn, { "aria-hidden": "true" }),
|
|
1092
|
+
title: e
|
|
1093
|
+
},
|
|
1094
|
+
`${o}-${e}`
|
|
1095
|
+
)) }) : null,
|
|
1096
|
+
w
|
|
1097
|
+
]
|
|
1098
|
+
}
|
|
1099
|
+
) : null,
|
|
1100
|
+
/* @__PURE__ */ g(
|
|
1101
|
+
"form",
|
|
1102
|
+
{
|
|
1103
|
+
ref: ze,
|
|
1104
|
+
noValidate: !0,
|
|
1105
|
+
method: "post",
|
|
1106
|
+
action: mn,
|
|
1107
|
+
"aria-labelledby": nr,
|
|
1108
|
+
"aria-busy": We || void 0,
|
|
1109
|
+
onSubmit: he.handleSubmit,
|
|
1110
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1111
|
+
children: [
|
|
1112
|
+
/* @__PURE__ */ s(
|
|
1113
|
+
Nn,
|
|
1114
|
+
{
|
|
1115
|
+
ref: F.ref,
|
|
1116
|
+
headingLevel: c + 1,
|
|
1117
|
+
"aria-describedby": xe ? tr : void 0,
|
|
1118
|
+
errors: F.listed.map((e) => {
|
|
1119
|
+
const o = L(e) ?? "";
|
|
1120
|
+
return {
|
|
1121
|
+
field: e,
|
|
1122
|
+
message: o,
|
|
1123
|
+
// "This field is required." does not say which field:
|
|
1124
|
+
// the summary names it.
|
|
1125
|
+
label: o === j && e !== "terms" ? H[e] : void 0,
|
|
1126
|
+
targetId: T(e)
|
|
1127
|
+
};
|
|
1128
|
+
})
|
|
1129
|
+
}
|
|
1130
|
+
),
|
|
1131
|
+
xe && /* @__PURE__ */ s(
|
|
1132
|
+
ce,
|
|
1133
|
+
{
|
|
1134
|
+
ref: pr,
|
|
1135
|
+
id: tr,
|
|
1136
|
+
variant: "error",
|
|
1137
|
+
announce: fn,
|
|
1138
|
+
tabIndex: -1,
|
|
1139
|
+
"data-field": "form",
|
|
1140
|
+
className: Gn(),
|
|
1141
|
+
children: /* @__PURE__ */ s(ce.Description, { children: xe })
|
|
1142
|
+
}
|
|
1143
|
+
),
|
|
1144
|
+
Vn(
|
|
1145
|
+
(e) => e === "emailConfirm" ? f(e) || dr : f(e)
|
|
1146
|
+
).map((e) => /* @__PURE__ */ s(
|
|
1147
|
+
"div",
|
|
1148
|
+
{
|
|
1149
|
+
className: Hn({
|
|
1150
|
+
columns: e.length === 2 ? "two" : "one"
|
|
1151
|
+
}),
|
|
1152
|
+
children: e.map(pn)
|
|
1153
|
+
},
|
|
1154
|
+
e[0]
|
|
1155
|
+
)),
|
|
1156
|
+
Y && $e && M.phone && /* @__PURE__ */ s(
|
|
1157
|
+
"input",
|
|
1158
|
+
{
|
|
1159
|
+
type: "hidden",
|
|
1160
|
+
name: M.phone,
|
|
1161
|
+
value: i.phone
|
|
1162
|
+
}
|
|
1163
|
+
),
|
|
1164
|
+
Y && M.captcha && /* @__PURE__ */ s(
|
|
1165
|
+
"input",
|
|
1166
|
+
{
|
|
1167
|
+
ref: Ue,
|
|
1168
|
+
type: "hidden",
|
|
1169
|
+
name: M.captcha,
|
|
1170
|
+
defaultValue: ""
|
|
1171
|
+
}
|
|
1172
|
+
),
|
|
1173
|
+
Nr.filter(([e]) => !br.has(e)).map(([e, o]) => /* @__PURE__ */ s(
|
|
1174
|
+
"input",
|
|
1175
|
+
{
|
|
1176
|
+
type: "hidden",
|
|
1177
|
+
name: e,
|
|
1178
|
+
value: o
|
|
1179
|
+
},
|
|
1180
|
+
e
|
|
1181
|
+
)),
|
|
1182
|
+
f("terms") && /* @__PURE__ */ g(
|
|
1183
|
+
"div",
|
|
1184
|
+
{
|
|
1185
|
+
id: T("terms"),
|
|
1186
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
1187
|
+
"data-field": "terms",
|
|
1188
|
+
children: [
|
|
1189
|
+
Je && /* @__PURE__ */ s(
|
|
1190
|
+
"p",
|
|
1191
|
+
{
|
|
1192
|
+
id: or,
|
|
1193
|
+
className: "type-body-sm ds:text-[var(--muted-foreground)]",
|
|
1194
|
+
children: Je
|
|
1195
|
+
}
|
|
1196
|
+
),
|
|
1197
|
+
/* @__PURE__ */ s(
|
|
1198
|
+
wn,
|
|
1199
|
+
{
|
|
1200
|
+
ref: $.terms,
|
|
1201
|
+
name: Z("terms"),
|
|
1202
|
+
value: "1",
|
|
1203
|
+
checked: i.terms,
|
|
1204
|
+
onCheckedChange: (e) => D("terms", e === !0),
|
|
1205
|
+
"aria-required": "true",
|
|
1206
|
+
"aria-invalid": Se ? !0 : void 0,
|
|
1207
|
+
"aria-describedby": un,
|
|
1208
|
+
label: /* @__PURE__ */ g(er, { children: [
|
|
1209
|
+
cn ?? /* @__PURE__ */ s(
|
|
1210
|
+
Sr,
|
|
1211
|
+
{
|
|
1212
|
+
i18n: rr,
|
|
1213
|
+
ns: "ui",
|
|
1214
|
+
i18nKey: "registrationForm.terms",
|
|
1215
|
+
components: {
|
|
1216
|
+
terms: Ke ? /* @__PURE__ */ s(ke, { href: Ke, newTab: !0 }) : /* @__PURE__ */ s(Wr, {}),
|
|
1217
|
+
privacy: Xe ? /* @__PURE__ */ s(ke, { href: Xe, newTab: !0 }) : /* @__PURE__ */ s(Wr, {})
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
),
|
|
1221
|
+
/* @__PURE__ */ s(
|
|
1222
|
+
"span",
|
|
1223
|
+
{
|
|
1224
|
+
"aria-hidden": "true",
|
|
1225
|
+
className: Kn(),
|
|
1226
|
+
children: "*"
|
|
1227
|
+
}
|
|
1228
|
+
)
|
|
1229
|
+
] })
|
|
1230
|
+
}
|
|
1231
|
+
),
|
|
1232
|
+
Se && /* @__PURE__ */ g(
|
|
1233
|
+
"p",
|
|
1234
|
+
{
|
|
1235
|
+
id: sr,
|
|
1236
|
+
role: F.lists("terms") ? void 0 : "alert",
|
|
1237
|
+
"data-slot": "error",
|
|
1238
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive",
|
|
1239
|
+
children: [
|
|
1240
|
+
/* @__PURE__ */ s(
|
|
1241
|
+
Tn,
|
|
1242
|
+
{
|
|
1243
|
+
"aria-hidden": "true",
|
|
1244
|
+
className: "ds:size-4 ds:shrink-0"
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
/* @__PURE__ */ s("span", { children: Se })
|
|
1248
|
+
]
|
|
1249
|
+
}
|
|
1250
|
+
)
|
|
1251
|
+
]
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
/* @__PURE__ */ s(
|
|
1255
|
+
oe,
|
|
1256
|
+
{
|
|
1257
|
+
type: "submit",
|
|
1258
|
+
intent: "primary",
|
|
1259
|
+
size: "lg",
|
|
1260
|
+
loading: We,
|
|
1261
|
+
className: "ds:w-full",
|
|
1262
|
+
"data-action": "submit",
|
|
1263
|
+
"aria-disabled": Be || Oe || void 0,
|
|
1264
|
+
children: be ?? m("registrationForm.submit")
|
|
1265
|
+
}
|
|
1266
|
+
),
|
|
1267
|
+
/* @__PURE__ */ s("p", { role: "status", className: "ds:sr-only", children: We ? m("chat.message.status.sending") : "" }),
|
|
1268
|
+
Cr && /* @__PURE__ */ s("p", { className: "type-body-sm ds:text-center ds:text-[var(--muted-foreground)]", children: /* @__PURE__ */ s(
|
|
1269
|
+
Sr,
|
|
1270
|
+
{
|
|
1271
|
+
i18n: rr,
|
|
1272
|
+
ns: "ui",
|
|
1273
|
+
i18nKey: "registrationForm.login",
|
|
1274
|
+
components: {
|
|
1275
|
+
login: /* @__PURE__ */ s(
|
|
1276
|
+
ke,
|
|
1277
|
+
{
|
|
1278
|
+
href: Cr,
|
|
1279
|
+
weight: "strong",
|
|
1280
|
+
action: "login"
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
) }),
|
|
1286
|
+
P && /* @__PURE__ */ s("div", { className: "ds:absolute", children: /* @__PURE__ */ s(
|
|
1287
|
+
xn,
|
|
1288
|
+
{
|
|
1289
|
+
ref: he.captcha.ref,
|
|
1290
|
+
siteKey: P,
|
|
1291
|
+
size: "invisible",
|
|
1292
|
+
announceStatus: !1,
|
|
1293
|
+
onChange: he.captcha.onChange,
|
|
1294
|
+
onError: he.captcha.onError
|
|
1295
|
+
}
|
|
1296
|
+
) })
|
|
1297
|
+
]
|
|
1298
|
+
}
|
|
1299
|
+
)
|
|
1300
|
+
] }) })
|
|
1301
|
+
}
|
|
1302
|
+
);
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1305
|
+
es.displayName = "RegistrationForm";
|
|
1306
|
+
export {
|
|
1307
|
+
$r as R,
|
|
1308
|
+
es as a
|
|
1309
|
+
};
|
|
1310
|
+
//# sourceMappingURL=registration-form-B6qqeXP1.js.map
|