@edgespark/web 0.0.1-beta.2 → 0.0.1-beta.4
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/README.md +4 -0
- package/dist/auth/types.d.ts +7 -1
- package/dist/auth-ui/ManagedAuthUI.d.ts +3 -0
- package/dist/client.d.ts +8 -8
- package/dist/index.cjs +9 -9
- package/dist/index.es.js +479 -359
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,171 +1,210 @@
|
|
|
1
|
-
import { createAuthClient as
|
|
2
|
-
class
|
|
3
|
-
constructor(e,
|
|
4
|
-
super(
|
|
1
|
+
import { createAuthClient as le } from "better-auth/client";
|
|
2
|
+
class x extends Error {
|
|
3
|
+
constructor(e, t) {
|
|
4
|
+
super(t), this.name = "EdgeSparkError", this.code = e;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
class
|
|
7
|
+
class d extends x {
|
|
8
8
|
constructor(e) {
|
|
9
9
|
super("CONFIG_ERROR", e), this.name = "EdgeSparkConfigError";
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class ne extends x {
|
|
13
13
|
constructor(e) {
|
|
14
14
|
super("RUNTIME_ERROR", e), this.name = "EdgeSparkRuntimeError";
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
class
|
|
18
|
-
constructor(e,
|
|
19
|
-
super((
|
|
17
|
+
class m extends x {
|
|
18
|
+
constructor(e, t) {
|
|
19
|
+
super((t == null ? void 0 : t.code) ?? "AUTH_ERROR", e), this.name = "EdgeSparkAuthError", this.cause = t == null ? void 0 : t.cause, this.status = t == null ? void 0 : t.status;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function re() {
|
|
23
23
|
if (typeof window > "u" || typeof document > "u")
|
|
24
|
-
throw new
|
|
24
|
+
throw new ne(
|
|
25
25
|
"@edgespark/web is browser-only. Create the client from a real browser runtime."
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function H() {
|
|
29
|
+
return re(), window.location.origin;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function de(s) {
|
|
32
|
+
return s instanceof URL ? s : typeof s == "string" ? new URL(s, window.location.href) : new URL(s.url, window.location.href);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
throw new
|
|
37
|
-
`Cross-origin requests are not supported by this SDK. Received ${
|
|
34
|
+
function ce(s) {
|
|
35
|
+
if (s.origin !== H())
|
|
36
|
+
throw new d(
|
|
37
|
+
`Cross-origin requests are not supported by this SDK. Received ${s.origin}, expected ${H()}.`
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ue() {
|
|
41
41
|
return {
|
|
42
|
-
async fetch(
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
async fetch(s, e) {
|
|
43
|
+
const t = de(s);
|
|
44
|
+
return ce(t), fetch(s, {
|
|
45
45
|
...e,
|
|
46
46
|
credentials: "include"
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
53
|
-
return
|
|
54
|
-
baseURL:
|
|
55
|
-
basePath:
|
|
56
|
-
...
|
|
51
|
+
const oe = "/api/_es/auth";
|
|
52
|
+
function ae(s) {
|
|
53
|
+
return le({
|
|
54
|
+
baseURL: H(),
|
|
55
|
+
basePath: oe,
|
|
56
|
+
...s != null && s.disableDefaultRedirectPlugin ? { disableDefaultFetchPlugins: !0 } : {},
|
|
57
57
|
fetchOptions: {
|
|
58
58
|
credentials: "include"
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
var e,
|
|
64
|
-
return (
|
|
62
|
+
function v(s) {
|
|
63
|
+
var e, t;
|
|
64
|
+
return (t = (e = s.$store) == null ? void 0 : e.atoms) == null ? void 0 : t.session;
|
|
65
|
+
}
|
|
66
|
+
function B(s) {
|
|
67
|
+
if (s instanceof m)
|
|
68
|
+
return s;
|
|
69
|
+
const e = s;
|
|
70
|
+
return new m(
|
|
71
|
+
(e == null ? void 0 : e.message) || "Failed to load the current session.",
|
|
72
|
+
{
|
|
73
|
+
code: (e == null ? void 0 : e.code) ?? "SESSION_LOOKUP_FAILED",
|
|
74
|
+
cause: s,
|
|
75
|
+
status: e == null ? void 0 : e.status
|
|
76
|
+
}
|
|
77
|
+
);
|
|
65
78
|
}
|
|
66
|
-
async function
|
|
79
|
+
async function he(s) {
|
|
67
80
|
var e;
|
|
68
|
-
await ((e =
|
|
81
|
+
await ((e = v(s)) == null ? void 0 : e.get().refetch());
|
|
69
82
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
let i = null;
|
|
73
|
-
const o = () =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
function me() {
|
|
84
|
+
const s = ae(), e = 2, t = 500;
|
|
85
|
+
let i = null, r = !1;
|
|
86
|
+
const o = () => {
|
|
87
|
+
var c;
|
|
88
|
+
return r ? Promise.resolve(((c = v(s)) == null ? void 0 : c.get().data) ?? null) : (i || (i = (async () => {
|
|
89
|
+
var P, L, y, S;
|
|
90
|
+
let a = !1, l = null;
|
|
91
|
+
try {
|
|
92
|
+
for (let p = 0; p <= e; p++) {
|
|
93
|
+
const f = await s.getSession(), b = ((P = v(s)) == null ? void 0 : P.get().data) ?? null;
|
|
94
|
+
if ((L = f.data) != null && L.session && ((y = f.data) != null && y.user))
|
|
95
|
+
return r = !0, f.data;
|
|
96
|
+
if (b != null && b.session && (b != null && b.user))
|
|
97
|
+
return r = !0, b;
|
|
98
|
+
if (f.error ? l = f.error : a = !0, !f.error && p < e) {
|
|
99
|
+
await new Promise((A) => setTimeout(A, t));
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
p < e && await new Promise((A) => setTimeout(A, t));
|
|
103
|
+
}
|
|
104
|
+
if (!a)
|
|
105
|
+
throw i = null, new m("Failed to load the current session.", {
|
|
106
|
+
code: "SESSION_LOOKUP_FAILED",
|
|
107
|
+
cause: l
|
|
108
|
+
});
|
|
109
|
+
const h = ((S = v(s)) == null ? void 0 : S.get().data) ?? null;
|
|
110
|
+
return r = !0, h;
|
|
111
|
+
} catch (h) {
|
|
112
|
+
throw i = null, B(h);
|
|
113
|
+
}
|
|
114
|
+
})()), i);
|
|
115
|
+
};
|
|
116
|
+
o().catch(() => {
|
|
117
|
+
});
|
|
118
|
+
const u = async () => {
|
|
119
|
+
var c, a;
|
|
120
|
+
try {
|
|
121
|
+
const l = await s.getSession();
|
|
122
|
+
if ((c = l.data) != null && c.session && ((a = l.data) != null && a.user))
|
|
123
|
+
return l.data;
|
|
124
|
+
throw l.error ? B(l.error) : new m("No authenticated session is available.", {
|
|
125
|
+
code: "UNAUTHENTICATED"
|
|
126
|
+
});
|
|
127
|
+
} catch (l) {
|
|
128
|
+
throw B(l);
|
|
77
129
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}));
|
|
83
|
-
o();
|
|
84
|
-
const a = async () => {
|
|
85
|
-
var r, d;
|
|
86
|
-
const l = await t.getSession();
|
|
87
|
-
if ((r = l.data) != null && r.session && ((d = l.data) != null && d.user))
|
|
88
|
-
return l.data;
|
|
89
|
-
throw new w("No authenticated session is available.", {
|
|
90
|
-
code: "UNAUTHENTICATED",
|
|
91
|
-
cause: l.error
|
|
92
|
-
});
|
|
93
|
-
}, c = (l) => {
|
|
94
|
-
let r = !1, d = !1, A;
|
|
95
|
-
const B = (m) => {
|
|
96
|
-
m !== A && (A = m, l(m));
|
|
130
|
+
}, w = (c) => {
|
|
131
|
+
let a = !1, l = !1, P;
|
|
132
|
+
const L = (h) => {
|
|
133
|
+
h !== P && (P = h, c(h));
|
|
97
134
|
};
|
|
98
|
-
o().then((
|
|
99
|
-
|
|
135
|
+
o().then((h) => {
|
|
136
|
+
a || (l = !0, L(h));
|
|
137
|
+
}).catch(() => {
|
|
138
|
+
a || (l = !0);
|
|
100
139
|
});
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
140
|
+
const y = v(s);
|
|
141
|
+
if (!y)
|
|
103
142
|
return () => {
|
|
104
|
-
|
|
143
|
+
a = !0;
|
|
105
144
|
};
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
145
|
+
const S = y.subscribe((h) => {
|
|
146
|
+
if (a || !l || h.error && !h.data)
|
|
108
147
|
return;
|
|
109
|
-
const
|
|
110
|
-
|
|
148
|
+
const p = h.data ?? null;
|
|
149
|
+
L(p);
|
|
111
150
|
});
|
|
112
151
|
return () => {
|
|
113
|
-
|
|
152
|
+
a = !0, S();
|
|
114
153
|
};
|
|
115
|
-
},
|
|
116
|
-
var
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
return
|
|
154
|
+
}, E = async (...c) => {
|
|
155
|
+
var l;
|
|
156
|
+
const a = await s.signOut(...c);
|
|
157
|
+
if (a && typeof a == "object" && "error" in a && a.error)
|
|
158
|
+
return a;
|
|
120
159
|
try {
|
|
121
|
-
await ((
|
|
160
|
+
await ((l = v(s)) == null ? void 0 : l.get().refetch());
|
|
122
161
|
} catch {
|
|
123
162
|
}
|
|
124
|
-
return
|
|
163
|
+
return a;
|
|
125
164
|
};
|
|
126
|
-
return new Proxy(
|
|
127
|
-
get(
|
|
128
|
-
return
|
|
165
|
+
return new Proxy(s, {
|
|
166
|
+
get(c, a, l) {
|
|
167
|
+
return a === "requireSession" ? u : a === "onSessionChange" ? w : a === "signOut" ? E : Reflect.get(c, a, l);
|
|
129
168
|
}
|
|
130
169
|
});
|
|
131
170
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
171
|
+
function we() {
|
|
172
|
+
return ae({ disableDefaultRedirectPlugin: !0 });
|
|
134
173
|
}
|
|
135
|
-
function k(
|
|
174
|
+
function k(s) {
|
|
136
175
|
const e = (() => {
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
139
|
-
const
|
|
140
|
-
if (!
|
|
141
|
-
throw new
|
|
176
|
+
if (s instanceof URL)
|
|
177
|
+
return s;
|
|
178
|
+
const t = s.trim();
|
|
179
|
+
if (!t)
|
|
180
|
+
throw new d("redirectTo must not be an empty string.");
|
|
142
181
|
try {
|
|
143
|
-
return new URL(
|
|
182
|
+
return new URL(t, window.location.href);
|
|
144
183
|
} catch {
|
|
145
|
-
throw new
|
|
146
|
-
`redirectTo must be a valid relative path or URL. Received: ${JSON.stringify(
|
|
184
|
+
throw new d(
|
|
185
|
+
`redirectTo must be a valid relative path or URL. Received: ${JSON.stringify(s)}`
|
|
147
186
|
);
|
|
148
187
|
}
|
|
149
188
|
})();
|
|
150
189
|
if (e.protocol !== "http:" && e.protocol !== "https:")
|
|
151
|
-
throw new
|
|
190
|
+
throw new d(
|
|
152
191
|
`redirectTo must resolve to an http(s) URL. Received protocol: ${e.protocol}`
|
|
153
192
|
);
|
|
154
193
|
return e;
|
|
155
194
|
}
|
|
156
|
-
function
|
|
195
|
+
function be(s, e) {
|
|
157
196
|
return e ? {
|
|
158
|
-
common: { ...
|
|
159
|
-
signIn: { ...
|
|
160
|
-
signUp: { ...
|
|
161
|
-
verifyEmail: { ...
|
|
162
|
-
forgotPassword: { ...
|
|
163
|
-
resetPassword: { ...
|
|
164
|
-
oauth: { ...
|
|
165
|
-
errors: { ...
|
|
166
|
-
} :
|
|
197
|
+
common: { ...s.common, ...e.common },
|
|
198
|
+
signIn: { ...s.signIn, ...e.signIn },
|
|
199
|
+
signUp: { ...s.signUp, ...e.signUp },
|
|
200
|
+
verifyEmail: { ...s.verifyEmail, ...e.verifyEmail },
|
|
201
|
+
forgotPassword: { ...s.forgotPassword, ...e.forgotPassword },
|
|
202
|
+
resetPassword: { ...s.resetPassword, ...e.resetPassword },
|
|
203
|
+
oauth: { ...s.oauth, ...e.oauth },
|
|
204
|
+
errors: { ...s.errors, ...e.errors }
|
|
205
|
+
} : s;
|
|
167
206
|
}
|
|
168
|
-
const
|
|
207
|
+
const U = {
|
|
169
208
|
common: {
|
|
170
209
|
loading: "Loading sign-in…",
|
|
171
210
|
redirecting: "Redirecting…",
|
|
@@ -228,7 +267,7 @@ const y = {
|
|
|
228
267
|
invalidCode: "Enter the 6-digit verification code.",
|
|
229
268
|
generic: "Something went wrong. Please try again."
|
|
230
269
|
}
|
|
231
|
-
},
|
|
270
|
+
}, M = {
|
|
232
271
|
common: {
|
|
233
272
|
loading: "加载中…",
|
|
234
273
|
redirecting: "跳转中…",
|
|
@@ -291,7 +330,7 @@ const y = {
|
|
|
291
330
|
invalidCode: "请输入 6 位验证码",
|
|
292
331
|
generic: "出现错误,请稍后重试"
|
|
293
332
|
}
|
|
294
|
-
},
|
|
333
|
+
}, W = {
|
|
295
334
|
common: {
|
|
296
335
|
loading: "サインインを読み込み中…",
|
|
297
336
|
redirecting: "リダイレクト中…",
|
|
@@ -354,7 +393,7 @@ const y = {
|
|
|
354
393
|
invalidCode: "6桁の認証コードを入力してください",
|
|
355
394
|
generic: "エラーが発生しました。もう一度お試しください"
|
|
356
395
|
}
|
|
357
|
-
},
|
|
396
|
+
}, j = {
|
|
358
397
|
common: {
|
|
359
398
|
loading: "로그인 로딩 중…",
|
|
360
399
|
redirecting: "리디렉션 중…",
|
|
@@ -417,7 +456,7 @@ const y = {
|
|
|
417
456
|
invalidCode: "6자리 인증 코드를 입력해 주세요",
|
|
418
457
|
generic: "문제가 발생했습니다. 다시 시도해 주세요"
|
|
419
458
|
}
|
|
420
|
-
},
|
|
459
|
+
}, O = {
|
|
421
460
|
common: {
|
|
422
461
|
loading: "Cargando inicio de sesión…",
|
|
423
462
|
redirecting: "Redirigiendo…",
|
|
@@ -480,7 +519,7 @@ const y = {
|
|
|
480
519
|
invalidCode: "Ingresa el código de verificación de 6 dígitos.",
|
|
481
520
|
generic: "Algo salió mal. Por favor, inténtalo de nuevo."
|
|
482
521
|
}
|
|
483
|
-
},
|
|
522
|
+
}, G = {
|
|
484
523
|
common: {
|
|
485
524
|
loading: "Carregando login…",
|
|
486
525
|
redirecting: "Redirecionando…",
|
|
@@ -543,7 +582,7 @@ const y = {
|
|
|
543
582
|
invalidCode: "Insira o código de verificação de 6 dígitos.",
|
|
544
583
|
generic: "Algo deu errado. Por favor, tente novamente."
|
|
545
584
|
}
|
|
546
|
-
},
|
|
585
|
+
}, Y = {
|
|
547
586
|
common: {
|
|
548
587
|
loading: "Chargement de la connexion…",
|
|
549
588
|
redirecting: "Redirection…",
|
|
@@ -606,7 +645,7 @@ const y = {
|
|
|
606
645
|
invalidCode: "Saisissez le code de vérification à 6 chiffres.",
|
|
607
646
|
generic: "Une erreur est survenue. Veuillez réessayer."
|
|
608
647
|
}
|
|
609
|
-
},
|
|
648
|
+
}, K = {
|
|
610
649
|
common: {
|
|
611
650
|
loading: "Anmeldung wird geladen…",
|
|
612
651
|
redirecting: "Weiterleitung…",
|
|
@@ -669,7 +708,7 @@ const y = {
|
|
|
669
708
|
invalidCode: "Geben Sie den 6-stelligen Bestätigungscode ein.",
|
|
670
709
|
generic: "Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut."
|
|
671
710
|
}
|
|
672
|
-
},
|
|
711
|
+
}, J = {
|
|
673
712
|
common: {
|
|
674
713
|
loading: "Caricamento accesso…",
|
|
675
714
|
redirecting: "Reindirizzamento…",
|
|
@@ -732,7 +771,7 @@ const y = {
|
|
|
732
771
|
invalidCode: "Inserisci il codice di verifica a 6 cifre.",
|
|
733
772
|
generic: "Qualcosa è andato storto. Riprova."
|
|
734
773
|
}
|
|
735
|
-
},
|
|
774
|
+
}, Z = {
|
|
736
775
|
common: {
|
|
737
776
|
loading: "Загрузка входа…",
|
|
738
777
|
redirecting: "Перенаправление…",
|
|
@@ -795,7 +834,7 @@ const y = {
|
|
|
795
834
|
invalidCode: "Введите 6-значный код подтверждения.",
|
|
796
835
|
generic: "Произошла ошибка. Пожалуйста, попробуйте снова."
|
|
797
836
|
}
|
|
798
|
-
},
|
|
837
|
+
}, Q = {
|
|
799
838
|
common: {
|
|
800
839
|
loading: "جارٍ تحميل تسجيل الدخول…",
|
|
801
840
|
redirecting: "جارٍ إعادة التوجيه…",
|
|
@@ -858,7 +897,7 @@ const y = {
|
|
|
858
897
|
invalidCode: "يرجى إدخال رمز التحقّق المكوّن من 6 أرقام.",
|
|
859
898
|
generic: "حدث خطأ. يرجى المحاولة مرة أخرى."
|
|
860
899
|
}
|
|
861
|
-
},
|
|
900
|
+
}, X = {
|
|
862
901
|
common: {
|
|
863
902
|
loading: "सधाइन की जुलातीअ लोड हो रही है…",
|
|
864
903
|
redirecting: "रीडायरेक्ट हो रहا है…",
|
|
@@ -921,61 +960,70 @@ const y = {
|
|
|
921
960
|
invalidCode: "कृपया 6 अंकों का सत्यापन कोड दर्ज करें।",
|
|
922
961
|
generic: "कुछ गलत हो गई। कृपया फिर से प्रयास करें।"
|
|
923
962
|
}
|
|
924
|
-
},
|
|
925
|
-
en:
|
|
926
|
-
"en-US":
|
|
927
|
-
zh:
|
|
928
|
-
"zh-CN":
|
|
929
|
-
"zh-TW":
|
|
930
|
-
ja:
|
|
931
|
-
"ja-JP":
|
|
932
|
-
ko:
|
|
933
|
-
"ko-KR":
|
|
934
|
-
es:
|
|
935
|
-
"es-ES":
|
|
936
|
-
"es-MX":
|
|
937
|
-
pt:
|
|
938
|
-
"pt-BR":
|
|
939
|
-
fr:
|
|
940
|
-
"fr-FR":
|
|
941
|
-
de:
|
|
942
|
-
"de-DE":
|
|
943
|
-
it:
|
|
944
|
-
"it-IT":
|
|
945
|
-
ru:
|
|
946
|
-
"ru-RU":
|
|
947
|
-
ar:
|
|
948
|
-
"ar-SA":
|
|
949
|
-
hi:
|
|
950
|
-
"hi-IN":
|
|
963
|
+
}, ee = {
|
|
964
|
+
en: U,
|
|
965
|
+
"en-US": U,
|
|
966
|
+
zh: M,
|
|
967
|
+
"zh-CN": M,
|
|
968
|
+
"zh-TW": M,
|
|
969
|
+
ja: W,
|
|
970
|
+
"ja-JP": W,
|
|
971
|
+
ko: j,
|
|
972
|
+
"ko-KR": j,
|
|
973
|
+
es: O,
|
|
974
|
+
"es-ES": O,
|
|
975
|
+
"es-MX": O,
|
|
976
|
+
pt: G,
|
|
977
|
+
"pt-BR": G,
|
|
978
|
+
fr: Y,
|
|
979
|
+
"fr-FR": Y,
|
|
980
|
+
de: K,
|
|
981
|
+
"de-DE": K,
|
|
982
|
+
it: J,
|
|
983
|
+
"it-IT": J,
|
|
984
|
+
ru: Z,
|
|
985
|
+
"ru-RU": Z,
|
|
986
|
+
ar: Q,
|
|
987
|
+
"ar-SA": Q,
|
|
988
|
+
hi: X,
|
|
989
|
+
"hi-IN": X
|
|
951
990
|
};
|
|
952
|
-
function
|
|
991
|
+
function pe() {
|
|
953
992
|
if (typeof navigator > "u")
|
|
954
|
-
return
|
|
955
|
-
const
|
|
956
|
-
for (const e of
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
993
|
+
return U;
|
|
994
|
+
const s = navigator.languages ?? [navigator.language];
|
|
995
|
+
for (const e of s) {
|
|
996
|
+
const t = ee[e] ?? ee[e.split("-")[0]];
|
|
997
|
+
if (t) return t;
|
|
959
998
|
}
|
|
960
|
-
return
|
|
999
|
+
return U;
|
|
961
1000
|
}
|
|
962
|
-
function
|
|
963
|
-
if (
|
|
964
|
-
return
|
|
965
|
-
if (typeof
|
|
966
|
-
const
|
|
967
|
-
return new
|
|
968
|
-
code:
|
|
969
|
-
status:
|
|
970
|
-
cause:
|
|
1001
|
+
function V(s, e = "Authentication failed.") {
|
|
1002
|
+
if (s instanceof m)
|
|
1003
|
+
return s;
|
|
1004
|
+
if (typeof s == "object" && s !== null) {
|
|
1005
|
+
const t = s;
|
|
1006
|
+
return new m(t.message || e, {
|
|
1007
|
+
code: t.code,
|
|
1008
|
+
status: t.status,
|
|
1009
|
+
cause: s
|
|
971
1010
|
});
|
|
972
1011
|
}
|
|
973
|
-
return typeof
|
|
1012
|
+
return typeof s == "string" ? new m(s) : new m(e, { cause: s });
|
|
974
1013
|
}
|
|
975
|
-
async function
|
|
976
|
-
var
|
|
977
|
-
const e = await
|
|
978
|
-
|
|
1014
|
+
async function _(s) {
|
|
1015
|
+
var t, i;
|
|
1016
|
+
const e = await s.getSession();
|
|
1017
|
+
if (e.error)
|
|
1018
|
+
throw new m(
|
|
1019
|
+
e.error.message || "Failed to load the current session.",
|
|
1020
|
+
{
|
|
1021
|
+
code: e.error.code ?? "SESSION_LOOKUP_FAILED",
|
|
1022
|
+
status: e.error.status,
|
|
1023
|
+
cause: e.error
|
|
1024
|
+
}
|
|
1025
|
+
);
|
|
1026
|
+
return (t = e.data) != null && t.user && ((i = e.data) != null && i.session) ? {
|
|
979
1027
|
user: e.data.user,
|
|
980
1028
|
session: e.data
|
|
981
1029
|
} : {
|
|
@@ -983,7 +1031,7 @@ async function j(t) {
|
|
|
983
1031
|
session: null
|
|
984
1032
|
};
|
|
985
1033
|
}
|
|
986
|
-
const
|
|
1034
|
+
const fe = "data-edgespark-auth", n = "edgespark-auth", F = "es_auth_completion", C = "es_auth_email", te = "oauth", T = "verify-sign-in", g = "verify-sign-up", se = 200, z = 2, N = {
|
|
987
1035
|
google: "Google",
|
|
988
1036
|
apple: "Apple",
|
|
989
1037
|
microsoft: "Microsoft",
|
|
@@ -991,24 +1039,24 @@ const ce = "data-edgespark-auth", n = "edgespark-auth", C = "es_auth_completion"
|
|
|
991
1039
|
gitlab: "GitLab",
|
|
992
1040
|
discord: "Discord"
|
|
993
1041
|
};
|
|
994
|
-
function
|
|
995
|
-
return "redirectTo" in
|
|
1042
|
+
function I(s) {
|
|
1043
|
+
return "redirectTo" in s;
|
|
996
1044
|
}
|
|
997
|
-
function
|
|
998
|
-
return "onSuccess" in
|
|
1045
|
+
function q(s) {
|
|
1046
|
+
return "onSuccess" in s && !("redirectTo" in s);
|
|
999
1047
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return !
|
|
1048
|
+
function D(s) {
|
|
1049
|
+
return !s || typeof s != "string" ? !1 : /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim());
|
|
1002
1050
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return /^\d{6}$/.test(
|
|
1051
|
+
function ge(s) {
|
|
1052
|
+
return /^\d{6}$/.test(s.trim());
|
|
1005
1053
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1054
|
+
function ve(s) {
|
|
1055
|
+
return s === "email" || s === "name" || s === "password" || s === "confirmPassword" || s === "code" || s === "newPassword";
|
|
1008
1056
|
}
|
|
1009
|
-
class
|
|
1010
|
-
constructor(e,
|
|
1011
|
-
if (this.container = e, this.auth =
|
|
1057
|
+
class Pe {
|
|
1058
|
+
constructor(e, t, i, r, o) {
|
|
1059
|
+
if (this.container = e, this.auth = t, this.options = i, this.loadConfig = r, this.runtimeOptions = o, this.state = {
|
|
1012
1060
|
view: "loading",
|
|
1013
1061
|
busy: !0,
|
|
1014
1062
|
busyLabel: void 0,
|
|
@@ -1021,27 +1069,27 @@ class me {
|
|
|
1021
1069
|
code: "",
|
|
1022
1070
|
newPassword: ""
|
|
1023
1071
|
}, this.destroyed = !1, this.terminalActionInProgress = !1, this.config = null, this.countdownUntil = null, this.countdownTimer = null, this.pendingFocusSnapshot = null, this.focusRestoreTimer = null, this.verificationCompletionAction = null, !(e instanceof HTMLElement))
|
|
1024
|
-
throw new
|
|
1025
|
-
this.labels =
|
|
1072
|
+
throw new d("authUI.mount(container, options) requires a real HTMLElement container.");
|
|
1073
|
+
this.labels = be(pe(), i.labels), this.root = document.createElement("div"), this.root.setAttribute(fe, ""), e.innerHTML = "", e.appendChild(this.root), this.render(), this.initialize();
|
|
1026
1074
|
}
|
|
1027
1075
|
destroy() {
|
|
1028
1076
|
this.destroyed || (this.destroyed = !0, this.clearCountdown(), this.clearFocusRestoreTimer(), this.container.innerHTML = "");
|
|
1029
1077
|
}
|
|
1030
1078
|
async initialize() {
|
|
1031
1079
|
try {
|
|
1032
|
-
const e = this.consumeManagedReturnContext(), [
|
|
1080
|
+
const e = this.consumeManagedReturnContext(), [t, i] = await Promise.all([
|
|
1033
1081
|
this.loadConfig(),
|
|
1034
|
-
|
|
1082
|
+
this.readMountSession(e)
|
|
1035
1083
|
]);
|
|
1036
1084
|
if (this.destroyed)
|
|
1037
1085
|
return;
|
|
1038
|
-
if (this.config =
|
|
1086
|
+
if (this.config = t, i.user && i.session) {
|
|
1039
1087
|
switch (e.marker) {
|
|
1040
|
-
case
|
|
1041
|
-
case
|
|
1088
|
+
case te:
|
|
1089
|
+
case T:
|
|
1042
1090
|
await this.completeAuth("sign-in", i);
|
|
1043
1091
|
return;
|
|
1044
|
-
case
|
|
1092
|
+
case g:
|
|
1045
1093
|
await this.completeAuth("sign-up", i);
|
|
1046
1094
|
return;
|
|
1047
1095
|
default:
|
|
@@ -1057,6 +1105,27 @@ class me {
|
|
|
1057
1105
|
this.handleError(e, "Failed to load the authentication UI.");
|
|
1058
1106
|
}
|
|
1059
1107
|
}
|
|
1108
|
+
async readMountSession(e) {
|
|
1109
|
+
if (!e.marker)
|
|
1110
|
+
return _(this.auth);
|
|
1111
|
+
let t = null;
|
|
1112
|
+
for (let i = 0; i <= z; i++) {
|
|
1113
|
+
try {
|
|
1114
|
+
const r = await _(this.auth);
|
|
1115
|
+
if (r.user && r.session)
|
|
1116
|
+
return r;
|
|
1117
|
+
} catch (r) {
|
|
1118
|
+
t = r;
|
|
1119
|
+
}
|
|
1120
|
+
i < z && await new Promise((r) => setTimeout(r, se));
|
|
1121
|
+
}
|
|
1122
|
+
if (t)
|
|
1123
|
+
throw t;
|
|
1124
|
+
return {
|
|
1125
|
+
user: null,
|
|
1126
|
+
session: null
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1060
1129
|
render() {
|
|
1061
1130
|
if (this.destroyed)
|
|
1062
1131
|
return;
|
|
@@ -1112,8 +1181,8 @@ class me {
|
|
|
1112
1181
|
}
|
|
1113
1182
|
}
|
|
1114
1183
|
renderSignInView() {
|
|
1115
|
-
var i,
|
|
1116
|
-
const e = this.renderOAuthProviders(),
|
|
1184
|
+
var i, r;
|
|
1185
|
+
const e = this.renderOAuthProviders(), t = ((i = this.config) == null ? void 0 : i.emailPasswordEnabled) ?? !0;
|
|
1117
1186
|
return `
|
|
1118
1187
|
<section class="${n}__section">
|
|
1119
1188
|
<header class="${n}__header">
|
|
@@ -1121,8 +1190,8 @@ class me {
|
|
|
1121
1190
|
<p class="${n}__copy">${this.escape(this.labels.signIn.subtitle)}</p>
|
|
1122
1191
|
</header>
|
|
1123
1192
|
${e}
|
|
1124
|
-
${e &&
|
|
1125
|
-
${
|
|
1193
|
+
${e && t ? `<div class="${n}__divider"><span>${this.escape(this.labels.oauth.dividerText)}</span></div>` : ""}
|
|
1194
|
+
${t ? `
|
|
1126
1195
|
<form class="${n}__form" data-view="sign-in" novalidate>
|
|
1127
1196
|
${this.renderInput("email", this.labels.signIn.emailLabel, "email", this.state.email, "email")}
|
|
1128
1197
|
${this.renderInput("password", this.labels.signIn.passwordLabel, "password", this.state.password, "current-password")}
|
|
@@ -1136,7 +1205,7 @@ class me {
|
|
|
1136
1205
|
${this.escape(this.labels.signIn.forgotPassword)}
|
|
1137
1206
|
</button>
|
|
1138
1207
|
` : ""}
|
|
1139
|
-
${(
|
|
1208
|
+
${(r = this.config) != null && r.disableSignUp ? "" : `
|
|
1140
1209
|
<p class="${n}__meta">
|
|
1141
1210
|
${this.escape(this.labels.signIn.signUpPrompt)}
|
|
1142
1211
|
<button class="${n}__link" type="button" data-action="switch-sign-up" ${this.state.busy ? "disabled" : ""}>
|
|
@@ -1251,48 +1320,48 @@ class me {
|
|
|
1251
1320
|
`;
|
|
1252
1321
|
}
|
|
1253
1322
|
renderOAuthProviders() {
|
|
1254
|
-
var
|
|
1255
|
-
const e = ((
|
|
1323
|
+
var t;
|
|
1324
|
+
const e = ((t = this.config) == null ? void 0 : t.oauthProviders) ?? [];
|
|
1256
1325
|
return e.length === 0 ? "" : `
|
|
1257
1326
|
<div class="${n}__stack">
|
|
1258
1327
|
${e.map((i) => `
|
|
1259
1328
|
<button class="${n}__button ${n}__button--secondary" type="button" data-action="oauth" data-provider="${i}" ${this.state.busy ? "disabled" : ""}>
|
|
1260
|
-
${this.escape(`${this.labels.oauth.continueWith} ${
|
|
1329
|
+
${this.escape(`${this.labels.oauth.continueWith} ${N[i]}`)}
|
|
1261
1330
|
</button>
|
|
1262
1331
|
`).join("")}
|
|
1263
1332
|
</div>
|
|
1264
1333
|
`;
|
|
1265
1334
|
}
|
|
1266
|
-
renderInput(e,
|
|
1335
|
+
renderInput(e, t, i, r, o) {
|
|
1267
1336
|
return `
|
|
1268
1337
|
<label class="${n}__field">
|
|
1269
|
-
<span class="${n}__label">${this.escape(
|
|
1338
|
+
<span class="${n}__label">${this.escape(t)}</span>
|
|
1270
1339
|
<input
|
|
1271
1340
|
class="${n}__input"
|
|
1272
1341
|
name="${this.escape(e)}"
|
|
1273
1342
|
type="${this.escape(i)}"
|
|
1274
|
-
value="${this.escape(
|
|
1275
|
-
autocomplete="${this.escape(
|
|
1343
|
+
value="${this.escape(r)}"
|
|
1344
|
+
autocomplete="${this.escape(o)}"
|
|
1276
1345
|
${this.state.busy ? "disabled" : ""}
|
|
1277
1346
|
/>
|
|
1278
1347
|
</label>
|
|
1279
1348
|
`;
|
|
1280
1349
|
}
|
|
1281
1350
|
bindDOM() {
|
|
1282
|
-
this.root.querySelectorAll("form[data-view]").forEach((
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1351
|
+
this.root.querySelectorAll("form[data-view]").forEach((r) => {
|
|
1352
|
+
r.addEventListener("submit", (o) => {
|
|
1353
|
+
o.preventDefault();
|
|
1354
|
+
const u = r.dataset.view;
|
|
1355
|
+
u === "sign-in" && this.handleSignIn(), u === "sign-up" && this.handleSignUp(), u === "forgot-password" && this.handleForgotPassword(), u === "reset-password" && this.handleResetPassword();
|
|
1287
1356
|
});
|
|
1288
|
-
}), this.root.querySelectorAll("input[name]").forEach((
|
|
1289
|
-
|
|
1290
|
-
|
|
1357
|
+
}), this.root.querySelectorAll("input[name]").forEach((r) => {
|
|
1358
|
+
r.addEventListener("input", () => {
|
|
1359
|
+
ve(r.name) && (this.state[r.name] = r.value);
|
|
1291
1360
|
});
|
|
1292
|
-
}), this.root.querySelectorAll("[data-action]").forEach((
|
|
1293
|
-
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1361
|
+
}), this.root.querySelectorAll("[data-action]").forEach((r) => {
|
|
1362
|
+
r.addEventListener("click", () => {
|
|
1363
|
+
const o = r.dataset.action;
|
|
1364
|
+
o === "switch-sign-up" && this.switchView("sign-up"), o === "switch-sign-in" && this.switchView("sign-in"), o === "forgot-password" && this.switchView("forgot-password"), o === "resend-verification" && this.resendVerificationEmail(), o === "use-different-email" && this.switchView(this.verificationCompletionAction === "sign-in" ? "sign-in" : "sign-up"), o === "resend-reset-code" && this.resendResetCode(), o === "oauth" && this.handleOAuthSignIn(r.dataset.provider);
|
|
1296
1365
|
});
|
|
1297
1366
|
});
|
|
1298
1367
|
}
|
|
@@ -1300,7 +1369,7 @@ class me {
|
|
|
1300
1369
|
this.clearCountdown(), e !== "verify-email" && (this.verificationCompletionAction = null), this.state.view = e, this.state.error = null, this.state.notice = null, this.state.busy = !1, this.state.busyLabel = void 0, this.terminalActionInProgress = !1, this.render();
|
|
1301
1370
|
}
|
|
1302
1371
|
async handleSignIn() {
|
|
1303
|
-
if (
|
|
1372
|
+
if (!D(this.state.email)) {
|
|
1304
1373
|
this.failValidation(this.labels.errors.invalidEmail);
|
|
1305
1374
|
return;
|
|
1306
1375
|
}
|
|
@@ -1312,7 +1381,7 @@ class me {
|
|
|
1312
1381
|
const e = await this.auth.signIn.email({
|
|
1313
1382
|
email: this.state.email.trim(),
|
|
1314
1383
|
password: this.state.password,
|
|
1315
|
-
callbackURL: this.getManagedReturnURL(
|
|
1384
|
+
callbackURL: this.getManagedReturnURL(T, this.state.email.trim())
|
|
1316
1385
|
});
|
|
1317
1386
|
if (e.error)
|
|
1318
1387
|
throw e.error;
|
|
@@ -1320,12 +1389,12 @@ class me {
|
|
|
1320
1389
|
});
|
|
1321
1390
|
}
|
|
1322
1391
|
async handleSignUp() {
|
|
1323
|
-
var e,
|
|
1392
|
+
var e, t;
|
|
1324
1393
|
if (!this.state.name.trim()) {
|
|
1325
1394
|
this.failValidation(this.labels.errors.requiredField);
|
|
1326
1395
|
return;
|
|
1327
1396
|
}
|
|
1328
|
-
if (
|
|
1397
|
+
if (!D(this.state.email)) {
|
|
1329
1398
|
this.failValidation(this.labels.errors.invalidEmail);
|
|
1330
1399
|
return;
|
|
1331
1400
|
}
|
|
@@ -1335,7 +1404,7 @@ class me {
|
|
|
1335
1404
|
}
|
|
1336
1405
|
if (this.state.password.length < (((e = this.config) == null ? void 0 : e.minPasswordLength) ?? 8)) {
|
|
1337
1406
|
this.failValidation(
|
|
1338
|
-
this.labels.errors.passwordTooShort.replace("{min}", String(((
|
|
1407
|
+
this.labels.errors.passwordTooShort.replace("{min}", String(((t = this.config) == null ? void 0 : t.minPasswordLength) ?? 8))
|
|
1339
1408
|
);
|
|
1340
1409
|
return;
|
|
1341
1410
|
}
|
|
@@ -1344,16 +1413,16 @@ class me {
|
|
|
1344
1413
|
return;
|
|
1345
1414
|
}
|
|
1346
1415
|
await this.runAction("Creating account…", async () => {
|
|
1347
|
-
var
|
|
1416
|
+
var r;
|
|
1348
1417
|
const i = await this.auth.signUp.email({
|
|
1349
1418
|
name: this.state.name.trim(),
|
|
1350
1419
|
email: this.state.email.trim(),
|
|
1351
1420
|
password: this.state.password,
|
|
1352
|
-
callbackURL: this.getManagedReturnURL(
|
|
1421
|
+
callbackURL: this.getManagedReturnURL(g, this.state.email.trim())
|
|
1353
1422
|
});
|
|
1354
1423
|
if (i.error)
|
|
1355
1424
|
throw i.error;
|
|
1356
|
-
if ((
|
|
1425
|
+
if ((r = this.config) != null && r.requireEmailVerification) {
|
|
1357
1426
|
this.verificationCompletionAction = "sign-up", this.state.view = "verify-email", this.state.notice = "Check your inbox to verify your email address.", this.startCountdown();
|
|
1358
1427
|
return;
|
|
1359
1428
|
}
|
|
@@ -1361,28 +1430,28 @@ class me {
|
|
|
1361
1430
|
});
|
|
1362
1431
|
}
|
|
1363
1432
|
async handleOAuthSignIn(e) {
|
|
1364
|
-
await this.runAction(`Redirecting to ${
|
|
1365
|
-
const
|
|
1433
|
+
await this.runAction(`Redirecting to ${N[e]}…`, async () => {
|
|
1434
|
+
const t = await this.auth.signIn.social({
|
|
1366
1435
|
provider: e,
|
|
1367
1436
|
callbackURL: this.getManagedReturnURL("oauth"),
|
|
1368
1437
|
errorCallbackURL: this.getManagedReturnURL("oauth")
|
|
1369
1438
|
});
|
|
1370
|
-
if (
|
|
1371
|
-
throw
|
|
1372
|
-
const i = this.extractRedirectURL(
|
|
1439
|
+
if (t.error)
|
|
1440
|
+
throw t.error;
|
|
1441
|
+
const i = this.extractRedirectURL(t.data);
|
|
1373
1442
|
if (!i)
|
|
1374
|
-
throw new
|
|
1375
|
-
this.terminalActionInProgress = !0, this.state.busy = !0, this.state.busyLabel = `Opening ${
|
|
1443
|
+
throw new d(`OAuth sign-in did not return a redirect URL for provider "${e}".`);
|
|
1444
|
+
this.terminalActionInProgress = !0, this.state.busy = !0, this.state.busyLabel = `Opening ${N[e]}…`, this.state.error = null, this.state.notice = null, this.render(), window.location.assign(i);
|
|
1376
1445
|
});
|
|
1377
1446
|
}
|
|
1378
1447
|
async handleForgotPassword() {
|
|
1379
1448
|
if (!this.canUsePasswordResetEmailOtp()) {
|
|
1380
1449
|
this.handleError(
|
|
1381
|
-
new
|
|
1450
|
+
new d("Password reset via email OTP is not enabled for this project.")
|
|
1382
1451
|
);
|
|
1383
1452
|
return;
|
|
1384
1453
|
}
|
|
1385
|
-
if (
|
|
1454
|
+
if (!D(this.state.email)) {
|
|
1386
1455
|
this.failValidation(this.labels.errors.invalidEmail);
|
|
1387
1456
|
return;
|
|
1388
1457
|
}
|
|
@@ -1399,13 +1468,14 @@ class me {
|
|
|
1399
1468
|
this.isCountdownActive() || await this.handleForgotPassword();
|
|
1400
1469
|
}
|
|
1401
1470
|
async handleResetPassword() {
|
|
1471
|
+
var e, t;
|
|
1402
1472
|
if (!this.canUsePasswordResetEmailOtp()) {
|
|
1403
1473
|
this.handleError(
|
|
1404
|
-
new
|
|
1474
|
+
new d("Password reset via email OTP is not enabled for this project.")
|
|
1405
1475
|
);
|
|
1406
1476
|
return;
|
|
1407
1477
|
}
|
|
1408
|
-
if (!
|
|
1478
|
+
if (!ge(this.state.code)) {
|
|
1409
1479
|
this.failValidation(this.labels.errors.invalidCode);
|
|
1410
1480
|
return;
|
|
1411
1481
|
}
|
|
@@ -1413,18 +1483,24 @@ class me {
|
|
|
1413
1483
|
this.failValidation(this.labels.errors.requiredField);
|
|
1414
1484
|
return;
|
|
1415
1485
|
}
|
|
1486
|
+
if (this.state.newPassword.length < (((e = this.config) == null ? void 0 : e.minPasswordLength) ?? 8)) {
|
|
1487
|
+
this.failValidation(
|
|
1488
|
+
this.labels.errors.passwordTooShort.replace("{min}", String(((t = this.config) == null ? void 0 : t.minPasswordLength) ?? 8))
|
|
1489
|
+
);
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1416
1492
|
if (this.state.newPassword !== this.state.confirmPassword) {
|
|
1417
1493
|
this.failValidation(this.labels.errors.passwordMismatch);
|
|
1418
1494
|
return;
|
|
1419
1495
|
}
|
|
1420
1496
|
await this.runAction("Updating password…", async () => {
|
|
1421
|
-
const
|
|
1497
|
+
const i = await this.passwordResetEndpoints().emailOtp.resetPassword({
|
|
1422
1498
|
email: this.state.email.trim(),
|
|
1423
1499
|
otp: this.state.code.trim(),
|
|
1424
1500
|
password: this.state.newPassword
|
|
1425
1501
|
});
|
|
1426
|
-
if (
|
|
1427
|
-
throw
|
|
1502
|
+
if (i.error)
|
|
1503
|
+
throw i.error;
|
|
1428
1504
|
await this.completePasswordReset();
|
|
1429
1505
|
});
|
|
1430
1506
|
}
|
|
@@ -1433,74 +1509,118 @@ class me {
|
|
|
1433
1509
|
}
|
|
1434
1510
|
async sendVerificationEmail(e) {
|
|
1435
1511
|
!e && this.isCountdownActive() || await this.runAction("Sending verification email…", async () => {
|
|
1436
|
-
const
|
|
1512
|
+
const t = await this.auth.sendVerificationEmail({
|
|
1437
1513
|
email: this.state.email.trim(),
|
|
1438
1514
|
callbackURL: this.getManagedReturnURL(
|
|
1439
|
-
this.verificationCompletionAction === "sign-up" ?
|
|
1515
|
+
this.verificationCompletionAction === "sign-up" ? g : T,
|
|
1440
1516
|
this.state.email.trim()
|
|
1441
1517
|
)
|
|
1442
1518
|
});
|
|
1443
|
-
if (
|
|
1444
|
-
throw
|
|
1519
|
+
if (t.error)
|
|
1520
|
+
throw t.error;
|
|
1445
1521
|
this.handleVerificationEmailSent(this.state.email.trim(), !0);
|
|
1446
1522
|
});
|
|
1447
1523
|
}
|
|
1448
|
-
async completeAuth(e,
|
|
1449
|
-
|
|
1450
|
-
|
|
1524
|
+
async completeAuth(e, t) {
|
|
1525
|
+
const i = await this.retryAuthCompletionDataIfNeeded(
|
|
1526
|
+
t ?? await this.resolveAuthCompletionData()
|
|
1527
|
+
);
|
|
1451
1528
|
if (!i.user || !i.session) {
|
|
1529
|
+
if (i.lookupError && I(this.options)) {
|
|
1530
|
+
this.terminalActionInProgress = !0, this.state.busy = !0, this.state.busyLabel = this.labels.common.redirecting, this.state.error = null, this.state.notice = null, this.render(), window.location.assign(k(this.options.redirectTo).toString());
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1452
1533
|
if (e === "sign-in")
|
|
1453
|
-
throw new
|
|
1534
|
+
throw i.lookupError ?? new ne(
|
|
1535
|
+
"Managed sign-in completed without an authenticated session."
|
|
1536
|
+
);
|
|
1454
1537
|
this.state.view = "sign-in", this.state.password = "", this.state.confirmPassword = "", this.state.error = null, this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = "Account created. Sign in to continue.", this.render();
|
|
1455
1538
|
return;
|
|
1456
1539
|
}
|
|
1457
|
-
const
|
|
1540
|
+
const r = {
|
|
1458
1541
|
action: e,
|
|
1459
1542
|
user: i.user,
|
|
1460
1543
|
session: i.session
|
|
1461
1544
|
};
|
|
1462
|
-
if (await
|
|
1463
|
-
this.terminalActionInProgress = !0, this.invokeRedirectModeSuccessHook(
|
|
1545
|
+
if (await this.syncPublicSessionBestEffort(), I(this.options)) {
|
|
1546
|
+
this.terminalActionInProgress = !0, this.invokeRedirectModeSuccessHook(r), this.state.busy = !0, this.state.busyLabel = this.labels.common.redirecting, this.state.error = null, this.state.notice = null, this.render(), window.location.assign(k(this.options.redirectTo).toString());
|
|
1464
1547
|
return;
|
|
1465
1548
|
}
|
|
1466
|
-
if (
|
|
1467
|
-
this.destroy(), this.options.onSuccess(
|
|
1549
|
+
if (q(this.options)) {
|
|
1550
|
+
this.destroy(), this.options.onSuccess(r);
|
|
1468
1551
|
return;
|
|
1469
1552
|
}
|
|
1470
1553
|
}
|
|
1471
|
-
async
|
|
1472
|
-
|
|
1554
|
+
async retryAuthCompletionDataIfNeeded(e) {
|
|
1555
|
+
if (e.session)
|
|
1556
|
+
return e;
|
|
1557
|
+
let t = e.lookupError;
|
|
1558
|
+
for (let i = 0; i < z; i++) {
|
|
1559
|
+
await new Promise((r) => setTimeout(r, se));
|
|
1560
|
+
try {
|
|
1561
|
+
const r = await _(this.auth);
|
|
1562
|
+
if (r.user && r.session)
|
|
1563
|
+
return {
|
|
1564
|
+
user: r.user,
|
|
1565
|
+
session: r.session
|
|
1566
|
+
};
|
|
1567
|
+
} catch (r) {
|
|
1568
|
+
t = r;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1473
1571
|
return {
|
|
1474
|
-
|
|
1475
|
-
|
|
1572
|
+
...e,
|
|
1573
|
+
lookupError: t ?? e.lookupError
|
|
1476
1574
|
};
|
|
1477
1575
|
}
|
|
1576
|
+
async syncPublicSessionBestEffort() {
|
|
1577
|
+
var e, t;
|
|
1578
|
+
try {
|
|
1579
|
+
await ((t = (e = this.runtimeOptions) == null ? void 0 : e.syncPublicSession) == null ? void 0 : t.call(e));
|
|
1580
|
+
} catch {
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
async resolveAuthCompletionData(e) {
|
|
1584
|
+
try {
|
|
1585
|
+
const t = await _(this.auth), i = this.extractUser(e);
|
|
1586
|
+
return {
|
|
1587
|
+
user: t.user ?? i,
|
|
1588
|
+
session: t.session
|
|
1589
|
+
};
|
|
1590
|
+
} catch (t) {
|
|
1591
|
+
return {
|
|
1592
|
+
user: this.extractUser(e),
|
|
1593
|
+
session: null,
|
|
1594
|
+
lookupError: t
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1478
1598
|
async completePasswordReset() {
|
|
1479
1599
|
const e = {
|
|
1480
1600
|
action: "password-reset",
|
|
1481
1601
|
user: null,
|
|
1482
1602
|
session: null
|
|
1483
1603
|
};
|
|
1484
|
-
if (
|
|
1604
|
+
if (q(this.options)) {
|
|
1485
1605
|
this.destroy(), this.options.onSuccess(e);
|
|
1486
1606
|
return;
|
|
1487
1607
|
}
|
|
1488
1608
|
this.invokeRedirectModeSuccessHook(e), this.clearCountdown(), this.state.view = "sign-in", this.state.password = "", this.state.confirmPassword = "", this.state.newPassword = "", this.state.code = "", this.state.busy = !1, this.state.busyLabel = void 0, this.state.error = null, this.state.notice = "Password updated. Sign in with your new password.", this.render();
|
|
1489
1609
|
}
|
|
1490
1610
|
handleExistingSessionOnMount(e) {
|
|
1491
|
-
if (
|
|
1611
|
+
if (I(this.options)) {
|
|
1492
1612
|
this.terminalActionInProgress = !0, this.state.busy = !0, this.state.busyLabel = this.labels.common.redirecting, this.state.error = null, this.state.notice = null, this.render(), window.location.assign(k(this.options.redirectTo).toString());
|
|
1493
1613
|
return;
|
|
1494
1614
|
}
|
|
1495
|
-
if (
|
|
1496
|
-
throw this.state.view = "sign-in", this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = null, new
|
|
1615
|
+
if (q(this.options))
|
|
1616
|
+
throw this.state.view = "sign-in", this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = null, new d(
|
|
1497
1617
|
"authUI.mount(container, { onSuccess }) cannot run while a session already exists. Check es.auth.getSession() before mounting controlled auth UI."
|
|
1498
1618
|
);
|
|
1499
1619
|
}
|
|
1500
|
-
async runAction(e,
|
|
1620
|
+
async runAction(e, t) {
|
|
1501
1621
|
this.state.busy = !0, this.state.busyLabel = e, this.state.error = null, this.state.notice = null, this.render();
|
|
1502
1622
|
try {
|
|
1503
|
-
await
|
|
1623
|
+
await t();
|
|
1504
1624
|
} catch (i) {
|
|
1505
1625
|
if (this.maybeHandleVerificationRequired(i))
|
|
1506
1626
|
return;
|
|
@@ -1510,45 +1630,45 @@ class me {
|
|
|
1510
1630
|
!this.destroyed && !this.terminalActionInProgress && (this.state.busy = !1, this.state.busyLabel = void 0, this.render());
|
|
1511
1631
|
}
|
|
1512
1632
|
maybeHandleVerificationRequired(e) {
|
|
1513
|
-
return
|
|
1633
|
+
return V(e).code !== "EMAIL_NOT_VERIFIED" ? !1 : (this.verificationCompletionAction = "sign-in", this.state.view = "verify-email", this.state.busy = !1, this.state.busyLabel = void 0, this.state.error = null, this.state.notice = `Verify your email to finish signing in as ${this.state.email.trim()}.`, this.render(), this.sendVerificationEmail(!0), !0);
|
|
1514
1634
|
}
|
|
1515
|
-
handleVerificationEmailSent(e,
|
|
1516
|
-
this.state.notice =
|
|
1635
|
+
handleVerificationEmailSent(e, t) {
|
|
1636
|
+
this.state.notice = t ? `We sent another verification email to ${e}.` : `We sent a verification email to ${e}.`, this.startCountdown();
|
|
1517
1637
|
}
|
|
1518
1638
|
invokeRedirectModeSuccessHook(e) {
|
|
1519
|
-
var
|
|
1520
|
-
if (!(!
|
|
1639
|
+
var t, i;
|
|
1640
|
+
if (!(!I(this.options) || !this.options.onSuccess))
|
|
1521
1641
|
try {
|
|
1522
1642
|
this.options.onSuccess(e);
|
|
1523
|
-
} catch (
|
|
1524
|
-
const
|
|
1643
|
+
} catch (r) {
|
|
1644
|
+
const o = V(r, "Post-auth callback failed.");
|
|
1525
1645
|
try {
|
|
1526
|
-
(i = (
|
|
1646
|
+
(i = (t = this.options).onError) == null || i.call(t, o);
|
|
1527
1647
|
} catch {
|
|
1528
1648
|
}
|
|
1529
1649
|
}
|
|
1530
1650
|
}
|
|
1531
|
-
handleError(e,
|
|
1532
|
-
var
|
|
1533
|
-
const i =
|
|
1534
|
-
this.state.busy = !1, this.state.busyLabel = void 0, this.state.error = i.message, this.render(), (
|
|
1651
|
+
handleError(e, t) {
|
|
1652
|
+
var r, o;
|
|
1653
|
+
const i = V(e, t);
|
|
1654
|
+
this.state.busy = !1, this.state.busyLabel = void 0, this.state.error = i.message, this.render(), (o = (r = this.options).onError) == null || o.call(r, i);
|
|
1535
1655
|
}
|
|
1536
1656
|
failValidation(e) {
|
|
1537
1657
|
this.state.error = e, this.state.notice = null, this.render();
|
|
1538
1658
|
}
|
|
1539
|
-
getManagedReturnURL(e,
|
|
1659
|
+
getManagedReturnURL(e, t) {
|
|
1540
1660
|
if (!e)
|
|
1541
1661
|
return window.location.href;
|
|
1542
1662
|
const i = new URL(window.location.href);
|
|
1543
|
-
return i.searchParams.set(
|
|
1663
|
+
return i.searchParams.set(F, e), t ? i.searchParams.set(C, t) : i.searchParams.delete(C), i.toString();
|
|
1544
1664
|
}
|
|
1545
1665
|
consumeManagedReturnContext() {
|
|
1546
|
-
const e = new URL(window.location.href),
|
|
1547
|
-
return (
|
|
1548
|
-
marker:
|
|
1666
|
+
const e = new URL(window.location.href), t = e.searchParams.get(F), i = e.searchParams.get(C), r = t ? e.searchParams.get("error") : null, o = t ? e.searchParams.get("error_description") : null;
|
|
1667
|
+
return (t || i) && (e.searchParams.delete(F), e.searchParams.delete(C), t && (e.searchParams.delete("error"), e.searchParams.delete("error_description")), window.history.replaceState(null, "", e.toString())), {
|
|
1668
|
+
marker: t,
|
|
1549
1669
|
email: i,
|
|
1550
|
-
error:
|
|
1551
|
-
errorDescription:
|
|
1670
|
+
error: r,
|
|
1671
|
+
errorDescription: o
|
|
1552
1672
|
};
|
|
1553
1673
|
}
|
|
1554
1674
|
startCountdown(e = 60) {
|
|
@@ -1576,14 +1696,14 @@ class me {
|
|
|
1576
1696
|
this.pendingFocusSnapshot && (this.clearFocusRestoreTimer(), this.focusRestoreTimer = window.setTimeout(() => {
|
|
1577
1697
|
if (this.focusRestoreTimer = null, this.destroyed || !this.pendingFocusSnapshot)
|
|
1578
1698
|
return;
|
|
1579
|
-
const e = this.pendingFocusSnapshot,
|
|
1699
|
+
const e = this.pendingFocusSnapshot, t = `input[name="${this.escape(e.name)}"][type="${this.escape(e.type)}"]`, i = this.root.querySelector(t);
|
|
1580
1700
|
if (!(!i || i.disabled)) {
|
|
1581
1701
|
if (i.focus(), e.selectionStart !== null && e.selectionEnd !== null)
|
|
1582
1702
|
try {
|
|
1583
1703
|
i.setSelectionRange(e.selectionStart, e.selectionEnd);
|
|
1584
1704
|
} catch {
|
|
1585
|
-
const
|
|
1586
|
-
i.setSelectionRange(
|
|
1705
|
+
const r = i.value.length;
|
|
1706
|
+
i.setSelectionRange(r, r);
|
|
1587
1707
|
}
|
|
1588
1708
|
this.pendingFocusSnapshot = null;
|
|
1589
1709
|
}
|
|
@@ -1598,24 +1718,24 @@ class me {
|
|
|
1598
1718
|
extractRedirectURL(e) {
|
|
1599
1719
|
if (!e || typeof e != "object")
|
|
1600
1720
|
return null;
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1721
|
+
const t = e;
|
|
1722
|
+
return t.redirect && typeof t.url == "string" && t.url.length > 0 ? t.url : null;
|
|
1603
1723
|
}
|
|
1604
1724
|
extractUser(e) {
|
|
1605
1725
|
if (!e || typeof e != "object")
|
|
1606
1726
|
return null;
|
|
1607
|
-
const
|
|
1608
|
-
return
|
|
1727
|
+
const t = e;
|
|
1728
|
+
return t.user && typeof t.user == "object" ? t.user : null;
|
|
1609
1729
|
}
|
|
1610
1730
|
canUsePasswordResetEmailOtp() {
|
|
1611
1731
|
var e;
|
|
1612
1732
|
return !!((e = this.config) != null && e.passwordResetEmailOtpEnabled);
|
|
1613
1733
|
}
|
|
1614
1734
|
handleSessionlessManagedReturn(e) {
|
|
1615
|
-
return e.email && (this.state.email = e.email), e.marker ===
|
|
1735
|
+
return e.email && (this.state.email = e.email), e.marker === g && !e.error ? (this.verificationCompletionAction = null, this.clearCountdown(), this.state.view = "sign-in", this.state.password = "", this.state.confirmPassword = "", this.state.error = null, this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = "Account created. Sign in to continue.", this.render(), !0) : e.marker === T || e.marker === g ? (this.verificationCompletionAction = e.marker === g ? "sign-up" : "sign-in", this.state.view = "verify-email", this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = null, e.error || e.errorDescription ? this.handleError(new m(
|
|
1616
1736
|
e.errorDescription ?? "Verification failed. Request a new verification email and try again.",
|
|
1617
1737
|
{ code: e.error ?? "VERIFY_EMAIL_ERROR" }
|
|
1618
|
-
)) : this.render(), !0) : e.marker ===
|
|
1738
|
+
)) : this.render(), !0) : e.marker === te && (e.error || e.errorDescription) ? (this.state.view = "sign-in", this.state.busy = !1, this.state.busyLabel = void 0, this.state.notice = null, this.handleError(new m(
|
|
1619
1739
|
e.errorDescription ?? "OAuth sign-in failed.",
|
|
1620
1740
|
{ code: e.error ?? "OAUTH_ERROR" }
|
|
1621
1741
|
)), !0) : !1;
|
|
@@ -1626,136 +1746,136 @@ class me {
|
|
|
1626
1746
|
getCountdownSecondsRemaining() {
|
|
1627
1747
|
return this.countdownUntil ? Math.max(0, Math.ceil((this.countdownUntil - Date.now()) / 1e3)) : 0;
|
|
1628
1748
|
}
|
|
1629
|
-
countdownText(e,
|
|
1749
|
+
countdownText(e, t) {
|
|
1630
1750
|
const i = this.getCountdownSecondsRemaining();
|
|
1631
|
-
return i <= 0 ? e :
|
|
1751
|
+
return i <= 0 ? e : t.replace("{seconds}", String(i));
|
|
1632
1752
|
}
|
|
1633
1753
|
escape(e) {
|
|
1634
1754
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1635
1755
|
}
|
|
1636
1756
|
}
|
|
1637
|
-
function
|
|
1638
|
-
return "data" in
|
|
1757
|
+
function Le(s) {
|
|
1758
|
+
return "data" in s && s.data ? s.data : s;
|
|
1639
1759
|
}
|
|
1640
|
-
const
|
|
1760
|
+
const ye = [
|
|
1641
1761
|
{ id: "google", key: "providerGoogle" },
|
|
1642
1762
|
{ id: "apple", key: "providerApple" },
|
|
1643
1763
|
{ id: "microsoft", key: "providerMicrosoft" },
|
|
1644
1764
|
{ id: "github", key: "providerGithub" },
|
|
1645
1765
|
{ id: "gitlab", key: "providerGitlab" },
|
|
1646
1766
|
{ id: "discord", key: "providerDiscord" }
|
|
1647
|
-
],
|
|
1648
|
-
async function
|
|
1649
|
-
const
|
|
1767
|
+
], ie = 2, Ee = 500;
|
|
1768
|
+
async function Se() {
|
|
1769
|
+
const s = `${window.location.origin}${oe}/config`;
|
|
1650
1770
|
let e;
|
|
1651
|
-
for (let
|
|
1771
|
+
for (let t = 0; t <= ie; t++)
|
|
1652
1772
|
try {
|
|
1653
|
-
const i = await fetch(
|
|
1773
|
+
const i = await fetch(s, { method: "GET", credentials: "include" });
|
|
1654
1774
|
if (!i.ok)
|
|
1655
|
-
throw new
|
|
1656
|
-
const
|
|
1657
|
-
return
|
|
1775
|
+
throw new d(`Failed to load auth config: HTTP ${i.status}`);
|
|
1776
|
+
const r = await i.json();
|
|
1777
|
+
return Ce(Le(r));
|
|
1658
1778
|
} catch (i) {
|
|
1659
|
-
e = i,
|
|
1779
|
+
e = i, t < ie && await new Promise((r) => setTimeout(r, Ee));
|
|
1660
1780
|
}
|
|
1661
1781
|
throw e;
|
|
1662
1782
|
}
|
|
1663
|
-
let
|
|
1664
|
-
async function
|
|
1665
|
-
return
|
|
1666
|
-
throw
|
|
1667
|
-
})),
|
|
1783
|
+
let R = null;
|
|
1784
|
+
async function _e() {
|
|
1785
|
+
return R || (R = Se().catch((s) => {
|
|
1786
|
+
throw R = null, s;
|
|
1787
|
+
})), R;
|
|
1668
1788
|
}
|
|
1669
|
-
function
|
|
1670
|
-
var
|
|
1671
|
-
const e =
|
|
1672
|
-
const
|
|
1673
|
-
return typeof
|
|
1674
|
-
}).map(({ id:
|
|
1789
|
+
function Ce(s) {
|
|
1790
|
+
var t, i, r, o, u, w, E;
|
|
1791
|
+
const e = ye.filter(({ key: c }) => {
|
|
1792
|
+
const a = s[c];
|
|
1793
|
+
return typeof a == "object" && a !== null && "enabled" in a && !!a.enabled;
|
|
1794
|
+
}).map(({ id: c }) => c);
|
|
1675
1795
|
return {
|
|
1676
|
-
disableSignUp: !!
|
|
1677
|
-
emailPasswordEnabled: !!((
|
|
1678
|
-
minPasswordLength: ((
|
|
1679
|
-
requireEmailVerification: !!((
|
|
1680
|
-
passwordResetEmailOtpEnabled: !!((
|
|
1796
|
+
disableSignUp: !!s.disableSignUp,
|
|
1797
|
+
emailPasswordEnabled: !!((t = s.providerEmailPassword) != null && t.enabled),
|
|
1798
|
+
minPasswordLength: ((r = (i = s.providerEmailPassword) == null ? void 0 : i.config) == null ? void 0 : r.minPasswordLength) ?? 8,
|
|
1799
|
+
requireEmailVerification: !!((u = (o = s.providerEmailPassword) == null ? void 0 : o.config) != null && u.requireEmailVerification),
|
|
1800
|
+
passwordResetEmailOtpEnabled: !!((E = (w = s.providerEmailPassword) == null ? void 0 : w.config) != null && E.requirePasswordResetEmailVerification),
|
|
1681
1801
|
oauthProviders: e
|
|
1682
1802
|
};
|
|
1683
1803
|
}
|
|
1684
|
-
const
|
|
1685
|
-
function
|
|
1686
|
-
if (!
|
|
1687
|
-
throw new
|
|
1804
|
+
const $ = /* @__PURE__ */ new WeakMap();
|
|
1805
|
+
function Te(s) {
|
|
1806
|
+
if (!s)
|
|
1807
|
+
throw new d(
|
|
1688
1808
|
"authUI.mount(container, options) requires either { redirectTo } or { onSuccess }."
|
|
1689
1809
|
);
|
|
1690
|
-
const e = "redirectTo" in
|
|
1691
|
-
if (!e && !
|
|
1692
|
-
throw new
|
|
1810
|
+
const e = "redirectTo" in s, t = "onSuccess" in s && typeof s.onSuccess == "function";
|
|
1811
|
+
if (!e && !t)
|
|
1812
|
+
throw new d(
|
|
1693
1813
|
"authUI.mount(container, options) requires either { redirectTo } or { onSuccess }."
|
|
1694
1814
|
);
|
|
1695
|
-
if ("redirectTo" in
|
|
1696
|
-
const i =
|
|
1815
|
+
if ("redirectTo" in s) {
|
|
1816
|
+
const i = s.redirectTo;
|
|
1697
1817
|
if (!(typeof i == "string" || i instanceof URL))
|
|
1698
|
-
throw new
|
|
1818
|
+
throw new d(
|
|
1699
1819
|
"authUI.mount(container, options) expected redirectTo to be a string or URL."
|
|
1700
1820
|
);
|
|
1701
1821
|
}
|
|
1702
|
-
if ("onSuccess" in
|
|
1703
|
-
throw new
|
|
1822
|
+
if ("onSuccess" in s && s.onSuccess !== void 0 && typeof s.onSuccess != "function")
|
|
1823
|
+
throw new d(
|
|
1704
1824
|
"authUI.mount(container, options) expected onSuccess to be a function."
|
|
1705
1825
|
);
|
|
1706
|
-
if ("onError" in
|
|
1707
|
-
throw new
|
|
1826
|
+
if ("onError" in s && s.onError !== void 0 && typeof s.onError != "function")
|
|
1827
|
+
throw new d(
|
|
1708
1828
|
"authUI.mount(container, options) expected onError to be a function."
|
|
1709
1829
|
);
|
|
1710
1830
|
}
|
|
1711
|
-
function
|
|
1712
|
-
if (!(
|
|
1713
|
-
throw new
|
|
1831
|
+
function Ie(s) {
|
|
1832
|
+
if (!(s instanceof HTMLElement))
|
|
1833
|
+
throw new d("authUI.mount(container, options) requires a real HTMLElement container.");
|
|
1714
1834
|
}
|
|
1715
|
-
function
|
|
1835
|
+
function Re(s, e) {
|
|
1716
1836
|
return {
|
|
1717
|
-
mount(
|
|
1718
|
-
var
|
|
1719
|
-
|
|
1720
|
-
const
|
|
1837
|
+
mount(t, i) {
|
|
1838
|
+
var w;
|
|
1839
|
+
Te(i), Ie(t), (w = $.get(t)) == null || w.destroy();
|
|
1840
|
+
const r = new Pe(t, s, i, _e, e), o = r.destroy.bind(r), u = {
|
|
1721
1841
|
destroy() {
|
|
1722
|
-
|
|
1842
|
+
o(), $.get(t) === u && $.delete(t);
|
|
1723
1843
|
}
|
|
1724
1844
|
};
|
|
1725
|
-
return
|
|
1845
|
+
return $.set(t, u), u;
|
|
1726
1846
|
}
|
|
1727
1847
|
};
|
|
1728
1848
|
}
|
|
1729
|
-
function
|
|
1730
|
-
|
|
1731
|
-
const
|
|
1849
|
+
function Ue() {
|
|
1850
|
+
re();
|
|
1851
|
+
const s = me(), e = we(), t = ue(), i = Re(e, {
|
|
1732
1852
|
syncPublicSession: async () => {
|
|
1733
|
-
await
|
|
1853
|
+
await he(s);
|
|
1734
1854
|
}
|
|
1735
1855
|
});
|
|
1736
1856
|
return {
|
|
1737
|
-
auth:
|
|
1738
|
-
api:
|
|
1857
|
+
auth: s,
|
|
1858
|
+
api: t,
|
|
1739
1859
|
authUI: i
|
|
1740
1860
|
};
|
|
1741
1861
|
}
|
|
1742
1862
|
export {
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1863
|
+
m as EdgeSparkAuthError,
|
|
1864
|
+
d as EdgeSparkConfigError,
|
|
1865
|
+
x as EdgeSparkError,
|
|
1866
|
+
ne as EdgeSparkRuntimeError,
|
|
1867
|
+
Q as ar,
|
|
1868
|
+
Ue as createEdgeSpark,
|
|
1869
|
+
K as de,
|
|
1870
|
+
pe as detectLocale,
|
|
1871
|
+
U as enUS,
|
|
1872
|
+
O as es,
|
|
1873
|
+
Y as fr,
|
|
1874
|
+
X as hi,
|
|
1875
|
+
J as it,
|
|
1876
|
+
W as ja,
|
|
1877
|
+
j as ko,
|
|
1878
|
+
G as ptBR,
|
|
1879
|
+
Z as ru,
|
|
1880
|
+
M as zhCN
|
|
1761
1881
|
};
|