@yourgoods/ui-smart 0.30.0 → 0.32.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/dist/{ProfileEmailDialog-Bcjd6d7z.js → ProfileEmailDialog-BCBd_O2U.js} +271 -281
- package/dist/{ProfilePasswordDialog-CoyO2ZMq.js → ProfilePasswordDialog-BceSLpxy.js} +1 -1
- package/dist/{ProfilePhoneDialog-DwUrEI73.js → ProfilePhoneDialog-6A8CraBl.js} +289 -299
- package/dist/{index-BVFeD92e.js → index-D8GpZOPw.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-7uS9YHDn.js → useRateLimitToast-DGG5L4f3.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as
|
|
2
|
-
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-
|
|
3
|
-
import { C as
|
|
4
|
-
import { PInput as J, IconMailMd as me, PButton as
|
|
1
|
+
import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as re, createElementBlock as k, openBlock as w, createElementVNode as S, createCommentVNode as N, toDisplayString as X, createVNode as $, unref as u, isRef as Z, withCtx as G, createTextVNode as oe, Fragment as Oe, createBlock as H, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
+
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-DGG5L4f3.js";
|
|
3
|
+
import { C as F, _ as ze, B as We, p as W, g as He } from "./index-D8GpZOPw.js";
|
|
4
|
+
import { PInput as J, IconMailMd as me, PButton as ie, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as _e, PTopBar as qe, IconCrossMd as je } from "@profeat/ui-kit";
|
|
5
5
|
const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "input-wrapper"
|
|
@@ -27,128 +27,123 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
|
|
29
29
|
setup(_, { emit: R }) {
|
|
30
|
-
const v = _, s = R, m = b(!1), e = b(""),
|
|
30
|
+
const v = _, s = R, m = b(!1), e = b(""), i = Q({
|
|
31
31
|
emailModel: v.email || "",
|
|
32
32
|
codeModel: "",
|
|
33
33
|
touched: { email: !1, code: !1 }
|
|
34
34
|
});
|
|
35
35
|
Y(
|
|
36
|
-
() =>
|
|
36
|
+
() => i.emailModel,
|
|
37
37
|
(p) => {
|
|
38
38
|
s("update:email", p);
|
|
39
39
|
}
|
|
40
40
|
), Y(
|
|
41
|
-
() =>
|
|
41
|
+
() => i.codeModel,
|
|
42
42
|
(p) => s("update:code", p)
|
|
43
43
|
);
|
|
44
44
|
const y = (p) => {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
e.value = "",
|
|
48
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
49
|
-
var p;
|
|
45
|
+
i.touched[p] = !0;
|
|
46
|
+
}, d = (p) => i.touched[p] = !1, r = () => {
|
|
47
|
+
e.value = "", d("email");
|
|
48
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
|
|
49
|
+
var p, a;
|
|
50
50
|
try {
|
|
51
51
|
if (y("email"), !V.value) {
|
|
52
52
|
e.value = "Это не похоже на e-mail";
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
e.value = "это не похоже на e-mail";
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const { data: i } = l.data;
|
|
61
|
-
if (!(((p = i == null ? void 0 : i[0]) == null ? void 0 : p.available) ?? !1)) {
|
|
55
|
+
const n = await Ve(i.emailModel), { data: f } = n.data;
|
|
56
|
+
if (!(((a = (p = f == null ? void 0 : f.data) == null ? void 0 : p[0]) == null ? void 0 : a.available) ?? !1)) {
|
|
62
57
|
e.value = "Такой email уже используется";
|
|
63
58
|
return;
|
|
64
59
|
}
|
|
65
60
|
e.value = "", s("on-send-code", {
|
|
66
|
-
email:
|
|
61
|
+
email: i.emailModel,
|
|
67
62
|
prevEmail: v.oldEmail,
|
|
68
63
|
offLoading: !0
|
|
69
64
|
}), m.value = !0;
|
|
70
|
-
} catch (
|
|
71
|
-
console.error("Неизвестная ошибка при проверке доступности email:",
|
|
65
|
+
} catch (n) {
|
|
66
|
+
console.error("Неизвестная ошибка при проверке доступности email:", n), e.value = "Это не похоже на e-mail";
|
|
72
67
|
}
|
|
73
68
|
};
|
|
74
|
-
let
|
|
69
|
+
let U = "";
|
|
75
70
|
const C = (p) => {
|
|
76
71
|
s("on-clear-code-error");
|
|
77
|
-
const
|
|
78
|
-
let
|
|
79
|
-
|
|
72
|
+
const a = p.target;
|
|
73
|
+
let n = a.value.replace(/\D/g, "");
|
|
74
|
+
n.length > 4 && (n = n.slice(0, 4)), a.value = n, i.codeModel = n, n.length === 4 && n !== U && (U = n, s("on-match-code", { email: i.emailModel, code: n }));
|
|
80
75
|
}, c = () => {
|
|
81
|
-
s("on-send-code-again", { email:
|
|
76
|
+
s("on-send-code-again", { email: i.emailModel });
|
|
82
77
|
}, T = M(() => {
|
|
83
78
|
if (e.value) return e.value;
|
|
84
|
-
if (
|
|
85
|
-
if (!
|
|
79
|
+
if (i.touched.email) {
|
|
80
|
+
if (!i.emailModel.trim()) return "Введите e-mail";
|
|
86
81
|
if (!V.value) return "Это не похоже на e-mail";
|
|
87
82
|
}
|
|
88
83
|
return v.emailError || "";
|
|
89
|
-
}), g = M(() => v.isNotMatchCode ? "Неверный код" :
|
|
90
|
-
return (p,
|
|
91
|
-
const
|
|
92
|
-
return w(),
|
|
84
|
+
}), g = M(() => v.isNotMatchCode ? "Неверный код" : i.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: L, codeModel: A } = re(i);
|
|
85
|
+
return (p, a) => {
|
|
86
|
+
const n = ue;
|
|
87
|
+
return w(), k("div", Ge, [
|
|
93
88
|
S("div", Ye, X(m.value ? "Введите код подтверждения" : p.hintText), 1),
|
|
94
|
-
p.showEmail ? (w(),
|
|
95
|
-
|
|
89
|
+
p.showEmail ? (w(), k("div", Je, [
|
|
90
|
+
$(u(J), {
|
|
96
91
|
modelValue: u(L),
|
|
97
|
-
"onUpdate:modelValue":
|
|
92
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => Z(L) ? L.value = f : null),
|
|
98
93
|
size: "large",
|
|
99
94
|
"text-size": "medium",
|
|
100
95
|
label: "Почта",
|
|
101
96
|
type: "email",
|
|
102
97
|
error: T.value,
|
|
103
|
-
onBlur:
|
|
104
|
-
onInput:
|
|
98
|
+
onBlur: a[1] || (a[1] = (f) => y("email")),
|
|
99
|
+
onInput: r
|
|
105
100
|
}, null, 8, ["modelValue", "error"]),
|
|
106
|
-
|
|
101
|
+
$(u(me), {
|
|
107
102
|
class: "icon-locked",
|
|
108
|
-
onClick:
|
|
103
|
+
onClick: a[2] || (a[2] = (f) => p.$emit("edit", "email"))
|
|
109
104
|
})
|
|
110
|
-
])) :
|
|
111
|
-
m.value ?
|
|
112
|
-
|
|
105
|
+
])) : N("", !0),
|
|
106
|
+
m.value ? N("", !0) : (w(), k("div", Ke, [
|
|
107
|
+
$(u(ie), {
|
|
113
108
|
style: { width: "100%" },
|
|
114
|
-
disabled:
|
|
109
|
+
disabled: O.value,
|
|
115
110
|
onClick: B
|
|
116
111
|
}, {
|
|
117
|
-
default: G(() =>
|
|
118
|
-
|
|
112
|
+
default: G(() => a[5] || (a[5] = [
|
|
113
|
+
oe(" Отправить код ")
|
|
119
114
|
])),
|
|
120
115
|
_: 1,
|
|
121
116
|
__: [5]
|
|
122
117
|
}, 8, ["disabled"])
|
|
123
118
|
])),
|
|
124
|
-
m.value ? (w(),
|
|
125
|
-
|
|
126
|
-
modelValue: u(
|
|
127
|
-
"onUpdate:modelValue":
|
|
119
|
+
m.value ? (w(), k("div", Qe, [
|
|
120
|
+
$(u(J), {
|
|
121
|
+
modelValue: u(A),
|
|
122
|
+
"onUpdate:modelValue": a[3] || (a[3] = (f) => Z(A) ? A.value = f : null),
|
|
128
123
|
size: "large",
|
|
129
124
|
"text-size": "medium",
|
|
130
125
|
label: "Код",
|
|
131
126
|
type: "text",
|
|
132
127
|
error: g.value,
|
|
133
128
|
onInput: C,
|
|
134
|
-
onBlur:
|
|
129
|
+
onBlur: a[4] || (a[4] = (f) => y("code"))
|
|
135
130
|
}, null, 8, ["modelValue", "error"])
|
|
136
|
-
])) :
|
|
137
|
-
!p.loading && m.value ? (w(),
|
|
138
|
-
|
|
131
|
+
])) : N("", !0),
|
|
132
|
+
!p.loading && m.value ? (w(), k("div", Xe, [
|
|
133
|
+
$(n, {
|
|
139
134
|
loading: p.loading,
|
|
140
135
|
"rate-limit-text": p.rateLimitText,
|
|
141
136
|
"is-final-limit": p.isFinalLimit,
|
|
142
137
|
"on-send-again": c
|
|
143
138
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
144
|
-
])) :
|
|
139
|
+
])) : N("", !0)
|
|
145
140
|
]);
|
|
146
141
|
};
|
|
147
142
|
}
|
|
148
|
-
}), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" },
|
|
143
|
+
}), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" }, at = { class: "input-wrapper" }, lt = { class: "input-wrapper" }, ot = { style: { width: "100%", display: "flex" } }, it = {
|
|
149
144
|
key: 0,
|
|
150
145
|
class: "dialogDefaultContainer"
|
|
151
|
-
}, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8,
|
|
146
|
+
}, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8, dt = /* @__PURE__ */ te({
|
|
152
147
|
__name: "AddNewPasswordContent",
|
|
153
148
|
props: {
|
|
154
149
|
modelValue: { type: Boolean },
|
|
@@ -158,64 +153,64 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
158
153
|
},
|
|
159
154
|
emits: ["update:modelValue", "submit", "close", "update-user"],
|
|
160
155
|
setup(_, { emit: R }) {
|
|
161
|
-
const v = R, s = b(!1), m = b(""), e = b(""),
|
|
156
|
+
const v = R, s = b(!1), m = b(""), e = b(""), i = Q({
|
|
162
157
|
newPassword: !1,
|
|
163
158
|
newPasswordConfirm: !1
|
|
164
|
-
}), y = b(
|
|
165
|
-
r.value = !r.value;
|
|
166
|
-
}, O = () => {
|
|
159
|
+
}), y = b(F.NEW), d = b(!1), r = b(!1), V = M(() => d.value ? "text" : "password"), O = M(() => r.value ? "text" : "password"), B = () => {
|
|
167
160
|
d.value = !d.value;
|
|
168
|
-
},
|
|
161
|
+
}, U = () => {
|
|
162
|
+
r.value = !r.value;
|
|
163
|
+
}, C = M(() => i.newPassword ? m.value.trim() ? m.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), c = M(() => i.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), T = M(() => !!(C.value || c.value)), g = M(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : T.value), L = () => {
|
|
169
164
|
v("update:modelValue", !1), v("close");
|
|
170
|
-
},
|
|
165
|
+
}, A = async () => {
|
|
171
166
|
v("update-user", m.value);
|
|
172
167
|
};
|
|
173
|
-
return (p,
|
|
168
|
+
return (p, a) => (w(), k(Oe, null, [
|
|
174
169
|
S("div", et, [
|
|
175
170
|
S("div", tt, [
|
|
176
|
-
|
|
177
|
-
S("div",
|
|
178
|
-
|
|
171
|
+
a[7] || (a[7] = S("div", { class: "dialogDefaultContainerTextHint" }, X("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
|
|
172
|
+
S("div", at, [
|
|
173
|
+
$(u(J), {
|
|
179
174
|
modelValue: m.value,
|
|
180
|
-
"onUpdate:modelValue":
|
|
175
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => m.value = n),
|
|
181
176
|
size: "large",
|
|
182
177
|
"text-size": "medium",
|
|
183
178
|
label: "Новый пароль",
|
|
184
179
|
type: V.value,
|
|
185
180
|
error: C.value,
|
|
186
|
-
onBlur:
|
|
187
|
-
onInput:
|
|
181
|
+
onBlur: a[1] || (a[1] = () => i.newPassword = !0),
|
|
182
|
+
onInput: a[2] || (a[2] = () => i.newPassword = !0)
|
|
188
183
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
189
|
-
(w(), H(Ce(
|
|
184
|
+
(w(), H(Ce(d.value ? u(ge) : u(he)), {
|
|
190
185
|
class: "icon-locked",
|
|
191
186
|
onClick: B
|
|
192
187
|
}))
|
|
193
188
|
]),
|
|
194
|
-
S("div",
|
|
195
|
-
|
|
189
|
+
S("div", lt, [
|
|
190
|
+
$(u(J), {
|
|
196
191
|
modelValue: e.value,
|
|
197
|
-
"onUpdate:modelValue":
|
|
192
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n),
|
|
198
193
|
size: "large",
|
|
199
194
|
"text-size": "medium",
|
|
200
195
|
label: "Повторите новый пароль",
|
|
201
|
-
type:
|
|
196
|
+
type: O.value,
|
|
202
197
|
error: c.value,
|
|
203
|
-
onBlur:
|
|
204
|
-
onInput:
|
|
198
|
+
onBlur: a[4] || (a[4] = () => i.newPasswordConfirm = !0),
|
|
199
|
+
onInput: a[5] || (a[5] = () => i.newPasswordConfirm = !0)
|
|
205
200
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
206
|
-
(w(), H(Ce(
|
|
201
|
+
(w(), H(Ce(r.value ? u(ge) : u(he)), {
|
|
207
202
|
class: "icon-locked",
|
|
208
|
-
onClick:
|
|
203
|
+
onClick: U
|
|
209
204
|
}))
|
|
210
205
|
]),
|
|
211
206
|
S("div", ot, [
|
|
212
|
-
|
|
207
|
+
$(u(ie), {
|
|
213
208
|
style: { width: "100%" },
|
|
214
209
|
disabled: g.value,
|
|
215
|
-
onClick:
|
|
210
|
+
onClick: A
|
|
216
211
|
}, {
|
|
217
|
-
default: G(() =>
|
|
218
|
-
|
|
212
|
+
default: G(() => a[6] || (a[6] = [
|
|
213
|
+
oe(X("Сохранить"))
|
|
219
214
|
])),
|
|
220
215
|
_: 1,
|
|
221
216
|
__: [6]
|
|
@@ -223,26 +218,26 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
223
218
|
])
|
|
224
219
|
])
|
|
225
220
|
]),
|
|
226
|
-
y.value === u(
|
|
221
|
+
y.value === u(F).COMPLETED ? (w(), k("div", it, [
|
|
227
222
|
S("div", nt, [
|
|
228
|
-
|
|
223
|
+
a[9] || (a[9] = S("p", null, "Пароль успешно установлен", -1)),
|
|
229
224
|
S("div", st, [
|
|
230
|
-
|
|
225
|
+
$(u(ie), {
|
|
231
226
|
style: { width: "100%" },
|
|
232
227
|
onClick: L
|
|
233
228
|
}, {
|
|
234
|
-
default: G(() =>
|
|
235
|
-
|
|
229
|
+
default: G(() => a[8] || (a[8] = [
|
|
230
|
+
oe("Закрыть")
|
|
236
231
|
])),
|
|
237
232
|
_: 1,
|
|
238
233
|
__: [8]
|
|
239
234
|
})
|
|
240
235
|
])
|
|
241
236
|
])
|
|
242
|
-
])) :
|
|
237
|
+
])) : N("", !0)
|
|
243
238
|
], 64));
|
|
244
239
|
}
|
|
245
|
-
}),
|
|
240
|
+
}), rt = { class: "dialogDefaultContainerInsideContent" }, ut = { class: "dialogDefaultContainerTextHint" }, mt = {
|
|
246
241
|
key: 0,
|
|
247
242
|
class: "input-wrapper"
|
|
248
243
|
}, ct = {
|
|
@@ -282,22 +277,22 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
282
277
|
);
|
|
283
278
|
const e = (C) => {
|
|
284
279
|
m.touched[C] = !0;
|
|
285
|
-
},
|
|
280
|
+
}, i = b(""), y = (C) => {
|
|
286
281
|
s("on-clear-code-error");
|
|
287
282
|
const c = C.target;
|
|
288
283
|
let T = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
|
|
289
|
-
T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !==
|
|
290
|
-
},
|
|
291
|
-
s("on-send-code-again", { email:
|
|
292
|
-
}, { emailModel:
|
|
284
|
+
T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !== i.value && (i.value = T, s("on-match-code", { email: r.value, code: T }));
|
|
285
|
+
}, d = () => {
|
|
286
|
+
s("on-send-code-again", { email: r.value });
|
|
287
|
+
}, { emailModel: r, codeModel: V, touched: O } = re(m), B = M(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = M(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
293
288
|
return (C, c) => {
|
|
294
289
|
const T = ue;
|
|
295
|
-
return w(),
|
|
290
|
+
return w(), k("div", rt, [
|
|
296
291
|
S("div", ut, X(C.hintText), 1),
|
|
297
|
-
C.showEmail ? (w(),
|
|
298
|
-
|
|
299
|
-
modelValue: u(
|
|
300
|
-
"onUpdate:modelValue": c[0] || (c[0] = (g) => Z(
|
|
292
|
+
C.showEmail ? (w(), k("div", mt, [
|
|
293
|
+
$(u(J), {
|
|
294
|
+
modelValue: u(r),
|
|
295
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => Z(r) ? r.value = g : null),
|
|
301
296
|
size: "large",
|
|
302
297
|
"text-size": "medium",
|
|
303
298
|
label: "Почта",
|
|
@@ -307,29 +302,29 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
307
302
|
onBlur: c[1] || (c[1] = (g) => e("email")),
|
|
308
303
|
onInput: c[2] || (c[2] = (g) => e("email"))
|
|
309
304
|
}, null, 8, ["modelValue", "error"]),
|
|
310
|
-
|
|
305
|
+
$(u(me), {
|
|
311
306
|
class: "icon-locked",
|
|
312
307
|
onClick: c[3] || (c[3] = (g) => C.$emit("edit", "email"))
|
|
313
308
|
})
|
|
314
|
-
])) :
|
|
315
|
-
C.showCode ? (w(),
|
|
316
|
-
|
|
309
|
+
])) : N("", !0),
|
|
310
|
+
C.showCode ? (w(), k("div", ct, [
|
|
311
|
+
$(u(J), {
|
|
317
312
|
modelValue: u(V),
|
|
318
313
|
"onUpdate:modelValue": c[4] || (c[4] = (g) => Z(V) ? V.value = g : null),
|
|
319
314
|
size: "large",
|
|
320
315
|
"text-size": "medium",
|
|
321
316
|
label: "Код",
|
|
322
317
|
type: "text",
|
|
323
|
-
error:
|
|
318
|
+
error: U.value,
|
|
324
319
|
onInput: y,
|
|
325
320
|
onBlur: c[5] || (c[5] = (g) => e("code"))
|
|
326
321
|
}, null, 8, ["modelValue", "error"])
|
|
327
|
-
])) :
|
|
328
|
-
|
|
322
|
+
])) : N("", !0),
|
|
323
|
+
$(T, {
|
|
329
324
|
loading: C.loading,
|
|
330
325
|
"rate-limit-text": C.rateLimitText,
|
|
331
326
|
"is-final-limit": C.isFinalLimit,
|
|
332
|
-
"on-send-again":
|
|
327
|
+
"on-send-again": d
|
|
333
328
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
334
329
|
]);
|
|
335
330
|
};
|
|
@@ -359,115 +354,110 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
359
354
|
},
|
|
360
355
|
emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
|
|
361
356
|
setup(_, { emit: R }) {
|
|
362
|
-
const v = _, s = R, m = b(!1), e = b(""),
|
|
357
|
+
const v = _, s = R, m = b(!1), e = b(""), i = Q({
|
|
363
358
|
touched: { email: !1, code: !1 },
|
|
364
359
|
emailModel: "",
|
|
365
360
|
codeModel: ""
|
|
366
361
|
});
|
|
367
362
|
Y(
|
|
368
|
-
() =>
|
|
369
|
-
(
|
|
370
|
-
s("update:email",
|
|
363
|
+
() => i.emailModel,
|
|
364
|
+
(a) => {
|
|
365
|
+
s("update:email", a);
|
|
371
366
|
}
|
|
372
367
|
), Y(
|
|
373
|
-
() =>
|
|
374
|
-
(
|
|
368
|
+
() => i.codeModel,
|
|
369
|
+
(a) => s("update:code", a)
|
|
375
370
|
);
|
|
376
|
-
const y = (
|
|
377
|
-
e.value = "",
|
|
378
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
379
|
-
var
|
|
371
|
+
const y = (a) => i.touched[a] = !0, d = (a) => i.touched[a] = !1, r = () => {
|
|
372
|
+
e.value = "", d("email");
|
|
373
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
|
|
374
|
+
var a, n;
|
|
380
375
|
try {
|
|
381
376
|
if (y("email"), !V.value) {
|
|
382
377
|
e.value = "Это не похоже на e-mail";
|
|
383
378
|
return;
|
|
384
379
|
}
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
e.value = "это не похоже на e-mail";
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
const { data: E } = i.data;
|
|
391
|
-
if (!(((l = E == null ? void 0 : E[0]) == null ? void 0 : l.available) ?? !1)) {
|
|
380
|
+
const f = await Ve(i.emailModel), { data: P } = f.data;
|
|
381
|
+
if (!(((n = (a = P == null ? void 0 : P.data) == null ? void 0 : a[0]) == null ? void 0 : n.available) ?? !1)) {
|
|
392
382
|
e.value = "Такой email уже используется";
|
|
393
383
|
return;
|
|
394
384
|
}
|
|
395
|
-
e.value = "", s("on-send-code", { email:
|
|
396
|
-
} catch (
|
|
397
|
-
console.error("Неизвестная ошибка при проверке доступности email:",
|
|
385
|
+
e.value = "", s("on-send-code", { email: i.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
|
|
386
|
+
} catch (f) {
|
|
387
|
+
console.error("Неизвестная ошибка при проверке доступности email:", f), e.value = "Это не похоже на e-mail";
|
|
398
388
|
}
|
|
399
389
|
};
|
|
400
|
-
let
|
|
401
|
-
const C = (
|
|
390
|
+
let U = "";
|
|
391
|
+
const C = (a) => {
|
|
402
392
|
s("on-clear-code-error");
|
|
403
|
-
const
|
|
404
|
-
let
|
|
405
|
-
|
|
393
|
+
const n = a.target;
|
|
394
|
+
let f = n.value.replace(/\D/g, "");
|
|
395
|
+
f.length > 4 && (f = f.slice(0, 4), n.value = f), i.codeModel = f, f.length === 4 && f !== U && (U = f, s("on-match-code", { email: i.emailModel, code: f }));
|
|
406
396
|
}, c = () => {
|
|
407
|
-
s("on-send-code-again", { email:
|
|
408
|
-
}, { emailModel: T, codeModel: g, touched: L } =
|
|
397
|
+
s("on-send-code-again", { email: i.emailModel });
|
|
398
|
+
}, { emailModel: T, codeModel: g, touched: L } = re(i), A = M(() => {
|
|
409
399
|
if (e.value) return e.value;
|
|
410
|
-
if (
|
|
411
|
-
if (!
|
|
400
|
+
if (i.touched.email) {
|
|
401
|
+
if (!i.emailModel.trim()) return "Введите e-mail";
|
|
412
402
|
if (!V.value) return "Это не похоже на e-mail";
|
|
413
403
|
}
|
|
414
404
|
return v.emailError || "";
|
|
415
405
|
}), p = M(() => v.isNotMatchCode ? "Неверный код" : L.value.code ? g.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
416
|
-
return (
|
|
417
|
-
const
|
|
418
|
-
return w(),
|
|
419
|
-
S("div", Et, X(m.value ? "Введите код подтверждения" :
|
|
420
|
-
|
|
421
|
-
|
|
406
|
+
return (a, n) => {
|
|
407
|
+
const f = ue;
|
|
408
|
+
return w(), k("div", ft, [
|
|
409
|
+
S("div", Et, X(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
410
|
+
a.showEmail ? (w(), k("div", wt, [
|
|
411
|
+
$(u(J), {
|
|
422
412
|
modelValue: u(T),
|
|
423
|
-
"onUpdate:modelValue":
|
|
413
|
+
"onUpdate:modelValue": n[0] || (n[0] = (P) => Z(T) ? T.value = P : null),
|
|
424
414
|
size: "large",
|
|
425
415
|
"text-size": "medium",
|
|
426
416
|
label: "Почта",
|
|
427
417
|
type: "email",
|
|
428
|
-
error:
|
|
429
|
-
onBlur:
|
|
430
|
-
onInput:
|
|
418
|
+
error: A.value,
|
|
419
|
+
onBlur: n[1] || (n[1] = (P) => y("email")),
|
|
420
|
+
onInput: r
|
|
431
421
|
}, null, 8, ["modelValue", "error"]),
|
|
432
|
-
|
|
422
|
+
$(u(me), {
|
|
433
423
|
class: "icon-locked",
|
|
434
|
-
onClick:
|
|
424
|
+
onClick: n[2] || (n[2] = (P) => a.$emit("edit", "email"))
|
|
435
425
|
})
|
|
436
|
-
])) :
|
|
437
|
-
m.value ?
|
|
438
|
-
|
|
426
|
+
])) : N("", !0),
|
|
427
|
+
m.value ? N("", !0) : (w(), k("div", Ct, [
|
|
428
|
+
$(u(ie), {
|
|
439
429
|
style: { width: "100%" },
|
|
440
|
-
disabled:
|
|
430
|
+
disabled: O.value,
|
|
441
431
|
onClick: B
|
|
442
432
|
}, {
|
|
443
|
-
default: G(() =>
|
|
444
|
-
|
|
433
|
+
default: G(() => n[5] || (n[5] = [
|
|
434
|
+
oe(" Отправить код ")
|
|
445
435
|
])),
|
|
446
436
|
_: 1,
|
|
447
437
|
__: [5]
|
|
448
438
|
}, 8, ["disabled"])
|
|
449
439
|
])),
|
|
450
|
-
m.value ? (w(),
|
|
451
|
-
|
|
440
|
+
m.value ? (w(), k("div", yt, [
|
|
441
|
+
$(u(J), {
|
|
452
442
|
modelValue: u(g),
|
|
453
|
-
"onUpdate:modelValue":
|
|
443
|
+
"onUpdate:modelValue": n[3] || (n[3] = (P) => Z(g) ? g.value = P : null),
|
|
454
444
|
size: "large",
|
|
455
445
|
"text-size": "medium",
|
|
456
446
|
label: "Код",
|
|
457
447
|
type: "text",
|
|
458
448
|
error: p.value,
|
|
459
449
|
onInput: C,
|
|
460
|
-
onBlur:
|
|
450
|
+
onBlur: n[4] || (n[4] = (P) => y("code"))
|
|
461
451
|
}, null, 8, ["modelValue", "error"])
|
|
462
|
-
])) :
|
|
463
|
-
m.value ? (w(),
|
|
464
|
-
|
|
465
|
-
loading:
|
|
466
|
-
"rate-limit-text":
|
|
467
|
-
"is-final-limit":
|
|
452
|
+
])) : N("", !0),
|
|
453
|
+
m.value ? (w(), k("div", gt, [
|
|
454
|
+
$(f, {
|
|
455
|
+
loading: a.loading,
|
|
456
|
+
"rate-limit-text": a.rateLimitText,
|
|
457
|
+
"is-final-limit": a.isFinalLimit,
|
|
468
458
|
"on-send-again": c
|
|
469
459
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
470
|
-
])) :
|
|
460
|
+
])) : N("", !0)
|
|
471
461
|
]);
|
|
472
462
|
};
|
|
473
463
|
}
|
|
@@ -496,53 +486,53 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
496
486
|
code: "",
|
|
497
487
|
addEmail: "",
|
|
498
488
|
addCode: ""
|
|
499
|
-
}),
|
|
489
|
+
}), i = Q({ email: !1, code: !1 }), y = b(F.OLD), d = b(null), r = b(!1), V = b(!1), O = b(!1), B = b(We.VERIFY_EMAIL), U = M(() => B.value === "password-flow"), C = M(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: T, isAvailableForSendAgain: g, totalRateAttempts: L, currentRateAttempt: A } = Fe(), { isEditFlow: p, getFlow: a } = Ae(b(v.mode ?? "edit")), { showRateLimitToast: n } = Re(s), f = M(() => i.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), P = M(() => i.code && !e.code.trim() ? "Введите код" : ""), ae = M(() => g.value ? "Повторить" : `${T.value}`), q = b(Me), be = M(() => q.value === 0), $e = (l) => new Promise((t) => setTimeout(t, l));
|
|
500
490
|
Y(
|
|
501
491
|
() => v.modelValue,
|
|
502
|
-
(
|
|
503
|
-
), Y(m, (
|
|
492
|
+
(l) => m.value = l
|
|
493
|
+
), Y(m, (l) => s("update:modelValue", l));
|
|
504
494
|
const ne = () => {
|
|
505
495
|
s("close"), m.value = !1;
|
|
506
|
-
}, ce = (
|
|
507
|
-
async function ve(
|
|
496
|
+
}, ce = (l) => s("edit", l);
|
|
497
|
+
async function ve(l, t = !1) {
|
|
508
498
|
var o;
|
|
509
499
|
try {
|
|
510
|
-
const h = (o = (await W("/users/profile/check-throttler", { method: "email", email:
|
|
511
|
-
return h ? (await
|
|
500
|
+
const h = (o = (await W("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
|
|
501
|
+
return h ? (await $e(1e3), h.restTimeSec > 0 ? (c(h.restTimeSec), g.value = !1, L.value = h.attempts.total ?? L.value, A.value = (h.attempts.total ?? 0) - (h.attempts.available ?? 0), q.value = h.attempts.available ?? q.value) : g.value = !0, h) : null;
|
|
512
502
|
} catch {
|
|
513
503
|
return null;
|
|
514
504
|
}
|
|
515
505
|
}
|
|
516
|
-
async function se(
|
|
506
|
+
async function se(l = "email") {
|
|
517
507
|
var o;
|
|
518
|
-
return ((o = (await He("/users/profile/session/get-edit-session", { params: { field:
|
|
508
|
+
return ((o = (await He("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : o.data) ?? null;
|
|
519
509
|
}
|
|
520
|
-
async function
|
|
510
|
+
async function xe(l = "email") {
|
|
521
511
|
try {
|
|
522
|
-
const t = await se(
|
|
523
|
-
|
|
512
|
+
const t = await se(l);
|
|
513
|
+
d.value = (t == null ? void 0 : t.sessionId) ?? d.value, y.value = (t == null ? void 0 : t.step) ?? y.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await pe(l);
|
|
524
514
|
} catch {
|
|
525
|
-
await pe(
|
|
515
|
+
await pe(l);
|
|
526
516
|
}
|
|
527
517
|
}
|
|
528
|
-
async function pe(
|
|
518
|
+
async function pe(l = "email") {
|
|
529
519
|
var t;
|
|
530
520
|
try {
|
|
531
|
-
const o = await W("/users/profile/session/create-if-not-exists", { field:
|
|
532
|
-
|
|
521
|
+
const o = await W("/users/profile/session/create-if-not-exists", { field: l, oldValue: v.initialEmail }), E = ((t = o.data) == null ? void 0 : t.data) ?? o.data;
|
|
522
|
+
d.value = (E == null ? void 0 : E.sessionId) ?? d.value, y.value = (E == null ? void 0 : E.step) ?? y.value, e.oldEmail = (E == null ? void 0 : E.oldValue) ?? e.oldEmail, e.newEmail = (E == null ? void 0 : E.newValue) ?? e.newEmail;
|
|
533
523
|
} catch {
|
|
534
524
|
}
|
|
535
525
|
}
|
|
536
|
-
async function ee({ value:
|
|
526
|
+
async function ee({ value: l, offLoading: t = !0 }) {
|
|
537
527
|
var o;
|
|
538
528
|
try {
|
|
539
|
-
|
|
540
|
-
const
|
|
529
|
+
r.value = !0;
|
|
530
|
+
const E = l ?? e.addEmail, h = await W(
|
|
541
531
|
"/users/profile/email/contact/send-code",
|
|
542
532
|
{
|
|
543
|
-
sessionId:
|
|
544
|
-
email:
|
|
545
|
-
value:
|
|
533
|
+
sessionId: d.value,
|
|
534
|
+
email: E,
|
|
535
|
+
value: E,
|
|
546
536
|
oldValue: e.oldEmail,
|
|
547
537
|
provider: v.provider
|
|
548
538
|
}
|
|
@@ -550,136 +540,136 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
550
540
|
);
|
|
551
541
|
if (h.status === 403 && ((o = h.data) != null && o.tooManyRequests)) {
|
|
552
542
|
const I = h.data.tooManyRequests;
|
|
553
|
-
return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value,
|
|
543
|
+
return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value, A.value = (I.attempts.total ?? 0) - (I.attempts.available ?? 0), q.value = I.attempts.available ?? q.value) : g.value = !0, h;
|
|
554
544
|
}
|
|
555
|
-
return await ve(
|
|
556
|
-
} catch (
|
|
557
|
-
throw console.error(
|
|
545
|
+
return await ve(l ?? e.oldEmail), h;
|
|
546
|
+
} catch (E) {
|
|
547
|
+
throw console.error(E), E;
|
|
558
548
|
} finally {
|
|
559
|
-
t && (
|
|
549
|
+
t && (r.value = !1);
|
|
560
550
|
}
|
|
561
551
|
}
|
|
562
|
-
const fe = async (
|
|
563
|
-
var o,
|
|
564
|
-
if (!e.oldEmail && t ===
|
|
552
|
+
const fe = async (l, t) => {
|
|
553
|
+
var o, E, h, I, x, j;
|
|
554
|
+
if (!e.oldEmail && t === F.OLD) throw new Error("oldEmail пустой — модель потерялась");
|
|
565
555
|
try {
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
556
|
+
r.value = !0;
|
|
557
|
+
const D = await se();
|
|
558
|
+
if (d.value = (D == null ? void 0 : D.sessionId) ?? d.value, y.value = (D == null ? void 0 : D.step) ?? y.value, e.oldEmail = (D == null ? void 0 : D.oldValue) ?? e.oldEmail, e.newEmail = (D == null ? void 0 : D.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
569
559
|
const z = await W("/users/profile/change/email/match-code", {
|
|
570
|
-
email: t ===
|
|
571
|
-
sessionId:
|
|
572
|
-
code:
|
|
560
|
+
email: t === F.NEW ? e.newEmail : e.oldEmail,
|
|
561
|
+
sessionId: d.value,
|
|
562
|
+
code: l,
|
|
573
563
|
step: t
|
|
574
|
-
}), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (
|
|
575
|
-
if (
|
|
564
|
+
}), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (E = z.data) == null ? void 0 : E.data) == null ? void 0 : h.nextStep) ?? null, De = ((x = (I = z.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((j = z.data) == null ? void 0 : j.rateLimit) ?? null, Ne = z.data.data.success ?? z.data.success;
|
|
565
|
+
if (n(De), !Ne) {
|
|
576
566
|
V.value = !0;
|
|
577
567
|
return;
|
|
578
568
|
}
|
|
579
569
|
if (le) {
|
|
580
|
-
if (y.value = le, y.value ===
|
|
570
|
+
if (y.value = le, y.value === F.NEW) {
|
|
581
571
|
const K = await se();
|
|
582
572
|
e.oldEmail = (K == null ? void 0 : K.oldValue) ?? e.oldEmail, e.newEmail = (K == null ? void 0 : K.newValue) ?? e.newEmail, e.code = "";
|
|
583
573
|
}
|
|
584
|
-
y.value ===
|
|
574
|
+
y.value === F.COMPLETED && (e.code = "", s("submit-email", { email: e.addEmail, code: l }), s("on-toast", { color: "success", text: "E-mail изменён" }), s("on-update-jwt", "email", "edit", e.newEmail), d.value = null, s("close"));
|
|
585
575
|
}
|
|
586
576
|
return z;
|
|
587
577
|
} finally {
|
|
588
|
-
|
|
578
|
+
r.value = !1;
|
|
589
579
|
}
|
|
590
|
-
},
|
|
580
|
+
}, ke = async () => {
|
|
591
581
|
try {
|
|
592
|
-
const
|
|
593
|
-
sessionId:
|
|
582
|
+
const l = await W("/users/profile/bind/email/cancel", {
|
|
583
|
+
sessionId: d.value
|
|
594
584
|
});
|
|
595
|
-
if ((
|
|
585
|
+
if ((l.data.data ?? l.data).success) {
|
|
596
586
|
s("close");
|
|
597
587
|
return;
|
|
598
588
|
}
|
|
599
|
-
} catch (
|
|
600
|
-
console.error(
|
|
589
|
+
} catch (l) {
|
|
590
|
+
console.error(l);
|
|
601
591
|
}
|
|
602
592
|
};
|
|
603
|
-
async function Ie({ code:
|
|
604
|
-
await fe(
|
|
593
|
+
async function Ie({ code: l }) {
|
|
594
|
+
await fe(l, F.OLD);
|
|
605
595
|
}
|
|
606
|
-
function Ee(
|
|
596
|
+
function Ee(l) {
|
|
607
597
|
}
|
|
608
|
-
async function Se({ code:
|
|
609
|
-
await fe(
|
|
598
|
+
async function Se({ code: l }) {
|
|
599
|
+
await fe(l, F.NEW);
|
|
610
600
|
}
|
|
611
601
|
const we = async ({
|
|
612
|
-
value:
|
|
602
|
+
value: l,
|
|
613
603
|
field: t = "email",
|
|
614
604
|
offLoading: o = !0
|
|
615
605
|
}) => {
|
|
616
|
-
var
|
|
606
|
+
var E;
|
|
617
607
|
try {
|
|
618
|
-
if (
|
|
619
|
-
const h =
|
|
620
|
-
sessionId:
|
|
608
|
+
if (r.value = !0, !d.value) throw new Error("Bind-сессия не найдена. Создайте её через createBindSession.");
|
|
609
|
+
const h = l ?? e.addEmail, I = await W(`/users/profile/bind/contact/send-code/${t}`, {
|
|
610
|
+
sessionId: d.value,
|
|
621
611
|
email: h,
|
|
622
612
|
provider: v.provider
|
|
623
|
-
}),
|
|
624
|
-
if (I.status === 403 &&
|
|
625
|
-
|
|
613
|
+
}), x = (E = I.data) == null ? void 0 : E.tooManyRequests;
|
|
614
|
+
if (I.status === 403 && x) {
|
|
615
|
+
x.restTimeSec > 0 ? (c(x.restTimeSec), L.value = x.attempts.total ?? L.value, A.value = (x.attempts.total ?? 0) - (x.attempts.available ?? 0), q.value = x.attempts.available ?? Me) : g.value = !0;
|
|
626
616
|
return;
|
|
627
617
|
}
|
|
628
618
|
const j = await ve(h);
|
|
629
619
|
return j && j.restTimeSec > 0 ? c(j.restTimeSec) : g.value = !0, I;
|
|
630
620
|
} finally {
|
|
631
|
-
o && (
|
|
621
|
+
o && (r.value = !1);
|
|
632
622
|
}
|
|
633
623
|
}, Be = async () => {
|
|
634
|
-
var
|
|
624
|
+
var l, t, o, E, h, I;
|
|
635
625
|
try {
|
|
636
|
-
if (!
|
|
637
|
-
const le = await
|
|
638
|
-
|
|
626
|
+
if (!d.value) {
|
|
627
|
+
const le = await de();
|
|
628
|
+
d.value = le.sessionId ?? d.value;
|
|
639
629
|
}
|
|
640
|
-
const
|
|
630
|
+
const x = await W("/users/profile/bind/email/match-code", {
|
|
641
631
|
email: e.addEmail,
|
|
642
|
-
sessionId:
|
|
632
|
+
sessionId: d.value,
|
|
643
633
|
code: e.addCode
|
|
644
|
-
}), j = ((
|
|
634
|
+
}), j = ((l = x.data) == null ? void 0 : l.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
645
635
|
B.value = j ?? B.value;
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
|
|
636
|
+
const D = ((h = (E = x.data) == null ? void 0 : E.data) == null ? void 0 : h.rateLimit) ?? ((I = x.data) == null ? void 0 : I.rateLimit) ?? null, z = x.data.data.success ?? x.data.success;
|
|
637
|
+
if (n(D), !z) {
|
|
638
|
+
O.value = !0;
|
|
649
639
|
return;
|
|
650
640
|
}
|
|
651
641
|
} catch {
|
|
652
642
|
}
|
|
653
643
|
}, Le = async () => {
|
|
654
|
-
}, Pe = async (
|
|
655
|
-
if (!
|
|
656
|
-
const t = await
|
|
657
|
-
|
|
644
|
+
}, Pe = async (l) => {
|
|
645
|
+
if (!d.value) {
|
|
646
|
+
const t = await de();
|
|
647
|
+
d.value = t.sessionId ?? d.value;
|
|
658
648
|
}
|
|
659
|
-
|
|
649
|
+
r.value = !0;
|
|
660
650
|
try {
|
|
661
|
-
await W("/users/profile/bind/email/password/set", { sessionId:
|
|
651
|
+
await W("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), B.value = F.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
|
|
662
652
|
} finally {
|
|
663
|
-
|
|
653
|
+
r.value = !1;
|
|
664
654
|
}
|
|
665
|
-
},
|
|
666
|
-
|
|
655
|
+
}, de = async () => {
|
|
656
|
+
r.value = !0;
|
|
667
657
|
try {
|
|
668
|
-
const
|
|
669
|
-
return B.value = t.step ?? B.value,
|
|
658
|
+
const l = await W("/users/profile/bind/email/init", { email: "" }), t = l.data.data ?? l.data;
|
|
659
|
+
return B.value = t.step ?? B.value, d.value = t.sessionId ?? d.value, t;
|
|
670
660
|
} finally {
|
|
671
|
-
|
|
661
|
+
r.value = !1;
|
|
672
662
|
}
|
|
673
663
|
};
|
|
674
664
|
return Ue(async () => {
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
if (v.mode === "bind" &&
|
|
678
|
-
await
|
|
665
|
+
r.value = !0;
|
|
666
|
+
const l = await a("email");
|
|
667
|
+
if (v.mode === "bind" && l === "bind") {
|
|
668
|
+
await de(), r.value = !1;
|
|
679
669
|
return;
|
|
680
670
|
}
|
|
681
|
-
await
|
|
682
|
-
}), (
|
|
671
|
+
await xe(), e.oldEmail && await ee({ value: e.oldEmail }), r.value = !1;
|
|
672
|
+
}), (l, t) => (w(), H(u(_e), {
|
|
683
673
|
modelValue: m.value,
|
|
684
674
|
"onUpdate:modelValue": [
|
|
685
675
|
t[18] || (t[18] = (o) => m.value = o),
|
|
@@ -692,7 +682,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
692
682
|
}, {
|
|
693
683
|
header: G(() => [
|
|
694
684
|
S("div", Tt, [
|
|
695
|
-
|
|
685
|
+
$(u(qe), {
|
|
696
686
|
"slot-left": !1,
|
|
697
687
|
size: "small",
|
|
698
688
|
borded: !0,
|
|
@@ -702,7 +692,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
702
692
|
S("span", Mt, X(C.value), 1)
|
|
703
693
|
]),
|
|
704
694
|
"right-button": G(() => [
|
|
705
|
-
|
|
695
|
+
$(u(je), {
|
|
706
696
|
class: "cross",
|
|
707
697
|
onClick: ne
|
|
708
698
|
})
|
|
@@ -713,28 +703,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
713
703
|
]),
|
|
714
704
|
default: G(() => [
|
|
715
705
|
S("div", null, [
|
|
716
|
-
u(p) ? (w(),
|
|
717
|
-
|
|
718
|
-
y.value === u(
|
|
706
|
+
u(p) ? (w(), k("div", Vt, [
|
|
707
|
+
r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
|
|
708
|
+
y.value === u(F).OLD ? (w(), H(pt, {
|
|
719
709
|
key: 1,
|
|
720
710
|
email: e.oldEmail,
|
|
721
711
|
"onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
|
|
722
712
|
code: e.code,
|
|
723
713
|
"onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
|
|
724
|
-
"hint-text":
|
|
725
|
-
"email-error":
|
|
726
|
-
"code-error":
|
|
727
|
-
"rate-limit-text":
|
|
714
|
+
"hint-text": l.hintText,
|
|
715
|
+
"email-error": f.value,
|
|
716
|
+
"code-error": P.value,
|
|
717
|
+
"rate-limit-text": ae.value,
|
|
728
718
|
"is-final-limit": q.value === 0,
|
|
729
719
|
"is-not-match-code": V.value,
|
|
730
|
-
loading:
|
|
720
|
+
loading: r.value,
|
|
731
721
|
onEdit: ce,
|
|
732
722
|
onOnMatchCode: Ie,
|
|
733
723
|
onOnMatchCodeError: Ee,
|
|
734
724
|
onSendCode: t[2] || (t[2] = (o) => ee({ value: e.oldEmail })),
|
|
735
725
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ee({ value: e.oldEmail })),
|
|
736
726
|
onOnClearCodeError: t[4] || (t[4] = (o) => V.value = !1)
|
|
737
|
-
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(
|
|
727
|
+
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(F).NEW ? (w(), H(ht, {
|
|
738
728
|
key: 2,
|
|
739
729
|
email: e.newEmail,
|
|
740
730
|
"onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
|
|
@@ -743,28 +733,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
743
733
|
code: e.code,
|
|
744
734
|
"onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
|
|
745
735
|
"hint-text": "Введите новый адрес вашей почты",
|
|
746
|
-
"email-error":
|
|
747
|
-
"code-error":
|
|
748
|
-
"rate-limit-text":
|
|
736
|
+
"email-error": f.value,
|
|
737
|
+
"code-error": P.value,
|
|
738
|
+
"rate-limit-text": ae.value,
|
|
749
739
|
"is-final-limit": q.value === 0,
|
|
750
740
|
"is-not-match-code": V.value,
|
|
751
|
-
loading:
|
|
741
|
+
loading: r.value,
|
|
752
742
|
onEdit: ce,
|
|
753
743
|
onOnMatchCode: Se,
|
|
754
744
|
onOnMatchCodeError: Ee,
|
|
755
745
|
onOnSendCode: t[8] || (t[8] = (o) => ee({ value: e.newEmail })),
|
|
756
746
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ee({ value: e.newEmail })),
|
|
757
747
|
onOnClearCodeError: t[10] || (t[10] = (o) => V.value = !1)
|
|
758
|
-
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) :
|
|
759
|
-
])) : (w(),
|
|
760
|
-
|
|
761
|
-
|
|
748
|
+
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : N("", !0)
|
|
749
|
+
])) : (w(), k("div", bt, [
|
|
750
|
+
r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
|
|
751
|
+
U.value ? (w(), H(dt, {
|
|
762
752
|
key: 2,
|
|
763
753
|
"model-value": m.value,
|
|
764
|
-
"email-session-id":
|
|
754
|
+
"email-session-id": d.value,
|
|
765
755
|
"onUpdate:modelValue": t[17] || (t[17] = (o) => s("update:modelValue", o)),
|
|
766
756
|
onUpdateUser: Pe,
|
|
767
|
-
onClose:
|
|
757
|
+
onClose: ke
|
|
768
758
|
}, null, 8, ["model-value", "email-session-id"])) : (w(), H(Ze, {
|
|
769
759
|
key: 1,
|
|
770
760
|
email: e.addEmail,
|
|
@@ -773,16 +763,16 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
773
763
|
"onUpdate:oldEmail": t[12] || (t[12] = (o) => e.addEmail = o),
|
|
774
764
|
code: e.addCode,
|
|
775
765
|
"onUpdate:code": t[13] || (t[13] = (o) => e.addCode = o),
|
|
776
|
-
"hint-text": u(p) ?
|
|
777
|
-
"rate-limit-text":
|
|
766
|
+
"hint-text": u(p) ? l.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
|
|
767
|
+
"rate-limit-text": ae.value,
|
|
778
768
|
"is-final-limit": be.value,
|
|
779
|
-
"is-not-match-code":
|
|
780
|
-
loading:
|
|
769
|
+
"is-not-match-code": O.value,
|
|
770
|
+
loading: r.value,
|
|
781
771
|
onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
782
772
|
onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
783
773
|
onOnMatchCode: Be,
|
|
784
774
|
onOnMatchCodeError: Le,
|
|
785
|
-
onOnClearCodeError: t[16] || (t[16] = (o) =>
|
|
775
|
+
onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
|
|
786
776
|
}, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
|
|
787
777
|
]))
|
|
788
778
|
])
|