@yourgoods/ui-smart 0.32.0 → 0.33.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-BCBd_O2U.js → ProfileEmailDialog-DY4_Fue4.js} +150 -150
- package/dist/{ProfilePasswordDialog-BceSLpxy.js → ProfilePasswordDialog-BYI8OfLa.js} +1 -1
- package/dist/{ProfilePhoneDialog-6A8CraBl.js → ProfilePhoneDialog-D2jMqKZo.js} +190 -190
- package/dist/{index-D8GpZOPw.js → index-1pX0MPM8.js} +132 -127
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-DGG5L4f3.js → useRateLimitToast-DrsfGcKN.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 re, createElementBlock as k, openBlock 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 E, createElementVNode as S, createCommentVNode as D, toDisplayString as X, createVNode as $, unref as u, isRef as Z, withCtx as G, createTextVNode as le, 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-DrsfGcKN.js";
|
|
3
|
+
import { C as A, _ as ze, B as We, p as W, g as He } from "./index-1pX0MPM8.js";
|
|
4
|
+
import { PInput as J, IconMailMd as me, PButton as oe, 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"
|
|
@@ -45,15 +45,15 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
45
45
|
i.touched[p] = !0;
|
|
46
46
|
}, d = (p) => i.touched[p] = !1, r = () => {
|
|
47
47
|
e.value = "", d("email");
|
|
48
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())),
|
|
49
|
-
var p
|
|
48
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), N = M(() => !V.value || !!e.value), B = async () => {
|
|
49
|
+
var p;
|
|
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 (!(((
|
|
55
|
+
const a = await Ve(i.emailModel), { data: n } = a.data;
|
|
56
|
+
if (!(((p = n.data[0]) == null ? void 0 : p.available) ?? !1)) {
|
|
57
57
|
e.value = "Такой email уже используется";
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
@@ -62,16 +62,16 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
62
62
|
prevEmail: v.oldEmail,
|
|
63
63
|
offLoading: !0
|
|
64
64
|
}), m.value = !0;
|
|
65
|
-
} catch (
|
|
66
|
-
console.error("Неизвестная ошибка при проверке доступности email:",
|
|
65
|
+
} catch (a) {
|
|
66
|
+
console.error("Неизвестная ошибка при проверке доступности email:", a), e.value = "Это не похоже на e-mail";
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
let
|
|
70
|
-
const
|
|
69
|
+
let O = "";
|
|
70
|
+
const w = (p) => {
|
|
71
71
|
s("on-clear-code-error");
|
|
72
72
|
const a = p.target;
|
|
73
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 !==
|
|
74
|
+
n.length > 4 && (n = n.slice(0, 4)), a.value = n, i.codeModel = n, n.length === 4 && n !== O && (O = n, s("on-match-code", { email: i.emailModel, code: n }));
|
|
75
75
|
}, c = () => {
|
|
76
76
|
s("on-send-code-again", { email: i.emailModel });
|
|
77
77
|
}, T = M(() => {
|
|
@@ -81,62 +81,62 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
81
81
|
if (!V.value) return "Это не похоже на e-mail";
|
|
82
82
|
}
|
|
83
83
|
return v.emailError || "";
|
|
84
|
-
}), g = M(() => v.isNotMatchCode ? "Неверный код" : i.touched.code ?
|
|
84
|
+
}), g = M(() => v.isNotMatchCode ? "Неверный код" : i.touched.code ? U.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: L, codeModel: U } = re(i);
|
|
85
85
|
return (p, a) => {
|
|
86
86
|
const n = ue;
|
|
87
|
-
return
|
|
87
|
+
return E(), k("div", Ge, [
|
|
88
88
|
S("div", Ye, X(m.value ? "Введите код подтверждения" : p.hintText), 1),
|
|
89
|
-
p.showEmail ? (
|
|
89
|
+
p.showEmail ? (E(), k("div", Je, [
|
|
90
90
|
$(u(J), {
|
|
91
91
|
modelValue: u(L),
|
|
92
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
92
|
+
"onUpdate:modelValue": a[0] || (a[0] = (C) => Z(L) ? L.value = C : null),
|
|
93
93
|
size: "large",
|
|
94
94
|
"text-size": "medium",
|
|
95
95
|
label: "Почта",
|
|
96
96
|
type: "email",
|
|
97
97
|
error: T.value,
|
|
98
|
-
onBlur: a[1] || (a[1] = (
|
|
98
|
+
onBlur: a[1] || (a[1] = (C) => y("email")),
|
|
99
99
|
onInput: r
|
|
100
100
|
}, null, 8, ["modelValue", "error"]),
|
|
101
101
|
$(u(me), {
|
|
102
102
|
class: "icon-locked",
|
|
103
|
-
onClick: a[2] || (a[2] = (
|
|
103
|
+
onClick: a[2] || (a[2] = (C) => p.$emit("edit", "email"))
|
|
104
104
|
})
|
|
105
|
-
])) :
|
|
106
|
-
m.value ?
|
|
107
|
-
$(u(
|
|
105
|
+
])) : D("", !0),
|
|
106
|
+
m.value ? D("", !0) : (E(), k("div", Ke, [
|
|
107
|
+
$(u(oe), {
|
|
108
108
|
style: { width: "100%" },
|
|
109
|
-
disabled:
|
|
109
|
+
disabled: N.value,
|
|
110
110
|
onClick: B
|
|
111
111
|
}, {
|
|
112
112
|
default: G(() => a[5] || (a[5] = [
|
|
113
|
-
|
|
113
|
+
le(" Отправить код ")
|
|
114
114
|
])),
|
|
115
115
|
_: 1,
|
|
116
116
|
__: [5]
|
|
117
117
|
}, 8, ["disabled"])
|
|
118
118
|
])),
|
|
119
|
-
m.value ? (
|
|
119
|
+
m.value ? (E(), k("div", Qe, [
|
|
120
120
|
$(u(J), {
|
|
121
|
-
modelValue: u(
|
|
122
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
121
|
+
modelValue: u(U),
|
|
122
|
+
"onUpdate:modelValue": a[3] || (a[3] = (C) => Z(U) ? U.value = C : null),
|
|
123
123
|
size: "large",
|
|
124
124
|
"text-size": "medium",
|
|
125
125
|
label: "Код",
|
|
126
126
|
type: "text",
|
|
127
127
|
error: g.value,
|
|
128
|
-
onInput:
|
|
129
|
-
onBlur: a[4] || (a[4] = (
|
|
128
|
+
onInput: w,
|
|
129
|
+
onBlur: a[4] || (a[4] = (C) => y("code"))
|
|
130
130
|
}, null, 8, ["modelValue", "error"])
|
|
131
|
-
])) :
|
|
132
|
-
!p.loading && m.value ? (
|
|
131
|
+
])) : D("", !0),
|
|
132
|
+
!p.loading && m.value ? (E(), k("div", Xe, [
|
|
133
133
|
$(n, {
|
|
134
134
|
loading: p.loading,
|
|
135
135
|
"rate-limit-text": p.rateLimitText,
|
|
136
136
|
"is-final-limit": p.isFinalLimit,
|
|
137
137
|
"on-send-again": c
|
|
138
138
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
139
|
-
])) :
|
|
139
|
+
])) : D("", !0)
|
|
140
140
|
]);
|
|
141
141
|
};
|
|
142
142
|
}
|
|
@@ -156,16 +156,16 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
156
156
|
const v = R, s = b(!1), m = b(""), e = b(""), i = Q({
|
|
157
157
|
newPassword: !1,
|
|
158
158
|
newPasswordConfirm: !1
|
|
159
|
-
}), y = b(
|
|
159
|
+
}), y = b(A.NEW), d = b(!1), r = b(!1), V = M(() => d.value ? "text" : "password"), N = M(() => r.value ? "text" : "password"), B = () => {
|
|
160
160
|
d.value = !d.value;
|
|
161
|
-
},
|
|
161
|
+
}, O = () => {
|
|
162
162
|
r.value = !r.value;
|
|
163
|
-
},
|
|
163
|
+
}, w = 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(() => !!(w.value || c.value)), g = M(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : T.value), L = () => {
|
|
164
164
|
v("update:modelValue", !1), v("close");
|
|
165
|
-
},
|
|
165
|
+
}, U = async () => {
|
|
166
166
|
v("update-user", m.value);
|
|
167
167
|
};
|
|
168
|
-
return (p, a) => (
|
|
168
|
+
return (p, a) => (E(), k(Oe, null, [
|
|
169
169
|
S("div", et, [
|
|
170
170
|
S("div", tt, [
|
|
171
171
|
a[7] || (a[7] = S("div", { class: "dialogDefaultContainerTextHint" }, X("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
|
|
@@ -177,11 +177,11 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
177
177
|
"text-size": "medium",
|
|
178
178
|
label: "Новый пароль",
|
|
179
179
|
type: V.value,
|
|
180
|
-
error:
|
|
180
|
+
error: w.value,
|
|
181
181
|
onBlur: a[1] || (a[1] = () => i.newPassword = !0),
|
|
182
182
|
onInput: a[2] || (a[2] = () => i.newPassword = !0)
|
|
183
183
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
184
|
-
(
|
|
184
|
+
(E(), H(Ce(d.value ? u(ge) : u(he)), {
|
|
185
185
|
class: "icon-locked",
|
|
186
186
|
onClick: B
|
|
187
187
|
}))
|
|
@@ -193,24 +193,24 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
193
193
|
size: "large",
|
|
194
194
|
"text-size": "medium",
|
|
195
195
|
label: "Повторите новый пароль",
|
|
196
|
-
type:
|
|
196
|
+
type: N.value,
|
|
197
197
|
error: c.value,
|
|
198
198
|
onBlur: a[4] || (a[4] = () => i.newPasswordConfirm = !0),
|
|
199
199
|
onInput: a[5] || (a[5] = () => i.newPasswordConfirm = !0)
|
|
200
200
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
201
|
-
(
|
|
201
|
+
(E(), H(Ce(r.value ? u(ge) : u(he)), {
|
|
202
202
|
class: "icon-locked",
|
|
203
|
-
onClick:
|
|
203
|
+
onClick: O
|
|
204
204
|
}))
|
|
205
205
|
]),
|
|
206
206
|
S("div", ot, [
|
|
207
|
-
$(u(
|
|
207
|
+
$(u(oe), {
|
|
208
208
|
style: { width: "100%" },
|
|
209
209
|
disabled: g.value,
|
|
210
|
-
onClick:
|
|
210
|
+
onClick: U
|
|
211
211
|
}, {
|
|
212
212
|
default: G(() => a[6] || (a[6] = [
|
|
213
|
-
|
|
213
|
+
le(X("Сохранить"))
|
|
214
214
|
])),
|
|
215
215
|
_: 1,
|
|
216
216
|
__: [6]
|
|
@@ -218,23 +218,23 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
218
218
|
])
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
|
-
y.value === u(
|
|
221
|
+
y.value === u(A).COMPLETED ? (E(), k("div", it, [
|
|
222
222
|
S("div", nt, [
|
|
223
223
|
a[9] || (a[9] = S("p", null, "Пароль успешно установлен", -1)),
|
|
224
224
|
S("div", st, [
|
|
225
|
-
$(u(
|
|
225
|
+
$(u(oe), {
|
|
226
226
|
style: { width: "100%" },
|
|
227
227
|
onClick: L
|
|
228
228
|
}, {
|
|
229
229
|
default: G(() => a[8] || (a[8] = [
|
|
230
|
-
|
|
230
|
+
le("Закрыть")
|
|
231
231
|
])),
|
|
232
232
|
_: 1,
|
|
233
233
|
__: [8]
|
|
234
234
|
})
|
|
235
235
|
])
|
|
236
236
|
])
|
|
237
|
-
])) :
|
|
237
|
+
])) : D("", !0)
|
|
238
238
|
], 64));
|
|
239
239
|
}
|
|
240
240
|
}), rt = { class: "dialogDefaultContainerInsideContent" }, ut = { class: "dialogDefaultContainerTextHint" }, mt = {
|
|
@@ -270,26 +270,26 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
270
270
|
});
|
|
271
271
|
Y(
|
|
272
272
|
() => m.emailModel,
|
|
273
|
-
(
|
|
273
|
+
(w) => s("update:email", w)
|
|
274
274
|
), Y(
|
|
275
275
|
() => m.codeModel,
|
|
276
|
-
(
|
|
276
|
+
(w) => s("update:code", w)
|
|
277
277
|
);
|
|
278
|
-
const e = (
|
|
279
|
-
m.touched[
|
|
280
|
-
}, i = b(""), y = (
|
|
278
|
+
const e = (w) => {
|
|
279
|
+
m.touched[w] = !0;
|
|
280
|
+
}, i = b(""), y = (w) => {
|
|
281
281
|
s("on-clear-code-error");
|
|
282
|
-
const c =
|
|
282
|
+
const c = w.target;
|
|
283
283
|
let T = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
|
|
284
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
285
|
}, d = () => {
|
|
286
286
|
s("on-send-code-again", { email: r.value });
|
|
287
|
-
}, { emailModel: r, codeModel: V, touched:
|
|
288
|
-
return (
|
|
287
|
+
}, { emailModel: r, codeModel: V, touched: N } = re(m), B = M(() => N.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), O = M(() => v.isNotMatchCode ? "Неверный код" : N.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
288
|
+
return (w, c) => {
|
|
289
289
|
const T = ue;
|
|
290
|
-
return
|
|
291
|
-
S("div", ut, X(
|
|
292
|
-
|
|
290
|
+
return E(), k("div", rt, [
|
|
291
|
+
S("div", ut, X(w.hintText), 1),
|
|
292
|
+
w.showEmail ? (E(), k("div", mt, [
|
|
293
293
|
$(u(J), {
|
|
294
294
|
modelValue: u(r),
|
|
295
295
|
"onUpdate:modelValue": c[0] || (c[0] = (g) => Z(r) ? r.value = g : null),
|
|
@@ -304,10 +304,10 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
304
304
|
}, null, 8, ["modelValue", "error"]),
|
|
305
305
|
$(u(me), {
|
|
306
306
|
class: "icon-locked",
|
|
307
|
-
onClick: c[3] || (c[3] = (g) =>
|
|
307
|
+
onClick: c[3] || (c[3] = (g) => w.$emit("edit", "email"))
|
|
308
308
|
})
|
|
309
|
-
])) :
|
|
310
|
-
|
|
309
|
+
])) : D("", !0),
|
|
310
|
+
w.showCode ? (E(), k("div", ct, [
|
|
311
311
|
$(u(J), {
|
|
312
312
|
modelValue: u(V),
|
|
313
313
|
"onUpdate:modelValue": c[4] || (c[4] = (g) => Z(V) ? V.value = g : null),
|
|
@@ -315,15 +315,15 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
315
315
|
"text-size": "medium",
|
|
316
316
|
label: "Код",
|
|
317
317
|
type: "text",
|
|
318
|
-
error:
|
|
318
|
+
error: O.value,
|
|
319
319
|
onInput: y,
|
|
320
320
|
onBlur: c[5] || (c[5] = (g) => e("code"))
|
|
321
321
|
}, null, 8, ["modelValue", "error"])
|
|
322
|
-
])) :
|
|
322
|
+
])) : D("", !0),
|
|
323
323
|
$(T, {
|
|
324
|
-
loading:
|
|
325
|
-
"rate-limit-text":
|
|
326
|
-
"is-final-limit":
|
|
324
|
+
loading: w.loading,
|
|
325
|
+
"rate-limit-text": w.rateLimitText,
|
|
326
|
+
"is-final-limit": w.isFinalLimit,
|
|
327
327
|
"on-send-again": d
|
|
328
328
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
329
329
|
]);
|
|
@@ -370,32 +370,32 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
370
370
|
);
|
|
371
371
|
const y = (a) => i.touched[a] = !0, d = (a) => i.touched[a] = !1, r = () => {
|
|
372
372
|
e.value = "", d("email");
|
|
373
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())),
|
|
374
|
-
var a
|
|
373
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), N = M(() => !V.value || !!e.value), B = async () => {
|
|
374
|
+
var a;
|
|
375
375
|
try {
|
|
376
376
|
if (y("email"), !V.value) {
|
|
377
377
|
e.value = "Это не похоже на e-mail";
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
const
|
|
381
|
-
if (!(((
|
|
380
|
+
const n = await Ve(i.emailModel), { data: C } = n.data;
|
|
381
|
+
if (!(((a = C.data[0]) == null ? void 0 : a.available) ?? !1)) {
|
|
382
382
|
e.value = "Такой email уже используется";
|
|
383
383
|
return;
|
|
384
384
|
}
|
|
385
385
|
e.value = "", s("on-send-code", { email: i.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
|
|
386
|
-
} catch (
|
|
387
|
-
console.error("Неизвестная ошибка при проверке доступности email:",
|
|
386
|
+
} catch (n) {
|
|
387
|
+
console.error("Неизвестная ошибка при проверке доступности email:", n), e.value = "Это не похоже на e-mail";
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
let
|
|
391
|
-
const
|
|
390
|
+
let O = "";
|
|
391
|
+
const w = (a) => {
|
|
392
392
|
s("on-clear-code-error");
|
|
393
393
|
const n = a.target;
|
|
394
|
-
let
|
|
395
|
-
|
|
394
|
+
let C = n.value.replace(/\D/g, "");
|
|
395
|
+
C.length > 4 && (C = C.slice(0, 4), n.value = C), i.codeModel = C, C.length === 4 && C !== O && (O = C, s("on-match-code", { email: i.emailModel, code: C }));
|
|
396
396
|
}, c = () => {
|
|
397
397
|
s("on-send-code-again", { email: i.emailModel });
|
|
398
|
-
}, { emailModel: T, codeModel: g, touched: L } = re(i),
|
|
398
|
+
}, { emailModel: T, codeModel: g, touched: L } = re(i), U = M(() => {
|
|
399
399
|
if (e.value) return e.value;
|
|
400
400
|
if (i.touched.email) {
|
|
401
401
|
if (!i.emailModel.trim()) return "Введите e-mail";
|
|
@@ -404,60 +404,60 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
404
404
|
return v.emailError || "";
|
|
405
405
|
}), p = M(() => v.isNotMatchCode ? "Неверный код" : L.value.code ? g.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
406
406
|
return (a, n) => {
|
|
407
|
-
const
|
|
408
|
-
return
|
|
407
|
+
const C = ue;
|
|
408
|
+
return E(), k("div", ft, [
|
|
409
409
|
S("div", Et, X(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
410
|
-
a.showEmail ? (
|
|
410
|
+
a.showEmail ? (E(), k("div", wt, [
|
|
411
411
|
$(u(J), {
|
|
412
412
|
modelValue: u(T),
|
|
413
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
413
|
+
"onUpdate:modelValue": n[0] || (n[0] = (F) => Z(T) ? T.value = F : null),
|
|
414
414
|
size: "large",
|
|
415
415
|
"text-size": "medium",
|
|
416
416
|
label: "Почта",
|
|
417
417
|
type: "email",
|
|
418
|
-
error:
|
|
419
|
-
onBlur: n[1] || (n[1] = (
|
|
418
|
+
error: U.value,
|
|
419
|
+
onBlur: n[1] || (n[1] = (F) => y("email")),
|
|
420
420
|
onInput: r
|
|
421
421
|
}, null, 8, ["modelValue", "error"]),
|
|
422
422
|
$(u(me), {
|
|
423
423
|
class: "icon-locked",
|
|
424
|
-
onClick: n[2] || (n[2] = (
|
|
424
|
+
onClick: n[2] || (n[2] = (F) => a.$emit("edit", "email"))
|
|
425
425
|
})
|
|
426
|
-
])) :
|
|
427
|
-
m.value ?
|
|
428
|
-
$(u(
|
|
426
|
+
])) : D("", !0),
|
|
427
|
+
m.value ? D("", !0) : (E(), k("div", Ct, [
|
|
428
|
+
$(u(oe), {
|
|
429
429
|
style: { width: "100%" },
|
|
430
|
-
disabled:
|
|
430
|
+
disabled: N.value,
|
|
431
431
|
onClick: B
|
|
432
432
|
}, {
|
|
433
433
|
default: G(() => n[5] || (n[5] = [
|
|
434
|
-
|
|
434
|
+
le(" Отправить код ")
|
|
435
435
|
])),
|
|
436
436
|
_: 1,
|
|
437
437
|
__: [5]
|
|
438
438
|
}, 8, ["disabled"])
|
|
439
439
|
])),
|
|
440
|
-
m.value ? (
|
|
440
|
+
m.value ? (E(), k("div", yt, [
|
|
441
441
|
$(u(J), {
|
|
442
442
|
modelValue: u(g),
|
|
443
|
-
"onUpdate:modelValue": n[3] || (n[3] = (
|
|
443
|
+
"onUpdate:modelValue": n[3] || (n[3] = (F) => Z(g) ? g.value = F : null),
|
|
444
444
|
size: "large",
|
|
445
445
|
"text-size": "medium",
|
|
446
446
|
label: "Код",
|
|
447
447
|
type: "text",
|
|
448
448
|
error: p.value,
|
|
449
|
-
onInput:
|
|
450
|
-
onBlur: n[4] || (n[4] = (
|
|
449
|
+
onInput: w,
|
|
450
|
+
onBlur: n[4] || (n[4] = (F) => y("code"))
|
|
451
451
|
}, null, 8, ["modelValue", "error"])
|
|
452
|
-
])) :
|
|
453
|
-
m.value ? (
|
|
454
|
-
$(
|
|
452
|
+
])) : D("", !0),
|
|
453
|
+
m.value ? (E(), k("div", gt, [
|
|
454
|
+
$(C, {
|
|
455
455
|
loading: a.loading,
|
|
456
456
|
"rate-limit-text": a.rateLimitText,
|
|
457
457
|
"is-final-limit": a.isFinalLimit,
|
|
458
458
|
"on-send-again": c
|
|
459
459
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
460
|
-
])) :
|
|
460
|
+
])) : D("", !0)
|
|
461
461
|
]);
|
|
462
462
|
};
|
|
463
463
|
}
|
|
@@ -486,7 +486,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
486
486
|
code: "",
|
|
487
487
|
addEmail: "",
|
|
488
488
|
addCode: ""
|
|
489
|
-
}), i = Q({ email: !1, code: !1 }), y = b(
|
|
489
|
+
}), i = Q({ email: !1, code: !1 }), y = b(A.OLD), d = b(null), r = b(!1), V = b(!1), N = b(!1), B = b(We.VERIFY_EMAIL), O = M(() => B.value === "password-flow"), w = M(() => p.value ? v.title : O.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: T, isAvailableForSendAgain: g, totalRateAttempts: L, currentRateAttempt: U } = Fe(), { isEditFlow: p, getFlow: a } = Ae(b(v.mode ?? "edit")), { showRateLimitToast: n } = Re(s), C = M(() => i.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), F = M(() => i.code && !e.code.trim() ? "Введите код" : ""), ie = M(() => g.value ? "Повторить" : `${T.value}`), q = b(Me), be = M(() => q.value === 0), $e = (l) => new Promise((t) => setTimeout(t, l));
|
|
490
490
|
Y(
|
|
491
491
|
() => v.modelValue,
|
|
492
492
|
(l) => m.value = l
|
|
@@ -498,7 +498,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
498
498
|
var o;
|
|
499
499
|
try {
|
|
500
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,
|
|
501
|
+
return h ? (await $e(1e3), h.restTimeSec > 0 ? (c(h.restTimeSec), g.value = !1, L.value = h.attempts.total ?? L.value, U.value = (h.attempts.total ?? 0) - (h.attempts.available ?? 0), q.value = h.attempts.available ?? q.value) : g.value = !0, h) : null;
|
|
502
502
|
} catch {
|
|
503
503
|
return null;
|
|
504
504
|
}
|
|
@@ -518,8 +518,8 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
518
518
|
async function pe(l = "email") {
|
|
519
519
|
var t;
|
|
520
520
|
try {
|
|
521
|
-
const o = await W("/users/profile/session/create-if-not-exists", { field: l, oldValue: v.initialEmail }),
|
|
522
|
-
d.value = (
|
|
521
|
+
const o = await W("/users/profile/session/create-if-not-exists", { field: l, oldValue: v.initialEmail }), f = ((t = o.data) == null ? void 0 : t.data) ?? o.data;
|
|
522
|
+
d.value = (f == null ? void 0 : f.sessionId) ?? d.value, y.value = (f == null ? void 0 : f.step) ?? y.value, e.oldEmail = (f == null ? void 0 : f.oldValue) ?? e.oldEmail, e.newEmail = (f == null ? void 0 : f.newValue) ?? e.newEmail;
|
|
523
523
|
} catch {
|
|
524
524
|
}
|
|
525
525
|
}
|
|
@@ -527,12 +527,12 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
527
527
|
var o;
|
|
528
528
|
try {
|
|
529
529
|
r.value = !0;
|
|
530
|
-
const
|
|
530
|
+
const f = l ?? e.addEmail, h = await W(
|
|
531
531
|
"/users/profile/email/contact/send-code",
|
|
532
532
|
{
|
|
533
533
|
sessionId: d.value,
|
|
534
|
-
email:
|
|
535
|
-
value:
|
|
534
|
+
email: f,
|
|
535
|
+
value: f,
|
|
536
536
|
oldValue: e.oldEmail,
|
|
537
537
|
provider: v.provider
|
|
538
538
|
}
|
|
@@ -540,38 +540,38 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
540
540
|
);
|
|
541
541
|
if (h.status === 403 && ((o = h.data) != null && o.tooManyRequests)) {
|
|
542
542
|
const I = h.data.tooManyRequests;
|
|
543
|
-
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, U.value = (I.attempts.total ?? 0) - (I.attempts.available ?? 0), q.value = I.attempts.available ?? q.value) : g.value = !0, h;
|
|
544
544
|
}
|
|
545
545
|
return await ve(l ?? e.oldEmail), h;
|
|
546
|
-
} catch (
|
|
547
|
-
throw console.error(
|
|
546
|
+
} catch (f) {
|
|
547
|
+
throw console.error(f), f;
|
|
548
548
|
} finally {
|
|
549
549
|
t && (r.value = !1);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
const fe = async (l, t) => {
|
|
553
|
-
var o,
|
|
554
|
-
if (!e.oldEmail && t ===
|
|
553
|
+
var o, f, h, I, x, j;
|
|
554
|
+
if (!e.oldEmail && t === A.OLD) throw new Error("oldEmail пустой — модель потерялась");
|
|
555
555
|
try {
|
|
556
556
|
r.value = !0;
|
|
557
|
-
const
|
|
558
|
-
if (d.value = (
|
|
557
|
+
const P = await se();
|
|
558
|
+
if (d.value = (P == null ? void 0 : P.sessionId) ?? d.value, y.value = (P == null ? void 0 : P.step) ?? y.value, e.oldEmail = (P == null ? void 0 : P.oldValue) ?? e.oldEmail, e.newEmail = (P == null ? void 0 : P.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
559
559
|
const z = await W("/users/profile/change/email/match-code", {
|
|
560
|
-
email: t ===
|
|
560
|
+
email: t === A.NEW ? e.newEmail : e.oldEmail,
|
|
561
561
|
sessionId: d.value,
|
|
562
562
|
code: l,
|
|
563
563
|
step: t
|
|
564
|
-
}),
|
|
564
|
+
}), ae = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (f = z.data) == null ? void 0 : f.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
565
|
if (n(De), !Ne) {
|
|
566
566
|
V.value = !0;
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
|
-
if (
|
|
570
|
-
if (y.value =
|
|
569
|
+
if (ae) {
|
|
570
|
+
if (y.value = ae, y.value === A.NEW) {
|
|
571
571
|
const K = await se();
|
|
572
572
|
e.oldEmail = (K == null ? void 0 : K.oldValue) ?? e.oldEmail, e.newEmail = (K == null ? void 0 : K.newValue) ?? e.newEmail, e.code = "";
|
|
573
573
|
}
|
|
574
|
-
y.value ===
|
|
574
|
+
y.value === A.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"));
|
|
575
575
|
}
|
|
576
576
|
return z;
|
|
577
577
|
} finally {
|
|
@@ -591,28 +591,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
593
|
async function Ie({ code: l }) {
|
|
594
|
-
await fe(l,
|
|
594
|
+
await fe(l, A.OLD);
|
|
595
595
|
}
|
|
596
596
|
function Ee(l) {
|
|
597
597
|
}
|
|
598
598
|
async function Se({ code: l }) {
|
|
599
|
-
await fe(l,
|
|
599
|
+
await fe(l, A.NEW);
|
|
600
600
|
}
|
|
601
601
|
const we = async ({
|
|
602
602
|
value: l,
|
|
603
603
|
field: t = "email",
|
|
604
604
|
offLoading: o = !0
|
|
605
605
|
}) => {
|
|
606
|
-
var
|
|
606
|
+
var f;
|
|
607
607
|
try {
|
|
608
608
|
if (r.value = !0, !d.value) throw new Error("Bind-сессия не найдена. Создайте её через createBindSession.");
|
|
609
609
|
const h = l ?? e.addEmail, I = await W(`/users/profile/bind/contact/send-code/${t}`, {
|
|
610
610
|
sessionId: d.value,
|
|
611
611
|
email: h,
|
|
612
612
|
provider: v.provider
|
|
613
|
-
}), x = (
|
|
613
|
+
}), x = (f = I.data) == null ? void 0 : f.tooManyRequests;
|
|
614
614
|
if (I.status === 403 && x) {
|
|
615
|
-
x.restTimeSec > 0 ? (c(x.restTimeSec), L.value = x.attempts.total ?? L.value,
|
|
615
|
+
x.restTimeSec > 0 ? (c(x.restTimeSec), L.value = x.attempts.total ?? L.value, U.value = (x.attempts.total ?? 0) - (x.attempts.available ?? 0), q.value = x.attempts.available ?? Me) : g.value = !0;
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
618
|
const j = await ve(h);
|
|
@@ -621,11 +621,11 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
621
621
|
o && (r.value = !1);
|
|
622
622
|
}
|
|
623
623
|
}, Be = async () => {
|
|
624
|
-
var l, t, o,
|
|
624
|
+
var l, t, o, f, h, I;
|
|
625
625
|
try {
|
|
626
626
|
if (!d.value) {
|
|
627
|
-
const
|
|
628
|
-
d.value =
|
|
627
|
+
const ae = await de();
|
|
628
|
+
d.value = ae.sessionId ?? d.value;
|
|
629
629
|
}
|
|
630
630
|
const x = await W("/users/profile/bind/email/match-code", {
|
|
631
631
|
email: e.addEmail,
|
|
@@ -633,9 +633,9 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
633
633
|
code: e.addCode
|
|
634
634
|
}), j = ((l = x.data) == null ? void 0 : l.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
635
635
|
B.value = j ?? B.value;
|
|
636
|
-
const
|
|
637
|
-
if (n(
|
|
638
|
-
|
|
636
|
+
const P = ((h = (f = x.data) == null ? void 0 : f.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(P), !z) {
|
|
638
|
+
N.value = !0;
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
641
|
} catch {
|
|
@@ -648,7 +648,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
648
648
|
}
|
|
649
649
|
r.value = !0;
|
|
650
650
|
try {
|
|
651
|
-
await W("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), B.value =
|
|
651
|
+
await W("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), B.value = A.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");
|
|
652
652
|
} finally {
|
|
653
653
|
r.value = !1;
|
|
654
654
|
}
|
|
@@ -669,7 +669,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
await xe(), e.oldEmail && await ee({ value: e.oldEmail }), r.value = !1;
|
|
672
|
-
}), (l, t) => (
|
|
672
|
+
}), (l, t) => (E(), H(u(_e), {
|
|
673
673
|
modelValue: m.value,
|
|
674
674
|
"onUpdate:modelValue": [
|
|
675
675
|
t[18] || (t[18] = (o) => m.value = o),
|
|
@@ -689,7 +689,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
689
689
|
"no-padding": !1
|
|
690
690
|
}, {
|
|
691
691
|
title: G(() => [
|
|
692
|
-
S("span", Mt, X(
|
|
692
|
+
S("span", Mt, X(w.value), 1)
|
|
693
693
|
]),
|
|
694
694
|
"right-button": G(() => [
|
|
695
695
|
$(u(je), {
|
|
@@ -703,18 +703,18 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
703
703
|
]),
|
|
704
704
|
default: G(() => [
|
|
705
705
|
S("div", null, [
|
|
706
|
-
u(p) ? (
|
|
707
|
-
r.value ? (
|
|
708
|
-
y.value === u(
|
|
706
|
+
u(p) ? (E(), k("div", Vt, [
|
|
707
|
+
r.value ? (E(), H(ye, { key: 0 })) : D("", !0),
|
|
708
|
+
y.value === u(A).OLD ? (E(), H(pt, {
|
|
709
709
|
key: 1,
|
|
710
710
|
email: e.oldEmail,
|
|
711
711
|
"onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
|
|
712
712
|
code: e.code,
|
|
713
713
|
"onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
|
|
714
714
|
"hint-text": l.hintText,
|
|
715
|
-
"email-error":
|
|
716
|
-
"code-error":
|
|
717
|
-
"rate-limit-text":
|
|
715
|
+
"email-error": C.value,
|
|
716
|
+
"code-error": F.value,
|
|
717
|
+
"rate-limit-text": ie.value,
|
|
718
718
|
"is-final-limit": q.value === 0,
|
|
719
719
|
"is-not-match-code": V.value,
|
|
720
720
|
loading: r.value,
|
|
@@ -724,7 +724,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
724
724
|
onSendCode: t[2] || (t[2] = (o) => ee({ value: e.oldEmail })),
|
|
725
725
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ee({ value: e.oldEmail })),
|
|
726
726
|
onOnClearCodeError: t[4] || (t[4] = (o) => V.value = !1)
|
|
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(
|
|
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(A).NEW ? (E(), H(ht, {
|
|
728
728
|
key: 2,
|
|
729
729
|
email: e.newEmail,
|
|
730
730
|
"onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
|
|
@@ -733,9 +733,9 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
733
733
|
code: e.code,
|
|
734
734
|
"onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
|
|
735
735
|
"hint-text": "Введите новый адрес вашей почты",
|
|
736
|
-
"email-error":
|
|
737
|
-
"code-error":
|
|
738
|
-
"rate-limit-text":
|
|
736
|
+
"email-error": C.value,
|
|
737
|
+
"code-error": F.value,
|
|
738
|
+
"rate-limit-text": ie.value,
|
|
739
739
|
"is-final-limit": q.value === 0,
|
|
740
740
|
"is-not-match-code": V.value,
|
|
741
741
|
loading: r.value,
|
|
@@ -745,17 +745,17 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
745
745
|
onOnSendCode: t[8] || (t[8] = (o) => ee({ value: e.newEmail })),
|
|
746
746
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ee({ value: e.newEmail })),
|
|
747
747
|
onOnClearCodeError: t[10] || (t[10] = (o) => V.value = !1)
|
|
748
|
-
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) :
|
|
749
|
-
])) : (
|
|
750
|
-
r.value ? (
|
|
751
|
-
|
|
748
|
+
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : D("", !0)
|
|
749
|
+
])) : (E(), k("div", bt, [
|
|
750
|
+
r.value ? (E(), H(ye, { key: 0 })) : D("", !0),
|
|
751
|
+
O.value ? (E(), H(dt, {
|
|
752
752
|
key: 2,
|
|
753
753
|
"model-value": m.value,
|
|
754
754
|
"email-session-id": d.value,
|
|
755
755
|
"onUpdate:modelValue": t[17] || (t[17] = (o) => s("update:modelValue", o)),
|
|
756
756
|
onUpdateUser: Pe,
|
|
757
757
|
onClose: ke
|
|
758
|
-
}, null, 8, ["model-value", "email-session-id"])) : (
|
|
758
|
+
}, null, 8, ["model-value", "email-session-id"])) : (E(), H(Ze, {
|
|
759
759
|
key: 1,
|
|
760
760
|
email: e.addEmail,
|
|
761
761
|
"onUpdate:email": t[11] || (t[11] = (o) => e.addEmail = o),
|
|
@@ -764,15 +764,15 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
764
764
|
code: e.addCode,
|
|
765
765
|
"onUpdate:code": t[13] || (t[13] = (o) => e.addCode = o),
|
|
766
766
|
"hint-text": u(p) ? l.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
|
|
767
|
-
"rate-limit-text":
|
|
767
|
+
"rate-limit-text": ie.value,
|
|
768
768
|
"is-final-limit": be.value,
|
|
769
|
-
"is-not-match-code":
|
|
769
|
+
"is-not-match-code": N.value,
|
|
770
770
|
loading: r.value,
|
|
771
771
|
onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
772
772
|
onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
773
773
|
onOnMatchCode: Be,
|
|
774
774
|
onOnMatchCodeError: Le,
|
|
775
|
-
onOnClearCodeError: t[16] || (t[16] = (o) =>
|
|
775
|
+
onOnClearCodeError: t[16] || (t[16] = (o) => N.value = !1)
|
|
776
776
|
}, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
|
|
777
777
|
]))
|
|
778
778
|
])
|