@cedros/login-react 0.0.37 → 0.0.39
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/{AuthenticationSettings-CsPbxwP7.js → AuthenticationSettings-BF_7Ea6Z.js} +1 -1
- package/dist/{AuthenticationSettings-CsPbxwP7.js.map → AuthenticationSettings-BF_7Ea6Z.js.map} +1 -1
- package/dist/{AuthenticationSettings-C-aYDXNH.cjs → AuthenticationSettings-BMDrCVSf.cjs} +1 -1
- package/dist/{AuthenticationSettings-C-aYDXNH.cjs.map → AuthenticationSettings-BMDrCVSf.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-DIVk0OP8.js → AuthenticationSettings-DUXpyiJ5.js} +39 -39
- package/dist/{AuthenticationSettings-DIVk0OP8.js.map → AuthenticationSettings-DUXpyiJ5.js.map} +1 -1
- package/dist/{AuthenticationSettings-CoTic-d_.cjs → AuthenticationSettings-Dk1LX0CK.cjs} +1 -1
- package/dist/{AuthenticationSettings-CoTic-d_.cjs.map → AuthenticationSettings-Dk1LX0CK.cjs.map} +1 -1
- package/dist/{AutosaveStatus-DGNI4lXn.cjs → AutosaveStatus-BKsCIvPj.cjs} +1 -1
- package/dist/AutosaveStatus-BKsCIvPj.cjs.map +1 -0
- package/dist/{AutosaveStatus-f-jw25Ay.js → AutosaveStatus-CSZsp6w7.js} +221 -186
- package/dist/AutosaveStatus-CSZsp6w7.js.map +1 -0
- package/dist/{CreditSystemSettings-C6ed3yp7.js → CreditSystemSettings-Buu7Y-7I.js} +1 -1
- package/dist/{CreditSystemSettings-C6ed3yp7.js.map → CreditSystemSettings-Buu7Y-7I.js.map} +1 -1
- package/dist/{CreditSystemSettings-DM9ep1TF.cjs → CreditSystemSettings-C2HkyMXy.cjs} +1 -1
- package/dist/{CreditSystemSettings-DM9ep1TF.cjs.map → CreditSystemSettings-C2HkyMXy.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-BNkvsgsk.cjs → CreditSystemSettings-CLImarX-.cjs} +1 -1
- package/dist/{CreditSystemSettings-BNkvsgsk.cjs.map → CreditSystemSettings-CLImarX-.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-uinhzoha.js → CreditSystemSettings-Cj21_Ug8.js} +1 -1
- package/dist/{CreditSystemSettings-uinhzoha.js.map → CreditSystemSettings-Cj21_Ug8.js.map} +1 -1
- package/dist/EmailRegisterForm-CNjYrqU6.cjs +1 -0
- package/dist/EmailRegisterForm-CNjYrqU6.cjs.map +1 -0
- package/dist/EmailRegisterForm-D2VaJouj.js +750 -0
- package/dist/EmailRegisterForm-D2VaJouj.js.map +1 -0
- package/dist/{EmailSettings-BC0f1PCI.cjs → EmailSettings-9sdEAONl.cjs} +1 -1
- package/dist/{EmailSettings-BC0f1PCI.cjs.map → EmailSettings-9sdEAONl.cjs.map} +1 -1
- package/dist/{EmailSettings-BKuXy8sc.js → EmailSettings-CmxxnrA9.js} +1 -1
- package/dist/{EmailSettings-BKuXy8sc.js.map → EmailSettings-CmxxnrA9.js.map} +1 -1
- package/dist/{EmailSettings-BAuQtEfM.js → EmailSettings-DRfOF0Sf.js} +1 -1
- package/dist/{EmailSettings-BAuQtEfM.js.map → EmailSettings-DRfOF0Sf.js.map} +1 -1
- package/dist/{EmailSettings-BF5EiPl9.cjs → EmailSettings-eLlzzI5D.cjs} +1 -1
- package/dist/{EmailSettings-BF5EiPl9.cjs.map → EmailSettings-eLlzzI5D.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CJY39UZN.cjs → EmbeddedWalletSettings-BuLN_Uqc.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-CJY39UZN.cjs.map → EmbeddedWalletSettings-BuLN_Uqc.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-C27X9He2.js → EmbeddedWalletSettings-CHkkCjyR.js} +1 -1
- package/dist/{EmbeddedWalletSettings-C27X9He2.js.map → EmbeddedWalletSettings-CHkkCjyR.js.map} +1 -1
- package/dist/EmbeddedWalletSettings-DGq-kXbw.cjs +1 -0
- package/dist/EmbeddedWalletSettings-DGq-kXbw.cjs.map +1 -0
- package/dist/{EmbeddedWalletSettings-Dmi-EQ7W.js → EmbeddedWalletSettings-M-D5N0eY.js} +5 -5
- package/dist/EmbeddedWalletSettings-M-D5N0eY.js.map +1 -0
- package/dist/{GoogleLoginButton-BDCbxoCB.cjs → GoogleLoginButton-JtRViYWS.cjs} +1 -1
- package/dist/GoogleLoginButton-JtRViYWS.cjs.map +1 -0
- package/dist/{GoogleLoginButton-6ip-vudk.js → GoogleLoginButton-qf4A_A3G.js} +6 -6
- package/dist/GoogleLoginButton-qf4A_A3G.js.map +1 -0
- package/dist/{ServerSettings-CKfiLfXi.cjs → ServerSettings-CMmH5pZv.cjs} +1 -1
- package/dist/{ServerSettings-CKfiLfXi.cjs.map → ServerSettings-CMmH5pZv.cjs.map} +1 -1
- package/dist/{ServerSettings-CZfBdMxG.js → ServerSettings-DQemMrNv.js} +1 -1
- package/dist/{ServerSettings-CZfBdMxG.js.map → ServerSettings-DQemMrNv.js.map} +1 -1
- package/dist/{ServerSettings-rHrVN8O8.cjs → ServerSettings-DfimU7ay.cjs} +1 -1
- package/dist/{ServerSettings-rHrVN8O8.cjs.map → ServerSettings-DfimU7ay.cjs.map} +1 -1
- package/dist/{ServerSettings-BT9weFPz.js → ServerSettings-qxi8aZO7.js} +1 -1
- package/dist/{ServerSettings-BT9weFPz.js.map → ServerSettings-qxi8aZO7.js.map} +1 -1
- package/dist/{WebhookSettings-DXjnq-c7.cjs → WebhookSettings-0sgWRI3U.cjs} +1 -1
- package/dist/{WebhookSettings-DXjnq-c7.cjs.map → WebhookSettings-0sgWRI3U.cjs.map} +1 -1
- package/dist/{WebhookSettings-Bgld6D_T.js → WebhookSettings-8QAqvkkO.js} +1 -1
- package/dist/{WebhookSettings-Bgld6D_T.js.map → WebhookSettings-8QAqvkkO.js.map} +1 -1
- package/dist/{WebhookSettings-DnLk97Mr.cjs → WebhookSettings-B6Y3Tnjv.cjs} +1 -1
- package/dist/{WebhookSettings-DnLk97Mr.cjs.map → WebhookSettings-B6Y3Tnjv.cjs.map} +1 -1
- package/dist/{WebhookSettings-ufiGTmbG.js → WebhookSettings-B8hAwhZ2.js} +1 -1
- package/dist/{WebhookSettings-ufiGTmbG.js.map → WebhookSettings-B8hAwhZ2.js.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +3 -2
- package/dist/email-only.js +2 -2
- package/dist/google-only.cjs +1 -1
- package/dist/google-only.d.ts +5 -4
- package/dist/google-only.js +2 -2
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +98 -7
- package/dist/index.js +8052 -5962
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-Xca67fp7.cjs → plugin-CUxpAjL-.cjs} +1 -1
- package/dist/{plugin-Xca67fp7.cjs.map → plugin-CUxpAjL-.cjs.map} +1 -1
- package/dist/{plugin-BbExid4E.js → plugin-C_NDZ2-D.js} +5 -5
- package/dist/{plugin-BbExid4E.js.map → plugin-C_NDZ2-D.js.map} +1 -1
- package/dist/solana-only.cjs +1 -1
- package/dist/solana-only.d.ts +3 -2
- package/dist/solana-only.js +1 -1
- package/dist/{useAuth-CVLv2oKA.js → useAuth-C-Vw-ggy.js} +743 -803
- package/dist/useAuth-C-Vw-ggy.js.map +1 -0
- package/dist/useAuth-U5CYsHEU.cjs +1 -0
- package/dist/useAuth-U5CYsHEU.cjs.map +1 -0
- package/package.json +4 -1
- package/dist/AutosaveStatus-DGNI4lXn.cjs.map +0 -1
- package/dist/AutosaveStatus-f-jw25Ay.js.map +0 -1
- package/dist/EmailRegisterForm-B_TiJkD6.cjs +0 -1
- package/dist/EmailRegisterForm-B_TiJkD6.cjs.map +0 -1
- package/dist/EmailRegisterForm-CCEuQA-w.js +0 -773
- package/dist/EmailRegisterForm-CCEuQA-w.js.map +0 -1
- package/dist/EmbeddedWalletSettings-BRjt2PAj.cjs +0 -1
- package/dist/EmbeddedWalletSettings-BRjt2PAj.cjs.map +0 -1
- package/dist/EmbeddedWalletSettings-Dmi-EQ7W.js.map +0 -1
- package/dist/GoogleLoginButton-6ip-vudk.js.map +0 -1
- package/dist/GoogleLoginButton-BDCbxoCB.cjs.map +0 -1
- package/dist/shamir-DBpHm7WN.cjs +0 -1
- package/dist/shamir-DBpHm7WN.cjs.map +0 -1
- package/dist/shamir-R8ddesFt.js +0 -1940
- package/dist/shamir-R8ddesFt.js.map +0 -1
- package/dist/silentWalletEnroll-Dp1GTeNr.js +0 -41
- package/dist/silentWalletEnroll-Dp1GTeNr.js.map +0 -1
- package/dist/silentWalletEnroll-HPvsbd2J.cjs +0 -1
- package/dist/silentWalletEnroll-HPvsbd2J.cjs.map +0 -1
- package/dist/useAuth-CVLv2oKA.js.map +0 -1
- package/dist/useAuth-XZaciuLg.cjs +0 -1
- package/dist/useAuth-XZaciuLg.cjs.map +0 -1
|
@@ -1,773 +0,0 @@
|
|
|
1
|
-
import { jsxs as f, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as W, useState as w, useCallback as E, useEffect as U, useMemo as z, useId as j } from "react";
|
|
3
|
-
import { L as $ } from "./LoadingSpinner-6vml-zwr.js";
|
|
4
|
-
import { E as H } from "./ErrorMessage-CcEK0pYO.js";
|
|
5
|
-
import { u as x, A as K, h as q } from "./useCedrosLogin-CFfID-0i.js";
|
|
6
|
-
import { b as F, v as ce } from "./validation-B8kMV3BL.js";
|
|
7
|
-
import { s as le } from "./sanitization-CQ-H1MSg.js";
|
|
8
|
-
function Z(c = {}) {
|
|
9
|
-
const { maxAttempts: m = 5, windowMs: k = 6e4, showCountdown: p = !1 } = c, u = W([]), [a, v] = w(!1), [, b] = w(0), d = E(() => {
|
|
10
|
-
b((i) => i + 1);
|
|
11
|
-
}, []), l = E(() => {
|
|
12
|
-
const i = Date.now();
|
|
13
|
-
u.current = u.current.filter((t) => i - t < k);
|
|
14
|
-
}, [k]), g = E(() => {
|
|
15
|
-
l(), v((i) => u.current.length === 0 && i ? !1 : i);
|
|
16
|
-
}, [l]), n = E(() => (l(), Math.max(0, m - u.current.length)), [l, m]), h = E(() => {
|
|
17
|
-
if (l(), u.current.length === 0)
|
|
18
|
-
return 0;
|
|
19
|
-
const t = u.current[0] + k;
|
|
20
|
-
return Math.max(0, t - Date.now());
|
|
21
|
-
}, [l, k]), y = E(() => (l(), u.current.length < m), [l, m]), C = E(() => {
|
|
22
|
-
if (g(), u.current.length >= m) {
|
|
23
|
-
const i = h(), t = Math.ceil(i / 1e3);
|
|
24
|
-
throw new Error(
|
|
25
|
-
`Too many attempts. Please wait ${t} second${t === 1 ? "" : "s"} before trying again.`
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
u.current.push(Date.now()), v((i) => i || !0), d();
|
|
29
|
-
}, [g, m, h, d]), N = E(() => {
|
|
30
|
-
u.current = [], v((i) => i && !1), d();
|
|
31
|
-
}, [d]);
|
|
32
|
-
return U(() => {
|
|
33
|
-
if (!a || !p) return;
|
|
34
|
-
const i = window.setInterval(() => {
|
|
35
|
-
g(), d();
|
|
36
|
-
}, 1e3);
|
|
37
|
-
return () => {
|
|
38
|
-
window.clearInterval(i);
|
|
39
|
-
};
|
|
40
|
-
}, [a, p, d, g]), {
|
|
41
|
-
checkLimit: C,
|
|
42
|
-
isAllowed: y,
|
|
43
|
-
getRemainingAttempts: n,
|
|
44
|
-
getTimeUntilReset: h,
|
|
45
|
-
reset: N
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function ie(c) {
|
|
49
|
-
return "mfaRequired" in c && c.mfaRequired === !0;
|
|
50
|
-
}
|
|
51
|
-
function Y() {
|
|
52
|
-
const { config: c, _internal: m } = x(), [k, p] = w(!1), [u, a] = w(null), {
|
|
53
|
-
checkLimit: v,
|
|
54
|
-
getRemainingAttempts: b,
|
|
55
|
-
getTimeUntilReset: d,
|
|
56
|
-
reset: l
|
|
57
|
-
} = Z({ maxAttempts: 5, windowMs: 6e4 }), g = z(
|
|
58
|
-
() => new K({
|
|
59
|
-
baseUrl: c.serverUrl,
|
|
60
|
-
timeoutMs: c.requestTimeout,
|
|
61
|
-
retryAttempts: c.retryAttempts
|
|
62
|
-
}),
|
|
63
|
-
[c.serverUrl, c.requestTimeout, c.retryAttempts]
|
|
64
|
-
), n = c.callbacks, h = c.features?.walletEnrollment !== !1, y = c.serverUrl, C = E(
|
|
65
|
-
async (t, s) => {
|
|
66
|
-
if (!F(t)) {
|
|
67
|
-
const o = {
|
|
68
|
-
code: "VALIDATION_ERROR",
|
|
69
|
-
message: "Please enter a valid email address"
|
|
70
|
-
};
|
|
71
|
-
throw a(o), o;
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
v();
|
|
75
|
-
} catch (o) {
|
|
76
|
-
const r = {
|
|
77
|
-
code: "RATE_LIMITED",
|
|
78
|
-
message: o instanceof Error ? o.message : "Too many attempts"
|
|
79
|
-
};
|
|
80
|
-
throw a(r), r;
|
|
81
|
-
}
|
|
82
|
-
p(!0), a(null);
|
|
83
|
-
try {
|
|
84
|
-
const o = await g.post("/login", {
|
|
85
|
-
email: t,
|
|
86
|
-
password: s
|
|
87
|
-
});
|
|
88
|
-
if (ie(o))
|
|
89
|
-
return {
|
|
90
|
-
mfaRequired: !0,
|
|
91
|
-
mfaToken: o.mfaToken,
|
|
92
|
-
email: t,
|
|
93
|
-
userId: o.userId
|
|
94
|
-
};
|
|
95
|
-
const r = o;
|
|
96
|
-
return n?.onLoginSuccess?.(r.user, "email"), m?.handleLoginSuccess(r.user, r.tokens), l(), {
|
|
97
|
-
mfaRequired: !1,
|
|
98
|
-
response: r
|
|
99
|
-
};
|
|
100
|
-
} catch (o) {
|
|
101
|
-
const r = q(o, "Unable to sign in. Please try again.");
|
|
102
|
-
throw a(r), r;
|
|
103
|
-
} finally {
|
|
104
|
-
p(!1);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
[g, n, m, v, l]
|
|
108
|
-
), N = E(
|
|
109
|
-
async (t, s, o) => {
|
|
110
|
-
if (!F(t)) {
|
|
111
|
-
const r = {
|
|
112
|
-
code: "VALIDATION_ERROR",
|
|
113
|
-
message: "Please enter a valid email address"
|
|
114
|
-
};
|
|
115
|
-
throw a(r), r;
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
v();
|
|
119
|
-
} catch (r) {
|
|
120
|
-
const A = {
|
|
121
|
-
code: "RATE_LIMITED",
|
|
122
|
-
message: r instanceof Error ? r.message : "Too many attempts"
|
|
123
|
-
};
|
|
124
|
-
throw a(A), A;
|
|
125
|
-
}
|
|
126
|
-
p(!0), a(null);
|
|
127
|
-
try {
|
|
128
|
-
const r = await g.post("/register", { email: t, password: s, name: o });
|
|
129
|
-
if (n?.onLoginSuccess?.(r.user, "email"), m?.handleLoginSuccess(r.user, r.tokens), l(), h) {
|
|
130
|
-
const A = r.tokens?.accessToken ?? "", I = !A ? 200 : 0;
|
|
131
|
-
new Promise((L) => setTimeout(L, I)).then(() => import("./silentWalletEnroll-Dp1GTeNr.js")).then(
|
|
132
|
-
({ silentWalletEnroll: L }) => L({
|
|
133
|
-
password: s,
|
|
134
|
-
serverUrl: y,
|
|
135
|
-
accessToken: A
|
|
136
|
-
})
|
|
137
|
-
).then((L) => {
|
|
138
|
-
L.success || console.warn("[useEmailAuth] Wallet auto-enrollment failed:", L.error);
|
|
139
|
-
}).catch((L) => {
|
|
140
|
-
const V = L instanceof Error ? L.message : "Unknown error";
|
|
141
|
-
console.warn("[useEmailAuth] Wallet auto-enrollment unavailable:", V);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return r;
|
|
145
|
-
} catch (r) {
|
|
146
|
-
const A = q(r, "Unable to create your account. Please try again.");
|
|
147
|
-
throw a(A), A;
|
|
148
|
-
} finally {
|
|
149
|
-
p(!1);
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
[
|
|
153
|
-
g,
|
|
154
|
-
n,
|
|
155
|
-
m,
|
|
156
|
-
v,
|
|
157
|
-
l,
|
|
158
|
-
y,
|
|
159
|
-
h
|
|
160
|
-
]
|
|
161
|
-
), i = E(() => a(null), []);
|
|
162
|
-
return {
|
|
163
|
-
login: C,
|
|
164
|
-
register: N,
|
|
165
|
-
isLoading: k,
|
|
166
|
-
error: u,
|
|
167
|
-
clearError: i,
|
|
168
|
-
// M-10: Point-in-time snapshots for UI display (see interface JSDoc)
|
|
169
|
-
remainingAttempts: b(),
|
|
170
|
-
timeUntilReset: d()
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
function O({
|
|
174
|
-
label: c = "Password",
|
|
175
|
-
labelAction: m,
|
|
176
|
-
showStrengthMeter: k = !1,
|
|
177
|
-
onValidationChange: p,
|
|
178
|
-
error: u,
|
|
179
|
-
className: a = "",
|
|
180
|
-
onChange: v,
|
|
181
|
-
value: b,
|
|
182
|
-
...d
|
|
183
|
-
}) {
|
|
184
|
-
const [l, g] = w(!1), [n, h] = w(null), y = j(), C = (i) => {
|
|
185
|
-
const t = i.target.value;
|
|
186
|
-
if (k || p) {
|
|
187
|
-
const s = ce(t);
|
|
188
|
-
h(s), p?.(s);
|
|
189
|
-
}
|
|
190
|
-
v?.(i);
|
|
191
|
-
}, N = {
|
|
192
|
-
weak: "var(--cedros-destructive, #ef4444)",
|
|
193
|
-
fair: "var(--cedros-warning, #f59e0b)",
|
|
194
|
-
good: "var(--cedros-success, #22c55e)",
|
|
195
|
-
strong: "var(--cedros-success, #22c55e)"
|
|
196
|
-
};
|
|
197
|
-
return /* @__PURE__ */ f("div", { className: `cedros-password-input ${a}`, children: [
|
|
198
|
-
/* @__PURE__ */ f("div", { className: "cedros-label-row", children: [
|
|
199
|
-
/* @__PURE__ */ e("label", { htmlFor: y, className: "cedros-label", children: c }),
|
|
200
|
-
m
|
|
201
|
-
] }),
|
|
202
|
-
/* @__PURE__ */ f("div", { className: "cedros-password-wrapper", children: [
|
|
203
|
-
/* @__PURE__ */ e(
|
|
204
|
-
"input",
|
|
205
|
-
{
|
|
206
|
-
id: y,
|
|
207
|
-
type: l ? "text" : "password",
|
|
208
|
-
className: "cedros-input",
|
|
209
|
-
onChange: C,
|
|
210
|
-
value: b,
|
|
211
|
-
"aria-invalid": u ? "true" : void 0,
|
|
212
|
-
"aria-describedby": u ? `${y}-error` : void 0,
|
|
213
|
-
...d
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ e(
|
|
217
|
-
"button",
|
|
218
|
-
{
|
|
219
|
-
type: "button",
|
|
220
|
-
className: "cedros-password-toggle",
|
|
221
|
-
onClick: () => g(!l),
|
|
222
|
-
"aria-label": l ? "Hide password" : "Show password",
|
|
223
|
-
"aria-pressed": l,
|
|
224
|
-
children: l ? /* @__PURE__ */ f("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
225
|
-
/* @__PURE__ */ e(
|
|
226
|
-
"path",
|
|
227
|
-
{
|
|
228
|
-
d: "M2.5 10s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6-7.5-6-7.5-6z",
|
|
229
|
-
stroke: "currentColor",
|
|
230
|
-
strokeWidth: "1.5"
|
|
231
|
-
}
|
|
232
|
-
),
|
|
233
|
-
/* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
234
|
-
/* @__PURE__ */ e("path", { d: "M3 17L17 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
235
|
-
] }) : /* @__PURE__ */ f("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
236
|
-
/* @__PURE__ */ e(
|
|
237
|
-
"path",
|
|
238
|
-
{
|
|
239
|
-
d: "M2.5 10s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6-7.5-6-7.5-6z",
|
|
240
|
-
stroke: "currentColor",
|
|
241
|
-
strokeWidth: "1.5"
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
/* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" })
|
|
245
|
-
] })
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
] }),
|
|
249
|
-
u && /* @__PURE__ */ e("p", { id: `${y}-error`, className: "cedros-input-error", children: u }),
|
|
250
|
-
k && n && b?.length > 0 && /* @__PURE__ */ f("div", { className: "cedros-password-strength", children: [
|
|
251
|
-
/* @__PURE__ */ e("div", { className: "cedros-strength-bar", children: /* @__PURE__ */ e(
|
|
252
|
-
"div",
|
|
253
|
-
{
|
|
254
|
-
className: "cedros-strength-fill",
|
|
255
|
-
style: {
|
|
256
|
-
width: `${n.strength === "weak" ? 25 : n.strength === "fair" ? 50 : n.strength === "good" ? 75 : 100}%`,
|
|
257
|
-
backgroundColor: N[n.strength]
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
) }),
|
|
261
|
-
/* @__PURE__ */ e("span", { className: "cedros-strength-label", children: n.strength })
|
|
262
|
-
] })
|
|
263
|
-
] });
|
|
264
|
-
}
|
|
265
|
-
function de() {
|
|
266
|
-
const { config: c, _internal: m } = x(), [k, p] = w("idle"), [u, a] = w(!1), [v, b] = w(null), {
|
|
267
|
-
checkLimit: d,
|
|
268
|
-
getRemainingAttempts: l,
|
|
269
|
-
getTimeUntilReset: g,
|
|
270
|
-
reset: n
|
|
271
|
-
} = Z({ maxAttempts: 5, windowMs: 12e4 }), h = z(
|
|
272
|
-
() => new K({
|
|
273
|
-
baseUrl: c.serverUrl,
|
|
274
|
-
timeoutMs: c.requestTimeout,
|
|
275
|
-
retryAttempts: c.retryAttempts
|
|
276
|
-
}),
|
|
277
|
-
[c.serverUrl, c.requestTimeout, c.retryAttempts]
|
|
278
|
-
), y = E(
|
|
279
|
-
async (i, t) => {
|
|
280
|
-
const s = /^[A-Z0-9]{16}$/i.test(t) || /^[A-Z0-9]{4}(-[A-Z0-9]{4}){3}$/i.test(t);
|
|
281
|
-
if (!(/^\d{6}$/.test(t) || s)) {
|
|
282
|
-
const r = {
|
|
283
|
-
code: "VALIDATION_ERROR",
|
|
284
|
-
message: "Please enter a valid 6-digit code or recovery code"
|
|
285
|
-
};
|
|
286
|
-
throw b(r), r;
|
|
287
|
-
}
|
|
288
|
-
try {
|
|
289
|
-
d();
|
|
290
|
-
} catch (r) {
|
|
291
|
-
const A = {
|
|
292
|
-
code: "RATE_LIMITED",
|
|
293
|
-
message: r instanceof Error ? r.message : "Too many attempts"
|
|
294
|
-
};
|
|
295
|
-
throw b(A), A;
|
|
296
|
-
}
|
|
297
|
-
a(!0), b(null), p("verifying");
|
|
298
|
-
try {
|
|
299
|
-
const r = await h.post("/login/mfa", { mfaToken: i, code: t });
|
|
300
|
-
return p("success"), n(), m && r.user && r.tokens && m.handleLoginSuccess(r.user, r.tokens), r;
|
|
301
|
-
} catch (r) {
|
|
302
|
-
const A = q(r, "Incorrect verification code. Please check and try again.");
|
|
303
|
-
throw b(A), p("error"), A;
|
|
304
|
-
} finally {
|
|
305
|
-
a(!1);
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
[h, m, d, n]
|
|
309
|
-
), C = E(() => b(null), []), N = E(() => {
|
|
310
|
-
b(null), p("idle"), a(!1);
|
|
311
|
-
}, []);
|
|
312
|
-
return {
|
|
313
|
-
state: k,
|
|
314
|
-
isLoading: u,
|
|
315
|
-
error: v,
|
|
316
|
-
verifyTotp: y,
|
|
317
|
-
clearError: C,
|
|
318
|
-
reset: N,
|
|
319
|
-
// Point-in-time snapshots for UI display
|
|
320
|
-
remainingAttempts: l(),
|
|
321
|
-
timeUntilReset: g()
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
const R = 6;
|
|
325
|
-
function ue({
|
|
326
|
-
value: c = "",
|
|
327
|
-
onChange: m,
|
|
328
|
-
onComplete: k,
|
|
329
|
-
disabled: p = !1,
|
|
330
|
-
error: u,
|
|
331
|
-
autoFocus: a = !1,
|
|
332
|
-
className: v = ""
|
|
333
|
-
}) {
|
|
334
|
-
const b = W([]), [d, l] = w(c.padEnd(R, "")), g = j();
|
|
335
|
-
U(() => {
|
|
336
|
-
l(c.padEnd(R, ""));
|
|
337
|
-
}, [c]);
|
|
338
|
-
const n = E((t) => {
|
|
339
|
-
t >= 0 && t < R && b.current[t]?.focus();
|
|
340
|
-
}, []), h = E(
|
|
341
|
-
(t) => {
|
|
342
|
-
const s = t.replace(/\D/g, "").slice(0, R);
|
|
343
|
-
l(s.padEnd(R, "")), m?.(s), s.length === R && k?.(s);
|
|
344
|
-
},
|
|
345
|
-
[m, k]
|
|
346
|
-
), y = E(
|
|
347
|
-
(t, s) => {
|
|
348
|
-
if (!/^\d?$/.test(s)) return;
|
|
349
|
-
const o = d.split("");
|
|
350
|
-
o[t] = s;
|
|
351
|
-
const r = o.join("").replace(/ /g, "");
|
|
352
|
-
h(r), s && t < R - 1 && n(t + 1);
|
|
353
|
-
},
|
|
354
|
-
[d, h, n]
|
|
355
|
-
), C = E(
|
|
356
|
-
(t, s) => {
|
|
357
|
-
if (s.key === "Backspace") {
|
|
358
|
-
s.preventDefault();
|
|
359
|
-
const o = d.split("");
|
|
360
|
-
o[t] && o[t] !== " " ? (o[t] = " ", h(o.join("").replace(/ /g, ""))) : t > 0 && (o[t - 1] = " ", h(o.join("").replace(/ /g, "")), n(t - 1));
|
|
361
|
-
} else s.key === "ArrowLeft" && t > 0 ? (s.preventDefault(), n(t - 1)) : s.key === "ArrowRight" && t < R - 1 && (s.preventDefault(), n(t + 1));
|
|
362
|
-
},
|
|
363
|
-
[d, h, n]
|
|
364
|
-
), N = E(
|
|
365
|
-
(t) => {
|
|
366
|
-
t.preventDefault();
|
|
367
|
-
const o = t.clipboardData.getData("text").replace(/\D/g, "").slice(0, R);
|
|
368
|
-
o && (h(o), n(Math.min(o.length, R - 1)));
|
|
369
|
-
},
|
|
370
|
-
[h, n]
|
|
371
|
-
), i = E((t) => {
|
|
372
|
-
t.target.select();
|
|
373
|
-
}, []);
|
|
374
|
-
return U(() => {
|
|
375
|
-
a && !p && b.current[0]?.focus();
|
|
376
|
-
}, [a, p]), /* @__PURE__ */ f("div", { className: `cedros-otp-input ${v}`, children: [
|
|
377
|
-
/* @__PURE__ */ e("div", { className: "cedros-otp-slots", role: "group", "aria-label": "One-time password", children: Array.from({ length: R }).map((t, s) => /* @__PURE__ */ e(
|
|
378
|
-
"input",
|
|
379
|
-
{
|
|
380
|
-
ref: (o) => {
|
|
381
|
-
b.current[s] = o;
|
|
382
|
-
},
|
|
383
|
-
id: `${g}-${s}`,
|
|
384
|
-
type: "text",
|
|
385
|
-
inputMode: "numeric",
|
|
386
|
-
pattern: "[0-9]*",
|
|
387
|
-
maxLength: 1,
|
|
388
|
-
className: `cedros-otp-slot ${u ? "cedros-otp-slot-error" : ""}`,
|
|
389
|
-
value: d[s] === " " ? "" : d[s] || "",
|
|
390
|
-
onChange: (o) => y(s, o.target.value),
|
|
391
|
-
onKeyDown: (o) => C(s, o),
|
|
392
|
-
onPaste: N,
|
|
393
|
-
onFocus: i,
|
|
394
|
-
disabled: p,
|
|
395
|
-
autoComplete: "one-time-code",
|
|
396
|
-
"aria-label": `Digit ${s + 1}`,
|
|
397
|
-
"aria-invalid": u ? "true" : void 0
|
|
398
|
-
},
|
|
399
|
-
s
|
|
400
|
-
)) }),
|
|
401
|
-
u && /* @__PURE__ */ e("p", { className: "cedros-otp-error", role: "alert", children: u })
|
|
402
|
-
] });
|
|
403
|
-
}
|
|
404
|
-
function me({
|
|
405
|
-
mfaToken: c,
|
|
406
|
-
email: m,
|
|
407
|
-
onSuccess: k,
|
|
408
|
-
onBack: p,
|
|
409
|
-
className: u = ""
|
|
410
|
-
}) {
|
|
411
|
-
const { verifyTotp: a, isLoading: v, error: b, clearError: d } = de(), [l, g] = w(""), [n, h] = w(!1), [y, C] = w(""), N = async (s) => {
|
|
412
|
-
const o = s || (n ? y : l);
|
|
413
|
-
if (o)
|
|
414
|
-
try {
|
|
415
|
-
await a(c, o), k?.();
|
|
416
|
-
} catch {
|
|
417
|
-
n ? C("") : g("");
|
|
418
|
-
}
|
|
419
|
-
}, i = (s) => {
|
|
420
|
-
N(s);
|
|
421
|
-
}, t = () => {
|
|
422
|
-
h(!n), d(), g(""), C("");
|
|
423
|
-
};
|
|
424
|
-
return /* @__PURE__ */ f("div", { className: `cedros-totp-verify ${u}`, children: [
|
|
425
|
-
/* @__PURE__ */ f("div", { className: "cedros-totp-verify-header", children: [
|
|
426
|
-
/* @__PURE__ */ f(
|
|
427
|
-
"svg",
|
|
428
|
-
{
|
|
429
|
-
className: "cedros-totp-verify-icon",
|
|
430
|
-
width: "48",
|
|
431
|
-
height: "48",
|
|
432
|
-
viewBox: "0 0 48 48",
|
|
433
|
-
fill: "none",
|
|
434
|
-
"aria-hidden": "true",
|
|
435
|
-
children: [
|
|
436
|
-
/* @__PURE__ */ e("rect", { x: "8", y: "20", width: "32", height: "24", rx: "4", stroke: "currentColor", strokeWidth: "2" }),
|
|
437
|
-
/* @__PURE__ */ e(
|
|
438
|
-
"path",
|
|
439
|
-
{
|
|
440
|
-
d: "M16 20V14a8 8 0 1 1 16 0v6",
|
|
441
|
-
stroke: "currentColor",
|
|
442
|
-
strokeWidth: "2",
|
|
443
|
-
strokeLinecap: "round"
|
|
444
|
-
}
|
|
445
|
-
),
|
|
446
|
-
/* @__PURE__ */ e("circle", { cx: "24", cy: "32", r: "3", fill: "currentColor" })
|
|
447
|
-
]
|
|
448
|
-
}
|
|
449
|
-
),
|
|
450
|
-
/* @__PURE__ */ e("h3", { className: "cedros-totp-title", children: "Two-factor authentication" }),
|
|
451
|
-
/* @__PURE__ */ e("p", { className: "cedros-totp-description", children: n ? "Enter one of your recovery codes to sign in." : "Enter the 6-digit code from your authenticator app." }),
|
|
452
|
-
m && /* @__PURE__ */ e("p", { className: "cedros-totp-email", children: m })
|
|
453
|
-
] }),
|
|
454
|
-
n ? /* @__PURE__ */ f("div", { className: "cedros-totp-backup-input", children: [
|
|
455
|
-
/* @__PURE__ */ e(
|
|
456
|
-
"input",
|
|
457
|
-
{
|
|
458
|
-
type: "text",
|
|
459
|
-
className: `cedros-input ${b ? "cedros-input-error" : ""}`,
|
|
460
|
-
placeholder: "Enter recovery code",
|
|
461
|
-
value: y,
|
|
462
|
-
onChange: (s) => {
|
|
463
|
-
C(s.target.value.toUpperCase()), d();
|
|
464
|
-
},
|
|
465
|
-
onKeyDown: (s) => {
|
|
466
|
-
s.key === "Enter" && y && N();
|
|
467
|
-
},
|
|
468
|
-
disabled: v,
|
|
469
|
-
autoFocus: !0,
|
|
470
|
-
autoComplete: "one-time-code"
|
|
471
|
-
}
|
|
472
|
-
),
|
|
473
|
-
b && /* @__PURE__ */ e("p", { className: "cedros-input-error", role: "alert", children: b.message })
|
|
474
|
-
] }) : /* @__PURE__ */ e(
|
|
475
|
-
ue,
|
|
476
|
-
{
|
|
477
|
-
value: l,
|
|
478
|
-
onChange: (s) => {
|
|
479
|
-
g(s), d();
|
|
480
|
-
},
|
|
481
|
-
onComplete: i,
|
|
482
|
-
disabled: v,
|
|
483
|
-
error: b?.message,
|
|
484
|
-
autoFocus: !0
|
|
485
|
-
}
|
|
486
|
-
),
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
"button",
|
|
489
|
-
{
|
|
490
|
-
type: "button",
|
|
491
|
-
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
492
|
-
onClick: () => N(),
|
|
493
|
-
disabled: v || (n ? !y : l.length !== 6),
|
|
494
|
-
children: v ? /* @__PURE__ */ f(D, { children: [
|
|
495
|
-
/* @__PURE__ */ e($, { size: "sm" }),
|
|
496
|
-
/* @__PURE__ */ e("span", { children: "Verifying..." })
|
|
497
|
-
] }) : "Verify"
|
|
498
|
-
}
|
|
499
|
-
),
|
|
500
|
-
/* @__PURE__ */ f("div", { className: "cedros-totp-verify-footer", children: [
|
|
501
|
-
/* @__PURE__ */ e(
|
|
502
|
-
"button",
|
|
503
|
-
{
|
|
504
|
-
type: "button",
|
|
505
|
-
className: "cedros-link cedros-link-sm",
|
|
506
|
-
onClick: t,
|
|
507
|
-
disabled: v,
|
|
508
|
-
children: n ? "Use authenticator app" : "Use a recovery code"
|
|
509
|
-
}
|
|
510
|
-
),
|
|
511
|
-
p && /* @__PURE__ */ f(D, { children: [
|
|
512
|
-
/* @__PURE__ */ e("span", { className: "cedros-totp-verify-divider", children: "•" }),
|
|
513
|
-
/* @__PURE__ */ e(
|
|
514
|
-
"button",
|
|
515
|
-
{
|
|
516
|
-
type: "button",
|
|
517
|
-
className: "cedros-link cedros-link-sm",
|
|
518
|
-
onClick: p,
|
|
519
|
-
disabled: v,
|
|
520
|
-
children: "Back to login"
|
|
521
|
-
}
|
|
522
|
-
)
|
|
523
|
-
] })
|
|
524
|
-
] })
|
|
525
|
-
] });
|
|
526
|
-
}
|
|
527
|
-
function ke({
|
|
528
|
-
onSuccess: c,
|
|
529
|
-
onSwitchToRegister: m,
|
|
530
|
-
onForgotPassword: k,
|
|
531
|
-
className: p = ""
|
|
532
|
-
}) {
|
|
533
|
-
const { login: u, isLoading: a, error: v, clearError: b } = Y(), [d, l] = w(""), [g, n] = w(""), [h, y] = w(null), [C, N] = w(""), i = async (o) => {
|
|
534
|
-
o.preventDefault();
|
|
535
|
-
try {
|
|
536
|
-
const r = await u(d, g);
|
|
537
|
-
r.mfaRequired ? (y(r.mfaToken), N(r.email)) : c?.();
|
|
538
|
-
} catch {
|
|
539
|
-
}
|
|
540
|
-
}, t = () => {
|
|
541
|
-
y(null), N(""), c?.();
|
|
542
|
-
}, s = () => {
|
|
543
|
-
y(null), N(""), n("");
|
|
544
|
-
};
|
|
545
|
-
return h ? /* @__PURE__ */ e(
|
|
546
|
-
me,
|
|
547
|
-
{
|
|
548
|
-
mfaToken: h,
|
|
549
|
-
email: C,
|
|
550
|
-
onSuccess: t,
|
|
551
|
-
onBack: s,
|
|
552
|
-
className: p
|
|
553
|
-
}
|
|
554
|
-
) : /* @__PURE__ */ f("form", { onSubmit: i, className: `cedros-form ${p}`, children: [
|
|
555
|
-
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
556
|
-
/* @__PURE__ */ e("label", { htmlFor: "email", className: "cedros-label", children: "Email" }),
|
|
557
|
-
/* @__PURE__ */ e(
|
|
558
|
-
"input",
|
|
559
|
-
{
|
|
560
|
-
id: "email",
|
|
561
|
-
type: "email",
|
|
562
|
-
className: "cedros-input",
|
|
563
|
-
value: d,
|
|
564
|
-
onChange: (o) => l(o.target.value),
|
|
565
|
-
placeholder: "you@example.com",
|
|
566
|
-
required: !0,
|
|
567
|
-
"aria-required": "true",
|
|
568
|
-
autoComplete: "email",
|
|
569
|
-
disabled: a
|
|
570
|
-
}
|
|
571
|
-
)
|
|
572
|
-
] }),
|
|
573
|
-
/* @__PURE__ */ e("div", { className: "cedros-form-field", children: /* @__PURE__ */ e(
|
|
574
|
-
O,
|
|
575
|
-
{
|
|
576
|
-
value: g,
|
|
577
|
-
onChange: (o) => n(o.target.value),
|
|
578
|
-
placeholder: "Enter your password",
|
|
579
|
-
required: !0,
|
|
580
|
-
autoComplete: "current-password",
|
|
581
|
-
disabled: a,
|
|
582
|
-
labelAction: k ? /* @__PURE__ */ e(
|
|
583
|
-
"button",
|
|
584
|
-
{
|
|
585
|
-
type: "button",
|
|
586
|
-
className: "cedros-link cedros-link-muted cedros-link-sm",
|
|
587
|
-
onClick: k,
|
|
588
|
-
children: "Forgot your password?"
|
|
589
|
-
}
|
|
590
|
-
) : void 0
|
|
591
|
-
}
|
|
592
|
-
) }),
|
|
593
|
-
/* @__PURE__ */ e(H, { error: v, onDismiss: b }),
|
|
594
|
-
/* @__PURE__ */ e(
|
|
595
|
-
"button",
|
|
596
|
-
{
|
|
597
|
-
type: "submit",
|
|
598
|
-
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
599
|
-
disabled: a || !d || !g,
|
|
600
|
-
"aria-busy": a,
|
|
601
|
-
children: a ? /* @__PURE__ */ f(D, { children: [
|
|
602
|
-
/* @__PURE__ */ e($, { size: "sm", announce: !0, label: "Signing in" }),
|
|
603
|
-
/* @__PURE__ */ e("span", { children: "Signing in..." })
|
|
604
|
-
] }) : "Sign in"
|
|
605
|
-
}
|
|
606
|
-
),
|
|
607
|
-
m && /* @__PURE__ */ f("p", { className: "cedros-form-footer", children: [
|
|
608
|
-
"Don't have an account?",
|
|
609
|
-
" ",
|
|
610
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cedros-link cedros-link-muted", onClick: m, children: "Sign up" })
|
|
611
|
-
] })
|
|
612
|
-
] });
|
|
613
|
-
}
|
|
614
|
-
function Ce({
|
|
615
|
-
onSuccess: c,
|
|
616
|
-
onSwitchToLogin: m,
|
|
617
|
-
className: k = ""
|
|
618
|
-
}) {
|
|
619
|
-
const { config: p } = x(), { register: u, isLoading: a, error: v, clearError: b } = Y(), [d, l] = w(""), [g, n] = w(""), [h, y] = w(""), [C, N] = w(""), [i, t] = w(null), [s, o] = w(null), r = p.forms?.termsOfService, A = p.forms?.emailOptIn, S = r?.show ?? !1, I = r?.required ?? !0, L = r?.defaultChecked ?? !1, V = r?.label ?? "I agree to the Terms of Service", G = r?.url, _ = le(G), J = A?.show ?? !1, Q = A?.defaultChecked ?? !1, X = A?.label ?? "Send me updates and news", [M, ee] = w(L), [te, re] = w(Q), P = h === C, se = i?.isValid ?? !1, B = g && h && C && P && se && (!S || !I || M) && !a, oe = async (T) => {
|
|
620
|
-
if (T.preventDefault(), o(null), S && I && !M) {
|
|
621
|
-
o({
|
|
622
|
-
code: "VALIDATION_ERROR",
|
|
623
|
-
message: "You must agree to the Terms of Service to continue"
|
|
624
|
-
});
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
if (B)
|
|
628
|
-
try {
|
|
629
|
-
await u(g, h, d || void 0), c?.();
|
|
630
|
-
} catch {
|
|
631
|
-
}
|
|
632
|
-
}, ae = v || s, ne = () => {
|
|
633
|
-
b(), o(null);
|
|
634
|
-
};
|
|
635
|
-
return /* @__PURE__ */ f("form", { onSubmit: oe, className: `cedros-form ${k}`, children: [
|
|
636
|
-
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
637
|
-
/* @__PURE__ */ f("label", { htmlFor: "name", className: "cedros-label", children: [
|
|
638
|
-
"Name ",
|
|
639
|
-
/* @__PURE__ */ e("span", { className: "cedros-optional", children: "(optional)" })
|
|
640
|
-
] }),
|
|
641
|
-
/* @__PURE__ */ e(
|
|
642
|
-
"input",
|
|
643
|
-
{
|
|
644
|
-
id: "name",
|
|
645
|
-
type: "text",
|
|
646
|
-
className: "cedros-input",
|
|
647
|
-
value: d,
|
|
648
|
-
onChange: (T) => l(T.target.value),
|
|
649
|
-
placeholder: "Your name",
|
|
650
|
-
autoComplete: "name",
|
|
651
|
-
disabled: a
|
|
652
|
-
}
|
|
653
|
-
)
|
|
654
|
-
] }),
|
|
655
|
-
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
656
|
-
/* @__PURE__ */ e("label", { htmlFor: "register-email", className: "cedros-label", children: "Email" }),
|
|
657
|
-
/* @__PURE__ */ e(
|
|
658
|
-
"input",
|
|
659
|
-
{
|
|
660
|
-
id: "register-email",
|
|
661
|
-
type: "email",
|
|
662
|
-
className: "cedros-input",
|
|
663
|
-
value: g,
|
|
664
|
-
onChange: (T) => n(T.target.value),
|
|
665
|
-
placeholder: "you@example.com",
|
|
666
|
-
required: !0,
|
|
667
|
-
"aria-required": "true",
|
|
668
|
-
autoComplete: "email",
|
|
669
|
-
disabled: a
|
|
670
|
-
}
|
|
671
|
-
)
|
|
672
|
-
] }),
|
|
673
|
-
/* @__PURE__ */ e("div", { className: "cedros-form-field", children: /* @__PURE__ */ e(
|
|
674
|
-
O,
|
|
675
|
-
{
|
|
676
|
-
value: h,
|
|
677
|
-
onChange: (T) => y(T.target.value),
|
|
678
|
-
placeholder: "Create a password",
|
|
679
|
-
required: !0,
|
|
680
|
-
autoComplete: "new-password",
|
|
681
|
-
disabled: a,
|
|
682
|
-
showStrengthMeter: !0,
|
|
683
|
-
onValidationChange: t
|
|
684
|
-
}
|
|
685
|
-
) }),
|
|
686
|
-
/* @__PURE__ */ e("div", { className: "cedros-form-field", children: /* @__PURE__ */ e(
|
|
687
|
-
O,
|
|
688
|
-
{
|
|
689
|
-
label: "Confirm Password",
|
|
690
|
-
value: C,
|
|
691
|
-
onChange: (T) => N(T.target.value),
|
|
692
|
-
placeholder: "Confirm your password",
|
|
693
|
-
required: !0,
|
|
694
|
-
autoComplete: "new-password",
|
|
695
|
-
disabled: a,
|
|
696
|
-
"aria-invalid": C && !P ? "true" : void 0,
|
|
697
|
-
error: C && !P ? "Passwords do not match" : void 0
|
|
698
|
-
}
|
|
699
|
-
) }),
|
|
700
|
-
S && /* @__PURE__ */ e("div", { className: "cedros-form-field cedros-checkbox-field", children: /* @__PURE__ */ f("label", { className: "cedros-checkbox-label", children: [
|
|
701
|
-
/* @__PURE__ */ e(
|
|
702
|
-
"input",
|
|
703
|
-
{
|
|
704
|
-
type: "checkbox",
|
|
705
|
-
className: "cedros-checkbox",
|
|
706
|
-
checked: M,
|
|
707
|
-
onChange: (T) => ee(T.target.checked),
|
|
708
|
-
disabled: a,
|
|
709
|
-
"aria-required": I
|
|
710
|
-
}
|
|
711
|
-
),
|
|
712
|
-
/* @__PURE__ */ f("span", { className: "cedros-checkbox-text", children: [
|
|
713
|
-
_ ? /* @__PURE__ */ f(D, { children: [
|
|
714
|
-
V.replace("Terms of Service", "").trim() || "I agree to the",
|
|
715
|
-
" ",
|
|
716
|
-
/* @__PURE__ */ e(
|
|
717
|
-
"a",
|
|
718
|
-
{
|
|
719
|
-
href: _,
|
|
720
|
-
target: "_blank",
|
|
721
|
-
rel: "noopener noreferrer",
|
|
722
|
-
className: "cedros-link",
|
|
723
|
-
children: "Terms of Service"
|
|
724
|
-
}
|
|
725
|
-
)
|
|
726
|
-
] }) : V,
|
|
727
|
-
I && /* @__PURE__ */ e("span", { className: "cedros-required", children: "*" })
|
|
728
|
-
] })
|
|
729
|
-
] }) }),
|
|
730
|
-
J && /* @__PURE__ */ e("div", { className: "cedros-form-field cedros-checkbox-field", children: /* @__PURE__ */ f("label", { className: "cedros-checkbox-label", children: [
|
|
731
|
-
/* @__PURE__ */ e(
|
|
732
|
-
"input",
|
|
733
|
-
{
|
|
734
|
-
type: "checkbox",
|
|
735
|
-
className: "cedros-checkbox",
|
|
736
|
-
checked: te,
|
|
737
|
-
onChange: (T) => re(T.target.checked),
|
|
738
|
-
disabled: a
|
|
739
|
-
}
|
|
740
|
-
),
|
|
741
|
-
/* @__PURE__ */ e("span", { className: "cedros-checkbox-text", children: X })
|
|
742
|
-
] }) }),
|
|
743
|
-
/* @__PURE__ */ e(H, { error: ae, onDismiss: ne }),
|
|
744
|
-
/* @__PURE__ */ e(
|
|
745
|
-
"button",
|
|
746
|
-
{
|
|
747
|
-
type: "submit",
|
|
748
|
-
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
749
|
-
disabled: !B,
|
|
750
|
-
"aria-busy": a,
|
|
751
|
-
children: a ? /* @__PURE__ */ f(D, { children: [
|
|
752
|
-
/* @__PURE__ */ e($, { size: "sm", announce: !0, label: "Creating account" }),
|
|
753
|
-
/* @__PURE__ */ e("span", { children: "Creating account..." })
|
|
754
|
-
] }) : "Create account"
|
|
755
|
-
}
|
|
756
|
-
),
|
|
757
|
-
m && /* @__PURE__ */ f("p", { className: "cedros-form-footer", children: [
|
|
758
|
-
"Already have an account?",
|
|
759
|
-
" ",
|
|
760
|
-
/* @__PURE__ */ e("button", { type: "button", className: "cedros-link cedros-link-muted", onClick: m, children: "Sign in" })
|
|
761
|
-
] })
|
|
762
|
-
] });
|
|
763
|
-
}
|
|
764
|
-
export {
|
|
765
|
-
ke as E,
|
|
766
|
-
ue as O,
|
|
767
|
-
O as P,
|
|
768
|
-
me as T,
|
|
769
|
-
Ce as a,
|
|
770
|
-
Z as b,
|
|
771
|
-
de as c,
|
|
772
|
-
Y as u
|
|
773
|
-
};
|