@yourgoods/ui-smart 0.46.5 → 0.46.7
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-anbTLDAX.js → ProfileEmailDialog-DlGErflr.js} +95 -95
- package/dist/{ProfilePasswordDialog-CeKV-Qzk.js → ProfilePasswordDialog-DLrepGiM.js} +1 -1
- package/dist/{ProfilePhoneDialog-Cu_Ug6x9.js → ProfilePhoneDialog-C8_OQsEV.js} +152 -149
- package/dist/{index-BKwB1EH3.js → index-BSr7kEC4.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast--LDSCeNe.js → useRateLimitToast-D6JDxDzB.js} +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as ie, ref as x, reactive as Z, watch as Y, computed as V, toRefs as ce, createElementBlock as I, openBlock as w, createElementVNode as B, createCommentVNode as D, toDisplayString as ee, createVNode as $, unref as u, isRef as te, withCtx as G, createTextVNode as ne, Fragment as
|
|
2
|
-
import { T as ve, c as $e, u as
|
|
3
|
-
import { C as R, _ as
|
|
4
|
-
import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as be, PDialog as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as ie, ref as x, reactive as Z, watch as Y, computed as V, toRefs as ce, createElementBlock as I, openBlock as w, createElementVNode as B, createCommentVNode as D, toDisplayString as ee, createVNode as $, unref as u, isRef as te, withCtx as G, createTextVNode as ne, Fragment as Ae, createBlock as _, resolveDynamicComponent as he, onMounted as Fe } from "vue";
|
|
2
|
+
import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-D6JDxDzB.js";
|
|
3
|
+
import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-BSr7kEC4.js";
|
|
4
|
+
import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as be, PDialog as je, PTopBar as Ge, IconCrossMd as Ye } from "@profeat/ui-kit";
|
|
5
|
+
const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dialogDefaultContainerTextHint" }, Qe = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "input-wrapper"
|
|
8
|
-
},
|
|
8
|
+
}, Xe = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "input-wrapper"
|
|
11
|
-
},
|
|
11
|
+
}, Ze = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "input-wrapper"
|
|
14
|
-
},
|
|
14
|
+
}, et = { key: 3 }, tt = /* @__PURE__ */ ie({
|
|
15
15
|
__name: "AddNewEmailContent",
|
|
16
16
|
props: {
|
|
17
17
|
email: {},
|
|
@@ -45,7 +45,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
45
45
|
n.touched[p] = !0;
|
|
46
46
|
}, d = (p) => n.touched[p] = !1, r = () => {
|
|
47
47
|
e.value = "", d("email");
|
|
48
|
-
}, T = V(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())),
|
|
48
|
+
}, T = V(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = V(() => !T.value || !!e.value), L = async () => {
|
|
49
49
|
var p;
|
|
50
50
|
try {
|
|
51
51
|
if (h("email"), !T.value) {
|
|
@@ -66,12 +66,12 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
66
66
|
console.error("Неизвестная ошибка при проверке доступности email:", a), e.value = "Это не похоже на e-mail";
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
let
|
|
69
|
+
let U = "";
|
|
70
70
|
const C = (p) => {
|
|
71
71
|
s("on-clear-code-error");
|
|
72
72
|
const a = p.target;
|
|
73
73
|
let i = a.value.replace(/\D/g, "");
|
|
74
|
-
i.length > 4 && (i = i.slice(0, 4)), a.value = i, n.codeModel = i, i.length === 4 && i !==
|
|
74
|
+
i.length > 4 && (i = i.slice(0, 4)), a.value = i, n.codeModel = i, i.length === 4 && i !== U && (U = i, s("on-match-code", { email: n.emailModel, code: i }));
|
|
75
75
|
}, c = () => {
|
|
76
76
|
s("on-send-code-again", { email: n.emailModel });
|
|
77
77
|
}, b = V(() => {
|
|
@@ -81,12 +81,12 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
81
81
|
if (!T.value) return "Это не похоже на e-mail";
|
|
82
82
|
}
|
|
83
83
|
return v.emailError || "";
|
|
84
|
-
}), M = V(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ?
|
|
84
|
+
}), M = V(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: P, codeModel: A } = ce(n);
|
|
85
85
|
return (p, a) => {
|
|
86
86
|
const i = ve;
|
|
87
|
-
return w(), I("div",
|
|
88
|
-
B("div",
|
|
89
|
-
p.showEmail ? (w(), I("div",
|
|
87
|
+
return w(), I("div", Je, [
|
|
88
|
+
B("div", Ke, ee(m.value ? "Введите код подтверждения" : p.hintText), 1),
|
|
89
|
+
p.showEmail ? (w(), I("div", Qe, [
|
|
90
90
|
$(u(J), {
|
|
91
91
|
modelValue: u(P),
|
|
92
92
|
"onUpdate:modelValue": a[0] || (a[0] = (y) => te(P) ? P.value = y : null),
|
|
@@ -103,10 +103,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
103
103
|
onClick: a[2] || (a[2] = (y) => p.$emit("edit", "email"))
|
|
104
104
|
})
|
|
105
105
|
])) : D("", !0),
|
|
106
|
-
m.value ? D("", !0) : (w(), I("div",
|
|
106
|
+
m.value ? D("", !0) : (w(), I("div", Xe, [
|
|
107
107
|
$(u(se), {
|
|
108
108
|
style: { width: "100%" },
|
|
109
|
-
disabled:
|
|
109
|
+
disabled: O.value,
|
|
110
110
|
onClick: L
|
|
111
111
|
}, {
|
|
112
112
|
default: G(() => a[5] || (a[5] = [
|
|
@@ -116,10 +116,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
116
116
|
__: [5]
|
|
117
117
|
}, 8, ["disabled"])
|
|
118
118
|
])),
|
|
119
|
-
m.value ? (w(), I("div",
|
|
119
|
+
m.value ? (w(), I("div", Ze, [
|
|
120
120
|
$(u(J), {
|
|
121
|
-
modelValue: u(
|
|
122
|
-
"onUpdate:modelValue": a[3] || (a[3] = (y) => te(
|
|
121
|
+
modelValue: u(A),
|
|
122
|
+
"onUpdate:modelValue": a[3] || (a[3] = (y) => te(A) ? A.value = y : null),
|
|
123
123
|
size: "large",
|
|
124
124
|
"text-size": "medium",
|
|
125
125
|
label: "Код",
|
|
@@ -129,7 +129,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
129
129
|
onBlur: a[4] || (a[4] = (y) => h("code"))
|
|
130
130
|
}, null, 8, ["modelValue", "error"])
|
|
131
131
|
])) : D("", !0),
|
|
132
|
-
!p.loading && m.value ? (w(), I("div",
|
|
132
|
+
!p.loading && m.value ? (w(), I("div", et, [
|
|
133
133
|
$(i, {
|
|
134
134
|
loading: p.loading,
|
|
135
135
|
"rate-limit-text": p.rateLimitText,
|
|
@@ -140,10 +140,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
140
140
|
]);
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
}),
|
|
143
|
+
}), at = { class: "dialogDefaultContainer" }, lt = { class: "dialogDefaultContainerInsideContent" }, ot = { class: "input-wrapper" }, it = { class: "input-wrapper" }, nt = { style: { width: "100%", display: "flex" } }, st = {
|
|
144
144
|
key: 0,
|
|
145
145
|
class: "dialogDefaultContainer"
|
|
146
|
-
},
|
|
146
|
+
}, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { "margin-top": "12px" } }, Ve = 8, ut = /* @__PURE__ */ ie({
|
|
147
147
|
__name: "AddNewPasswordContent",
|
|
148
148
|
props: {
|
|
149
149
|
modelValue: { type: Boolean },
|
|
@@ -156,20 +156,20 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
156
156
|
const v = W, s = x(!1), m = x(""), e = x(""), n = Z({
|
|
157
157
|
newPassword: !1,
|
|
158
158
|
newPasswordConfirm: !1
|
|
159
|
-
}), h = x(R.NEW), d = x(!1), r = x(!1), T = V(() => d.value ? "text" : "password"),
|
|
159
|
+
}), h = x(R.NEW), d = x(!1), r = x(!1), T = V(() => d.value ? "text" : "password"), O = V(() => r.value ? "text" : "password"), L = () => {
|
|
160
160
|
d.value = !d.value;
|
|
161
|
-
},
|
|
161
|
+
}, U = () => {
|
|
162
162
|
r.value = !r.value;
|
|
163
163
|
}, C = V(() => n.newPassword ? m.value.trim() ? m.value.trim().length < Ve ? `Пароль слишком короткий. Введите хотя бы ${Ve} символов` : "" : "Введите пароль" : ""), c = V(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), b = V(() => !!(C.value || c.value)), M = V(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : b.value), P = () => {
|
|
164
164
|
v("update:modelValue", !1), v("close");
|
|
165
|
-
},
|
|
165
|
+
}, A = async () => {
|
|
166
166
|
v("update-user", m.value);
|
|
167
167
|
};
|
|
168
|
-
return (p, a) => (w(), I(
|
|
169
|
-
B("div",
|
|
170
|
-
B("div",
|
|
168
|
+
return (p, a) => (w(), I(Ae, null, [
|
|
169
|
+
B("div", at, [
|
|
170
|
+
B("div", lt, [
|
|
171
171
|
a[7] || (a[7] = B("div", { class: "dialogDefaultContainerTextHint" }, ee("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
|
|
172
|
-
B("div",
|
|
172
|
+
B("div", ot, [
|
|
173
173
|
$(u(J), {
|
|
174
174
|
modelValue: m.value,
|
|
175
175
|
"onUpdate:modelValue": a[0] || (a[0] = (i) => m.value = i),
|
|
@@ -186,28 +186,28 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
186
186
|
onClick: L
|
|
187
187
|
}))
|
|
188
188
|
]),
|
|
189
|
-
B("div",
|
|
189
|
+
B("div", it, [
|
|
190
190
|
$(u(J), {
|
|
191
191
|
modelValue: e.value,
|
|
192
192
|
"onUpdate:modelValue": a[3] || (a[3] = (i) => e.value = i),
|
|
193
193
|
size: "large",
|
|
194
194
|
"text-size": "medium",
|
|
195
195
|
label: "Повторите новый пароль",
|
|
196
|
-
type:
|
|
196
|
+
type: O.value,
|
|
197
197
|
error: c.value,
|
|
198
198
|
onBlur: a[4] || (a[4] = () => n.newPasswordConfirm = !0),
|
|
199
199
|
onInput: a[5] || (a[5] = () => n.newPasswordConfirm = !0)
|
|
200
200
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
201
201
|
(w(), _(he(r.value ? u(Me) : u(be)), {
|
|
202
202
|
class: "icon-locked",
|
|
203
|
-
onClick:
|
|
203
|
+
onClick: U
|
|
204
204
|
}))
|
|
205
205
|
]),
|
|
206
|
-
B("div",
|
|
206
|
+
B("div", nt, [
|
|
207
207
|
$(u(se), {
|
|
208
208
|
style: { width: "100%" },
|
|
209
209
|
disabled: M.value,
|
|
210
|
-
onClick:
|
|
210
|
+
onClick: A
|
|
211
211
|
}, {
|
|
212
212
|
default: G(() => a[6] || (a[6] = [
|
|
213
213
|
ne(ee("Сохранить"))
|
|
@@ -218,10 +218,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
218
218
|
])
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
|
-
h.value === u(R).COMPLETED ? (w(), I("div",
|
|
222
|
-
B("div",
|
|
221
|
+
h.value === u(R).COMPLETED ? (w(), I("div", st, [
|
|
222
|
+
B("div", dt, [
|
|
223
223
|
a[9] || (a[9] = B("p", null, "Пароль успешно установлен", -1)),
|
|
224
|
-
B("div",
|
|
224
|
+
B("div", rt, [
|
|
225
225
|
$(u(se), {
|
|
226
226
|
style: { width: "100%" },
|
|
227
227
|
onClick: P
|
|
@@ -237,13 +237,13 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
237
237
|
])) : D("", !0)
|
|
238
238
|
], 64));
|
|
239
239
|
}
|
|
240
|
-
}),
|
|
240
|
+
}), mt = { class: "dialogDefaultContainerInsideContent" }, ct = { class: "dialogDefaultContainerTextHint" }, vt = {
|
|
241
241
|
key: 0,
|
|
242
242
|
class: "input-wrapper"
|
|
243
|
-
},
|
|
243
|
+
}, pt = {
|
|
244
244
|
key: 1,
|
|
245
245
|
class: "input-wrapper"
|
|
246
|
-
},
|
|
246
|
+
}, ft = /* @__PURE__ */ ie({
|
|
247
247
|
__name: "OldEmailContent",
|
|
248
248
|
props: {
|
|
249
249
|
email: {},
|
|
@@ -284,12 +284,12 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
284
284
|
b.length > 4 && (b = b.slice(0, 4)), T.value = b, c && c.value !== b && (c.value = b), b.length === 4 && b !== n.value && (n.value = b, s("on-match-code", { email: r.value, code: b }));
|
|
285
285
|
}, d = () => {
|
|
286
286
|
s("on-send-code-again", { email: r.value });
|
|
287
|
-
}, { emailModel: r, codeModel: T, touched:
|
|
287
|
+
}, { emailModel: r, codeModel: T, touched: O } = ce(m), L = V(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = V(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? T.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
288
288
|
return (C, c) => {
|
|
289
289
|
const b = ve;
|
|
290
|
-
return w(), I("div",
|
|
291
|
-
B("div",
|
|
292
|
-
C.showEmail ? (w(), I("div",
|
|
290
|
+
return w(), I("div", mt, [
|
|
291
|
+
B("div", ct, ee(C.hintText), 1),
|
|
292
|
+
C.showEmail ? (w(), I("div", vt, [
|
|
293
293
|
$(u(J), {
|
|
294
294
|
modelValue: u(r),
|
|
295
295
|
"onUpdate:modelValue": c[0] || (c[0] = (M) => te(r) ? r.value = M : null),
|
|
@@ -307,7 +307,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
307
307
|
onClick: c[3] || (c[3] = (M) => C.$emit("edit", "email"))
|
|
308
308
|
})
|
|
309
309
|
])) : D("", !0),
|
|
310
|
-
C.showCode ? (w(), I("div",
|
|
310
|
+
C.showCode ? (w(), I("div", pt, [
|
|
311
311
|
$(u(J), {
|
|
312
312
|
modelValue: u(T),
|
|
313
313
|
"onUpdate:modelValue": c[4] || (c[4] = (M) => te(T) ? T.value = M : null),
|
|
@@ -315,7 +315,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
315
315
|
"text-size": "medium",
|
|
316
316
|
label: "Код",
|
|
317
317
|
type: "text",
|
|
318
|
-
error:
|
|
318
|
+
error: U.value,
|
|
319
319
|
onInput: h,
|
|
320
320
|
onBlur: c[5] || (c[5] = (M) => e("code"))
|
|
321
321
|
}, null, 8, ["modelValue", "error"])
|
|
@@ -329,16 +329,16 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
329
329
|
]);
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
|
-
}),
|
|
332
|
+
}), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-5e561fbe"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, yt = {
|
|
333
333
|
key: 0,
|
|
334
334
|
class: "input-wrapper"
|
|
335
|
-
},
|
|
335
|
+
}, gt = {
|
|
336
336
|
key: 1,
|
|
337
337
|
class: "input-wrapper"
|
|
338
|
-
},
|
|
338
|
+
}, ht = {
|
|
339
339
|
key: 2,
|
|
340
340
|
class: "input-wrapper"
|
|
341
|
-
},
|
|
341
|
+
}, Tt = { key: 3 }, Mt = /* @__PURE__ */ ie({
|
|
342
342
|
__name: "NewEmailContent",
|
|
343
343
|
props: {
|
|
344
344
|
email: {},
|
|
@@ -370,7 +370,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
370
370
|
);
|
|
371
371
|
const h = (a) => n.touched[a] = !0, d = (a) => n.touched[a] = !1, r = () => {
|
|
372
372
|
e.value = "", d("email");
|
|
373
|
-
}, T = V(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())),
|
|
373
|
+
}, T = V(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = V(() => !T.value || !!e.value), L = async () => {
|
|
374
374
|
var a;
|
|
375
375
|
try {
|
|
376
376
|
if (h("email"), !T.value) {
|
|
@@ -387,15 +387,15 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
387
387
|
console.error("Неизвестная ошибка при проверке доступности email:", i), e.value = "Это не похоже на e-mail";
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
let
|
|
390
|
+
let U = "";
|
|
391
391
|
const C = (a) => {
|
|
392
392
|
s("on-clear-code-error");
|
|
393
393
|
const i = a.target;
|
|
394
394
|
let y = i.value.replace(/\D/g, "");
|
|
395
|
-
y.length > 4 && (y = y.slice(0, 4), i.value = y), n.codeModel = y, y.length === 4 && y !==
|
|
395
|
+
y.length > 4 && (y = y.slice(0, 4), i.value = y), n.codeModel = y, y.length === 4 && y !== U && (U = y, s("on-match-code", { email: n.emailModel, code: y }));
|
|
396
396
|
}, c = () => {
|
|
397
397
|
s("on-send-code-again", { email: n.emailModel });
|
|
398
|
-
}, { emailModel: b, codeModel: M, touched: P } = ce(n),
|
|
398
|
+
}, { emailModel: b, codeModel: M, touched: P } = ce(n), A = V(() => {
|
|
399
399
|
if (e.value) return e.value;
|
|
400
400
|
if (n.touched.email) {
|
|
401
401
|
if (!n.emailModel.trim()) return "Введите e-mail";
|
|
@@ -405,9 +405,9 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
405
405
|
}), p = V(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? M.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
406
406
|
return (a, i) => {
|
|
407
407
|
const y = ve;
|
|
408
|
-
return w(), I("div",
|
|
409
|
-
B("div",
|
|
410
|
-
a.showEmail ? (w(), I("div",
|
|
408
|
+
return w(), I("div", wt, [
|
|
409
|
+
B("div", Ct, ee(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
410
|
+
a.showEmail ? (w(), I("div", yt, [
|
|
411
411
|
$(u(J), {
|
|
412
412
|
modelValue: u(b),
|
|
413
413
|
"onUpdate:modelValue": i[0] || (i[0] = (z) => te(b) ? b.value = z : null),
|
|
@@ -415,7 +415,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
415
415
|
"text-size": "medium",
|
|
416
416
|
label: "Почта",
|
|
417
417
|
type: "email",
|
|
418
|
-
error:
|
|
418
|
+
error: A.value,
|
|
419
419
|
onBlur: i[1] || (i[1] = (z) => h("email")),
|
|
420
420
|
onInput: r
|
|
421
421
|
}, null, 8, ["modelValue", "error"]),
|
|
@@ -424,10 +424,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
424
424
|
onClick: i[2] || (i[2] = (z) => a.$emit("edit", "email"))
|
|
425
425
|
})
|
|
426
426
|
])) : D("", !0),
|
|
427
|
-
m.value ? D("", !0) : (w(), I("div",
|
|
427
|
+
m.value ? D("", !0) : (w(), I("div", gt, [
|
|
428
428
|
$(u(se), {
|
|
429
429
|
style: { width: "100%" },
|
|
430
|
-
disabled:
|
|
430
|
+
disabled: O.value,
|
|
431
431
|
onClick: L
|
|
432
432
|
}, {
|
|
433
433
|
default: G(() => i[5] || (i[5] = [
|
|
@@ -437,7 +437,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
437
437
|
__: [5]
|
|
438
438
|
}, 8, ["disabled"])
|
|
439
439
|
])),
|
|
440
|
-
m.value ? (w(), I("div",
|
|
440
|
+
m.value ? (w(), I("div", ht, [
|
|
441
441
|
$(u(J), {
|
|
442
442
|
modelValue: u(M),
|
|
443
443
|
"onUpdate:modelValue": i[3] || (i[3] = (z) => te(M) ? M.value = z : null),
|
|
@@ -450,7 +450,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
450
450
|
onBlur: i[4] || (i[4] = (z) => h("code"))
|
|
451
451
|
}, null, 8, ["modelValue", "error"])
|
|
452
452
|
])) : D("", !0),
|
|
453
|
-
m.value ? (w(), I("div",
|
|
453
|
+
m.value ? (w(), I("div", Tt, [
|
|
454
454
|
$(y, {
|
|
455
455
|
loading: a.loading,
|
|
456
456
|
"rate-limit-text": a.rateLimitText,
|
|
@@ -461,10 +461,10 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
461
461
|
]);
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
}),
|
|
464
|
+
}), bt = { class: "text-center w-full" }, Vt = { class: "dialogTitle" }, xt = {
|
|
465
465
|
key: 0,
|
|
466
466
|
class: "dialogDefaultContainer"
|
|
467
|
-
},
|
|
467
|
+
}, $t = {
|
|
468
468
|
key: 1,
|
|
469
469
|
class: "dialogDefaultContainer"
|
|
470
470
|
}, xe = 3, Pt = /* @__PURE__ */ ie({
|
|
@@ -486,7 +486,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
486
486
|
code: "",
|
|
487
487
|
addEmail: "",
|
|
488
488
|
addCode: ""
|
|
489
|
-
}), n = Z({ email: !1, code: !1 }), h = x(R.OLD), d = x(null), r = x(!1), T = x(!1),
|
|
489
|
+
}), n = Z({ email: !1, code: !1 }), h = x(R.OLD), d = x(null), r = x(!1), T = x(!1), O = x(!1), L = x(_e.VERIFY_EMAIL), U = V(() => L.value === "password-flow"), C = V(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: b, isAvailableForSendAgain: M, totalRateAttempts: P, currentRateAttempt: A } = ze(), { isEditFlow: p, getFlow: a } = Re(x(v.mode ?? "edit")), { showRateLimitToast: i } = We(s), y = V(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), z = V(() => n.code && !e.code.trim() ? "Введите код" : ""), de = V(() => M.value ? "Повторить" : `${b.value}`), j = x(xe), ke = V(() => j.value === 0), Ie = (l) => new Promise((t) => setTimeout(t, l));
|
|
490
490
|
Y(
|
|
491
491
|
() => v.modelValue,
|
|
492
492
|
(l) => m.value = l
|
|
@@ -498,14 +498,14 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
498
498
|
var o;
|
|
499
499
|
try {
|
|
500
500
|
const E = (o = (await H("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
|
|
501
|
-
return E ? (await Ie(1e3), E.restTimeSec > 0 ? (c(E.restTimeSec), M.value = !1, P.value = E.attempts.total ?? P.value,
|
|
501
|
+
return E ? (await Ie(1e3), E.restTimeSec > 0 ? (c(E.restTimeSec), M.value = !1, P.value = E.attempts.total ?? P.value, A.value = (E.attempts.total ?? 0) - (E.attempts.available ?? 0), j.value = E.attempts.available ?? j.value) : M.value = !0, E) : null;
|
|
502
502
|
} catch {
|
|
503
503
|
return null;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
async function ue(l = "email") {
|
|
507
507
|
var o;
|
|
508
|
-
return ((o = (await
|
|
508
|
+
return ((o = (await qe("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : o.data) ?? null;
|
|
509
509
|
}
|
|
510
510
|
async function Se(l = "email") {
|
|
511
511
|
try {
|
|
@@ -540,7 +540,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
540
540
|
);
|
|
541
541
|
if (E.status === 403 && ((o = E.data) != null && o.tooManyRequests)) {
|
|
542
542
|
const S = E.data.tooManyRequests;
|
|
543
|
-
return S.restTimeSec > 0 ? (c(S.restTimeSec), P.value = S.attempts.total ?? P.value,
|
|
543
|
+
return S.restTimeSec > 0 ? (c(S.restTimeSec), P.value = S.attempts.total ?? P.value, A.value = (S.attempts.total ?? 0) - (S.attempts.available ?? 0), j.value = S.attempts.available ?? j.value) : M.value = !0, E;
|
|
544
544
|
}
|
|
545
545
|
return E;
|
|
546
546
|
} catch (f) {
|
|
@@ -556,14 +556,14 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
556
556
|
r.value = !0;
|
|
557
557
|
const g = await ue();
|
|
558
558
|
if (d.value = (g == null ? void 0 : g.sessionId) ?? d.value, h.value = (g == null ? void 0 : g.step) ?? h.value, e.oldEmail = (g == null ? void 0 : g.oldValue) ?? e.oldEmail, e.newEmail = (g == null ? void 0 : g.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
559
|
-
const
|
|
559
|
+
const F = await H("/users/profile/change/email/match-code", {
|
|
560
560
|
email: t === R.NEW ? e.newEmail : e.oldEmail,
|
|
561
561
|
sessionId: d.value,
|
|
562
562
|
code: l,
|
|
563
563
|
step: t
|
|
564
|
-
}), Q = ((o =
|
|
565
|
-
if (
|
|
566
|
-
T.value = !0;
|
|
564
|
+
}), Q = ((o = F.data) == null ? void 0 : o.nextStep) ?? ((E = (f = F.data) == null ? void 0 : f.data) == null ? void 0 : E.nextStep) ?? null, Ue = ((N = (S = F.data) == null ? void 0 : S.data) == null ? void 0 : N.rateLimit) ?? ((le = F.data) == null ? void 0 : le.rateLimit) ?? null;
|
|
565
|
+
if (!(F.data.data.success ?? F.data.success)) {
|
|
566
|
+
i(Ue), T.value = !0;
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
if (Q) {
|
|
@@ -573,11 +573,11 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
573
573
|
}
|
|
574
574
|
h.value === R.COMPLETED && (e.code = "", s("submit-email", { email: e.addEmail, code: l }), s("on-toast", { color: "success", text: "E-mail изменён" }), s("on-update-jwt", "email", "edit", e.newEmail), d.value = null, s("close"));
|
|
575
575
|
}
|
|
576
|
-
return
|
|
576
|
+
return F;
|
|
577
577
|
} catch (g) {
|
|
578
|
-
const
|
|
579
|
-
if (console.error("rate-limit debug error: ", g), Q === 429 &&
|
|
580
|
-
console.debug("rate-limit debug status and exists rateLimit: ",
|
|
578
|
+
const F = (k = (oe = g == null ? void 0 : g.response) == null ? void 0 : oe.data) == null ? void 0 : k.rateLimit, Q = (K = g == null ? void 0 : g.response) == null ? void 0 : K.data.statusCode;
|
|
579
|
+
if (console.error("rate-limit debug error: ", g), Q === 429 && F) {
|
|
580
|
+
console.debug("rate-limit debug status and exists rateLimit: ", F), i(F), T.value = !0;
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
throw g;
|
|
@@ -619,7 +619,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
619
619
|
provider: v.provider
|
|
620
620
|
}), N = (f = S.data) == null ? void 0 : f.tooManyRequests;
|
|
621
621
|
if (S.status === 403 && N) {
|
|
622
|
-
N.restTimeSec > 0 ? (c(N.restTimeSec), P.value = N.attempts.total ?? P.value,
|
|
622
|
+
N.restTimeSec > 0 ? (c(N.restTimeSec), P.value = N.attempts.total ?? P.value, A.value = (N.attempts.total ?? 0) - (N.attempts.available ?? 0), j.value = N.attempts.available ?? xe) : M.value = !0;
|
|
623
623
|
return;
|
|
624
624
|
}
|
|
625
625
|
return S;
|
|
@@ -640,9 +640,9 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
640
640
|
code: e.addCode
|
|
641
641
|
}), K = ((l = k.data) == null ? void 0 : l.nextStep) ?? ((o = (t = k.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
642
642
|
L.value = K ?? L.value;
|
|
643
|
-
const g = ((E = (f = k.data) == null ? void 0 : f.data) == null ? void 0 : E.rateLimit) ?? ((S = k.data) == null ? void 0 : S.rateLimit) ?? null
|
|
644
|
-
if (
|
|
645
|
-
|
|
643
|
+
const g = ((E = (f = k.data) == null ? void 0 : f.data) == null ? void 0 : E.rateLimit) ?? ((S = k.data) == null ? void 0 : S.rateLimit) ?? null;
|
|
644
|
+
if (!(k.data.data.success ?? k.data.success)) {
|
|
645
|
+
i(g), O.value = !0;
|
|
646
646
|
return;
|
|
647
647
|
}
|
|
648
648
|
} catch (k) {
|
|
@@ -674,7 +674,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
674
674
|
r.value = !1;
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
return
|
|
677
|
+
return Fe(async () => {
|
|
678
678
|
r.value = !0;
|
|
679
679
|
const l = await a("email");
|
|
680
680
|
if (v.mode === "bind" && l === "bind") {
|
|
@@ -682,7 +682,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
684
|
await Se(), e.oldEmail && await ae({ value: e.oldEmail }), r.value = !1;
|
|
685
|
-
}), (l, t) => (w(), _(u(
|
|
685
|
+
}), (l, t) => (w(), _(u(je), {
|
|
686
686
|
modelValue: m.value,
|
|
687
687
|
"onUpdate:modelValue": [
|
|
688
688
|
t[18] || (t[18] = (o) => m.value = o),
|
|
@@ -694,18 +694,18 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
694
694
|
"onClick:outside": re
|
|
695
695
|
}, {
|
|
696
696
|
header: G(() => [
|
|
697
|
-
B("div",
|
|
698
|
-
$(u(
|
|
697
|
+
B("div", bt, [
|
|
698
|
+
$(u(Ge), {
|
|
699
699
|
"slot-left": !1,
|
|
700
700
|
size: "small",
|
|
701
701
|
borded: !0,
|
|
702
702
|
"no-padding": !1
|
|
703
703
|
}, {
|
|
704
704
|
title: G(() => [
|
|
705
|
-
B("span",
|
|
705
|
+
B("span", Vt, ee(C.value), 1)
|
|
706
706
|
]),
|
|
707
707
|
"right-button": G(() => [
|
|
708
|
-
$(u(
|
|
708
|
+
$(u(Ye), {
|
|
709
709
|
class: "cross",
|
|
710
710
|
onClick: re
|
|
711
711
|
})
|
|
@@ -716,9 +716,9 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
716
716
|
]),
|
|
717
717
|
default: G(() => [
|
|
718
718
|
B("div", null, [
|
|
719
|
-
u(p) ? (w(), I("div",
|
|
719
|
+
u(p) ? (w(), I("div", xt, [
|
|
720
720
|
r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
|
|
721
|
-
h.value === u(R).OLD ? (w(), _(
|
|
721
|
+
h.value === u(R).OLD ? (w(), _(Et, {
|
|
722
722
|
key: 1,
|
|
723
723
|
email: e.oldEmail,
|
|
724
724
|
"onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
|
|
@@ -737,7 +737,7 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
737
737
|
onSendCode: t[2] || (t[2] = (o) => ae({ value: e.oldEmail })),
|
|
738
738
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ae({ value: e.oldEmail })),
|
|
739
739
|
onOnClearCodeError: t[4] || (t[4] = (o) => T.value = !1)
|
|
740
|
-
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : h.value === u(R).NEW ? (w(), _(
|
|
740
|
+
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : h.value === u(R).NEW ? (w(), _(Mt, {
|
|
741
741
|
key: 2,
|
|
742
742
|
email: e.newEmail,
|
|
743
743
|
"onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
|
|
@@ -759,16 +759,16 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
759
759
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ae({ value: e.newEmail })),
|
|
760
760
|
onOnClearCodeError: t[10] || (t[10] = (o) => T.value = !1)
|
|
761
761
|
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : D("", !0)
|
|
762
|
-
])) : (w(), I("div",
|
|
762
|
+
])) : (w(), I("div", $t, [
|
|
763
763
|
r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
|
|
764
|
-
|
|
764
|
+
U.value ? (w(), _(ut, {
|
|
765
765
|
key: 2,
|
|
766
766
|
"model-value": m.value,
|
|
767
767
|
"email-session-id": d.value,
|
|
768
768
|
"onUpdate:modelValue": t[17] || (t[17] = (o) => s("update:modelValue", o)),
|
|
769
769
|
onUpdateUser: Oe,
|
|
770
770
|
onClose: Be
|
|
771
|
-
}, null, 8, ["model-value", "email-session-id"])) : (w(), _(
|
|
771
|
+
}, null, 8, ["model-value", "email-session-id"])) : (w(), _(tt, {
|
|
772
772
|
key: 1,
|
|
773
773
|
email: e.addEmail,
|
|
774
774
|
"onUpdate:email": t[11] || (t[11] = (o) => e.addEmail = o),
|
|
@@ -779,13 +779,13 @@ const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dial
|
|
|
779
779
|
"hint-text": u(p) ? l.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
|
|
780
780
|
"rate-limit-text": de.value,
|
|
781
781
|
"is-final-limit": ke.value,
|
|
782
|
-
"is-not-match-code":
|
|
782
|
+
"is-not-match-code": O.value,
|
|
783
783
|
loading: r.value,
|
|
784
784
|
onOnSendCode: t[14] || (t[14] = (o) => ge({ value: e.addEmail, field: "email" })),
|
|
785
785
|
onOnSendCodeAgain: t[15] || (t[15] = (o) => ge({ value: e.addEmail, field: "email" })),
|
|
786
786
|
onOnMatchCode: De,
|
|
787
787
|
onOnMatchCodeError: Ne,
|
|
788
|
-
onOnClearCodeError: t[16] || (t[16] = (o) =>
|
|
788
|
+
onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
|
|
789
789
|
}, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
|
|
790
790
|
]))
|
|
791
791
|
])
|
|
@@ -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-BSr7kEC4.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) => {
|