@yourgoods/ui-smart 0.49.0 → 0.50.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-sZkCbkOn.js → ProfileEmailDialog-rzPRsM0B.js} +2 -2
- package/dist/{ProfilePasswordDialog-LdM_8zVG.js → ProfilePasswordDialog-FRHBCNZO.js} +1 -1
- package/dist/{ProfilePhoneDialog-BF5sey9V.js → ProfilePhoneDialog-DyDCK0A6.js} +269 -267
- package/dist/{index-3V186vCD.js → index-B03tgxbV.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-_WymxlzB.js → useRateLimitToast-BDwiUmEF.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
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-
|
|
3
|
-
import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-
|
|
2
|
+
import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-BDwiUmEF.js";
|
|
3
|
+
import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-B03tgxbV.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,
|
|
@@ -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-B03tgxbV.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
|
|
2
|
-
import { T as we, c as Ae, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-
|
|
3
|
-
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Ke, IconMailMd as Ne, PButton as
|
|
4
|
-
import { C as j, t as De, p as te, g as Re } from "./index-
|
|
1
|
+
import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as L, createCommentVNode as B, createVNode as x, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
|
|
2
|
+
import { T as we, c as Ae, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-BDwiUmEF.js";
|
|
3
|
+
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Ke, IconMailMd as Ne, PButton as ze, 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 Re } from "./index-B03tgxbV.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -9,7 +9,7 @@ const _e = {
|
|
|
9
9
|
fill: "none"
|
|
10
10
|
};
|
|
11
11
|
function et(U, V) {
|
|
12
|
-
return
|
|
12
|
+
return v(), S("svg", _e, V[0] || (V[0] = [
|
|
13
13
|
H("path", {
|
|
14
14
|
fill: "#1C7EF1",
|
|
15
15
|
"fill-rule": "evenodd",
|
|
@@ -43,85 +43,85 @@ const de = { 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(U, { emit: V }) {
|
|
46
|
-
const E = U,
|
|
46
|
+
const E = U, u = V, p = ve({
|
|
47
47
|
touched: { phone: !1, code: !1 },
|
|
48
48
|
phoneModel: E.phone,
|
|
49
49
|
codeModel: E.code
|
|
50
50
|
});
|
|
51
51
|
_(
|
|
52
|
-
() =>
|
|
53
|
-
(
|
|
52
|
+
() => p.phoneModel,
|
|
53
|
+
(m) => u("update:phone", m)
|
|
54
54
|
), _(
|
|
55
|
-
() =>
|
|
56
|
-
(
|
|
55
|
+
() => p.codeModel,
|
|
56
|
+
(m) => u("update:code", m)
|
|
57
57
|
);
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const y = (m) => {
|
|
59
|
+
p.touched[m] = !0;
|
|
60
60
|
};
|
|
61
|
-
let
|
|
62
|
-
const z = (
|
|
63
|
-
const
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
}, Y = () =>
|
|
67
|
-
console.debug("onSendCodeViaSms"),
|
|
68
|
-
}, { phoneModel: e, codeModel: k, touched:
|
|
69
|
-
return (
|
|
61
|
+
let h = O("");
|
|
62
|
+
const z = (m) => {
|
|
63
|
+
const g = m.target;
|
|
64
|
+
let i = ((g == null ? void 0 : g.value) ?? "").replace(/\D/g, "");
|
|
65
|
+
i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), k.value = i, g && g.value !== i && (g.value = i), i.length === 4 && i !== h.value && (h.value = i, u("on-match-code", { phone: e.value, code: i }));
|
|
66
|
+
}, Y = () => u("on-send-code-again", { phone: p.phoneModel }), K = () => {
|
|
67
|
+
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: p.phoneModel });
|
|
68
|
+
}, { phoneModel: e, codeModel: k, touched: P } = Ce(p), C = L(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), D = L(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? k.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
69
|
+
return (m, g) => (v(), S("div", tt, [
|
|
70
70
|
H("div", ot, [
|
|
71
|
-
H("div", nt, G(
|
|
71
|
+
H("div", nt, G(m.hintText), 1),
|
|
72
72
|
H("div", at, [
|
|
73
|
-
|
|
73
|
+
m.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
74
74
|
key: 1,
|
|
75
75
|
style: { "margin-left": "5px" }
|
|
76
76
|
})),
|
|
77
|
-
Z(" " + G(
|
|
77
|
+
Z(" " + G(m.isTg ? "Telegram" : "СМС"), 1)
|
|
78
78
|
])
|
|
79
79
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
modelValue:
|
|
83
|
-
"onUpdate:modelValue":
|
|
80
|
+
m.showPhone ? (v(), S("div", lt, [
|
|
81
|
+
x(r(se), {
|
|
82
|
+
modelValue: r(e),
|
|
83
|
+
"onUpdate:modelValue": g[0] || (g[0] = (i) => le(e) ? e.value = i : null),
|
|
84
84
|
size: "large",
|
|
85
85
|
"text-size": "medium",
|
|
86
86
|
label: "Телефон",
|
|
87
87
|
type: "tel",
|
|
88
|
-
error:
|
|
88
|
+
error: C.value,
|
|
89
89
|
disabled: !0,
|
|
90
|
-
onBlur:
|
|
91
|
-
onInput:
|
|
90
|
+
onBlur: g[1] || (g[1] = (i) => y("phone")),
|
|
91
|
+
onInput: g[2] || (g[2] = (i) => y("phone"))
|
|
92
92
|
}, null, 8, ["modelValue", "error"]),
|
|
93
|
-
|
|
93
|
+
x(r(Ke), {
|
|
94
94
|
class: "icon-locked",
|
|
95
|
-
onClick:
|
|
95
|
+
onClick: g[3] || (g[3] = (i) => m.$emit("edit", "phone"))
|
|
96
96
|
})
|
|
97
97
|
])) : B("", !0),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
modelValue:
|
|
101
|
-
"onUpdate:modelValue":
|
|
98
|
+
m.showCode ? (v(), S("div", st, [
|
|
99
|
+
x(r(se), {
|
|
100
|
+
modelValue: r(k),
|
|
101
|
+
"onUpdate:modelValue": g[4] || (g[4] = (i) => le(k) ? k.value = i : null),
|
|
102
102
|
size: "large",
|
|
103
103
|
"text-size": "medium",
|
|
104
104
|
label: "Код",
|
|
105
105
|
type: "text",
|
|
106
106
|
error: D.value,
|
|
107
107
|
onInput: z,
|
|
108
|
-
onBlur:
|
|
108
|
+
onBlur: g[5] || (g[5] = (i) => y("code"))
|
|
109
109
|
}, null, 8, ["modelValue", "error"])
|
|
110
110
|
])) : B("", !0),
|
|
111
|
-
|
|
112
|
-
loading:
|
|
113
|
-
"rate-limit-text":
|
|
114
|
-
"is-final-limit":
|
|
111
|
+
x(we, {
|
|
112
|
+
loading: m.loading,
|
|
113
|
+
"rate-limit-text": m.rateLimitText,
|
|
114
|
+
"is-final-limit": m.isFinalLimit,
|
|
115
115
|
"on-send-again": Y
|
|
116
116
|
}, {
|
|
117
117
|
extra: X(() => [
|
|
118
|
-
|
|
118
|
+
m.isTg ? (v(), S("span", {
|
|
119
119
|
key: 0,
|
|
120
120
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
121
121
|
onClick: K
|
|
122
122
|
}, [
|
|
123
|
-
Z(G(
|
|
124
|
-
|
|
123
|
+
Z(G(m.sendCodeBySmsText) + " ", 1),
|
|
124
|
+
x(r(de), { style: { "margin-left": "5px" } })
|
|
125
125
|
])) : B("", !0)
|
|
126
126
|
]),
|
|
127
127
|
_: 1
|
|
@@ -167,77 +167,77 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
167
167
|
},
|
|
168
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"],
|
|
169
169
|
setup(U, { emit: V }) {
|
|
170
|
-
const E = U,
|
|
170
|
+
const E = U, u = V, p = O(!1), y = O(""), h = ve({
|
|
171
171
|
touched: { phone: !1, code: !1 },
|
|
172
172
|
phoneModel: "",
|
|
173
173
|
codeModel: ""
|
|
174
174
|
});
|
|
175
175
|
_(
|
|
176
|
-
() =>
|
|
176
|
+
() => h.phoneModel,
|
|
177
177
|
(t) => {
|
|
178
|
-
|
|
178
|
+
u("update:phone", t), y.value = "";
|
|
179
179
|
}
|
|
180
180
|
), _(
|
|
181
|
-
() =>
|
|
182
|
-
(t) =>
|
|
181
|
+
() => h.codeModel,
|
|
182
|
+
(t) => u("update:code", t)
|
|
183
183
|
);
|
|
184
|
-
const z = (t) =>
|
|
185
|
-
|
|
184
|
+
const z = (t) => h.touched[t] = !0, Y = (t) => h.touched[t] = !1, K = () => {
|
|
185
|
+
y.value = "", Y("phone");
|
|
186
186
|
}, e = L(() => {
|
|
187
|
-
const n =
|
|
187
|
+
const n = h.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
188
188
|
return /^\+?\d{10,15}$/.test(n);
|
|
189
|
-
}), k = L(() => !e.value || !!
|
|
189
|
+
}), k = L(() => !e.value || !!y.value), P = async () => {
|
|
190
190
|
var t;
|
|
191
191
|
try {
|
|
192
192
|
if (z("phone"), !e.value) {
|
|
193
|
-
|
|
193
|
+
y.value = "Это не похоже на номер телефона";
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
const n = await Ae(void 0, F(
|
|
196
|
+
const n = await Ae(void 0, F(h.phoneModel)), { data: s } = n.data;
|
|
197
197
|
if (console.debug("result for checkAvailability: ", {
|
|
198
198
|
res: n,
|
|
199
199
|
data: s
|
|
200
200
|
}), !(((t = s.data[0]) == null ? void 0 : t.available) ?? !1)) {
|
|
201
|
-
|
|
201
|
+
y.value = "Такой номер уже используется";
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
y.value = "", u("on-send-code", { phone: h.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), p.value = !0;
|
|
205
205
|
} catch (n) {
|
|
206
|
-
console.error("Неизвестная ошибка при проверке доступности телефона:", n),
|
|
206
|
+
console.error("Неизвестная ошибка при проверке доступности телефона:", n), y.value = "Это не похоже на номер телефона";
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
|
-
let
|
|
209
|
+
let C = O("");
|
|
210
210
|
const D = (t) => {
|
|
211
211
|
const n = t.target;
|
|
212
212
|
let s = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
|
|
213
|
-
s.length < 4 &&
|
|
214
|
-
}, h = () => {
|
|
215
|
-
r("on-send-code-again", { phone: c.phoneModel });
|
|
213
|
+
s.length < 4 && u("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 !== C.value && (C.value = s, u("on-match-code", { phone: i.value, code: s }));
|
|
216
214
|
}, m = () => {
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
u("on-send-code-again", { phone: h.phoneModel });
|
|
216
|
+
}, g = () => {
|
|
217
|
+
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: h.phoneModel });
|
|
218
|
+
}, { phoneModel: i, codeModel: I, touched: ie } = Ce(h), R = L(() => {
|
|
219
|
+
if (y.value) return y.value;
|
|
220
|
+
if (h.touched.phone) {
|
|
221
|
+
if (!h.phoneModel.trim()) return "Введите номер телефона";
|
|
222
222
|
if (!e.value) return "Это не похоже на номер телефона";
|
|
223
223
|
}
|
|
224
224
|
return E.phoneError || "";
|
|
225
225
|
}), Q = L(() => E.isNotMatchCode ? "Неверный код" : ie.value.code ? I.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
226
|
-
return (t, n) => (
|
|
226
|
+
return (t, n) => (v(), S("div", it, [
|
|
227
227
|
H("div", rt, [
|
|
228
|
-
H("div", ut, G(
|
|
229
|
-
|
|
230
|
-
t.isTg ? (
|
|
228
|
+
H("div", ut, G(p.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
229
|
+
p.value ? (v(), S("div", ct, [
|
|
230
|
+
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
231
231
|
key: 1,
|
|
232
232
|
style: { "margin-left": "5px" }
|
|
233
233
|
})),
|
|
234
234
|
Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
|
|
235
235
|
])) : B("", !0)
|
|
236
236
|
]),
|
|
237
|
-
t.showPhone ? (
|
|
238
|
-
|
|
239
|
-
modelValue: i
|
|
240
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) => le(
|
|
237
|
+
t.showPhone ? (v(), S("div", pt, [
|
|
238
|
+
x(r(se), {
|
|
239
|
+
modelValue: r(i),
|
|
240
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => le(i) ? i.value = s : null),
|
|
241
241
|
size: "large",
|
|
242
242
|
"text-size": "medium",
|
|
243
243
|
label: "Телефон",
|
|
@@ -246,16 +246,16 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
246
246
|
onBlur: n[1] || (n[1] = (s) => z("phone")),
|
|
247
247
|
onInput: K
|
|
248
248
|
}, null, 8, ["modelValue", "error"]),
|
|
249
|
-
|
|
249
|
+
x(r(Ne), {
|
|
250
250
|
class: "icon-locked",
|
|
251
251
|
onClick: n[2] || (n[2] = (s) => t.$emit("edit", "phone"))
|
|
252
252
|
})
|
|
253
253
|
])) : B("", !0),
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
p.value ? B("", !0) : (v(), S("div", ht, [
|
|
255
|
+
x(r(ze), {
|
|
256
256
|
style: { width: "100%" },
|
|
257
257
|
disabled: k.value,
|
|
258
|
-
onClick:
|
|
258
|
+
onClick: P
|
|
259
259
|
}, {
|
|
260
260
|
default: X(() => n[5] || (n[5] = [
|
|
261
261
|
Z(" Отправить код ")
|
|
@@ -264,9 +264,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
264
264
|
__: [5]
|
|
265
265
|
}, 8, ["disabled"])
|
|
266
266
|
])),
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
modelValue:
|
|
267
|
+
p.value ? (v(), S("div", vt, [
|
|
268
|
+
x(r(se), {
|
|
269
|
+
modelValue: r(I),
|
|
270
270
|
"onUpdate:modelValue": n[3] || (n[3] = (s) => le(I) ? I.value = s : null),
|
|
271
271
|
size: "large",
|
|
272
272
|
"text-size": "medium",
|
|
@@ -277,21 +277,21 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
277
277
|
onBlur: n[4] || (n[4] = (s) => z("code"))
|
|
278
278
|
}, null, 8, ["modelValue", "error"])
|
|
279
279
|
])) : B("", !0),
|
|
280
|
-
!t.loading &&
|
|
281
|
-
|
|
280
|
+
!t.loading && p.value ? (v(), S("div", mt, [
|
|
281
|
+
x(we, {
|
|
282
282
|
loading: t.loading,
|
|
283
283
|
"rate-limit-text": t.rateLimitText,
|
|
284
284
|
"is-final-limit": t.isFinalLimit,
|
|
285
|
-
"on-send-again":
|
|
285
|
+
"on-send-again": m
|
|
286
286
|
}, {
|
|
287
287
|
extra: X(() => [
|
|
288
|
-
t.isTg ? (
|
|
288
|
+
t.isTg ? (v(), S("span", {
|
|
289
289
|
key: 0,
|
|
290
290
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
291
|
-
onClick:
|
|
291
|
+
onClick: g
|
|
292
292
|
}, [
|
|
293
293
|
Z(G(t.sendCodeBySmsText) + " ", 1),
|
|
294
|
-
|
|
294
|
+
x(r(de), { style: { "margin-left": "5px" } })
|
|
295
295
|
])) : B("", !0)
|
|
296
296
|
]),
|
|
297
297
|
_: 1
|
|
@@ -329,74 +329,74 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
329
329
|
},
|
|
330
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"],
|
|
331
331
|
setup(U, { emit: V }) {
|
|
332
|
-
const E = U,
|
|
332
|
+
const E = U, u = V, p = O(!1), y = O(""), h = ve({
|
|
333
333
|
touched: { phone: !1, code: !1 },
|
|
334
334
|
phoneModel: "",
|
|
335
335
|
codeModel: ""
|
|
336
336
|
});
|
|
337
337
|
_(
|
|
338
|
-
() =>
|
|
338
|
+
() => h.phoneModel,
|
|
339
339
|
(t) => {
|
|
340
|
-
|
|
340
|
+
u("update:phone", t), y.value = "";
|
|
341
341
|
}
|
|
342
342
|
), _(
|
|
343
|
-
() =>
|
|
344
|
-
(t) =>
|
|
343
|
+
() => h.codeModel,
|
|
344
|
+
(t) => u("update:code", t)
|
|
345
345
|
);
|
|
346
|
-
const z = (t) =>
|
|
347
|
-
|
|
346
|
+
const z = (t) => h.touched[t] = !0, Y = (t) => h.touched[t] = !1, K = () => {
|
|
347
|
+
y.value = "", Y("phone");
|
|
348
348
|
}, e = L(() => {
|
|
349
|
-
const n =
|
|
349
|
+
const n = h.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
350
350
|
return /^\+?\d{10,15}$/.test(n);
|
|
351
|
-
}), k = L(() => !e.value || !!
|
|
351
|
+
}), k = L(() => !e.value || !!y.value), P = async () => {
|
|
352
352
|
var t;
|
|
353
353
|
try {
|
|
354
354
|
if (z("phone"), !e.value) {
|
|
355
|
-
|
|
355
|
+
y.value = "Это не похоже на номер телефона";
|
|
356
356
|
return;
|
|
357
357
|
}
|
|
358
|
-
const n = await Ae(void 0, F(
|
|
358
|
+
const n = await Ae(void 0, F(h.phoneModel)), { data: s } = n.data;
|
|
359
359
|
if (!(((t = s.data[0]) == null ? void 0 : t.available) ?? !1)) {
|
|
360
|
-
|
|
360
|
+
y.value = "Такой номер уже используется";
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
y.value = "", u("on-send-code", { phone: h.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), p.value = !0;
|
|
364
364
|
} catch (n) {
|
|
365
|
-
console.error("Неизвестная ошибка при проверке доступности телефона:", n),
|
|
365
|
+
console.error("Неизвестная ошибка при проверке доступности телефона:", n), y.value = "Это не похоже на номер телефона";
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
|
-
let
|
|
368
|
+
let C = "";
|
|
369
369
|
const D = (t) => {
|
|
370
370
|
const n = t.target;
|
|
371
371
|
let s = n.value.replace(/\D/g, "");
|
|
372
|
-
s.length < 4 &&
|
|
373
|
-
}, h = () => {
|
|
374
|
-
r("on-send-code-again", { phone: c.phoneModel });
|
|
372
|
+
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), n.value = s), h.codeModel = s, s.length === 4 && s !== C && (C = s, u("on-match-code", { phone: h.phoneModel, code: s }));
|
|
375
373
|
}, m = () => {
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
374
|
+
u("on-send-code-again", { phone: h.phoneModel });
|
|
375
|
+
}, g = () => {
|
|
376
|
+
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: h.phoneModel });
|
|
377
|
+
}, { phoneModel: i, codeModel: I, touched: ie } = Ce(h), R = L(() => {
|
|
378
|
+
if (y.value) return y.value;
|
|
379
|
+
if (h.touched.phone) {
|
|
380
|
+
if (!h.phoneModel.trim()) return "Введите номер телефона";
|
|
381
381
|
if (!e.value) return "Это не похоже на номер телефона";
|
|
382
382
|
}
|
|
383
383
|
return E.phoneError || "";
|
|
384
|
-
}), Q = L(() => E.isNotMatchCode ? "Неверный код" :
|
|
385
|
-
return (t, n) => (
|
|
384
|
+
}), Q = L(() => E.isNotMatchCode ? "Неверный код" : h.touched.code ? I.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
385
|
+
return (t, n) => (v(), S("div", yt, [
|
|
386
386
|
H("div", gt, [
|
|
387
|
-
H("div", Ct, G(
|
|
388
|
-
|
|
389
|
-
t.isTg ? (
|
|
387
|
+
H("div", Ct, G(p.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
388
|
+
p.value ? (v(), S("div", wt, [
|
|
389
|
+
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
390
390
|
key: 1,
|
|
391
391
|
style: { "margin-left": "5px" }
|
|
392
392
|
})),
|
|
393
393
|
Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
|
|
394
394
|
])) : B("", !0)
|
|
395
395
|
]),
|
|
396
|
-
t.showPhone ? (
|
|
397
|
-
|
|
398
|
-
modelValue: i
|
|
399
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) => le(
|
|
396
|
+
t.showPhone ? (v(), S("div", Pt, [
|
|
397
|
+
x(r(se), {
|
|
398
|
+
modelValue: r(i),
|
|
399
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => le(i) ? i.value = s : null),
|
|
400
400
|
size: "large",
|
|
401
401
|
"text-size": "medium",
|
|
402
402
|
label: "Телефон",
|
|
@@ -405,16 +405,16 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
405
405
|
onBlur: n[1] || (n[1] = (s) => z("phone")),
|
|
406
406
|
onInput: K
|
|
407
407
|
}, null, 8, ["modelValue", "error"]),
|
|
408
|
-
|
|
408
|
+
x(r(Ne), {
|
|
409
409
|
class: "icon-locked",
|
|
410
410
|
onClick: n[2] || (n[2] = (s) => t.$emit("edit", "phone"))
|
|
411
411
|
})
|
|
412
412
|
])) : B("", !0),
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
p.value ? B("", !0) : (v(), S("div", Tt, [
|
|
414
|
+
x(r(ze), {
|
|
415
415
|
style: { width: "100%" },
|
|
416
416
|
disabled: k.value,
|
|
417
|
-
onClick:
|
|
417
|
+
onClick: P
|
|
418
418
|
}, {
|
|
419
419
|
default: X(() => n[5] || (n[5] = [
|
|
420
420
|
Z(" Отправить код ")
|
|
@@ -423,9 +423,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
423
423
|
__: [5]
|
|
424
424
|
}, 8, ["disabled"])
|
|
425
425
|
])),
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
modelValue:
|
|
426
|
+
p.value ? (v(), S("div", St, [
|
|
427
|
+
x(r(se), {
|
|
428
|
+
modelValue: r(I),
|
|
429
429
|
"onUpdate:modelValue": n[3] || (n[3] = (s) => le(I) ? I.value = s : null),
|
|
430
430
|
size: "large",
|
|
431
431
|
"text-size": "medium",
|
|
@@ -436,21 +436,21 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
436
436
|
onBlur: n[4] || (n[4] = (s) => z("code"))
|
|
437
437
|
}, null, 8, ["modelValue", "error"])
|
|
438
438
|
])) : B("", !0),
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
p.value ? (v(), S("div", Mt, [
|
|
440
|
+
x(we, {
|
|
441
441
|
loading: t.loading,
|
|
442
442
|
"rate-limit-text": t.rateLimitText,
|
|
443
443
|
"is-final-limit": t.isFinalLimit,
|
|
444
|
-
"on-send-again":
|
|
444
|
+
"on-send-again": m
|
|
445
445
|
}, {
|
|
446
446
|
extra: X(() => [
|
|
447
|
-
t.isTg ? (
|
|
447
|
+
t.isTg ? (v(), S("span", {
|
|
448
448
|
key: 0,
|
|
449
449
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
450
|
-
onClick:
|
|
450
|
+
onClick: g
|
|
451
451
|
}, [
|
|
452
452
|
Z(G(t.sendCodeBySmsText) + " ", 1),
|
|
453
|
-
|
|
453
|
+
x(r(de), { style: { "margin-left": "5px" } })
|
|
454
454
|
])) : B("", !0)
|
|
455
455
|
]),
|
|
456
456
|
_: 1
|
|
@@ -477,18 +477,18 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
477
477
|
},
|
|
478
478
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
479
479
|
setup(U, { expose: V, emit: E }) {
|
|
480
|
-
const
|
|
480
|
+
const u = U, p = E, y = O(u.modelValue);
|
|
481
481
|
_(
|
|
482
|
-
() =>
|
|
483
|
-
(a) =>
|
|
484
|
-
), _(
|
|
485
|
-
const
|
|
486
|
-
oldPhone:
|
|
482
|
+
() => u.modelValue,
|
|
483
|
+
(a) => y.value = a
|
|
484
|
+
), _(y, (a) => p("update:modelValue", a));
|
|
485
|
+
const h = L(() => u.language ?? "ru"), z = (a) => De[h.value] && De[h.value][a] || (u.title ?? a), Y = L(() => u.title ?? z("Смена номера телефона")), K = L(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
|
|
486
|
+
oldPhone: u.initialPhone ?? "",
|
|
487
487
|
newPhone: "",
|
|
488
488
|
code: "",
|
|
489
489
|
addPhone: "",
|
|
490
490
|
addCode: ""
|
|
491
|
-
}), k = O(j.OLD),
|
|
491
|
+
}), k = O(j.OLD), P = O(null), C = O(!1), D = O(!1), m = O("tg"), g = L(() => m.value === "tg"), i = O(!1), { startTimer: I, remainingSeconds: ie, isAvailableForSendAgain: R, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: n } = Je(p), { isEditFlow: s, getFlow: me } = Ge(O(u.mode)), re = L(() => R.value ? "Повторить" : `${ie.value}`), oe = O(ae), ue = L(() => oe.value === 0), Fe = (a) => new Promise((l) => setTimeout(l, a));
|
|
492
492
|
async function fe(a = "email") {
|
|
493
493
|
var o;
|
|
494
494
|
return (o = (await Re("/users/profile/session/get-edit-session", { params: { field: a } })).data) == null ? void 0 : o.data;
|
|
@@ -497,14 +497,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
497
497
|
var $;
|
|
498
498
|
const o = ($ = (await te("/users/profile/session/create-if-not-exists", {
|
|
499
499
|
field: a,
|
|
500
|
-
oldValue: F(
|
|
500
|
+
oldValue: F(u.initialPhone)
|
|
501
501
|
})).data) == null ? void 0 : $.data;
|
|
502
|
-
return
|
|
502
|
+
return P.value = (o == null ? void 0 : o.sessionId) ?? null, k.value = (o == null ? void 0 : o.step) ?? j.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function Ue() {
|
|
505
505
|
try {
|
|
506
506
|
const a = await fe("phone");
|
|
507
|
-
return
|
|
507
|
+
return P.value = a.sessionId, k.value = a.step, e.oldPhone = a.oldValue ?? "", a.sessionId ? a : await Te("phone");
|
|
508
508
|
} catch {
|
|
509
509
|
return await Te("phone");
|
|
510
510
|
}
|
|
@@ -521,29 +521,29 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
523
|
headers: {
|
|
524
|
-
"x-only-sms":
|
|
524
|
+
"x-only-sms": i.value ?? !1
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
);
|
|
528
|
-
await
|
|
529
|
-
const
|
|
530
|
-
return
|
|
528
|
+
await Fe(1e3);
|
|
529
|
+
const T = (o = $.data) == null ? void 0 : o.data;
|
|
530
|
+
return T ? (T.restTimeSec > 0 ? (I(T.restTimeSec), R.value = !1, Q.value = T.attempts.total, t.value = T.attempts.total - T.attempts.available, oe.value = T.attempts.available ?? ae) : R.value = !0, T) : null;
|
|
531
531
|
} catch {
|
|
532
532
|
return null;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
const ye = async ({ phone: a }) => (
|
|
536
|
-
var $,
|
|
537
|
-
|
|
535
|
+
const ye = async ({ phone: a }) => (i.value = !0, await ee({ value: a, isOnlySms: !0 })), ee = async ({ value: a, isOnlySms: l, offLoading: o } = {}) => {
|
|
536
|
+
var $, T, A, N, q, W, w;
|
|
537
|
+
C.value = !0;
|
|
538
538
|
try {
|
|
539
|
-
const
|
|
539
|
+
const f = a ?? e.oldPhone, c = await te(
|
|
540
540
|
"/users/profile/phone/contact/send-code",
|
|
541
541
|
{
|
|
542
|
-
sessionId:
|
|
543
|
-
phone: F(
|
|
544
|
-
value: F(
|
|
542
|
+
sessionId: P.value,
|
|
543
|
+
phone: F(f),
|
|
544
|
+
value: F(f),
|
|
545
545
|
oldValue: e.oldPhone ? F(e.oldPhone) : void 0,
|
|
546
|
-
provider:
|
|
546
|
+
provider: u.provider,
|
|
547
547
|
isOnlySms: l ?? !1
|
|
548
548
|
},
|
|
549
549
|
{
|
|
@@ -552,58 +552,58 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
);
|
|
555
|
-
console.debug("response sendContactCode: ",
|
|
556
|
-
const
|
|
557
|
-
if ((
|
|
558
|
-
console.debug("sendContactCode IN обработка 403 tooManyRequests",
|
|
559
|
-
const M = (
|
|
560
|
-
|
|
561
|
-
const
|
|
562
|
-
return
|
|
555
|
+
console.debug("response sendContactCode: ", c);
|
|
556
|
+
const d = (T = ($ = c == null ? void 0 : c.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
|
|
557
|
+
if ((d === "tg" || d === "sms") && (m.value = d, d === "tg" && (i.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", c), (c == null ? void 0 : c.status) === 403 && ((A = c.data) != null && A.tooManyRequests)) {
|
|
558
|
+
console.debug("sendContactCode IN обработка 403 tooManyRequests", c);
|
|
559
|
+
const M = (q = (N = c.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : q.type;
|
|
560
|
+
m.value = M;
|
|
561
|
+
const b = c.data.tooManyRequests;
|
|
562
|
+
return b.restTimeSec > 0 ? (I(b.restTimeSec), Q.value = b.attempts.total, t.value = b.attempts.total - b.attempts.available, oe.value = b.attempts.available ?? ae) : R.value = !0, c;
|
|
563
563
|
}
|
|
564
|
-
return console.debug("sendContactCode after обработка 403 tooManyRequests",
|
|
565
|
-
} catch (
|
|
566
|
-
if ((
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
return
|
|
564
|
+
return console.debug("sendContactCode after обработка 403 tooManyRequests", c), c;
|
|
565
|
+
} catch (f) {
|
|
566
|
+
if (console.error("sendContactCode catch error: ", f), console.debug("sendContactCode catch error: ", f), (f == null ? void 0 : f.status) === 403 && ((w = (W = f == null ? void 0 : f.response) == null ? void 0 : W.data) != null && w.tooManyRequests)) {
|
|
567
|
+
const c = f.response.data.tooManyRequests.type;
|
|
568
|
+
m.value = c;
|
|
569
|
+
const d = f.response.data.tooManyRequests;
|
|
570
|
+
return d.restTimeSec > 0 ? (I(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : R.value = !0, f;
|
|
571
571
|
}
|
|
572
|
-
throw
|
|
572
|
+
throw f;
|
|
573
573
|
} finally {
|
|
574
|
-
await Se(a ?? e.oldPhone),
|
|
574
|
+
await Se(a ?? e.oldPhone), C.value = !1, o && (C.value = !1);
|
|
575
575
|
}
|
|
576
576
|
}, Me = async (a, l) => {
|
|
577
|
-
var o, $,
|
|
578
|
-
|
|
577
|
+
var o, $, T, A, N, q, W, w, f, c, d;
|
|
578
|
+
C.value = !0;
|
|
579
579
|
try {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
const
|
|
580
|
+
const M = await fe("phone");
|
|
581
|
+
P.value = M.sessionId, k.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
|
|
582
|
+
const b = await te("/users/profile/change/phone/match-code", {
|
|
583
583
|
phone: l === j.NEW ? F(e.newPhone) : F(e.oldPhone),
|
|
584
|
-
sessionId:
|
|
584
|
+
sessionId: P.value,
|
|
585
585
|
code: a,
|
|
586
586
|
step: l
|
|
587
|
-
}), ne = ((o =
|
|
588
|
-
if (!(((
|
|
587
|
+
}), ne = ((o = b.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = b.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((N = (A = b.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((q = b.data) == null ? void 0 : q.rateLimit) ?? null;
|
|
588
|
+
if (!(((W = b.data) == null ? void 0 : W.data.success) ?? ((w = b.data) == null ? void 0 : w.success))) {
|
|
589
589
|
n(pe), D.value = !0;
|
|
590
590
|
return;
|
|
591
591
|
}
|
|
592
|
-
if (!ne) return
|
|
592
|
+
if (!ne) return b;
|
|
593
593
|
if (k.value = ne, ne === j.NEW) {
|
|
594
594
|
const Le = await fe("phone");
|
|
595
595
|
e.oldPhone = Le.oldValue ?? e.oldPhone, e.newPhone = Le.newValue ?? e.newPhone, e.code = "";
|
|
596
596
|
}
|
|
597
|
-
return ne === j.COMPLETED && (e.code = "",
|
|
598
|
-
} catch (
|
|
599
|
-
const
|
|
600
|
-
if (((
|
|
601
|
-
n(
|
|
597
|
+
return ne === j.COMPLETED && (e.code = "", p("update-phone-field", e.addPhone), p("submit-phone", { phone: e.oldPhone, code: a }), p("on-toast", { color: "success", text: "Номер телефона изменён" }), p("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, p("close")), b;
|
|
598
|
+
} catch (M) {
|
|
599
|
+
const b = (c = (f = M == null ? void 0 : M.response) == null ? void 0 : f.data) == null ? void 0 : c.rateLimit;
|
|
600
|
+
if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && b) {
|
|
601
|
+
n(b), D.value = !0;
|
|
602
602
|
return;
|
|
603
603
|
}
|
|
604
|
-
throw
|
|
604
|
+
throw M;
|
|
605
605
|
} finally {
|
|
606
|
-
|
|
606
|
+
C.value = !1;
|
|
607
607
|
}
|
|
608
608
|
}, xe = ({ code: a }) => Me(a, j.OLD);
|
|
609
609
|
function be(a) {
|
|
@@ -612,7 +612,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
612
612
|
function Ve(a) {
|
|
613
613
|
}
|
|
614
614
|
const ce = () => {
|
|
615
|
-
|
|
615
|
+
p("close"), y.value = !1;
|
|
616
616
|
};
|
|
617
617
|
async function $e(a = "phone") {
|
|
618
618
|
var o;
|
|
@@ -623,25 +623,25 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
623
623
|
field: l = "phone",
|
|
624
624
|
offLoading: o = !0
|
|
625
625
|
}) {
|
|
626
|
-
var $,
|
|
627
|
-
|
|
626
|
+
var $, T, A;
|
|
627
|
+
C.value = !0;
|
|
628
628
|
try {
|
|
629
|
-
if (!
|
|
629
|
+
if (!P.value) {
|
|
630
630
|
const N = await te("/users/profile/session/bind/create", {
|
|
631
631
|
field: l,
|
|
632
632
|
newValue: F(a || e.addPhone)
|
|
633
633
|
});
|
|
634
|
-
if (
|
|
634
|
+
if (P.value = ((T = ($ = N.data) == null ? void 0 : $.data) == null ? void 0 : T.sessionId) ?? ((A = N.data) == null ? void 0 : A.sessionId) ?? null, !P.value)
|
|
635
635
|
throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
|
|
636
636
|
}
|
|
637
637
|
} finally {
|
|
638
|
-
o && (
|
|
638
|
+
o && (C.value = !1);
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
async function
|
|
641
|
+
async function qe() {
|
|
642
642
|
try {
|
|
643
643
|
const a = await $e("phone");
|
|
644
|
-
|
|
644
|
+
P.value = a.sessionId, k.value = a.step, e.addPhone = a.newValue ?? "", a.sessionId || await Be({ field: "phone", value: e.addPhone });
|
|
645
645
|
} catch {
|
|
646
646
|
await Be({ field: "phone", value: e.addPhone });
|
|
647
647
|
}
|
|
@@ -652,17 +652,17 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
652
652
|
isOnlySms: o = !1,
|
|
653
653
|
offLoading: $ = !0
|
|
654
654
|
} = {}) => {
|
|
655
|
-
var
|
|
656
|
-
|
|
655
|
+
var T, A, N, q, W;
|
|
656
|
+
C.value = !0;
|
|
657
657
|
try {
|
|
658
|
-
if (!
|
|
658
|
+
if (!P.value)
|
|
659
659
|
throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
|
|
660
|
-
const
|
|
660
|
+
const w = a ?? e.addPhone, f = await te(
|
|
661
661
|
`/users/profile/bind/contact/send-code/${l}`,
|
|
662
662
|
{
|
|
663
|
-
sessionId:
|
|
664
|
-
phone: F(
|
|
665
|
-
provider:
|
|
663
|
+
sessionId: P.value,
|
|
664
|
+
phone: F(w),
|
|
665
|
+
provider: u.provider,
|
|
666
666
|
isOnlySms: o ?? !1
|
|
667
667
|
},
|
|
668
668
|
{
|
|
@@ -670,67 +670,69 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
670
670
|
"x-only-sms": o ?? !1
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
),
|
|
674
|
-
(
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
const M =
|
|
678
|
-
return
|
|
673
|
+
), c = (A = (T = f == null ? void 0 : f.data) == null ? void 0 : T.data) == null ? void 0 : A.deliveryType;
|
|
674
|
+
(c === "tg" || c === "sms") && (m.value = c, c === "tg" && (i.value = !1));
|
|
675
|
+
const d = (N = f.data) == null ? void 0 : N.tooManyRequests;
|
|
676
|
+
if (f.status === 403 && d) {
|
|
677
|
+
const M = d == null ? void 0 : d.type;
|
|
678
|
+
return m.value = M, d.restTimeSec > 0 ? (I(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : R.value = !0, f;
|
|
679
679
|
}
|
|
680
|
-
return
|
|
681
|
-
} catch (
|
|
682
|
-
if ((
|
|
683
|
-
const
|
|
684
|
-
|
|
680
|
+
return f;
|
|
681
|
+
} catch (w) {
|
|
682
|
+
if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((W = (q = w == null ? void 0 : w.response) == null ? void 0 : q.data) != null && W.tooManyRequests)) {
|
|
683
|
+
const f = w.response.data.tooManyRequests.type;
|
|
684
|
+
m.value = f;
|
|
685
|
+
const c = w.response.data.tooManyRequests;
|
|
686
|
+
return c.restTimeSec > 0 ? (I(c.restTimeSec), Q.value = c.attempts.total, t.value = c.attempts.total - c.attempts.available, oe.value = c.attempts.available ?? ae, R.value = !1) : R.value = !0, w;
|
|
685
687
|
}
|
|
686
|
-
throw
|
|
688
|
+
throw w;
|
|
687
689
|
} finally {
|
|
688
|
-
const
|
|
689
|
-
|
|
690
|
+
const w = await Se(a ?? e.addPhone);
|
|
691
|
+
w && w.restTimeSec > 0 ? (I(w.restTimeSec), R.value = !1) : R.value = !0, $ && (C.value = !1);
|
|
690
692
|
}
|
|
691
693
|
}, Ee = async ({ code: a }) => {
|
|
692
|
-
var l, o, $,
|
|
693
|
-
|
|
694
|
+
var l, o, $, T, A, N, q, W, w, f, c;
|
|
695
|
+
C.value = !0;
|
|
694
696
|
try {
|
|
695
|
-
if (!
|
|
697
|
+
if (!P.value) {
|
|
696
698
|
const pe = await $e("phone");
|
|
697
|
-
|
|
699
|
+
P.value = pe.sessionId, e.addPhone = pe.newValue ?? e.addPhone;
|
|
698
700
|
}
|
|
699
|
-
const
|
|
701
|
+
const d = await te("/users/profile/bind/phone/match-code", {
|
|
700
702
|
phone: F(e.addPhone),
|
|
701
|
-
sessionId:
|
|
703
|
+
sessionId: P.value,
|
|
702
704
|
code: a
|
|
703
|
-
}),
|
|
704
|
-
if (!(((
|
|
705
|
-
n(
|
|
705
|
+
}), M = ((l = d.data) == null ? void 0 : l.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), b = ((A = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : A.rateLimit) ?? ((N = d.data) == null ? void 0 : N.rateLimit) ?? null;
|
|
706
|
+
if (!(((q = d.data) == null ? void 0 : q.data.success) ?? ((W = d.data) == null ? void 0 : W.success))) {
|
|
707
|
+
n(b), D.value = !0;
|
|
706
708
|
return;
|
|
707
709
|
}
|
|
708
|
-
return
|
|
709
|
-
} catch (
|
|
710
|
-
const
|
|
711
|
-
if (((
|
|
712
|
-
n(
|
|
710
|
+
return M && M === j.COMPLETED && (e.code = "", p("update-phone-field", e.addPhone), p("submit-phone", { phone: e.addPhone, code: a }), p("on-update-jwt", "phone", "bind", e.addPhone), p("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, p("close")), d;
|
|
711
|
+
} catch (d) {
|
|
712
|
+
const M = (f = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : f.rateLimit;
|
|
713
|
+
if (((c = d == null ? void 0 : d.response) == null ? void 0 : c.status) === 429 && M) {
|
|
714
|
+
n(M), D.value = !0;
|
|
713
715
|
return;
|
|
714
716
|
}
|
|
715
|
-
throw
|
|
717
|
+
throw d;
|
|
716
718
|
} finally {
|
|
717
|
-
|
|
719
|
+
C.value = !1;
|
|
718
720
|
}
|
|
719
721
|
}, Ie = async () => {
|
|
720
722
|
};
|
|
721
723
|
return We(async () => {
|
|
722
|
-
|
|
724
|
+
C.value = !0;
|
|
723
725
|
const a = await me("phone");
|
|
724
|
-
if (
|
|
725
|
-
await
|
|
726
|
+
if (u.mode === "bind" && a === "bind") {
|
|
727
|
+
await qe(), C.value = !1;
|
|
726
728
|
return;
|
|
727
729
|
}
|
|
728
|
-
(await
|
|
730
|
+
(await Ue()).step === "old" && await ee({}), C.value = !1;
|
|
729
731
|
}), V({
|
|
730
|
-
localVisible:
|
|
732
|
+
localVisible: y,
|
|
731
733
|
form: e,
|
|
732
734
|
currentStep: k,
|
|
733
|
-
loading:
|
|
735
|
+
loading: C,
|
|
734
736
|
rateLimitText: re,
|
|
735
737
|
isAvailable: ue,
|
|
736
738
|
title: Y,
|
|
@@ -744,11 +746,11 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
744
746
|
handleNewCodeError: Ve,
|
|
745
747
|
matchBindCode: Ee,
|
|
746
748
|
matchBindCodeError: Ie
|
|
747
|
-
}), (a, l) => (
|
|
748
|
-
|
|
749
|
-
modelValue:
|
|
749
|
+
}), (a, l) => (v(), S(je, null, [
|
|
750
|
+
x(r(Qe), {
|
|
751
|
+
modelValue: y.value,
|
|
750
752
|
"onUpdate:modelValue": [
|
|
751
|
-
l[15] || (l[15] = (o) =>
|
|
753
|
+
l[15] || (l[15] = (o) => y.value = o),
|
|
752
754
|
ce
|
|
753
755
|
],
|
|
754
756
|
width: "small",
|
|
@@ -758,17 +760,17 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
758
760
|
}, {
|
|
759
761
|
header: X(() => [
|
|
760
762
|
H("div", bt, [
|
|
761
|
-
|
|
763
|
+
x(r(Xe), {
|
|
762
764
|
"slot-left": !1,
|
|
763
765
|
size: "small",
|
|
764
766
|
borded: !0,
|
|
765
767
|
"no-padding": !1
|
|
766
768
|
}, {
|
|
767
769
|
title: X(() => [
|
|
768
|
-
H("span", kt, G(
|
|
770
|
+
H("span", kt, G(r(s) ? Y.value : "Добавление номера телефона"), 1)
|
|
769
771
|
]),
|
|
770
772
|
"right-button": X(() => [
|
|
771
|
-
|
|
773
|
+
x(r(Ye), {
|
|
772
774
|
class: "cross",
|
|
773
775
|
onClick: ce
|
|
774
776
|
})
|
|
@@ -778,9 +780,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
778
780
|
])
|
|
779
781
|
]),
|
|
780
782
|
default: X(() => [
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
k.value ===
|
|
783
|
+
r(s) ? (v(), S("div", Vt, [
|
|
784
|
+
C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
|
|
785
|
+
k.value === r(j).OLD ? (v(), J(dt, {
|
|
784
786
|
key: 1,
|
|
785
787
|
phone: e.oldPhone,
|
|
786
788
|
"onUpdate:phone": l[0] || (l[0] = (o) => e.oldPhone = o),
|
|
@@ -789,14 +791,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
789
791
|
"rate-limit-text": re.value,
|
|
790
792
|
"is-final-limit": ue.value,
|
|
791
793
|
"is-not-match-code": D.value,
|
|
792
|
-
loading:
|
|
793
|
-
"is-tg":
|
|
794
|
+
loading: C.value,
|
|
795
|
+
"is-tg": g.value,
|
|
794
796
|
onOnSendCode: l[2] || (l[2] = (o) => ee({ value: e.oldPhone })),
|
|
795
|
-
onOnSendCodeAgain: l[3] || (l[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !
|
|
797
|
+
onOnSendCodeAgain: l[3] || (l[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !g.value && i.value })),
|
|
796
798
|
onOnSendOnlySms: ye,
|
|
797
799
|
onOnMatchCode: xe,
|
|
798
800
|
onOnMatchCodeError: be
|
|
799
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value ===
|
|
801
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === r(j).NEW ? (v(), J(ft, {
|
|
800
802
|
key: 2,
|
|
801
803
|
phone: e.newPhone,
|
|
802
804
|
"onUpdate:phone": l[4] || (l[4] = (o) => e.newPhone = o),
|
|
@@ -808,34 +810,34 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
808
810
|
"rate-limit-text": re.value,
|
|
809
811
|
"is-final-limit": ue.value,
|
|
810
812
|
"is-not-match-code": D.value,
|
|
811
|
-
loading:
|
|
812
|
-
"is-tg":
|
|
813
|
+
loading: C.value,
|
|
814
|
+
"is-tg": g.value,
|
|
813
815
|
onOnSendCode: l[7] || (l[7] = (o) => ee({ value: e.newPhone })),
|
|
814
|
-
onOnSendCodeAgain: l[8] || (l[8] = (o) => ee({ value: e.newPhone, isOnlySms: !
|
|
816
|
+
onOnSendCodeAgain: l[8] || (l[8] = (o) => ee({ value: e.newPhone, isOnlySms: !g.value && i.value })),
|
|
815
817
|
onOnSendOnlySms: ye,
|
|
816
818
|
onOnMatchCode: ke,
|
|
817
819
|
onOnMatchCodeError: Ve,
|
|
818
820
|
onOnClearCodeError: l[9] || (l[9] = (o) => D.value = !1)
|
|
819
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value ===
|
|
821
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === r(j).COMPLETED ? (v(), S("div", $t, [
|
|
820
822
|
H("p", null, G(z("Телефон успешно изменен")), 1)
|
|
821
823
|
])) : B("", !0)
|
|
822
|
-
])) : (
|
|
823
|
-
|
|
824
|
-
|
|
824
|
+
])) : (v(), S("div", Bt, [
|
|
825
|
+
C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
|
|
826
|
+
x(xt, {
|
|
825
827
|
phone: e.addPhone,
|
|
826
828
|
"onUpdate:phone": l[10] || (l[10] = (o) => e.addPhone = o),
|
|
827
829
|
oldPhone: e.oldPhone,
|
|
828
830
|
"onUpdate:oldPhone": l[11] || (l[11] = (o) => e.oldPhone = o),
|
|
829
831
|
code: e.addCode,
|
|
830
832
|
"onUpdate:code": l[12] || (l[12] = (o) => e.addCode = o),
|
|
831
|
-
"hint-text":
|
|
833
|
+
"hint-text": r(s) ? K.value : "Чтобы продолжить, введите новый номер",
|
|
832
834
|
"rate-limit-text": re.value,
|
|
833
835
|
"is-final-limit": ue.value,
|
|
834
836
|
"is-not-match-code": D.value,
|
|
835
|
-
loading:
|
|
836
|
-
"is-tg":
|
|
837
|
+
loading: C.value,
|
|
838
|
+
"is-tg": g.value,
|
|
837
839
|
onOnSendCode: l[13] || (l[13] = (o) => ge({ value: e.addPhone, field: "phone" })),
|
|
838
|
-
onOnSendCodeAgain: l[14] || (l[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !
|
|
840
|
+
onOnSendCodeAgain: l[14] || (l[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !g.value && i.value })),
|
|
839
841
|
onOnSendOnlySms: ye,
|
|
840
842
|
onOnMatchCode: Ee,
|
|
841
843
|
onOnMatchCodeError: Ie
|
|
@@ -844,7 +846,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
844
846
|
]),
|
|
845
847
|
_: 1
|
|
846
848
|
}, 8, ["modelValue"]),
|
|
847
|
-
|
|
849
|
+
x(r(Ze))
|
|
848
850
|
], 64));
|
|
849
851
|
}
|
|
850
852
|
});
|
|
@@ -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: c, closeDialog: U } = X(), l = {
|
|
219
|
-
email: J(() => import("./ProfileEmailDialog-
|
|
220
|
-
phone: J(() => import("./ProfilePhoneDialog-
|
|
221
|
-
password: J(() => import("./ProfilePasswordDialog-
|
|
219
|
+
email: J(() => import("./ProfileEmailDialog-rzPRsM0B.js")),
|
|
220
|
+
phone: J(() => import("./ProfilePhoneDialog-DyDCK0A6.js")),
|
|
221
|
+
password: J(() => import("./ProfilePasswordDialog-FRHBCNZO.js"))
|
|
222
222
|
}, i = ({ email: y }) => {
|
|
223
223
|
r("update-email-field", y);
|
|
224
224
|
}, p = ({ 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-7d90f646] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-7d90f646] .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-B03tgxbV.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-B03tgxbV.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")}`;
|