@yourgoods/ui-smart 0.51.0 → 0.51.1
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-CLM-pIRG.js → ProfileEmailDialog-BFVZACzO.js} +2 -2
- package/dist/{ProfilePasswordDialog-BY5VAdH3.js → ProfilePasswordDialog-BSB6ZLoY.js} +1 -1
- package/dist/{ProfilePhoneDialog-BdAKmUji.js → ProfilePhoneDialog-BozJVfL9.js} +63 -62
- package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts +1 -0
- package/dist/components/PEditUserContact/ProfileDialogs/ProfilePhoneDialog.vue.d.ts +1 -0
- package/dist/{index-5nM1qYsp.js → index-DR9kwm5X.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/useRateLimitToast-qLNKIH0n.js +132 -0
- package/package.json +1 -1
- package/dist/useRateLimitToast-BS-y9G79.js +0 -151
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as oe, ref as T, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as y, createElementVNode as x, createCommentVNode as D, toDisplayString as _, createVNode as $, unref as u, isRef as ee, withCtx as G, createTextVNode as ie, Fragment as Ae, createBlock as H, resolveDynamicComponent as he, onMounted as Fe } from "vue";
|
|
2
|
-
import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-
|
|
3
|
-
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-
|
|
2
|
+
import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-qLNKIH0n.js";
|
|
3
|
+
import { C as F, _ as He, B as qe, p as W, g as je } from "./index-DR9kwm5X.js";
|
|
4
4
|
import { PInput as J, IconMailMd as pe, PButton as ne, IconEyeMd as Ve, IconEyeClosedMd as be, PDialog as Ge, PTopBar as Ye, IconCrossMd as Je } from "@profeat/ui-kit";
|
|
5
5
|
const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dialogDefaultContainerTextHint" }, Xe = {
|
|
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-DR9kwm5X.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 S, openBlock as v, createElementVNode as
|
|
2
|
-
import { _ as we, c as Ne, a as He, u as Ge, P as De, b as Je } from "./useRateLimitToast-
|
|
1
|
+
import { createElementBlock as S, openBlock as v, createElementVNode as G, defineComponent as he, reactive as ve, watch as _, ref as D, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as q, createBlock as J, createTextVNode as X, unref as r, isRef as le, withCtx as Y, onMounted as We, Fragment as je } from "vue";
|
|
2
|
+
import { _ as we, c as Ne, a as He, u as Ge, P as De, b as Je } from "./useRateLimitToast-qLNKIH0n.js";
|
|
3
3
|
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
|
|
4
|
-
import { C as
|
|
4
|
+
import { C as H, t as Oe, p as te, g as Ae } from "./index-DR9kwm5X.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
@@ -10,7 +10,7 @@ const _e = {
|
|
|
10
10
|
};
|
|
11
11
|
function et(U, V) {
|
|
12
12
|
return v(), S("svg", _e, V[0] || (V[0] = [
|
|
13
|
-
|
|
13
|
+
G("path", {
|
|
14
14
|
fill: "#1C7EF1",
|
|
15
15
|
"fill-rule": "evenodd",
|
|
16
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",
|
|
@@ -64,18 +64,18 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
64
64
|
const y = h.target;
|
|
65
65
|
let i = ((y == null ? void 0 : y.value) ?? "").replace(/\D/g, "");
|
|
66
66
|
i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), x.value = i, y && y.value !== i && (y.value = i), i.length === 4 && i !== p.value && (p.value = i, u("on-match-code", { phone: e.value, code: i }));
|
|
67
|
-
},
|
|
67
|
+
}, Z = () => u("on-send-code-again", { phone: c.phoneModel }), K = () => {
|
|
68
68
|
u("on-send-only-sms", { phone: c.phoneModel });
|
|
69
69
|
}, { phoneModel: e, codeModel: x, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), O = I(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? x.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
70
70
|
return (h, y) => (v(), S("div", tt, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
G("div", ot, [
|
|
72
|
+
G("div", nt, q(h.hintText), 1),
|
|
73
|
+
G("div", at, [
|
|
74
74
|
h.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
75
75
|
key: 1,
|
|
76
76
|
style: { "margin-left": "5px" }
|
|
77
77
|
})),
|
|
78
|
-
|
|
78
|
+
X(" " + q(h.isTg ? "Telegram" : "СМС"), 1)
|
|
79
79
|
])
|
|
80
80
|
]),
|
|
81
81
|
h.showPhone ? (v(), S("div", lt, [
|
|
@@ -113,16 +113,16 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
113
113
|
loading: h.loading,
|
|
114
114
|
"rate-limit-text": h.rateLimitText,
|
|
115
115
|
"is-final-limit": h.isFinalLimit,
|
|
116
|
-
"on-send-again":
|
|
116
|
+
"on-send-again": Z,
|
|
117
117
|
product: h.product
|
|
118
118
|
}, {
|
|
119
|
-
extra:
|
|
119
|
+
extra: Y(() => [
|
|
120
120
|
h.isTg ? (v(), S("span", {
|
|
121
121
|
key: 0,
|
|
122
122
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
123
123
|
onClick: K
|
|
124
124
|
}, [
|
|
125
|
-
|
|
125
|
+
X(q(h.sendCodeBySmsText) + " ", 1),
|
|
126
126
|
b(r(de), { style: { "margin-left": "5px" } })
|
|
127
127
|
])) : B("", !0)
|
|
128
128
|
]),
|
|
@@ -184,8 +184,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
184
184
|
() => p.codeModel,
|
|
185
185
|
(t) => u("update:code", t)
|
|
186
186
|
);
|
|
187
|
-
const z = (t) => p.touched[t] = !0,
|
|
188
|
-
f.value = "",
|
|
187
|
+
const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
|
|
188
|
+
f.value = "", Z("phone");
|
|
189
189
|
}, e = I(() => {
|
|
190
190
|
const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
191
191
|
return /^\+?\d{10,15}$/.test(l);
|
|
@@ -224,14 +224,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
224
224
|
return E.phoneError || "";
|
|
225
225
|
}), Q = I(() => E.isNotMatchCode ? "Неверный код" : ie.value.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
226
226
|
return (t, l) => (v(), S("div", it, [
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
G("div", rt, [
|
|
228
|
+
G("div", ut, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
229
229
|
c.value ? (v(), S("div", ct, [
|
|
230
230
|
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
231
231
|
key: 1,
|
|
232
232
|
style: { "margin-left": "5px" }
|
|
233
233
|
})),
|
|
234
|
-
|
|
234
|
+
X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
|
|
235
235
|
])) : B("", !0)
|
|
236
236
|
]),
|
|
237
237
|
t.showPhone ? (v(), S("div", pt, [
|
|
@@ -257,8 +257,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
257
257
|
disabled: x.value,
|
|
258
258
|
onClick: P
|
|
259
259
|
}, {
|
|
260
|
-
default:
|
|
261
|
-
|
|
260
|
+
default: Y(() => l[5] || (l[5] = [
|
|
261
|
+
X(" Отправить код ")
|
|
262
262
|
])),
|
|
263
263
|
_: 1,
|
|
264
264
|
__: [5]
|
|
@@ -285,13 +285,13 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
285
285
|
"on-send-again": h,
|
|
286
286
|
product: t.product
|
|
287
287
|
}, {
|
|
288
|
-
extra:
|
|
288
|
+
extra: Y(() => [
|
|
289
289
|
t.isTg ? (v(), S("span", {
|
|
290
290
|
key: 0,
|
|
291
291
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
292
292
|
onClick: y
|
|
293
293
|
}, [
|
|
294
|
-
|
|
294
|
+
X(q(t.sendCodeBySmsText) + " ", 1),
|
|
295
295
|
b(r(de), { style: { "margin-left": "5px" } })
|
|
296
296
|
])) : B("", !0)
|
|
297
297
|
]),
|
|
@@ -328,7 +328,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
328
328
|
loading: { type: Boolean },
|
|
329
329
|
isTg: { type: Boolean },
|
|
330
330
|
product: {},
|
|
331
|
-
onDisableAddPhone: { type: Boolean }
|
|
331
|
+
onDisableAddPhone: { type: Boolean, default: !1 }
|
|
332
332
|
},
|
|
333
333
|
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"],
|
|
334
334
|
setup(U, { emit: V }) {
|
|
@@ -346,8 +346,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
346
346
|
() => p.codeModel,
|
|
347
347
|
(t) => u("update:code", t)
|
|
348
348
|
);
|
|
349
|
-
const z = (t) => p.touched[t] = !0,
|
|
350
|
-
f.value = "",
|
|
349
|
+
const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
|
|
350
|
+
f.value = "", Z("phone");
|
|
351
351
|
}, e = I(() => {
|
|
352
352
|
const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
353
353
|
return /^\+?\d{10,15}$/.test(l);
|
|
@@ -386,14 +386,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
386
386
|
return E.phoneError || "";
|
|
387
387
|
}), Q = I(() => E.isNotMatchCode ? "Неверный код" : p.touched.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
388
388
|
return (t, l) => (v(), S("div", yt, [
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
G("div", gt, [
|
|
390
|
+
G("div", Ct, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
391
391
|
c.value ? (v(), S("div", wt, [
|
|
392
392
|
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
393
393
|
key: 1,
|
|
394
394
|
style: { "margin-left": "5px" }
|
|
395
395
|
})),
|
|
396
|
-
|
|
396
|
+
X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
|
|
397
397
|
])) : B("", !0)
|
|
398
398
|
]),
|
|
399
399
|
t.showPhone ? (v(), S("div", Pt, [
|
|
@@ -409,6 +409,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
409
409
|
onBlur: l[1] || (l[1] = (s) => z("phone")),
|
|
410
410
|
onInput: K
|
|
411
411
|
}, null, 8, ["modelValue", "error", "disabled"]),
|
|
412
|
+
X(" " + q("fuck off: " + t.onDisableAddPhone) + " ", 1),
|
|
412
413
|
b(r(Re), {
|
|
413
414
|
class: "icon-locked",
|
|
414
415
|
onClick: l[2] || (l[2] = (s) => t.$emit("edit", "phone"))
|
|
@@ -420,8 +421,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
420
421
|
disabled: x.value,
|
|
421
422
|
onClick: P
|
|
422
423
|
}, {
|
|
423
|
-
default:
|
|
424
|
-
|
|
424
|
+
default: Y(() => l[5] || (l[5] = [
|
|
425
|
+
X(" Отправить код ")
|
|
425
426
|
])),
|
|
426
427
|
_: 1,
|
|
427
428
|
__: [5]
|
|
@@ -448,13 +449,13 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
448
449
|
"on-send-again": h,
|
|
449
450
|
product: t.product
|
|
450
451
|
}, {
|
|
451
|
-
extra:
|
|
452
|
+
extra: Y(() => [
|
|
452
453
|
t.isTg ? (v(), S("span", {
|
|
453
454
|
key: 0,
|
|
454
455
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
455
456
|
onClick: y
|
|
456
457
|
}, [
|
|
457
|
-
|
|
458
|
+
X(q(t.sendCodeBySmsText) + " ", 1),
|
|
458
459
|
b(r(de), { style: { "margin-left": "5px" } })
|
|
459
460
|
])) : B("", !0)
|
|
460
461
|
]),
|
|
@@ -478,7 +479,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
478
479
|
initialPhone: { default: "" },
|
|
479
480
|
language: {},
|
|
480
481
|
provider: {},
|
|
481
|
-
onDisableAddPhone: { type: Boolean },
|
|
482
|
+
onDisableAddPhone: { type: Boolean, default: !1 },
|
|
482
483
|
mode: { default: void 0 }
|
|
483
484
|
},
|
|
484
485
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
@@ -488,13 +489,13 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
488
489
|
() => u.modelValue,
|
|
489
490
|
(n) => f.value = n
|
|
490
491
|
), _(f, (n) => c("update:modelValue", n));
|
|
491
|
-
const p = I(() => u.language ?? "ru"), z = (n) => Oe[p.value] && Oe[p.value][n] || (u.title ?? n),
|
|
492
|
+
const p = I(() => u.language ?? "ru"), z = (n) => Oe[p.value] && Oe[p.value][n] || (u.title ?? n), Z = I(() => u.title ?? z("Смена номера телефона")), K = I(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
|
|
492
493
|
oldPhone: u.initialPhone ?? "",
|
|
493
494
|
newPhone: "",
|
|
494
495
|
code: "",
|
|
495
496
|
addPhone: "",
|
|
496
497
|
addCode: ""
|
|
497
|
-
}), x = D(
|
|
498
|
+
}), x = D(H.OLD), P = D(null), C = D(!1), O = D(!1), h = D("tg"), y = I(() => h.value === "tg"), i = D(!1), { startTimer: L, remainingSeconds: ie, isAvailableForSendAgain: A, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: l } = Je(c), { isEditFlow: s, getFlow: me } = Ge(D(u.mode)), re = I(() => A.value ? "Повторить" : `${ie.value}`), oe = D(ae), ue = I(() => oe.value === 0), Fe = (n) => new Promise((a) => setTimeout(a, n));
|
|
498
499
|
async function fe(n = "email") {
|
|
499
500
|
var o;
|
|
500
501
|
return (o = (await Ae("/users/profile/session/get-edit-session", { params: { field: n } })).data) == null ? void 0 : o.data;
|
|
@@ -505,7 +506,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
505
506
|
field: n,
|
|
506
507
|
oldValue: F(u.initialPhone)
|
|
507
508
|
})).data) == null ? void 0 : $.data;
|
|
508
|
-
return P.value = (o == null ? void 0 : o.sessionId) ?? null, x.value = (o == null ? void 0 : o.step) ??
|
|
509
|
+
return P.value = (o == null ? void 0 : o.sessionId) ?? null, x.value = (o == null ? void 0 : o.step) ?? H.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
|
|
509
510
|
}
|
|
510
511
|
async function Ue() {
|
|
511
512
|
try {
|
|
@@ -539,7 +540,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
539
540
|
}
|
|
540
541
|
}
|
|
541
542
|
const ye = async ({ phone: n }) => (i.value = !0, await ee({ value: n, isOnlySms: !0 })), ee = async ({ value: n, isOnlySms: a, offLoading: o } = {}) => {
|
|
542
|
-
var $, T, N, R,
|
|
543
|
+
var $, T, N, R, W, j, w;
|
|
543
544
|
C.value = !0;
|
|
544
545
|
try {
|
|
545
546
|
const g = n ?? e.oldPhone, m = await te(
|
|
@@ -559,14 +560,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
559
560
|
}
|
|
560
561
|
), d = (T = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
|
|
561
562
|
if ((d === "tg" || d === "sms") && (h.value = d, d === "tg" && (i.value = !1)), (m == null ? void 0 : m.status) === 403 && ((N = m.data) != null && N.tooManyRequests)) {
|
|
562
|
-
const M = (
|
|
563
|
+
const M = (W = (R = m.data) == null ? void 0 : R.tooManyRequests) == null ? void 0 : W.type;
|
|
563
564
|
h.value = M;
|
|
564
565
|
const k = m.data.tooManyRequests;
|
|
565
566
|
return k.restTimeSec > 0 ? (L(k.restTimeSec), Q.value = k.attempts.total, t.value = k.attempts.total - k.attempts.available, oe.value = k.attempts.available ?? ae) : A.value = !0, m;
|
|
566
567
|
}
|
|
567
568
|
return m;
|
|
568
569
|
} catch (g) {
|
|
569
|
-
if ((g == null ? void 0 : g.status) === 403 && ((w = (
|
|
570
|
+
if ((g == null ? void 0 : g.status) === 403 && ((w = (j = g == null ? void 0 : g.response) == null ? void 0 : j.data) != null && w.tooManyRequests)) {
|
|
570
571
|
const m = g.response.data.tooManyRequests.type;
|
|
571
572
|
h.value = m;
|
|
572
573
|
const d = g.response.data.tooManyRequests;
|
|
@@ -577,27 +578,27 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
577
578
|
await Se(n ?? e.oldPhone), C.value = !1, o && (C.value = !1);
|
|
578
579
|
}
|
|
579
580
|
}, Me = async (n, a) => {
|
|
580
|
-
var o, $, T, N, R,
|
|
581
|
+
var o, $, T, N, R, W, j, w, g, m, d;
|
|
581
582
|
C.value = !0;
|
|
582
583
|
try {
|
|
583
584
|
const M = await fe("phone");
|
|
584
585
|
P.value = M.sessionId, x.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
|
|
585
586
|
const k = await te("/users/profile/change/phone/match-code", {
|
|
586
|
-
phone: a ===
|
|
587
|
+
phone: a === H.NEW ? F(e.newPhone) : F(e.oldPhone),
|
|
587
588
|
sessionId: P.value,
|
|
588
589
|
code: n,
|
|
589
590
|
step: a
|
|
590
|
-
}), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((
|
|
591
|
-
if (!(((
|
|
591
|
+
}), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((W = k.data) == null ? void 0 : W.rateLimit) ?? null;
|
|
592
|
+
if (!(((j = k.data) == null ? void 0 : j.data.success) ?? ((w = k.data) == null ? void 0 : w.success))) {
|
|
592
593
|
l(pe), O.value = !0;
|
|
593
594
|
return;
|
|
594
595
|
}
|
|
595
596
|
if (!ne) return k;
|
|
596
|
-
if (x.value = ne, ne ===
|
|
597
|
+
if (x.value = ne, ne === H.NEW) {
|
|
597
598
|
const Ie = await fe("phone");
|
|
598
599
|
e.oldPhone = Ie.oldValue ?? e.oldPhone, e.newPhone = Ie.newValue ?? e.newPhone, e.code = "";
|
|
599
600
|
}
|
|
600
|
-
return ne ===
|
|
601
|
+
return ne === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: n }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, c("close")), k;
|
|
601
602
|
} catch (M) {
|
|
602
603
|
const k = (m = (g = M == null ? void 0 : M.response) == null ? void 0 : g.data) == null ? void 0 : m.rateLimit;
|
|
603
604
|
if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && k) {
|
|
@@ -608,10 +609,10 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
608
609
|
} finally {
|
|
609
610
|
C.value = !1;
|
|
610
611
|
}
|
|
611
|
-
}, be = ({ code: n }) => Me(n,
|
|
612
|
+
}, be = ({ code: n }) => Me(n, H.OLD);
|
|
612
613
|
function ke(n) {
|
|
613
614
|
}
|
|
614
|
-
const xe = ({ code: n }) => Me(n,
|
|
615
|
+
const xe = ({ code: n }) => Me(n, H.NEW);
|
|
615
616
|
function Ve(n) {
|
|
616
617
|
}
|
|
617
618
|
const ce = () => {
|
|
@@ -655,7 +656,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
655
656
|
isOnlySms: o = !1,
|
|
656
657
|
offLoading: $ = !0
|
|
657
658
|
} = {}) => {
|
|
658
|
-
var T, N, R,
|
|
659
|
+
var T, N, R, W, j;
|
|
659
660
|
C.value = !0;
|
|
660
661
|
try {
|
|
661
662
|
if (!P.value)
|
|
@@ -682,7 +683,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
682
683
|
}
|
|
683
684
|
return g;
|
|
684
685
|
} catch (w) {
|
|
685
|
-
if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((
|
|
686
|
+
if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((j = (W = w == null ? void 0 : w.response) == null ? void 0 : W.data) != null && j.tooManyRequests)) {
|
|
686
687
|
const g = w.response.data.tooManyRequests.type;
|
|
687
688
|
h.value = g;
|
|
688
689
|
const m = w.response.data.tooManyRequests;
|
|
@@ -694,7 +695,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
694
695
|
w && w.restTimeSec > 0 ? (L(w.restTimeSec), A.value = !1) : A.value = !0, $ && (C.value = !1);
|
|
695
696
|
}
|
|
696
697
|
}, Ee = async ({ code: n }) => {
|
|
697
|
-
var a, o, $, T, N, R,
|
|
698
|
+
var a, o, $, T, N, R, W, j, w, g, m;
|
|
698
699
|
C.value = !0;
|
|
699
700
|
try {
|
|
700
701
|
if (!P.value) {
|
|
@@ -706,11 +707,11 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
706
707
|
sessionId: P.value,
|
|
707
708
|
code: n
|
|
708
709
|
}), M = ((a = d.data) == null ? void 0 : a.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), k = ((N = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : N.rateLimit) ?? ((R = d.data) == null ? void 0 : R.rateLimit) ?? null;
|
|
709
|
-
if (!(((
|
|
710
|
+
if (!(((W = d.data) == null ? void 0 : W.data.success) ?? ((j = d.data) == null ? void 0 : j.success))) {
|
|
710
711
|
l(k), O.value = !0;
|
|
711
712
|
return;
|
|
712
713
|
}
|
|
713
|
-
return M && M ===
|
|
714
|
+
return M && M === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: n }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, c("close")), d;
|
|
714
715
|
} catch (d) {
|
|
715
716
|
const M = (g = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : g.rateLimit;
|
|
716
717
|
if (((m = d == null ? void 0 : d.response) == null ? void 0 : m.status) === 429 && M) {
|
|
@@ -738,7 +739,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
738
739
|
loading: C,
|
|
739
740
|
rateLimitText: re,
|
|
740
741
|
isAvailable: ue,
|
|
741
|
-
title:
|
|
742
|
+
title: Z,
|
|
742
743
|
hintText: K,
|
|
743
744
|
handleClose: ce,
|
|
744
745
|
sendContactCode: ee,
|
|
@@ -761,18 +762,18 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
761
762
|
"close-on-click-outside": !0,
|
|
762
763
|
"onClick:outside": ce
|
|
763
764
|
}, {
|
|
764
|
-
header:
|
|
765
|
-
|
|
765
|
+
header: Y(() => [
|
|
766
|
+
G("div", kt, [
|
|
766
767
|
b(r(Xe), {
|
|
767
768
|
"slot-left": !1,
|
|
768
769
|
size: "small",
|
|
769
770
|
borded: !0,
|
|
770
771
|
"no-padding": !1
|
|
771
772
|
}, {
|
|
772
|
-
title:
|
|
773
|
-
|
|
773
|
+
title: Y(() => [
|
|
774
|
+
G("span", xt, q(r(s) ? Z.value : "Добавление номера телефона"), 1)
|
|
774
775
|
]),
|
|
775
|
-
"right-button":
|
|
776
|
+
"right-button": Y(() => [
|
|
776
777
|
b(r(Ye), {
|
|
777
778
|
class: "cross",
|
|
778
779
|
onClick: ce
|
|
@@ -782,10 +783,10 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
782
783
|
})
|
|
783
784
|
])
|
|
784
785
|
]),
|
|
785
|
-
default:
|
|
786
|
+
default: Y(() => [
|
|
786
787
|
r(s) ? (v(), S("div", Vt, [
|
|
787
788
|
C.value ? (v(), J(De, { key: 0 })) : B("", !0),
|
|
788
|
-
x.value === r(
|
|
789
|
+
x.value === r(H).OLD ? (v(), J(dt, {
|
|
789
790
|
key: 1,
|
|
790
791
|
phone: e.oldPhone,
|
|
791
792
|
"onUpdate:phone": a[0] || (a[0] = (o) => e.oldPhone = o),
|
|
@@ -802,7 +803,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
802
803
|
onOnSendOnlySms: ye,
|
|
803
804
|
onOnMatchCode: be,
|
|
804
805
|
onOnMatchCodeError: ke
|
|
805
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(
|
|
806
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).NEW ? (v(), J(ft, {
|
|
806
807
|
key: 2,
|
|
807
808
|
phone: e.newPhone,
|
|
808
809
|
"onUpdate:phone": a[4] || (a[4] = (o) => e.newPhone = o),
|
|
@@ -823,8 +824,8 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
823
824
|
onOnMatchCode: xe,
|
|
824
825
|
onOnMatchCodeError: Ve,
|
|
825
826
|
onOnClearCodeError: a[9] || (a[9] = (o) => O.value = !1)
|
|
826
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(
|
|
827
|
-
|
|
827
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).COMPLETED ? (v(), S("div", $t, [
|
|
828
|
+
G("p", null, q(z("Телефон успешно изменен")), 1)
|
|
828
829
|
])) : B("", !0)
|
|
829
830
|
])) : (v(), S("div", Bt, [
|
|
830
831
|
C.value ? (v(), J(De, { key: 0 })) : B("", !0),
|
package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts
CHANGED
|
@@ -70,5 +70,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
70
70
|
phoneError: string;
|
|
71
71
|
showPhone: boolean;
|
|
72
72
|
sendCodeBySmsText: string;
|
|
73
|
+
onDisableAddPhone: boolean;
|
|
73
74
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
74
75
|
export default _default;
|
|
@@ -87,6 +87,7 @@ declare const _default: import('vue').DefineComponent<Props, {
|
|
|
87
87
|
title: string;
|
|
88
88
|
hintText: string;
|
|
89
89
|
mode: ModeType;
|
|
90
|
+
onDisableAddPhone: boolean;
|
|
90
91
|
initialPhone: string;
|
|
91
92
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
92
93
|
export default _default;
|
|
@@ -217,9 +217,9 @@ const na = {
|
|
|
217
217
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
218
218
|
setup(l, { emit: r }) {
|
|
219
219
|
const n = r, u = w(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), i = {
|
|
220
|
-
email: J(() => import("./ProfileEmailDialog-
|
|
221
|
-
phone: J(() => import("./ProfilePhoneDialog-
|
|
222
|
-
password: J(() => import("./ProfilePasswordDialog-
|
|
220
|
+
email: J(() => import("./ProfileEmailDialog-BFVZACzO.js")),
|
|
221
|
+
phone: J(() => import("./ProfilePhoneDialog-BozJVfL9.js")),
|
|
222
|
+
password: J(() => import("./ProfilePasswordDialog-BSB6ZLoY.js"))
|
|
223
223
|
}, s = ({ email: h }) => {
|
|
224
224
|
n("update-email-field", h);
|
|
225
225
|
}, p = ({ phone: h }) => {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-input[data-v-05cc0841] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-05cc0841] .p-input-file:hover .overlay{visibility:visible}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { a as o } from "./index-
|
|
2
|
+
import { a as o } from "./index-DR9kwm5X.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact
|
|
5
5
|
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ref as n, defineComponent as L, createElementBlock as p, openBlock as v, normalizeClass as c, createVNode as w, unref as _, computed as T, renderSlot as d, createCommentVNode as h, createElementVNode as i, toDisplayString as y, createTextVNode as f } from "vue";
|
|
2
|
+
import { PLoader as $ } from "@profeat/ui-kit";
|
|
3
|
+
import { _ as b, g as C, p as R } from "./index-DR9kwm5X.js";
|
|
4
|
+
function g(s) {
|
|
5
|
+
const e = Math.floor(s / 60), a = s % 60;
|
|
6
|
+
return `${String(e).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|
|
7
|
+
}
|
|
8
|
+
function q() {
|
|
9
|
+
let s = null;
|
|
10
|
+
const e = n(0), a = n(!1), t = n("00:00"), o = n(0), l = n(0), r = n(!1);
|
|
11
|
+
return {
|
|
12
|
+
startTimer: (u, m) => {
|
|
13
|
+
s && clearInterval(s), r.value = !1, e.value = u, a.value = u > 0, t.value = g(u);
|
|
14
|
+
const k = Date.now() + u * 1e3;
|
|
15
|
+
s = setInterval(() => {
|
|
16
|
+
e.value > 1 ? (e.value = Math.max(0, Math.round((k - Date.now()) / 1e3)), t.value = g(e.value)) : (clearInterval(s), e.value = 0, a.value = !1, r.value = !0, m && typeof m == "function" && m());
|
|
17
|
+
}, 1e3);
|
|
18
|
+
},
|
|
19
|
+
isShowRateTimers: a,
|
|
20
|
+
remainingSeconds: t,
|
|
21
|
+
totalRateAttempts: o,
|
|
22
|
+
currentRateAttempt: l,
|
|
23
|
+
isAvailableForSendAgain: r
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const S = /* @__PURE__ */ L({
|
|
27
|
+
__name: "ProfileOverlayLoading",
|
|
28
|
+
setup(s) {
|
|
29
|
+
return (e, a) => (v(), p("div", {
|
|
30
|
+
class: c(e.$style.loaderOverlay)
|
|
31
|
+
}, [
|
|
32
|
+
w(_($), {
|
|
33
|
+
class: "relative m-auto",
|
|
34
|
+
size: "normal"
|
|
35
|
+
})
|
|
36
|
+
], 2));
|
|
37
|
+
}
|
|
38
|
+
}), F = "_loaderOverlay_cpu73_1", M = {
|
|
39
|
+
loaderOverlay: F
|
|
40
|
+
}, x = {
|
|
41
|
+
$style: M
|
|
42
|
+
}, G = /* @__PURE__ */ b(S, [["__cssModules", x], ["__scopeId", "data-v-9e697525"]]);
|
|
43
|
+
function H(s) {
|
|
44
|
+
const e = n("edit"), a = T(() => s.value === "edit" && e.value === "edit");
|
|
45
|
+
return {
|
|
46
|
+
modeFlowFromBack: e,
|
|
47
|
+
isEditFlow: a,
|
|
48
|
+
getFlow: async (o) => {
|
|
49
|
+
const r = (await C("/users/profile/session/flow", { params: { field: o } })).data.data;
|
|
50
|
+
return e.value = r.mode, r.mode;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const J = async (s, e) => {
|
|
55
|
+
try {
|
|
56
|
+
return await R("/users/profile/contact/check-availability", {
|
|
57
|
+
email: s,
|
|
58
|
+
phone: e
|
|
59
|
+
});
|
|
60
|
+
} catch (a) {
|
|
61
|
+
throw console.error("Ошибка проверки доступности", a), a;
|
|
62
|
+
}
|
|
63
|
+
}, A = {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: "spacer",
|
|
66
|
+
style: { height: "20px", width: "100%" }
|
|
67
|
+
}, O = { key: 1 }, B = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, D = "dialogDefaultContainerRateLimitText", I = "dialogDefaultContainerRateLimitTextActive", N = "finalLimitWrapper", P = "finalLimitText", V = "finalLimitLink", K = /* @__PURE__ */ L({
|
|
68
|
+
__name: "ThrottlerTimer",
|
|
69
|
+
props: {
|
|
70
|
+
loading: { type: Boolean, default: !1 },
|
|
71
|
+
rateLimitText: {},
|
|
72
|
+
isFinalLimit: { type: Boolean },
|
|
73
|
+
onSendAgain: {},
|
|
74
|
+
product: {}
|
|
75
|
+
},
|
|
76
|
+
setup(s) {
|
|
77
|
+
const e = s, a = T(() => e.rateLimitText === "Повторить");
|
|
78
|
+
return (t, o) => t.loading ? (v(), p("div", A)) : (v(), p("div", O, [
|
|
79
|
+
t.isFinalLimit ? t.isFinalLimit && t.rateLimitText !== "Повторить" ? d(t.$slots, "final", { key: 1 }, () => [
|
|
80
|
+
i("div", {
|
|
81
|
+
class: c(N)
|
|
82
|
+
}, [
|
|
83
|
+
i("div", {
|
|
84
|
+
class: c(P)
|
|
85
|
+
}, [
|
|
86
|
+
o[1] || (o[1] = f(" Вы слишком часто запрашивали код. ")),
|
|
87
|
+
o[2] || (o[2] = i("br", null, null, -1)),
|
|
88
|
+
f(" Новый код можно получить через " + y(t.rateLimitText) + ". ", 1)
|
|
89
|
+
]),
|
|
90
|
+
i("span", { style: { display: "inline" } }, [
|
|
91
|
+
o[3] || (o[3] = f(" Если есть вопросы — ")),
|
|
92
|
+
i("a", {
|
|
93
|
+
class: c(V),
|
|
94
|
+
href: "https://t.me/yg_support_bot",
|
|
95
|
+
target: "_blank"
|
|
96
|
+
}, "пишите в Telegram.")
|
|
97
|
+
])
|
|
98
|
+
])
|
|
99
|
+
]) : h("", !0) : d(t.$slots, "active", { key: 0 }, () => [
|
|
100
|
+
i("div", B, [
|
|
101
|
+
i("span", {
|
|
102
|
+
class: c([D, { [I]: a.value }]),
|
|
103
|
+
onClick: o[0] || (o[0] = (l) => a.value && t.onSendAgain())
|
|
104
|
+
}, y(a.value ? "Повторить" : `Повторить через ${t.rateLimitText}`), 3),
|
|
105
|
+
d(t.$slots, "extra")
|
|
106
|
+
])
|
|
107
|
+
])
|
|
108
|
+
]));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
function Q(s) {
|
|
112
|
+
return { showRateLimitToast: (t) => {
|
|
113
|
+
if (!t) return;
|
|
114
|
+
const { attemptsLeft: o } = t, l = {
|
|
115
|
+
2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
|
|
116
|
+
1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
|
|
117
|
+
0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
|
|
118
|
+
};
|
|
119
|
+
l[o] && s("on-toast", {
|
|
120
|
+
color: "error",
|
|
121
|
+
text: l[o]
|
|
122
|
+
});
|
|
123
|
+
} };
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
G as P,
|
|
127
|
+
K as _,
|
|
128
|
+
q as a,
|
|
129
|
+
Q as b,
|
|
130
|
+
J as c,
|
|
131
|
+
H as u
|
|
132
|
+
};
|
package/package.json
CHANGED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { ref as r, defineComponent as _, createElementBlock as f, openBlock as v, normalizeClass as c, createVNode as T, unref as h, computed as L, renderSlot as m, createCommentVNode as b, createElementVNode as n, toDisplayString as g, createTextVNode as p } from "vue";
|
|
2
|
-
import { PLoader as k } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as $, g as C, p as R } from "./index-5nM1qYsp.js";
|
|
4
|
-
function y(e) {
|
|
5
|
-
const a = Math.floor(e / 60), s = e % 60;
|
|
6
|
-
return `${String(a).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
7
|
-
}
|
|
8
|
-
function G() {
|
|
9
|
-
let e = null;
|
|
10
|
-
const a = r(0), s = r(!1), t = r("00:00"), o = r(0), i = r(0), l = r(!1);
|
|
11
|
-
return {
|
|
12
|
-
startTimer: (u, d) => {
|
|
13
|
-
e && clearInterval(e), l.value = !1, a.value = u, s.value = u > 0, t.value = y(u);
|
|
14
|
-
const w = Date.now() + u * 1e3;
|
|
15
|
-
e = setInterval(() => {
|
|
16
|
-
a.value > 1 ? (a.value = Math.max(0, Math.round((w - Date.now()) / 1e3)), t.value = y(a.value)) : (clearInterval(e), a.value = 0, s.value = !1, l.value = !0, d && typeof d == "function" && d());
|
|
17
|
-
}, 1e3);
|
|
18
|
-
},
|
|
19
|
-
isShowRateTimers: s,
|
|
20
|
-
remainingSeconds: t,
|
|
21
|
-
totalRateAttempts: o,
|
|
22
|
-
currentRateAttempt: i,
|
|
23
|
-
isAvailableForSendAgain: l
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const S = /* @__PURE__ */ _({
|
|
27
|
-
__name: "ProfileOverlayLoading",
|
|
28
|
-
setup(e) {
|
|
29
|
-
return (a, s) => (v(), f("div", {
|
|
30
|
-
class: c(a.$style.loaderOverlay)
|
|
31
|
-
}, [
|
|
32
|
-
T(h(k), {
|
|
33
|
-
class: "relative m-auto",
|
|
34
|
-
size: "normal"
|
|
35
|
-
})
|
|
36
|
-
], 2));
|
|
37
|
-
}
|
|
38
|
-
}), F = "_loaderOverlay_cpu73_1", M = {
|
|
39
|
-
loaderOverlay: F
|
|
40
|
-
}, A = {
|
|
41
|
-
$style: M
|
|
42
|
-
}, H = /* @__PURE__ */ $(S, [["__cssModules", A], ["__scopeId", "data-v-9e697525"]]);
|
|
43
|
-
function J(e) {
|
|
44
|
-
const a = r("edit"), s = L(() => e.value === "edit" && a.value === "edit");
|
|
45
|
-
return {
|
|
46
|
-
modeFlowFromBack: a,
|
|
47
|
-
isEditFlow: s,
|
|
48
|
-
getFlow: async (o) => {
|
|
49
|
-
const l = (await C("/users/profile/session/flow", { params: { field: o } })).data.data;
|
|
50
|
-
return a.value = l.mode, l.mode;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
const K = async (e, a) => {
|
|
55
|
-
try {
|
|
56
|
-
return await R("/users/profile/contact/check-availability", {
|
|
57
|
-
email: e,
|
|
58
|
-
phone: a
|
|
59
|
-
});
|
|
60
|
-
} catch (s) {
|
|
61
|
-
throw console.error("Ошибка проверки доступности", s), s;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
function x(e) {
|
|
65
|
-
switch (e) {
|
|
66
|
-
case "widget":
|
|
67
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
68
|
-
case "planner":
|
|
69
|
-
return "https://t.me/Yourgood_planner_bot";
|
|
70
|
-
case "sendbot":
|
|
71
|
-
return "https://t.me/care_sendbot";
|
|
72
|
-
case "logic":
|
|
73
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
74
|
-
case "crm":
|
|
75
|
-
return "https://t.me/YourgoodsCRM_bot";
|
|
76
|
-
case "dengi":
|
|
77
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
78
|
-
default:
|
|
79
|
-
return "https://t.me/yourgoodwidget_bot";
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const O = {
|
|
83
|
-
key: 0,
|
|
84
|
-
class: "spacer",
|
|
85
|
-
style: { height: "20px", width: "100%" }
|
|
86
|
-
}, B = { key: 1 }, D = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } }, N = ["href"], P = "dialogDefaultContainerRateLimitText", V = "dialogDefaultContainerRateLimitTextActive", E = "finalLimitWrapper", z = "finalLimitText", W = "finalLimitLink", Q = /* @__PURE__ */ _({
|
|
87
|
-
__name: "ThrottlerTimer",
|
|
88
|
-
props: {
|
|
89
|
-
loading: { type: Boolean, default: !1 },
|
|
90
|
-
rateLimitText: {},
|
|
91
|
-
isFinalLimit: { type: Boolean },
|
|
92
|
-
onSendAgain: {},
|
|
93
|
-
product: {}
|
|
94
|
-
},
|
|
95
|
-
setup(e) {
|
|
96
|
-
const a = e, s = L(() => a.rateLimitText === "Повторить");
|
|
97
|
-
return (t, o) => t.loading ? (v(), f("div", O)) : (v(), f("div", B, [
|
|
98
|
-
t.isFinalLimit ? t.isFinalLimit && t.rateLimitText !== "Повторить" ? m(t.$slots, "final", { key: 1 }, () => [
|
|
99
|
-
n("div", {
|
|
100
|
-
class: c(E)
|
|
101
|
-
}, [
|
|
102
|
-
n("div", {
|
|
103
|
-
class: c(z)
|
|
104
|
-
}, [
|
|
105
|
-
o[1] || (o[1] = p(" Вы слишком часто запрашивали код. ")),
|
|
106
|
-
o[2] || (o[2] = n("br", null, null, -1)),
|
|
107
|
-
p(" Новый код можно получить через " + g(t.rateLimitText) + ". ", 1)
|
|
108
|
-
]),
|
|
109
|
-
n("span", I, [
|
|
110
|
-
o[3] || (o[3] = p(" Если есть вопросы — ")),
|
|
111
|
-
n("a", {
|
|
112
|
-
class: c(W),
|
|
113
|
-
href: h(x)(t.product),
|
|
114
|
-
target: "_blank"
|
|
115
|
-
}, "пишите в Telegram.", 8, N)
|
|
116
|
-
])
|
|
117
|
-
])
|
|
118
|
-
]) : b("", !0) : m(t.$slots, "active", { key: 0 }, () => [
|
|
119
|
-
n("div", D, [
|
|
120
|
-
n("span", {
|
|
121
|
-
class: c([P, { [V]: s.value }]),
|
|
122
|
-
onClick: o[0] || (o[0] = (i) => s.value && t.onSendAgain())
|
|
123
|
-
}, g(s.value ? "Повторить" : `Повторить через ${t.rateLimitText}`), 3),
|
|
124
|
-
m(t.$slots, "extra")
|
|
125
|
-
])
|
|
126
|
-
])
|
|
127
|
-
]));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
function X(e) {
|
|
131
|
-
return { showRateLimitToast: (t) => {
|
|
132
|
-
if (!t) return;
|
|
133
|
-
const { attemptsLeft: o } = t, i = {
|
|
134
|
-
2: "Осталось 2 попытки. После исчерпания лимита ввод кода будет заблокирован на 5 минут",
|
|
135
|
-
1: "Осталась 1 попытка. После следующей ошибки ввод кода будет заблокирован на 5 минут",
|
|
136
|
-
0: "Достигнут лимит попыток ввода кода. Попробуйте снова через 5 минут"
|
|
137
|
-
};
|
|
138
|
-
i[o] && e("on-toast", {
|
|
139
|
-
color: "error",
|
|
140
|
-
text: i[o]
|
|
141
|
-
});
|
|
142
|
-
} };
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
H as P,
|
|
146
|
-
Q as _,
|
|
147
|
-
G as a,
|
|
148
|
-
X as b,
|
|
149
|
-
K as c,
|
|
150
|
-
J as u
|
|
151
|
-
};
|