@yourgoods/ui-smart 0.15.0 → 0.17.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-CxxrKdXq.js → ProfileEmailDialog-DstpXM37.js} +2 -2
- package/dist/{ProfilePasswordDialog-DD7Y-yST.js → ProfilePasswordDialog-yImHpQbw.js} +1 -1
- package/dist/{ProfilePhoneDialog-B70yCvN1.js → ProfilePhoneDialog-ClsVPLkz.js} +316 -300
- package/dist/{index-CUlv4_bc.js → index-pkvfGwA4.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-D8ZnOLXz.js → useRateLimitToast-CNzNHAUx.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as De, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
-
import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-
|
|
3
|
-
import { C as D, _ as ze, B as We, p as F, g as He } from "./index-
|
|
2
|
+
import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-CNzNHAUx.js";
|
|
3
|
+
import { C as D, _ as ze, B as We, p as F, g as He } from "./index-pkvfGwA4.js";
|
|
4
4
|
import { PInput as G, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as Ge } from "@profeat/ui-kit";
|
|
5
5
|
const Ye = { class: "dialogDefaultContainerInsideContent" }, _e = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
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-pkvfGwA4.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 T, openBlock as p, createElementVNode as F, defineComponent as
|
|
2
|
-
import { T as
|
|
3
|
-
import { IconTelegramSm as
|
|
4
|
-
import { C as
|
|
1
|
+
import { createElementBlock as T, openBlock as p, createElementVNode as F, defineComponent as ue, reactive as ce, watch as Z, ref as O, toRefs as fe, computed as A, createCommentVNode as E, createVNode as S, toDisplayString as q, createBlock as K, createTextVNode as Y, unref as r, isRef as ae, withCtx as Q, onMounted as Ue, Fragment as je } from "vue";
|
|
2
|
+
import { T as ge, c as Le, a as qe, u as We, P as Be, b as Ke } from "./useRateLimitToast-CNzNHAUx.js";
|
|
3
|
+
import { IconTelegramSm as ye, PInput as le, IconPhoneMd as He, IconMailMd as De, PButton as Ae, PDialog as Ge, PTopBar as Je, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
|
|
4
|
+
import { C as j, t as Ie, p as oe, g as Oe } from "./index-pkvfGwA4.js";
|
|
5
5
|
const Ye = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -18,13 +18,13 @@ function Ze(z, b) {
|
|
|
18
18
|
}, null, -1)
|
|
19
19
|
]));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }, eo = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, oo = { class: "dialogDefaultContainerTextHint" }, to = { class: "chip" }, no = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "input-wrapper"
|
|
24
|
-
},
|
|
24
|
+
}, ao = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "input-wrapper"
|
|
27
|
-
},
|
|
27
|
+
}, lo = /* @__PURE__ */ ue({
|
|
28
28
|
__name: "OldPhoneContent",
|
|
29
29
|
props: {
|
|
30
30
|
phone: {},
|
|
@@ -43,15 +43,15 @@ const ne = { render: Ze }, _e = { 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(z, { emit: b }) {
|
|
46
|
-
const k = z, u = b, c =
|
|
46
|
+
const k = z, u = b, c = ce({
|
|
47
47
|
touched: { phone: !1, code: !1 },
|
|
48
48
|
phoneModel: k.phone,
|
|
49
49
|
codeModel: k.code
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
Z(
|
|
52
52
|
() => c.phoneModel,
|
|
53
53
|
(i) => u("update:phone", i)
|
|
54
|
-
),
|
|
54
|
+
), Z(
|
|
55
55
|
() => c.codeModel,
|
|
56
56
|
(i) => u("update:code", i)
|
|
57
57
|
);
|
|
@@ -64,24 +64,24 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
64
64
|
const h = i.target;
|
|
65
65
|
let v = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
|
|
66
66
|
v.length > 4 && (v = v.slice(0, 4)), M.value = v, h && h.value !== v && (h.value = v), v.length === 4 && v !== f.value && (f.value = v, u("on-match-code", { phone: e.value, code: v }));
|
|
67
|
-
},
|
|
67
|
+
}, W = () => u("on-send-code-again", { phone: c.phoneModel }), H = () => {
|
|
68
68
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: c.phoneModel });
|
|
69
|
-
}, { phoneModel: e, codeModel: M, touched: C } =
|
|
69
|
+
}, { phoneModel: e, codeModel: M, touched: C } = fe(c), y = A(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), x = A(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? M.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
70
70
|
return (i, h) => (p(), T("div", _e, [
|
|
71
|
-
F("div",
|
|
72
|
-
F("div",
|
|
73
|
-
F("div",
|
|
74
|
-
i.isTg ? (p(),
|
|
71
|
+
F("div", eo, [
|
|
72
|
+
F("div", oo, q(i.hintText), 1),
|
|
73
|
+
F("div", to, [
|
|
74
|
+
i.isTg ? (p(), K(r(ye), { key: 0 })) : (p(), K(r(se), {
|
|
75
75
|
key: 1,
|
|
76
76
|
style: { "margin-left": "5px" }
|
|
77
77
|
})),
|
|
78
|
-
|
|
78
|
+
Y(" " + q(i.isTg ? "Telegram" : "СМС"), 1)
|
|
79
79
|
])
|
|
80
80
|
]),
|
|
81
|
-
i.showPhone ? (p(), T("div",
|
|
82
|
-
S(r(
|
|
81
|
+
i.showPhone ? (p(), T("div", no, [
|
|
82
|
+
S(r(le), {
|
|
83
83
|
modelValue: r(e),
|
|
84
|
-
"onUpdate:modelValue": h[0] || (h[0] = (v) =>
|
|
84
|
+
"onUpdate:modelValue": h[0] || (h[0] = (v) => ae(e) ? e.value = v : null),
|
|
85
85
|
size: "large",
|
|
86
86
|
"text-size": "medium",
|
|
87
87
|
label: "Телефон",
|
|
@@ -91,15 +91,15 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
91
91
|
onBlur: h[1] || (h[1] = (v) => g("phone")),
|
|
92
92
|
onInput: h[2] || (h[2] = (v) => g("phone"))
|
|
93
93
|
}, null, 8, ["modelValue", "error"]),
|
|
94
|
-
S(r(
|
|
94
|
+
S(r(He), {
|
|
95
95
|
class: "icon-locked",
|
|
96
96
|
onClick: h[3] || (h[3] = (v) => i.$emit("edit", "phone"))
|
|
97
97
|
})
|
|
98
|
-
])) :
|
|
99
|
-
i.showCode ? (p(), T("div",
|
|
100
|
-
S(r(
|
|
98
|
+
])) : E("", !0),
|
|
99
|
+
i.showCode ? (p(), T("div", ao, [
|
|
100
|
+
S(r(le), {
|
|
101
101
|
modelValue: r(M),
|
|
102
|
-
"onUpdate:modelValue": h[4] || (h[4] = (v) =>
|
|
102
|
+
"onUpdate:modelValue": h[4] || (h[4] = (v) => ae(M) ? M.value = v : null),
|
|
103
103
|
size: "large",
|
|
104
104
|
"text-size": "medium",
|
|
105
105
|
label: "Код",
|
|
@@ -108,22 +108,22 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
108
108
|
onInput: B,
|
|
109
109
|
onBlur: h[5] || (h[5] = (v) => g("code"))
|
|
110
110
|
}, null, 8, ["modelValue", "error"])
|
|
111
|
-
])) :
|
|
112
|
-
S(
|
|
111
|
+
])) : E("", !0),
|
|
112
|
+
S(ge, {
|
|
113
113
|
loading: i.loading,
|
|
114
114
|
"rate-limit-text": i.rateLimitText,
|
|
115
115
|
"is-final-limit": i.isFinalLimit,
|
|
116
|
-
"on-send-again":
|
|
116
|
+
"on-send-again": W
|
|
117
117
|
}, {
|
|
118
|
-
extra:
|
|
118
|
+
extra: Q(() => [
|
|
119
119
|
i.isTg ? (p(), T("span", {
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: H
|
|
123
123
|
}, [
|
|
124
|
-
|
|
125
|
-
S(r(
|
|
126
|
-
])) :
|
|
124
|
+
Y(q(i.sendCodeBySmsText) + " ", 1),
|
|
125
|
+
S(r(se), { style: { "margin-left": "5px" } })
|
|
126
|
+
])) : E("", !0)
|
|
127
127
|
]),
|
|
128
128
|
_: 1
|
|
129
129
|
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
@@ -138,19 +138,19 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
138
138
|
return `+${b}`;
|
|
139
139
|
}
|
|
140
140
|
return z.trim().startsWith("+") ? z.trim() : `+${b}`;
|
|
141
|
-
},
|
|
141
|
+
}, so = { class: "dialogDefaultContainerInsideContent" }, io = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, ro = { class: "dialogDefaultContainerTextHint" }, uo = {
|
|
142
142
|
key: 0,
|
|
143
143
|
class: "chip"
|
|
144
|
-
},
|
|
144
|
+
}, co = {
|
|
145
145
|
key: 0,
|
|
146
146
|
class: "input-wrapper"
|
|
147
|
-
},
|
|
147
|
+
}, po = {
|
|
148
148
|
key: 1,
|
|
149
149
|
class: "input-wrapper"
|
|
150
|
-
},
|
|
150
|
+
}, ho = {
|
|
151
151
|
key: 2,
|
|
152
152
|
class: "input-wrapper"
|
|
153
|
-
},
|
|
153
|
+
}, vo = { key: 3 }, mo = /* @__PURE__ */ ue({
|
|
154
154
|
__name: "NewPhoneContent",
|
|
155
155
|
props: {
|
|
156
156
|
phone: {},
|
|
@@ -168,37 +168,45 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
168
168
|
},
|
|
169
169
|
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
170
|
setup(z, { emit: b }) {
|
|
171
|
-
const k = z, u = b, c = O(!1), g = O(""), f =
|
|
171
|
+
const k = z, u = b, c = O(!1), g = O(""), f = ce({
|
|
172
172
|
touched: { phone: !1, code: !1 },
|
|
173
173
|
phoneModel: "",
|
|
174
174
|
codeModel: ""
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
Z(
|
|
177
177
|
() => f.phoneModel,
|
|
178
178
|
(n) => {
|
|
179
179
|
u("update:phone", n), g.value = "";
|
|
180
180
|
}
|
|
181
|
-
),
|
|
181
|
+
), Z(
|
|
182
182
|
() => f.codeModel,
|
|
183
183
|
(n) => u("update:code", n)
|
|
184
184
|
);
|
|
185
|
-
const B = (n) => f.touched[n] = !0,
|
|
186
|
-
const
|
|
187
|
-
return /^\+?\d{10,15}$/.test(
|
|
188
|
-
}),
|
|
189
|
-
var
|
|
190
|
-
if (B("phone"), !
|
|
185
|
+
const B = (n) => f.touched[n] = !0, W = A(() => {
|
|
186
|
+
const t = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
187
|
+
return /^\+?\d{10,15}$/.test(t);
|
|
188
|
+
}), H = async () => {
|
|
189
|
+
var X;
|
|
190
|
+
if (B("phone"), !W.value) {
|
|
191
191
|
g.value = "Это не похоже на номер телефона";
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
const {
|
|
195
|
-
data: { data: n, success:
|
|
196
|
-
} = await
|
|
197
|
-
if (!
|
|
198
|
-
|
|
199
|
-
|
|
195
|
+
data: { data: n, success: t, message: l }
|
|
196
|
+
} = await Le(void 0, N(f.phoneModel));
|
|
197
|
+
if (!t && l) {
|
|
198
|
+
let _ = Array.isArray(l) ? l.join(" ") : String(l);
|
|
199
|
+
if ([
|
|
200
|
+
"Телефон должен быть в формате",
|
|
201
|
+
"must be a valid phone number"
|
|
202
|
+
].some(
|
|
203
|
+
(J) => _.includes(J)
|
|
204
|
+
)) {
|
|
205
|
+
g.value = "Это не похоже на номер телефона";
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
200
208
|
}
|
|
201
|
-
if (!(((
|
|
209
|
+
if (!(((X = n == null ? void 0 : n[0]) == null ? void 0 : X.available) ?? !1)) {
|
|
202
210
|
g.value = "Такой номер уже используется";
|
|
203
211
|
return;
|
|
204
212
|
}
|
|
@@ -207,100 +215,100 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
207
215
|
let e = O("");
|
|
208
216
|
const M = (n) => {
|
|
209
217
|
u("on-clear-code-error");
|
|
210
|
-
const
|
|
211
|
-
let
|
|
212
|
-
|
|
218
|
+
const t = n.target;
|
|
219
|
+
let l = ((t == null ? void 0 : t.value) ?? "").replace(/\D/g, "");
|
|
220
|
+
l.length > 4 && (l = l.slice(0, 4)), i.value = l, t && t.value !== l && (t.value = l), l.length === 4 && l !== e.value && (e.value = l, u("on-match-code", { phone: x.value, code: l }));
|
|
213
221
|
}, C = () => {
|
|
214
222
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
215
223
|
}, y = () => {
|
|
216
224
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
217
|
-
}, { phoneModel: x, codeModel: i, touched: h } =
|
|
218
|
-
return (n,
|
|
219
|
-
F("div",
|
|
220
|
-
F("div",
|
|
221
|
-
c.value ? (p(), T("div",
|
|
222
|
-
n.isTg ? (p(),
|
|
225
|
+
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), G = A(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
226
|
+
return (n, t) => (p(), T("div", so, [
|
|
227
|
+
F("div", io, [
|
|
228
|
+
F("div", ro, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
229
|
+
c.value ? (p(), T("div", uo, [
|
|
230
|
+
n.isTg ? (p(), K(r(ye), { key: 0 })) : (p(), K(r(se), {
|
|
223
231
|
key: 1,
|
|
224
232
|
style: { "margin-left": "5px" }
|
|
225
233
|
})),
|
|
226
|
-
|
|
227
|
-
])) :
|
|
234
|
+
Y(" " + q(n.isTg ? "Telegram" : "СМС"), 1)
|
|
235
|
+
])) : E("", !0)
|
|
228
236
|
]),
|
|
229
|
-
n.showPhone ? (p(), T("div",
|
|
230
|
-
S(r(
|
|
237
|
+
n.showPhone ? (p(), T("div", co, [
|
|
238
|
+
S(r(le), {
|
|
231
239
|
modelValue: r(x),
|
|
232
|
-
"onUpdate:modelValue":
|
|
240
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => ae(x) ? x.value = l : null),
|
|
233
241
|
size: "large",
|
|
234
242
|
"text-size": "medium",
|
|
235
243
|
label: "Телефон",
|
|
236
244
|
type: "tel",
|
|
237
245
|
error: v.value,
|
|
238
|
-
onBlur:
|
|
239
|
-
onInput:
|
|
246
|
+
onBlur: t[1] || (t[1] = (l) => B("phone")),
|
|
247
|
+
onInput: t[2] || (t[2] = (l) => B("phone"))
|
|
240
248
|
}, null, 8, ["modelValue", "error"]),
|
|
241
|
-
S(r(
|
|
249
|
+
S(r(De), {
|
|
242
250
|
class: "icon-locked",
|
|
243
|
-
onClick:
|
|
251
|
+
onClick: t[3] || (t[3] = (l) => n.$emit("edit", "phone"))
|
|
244
252
|
})
|
|
245
|
-
])) :
|
|
246
|
-
c.value ?
|
|
247
|
-
S(r(
|
|
253
|
+
])) : E("", !0),
|
|
254
|
+
c.value ? E("", !0) : (p(), T("div", po, [
|
|
255
|
+
S(r(Ae), {
|
|
248
256
|
style: { width: "100%" },
|
|
249
|
-
disabled: !
|
|
250
|
-
onClick:
|
|
257
|
+
disabled: !W.value,
|
|
258
|
+
onClick: H
|
|
251
259
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
|
|
260
|
+
default: Q(() => t[6] || (t[6] = [
|
|
261
|
+
Y(" Отправить код ")
|
|
254
262
|
])),
|
|
255
263
|
_: 1,
|
|
256
264
|
__: [6]
|
|
257
265
|
}, 8, ["disabled"])
|
|
258
266
|
])),
|
|
259
|
-
c.value ? (p(), T("div",
|
|
260
|
-
S(r(
|
|
267
|
+
c.value ? (p(), T("div", ho, [
|
|
268
|
+
S(r(le), {
|
|
261
269
|
modelValue: r(i),
|
|
262
|
-
"onUpdate:modelValue":
|
|
270
|
+
"onUpdate:modelValue": t[4] || (t[4] = (l) => ae(i) ? i.value = l : null),
|
|
263
271
|
size: "large",
|
|
264
272
|
"text-size": "medium",
|
|
265
273
|
label: "Код",
|
|
266
274
|
type: "text",
|
|
267
|
-
error:
|
|
275
|
+
error: G.value,
|
|
268
276
|
onInput: M,
|
|
269
|
-
onBlur:
|
|
277
|
+
onBlur: t[5] || (t[5] = (l) => B("code"))
|
|
270
278
|
}, null, 8, ["modelValue", "error"])
|
|
271
|
-
])) :
|
|
272
|
-
!n.loading && c.value ? (p(), T("div",
|
|
273
|
-
S(
|
|
279
|
+
])) : E("", !0),
|
|
280
|
+
!n.loading && c.value ? (p(), T("div", vo, [
|
|
281
|
+
S(ge, {
|
|
274
282
|
loading: n.loading,
|
|
275
283
|
"rate-limit-text": n.rateLimitText,
|
|
276
284
|
"is-final-limit": n.isFinalLimit,
|
|
277
285
|
"on-send-again": C
|
|
278
286
|
}, {
|
|
279
|
-
extra:
|
|
287
|
+
extra: Q(() => [
|
|
280
288
|
n.isTg ? (p(), T("span", {
|
|
281
289
|
key: 0,
|
|
282
290
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
283
291
|
onClick: y
|
|
284
292
|
}, [
|
|
285
|
-
|
|
286
|
-
S(r(
|
|
287
|
-
])) :
|
|
293
|
+
Y(q(n.sendCodeBySmsText) + " ", 1),
|
|
294
|
+
S(r(se), { style: { "margin-left": "5px" } })
|
|
295
|
+
])) : E("", !0)
|
|
288
296
|
]),
|
|
289
297
|
_: 1
|
|
290
298
|
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
291
|
-
])) :
|
|
299
|
+
])) : E("", !0)
|
|
292
300
|
]));
|
|
293
301
|
}
|
|
294
|
-
}),
|
|
302
|
+
}), fo = { class: "dialogDefaultContainerInsideContent" }, go = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, yo = { class: "dialogDefaultContainerTextHint" }, Co = { class: "chip" }, wo = {
|
|
295
303
|
key: 0,
|
|
296
304
|
class: "input-wrapper"
|
|
297
|
-
},
|
|
305
|
+
}, Po = {
|
|
298
306
|
key: 1,
|
|
299
307
|
class: "input-wrapper"
|
|
300
|
-
},
|
|
308
|
+
}, To = {
|
|
301
309
|
key: 2,
|
|
302
310
|
class: "input-wrapper"
|
|
303
|
-
},
|
|
311
|
+
}, So = { key: 3 }, Mo = /* @__PURE__ */ ue({
|
|
304
312
|
__name: "AddNewPhoneContent",
|
|
305
313
|
props: {
|
|
306
314
|
phone: {},
|
|
@@ -318,37 +326,45 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
318
326
|
},
|
|
319
327
|
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"],
|
|
320
328
|
setup(z, { emit: b }) {
|
|
321
|
-
const k = z, u = b, c = O(!1), g = O(""), f =
|
|
329
|
+
const k = z, u = b, c = O(!1), g = O(""), f = ce({
|
|
322
330
|
touched: { phone: !1, code: !1 },
|
|
323
331
|
phoneModel: "",
|
|
324
332
|
codeModel: ""
|
|
325
333
|
});
|
|
326
|
-
|
|
334
|
+
Z(
|
|
327
335
|
() => f.phoneModel,
|
|
328
336
|
(n) => {
|
|
329
337
|
u("update:phone", n), g.value = "";
|
|
330
338
|
}
|
|
331
|
-
),
|
|
339
|
+
), Z(
|
|
332
340
|
() => f.codeModel,
|
|
333
341
|
(n) => u("update:code", n)
|
|
334
342
|
);
|
|
335
|
-
const B = (n) => f.touched[n] = !0,
|
|
336
|
-
const
|
|
337
|
-
return /^\+?\d{10,15}$/.test(
|
|
338
|
-
}),
|
|
339
|
-
var
|
|
340
|
-
if (B("phone"), !
|
|
343
|
+
const B = (n) => f.touched[n] = !0, W = A(() => {
|
|
344
|
+
const t = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
345
|
+
return /^\+?\d{10,15}$/.test(t);
|
|
346
|
+
}), H = async () => {
|
|
347
|
+
var X;
|
|
348
|
+
if (B("phone"), !W.value) {
|
|
341
349
|
g.value = "Это не похоже на номер телефона";
|
|
342
350
|
return;
|
|
343
351
|
}
|
|
344
352
|
const {
|
|
345
|
-
data: { data: n, success:
|
|
346
|
-
} = await
|
|
347
|
-
if (!
|
|
348
|
-
|
|
349
|
-
|
|
353
|
+
data: { data: n, success: t, message: l }
|
|
354
|
+
} = await Le(void 0, N(f.phoneModel));
|
|
355
|
+
if (!t && l) {
|
|
356
|
+
let _ = Array.isArray(l) ? l.join(" ") : String(l);
|
|
357
|
+
if ([
|
|
358
|
+
"Телефон должен быть в формате",
|
|
359
|
+
"must be a valid phone number"
|
|
360
|
+
].some(
|
|
361
|
+
(J) => _.includes(J)
|
|
362
|
+
)) {
|
|
363
|
+
g.value = "Это не похоже на номер телефона";
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
350
366
|
}
|
|
351
|
-
if (!(((
|
|
367
|
+
if (!(((X = n == null ? void 0 : n[0]) == null ? void 0 : X.available) ?? !1)) {
|
|
352
368
|
g.value = "Такой номер уже используется";
|
|
353
369
|
return;
|
|
354
370
|
}
|
|
@@ -357,97 +373,97 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
357
373
|
let e = "";
|
|
358
374
|
const M = (n) => {
|
|
359
375
|
u("on-clear-code-error");
|
|
360
|
-
const
|
|
361
|
-
let
|
|
362
|
-
|
|
376
|
+
const t = n.target;
|
|
377
|
+
let l = t.value.replace(/\D/g, "");
|
|
378
|
+
l.length > 4 && (l = l.slice(0, 4), t.value = l), f.codeModel = l, l.length === 4 && l !== e && (e = l, u("on-match-code", { phone: f.phoneModel, code: l }));
|
|
363
379
|
}, C = () => {
|
|
364
380
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
365
381
|
}, y = () => {
|
|
366
382
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
367
|
-
}, { phoneModel: x, codeModel: i, touched: h } =
|
|
368
|
-
return (n,
|
|
369
|
-
F("div",
|
|
370
|
-
F("div",
|
|
371
|
-
F("div",
|
|
372
|
-
n.isTg ? (p(),
|
|
383
|
+
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), G = A(() => k.isNotMatchCode ? "Неверный код" : f.touched.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
384
|
+
return (n, t) => (p(), T("div", fo, [
|
|
385
|
+
F("div", go, [
|
|
386
|
+
F("div", yo, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
387
|
+
F("div", Co, [
|
|
388
|
+
n.isTg ? (p(), K(r(ye), { key: 0 })) : (p(), K(r(se), {
|
|
373
389
|
key: 1,
|
|
374
390
|
style: { "margin-left": "5px" }
|
|
375
391
|
})),
|
|
376
|
-
|
|
392
|
+
Y(" " + q(n.isTg ? "Telegram" : "СМС"), 1)
|
|
377
393
|
])
|
|
378
394
|
]),
|
|
379
|
-
n.showPhone ? (p(), T("div",
|
|
380
|
-
S(r(
|
|
395
|
+
n.showPhone ? (p(), T("div", wo, [
|
|
396
|
+
S(r(le), {
|
|
381
397
|
modelValue: r(x),
|
|
382
|
-
"onUpdate:modelValue":
|
|
398
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => ae(x) ? x.value = l : null),
|
|
383
399
|
size: "large",
|
|
384
400
|
"text-size": "medium",
|
|
385
401
|
label: "Телефон",
|
|
386
402
|
type: "tel",
|
|
387
403
|
error: v.value,
|
|
388
|
-
onBlur:
|
|
389
|
-
onInput:
|
|
404
|
+
onBlur: t[1] || (t[1] = (l) => B("phone")),
|
|
405
|
+
onInput: t[2] || (t[2] = (l) => B("phone"))
|
|
390
406
|
}, null, 8, ["modelValue", "error"]),
|
|
391
|
-
S(r(
|
|
407
|
+
S(r(De), {
|
|
392
408
|
class: "icon-locked",
|
|
393
|
-
onClick:
|
|
409
|
+
onClick: t[3] || (t[3] = (l) => n.$emit("edit", "phone"))
|
|
394
410
|
})
|
|
395
|
-
])) :
|
|
396
|
-
c.value ?
|
|
397
|
-
S(r(
|
|
411
|
+
])) : E("", !0),
|
|
412
|
+
c.value ? E("", !0) : (p(), T("div", Po, [
|
|
413
|
+
S(r(Ae), {
|
|
398
414
|
style: { width: "100%" },
|
|
399
|
-
disabled: !
|
|
400
|
-
onClick:
|
|
415
|
+
disabled: !W.value,
|
|
416
|
+
onClick: H
|
|
401
417
|
}, {
|
|
402
|
-
default:
|
|
403
|
-
|
|
418
|
+
default: Q(() => t[6] || (t[6] = [
|
|
419
|
+
Y(" Отправить код ")
|
|
404
420
|
])),
|
|
405
421
|
_: 1,
|
|
406
422
|
__: [6]
|
|
407
423
|
}, 8, ["disabled"])
|
|
408
424
|
])),
|
|
409
|
-
c.value ? (p(), T("div",
|
|
410
|
-
S(r(
|
|
425
|
+
c.value ? (p(), T("div", To, [
|
|
426
|
+
S(r(le), {
|
|
411
427
|
modelValue: r(i),
|
|
412
|
-
"onUpdate:modelValue":
|
|
428
|
+
"onUpdate:modelValue": t[4] || (t[4] = (l) => ae(i) ? i.value = l : null),
|
|
413
429
|
size: "large",
|
|
414
430
|
"text-size": "medium",
|
|
415
431
|
label: "Код",
|
|
416
432
|
type: "text",
|
|
417
|
-
error:
|
|
433
|
+
error: G.value,
|
|
418
434
|
onInput: M,
|
|
419
|
-
onBlur:
|
|
435
|
+
onBlur: t[5] || (t[5] = (l) => B("code"))
|
|
420
436
|
}, null, 8, ["modelValue", "error"])
|
|
421
|
-
])) :
|
|
422
|
-
c.value ? (p(), T("div",
|
|
423
|
-
S(
|
|
437
|
+
])) : E("", !0),
|
|
438
|
+
c.value ? (p(), T("div", So, [
|
|
439
|
+
S(ge, {
|
|
424
440
|
loading: n.loading,
|
|
425
441
|
"rate-limit-text": n.rateLimitText,
|
|
426
442
|
"is-final-limit": n.isFinalLimit,
|
|
427
443
|
"on-send-again": C
|
|
428
444
|
}, {
|
|
429
|
-
extra:
|
|
445
|
+
extra: Q(() => [
|
|
430
446
|
n.isTg ? (p(), T("span", {
|
|
431
447
|
key: 0,
|
|
432
448
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
433
449
|
onClick: y
|
|
434
450
|
}, [
|
|
435
|
-
|
|
436
|
-
S(r(
|
|
437
|
-
])) :
|
|
451
|
+
Y(q(n.sendCodeBySmsText) + " ", 1),
|
|
452
|
+
S(r(se), { style: { "margin-left": "5px" } })
|
|
453
|
+
])) : E("", !0)
|
|
438
454
|
]),
|
|
439
455
|
_: 1
|
|
440
456
|
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
441
|
-
])) :
|
|
457
|
+
])) : E("", !0)
|
|
442
458
|
]));
|
|
443
459
|
}
|
|
444
|
-
}),
|
|
460
|
+
}), xo = { class: "text-center w-full" }, bo = { class: "dialogTitle" }, Vo = {
|
|
445
461
|
key: 0,
|
|
446
462
|
class: "dialogDefaultContainer"
|
|
447
|
-
},
|
|
463
|
+
}, ko = { key: 3 }, Eo = {
|
|
448
464
|
key: 1,
|
|
449
465
|
class: "dialogDefaultContainer"
|
|
450
|
-
},
|
|
466
|
+
}, ie = 3, Lo = /* @__PURE__ */ ue({
|
|
451
467
|
__name: "ProfilePhoneDialog",
|
|
452
468
|
props: {
|
|
453
469
|
modelValue: { type: Boolean },
|
|
@@ -461,45 +477,45 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
461
477
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
462
478
|
setup(z, { expose: b, emit: k }) {
|
|
463
479
|
const u = z, c = k, g = O(u.modelValue);
|
|
464
|
-
|
|
480
|
+
Z(
|
|
465
481
|
() => u.modelValue,
|
|
466
|
-
(
|
|
467
|
-
),
|
|
468
|
-
const f = A(() => u.language ?? "ru"), B = (
|
|
482
|
+
(s) => g.value = s
|
|
483
|
+
), Z(g, (s) => c("update:modelValue", s));
|
|
484
|
+
const f = A(() => u.language ?? "ru"), B = (s) => Ie[f.value] && Ie[f.value][s] || (u.title ?? s), W = A(() => u.title ?? B("Смена номера телефона")), H = A(() => u.hintText ?? B("Чтобы продолжить, введите новый номер")), e = ce({
|
|
469
485
|
oldPhone: u.initialPhone ?? "",
|
|
470
486
|
newPhone: "",
|
|
471
487
|
code: "",
|
|
472
488
|
addPhone: "",
|
|
473
489
|
addCode: ""
|
|
474
|
-
}), M = O(
|
|
475
|
-
async function
|
|
476
|
-
var
|
|
477
|
-
return (
|
|
490
|
+
}), M = O(j.OLD), C = O(null), y = O(!1), x = O(!1), i = O("tg"), h = A(() => i.value === "tg"), v = O(!1), { startTimer: G, remainingSeconds: n, isAvailableForSendAgain: t, totalRateAttempts: l, currentRateAttempt: te } = qe(), { showRateLimitToast: X } = Ke(c), { isEditFlow: _, getFlow: pe } = We(O(u.mode)), ne = A(() => t.value ? "Повторить" : `${n.value}`), J = O(ie), de = A(() => J.value === 0), Ne = (s) => new Promise((a) => setTimeout(a, s));
|
|
491
|
+
async function he(s = "email") {
|
|
492
|
+
var o;
|
|
493
|
+
return (o = (await Oe("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : o.data;
|
|
478
494
|
}
|
|
479
|
-
async function
|
|
495
|
+
async function Ce(s = "phone") {
|
|
480
496
|
var V;
|
|
481
|
-
const
|
|
482
|
-
field:
|
|
497
|
+
const o = (V = (await oe("/users/profile/session/create-if-not-exists", {
|
|
498
|
+
field: s,
|
|
483
499
|
oldValue: N(u.initialPhone)
|
|
484
500
|
})).data) == null ? void 0 : V.data;
|
|
485
|
-
C.value = (
|
|
501
|
+
C.value = (o == null ? void 0 : o.sessionId) ?? null, M.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) ?? "";
|
|
486
502
|
}
|
|
487
503
|
async function ze() {
|
|
488
504
|
try {
|
|
489
|
-
const
|
|
490
|
-
C.value =
|
|
505
|
+
const s = await he("phone");
|
|
506
|
+
C.value = s.sessionId, M.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
|
|
491
507
|
} catch {
|
|
492
|
-
await
|
|
508
|
+
await Ce("phone");
|
|
493
509
|
}
|
|
494
510
|
}
|
|
495
|
-
async function
|
|
496
|
-
var
|
|
511
|
+
async function we(s, a = !1) {
|
|
512
|
+
var o;
|
|
497
513
|
try {
|
|
498
|
-
const V = await
|
|
514
|
+
const V = await oe(
|
|
499
515
|
"/users/profile/check-throttler",
|
|
500
516
|
{
|
|
501
517
|
method: "sms",
|
|
502
|
-
phone: N(
|
|
518
|
+
phone: N(s),
|
|
503
519
|
isInvite: a
|
|
504
520
|
},
|
|
505
521
|
{
|
|
@@ -509,17 +525,17 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
509
525
|
}
|
|
510
526
|
);
|
|
511
527
|
await Ne(1e3);
|
|
512
|
-
const w = (
|
|
513
|
-
return w ? (w.restTimeSec > 0 ? (
|
|
528
|
+
const w = (o = V.data) == null ? void 0 : o.data;
|
|
529
|
+
return w ? (w.restTimeSec > 0 ? (G(w.restTimeSec), t.value = !1, l.value = w.attempts.total, te.value = w.attempts.total - w.attempts.available, J.value = w.attempts.available ?? ie) : t.value = !0, w) : null;
|
|
514
530
|
} catch {
|
|
515
531
|
return null;
|
|
516
532
|
}
|
|
517
533
|
}
|
|
518
|
-
const
|
|
519
|
-
var V, w, L, D, R,
|
|
534
|
+
const ve = async ({ phone: s }) => (v.value = !0, await ee({ value: s, isOnlySms: !0 })), ee = async ({ value: s, isOnlySms: a, offLoading: o } = {}) => {
|
|
535
|
+
var V, w, L, D, R, $;
|
|
520
536
|
y.value = !0;
|
|
521
537
|
try {
|
|
522
|
-
const m =
|
|
538
|
+
const m = s ?? e.oldPhone, d = await oe(
|
|
523
539
|
"/users/profile/phone/contact/send-code",
|
|
524
540
|
{
|
|
525
541
|
sessionId: C.value,
|
|
@@ -542,89 +558,89 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
542
558
|
const I = (R = (D = d.data) == null ? void 0 : D.tooManyRequests) == null ? void 0 : R.type;
|
|
543
559
|
i.value = I;
|
|
544
560
|
const U = d.data.tooManyRequests;
|
|
545
|
-
return U.restTimeSec > 0 ? (
|
|
561
|
+
return U.restTimeSec > 0 ? (G(U.restTimeSec), l.value = U.attempts.total, te.value = U.attempts.total - U.attempts.available, J.value = U.attempts.available ?? ie) : t.value = !0, d;
|
|
546
562
|
}
|
|
547
|
-
return console.debug("sendContactCode after обработка 403 tooManyRequests", d), await
|
|
563
|
+
return console.debug("sendContactCode after обработка 403 tooManyRequests", d), await we(m), d;
|
|
548
564
|
} catch (m) {
|
|
549
|
-
const d = (
|
|
565
|
+
const d = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.tooManyRequests;
|
|
550
566
|
if ((m == null ? void 0 : m.status) === 403 && d) {
|
|
551
567
|
const { restTimeSec: P, attempts: I } = d;
|
|
552
|
-
return P > 0 ? (
|
|
568
|
+
return P > 0 ? (G(P), l.value = I.total, te.value = I.total - I.available, J.value = I.available ?? ie) : t.value = !0, m;
|
|
553
569
|
}
|
|
554
570
|
throw m;
|
|
555
571
|
} finally {
|
|
556
|
-
y.value = !1,
|
|
572
|
+
y.value = !1, o && (y.value = !1);
|
|
557
573
|
}
|
|
558
|
-
},
|
|
559
|
-
var
|
|
574
|
+
}, Pe = async (s, a) => {
|
|
575
|
+
var o, V, w, L, D, R, $, m;
|
|
560
576
|
y.value = !0;
|
|
561
577
|
try {
|
|
562
|
-
const d = await
|
|
578
|
+
const d = await he("phone");
|
|
563
579
|
C.value = d.sessionId, M.value = d.step, e.oldPhone = d.oldValue ?? e.oldPhone, e.newPhone = d.newValue ?? e.newPhone;
|
|
564
|
-
const P = await
|
|
565
|
-
phone: a ===
|
|
580
|
+
const P = await oe("/users/profile/change/phone/match-code", {
|
|
581
|
+
phone: a === j.NEW ? N(e.newPhone) : N(e.oldPhone),
|
|
566
582
|
sessionId: C.value,
|
|
567
|
-
code:
|
|
583
|
+
code: s,
|
|
568
584
|
step: a
|
|
569
|
-
}), I = ((
|
|
570
|
-
if (
|
|
585
|
+
}), I = ((o = P.data) == null ? void 0 : o.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), U = ((D = (L = P.data) == null ? void 0 : L.data) == null ? void 0 : D.rateLimit) ?? ((R = P.data) == null ? void 0 : R.rateLimit) ?? null, Re = (($ = P.data) == null ? void 0 : $.data.success) ?? ((m = P.data) == null ? void 0 : m.success);
|
|
586
|
+
if (X(U), !Re) {
|
|
571
587
|
x.value = !0;
|
|
572
588
|
return;
|
|
573
589
|
}
|
|
574
590
|
if (!I) return P;
|
|
575
|
-
if (M.value = I, I ===
|
|
576
|
-
const $e = await
|
|
591
|
+
if (M.value = I, I === j.NEW) {
|
|
592
|
+
const $e = await he("phone");
|
|
577
593
|
e.oldPhone = $e.oldValue ?? e.oldPhone, e.newPhone = $e.newValue ?? e.newPhone, e.code = "";
|
|
578
594
|
}
|
|
579
|
-
return I ===
|
|
595
|
+
return I === j.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: s }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), P;
|
|
580
596
|
} finally {
|
|
581
597
|
y.value = !1;
|
|
582
598
|
}
|
|
583
|
-
},
|
|
584
|
-
function
|
|
599
|
+
}, Te = ({ code: s }) => Pe(s, j.OLD);
|
|
600
|
+
function Se(s) {
|
|
585
601
|
}
|
|
586
|
-
const
|
|
587
|
-
function
|
|
602
|
+
const Me = ({ code: s }) => Pe(s, j.NEW);
|
|
603
|
+
function xe(s) {
|
|
588
604
|
}
|
|
589
|
-
const
|
|
605
|
+
const re = () => {
|
|
590
606
|
c("close"), g.value = !1;
|
|
591
607
|
};
|
|
592
|
-
async function
|
|
593
|
-
var
|
|
594
|
-
return (
|
|
608
|
+
async function be(s = "phone") {
|
|
609
|
+
var o;
|
|
610
|
+
return (o = (await Oe("/users/profile/session/get-bind-session", { params: { field: s } })).data) == null ? void 0 : o.data;
|
|
595
611
|
}
|
|
596
|
-
async function
|
|
597
|
-
value:
|
|
612
|
+
async function Ve({
|
|
613
|
+
value: s,
|
|
598
614
|
field: a = "phone",
|
|
599
|
-
offLoading:
|
|
615
|
+
offLoading: o = !0
|
|
600
616
|
}) {
|
|
601
617
|
var V, w, L;
|
|
602
618
|
y.value = !0;
|
|
603
619
|
try {
|
|
604
620
|
if (!C.value) {
|
|
605
|
-
const D = await
|
|
621
|
+
const D = await oe("/users/profile/session/bind/create", {
|
|
606
622
|
field: a,
|
|
607
|
-
newValue: N(
|
|
623
|
+
newValue: N(s || e.addPhone)
|
|
608
624
|
});
|
|
609
625
|
if (C.value = ((w = (V = D.data) == null ? void 0 : V.data) == null ? void 0 : w.sessionId) ?? ((L = D.data) == null ? void 0 : L.sessionId) ?? null, !C.value)
|
|
610
626
|
throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
|
|
611
627
|
}
|
|
612
628
|
} finally {
|
|
613
|
-
|
|
629
|
+
o && (y.value = !1);
|
|
614
630
|
}
|
|
615
631
|
}
|
|
616
632
|
async function Fe() {
|
|
617
633
|
try {
|
|
618
|
-
const
|
|
619
|
-
C.value =
|
|
634
|
+
const s = await be("phone");
|
|
635
|
+
C.value = s.sessionId, M.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
|
|
620
636
|
} catch {
|
|
621
|
-
await
|
|
637
|
+
await Ve({ field: "phone", value: e.addPhone });
|
|
622
638
|
}
|
|
623
639
|
}
|
|
624
|
-
const
|
|
625
|
-
value:
|
|
640
|
+
const me = async ({
|
|
641
|
+
value: s,
|
|
626
642
|
field: a = "phone",
|
|
627
|
-
isOnlySms:
|
|
643
|
+
isOnlySms: o = !1,
|
|
628
644
|
offLoading: V = !0
|
|
629
645
|
} = {}) => {
|
|
630
646
|
var w, L, D;
|
|
@@ -632,175 +648,175 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
632
648
|
try {
|
|
633
649
|
if (!C.value)
|
|
634
650
|
throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
|
|
635
|
-
const R =
|
|
651
|
+
const R = s ?? e.addPhone, $ = await oe(
|
|
636
652
|
`/users/profile/bind/contact/send-code/${a}`,
|
|
637
653
|
{
|
|
638
654
|
sessionId: C.value,
|
|
639
655
|
phone: N(R),
|
|
640
656
|
provider: u.provider,
|
|
641
|
-
isOnlySms:
|
|
657
|
+
isOnlySms: o ?? !1
|
|
642
658
|
},
|
|
643
659
|
{
|
|
644
660
|
headers: {
|
|
645
|
-
"x-only-sms":
|
|
661
|
+
"x-only-sms": o ?? !1
|
|
646
662
|
}
|
|
647
663
|
}
|
|
648
|
-
), m = (L = (w =
|
|
664
|
+
), m = (L = (w = $ == null ? void 0 : $.data) == null ? void 0 : w.data) == null ? void 0 : L.deliveryType;
|
|
649
665
|
(m === "tg" || m === "sms") && (i.value = m, m === "tg" && (v.value = !1));
|
|
650
|
-
const d = (D =
|
|
651
|
-
if (
|
|
666
|
+
const d = (D = $.data) == null ? void 0 : D.tooManyRequests;
|
|
667
|
+
if ($.status === 403 && d) {
|
|
652
668
|
const I = d == null ? void 0 : d.type;
|
|
653
|
-
return i.value = I, d.restTimeSec > 0 ? (
|
|
669
|
+
return i.value = I, d.restTimeSec > 0 ? (G(d.restTimeSec), l.value = d.attempts.total, te.value = d.attempts.total - d.attempts.available, J.value = d.attempts.available ?? ie) : t.value = !0, $;
|
|
654
670
|
}
|
|
655
|
-
const P = await
|
|
656
|
-
return P && P.restTimeSec > 0 ? (
|
|
671
|
+
const P = await we(R);
|
|
672
|
+
return P && P.restTimeSec > 0 ? (G(P.restTimeSec), t.value = !1) : t.value = !0, $;
|
|
657
673
|
} finally {
|
|
658
674
|
V && (y.value = !1);
|
|
659
675
|
}
|
|
660
|
-
},
|
|
661
|
-
var a,
|
|
676
|
+
}, ke = async ({ code: s }) => {
|
|
677
|
+
var a, o, V, w, L, D, R, $;
|
|
662
678
|
y.value = !0;
|
|
663
679
|
try {
|
|
664
680
|
if (!C.value) {
|
|
665
|
-
const U = await
|
|
681
|
+
const U = await be("phone");
|
|
666
682
|
C.value = U.sessionId, e.addPhone = U.newValue ?? e.addPhone;
|
|
667
683
|
}
|
|
668
|
-
const m = await
|
|
684
|
+
const m = await oe("/users/profile/bind/phone/match-code", {
|
|
669
685
|
phone: N(e.addPhone),
|
|
670
686
|
sessionId: C.value,
|
|
671
|
-
code:
|
|
672
|
-
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (
|
|
673
|
-
if (
|
|
687
|
+
code: s
|
|
688
|
+
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (o = m.data) == null ? void 0 : o.data) == null ? void 0 : V.nextStep), P = ((L = (w = m.data) == null ? void 0 : w.data) == null ? void 0 : L.rateLimit) ?? ((D = m.data) == null ? void 0 : D.rateLimit) ?? null, I = ((R = m.data) == null ? void 0 : R.data.success) ?? (($ = m.data) == null ? void 0 : $.success);
|
|
689
|
+
if (X(P), !I) {
|
|
674
690
|
x.value = !0;
|
|
675
691
|
return;
|
|
676
692
|
}
|
|
677
|
-
return d && d ===
|
|
693
|
+
return d && d === j.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: s }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), m;
|
|
678
694
|
} finally {
|
|
679
695
|
y.value = !1;
|
|
680
696
|
}
|
|
681
|
-
},
|
|
697
|
+
}, Ee = async () => {
|
|
682
698
|
};
|
|
683
699
|
return Ue(async () => {
|
|
684
700
|
y.value = !0;
|
|
685
|
-
const
|
|
686
|
-
if (u.mode === "bind" &&
|
|
701
|
+
const s = await pe("phone");
|
|
702
|
+
if (u.mode === "bind" && s === "bind") {
|
|
687
703
|
await Fe(), y.value = !1;
|
|
688
704
|
return;
|
|
689
705
|
}
|
|
690
|
-
await ze(), await
|
|
706
|
+
await ze(), await ee({});
|
|
691
707
|
}), b({
|
|
692
708
|
localVisible: g,
|
|
693
709
|
form: e,
|
|
694
710
|
currentStep: M,
|
|
695
711
|
loading: y,
|
|
696
|
-
rateLimitText:
|
|
697
|
-
isAvailable:
|
|
698
|
-
title:
|
|
699
|
-
hintText:
|
|
700
|
-
handleClose:
|
|
701
|
-
sendContactCode:
|
|
702
|
-
sendBindContactCode:
|
|
703
|
-
handleOldCodeSuccess:
|
|
704
|
-
handleOldCodeError:
|
|
705
|
-
handleNewCodeSuccess:
|
|
706
|
-
handleNewCodeError:
|
|
707
|
-
matchBindCode:
|
|
708
|
-
matchBindCodeError:
|
|
709
|
-
}), (
|
|
710
|
-
S(r(
|
|
712
|
+
rateLimitText: ne,
|
|
713
|
+
isAvailable: de,
|
|
714
|
+
title: W,
|
|
715
|
+
hintText: H,
|
|
716
|
+
handleClose: re,
|
|
717
|
+
sendContactCode: ee,
|
|
718
|
+
sendBindContactCode: me,
|
|
719
|
+
handleOldCodeSuccess: Te,
|
|
720
|
+
handleOldCodeError: Se,
|
|
721
|
+
handleNewCodeSuccess: Me,
|
|
722
|
+
handleNewCodeError: xe,
|
|
723
|
+
matchBindCode: ke,
|
|
724
|
+
matchBindCodeError: Ee
|
|
725
|
+
}), (s, a) => (p(), T(je, null, [
|
|
726
|
+
S(r(Ge), {
|
|
711
727
|
modelValue: g.value,
|
|
712
728
|
"onUpdate:modelValue": [
|
|
713
|
-
a[15] || (a[15] = (
|
|
714
|
-
|
|
729
|
+
a[15] || (a[15] = (o) => g.value = o),
|
|
730
|
+
re
|
|
715
731
|
],
|
|
716
732
|
width: "small",
|
|
717
733
|
"auto-height": !0,
|
|
718
734
|
"close-on-click-outside": !0,
|
|
719
|
-
"onClick:outside":
|
|
735
|
+
"onClick:outside": re
|
|
720
736
|
}, {
|
|
721
|
-
header:
|
|
722
|
-
F("div",
|
|
723
|
-
S(r(
|
|
737
|
+
header: Q(() => [
|
|
738
|
+
F("div", xo, [
|
|
739
|
+
S(r(Je), {
|
|
724
740
|
"slot-left": !1,
|
|
725
741
|
size: "small",
|
|
726
742
|
borded: !0,
|
|
727
743
|
"no-padding": !1
|
|
728
744
|
}, {
|
|
729
|
-
title:
|
|
730
|
-
F("span",
|
|
745
|
+
title: Q(() => [
|
|
746
|
+
F("span", bo, q(r(_) ? W.value : "Добавление номера телефона"), 1)
|
|
731
747
|
]),
|
|
732
|
-
"right-button":
|
|
748
|
+
"right-button": Q(() => [
|
|
733
749
|
S(r(Qe), {
|
|
734
750
|
class: "cross",
|
|
735
|
-
onClick:
|
|
751
|
+
onClick: re
|
|
736
752
|
})
|
|
737
753
|
]),
|
|
738
754
|
_: 1
|
|
739
755
|
})
|
|
740
756
|
])
|
|
741
757
|
]),
|
|
742
|
-
default:
|
|
743
|
-
r(
|
|
744
|
-
y.value ? (p(),
|
|
745
|
-
M.value === r(
|
|
758
|
+
default: Q(() => [
|
|
759
|
+
r(_) ? (p(), T("div", Vo, [
|
|
760
|
+
y.value ? (p(), K(Be, { key: 0 })) : E("", !0),
|
|
761
|
+
M.value === r(j).OLD ? (p(), K(lo, {
|
|
746
762
|
key: 1,
|
|
747
763
|
phone: e.oldPhone,
|
|
748
|
-
"onUpdate:phone": a[0] || (a[0] = (
|
|
764
|
+
"onUpdate:phone": a[0] || (a[0] = (o) => e.oldPhone = o),
|
|
749
765
|
code: e.code,
|
|
750
|
-
"onUpdate:code": a[1] || (a[1] = (
|
|
751
|
-
"rate-limit-text":
|
|
752
|
-
"is-final-limit":
|
|
766
|
+
"onUpdate:code": a[1] || (a[1] = (o) => e.code = o),
|
|
767
|
+
"rate-limit-text": ne.value,
|
|
768
|
+
"is-final-limit": de.value,
|
|
753
769
|
"is-not-match-code": x.value,
|
|
754
770
|
loading: y.value,
|
|
755
771
|
"is-tg": h.value,
|
|
756
|
-
onOnSendCode: a[2] || (a[2] = (
|
|
757
|
-
onOnSendCodeAgain: a[3] || (a[3] = (
|
|
758
|
-
onOnSendOnlySms:
|
|
759
|
-
onOnMatchCode:
|
|
760
|
-
onOnMatchCodeError:
|
|
761
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(
|
|
772
|
+
onOnSendCode: a[2] || (a[2] = (o) => ee({ value: e.oldPhone })),
|
|
773
|
+
onOnSendCodeAgain: a[3] || (a[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !h.value && v.value })),
|
|
774
|
+
onOnSendOnlySms: ve,
|
|
775
|
+
onOnMatchCode: Te,
|
|
776
|
+
onOnMatchCodeError: Se
|
|
777
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).NEW ? (p(), K(mo, {
|
|
762
778
|
key: 2,
|
|
763
779
|
phone: e.newPhone,
|
|
764
|
-
"onUpdate:phone": a[4] || (a[4] = (
|
|
780
|
+
"onUpdate:phone": a[4] || (a[4] = (o) => e.newPhone = o),
|
|
765
781
|
oldPhone: e.oldPhone,
|
|
766
|
-
"onUpdate:oldPhone": a[5] || (a[5] = (
|
|
782
|
+
"onUpdate:oldPhone": a[5] || (a[5] = (o) => e.oldPhone = o),
|
|
767
783
|
code: e.code,
|
|
768
|
-
"onUpdate:code": a[6] || (a[6] = (
|
|
769
|
-
"hint-text":
|
|
770
|
-
"rate-limit-text":
|
|
771
|
-
"is-final-limit":
|
|
784
|
+
"onUpdate:code": a[6] || (a[6] = (o) => e.code = o),
|
|
785
|
+
"hint-text": H.value,
|
|
786
|
+
"rate-limit-text": ne.value,
|
|
787
|
+
"is-final-limit": de.value,
|
|
772
788
|
"is-not-match-code": x.value,
|
|
773
789
|
loading: y.value,
|
|
774
790
|
"is-tg": h.value,
|
|
775
|
-
onOnSendCode: a[7] || (a[7] = (
|
|
776
|
-
onOnSendCodeAgain: a[8] || (a[8] = (
|
|
777
|
-
onOnSendOnlySms:
|
|
778
|
-
onOnMatchCode:
|
|
779
|
-
onOnMatchCodeError:
|
|
780
|
-
onOnClearCodeError: a[9] || (a[9] = (
|
|
781
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(
|
|
782
|
-
F("p", null,
|
|
783
|
-
])) :
|
|
784
|
-
])) : (p(), T("div",
|
|
785
|
-
y.value ? (p(),
|
|
786
|
-
S(
|
|
791
|
+
onOnSendCode: a[7] || (a[7] = (o) => ee({ value: e.newPhone })),
|
|
792
|
+
onOnSendCodeAgain: a[8] || (a[8] = (o) => ee({ value: e.newPhone, isOnlySms: !h.value && v.value })),
|
|
793
|
+
onOnSendOnlySms: ve,
|
|
794
|
+
onOnMatchCode: Me,
|
|
795
|
+
onOnMatchCodeError: xe,
|
|
796
|
+
onOnClearCodeError: a[9] || (a[9] = (o) => x.value = !1)
|
|
797
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).COMPLETED ? (p(), T("div", ko, [
|
|
798
|
+
F("p", null, q(B("Телефон успешно изменен")), 1)
|
|
799
|
+
])) : E("", !0)
|
|
800
|
+
])) : (p(), T("div", Eo, [
|
|
801
|
+
y.value ? (p(), K(Be, { key: 0 })) : E("", !0),
|
|
802
|
+
S(Mo, {
|
|
787
803
|
phone: e.addPhone,
|
|
788
|
-
"onUpdate:phone": a[10] || (a[10] = (
|
|
804
|
+
"onUpdate:phone": a[10] || (a[10] = (o) => e.addPhone = o),
|
|
789
805
|
oldPhone: e.oldPhone,
|
|
790
|
-
"onUpdate:oldPhone": a[11] || (a[11] = (
|
|
806
|
+
"onUpdate:oldPhone": a[11] || (a[11] = (o) => e.oldPhone = o),
|
|
791
807
|
code: e.addCode,
|
|
792
|
-
"onUpdate:code": a[12] || (a[12] = (
|
|
793
|
-
"hint-text": r(
|
|
794
|
-
"rate-limit-text":
|
|
795
|
-
"is-final-limit":
|
|
808
|
+
"onUpdate:code": a[12] || (a[12] = (o) => e.addCode = o),
|
|
809
|
+
"hint-text": r(_) ? H.value : "Чтобы продолжить, введите новый номер",
|
|
810
|
+
"rate-limit-text": ne.value,
|
|
811
|
+
"is-final-limit": de.value,
|
|
796
812
|
"is-not-match-code": x.value,
|
|
797
813
|
loading: y.value,
|
|
798
814
|
"is-tg": h.value,
|
|
799
|
-
onOnSendCode: a[13] || (a[13] = (
|
|
800
|
-
onOnSendCodeAgain: a[14] || (a[14] = (
|
|
801
|
-
onOnSendOnlySms:
|
|
802
|
-
onOnMatchCode:
|
|
803
|
-
onOnMatchCodeError:
|
|
815
|
+
onOnSendCode: a[13] || (a[13] = (o) => me({ value: e.addPhone, field: "phone" })),
|
|
816
|
+
onOnSendCodeAgain: a[14] || (a[14] = (o) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && v.value })),
|
|
817
|
+
onOnSendOnlySms: ve,
|
|
818
|
+
onOnMatchCode: ke,
|
|
819
|
+
onOnMatchCodeError: Ee
|
|
804
820
|
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])
|
|
805
821
|
]))
|
|
806
822
|
]),
|
|
@@ -811,5 +827,5 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
811
827
|
}
|
|
812
828
|
});
|
|
813
829
|
export {
|
|
814
|
-
|
|
830
|
+
Lo as default
|
|
815
831
|
};
|
|
@@ -213,9 +213,9 @@ const Ze = {
|
|
|
213
213
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
214
214
|
setup(m, { emit: r }) {
|
|
215
215
|
const n = r, s = h(!0), { currentDialog: v, dialogPayload: g, closeDialog: U } = K(), l = {
|
|
216
|
-
email: G(() => import("./ProfileEmailDialog-
|
|
217
|
-
phone: G(() => import("./ProfilePhoneDialog-
|
|
218
|
-
password: G(() => import("./ProfilePasswordDialog-
|
|
216
|
+
email: G(() => import("./ProfileEmailDialog-DstpXM37.js")),
|
|
217
|
+
phone: G(() => import("./ProfilePhoneDialog-ClsVPLkz.js")),
|
|
218
|
+
password: G(() => import("./ProfilePasswordDialog-yImHpQbw.js"))
|
|
219
219
|
}, d = ({ email: y }) => {
|
|
220
220
|
n("update-email-field", y);
|
|
221
221
|
}, 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-wrapper[data-v-0fcb1c3e] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-0fcb1c3e] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .wide-img .overlay{opacity:1!important}.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-pkvfGwA4.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 m, 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-pkvfGwA4.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")}`;
|