@wssto2/vue-core 0.4.28 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
- package/dist/{Activity-BWkVX1Nx.js → Activity-CoGI2_GL.js} +7 -7
- package/dist/{Changes-MG77TDwz.js → Changes-Cwfe6wbX.js} +6 -6
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js} +4 -4
- package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
- package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-DyA5Dqn0.js} +7 -7
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
- package/dist/{General-UTBVEXbN.js → General-DTEfxWls.js} +10 -10
- package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
- package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-CRZoUajV.js} +3 -3
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
- package/dist/ProfilePage-DLY81mvN.js +764 -0
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js +325 -0
- package/dist/RolePage-B9t586Q8.js +314 -0
- package/dist/{RolesPage-B5RwSZ89.js → RolesPage-BRdG-OSL.js} +6 -6
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js} +1 -1
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
- package/dist/{Sessions-DWj2OGo0.js → Sessions-vGyUOnPG.js} +5 -5
- package/dist/SettingsPage-V8WeADZZ.js +632 -0
- package/dist/{SignIn-COThB9XN.js → SignIn-C-3i8RG6.js} +7 -7
- package/dist/{SignInPage-CdzgSvRm.js → SignInPage-D2NA3VKU.js} +4 -4
- package/dist/SignIns-eoYPB6kB.js +121 -0
- package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
- package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
- package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
- package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BaQl2zzQ.js} +13 -13
- package/dist/{UsersList-Chq8yM5C.js → UsersList-BfXWgH5K.js} +9 -9
- package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
- package/dist/access/RoleEditor.vue.d.ts +2 -0
- package/dist/access/constraints.d.ts +28 -0
- package/dist/access/context.d.ts +5 -0
- package/dist/access/feature.d.ts +17 -0
- package/dist/access/index.d.ts +3 -1
- package/dist/access/index.js +11 -9
- package/dist/access/refusals.d.ts +20 -2
- package/dist/app/index.js +6 -6
- package/dist/client/index.js +19 -11
- package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
- package/dist/collection/index.js +3 -3
- package/dist/content/index.js +66 -37
- package/dist/{contributions-BVBZP5Jb.js → contributions-DVQPcjJz.js} +1 -1
- package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
- package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
- package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
- package/dist/form/index.js +1235 -1412
- package/dist/{guards-BJZjc3FZ.js → guards-DRh4zmxO.js} +1 -1
- package/dist/{http-BFfkA7gN.js → http-D_pBg22D.js} +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +30 -30
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity/index.js +8 -6
- package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
- package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
- package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
- package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
- package/dist/identity/profile/profileSections.d.ts +37 -0
- package/dist/identity/shared/SignInList.vue.d.ts +22 -0
- package/dist/identity/shared/deviceLabel.d.ts +7 -0
- package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
- package/dist/identity/users/context.d.ts +3 -0
- package/dist/identity/users/feature.d.ts +3 -0
- package/dist/index-WkbzC_ee.js +745 -0
- package/dist/index-g-qbUeTk.js +630 -0
- package/dist/index-kqk7Mclb.js +480 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/notification/entities.d.ts +19 -0
- package/dist/modules/notification/routes.d.ts +25 -1
- package/dist/modules/notification/schemas.d.ts +24 -0
- package/dist/{navigation-DpcDF0rX.js → navigation-DuQwti76.js} +1 -1
- package/dist/{neighbors-RVQ4O3Qv.js → neighbors-IMRQ4rkm.js} +22 -22
- package/dist/notifications/context.d.ts +24 -1
- package/dist/notifications/feature.d.ts +10 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
- package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
- package/dist/notifications/push/browser.d.ts +40 -0
- package/dist/notifications/push/devices.d.ts +15 -0
- package/dist/notifications/push/thisDevice.d.ts +28 -0
- package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
- package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
- package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
- package/dist/notifications/settings/settings.d.ts +4 -3
- package/dist/notifications/settings/state.d.ts +4 -2
- package/dist/options-g8RwEhBk.js +366 -0
- package/dist/overlay/index.js +37 -59
- package/dist/page/index.js +1 -1
- package/dist/phone/index.js +10 -11
- package/dist/platform/index.js +3 -3
- package/dist/{platform-PZpUkkMS.js → platform-Dl1fbScN.js} +2 -2
- package/dist/push-worker/index.d.ts +91 -0
- package/dist/push-worker/index.js +54 -0
- package/dist/resource/index.js +1 -1
- package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
- package/dist/router/index.js +3 -3
- package/dist/{sections-CeZl-Jxg.js → sections-D5rgQ4YB.js} +1 -1
- package/dist/shell/index.js +3 -3
- package/dist/signInEvents-DWShrJox.js +30 -0
- package/dist/state/index.js +1 -1
- package/dist/{status-dGvfh1TP.js → status-C2gHqkj6.js} +2 -2
- package/dist/styles.css +1 -1
- package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
- package/dist/testing/index.js +1 -1
- package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
- package/dist/useGroupSheet-ATvc0IiM.js +278 -0
- package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
- package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
- package/package.json +6 -2
- package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
- package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
- package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
- package/dist/ProfilePage-C8VhiKIh.js +0 -654
- package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
- package/dist/RolePage-ODFu68Ce.js +0 -315
- package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
- package/dist/SettingsPage-C3fPSmi7.js +0 -255
- package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
- package/dist/SignIns-cztICmqt.js +0 -66
- package/dist/control-B4SdblL6.js +0 -350
- package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
- package/dist/index-BhtJR4c_.js +0 -459
- package/dist/index-C3E6DcO0.js +0 -706
- package/dist/index-sTBBHqNG.js +0 -504
- package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
- package/dist/options-Ba_0uLWN.js +0 -18
- package/dist/route-goWMxDUN.js +0 -13
- package/dist/transport-BnP7WC0Y.js +0 -4
- /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
- /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
import { defineComponent as P, openBlock as f, createBlock as E, unref as e, withCtx as m, createVNode as i, mergeProps as N, createElementVNode as A, toDisplayString as $, watch as Q, createElementBlock as b, Fragment as V, useModel as ge, useId as ye, useTemplateRef as Y, ref as x, onMounted as be, onBeforeUnmount as we, computed as L, withModifiers as he, createCommentVNode as z, createTextVNode as U, mergeModels as re, createSlots as xe, renderList as de, renderSlot as $e, resolveDynamicComponent as ne } from "vue";
|
|
2
|
+
import { useI18n as I } from "vue-i18n";
|
|
3
|
+
import { a as ke } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-GUTIXuNd.js";
|
|
4
|
+
import { u as G } from "./platform-Dl1fbScN.js";
|
|
5
|
+
import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
|
|
6
|
+
import { u as te } from "./useLoad-W4tfxmm5.js";
|
|
7
|
+
import { i as S, d as T, c as qe } from "./index-kqk7Mclb.js";
|
|
8
|
+
import { u as ce } from "./FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js";
|
|
9
|
+
import { _ as ue } from "./FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js";
|
|
10
|
+
import { u as Ce, _ as Se, a as Ee, b as Ve } from "./useGroupSheet-ATvc0IiM.js";
|
|
11
|
+
import { _ as H, p as Pe } from "./FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js";
|
|
12
|
+
import { t as C } from "./toast-CqSDTWRX.js";
|
|
13
|
+
import { u as W } from "./fieldMessages-DTXpWnBd.js";
|
|
14
|
+
import { g as K } from "./options-g8RwEhBk.js";
|
|
15
|
+
import { _ as F } from "./TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js";
|
|
16
|
+
import { _ as pe } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
|
|
17
|
+
import { u as ae } from "./format-D8X4zsx6.js";
|
|
18
|
+
import { _ as X } from "./ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js";
|
|
19
|
+
import { i as Z } from "./error-Bb_dr_Ay.js";
|
|
20
|
+
import { a as Ie } from "./leaveGuard-Cc8yeLxM.js";
|
|
21
|
+
import { _ as Ne } from "./Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
|
|
22
|
+
import { _ as J } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
|
|
23
|
+
import { u as Ae, _ as Me } from "./useCommand-CtqheKUv.js";
|
|
24
|
+
import { _ as Re } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
|
|
25
|
+
import { _ as De } from "./SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js";
|
|
26
|
+
import { _ as Le } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
|
|
27
|
+
import { _ as Ue } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
|
|
28
|
+
import { d as Fe, s as Ge, a as Be } from "./signInEvents-DWShrJox.js";
|
|
29
|
+
import { _ as Oe } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js";
|
|
30
|
+
const je = { class: "font-mono" }, ie = /* @__PURE__ */ P({
|
|
31
|
+
__name: "DetailsFields",
|
|
32
|
+
props: {
|
|
33
|
+
bind: { type: Function },
|
|
34
|
+
login: {}
|
|
35
|
+
},
|
|
36
|
+
setup(w) {
|
|
37
|
+
const l = w, { t: u } = I();
|
|
38
|
+
return (t, a) => (f(), E(e(H), {
|
|
39
|
+
group: "details",
|
|
40
|
+
header: e(u)("core.profile.details.title"),
|
|
41
|
+
footer: e(u)("core.profile.details.login_hint")
|
|
42
|
+
}, {
|
|
43
|
+
default: m(() => [
|
|
44
|
+
i(e(F), N(l.bind("name"), {
|
|
45
|
+
label: e(u)("core.users.fields.name"),
|
|
46
|
+
required: "",
|
|
47
|
+
autocomplete: "name"
|
|
48
|
+
}), null, 16, ["label"]),
|
|
49
|
+
i(e(F), N(l.bind("phone"), {
|
|
50
|
+
label: e(u)("core.users.fields.phone"),
|
|
51
|
+
type: "tel",
|
|
52
|
+
autocomplete: "tel"
|
|
53
|
+
}), null, 16, ["label"]),
|
|
54
|
+
i(e(K), {
|
|
55
|
+
layout: "value",
|
|
56
|
+
label: e(u)("core.users.fields.login"),
|
|
57
|
+
"data-profile-login": ""
|
|
58
|
+
}, {
|
|
59
|
+
default: m(() => [
|
|
60
|
+
A("span", je, $(l.login), 1)
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["label"])
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["header", "footer"]));
|
|
67
|
+
}
|
|
68
|
+
}), ze = /* @__PURE__ */ P({
|
|
69
|
+
__name: "DetailsGroup",
|
|
70
|
+
props: {
|
|
71
|
+
profile: {}
|
|
72
|
+
},
|
|
73
|
+
emits: ["updated"],
|
|
74
|
+
setup(w, { emit: l }) {
|
|
75
|
+
const u = w, t = l, { t: a } = I(), { http: r } = G(), o = {
|
|
76
|
+
safeParse(p) {
|
|
77
|
+
const { name: g, phone: y } = p;
|
|
78
|
+
return g.trim() === "" ? { success: !1, error: { issues: [{ path: ["name"], message: a("core.account.validation.required") }] } } : { success: !0, data: { name: g, phone: y.trim() === "" ? void 0 : y } };
|
|
79
|
+
}
|
|
80
|
+
}, s = ce({ ...W(), defaults: () => ({ name: "", phone: "" }), validator: o });
|
|
81
|
+
Q(() => u.profile, (p) => s.hydrate({ name: p.name, phone: p.phone }), { immediate: !0 });
|
|
82
|
+
const c = {}, d = Pe({ edit: (p) => c[p].present });
|
|
83
|
+
let n = null;
|
|
84
|
+
const h = Ce({
|
|
85
|
+
form: s,
|
|
86
|
+
group: "details",
|
|
87
|
+
fields: ["name", "phone"],
|
|
88
|
+
groupOf: d.groupOf,
|
|
89
|
+
save: async (p) => {
|
|
90
|
+
n = (await r.request(S.profileUpdate, { name: p.name, phone: p.phone.trim() === "" ? void 0 : p.phone })).data;
|
|
91
|
+
},
|
|
92
|
+
onSaved: () => {
|
|
93
|
+
C.success(a("core.profile.details.saved")), n && t("updated", n);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return c.details = h, (p, g) => (f(), b(V, null, [
|
|
97
|
+
i(e(ue), {
|
|
98
|
+
editable: !1,
|
|
99
|
+
"data-profile-details": ""
|
|
100
|
+
}, {
|
|
101
|
+
default: m(() => [
|
|
102
|
+
i(ie, {
|
|
103
|
+
bind: e(s).bind,
|
|
104
|
+
login: u.profile.login
|
|
105
|
+
}, null, 8, ["bind", "login"])
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}),
|
|
109
|
+
i(e(Se), {
|
|
110
|
+
sheet: e(h),
|
|
111
|
+
title: e(a)("core.profile.details.title"),
|
|
112
|
+
editable: !0,
|
|
113
|
+
"group-label": () => e(a)("core.profile.details.title")
|
|
114
|
+
}, {
|
|
115
|
+
default: m(() => [
|
|
116
|
+
i(e(Ee), {
|
|
117
|
+
only: "details",
|
|
118
|
+
editable: !0
|
|
119
|
+
}, {
|
|
120
|
+
default: m(() => [
|
|
121
|
+
i(ie, {
|
|
122
|
+
bind: e(s).bind,
|
|
123
|
+
login: u.profile.login
|
|
124
|
+
}, null, 8, ["bind", "login"])
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
})
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
130
|
+
}, 8, ["sheet", "title", "group-label"])
|
|
131
|
+
], 64));
|
|
132
|
+
}
|
|
133
|
+
}), Te = {
|
|
134
|
+
key: 0,
|
|
135
|
+
class: "max-w-sm text-body text-content-muted"
|
|
136
|
+
}, He = ["id"], Ke = {
|
|
137
|
+
key: 2,
|
|
138
|
+
class: "mt-3 text-footnote text-content-muted",
|
|
139
|
+
"data-verify-expires": ""
|
|
140
|
+
}, We = { class: "mt-6 flex w-full flex-col gap-2" }, Xe = /* @__PURE__ */ P({
|
|
141
|
+
__name: "VerifyCode",
|
|
142
|
+
props: /* @__PURE__ */ re({
|
|
143
|
+
description: { default: void 0 },
|
|
144
|
+
length: { default: 6 },
|
|
145
|
+
resendAvailableAt: { default: null },
|
|
146
|
+
expiresAt: { default: null },
|
|
147
|
+
error: { default: "" },
|
|
148
|
+
expired: { type: Boolean, default: !1 },
|
|
149
|
+
verifying: { type: Boolean, default: !1 },
|
|
150
|
+
resending: { type: Boolean, default: !1 }
|
|
151
|
+
}, {
|
|
152
|
+
modelValue: { default: "" },
|
|
153
|
+
modelModifiers: {}
|
|
154
|
+
}),
|
|
155
|
+
emits: /* @__PURE__ */ re(["verify", "resend", "cancel"], ["update:modelValue"]),
|
|
156
|
+
setup(w, { expose: l, emit: u }) {
|
|
157
|
+
const t = w, a = ge(w, "modelValue"), r = u, { t: o } = I(), s = ae(), c = ye(), d = Y("otp"), n = x(Date.now());
|
|
158
|
+
let h;
|
|
159
|
+
be(() => h = setInterval(() => n.value = Date.now(), 1e3)), we(() => clearInterval(h));
|
|
160
|
+
const p = L(() => {
|
|
161
|
+
const q = t.resendAvailableAt ? Date.parse(t.resendAvailableAt) : Number.NaN;
|
|
162
|
+
return Number.isNaN(q) ? 0 : Math.max(0, Math.ceil((q - n.value) / 1e3));
|
|
163
|
+
}), g = L(() => `${Math.floor(p.value / 60)}:${String(p.value % 60).padStart(2, "0")}`), y = L(() => t.expiresAt && !t.expired ? s.time(t.expiresAt) : ""), k = L(() => a.value.length === t.length), B = L(() => t.verifying || t.resending);
|
|
164
|
+
function R(q = a.value) {
|
|
165
|
+
q.length === t.length && !B.value && !t.expired && r("verify", q);
|
|
166
|
+
}
|
|
167
|
+
function O() {
|
|
168
|
+
p.value === 0 && !B.value && r("resend");
|
|
169
|
+
}
|
|
170
|
+
return Q(() => t.error, (q) => {
|
|
171
|
+
q && (a.value = "", d.value?.focus());
|
|
172
|
+
}), l({ focus: () => d.value?.focus() }), (q, M) => (f(), b("form", {
|
|
173
|
+
class: "flex flex-col items-center text-center",
|
|
174
|
+
"data-verify-code": "",
|
|
175
|
+
novalidate: "",
|
|
176
|
+
onSubmit: M[2] || (M[2] = he((D) => R(), ["prevent"]))
|
|
177
|
+
}, [
|
|
178
|
+
t.description ? (f(), b("p", Te, $(t.description), 1)) : z("", !0),
|
|
179
|
+
i(e(Ve), {
|
|
180
|
+
ref_key: "otp",
|
|
181
|
+
ref: d,
|
|
182
|
+
modelValue: a.value,
|
|
183
|
+
"onUpdate:modelValue": M[0] || (M[0] = (D) => a.value = D),
|
|
184
|
+
class: "mt-6",
|
|
185
|
+
length: t.length,
|
|
186
|
+
invalid: !!t.error,
|
|
187
|
+
disabled: t.expired || t.verifying,
|
|
188
|
+
"described-by": t.error ? e(c) : void 0,
|
|
189
|
+
autofocus: "",
|
|
190
|
+
onComplete: R
|
|
191
|
+
}, null, 8, ["modelValue", "length", "invalid", "disabled", "described-by"]),
|
|
192
|
+
t.error ? (f(), b("p", {
|
|
193
|
+
key: 1,
|
|
194
|
+
id: e(c),
|
|
195
|
+
role: "alert",
|
|
196
|
+
class: "mt-3 text-footnote text-content-destructive",
|
|
197
|
+
"data-verify-error": ""
|
|
198
|
+
}, $(t.error), 9, He)) : y.value ? (f(), b("p", Ke, $(e(o)("core.profile.email.valid_until", { time: y.value })), 1)) : z("", !0),
|
|
199
|
+
A("div", We, [
|
|
200
|
+
t.expired ? z("", !0) : (f(), E(e(J), {
|
|
201
|
+
key: 0,
|
|
202
|
+
type: "submit",
|
|
203
|
+
prominence: "primary",
|
|
204
|
+
size: "lg",
|
|
205
|
+
class: "w-full justify-center",
|
|
206
|
+
disabled: !k.value || t.resending,
|
|
207
|
+
processing: t.verifying,
|
|
208
|
+
"data-verify-submit": ""
|
|
209
|
+
}, {
|
|
210
|
+
default: m(() => [
|
|
211
|
+
U($(e(o)("core.profile.email.verify")), 1)
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
}, 8, ["disabled", "processing"])),
|
|
215
|
+
i(e(J), {
|
|
216
|
+
prominence: t.expired ? "primary" : "standard",
|
|
217
|
+
size: "lg",
|
|
218
|
+
class: "w-full justify-center",
|
|
219
|
+
disabled: p.value > 0 || t.verifying,
|
|
220
|
+
processing: t.resending,
|
|
221
|
+
"data-verify-resend": "",
|
|
222
|
+
onClick: O
|
|
223
|
+
}, {
|
|
224
|
+
default: m(() => [
|
|
225
|
+
p.value > 0 ? (f(), b(V, { key: 0 }, [
|
|
226
|
+
U($(e(o)("core.profile.email.resend_in", { time: g.value })), 1)
|
|
227
|
+
], 64)) : (f(), b(V, { key: 1 }, [
|
|
228
|
+
U($(t.expired ? e(o)("core.profile.email.request_new") : e(o)("core.profile.email.resend")), 1)
|
|
229
|
+
], 64))
|
|
230
|
+
]),
|
|
231
|
+
_: 1
|
|
232
|
+
}, 8, ["prominence", "disabled", "processing"]),
|
|
233
|
+
i(e(J), {
|
|
234
|
+
prominence: "link",
|
|
235
|
+
class: "mt-1 self-center",
|
|
236
|
+
disabled: t.verifying,
|
|
237
|
+
"data-verify-cancel": "",
|
|
238
|
+
onClick: M[1] || (M[1] = (D) => r("cancel"))
|
|
239
|
+
}, {
|
|
240
|
+
default: m(() => [
|
|
241
|
+
U($(e(o)("core.profile.email.cancel_change")), 1)
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["disabled"])
|
|
245
|
+
])
|
|
246
|
+
], 32));
|
|
247
|
+
}
|
|
248
|
+
}), Je = { class: "text-body text-content-muted" }, Qe = {
|
|
249
|
+
key: 1,
|
|
250
|
+
class: "px-2 py-4 sm:px-6"
|
|
251
|
+
}, Ye = /* @__PURE__ */ P({
|
|
252
|
+
__name: "EmailChangeDialog",
|
|
253
|
+
emits: ["pending", "changed", "cancelled"],
|
|
254
|
+
setup(w, { expose: l, emit: u }) {
|
|
255
|
+
const t = u, { t: a } = I(), { http: r } = G(), o = W(), s = Y("modal"), c = x("request"), d = x(null), n = x(!1), p = ce({ ...o, defaults: () => ({ email: "", password: "" }), validator: {
|
|
256
|
+
safeParse(v) {
|
|
257
|
+
const { email: _, password: j } = v, oe = a("core.account.validation.required"), le = [..._.trim() === "" ? [{ path: ["email"], message: oe }] : [], ...j === "" ? [{ path: ["password"], message: oe }] : []];
|
|
258
|
+
return le.length > 0 ? { success: !1, error: { issues: le } } : { success: !0, data: { email: _.trim(), current_password: j } };
|
|
259
|
+
}
|
|
260
|
+
}, serverField: (v) => v === "current_password" ? "password" : v }), { confirmDiscard: g } = Ie(() => n.value && c.value === "request" && p.dirty.value), y = x(""), k = x(""), B = x(!1), R = x(!1), O = x(!1), q = x(!1), M = ["identity.code.expired", "identity.code.too_many_attempts", "identity.code.no_pending"];
|
|
261
|
+
function D() {
|
|
262
|
+
y.value = "", k.value = "", B.value = !1;
|
|
263
|
+
}
|
|
264
|
+
function fe(v) {
|
|
265
|
+
d.value = v, c.value = v ? "verify" : "request", p.hydrate({ email: "", password: "" }), D(), s.value?.present();
|
|
266
|
+
}
|
|
267
|
+
async function se() {
|
|
268
|
+
const v = await p.submit(async (_) => (await r.request(S.profileRequestEmail, _)).data);
|
|
269
|
+
v.status === "saved" && (d.value = v.value, D(), c.value = "verify", t("pending", v.value));
|
|
270
|
+
}
|
|
271
|
+
async function me(v) {
|
|
272
|
+
if (!R.value) {
|
|
273
|
+
R.value = !0, k.value = "";
|
|
274
|
+
try {
|
|
275
|
+
const _ = (await r.request(S.profileConfirmEmail, { code: v })).data;
|
|
276
|
+
t("changed", _), C.success(a("core.profile.email.changed")), s.value?.dismiss();
|
|
277
|
+
} catch (_) {
|
|
278
|
+
if (T(_)) return;
|
|
279
|
+
if (Z(_) && _.fields.email?.[0]) {
|
|
280
|
+
d.value = null, t("pending", null), c.value = "request", p.errors.set({ email: [o.describeFieldError(_.fields.email[0])] });
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
B.value = Z(_) && _.code !== null && M.includes(_.code), k.value = o.sentence(_, a("core.profile.email.verify_failed"));
|
|
284
|
+
} finally {
|
|
285
|
+
R.value = !1;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
async function ve() {
|
|
290
|
+
if (!O.value) {
|
|
291
|
+
O.value = !0;
|
|
292
|
+
try {
|
|
293
|
+
d.value = (await r.request(S.profileResendEmail)).data, D(), t("pending", d.value), C.success(a("core.profile.email.code_sent", { email: d.value.email }));
|
|
294
|
+
} catch (v) {
|
|
295
|
+
if (T(v)) return;
|
|
296
|
+
if (Z(v) && v.code === "identity.code.no_pending") {
|
|
297
|
+
d.value = null, t("pending", null), c.value = "request", C.error(o.sentence(v, a("core.profile.email.resend_failed")));
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
k.value = o.sentence(v, a("core.profile.email.resend_failed"));
|
|
301
|
+
} finally {
|
|
302
|
+
O.value = !1;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async function _e() {
|
|
307
|
+
if (!q.value) {
|
|
308
|
+
q.value = !0;
|
|
309
|
+
try {
|
|
310
|
+
await r.request(S.profileCancelEmail), d.value = null, t("cancelled"), C.success(a("core.profile.email.cancelled")), s.value?.dismiss();
|
|
311
|
+
} catch (v) {
|
|
312
|
+
T(v) || C.error(o.sentence(v, a("core.profile.email.cancel_failed")));
|
|
313
|
+
} finally {
|
|
314
|
+
q.value = !1;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return l({ present: fe }), (v, _) => (f(), E(e(Ne), {
|
|
319
|
+
ref_key: "modal",
|
|
320
|
+
ref: s,
|
|
321
|
+
size: "md",
|
|
322
|
+
title: c.value === "request" ? e(a)("core.profile.email.change_title") : e(a)("core.profile.email.verify_title"),
|
|
323
|
+
"primary-label": c.value === "request" ? e(a)("core.profile.email.send_code") : void 0,
|
|
324
|
+
"without-footer": c.value === "verify",
|
|
325
|
+
status: e(p).submitting.value ? "processing" : "idle",
|
|
326
|
+
"before-dismiss": e(g),
|
|
327
|
+
onPrimary: se,
|
|
328
|
+
onPresented: _[1] || (_[1] = (j) => n.value = !0),
|
|
329
|
+
onDismissed: _[2] || (_[2] = (j) => n.value = !1)
|
|
330
|
+
}, {
|
|
331
|
+
default: m(() => [
|
|
332
|
+
c.value === "request" ? (f(), E(e(ue), {
|
|
333
|
+
key: 0,
|
|
334
|
+
form: e(p),
|
|
335
|
+
onSubmit: se
|
|
336
|
+
}, {
|
|
337
|
+
default: m(() => [
|
|
338
|
+
A("p", Je, $(e(a)("core.profile.email.request_hint")), 1),
|
|
339
|
+
i(e(F), N(e(p).bind("email"), {
|
|
340
|
+
label: e(a)("core.profile.email.new_email"),
|
|
341
|
+
type: "email",
|
|
342
|
+
required: "",
|
|
343
|
+
autocomplete: "email"
|
|
344
|
+
}), null, 16, ["label"]),
|
|
345
|
+
i(e(F), N(e(p).bind("password"), {
|
|
346
|
+
label: e(a)("core.profile.email.current_password"),
|
|
347
|
+
type: "password",
|
|
348
|
+
required: "",
|
|
349
|
+
autocomplete: "current-password"
|
|
350
|
+
}), null, 16, ["label"])
|
|
351
|
+
]),
|
|
352
|
+
_: 1
|
|
353
|
+
}, 8, ["form"])) : (f(), b("div", Qe, [
|
|
354
|
+
i(Xe, {
|
|
355
|
+
modelValue: y.value,
|
|
356
|
+
"onUpdate:modelValue": _[0] || (_[0] = (j) => y.value = j),
|
|
357
|
+
description: e(a)("core.profile.email.verify_description", { email: d.value?.email ?? "" }),
|
|
358
|
+
"resend-available-at": d.value?.resend_available_at ?? null,
|
|
359
|
+
"expires-at": d.value?.expires_at ?? null,
|
|
360
|
+
error: k.value,
|
|
361
|
+
expired: B.value,
|
|
362
|
+
verifying: R.value,
|
|
363
|
+
resending: O.value,
|
|
364
|
+
onVerify: me,
|
|
365
|
+
onResend: ve,
|
|
366
|
+
onCancel: _e
|
|
367
|
+
}, null, 8, ["modelValue", "description", "resend-available-at", "expires-at", "error", "expired", "verifying", "resending"])
|
|
368
|
+
]))
|
|
369
|
+
]),
|
|
370
|
+
_: 1
|
|
371
|
+
}, 8, ["title", "primary-label", "without-footer", "status", "before-dismiss"]));
|
|
372
|
+
}
|
|
373
|
+
}), Ze = /* @__PURE__ */ P({
|
|
374
|
+
__name: "EmailGroup",
|
|
375
|
+
props: {
|
|
376
|
+
profile: {}
|
|
377
|
+
},
|
|
378
|
+
emits: ["updated"],
|
|
379
|
+
setup(w, { emit: l }) {
|
|
380
|
+
const u = w, t = l, { t: a } = I(), { http: r } = G(), o = ae(), s = W(), c = Y("dialog"), d = x(!1), n = L(() => u.profile.pending_email), h = (g) => t("updated", { ...u.profile, pending_email: g });
|
|
381
|
+
async function p() {
|
|
382
|
+
if (!d.value) {
|
|
383
|
+
d.value = !0;
|
|
384
|
+
try {
|
|
385
|
+
await r.request(S.profileCancelEmail), C.success(a("core.profile.email.cancelled")), h(null);
|
|
386
|
+
} catch (g) {
|
|
387
|
+
T(g) || C.error(s.sentence(g, a("core.profile.email.cancel_failed")));
|
|
388
|
+
} finally {
|
|
389
|
+
d.value = !1;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return (g, y) => (f(), b(V, null, [
|
|
394
|
+
i(e(H), {
|
|
395
|
+
header: e(a)("core.profile.email.title"),
|
|
396
|
+
"data-profile-email": ""
|
|
397
|
+
}, {
|
|
398
|
+
default: m(() => [
|
|
399
|
+
i(e(K), {
|
|
400
|
+
layout: "value",
|
|
401
|
+
label: e(a)("core.profile.email.current"),
|
|
402
|
+
"data-profile-email-current": ""
|
|
403
|
+
}, {
|
|
404
|
+
default: m(() => [
|
|
405
|
+
U($(u.profile.email), 1)
|
|
406
|
+
]),
|
|
407
|
+
_: 1
|
|
408
|
+
}, 8, ["label"]),
|
|
409
|
+
i(X, {
|
|
410
|
+
label: e(a)("core.profile.email.change"),
|
|
411
|
+
"data-email-change": "",
|
|
412
|
+
onClick: y[0] || (y[0] = (k) => c.value?.present(null))
|
|
413
|
+
}, null, 8, ["label"]),
|
|
414
|
+
n.value ? (f(), b(V, { key: 0 }, [
|
|
415
|
+
i(e(K), {
|
|
416
|
+
layout: "setting",
|
|
417
|
+
label: e(a)("core.profile.email.pending", { email: n.value.email }),
|
|
418
|
+
sub: e(a)("core.profile.email.valid_until", { time: e(o).time(n.value.expires_at) }),
|
|
419
|
+
"data-email-pending": ""
|
|
420
|
+
}, {
|
|
421
|
+
leading: m(() => [
|
|
422
|
+
i(e(pe), {
|
|
423
|
+
tone: "neutral",
|
|
424
|
+
icon: "timeLine"
|
|
425
|
+
})
|
|
426
|
+
]),
|
|
427
|
+
_: 1
|
|
428
|
+
}, 8, ["label", "sub"]),
|
|
429
|
+
i(X, {
|
|
430
|
+
label: e(a)("core.profile.email.enter_code"),
|
|
431
|
+
"data-email-enter-code": "",
|
|
432
|
+
onClick: y[1] || (y[1] = (k) => c.value?.present(n.value))
|
|
433
|
+
}, null, 8, ["label"]),
|
|
434
|
+
i(X, {
|
|
435
|
+
label: e(a)("core.profile.email.cancel_change"),
|
|
436
|
+
tone: "critical",
|
|
437
|
+
disabled: d.value,
|
|
438
|
+
"data-email-cancel": "",
|
|
439
|
+
onClick: p
|
|
440
|
+
}, null, 8, ["label", "disabled"])
|
|
441
|
+
], 64)) : z("", !0)
|
|
442
|
+
]),
|
|
443
|
+
_: 1
|
|
444
|
+
}, 8, ["header"]),
|
|
445
|
+
i(Ye, {
|
|
446
|
+
ref_key: "dialog",
|
|
447
|
+
ref: c,
|
|
448
|
+
onPending: h,
|
|
449
|
+
onChanged: y[2] || (y[2] = (k) => t("updated", k)),
|
|
450
|
+
onCancelled: y[3] || (y[3] = (k) => h(null))
|
|
451
|
+
}, null, 512)
|
|
452
|
+
], 64));
|
|
453
|
+
}
|
|
454
|
+
}), et = { class: "flex justify-end" }, tt = /* @__PURE__ */ P({
|
|
455
|
+
__name: "PasswordGroup",
|
|
456
|
+
setup(w) {
|
|
457
|
+
const { t: l } = I(), { http: u } = G(), t = x(!1), a = {
|
|
458
|
+
safeParse(o) {
|
|
459
|
+
const s = o, c = l("core.account.validation.required"), d = [
|
|
460
|
+
...s.current === "" ? [{ path: ["current"], message: c }] : [],
|
|
461
|
+
...s.password === "" ? [{ path: ["password"], message: c }] : [],
|
|
462
|
+
...s.password !== "" && s.repeat !== s.password ? [{ path: ["repeat"], message: s.repeat === "" ? c : l("core.account.validation.mismatch") }] : []
|
|
463
|
+
];
|
|
464
|
+
return d.length > 0 ? { success: !1, error: { issues: d } } : { success: !0, data: { current_password: s.current, new_password: s.password, new_password_confirmation: s.repeat } };
|
|
465
|
+
}
|
|
466
|
+
}, r = Ae({
|
|
467
|
+
...W(),
|
|
468
|
+
defaults: () => ({ current: "", password: "", repeat: "" }),
|
|
469
|
+
validator: a,
|
|
470
|
+
// The server names its fields; the draft's are shorter.
|
|
471
|
+
serverField: (o) => ({ current_password: "current", new_password: "password", new_password_confirmation: "repeat" })[o] ?? o,
|
|
472
|
+
run: (o) => u.request(S.profileChangePassword, o),
|
|
473
|
+
done: () => {
|
|
474
|
+
t.value = !1, C.success(l("core.profile.password.changed"));
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
return (o, s) => (f(), b(V, null, [
|
|
478
|
+
i(e(H), { "data-profile-password": "" }, {
|
|
479
|
+
default: m(() => [
|
|
480
|
+
i(X, {
|
|
481
|
+
label: e(l)("core.profile.password.submit"),
|
|
482
|
+
sub: e(l)("core.profile.password.row_sub"),
|
|
483
|
+
"data-change-password": "",
|
|
484
|
+
onClick: s[0] || (s[0] = (c) => e(r).present())
|
|
485
|
+
}, null, 8, ["label", "sub"])
|
|
486
|
+
]),
|
|
487
|
+
_: 1
|
|
488
|
+
}),
|
|
489
|
+
i(e(Me), {
|
|
490
|
+
command: e(r),
|
|
491
|
+
title: e(l)("core.profile.password.title"),
|
|
492
|
+
"confirm-label": e(l)("core.profile.password.submit")
|
|
493
|
+
}, {
|
|
494
|
+
default: m(() => [
|
|
495
|
+
i(e(H), { "data-password-dialog": "" }, {
|
|
496
|
+
default: m(() => [
|
|
497
|
+
i(e(F), N(e(r).form.bind("current"), {
|
|
498
|
+
type: t.value ? "text" : "password",
|
|
499
|
+
label: e(l)("core.profile.password.current"),
|
|
500
|
+
required: "",
|
|
501
|
+
autocomplete: "current-password"
|
|
502
|
+
}), null, 16, ["type", "label"]),
|
|
503
|
+
i(e(F), N(e(r).form.bind("password"), {
|
|
504
|
+
type: t.value ? "text" : "password",
|
|
505
|
+
label: e(l)("core.profile.password.new"),
|
|
506
|
+
required: "",
|
|
507
|
+
autocomplete: "new-password"
|
|
508
|
+
}), null, 16, ["type", "label"]),
|
|
509
|
+
i(e(F), N(e(r).form.bind("repeat"), {
|
|
510
|
+
type: t.value ? "text" : "password",
|
|
511
|
+
label: e(l)("core.profile.password.repeat"),
|
|
512
|
+
required: "",
|
|
513
|
+
autocomplete: "new-password"
|
|
514
|
+
}), null, 16, ["type", "label"])
|
|
515
|
+
]),
|
|
516
|
+
_: 1
|
|
517
|
+
}),
|
|
518
|
+
A("div", et, [
|
|
519
|
+
i(e(J), N({
|
|
520
|
+
prominence: "link",
|
|
521
|
+
size: "sm",
|
|
522
|
+
icon: t.value ? "eyeOff" : "eye"
|
|
523
|
+
}, { "aria-pressed": t.value }, {
|
|
524
|
+
"data-password-visibility": "",
|
|
525
|
+
onClick: s[1] || (s[1] = (c) => t.value = !t.value)
|
|
526
|
+
}), {
|
|
527
|
+
default: m(() => [
|
|
528
|
+
U($(t.value ? e(l)("core.profile.password.hide") : e(l)("core.profile.password.show")), 1)
|
|
529
|
+
]),
|
|
530
|
+
_: 1
|
|
531
|
+
}, 16, ["icon"])
|
|
532
|
+
])
|
|
533
|
+
]),
|
|
534
|
+
_: 1
|
|
535
|
+
}, 8, ["command", "title", "confirm-label"])
|
|
536
|
+
], 64));
|
|
537
|
+
}
|
|
538
|
+
}), at = ["details", "email", "password", "sessions", "signins"];
|
|
539
|
+
function st(w, l) {
|
|
540
|
+
const u = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), a = [];
|
|
541
|
+
for (const o of w) {
|
|
542
|
+
if (o.visible && !o.visible(l)) continue;
|
|
543
|
+
const s = o.after ?? o.before;
|
|
544
|
+
(s ? o.after ? t.get(s) ?? t.set(s, []).get(s) : u.get(s) ?? u.set(s, []).get(s) : a).push(o);
|
|
545
|
+
}
|
|
546
|
+
const r = (o) => ({ kind: "section", section: o });
|
|
547
|
+
return [
|
|
548
|
+
...at.flatMap((o) => [...(u.get(o) ?? []).map(r), { kind: "panel", id: o }, ...(t.get(o) ?? []).map(r)]),
|
|
549
|
+
...a.map(r)
|
|
550
|
+
];
|
|
551
|
+
}
|
|
552
|
+
const ot = { "data-profile-sessions": "" }, lt = /* @__PURE__ */ P({
|
|
553
|
+
__name: "SessionsGroup",
|
|
554
|
+
setup(w) {
|
|
555
|
+
const { t: l } = I(), { http: u } = G(), t = W(), a = te(async ({ signal: d }) => (await u.request(S.profileSessions, void 0, { signal: d })).data), r = L(() => a.data.value?.sessions ?? []), o = Y("dialog"), s = x(null);
|
|
556
|
+
async function c(d) {
|
|
557
|
+
try {
|
|
558
|
+
await u.request(S.profileRevokeSession, { session_id: d.id }), C.success(l("core.account.sessions.ended"));
|
|
559
|
+
} catch (n) {
|
|
560
|
+
T(n) || C.error(t.sentence(n, l("core.account.sessions.end_failed")));
|
|
561
|
+
}
|
|
562
|
+
await a.reload();
|
|
563
|
+
}
|
|
564
|
+
return (d, n) => (f(), b("div", ot, [
|
|
565
|
+
i(e(ee), {
|
|
566
|
+
state: e(a).state.value,
|
|
567
|
+
"skeleton-rows": 3,
|
|
568
|
+
"is-empty": () => !1,
|
|
569
|
+
onRetry: n[1] || (n[1] = (h) => e(a).reload())
|
|
570
|
+
}, {
|
|
571
|
+
default: m(() => [
|
|
572
|
+
i(De, {
|
|
573
|
+
sessions: r.value,
|
|
574
|
+
"can-end": "",
|
|
575
|
+
header: e(l)("core.profile.sessions.title"),
|
|
576
|
+
footer: e(l)("core.profile.sessions.footer"),
|
|
577
|
+
onEnd: n[0] || (n[0] = (h) => {
|
|
578
|
+
s.value = h, o.value?.present(h);
|
|
579
|
+
})
|
|
580
|
+
}, null, 8, ["sessions", "header", "footer"])
|
|
581
|
+
]),
|
|
582
|
+
_: 1
|
|
583
|
+
}, 8, ["state"]),
|
|
584
|
+
i(e(Re), {
|
|
585
|
+
ref_key: "dialog",
|
|
586
|
+
ref: o,
|
|
587
|
+
tone: "critical",
|
|
588
|
+
icon: "logoutBoxRLine",
|
|
589
|
+
title: e(l)("core.account.sessions.end_title"),
|
|
590
|
+
message: e(l)("core.account.sessions.end_body", { device: s.value?.device || e(l)("core.account.sessions.unknown_device") }),
|
|
591
|
+
"confirm-label": e(l)("core.account.sessions.end"),
|
|
592
|
+
action: c
|
|
593
|
+
}, null, 8, ["title", "message", "confirm-label"])
|
|
594
|
+
]));
|
|
595
|
+
}
|
|
596
|
+
}), rt = ["title"], nt = { class: "font-mono" }, it = /* @__PURE__ */ P({
|
|
597
|
+
__name: "SignInList",
|
|
598
|
+
props: {
|
|
599
|
+
rows: {},
|
|
600
|
+
header: {},
|
|
601
|
+
footer: {}
|
|
602
|
+
},
|
|
603
|
+
setup(w) {
|
|
604
|
+
const l = w, { t: u } = I(), t = ae(), a = (r) => u(Be(r.event, r.actor?.name || null), { name: r.actor?.name ?? "" });
|
|
605
|
+
return (r, o) => (f(), E(e(H), {
|
|
606
|
+
header: l.header,
|
|
607
|
+
footer: l.footer,
|
|
608
|
+
"data-signin-list": ""
|
|
609
|
+
}, xe({
|
|
610
|
+
default: m(() => [
|
|
611
|
+
l.rows.length === 0 ? (f(), E(e(K), {
|
|
612
|
+
key: 0,
|
|
613
|
+
layout: "setting",
|
|
614
|
+
label: e(u)("core.account.signins.empty"),
|
|
615
|
+
"data-signin-empty": ""
|
|
616
|
+
}, null, 8, ["label"])) : z("", !0),
|
|
617
|
+
(f(!0), b(V, null, de(l.rows, (s) => (f(), E(e(K), {
|
|
618
|
+
key: s.id,
|
|
619
|
+
layout: "setting",
|
|
620
|
+
label: e(Fe)(s.device) || e(u)("core.account.sessions.unknown_device"),
|
|
621
|
+
"data-signin-row": ""
|
|
622
|
+
}, {
|
|
623
|
+
leading: m(() => [
|
|
624
|
+
i(e(pe), {
|
|
625
|
+
tone: "neutral",
|
|
626
|
+
icon: "timeLine"
|
|
627
|
+
})
|
|
628
|
+
]),
|
|
629
|
+
sub: m(() => [
|
|
630
|
+
A("span", {
|
|
631
|
+
class: "flex flex-col gap-y-0.5 md:flex-row md:flex-wrap md:items-center md:gap-x-1.5",
|
|
632
|
+
title: s.device,
|
|
633
|
+
"data-signin-facts": ""
|
|
634
|
+
}, [
|
|
635
|
+
A("span", null, $(e(t).dateTime(s.created_at)), 1),
|
|
636
|
+
s.ip ? (f(), b(V, { key: 0 }, [
|
|
637
|
+
o[0] || (o[0] = A("span", {
|
|
638
|
+
"aria-hidden": "true",
|
|
639
|
+
class: "hidden md:inline"
|
|
640
|
+
}, "·", -1)),
|
|
641
|
+
A("span", nt, $(s.ip), 1)
|
|
642
|
+
], 64)) : z("", !0)
|
|
643
|
+
], 8, rt)
|
|
644
|
+
]),
|
|
645
|
+
default: m(() => [
|
|
646
|
+
i(e(Ue), {
|
|
647
|
+
tone: e(Ge)(s.event).tone,
|
|
648
|
+
"data-event": s.event
|
|
649
|
+
}, {
|
|
650
|
+
default: m(() => [
|
|
651
|
+
U($(a(s)), 1)
|
|
652
|
+
]),
|
|
653
|
+
_: 2
|
|
654
|
+
}, 1032, ["tone", "data-event"])
|
|
655
|
+
]),
|
|
656
|
+
_: 2
|
|
657
|
+
}, 1032, ["label"]))), 128))
|
|
658
|
+
]),
|
|
659
|
+
_: 2
|
|
660
|
+
}, [
|
|
661
|
+
r.$slots["header-trailing"] ? {
|
|
662
|
+
name: "header-trailing",
|
|
663
|
+
fn: m(() => [
|
|
664
|
+
$e(r.$slots, "header-trailing")
|
|
665
|
+
]),
|
|
666
|
+
key: "0"
|
|
667
|
+
} : void 0
|
|
668
|
+
]), 1032, ["header", "footer"]));
|
|
669
|
+
}
|
|
670
|
+
}), dt = {
|
|
671
|
+
class: "flex min-w-0 flex-col gap-group-gap",
|
|
672
|
+
"data-profile-signins": ""
|
|
673
|
+
}, ct = /* @__PURE__ */ P({
|
|
674
|
+
__name: "SignInsGroup",
|
|
675
|
+
setup(w) {
|
|
676
|
+
const { t: l } = I(), { http: u } = G(), t = ["all", "failed"], a = x("all"), r = x(1), o = te(async ({ signal: s }) => (await u.request(S.profileSignins, { view: a.value, page: r.value, per_page: 20 }, { signal: s })).data);
|
|
677
|
+
return Q(a, () => {
|
|
678
|
+
r.value = 1, o.reload();
|
|
679
|
+
}), Q(r, () => void o.reload()), (s, c) => (f(), b("div", dt, [
|
|
680
|
+
i(e(ee), {
|
|
681
|
+
state: e(o).state.value,
|
|
682
|
+
"skeleton-rows": 4,
|
|
683
|
+
"is-empty": () => !1,
|
|
684
|
+
onRetry: c[2] || (c[2] = (d) => e(o).reload())
|
|
685
|
+
}, {
|
|
686
|
+
default: m(({ value: d }) => [
|
|
687
|
+
i(it, {
|
|
688
|
+
rows: d.data,
|
|
689
|
+
header: e(l)("core.profile.signins.title"),
|
|
690
|
+
footer: e(l)("core.profile.signins.footer")
|
|
691
|
+
}, {
|
|
692
|
+
"header-trailing": m(() => [
|
|
693
|
+
i(Oe, {
|
|
694
|
+
modelValue: a.value,
|
|
695
|
+
"onUpdate:modelValue": c[0] || (c[0] = (n) => a.value = n),
|
|
696
|
+
views: t,
|
|
697
|
+
counts: e(o).data.value?.meta?.views,
|
|
698
|
+
"label-of": (n) => e(l)(`core.account.signins.views.${n}`),
|
|
699
|
+
label: e(l)("core.profile.signins.title")
|
|
700
|
+
}, null, 8, ["modelValue", "counts", "label-of", "label"])
|
|
701
|
+
]),
|
|
702
|
+
_: 2
|
|
703
|
+
}, 1032, ["rows", "header", "footer"]),
|
|
704
|
+
i(Le, {
|
|
705
|
+
page: r.value,
|
|
706
|
+
"onUpdate:page": c[1] || (c[1] = (n) => r.value = n),
|
|
707
|
+
"last-page": d.last_page,
|
|
708
|
+
total: d.total
|
|
709
|
+
}, null, 8, ["page", "last-page", "total"])
|
|
710
|
+
]),
|
|
711
|
+
_: 1
|
|
712
|
+
}, 8, ["state"])
|
|
713
|
+
]));
|
|
714
|
+
}
|
|
715
|
+
}), ut = { class: "flex min-w-0 flex-col gap-group-gap" }, pt = ["data-profile-section"], Ot = /* @__PURE__ */ P({
|
|
716
|
+
__name: "ProfilePage",
|
|
717
|
+
setup(w) {
|
|
718
|
+
const { t: l } = I(), { http: u, session: t } = G(), { profileSections: a } = qe(), r = te(async ({ signal: n }) => (await u.request(S.profileShow, void 0, { signal: n })).data), o = { details: ze, email: Ze, password: tt, sessions: lt, signins: ct }, s = (n) => n.kind === "panel" ? n.id : `section:${n.section.id}`, c = (n) => n.kind === "section" || ["details", "email"].includes(n.id);
|
|
719
|
+
function d(n) {
|
|
720
|
+
r.update(n), t.refresh();
|
|
721
|
+
}
|
|
722
|
+
return (n, h) => (f(), E(e(ke), {
|
|
723
|
+
title: e(l)("core.profile.title"),
|
|
724
|
+
description: e(l)("core.profile.description"),
|
|
725
|
+
width: "readable"
|
|
726
|
+
}, {
|
|
727
|
+
default: m(() => [
|
|
728
|
+
i(e(ee), {
|
|
729
|
+
state: e(r).state.value,
|
|
730
|
+
"skeleton-rows": 6,
|
|
731
|
+
"is-empty": () => !1,
|
|
732
|
+
onRetry: h[0] || (h[0] = (p) => e(r).reload())
|
|
733
|
+
}, {
|
|
734
|
+
default: m(({ value: p }) => [
|
|
735
|
+
A("div", ut, [
|
|
736
|
+
(f(!0), b(V, null, de(e(st)(e(a), p), (g) => (f(), b(V, {
|
|
737
|
+
key: s(g)
|
|
738
|
+
}, [
|
|
739
|
+
g.kind === "section" ? (f(), b("div", {
|
|
740
|
+
key: 0,
|
|
741
|
+
class: "flex min-w-0 flex-col gap-group-gap",
|
|
742
|
+
"data-profile-section": g.section.id
|
|
743
|
+
}, [
|
|
744
|
+
(f(), E(ne(g.section.component), {
|
|
745
|
+
profile: p,
|
|
746
|
+
onUpdated: d
|
|
747
|
+
}, null, 40, ["profile"]))
|
|
748
|
+
], 8, pt)) : (f(), E(ne(o[g.id]), N({
|
|
749
|
+
key: 1,
|
|
750
|
+
ref_for: !0
|
|
751
|
+
}, c(g) ? { profile: p } : {}, { onUpdated: d }), null, 16))
|
|
752
|
+
], 64))), 128))
|
|
753
|
+
])
|
|
754
|
+
]),
|
|
755
|
+
_: 1
|
|
756
|
+
}, 8, ["state"])
|
|
757
|
+
]),
|
|
758
|
+
_: 1
|
|
759
|
+
}, 8, ["title", "description"]));
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
export {
|
|
763
|
+
Ot as default
|
|
764
|
+
};
|