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