@tempots/beatui 0.50.0 → 0.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auth/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { localStorageProp as
|
|
2
|
-
import { t as
|
|
3
|
-
import { s as
|
|
4
|
-
import { AuthI18n as
|
|
5
|
-
import { B as
|
|
6
|
-
import { classes as
|
|
7
|
-
const
|
|
1
|
+
import { localStorageProp as ce, prop as V, Use as q, html as i, OnDispose as C, attr as t, on as E, When as b, coalesce as h, Ensure as W, computedOf as g, Fragment as z, bind as le, ForEach as me, Value as oe, OneOfValue as ue } from "@tempots/dom";
|
|
2
|
+
import { t as de, a as te, u as G, S as $, b as ae, c as T, P as N, E as H, N as j } from "../notice-Dgv1Puqy.js";
|
|
3
|
+
import { s as A, o as X, b as R, M as pe } from "../modal-Dx7nHv_u.js";
|
|
4
|
+
import { AuthI18n as B } from "../translations-BaKCl3Vc.js";
|
|
5
|
+
import { B as F, T as he, I as ge } from "../translations-DoBmuZ5v.js";
|
|
6
|
+
import { classes as fe } from "@tempots/ui";
|
|
7
|
+
const Y = {
|
|
8
8
|
google: { name: "Google", icon: "logos:google-icon", color: "#4285f4" },
|
|
9
9
|
github: { name: "GitHub", icon: "logos:github-icon", color: "#333" },
|
|
10
10
|
apple: { name: "Apple", icon: "logos:apple", color: "#000" },
|
|
@@ -50,37 +50,37 @@ const j = {
|
|
|
50
50
|
paypal: { name: "PayPal", icon: "logos:paypal", color: "#0070ba" },
|
|
51
51
|
x: { name: "X", icon: "simple-icons:x", color: "#000" }
|
|
52
52
|
};
|
|
53
|
-
function
|
|
54
|
-
return
|
|
53
|
+
function be(e) {
|
|
54
|
+
return Y[e]?.name || e;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
56
|
+
function Te(e) {
|
|
57
|
+
return Y[e]?.icon || "mdi:account";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function Ae(e) {
|
|
60
|
+
return Y[e]?.color || "#666";
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
return o.replace("{provider}",
|
|
62
|
+
function Ce(e, o = "Continue with {provider}") {
|
|
63
|
+
return o.replace("{provider}", be(e));
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const I = {
|
|
66
66
|
minLength: 8,
|
|
67
67
|
requireUppercase: !0,
|
|
68
68
|
requireLowercase: !0,
|
|
69
69
|
requireNumbers: !0,
|
|
70
70
|
requireSymbols: !1
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function ze(e) {
|
|
73
73
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function we(e = 32) {
|
|
76
76
|
const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
77
77
|
let c = "";
|
|
78
78
|
for (let m = 0; m < e; m++)
|
|
79
79
|
c += o.charAt(Math.floor(Math.random() * o.length));
|
|
80
80
|
return c;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
82
|
+
function Ee(e, o, c, m = [], l = {}) {
|
|
83
|
+
const n = {
|
|
84
84
|
google: "https://accounts.google.com/oauth/authorize",
|
|
85
85
|
github: "https://github.com/login/oauth/authorize",
|
|
86
86
|
apple: "https://appleid.apple.com/auth/authorize",
|
|
@@ -105,7 +105,7 @@ function Ce(e, o, c, m = [], l = {}) {
|
|
|
105
105
|
yahoo: "https://api.login.yahoo.com/oauth2/request_auth",
|
|
106
106
|
paypal: "https://www.paypal.com/signin/authorize",
|
|
107
107
|
x: "https://api.twitter.com/oauth2/authorize"
|
|
108
|
-
},
|
|
108
|
+
}, u = {
|
|
109
109
|
google: ["openid", "email", "profile"],
|
|
110
110
|
github: ["user:email"],
|
|
111
111
|
apple: ["email", "name"],
|
|
@@ -130,20 +130,20 @@ function Ce(e, o, c, m = [], l = {}) {
|
|
|
130
130
|
yahoo: ["openid", "email", "profile"],
|
|
131
131
|
paypal: ["openid", "email", "profile"],
|
|
132
132
|
x: ["openid", "email", "profile"]
|
|
133
|
-
},
|
|
134
|
-
if (!
|
|
133
|
+
}, s = n[e];
|
|
134
|
+
if (!s)
|
|
135
135
|
throw new Error(`Unsupported provider: ${e}`);
|
|
136
|
-
const
|
|
136
|
+
const a = m.length > 0 ? m : u[e], r = we(), f = new URLSearchParams({
|
|
137
137
|
client_id: o,
|
|
138
138
|
redirect_uri: c,
|
|
139
|
-
scope:
|
|
139
|
+
scope: a.join(" "),
|
|
140
140
|
state: r,
|
|
141
141
|
response_type: "code",
|
|
142
142
|
...l
|
|
143
143
|
});
|
|
144
|
-
return `${
|
|
144
|
+
return `${s}?${f.toString()}`;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ue(e, o, c, m) {
|
|
147
147
|
const l = window.open(
|
|
148
148
|
e,
|
|
149
149
|
`${o}_login`,
|
|
@@ -153,20 +153,20 @@ function ze(e, o, c, m) {
|
|
|
153
153
|
m?.(new Error("Failed to open popup window"));
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
l.closed && (clearInterval(
|
|
158
|
-
}, 1e3),
|
|
159
|
-
|
|
156
|
+
const n = setInterval(() => {
|
|
157
|
+
l.closed && (clearInterval(n), m?.(new Error("Login cancelled")));
|
|
158
|
+
}, 1e3), u = (s) => {
|
|
159
|
+
s.origin === window.location.origin && (s.data.type === "SOCIAL_LOGIN_SUCCESS" ? (clearInterval(n), l.close(), window.removeEventListener("message", u), c?.(s.data.result)) : s.data.type === "SOCIAL_LOGIN_ERROR" && (clearInterval(n), l.close(), window.removeEventListener("message", u), m?.(new Error(s.data.error))));
|
|
160
160
|
};
|
|
161
|
-
window.addEventListener("message",
|
|
161
|
+
window.addEventListener("message", u);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Oe(e) {
|
|
164
164
|
return e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e ? String(e.message) : "An unexpected error occurred";
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Ve() {
|
|
167
167
|
return typeof window < "u" && typeof document < "u";
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Z({
|
|
170
170
|
task: e,
|
|
171
171
|
message: o,
|
|
172
172
|
onStart: c,
|
|
@@ -174,17 +174,17 @@ function X({
|
|
|
174
174
|
}) {
|
|
175
175
|
return async (l) => {
|
|
176
176
|
c?.();
|
|
177
|
-
const
|
|
177
|
+
const n = await de({
|
|
178
178
|
task: e != null ? () => e(l) : async () => null,
|
|
179
179
|
errorMessage: o,
|
|
180
180
|
errorPath: ["root"],
|
|
181
|
-
validation: (
|
|
181
|
+
validation: (u) => u != null ? te.invalid({ message: u }) : te.valid
|
|
182
182
|
});
|
|
183
|
-
return m?.(),
|
|
183
|
+
return m?.(), n;
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
let o =
|
|
186
|
+
function J(e = I) {
|
|
187
|
+
let o = A();
|
|
188
188
|
return e.minLength && (o = o.min(
|
|
189
189
|
e.minLength,
|
|
190
190
|
`Password must be at least ${e.minLength} characters`
|
|
@@ -202,53 +202,53 @@ function Y(e = B) {
|
|
|
202
202
|
"Password must contain at least one special character"
|
|
203
203
|
)), e.customValidation && (o = o.refine((c) => e.customValidation(c))), o;
|
|
204
204
|
}
|
|
205
|
-
const
|
|
206
|
-
function
|
|
207
|
-
const o = e ?
|
|
205
|
+
const M = A().min(1, "Email is required").email("Please enter a valid email address");
|
|
206
|
+
function K(e) {
|
|
207
|
+
const o = e ? J(e) : A().refine(
|
|
208
208
|
(c) => c.length > 0 ? null : "Password is required"
|
|
209
209
|
);
|
|
210
|
-
return
|
|
211
|
-
email:
|
|
210
|
+
return X({
|
|
211
|
+
email: M,
|
|
212
212
|
password: o,
|
|
213
|
-
rememberMe:
|
|
213
|
+
rememberMe: R().default(!1)
|
|
214
214
|
}).schema();
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const c =
|
|
218
|
-
name: m ?
|
|
219
|
-
email:
|
|
216
|
+
function Q(e = I, o) {
|
|
217
|
+
const c = J(e), m = o?.showNameField !== !1, l = o?.showConfirmPassword !== !1, n = o?.showAcceptTermsAndConditions !== !1, u = {
|
|
218
|
+
name: m ? A().min(1, "Name is required").optional() : A().optional(),
|
|
219
|
+
email: M,
|
|
220
220
|
password: c,
|
|
221
221
|
// Always require confirmPassword as string to match SignUpData interface
|
|
222
222
|
// When not shown, it should accept any value (including empty string)
|
|
223
|
-
confirmPassword: l ?
|
|
223
|
+
confirmPassword: l ? A().min(1, "Please confirm your password") : A(),
|
|
224
224
|
// Accept any string value when not shown
|
|
225
|
-
acceptTerms:
|
|
226
|
-
(
|
|
225
|
+
acceptTerms: n ? R().refine(
|
|
226
|
+
(a) => a === !0,
|
|
227
227
|
"You must accept the terms and conditions"
|
|
228
|
-
) :
|
|
228
|
+
) : R().default(!0)
|
|
229
229
|
// Default to true when not shown
|
|
230
|
-
},
|
|
231
|
-
return l ?
|
|
232
|
-
(
|
|
230
|
+
}, s = X(u);
|
|
231
|
+
return l ? s.refine(
|
|
232
|
+
(a) => a.password === a.confirmPassword ? null : "Passwords don't match",
|
|
233
233
|
{ path: ["confirmPassword"] }
|
|
234
|
-
).schema() :
|
|
234
|
+
).schema() : s.schema();
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
email:
|
|
238
|
-
}).schema(),
|
|
239
|
-
signIn:
|
|
240
|
-
signUp:
|
|
241
|
-
resetPassword: () =>
|
|
236
|
+
const re = X({
|
|
237
|
+
email: M
|
|
238
|
+
}).schema(), Fe = K(), Me = Q(), De = {
|
|
239
|
+
signIn: K,
|
|
240
|
+
signUp: Q,
|
|
241
|
+
resetPassword: () => re
|
|
242
242
|
};
|
|
243
|
-
function
|
|
244
|
-
const o =
|
|
243
|
+
function Ne(e) {
|
|
244
|
+
const o = M.validate(e);
|
|
245
245
|
return o.success ? null : o.errors[0]?.message || "Invalid email";
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const m =
|
|
247
|
+
function Re(e, o = I) {
|
|
248
|
+
const m = J(o).validate(e);
|
|
249
249
|
return m.success ? null : m.errors[0]?.message || "Invalid password";
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function ee(e, o = I) {
|
|
252
252
|
const c = {
|
|
253
253
|
length: e.length >= (o.minLength || 8),
|
|
254
254
|
uppercase: /[A-Z]/.test(e),
|
|
@@ -272,84 +272,84 @@ function K(e, o = B) {
|
|
|
272
272
|
o.requireNumbers ? c.numbers : null,
|
|
273
273
|
o.requireSymbols ? c.symbols : null,
|
|
274
274
|
o.customValidation ? c.custom : null
|
|
275
|
-
].filter((
|
|
276
|
-
let
|
|
277
|
-
return
|
|
275
|
+
].filter((s) => s === !0).length, n = m > 0 ? Math.round(l / m * 100) : 0;
|
|
276
|
+
let u;
|
|
277
|
+
return n < 40 ? u = "weak" : n < 60 ? u = "fair" : n < 80 ? u = "good" : u = "strong", { strength: u, score: n, checks: c };
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const ie = () => ce({
|
|
280
280
|
key: "bui_auth_email",
|
|
281
281
|
defaultValue: null
|
|
282
282
|
});
|
|
283
|
-
function
|
|
283
|
+
function _e({
|
|
284
284
|
onSignIn: e,
|
|
285
285
|
passwordRules: o,
|
|
286
286
|
labels: c,
|
|
287
287
|
showRememberMe: m
|
|
288
288
|
}) {
|
|
289
|
-
const l =
|
|
290
|
-
schema:
|
|
291
|
-
onSubmit:
|
|
289
|
+
const l = V(!1), n = ie(), u = K(o), s = G({
|
|
290
|
+
schema: u,
|
|
291
|
+
onSubmit: Z({
|
|
292
292
|
task: e,
|
|
293
293
|
message: "Reset password failed",
|
|
294
294
|
onStart: () => {
|
|
295
|
-
l.set(!0),
|
|
295
|
+
l.set(!0), s.controller.disable();
|
|
296
296
|
},
|
|
297
297
|
onEnd: () => {
|
|
298
|
-
l.set(!1),
|
|
298
|
+
l.set(!1), s.controller.enable();
|
|
299
299
|
}
|
|
300
300
|
}),
|
|
301
301
|
initialValue: {
|
|
302
302
|
email: "",
|
|
303
303
|
password: ""
|
|
304
304
|
}
|
|
305
|
-
}), { controller:
|
|
306
|
-
l.on(
|
|
307
|
-
const
|
|
308
|
-
return
|
|
309
|
-
|
|
310
|
-
}),
|
|
311
|
-
|
|
312
|
-
}),
|
|
313
|
-
|
|
314
|
-
(
|
|
305
|
+
}), { controller: a, submit: r } = s;
|
|
306
|
+
l.on(a.setDisabled);
|
|
307
|
+
const f = a.field("email"), w = a.field("password");
|
|
308
|
+
return n.on((_) => {
|
|
309
|
+
_ != null && f.change(_);
|
|
310
|
+
}), f.signal.on((_) => {
|
|
311
|
+
n.value != null && (n.value = _);
|
|
312
|
+
}), q(
|
|
313
|
+
B,
|
|
314
|
+
(_) => (
|
|
315
315
|
// Email/Password form
|
|
316
316
|
i.form(
|
|
317
|
-
|
|
317
|
+
C(a.dispose, n.dispose, l.dispose),
|
|
318
318
|
t.class("bc-auth-form__form"),
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
E.submit(r),
|
|
320
|
+
$(
|
|
321
321
|
t.class("bc-auth-form__fields"),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
(
|
|
322
|
+
W(
|
|
323
|
+
a.error,
|
|
324
|
+
(k) => j(
|
|
325
325
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
326
|
-
i.div(
|
|
326
|
+
i.div(k)
|
|
327
327
|
)
|
|
328
328
|
),
|
|
329
329
|
// Email field
|
|
330
|
-
|
|
331
|
-
controller:
|
|
332
|
-
label: h(c?.emailLabel,
|
|
330
|
+
T(H, {
|
|
331
|
+
controller: f,
|
|
332
|
+
label: h(c?.emailLabel, _.$.emailLabel)
|
|
333
333
|
}),
|
|
334
334
|
// Password field
|
|
335
|
-
|
|
336
|
-
controller:
|
|
337
|
-
label: h(c?.passwordLabel,
|
|
335
|
+
T(N, {
|
|
336
|
+
controller: w,
|
|
337
|
+
label: h(c?.passwordLabel, _.$.passwordLabel)
|
|
338
338
|
}),
|
|
339
339
|
// Remember me checkbox
|
|
340
|
-
|
|
340
|
+
b(
|
|
341
341
|
m ?? !0,
|
|
342
342
|
() => i.div(
|
|
343
343
|
t.class("bc-auth-form__remember-me"),
|
|
344
344
|
i.label(
|
|
345
345
|
t.class("bc-auth-form__checkbox-label"),
|
|
346
|
-
|
|
347
|
-
value:
|
|
346
|
+
ae({
|
|
347
|
+
value: n.map((k) => k != null),
|
|
348
348
|
after: i.span(
|
|
349
|
-
h(c?.rememberMeLabel,
|
|
349
|
+
h(c?.rememberMeLabel, _.$.rememberMeLabel)
|
|
350
350
|
),
|
|
351
|
-
onChange: (
|
|
352
|
-
|
|
351
|
+
onChange: (k) => {
|
|
352
|
+
k ? n.value = f.signal.value ?? "" : n.value = null;
|
|
353
353
|
}
|
|
354
354
|
})
|
|
355
355
|
)
|
|
@@ -357,28 +357,28 @@ function be({
|
|
|
357
357
|
)
|
|
358
358
|
),
|
|
359
359
|
// Submit button
|
|
360
|
-
|
|
360
|
+
F(
|
|
361
361
|
{
|
|
362
362
|
type: "submit",
|
|
363
363
|
variant: "filled",
|
|
364
364
|
color: "primary",
|
|
365
365
|
loading: l,
|
|
366
|
-
disabled:
|
|
366
|
+
disabled: a.disabledOrHasErrors
|
|
367
367
|
},
|
|
368
368
|
t.class("bc-auth-form__submit"),
|
|
369
|
-
h(c?.signInButton,
|
|
369
|
+
h(c?.signInButton, _.$.signInButton)
|
|
370
370
|
)
|
|
371
371
|
)
|
|
372
372
|
)
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function Le({
|
|
376
376
|
password: e,
|
|
377
|
-
rules: o =
|
|
377
|
+
rules: o = I,
|
|
378
378
|
showLabel: c = !0,
|
|
379
379
|
className: m
|
|
380
380
|
}) {
|
|
381
|
-
const l =
|
|
381
|
+
const l = g(e)((r) => !r || r.length === 0 ? {
|
|
382
382
|
strength: "weak",
|
|
383
383
|
score: 0,
|
|
384
384
|
checks: {
|
|
@@ -389,47 +389,47 @@ function we({
|
|
|
389
389
|
symbols: !1,
|
|
390
390
|
custom: !1
|
|
391
391
|
}
|
|
392
|
-
} :
|
|
393
|
-
|
|
392
|
+
} : ee(r, o)), n = l.map((r) => r.strength), u = l.map((r) => r.score), s = l.map((r) => r.checks), a = g(
|
|
393
|
+
n,
|
|
394
394
|
m
|
|
395
|
-
)((r,
|
|
395
|
+
)((r, f) => [
|
|
396
396
|
"bc-password-strength",
|
|
397
397
|
`bc-password-strength--${r}`,
|
|
398
|
-
|
|
398
|
+
f
|
|
399
399
|
].filter(Boolean).join(" "));
|
|
400
400
|
return i.div(
|
|
401
|
-
|
|
402
|
-
t.class(
|
|
401
|
+
C(l, a),
|
|
402
|
+
t.class(a),
|
|
403
403
|
// Strength bar
|
|
404
404
|
i.div(
|
|
405
405
|
t.class("bc-password-strength__bar"),
|
|
406
406
|
i.div(
|
|
407
407
|
t.class("bc-password-strength__fill"),
|
|
408
|
-
t.style(
|
|
408
|
+
t.style(u.map((r) => `width: ${r}%`))
|
|
409
409
|
)
|
|
410
410
|
),
|
|
411
411
|
// Strength label (optional)
|
|
412
|
-
|
|
412
|
+
b(
|
|
413
413
|
c,
|
|
414
|
-
() =>
|
|
415
|
-
|
|
414
|
+
() => q(
|
|
415
|
+
B,
|
|
416
416
|
(r) => i.div(
|
|
417
417
|
t.class("bc-password-strength__label"),
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
g(
|
|
419
|
+
n,
|
|
420
420
|
r
|
|
421
|
-
)((
|
|
422
|
-
switch (
|
|
421
|
+
)((f, w) => {
|
|
422
|
+
switch (f) {
|
|
423
423
|
case "weak":
|
|
424
|
-
return
|
|
424
|
+
return w.passwordStrengthWeak;
|
|
425
425
|
case "fair":
|
|
426
|
-
return
|
|
426
|
+
return w.passwordStrengthFair;
|
|
427
427
|
case "good":
|
|
428
|
-
return
|
|
428
|
+
return w.passwordStrengthGood;
|
|
429
429
|
case "strong":
|
|
430
|
-
return
|
|
430
|
+
return w.passwordStrengthStrong;
|
|
431
431
|
default:
|
|
432
|
-
return
|
|
432
|
+
return w.passwordStrengthWeak;
|
|
433
433
|
}
|
|
434
434
|
})
|
|
435
435
|
)
|
|
@@ -439,18 +439,18 @@ function we({
|
|
|
439
439
|
i.div(
|
|
440
440
|
t.class("bc-password-strength__requirements"),
|
|
441
441
|
// Length requirement
|
|
442
|
-
|
|
442
|
+
b(
|
|
443
443
|
o.minLength !== void 0,
|
|
444
444
|
() => i.div(
|
|
445
445
|
t.class("bc-password-strength__requirement"),
|
|
446
446
|
t.class(
|
|
447
|
-
|
|
447
|
+
g(s)(
|
|
448
448
|
(r) => r.length ? "bc-password-strength__requirement--met" : ""
|
|
449
449
|
)
|
|
450
450
|
),
|
|
451
451
|
i.span(
|
|
452
452
|
t.class("bc-password-strength__requirement-icon"),
|
|
453
|
-
|
|
453
|
+
g(s)((r) => r.length ? "✓" : "○")
|
|
454
454
|
),
|
|
455
455
|
i.span(
|
|
456
456
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -459,18 +459,18 @@ function we({
|
|
|
459
459
|
)
|
|
460
460
|
),
|
|
461
461
|
// Uppercase requirement
|
|
462
|
-
|
|
462
|
+
b(
|
|
463
463
|
o.requireUppercase === !0,
|
|
464
464
|
() => i.div(
|
|
465
465
|
t.class("bc-password-strength__requirement"),
|
|
466
466
|
t.class(
|
|
467
|
-
|
|
467
|
+
g(s)(
|
|
468
468
|
(r) => r.uppercase ? "bc-password-strength__requirement--met" : ""
|
|
469
469
|
)
|
|
470
470
|
),
|
|
471
471
|
i.span(
|
|
472
472
|
t.class("bc-password-strength__requirement-icon"),
|
|
473
|
-
|
|
473
|
+
g(s)((r) => r.uppercase ? "✓" : "○")
|
|
474
474
|
),
|
|
475
475
|
i.span(
|
|
476
476
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -479,18 +479,18 @@ function we({
|
|
|
479
479
|
)
|
|
480
480
|
),
|
|
481
481
|
// Lowercase requirement
|
|
482
|
-
|
|
482
|
+
b(
|
|
483
483
|
o.requireLowercase === !0,
|
|
484
484
|
() => i.div(
|
|
485
485
|
t.class("bc-password-strength__requirement"),
|
|
486
486
|
t.class(
|
|
487
|
-
|
|
487
|
+
g(s)(
|
|
488
488
|
(r) => r.lowercase ? "bc-password-strength__requirement--met" : ""
|
|
489
489
|
)
|
|
490
490
|
),
|
|
491
491
|
i.span(
|
|
492
492
|
t.class("bc-password-strength__requirement-icon"),
|
|
493
|
-
|
|
493
|
+
g(s)((r) => r.lowercase ? "✓" : "○")
|
|
494
494
|
),
|
|
495
495
|
i.span(
|
|
496
496
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -499,18 +499,18 @@ function we({
|
|
|
499
499
|
)
|
|
500
500
|
),
|
|
501
501
|
// Numbers requirement
|
|
502
|
-
|
|
502
|
+
b(
|
|
503
503
|
o.requireNumbers === !0,
|
|
504
504
|
() => i.div(
|
|
505
505
|
t.class("bc-password-strength__requirement"),
|
|
506
506
|
t.class(
|
|
507
|
-
|
|
507
|
+
g(s)(
|
|
508
508
|
(r) => r.numbers ? "bc-password-strength__requirement--met" : ""
|
|
509
509
|
)
|
|
510
510
|
),
|
|
511
511
|
i.span(
|
|
512
512
|
t.class("bc-password-strength__requirement-icon"),
|
|
513
|
-
|
|
513
|
+
g(s)((r) => r.numbers ? "✓" : "○")
|
|
514
514
|
),
|
|
515
515
|
i.span(
|
|
516
516
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -519,18 +519,18 @@ function we({
|
|
|
519
519
|
)
|
|
520
520
|
),
|
|
521
521
|
// Symbols requirement
|
|
522
|
-
|
|
522
|
+
b(
|
|
523
523
|
o.requireSymbols === !0,
|
|
524
524
|
() => i.div(
|
|
525
525
|
t.class("bc-password-strength__requirement"),
|
|
526
526
|
t.class(
|
|
527
|
-
|
|
527
|
+
g(s)(
|
|
528
528
|
(r) => r.symbols ? "bc-password-strength__requirement--met" : ""
|
|
529
529
|
)
|
|
530
530
|
),
|
|
531
531
|
i.span(
|
|
532
532
|
t.class("bc-password-strength__requirement-icon"),
|
|
533
|
-
|
|
533
|
+
g(s)((r) => r.symbols ? "✓" : "○")
|
|
534
534
|
),
|
|
535
535
|
i.span(
|
|
536
536
|
t.class("bc-password-strength__requirement-text"),
|
|
@@ -541,214 +541,216 @@ function we({
|
|
|
541
541
|
)
|
|
542
542
|
);
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function We({
|
|
545
545
|
password: e,
|
|
546
|
-
rules: o =
|
|
546
|
+
rules: o = I,
|
|
547
547
|
className: c
|
|
548
548
|
}) {
|
|
549
|
-
const m =
|
|
549
|
+
const m = g(e)((s) => !s || s.length === 0 ? { strength: "weak", score: 0 } : ee(s, o)), l = m.map((s) => s.strength), n = m.map((s) => s.score), u = g(
|
|
550
550
|
l,
|
|
551
551
|
c
|
|
552
|
-
)((
|
|
552
|
+
)((s, a) => [
|
|
553
553
|
"bc-password-strength-bar",
|
|
554
|
-
`bc-password-strength-bar--${
|
|
555
|
-
|
|
554
|
+
`bc-password-strength-bar--${s}`,
|
|
555
|
+
a
|
|
556
556
|
].filter(Boolean).join(" "));
|
|
557
557
|
return i.div(
|
|
558
|
-
|
|
559
|
-
t.class(
|
|
558
|
+
C(m, u),
|
|
559
|
+
t.class(u),
|
|
560
560
|
i.div(
|
|
561
561
|
t.class("bc-password-strength-bar__fill"),
|
|
562
|
-
t.style(
|
|
562
|
+
t.style(n.map((s) => `width: ${s}%`))
|
|
563
563
|
)
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Ge({
|
|
567
567
|
password: e,
|
|
568
|
-
rules: o =
|
|
568
|
+
rules: o = I,
|
|
569
569
|
className: c
|
|
570
570
|
}) {
|
|
571
|
-
const m =
|
|
571
|
+
const m = g(e)((n) => !n || n.length === 0 ? "weak" : ee(n, o).strength), l = g(
|
|
572
572
|
m,
|
|
573
573
|
c
|
|
574
|
-
)((
|
|
574
|
+
)((n, u) => [
|
|
575
575
|
"bc-password-strength-text",
|
|
576
|
-
`bc-password-strength-text--${
|
|
577
|
-
|
|
576
|
+
`bc-password-strength-text--${n}`,
|
|
577
|
+
u
|
|
578
578
|
].filter(Boolean).join(" "));
|
|
579
|
-
return
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
(
|
|
579
|
+
return z(
|
|
580
|
+
C(m, l),
|
|
581
|
+
q(
|
|
582
|
+
B,
|
|
583
|
+
(n) => i.span(
|
|
584
584
|
t.class(l),
|
|
585
|
-
|
|
585
|
+
g(
|
|
586
586
|
m,
|
|
587
|
-
|
|
588
|
-
)((
|
|
589
|
-
switch (
|
|
587
|
+
n
|
|
588
|
+
)((u, s) => {
|
|
589
|
+
switch (u) {
|
|
590
590
|
case "weak":
|
|
591
|
-
return
|
|
591
|
+
return s.passwordStrengthWeak;
|
|
592
592
|
case "fair":
|
|
593
|
-
return
|
|
593
|
+
return s.passwordStrengthFair;
|
|
594
594
|
case "good":
|
|
595
|
-
return
|
|
595
|
+
return s.passwordStrengthGood;
|
|
596
596
|
case "strong":
|
|
597
|
-
return
|
|
597
|
+
return s.passwordStrengthStrong;
|
|
598
598
|
default:
|
|
599
|
-
return
|
|
599
|
+
return s.passwordStrengthWeak;
|
|
600
600
|
}
|
|
601
601
|
})
|
|
602
602
|
)
|
|
603
603
|
)
|
|
604
604
|
);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function ke({
|
|
607
607
|
passwordRules: e,
|
|
608
608
|
labels: o,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
609
|
+
initialEmail: c,
|
|
610
|
+
initialName: m,
|
|
611
|
+
showPasswordStrength: l,
|
|
612
|
+
onSignUp: n,
|
|
613
|
+
showNameField: u,
|
|
614
|
+
showConfirmPassword: s,
|
|
615
|
+
showAcceptTermsAndConditions: a,
|
|
616
|
+
termsAndConditions: r
|
|
615
617
|
}) {
|
|
616
|
-
const
|
|
617
|
-
showNameField:
|
|
618
|
-
showConfirmPassword:
|
|
619
|
-
showAcceptTermsAndConditions:
|
|
620
|
-
}),
|
|
621
|
-
schema:
|
|
622
|
-
onSubmit:
|
|
623
|
-
task:
|
|
624
|
-
email:
|
|
625
|
-
password:
|
|
626
|
-
name:
|
|
618
|
+
const f = V(!1), w = e || I, _ = Q(w, {
|
|
619
|
+
showNameField: u !== !1,
|
|
620
|
+
showConfirmPassword: s !== !1,
|
|
621
|
+
showAcceptTermsAndConditions: a !== !1
|
|
622
|
+
}), k = G({
|
|
623
|
+
schema: _,
|
|
624
|
+
onSubmit: Z({
|
|
625
|
+
task: n != null ? (P) => n({
|
|
626
|
+
email: P.email,
|
|
627
|
+
password: P.password,
|
|
628
|
+
name: P.name
|
|
627
629
|
}) : void 0,
|
|
628
630
|
message: "Reset password failed",
|
|
629
631
|
onStart: () => {
|
|
630
|
-
|
|
632
|
+
f.set(!0), k.controller.disable();
|
|
631
633
|
},
|
|
632
634
|
onEnd: () => {
|
|
633
|
-
|
|
635
|
+
f.set(!1), k.controller.enable();
|
|
634
636
|
}
|
|
635
637
|
}),
|
|
636
638
|
initialValue: {
|
|
637
|
-
name: "",
|
|
638
|
-
email: "",
|
|
639
|
+
name: m ?? "",
|
|
640
|
+
email: c ?? "",
|
|
639
641
|
password: "",
|
|
640
642
|
confirmPassword: "",
|
|
641
643
|
acceptTerms: !1
|
|
642
644
|
}
|
|
643
|
-
}), { controller:
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
return
|
|
647
|
-
|
|
648
|
-
(
|
|
645
|
+
}), { controller: v, submit: x } = k;
|
|
646
|
+
f.on(v.setDisabled);
|
|
647
|
+
const y = v.field("name"), U = v.field("email"), O = v.field("password"), D = v.field("confirmPassword"), S = v.field("acceptTerms");
|
|
648
|
+
return q(
|
|
649
|
+
B,
|
|
650
|
+
(P) => (
|
|
649
651
|
// Registration form
|
|
650
652
|
i.form(
|
|
651
|
-
|
|
653
|
+
C(v.dispose, f.dispose),
|
|
652
654
|
t.class("bc-auth-form__form"),
|
|
653
|
-
|
|
654
|
-
|
|
655
|
+
E.submit(x),
|
|
656
|
+
$(
|
|
655
657
|
t.class("bc-auth-form__fields"),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
(
|
|
658
|
+
W(
|
|
659
|
+
v.error,
|
|
660
|
+
(L) => j(
|
|
659
661
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
660
|
-
i.div(
|
|
662
|
+
i.div(L)
|
|
661
663
|
)
|
|
662
664
|
),
|
|
663
665
|
// Name field (optional)
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
() =>
|
|
667
|
-
controller:
|
|
668
|
-
(
|
|
669
|
-
(
|
|
666
|
+
b(
|
|
667
|
+
u !== !1,
|
|
668
|
+
() => T(he, {
|
|
669
|
+
controller: y.transform(
|
|
670
|
+
(L) => L ?? "",
|
|
671
|
+
(L) => L === "" ? void 0 : L
|
|
670
672
|
),
|
|
671
|
-
label: h(o?.nameLabel,
|
|
673
|
+
label: h(o?.nameLabel, P.$.nameLabel)
|
|
672
674
|
})
|
|
673
675
|
),
|
|
674
676
|
// Email field
|
|
675
|
-
|
|
676
|
-
controller:
|
|
677
|
-
label: h(o?.emailLabel,
|
|
677
|
+
T(H, {
|
|
678
|
+
controller: U,
|
|
679
|
+
label: h(o?.emailLabel, P.$.emailLabel)
|
|
678
680
|
}),
|
|
679
681
|
// Password field
|
|
680
|
-
|
|
681
|
-
controller:
|
|
682
|
-
label: h(o?.passwordLabel,
|
|
682
|
+
T(N, {
|
|
683
|
+
controller: O,
|
|
684
|
+
label: h(o?.passwordLabel, P.$.passwordLabel)
|
|
683
685
|
}),
|
|
684
686
|
// Password strength indicator
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
() =>
|
|
688
|
-
password:
|
|
689
|
-
rules:
|
|
687
|
+
b(
|
|
688
|
+
l ?? !1,
|
|
689
|
+
() => Le({
|
|
690
|
+
password: O.signal,
|
|
691
|
+
rules: w,
|
|
690
692
|
showLabel: !0
|
|
691
693
|
})
|
|
692
694
|
),
|
|
693
695
|
// Confirm password field
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
() =>
|
|
697
|
-
controller:
|
|
696
|
+
b(
|
|
697
|
+
s ?? !1,
|
|
698
|
+
() => T(N, {
|
|
699
|
+
controller: D,
|
|
698
700
|
label: h(
|
|
699
701
|
o?.confirmPasswordLabel,
|
|
700
|
-
|
|
702
|
+
P.$.confirmPasswordLabel
|
|
701
703
|
)
|
|
702
704
|
})
|
|
703
705
|
),
|
|
704
706
|
// Terms acceptance checkbox
|
|
705
|
-
|
|
706
|
-
|
|
707
|
+
b(
|
|
708
|
+
a ?? !1,
|
|
707
709
|
() => i.div(
|
|
708
710
|
t.class("bc-auth-form__terms"),
|
|
709
711
|
i.label(
|
|
710
712
|
t.class("bc-auth-form__checkbox-label"),
|
|
711
|
-
|
|
712
|
-
value:
|
|
713
|
-
onChange: (
|
|
713
|
+
ae({
|
|
714
|
+
value: S.signal.map((L) => L ?? !1),
|
|
715
|
+
onChange: (L) => S.change(L)
|
|
714
716
|
}),
|
|
715
717
|
i.span(
|
|
716
|
-
|
|
718
|
+
r || h(o?.acceptTermsLabel, P.$.acceptTermsLabel)
|
|
717
719
|
)
|
|
718
720
|
),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
+
b(
|
|
722
|
+
S.errorVisible,
|
|
721
723
|
() => i.div(
|
|
722
724
|
t.class("bc-auth-form__field-error"),
|
|
723
|
-
|
|
725
|
+
S.error.map((L) => L || "")
|
|
724
726
|
)
|
|
725
727
|
)
|
|
726
728
|
)
|
|
727
729
|
)
|
|
728
730
|
),
|
|
729
731
|
// Submit button
|
|
730
|
-
|
|
732
|
+
F(
|
|
731
733
|
{
|
|
732
734
|
type: "submit",
|
|
733
735
|
variant: "filled",
|
|
734
736
|
color: "primary",
|
|
735
|
-
loading:
|
|
736
|
-
disabled:
|
|
737
|
+
loading: f,
|
|
738
|
+
disabled: v.disabledOrHasErrors
|
|
737
739
|
},
|
|
738
740
|
t.class("bc-auth-form__submit"),
|
|
739
|
-
h(o?.signUpButton,
|
|
741
|
+
h(o?.signUpButton, P.$.signUpButton)
|
|
740
742
|
)
|
|
741
743
|
)
|
|
742
744
|
)
|
|
743
745
|
);
|
|
744
746
|
}
|
|
745
|
-
function
|
|
747
|
+
function ve({
|
|
746
748
|
onResetPassword: e,
|
|
747
749
|
labels: o = {}
|
|
748
750
|
}) {
|
|
749
|
-
const c =
|
|
750
|
-
schema:
|
|
751
|
-
onSubmit:
|
|
751
|
+
const c = ie(), m = V(!1), l = G({
|
|
752
|
+
schema: re,
|
|
753
|
+
onSubmit: Z({
|
|
752
754
|
task: e,
|
|
753
755
|
message: "Reset password failed",
|
|
754
756
|
onStart: () => {
|
|
@@ -761,21 +763,21 @@ function Le({
|
|
|
761
763
|
initialValue: {
|
|
762
764
|
email: ""
|
|
763
765
|
}
|
|
764
|
-
}), { controller:
|
|
765
|
-
m.on(
|
|
766
|
-
const
|
|
767
|
-
return c.on((
|
|
768
|
-
|
|
769
|
-
}),
|
|
770
|
-
|
|
771
|
-
(
|
|
766
|
+
}), { controller: n, submit: u } = l;
|
|
767
|
+
m.on(n.setDisabled);
|
|
768
|
+
const s = n.field("email");
|
|
769
|
+
return c.on((a) => {
|
|
770
|
+
a != null && s.change(a);
|
|
771
|
+
}), q(
|
|
772
|
+
B,
|
|
773
|
+
(a) => (
|
|
772
774
|
// Reset password form
|
|
773
775
|
i.form(
|
|
774
|
-
|
|
776
|
+
C(n.dispose, c.dispose, m.dispose),
|
|
775
777
|
t.class("bc-auth-form__form"),
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
(r) =>
|
|
778
|
+
W(
|
|
779
|
+
n.error,
|
|
780
|
+
(r) => j(
|
|
779
781
|
{ variant: "danger", tone: "prominent", role: "alert" },
|
|
780
782
|
i.div(r)
|
|
781
783
|
)
|
|
@@ -783,28 +785,28 @@ function Le({
|
|
|
783
785
|
// Description
|
|
784
786
|
i.p(
|
|
785
787
|
t.class("bc-auth-form__description"),
|
|
786
|
-
h(o?.resetPasswordDescription,
|
|
788
|
+
h(o?.resetPasswordDescription, a.$.resetPasswordDescription)
|
|
787
789
|
),
|
|
788
|
-
|
|
789
|
-
|
|
790
|
+
E.submit(u),
|
|
791
|
+
$(
|
|
790
792
|
t.class("bc-auth-form__fields"),
|
|
791
793
|
// Email field
|
|
792
|
-
|
|
793
|
-
controller:
|
|
794
|
-
label: h(o?.emailLabel,
|
|
794
|
+
T(H, {
|
|
795
|
+
controller: s,
|
|
796
|
+
label: h(o?.emailLabel, a.$.emailLabel)
|
|
795
797
|
})
|
|
796
798
|
),
|
|
797
799
|
// Submit button
|
|
798
|
-
|
|
800
|
+
F(
|
|
799
801
|
{
|
|
800
802
|
loading: m,
|
|
801
803
|
type: "submit",
|
|
802
804
|
variant: "filled",
|
|
803
805
|
color: "primary",
|
|
804
|
-
disabled:
|
|
806
|
+
disabled: n.disabledOrHasErrors
|
|
805
807
|
},
|
|
806
808
|
t.class("bc-auth-form__submit"),
|
|
807
|
-
h(o?.resetPasswordButton,
|
|
809
|
+
h(o?.resetPasswordButton, a.$.resetPasswordButton)
|
|
808
810
|
)
|
|
809
811
|
)
|
|
810
812
|
)
|
|
@@ -816,23 +818,23 @@ function p({
|
|
|
816
818
|
size: c = "md",
|
|
817
819
|
name: m,
|
|
818
820
|
icon: l,
|
|
819
|
-
color:
|
|
820
|
-
flow:
|
|
821
|
-
labels:
|
|
821
|
+
color: n,
|
|
822
|
+
flow: u,
|
|
823
|
+
labels: s
|
|
822
824
|
}) {
|
|
823
|
-
return
|
|
825
|
+
return F(
|
|
824
826
|
{
|
|
825
827
|
type: "button",
|
|
826
828
|
variant: "filled",
|
|
827
829
|
size: c,
|
|
828
|
-
color:
|
|
830
|
+
color: n,
|
|
829
831
|
onClick: async () => {
|
|
830
832
|
if (o)
|
|
831
833
|
try {
|
|
832
|
-
|
|
834
|
+
u === "popup" ? await o() : await o();
|
|
833
835
|
} catch (r) {
|
|
834
836
|
console.error(
|
|
835
|
-
`Social login error for ${e} (${
|
|
837
|
+
`Social login error for ${e} (${u || "redirect"} flow):`,
|
|
836
838
|
r
|
|
837
839
|
);
|
|
838
840
|
}
|
|
@@ -841,45 +843,45 @@ function p({
|
|
|
841
843
|
},
|
|
842
844
|
t.class("bc-social-login-button"),
|
|
843
845
|
t.class(
|
|
844
|
-
|
|
846
|
+
g(e)((r) => `bc-social-login-button--${r}`)
|
|
845
847
|
),
|
|
846
848
|
i.span(
|
|
847
849
|
t.class("bc-social-login-button__inner"),
|
|
848
850
|
i.span(
|
|
849
851
|
t.class("bc-social-login-button__icon"),
|
|
850
|
-
|
|
852
|
+
ge({ icon: l, size: c }, t.class("bc-social-login-button__icon-inner"))
|
|
851
853
|
),
|
|
852
|
-
|
|
853
|
-
|
|
854
|
+
q(
|
|
855
|
+
B,
|
|
854
856
|
(r) => i.span(
|
|
855
857
|
t.class("bc-social-login-button__label"),
|
|
856
|
-
|
|
857
|
-
h(
|
|
858
|
+
le(
|
|
859
|
+
h(s?.continueWithProvider, r.$.continueWithProvider)
|
|
858
860
|
)(m)
|
|
859
861
|
)
|
|
860
862
|
)
|
|
861
863
|
)
|
|
862
864
|
);
|
|
863
865
|
}
|
|
864
|
-
function
|
|
866
|
+
function ye({
|
|
865
867
|
providers: e,
|
|
866
868
|
onProviderClick: o,
|
|
867
869
|
size: c = "md",
|
|
868
870
|
className: m
|
|
869
871
|
}) {
|
|
870
|
-
return
|
|
872
|
+
return $(
|
|
871
873
|
t.class("bc-social-login-buttons"),
|
|
872
874
|
t.class(m),
|
|
873
|
-
|
|
875
|
+
me(
|
|
874
876
|
e,
|
|
875
877
|
(l) => p({
|
|
876
878
|
provider: l.$.provider,
|
|
877
879
|
flow: l.$.flow,
|
|
878
880
|
color: l.map(
|
|
879
|
-
({ provider:
|
|
881
|
+
({ provider: n }) => d[n].color
|
|
880
882
|
),
|
|
881
|
-
name: l.map(({ provider:
|
|
882
|
-
icon: l.map(({ provider:
|
|
883
|
+
name: l.map(({ provider: n }) => d[n].name),
|
|
884
|
+
icon: l.map(({ provider: n }) => d[n].icon),
|
|
883
885
|
onClick: async () => {
|
|
884
886
|
o && await o(l.$.provider.value);
|
|
885
887
|
},
|
|
@@ -1019,237 +1021,241 @@ const d = {
|
|
|
1019
1021
|
color: "blue"
|
|
1020
1022
|
// distinct deep blue tone (not Facebook’s exact blue)
|
|
1021
1023
|
}
|
|
1022
|
-
},
|
|
1024
|
+
}, He = (e) => p({
|
|
1023
1025
|
...e,
|
|
1024
1026
|
...d.google,
|
|
1025
1027
|
provider: "google"
|
|
1026
|
-
}),
|
|
1028
|
+
}), je = (e) => p({
|
|
1027
1029
|
...e,
|
|
1028
1030
|
...d.github,
|
|
1029
1031
|
provider: "github"
|
|
1030
|
-
}),
|
|
1032
|
+
}), Xe = (e) => p({
|
|
1031
1033
|
...e,
|
|
1032
1034
|
...d.apple,
|
|
1033
1035
|
provider: "apple"
|
|
1034
|
-
}),
|
|
1036
|
+
}), Ye = (e) => p({
|
|
1035
1037
|
...e,
|
|
1036
1038
|
...d.facebook,
|
|
1037
1039
|
provider: "facebook"
|
|
1038
|
-
}),
|
|
1040
|
+
}), Ze = (e) => p({
|
|
1039
1041
|
...e,
|
|
1040
1042
|
...d.x,
|
|
1041
1043
|
provider: "x"
|
|
1042
|
-
}),
|
|
1044
|
+
}), Je = (e) => p({
|
|
1043
1045
|
...e,
|
|
1044
1046
|
...d.twitter,
|
|
1045
1047
|
provider: "twitter"
|
|
1046
|
-
}),
|
|
1048
|
+
}), Ke = (e) => p({
|
|
1047
1049
|
...e,
|
|
1048
1050
|
...d.microsoft,
|
|
1049
1051
|
provider: "microsoft"
|
|
1050
|
-
}),
|
|
1052
|
+
}), Qe = (e) => p({
|
|
1051
1053
|
...e,
|
|
1052
1054
|
...d.discord,
|
|
1053
1055
|
provider: "discord"
|
|
1054
|
-
}),
|
|
1056
|
+
}), eo = (e) => p({
|
|
1055
1057
|
...e,
|
|
1056
1058
|
...d.linkedin,
|
|
1057
1059
|
provider: "linkedin"
|
|
1058
|
-
}),
|
|
1060
|
+
}), oo = (e) => p({
|
|
1059
1061
|
...e,
|
|
1060
1062
|
...d.instagram,
|
|
1061
1063
|
provider: "instagram"
|
|
1062
|
-
}),
|
|
1064
|
+
}), to = (e) => p({
|
|
1063
1065
|
...e,
|
|
1064
1066
|
...d.tiktok,
|
|
1065
1067
|
provider: "tiktok"
|
|
1066
|
-
}),
|
|
1068
|
+
}), so = (e) => p({
|
|
1067
1069
|
...e,
|
|
1068
1070
|
...d.snapchat,
|
|
1069
1071
|
provider: "snapchat"
|
|
1070
|
-
}),
|
|
1072
|
+
}), no = (e) => p({
|
|
1071
1073
|
...e,
|
|
1072
1074
|
...d.reddit,
|
|
1073
1075
|
provider: "reddit"
|
|
1074
|
-
}),
|
|
1076
|
+
}), ao = (e) => p({
|
|
1075
1077
|
...e,
|
|
1076
1078
|
...d.pinterest,
|
|
1077
1079
|
provider: "pinterest"
|
|
1078
|
-
}),
|
|
1080
|
+
}), ro = (e) => p({
|
|
1079
1081
|
...e,
|
|
1080
1082
|
...d.twitch,
|
|
1081
1083
|
provider: "twitch"
|
|
1082
|
-
}),
|
|
1084
|
+
}), io = (e) => p({
|
|
1083
1085
|
...e,
|
|
1084
1086
|
...d.steam,
|
|
1085
1087
|
provider: "steam"
|
|
1086
|
-
}),
|
|
1088
|
+
}), co = (e) => p({
|
|
1087
1089
|
...e,
|
|
1088
1090
|
...d.epic,
|
|
1089
1091
|
provider: "epic"
|
|
1090
|
-
}),
|
|
1092
|
+
}), lo = (e) => p({
|
|
1091
1093
|
...e,
|
|
1092
1094
|
...d.playstation,
|
|
1093
1095
|
provider: "playstation"
|
|
1094
|
-
}),
|
|
1096
|
+
}), mo = (e) => p({
|
|
1095
1097
|
...e,
|
|
1096
1098
|
...d.xbox,
|
|
1097
1099
|
provider: "xbox"
|
|
1098
|
-
}),
|
|
1100
|
+
}), uo = (e) => p({
|
|
1099
1101
|
...e,
|
|
1100
1102
|
...d.whatsapp,
|
|
1101
1103
|
provider: "whatsapp"
|
|
1102
|
-
}),
|
|
1104
|
+
}), po = (e) => p({
|
|
1103
1105
|
...e,
|
|
1104
1106
|
...d.wechat,
|
|
1105
1107
|
provider: "wechat"
|
|
1106
|
-
}),
|
|
1108
|
+
}), ho = (e) => p({
|
|
1107
1109
|
...e,
|
|
1108
1110
|
...d.amazon,
|
|
1109
1111
|
provider: "amazon"
|
|
1110
|
-
}),
|
|
1112
|
+
}), go = (e) => p({
|
|
1111
1113
|
...e,
|
|
1112
1114
|
...d.yahoo,
|
|
1113
1115
|
provider: "yahoo"
|
|
1114
|
-
}),
|
|
1116
|
+
}), fo = (e) => p({
|
|
1115
1117
|
...e,
|
|
1116
1118
|
...d.paypal,
|
|
1117
1119
|
provider: "paypal"
|
|
1118
1120
|
});
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1121
|
-
|
|
1121
|
+
function se({ providers: e }) {
|
|
1122
|
+
return $(
|
|
1123
|
+
ye({
|
|
1122
1124
|
providers: e
|
|
1123
1125
|
})
|
|
1124
1126
|
);
|
|
1125
1127
|
}
|
|
1126
|
-
function
|
|
1128
|
+
function Se({
|
|
1127
1129
|
mode: e,
|
|
1128
1130
|
socialProviders: o,
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1131
|
+
initialName: c,
|
|
1132
|
+
initialEmail: m,
|
|
1133
|
+
passwordRules: l,
|
|
1134
|
+
showRememberMe: n,
|
|
1135
|
+
showSocialDivider: u,
|
|
1136
|
+
showPasswordStrength: s,
|
|
1137
|
+
labels: a,
|
|
1138
|
+
onSignIn: r,
|
|
1139
|
+
onSignUp: f,
|
|
1140
|
+
onResetPassword: w,
|
|
1141
|
+
onModeChange: _,
|
|
1138
1142
|
// onSocialLogin,
|
|
1139
|
-
showContainer:
|
|
1140
|
-
}, ...
|
|
1141
|
-
const
|
|
1142
|
-
return
|
|
1143
|
-
function
|
|
1144
|
-
const
|
|
1143
|
+
showContainer: k
|
|
1144
|
+
}, ...v) {
|
|
1145
|
+
const x = e != null ? oe.deriveProp(e) : V("signin");
|
|
1146
|
+
return x.on((y) => _?.(y)), q(B, (y) => {
|
|
1147
|
+
function U() {
|
|
1148
|
+
const S = h(a?.hasAccountLink, y.$.hasAccountLink);
|
|
1145
1149
|
return i.button(
|
|
1146
1150
|
t.type("button"),
|
|
1147
1151
|
t.class("bc-auth-form__link"),
|
|
1148
|
-
|
|
1149
|
-
|
|
1152
|
+
E.click(() => x.set("signin")),
|
|
1153
|
+
S
|
|
1150
1154
|
);
|
|
1151
1155
|
}
|
|
1152
|
-
function
|
|
1156
|
+
function O() {
|
|
1153
1157
|
return i.button(
|
|
1154
1158
|
t.type("button"),
|
|
1155
1159
|
t.class("bc-auth-form__link"),
|
|
1156
|
-
|
|
1157
|
-
h(
|
|
1160
|
+
E.click(() => x.set("signup")),
|
|
1161
|
+
h(a?.noAccountLink, y.$.noAccountLink)
|
|
1158
1162
|
);
|
|
1159
1163
|
}
|
|
1160
|
-
function
|
|
1164
|
+
function D() {
|
|
1161
1165
|
return i.button(
|
|
1162
1166
|
t.type("button"),
|
|
1163
1167
|
t.class("bc-auth-form__link"),
|
|
1164
|
-
|
|
1165
|
-
h(
|
|
1168
|
+
E.click(() => x.set("reset-password")),
|
|
1169
|
+
h(a?.forgotPasswordLink, y.$.forgotPasswordLink)
|
|
1166
1170
|
);
|
|
1167
1171
|
}
|
|
1168
1172
|
return i.div(
|
|
1169
|
-
|
|
1173
|
+
fe({
|
|
1170
1174
|
"bc-auth-container": !0,
|
|
1171
|
-
"bc-auth-container--styled":
|
|
1175
|
+
"bc-auth-container--styled": oe.map(k ?? !0, (S) => S)
|
|
1172
1176
|
}),
|
|
1173
|
-
t.class(
|
|
1177
|
+
t.class(x.map((S) => `bc-auth-container--${S}`)),
|
|
1174
1178
|
t.class("bc-auth-form"),
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
signin: () =>
|
|
1179
|
+
C(x.dispose),
|
|
1180
|
+
ue(x, {
|
|
1181
|
+
signin: () => z(
|
|
1178
1182
|
i.h2(
|
|
1179
1183
|
t.class("bc-auth-form__title"),
|
|
1180
|
-
h(
|
|
1184
|
+
h(a?.signInTitle, y.$.signInTitle)
|
|
1181
1185
|
),
|
|
1182
|
-
o != null ?
|
|
1183
|
-
|
|
1184
|
-
|
|
1186
|
+
o != null ? z(
|
|
1187
|
+
se({ providers: o }),
|
|
1188
|
+
b(u ?? !1, ne)
|
|
1185
1189
|
) : null,
|
|
1186
|
-
|
|
1187
|
-
onSignIn:
|
|
1188
|
-
showRememberMe:
|
|
1189
|
-
passwordRules:
|
|
1190
|
+
_e({
|
|
1191
|
+
onSignIn: r,
|
|
1192
|
+
showRememberMe: n,
|
|
1193
|
+
passwordRules: l,
|
|
1190
1194
|
labels: {
|
|
1191
|
-
emailLabel:
|
|
1192
|
-
passwordLabel:
|
|
1193
|
-
rememberMeLabel:
|
|
1194
|
-
signInButton:
|
|
1195
|
-
forgotPasswordLink:
|
|
1196
|
-
noAccountLink:
|
|
1195
|
+
emailLabel: a?.emailLabel,
|
|
1196
|
+
passwordLabel: a?.passwordLabel,
|
|
1197
|
+
rememberMeLabel: a?.rememberMeLabel,
|
|
1198
|
+
signInButton: a?.signInButton,
|
|
1199
|
+
forgotPasswordLink: a?.forgotPasswordLink,
|
|
1200
|
+
noAccountLink: a?.noAccountLink
|
|
1197
1201
|
}
|
|
1198
1202
|
}),
|
|
1199
|
-
|
|
1203
|
+
$(
|
|
1200
1204
|
t.class("bc-auth-form__footer"),
|
|
1201
|
-
|
|
1202
|
-
|
|
1205
|
+
O(),
|
|
1206
|
+
D()
|
|
1203
1207
|
)
|
|
1204
1208
|
),
|
|
1205
|
-
signup: () =>
|
|
1209
|
+
signup: () => z(
|
|
1206
1210
|
i.h2(
|
|
1207
1211
|
t.class("bc-auth-form__title"),
|
|
1208
|
-
h(
|
|
1212
|
+
h(a?.signUpTitle, y.$.signUpTitle)
|
|
1209
1213
|
),
|
|
1210
|
-
o != null ?
|
|
1211
|
-
|
|
1212
|
-
|
|
1214
|
+
o != null ? z(
|
|
1215
|
+
se({ providers: o }),
|
|
1216
|
+
b(u ?? !1, ne)
|
|
1213
1217
|
) : null,
|
|
1214
|
-
|
|
1218
|
+
ke({
|
|
1215
1219
|
labels: {
|
|
1216
|
-
nameLabel:
|
|
1217
|
-
emailLabel:
|
|
1218
|
-
passwordLabel:
|
|
1219
|
-
confirmPasswordLabel:
|
|
1220
|
-
acceptTermsLabel:
|
|
1221
|
-
signUpButton:
|
|
1222
|
-
hasAccountLink:
|
|
1220
|
+
nameLabel: a?.nameLabel,
|
|
1221
|
+
emailLabel: a?.emailLabel,
|
|
1222
|
+
passwordLabel: a?.passwordLabel,
|
|
1223
|
+
confirmPasswordLabel: a?.confirmPasswordLabel,
|
|
1224
|
+
acceptTermsLabel: a?.acceptTermsLabel,
|
|
1225
|
+
signUpButton: a?.signUpButton,
|
|
1226
|
+
hasAccountLink: a?.hasAccountLink
|
|
1223
1227
|
},
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1228
|
+
initialEmail: m,
|
|
1229
|
+
initialName: c,
|
|
1230
|
+
onSignUp: f,
|
|
1231
|
+
passwordRules: l,
|
|
1232
|
+
showPasswordStrength: s
|
|
1227
1233
|
}),
|
|
1228
|
-
|
|
1234
|
+
$(t.class("bc-auth-form__footer"), U())
|
|
1229
1235
|
),
|
|
1230
|
-
"reset-password": () =>
|
|
1236
|
+
"reset-password": () => z(
|
|
1231
1237
|
i.h2(
|
|
1232
1238
|
t.class("bc-auth-form__title"),
|
|
1233
|
-
h(
|
|
1239
|
+
h(a?.resetPasswordTitle, y.$.resetPasswordTitle)
|
|
1234
1240
|
),
|
|
1235
|
-
|
|
1241
|
+
ve({
|
|
1236
1242
|
labels: {
|
|
1237
|
-
backToSignInLink:
|
|
1238
|
-
emailLabel:
|
|
1239
|
-
resetPasswordButton:
|
|
1240
|
-
resetPasswordDescription:
|
|
1243
|
+
backToSignInLink: a?.backToSignInLink,
|
|
1244
|
+
emailLabel: a?.emailLabel,
|
|
1245
|
+
resetPasswordButton: a?.resetPasswordButton,
|
|
1246
|
+
resetPasswordDescription: a?.resetPasswordDescription
|
|
1241
1247
|
},
|
|
1242
|
-
onResetPassword:
|
|
1248
|
+
onResetPassword: w
|
|
1243
1249
|
}),
|
|
1244
|
-
|
|
1250
|
+
$(t.class("bc-auth-form__footer"), U())
|
|
1245
1251
|
)
|
|
1246
1252
|
}),
|
|
1247
|
-
...
|
|
1253
|
+
...v
|
|
1248
1254
|
);
|
|
1249
1255
|
});
|
|
1250
1256
|
}
|
|
1251
|
-
function
|
|
1252
|
-
return
|
|
1257
|
+
function bo(e) {
|
|
1258
|
+
return pe(
|
|
1253
1259
|
{
|
|
1254
1260
|
size: "sm",
|
|
1255
1261
|
dismissable: !0,
|
|
@@ -1257,16 +1263,16 @@ function go(e) {
|
|
|
1257
1263
|
},
|
|
1258
1264
|
(o, c) => e(
|
|
1259
1265
|
(m) => o({
|
|
1260
|
-
body:
|
|
1261
|
-
header:
|
|
1262
|
-
|
|
1266
|
+
body: Se({ showContainer: !1, ...m }),
|
|
1267
|
+
header: q(
|
|
1268
|
+
B,
|
|
1263
1269
|
(l) => h(m.modalTitle, l.$.authenticationTitle)
|
|
1264
1270
|
)
|
|
1265
1271
|
})
|
|
1266
1272
|
)
|
|
1267
1273
|
);
|
|
1268
1274
|
}
|
|
1269
|
-
function
|
|
1275
|
+
function ne({
|
|
1270
1276
|
labels: e,
|
|
1271
1277
|
className: o
|
|
1272
1278
|
} = {}) {
|
|
@@ -1274,8 +1280,8 @@ function te({
|
|
|
1274
1280
|
t.class("bc-auth-divider"),
|
|
1275
1281
|
t.class(o),
|
|
1276
1282
|
i.div(t.class("bc-auth-divider__line")),
|
|
1277
|
-
|
|
1278
|
-
|
|
1283
|
+
q(
|
|
1284
|
+
B,
|
|
1279
1285
|
(c) => i.span(
|
|
1280
1286
|
t.class("bc-auth-divider__text"),
|
|
1281
1287
|
h(e?.text, c.$.orDivider)
|
|
@@ -1285,66 +1291,66 @@ function te({
|
|
|
1285
1291
|
);
|
|
1286
1292
|
}
|
|
1287
1293
|
export {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1294
|
+
ho as AmazonLoginButton,
|
|
1295
|
+
Xe as AppleLoginButton,
|
|
1296
|
+
Se as AuthContainer,
|
|
1297
|
+
ne as AuthDivider,
|
|
1298
|
+
bo as AuthModal,
|
|
1299
|
+
Qe as DiscordLoginButton,
|
|
1300
|
+
co as EpicLoginButton,
|
|
1301
|
+
Ye as FacebookLoginButton,
|
|
1302
|
+
je as GitHubLoginButton,
|
|
1303
|
+
He as GoogleLoginButton,
|
|
1304
|
+
oo as InstagramLoginButton,
|
|
1305
|
+
eo as LinkedInLoginButton,
|
|
1306
|
+
Ke as MicrosoftLoginButton,
|
|
1307
|
+
We as PasswordStrengthBar,
|
|
1308
|
+
Le as PasswordStrengthIndicator,
|
|
1309
|
+
Ge as PasswordStrengthText,
|
|
1310
|
+
fo as PayPalLoginButton,
|
|
1311
|
+
ao as PinterestLoginButton,
|
|
1312
|
+
lo as PlayStationLoginButton,
|
|
1313
|
+
no as RedditLoginButton,
|
|
1314
|
+
ve as ResetPasswordForm,
|
|
1315
|
+
_e as SignInForm,
|
|
1316
|
+
ke as SignUpForm,
|
|
1317
|
+
so as SnapchatLoginButton,
|
|
1312
1318
|
p as SocialLoginButton,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1319
|
+
ye as SocialLoginButtons,
|
|
1320
|
+
se as SocialProviders,
|
|
1321
|
+
io as SteamLoginButton,
|
|
1322
|
+
to as TiktokLoginButton,
|
|
1323
|
+
ro as TwitchLoginButton,
|
|
1324
|
+
Je as TwitterLoginButton,
|
|
1325
|
+
po as WeChatLoginButton,
|
|
1326
|
+
uo as WhatsAppLoginButton,
|
|
1327
|
+
Ze as XLoginButtin,
|
|
1328
|
+
mo as XboxLoginButton,
|
|
1329
|
+
go as YahooLoginButton,
|
|
1330
|
+
De as authSchemas,
|
|
1331
|
+
ee as calculatePasswordStrength,
|
|
1332
|
+
J as createPasswordSchema,
|
|
1333
|
+
K as createSignInSchema,
|
|
1334
|
+
Q as createSignUpSchema,
|
|
1335
|
+
Ee as createSocialLoginUrl,
|
|
1336
|
+
I as defaultPasswordRules,
|
|
1337
|
+
Fe as defaultSignInSchema,
|
|
1338
|
+
Me as defaultSignUpSchema,
|
|
1339
|
+
M as emailSchema,
|
|
1340
|
+
Oe as formatAuthError,
|
|
1341
|
+
be as formatProviderName,
|
|
1342
|
+
Ce as formatSocialLoginText,
|
|
1343
|
+
we as generateRandomString,
|
|
1344
|
+
Ae as getProviderColor,
|
|
1345
|
+
Te as getProviderIcon,
|
|
1346
|
+
Ve as isBrowser,
|
|
1347
|
+
ze as isValidEmail,
|
|
1348
|
+
Ue as openSocialLoginPopup,
|
|
1349
|
+
Y as providerInfo,
|
|
1350
|
+
Z as requestToControllerValidation,
|
|
1351
|
+
re as resetPasswordSchema,
|
|
1346
1352
|
d as socialProviderInfo,
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1353
|
+
ie as useAuthEmailProp,
|
|
1354
|
+
Ne as validateEmail,
|
|
1355
|
+
Re as validatePassword
|
|
1350
1356
|
};
|