@yourgoods/ui-smart 0.46.7 → 0.47.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-DlGErflr.js → ProfileEmailDialog-D7meJIOd.js} +77 -80
- package/dist/{ProfilePasswordDialog-DLrepGiM.js → ProfilePasswordDialog-DmvyrGhz.js} +1 -1
- package/dist/{ProfilePhoneDialog-C8_OQsEV.js → ProfilePhoneDialog-DUxLeNPV.js} +87 -90
- package/dist/{index-BSr7kEC4.js → index-xXK11ev0.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-D6JDxDzB.js → useRateLimitToast-DocdeOsw.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as x, reactive as Z, watch as Y, computed as
|
|
2
|
-
import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-
|
|
3
|
-
import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-
|
|
4
|
-
import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as
|
|
1
|
+
import { defineComponent as ie, ref as x, 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 $, 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 $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-DocdeOsw.js";
|
|
3
|
+
import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-xXK11ev0.js";
|
|
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,
|
|
7
7
|
class: "input-wrapper"
|
|
@@ -45,7 +45,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
45
45
|
n.touched[p] = !0;
|
|
46
46
|
}, d = (p) => n.touched[p] = !1, r = () => {
|
|
47
47
|
e.value = "", d("email");
|
|
48
|
-
}, T =
|
|
48
|
+
}, T = b(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = b(() => !T.value || !!e.value), L = async () => {
|
|
49
49
|
var p;
|
|
50
50
|
try {
|
|
51
51
|
if (h("email"), !T.value) {
|
|
@@ -68,20 +68,19 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
68
68
|
};
|
|
69
69
|
let U = "";
|
|
70
70
|
const C = (p) => {
|
|
71
|
-
s("on-clear-code-error");
|
|
72
71
|
const a = p.target;
|
|
73
72
|
let i = a.value.replace(/\D/g, "");
|
|
74
|
-
i.length > 4 && (i = i.slice(0, 4)), a.value = i, n.codeModel = i, i.length === 4 && i !== U && (U = i, s("on-match-code", { email: n.emailModel, code: i }));
|
|
73
|
+
i.length < 4 && s("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), a.value = i, n.codeModel = i, i.length === 4 && i !== U && (U = i, s("on-match-code", { email: n.emailModel, code: i }));
|
|
75
74
|
}, c = () => {
|
|
76
75
|
s("on-send-code-again", { email: n.emailModel });
|
|
77
|
-
},
|
|
76
|
+
}, M = b(() => {
|
|
78
77
|
if (e.value) return e.value;
|
|
79
78
|
if (n.touched.email) {
|
|
80
79
|
if (!n.emailModel.trim()) return "Введите e-mail";
|
|
81
80
|
if (!T.value) return "Это не похоже на e-mail";
|
|
82
81
|
}
|
|
83
82
|
return v.emailError || "";
|
|
84
|
-
}),
|
|
83
|
+
}), V = b(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: P, codeModel: A } = ce(n);
|
|
85
84
|
return (p, a) => {
|
|
86
85
|
const i = ve;
|
|
87
86
|
return w(), I("div", Je, [
|
|
@@ -89,18 +88,18 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
89
88
|
p.showEmail ? (w(), I("div", Qe, [
|
|
90
89
|
$(u(J), {
|
|
91
90
|
modelValue: u(P),
|
|
92
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
91
|
+
"onUpdate:modelValue": a[0] || (a[0] = (g) => te(P) ? P.value = g : null),
|
|
93
92
|
size: "large",
|
|
94
93
|
"text-size": "medium",
|
|
95
94
|
label: "Почта",
|
|
96
95
|
type: "email",
|
|
97
|
-
error:
|
|
98
|
-
onBlur: a[1] || (a[1] = (
|
|
96
|
+
error: M.value,
|
|
97
|
+
onBlur: a[1] || (a[1] = (g) => h("email")),
|
|
99
98
|
onInput: r
|
|
100
99
|
}, null, 8, ["modelValue", "error"]),
|
|
101
100
|
$(u(pe), {
|
|
102
101
|
class: "icon-locked",
|
|
103
|
-
onClick: a[2] || (a[2] = (
|
|
102
|
+
onClick: a[2] || (a[2] = (g) => p.$emit("edit", "email"))
|
|
104
103
|
})
|
|
105
104
|
])) : D("", !0),
|
|
106
105
|
m.value ? D("", !0) : (w(), I("div", Xe, [
|
|
@@ -119,14 +118,14 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
119
118
|
m.value ? (w(), I("div", Ze, [
|
|
120
119
|
$(u(J), {
|
|
121
120
|
modelValue: u(A),
|
|
122
|
-
"onUpdate:modelValue": a[3] || (a[3] = (
|
|
121
|
+
"onUpdate:modelValue": a[3] || (a[3] = (g) => te(A) ? A.value = g : null),
|
|
123
122
|
size: "large",
|
|
124
123
|
"text-size": "medium",
|
|
125
124
|
label: "Код",
|
|
126
125
|
type: "text",
|
|
127
|
-
error:
|
|
126
|
+
error: V.value,
|
|
128
127
|
onInput: C,
|
|
129
|
-
onBlur: a[4] || (a[4] = (
|
|
128
|
+
onBlur: a[4] || (a[4] = (g) => h("code"))
|
|
130
129
|
}, null, 8, ["modelValue", "error"])
|
|
131
130
|
])) : D("", !0),
|
|
132
131
|
!p.loading && m.value ? (w(), I("div", et, [
|
|
@@ -143,7 +142,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
143
142
|
}), at = { class: "dialogDefaultContainer" }, lt = { class: "dialogDefaultContainerInsideContent" }, ot = { class: "input-wrapper" }, it = { class: "input-wrapper" }, nt = { style: { width: "100%", display: "flex" } }, st = {
|
|
144
143
|
key: 0,
|
|
145
144
|
class: "dialogDefaultContainer"
|
|
146
|
-
}, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { "margin-top": "12px" } },
|
|
145
|
+
}, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { "margin-top": "12px" } }, be = 8, ut = /* @__PURE__ */ ie({
|
|
147
146
|
__name: "AddNewPasswordContent",
|
|
148
147
|
props: {
|
|
149
148
|
modelValue: { type: Boolean },
|
|
@@ -156,11 +155,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
156
155
|
const v = W, s = x(!1), m = x(""), e = x(""), n = Z({
|
|
157
156
|
newPassword: !1,
|
|
158
157
|
newPasswordConfirm: !1
|
|
159
|
-
}), h = x(R.NEW), d = x(!1), r = x(!1), T =
|
|
158
|
+
}), h = x(R.NEW), d = x(!1), r = x(!1), T = b(() => d.value ? "text" : "password"), O = b(() => r.value ? "text" : "password"), L = () => {
|
|
160
159
|
d.value = !d.value;
|
|
161
160
|
}, U = () => {
|
|
162
161
|
r.value = !r.value;
|
|
163
|
-
}, C =
|
|
162
|
+
}, C = b(() => n.newPassword ? m.value.trim() ? m.value.trim().length < be ? `Пароль слишком короткий. Введите хотя бы ${be} символов` : "" : "Введите пароль" : ""), c = b(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), M = b(() => !!(C.value || c.value)), V = b(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : M.value), P = () => {
|
|
164
163
|
v("update:modelValue", !1), v("close");
|
|
165
164
|
}, A = async () => {
|
|
166
165
|
v("update-user", m.value);
|
|
@@ -181,7 +180,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
181
180
|
onBlur: a[1] || (a[1] = () => n.newPassword = !0),
|
|
182
181
|
onInput: a[2] || (a[2] = () => n.newPassword = !0)
|
|
183
182
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
184
|
-
(w(), _(he(d.value ? u(Me) : u(
|
|
183
|
+
(w(), _(he(d.value ? u(Me) : u(Ve)), {
|
|
185
184
|
class: "icon-locked",
|
|
186
185
|
onClick: L
|
|
187
186
|
}))
|
|
@@ -198,7 +197,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
198
197
|
onBlur: a[4] || (a[4] = () => n.newPasswordConfirm = !0),
|
|
199
198
|
onInput: a[5] || (a[5] = () => n.newPasswordConfirm = !0)
|
|
200
199
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
201
|
-
(w(), _(he(r.value ? u(Me) : u(
|
|
200
|
+
(w(), _(he(r.value ? u(Me) : u(Ve)), {
|
|
202
201
|
class: "icon-locked",
|
|
203
202
|
onClick: U
|
|
204
203
|
}))
|
|
@@ -206,7 +205,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
206
205
|
B("div", nt, [
|
|
207
206
|
$(u(se), {
|
|
208
207
|
style: { width: "100%" },
|
|
209
|
-
disabled:
|
|
208
|
+
disabled: V.value,
|
|
210
209
|
onClick: A
|
|
211
210
|
}, {
|
|
212
211
|
default: G(() => a[6] || (a[6] = [
|
|
@@ -278,49 +277,48 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
278
277
|
const e = (C) => {
|
|
279
278
|
m.touched[C] = !0;
|
|
280
279
|
}, n = x(""), h = (C) => {
|
|
281
|
-
s("on-clear-code-error");
|
|
282
280
|
const c = C.target;
|
|
283
|
-
let
|
|
284
|
-
|
|
281
|
+
let M = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
|
|
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 }));
|
|
285
283
|
}, d = () => {
|
|
286
284
|
s("on-send-code-again", { email: r.value });
|
|
287
|
-
}, { emailModel: r, codeModel: T, touched: O } = ce(m), L =
|
|
285
|
+
}, { emailModel: r, codeModel: T, touched: O } = ce(m), L = b(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = b(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? T.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
288
286
|
return (C, c) => {
|
|
289
|
-
const
|
|
287
|
+
const M = ve;
|
|
290
288
|
return w(), I("div", mt, [
|
|
291
289
|
B("div", ct, ee(C.hintText), 1),
|
|
292
290
|
C.showEmail ? (w(), I("div", vt, [
|
|
293
291
|
$(u(J), {
|
|
294
292
|
modelValue: u(r),
|
|
295
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
293
|
+
"onUpdate:modelValue": c[0] || (c[0] = (V) => te(r) ? r.value = V : null),
|
|
296
294
|
size: "large",
|
|
297
295
|
"text-size": "medium",
|
|
298
296
|
label: "Почта",
|
|
299
297
|
type: "email",
|
|
300
298
|
error: L.value,
|
|
301
299
|
disabled: !0,
|
|
302
|
-
onBlur: c[1] || (c[1] = (
|
|
303
|
-
onInput: c[2] || (c[2] = (
|
|
300
|
+
onBlur: c[1] || (c[1] = (V) => e("email")),
|
|
301
|
+
onInput: c[2] || (c[2] = (V) => e("email"))
|
|
304
302
|
}, null, 8, ["modelValue", "error"]),
|
|
305
303
|
$(u(pe), {
|
|
306
304
|
class: "icon-locked",
|
|
307
|
-
onClick: c[3] || (c[3] = (
|
|
305
|
+
onClick: c[3] || (c[3] = (V) => C.$emit("edit", "email"))
|
|
308
306
|
})
|
|
309
307
|
])) : D("", !0),
|
|
310
308
|
C.showCode ? (w(), I("div", pt, [
|
|
311
309
|
$(u(J), {
|
|
312
310
|
modelValue: u(T),
|
|
313
|
-
"onUpdate:modelValue": c[4] || (c[4] = (
|
|
311
|
+
"onUpdate:modelValue": c[4] || (c[4] = (V) => te(T) ? T.value = V : null),
|
|
314
312
|
size: "large",
|
|
315
313
|
"text-size": "medium",
|
|
316
314
|
label: "Код",
|
|
317
315
|
type: "text",
|
|
318
316
|
error: U.value,
|
|
319
317
|
onInput: h,
|
|
320
|
-
onBlur: c[5] || (c[5] = (
|
|
318
|
+
onBlur: c[5] || (c[5] = (V) => e("code"))
|
|
321
319
|
}, null, 8, ["modelValue", "error"])
|
|
322
320
|
])) : D("", !0),
|
|
323
|
-
$(
|
|
321
|
+
$(M, {
|
|
324
322
|
loading: C.loading,
|
|
325
323
|
"rate-limit-text": C.rateLimitText,
|
|
326
324
|
"is-final-limit": C.isFinalLimit,
|
|
@@ -329,10 +327,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
329
327
|
]);
|
|
330
328
|
};
|
|
331
329
|
}
|
|
332
|
-
}), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-
|
|
330
|
+
}), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, gt = {
|
|
333
331
|
key: 0,
|
|
334
332
|
class: "input-wrapper"
|
|
335
|
-
},
|
|
333
|
+
}, yt = {
|
|
336
334
|
key: 1,
|
|
337
335
|
class: "input-wrapper"
|
|
338
336
|
}, ht = {
|
|
@@ -370,15 +368,15 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
370
368
|
);
|
|
371
369
|
const h = (a) => n.touched[a] = !0, d = (a) => n.touched[a] = !1, r = () => {
|
|
372
370
|
e.value = "", d("email");
|
|
373
|
-
}, T =
|
|
371
|
+
}, T = b(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = b(() => !T.value || !!e.value), L = async () => {
|
|
374
372
|
var a;
|
|
375
373
|
try {
|
|
376
374
|
if (h("email"), !T.value) {
|
|
377
375
|
e.value = "Это не похоже на e-mail";
|
|
378
376
|
return;
|
|
379
377
|
}
|
|
380
|
-
const i = await $e(n.emailModel), { data:
|
|
381
|
-
if (!(((a =
|
|
378
|
+
const i = await $e(n.emailModel), { data: g } = i.data;
|
|
379
|
+
if (!(((a = g.data[0]) == null ? void 0 : a.available) ?? !1)) {
|
|
382
380
|
e.value = "Такой email уже используется";
|
|
383
381
|
return;
|
|
384
382
|
}
|
|
@@ -389,28 +387,27 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
389
387
|
};
|
|
390
388
|
let U = "";
|
|
391
389
|
const C = (a) => {
|
|
392
|
-
s("on-clear-code-error");
|
|
393
390
|
const i = a.target;
|
|
394
|
-
let
|
|
395
|
-
|
|
391
|
+
let g = i.value.replace(/\D/g, "");
|
|
392
|
+
g.length < 4 && s("on-clear-code-error"), g.length > 4 && (g = g.slice(0, 4), i.value = g), n.codeModel = g, g.length === 4 && g !== U && (U = g, s("on-match-code", { email: n.emailModel, code: g }));
|
|
396
393
|
}, c = () => {
|
|
397
394
|
s("on-send-code-again", { email: n.emailModel });
|
|
398
|
-
}, { emailModel:
|
|
395
|
+
}, { emailModel: M, codeModel: V, touched: P } = ce(n), A = b(() => {
|
|
399
396
|
if (e.value) return e.value;
|
|
400
397
|
if (n.touched.email) {
|
|
401
398
|
if (!n.emailModel.trim()) return "Введите e-mail";
|
|
402
399
|
if (!T.value) return "Это не похоже на e-mail";
|
|
403
400
|
}
|
|
404
401
|
return v.emailError || "";
|
|
405
|
-
}), p =
|
|
402
|
+
}), p = b(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
406
403
|
return (a, i) => {
|
|
407
|
-
const
|
|
404
|
+
const g = ve;
|
|
408
405
|
return w(), I("div", wt, [
|
|
409
406
|
B("div", Ct, ee(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
410
|
-
a.showEmail ? (w(), I("div",
|
|
407
|
+
a.showEmail ? (w(), I("div", gt, [
|
|
411
408
|
$(u(J), {
|
|
412
|
-
modelValue: u(
|
|
413
|
-
"onUpdate:modelValue": i[0] || (i[0] = (z) => te(
|
|
409
|
+
modelValue: u(M),
|
|
410
|
+
"onUpdate:modelValue": i[0] || (i[0] = (z) => te(M) ? M.value = z : null),
|
|
414
411
|
size: "large",
|
|
415
412
|
"text-size": "medium",
|
|
416
413
|
label: "Почта",
|
|
@@ -424,7 +421,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
424
421
|
onClick: i[2] || (i[2] = (z) => a.$emit("edit", "email"))
|
|
425
422
|
})
|
|
426
423
|
])) : D("", !0),
|
|
427
|
-
m.value ? D("", !0) : (w(), I("div",
|
|
424
|
+
m.value ? D("", !0) : (w(), I("div", yt, [
|
|
428
425
|
$(u(se), {
|
|
429
426
|
style: { width: "100%" },
|
|
430
427
|
disabled: O.value,
|
|
@@ -439,8 +436,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
439
436
|
])),
|
|
440
437
|
m.value ? (w(), I("div", ht, [
|
|
441
438
|
$(u(J), {
|
|
442
|
-
modelValue: u(
|
|
443
|
-
"onUpdate:modelValue": i[3] || (i[3] = (z) => te(
|
|
439
|
+
modelValue: u(V),
|
|
440
|
+
"onUpdate:modelValue": i[3] || (i[3] = (z) => te(V) ? V.value = z : null),
|
|
444
441
|
size: "large",
|
|
445
442
|
"text-size": "medium",
|
|
446
443
|
label: "Код",
|
|
@@ -451,7 +448,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
451
448
|
}, null, 8, ["modelValue", "error"])
|
|
452
449
|
])) : D("", !0),
|
|
453
450
|
m.value ? (w(), I("div", Tt, [
|
|
454
|
-
$(
|
|
451
|
+
$(g, {
|
|
455
452
|
loading: a.loading,
|
|
456
453
|
"rate-limit-text": a.rateLimitText,
|
|
457
454
|
"is-final-limit": a.isFinalLimit,
|
|
@@ -461,7 +458,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
461
458
|
]);
|
|
462
459
|
};
|
|
463
460
|
}
|
|
464
|
-
}),
|
|
461
|
+
}), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" }, xt = {
|
|
465
462
|
key: 0,
|
|
466
463
|
class: "dialogDefaultContainer"
|
|
467
464
|
}, $t = {
|
|
@@ -486,7 +483,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
486
483
|
code: "",
|
|
487
484
|
addEmail: "",
|
|
488
485
|
addCode: ""
|
|
489
|
-
}), n = Z({ email: !1, code: !1 }), h = x(R.OLD), d = x(null), r = x(!1), T = x(!1), O = x(!1), L = x(_e.VERIFY_EMAIL), U =
|
|
486
|
+
}), n = Z({ email: !1, code: !1 }), h = x(R.OLD), d = x(null), r = x(!1), T = x(!1), O = x(!1), L = x(_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(x(v.mode ?? "edit")), { showRateLimitToast: i } = We(s), g = b(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), z = b(() => n.code && !e.code.trim() ? "Введите код" : ""), de = b(() => V.value ? "Повторить" : `${M.value}`), j = x(xe), ke = b(() => j.value === 0), Ie = (l) => new Promise((t) => setTimeout(t, l));
|
|
490
487
|
Y(
|
|
491
488
|
() => v.modelValue,
|
|
492
489
|
(l) => m.value = l
|
|
@@ -498,19 +495,19 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
498
495
|
var o;
|
|
499
496
|
try {
|
|
500
497
|
const E = (o = (await H("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
|
|
501
|
-
return E ? (await Ie(1e3), E.restTimeSec > 0 ? (c(E.restTimeSec),
|
|
498
|
+
return E ? (await Ie(1e3), E.restTimeSec > 0 ? (c(E.restTimeSec), V.value = !1, P.value = E.attempts.total ?? P.value, A.value = (E.attempts.total ?? 0) - (E.attempts.available ?? 0), j.value = E.attempts.available ?? j.value) : V.value = !0, E) : null;
|
|
502
499
|
} catch {
|
|
503
500
|
return null;
|
|
504
501
|
}
|
|
505
502
|
}
|
|
506
503
|
async function ue(l = "email") {
|
|
507
504
|
var o;
|
|
508
|
-
return (
|
|
505
|
+
return (o = (await qe("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : o.data;
|
|
509
506
|
}
|
|
510
507
|
async function Se(l = "email") {
|
|
511
508
|
try {
|
|
512
509
|
const t = await ue(l);
|
|
513
|
-
d.value = (t == null ? void 0 : t.sessionId) ?? d.value, h.value = (t == null ? void 0 : t.step) ?? h.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await we(l);
|
|
510
|
+
return d.value = (t == null ? void 0 : t.sessionId) ?? d.value, h.value = (t == null ? void 0 : t.step) ?? h.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await we(l), t;
|
|
514
511
|
} catch {
|
|
515
512
|
await we(l);
|
|
516
513
|
}
|
|
@@ -519,7 +516,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
519
516
|
var t;
|
|
520
517
|
try {
|
|
521
518
|
const o = await H("/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, h.value = (f == null ? void 0 : f.step) ?? h.value, e.oldEmail = (f == null ? void 0 : f.oldValue) ?? e.oldEmail, e.newEmail = (f == null ? void 0 : f.newValue) ?? e.newEmail;
|
|
519
|
+
return d.value = (f == null ? void 0 : f.sessionId) ?? d.value, h.value = (f == null ? void 0 : f.step) ?? h.value, e.oldEmail = (f == null ? void 0 : f.oldValue) ?? e.oldEmail, e.newEmail = (f == null ? void 0 : f.newValue) ?? e.newEmail, f;
|
|
523
520
|
} catch {
|
|
524
521
|
}
|
|
525
522
|
}
|
|
@@ -540,7 +537,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
540
537
|
);
|
|
541
538
|
if (E.status === 403 && ((o = E.data) != null && o.tooManyRequests)) {
|
|
542
539
|
const S = E.data.tooManyRequests;
|
|
543
|
-
return S.restTimeSec > 0 ? (c(S.restTimeSec), P.value = S.attempts.total ?? P.value, A.value = (S.attempts.total ?? 0) - (S.attempts.available ?? 0), j.value = S.attempts.available ?? j.value) :
|
|
540
|
+
return S.restTimeSec > 0 ? (c(S.restTimeSec), P.value = S.attempts.total ?? P.value, A.value = (S.attempts.total ?? 0) - (S.attempts.available ?? 0), j.value = S.attempts.available ?? j.value) : V.value = !0, E;
|
|
544
541
|
}
|
|
545
542
|
return E;
|
|
546
543
|
} catch (f) {
|
|
@@ -554,8 +551,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
554
551
|
if (!e.oldEmail && t === R.OLD) throw new Error("oldEmail пустой — модель потерялась");
|
|
555
552
|
try {
|
|
556
553
|
r.value = !0;
|
|
557
|
-
const
|
|
558
|
-
if (d.value = (
|
|
554
|
+
const y = await ue();
|
|
555
|
+
if (d.value = (y == null ? void 0 : y.sessionId) ?? d.value, h.value = (y == null ? void 0 : y.step) ?? h.value, e.oldEmail = (y == null ? void 0 : y.oldValue) ?? e.oldEmail, e.newEmail = (y == null ? void 0 : y.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
559
556
|
const F = await H("/users/profile/change/email/match-code", {
|
|
560
557
|
email: t === R.NEW ? e.newEmail : e.oldEmail,
|
|
561
558
|
sessionId: d.value,
|
|
@@ -574,13 +571,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
574
571
|
h.value === R.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
572
|
}
|
|
576
573
|
return F;
|
|
577
|
-
} catch (
|
|
578
|
-
const F = (k = (oe =
|
|
579
|
-
if (console.error("rate-limit debug error: ",
|
|
574
|
+
} catch (y) {
|
|
575
|
+
const F = (k = (oe = y == null ? void 0 : y.response) == null ? void 0 : oe.data) == null ? void 0 : k.rateLimit, Q = (K = y == null ? void 0 : y.response) == null ? void 0 : K.data.statusCode;
|
|
576
|
+
if (console.error("rate-limit debug error: ", y), Q === 429 && F) {
|
|
580
577
|
console.debug("rate-limit debug status and exists rateLimit: ", F), i(F), T.value = !0;
|
|
581
578
|
return;
|
|
582
579
|
}
|
|
583
|
-
throw
|
|
580
|
+
throw y;
|
|
584
581
|
} finally {
|
|
585
582
|
r.value = !1;
|
|
586
583
|
}
|
|
@@ -600,12 +597,12 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
600
597
|
async function Le({ code: l }) {
|
|
601
598
|
await Ce(l, R.OLD);
|
|
602
599
|
}
|
|
603
|
-
function
|
|
600
|
+
function ge(l) {
|
|
604
601
|
}
|
|
605
602
|
async function Pe({ code: l }) {
|
|
606
603
|
await Ce(l, R.NEW);
|
|
607
604
|
}
|
|
608
|
-
const
|
|
605
|
+
const ye = async ({
|
|
609
606
|
value: l,
|
|
610
607
|
field: t = "email",
|
|
611
608
|
offLoading: o = !0
|
|
@@ -619,13 +616,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
619
616
|
provider: v.provider
|
|
620
617
|
}), N = (f = S.data) == null ? void 0 : f.tooManyRequests;
|
|
621
618
|
if (S.status === 403 && N) {
|
|
622
|
-
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 ?? xe) :
|
|
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 ?? xe) : V.value = !0;
|
|
623
620
|
return;
|
|
624
621
|
}
|
|
625
622
|
return S;
|
|
626
623
|
} finally {
|
|
627
624
|
const E = await Ee(l ?? e.addEmail);
|
|
628
|
-
E && E.restTimeSec > 0 ? c(E.restTimeSec) :
|
|
625
|
+
E && E.restTimeSec > 0 ? c(E.restTimeSec) : V.value = !0, o && (r.value = !1);
|
|
629
626
|
}
|
|
630
627
|
}, De = async () => {
|
|
631
628
|
var l, t, o, f, E, S, N, le, oe;
|
|
@@ -640,9 +637,9 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
640
637
|
code: e.addCode
|
|
641
638
|
}), K = ((l = k.data) == null ? void 0 : l.nextStep) ?? ((o = (t = k.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
642
639
|
L.value = K ?? L.value;
|
|
643
|
-
const
|
|
640
|
+
const y = ((E = (f = k.data) == null ? void 0 : f.data) == null ? void 0 : E.rateLimit) ?? ((S = k.data) == null ? void 0 : S.rateLimit) ?? null;
|
|
644
641
|
if (!(k.data.data.success ?? k.data.success)) {
|
|
645
|
-
i(
|
|
642
|
+
i(y), O.value = !0;
|
|
646
643
|
return;
|
|
647
644
|
}
|
|
648
645
|
} catch (k) {
|
|
@@ -681,7 +678,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
681
678
|
await me(), r.value = !1;
|
|
682
679
|
return;
|
|
683
680
|
}
|
|
684
|
-
await Se()
|
|
681
|
+
(await Se()).step === "old" && e.oldEmail && await ae({ value: e.oldEmail }), r.value = !1;
|
|
685
682
|
}), (l, t) => (w(), _(u(je), {
|
|
686
683
|
modelValue: m.value,
|
|
687
684
|
"onUpdate:modelValue": [
|
|
@@ -694,7 +691,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
694
691
|
"onClick:outside": re
|
|
695
692
|
}, {
|
|
696
693
|
header: G(() => [
|
|
697
|
-
B("div",
|
|
694
|
+
B("div", Vt, [
|
|
698
695
|
$(u(Ge), {
|
|
699
696
|
"slot-left": !1,
|
|
700
697
|
size: "small",
|
|
@@ -702,7 +699,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
702
699
|
"no-padding": !1
|
|
703
700
|
}, {
|
|
704
701
|
title: G(() => [
|
|
705
|
-
B("span",
|
|
702
|
+
B("span", bt, ee(C.value), 1)
|
|
706
703
|
]),
|
|
707
704
|
"right-button": G(() => [
|
|
708
705
|
$(u(Ye), {
|
|
@@ -725,7 +722,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
725
722
|
code: e.code,
|
|
726
723
|
"onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
|
|
727
724
|
"hint-text": l.hintText,
|
|
728
|
-
"email-error":
|
|
725
|
+
"email-error": g.value,
|
|
729
726
|
"code-error": z.value,
|
|
730
727
|
"rate-limit-text": de.value,
|
|
731
728
|
"is-final-limit": j.value === 0,
|
|
@@ -733,7 +730,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
733
730
|
loading: r.value,
|
|
734
731
|
onEdit: fe,
|
|
735
732
|
onOnMatchCode: Le,
|
|
736
|
-
onOnMatchCodeError:
|
|
733
|
+
onOnMatchCodeError: ge,
|
|
737
734
|
onSendCode: t[2] || (t[2] = (o) => ae({ value: e.oldEmail })),
|
|
738
735
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ae({ value: e.oldEmail })),
|
|
739
736
|
onOnClearCodeError: t[4] || (t[4] = (o) => T.value = !1)
|
|
@@ -746,7 +743,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
746
743
|
code: e.code,
|
|
747
744
|
"onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
|
|
748
745
|
"hint-text": "Введите новый адрес вашей почты",
|
|
749
|
-
"email-error":
|
|
746
|
+
"email-error": g.value,
|
|
750
747
|
"code-error": z.value,
|
|
751
748
|
"rate-limit-text": de.value,
|
|
752
749
|
"is-final-limit": j.value === 0,
|
|
@@ -754,7 +751,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
754
751
|
loading: r.value,
|
|
755
752
|
onEdit: fe,
|
|
756
753
|
onOnMatchCode: Pe,
|
|
757
|
-
onOnMatchCodeError:
|
|
754
|
+
onOnMatchCodeError: ge,
|
|
758
755
|
onOnSendCode: t[8] || (t[8] = (o) => ae({ value: e.newEmail })),
|
|
759
756
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ae({ value: e.newEmail })),
|
|
760
757
|
onOnClearCodeError: t[10] || (t[10] = (o) => T.value = !1)
|
|
@@ -781,8 +778,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
|
|
|
781
778
|
"is-final-limit": ke.value,
|
|
782
779
|
"is-not-match-code": O.value,
|
|
783
780
|
loading: r.value,
|
|
784
|
-
onOnSendCode: t[14] || (t[14] = (o) =>
|
|
785
|
-
onOnSendCodeAgain: t[15] || (t[15] = (o) =>
|
|
781
|
+
onOnSendCode: t[14] || (t[14] = (o) => ye({ value: e.addEmail, field: "email" })),
|
|
782
|
+
onOnSendCodeAgain: t[15] || (t[15] = (o) => ye({ value: e.addEmail, field: "email" })),
|
|
786
783
|
onOnMatchCode: De,
|
|
787
784
|
onOnMatchCodeError: Ne,
|
|
788
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-xXK11ev0.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) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createElementBlock as P, openBlock as p, createElementVNode as q, defineComponent as he, reactive as ve, watch as Z, ref as L, toRefs as Ce, computed as E, createCommentVNode as $, createVNode as T, toDisplayString as H, createBlock as G, createTextVNode as Y, unref as
|
|
2
|
-
import { T as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-
|
|
1
|
+
import { createElementBlock as P, openBlock as p, createElementVNode as q, defineComponent as he, reactive as ve, watch as Z, ref as L, toRefs as Ce, computed as E, createCommentVNode as $, createVNode as T, toDisplayString as H, createBlock as G, createTextVNode as Y, unref as i, isRef as ne, withCtx as Q, onMounted as je, Fragment as qe } from "vue";
|
|
2
|
+
import { T as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-DocdeOsw.js";
|
|
3
3
|
import { IconTelegramSm as Pe, PInput as ae, IconPhoneMd as Ke, IconMailMd as ze, PButton as Fe, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
|
|
4
|
-
import { C as j, t as De, p as te, g as Ae } from "./index-
|
|
4
|
+
import { C as j, t as De, p as te, g as Ae } from "./index-xXK11ev0.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -43,35 +43,34 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
43
43
|
},
|
|
44
44
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
45
45
|
setup(R, { emit: x }) {
|
|
46
|
-
const B = R,
|
|
46
|
+
const B = R, r = x, u = ve({
|
|
47
47
|
touched: { phone: !1, code: !1 },
|
|
48
48
|
phoneModel: B.phone,
|
|
49
49
|
codeModel: B.code
|
|
50
50
|
});
|
|
51
51
|
Z(
|
|
52
52
|
() => u.phoneModel,
|
|
53
|
-
(v) =>
|
|
53
|
+
(v) => r("update:phone", v)
|
|
54
54
|
), Z(
|
|
55
55
|
() => u.codeModel,
|
|
56
|
-
(v) =>
|
|
56
|
+
(v) => r("update:code", v)
|
|
57
57
|
);
|
|
58
58
|
const h = (v) => {
|
|
59
59
|
u.touched[v] = !0;
|
|
60
60
|
};
|
|
61
61
|
let c = L("");
|
|
62
62
|
const F = (v) => {
|
|
63
|
-
i("on-clear-code-error");
|
|
64
63
|
const m = v.target;
|
|
65
|
-
let
|
|
66
|
-
r.length > 4 && (
|
|
67
|
-
}, X = () =>
|
|
68
|
-
console.debug("onSendCodeViaSms"),
|
|
64
|
+
let d = ((m == null ? void 0 : m.value) ?? "").replace(/\D/g, "");
|
|
65
|
+
d.length < 4 && r("on-clear-code-error"), d.length > 4 && (d = d.slice(0, 4)), M.value = d, m && m.value !== d && (m.value = d), d.length === 4 && d !== c.value && (c.value = d, r("on-match-code", { phone: e.value, code: d }));
|
|
66
|
+
}, X = () => r("on-send-code-again", { phone: u.phoneModel }), J = () => {
|
|
67
|
+
console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: u.phoneModel });
|
|
69
68
|
}, { phoneModel: e, codeModel: M, touched: C } = Ce(u), f = E(() => C.value.phone && !e.value.trim() ? "Введите телефон" : B.phoneError), O = E(() => B.isNotMatchCode ? "Неверный код" : C.value.code ? M.value.trim() ? B.codeError ?? null : "Введите код" : "");
|
|
70
69
|
return (v, m) => (p(), P("div", tt, [
|
|
71
70
|
q("div", ot, [
|
|
72
71
|
q("div", nt, H(v.hintText), 1),
|
|
73
72
|
q("div", at, [
|
|
74
|
-
v.isTg ? (p(), G(
|
|
73
|
+
v.isTg ? (p(), G(i(Pe), { key: 0 })) : (p(), G(i(le), {
|
|
75
74
|
key: 1,
|
|
76
75
|
style: { "margin-left": "5px" }
|
|
77
76
|
})),
|
|
@@ -79,34 +78,34 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
79
78
|
])
|
|
80
79
|
]),
|
|
81
80
|
v.showPhone ? (p(), P("div", lt, [
|
|
82
|
-
T(
|
|
83
|
-
modelValue:
|
|
84
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
81
|
+
T(i(ae), {
|
|
82
|
+
modelValue: i(e),
|
|
83
|
+
"onUpdate:modelValue": m[0] || (m[0] = (d) => ne(e) ? e.value = d : null),
|
|
85
84
|
size: "large",
|
|
86
85
|
"text-size": "medium",
|
|
87
86
|
label: "Телефон",
|
|
88
87
|
type: "tel",
|
|
89
88
|
error: f.value,
|
|
90
89
|
disabled: !0,
|
|
91
|
-
onBlur: m[1] || (m[1] = (
|
|
92
|
-
onInput: m[2] || (m[2] = (
|
|
90
|
+
onBlur: m[1] || (m[1] = (d) => h("phone")),
|
|
91
|
+
onInput: m[2] || (m[2] = (d) => h("phone"))
|
|
93
92
|
}, null, 8, ["modelValue", "error"]),
|
|
94
|
-
T(
|
|
93
|
+
T(i(Ke), {
|
|
95
94
|
class: "icon-locked",
|
|
96
|
-
onClick: m[3] || (m[3] = (
|
|
95
|
+
onClick: m[3] || (m[3] = (d) => v.$emit("edit", "phone"))
|
|
97
96
|
})
|
|
98
97
|
])) : $("", !0),
|
|
99
98
|
v.showCode ? (p(), P("div", st, [
|
|
100
|
-
T(
|
|
101
|
-
modelValue:
|
|
102
|
-
"onUpdate:modelValue": m[4] || (m[4] = (
|
|
99
|
+
T(i(ae), {
|
|
100
|
+
modelValue: i(M),
|
|
101
|
+
"onUpdate:modelValue": m[4] || (m[4] = (d) => ne(M) ? M.value = d : null),
|
|
103
102
|
size: "large",
|
|
104
103
|
"text-size": "medium",
|
|
105
104
|
label: "Код",
|
|
106
105
|
type: "text",
|
|
107
106
|
error: O.value,
|
|
108
107
|
onInput: F,
|
|
109
|
-
onBlur: m[5] || (m[5] = (
|
|
108
|
+
onBlur: m[5] || (m[5] = (d) => h("code"))
|
|
110
109
|
}, null, 8, ["modelValue", "error"])
|
|
111
110
|
])) : $("", !0),
|
|
112
111
|
T(we, {
|
|
@@ -122,7 +121,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
122
121
|
onClick: J
|
|
123
122
|
}, [
|
|
124
123
|
Y(H(v.sendCodeBySmsText) + " ", 1),
|
|
125
|
-
T(
|
|
124
|
+
T(i(le), { style: { "margin-left": "5px" } })
|
|
126
125
|
])) : $("", !0)
|
|
127
126
|
]),
|
|
128
127
|
_: 1
|
|
@@ -168,7 +167,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
168
167
|
},
|
|
169
168
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
170
169
|
setup(R, { emit: x }) {
|
|
171
|
-
const B = R,
|
|
170
|
+
const B = R, r = x, u = L(!1), h = L(""), c = ve({
|
|
172
171
|
touched: { phone: !1, code: !1 },
|
|
173
172
|
phoneModel: "",
|
|
174
173
|
codeModel: ""
|
|
@@ -176,11 +175,11 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
176
175
|
Z(
|
|
177
176
|
() => c.phoneModel,
|
|
178
177
|
(o) => {
|
|
179
|
-
|
|
178
|
+
r("update:phone", o), h.value = "";
|
|
180
179
|
}
|
|
181
180
|
), Z(
|
|
182
181
|
() => c.codeModel,
|
|
183
|
-
(o) =>
|
|
182
|
+
(o) => r("update:code", o)
|
|
184
183
|
);
|
|
185
184
|
const F = (o) => c.touched[o] = !0, X = (o) => c.touched[o] = !1, J = () => {
|
|
186
185
|
h.value = "", X("phone");
|
|
@@ -202,22 +201,21 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
202
201
|
h.value = "Такой номер уже используется";
|
|
203
202
|
return;
|
|
204
203
|
}
|
|
205
|
-
h.value = "",
|
|
204
|
+
h.value = "", r("on-send-code", { phone: c.phoneModel, prevPhone: B.oldPhone, offLoading: !0 }), u.value = !0;
|
|
206
205
|
} catch (n) {
|
|
207
206
|
console.error("Неизвестная ошибка при проверке доступности телефона:", n), h.value = "Это не похоже на номер телефона";
|
|
208
207
|
}
|
|
209
208
|
};
|
|
210
209
|
let f = L("");
|
|
211
210
|
const O = (o) => {
|
|
212
|
-
i("on-clear-code-error");
|
|
213
211
|
const n = o.target;
|
|
214
212
|
let s = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
|
|
215
|
-
s.length > 4 && (s = s.slice(0, 4)), I.value = s, n && n.value !== s && (n.value = s), s.length === 4 && s !== f.value && (f.value = s,
|
|
213
|
+
s.length < 4 && r("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), I.value = s, n && n.value !== s && (n.value = s), s.length === 4 && s !== f.value && (f.value = s, r("on-match-code", { phone: d.value, code: s }));
|
|
216
214
|
}, v = () => {
|
|
217
|
-
|
|
215
|
+
r("on-send-code-again", { phone: c.phoneModel });
|
|
218
216
|
}, m = () => {
|
|
219
|
-
console.debug("onSendCodeViaSms"),
|
|
220
|
-
}, { phoneModel:
|
|
217
|
+
console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: c.phoneModel });
|
|
218
|
+
}, { phoneModel: d, codeModel: I, touched: se } = Ce(c), W = E(() => {
|
|
221
219
|
if (h.value) return h.value;
|
|
222
220
|
if (c.touched.phone) {
|
|
223
221
|
if (!c.phoneModel.trim()) return "Введите номер телефона";
|
|
@@ -229,7 +227,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
229
227
|
q("div", rt, [
|
|
230
228
|
q("div", ut, H(u.value ? "Чтобы продолжить, введите код подтверждения из" : o.hintText), 1),
|
|
231
229
|
u.value ? (p(), P("div", ct, [
|
|
232
|
-
o.isTg ? (p(), G(
|
|
230
|
+
o.isTg ? (p(), G(i(Pe), { key: 0 })) : (p(), G(i(le), {
|
|
233
231
|
key: 1,
|
|
234
232
|
style: { "margin-left": "5px" }
|
|
235
233
|
})),
|
|
@@ -237,9 +235,9 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
237
235
|
])) : $("", !0)
|
|
238
236
|
]),
|
|
239
237
|
o.showPhone ? (p(), P("div", pt, [
|
|
240
|
-
T(
|
|
241
|
-
modelValue: d
|
|
242
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) => ne(
|
|
238
|
+
T(i(ae), {
|
|
239
|
+
modelValue: i(d),
|
|
240
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => ne(d) ? d.value = s : null),
|
|
243
241
|
size: "large",
|
|
244
242
|
"text-size": "medium",
|
|
245
243
|
label: "Телефон",
|
|
@@ -248,13 +246,13 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
248
246
|
onBlur: n[1] || (n[1] = (s) => F("phone")),
|
|
249
247
|
onInput: J
|
|
250
248
|
}, null, 8, ["modelValue", "error"]),
|
|
251
|
-
T(
|
|
249
|
+
T(i(ze), {
|
|
252
250
|
class: "icon-locked",
|
|
253
251
|
onClick: n[2] || (n[2] = (s) => o.$emit("edit", "phone"))
|
|
254
252
|
})
|
|
255
253
|
])) : $("", !0),
|
|
256
254
|
u.value ? $("", !0) : (p(), P("div", ht, [
|
|
257
|
-
T(
|
|
255
|
+
T(i(Fe), {
|
|
258
256
|
style: { width: "100%" },
|
|
259
257
|
disabled: M.value,
|
|
260
258
|
onClick: C
|
|
@@ -267,8 +265,8 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
267
265
|
}, 8, ["disabled"])
|
|
268
266
|
])),
|
|
269
267
|
u.value ? (p(), P("div", vt, [
|
|
270
|
-
T(
|
|
271
|
-
modelValue:
|
|
268
|
+
T(i(ae), {
|
|
269
|
+
modelValue: i(I),
|
|
272
270
|
"onUpdate:modelValue": n[3] || (n[3] = (s) => ne(I) ? I.value = s : null),
|
|
273
271
|
size: "large",
|
|
274
272
|
"text-size": "medium",
|
|
@@ -293,7 +291,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
293
291
|
onClick: m
|
|
294
292
|
}, [
|
|
295
293
|
Y(H(o.sendCodeBySmsText) + " ", 1),
|
|
296
|
-
T(
|
|
294
|
+
T(i(le), { style: { "margin-left": "5px" } })
|
|
297
295
|
])) : $("", !0)
|
|
298
296
|
]),
|
|
299
297
|
_: 1
|
|
@@ -331,7 +329,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
331
329
|
},
|
|
332
330
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
333
331
|
setup(R, { emit: x }) {
|
|
334
|
-
const B = R,
|
|
332
|
+
const B = R, r = x, u = L(!1), h = L(""), c = ve({
|
|
335
333
|
touched: { phone: !1, code: !1 },
|
|
336
334
|
phoneModel: "",
|
|
337
335
|
codeModel: ""
|
|
@@ -339,11 +337,11 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
339
337
|
Z(
|
|
340
338
|
() => c.phoneModel,
|
|
341
339
|
(o) => {
|
|
342
|
-
|
|
340
|
+
r("update:phone", o), h.value = "";
|
|
343
341
|
}
|
|
344
342
|
), Z(
|
|
345
343
|
() => c.codeModel,
|
|
346
|
-
(o) =>
|
|
344
|
+
(o) => r("update:code", o)
|
|
347
345
|
);
|
|
348
346
|
const F = (o) => c.touched[o] = !0, X = (o) => c.touched[o] = !1, J = () => {
|
|
349
347
|
h.value = "", X("phone");
|
|
@@ -362,22 +360,21 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
362
360
|
h.value = "Такой номер уже используется";
|
|
363
361
|
return;
|
|
364
362
|
}
|
|
365
|
-
h.value = "",
|
|
363
|
+
h.value = "", r("on-send-code", { phone: c.phoneModel, prevPhone: B.oldPhone, offLoading: !0 }), u.value = !0;
|
|
366
364
|
} catch (n) {
|
|
367
365
|
console.error("Неизвестная ошибка при проверке доступности телефона:", n), h.value = "Это не похоже на номер телефона";
|
|
368
366
|
}
|
|
369
367
|
};
|
|
370
368
|
let f = "";
|
|
371
369
|
const O = (o) => {
|
|
372
|
-
i("on-clear-code-error");
|
|
373
370
|
const n = o.target;
|
|
374
371
|
let s = n.value.replace(/\D/g, "");
|
|
375
|
-
s.length > 4 && (s = s.slice(0, 4), n.value = s), c.codeModel = s, s.length === 4 && s !== f && (f = s,
|
|
372
|
+
s.length < 4 && r("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), n.value = s), c.codeModel = s, s.length === 4 && s !== f && (f = s, r("on-match-code", { phone: c.phoneModel, code: s }));
|
|
376
373
|
}, v = () => {
|
|
377
|
-
|
|
374
|
+
r("on-send-code-again", { phone: c.phoneModel });
|
|
378
375
|
}, m = () => {
|
|
379
|
-
console.debug("onSendCodeViaSms"),
|
|
380
|
-
}, { phoneModel:
|
|
376
|
+
console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: c.phoneModel });
|
|
377
|
+
}, { phoneModel: d, codeModel: I, touched: se } = Ce(c), W = E(() => {
|
|
381
378
|
if (h.value) return h.value;
|
|
382
379
|
if (c.touched.phone) {
|
|
383
380
|
if (!c.phoneModel.trim()) return "Введите номер телефона";
|
|
@@ -389,7 +386,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
389
386
|
q("div", yt, [
|
|
390
387
|
q("div", Ct, H(u.value ? "Чтобы продолжить, введите код подтверждения из" : o.hintText), 1),
|
|
391
388
|
u.value ? (p(), P("div", wt, [
|
|
392
|
-
o.isTg ? (p(), G(
|
|
389
|
+
o.isTg ? (p(), G(i(Pe), { key: 0 })) : (p(), G(i(le), {
|
|
393
390
|
key: 1,
|
|
394
391
|
style: { "margin-left": "5px" }
|
|
395
392
|
})),
|
|
@@ -397,9 +394,9 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
397
394
|
])) : $("", !0)
|
|
398
395
|
]),
|
|
399
396
|
o.showPhone ? (p(), P("div", Pt, [
|
|
400
|
-
T(
|
|
401
|
-
modelValue: d
|
|
402
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) => ne(
|
|
397
|
+
T(i(ae), {
|
|
398
|
+
modelValue: i(d),
|
|
399
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => ne(d) ? d.value = s : null),
|
|
403
400
|
size: "large",
|
|
404
401
|
"text-size": "medium",
|
|
405
402
|
label: "Телефон",
|
|
@@ -408,13 +405,13 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
408
405
|
onBlur: n[1] || (n[1] = (s) => F("phone")),
|
|
409
406
|
onInput: J
|
|
410
407
|
}, null, 8, ["modelValue", "error"]),
|
|
411
|
-
T(
|
|
408
|
+
T(i(ze), {
|
|
412
409
|
class: "icon-locked",
|
|
413
410
|
onClick: n[2] || (n[2] = (s) => o.$emit("edit", "phone"))
|
|
414
411
|
})
|
|
415
412
|
])) : $("", !0),
|
|
416
413
|
u.value ? $("", !0) : (p(), P("div", Tt, [
|
|
417
|
-
T(
|
|
414
|
+
T(i(Fe), {
|
|
418
415
|
style: { width: "100%" },
|
|
419
416
|
disabled: M.value,
|
|
420
417
|
onClick: C
|
|
@@ -427,8 +424,8 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
427
424
|
}, 8, ["disabled"])
|
|
428
425
|
])),
|
|
429
426
|
u.value ? (p(), P("div", St, [
|
|
430
|
-
T(
|
|
431
|
-
modelValue:
|
|
427
|
+
T(i(ae), {
|
|
428
|
+
modelValue: i(I),
|
|
432
429
|
"onUpdate:modelValue": n[3] || (n[3] = (s) => ne(I) ? I.value = s : null),
|
|
433
430
|
size: "large",
|
|
434
431
|
"text-size": "medium",
|
|
@@ -453,7 +450,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
453
450
|
onClick: m
|
|
454
451
|
}, [
|
|
455
452
|
Y(H(o.sendCodeBySmsText) + " ", 1),
|
|
456
|
-
T(
|
|
453
|
+
T(i(le), { style: { "margin-left": "5px" } })
|
|
457
454
|
])) : $("", !0)
|
|
458
455
|
]),
|
|
459
456
|
_: 1
|
|
@@ -480,18 +477,18 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
480
477
|
},
|
|
481
478
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
482
479
|
setup(R, { expose: x, emit: B }) {
|
|
483
|
-
const
|
|
480
|
+
const r = R, u = B, h = L(r.modelValue);
|
|
484
481
|
Z(
|
|
485
|
-
() =>
|
|
482
|
+
() => r.modelValue,
|
|
486
483
|
(a) => h.value = a
|
|
487
484
|
), Z(h, (a) => u("update:modelValue", a));
|
|
488
|
-
const c = E(() =>
|
|
489
|
-
oldPhone:
|
|
485
|
+
const c = E(() => r.language ?? "ru"), F = (a) => De[c.value] && De[c.value][a] || (r.title ?? a), X = E(() => r.title ?? F("Смена номера телефона")), J = E(() => r.hintText ?? F("Чтобы продолжить, введите новый номер")), e = ve({
|
|
486
|
+
oldPhone: r.initialPhone ?? "",
|
|
490
487
|
newPhone: "",
|
|
491
488
|
code: "",
|
|
492
489
|
addPhone: "",
|
|
493
490
|
addCode: ""
|
|
494
|
-
}), M = L(j.OLD), C = L(null), f = L(!1), O = L(!1), v = L("tg"), m = E(() => v.value === "tg"),
|
|
491
|
+
}), M = L(j.OLD), C = L(null), f = L(!1), O = L(!1), v = L("tg"), m = E(() => v.value === "tg"), d = L(!1), { startTimer: I, remainingSeconds: se, isAvailableForSendAgain: W, totalRateAttempts: _, currentRateAttempt: o } = He(), { showRateLimitToast: n } = Je(u), { isEditFlow: s, getFlow: me } = Ge(L(r.mode)), de = E(() => W.value ? "Повторить" : `${se.value}`), ie = L(pe), re = E(() => ie.value === 0), Ue = (a) => new Promise((l) => setTimeout(l, a));
|
|
495
492
|
async function fe(a = "email") {
|
|
496
493
|
var t;
|
|
497
494
|
return (t = (await Ae("/users/profile/session/get-edit-session", { params: { field: a } })).data) == null ? void 0 : t.data;
|
|
@@ -500,16 +497,16 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
500
497
|
var b;
|
|
501
498
|
const t = (b = (await te("/users/profile/session/create-if-not-exists", {
|
|
502
499
|
field: a,
|
|
503
|
-
oldValue: U(
|
|
500
|
+
oldValue: U(r.initialPhone)
|
|
504
501
|
})).data) == null ? void 0 : b.data;
|
|
505
|
-
C.value = (t == null ? void 0 : t.sessionId) ?? null, M.value = (t == null ? void 0 : t.step) ?? j.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
|
|
502
|
+
return C.value = (t == null ? void 0 : t.sessionId) ?? null, M.value = (t == null ? void 0 : t.step) ?? j.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "", t;
|
|
506
503
|
}
|
|
507
504
|
async function Re() {
|
|
508
505
|
try {
|
|
509
506
|
const a = await fe("phone");
|
|
510
|
-
C.value = a.sessionId, M.value = a.step, e.oldPhone = a.oldValue ?? "", a.sessionId
|
|
507
|
+
return C.value = a.sessionId, M.value = a.step, e.oldPhone = a.oldValue ?? "", a.sessionId ? a : await Te("phone");
|
|
511
508
|
} catch {
|
|
512
|
-
await Te("phone");
|
|
509
|
+
return await Te("phone");
|
|
513
510
|
}
|
|
514
511
|
}
|
|
515
512
|
async function Se(a, l = !1) {
|
|
@@ -524,7 +521,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
524
521
|
},
|
|
525
522
|
{
|
|
526
523
|
headers: {
|
|
527
|
-
"x-only-sms":
|
|
524
|
+
"x-only-sms": d.value ?? !1
|
|
528
525
|
}
|
|
529
526
|
}
|
|
530
527
|
);
|
|
@@ -535,7 +532,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
535
532
|
return null;
|
|
536
533
|
}
|
|
537
534
|
}
|
|
538
|
-
const ge = async ({ phone: a }) => (
|
|
535
|
+
const ge = async ({ phone: a }) => (d.value = !0, await ee({ value: a, isOnlySms: !0 })), ee = async ({ value: a, isOnlySms: l, offLoading: t } = {}) => {
|
|
539
536
|
var b, w, D, A, N;
|
|
540
537
|
f.value = !0;
|
|
541
538
|
try {
|
|
@@ -546,7 +543,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
546
543
|
phone: U(k),
|
|
547
544
|
value: U(k),
|
|
548
545
|
oldValue: U(e.oldPhone),
|
|
549
|
-
provider:
|
|
546
|
+
provider: r.provider,
|
|
550
547
|
isOnlySms: l ?? !1
|
|
551
548
|
},
|
|
552
549
|
{
|
|
@@ -557,7 +554,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
557
554
|
);
|
|
558
555
|
console.debug("response sendContactCode: ", g);
|
|
559
556
|
const S = (w = (b = g == null ? void 0 : g.data) == null ? void 0 : b.data) == null ? void 0 : w.deliveryType;
|
|
560
|
-
if ((S === "tg" || S === "sms") && (v.value = S, S === "tg" && (
|
|
557
|
+
if ((S === "tg" || S === "sms") && (v.value = S, S === "tg" && (d.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", g), (g == null ? void 0 : g.status) === 403 && ((D = g.data) != null && D.tooManyRequests)) {
|
|
561
558
|
console.debug("sendContactCode IN обработка 403 tooManyRequests", g);
|
|
562
559
|
const K = (N = (A = g.data) == null ? void 0 : A.tooManyRequests) == null ? void 0 : N.type;
|
|
563
560
|
v.value = K;
|
|
@@ -659,7 +656,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
659
656
|
{
|
|
660
657
|
sessionId: C.value,
|
|
661
658
|
phone: U(N),
|
|
662
|
-
provider:
|
|
659
|
+
provider: r.provider,
|
|
663
660
|
isOnlySms: t ?? !1
|
|
664
661
|
},
|
|
665
662
|
{
|
|
@@ -668,7 +665,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
668
665
|
}
|
|
669
666
|
}
|
|
670
667
|
), g = (D = (w = k == null ? void 0 : k.data) == null ? void 0 : w.data) == null ? void 0 : D.deliveryType;
|
|
671
|
-
(g === "tg" || g === "sms") && (v.value = g, g === "tg" && (
|
|
668
|
+
(g === "tg" || g === "sms") && (v.value = g, g === "tg" && (d.value = !1));
|
|
672
669
|
const S = (A = k.data) == null ? void 0 : A.tooManyRequests;
|
|
673
670
|
if (k.status === 403 && S) {
|
|
674
671
|
const K = S == null ? void 0 : S.type;
|
|
@@ -712,11 +709,11 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
712
709
|
return je(async () => {
|
|
713
710
|
f.value = !0;
|
|
714
711
|
const a = await me("phone");
|
|
715
|
-
if (
|
|
712
|
+
if (r.mode === "bind" && a === "bind") {
|
|
716
713
|
await We(), f.value = !1;
|
|
717
714
|
return;
|
|
718
715
|
}
|
|
719
|
-
await Re()
|
|
716
|
+
(await Re()).step === "old" && await ee({}), f.value = !1;
|
|
720
717
|
}), x({
|
|
721
718
|
localVisible: h,
|
|
722
719
|
form: e,
|
|
@@ -736,7 +733,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
736
733
|
matchBindCode: Ee,
|
|
737
734
|
matchBindCodeError: Ie
|
|
738
735
|
}), (a, l) => (p(), P(qe, null, [
|
|
739
|
-
T(
|
|
736
|
+
T(i(Qe), {
|
|
740
737
|
modelValue: h.value,
|
|
741
738
|
"onUpdate:modelValue": [
|
|
742
739
|
l[15] || (l[15] = (t) => h.value = t),
|
|
@@ -749,17 +746,17 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
749
746
|
}, {
|
|
750
747
|
header: Q(() => [
|
|
751
748
|
q("div", bt, [
|
|
752
|
-
T(
|
|
749
|
+
T(i(Xe), {
|
|
753
750
|
"slot-left": !1,
|
|
754
751
|
size: "small",
|
|
755
752
|
borded: !0,
|
|
756
753
|
"no-padding": !1
|
|
757
754
|
}, {
|
|
758
755
|
title: Q(() => [
|
|
759
|
-
q("span", kt, H(
|
|
756
|
+
q("span", kt, H(i(s) ? X.value : "Добавление номера телефона"), 1)
|
|
760
757
|
]),
|
|
761
758
|
"right-button": Q(() => [
|
|
762
|
-
T(
|
|
759
|
+
T(i(Ye), {
|
|
763
760
|
class: "cross",
|
|
764
761
|
onClick: ue
|
|
765
762
|
})
|
|
@@ -769,9 +766,9 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
769
766
|
])
|
|
770
767
|
]),
|
|
771
768
|
default: Q(() => [
|
|
772
|
-
|
|
769
|
+
i(s) ? (p(), P("div", Vt, [
|
|
773
770
|
f.value ? (p(), G(Oe, { key: 0 })) : $("", !0),
|
|
774
|
-
M.value ===
|
|
771
|
+
M.value === i(j).OLD ? (p(), G(dt, {
|
|
775
772
|
key: 1,
|
|
776
773
|
phone: e.oldPhone,
|
|
777
774
|
"onUpdate:phone": l[0] || (l[0] = (t) => e.oldPhone = t),
|
|
@@ -783,11 +780,11 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
783
780
|
loading: f.value,
|
|
784
781
|
"is-tg": m.value,
|
|
785
782
|
onOnSendCode: l[2] || (l[2] = (t) => ee({ value: e.oldPhone })),
|
|
786
|
-
onOnSendCodeAgain: l[3] || (l[3] = (t) => ee({ value: e.oldPhone, isOnlySms: !m.value &&
|
|
783
|
+
onOnSendCodeAgain: l[3] || (l[3] = (t) => ee({ value: e.oldPhone, isOnlySms: !m.value && d.value })),
|
|
787
784
|
onOnSendOnlySms: ge,
|
|
788
785
|
onOnMatchCode: xe,
|
|
789
786
|
onOnMatchCodeError: be
|
|
790
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value ===
|
|
787
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === i(j).NEW ? (p(), G(ft, {
|
|
791
788
|
key: 2,
|
|
792
789
|
phone: e.newPhone,
|
|
793
790
|
"onUpdate:phone": l[4] || (l[4] = (t) => e.newPhone = t),
|
|
@@ -802,12 +799,12 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
802
799
|
loading: f.value,
|
|
803
800
|
"is-tg": m.value,
|
|
804
801
|
onOnSendCode: l[7] || (l[7] = (t) => ee({ value: e.newPhone })),
|
|
805
|
-
onOnSendCodeAgain: l[8] || (l[8] = (t) => ee({ value: e.newPhone, isOnlySms: !m.value &&
|
|
802
|
+
onOnSendCodeAgain: l[8] || (l[8] = (t) => ee({ value: e.newPhone, isOnlySms: !m.value && d.value })),
|
|
806
803
|
onOnSendOnlySms: ge,
|
|
807
804
|
onOnMatchCode: ke,
|
|
808
805
|
onOnMatchCodeError: Ve,
|
|
809
806
|
onOnClearCodeError: l[9] || (l[9] = (t) => O.value = !1)
|
|
810
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value ===
|
|
807
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === i(j).COMPLETED ? (p(), P("div", $t, [
|
|
811
808
|
q("p", null, H(F("Телефон успешно изменен")), 1)
|
|
812
809
|
])) : $("", !0)
|
|
813
810
|
])) : (p(), P("div", Bt, [
|
|
@@ -819,14 +816,14 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
819
816
|
"onUpdate:oldPhone": l[11] || (l[11] = (t) => e.oldPhone = t),
|
|
820
817
|
code: e.addCode,
|
|
821
818
|
"onUpdate:code": l[12] || (l[12] = (t) => e.addCode = t),
|
|
822
|
-
"hint-text":
|
|
819
|
+
"hint-text": i(s) ? J.value : "Чтобы продолжить, введите новый номер",
|
|
823
820
|
"rate-limit-text": de.value,
|
|
824
821
|
"is-final-limit": re.value,
|
|
825
822
|
"is-not-match-code": O.value,
|
|
826
823
|
loading: f.value,
|
|
827
824
|
"is-tg": m.value,
|
|
828
825
|
onOnSendCode: l[13] || (l[13] = (t) => ye({ value: e.addPhone, field: "phone" })),
|
|
829
|
-
onOnSendCodeAgain: l[14] || (l[14] = (t) => ye({ value: e.addPhone, field: "phone", isOnlySms: !m.value &&
|
|
826
|
+
onOnSendCodeAgain: l[14] || (l[14] = (t) => ye({ value: e.addPhone, field: "phone", isOnlySms: !m.value && d.value })),
|
|
830
827
|
onOnSendOnlySms: ge,
|
|
831
828
|
onOnMatchCode: Ee,
|
|
832
829
|
onOnMatchCodeError: Ie
|
|
@@ -835,7 +832,7 @@ const le = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
835
832
|
]),
|
|
836
833
|
_: 1
|
|
837
834
|
}, 8, ["modelValue"]),
|
|
838
|
-
T(
|
|
835
|
+
T(i(Ze))
|
|
839
836
|
], 64));
|
|
840
837
|
}
|
|
841
838
|
});
|
|
@@ -216,9 +216,9 @@ const ra = {
|
|
|
216
216
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
217
217
|
setup(s, { emit: n }) {
|
|
218
218
|
const r = n, u = h(!0), { currentDialog: v, dialogPayload: p, closeDialog: U } = X(), l = {
|
|
219
|
-
email: q(() => import("./ProfileEmailDialog-
|
|
220
|
-
phone: q(() => import("./ProfilePhoneDialog-
|
|
221
|
-
password: q(() => import("./ProfilePasswordDialog-
|
|
219
|
+
email: q(() => import("./ProfileEmailDialog-D7meJIOd.js")),
|
|
220
|
+
phone: q(() => import("./ProfilePhoneDialog-DUxLeNPV.js")),
|
|
221
|
+
password: q(() => import("./ProfilePasswordDialog-DmvyrGhz.js"))
|
|
222
222
|
}, i = ({ email: y }) => {
|
|
223
223
|
r("update-email-field", y);
|
|
224
224
|
}, c = ({ phone: y }) => {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-965c8738] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-965c8738] .p-input-file:hover .overlay{visibility:visible}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { a as o } from "./index-
|
|
2
|
+
import { a as o } from "./index-xXK11ev0.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as d, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
|
|
2
2
|
import { PLoader as w } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as g, g as R, p as h } from "./index-
|
|
3
|
+
import { _ as g, g as R, p as h } from "./index-xXK11ev0.js";
|
|
4
4
|
function C(e) {
|
|
5
5
|
const t = Math.floor(e / 60), a = e % 60;
|
|
6
6
|
return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|