@yourgoods/ui-smart 0.46.8 → 0.47.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.
@@ -1,7 +1,7 @@
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-gpF7vjbF.js";
3
- import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-DgXqm9qe.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";
1
+ import { defineComponent as ie, ref as x, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as w, createElementVNode as B, createCommentVNode as D, toDisplayString as ee, createVNode as $, unref as u, isRef as te, withCtx as G, createTextVNode as ne, Fragment as Ae, createBlock as _, resolveDynamicComponent as he, onMounted as Fe } from "vue";
2
+ import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-CcrT2O8l.js";
3
+ import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-dEoNAWMA.js";
4
+ import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as Ve, PDialog as je, PTopBar as Ge, IconCrossMd as Ye } from "@profeat/ui-kit";
5
5
  const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dialogDefaultContainerTextHint" }, Qe = {
6
6
  key: 0,
7
7
  class: "input-wrapper"
@@ -45,7 +45,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { 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())), O = V(() => !T.value || !!e.value), L = async () => {
48
+ }, T = b(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = b(() => !T.value || !!e.value), L = async () => {
49
49
  var p;
50
50
  try {
51
51
  if (h("email"), !T.value) {
@@ -70,17 +70,17 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
70
70
  const C = (p) => {
71
71
  const a = p.target;
72
72
  let i = a.value.replace(/\D/g, "");
73
- i.length <= 4 && s("on-clear-code-error"), 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 }));
73
+ i.length < 4 && s("on-clear-code-error"), 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 }));
74
74
  }, c = () => {
75
75
  s("on-send-code-again", { email: n.emailModel });
76
- }, b = V(() => {
76
+ }, M = b(() => {
77
77
  if (e.value) return e.value;
78
78
  if (n.touched.email) {
79
79
  if (!n.emailModel.trim()) return "Введите e-mail";
80
80
  if (!T.value) return "Это не похоже на e-mail";
81
81
  }
82
82
  return v.emailError || "";
83
- }), M = V(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: P, codeModel: A } = ce(n);
83
+ }), V = b(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: P, codeModel: A } = ce(n);
84
84
  return (p, a) => {
85
85
  const i = ve;
86
86
  return w(), I("div", Je, [
@@ -88,18 +88,18 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
88
88
  p.showEmail ? (w(), I("div", Qe, [
89
89
  $(u(J), {
90
90
  modelValue: u(P),
91
- "onUpdate:modelValue": a[0] || (a[0] = (y) => te(P) ? P.value = y : null),
91
+ "onUpdate:modelValue": a[0] || (a[0] = (g) => te(P) ? P.value = g : null),
92
92
  size: "large",
93
93
  "text-size": "medium",
94
94
  label: "Почта",
95
95
  type: "email",
96
- error: b.value,
97
- onBlur: a[1] || (a[1] = (y) => h("email")),
96
+ error: M.value,
97
+ onBlur: a[1] || (a[1] = (g) => h("email")),
98
98
  onInput: r
99
99
  }, null, 8, ["modelValue", "error"]),
100
100
  $(u(pe), {
101
101
  class: "icon-locked",
102
- onClick: a[2] || (a[2] = (y) => p.$emit("edit", "email"))
102
+ onClick: a[2] || (a[2] = (g) => p.$emit("edit", "email"))
103
103
  })
104
104
  ])) : D("", !0),
105
105
  m.value ? D("", !0) : (w(), I("div", Xe, [
@@ -118,14 +118,14 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
118
118
  m.value ? (w(), I("div", Ze, [
119
119
  $(u(J), {
120
120
  modelValue: u(A),
121
- "onUpdate:modelValue": a[3] || (a[3] = (y) => te(A) ? A.value = y : null),
121
+ "onUpdate:modelValue": a[3] || (a[3] = (g) => te(A) ? A.value = g : null),
122
122
  size: "large",
123
123
  "text-size": "medium",
124
124
  label: "Код",
125
125
  type: "text",
126
- error: M.value,
126
+ error: V.value,
127
127
  onInput: C,
128
- onBlur: a[4] || (a[4] = (y) => h("code"))
128
+ onBlur: a[4] || (a[4] = (g) => h("code"))
129
129
  }, null, 8, ["modelValue", "error"])
130
130
  ])) : D("", !0),
131
131
  !p.loading && m.value ? (w(), I("div", et, [
@@ -142,7 +142,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
142
142
  }), at = { class: "dialogDefaultContainer" }, lt = { class: "dialogDefaultContainerInsideContent" }, ot = { class: "input-wrapper" }, it = { class: "input-wrapper" }, nt = { style: { width: "100%", display: "flex" } }, st = {
143
143
  key: 0,
144
144
  class: "dialogDefaultContainer"
145
- }, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { "margin-top": "12px" } }, Ve = 8, ut = /* @__PURE__ */ ie({
145
+ }, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { "margin-top": "12px" } }, be = 8, ut = /* @__PURE__ */ ie({
146
146
  __name: "AddNewPasswordContent",
147
147
  props: {
148
148
  modelValue: { type: Boolean },
@@ -155,11 +155,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
155
155
  const v = W, s = x(!1), m = x(""), e = x(""), n = Z({
156
156
  newPassword: !1,
157
157
  newPasswordConfirm: !1
158
- }), h = x(R.NEW), d = x(!1), r = x(!1), T = V(() => d.value ? "text" : "password"), O = V(() => r.value ? "text" : "password"), L = () => {
158
+ }), h = x(R.NEW), d = x(!1), r = x(!1), T = b(() => d.value ? "text" : "password"), O = b(() => r.value ? "text" : "password"), L = () => {
159
159
  d.value = !d.value;
160
160
  }, U = () => {
161
161
  r.value = !r.value;
162
- }, 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 = () => {
162
+ }, C = b(() => n.newPassword ? m.value.trim() ? m.value.trim().length < be ? `Пароль слишком короткий. Введите хотя бы ${be} символов` : "" : "Введите пароль" : ""), c = b(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), M = b(() => !!(C.value || c.value)), V = b(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : M.value), P = () => {
163
163
  v("update:modelValue", !1), v("close");
164
164
  }, A = async () => {
165
165
  v("update-user", m.value);
@@ -180,7 +180,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
180
180
  onBlur: a[1] || (a[1] = () => n.newPassword = !0),
181
181
  onInput: a[2] || (a[2] = () => n.newPassword = !0)
182
182
  }, null, 8, ["modelValue", "type", "error"]),
183
- (w(), _(he(d.value ? u(Me) : u(be)), {
183
+ (w(), _(he(d.value ? u(Me) : u(Ve)), {
184
184
  class: "icon-locked",
185
185
  onClick: L
186
186
  }))
@@ -197,7 +197,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
197
197
  onBlur: a[4] || (a[4] = () => n.newPasswordConfirm = !0),
198
198
  onInput: a[5] || (a[5] = () => n.newPasswordConfirm = !0)
199
199
  }, null, 8, ["modelValue", "type", "error"]),
200
- (w(), _(he(r.value ? u(Me) : u(be)), {
200
+ (w(), _(he(r.value ? u(Me) : u(Ve)), {
201
201
  class: "icon-locked",
202
202
  onClick: U
203
203
  }))
@@ -205,7 +205,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
205
205
  B("div", nt, [
206
206
  $(u(se), {
207
207
  style: { width: "100%" },
208
- disabled: M.value,
208
+ disabled: V.value,
209
209
  onClick: A
210
210
  }, {
211
211
  default: G(() => a[6] || (a[6] = [
@@ -277,49 +277,48 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
277
277
  const e = (C) => {
278
278
  m.touched[C] = !0;
279
279
  }, n = x(""), h = (C) => {
280
- s("on-clear-code-error");
281
280
  const c = C.target;
282
- let b = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
283
- 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 }));
281
+ let M = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
282
+ M.length < 4 && s("on-clear-code-error"), M.length > 4 && (M = M.slice(0, 4)), T.value = M, c && c.value !== M && (c.value = M), M.length === 4 && M !== n.value && (n.value = M, s("on-match-code", { email: r.value, code: M }));
284
283
  }, d = () => {
285
284
  s("on-send-code-again", { email: r.value });
286
- }, { 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 : "Введите код" : "");
285
+ }, { emailModel: r, codeModel: T, touched: O } = ce(m), L = b(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = b(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? T.value.trim() ? v.codeError ?? null : "Введите код" : "");
287
286
  return (C, c) => {
288
- const b = ve;
287
+ const M = ve;
289
288
  return w(), I("div", mt, [
290
289
  B("div", ct, ee(C.hintText), 1),
291
290
  C.showEmail ? (w(), I("div", vt, [
292
291
  $(u(J), {
293
292
  modelValue: u(r),
294
- "onUpdate:modelValue": c[0] || (c[0] = (M) => te(r) ? r.value = M : null),
293
+ "onUpdate:modelValue": c[0] || (c[0] = (V) => te(r) ? r.value = V : null),
295
294
  size: "large",
296
295
  "text-size": "medium",
297
296
  label: "Почта",
298
297
  type: "email",
299
298
  error: L.value,
300
299
  disabled: !0,
301
- onBlur: c[1] || (c[1] = (M) => e("email")),
302
- onInput: c[2] || (c[2] = (M) => e("email"))
300
+ onBlur: c[1] || (c[1] = (V) => e("email")),
301
+ onInput: c[2] || (c[2] = (V) => e("email"))
303
302
  }, null, 8, ["modelValue", "error"]),
304
303
  $(u(pe), {
305
304
  class: "icon-locked",
306
- onClick: c[3] || (c[3] = (M) => C.$emit("edit", "email"))
305
+ onClick: c[3] || (c[3] = (V) => C.$emit("edit", "email"))
307
306
  })
308
307
  ])) : D("", !0),
309
308
  C.showCode ? (w(), I("div", pt, [
310
309
  $(u(J), {
311
310
  modelValue: u(T),
312
- "onUpdate:modelValue": c[4] || (c[4] = (M) => te(T) ? T.value = M : null),
311
+ "onUpdate:modelValue": c[4] || (c[4] = (V) => te(T) ? T.value = V : null),
313
312
  size: "large",
314
313
  "text-size": "medium",
315
314
  label: "Код",
316
315
  type: "text",
317
316
  error: U.value,
318
317
  onInput: h,
319
- onBlur: c[5] || (c[5] = (M) => e("code"))
318
+ onBlur: c[5] || (c[5] = (V) => e("code"))
320
319
  }, null, 8, ["modelValue", "error"])
321
320
  ])) : D("", !0),
322
- $(b, {
321
+ $(M, {
323
322
  loading: C.loading,
324
323
  "rate-limit-text": C.rateLimitText,
325
324
  "is-final-limit": C.isFinalLimit,
@@ -328,10 +327,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
328
327
  ]);
329
328
  };
330
329
  }
331
- }), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-5e561fbe"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, yt = {
330
+ }), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, gt = {
332
331
  key: 0,
333
332
  class: "input-wrapper"
334
- }, gt = {
333
+ }, yt = {
335
334
  key: 1,
336
335
  class: "input-wrapper"
337
336
  }, ht = {
@@ -369,15 +368,15 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
369
368
  );
370
369
  const h = (a) => n.touched[a] = !0, d = (a) => n.touched[a] = !1, r = () => {
371
370
  e.value = "", d("email");
372
- }, T = V(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = V(() => !T.value || !!e.value), L = async () => {
371
+ }, T = b(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), O = b(() => !T.value || !!e.value), L = async () => {
373
372
  var a;
374
373
  try {
375
374
  if (h("email"), !T.value) {
376
375
  e.value = "Это не похоже на e-mail";
377
376
  return;
378
377
  }
379
- const i = await $e(n.emailModel), { data: y } = i.data;
380
- if (!(((a = y.data[0]) == null ? void 0 : a.available) ?? !1)) {
378
+ const i = await $e(n.emailModel), { data: g } = i.data;
379
+ if (!(((a = g.data[0]) == null ? void 0 : a.available) ?? !1)) {
381
380
  e.value = "Такой email уже используется";
382
381
  return;
383
382
  }
@@ -388,28 +387,27 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
388
387
  };
389
388
  let U = "";
390
389
  const C = (a) => {
391
- s("on-clear-code-error");
392
390
  const i = a.target;
393
- let y = i.value.replace(/\D/g, "");
394
- 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 }));
391
+ let g = i.value.replace(/\D/g, "");
392
+ g.length < 4 && s("on-clear-code-error"), g.length > 4 && (g = g.slice(0, 4), i.value = g), n.codeModel = g, g.length === 4 && g !== U && (U = g, s("on-match-code", { email: n.emailModel, code: g }));
395
393
  }, c = () => {
396
394
  s("on-send-code-again", { email: n.emailModel });
397
- }, { emailModel: b, codeModel: M, touched: P } = ce(n), A = V(() => {
395
+ }, { emailModel: M, codeModel: V, touched: P } = ce(n), A = b(() => {
398
396
  if (e.value) return e.value;
399
397
  if (n.touched.email) {
400
398
  if (!n.emailModel.trim()) return "Введите e-mail";
401
399
  if (!T.value) return "Это не похоже на e-mail";
402
400
  }
403
401
  return v.emailError || "";
404
- }), p = V(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? M.value.trim() ? v.codeError ?? null : "Введите код" : "");
402
+ }), p = b(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
405
403
  return (a, i) => {
406
- const y = ve;
404
+ const g = ve;
407
405
  return w(), I("div", wt, [
408
406
  B("div", Ct, ee(m.value ? "Введите код подтверждения" : a.hintText), 1),
409
- a.showEmail ? (w(), I("div", yt, [
407
+ a.showEmail ? (w(), I("div", gt, [
410
408
  $(u(J), {
411
- modelValue: u(b),
412
- "onUpdate:modelValue": i[0] || (i[0] = (z) => te(b) ? b.value = z : null),
409
+ modelValue: u(M),
410
+ "onUpdate:modelValue": i[0] || (i[0] = (z) => te(M) ? M.value = z : null),
413
411
  size: "large",
414
412
  "text-size": "medium",
415
413
  label: "Почта",
@@ -423,7 +421,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
423
421
  onClick: i[2] || (i[2] = (z) => a.$emit("edit", "email"))
424
422
  })
425
423
  ])) : D("", !0),
426
- m.value ? D("", !0) : (w(), I("div", gt, [
424
+ m.value ? D("", !0) : (w(), I("div", yt, [
427
425
  $(u(se), {
428
426
  style: { width: "100%" },
429
427
  disabled: O.value,
@@ -438,8 +436,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
438
436
  ])),
439
437
  m.value ? (w(), I("div", ht, [
440
438
  $(u(J), {
441
- modelValue: u(M),
442
- "onUpdate:modelValue": i[3] || (i[3] = (z) => te(M) ? M.value = z : null),
439
+ modelValue: u(V),
440
+ "onUpdate:modelValue": i[3] || (i[3] = (z) => te(V) ? V.value = z : null),
443
441
  size: "large",
444
442
  "text-size": "medium",
445
443
  label: "Код",
@@ -450,7 +448,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
450
448
  }, null, 8, ["modelValue", "error"])
451
449
  ])) : D("", !0),
452
450
  m.value ? (w(), I("div", Tt, [
453
- $(y, {
451
+ $(g, {
454
452
  loading: a.loading,
455
453
  "rate-limit-text": a.rateLimitText,
456
454
  "is-final-limit": a.isFinalLimit,
@@ -460,7 +458,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
460
458
  ]);
461
459
  };
462
460
  }
463
- }), bt = { class: "text-center w-full" }, Vt = { class: "dialogTitle" }, xt = {
461
+ }), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" }, xt = {
464
462
  key: 0,
465
463
  class: "dialogDefaultContainer"
466
464
  }, $t = {
@@ -485,7 +483,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
485
483
  code: "",
486
484
  addEmail: "",
487
485
  addCode: ""
488
- }), 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));
486
+ }), 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 = b(() => L.value === "password-flow"), C = b(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: M, isAvailableForSendAgain: V, totalRateAttempts: P, currentRateAttempt: A } = ze(), { isEditFlow: p, getFlow: a } = Re(x(v.mode ?? "edit")), { showRateLimitToast: i } = We(s), g = b(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), z = b(() => n.code && !e.code.trim() ? "Введите код" : ""), de = b(() => V.value ? "Повторить" : `${M.value}`), j = x(xe), ke = b(() => j.value === 0), Ie = (l) => new Promise((t) => setTimeout(t, l));
489
487
  Y(
490
488
  () => v.modelValue,
491
489
  (l) => m.value = l
@@ -497,7 +495,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
497
495
  var o;
498
496
  try {
499
497
  const E = (o = (await H("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
500
- 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;
498
+ return E ? (await Ie(1e3), E.restTimeSec > 0 ? (c(E.restTimeSec), V.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) : V.value = !0, E) : null;
501
499
  } catch {
502
500
  return null;
503
501
  }
@@ -539,7 +537,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
539
537
  );
540
538
  if (E.status === 403 && ((o = E.data) != null && o.tooManyRequests)) {
541
539
  const S = E.data.tooManyRequests;
542
- 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;
540
+ 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) : V.value = !0, E;
543
541
  }
544
542
  return E;
545
543
  } catch (f) {
@@ -553,8 +551,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
553
551
  if (!e.oldEmail && t === R.OLD) throw new Error("oldEmail пустой — модель потерялась");
554
552
  try {
555
553
  r.value = !0;
556
- const g = await ue();
557
- 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");
554
+ const y = await ue();
555
+ if (d.value = (y == null ? void 0 : y.sessionId) ?? d.value, h.value = (y == null ? void 0 : y.step) ?? h.value, e.oldEmail = (y == null ? void 0 : y.oldValue) ?? e.oldEmail, e.newEmail = (y == null ? void 0 : y.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
558
556
  const F = await H("/users/profile/change/email/match-code", {
559
557
  email: t === R.NEW ? e.newEmail : e.oldEmail,
560
558
  sessionId: d.value,
@@ -573,13 +571,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
573
571
  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"));
574
572
  }
575
573
  return F;
576
- } catch (g) {
577
- 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;
578
- if (console.error("rate-limit debug error: ", g), Q === 429 && F) {
574
+ } catch (y) {
575
+ const F = (k = (oe = y == null ? void 0 : y.response) == null ? void 0 : oe.data) == null ? void 0 : k.rateLimit, Q = (K = y == null ? void 0 : y.response) == null ? void 0 : K.data.statusCode;
576
+ if (console.error("rate-limit debug error: ", y), Q === 429 && F) {
579
577
  console.debug("rate-limit debug status and exists rateLimit: ", F), i(F), T.value = !0;
580
578
  return;
581
579
  }
582
- throw g;
580
+ throw y;
583
581
  } finally {
584
582
  r.value = !1;
585
583
  }
@@ -599,12 +597,12 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
599
597
  async function Le({ code: l }) {
600
598
  await Ce(l, R.OLD);
601
599
  }
602
- function ye(l) {
600
+ function ge(l) {
603
601
  }
604
602
  async function Pe({ code: l }) {
605
603
  await Ce(l, R.NEW);
606
604
  }
607
- const ge = async ({
605
+ const ye = async ({
608
606
  value: l,
609
607
  field: t = "email",
610
608
  offLoading: o = !0
@@ -618,13 +616,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
618
616
  provider: v.provider
619
617
  }), N = (f = S.data) == null ? void 0 : f.tooManyRequests;
620
618
  if (S.status === 403 && N) {
621
- 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;
619
+ 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) : V.value = !0;
622
620
  return;
623
621
  }
624
622
  return S;
625
623
  } finally {
626
624
  const E = await Ee(l ?? e.addEmail);
627
- E && E.restTimeSec > 0 ? c(E.restTimeSec) : M.value = !0, o && (r.value = !1);
625
+ E && E.restTimeSec > 0 ? c(E.restTimeSec) : V.value = !0, o && (r.value = !1);
628
626
  }
629
627
  }, De = async () => {
630
628
  var l, t, o, f, E, S, N, le, oe;
@@ -639,9 +637,9 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
639
637
  code: e.addCode
640
638
  }), K = ((l = k.data) == null ? void 0 : l.nextStep) ?? ((o = (t = k.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
641
639
  L.value = K ?? L.value;
642
- 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;
640
+ const y = ((E = (f = k.data) == null ? void 0 : f.data) == null ? void 0 : E.rateLimit) ?? ((S = k.data) == null ? void 0 : S.rateLimit) ?? null;
643
641
  if (!(k.data.data.success ?? k.data.success)) {
644
- i(g), O.value = !0;
642
+ i(y), O.value = !0;
645
643
  return;
646
644
  }
647
645
  } catch (k) {
@@ -693,7 +691,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
693
691
  "onClick:outside": re
694
692
  }, {
695
693
  header: G(() => [
696
- B("div", bt, [
694
+ B("div", Vt, [
697
695
  $(u(Ge), {
698
696
  "slot-left": !1,
699
697
  size: "small",
@@ -701,7 +699,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
701
699
  "no-padding": !1
702
700
  }, {
703
701
  title: G(() => [
704
- B("span", Vt, ee(C.value), 1)
702
+ B("span", bt, ee(C.value), 1)
705
703
  ]),
706
704
  "right-button": G(() => [
707
705
  $(u(Ye), {
@@ -724,7 +722,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
724
722
  code: e.code,
725
723
  "onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
726
724
  "hint-text": l.hintText,
727
- "email-error": y.value,
725
+ "email-error": g.value,
728
726
  "code-error": z.value,
729
727
  "rate-limit-text": de.value,
730
728
  "is-final-limit": j.value === 0,
@@ -732,7 +730,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
732
730
  loading: r.value,
733
731
  onEdit: fe,
734
732
  onOnMatchCode: Le,
735
- onOnMatchCodeError: ye,
733
+ onOnMatchCodeError: ge,
736
734
  onSendCode: t[2] || (t[2] = (o) => ae({ value: e.oldEmail })),
737
735
  onOnSendCodeAgain: t[3] || (t[3] = (o) => ae({ value: e.oldEmail })),
738
736
  onOnClearCodeError: t[4] || (t[4] = (o) => T.value = !1)
@@ -745,7 +743,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
745
743
  code: e.code,
746
744
  "onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
747
745
  "hint-text": "Введите новый адрес вашей почты",
748
- "email-error": y.value,
746
+ "email-error": g.value,
749
747
  "code-error": z.value,
750
748
  "rate-limit-text": de.value,
751
749
  "is-final-limit": j.value === 0,
@@ -753,7 +751,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
753
751
  loading: r.value,
754
752
  onEdit: fe,
755
753
  onOnMatchCode: Pe,
756
- onOnMatchCodeError: ye,
754
+ onOnMatchCodeError: ge,
757
755
  onOnSendCode: t[8] || (t[8] = (o) => ae({ value: e.newEmail })),
758
756
  onOnSendCodeAgain: t[9] || (t[9] = (o) => ae({ value: e.newEmail })),
759
757
  onOnClearCodeError: t[10] || (t[10] = (o) => T.value = !1)
@@ -780,8 +778,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
780
778
  "is-final-limit": ke.value,
781
779
  "is-not-match-code": O.value,
782
780
  loading: r.value,
783
- onOnSendCode: t[14] || (t[14] = (o) => ge({ value: e.addEmail, field: "email" })),
784
- onOnSendCodeAgain: t[15] || (t[15] = (o) => ge({ value: e.addEmail, field: "email" })),
781
+ onOnSendCode: t[14] || (t[14] = (o) => ye({ value: e.addEmail, field: "email" })),
782
+ onOnSendCodeAgain: t[15] || (t[15] = (o) => ye({ value: e.addEmail, field: "email" })),
785
783
  onOnMatchCode: De,
786
784
  onOnMatchCodeError: Ne,
787
785
  onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
@@ -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-DgXqm9qe.js";
2
+ import { C as I, p as D, g as Ve } from "./index-dEoNAWMA.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) => {