@getauthui/core 0.1.10 → 0.1.12
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 +3 -3
- package/dist/{authui-user-button-CPPH9iUx.js → authui-user-button--QfXbaC8.js} +698 -606
- package/dist/authui.cdn.js +291 -242
- package/dist/authui.cdn.mjs +1093 -1001
- package/dist/authui.js +2 -2
- package/dist/components/authui-account.d.ts +7 -0
- package/dist/components/authui-account.d.ts.map +1 -1
- package/dist/components/authui-sign-in.d.ts +3 -0
- package/dist/components/authui-sign-in.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/store.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { state as
|
|
2
|
-
import { css as
|
|
3
|
-
import { Client as
|
|
1
|
+
import { state as c, property as m, customElement as L, query as at } from "lit/decorators.js";
|
|
2
|
+
import { css as T, LitElement as nt, nothing as n, html as r, svg as u } from "lit";
|
|
3
|
+
import { Client as ct, Account as dt, Teams as kt, ID as W, Avatars as Ct } from "appwrite";
|
|
4
4
|
const St = {
|
|
5
5
|
signIn: "Sign in",
|
|
6
6
|
dialogSignIn: "Sign in",
|
|
@@ -79,7 +79,7 @@ const St = {
|
|
|
79
79
|
twoFactor: "Two-factor authentication",
|
|
80
80
|
mfaBadge: "MFA",
|
|
81
81
|
twoFactorDescription: "Require a second factor when signing in to this account.",
|
|
82
|
-
mfaNoFactorWarning: "
|
|
82
|
+
mfaNoFactorWarning: "Two-factor authentication is on, but no factors are set up yet. Add an authenticator, or verify your email or phone. Without a factor, this setting does not protect the account.",
|
|
83
83
|
enable: "Enable",
|
|
84
84
|
disable: "Disable",
|
|
85
85
|
authenticatorApp: "Authenticator app",
|
|
@@ -248,13 +248,13 @@ const K = (e, t, i = 401) => Object.assign(new Error(t), { type: e, code: i }),
|
|
|
248
248
|
"juniper",
|
|
249
249
|
"kite",
|
|
250
250
|
"lumen"
|
|
251
|
-
],
|
|
251
|
+
], ht = () => `${G[Math.floor(Math.random() * G.length)]}-${G[Math.floor(Math.random() * G.length)]}`, D = () => Math.random().toString(36).slice(2, 12), ut = () => Array.from({ length: 2 }, () => Math.random().toString(36).slice(2, 7)).join("-"), Ut = {
|
|
252
252
|
name: "Ada Lovelace",
|
|
253
253
|
email: "ada@example.com",
|
|
254
254
|
phone: "+15550100"
|
|
255
255
|
};
|
|
256
|
-
class
|
|
257
|
-
constructor(t =
|
|
256
|
+
class It {
|
|
257
|
+
constructor(t = Ut) {
|
|
258
258
|
this.seed = t, this.user = null, this.mfaPending = !1, this.mfaEnabled = !1, this.totpEnrolled = !1, this.recoveryCodes = [], this.lastChallenge = 0, this.sessions = [], this.identities = [], this.logs = [], this.tokens = /* @__PURE__ */ new Map(), this.pendingAuthenticator = null;
|
|
259
259
|
}
|
|
260
260
|
// ───────────────────────── helpers ─────────────────────────
|
|
@@ -318,7 +318,7 @@ class Ut {
|
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
...i,
|
|
321
|
-
$id:
|
|
321
|
+
$id: D(),
|
|
322
322
|
$createdAt: M(300),
|
|
323
323
|
provider: t,
|
|
324
324
|
ip: "198.51.100.7",
|
|
@@ -335,7 +335,7 @@ class Ut {
|
|
|
335
335
|
},
|
|
336
336
|
{
|
|
337
337
|
...i,
|
|
338
|
-
$id:
|
|
338
|
+
$id: D(),
|
|
339
339
|
$createdAt: M(1440 * 3),
|
|
340
340
|
provider: "oauth2",
|
|
341
341
|
ip: "192.0.2.90",
|
|
@@ -436,26 +436,26 @@ class Ut {
|
|
|
436
436
|
}
|
|
437
437
|
async createMagicURLToken(t, i) {
|
|
438
438
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
439
|
-
$id:
|
|
439
|
+
$id: D(),
|
|
440
440
|
$createdAt: P(),
|
|
441
441
|
userId: t,
|
|
442
442
|
secret: "",
|
|
443
443
|
expire: "",
|
|
444
|
-
phrase:
|
|
444
|
+
phrase: ht()
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
447
|
async createEmailToken(t, i) {
|
|
448
448
|
return this.tokens.set(t, { email: i }), this.delay({
|
|
449
|
-
$id:
|
|
449
|
+
$id: D(),
|
|
450
450
|
$createdAt: P(),
|
|
451
451
|
userId: t,
|
|
452
452
|
secret: "",
|
|
453
453
|
expire: "",
|
|
454
|
-
phrase:
|
|
454
|
+
phrase: ht()
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
async createPhoneToken(t, i) {
|
|
458
|
-
return this.tokens.set(t, { phone: i }), this.delay({ $id:
|
|
458
|
+
return this.tokens.set(t, { phone: i }), this.delay({ $id: D(), $createdAt: P(), userId: t, secret: "", expire: "", phrase: "" });
|
|
459
459
|
}
|
|
460
460
|
async createSession(t) {
|
|
461
461
|
return this.delay(() => {
|
|
@@ -547,7 +547,7 @@ class Ut {
|
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
async createMFAChallenge() {
|
|
550
|
-
return this.delay({ $id:
|
|
550
|
+
return this.delay({ $id: D(), $createdAt: P(), userId: "preview-user", expire: "" });
|
|
551
551
|
}
|
|
552
552
|
async updateMFAChallenge() {
|
|
553
553
|
return this.delay(() => (this.mfaPending = !1, this.lastChallenge = Date.now(), this.sessions[0]));
|
|
@@ -594,17 +594,17 @@ class Ut {
|
|
|
594
594
|
function Et(e) {
|
|
595
595
|
let t = 2166136261;
|
|
596
596
|
const i = () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) / 4294967296);
|
|
597
|
-
for (const
|
|
597
|
+
for (const g of e) t = (t ^ g.charCodeAt(0)) * 16777619;
|
|
598
598
|
const s = 25;
|
|
599
599
|
let a = "";
|
|
600
|
-
const
|
|
601
|
-
for (let
|
|
600
|
+
const h = (g, y) => `<rect x="${g}" y="${y}" width="7" height="7"/><rect x="${g + 1}" y="${y + 1}" width="5" height="5" fill="#fff"/><rect x="${g + 2}" y="${y + 2}" width="3" height="3"/>`;
|
|
601
|
+
for (let g = 0; g < s; g++)
|
|
602
602
|
for (let y = 0; y < s; y++)
|
|
603
|
-
!(y < 8 &&
|
|
604
|
-
const
|
|
605
|
-
return `data:image/svg+xml;utf8,${encodeURIComponent(
|
|
603
|
+
!(y < 8 && g < 8 || y >= s - 8 && g < 8 || y < 8 && g >= s - 8) && i() < 0.45 && (a += `<rect x="${y}" y="${g}" width="1" height="1"/>`);
|
|
604
|
+
const d = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s}" shape-rendering="crispEdges"><rect width="${s}" height="${s}" fill="#fff"/><g fill="#000">${h(0, 0)}${h(s - 7, 0)}${h(0, s - 7)}${a}</g></svg>`;
|
|
605
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(d)}`;
|
|
606
606
|
}
|
|
607
|
-
const
|
|
607
|
+
const v = {
|
|
608
608
|
moreFactorsRequired: "user_more_factors_required",
|
|
609
609
|
invalidCredentials: "user_invalid_credentials",
|
|
610
610
|
userAlreadyExists: "user_already_exists",
|
|
@@ -639,7 +639,7 @@ const g = {
|
|
|
639
639
|
targetAlreadyExists: "user_target_already_exists",
|
|
640
640
|
argumentInvalid: "general_argument_invalid"
|
|
641
641
|
};
|
|
642
|
-
function
|
|
642
|
+
function q(e) {
|
|
643
643
|
if (e && typeof e == "object") {
|
|
644
644
|
const t = e;
|
|
645
645
|
let i = typeof t.message == "string" ? t.message : "Unknown error";
|
|
@@ -652,60 +652,60 @@ function _(e) {
|
|
|
652
652
|
return { message: String(e), type: "", code: 0 };
|
|
653
653
|
}
|
|
654
654
|
function j(e, t) {
|
|
655
|
-
return
|
|
655
|
+
return q(e).type === t;
|
|
656
656
|
}
|
|
657
657
|
function Y(e, t, i = "link") {
|
|
658
|
-
const s =
|
|
658
|
+
const s = q(e);
|
|
659
659
|
switch (s.type) {
|
|
660
|
-
case
|
|
660
|
+
case v.invalidCredentials:
|
|
661
661
|
return i === "password" ? t.errorCurrentPassword : t.errorInvalidCredentials;
|
|
662
|
-
case
|
|
663
|
-
case
|
|
664
|
-
case
|
|
662
|
+
case v.userAlreadyExists:
|
|
663
|
+
case v.emailAlreadyExists:
|
|
664
|
+
case v.phoneAlreadyExists:
|
|
665
665
|
return t.errorUserExists;
|
|
666
|
-
case
|
|
666
|
+
case v.userBlocked:
|
|
667
667
|
return t.errorUserBlocked;
|
|
668
|
-
case
|
|
668
|
+
case v.rateLimit:
|
|
669
669
|
return t.errorRateLimit;
|
|
670
|
-
case
|
|
670
|
+
case v.invalidToken:
|
|
671
671
|
return i === "code" ? t.errorInvalidCode : t.errorInvalidToken;
|
|
672
|
-
case
|
|
672
|
+
case v.invalidCode:
|
|
673
673
|
return t.errorInvalidCode;
|
|
674
|
-
case
|
|
674
|
+
case v.passwordMismatch:
|
|
675
675
|
return t.errorPasswordMismatch;
|
|
676
|
-
case
|
|
676
|
+
case v.passwordRecentlyUsed:
|
|
677
677
|
return t.errorPasswordRecentlyUsed;
|
|
678
|
-
case
|
|
678
|
+
case v.passwordPersonalData:
|
|
679
679
|
return t.errorPasswordPersonalData;
|
|
680
|
-
case
|
|
680
|
+
case v.passwordWeak:
|
|
681
681
|
return t.errorPasswordWeak;
|
|
682
|
-
case
|
|
682
|
+
case v.passwordPwned:
|
|
683
683
|
return t.errorPasswordPwned;
|
|
684
|
-
case
|
|
684
|
+
case v.challengeRequired:
|
|
685
685
|
return t.errorChallengeRequired;
|
|
686
|
-
case
|
|
686
|
+
case v.sessionAlreadyExists:
|
|
687
687
|
return t.errorSessionExists;
|
|
688
|
-
case
|
|
689
|
-
case
|
|
688
|
+
case v.oauthUnauthorized:
|
|
689
|
+
case v.oauthBadRequest:
|
|
690
690
|
return t.errorOAuth;
|
|
691
|
-
case
|
|
691
|
+
case v.authMethodUnsupported:
|
|
692
692
|
return t.errorMethodDisabled;
|
|
693
693
|
}
|
|
694
|
-
if (s.type ===
|
|
694
|
+
if (s.type === v.argumentInvalid || /Invalid `\w+` param/i.test(s.message)) {
|
|
695
695
|
const a = s.message.match(/Invalid `([^`]+)` param/i)?.[1]?.toLowerCase();
|
|
696
696
|
return a === "email" ? t.errorInvalidEmail : a === "password" ? t.errorInvalidPassword : a === "phone" ? t.errorInvalidPhone : a === "name" ? t.errorInvalidName : t.errorGeneric;
|
|
697
697
|
}
|
|
698
|
-
return s.type ===
|
|
698
|
+
return s.type === v.projectNotFound || s.type === v.unknownOrigin ? t.errorConfig : s.type === v.routeNotFound ? t.errorConfigEndpoint : s.code === 0 && /fetch|network/i.test(s.message) ? t.errorNetwork : /Invalid `\w+` param/i.test(s.message) ? t.errorGeneric : s.message ? s.message || t.errorGeneric : s.code === 404 || s.type === v.routeNotFound ? t.errorConfigEndpoint : t.errorGeneric;
|
|
699
699
|
}
|
|
700
700
|
function Mt(e) {
|
|
701
|
-
const t =
|
|
702
|
-
return !!(t.type ===
|
|
701
|
+
const t = q(e);
|
|
702
|
+
return !!(t.type === v.projectNotFound || t.type === v.unknownOrigin || t.type === v.routeNotFound || !t.message && t.code === 404 || t.code === 0 && /fetch|network|load failed|failed to fetch/i.test(t.message));
|
|
703
703
|
}
|
|
704
|
-
const
|
|
705
|
-
function
|
|
704
|
+
const et = (e) => `authui:active-team:${e}`;
|
|
705
|
+
function pt(e) {
|
|
706
706
|
if (typeof localStorage > "u" || !e) return null;
|
|
707
707
|
try {
|
|
708
|
-
return localStorage.getItem(
|
|
708
|
+
return localStorage.getItem(et(e));
|
|
709
709
|
} catch {
|
|
710
710
|
return null;
|
|
711
711
|
}
|
|
@@ -713,26 +713,26 @@ function ht(e) {
|
|
|
713
713
|
function Ot(e, t) {
|
|
714
714
|
if (!(typeof localStorage > "u" || !e))
|
|
715
715
|
try {
|
|
716
|
-
t ? localStorage.setItem(
|
|
716
|
+
t ? localStorage.setItem(et(e), t) : localStorage.removeItem(et(e));
|
|
717
717
|
} catch {
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
const
|
|
721
|
-
function
|
|
720
|
+
const ot = "authui:last-method";
|
|
721
|
+
function _(e) {
|
|
722
722
|
if (!(typeof localStorage > "u")) {
|
|
723
723
|
if (!e || e === "mfa" || e === "sign-up")
|
|
724
724
|
if (e === "sign-up") e = "email-password";
|
|
725
725
|
else return;
|
|
726
726
|
try {
|
|
727
|
-
localStorage.setItem(
|
|
727
|
+
localStorage.setItem(ot, e);
|
|
728
728
|
} catch {
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function z() {
|
|
733
733
|
if (typeof localStorage > "u") return null;
|
|
734
734
|
try {
|
|
735
|
-
return localStorage.getItem(
|
|
735
|
+
return localStorage.getItem(ot);
|
|
736
736
|
} catch {
|
|
737
737
|
return null;
|
|
738
738
|
}
|
|
@@ -740,7 +740,7 @@ function D() {
|
|
|
740
740
|
function le() {
|
|
741
741
|
if (!(typeof localStorage > "u"))
|
|
742
742
|
try {
|
|
743
|
-
localStorage.removeItem(
|
|
743
|
+
localStorage.removeItem(ot);
|
|
744
744
|
} catch {
|
|
745
745
|
}
|
|
746
746
|
}
|
|
@@ -752,15 +752,15 @@ function Ft(e) {
|
|
|
752
752
|
} catch {
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function $t() {
|
|
756
756
|
if (!(typeof sessionStorage > "u"))
|
|
757
757
|
try {
|
|
758
758
|
const e = sessionStorage.getItem(Z);
|
|
759
|
-
sessionStorage.removeItem(Z), e &&
|
|
759
|
+
sessionStorage.removeItem(Z), e && _(`oauth:${e}`);
|
|
760
760
|
} catch {
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function ft() {
|
|
764
764
|
if (!(typeof sessionStorage > "u"))
|
|
765
765
|
try {
|
|
766
766
|
sessionStorage.removeItem(Z);
|
|
@@ -777,7 +777,7 @@ function A(e, t, i) {
|
|
|
777
777
|
new Error(`Appwrite SDK is missing ${t[0]}(). Update the appwrite package.`)
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
const
|
|
780
|
+
const it = "authui", mt = ["userId", "secret", "expire", "project", "error", it], gt = () => ({
|
|
781
781
|
status: "loading",
|
|
782
782
|
user: null,
|
|
783
783
|
mfaFactors: null,
|
|
@@ -785,9 +785,9 @@ const et = "authui", mt = ["userId", "secret", "expire", "project", "error", et]
|
|
|
785
785
|
configured: !1,
|
|
786
786
|
configError: null
|
|
787
787
|
});
|
|
788
|
-
class
|
|
788
|
+
class Tt {
|
|
789
789
|
constructor() {
|
|
790
|
-
this.client = null, this.account = null, this.config = null, this.state =
|
|
790
|
+
this.client = null, this.account = null, this.config = null, this.state = gt(), this.listeners = /* @__PURE__ */ new Map(), this.refreshPromise = null, this.preview = null, this.teams = null, this.activeTeamId = null;
|
|
791
791
|
}
|
|
792
792
|
// ───────────────────────────── configuration ─────────────────────────────
|
|
793
793
|
/** Configure the Appwrite client. Safe to call more than once; the last call wins. */
|
|
@@ -795,7 +795,7 @@ class Lt {
|
|
|
795
795
|
const i = t.endpoint.trim().replace(/\/+$/, "");
|
|
796
796
|
i && !i.endsWith("/v1") && console.warn(
|
|
797
797
|
`[authui] endpoint should end with /v1 (got "${t.endpoint}"). Without it Appwrite returns HTML 404 pages.`
|
|
798
|
-
), this.config = t, this.client = new
|
|
798
|
+
), this.config = t, this.client = new ct().setEndpoint(t.endpoint).setProject(t.project), this.preview = t.preview ? new It() : null, this.account = this.preview ? this.preview : new dt(this.client), this.teams = null, this.activeTeamId = pt(t.project), this.setState({ configured: !0, status: "loading", configError: null }), this.preview ? this.refresh() : typeof window < "u" && this.handleRedirect().then(() => this.refresh());
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
801
801
|
* Called by <authui-config> when it is on the page but missing endpoint or project.
|
|
@@ -851,7 +851,7 @@ class Lt {
|
|
|
851
851
|
getActiveTeamId() {
|
|
852
852
|
if (this.activeTeamId) return this.activeTeamId;
|
|
853
853
|
const t = this.config?.project;
|
|
854
|
-
return t ? (this.activeTeamId =
|
|
854
|
+
return t ? (this.activeTeamId = pt(t), this.activeTeamId) : null;
|
|
855
855
|
}
|
|
856
856
|
/**
|
|
857
857
|
* Remember the active team locally and emit `active-team`.
|
|
@@ -888,7 +888,7 @@ class Lt {
|
|
|
888
888
|
this.state = { ...this.state, ...t }, this.emit("change", this.getState());
|
|
889
889
|
}
|
|
890
890
|
fail(t) {
|
|
891
|
-
const i =
|
|
891
|
+
const i = q(t);
|
|
892
892
|
throw this.emit("error", i), t;
|
|
893
893
|
}
|
|
894
894
|
acct() {
|
|
@@ -908,7 +908,7 @@ class Lt {
|
|
|
908
908
|
const i = await this.account.get();
|
|
909
909
|
this.setState({ status: "signed-in", user: i, mfaFactors: null, configError: null }), t || this.emit("signed-in", i);
|
|
910
910
|
} catch (i) {
|
|
911
|
-
if (j(i,
|
|
911
|
+
if (j(i, v.moreFactorsRequired)) {
|
|
912
912
|
let s = null;
|
|
913
913
|
try {
|
|
914
914
|
s = await A(
|
|
@@ -919,7 +919,7 @@ class Lt {
|
|
|
919
919
|
} catch {
|
|
920
920
|
}
|
|
921
921
|
this.setState({ status: "mfa-required", user: null, mfaFactors: s });
|
|
922
|
-
} else if (j(i,
|
|
922
|
+
} else if (j(i, v.userBlocked))
|
|
923
923
|
await this.purgeLocalSession(), this.setState({
|
|
924
924
|
status: "signed-out",
|
|
925
925
|
user: null,
|
|
@@ -935,8 +935,8 @@ class Lt {
|
|
|
935
935
|
console.warn(
|
|
936
936
|
`[authui] ${a} (endpoint=${this.config?.endpoint ?? "?"}, project=${this.config?.project ?? "?"})`
|
|
937
937
|
);
|
|
938
|
-
const
|
|
939
|
-
this.emit("error", { message: a, type:
|
|
938
|
+
const h = q(i);
|
|
939
|
+
this.emit("error", { message: a, type: h.type, code: h.code }), this.setState({
|
|
940
940
|
status: "signed-out",
|
|
941
941
|
user: null,
|
|
942
942
|
mfaFactors: null,
|
|
@@ -955,7 +955,7 @@ class Lt {
|
|
|
955
955
|
const i = this.state.pending;
|
|
956
956
|
if (i?.type === "notice" && i.tone === "error")
|
|
957
957
|
throw Object.assign(new Error(i.message), {
|
|
958
|
-
type:
|
|
958
|
+
type: v.userBlocked,
|
|
959
959
|
code: 401
|
|
960
960
|
});
|
|
961
961
|
}
|
|
@@ -980,7 +980,7 @@ class Lt {
|
|
|
980
980
|
localStorage.removeItem("cookieFallback");
|
|
981
981
|
} catch {
|
|
982
982
|
}
|
|
983
|
-
this.config && !this.preview && (this.client = new
|
|
983
|
+
this.config && !this.preview && (this.client = new ct().setEndpoint(this.config.endpoint).setProject(this.config.project), this.account = new dt(this.client));
|
|
984
984
|
}
|
|
985
985
|
// ─────────────────────────────── sign in ───────────────────────────────
|
|
986
986
|
async signInWithEmailPassword(t, i) {
|
|
@@ -1333,7 +1333,7 @@ class Lt {
|
|
|
1333
1333
|
redirectUrl(t) {
|
|
1334
1334
|
const i = this.config?.redirectUrl ?? (typeof window < "u" ? window.location.origin + window.location.pathname : ""), s = new URL(i, typeof window < "u" ? window.location.href : void 0);
|
|
1335
1335
|
for (const a of mt) s.searchParams.delete(a);
|
|
1336
|
-
return s.searchParams.set(
|
|
1336
|
+
return s.searchParams.set(it, t), s.toString();
|
|
1337
1337
|
}
|
|
1338
1338
|
setPending(t) {
|
|
1339
1339
|
this.setState({ pending: t });
|
|
@@ -1344,11 +1344,11 @@ class Lt {
|
|
|
1344
1344
|
*/
|
|
1345
1345
|
async handleRedirect() {
|
|
1346
1346
|
if (typeof window > "u") return !1;
|
|
1347
|
-
const t = new URLSearchParams(window.location.search), i = t.get(
|
|
1347
|
+
const t = new URLSearchParams(window.location.search), i = t.get(it);
|
|
1348
1348
|
if (!i) return !1;
|
|
1349
1349
|
const s = t.get("userId") ?? "", a = t.get("secret") ?? "";
|
|
1350
1350
|
this.cleanUrl();
|
|
1351
|
-
const
|
|
1351
|
+
const h = () => {
|
|
1352
1352
|
this.setState({
|
|
1353
1353
|
pending: {
|
|
1354
1354
|
type: "notice",
|
|
@@ -1361,10 +1361,10 @@ class Lt {
|
|
|
1361
1361
|
switch (i) {
|
|
1362
1362
|
case "oauth":
|
|
1363
1363
|
case "magic-url":
|
|
1364
|
-
s && a ? (await this.acct().createSession(s, a), i === "oauth"
|
|
1364
|
+
s && a ? (await this.acct().createSession(s, a), i === "oauth" ? $t() : _("magic-url")) : (i === "oauth" && ft(), h());
|
|
1365
1365
|
break;
|
|
1366
1366
|
case "oauth-failed":
|
|
1367
|
-
|
|
1367
|
+
ft(), this.setState({
|
|
1368
1368
|
pending: {
|
|
1369
1369
|
type: "notice",
|
|
1370
1370
|
tone: "error",
|
|
@@ -1373,7 +1373,7 @@ class Lt {
|
|
|
1373
1373
|
});
|
|
1374
1374
|
break;
|
|
1375
1375
|
case "recovery":
|
|
1376
|
-
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) :
|
|
1376
|
+
s && a ? this.setState({ pending: { type: "reset-password", userId: s, secret: a } }) : h();
|
|
1377
1377
|
break;
|
|
1378
1378
|
case "verify-email":
|
|
1379
1379
|
s && a ? (await A(
|
|
@@ -1386,12 +1386,12 @@ class Lt {
|
|
|
1386
1386
|
message: this.getStrings().emailVerified,
|
|
1387
1387
|
tone: "success"
|
|
1388
1388
|
}
|
|
1389
|
-
})) :
|
|
1389
|
+
})) : h();
|
|
1390
1390
|
break;
|
|
1391
1391
|
}
|
|
1392
|
-
} catch (
|
|
1393
|
-
const
|
|
1394
|
-
this.emit("error",
|
|
1392
|
+
} catch (d) {
|
|
1393
|
+
const g = q(d), y = Y(d, this.getStrings(), "link");
|
|
1394
|
+
this.emit("error", g), this.setState({ pending: { type: "notice", message: y, tone: "error" } });
|
|
1395
1395
|
}
|
|
1396
1396
|
return !0;
|
|
1397
1397
|
}
|
|
@@ -1402,10 +1402,10 @@ class Lt {
|
|
|
1402
1402
|
}
|
|
1403
1403
|
/** Test helper. */
|
|
1404
1404
|
reset() {
|
|
1405
|
-
this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state =
|
|
1405
|
+
this.client = null, this.account = null, this.teams = null, this.activeTeamId = null, this.preview = null, this.config = null, this.state = gt(), this.listeners.clear();
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
|
-
const
|
|
1408
|
+
const l = new Tt();
|
|
1409
1409
|
class Rt {
|
|
1410
1410
|
constructor() {
|
|
1411
1411
|
this.listeners = /* @__PURE__ */ new Set(), this.observer = null, this.media = null, this.notify = () => {
|
|
@@ -1434,14 +1434,14 @@ class Rt {
|
|
|
1434
1434
|
this.observer?.disconnect(), this.observer = null, this.media?.removeEventListener?.("change", this.notify), this.media = null;
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
const
|
|
1437
|
+
const vt = new Rt(), bt = {
|
|
1438
1438
|
none: "0px",
|
|
1439
1439
|
sm: "0.25rem",
|
|
1440
1440
|
md: "0.625rem",
|
|
1441
1441
|
lg: "0.875rem",
|
|
1442
1442
|
xl: "1.125rem",
|
|
1443
1443
|
full: "1.5rem"
|
|
1444
|
-
},
|
|
1444
|
+
}, Lt = T`
|
|
1445
1445
|
:host {
|
|
1446
1446
|
/* Light theme (matches :root in the console) */
|
|
1447
1447
|
--authui-background: oklch(1 0 0);
|
|
@@ -1519,7 +1519,7 @@ const gt = new Rt(), vt = {
|
|
|
1519
1519
|
--authui-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
|
|
1520
1520
|
color-scheme: dark;
|
|
1521
1521
|
}
|
|
1522
|
-
`,
|
|
1522
|
+
`, Dt = T`
|
|
1523
1523
|
*,
|
|
1524
1524
|
*::before,
|
|
1525
1525
|
*::after {
|
|
@@ -2522,21 +2522,21 @@ const gt = new Rt(), vt = {
|
|
|
2522
2522
|
}
|
|
2523
2523
|
}
|
|
2524
2524
|
`;
|
|
2525
|
-
var
|
|
2526
|
-
for (var a = void 0,
|
|
2527
|
-
(
|
|
2528
|
-
return a &&
|
|
2525
|
+
var zt = Object.defineProperty, _t = (e, t, i, s) => {
|
|
2526
|
+
for (var a = void 0, h = e.length - 1, d; h >= 0; h--)
|
|
2527
|
+
(d = e[h]) && (a = d(t, i, a) || a);
|
|
2528
|
+
return a && zt(t, i, a), a;
|
|
2529
2529
|
}, O;
|
|
2530
|
-
const
|
|
2530
|
+
const xt = (O = class extends nt {
|
|
2531
2531
|
constructor() {
|
|
2532
|
-
super(...arguments), this.auth =
|
|
2532
|
+
super(...arguments), this.auth = l.getState(), this.unsubscribeStore = null, this.unsubscribeTheme = null, this.stopKeys = (t) => t.stopPropagation();
|
|
2533
2533
|
}
|
|
2534
2534
|
connectedCallback() {
|
|
2535
2535
|
super.connectedCallback();
|
|
2536
2536
|
for (const t of O.KEY_EVENTS) this.addEventListener(t, this.stopKeys);
|
|
2537
|
-
this.auth =
|
|
2537
|
+
this.auth = l.getState(), this.unsubscribeStore = l.on("change", (t) => {
|
|
2538
2538
|
this.auth = t, this.applyBranding();
|
|
2539
|
-
}), this.unsubscribeTheme =
|
|
2539
|
+
}), this.unsubscribeTheme = vt.subscribe(() => this.applyBranding()), this.applyBranding();
|
|
2540
2540
|
}
|
|
2541
2541
|
disconnectedCallback() {
|
|
2542
2542
|
super.disconnectedCallback();
|
|
@@ -2544,41 +2544,41 @@ const $t = (O = class extends at {
|
|
|
2544
2544
|
this.unsubscribeStore?.(), this.unsubscribeTheme?.(), this.unsubscribeStore = null, this.unsubscribeTheme = null;
|
|
2545
2545
|
}
|
|
2546
2546
|
get strings() {
|
|
2547
|
-
return
|
|
2547
|
+
return l.getStrings();
|
|
2548
2548
|
}
|
|
2549
2549
|
/** Translate a string key with optional `{placeholders}`. */
|
|
2550
2550
|
t(t, i) {
|
|
2551
2551
|
return At(this.strings[t], i);
|
|
2552
2552
|
}
|
|
2553
2553
|
get config() {
|
|
2554
|
-
return
|
|
2554
|
+
return l.getConfig();
|
|
2555
2555
|
}
|
|
2556
2556
|
get productName() {
|
|
2557
2557
|
return this.config?.branding?.name ?? "";
|
|
2558
2558
|
}
|
|
2559
2559
|
/** Push theme and branding from config onto the host element. */
|
|
2560
2560
|
applyBranding() {
|
|
2561
|
-
const t = this.config?.branding, i =
|
|
2561
|
+
const t = this.config?.branding, i = vt.isDark(t?.theme ?? "auto");
|
|
2562
2562
|
this.setAttribute("data-theme", i ? "dark" : "light"), t?.primary && (this.style.setProperty("--authui-primary", t.primary), this.style.setProperty(
|
|
2563
2563
|
"--authui-primary-foreground",
|
|
2564
2564
|
t.primaryForeground ?? "#ffffff"
|
|
2565
|
-
)), t?.radius &&
|
|
2565
|
+
)), t?.radius && bt[t.radius] && this.style.setProperty("--authui-radius", bt[t.radius]);
|
|
2566
2566
|
}
|
|
2567
2567
|
/** Emit a composed custom event from this element. */
|
|
2568
2568
|
fire(t, i) {
|
|
2569
2569
|
this.dispatchEvent(new CustomEvent(t, { detail: i, bubbles: !0, composed: !0 }));
|
|
2570
2570
|
}
|
|
2571
|
-
}, O.styles = [
|
|
2571
|
+
}, O.styles = [Lt, Dt], O.KEY_EVENTS = ["keydown", "keyup", "keypress"], O);
|
|
2572
2572
|
_t([
|
|
2573
|
-
|
|
2574
|
-
],
|
|
2575
|
-
let E =
|
|
2576
|
-
var qt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor,
|
|
2577
|
-
for (var a = s > 1 ? void 0 : s ? Vt(t, i) : t,
|
|
2578
|
-
(
|
|
2573
|
+
c()
|
|
2574
|
+
], xt.prototype, "auth");
|
|
2575
|
+
let E = xt;
|
|
2576
|
+
var qt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, x = (e, t, i, s) => {
|
|
2577
|
+
for (var a = s > 1 ? void 0 : s ? Vt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
2578
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
2579
2579
|
return s && a && qt(t, i, a), a;
|
|
2580
2580
|
};
|
|
2581
|
-
let w = class extends
|
|
2581
|
+
let w = class extends nt {
|
|
2582
2582
|
constructor() {
|
|
2583
2583
|
super(...arguments), this.endpoint = "", this.project = "", this.redirectUrl = "", this.successUrl = "", this.methods = "email-password", this.signUp = "true", this.requireName = "true", this.mfa = "true", this.securityPhrase = "true", this.name = "", this.logo = "", this.theme = "auto", this.radius = "", this.primary = "", this.primaryForeground = "", this.termsUrl = "", this.privacyUrl = "", this.requireAcceptance = "", this.oauthLayout = "", this.preview = "";
|
|
2584
2584
|
}
|
|
@@ -2591,12 +2591,12 @@ let w = class extends at {
|
|
|
2591
2591
|
configure() {
|
|
2592
2592
|
if (!this.endpoint || !this.project) {
|
|
2593
2593
|
queueMicrotask(() => {
|
|
2594
|
-
(!this.endpoint || !this.project) &&
|
|
2594
|
+
(!this.endpoint || !this.project) && l.notifyConfigIncomplete();
|
|
2595
2595
|
});
|
|
2596
2596
|
return;
|
|
2597
2597
|
}
|
|
2598
|
-
const e = this.toConfig(), t =
|
|
2599
|
-
t && JSON.stringify(t) === JSON.stringify(e) ||
|
|
2598
|
+
const e = this.toConfig(), t = l.getConfig();
|
|
2599
|
+
t && JSON.stringify(t) === JSON.stringify(e) || l.configure(e);
|
|
2600
2600
|
}
|
|
2601
2601
|
toConfig() {
|
|
2602
2602
|
const e = { oauth: [] }, t = this.methods.split(/[\s,]+/).filter(Boolean);
|
|
@@ -2629,113 +2629,113 @@ let w = class extends at {
|
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
2631
|
};
|
|
2632
|
-
w.styles =
|
|
2632
|
+
w.styles = T`
|
|
2633
2633
|
:host {
|
|
2634
2634
|
display: none;
|
|
2635
2635
|
}
|
|
2636
2636
|
`;
|
|
2637
|
-
|
|
2637
|
+
x([
|
|
2638
2638
|
m({ type: String })
|
|
2639
2639
|
], w.prototype, "endpoint", 2);
|
|
2640
|
-
|
|
2640
|
+
x([
|
|
2641
2641
|
m({ type: String })
|
|
2642
2642
|
], w.prototype, "project", 2);
|
|
2643
|
-
|
|
2643
|
+
x([
|
|
2644
2644
|
m({ type: String, attribute: "redirect-url" })
|
|
2645
2645
|
], w.prototype, "redirectUrl", 2);
|
|
2646
|
-
|
|
2646
|
+
x([
|
|
2647
2647
|
m({ type: String, attribute: "success-url" })
|
|
2648
2648
|
], w.prototype, "successUrl", 2);
|
|
2649
|
-
|
|
2649
|
+
x([
|
|
2650
2650
|
m({ type: String })
|
|
2651
2651
|
], w.prototype, "methods", 2);
|
|
2652
|
-
|
|
2652
|
+
x([
|
|
2653
2653
|
m({ type: String, attribute: "sign-up" })
|
|
2654
2654
|
], w.prototype, "signUp", 2);
|
|
2655
|
-
|
|
2655
|
+
x([
|
|
2656
2656
|
m({ type: String, attribute: "require-name" })
|
|
2657
2657
|
], w.prototype, "requireName", 2);
|
|
2658
|
-
|
|
2658
|
+
x([
|
|
2659
2659
|
m({ type: String })
|
|
2660
2660
|
], w.prototype, "mfa", 2);
|
|
2661
|
-
|
|
2661
|
+
x([
|
|
2662
2662
|
m({ type: String, attribute: "security-phrase" })
|
|
2663
2663
|
], w.prototype, "securityPhrase", 2);
|
|
2664
|
-
|
|
2664
|
+
x([
|
|
2665
2665
|
m({ type: String })
|
|
2666
2666
|
], w.prototype, "name", 2);
|
|
2667
|
-
|
|
2667
|
+
x([
|
|
2668
2668
|
m({ type: String })
|
|
2669
2669
|
], w.prototype, "logo", 2);
|
|
2670
|
-
|
|
2670
|
+
x([
|
|
2671
2671
|
m({ type: String })
|
|
2672
2672
|
], w.prototype, "theme", 2);
|
|
2673
|
-
|
|
2673
|
+
x([
|
|
2674
2674
|
m({ type: String })
|
|
2675
2675
|
], w.prototype, "radius", 2);
|
|
2676
|
-
|
|
2676
|
+
x([
|
|
2677
2677
|
m({ type: String })
|
|
2678
2678
|
], w.prototype, "primary", 2);
|
|
2679
|
-
|
|
2679
|
+
x([
|
|
2680
2680
|
m({ type: String, attribute: "primary-foreground" })
|
|
2681
2681
|
], w.prototype, "primaryForeground", 2);
|
|
2682
|
-
|
|
2682
|
+
x([
|
|
2683
2683
|
m({ type: String, attribute: "terms-url" })
|
|
2684
2684
|
], w.prototype, "termsUrl", 2);
|
|
2685
|
-
|
|
2685
|
+
x([
|
|
2686
2686
|
m({ type: String, attribute: "privacy-url" })
|
|
2687
2687
|
], w.prototype, "privacyUrl", 2);
|
|
2688
|
-
|
|
2688
|
+
x([
|
|
2689
2689
|
m({ type: String, attribute: "require-acceptance" })
|
|
2690
2690
|
], w.prototype, "requireAcceptance", 2);
|
|
2691
|
-
|
|
2691
|
+
x([
|
|
2692
2692
|
m({ type: String, attribute: "oauth-layout" })
|
|
2693
2693
|
], w.prototype, "oauthLayout", 2);
|
|
2694
|
-
|
|
2694
|
+
x([
|
|
2695
2695
|
m({ type: String })
|
|
2696
2696
|
], w.prototype, "preview", 2);
|
|
2697
|
-
w =
|
|
2698
|
-
|
|
2697
|
+
w = x([
|
|
2698
|
+
L("authui-config")
|
|
2699
2699
|
], w);
|
|
2700
2700
|
var Nt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Q = (e, t, i, s) => {
|
|
2701
|
-
for (var a = s > 1 ? void 0 : s ? Bt(t, i) : t,
|
|
2702
|
-
(
|
|
2701
|
+
for (var a = s > 1 ? void 0 : s ? Bt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
2702
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
2703
2703
|
return s && a && Nt(t, i, a), a;
|
|
2704
2704
|
};
|
|
2705
|
-
const
|
|
2706
|
-
let
|
|
2705
|
+
const yt = "authui-show:not([ready]){display:none}", ce = "authui-show:not([ready]){display:none}authui-button:not(:defined),authui-user-button:not(:defined){visibility:hidden}";
|
|
2706
|
+
let wt = !1;
|
|
2707
2707
|
function jt() {
|
|
2708
|
-
if (!(typeof document > "u" ||
|
|
2709
|
-
|
|
2708
|
+
if (!(typeof document > "u" || wt)) {
|
|
2709
|
+
wt = !0;
|
|
2710
2710
|
try {
|
|
2711
2711
|
if (typeof CSSStyleSheet < "u" && "adoptedStyleSheets" in Document.prototype) {
|
|
2712
2712
|
const e = new CSSStyleSheet();
|
|
2713
|
-
e.replaceSync(
|
|
2713
|
+
e.replaceSync(yt), document.adoptedStyleSheets = [...document.adoptedStyleSheets, e];
|
|
2714
2714
|
return;
|
|
2715
2715
|
}
|
|
2716
2716
|
} catch {
|
|
2717
2717
|
}
|
|
2718
2718
|
if (!document.getElementById("authui-fouc")) {
|
|
2719
2719
|
const e = document.createElement("style");
|
|
2720
|
-
e.id = "authui-fouc", e.textContent =
|
|
2720
|
+
e.id = "authui-fouc", e.textContent = yt, document.head.appendChild(e);
|
|
2721
2721
|
}
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
2724
|
jt();
|
|
2725
2725
|
const Ht = ["loading", "signed-out", "signed-in", "mfa-required"];
|
|
2726
|
-
function
|
|
2726
|
+
function st(e) {
|
|
2727
2727
|
return e ? e.split(/[\s,]+/).map((t) => t.trim()).filter((t) => Ht.includes(t)) : [];
|
|
2728
2728
|
}
|
|
2729
2729
|
function Wt(e, t, i) {
|
|
2730
|
-
const s =
|
|
2730
|
+
const s = st(t), a = st(i);
|
|
2731
2731
|
return !(e === "loading" && !s.includes("loading") || s.length > 0 && !s.includes(e) || a.includes(e));
|
|
2732
2732
|
}
|
|
2733
|
-
let H = class extends
|
|
2733
|
+
let H = class extends nt {
|
|
2734
2734
|
constructor() {
|
|
2735
|
-
super(...arguments), this.when = "", this.unless = "", this.status =
|
|
2735
|
+
super(...arguments), this.when = "", this.unless = "", this.status = l.getState().status, this.unsubscribe = null;
|
|
2736
2736
|
}
|
|
2737
2737
|
connectedCallback() {
|
|
2738
|
-
super.connectedCallback(), this.status =
|
|
2738
|
+
super.connectedCallback(), this.status = l.getState().status, this.unsubscribe = l.on("change", (e) => this.status = e.status);
|
|
2739
2739
|
}
|
|
2740
2740
|
disconnectedCallback() {
|
|
2741
2741
|
super.disconnectedCallback(), this.unsubscribe?.(), this.unsubscribe = null;
|
|
@@ -2745,7 +2745,7 @@ let H = class extends at {
|
|
|
2745
2745
|
return Wt(this.status, this.when, this.unless);
|
|
2746
2746
|
}
|
|
2747
2747
|
updated() {
|
|
2748
|
-
(this.status !== "loading" ||
|
|
2748
|
+
(this.status !== "loading" || st(this.when).includes("loading")) && (this.setAttribute("ready", ""), this.style.display = "contents");
|
|
2749
2749
|
}
|
|
2750
2750
|
render() {
|
|
2751
2751
|
return this.visible ? r`<slot></slot>` : n;
|
|
@@ -2758,12 +2758,12 @@ Q([
|
|
|
2758
2758
|
m({ type: String })
|
|
2759
2759
|
], H.prototype, "unless", 2);
|
|
2760
2760
|
Q([
|
|
2761
|
-
|
|
2761
|
+
c()
|
|
2762
2762
|
], H.prototype, "status", 2);
|
|
2763
2763
|
H = Q([
|
|
2764
|
-
|
|
2764
|
+
L("authui-show")
|
|
2765
2765
|
], H);
|
|
2766
|
-
const Kt =
|
|
2766
|
+
const Kt = T`
|
|
2767
2767
|
:host {
|
|
2768
2768
|
display: block;
|
|
2769
2769
|
width: 100%;
|
|
@@ -2828,150 +2828,150 @@ const Kt = L`
|
|
|
2828
2828
|
aria-hidden="true"
|
|
2829
2829
|
>
|
|
2830
2830
|
${e}
|
|
2831
|
-
</svg>`,
|
|
2831
|
+
</svg>`, o = {
|
|
2832
2832
|
mail: b(
|
|
2833
|
-
|
|
2833
|
+
u`<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>`
|
|
2834
2834
|
),
|
|
2835
2835
|
phone: b(
|
|
2836
|
-
|
|
2836
|
+
u`<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>`
|
|
2837
2837
|
),
|
|
2838
2838
|
user: b(
|
|
2839
|
-
|
|
2839
|
+
u`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`
|
|
2840
2840
|
),
|
|
2841
2841
|
userX: b(
|
|
2842
|
-
|
|
2842
|
+
u`<path d="M2 21a8 8 0 0 1 11.873-7"/><circle cx="10" cy="8" r="5"/><path d="m17 17 5 5"/><path d="m22 17-5 5"/>`
|
|
2843
2843
|
),
|
|
2844
2844
|
lock: b(
|
|
2845
|
-
|
|
2845
|
+
u`<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>`
|
|
2846
2846
|
),
|
|
2847
2847
|
key: b(
|
|
2848
|
-
|
|
2848
|
+
u`<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>`
|
|
2849
2849
|
),
|
|
2850
2850
|
shield: b(
|
|
2851
|
-
|
|
2851
|
+
u`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>`
|
|
2852
2852
|
),
|
|
2853
2853
|
shieldCheck: b(
|
|
2854
|
-
|
|
2854
|
+
u`<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>`
|
|
2855
2855
|
),
|
|
2856
2856
|
smartphone: b(
|
|
2857
|
-
|
|
2857
|
+
u`<rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/>`
|
|
2858
2858
|
),
|
|
2859
2859
|
monitor: b(
|
|
2860
|
-
|
|
2860
|
+
u`<rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/>`
|
|
2861
2861
|
),
|
|
2862
2862
|
globe: b(
|
|
2863
|
-
|
|
2863
|
+
u`<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>`
|
|
2864
2864
|
),
|
|
2865
2865
|
logOut: b(
|
|
2866
|
-
|
|
2866
|
+
u`<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/>`
|
|
2867
2867
|
),
|
|
2868
2868
|
settings: b(
|
|
2869
|
-
|
|
2869
|
+
u`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`
|
|
2870
2870
|
),
|
|
2871
|
-
x: b(
|
|
2872
|
-
check: b(
|
|
2871
|
+
x: b(u`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`),
|
|
2872
|
+
check: b(u`<path d="M20 6 9 17l-5-5"/>`),
|
|
2873
2873
|
users: b(
|
|
2874
|
-
|
|
2874
|
+
u`<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>`
|
|
2875
2875
|
),
|
|
2876
2876
|
copy: b(
|
|
2877
|
-
|
|
2877
|
+
u`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`
|
|
2878
2878
|
),
|
|
2879
2879
|
eye: b(
|
|
2880
|
-
|
|
2880
|
+
u`<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>`
|
|
2881
2881
|
),
|
|
2882
2882
|
eyeOff: b(
|
|
2883
|
-
|
|
2883
|
+
u`<path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/>`
|
|
2884
2884
|
),
|
|
2885
|
-
arrowLeft: b(
|
|
2885
|
+
arrowLeft: b(u`<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>`),
|
|
2886
2886
|
alert: b(
|
|
2887
|
-
|
|
2887
|
+
u`<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>`
|
|
2888
2888
|
),
|
|
2889
|
-
info: b(
|
|
2890
|
-
checkCircle: b(
|
|
2889
|
+
info: b(u`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`),
|
|
2890
|
+
checkCircle: b(u`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`),
|
|
2891
2891
|
link: b(
|
|
2892
|
-
|
|
2892
|
+
u`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`
|
|
2893
2893
|
),
|
|
2894
2894
|
activity: b(
|
|
2895
|
-
|
|
2895
|
+
u`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>`
|
|
2896
2896
|
),
|
|
2897
2897
|
trash: b(
|
|
2898
|
-
|
|
2898
|
+
u`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`
|
|
2899
2899
|
),
|
|
2900
2900
|
sparkles: b(
|
|
2901
|
-
|
|
2901
|
+
u`<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>`
|
|
2902
2902
|
),
|
|
2903
2903
|
refresh: b(
|
|
2904
|
-
|
|
2904
|
+
u`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`
|
|
2905
2905
|
),
|
|
2906
|
-
chevronDown: b(
|
|
2906
|
+
chevronDown: b(u`<path d="m6 9 6 6 6-6"/>`),
|
|
2907
2907
|
ghost: b(
|
|
2908
|
-
|
|
2908
|
+
u`<path d="M9 10h.01"/><path d="M15 10h.01"/><path d="M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z"/>`
|
|
2909
2909
|
),
|
|
2910
2910
|
qr: b(
|
|
2911
|
-
|
|
2911
|
+
u`<rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/>`
|
|
2912
2912
|
)
|
|
2913
|
-
},
|
|
2914
|
-
google:
|
|
2915
|
-
|
|
2913
|
+
}, S = (e, t = "0 0 24 24") => r`<svg xmlns="http://www.w3.org/2000/svg" viewBox=${t} aria-hidden="true">${e}</svg>`, Gt = {
|
|
2914
|
+
google: S(
|
|
2915
|
+
u`<path fill="#4285F4" d="M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47a5.57 5.57 0 0 1-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"/><path fill="#34A853" d="M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.09A11.99 11.99 0 0 0 12 24z"/><path fill="#FBBC05" d="M5.27 14.29A7.2 7.2 0 0 1 4.89 12c0-.8.14-1.57.38-2.29V6.62H1.29A11.97 11.97 0 0 0 0 12c0 1.94.46 3.77 1.29 5.38l3.98-3.09z"/><path fill="#EA4335" d="M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.69 1.29 6.62l3.98 3.09C6.22 6.86 8.87 4.75 12 4.75z"/>`
|
|
2916
2916
|
),
|
|
2917
|
-
github:
|
|
2918
|
-
|
|
2917
|
+
github: S(
|
|
2918
|
+
u`<path fill="currentColor" d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/>`
|
|
2919
2919
|
),
|
|
2920
|
-
apple:
|
|
2921
|
-
|
|
2920
|
+
apple: S(
|
|
2921
|
+
u`<path fill="currentColor" d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>`
|
|
2922
2922
|
),
|
|
2923
|
-
facebook:
|
|
2924
|
-
|
|
2923
|
+
facebook: S(
|
|
2924
|
+
u`<path fill="#1877F2" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>`
|
|
2925
2925
|
),
|
|
2926
|
-
x:
|
|
2927
|
-
|
|
2926
|
+
x: S(
|
|
2927
|
+
u`<path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>`
|
|
2928
2928
|
),
|
|
2929
|
-
microsoft:
|
|
2930
|
-
|
|
2929
|
+
microsoft: S(
|
|
2930
|
+
u`<path fill="#F25022" d="M1 1h10v10H1z"/><path fill="#7FBA00" d="M13 1h10v10H13z"/><path fill="#00A4EF" d="M1 13h10v10H1z"/><path fill="#FFB900" d="M13 13h10v10H13z"/>`
|
|
2931
2931
|
),
|
|
2932
|
-
discord:
|
|
2933
|
-
|
|
2932
|
+
discord: S(
|
|
2933
|
+
u`<path fill="#5865F2" d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/>`
|
|
2934
2934
|
),
|
|
2935
|
-
gitlab:
|
|
2936
|
-
|
|
2935
|
+
gitlab: S(
|
|
2936
|
+
u`<path fill="#FC6D26" d="m23.6 9.593-.033-.086L20.3.98a.851.851 0 0 0-.336-.405.876.876 0 0 0-1.001.054.874.874 0 0 0-.29.44l-2.205 6.748H7.535L5.33 1.069a.857.857 0 0 0-.29-.441.876.876 0 0 0-1.001-.054.86.86 0 0 0-.336.405L.436 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.011.009.03.021 4.976 3.727 2.462 1.863 1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.5-1.132 2.461-1.863 5.006-3.75.013-.01a6.068 6.068 0 0 0 2.006-7.002z"/>`
|
|
2937
2937
|
),
|
|
2938
|
-
linkedin:
|
|
2939
|
-
|
|
2938
|
+
linkedin: S(
|
|
2939
|
+
u`<path fill="#0A66C2" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>`
|
|
2940
2940
|
),
|
|
2941
|
-
slack:
|
|
2942
|
-
|
|
2941
|
+
slack: S(
|
|
2942
|
+
u`<path fill="#E01E5A" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z"/><path fill="#36C5F0" d="M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z"/><path fill="#2EB67D" d="M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.163 0a2.528 2.528 0 0 1 2.523 2.522v6.312z"/><path fill="#ECB22E" d="M15.163 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.163 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.27a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.315A2.527 2.527 0 0 1 24 15.163a2.528 2.528 0 0 1-2.522 2.523h-6.315z"/>`
|
|
2943
2943
|
),
|
|
2944
|
-
twitch:
|
|
2945
|
-
|
|
2944
|
+
twitch: S(
|
|
2945
|
+
u`<path fill="#9146FF" d="M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0 1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"/>`
|
|
2946
2946
|
),
|
|
2947
|
-
spotify:
|
|
2948
|
-
|
|
2947
|
+
spotify: S(
|
|
2948
|
+
u`<path fill="#1DB954" d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"/>`
|
|
2949
2949
|
),
|
|
2950
|
-
notion:
|
|
2951
|
-
|
|
2950
|
+
notion: S(
|
|
2951
|
+
u`<path fill="currentColor" d="M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"/>`
|
|
2952
2952
|
),
|
|
2953
|
-
dropbox:
|
|
2954
|
-
|
|
2953
|
+
dropbox: S(
|
|
2954
|
+
u`<path fill="#0061FF" d="M6 1.807 0 5.629l6 3.822 6.001-3.822L6 1.807zm12 0-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zm18-3.822-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"/>`
|
|
2955
2955
|
),
|
|
2956
|
-
figma:
|
|
2957
|
-
|
|
2956
|
+
figma: S(
|
|
2957
|
+
u`<path fill="#F24E1E" d="M8 24a4 4 0 0 0 4-4v-4H8a4 4 0 0 0 0 8z"/><path fill="#A259FF" d="M4 12a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#FF7262" d="M4 4a4 4 0 0 1 4-4h4v8H8a4 4 0 0 1-4-4z"/><path fill="#1ABCFE" d="M12 0h4a4 4 0 0 1 0 8h-4V0z"/><path fill="#0ACF83" d="M20 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/>`
|
|
2958
2958
|
),
|
|
2959
|
-
bitbucket:
|
|
2960
|
-
|
|
2959
|
+
bitbucket: S(
|
|
2960
|
+
u`<path fill="#2684FF" d="M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"/>`
|
|
2961
2961
|
),
|
|
2962
|
-
amazon:
|
|
2963
|
-
|
|
2962
|
+
amazon: S(
|
|
2963
|
+
u`<path fill="currentColor" d="M.045 18.02c.072-.116.187-.124.348-.022 3.636 2.11 7.594 3.166 11.87 3.166 2.852 0 5.668-.533 8.447-1.595l.315-.14c.138-.06.234-.1.293-.13.226-.088.39-.046.525.13.12.174.09.336-.12.48-.256.19-.6.41-1.006.654-1.244.743-2.64 1.316-4.185 1.726a17.617 17.617 0 0 1-10.951-.577 17.88 17.88 0 0 1-5.43-3.35c-.1-.074-.151-.15-.151-.22 0-.047.021-.09.051-.13zm6.565-6.218c0-1.005.247-1.863.743-2.577.495-.71 1.17-1.25 2.04-1.615.796-.335 1.756-.575 2.912-.72.39-.046 1.033-.103 1.92-.174v-.37c0-.93-.105-1.558-.3-1.875-.302-.43-.78-.65-1.44-.65h-.182c-.48.046-.896.196-1.246.46-.35.27-.575.63-.675 1.096-.06.3-.206.465-.435.51l-2.52-.315c-.248-.06-.372-.18-.372-.39 0-.046.007-.09.022-.15.247-1.29.855-2.25 1.82-2.88.976-.616 2.1-.975 3.39-1.05h.54c1.65 0 2.957.434 3.888 1.29.135.15.27.3.405.48.12.165.224.314.283.45.075.134.15.33.195.57.06.254.105.42.135.51.03.104.062.3.076.615.01.313.02.493.02.553v5.28c0 .376.06.72.165 1.036.105.313.21.54.315.674l.51.674c.09.136.136.256.136.36 0 .12-.06.226-.18.314-1.2 1.05-1.86 1.62-1.963 1.71-.165.135-.373.15-.61.045a6.62 6.62 0 0 1-.526-.496l-.31-.347a9.858 9.858 0 0 1-.317-.42l-.3-.435c-.81.886-1.603 1.44-2.4 1.665-.494.15-1.093.227-1.83.227-1.11 0-2.04-.343-2.76-1.034-.72-.69-1.08-1.665-1.08-2.94l-.05-.076zm3.753-.438c0 .566.14 1.02.425 1.364.285.34.675.512 1.155.512.045 0 .106-.007.195-.02.09-.016.134-.023.166-.023.614-.16 1.08-.553 1.424-1.178.165-.28.285-.58.36-.91.09-.32.12-.59.135-.8.015-.195.015-.54.015-1.005v-.54c-.84 0-1.484.06-1.92.18-1.275.36-1.92 1.17-1.92 2.43l-.035-.01zm9.162 7.027c.03-.06.075-.11.132-.17.362-.243.714-.41 1.05-.5a8.094 8.094 0 0 1 1.612-.24c.14-.012.28 0 .41.03.65.06 1.05.168 1.172.33.063.09.099.228.099.39v.15c0 .51-.149 1.11-.424 1.8-.278.69-.664 1.248-1.156 1.68-.073.06-.14.09-.197.09-.03 0-.06 0-.09-.012-.09-.044-.107-.12-.064-.24.54-1.26.806-2.143.806-2.64 0-.15-.03-.27-.087-.344-.145-.166-.55-.257-1.224-.257-.243 0-.533.016-.87.045-.363.045-.7.09-1 .135-.09 0-.148-.014-.18-.044-.03-.03-.036-.06-.02-.106 0-.014.007-.03.02-.06z"/>`
|
|
2964
2964
|
),
|
|
2965
|
-
paypal:
|
|
2966
|
-
|
|
2965
|
+
paypal: S(
|
|
2966
|
+
u`<path fill="#003087" d="M7.076 21.337H2.47a.641.641 0 0 1-.633-.74L4.944.901C5.026.382 5.474 0 5.998 0h7.46c2.57 0 4.578.543 5.69 1.81 1.01 1.15 1.304 2.42 1.012 4.287-.023.143-.047.288-.077.437-.983 5.05-4.349 6.797-8.647 6.797h-2.19c-.524 0-.968.382-1.05.9l-1.12 7.106zm14.146-14.42a3.35 3.35 0 0 0-.607-.541c-.013.076-.026.175-.041.254-.93 4.778-4.005 7.201-9.138 7.201h-2.19a.563.563 0 0 0-.556.479l-1.187 7.527h-.506l-.24 1.516a.56.56 0 0 0 .554.647h3.882c.46 0 .85-.334.922-.788.06-.26.76-4.852.816-5.09a.932.932 0 0 1 .923-.788h.58c3.76 0 6.705-1.528 7.565-5.946.36-1.847.174-3.388-.777-4.471z"/>`
|
|
2967
2967
|
)
|
|
2968
2968
|
};
|
|
2969
2969
|
function B(e) {
|
|
2970
|
-
return Gt[e] ??
|
|
2970
|
+
return Gt[e] ?? o.globe;
|
|
2971
2971
|
}
|
|
2972
|
-
function
|
|
2972
|
+
function lt(e) {
|
|
2973
2973
|
const t = (e.trim()[0] ?? "?").toUpperCase();
|
|
2974
|
-
return /[A-Z0-9]/i.test(t) ? t :
|
|
2974
|
+
return /[A-Z0-9]/i.test(t) ? t : o.user;
|
|
2975
2975
|
}
|
|
2976
2976
|
function X(e) {
|
|
2977
2977
|
typeof document > "u" || (document.querySelector("authui-modal") || document.body.appendChild(document.createElement("authui-modal")), queueMicrotask(() => {
|
|
@@ -2981,7 +2981,7 @@ function X(e) {
|
|
|
2981
2981
|
function de() {
|
|
2982
2982
|
typeof window > "u" || window.dispatchEvent(new CustomEvent("authui:close"));
|
|
2983
2983
|
}
|
|
2984
|
-
function
|
|
2984
|
+
function rt(e) {
|
|
2985
2985
|
const t = {
|
|
2986
2986
|
length: e.length >= 8,
|
|
2987
2987
|
long: e.length >= 12,
|
|
@@ -2997,36 +2997,40 @@ function st(e) {
|
|
|
2997
2997
|
let s, a;
|
|
2998
2998
|
return !t.length || i <= 1 ? (s = 1, a = "passwordStrengthTooWeak") : i === 2 ? (s = 2, a = "passwordStrengthWeak") : i === 3 ? (s = 3, a = "passwordStrengthFair") : i >= 5 && t.long && t.lower && t.upper && t.number && t.symbol ? (s = 4, a = "passwordStrengthVeryStrong") : (s = 4, a = "passwordStrengthStrong"), { level: s, percent: s * 25, labelKey: a, checks: t };
|
|
2999
2999
|
}
|
|
3000
|
-
var Yt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor,
|
|
3001
|
-
for (var a = s > 1 ? void 0 : s ? Zt(t, i) : t,
|
|
3002
|
-
(
|
|
3000
|
+
var Yt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, k = (e, t, i, s) => {
|
|
3001
|
+
for (var a = s > 1 ? void 0 : s ? Zt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
3002
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
3003
3003
|
return s && a && Yt(t, i, a), a;
|
|
3004
3004
|
};
|
|
3005
|
-
let
|
|
3005
|
+
let $ = class extends E {
|
|
3006
3006
|
constructor() {
|
|
3007
|
-
super(...arguments), this.view = "sign-in", this.embedded = !1, this.step = "sign-in", this.busy = !1, this.error = "", this.notice = null, this.showPassword = !1, this.expandedOAuth = null, this.token = null, this.focusOnStep = !1, this.resendCooldownUntil = 0, this.challenge = null, this.recovery = null, this.email = "", this.password = "", this.passwordConfirm = "", this.name = "", this.phone = "", this.code = "", this.legalAccepted = !1, this.onSignIn = (e) => {
|
|
3007
|
+
super(...arguments), this.view = "sign-in", this.embedded = !1, this.step = "sign-in", this.busy = !1, this.error = "", this.notice = null, this.showPassword = !1, this.showPasswordConfirm = !1, this.expandedOAuth = null, this.token = null, this.focusOnStep = !1, this.resendCooldownUntil = 0, this.challenge = null, this.recovery = null, this.email = "", this.password = "", this.passwordConfirm = "", this.name = "", this.phone = "", this.code = "", this.legalAccepted = !1, this.legalErrorFromOAuth = !1, this.onSignIn = (e) => {
|
|
3008
3008
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3009
|
-
await
|
|
3009
|
+
await l.signInWithEmailPassword(this.email, this.password), this.password = "", _("email-password"), this.fire("authui-success", { method: "email-password" });
|
|
3010
3010
|
});
|
|
3011
3011
|
}, this.onSignUp = (e) => {
|
|
3012
|
-
e.preventDefault(), this.requireValid(e) && this.ensureLegalAccepted() && this.run(async () => {
|
|
3013
|
-
await
|
|
3014
|
-
});
|
|
3012
|
+
e.preventDefault(), this.requireValid(e) && (this.legalErrorFromOAuth = !1, this.ensureLegalAccepted() && this.run(async () => {
|
|
3013
|
+
await l.signUp(this.email, this.password, this.name), this.password = "", _("email-password"), this.fire("authui-success", { method: "sign-up" });
|
|
3014
|
+
}));
|
|
3015
3015
|
}, this.onGuest = () => {
|
|
3016
3016
|
this.run(async () => {
|
|
3017
|
-
await
|
|
3017
|
+
await l.signInAnonymously(), _("anonymous"), this.fire("authui-success", { method: "anonymous" });
|
|
3018
3018
|
});
|
|
3019
3019
|
}, this.onOAuth = (e) => {
|
|
3020
|
-
this.step === "sign-up" && !this.ensureLegalAccepted()
|
|
3021
|
-
|
|
3022
|
-
|
|
3020
|
+
if (this.step === "sign-up" && !this.ensureLegalAccepted()) {
|
|
3021
|
+
this.legalErrorFromOAuth = !0;
|
|
3022
|
+
return;
|
|
3023
|
+
}
|
|
3024
|
+
this.legalErrorFromOAuth = !1, this.run(async () => {
|
|
3025
|
+
if (Ft(e), await l.signInWithOAuth(e), l.isPreview) {
|
|
3026
|
+
$t(), this.fire("authui-success", { method: "oauth" });
|
|
3023
3027
|
return;
|
|
3024
3028
|
}
|
|
3025
3029
|
await new Promise((t) => setTimeout(t, 4e3));
|
|
3026
3030
|
});
|
|
3027
3031
|
}, this.onForgot = (e) => {
|
|
3028
3032
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3029
|
-
await
|
|
3033
|
+
await l.sendPasswordRecovery(this.email), this.notice = { tone: "success", message: this.t("resetLinkSent", { email: this.email }) };
|
|
3030
3034
|
});
|
|
3031
3035
|
}, this.onReset = (e) => {
|
|
3032
3036
|
if (e.preventDefault(), !this.requireValid(e)) return;
|
|
@@ -3036,11 +3040,11 @@ let x = class extends E {
|
|
|
3036
3040
|
}
|
|
3037
3041
|
const t = this.recovery;
|
|
3038
3042
|
t && this.run(async () => {
|
|
3039
|
-
await
|
|
3043
|
+
await l.completePasswordRecovery(t.userId, t.secret, this.password), this.password = "", this.passwordConfirm = "", this.recovery = null, this.auth.pending?.type === "reset-password" && l.setPending(null), this.go("sign-in"), this.notice = { tone: "success", message: this.t("passwordUpdated") };
|
|
3040
3044
|
});
|
|
3041
3045
|
}, this.onMagicUrl = (e) => {
|
|
3042
3046
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3043
|
-
const t = await
|
|
3047
|
+
const t = await l.sendMagicUrl(this.email);
|
|
3044
3048
|
this.token = {
|
|
3045
3049
|
userId: t.userId,
|
|
3046
3050
|
kind: "magic-url",
|
|
@@ -3050,47 +3054,47 @@ let x = class extends E {
|
|
|
3050
3054
|
});
|
|
3051
3055
|
}, this.onEmailOtp = (e) => {
|
|
3052
3056
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3053
|
-
const t = await
|
|
3057
|
+
const t = await l.sendEmailOtp(this.email);
|
|
3054
3058
|
this.token = {
|
|
3055
3059
|
userId: t.userId,
|
|
3056
3060
|
kind: "email-otp",
|
|
3057
3061
|
target: this.email,
|
|
3058
3062
|
phrase: t.phrase
|
|
3059
|
-
}, this.code = "";
|
|
3063
|
+
}, this.code = "", this.resendCooldownUntil = Date.now() + 3e4, window.setTimeout(() => this.requestUpdate(), 3e4);
|
|
3060
3064
|
});
|
|
3061
3065
|
}, this.onPhoneOtp = (e) => {
|
|
3062
3066
|
e.preventDefault(), this.requireValid(e) && this.run(async () => {
|
|
3063
|
-
const t = await
|
|
3064
|
-
this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "";
|
|
3067
|
+
const t = await l.sendPhoneOtp(this.phone);
|
|
3068
|
+
this.token = { userId: t.userId, kind: "phone", target: this.phone }, this.code = "", this.resendCooldownUntil = Date.now() + 3e4, window.setTimeout(() => this.requestUpdate(), 3e4);
|
|
3065
3069
|
});
|
|
3066
3070
|
}, this.onVerifyCode = (e) => {
|
|
3067
3071
|
if (e.preventDefault(), !this.requireValid(e)) return;
|
|
3068
3072
|
const t = this.token;
|
|
3069
3073
|
t && this.run(async () => {
|
|
3070
|
-
await
|
|
3074
|
+
await l.signInWithToken(t.userId, this.code), this.code = "", this.token = null, _(t.kind), this.fire("authui-success", { method: t.kind });
|
|
3071
3075
|
}, "code");
|
|
3072
3076
|
}, this.onChooseFactor = (e) => {
|
|
3073
3077
|
this.run(async () => {
|
|
3074
|
-
const t = await
|
|
3078
|
+
const t = await l.createMfaChallenge(e);
|
|
3075
3079
|
this.challenge = { id: t.$id, factor: e }, this.code = "";
|
|
3076
3080
|
});
|
|
3077
3081
|
}, this.onVerifyFactor = (e) => {
|
|
3078
3082
|
if (e.preventDefault(), !this.requireValid(e)) return;
|
|
3079
3083
|
const t = this.challenge;
|
|
3080
3084
|
t && this.run(async () => {
|
|
3081
|
-
await
|
|
3085
|
+
await l.completeMfaChallenge(t.id, this.code), this.code = "", this.challenge = null, this.go("sign-in"), this.fire("authui-success", { method: "mfa" });
|
|
3082
3086
|
}, "code");
|
|
3083
3087
|
}, this.onCancelMfa = () => {
|
|
3084
3088
|
this.run(async () => {
|
|
3085
3089
|
try {
|
|
3086
|
-
await
|
|
3090
|
+
await l.signOut();
|
|
3087
3091
|
} catch (e) {
|
|
3088
|
-
if (!j(e,
|
|
3092
|
+
if (!j(e, v.sessionNotFound)) throw e;
|
|
3089
3093
|
}
|
|
3090
3094
|
this.go("sign-in");
|
|
3091
3095
|
});
|
|
3092
3096
|
}, this.onSignOut = () => {
|
|
3093
|
-
this.run(() =>
|
|
3097
|
+
this.run(() => l.signOut());
|
|
3094
3098
|
};
|
|
3095
3099
|
}
|
|
3096
3100
|
connectedCallback() {
|
|
@@ -3114,10 +3118,10 @@ let x = class extends E {
|
|
|
3114
3118
|
}
|
|
3115
3119
|
/** Navigate between screens and reset transient state. */
|
|
3116
3120
|
dismissNotice() {
|
|
3117
|
-
this.notice = null, this.auth.pending?.type === "notice" &&
|
|
3121
|
+
this.notice = null, this.auth.pending?.type === "notice" && l.setPending(null);
|
|
3118
3122
|
}
|
|
3119
3123
|
go(e) {
|
|
3120
|
-
e === "sign-up" && this.config?.signUp === !1 && (e = "sign-in"), this.focusOnStep = !0, this.step = e, this.error = "", this.notice = null, this.busy = !1, this.showPassword = !1, this.password = "", this.passwordConfirm = "", this.legalAccepted = !1, e !== "mfa" && (this.challenge = null), e !== "email-otp" && e !== "phone" && e !== "magic-url" && (this.token = null), this.fire("authui-view", { view: e });
|
|
3124
|
+
e === "sign-up" && this.config?.signUp === !1 && (e = "sign-in"), this.focusOnStep = !0, this.step = e, this.error = "", this.notice = null, this.busy = !1, this.showPassword = !1, this.showPasswordConfirm = !1, this.password = "", this.passwordConfirm = "", this.legalAccepted = !1, this.legalErrorFromOAuth = !1, e !== "mfa" && (this.challenge = null), e !== "email-otp" && e !== "phone" && e !== "magic-url" && (this.token = null), this.fire("authui-view", { view: e });
|
|
3121
3125
|
}
|
|
3122
3126
|
// ───────────────────────────── actions ─────────────────────────────
|
|
3123
3127
|
async run(e, t = "link") {
|
|
@@ -3149,14 +3153,14 @@ let x = class extends E {
|
|
|
3149
3153
|
<div class="panel ${this.embedded ? "embedded" : ""}" part="panel">
|
|
3150
3154
|
${this.renderHeader()}
|
|
3151
3155
|
${this.notice ? r`<div class="alert alert-${this.notice.tone}" role="status">
|
|
3152
|
-
${this.notice.tone === "success" ?
|
|
3156
|
+
${this.notice.tone === "success" ? o.checkCircle : this.notice.tone === "error" ? o.alert : o.info}
|
|
3153
3157
|
<div class="alert-body">${this.notice.message}</div>
|
|
3154
3158
|
<button
|
|
3155
3159
|
class="btn btn-ghost btn-icon dismiss"
|
|
3156
3160
|
@click=${() => this.dismissNotice()}
|
|
3157
3161
|
aria-label=${this.t("close")}
|
|
3158
3162
|
>
|
|
3159
|
-
${
|
|
3163
|
+
${o.x}
|
|
3160
3164
|
</button>
|
|
3161
3165
|
</div>` : n}
|
|
3162
3166
|
${e}
|
|
@@ -3201,7 +3205,7 @@ let x = class extends E {
|
|
|
3201
3205
|
a.target.hidden = !0;
|
|
3202
3206
|
}}
|
|
3203
3207
|
/>` : n}
|
|
3204
|
-
${
|
|
3208
|
+
${l.isPreview ? r`<span class="badge badge-info preview">${this.t("preview")}</span>` : n}
|
|
3205
3209
|
<h2 class="title" id="authui-title">${i}</h2>
|
|
3206
3210
|
${s ? r`<p class="description">${s}</p>` : n}
|
|
3207
3211
|
</div>
|
|
@@ -3209,7 +3213,7 @@ let x = class extends E {
|
|
|
3209
3213
|
}
|
|
3210
3214
|
renderError() {
|
|
3211
3215
|
return this.error ? r`<div class="alert alert-error" role="alert">
|
|
3212
|
-
${
|
|
3216
|
+
${o.alert}
|
|
3213
3217
|
<div class="alert-body">${this.error}</div>
|
|
3214
3218
|
</div>` : n;
|
|
3215
3219
|
}
|
|
@@ -3219,7 +3223,7 @@ let x = class extends E {
|
|
|
3219
3223
|
</button>`;
|
|
3220
3224
|
}
|
|
3221
3225
|
passwordField(e) {
|
|
3222
|
-
const t = this[e.field], i = e.meter ?
|
|
3226
|
+
const t = this[e.field], i = e.field === "passwordConfirm" ? this.showPasswordConfirm : this.showPassword, s = e.meter ? rt(t) : null;
|
|
3223
3227
|
return r`
|
|
3224
3228
|
<div class="field">
|
|
3225
3229
|
<div class="field-header">
|
|
@@ -3236,7 +3240,7 @@ let x = class extends E {
|
|
|
3236
3240
|
<input
|
|
3237
3241
|
class="input"
|
|
3238
3242
|
id=${e.id}
|
|
3239
|
-
type=${
|
|
3243
|
+
type=${i ? "text" : "password"}
|
|
3240
3244
|
autocomplete=${e.autocomplete}
|
|
3241
3245
|
required
|
|
3242
3246
|
minlength="8"
|
|
@@ -3246,26 +3250,28 @@ let x = class extends E {
|
|
|
3246
3250
|
<button
|
|
3247
3251
|
type="button"
|
|
3248
3252
|
class="btn btn-ghost btn-icon"
|
|
3249
|
-
@click=${() =>
|
|
3250
|
-
|
|
3253
|
+
@click=${() => {
|
|
3254
|
+
e.field === "passwordConfirm" ? this.showPasswordConfirm = !this.showPasswordConfirm : this.showPassword = !this.showPassword;
|
|
3255
|
+
}}
|
|
3256
|
+
aria-label=${i ? this.t("hidePassword") : this.t("showPassword")}
|
|
3251
3257
|
>
|
|
3252
|
-
${
|
|
3258
|
+
${i ? o.eyeOff : o.eye}
|
|
3253
3259
|
</button>
|
|
3254
3260
|
</div>
|
|
3255
|
-
${
|
|
3261
|
+
${s && t ? r`<div class="strength" aria-live="polite">
|
|
3256
3262
|
<div
|
|
3257
3263
|
class="strength-meter"
|
|
3258
|
-
data-level=${String(
|
|
3264
|
+
data-level=${String(s.level)}
|
|
3259
3265
|
role="meter"
|
|
3260
3266
|
aria-label=${this.t("passwordStrengthLabel")}
|
|
3261
3267
|
aria-valuemin="0"
|
|
3262
3268
|
aria-valuemax="4"
|
|
3263
|
-
aria-valuenow=${String(
|
|
3264
|
-
aria-valuetext=${this.t(
|
|
3269
|
+
aria-valuenow=${String(s.level)}
|
|
3270
|
+
aria-valuetext=${this.t(s.labelKey)}
|
|
3265
3271
|
>
|
|
3266
3272
|
<span></span><span></span><span></span><span></span>
|
|
3267
3273
|
</div>
|
|
3268
|
-
<p class="strength-label">${this.t(
|
|
3274
|
+
<p class="strength-label">${this.t(s.labelKey)}</p>
|
|
3269
3275
|
</div>` : e.hint ? r`<p class="hint">${e.hint}</p>` : n}
|
|
3270
3276
|
</div>
|
|
3271
3277
|
`;
|
|
@@ -3330,7 +3336,7 @@ let x = class extends E {
|
|
|
3330
3336
|
type="checkbox"
|
|
3331
3337
|
.checked=${this.legalAccepted}
|
|
3332
3338
|
@change=${(e) => {
|
|
3333
|
-
this.legalAccepted = e.target.checked, this.legalAccepted && this.error === this.t("errorLegalRequired") && (this.error = "");
|
|
3339
|
+
this.legalAccepted = e.target.checked, this.legalAccepted && this.error === this.t("errorLegalRequired") && (this.error = "", this.legalErrorFromOAuth = !1);
|
|
3334
3340
|
}}
|
|
3335
3341
|
/>
|
|
3336
3342
|
<span>${this.t("acceptLegal")} ${this.legalLinks()}.</span>
|
|
@@ -3339,19 +3345,19 @@ let x = class extends E {
|
|
|
3339
3345
|
backLink(e = "sign-in") {
|
|
3340
3346
|
return r`<div class="links">
|
|
3341
3347
|
<button type="button" class="btn btn-link" @click=${() => this.go(e)}>
|
|
3342
|
-
${
|
|
3348
|
+
${o.arrowLeft} ${this.t("back")}
|
|
3343
3349
|
</button>
|
|
3344
3350
|
</div>`;
|
|
3345
3351
|
}
|
|
3346
3352
|
renderStep() {
|
|
3347
3353
|
if (this.auth.configError)
|
|
3348
3354
|
return r`<div class="alert alert-error" role="alert">
|
|
3349
|
-
${
|
|
3355
|
+
${o.alert}
|
|
3350
3356
|
<div class="alert-body">${this.auth.configError}</div>
|
|
3351
3357
|
</div>`;
|
|
3352
3358
|
if (!this.auth.configured)
|
|
3353
3359
|
return r`<div class="alert alert-error" role="alert">
|
|
3354
|
-
${
|
|
3360
|
+
${o.alert}
|
|
3355
3361
|
<div class="alert-body">${this.t("errorNotConfigured")}</div>
|
|
3356
3362
|
</div>`;
|
|
3357
3363
|
if (this.auth.status === "loading")
|
|
@@ -3382,7 +3388,7 @@ let x = class extends E {
|
|
|
3382
3388
|
<div class="stack">
|
|
3383
3389
|
<div class="row">
|
|
3384
3390
|
<div class="inline">
|
|
3385
|
-
<span class="avatar">${
|
|
3391
|
+
<span class="avatar">${lt(t)}</span>
|
|
3386
3392
|
<div class="row-main">
|
|
3387
3393
|
<span class="row-title" title=${t}>${t}</span>
|
|
3388
3394
|
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
|
|
@@ -3400,10 +3406,10 @@ let x = class extends E {
|
|
|
3400
3406
|
this.embedded ? this.fire("authui-open", { view: "account" }) : X("account");
|
|
3401
3407
|
}}
|
|
3402
3408
|
>
|
|
3403
|
-
${
|
|
3409
|
+
${o.settings} ${this.t("manageAccount")}
|
|
3404
3410
|
</button>
|
|
3405
3411
|
<button class="btn btn-ghost btn-block" @click=${this.onSignOut} ?disabled=${this.busy}>
|
|
3406
|
-
${
|
|
3412
|
+
${o.logOut} ${this.t("signOut")}
|
|
3407
3413
|
</button>
|
|
3408
3414
|
</div>
|
|
3409
3415
|
</div>
|
|
@@ -3412,51 +3418,56 @@ let x = class extends E {
|
|
|
3412
3418
|
renderProviders() {
|
|
3413
3419
|
const e = [...this.config?.methods?.oauth ?? []];
|
|
3414
3420
|
if (e.length === 0) return n;
|
|
3415
|
-
const t =
|
|
3416
|
-
if (a === "icon")
|
|
3421
|
+
const t = z(), i = e.find((d) => t === `oauth:${d}`) ?? null, s = this.config?.methods?.oauthLayout, a = s === "horizontal" || s === "icon" ? "icon" : s === "stack" || s === "accordion" ? s : e.length <= 2 ? "stack" : "accordion";
|
|
3422
|
+
if (a === "icon") {
|
|
3423
|
+
const d = [...e].sort((g, y) => {
|
|
3424
|
+
const C = t === `oauth:${g}` ? 0 : 1, tt = t === `oauth:${y}` ? 0 : 1;
|
|
3425
|
+
return C - tt;
|
|
3426
|
+
});
|
|
3417
3427
|
return r`
|
|
3418
3428
|
<div class="providers icon">
|
|
3419
|
-
${
|
|
3420
|
-
const
|
|
3429
|
+
${d.map((g) => {
|
|
3430
|
+
const y = t === `oauth:${g}`, C = this.t("continueWith", { provider: N(g) });
|
|
3421
3431
|
return r`<button
|
|
3422
3432
|
type="button"
|
|
3423
|
-
class="btn btn-outline ${
|
|
3424
|
-
@click=${() => this.onOAuth(
|
|
3433
|
+
class="btn btn-outline ${y ? "last-used" : ""}"
|
|
3434
|
+
@click=${() => this.onOAuth(g)}
|
|
3425
3435
|
?disabled=${this.busy}
|
|
3426
|
-
aria-label=${
|
|
3427
|
-
title=${
|
|
3436
|
+
aria-label=${y ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3437
|
+
title=${C}
|
|
3428
3438
|
>
|
|
3429
|
-
${B(
|
|
3430
|
-
${
|
|
3439
|
+
${B(g)}
|
|
3440
|
+
${y ? r`<span class="oauth-last-used-dot" aria-hidden="true"></span>` : n}
|
|
3431
3441
|
</button>`;
|
|
3432
3442
|
})}
|
|
3433
3443
|
</div>
|
|
3434
3444
|
`;
|
|
3445
|
+
}
|
|
3435
3446
|
if (a === "stack") {
|
|
3436
|
-
const
|
|
3437
|
-
const
|
|
3438
|
-
return
|
|
3447
|
+
const d = [...e].sort((g, y) => {
|
|
3448
|
+
const C = t === `oauth:${g}` ? 0 : 1, tt = t === `oauth:${y}` ? 0 : 1;
|
|
3449
|
+
return C - tt;
|
|
3439
3450
|
});
|
|
3440
3451
|
return r`
|
|
3441
3452
|
<div class="providers">
|
|
3442
|
-
${
|
|
3443
|
-
const y = t === `oauth:${
|
|
3453
|
+
${d.map((g) => {
|
|
3454
|
+
const y = t === `oauth:${g}`, C = this.t("continueWith", { provider: N(g) });
|
|
3444
3455
|
return r`<button
|
|
3445
3456
|
type="button"
|
|
3446
3457
|
class="btn btn-outline ${y ? "last-used" : ""}"
|
|
3447
|
-
@click=${() => this.onOAuth(
|
|
3458
|
+
@click=${() => this.onOAuth(g)}
|
|
3448
3459
|
?disabled=${this.busy}
|
|
3449
|
-
aria-label=${y ? `${
|
|
3460
|
+
aria-label=${y ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3450
3461
|
>
|
|
3451
|
-
${B(
|
|
3452
|
-
<span>${
|
|
3462
|
+
${B(g)}
|
|
3463
|
+
<span>${C}</span>
|
|
3453
3464
|
${y ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
|
|
3454
3465
|
</button>`;
|
|
3455
3466
|
})}
|
|
3456
3467
|
</div>
|
|
3457
3468
|
`;
|
|
3458
3469
|
}
|
|
3459
|
-
const
|
|
3470
|
+
const h = this.expandedOAuth && e.includes(this.expandedOAuth) ? this.expandedOAuth : i ?? e[0];
|
|
3460
3471
|
return r`
|
|
3461
3472
|
<div
|
|
3462
3473
|
class="providers accordion"
|
|
@@ -3464,29 +3475,29 @@ let x = class extends E {
|
|
|
3464
3475
|
this.expandedOAuth = i ?? e[0];
|
|
3465
3476
|
}}
|
|
3466
3477
|
>
|
|
3467
|
-
${e.map((
|
|
3468
|
-
const
|
|
3478
|
+
${e.map((d) => {
|
|
3479
|
+
const g = t === `oauth:${d}`, y = h === d, C = this.t("continueWith", { provider: N(d) });
|
|
3469
3480
|
return r`<div
|
|
3470
3481
|
class="provider-slot ${y ? "is-expanded" : ""}"
|
|
3471
3482
|
@mouseenter=${() => {
|
|
3472
|
-
this.expandedOAuth =
|
|
3483
|
+
this.expandedOAuth = d;
|
|
3473
3484
|
}}
|
|
3474
3485
|
>
|
|
3475
3486
|
<button
|
|
3476
3487
|
type="button"
|
|
3477
3488
|
class="btn btn-outline"
|
|
3478
|
-
@click=${() => this.onOAuth(
|
|
3489
|
+
@click=${() => this.onOAuth(d)}
|
|
3479
3490
|
@focus=${() => {
|
|
3480
|
-
this.expandedOAuth =
|
|
3491
|
+
this.expandedOAuth = d;
|
|
3481
3492
|
}}
|
|
3482
3493
|
?disabled=${this.busy}
|
|
3483
|
-
aria-label=${
|
|
3494
|
+
aria-label=${g ? `${C}. ${this.t("lastUsed")}` : C}
|
|
3484
3495
|
>
|
|
3485
|
-
${B(
|
|
3496
|
+
${B(d)}
|
|
3486
3497
|
<span class="provider-label"
|
|
3487
|
-
><span><span class="provider-label-text">${
|
|
3498
|
+
><span><span class="provider-label-text">${C}</span></span></span
|
|
3488
3499
|
>
|
|
3489
|
-
${
|
|
3500
|
+
${g ? r`<span class="oauth-last-used" data-last-used=${d} aria-hidden="true">
|
|
3490
3501
|
<span class="oauth-last-used-dot"></span>
|
|
3491
3502
|
<span class="oauth-last-used-pill">${this.t("lastUsed")}</span>
|
|
3492
3503
|
</span>` : n}
|
|
@@ -3498,20 +3509,20 @@ let x = class extends E {
|
|
|
3498
3509
|
}
|
|
3499
3510
|
renderSignIn() {
|
|
3500
3511
|
const e = this.config?.methods ?? {}, t = e.emailPassword !== !1, i = (e.oauth?.length ?? 0) > 0, s = [
|
|
3501
|
-
e.magicUrl ? { step: "magic-url", icon:
|
|
3502
|
-
e.emailOtp ? { step: "email-otp", icon:
|
|
3503
|
-
e.phone ? { step: "phone", icon:
|
|
3512
|
+
e.magicUrl ? { step: "magic-url", icon: o.link, label: this.t("sendMagicLink") } : null,
|
|
3513
|
+
e.emailOtp ? { step: "email-otp", icon: o.mail, label: this.t("continueWithEmail") } : null,
|
|
3514
|
+
e.phone ? { step: "phone", icon: o.smartphone, label: this.t("continueWithPhone") } : null
|
|
3504
3515
|
].filter(Boolean);
|
|
3505
3516
|
return r`
|
|
3506
3517
|
<div class="stack">
|
|
3507
3518
|
${this.renderProviders()}
|
|
3508
3519
|
${i && (t || s.length > 0) ? r`<div class="separator-text">${this.t("or")}</div>` : n}
|
|
3509
3520
|
${t ? r`<form
|
|
3510
|
-
class="form ${
|
|
3521
|
+
class="form ${z() === "email-password" ? "last-used-form" : ""}"
|
|
3511
3522
|
@submit=${this.onSignIn}
|
|
3512
3523
|
novalidate
|
|
3513
3524
|
>
|
|
3514
|
-
${
|
|
3525
|
+
${z() === "email-password" ? r`<p class="hint">
|
|
3515
3526
|
<span class="last-used-badge">${this.t("lastUsed")}</span>
|
|
3516
3527
|
</p>` : n}
|
|
3517
3528
|
${this.emailField()}
|
|
@@ -3520,25 +3531,26 @@ let x = class extends E {
|
|
|
3520
3531
|
</form>` : this.renderError()}
|
|
3521
3532
|
${s.length > 0 ? r`<div class="stack-sm">
|
|
3522
3533
|
${s.map((a) => {
|
|
3523
|
-
const
|
|
3534
|
+
const h = z() === a.step;
|
|
3524
3535
|
return r`<button
|
|
3525
3536
|
type="button"
|
|
3526
|
-
class="btn btn-secondary btn-block ${
|
|
3537
|
+
class="btn btn-secondary btn-block ${h ? "last-used" : ""}"
|
|
3527
3538
|
@click=${() => this.go(a.step)}
|
|
3539
|
+
?disabled=${this.busy}
|
|
3528
3540
|
>
|
|
3529
3541
|
${a.icon} ${a.label}
|
|
3530
|
-
${
|
|
3542
|
+
${h ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
|
|
3531
3543
|
</button>`;
|
|
3532
3544
|
})}
|
|
3533
3545
|
</div>` : n}
|
|
3534
3546
|
${e.anonymous ? r`<button
|
|
3535
3547
|
type="button"
|
|
3536
|
-
class="btn btn-ghost btn-block ${
|
|
3548
|
+
class="btn btn-ghost btn-block ${z() === "anonymous" ? "last-used" : ""}"
|
|
3537
3549
|
@click=${this.onGuest}
|
|
3538
3550
|
?disabled=${this.busy}
|
|
3539
3551
|
>
|
|
3540
|
-
${
|
|
3541
|
-
${
|
|
3552
|
+
${o.ghost} ${this.t("continueAsGuest")}
|
|
3553
|
+
${z() === "anonymous" ? r`<span class="last-used-badge">${this.t("lastUsed")}</span>` : n}
|
|
3542
3554
|
</button>` : n}
|
|
3543
3555
|
${t && this.config?.signUp !== !1 ? r`<div class="links">
|
|
3544
3556
|
<span>${this.t("noAccount")}</span>
|
|
@@ -3551,9 +3563,10 @@ let x = class extends E {
|
|
|
3551
3563
|
`;
|
|
3552
3564
|
}
|
|
3553
3565
|
renderSignUp() {
|
|
3566
|
+
const e = this.legalErrorFromOAuth && this.error === this.t("errorLegalRequired");
|
|
3554
3567
|
return r`
|
|
3555
3568
|
<div class="stack">
|
|
3556
|
-
${this.renderProviders()}
|
|
3569
|
+
${this.renderProviders()} ${e ? this.renderError() : n}
|
|
3557
3570
|
${(this.config?.methods?.oauth?.length ?? 0) > 0 ? r`<div class="separator-text">${this.t("or")}</div>` : n}
|
|
3558
3571
|
<form class="form" @submit=${this.onSignUp} novalidate>
|
|
3559
3572
|
${this.config?.requireName !== !1 ? r`<div class="field">
|
|
@@ -3570,7 +3583,7 @@ let x = class extends E {
|
|
|
3570
3583
|
</div>` : n}
|
|
3571
3584
|
${this.emailField()}
|
|
3572
3585
|
${this.passwordField({ label: this.t("password"), autocomplete: "new-password", id: "authui-password", field: "password", hint: this.t("passwordHint"), meter: !0 })}
|
|
3573
|
-
${this.legalAcceptField()} ${this.renderError()}
|
|
3586
|
+
${this.legalAcceptField()} ${e ? n : this.renderError()}
|
|
3574
3587
|
${this.submitButton(this.t("createAccount"))}
|
|
3575
3588
|
</form>
|
|
3576
3589
|
<div class="links">
|
|
@@ -3609,13 +3622,13 @@ let x = class extends E {
|
|
|
3609
3622
|
this.step = "sign-in", this.error = "", this.notice = null, this.focusOnStep = !0, this.fire("authui-view", { view: "sign-in" });
|
|
3610
3623
|
}}
|
|
3611
3624
|
>
|
|
3612
|
-
${
|
|
3625
|
+
${o.arrowLeft} ${this.t("back")}
|
|
3613
3626
|
</button>
|
|
3614
3627
|
</div>
|
|
3615
3628
|
</div>
|
|
3616
3629
|
` : r`<div class="stack">
|
|
3617
3630
|
<div class="alert alert-error" role="alert">
|
|
3618
|
-
${
|
|
3631
|
+
${o.alert}
|
|
3619
3632
|
<div class="alert-body">${this.t("errorInvalidToken")}</div>
|
|
3620
3633
|
</div>
|
|
3621
3634
|
<div class="links">
|
|
@@ -3633,7 +3646,7 @@ let x = class extends E {
|
|
|
3633
3646
|
}
|
|
3634
3647
|
phraseBox(e) {
|
|
3635
3648
|
return e ? r`<div class="alert alert-info">
|
|
3636
|
-
${
|
|
3649
|
+
${o.shield}
|
|
3637
3650
|
<div class="alert-title">
|
|
3638
3651
|
${this.t("securityPhrase")}: <span class="code">${e}</span>
|
|
3639
3652
|
</div>
|
|
@@ -3643,7 +3656,7 @@ let x = class extends E {
|
|
|
3643
3656
|
renderMagicUrl() {
|
|
3644
3657
|
return this.token ? r`<div class="stack">
|
|
3645
3658
|
<div class="alert alert-success" role="status">
|
|
3646
|
-
${
|
|
3659
|
+
${o.mail}
|
|
3647
3660
|
<div class="alert-body">${this.t("magicLinkSent", { email: this.token.target })}</div>
|
|
3648
3661
|
</div>
|
|
3649
3662
|
${this.phraseBox(this.token.phrase)} ${this.backLink()}
|
|
@@ -3660,10 +3673,10 @@ let x = class extends E {
|
|
|
3660
3673
|
const e = this.token;
|
|
3661
3674
|
!e || Date.now() < this.resendCooldownUntil || (this.error = "", await this.run(async () => {
|
|
3662
3675
|
if (e.kind === "phone") {
|
|
3663
|
-
const t = await
|
|
3676
|
+
const t = await l.sendPhoneOtp(e.target);
|
|
3664
3677
|
this.token = { userId: t.userId, kind: "phone", target: e.target };
|
|
3665
3678
|
} else {
|
|
3666
|
-
const t = await
|
|
3679
|
+
const t = await l.sendEmailOtp(e.target);
|
|
3667
3680
|
this.token = {
|
|
3668
3681
|
userId: t.userId,
|
|
3669
3682
|
kind: "email-otp",
|
|
@@ -3678,7 +3691,7 @@ let x = class extends E {
|
|
|
3678
3691
|
const e = this.token?.kind === "phone", t = Date.now() < this.resendCooldownUntil;
|
|
3679
3692
|
return r`
|
|
3680
3693
|
<div class="alert alert-info" role="status">
|
|
3681
|
-
${e ?
|
|
3694
|
+
${e ? o.smartphone : o.mail}
|
|
3682
3695
|
<div class="alert-body">${this.t("codeSent", { target: this.token.target })}</div>
|
|
3683
3696
|
</div>
|
|
3684
3697
|
${this.phraseBox(this.token.phrase)}
|
|
@@ -3748,25 +3761,25 @@ let x = class extends E {
|
|
|
3748
3761
|
const i = [
|
|
3749
3762
|
{
|
|
3750
3763
|
factor: "totp",
|
|
3751
|
-
icon:
|
|
3764
|
+
icon: o.smartphone,
|
|
3752
3765
|
label: this.t("mfaUseAuthenticator"),
|
|
3753
3766
|
available: e?.totp ?? !0
|
|
3754
3767
|
},
|
|
3755
3768
|
{
|
|
3756
3769
|
factor: "email",
|
|
3757
|
-
icon:
|
|
3770
|
+
icon: o.mail,
|
|
3758
3771
|
label: this.t("mfaUseEmail"),
|
|
3759
3772
|
available: e?.email ?? !0
|
|
3760
3773
|
},
|
|
3761
3774
|
{
|
|
3762
3775
|
factor: "phone",
|
|
3763
|
-
icon:
|
|
3776
|
+
icon: o.phone,
|
|
3764
3777
|
label: this.t("mfaUsePhone"),
|
|
3765
3778
|
available: e?.phone ?? !0
|
|
3766
3779
|
},
|
|
3767
3780
|
{
|
|
3768
3781
|
factor: "recoverycode",
|
|
3769
|
-
icon:
|
|
3782
|
+
icon: o.key,
|
|
3770
3783
|
label: this.t("mfaUseRecoveryCode"),
|
|
3771
3784
|
available: e?.recoveryCode ?? !0
|
|
3772
3785
|
}
|
|
@@ -3814,7 +3827,7 @@ let x = class extends E {
|
|
|
3814
3827
|
</form>
|
|
3815
3828
|
<div class="links">
|
|
3816
3829
|
<button type="button" class="btn btn-link" @click=${() => this.challenge = null}>
|
|
3817
|
-
${
|
|
3830
|
+
${o.arrowLeft} ${this.t("back")}
|
|
3818
3831
|
</button>
|
|
3819
3832
|
<span aria-hidden="true">·</span>
|
|
3820
3833
|
<button type="button" class="btn btn-link" @click=${this.onCancelMfa}>
|
|
@@ -3825,69 +3838,75 @@ let x = class extends E {
|
|
|
3825
3838
|
`;
|
|
3826
3839
|
}
|
|
3827
3840
|
};
|
|
3828
|
-
|
|
3829
|
-
|
|
3841
|
+
$.styles = [...E.styles, Kt];
|
|
3842
|
+
k([
|
|
3830
3843
|
m({ type: String })
|
|
3831
|
-
],
|
|
3832
|
-
|
|
3844
|
+
], $.prototype, "view", 2);
|
|
3845
|
+
k([
|
|
3833
3846
|
m({ type: Boolean })
|
|
3834
|
-
],
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
],
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
],
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
],
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
],
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
],
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
],
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
],
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
],
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
],
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
],
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
],
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
],
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
],
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
],
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
],
|
|
3847
|
+
], $.prototype, "embedded", 2);
|
|
3848
|
+
k([
|
|
3849
|
+
c()
|
|
3850
|
+
], $.prototype, "step", 2);
|
|
3851
|
+
k([
|
|
3852
|
+
c()
|
|
3853
|
+
], $.prototype, "busy", 2);
|
|
3854
|
+
k([
|
|
3855
|
+
c()
|
|
3856
|
+
], $.prototype, "error", 2);
|
|
3857
|
+
k([
|
|
3858
|
+
c()
|
|
3859
|
+
], $.prototype, "notice", 2);
|
|
3860
|
+
k([
|
|
3861
|
+
c()
|
|
3862
|
+
], $.prototype, "showPassword", 2);
|
|
3863
|
+
k([
|
|
3864
|
+
c()
|
|
3865
|
+
], $.prototype, "showPasswordConfirm", 2);
|
|
3866
|
+
k([
|
|
3867
|
+
c()
|
|
3868
|
+
], $.prototype, "expandedOAuth", 2);
|
|
3869
|
+
k([
|
|
3870
|
+
c()
|
|
3871
|
+
], $.prototype, "token", 2);
|
|
3872
|
+
k([
|
|
3873
|
+
c()
|
|
3874
|
+
], $.prototype, "resendCooldownUntil", 2);
|
|
3875
|
+
k([
|
|
3876
|
+
c()
|
|
3877
|
+
], $.prototype, "challenge", 2);
|
|
3878
|
+
k([
|
|
3879
|
+
c()
|
|
3880
|
+
], $.prototype, "recovery", 2);
|
|
3881
|
+
k([
|
|
3882
|
+
at("form input:not([type=hidden])")
|
|
3883
|
+
], $.prototype, "firstInput", 2);
|
|
3884
|
+
k([
|
|
3885
|
+
c()
|
|
3886
|
+
], $.prototype, "password", 2);
|
|
3887
|
+
k([
|
|
3888
|
+
c()
|
|
3889
|
+
], $.prototype, "passwordConfirm", 2);
|
|
3890
|
+
k([
|
|
3891
|
+
c()
|
|
3892
|
+
], $.prototype, "legalAccepted", 2);
|
|
3893
|
+
k([
|
|
3894
|
+
c()
|
|
3895
|
+
], $.prototype, "legalErrorFromOAuth", 2);
|
|
3896
|
+
$ = k([
|
|
3897
|
+
L("authui-sign-in")
|
|
3898
|
+
], $);
|
|
3880
3899
|
var Xt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, f = (e, t, i, s) => {
|
|
3881
|
-
for (var a = s > 1 ? void 0 : s ? Qt(t, i) : t,
|
|
3882
|
-
(
|
|
3900
|
+
for (var a = s > 1 ? void 0 : s ? Qt(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
3901
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
3883
3902
|
return s && a && Xt(t, i, a), a;
|
|
3884
3903
|
};
|
|
3885
3904
|
let p = class extends E {
|
|
3886
3905
|
constructor() {
|
|
3887
|
-
super(...arguments), this.embedded = !1, this.tab = "profile", this.active = "profile", this.busy = "", this.notice = null, this.errors = {}, this.nameInput = "", this.emailInput = "", this.emailPassword = "", this.phoneInput = "", this.phonePassword = "", this.phoneCode = "", this.phoneCodeSent = !1, this.guestName = "", this.oldPassword = "", this.newPassword = "", this.newPasswordConfirm = "", this.authenticator = null, this.authenticatorCode = "", this.factors = null, this.recoveryCodes = null, this.stepUp = null, this.stepUpCode = "", this.copied = !1, this.sessions = null, this.identities = null, this.logs = null, this.logsSupported = null, this.logsProbeStarted = !1, this.confirmDelete = !1, this.confirmRegenerate = !1, this.confirmRemoveAuthenticator = !1, this.confirmSignOutAll = !1, this.confirmDisconnectId = null, this.verifyEmailCooldownUntil = 0, this.verifyEmailCooldownTimer = null, this.onTabsKeydown = (e) => {
|
|
3906
|
+
super(...arguments), this.embedded = !1, this.tab = "profile", this.active = "profile", this.busy = "", this.notice = null, this.errors = {}, this.nameInput = "", this.emailInput = "", this.emailPassword = "", this.phoneInput = "", this.phonePassword = "", this.phoneCode = "", this.phoneCodeSent = !1, this.guestName = "", this.oldPassword = "", this.newPassword = "", this.newPasswordConfirm = "", this.showOldPassword = !1, this.showNewPassword = !1, this.showNewPasswordConfirm = !1, this.authenticator = null, this.authenticatorCode = "", this.factors = null, this.recoveryCodes = null, this.stepUp = null, this.stepUpCode = "", this.copied = !1, this.sessions = null, this.identities = null, this.logs = null, this.logsSupported = null, this.logsProbeStarted = !1, this.confirmDelete = !1, this.confirmRegenerate = !1, this.confirmRemoveAuthenticator = !1, this.confirmSignOutAll = !1, this.confirmDisconnectId = null, this.verifyEmailCooldownUntil = 0, this.verifyEmailCooldownTimer = null, this.verifyPhoneCooldownUntil = 0, this.verifyPhoneCooldownTimer = null, this.onTabsKeydown = (e) => {
|
|
3888
3907
|
const t = [...this.renderRoot?.querySelectorAll('[role="tab"]') ?? []];
|
|
3889
3908
|
if (!t.length) return;
|
|
3890
|
-
const i = t.findIndex((
|
|
3909
|
+
const i = t.findIndex((h) => h.getAttribute("aria-selected") === "true");
|
|
3891
3910
|
let s = i;
|
|
3892
3911
|
if (e.key === "ArrowRight" || e.key === "ArrowDown") s = (i + 1) % t.length;
|
|
3893
3912
|
else if (e.key === "ArrowLeft" || e.key === "ArrowUp")
|
|
@@ -3899,12 +3918,12 @@ let p = class extends E {
|
|
|
3899
3918
|
const a = t[s].id.replace("authui-tab-", "");
|
|
3900
3919
|
this.select(a), requestAnimationFrame(() => t[s]?.focus());
|
|
3901
3920
|
}, this.noticeTimer = null, this.factorsLoading = !1, this.onUpdateName = (e) => {
|
|
3902
|
-
e.preventDefault(), this.requireValid(e) && this.run("name", () =>
|
|
3921
|
+
e.preventDefault(), this.requireValid(e) && this.run("name", () => l.updateName(this.nameInput), this.t("nameUpdated"));
|
|
3903
3922
|
}, this.onUpdateEmail = (e) => {
|
|
3904
3923
|
e.preventDefault(), this.requireValid(e) && this.run(
|
|
3905
3924
|
"email",
|
|
3906
3925
|
async () => {
|
|
3907
|
-
await
|
|
3926
|
+
await l.updateEmail(this.emailInput, this.emailPassword), this.emailPassword = "";
|
|
3908
3927
|
},
|
|
3909
3928
|
this.t("emailUpdated")
|
|
3910
3929
|
);
|
|
@@ -3912,7 +3931,7 @@ let p = class extends E {
|
|
|
3912
3931
|
e.preventDefault(), this.requireValid(e) && this.run(
|
|
3913
3932
|
"phone",
|
|
3914
3933
|
async () => {
|
|
3915
|
-
await
|
|
3934
|
+
await l.updatePhone(this.phoneInput, this.phonePassword), this.phonePassword = "";
|
|
3916
3935
|
},
|
|
3917
3936
|
this.t("phoneUpdated")
|
|
3918
3937
|
);
|
|
@@ -3920,7 +3939,7 @@ let p = class extends E {
|
|
|
3920
3939
|
e.preventDefault(), this.requireValid(e) && this.run(
|
|
3921
3940
|
"guest",
|
|
3922
3941
|
async () => {
|
|
3923
|
-
await
|
|
3942
|
+
await l.convertGuest(this.emailInput, this.emailPassword, this.guestName), this.emailPassword = "";
|
|
3924
3943
|
},
|
|
3925
3944
|
this.t("accountConverted")
|
|
3926
3945
|
);
|
|
@@ -3928,19 +3947,19 @@ let p = class extends E {
|
|
|
3928
3947
|
Date.now() < this.verifyEmailCooldownUntil || this.run(
|
|
3929
3948
|
"verify",
|
|
3930
3949
|
async () => {
|
|
3931
|
-
await
|
|
3950
|
+
await l.sendEmailVerification(), this.startVerifyEmailCooldown();
|
|
3932
3951
|
},
|
|
3933
3952
|
this.t("verificationSent")
|
|
3934
3953
|
);
|
|
3935
3954
|
}, this.onSendPhoneVerification = () => {
|
|
3936
|
-
this.run("verify-phone", async () => {
|
|
3937
|
-
await
|
|
3955
|
+
Date.now() < this.verifyPhoneCooldownUntil || this.run("verify-phone", async () => {
|
|
3956
|
+
await l.sendPhoneVerification(), this.phoneCodeSent = !0, this.startVerifyPhoneCooldown();
|
|
3938
3957
|
});
|
|
3939
3958
|
}, this.onConfirmPhoneVerification = (e) => {
|
|
3940
3959
|
e.preventDefault(), this.requireValid(e) && this.run(
|
|
3941
3960
|
"verify-phone-code",
|
|
3942
3961
|
async () => {
|
|
3943
|
-
await
|
|
3962
|
+
await l.confirmPhoneVerification(this.phoneCode), this.phoneCode = "", this.phoneCodeSent = !1, this.verifyPhoneCooldownUntil = 0, this.clearVerifyPhoneCooldownTimer();
|
|
3944
3963
|
},
|
|
3945
3964
|
this.t("phoneVerified")
|
|
3946
3965
|
);
|
|
@@ -3953,7 +3972,7 @@ let p = class extends E {
|
|
|
3953
3972
|
this.run(
|
|
3954
3973
|
"password",
|
|
3955
3974
|
async () => {
|
|
3956
|
-
await
|
|
3975
|
+
await l.updatePassword(this.newPassword, this.oldPassword), this.oldPassword = this.newPassword = this.newPasswordConfirm = "";
|
|
3957
3976
|
},
|
|
3958
3977
|
this.t("passwordChanged")
|
|
3959
3978
|
);
|
|
@@ -3961,17 +3980,17 @@ let p = class extends E {
|
|
|
3961
3980
|
}, this.onToggleMfa = () => {
|
|
3962
3981
|
const e = !this.user?.mfa;
|
|
3963
3982
|
this.run("mfa", async () => {
|
|
3964
|
-
await
|
|
3983
|
+
await l.setMfaEnabled(e), await this.loadFactors();
|
|
3965
3984
|
});
|
|
3966
3985
|
}, this.onAddAuthenticator = () => {
|
|
3967
3986
|
this.run("authenticator", async () => {
|
|
3968
|
-
this.authenticator = await
|
|
3987
|
+
this.authenticator = await l.addAuthenticator(), this.authenticatorCode = "";
|
|
3969
3988
|
});
|
|
3970
3989
|
}, this.onVerifyAuthenticator = (e) => {
|
|
3971
3990
|
e.preventDefault(), this.requireValid(e) && this.run(
|
|
3972
3991
|
"authenticator-code",
|
|
3973
3992
|
async () => {
|
|
3974
|
-
await
|
|
3993
|
+
await l.verifyAuthenticator(this.authenticatorCode), this.authenticator = null, this.authenticatorCode = "", await this.loadFactors();
|
|
3975
3994
|
},
|
|
3976
3995
|
this.t("authenticatorAdded")
|
|
3977
3996
|
);
|
|
@@ -3981,15 +4000,15 @@ let p = class extends E {
|
|
|
3981
4000
|
return;
|
|
3982
4001
|
}
|
|
3983
4002
|
this.confirmRemoveAuthenticator = !1, this.run("remove-authenticator", async () => {
|
|
3984
|
-
await
|
|
4003
|
+
await l.removeAuthenticator(), await this.loadFactors();
|
|
3985
4004
|
});
|
|
3986
4005
|
}, this.onRecoveryCodes = () => {
|
|
3987
4006
|
this.run("recovery", async () => {
|
|
3988
4007
|
try {
|
|
3989
|
-
this.recoveryCodes = await
|
|
4008
|
+
this.recoveryCodes = await l.createRecoveryCodes();
|
|
3990
4009
|
} catch (e) {
|
|
3991
|
-
if (!j(e,
|
|
3992
|
-
this.recoveryCodes = await
|
|
4010
|
+
if (!j(e, v.recoveryCodesExist)) throw e;
|
|
4011
|
+
this.recoveryCodes = await l.getRecoveryCodes();
|
|
3993
4012
|
}
|
|
3994
4013
|
await this.loadFactors();
|
|
3995
4014
|
});
|
|
@@ -3999,7 +4018,7 @@ let p = class extends E {
|
|
|
3999
4018
|
return;
|
|
4000
4019
|
}
|
|
4001
4020
|
this.confirmRegenerate = !1, this.run("recovery", async () => {
|
|
4002
|
-
this.recoveryCodes = await
|
|
4021
|
+
this.recoveryCodes = await l.regenerateRecoveryCodes();
|
|
4003
4022
|
});
|
|
4004
4023
|
}, this.onCopyCodes = async () => {
|
|
4005
4024
|
if (this.recoveryCodes)
|
|
@@ -4019,7 +4038,7 @@ let p = class extends E {
|
|
|
4019
4038
|
}
|
|
4020
4039
|
}, this.onStepUpFactor = (e) => {
|
|
4021
4040
|
this.run("stepup", async () => {
|
|
4022
|
-
const t = await
|
|
4041
|
+
const t = await l.createMfaChallenge(e);
|
|
4023
4042
|
this.stepUp = { ...this.stepUp, challenge: { id: t.$id, factor: e } }, this.stepUpCode = "";
|
|
4024
4043
|
});
|
|
4025
4044
|
}, this.onStepUpVerify = (e) => {
|
|
@@ -4028,40 +4047,40 @@ let p = class extends E {
|
|
|
4028
4047
|
t?.challenge && (async () => {
|
|
4029
4048
|
let i = !1;
|
|
4030
4049
|
await this.run("stepup-code", async () => {
|
|
4031
|
-
await
|
|
4050
|
+
await l.completeMfaChallenge(t.challenge.id, this.stepUpCode, { signIn: !1 }), this.stepUp = null, this.stepUpCode = "", i = !0;
|
|
4032
4051
|
}), i && await t.retry();
|
|
4033
4052
|
})();
|
|
4034
4053
|
}, this.onDeleteSession = (e) => {
|
|
4035
4054
|
this.run(`session-${e}`, async () => {
|
|
4036
4055
|
if ((this.sessions ?? []).some((i) => i.$id === e && i.current)) {
|
|
4037
|
-
await
|
|
4056
|
+
await l.signOut(), this.sessions = [];
|
|
4038
4057
|
return;
|
|
4039
4058
|
}
|
|
4040
|
-
await
|
|
4059
|
+
await l.signOut(e), this.sessions = (this.sessions ?? []).filter((i) => i.$id !== e);
|
|
4041
4060
|
});
|
|
4042
4061
|
}, this.onSignOutAll = () => {
|
|
4043
4062
|
if (!this.confirmSignOutAll) {
|
|
4044
4063
|
this.confirmSignOutAll = !0;
|
|
4045
4064
|
return;
|
|
4046
4065
|
}
|
|
4047
|
-
this.confirmSignOutAll = !1, this.run("sessions-all", () =>
|
|
4066
|
+
this.confirmSignOutAll = !1, this.run("sessions-all", () => l.signOutEverywhere());
|
|
4048
4067
|
}, this.onDeleteIdentity = (e) => {
|
|
4049
4068
|
if (this.confirmDisconnectId !== e) {
|
|
4050
4069
|
this.confirmDisconnectId = e;
|
|
4051
4070
|
return;
|
|
4052
4071
|
}
|
|
4053
4072
|
this.confirmDisconnectId = null, this.run(`identity-${e}`, async () => {
|
|
4054
|
-
await
|
|
4073
|
+
await l.deleteIdentity(e), this.identities = (this.identities ?? []).filter((t) => t.$id !== e);
|
|
4055
4074
|
});
|
|
4056
4075
|
}, this.onDeleteAccount = () => {
|
|
4057
|
-
this.run("delete", () =>
|
|
4076
|
+
this.run("delete", () => l.deleteAccount());
|
|
4058
4077
|
};
|
|
4059
4078
|
}
|
|
4060
4079
|
connectedCallback() {
|
|
4061
4080
|
super.connectedCallback(), this.active = this.tab, this.hydrate();
|
|
4062
4081
|
}
|
|
4063
4082
|
disconnectedCallback() {
|
|
4064
|
-
super.disconnectedCallback(), this.clearVerifyEmailCooldownTimer(), this.noticeTimer && (clearTimeout(this.noticeTimer), this.noticeTimer = null);
|
|
4083
|
+
super.disconnectedCallback(), this.clearVerifyEmailCooldownTimer(), this.clearVerifyPhoneCooldownTimer(), this.noticeTimer && (clearTimeout(this.noticeTimer), this.noticeTimer = null);
|
|
4065
4084
|
}
|
|
4066
4085
|
willUpdate(e) {
|
|
4067
4086
|
e.has("tab") && e.get("tab") !== void 0 && (this.active = this.tab), e.has("auth") && this.hydrate(), this.ensureLoaded();
|
|
@@ -4090,7 +4109,7 @@ let p = class extends E {
|
|
|
4090
4109
|
'.tab[aria-selected="true"]'
|
|
4091
4110
|
);
|
|
4092
4111
|
i && typeof i.scrollIntoView == "function" && i.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
|
|
4093
|
-
}), (e.has("confirmDelete") && this.confirmDelete || e.has("confirmSignOutAll") && this.confirmSignOutAll || e.has("confirmDisconnectId") && this.confirmDisconnectId !== null) && requestAnimationFrame(() => {
|
|
4112
|
+
}), (e.has("confirmDelete") && this.confirmDelete || e.has("confirmSignOutAll") && this.confirmSignOutAll || e.has("confirmDisconnectId") && this.confirmDisconnectId !== null || e.has("confirmRegenerate") && this.confirmRegenerate || e.has("confirmRemoveAuthenticator") && this.confirmRemoveAuthenticator) && requestAnimationFrame(() => {
|
|
4094
4113
|
this.renderRoot.querySelector(
|
|
4095
4114
|
".card-footer [autofocus], .row-actions [autofocus], .inline [autofocus], .card-footer .btn-outline, .row-actions .btn-outline, .inline .btn-outline"
|
|
4096
4115
|
)?.focus({ preventScroll: !0 });
|
|
@@ -4111,7 +4130,7 @@ let p = class extends E {
|
|
|
4111
4130
|
try {
|
|
4112
4131
|
await t(), i && this.setNotice("success", i);
|
|
4113
4132
|
} catch (s) {
|
|
4114
|
-
j(s,
|
|
4133
|
+
j(s, v.challengeRequired) ? this.stepUp = { retry: () => this.run(e, t, i) } : this.errors = {
|
|
4115
4134
|
...this.errors,
|
|
4116
4135
|
[e]: Y(
|
|
4117
4136
|
s,
|
|
@@ -4127,12 +4146,12 @@ let p = class extends E {
|
|
|
4127
4146
|
// ─────────────────────────── loaders ───────────────────────────
|
|
4128
4147
|
async loadSessions() {
|
|
4129
4148
|
await this.run("sessions", async () => {
|
|
4130
|
-
this.sessions = await
|
|
4149
|
+
this.sessions = await l.listSessions();
|
|
4131
4150
|
});
|
|
4132
4151
|
}
|
|
4133
4152
|
async loadIdentities() {
|
|
4134
4153
|
await this.run("identities", async () => {
|
|
4135
|
-
this.identities = await
|
|
4154
|
+
this.identities = await l.listIdentities();
|
|
4136
4155
|
});
|
|
4137
4156
|
}
|
|
4138
4157
|
/** Probe once so Activity is never shown on servers without /account/logs. */
|
|
@@ -4140,7 +4159,7 @@ let p = class extends E {
|
|
|
4140
4159
|
if (!this.logsProbeStarted) {
|
|
4141
4160
|
this.logsProbeStarted = !0;
|
|
4142
4161
|
try {
|
|
4143
|
-
this.logs = await
|
|
4162
|
+
this.logs = await l.listLogs(), this.logsSupported = !0;
|
|
4144
4163
|
} catch {
|
|
4145
4164
|
this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
|
|
4146
4165
|
}
|
|
@@ -4153,7 +4172,7 @@ let p = class extends E {
|
|
|
4153
4172
|
}
|
|
4154
4173
|
this.busy = "logs";
|
|
4155
4174
|
try {
|
|
4156
|
-
this.logs = await
|
|
4175
|
+
this.logs = await l.listLogs();
|
|
4157
4176
|
} catch {
|
|
4158
4177
|
this.logsSupported = !1, this.logs = [], this.active === "activity" && (this.active = "profile");
|
|
4159
4178
|
} finally {
|
|
@@ -4164,7 +4183,7 @@ let p = class extends E {
|
|
|
4164
4183
|
if (!this.factorsLoading) {
|
|
4165
4184
|
this.factorsLoading = !0;
|
|
4166
4185
|
try {
|
|
4167
|
-
this.factors = await
|
|
4186
|
+
this.factors = await l.listMfaFactors();
|
|
4168
4187
|
} catch {
|
|
4169
4188
|
this.factors = {
|
|
4170
4189
|
totp: !1,
|
|
@@ -4186,6 +4205,14 @@ let p = class extends E {
|
|
|
4186
4205
|
clearVerifyEmailCooldownTimer() {
|
|
4187
4206
|
this.verifyEmailCooldownTimer && (clearInterval(this.verifyEmailCooldownTimer), this.verifyEmailCooldownTimer = null);
|
|
4188
4207
|
}
|
|
4208
|
+
startVerifyPhoneCooldown() {
|
|
4209
|
+
this.verifyPhoneCooldownUntil = Date.now() + 45e3, this.clearVerifyPhoneCooldownTimer(), this.verifyPhoneCooldownTimer = setInterval(() => {
|
|
4210
|
+
this.requestUpdate(), Date.now() >= this.verifyPhoneCooldownUntil && this.clearVerifyPhoneCooldownTimer();
|
|
4211
|
+
}, 1e3);
|
|
4212
|
+
}
|
|
4213
|
+
clearVerifyPhoneCooldownTimer() {
|
|
4214
|
+
this.verifyPhoneCooldownTimer && (clearInterval(this.verifyPhoneCooldownTimer), this.verifyPhoneCooldownTimer = null);
|
|
4215
|
+
}
|
|
4189
4216
|
bind(e) {
|
|
4190
4217
|
return (t) => {
|
|
4191
4218
|
this[e] = t.target.value;
|
|
@@ -4195,7 +4222,7 @@ let p = class extends E {
|
|
|
4195
4222
|
render() {
|
|
4196
4223
|
if (!this.auth.configured)
|
|
4197
4224
|
return r`<div class="alert alert-error" role="alert">
|
|
4198
|
-
${
|
|
4225
|
+
${o.alert}
|
|
4199
4226
|
<div class="alert-body">${this.t("errorNotConfigured")}</div>
|
|
4200
4227
|
</div>`;
|
|
4201
4228
|
if (this.auth.status === "loading")
|
|
@@ -4232,7 +4259,7 @@ let p = class extends E {
|
|
|
4232
4259
|
)}
|
|
4233
4260
|
</div>
|
|
4234
4261
|
${this.notice ? r`<div class="alert alert-${this.notice.tone}" role="status">
|
|
4235
|
-
${this.notice.tone === "success" ?
|
|
4262
|
+
${this.notice.tone === "success" ? o.checkCircle : o.info}
|
|
4236
4263
|
<div class="alert-body">${this.notice.message}</div>
|
|
4237
4264
|
<button
|
|
4238
4265
|
class="btn btn-ghost btn-icon dismiss"
|
|
@@ -4241,7 +4268,7 @@ let p = class extends E {
|
|
|
4241
4268
|
}}
|
|
4242
4269
|
aria-label=${this.t("close")}
|
|
4243
4270
|
>
|
|
4244
|
-
${
|
|
4271
|
+
${o.x}
|
|
4245
4272
|
</button>
|
|
4246
4273
|
</div>` : n}
|
|
4247
4274
|
${this.stepUp ? this.renderStepUp() : r`<div
|
|
@@ -4260,18 +4287,18 @@ let p = class extends E {
|
|
|
4260
4287
|
return r`
|
|
4261
4288
|
<div class="between">
|
|
4262
4289
|
<div class="identity">
|
|
4263
|
-
<span class="avatar">${
|
|
4290
|
+
<span class="avatar">${lt(t)}</span>
|
|
4264
4291
|
<div class="row-main">
|
|
4265
4292
|
<span class="row-title" title=${t}>
|
|
4266
4293
|
${t}
|
|
4267
|
-
${e.mfa ? r`<span class="badge badge-success">${
|
|
4268
|
-
${
|
|
4294
|
+
${e.mfa ? r`<span class="badge badge-success">${o.shieldCheck} ${this.t("mfaBadge")}</span>` : n}
|
|
4295
|
+
${l.isPreview ? r`<span class="badge badge-info">${this.t("preview")}</span>` : n}
|
|
4269
4296
|
</span>
|
|
4270
4297
|
${e.email && e.name ? r`<span class="row-sub" title=${e.email}>${e.email}</span>` : n}
|
|
4271
4298
|
</div>
|
|
4272
4299
|
</div>
|
|
4273
|
-
<button class="btn btn-outline btn-sm" @click=${() =>
|
|
4274
|
-
${
|
|
4300
|
+
<button class="btn btn-outline btn-sm" @click=${() => l.signOut()}>
|
|
4301
|
+
${o.logOut} ${this.t("signOut")}
|
|
4275
4302
|
</button>
|
|
4276
4303
|
</div>
|
|
4277
4304
|
`;
|
|
@@ -4293,7 +4320,7 @@ let p = class extends E {
|
|
|
4293
4320
|
error(e) {
|
|
4294
4321
|
const t = this.errors[e];
|
|
4295
4322
|
return t ? r`<div class="alert alert-error" role="alert">
|
|
4296
|
-
${
|
|
4323
|
+
${o.alert}
|
|
4297
4324
|
<div class="alert-body">${t}</div>
|
|
4298
4325
|
</div>` : n;
|
|
4299
4326
|
}
|
|
@@ -4340,7 +4367,7 @@ let p = class extends E {
|
|
|
4340
4367
|
</div>`;
|
|
4341
4368
|
}
|
|
4342
4369
|
verifiedBadge(e) {
|
|
4343
|
-
return e ? r`<span class="badge badge-success">${
|
|
4370
|
+
return e ? r`<span class="badge badge-success">${o.check} ${this.t("verified")}</span>` : r`<span class="badge badge-warning">${this.t("unverified")}</span>`;
|
|
4344
4371
|
}
|
|
4345
4372
|
// ── Profile ──
|
|
4346
4373
|
renderProfile() {
|
|
@@ -4385,7 +4412,7 @@ let p = class extends E {
|
|
|
4385
4412
|
autocomplete="new-password"
|
|
4386
4413
|
/>
|
|
4387
4414
|
${this.emailPassword ? (() => {
|
|
4388
|
-
const t =
|
|
4415
|
+
const t = rt(this.emailPassword);
|
|
4389
4416
|
return r`<div class="strength" aria-live="polite">
|
|
4390
4417
|
<div
|
|
4391
4418
|
class="strength-meter"
|
|
@@ -4565,13 +4592,27 @@ let p = class extends E {
|
|
|
4565
4592
|
${this.spinner("verify-phone")} ${this.t("sendCode")}
|
|
4566
4593
|
</button>` : n}
|
|
4567
4594
|
${this.phoneCodeSent ? r`<button
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4595
|
+
class="btn btn-outline btn-sm"
|
|
4596
|
+
type="button"
|
|
4597
|
+
@click=${this.onSendPhoneVerification}
|
|
4598
|
+
?disabled=${!!this.busy || Date.now() < this.verifyPhoneCooldownUntil}
|
|
4599
|
+
>
|
|
4600
|
+
${this.spinner("verify-phone")}
|
|
4601
|
+
${Date.now() < this.verifyPhoneCooldownUntil ? this.t("verificationResendIn", {
|
|
4602
|
+
seconds: Math.max(
|
|
4603
|
+
1,
|
|
4604
|
+
Math.ceil((this.verifyPhoneCooldownUntil - Date.now()) / 1e3)
|
|
4605
|
+
)
|
|
4606
|
+
}) : this.t("resendCode")}
|
|
4607
|
+
</button>
|
|
4608
|
+
<button
|
|
4609
|
+
class="btn btn-outline btn-sm"
|
|
4610
|
+
type="button"
|
|
4611
|
+
@click=${this.onConfirmPhoneVerification}
|
|
4612
|
+
?disabled=${!!this.busy}
|
|
4613
|
+
>
|
|
4614
|
+
${this.spinner("verify-phone-code")} ${this.t("verifyCode")}
|
|
4615
|
+
</button>` : n}
|
|
4575
4616
|
<button
|
|
4576
4617
|
class="btn btn-primary btn-sm"
|
|
4577
4618
|
type="submit"
|
|
@@ -4591,7 +4632,7 @@ let p = class extends E {
|
|
|
4591
4632
|
this.t("deleteAccountDescription"),
|
|
4592
4633
|
this.confirmDelete ? this.error("delete") : r`${this.error("delete")}
|
|
4593
4634
|
<button class="btn btn-outline btn-sm warn" @click=${() => this.confirmDelete = !0}>
|
|
4594
|
-
${
|
|
4635
|
+
${o.userX} ${this.t("deleteAccount")}
|
|
4595
4636
|
</button>`,
|
|
4596
4637
|
this.confirmDelete ? this.confirmFooter(
|
|
4597
4638
|
() => {
|
|
@@ -4623,30 +4664,50 @@ let p = class extends E {
|
|
|
4623
4664
|
<label class="label" for="acc-old-password"
|
|
4624
4665
|
>${this.t("currentPassword")}</label
|
|
4625
4666
|
>
|
|
4626
|
-
<input
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4667
|
+
<div class="input-wrap">
|
|
4668
|
+
<input
|
|
4669
|
+
class="input"
|
|
4670
|
+
id="acc-old-password"
|
|
4671
|
+
type=${this.showOldPassword ? "text" : "password"}
|
|
4672
|
+
.value=${this.oldPassword}
|
|
4673
|
+
@input=${this.bind("oldPassword")}
|
|
4674
|
+
autocomplete="current-password"
|
|
4675
|
+
required
|
|
4676
|
+
/>
|
|
4677
|
+
<button
|
|
4678
|
+
type="button"
|
|
4679
|
+
class="btn btn-ghost btn-icon"
|
|
4680
|
+
@click=${() => this.showOldPassword = !this.showOldPassword}
|
|
4681
|
+
aria-label=${this.showOldPassword ? this.t("hidePassword") : this.t("showPassword")}
|
|
4682
|
+
>
|
|
4683
|
+
${this.showOldPassword ? o.eyeOff : o.eye}
|
|
4684
|
+
</button>
|
|
4685
|
+
</div>
|
|
4635
4686
|
</div>` : n}
|
|
4636
4687
|
<div class="field">
|
|
4637
4688
|
<label class="label" for="acc-new-password">${this.t("newPassword")}</label>
|
|
4638
|
-
<input
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4689
|
+
<div class="input-wrap">
|
|
4690
|
+
<input
|
|
4691
|
+
class="input"
|
|
4692
|
+
id="acc-new-password"
|
|
4693
|
+
type=${this.showNewPassword ? "text" : "password"}
|
|
4694
|
+
required
|
|
4695
|
+
minlength="8"
|
|
4696
|
+
.value=${this.newPassword}
|
|
4697
|
+
@input=${this.bind("newPassword")}
|
|
4698
|
+
autocomplete="new-password"
|
|
4699
|
+
/>
|
|
4700
|
+
<button
|
|
4701
|
+
type="button"
|
|
4702
|
+
class="btn btn-ghost btn-icon"
|
|
4703
|
+
@click=${() => this.showNewPassword = !this.showNewPassword}
|
|
4704
|
+
aria-label=${this.showNewPassword ? this.t("hidePassword") : this.t("showPassword")}
|
|
4705
|
+
>
|
|
4706
|
+
${this.showNewPassword ? o.eyeOff : o.eye}
|
|
4707
|
+
</button>
|
|
4708
|
+
</div>
|
|
4648
4709
|
${this.newPassword ? (() => {
|
|
4649
|
-
const i =
|
|
4710
|
+
const i = rt(this.newPassword);
|
|
4650
4711
|
return r`<div class="strength" aria-live="polite">
|
|
4651
4712
|
<div
|
|
4652
4713
|
class="strength-meter"
|
|
@@ -4668,16 +4729,26 @@ let p = class extends E {
|
|
|
4668
4729
|
<label class="label" for="acc-new-password-confirm"
|
|
4669
4730
|
>${this.t("confirmPassword")}</label
|
|
4670
4731
|
>
|
|
4671
|
-
<input
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4732
|
+
<div class="input-wrap">
|
|
4733
|
+
<input
|
|
4734
|
+
class="input"
|
|
4735
|
+
id="acc-new-password-confirm"
|
|
4736
|
+
type=${this.showNewPasswordConfirm ? "text" : "password"}
|
|
4737
|
+
required
|
|
4738
|
+
minlength="8"
|
|
4739
|
+
.value=${this.newPasswordConfirm}
|
|
4740
|
+
@input=${this.bind("newPasswordConfirm")}
|
|
4741
|
+
autocomplete="new-password"
|
|
4742
|
+
/>
|
|
4743
|
+
<button
|
|
4744
|
+
type="button"
|
|
4745
|
+
class="btn btn-ghost btn-icon"
|
|
4746
|
+
@click=${() => this.showNewPasswordConfirm = !this.showNewPasswordConfirm}
|
|
4747
|
+
aria-label=${this.showNewPasswordConfirm ? this.t("hidePassword") : this.t("showPassword")}
|
|
4748
|
+
>
|
|
4749
|
+
${this.showNewPasswordConfirm ? o.eyeOff : o.eye}
|
|
4750
|
+
</button>
|
|
4751
|
+
</div>
|
|
4681
4752
|
</div>
|
|
4682
4753
|
${this.error("password")}
|
|
4683
4754
|
</form>`,
|
|
@@ -4695,7 +4766,7 @@ let p = class extends E {
|
|
|
4695
4766
|
</div>`;
|
|
4696
4767
|
}
|
|
4697
4768
|
renderMfaCard() {
|
|
4698
|
-
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ?
|
|
4769
|
+
const e = this.user, t = this.factors?.totp ?? !1, i = this.authenticator ? l.isPreview ? Et(this.authenticator.uri) : new Ct(l.getClient()).getQR(this.authenticator.uri, 400, 1).toString() : "";
|
|
4699
4770
|
return this.card(
|
|
4700
4771
|
this.t("twoFactor"),
|
|
4701
4772
|
this.t("twoFactorDescription"),
|
|
@@ -4715,7 +4786,7 @@ let p = class extends E {
|
|
|
4715
4786
|
></button>
|
|
4716
4787
|
</div>
|
|
4717
4788
|
${e.mfa && !(this.factors?.totp || e.emailVerification || e.phoneVerification) ? r`<div class="alert alert-warning" role="status">
|
|
4718
|
-
${
|
|
4789
|
+
${o.alert}
|
|
4719
4790
|
<div class="alert-body">
|
|
4720
4791
|
${this.t("mfaNoFactorWarning")}
|
|
4721
4792
|
${this.factors?.totp ? n : r`<div class="links">
|
|
@@ -4735,23 +4806,27 @@ let p = class extends E {
|
|
|
4735
4806
|
<div class="toggle-row">
|
|
4736
4807
|
<div class="row-main">
|
|
4737
4808
|
<span class="row-title"
|
|
4738
|
-
>${
|
|
4809
|
+
>${o.smartphone} ${this.t("authenticatorApp")}
|
|
4739
4810
|
${t ? this.verifiedBadge(!0) : n}</span
|
|
4740
4811
|
>
|
|
4741
4812
|
</div>
|
|
4742
4813
|
${t ? this.confirmRemoveAuthenticator ? r`<div class="inline">
|
|
4743
4814
|
<button
|
|
4744
|
-
|
|
4745
|
-
|
|
4815
|
+
type="button"
|
|
4816
|
+
class="btn btn-outline btn-sm"
|
|
4817
|
+
autofocus
|
|
4746
4818
|
?disabled=${!!this.busy}
|
|
4819
|
+
@click=${() => this.confirmRemoveAuthenticator = !1}
|
|
4747
4820
|
>
|
|
4748
|
-
${this.
|
|
4821
|
+
${this.t("cancel")}
|
|
4749
4822
|
</button>
|
|
4750
4823
|
<button
|
|
4751
|
-
|
|
4752
|
-
|
|
4824
|
+
type="button"
|
|
4825
|
+
class="btn btn-destructive btn-sm"
|
|
4826
|
+
@click=${this.onRemoveAuthenticator}
|
|
4827
|
+
?disabled=${!!this.busy}
|
|
4753
4828
|
>
|
|
4754
|
-
${this.t("
|
|
4829
|
+
${this.spinner("remove-authenticator")} ${this.t("remove")}
|
|
4755
4830
|
</button>
|
|
4756
4831
|
</div>` : r`<button
|
|
4757
4832
|
class="btn btn-outline btn-sm"
|
|
@@ -4783,7 +4858,7 @@ let p = class extends E {
|
|
|
4783
4858
|
this.onCopySecret();
|
|
4784
4859
|
}}
|
|
4785
4860
|
>
|
|
4786
|
-
${this.copied ?
|
|
4861
|
+
${this.copied ? o.check : o.copy}
|
|
4787
4862
|
${this.copied ? this.t("copied") : this.t("authenticatorCopyKey")}
|
|
4788
4863
|
</button>
|
|
4789
4864
|
</div>
|
|
@@ -4825,7 +4900,7 @@ let p = class extends E {
|
|
|
4825
4900
|
this.t("recoveryCodesDescription") + " " + this.t("recoveryCodesOnceHint"),
|
|
4826
4901
|
r`<div class="kv">
|
|
4827
4902
|
${this.recoveryCodes ? r`<div class="alert alert-warning">
|
|
4828
|
-
${
|
|
4903
|
+
${o.alert}
|
|
4829
4904
|
<div class="alert-body">${this.t("recoveryCodesWarning")}</div>
|
|
4830
4905
|
</div>
|
|
4831
4906
|
<div class="codes">
|
|
@@ -4833,7 +4908,7 @@ let p = class extends E {
|
|
|
4833
4908
|
</div>
|
|
4834
4909
|
<div class="inline">
|
|
4835
4910
|
<button class="btn btn-outline btn-sm" @click=${this.onCopyCodes}>
|
|
4836
|
-
${this.copied ?
|
|
4911
|
+
${this.copied ? o.check : o.copy}
|
|
4837
4912
|
${this.copied ? this.t("copied") : this.t("copy")}
|
|
4838
4913
|
</button>
|
|
4839
4914
|
<button class="btn btn-ghost btn-sm" @click=${() => this.recoveryCodes = null}>
|
|
@@ -4845,29 +4920,34 @@ let p = class extends E {
|
|
|
4845
4920
|
@click=${this.onRecoveryCodes}
|
|
4846
4921
|
?disabled=${!!this.busy}
|
|
4847
4922
|
>
|
|
4848
|
-
${this.spinner("recovery")} ${
|
|
4923
|
+
${this.spinner("recovery")} ${o.key}
|
|
4849
4924
|
${e ? this.t("viewRecoveryCodes") : this.t("generateRecoveryCodes")}
|
|
4850
4925
|
</button>
|
|
4851
4926
|
${e ? this.confirmRegenerate ? r`<div class="inline">
|
|
4852
4927
|
<button
|
|
4853
|
-
|
|
4854
|
-
|
|
4928
|
+
type="button"
|
|
4929
|
+
class="btn btn-outline btn-sm"
|
|
4930
|
+
autofocus
|
|
4855
4931
|
?disabled=${!!this.busy}
|
|
4932
|
+
@click=${() => this.confirmRegenerate = !1}
|
|
4856
4933
|
>
|
|
4857
|
-
${
|
|
4934
|
+
${this.t("cancel")}
|
|
4858
4935
|
</button>
|
|
4859
4936
|
<button
|
|
4860
|
-
|
|
4861
|
-
|
|
4937
|
+
type="button"
|
|
4938
|
+
class="btn btn-destructive btn-sm"
|
|
4939
|
+
@click=${this.onRegenerateRecoveryCodes}
|
|
4940
|
+
?disabled=${!!this.busy}
|
|
4862
4941
|
>
|
|
4863
|
-
${this.
|
|
4942
|
+
${this.spinner("recovery")} ${o.refresh}
|
|
4943
|
+
${this.t("regenerateRecoveryCodes")}
|
|
4864
4944
|
</button>
|
|
4865
4945
|
</div>` : r`<button
|
|
4866
4946
|
class="btn btn-ghost btn-sm"
|
|
4867
4947
|
@click=${this.onRegenerateRecoveryCodes}
|
|
4868
4948
|
?disabled=${!!this.busy}
|
|
4869
4949
|
>
|
|
4870
|
-
${
|
|
4950
|
+
${o.refresh} ${this.t("regenerateRecoveryCodes")}
|
|
4871
4951
|
</button>` : n}
|
|
4872
4952
|
</div>`}
|
|
4873
4953
|
${this.error("recovery")}
|
|
@@ -4879,25 +4959,25 @@ let p = class extends E {
|
|
|
4879
4959
|
const e = this.stepUp, t = this.factors, i = [
|
|
4880
4960
|
{
|
|
4881
4961
|
factor: "totp",
|
|
4882
|
-
icon:
|
|
4962
|
+
icon: o.smartphone,
|
|
4883
4963
|
label: this.t("mfaUseAuthenticator"),
|
|
4884
4964
|
available: t?.totp ?? !0
|
|
4885
4965
|
},
|
|
4886
4966
|
{
|
|
4887
4967
|
factor: "email",
|
|
4888
|
-
icon:
|
|
4968
|
+
icon: o.mail,
|
|
4889
4969
|
label: this.t("mfaUseEmail"),
|
|
4890
4970
|
available: t?.email ?? !0
|
|
4891
4971
|
},
|
|
4892
4972
|
{
|
|
4893
4973
|
factor: "phone",
|
|
4894
|
-
icon:
|
|
4974
|
+
icon: o.phone,
|
|
4895
4975
|
label: this.t("mfaUsePhone"),
|
|
4896
4976
|
available: t?.phone ?? !0
|
|
4897
4977
|
},
|
|
4898
4978
|
{
|
|
4899
4979
|
factor: "recoverycode",
|
|
4900
|
-
icon:
|
|
4980
|
+
icon: o.key,
|
|
4901
4981
|
label: this.t("mfaUseRecoveryCode"),
|
|
4902
4982
|
available: t?.recoveryCode ?? !0
|
|
4903
4983
|
}
|
|
@@ -4948,7 +5028,7 @@ let p = class extends E {
|
|
|
4948
5028
|
// ── Sessions ──
|
|
4949
5029
|
deviceIcon(e) {
|
|
4950
5030
|
const t = (e.deviceName || "").toLowerCase(), i = (e.osName || e.osCode || "").toLowerCase();
|
|
4951
|
-
return /phone|tablet|mobile/.test(t) || /ios|android|ipados/.test(i) ?
|
|
5031
|
+
return /phone|tablet|mobile/.test(t) || /ios|android|ipados/.test(i) ? o.smartphone : /desktop|browser/.test(t) || /mac|windows|linux|chrome os/.test(i) ? o.monitor : o.globe;
|
|
4952
5032
|
}
|
|
4953
5033
|
renderSessions() {
|
|
4954
5034
|
const e = this.sessions;
|
|
@@ -4958,7 +5038,7 @@ let p = class extends E {
|
|
|
4958
5038
|
void 0,
|
|
4959
5039
|
r`${this.error("sessions")}
|
|
4960
5040
|
${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
|
|
4961
|
-
|
|
5041
|
+
o.monitor,
|
|
4962
5042
|
this.t("noSessions"),
|
|
4963
5043
|
this.t("noSessionsDescription")
|
|
4964
5044
|
) : e.map(
|
|
@@ -4984,7 +5064,7 @@ let p = class extends E {
|
|
|
4984
5064
|
?disabled=${!!this.busy}
|
|
4985
5065
|
aria-label=${this.t("signOutSession")}
|
|
4986
5066
|
>
|
|
4987
|
-
${
|
|
5067
|
+
${o.logOut}
|
|
4988
5068
|
</button>
|
|
4989
5069
|
</div>
|
|
4990
5070
|
</div>`
|
|
@@ -4999,7 +5079,7 @@ let p = class extends E {
|
|
|
4999
5079
|
@click=${this.onSignOutAll}
|
|
5000
5080
|
?disabled=${!!this.busy}
|
|
5001
5081
|
>
|
|
5002
|
-
${this.spinner("sessions-all")} ${
|
|
5082
|
+
${this.spinner("sessions-all")} ${o.logOut} ${this.t("signOutAllSessions")}
|
|
5003
5083
|
</button>`,
|
|
5004
5084
|
this.confirmSignOutAll ? this.confirmFooter(
|
|
5005
5085
|
() => {
|
|
@@ -5024,7 +5104,7 @@ let p = class extends E {
|
|
|
5024
5104
|
void 0,
|
|
5025
5105
|
r`${this.error("identities")}
|
|
5026
5106
|
${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
|
|
5027
|
-
|
|
5107
|
+
o.link,
|
|
5028
5108
|
this.t("noConnections"),
|
|
5029
5109
|
this.t("noConnectionsDescription")
|
|
5030
5110
|
) : e.map(
|
|
@@ -5071,7 +5151,7 @@ let p = class extends E {
|
|
|
5071
5151
|
(i) => r`<button
|
|
5072
5152
|
class="btn btn-outline btn-sm"
|
|
5073
5153
|
@click=${() => {
|
|
5074
|
-
this.run(`connect-${i}`, () =>
|
|
5154
|
+
this.run(`connect-${i}`, () => l.signInWithOAuth(i));
|
|
5075
5155
|
}}
|
|
5076
5156
|
?disabled=${!!this.busy}
|
|
5077
5157
|
>
|
|
@@ -5090,7 +5170,7 @@ let p = class extends E {
|
|
|
5090
5170
|
this.t("activity"),
|
|
5091
5171
|
void 0,
|
|
5092
5172
|
r`${e === null ? r`<div class="empty"><span class="spinner"></span></div>` : e.length === 0 ? this.emptyState(
|
|
5093
|
-
|
|
5173
|
+
o.activity,
|
|
5094
5174
|
this.t("noActivity"),
|
|
5095
5175
|
this.t("noActivityDescription")
|
|
5096
5176
|
) : e.map(
|
|
@@ -5110,7 +5190,7 @@ let p = class extends E {
|
|
|
5110
5190
|
};
|
|
5111
5191
|
p.styles = [
|
|
5112
5192
|
...E.styles,
|
|
5113
|
-
|
|
5193
|
+
T`
|
|
5114
5194
|
:host {
|
|
5115
5195
|
display: block;
|
|
5116
5196
|
width: 100%;
|
|
@@ -5213,110 +5293,122 @@ f([
|
|
|
5213
5293
|
m({ type: String })
|
|
5214
5294
|
], p.prototype, "tab", 2);
|
|
5215
5295
|
f([
|
|
5216
|
-
|
|
5296
|
+
c()
|
|
5217
5297
|
], p.prototype, "active", 2);
|
|
5218
5298
|
f([
|
|
5219
|
-
|
|
5299
|
+
c()
|
|
5220
5300
|
], p.prototype, "busy", 2);
|
|
5221
5301
|
f([
|
|
5222
|
-
|
|
5302
|
+
c()
|
|
5223
5303
|
], p.prototype, "notice", 2);
|
|
5224
5304
|
f([
|
|
5225
|
-
|
|
5305
|
+
c()
|
|
5226
5306
|
], p.prototype, "errors", 2);
|
|
5227
5307
|
f([
|
|
5228
|
-
|
|
5308
|
+
c()
|
|
5229
5309
|
], p.prototype, "nameInput", 2);
|
|
5230
5310
|
f([
|
|
5231
|
-
|
|
5311
|
+
c()
|
|
5232
5312
|
], p.prototype, "emailInput", 2);
|
|
5233
5313
|
f([
|
|
5234
|
-
|
|
5314
|
+
c()
|
|
5235
5315
|
], p.prototype, "emailPassword", 2);
|
|
5236
5316
|
f([
|
|
5237
|
-
|
|
5317
|
+
c()
|
|
5238
5318
|
], p.prototype, "phoneInput", 2);
|
|
5239
5319
|
f([
|
|
5240
|
-
|
|
5320
|
+
c()
|
|
5241
5321
|
], p.prototype, "phonePassword", 2);
|
|
5242
5322
|
f([
|
|
5243
|
-
|
|
5323
|
+
c()
|
|
5244
5324
|
], p.prototype, "phoneCode", 2);
|
|
5245
5325
|
f([
|
|
5246
|
-
|
|
5326
|
+
c()
|
|
5247
5327
|
], p.prototype, "phoneCodeSent", 2);
|
|
5248
5328
|
f([
|
|
5249
|
-
|
|
5329
|
+
c()
|
|
5250
5330
|
], p.prototype, "guestName", 2);
|
|
5251
5331
|
f([
|
|
5252
|
-
|
|
5332
|
+
c()
|
|
5253
5333
|
], p.prototype, "oldPassword", 2);
|
|
5254
5334
|
f([
|
|
5255
|
-
|
|
5335
|
+
c()
|
|
5256
5336
|
], p.prototype, "newPassword", 2);
|
|
5257
5337
|
f([
|
|
5258
|
-
|
|
5338
|
+
c()
|
|
5259
5339
|
], p.prototype, "newPasswordConfirm", 2);
|
|
5260
5340
|
f([
|
|
5261
|
-
|
|
5341
|
+
c()
|
|
5342
|
+
], p.prototype, "showOldPassword", 2);
|
|
5343
|
+
f([
|
|
5344
|
+
c()
|
|
5345
|
+
], p.prototype, "showNewPassword", 2);
|
|
5346
|
+
f([
|
|
5347
|
+
c()
|
|
5348
|
+
], p.prototype, "showNewPasswordConfirm", 2);
|
|
5349
|
+
f([
|
|
5350
|
+
c()
|
|
5262
5351
|
], p.prototype, "authenticator", 2);
|
|
5263
5352
|
f([
|
|
5264
|
-
|
|
5353
|
+
c()
|
|
5265
5354
|
], p.prototype, "authenticatorCode", 2);
|
|
5266
5355
|
f([
|
|
5267
|
-
|
|
5356
|
+
c()
|
|
5268
5357
|
], p.prototype, "factors", 2);
|
|
5269
5358
|
f([
|
|
5270
|
-
|
|
5359
|
+
c()
|
|
5271
5360
|
], p.prototype, "recoveryCodes", 2);
|
|
5272
5361
|
f([
|
|
5273
|
-
|
|
5362
|
+
c()
|
|
5274
5363
|
], p.prototype, "stepUp", 2);
|
|
5275
5364
|
f([
|
|
5276
|
-
|
|
5365
|
+
c()
|
|
5277
5366
|
], p.prototype, "stepUpCode", 2);
|
|
5278
5367
|
f([
|
|
5279
|
-
|
|
5368
|
+
c()
|
|
5280
5369
|
], p.prototype, "copied", 2);
|
|
5281
5370
|
f([
|
|
5282
|
-
|
|
5371
|
+
c()
|
|
5283
5372
|
], p.prototype, "sessions", 2);
|
|
5284
5373
|
f([
|
|
5285
|
-
|
|
5374
|
+
c()
|
|
5286
5375
|
], p.prototype, "identities", 2);
|
|
5287
5376
|
f([
|
|
5288
|
-
|
|
5377
|
+
c()
|
|
5289
5378
|
], p.prototype, "logs", 2);
|
|
5290
5379
|
f([
|
|
5291
|
-
|
|
5380
|
+
c()
|
|
5292
5381
|
], p.prototype, "logsSupported", 2);
|
|
5293
5382
|
f([
|
|
5294
|
-
|
|
5383
|
+
c()
|
|
5295
5384
|
], p.prototype, "confirmDelete", 2);
|
|
5296
5385
|
f([
|
|
5297
|
-
|
|
5386
|
+
c()
|
|
5298
5387
|
], p.prototype, "confirmRegenerate", 2);
|
|
5299
5388
|
f([
|
|
5300
|
-
|
|
5389
|
+
c()
|
|
5301
5390
|
], p.prototype, "confirmRemoveAuthenticator", 2);
|
|
5302
5391
|
f([
|
|
5303
|
-
|
|
5392
|
+
c()
|
|
5304
5393
|
], p.prototype, "confirmSignOutAll", 2);
|
|
5305
5394
|
f([
|
|
5306
|
-
|
|
5395
|
+
c()
|
|
5307
5396
|
], p.prototype, "confirmDisconnectId", 2);
|
|
5308
5397
|
f([
|
|
5309
|
-
|
|
5398
|
+
c()
|
|
5310
5399
|
], p.prototype, "verifyEmailCooldownUntil", 2);
|
|
5400
|
+
f([
|
|
5401
|
+
c()
|
|
5402
|
+
], p.prototype, "verifyPhoneCooldownUntil", 2);
|
|
5311
5403
|
p = f([
|
|
5312
|
-
|
|
5404
|
+
L("authui-account")
|
|
5313
5405
|
], p);
|
|
5314
5406
|
var Jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, R = (e, t, i, s) => {
|
|
5315
|
-
for (var a = s > 1 ? void 0 : s ? te(t, i) : t,
|
|
5316
|
-
(
|
|
5407
|
+
for (var a = s > 1 ? void 0 : s ? te(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5408
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5317
5409
|
return s && a && Jt(t, i, a), a;
|
|
5318
5410
|
};
|
|
5319
|
-
let
|
|
5411
|
+
let I = class extends E {
|
|
5320
5412
|
constructor() {
|
|
5321
5413
|
super(...arguments), this.open = !1, this.view = "sign-in", this.closeOnSuccess = !0, this.handledPending = null, this.scrollCue = !1, this.bodyResizeObserver = null, this.onOpenEvent = (e) => {
|
|
5322
5414
|
const t = e.detail ?? {};
|
|
@@ -5397,7 +5489,7 @@ let U = class extends E {
|
|
|
5397
5489
|
@click=${this.hide}
|
|
5398
5490
|
aria-label=${this.t("close")}
|
|
5399
5491
|
>
|
|
5400
|
-
${
|
|
5492
|
+
${o.x}
|
|
5401
5493
|
</button>
|
|
5402
5494
|
</div>
|
|
5403
5495
|
<div class="body" @scroll=${this.syncScrollCue}>
|
|
@@ -5412,9 +5504,9 @@ let U = class extends E {
|
|
|
5412
5504
|
`;
|
|
5413
5505
|
}
|
|
5414
5506
|
};
|
|
5415
|
-
|
|
5507
|
+
I.styles = [
|
|
5416
5508
|
...E.styles,
|
|
5417
|
-
|
|
5509
|
+
T`
|
|
5418
5510
|
:host {
|
|
5419
5511
|
display: contents;
|
|
5420
5512
|
}
|
|
@@ -5504,10 +5596,10 @@ U.styles = [
|
|
|
5504
5596
|
];
|
|
5505
5597
|
R([
|
|
5506
5598
|
m({ type: Boolean, reflect: !0 })
|
|
5507
|
-
],
|
|
5599
|
+
], I.prototype, "open", 2);
|
|
5508
5600
|
R([
|
|
5509
5601
|
m({ type: String })
|
|
5510
|
-
],
|
|
5602
|
+
], I.prototype, "view", 2);
|
|
5511
5603
|
R([
|
|
5512
5604
|
m({
|
|
5513
5605
|
attribute: "close-on-success",
|
|
@@ -5523,28 +5615,28 @@ R([
|
|
|
5523
5615
|
}
|
|
5524
5616
|
}
|
|
5525
5617
|
})
|
|
5526
|
-
],
|
|
5618
|
+
], I.prototype, "closeOnSuccess", 2);
|
|
5527
5619
|
R([
|
|
5528
|
-
|
|
5529
|
-
],
|
|
5620
|
+
c()
|
|
5621
|
+
], I.prototype, "handledPending", 2);
|
|
5530
5622
|
R([
|
|
5531
|
-
|
|
5532
|
-
],
|
|
5623
|
+
c()
|
|
5624
|
+
], I.prototype, "scrollCue", 2);
|
|
5533
5625
|
R([
|
|
5534
|
-
|
|
5535
|
-
],
|
|
5626
|
+
at("dialog")
|
|
5627
|
+
], I.prototype, "dialog", 2);
|
|
5536
5628
|
R([
|
|
5537
|
-
|
|
5538
|
-
],
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
],
|
|
5629
|
+
at(".body")
|
|
5630
|
+
], I.prototype, "bodyEl", 2);
|
|
5631
|
+
I = R([
|
|
5632
|
+
L("authui-modal")
|
|
5633
|
+
], I);
|
|
5542
5634
|
var ee = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, J = (e, t, i, s) => {
|
|
5543
|
-
for (var a = s > 1 ? void 0 : s ? ie(t, i) : t,
|
|
5544
|
-
(
|
|
5635
|
+
for (var a = s > 1 ? void 0 : s ? ie(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5636
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5545
5637
|
return s && a && ee(t, i, a), a;
|
|
5546
5638
|
};
|
|
5547
|
-
let
|
|
5639
|
+
let V = class extends E {
|
|
5548
5640
|
constructor() {
|
|
5549
5641
|
super(...arguments), this.view = "sign-in", this.variant = "primary", this.size = "md";
|
|
5550
5642
|
}
|
|
@@ -5561,9 +5653,9 @@ let q = class extends E {
|
|
|
5561
5653
|
</button>`;
|
|
5562
5654
|
}
|
|
5563
5655
|
};
|
|
5564
|
-
|
|
5656
|
+
V.styles = [
|
|
5565
5657
|
...E.styles,
|
|
5566
|
-
|
|
5658
|
+
T`
|
|
5567
5659
|
:host {
|
|
5568
5660
|
display: inline-block;
|
|
5569
5661
|
}
|
|
@@ -5574,22 +5666,22 @@ q.styles = [
|
|
|
5574
5666
|
];
|
|
5575
5667
|
J([
|
|
5576
5668
|
m({ type: String })
|
|
5577
|
-
],
|
|
5669
|
+
], V.prototype, "view", 2);
|
|
5578
5670
|
J([
|
|
5579
5671
|
m({ type: String })
|
|
5580
|
-
],
|
|
5672
|
+
], V.prototype, "variant", 2);
|
|
5581
5673
|
J([
|
|
5582
5674
|
m({ type: String })
|
|
5583
|
-
],
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
],
|
|
5675
|
+
], V.prototype, "size", 2);
|
|
5676
|
+
V = J([
|
|
5677
|
+
L("authui-button")
|
|
5678
|
+
], V);
|
|
5587
5679
|
var se = Object.defineProperty, re = Object.getOwnPropertyDescriptor, F = (e, t, i, s) => {
|
|
5588
|
-
for (var a = s > 1 ? void 0 : s ? re(t, i) : t,
|
|
5589
|
-
(
|
|
5680
|
+
for (var a = s > 1 ? void 0 : s ? re(t, i) : t, h = e.length - 1, d; h >= 0; h--)
|
|
5681
|
+
(d = e[h]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
5590
5682
|
return s && a && se(t, i, a), a;
|
|
5591
5683
|
};
|
|
5592
|
-
let
|
|
5684
|
+
let U = class extends E {
|
|
5593
5685
|
constructor() {
|
|
5594
5686
|
super(...arguments), this.showTeams = !1, this.menuItems = [], this.src = "", this.menuOpen = !1, this.menuAbove = !1, this.teams = [], this.teamsLoading = !1, this.activeTeamId = null, this.onReposition = () => {
|
|
5595
5687
|
this.menuOpen && this.placeMenu();
|
|
@@ -5613,7 +5705,7 @@ let I = class extends E {
|
|
|
5613
5705
|
}, this.toggleMenu = () => {
|
|
5614
5706
|
this.menuOpen = !this.menuOpen, this.menuOpen && this.showTeams && this.loadTeams();
|
|
5615
5707
|
}, this.selectTeam = (e) => {
|
|
5616
|
-
|
|
5708
|
+
l.setActiveTeam({ $id: e.$id, name: e.name }), this.activeTeamId = e.$id, this.dispatchEvent(
|
|
5617
5709
|
new CustomEvent("authui-active-team", {
|
|
5618
5710
|
detail: { teamId: e.$id, team: e },
|
|
5619
5711
|
bubbles: !0,
|
|
@@ -5634,10 +5726,10 @@ let I = class extends E {
|
|
|
5634
5726
|
if (!e || !t) return;
|
|
5635
5727
|
const i = e.getBoundingClientRect(), s = 6, a = 8;
|
|
5636
5728
|
t.style.maxHeight = "";
|
|
5637
|
-
const
|
|
5729
|
+
const h = t.offsetHeight + s, d = window.innerHeight - i.bottom, g = i.top, y = d < h && g > d;
|
|
5638
5730
|
y !== this.menuAbove && (this.menuAbove = y);
|
|
5639
|
-
const
|
|
5640
|
-
t.style.maxHeight = `${
|
|
5731
|
+
const C = Math.max(80, (y ? g : d) - s - a);
|
|
5732
|
+
t.style.maxHeight = `${C}px`;
|
|
5641
5733
|
}
|
|
5642
5734
|
focusMenuItem(e) {
|
|
5643
5735
|
[
|
|
@@ -5650,9 +5742,9 @@ let I = class extends E {
|
|
|
5650
5742
|
})) : this.menuAbove = !1), this.menuOpen && (e.has("teams") || e.has("teamsLoading")) && requestAnimationFrame(() => this.placeMenu());
|
|
5651
5743
|
}
|
|
5652
5744
|
async loadTeams() {
|
|
5653
|
-
this.teamsLoading = !0, this.activeTeamId =
|
|
5745
|
+
this.teamsLoading = !0, this.activeTeamId = l.getActiveTeamId();
|
|
5654
5746
|
try {
|
|
5655
|
-
this.teams = await
|
|
5747
|
+
this.teams = await l.listTeams(), this.activeTeamId && !this.teams.some((e) => e.$id === this.activeTeamId) && (this.activeTeamId = null, l.setActiveTeam(null));
|
|
5656
5748
|
} catch {
|
|
5657
5749
|
this.teams = [];
|
|
5658
5750
|
} finally {
|
|
@@ -5677,7 +5769,7 @@ let I = class extends E {
|
|
|
5677
5769
|
aria-label=${s}
|
|
5678
5770
|
>
|
|
5679
5771
|
<span class="avatar"
|
|
5680
|
-
>${this.src ? r`<img src=${this.src} alt="" />` :
|
|
5772
|
+
>${this.src ? r`<img src=${this.src} alt="" />` : lt(s)}</span
|
|
5681
5773
|
>
|
|
5682
5774
|
</button>
|
|
5683
5775
|
${this.menuOpen ? r`<div class="menu ${this.menuAbove ? "above" : ""}" role="menu">
|
|
@@ -5696,9 +5788,9 @@ let I = class extends E {
|
|
|
5696
5788
|
aria-checked=${a.$id === this.activeTeamId ? "true" : "false"}
|
|
5697
5789
|
@click=${() => this.selectTeam(a)}
|
|
5698
5790
|
>
|
|
5699
|
-
${
|
|
5791
|
+
${o.users}
|
|
5700
5792
|
<span title=${a.name}>${a.name}</span>
|
|
5701
|
-
${a.$id === this.activeTeamId ? r`<span class="check">${
|
|
5793
|
+
${a.$id === this.activeTeamId ? r`<span class="check">${o.check}</span>` : n}
|
|
5702
5794
|
</button>`
|
|
5703
5795
|
)}
|
|
5704
5796
|
</div>` : n}
|
|
@@ -5711,16 +5803,16 @@ let I = class extends E {
|
|
|
5711
5803
|
this.menuOpen = !1, X("account");
|
|
5712
5804
|
}}
|
|
5713
5805
|
>
|
|
5714
|
-
${
|
|
5806
|
+
${o.settings} ${this.t("manageAccount")}
|
|
5715
5807
|
</button>
|
|
5716
5808
|
<button
|
|
5717
5809
|
class="menu-item"
|
|
5718
5810
|
role="menuitem"
|
|
5719
5811
|
@click=${() => {
|
|
5720
|
-
this.menuOpen = !1,
|
|
5812
|
+
this.menuOpen = !1, l.signOut();
|
|
5721
5813
|
}}
|
|
5722
5814
|
>
|
|
5723
|
-
${
|
|
5815
|
+
${o.logOut} ${this.t("signOut")}
|
|
5724
5816
|
</button>
|
|
5725
5817
|
</div>` : n}
|
|
5726
5818
|
`;
|
|
@@ -5762,9 +5854,9 @@ let I = class extends E {
|
|
|
5762
5854
|
}) : n;
|
|
5763
5855
|
}
|
|
5764
5856
|
};
|
|
5765
|
-
|
|
5857
|
+
U.styles = [
|
|
5766
5858
|
...E.styles,
|
|
5767
|
-
|
|
5859
|
+
T`
|
|
5768
5860
|
:host {
|
|
5769
5861
|
display: inline-block;
|
|
5770
5862
|
position: relative;
|
|
@@ -5886,61 +5978,61 @@ I.styles = [
|
|
|
5886
5978
|
];
|
|
5887
5979
|
F([
|
|
5888
5980
|
m({ type: Boolean, attribute: "show-teams" })
|
|
5889
|
-
],
|
|
5981
|
+
], U.prototype, "showTeams", 2);
|
|
5890
5982
|
F([
|
|
5891
5983
|
m({ attribute: !1 })
|
|
5892
|
-
],
|
|
5984
|
+
], U.prototype, "menuItems", 2);
|
|
5893
5985
|
F([
|
|
5894
5986
|
m({ type: String })
|
|
5895
|
-
],
|
|
5987
|
+
], U.prototype, "src", 2);
|
|
5896
5988
|
F([
|
|
5897
|
-
|
|
5898
|
-
],
|
|
5989
|
+
c()
|
|
5990
|
+
], U.prototype, "menuOpen", 2);
|
|
5899
5991
|
F([
|
|
5900
|
-
|
|
5901
|
-
],
|
|
5992
|
+
c()
|
|
5993
|
+
], U.prototype, "menuAbove", 2);
|
|
5902
5994
|
F([
|
|
5903
|
-
|
|
5904
|
-
],
|
|
5995
|
+
c()
|
|
5996
|
+
], U.prototype, "teams", 2);
|
|
5905
5997
|
F([
|
|
5906
|
-
|
|
5907
|
-
],
|
|
5998
|
+
c()
|
|
5999
|
+
], U.prototype, "teamsLoading", 2);
|
|
5908
6000
|
F([
|
|
5909
|
-
|
|
5910
|
-
],
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
],
|
|
6001
|
+
c()
|
|
6002
|
+
], U.prototype, "activeTeamId", 2);
|
|
6003
|
+
U = F([
|
|
6004
|
+
L("authui-user-button")
|
|
6005
|
+
], U);
|
|
5914
6006
|
export {
|
|
5915
|
-
|
|
6007
|
+
Tt as A,
|
|
5916
6008
|
ce as C,
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
6009
|
+
v as E,
|
|
6010
|
+
yt as F,
|
|
6011
|
+
It as P,
|
|
6012
|
+
l as a,
|
|
5921
6013
|
p as b,
|
|
5922
6014
|
de as c,
|
|
5923
|
-
|
|
6015
|
+
V as d,
|
|
5924
6016
|
w as e,
|
|
5925
6017
|
E as f,
|
|
5926
|
-
|
|
6018
|
+
I as g,
|
|
5927
6019
|
H as h,
|
|
5928
|
-
|
|
5929
|
-
|
|
6020
|
+
$ as i,
|
|
6021
|
+
U as j,
|
|
5930
6022
|
le as k,
|
|
5931
|
-
|
|
6023
|
+
ft as l,
|
|
5932
6024
|
St as m,
|
|
5933
6025
|
Y as n,
|
|
5934
6026
|
X as o,
|
|
5935
|
-
|
|
5936
|
-
|
|
6027
|
+
z as p,
|
|
6028
|
+
pt as q,
|
|
5937
6029
|
Mt as r,
|
|
5938
6030
|
N as s,
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
6031
|
+
_ as t,
|
|
6032
|
+
$t as u,
|
|
6033
|
+
rt as v,
|
|
5942
6034
|
Ot as w,
|
|
5943
6035
|
Ft as x,
|
|
5944
|
-
|
|
6036
|
+
q as y,
|
|
5945
6037
|
Wt as z
|
|
5946
6038
|
};
|