@yourgoods/ui-smart 0.49.0 → 0.50.1
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-sZkCbkOn.js → ProfileEmailDialog-_xFNmM53.js} +82 -82
- package/dist/{ProfilePasswordDialog-LdM_8zVG.js → ProfilePasswordDialog-BRL-NxyC.js} +1 -1
- package/dist/ProfilePhoneDialog-DJzWkfsA.js +849 -0
- package/dist/{index-3V186vCD.js → index-Dt-xD4lU.js} +53 -53
- package/dist/index.js +2 -2
- package/dist/{useRateLimitToast-_WymxlzB.js → useRateLimitToast-DID9XsBg.js} +10 -11
- package/package.json +1 -1
- package/dist/ProfilePhoneDialog-BF5sey9V.js +0 -853
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as
|
|
2
|
-
import { T as ve, c as
|
|
3
|
-
import { C as
|
|
1
|
+
import { defineComponent as ie, ref as $, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as w, createElementVNode as B, createCommentVNode as D, toDisplayString as ee, createVNode as x, unref as u, isRef as te, withCtx as G, createTextVNode as ne, Fragment as Ae, createBlock as _, resolveDynamicComponent as he, onMounted as Fe } from "vue";
|
|
2
|
+
import { T as ve, c as xe, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-DID9XsBg.js";
|
|
3
|
+
import { C as F, _ as He, B as _e, p as H, g as qe } from "./index-Dt-xD4lU.js";
|
|
4
4
|
import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as Ve, PDialog as je, PTopBar as Ge, IconCrossMd as Ye } from "@profeat/ui-kit";
|
|
5
5
|
const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dialogDefaultContainerTextHint" }, Qe = {
|
|
6
6
|
key: 0,
|
|
@@ -27,7 +27,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { 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(q, { emit: W }) {
|
|
30
|
-
const v = q, s = W, m =
|
|
30
|
+
const v = q, s = W, m = $(!1), e = $(""), n = Z({
|
|
31
31
|
emailModel: v.email || "",
|
|
32
32
|
codeModel: "",
|
|
33
33
|
touched: { email: !1, code: !1 }
|
|
@@ -52,7 +52,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
52
52
|
e.value = "Это не похоже на e-mail";
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const a = await
|
|
55
|
+
const a = await xe(n.emailModel), { data: i } = a.data;
|
|
56
56
|
if (!(((p = i.data[0]) == null ? void 0 : p.available) ?? !1)) {
|
|
57
57
|
e.value = "Такой email уже используется";
|
|
58
58
|
return;
|
|
@@ -86,24 +86,24 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
86
86
|
return w(), I("div", Je, [
|
|
87
87
|
B("div", Ke, ee(m.value ? "Введите код подтверждения" : p.hintText), 1),
|
|
88
88
|
p.showEmail ? (w(), I("div", Qe, [
|
|
89
|
-
|
|
89
|
+
x(u(J), {
|
|
90
90
|
modelValue: u(P),
|
|
91
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
91
|
+
"onUpdate:modelValue": a[0] || (a[0] = (y) => te(P) ? P.value = y : null),
|
|
92
92
|
size: "large",
|
|
93
93
|
"text-size": "medium",
|
|
94
94
|
label: "Почта",
|
|
95
95
|
type: "email",
|
|
96
96
|
error: M.value,
|
|
97
|
-
onBlur: a[1] || (a[1] = (
|
|
97
|
+
onBlur: a[1] || (a[1] = (y) => h("email")),
|
|
98
98
|
onInput: r
|
|
99
99
|
}, null, 8, ["modelValue", "error"]),
|
|
100
|
-
|
|
100
|
+
x(u(pe), {
|
|
101
101
|
class: "icon-locked",
|
|
102
|
-
onClick: a[2] || (a[2] = (
|
|
102
|
+
onClick: a[2] || (a[2] = (y) => p.$emit("edit", "email"))
|
|
103
103
|
})
|
|
104
104
|
])) : D("", !0),
|
|
105
105
|
m.value ? D("", !0) : (w(), I("div", Xe, [
|
|
106
|
-
|
|
106
|
+
x(u(se), {
|
|
107
107
|
style: { width: "100%" },
|
|
108
108
|
disabled: O.value,
|
|
109
109
|
onClick: L
|
|
@@ -116,20 +116,20 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
116
116
|
}, 8, ["disabled"])
|
|
117
117
|
])),
|
|
118
118
|
m.value ? (w(), I("div", Ze, [
|
|
119
|
-
|
|
119
|
+
x(u(J), {
|
|
120
120
|
modelValue: u(A),
|
|
121
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
121
|
+
"onUpdate:modelValue": a[3] || (a[3] = (y) => te(A) ? A.value = y : null),
|
|
122
122
|
size: "large",
|
|
123
123
|
"text-size": "medium",
|
|
124
124
|
label: "Код",
|
|
125
125
|
type: "text",
|
|
126
126
|
error: V.value,
|
|
127
127
|
onInput: C,
|
|
128
|
-
onBlur: a[4] || (a[4] = (
|
|
128
|
+
onBlur: a[4] || (a[4] = (y) => h("code"))
|
|
129
129
|
}, null, 8, ["modelValue", "error"])
|
|
130
130
|
])) : D("", !0),
|
|
131
131
|
!p.loading && m.value ? (w(), I("div", et, [
|
|
132
|
-
|
|
132
|
+
x(i, {
|
|
133
133
|
loading: p.loading,
|
|
134
134
|
"rate-limit-text": p.rateLimitText,
|
|
135
135
|
"is-final-limit": p.isFinalLimit,
|
|
@@ -152,10 +152,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
152
152
|
},
|
|
153
153
|
emits: ["update:modelValue", "submit", "close", "update-user"],
|
|
154
154
|
setup(q, { emit: W }) {
|
|
155
|
-
const v = W, s =
|
|
155
|
+
const v = W, s = $(!1), m = $(""), e = $(""), n = Z({
|
|
156
156
|
newPassword: !1,
|
|
157
157
|
newPasswordConfirm: !1
|
|
158
|
-
}), h =
|
|
158
|
+
}), h = $(F.NEW), d = $(!1), r = $(!1), T = b(() => d.value ? "text" : "password"), O = b(() => r.value ? "text" : "password"), L = () => {
|
|
159
159
|
d.value = !d.value;
|
|
160
160
|
}, U = () => {
|
|
161
161
|
r.value = !r.value;
|
|
@@ -169,7 +169,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
169
169
|
B("div", lt, [
|
|
170
170
|
a[7] || (a[7] = B("div", { class: "dialogDefaultContainerTextHint" }, ee("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
|
|
171
171
|
B("div", ot, [
|
|
172
|
-
|
|
172
|
+
x(u(J), {
|
|
173
173
|
modelValue: m.value,
|
|
174
174
|
"onUpdate:modelValue": a[0] || (a[0] = (i) => m.value = i),
|
|
175
175
|
size: "large",
|
|
@@ -186,7 +186,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
186
186
|
}))
|
|
187
187
|
]),
|
|
188
188
|
B("div", it, [
|
|
189
|
-
|
|
189
|
+
x(u(J), {
|
|
190
190
|
modelValue: e.value,
|
|
191
191
|
"onUpdate:modelValue": a[3] || (a[3] = (i) => e.value = i),
|
|
192
192
|
size: "large",
|
|
@@ -203,7 +203,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
203
203
|
}))
|
|
204
204
|
]),
|
|
205
205
|
B("div", nt, [
|
|
206
|
-
|
|
206
|
+
x(u(se), {
|
|
207
207
|
style: { width: "100%" },
|
|
208
208
|
disabled: V.value,
|
|
209
209
|
onClick: A
|
|
@@ -217,11 +217,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
217
217
|
])
|
|
218
218
|
])
|
|
219
219
|
]),
|
|
220
|
-
h.value === u(
|
|
220
|
+
h.value === u(F).COMPLETED ? (w(), I("div", st, [
|
|
221
221
|
B("div", dt, [
|
|
222
222
|
a[9] || (a[9] = B("p", null, "Пароль успешно установлен", -1)),
|
|
223
223
|
B("div", rt, [
|
|
224
|
-
|
|
224
|
+
x(u(se), {
|
|
225
225
|
style: { width: "100%" },
|
|
226
226
|
onClick: P
|
|
227
227
|
}, {
|
|
@@ -276,7 +276,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
276
276
|
);
|
|
277
277
|
const e = (C) => {
|
|
278
278
|
m.touched[C] = !0;
|
|
279
|
-
}, n =
|
|
279
|
+
}, n = $(""), h = (C) => {
|
|
280
280
|
const c = C.target;
|
|
281
281
|
let M = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
|
|
282
282
|
M.length < 4 && s("on-clear-code-error"), M.length > 4 && (M = M.slice(0, 4)), T.value = M, c && c.value !== M && (c.value = M), M.length === 4 && M !== n.value && (n.value = M, s("on-match-code", { email: r.value, code: M }));
|
|
@@ -288,7 +288,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
288
288
|
return w(), I("div", mt, [
|
|
289
289
|
B("div", ct, ee(C.hintText), 1),
|
|
290
290
|
C.showEmail ? (w(), I("div", vt, [
|
|
291
|
-
|
|
291
|
+
x(u(J), {
|
|
292
292
|
modelValue: u(r),
|
|
293
293
|
"onUpdate:modelValue": c[0] || (c[0] = (V) => te(r) ? r.value = V : null),
|
|
294
294
|
size: "large",
|
|
@@ -300,13 +300,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
300
300
|
onBlur: c[1] || (c[1] = (V) => e("email")),
|
|
301
301
|
onInput: c[2] || (c[2] = (V) => e("email"))
|
|
302
302
|
}, null, 8, ["modelValue", "error"]),
|
|
303
|
-
|
|
303
|
+
x(u(pe), {
|
|
304
304
|
class: "icon-locked",
|
|
305
305
|
onClick: c[3] || (c[3] = (V) => C.$emit("edit", "email"))
|
|
306
306
|
})
|
|
307
307
|
])) : D("", !0),
|
|
308
308
|
C.showCode ? (w(), I("div", pt, [
|
|
309
|
-
|
|
309
|
+
x(u(J), {
|
|
310
310
|
modelValue: u(T),
|
|
311
311
|
"onUpdate:modelValue": c[4] || (c[4] = (V) => te(T) ? T.value = V : null),
|
|
312
312
|
size: "large",
|
|
@@ -318,7 +318,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
318
318
|
onBlur: c[5] || (c[5] = (V) => e("code"))
|
|
319
319
|
}, null, 8, ["modelValue", "error"])
|
|
320
320
|
])) : D("", !0),
|
|
321
|
-
|
|
321
|
+
x(M, {
|
|
322
322
|
loading: C.loading,
|
|
323
323
|
"rate-limit-text": C.rateLimitText,
|
|
324
324
|
"is-final-limit": C.isFinalLimit,
|
|
@@ -327,10 +327,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
327
327
|
]);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
}), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" },
|
|
330
|
+
}), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, yt = {
|
|
331
331
|
key: 0,
|
|
332
332
|
class: "input-wrapper"
|
|
333
|
-
},
|
|
333
|
+
}, gt = {
|
|
334
334
|
key: 1,
|
|
335
335
|
class: "input-wrapper"
|
|
336
336
|
}, ht = {
|
|
@@ -352,7 +352,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
352
352
|
},
|
|
353
353
|
emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
|
|
354
354
|
setup(q, { emit: W }) {
|
|
355
|
-
const v = q, s = W, m =
|
|
355
|
+
const v = q, s = W, m = $(!1), e = $(""), n = Z({
|
|
356
356
|
touched: { email: !1, code: !1 },
|
|
357
357
|
emailModel: "",
|
|
358
358
|
codeModel: ""
|
|
@@ -375,8 +375,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
375
375
|
e.value = "Это не похоже на e-mail";
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
|
-
const i = await
|
|
379
|
-
if (!(((a =
|
|
378
|
+
const i = await xe(n.emailModel), { data: y } = i.data;
|
|
379
|
+
if (!(((a = y.data[0]) == null ? void 0 : a.available) ?? !1)) {
|
|
380
380
|
e.value = "Такой email уже используется";
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
@@ -388,8 +388,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
388
388
|
let U = "";
|
|
389
389
|
const C = (a) => {
|
|
390
390
|
const i = a.target;
|
|
391
|
-
let
|
|
392
|
-
|
|
391
|
+
let y = i.value.replace(/\D/g, "");
|
|
392
|
+
y.length < 4 && s("on-clear-code-error"), y.length > 4 && (y = y.slice(0, 4), i.value = y), n.codeModel = y, y.length === 4 && y !== U && (U = y, s("on-match-code", { email: n.emailModel, code: y }));
|
|
393
393
|
}, c = () => {
|
|
394
394
|
s("on-send-code-again", { email: n.emailModel });
|
|
395
395
|
}, { emailModel: M, codeModel: V, touched: P } = ce(n), A = b(() => {
|
|
@@ -401,11 +401,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
401
401
|
return v.emailError || "";
|
|
402
402
|
}), p = b(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
403
403
|
return (a, i) => {
|
|
404
|
-
const
|
|
404
|
+
const y = ve;
|
|
405
405
|
return w(), I("div", wt, [
|
|
406
406
|
B("div", Ct, ee(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
407
|
-
a.showEmail ? (w(), I("div",
|
|
408
|
-
|
|
407
|
+
a.showEmail ? (w(), I("div", yt, [
|
|
408
|
+
x(u(J), {
|
|
409
409
|
modelValue: u(M),
|
|
410
410
|
"onUpdate:modelValue": i[0] || (i[0] = (z) => te(M) ? M.value = z : null),
|
|
411
411
|
size: "large",
|
|
@@ -416,13 +416,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
416
416
|
onBlur: i[1] || (i[1] = (z) => h("email")),
|
|
417
417
|
onInput: r
|
|
418
418
|
}, null, 8, ["modelValue", "error"]),
|
|
419
|
-
|
|
419
|
+
x(u(pe), {
|
|
420
420
|
class: "icon-locked",
|
|
421
421
|
onClick: i[2] || (i[2] = (z) => a.$emit("edit", "email"))
|
|
422
422
|
})
|
|
423
423
|
])) : D("", !0),
|
|
424
|
-
m.value ? D("", !0) : (w(), I("div",
|
|
425
|
-
|
|
424
|
+
m.value ? D("", !0) : (w(), I("div", gt, [
|
|
425
|
+
x(u(se), {
|
|
426
426
|
style: { width: "100%" },
|
|
427
427
|
disabled: O.value,
|
|
428
428
|
onClick: L
|
|
@@ -435,7 +435,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
435
435
|
}, 8, ["disabled"])
|
|
436
436
|
])),
|
|
437
437
|
m.value ? (w(), I("div", ht, [
|
|
438
|
-
|
|
438
|
+
x(u(J), {
|
|
439
439
|
modelValue: u(V),
|
|
440
440
|
"onUpdate:modelValue": i[3] || (i[3] = (z) => te(V) ? V.value = z : null),
|
|
441
441
|
size: "large",
|
|
@@ -448,7 +448,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
448
448
|
}, null, 8, ["modelValue", "error"])
|
|
449
449
|
])) : D("", !0),
|
|
450
450
|
m.value ? (w(), I("div", Tt, [
|
|
451
|
-
|
|
451
|
+
x(y, {
|
|
452
452
|
loading: a.loading,
|
|
453
453
|
"rate-limit-text": a.rateLimitText,
|
|
454
454
|
"is-final-limit": a.isFinalLimit,
|
|
@@ -458,13 +458,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
458
458
|
]);
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
}), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" },
|
|
461
|
+
}), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" }, $t = {
|
|
462
462
|
key: 0,
|
|
463
463
|
class: "dialogDefaultContainer"
|
|
464
|
-
},
|
|
464
|
+
}, xt = {
|
|
465
465
|
key: 1,
|
|
466
466
|
class: "dialogDefaultContainer"
|
|
467
|
-
},
|
|
467
|
+
}, $e = 3, Pt = /* @__PURE__ */ ie({
|
|
468
468
|
__name: "ProfileEmailDialog",
|
|
469
469
|
props: {
|
|
470
470
|
modelValue: { type: Boolean },
|
|
@@ -477,13 +477,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
477
477
|
},
|
|
478
478
|
emits: ["update:modelValue", "submit-email", "edit", "close", "notify", "clean-input-errors", "on-update-jwt", "update-email-field", "on-password-error", "on-toast"],
|
|
479
479
|
setup(q, { emit: W }) {
|
|
480
|
-
const v = q, s = W, m =
|
|
480
|
+
const v = q, s = W, m = $(v.modelValue), e = Z({
|
|
481
481
|
oldEmail: v.initialEmail,
|
|
482
482
|
newEmail: "",
|
|
483
483
|
code: "",
|
|
484
484
|
addEmail: "",
|
|
485
485
|
addCode: ""
|
|
486
|
-
}), n = Z({ email: !1, code: !1 }), h =
|
|
486
|
+
}), n = Z({ email: !1, code: !1 }), h = $(F.OLD), d = $(null), r = $(!1), T = $(!1), O = $(!1), L = $(_e.VERIFY_EMAIL), U = b(() => L.value === "password-flow"), C = b(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: M, isAvailableForSendAgain: V, totalRateAttempts: P, currentRateAttempt: A } = ze(), { isEditFlow: p, getFlow: a } = Re($(v.mode ?? "edit")), { showRateLimitToast: i } = We(s), y = b(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), z = b(() => n.code && !e.code.trim() ? "Введите код" : ""), de = b(() => V.value ? "Повторить" : `${M.value}`), j = $($e), ke = b(() => j.value === 0), Ie = (l) => new Promise((t) => setTimeout(t, l));
|
|
487
487
|
Y(
|
|
488
488
|
() => v.modelValue,
|
|
489
489
|
(l) => m.value = l
|
|
@@ -548,36 +548,36 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
548
548
|
}
|
|
549
549
|
const Ce = async (l, t) => {
|
|
550
550
|
var o, f, E, S, N, le, oe, k, K;
|
|
551
|
-
if (!e.oldEmail && t ===
|
|
551
|
+
if (!e.oldEmail && t === F.OLD) throw new Error("oldEmail пустой — модель потерялась");
|
|
552
552
|
try {
|
|
553
553
|
r.value = !0;
|
|
554
|
-
const
|
|
555
|
-
if (d.value = (
|
|
556
|
-
const
|
|
557
|
-
email: t ===
|
|
554
|
+
const g = await ue();
|
|
555
|
+
if (d.value = (g == null ? void 0 : g.sessionId) ?? d.value, h.value = (g == null ? void 0 : g.step) ?? h.value, e.oldEmail = (g == null ? void 0 : g.oldValue) ?? e.oldEmail, e.newEmail = (g == null ? void 0 : g.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
556
|
+
const R = await H("/users/profile/change/email/match-code", {
|
|
557
|
+
email: t === F.NEW ? e.newEmail : e.oldEmail,
|
|
558
558
|
sessionId: d.value,
|
|
559
559
|
code: l,
|
|
560
560
|
step: t
|
|
561
|
-
}), Q = ((o =
|
|
562
|
-
if (!(
|
|
561
|
+
}), Q = ((o = R.data) == null ? void 0 : o.nextStep) ?? ((E = (f = R.data) == null ? void 0 : f.data) == null ? void 0 : E.nextStep) ?? null, Ue = ((N = (S = R.data) == null ? void 0 : S.data) == null ? void 0 : N.rateLimit) ?? ((le = R.data) == null ? void 0 : le.rateLimit) ?? null;
|
|
562
|
+
if (!(R.data.data.success ?? R.data.success)) {
|
|
563
563
|
i(Ue), T.value = !0;
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
566
|
if (Q) {
|
|
567
|
-
if (h.value = Q, h.value ===
|
|
567
|
+
if (h.value = Q, h.value === F.NEW) {
|
|
568
568
|
const X = await ue();
|
|
569
569
|
e.oldEmail = (X == null ? void 0 : X.oldValue) ?? e.oldEmail, e.newEmail = (X == null ? void 0 : X.newValue) ?? e.newEmail, e.code = "";
|
|
570
570
|
}
|
|
571
|
-
h.value ===
|
|
571
|
+
h.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"));
|
|
572
572
|
}
|
|
573
|
-
return
|
|
574
|
-
} catch (
|
|
575
|
-
const
|
|
576
|
-
if (console.error("rate-limit debug error: ",
|
|
577
|
-
|
|
573
|
+
return R;
|
|
574
|
+
} catch (g) {
|
|
575
|
+
const R = (k = (oe = g == null ? void 0 : g.response) == null ? void 0 : oe.data) == null ? void 0 : k.rateLimit, Q = (K = g == null ? void 0 : g.response) == null ? void 0 : K.data.statusCode;
|
|
576
|
+
if (console.error("rate-limit debug error: ", g), Q === 429 && R) {
|
|
577
|
+
i(R), T.value = !0;
|
|
578
578
|
return;
|
|
579
579
|
}
|
|
580
|
-
throw
|
|
580
|
+
throw g;
|
|
581
581
|
} finally {
|
|
582
582
|
r.value = !1;
|
|
583
583
|
}
|
|
@@ -595,14 +595,14 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
597
|
async function Le({ code: l }) {
|
|
598
|
-
await Ce(l,
|
|
598
|
+
await Ce(l, F.OLD);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function ye(l) {
|
|
601
601
|
}
|
|
602
602
|
async function Pe({ code: l }) {
|
|
603
|
-
await Ce(l,
|
|
603
|
+
await Ce(l, F.NEW);
|
|
604
604
|
}
|
|
605
|
-
const
|
|
605
|
+
const ge = async ({
|
|
606
606
|
value: l,
|
|
607
607
|
field: t = "email",
|
|
608
608
|
offLoading: o = !0
|
|
@@ -616,7 +616,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
616
616
|
provider: v.provider
|
|
617
617
|
}), N = (f = S.data) == null ? void 0 : f.tooManyRequests;
|
|
618
618
|
if (S.status === 403 && N) {
|
|
619
|
-
N.restTimeSec > 0 ? (c(N.restTimeSec), P.value = N.attempts.total ?? P.value, A.value = (N.attempts.total ?? 0) - (N.attempts.available ?? 0), j.value = N.attempts.available ??
|
|
619
|
+
N.restTimeSec > 0 ? (c(N.restTimeSec), P.value = N.attempts.total ?? P.value, A.value = (N.attempts.total ?? 0) - (N.attempts.available ?? 0), j.value = N.attempts.available ?? $e) : V.value = !0;
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
622
|
return S;
|
|
@@ -637,9 +637,9 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
637
637
|
code: e.addCode
|
|
638
638
|
}), K = ((l = k.data) == null ? void 0 : l.nextStep) ?? ((o = (t = k.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
639
639
|
L.value = K ?? L.value;
|
|
640
|
-
const
|
|
640
|
+
const g = ((E = (f = k.data) == null ? void 0 : f.data) == null ? void 0 : E.rateLimit) ?? ((S = k.data) == null ? void 0 : S.rateLimit) ?? null;
|
|
641
641
|
if (!(k.data.data.success ?? k.data.success)) {
|
|
642
|
-
i(
|
|
642
|
+
i(g), O.value = !0;
|
|
643
643
|
return;
|
|
644
644
|
}
|
|
645
645
|
} catch (k) {
|
|
@@ -658,7 +658,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
658
658
|
}
|
|
659
659
|
r.value = !0;
|
|
660
660
|
try {
|
|
661
|
-
await H("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), L.value =
|
|
661
|
+
await H("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), L.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
662
|
} finally {
|
|
663
663
|
r.value = !1;
|
|
664
664
|
}
|
|
@@ -692,7 +692,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
692
692
|
}, {
|
|
693
693
|
header: G(() => [
|
|
694
694
|
B("div", Vt, [
|
|
695
|
-
|
|
695
|
+
x(u(Ge), {
|
|
696
696
|
"slot-left": !1,
|
|
697
697
|
size: "small",
|
|
698
698
|
borded: !0,
|
|
@@ -702,7 +702,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
702
702
|
B("span", bt, ee(C.value), 1)
|
|
703
703
|
]),
|
|
704
704
|
"right-button": G(() => [
|
|
705
|
-
|
|
705
|
+
x(u(Ye), {
|
|
706
706
|
class: "cross",
|
|
707
707
|
onClick: re
|
|
708
708
|
})
|
|
@@ -713,16 +713,16 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
713
713
|
]),
|
|
714
714
|
default: G(() => [
|
|
715
715
|
B("div", null, [
|
|
716
|
-
u(p) ? (w(), I("div",
|
|
716
|
+
u(p) ? (w(), I("div", $t, [
|
|
717
717
|
r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
|
|
718
|
-
h.value === u(
|
|
718
|
+
h.value === u(F).OLD ? (w(), _(Et, {
|
|
719
719
|
key: 1,
|
|
720
720
|
email: e.oldEmail,
|
|
721
721
|
"onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
|
|
722
722
|
code: e.code,
|
|
723
723
|
"onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
|
|
724
724
|
"hint-text": l.hintText,
|
|
725
|
-
"email-error":
|
|
725
|
+
"email-error": y.value,
|
|
726
726
|
"code-error": z.value,
|
|
727
727
|
"rate-limit-text": de.value,
|
|
728
728
|
"is-final-limit": j.value === 0,
|
|
@@ -730,11 +730,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
730
730
|
loading: r.value,
|
|
731
731
|
onEdit: fe,
|
|
732
732
|
onOnMatchCode: Le,
|
|
733
|
-
onOnMatchCodeError:
|
|
733
|
+
onOnMatchCodeError: ye,
|
|
734
734
|
onSendCode: t[2] || (t[2] = (o) => ae({ value: e.oldEmail })),
|
|
735
735
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ae({ value: e.oldEmail })),
|
|
736
736
|
onOnClearCodeError: t[4] || (t[4] = (o) => T.value = !1)
|
|
737
|
-
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : h.value === u(
|
|
737
|
+
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : h.value === u(F).NEW ? (w(), _(Mt, {
|
|
738
738
|
key: 2,
|
|
739
739
|
email: e.newEmail,
|
|
740
740
|
"onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
|
|
@@ -743,7 +743,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
743
743
|
code: e.code,
|
|
744
744
|
"onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
|
|
745
745
|
"hint-text": "Введите новый адрес вашей почты",
|
|
746
|
-
"email-error":
|
|
746
|
+
"email-error": y.value,
|
|
747
747
|
"code-error": z.value,
|
|
748
748
|
"rate-limit-text": de.value,
|
|
749
749
|
"is-final-limit": j.value === 0,
|
|
@@ -751,12 +751,12 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
751
751
|
loading: r.value,
|
|
752
752
|
onEdit: fe,
|
|
753
753
|
onOnMatchCode: Pe,
|
|
754
|
-
onOnMatchCodeError:
|
|
754
|
+
onOnMatchCodeError: ye,
|
|
755
755
|
onOnSendCode: t[8] || (t[8] = (o) => ae({ value: e.newEmail })),
|
|
756
756
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ae({ value: e.newEmail })),
|
|
757
757
|
onOnClearCodeError: t[10] || (t[10] = (o) => T.value = !1)
|
|
758
758
|
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : D("", !0)
|
|
759
|
-
])) : (w(), I("div",
|
|
759
|
+
])) : (w(), I("div", xt, [
|
|
760
760
|
r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
|
|
761
761
|
U.value ? (w(), _(ut, {
|
|
762
762
|
key: 2,
|
|
@@ -778,8 +778,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
778
778
|
"is-final-limit": ke.value,
|
|
779
779
|
"is-not-match-code": O.value,
|
|
780
780
|
loading: r.value,
|
|
781
|
-
onOnSendCode: t[14] || (t[14] = (o) =>
|
|
782
|
-
onOnSendCodeAgain: t[15] || (t[15] = (o) =>
|
|
781
|
+
onOnSendCode: t[14] || (t[14] = (o) => ge({ value: e.addEmail, field: "email" })),
|
|
782
|
+
onOnSendCodeAgain: t[15] || (t[15] = (o) => ge({ value: e.addEmail, field: "email" })),
|
|
783
783
|
onOnMatchCode: De,
|
|
784
784
|
onOnMatchCodeError: Ne,
|
|
785
785
|
onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
|
|
2
|
-
import { C as I, p as D, g as Ve } from "./index-
|
|
2
|
+
import { C as I, p as D, g as Ve } from "./index-Dt-xD4lU.js";
|
|
3
3
|
import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
|
|
4
4
|
function ke(b) {
|
|
5
5
|
return { showPasswordRateLimitToast: (P) => {
|