@yourgoods/ui-smart 0.50.0 → 0.50.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,6 +1,6 @@
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-BDwiUmEF.js";
3
- import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-B03tgxbV.js";
1
+ import { defineComponent as ie, ref as $, 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 x, 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 xe, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-DID9XsBg.js";
3
+ import { C as F, _ as He, B as _e, p as H, g as qe } from "./index-Dt-xD4lU.js";
4
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,
@@ -27,7 +27,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
27
27
  },
28
28
  emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
29
29
  setup(q, { emit: W }) {
30
- const v = q, s = W, m = x(!1), e = x(""), n = Z({
30
+ const v = q, s = W, m = $(!1), e = $(""), n = Z({
31
31
  emailModel: v.email || "",
32
32
  codeModel: "",
33
33
  touched: { email: !1, code: !1 }
@@ -52,7 +52,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
52
52
  e.value = "Это не похоже на e-mail";
53
53
  return;
54
54
  }
55
- const a = await $e(n.emailModel), { data: i } = a.data;
55
+ const a = await xe(n.emailModel), { data: i } = a.data;
56
56
  if (!(((p = i.data[0]) == null ? void 0 : p.available) ?? !1)) {
57
57
  e.value = "Такой email уже используется";
58
58
  return;
@@ -86,24 +86,24 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
86
86
  return w(), I("div", Je, [
87
87
  B("div", Ke, ee(m.value ? "Введите код подтверждения" : p.hintText), 1),
88
88
  p.showEmail ? (w(), I("div", Qe, [
89
- $(u(J), {
89
+ x(u(J), {
90
90
  modelValue: u(P),
91
- "onUpdate:modelValue": a[0] || (a[0] = (g) => te(P) ? P.value = g : null),
91
+ "onUpdate:modelValue": a[0] || (a[0] = (y) => te(P) ? P.value = y : null),
92
92
  size: "large",
93
93
  "text-size": "medium",
94
94
  label: "Почта",
95
95
  type: "email",
96
96
  error: M.value,
97
- onBlur: a[1] || (a[1] = (g) => h("email")),
97
+ onBlur: a[1] || (a[1] = (y) => h("email")),
98
98
  onInput: r
99
99
  }, null, 8, ["modelValue", "error"]),
100
- $(u(pe), {
100
+ x(u(pe), {
101
101
  class: "icon-locked",
102
- onClick: a[2] || (a[2] = (g) => p.$emit("edit", "email"))
102
+ onClick: a[2] || (a[2] = (y) => p.$emit("edit", "email"))
103
103
  })
104
104
  ])) : D("", !0),
105
105
  m.value ? D("", !0) : (w(), I("div", Xe, [
106
- $(u(se), {
106
+ x(u(se), {
107
107
  style: { width: "100%" },
108
108
  disabled: O.value,
109
109
  onClick: L
@@ -116,20 +116,20 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
116
116
  }, 8, ["disabled"])
117
117
  ])),
118
118
  m.value ? (w(), I("div", Ze, [
119
- $(u(J), {
119
+ x(u(J), {
120
120
  modelValue: u(A),
121
- "onUpdate:modelValue": a[3] || (a[3] = (g) => te(A) ? A.value = g : null),
121
+ "onUpdate:modelValue": a[3] || (a[3] = (y) => te(A) ? A.value = y : null),
122
122
  size: "large",
123
123
  "text-size": "medium",
124
124
  label: "Код",
125
125
  type: "text",
126
126
  error: V.value,
127
127
  onInput: C,
128
- onBlur: a[4] || (a[4] = (g) => h("code"))
128
+ onBlur: a[4] || (a[4] = (y) => h("code"))
129
129
  }, null, 8, ["modelValue", "error"])
130
130
  ])) : D("", !0),
131
131
  !p.loading && m.value ? (w(), I("div", et, [
132
- $(i, {
132
+ x(i, {
133
133
  loading: p.loading,
134
134
  "rate-limit-text": p.rateLimitText,
135
135
  "is-final-limit": p.isFinalLimit,
@@ -152,10 +152,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
152
152
  },
153
153
  emits: ["update:modelValue", "submit", "close", "update-user"],
154
154
  setup(q, { emit: W }) {
155
- const v = W, s = x(!1), m = x(""), e = x(""), n = Z({
155
+ const v = W, s = $(!1), m = $(""), e = $(""), n = Z({
156
156
  newPassword: !1,
157
157
  newPasswordConfirm: !1
158
- }), h = x(R.NEW), d = x(!1), r = x(!1), T = b(() => d.value ? "text" : "password"), O = b(() => r.value ? "text" : "password"), L = () => {
158
+ }), h = $(F.NEW), d = $(!1), r = $(!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;
@@ -169,7 +169,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
169
169
  B("div", lt, [
170
170
  a[7] || (a[7] = B("div", { class: "dialogDefaultContainerTextHint" }, ee("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
171
171
  B("div", ot, [
172
- $(u(J), {
172
+ x(u(J), {
173
173
  modelValue: m.value,
174
174
  "onUpdate:modelValue": a[0] || (a[0] = (i) => m.value = i),
175
175
  size: "large",
@@ -186,7 +186,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
186
186
  }))
187
187
  ]),
188
188
  B("div", it, [
189
- $(u(J), {
189
+ x(u(J), {
190
190
  modelValue: e.value,
191
191
  "onUpdate:modelValue": a[3] || (a[3] = (i) => e.value = i),
192
192
  size: "large",
@@ -203,7 +203,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
203
203
  }))
204
204
  ]),
205
205
  B("div", nt, [
206
- $(u(se), {
206
+ x(u(se), {
207
207
  style: { width: "100%" },
208
208
  disabled: V.value,
209
209
  onClick: A
@@ -217,11 +217,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
217
217
  ])
218
218
  ])
219
219
  ]),
220
- h.value === u(R).COMPLETED ? (w(), I("div", st, [
220
+ h.value === u(F).COMPLETED ? (w(), I("div", st, [
221
221
  B("div", dt, [
222
222
  a[9] || (a[9] = B("p", null, "Пароль успешно установлен", -1)),
223
223
  B("div", rt, [
224
- $(u(se), {
224
+ x(u(se), {
225
225
  style: { width: "100%" },
226
226
  onClick: P
227
227
  }, {
@@ -276,7 +276,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
276
276
  );
277
277
  const e = (C) => {
278
278
  m.touched[C] = !0;
279
- }, n = x(""), h = (C) => {
279
+ }, n = $(""), h = (C) => {
280
280
  const c = C.target;
281
281
  let M = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
282
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 }));
@@ -288,7 +288,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
288
288
  return w(), I("div", mt, [
289
289
  B("div", ct, ee(C.hintText), 1),
290
290
  C.showEmail ? (w(), I("div", vt, [
291
- $(u(J), {
291
+ x(u(J), {
292
292
  modelValue: u(r),
293
293
  "onUpdate:modelValue": c[0] || (c[0] = (V) => te(r) ? r.value = V : null),
294
294
  size: "large",
@@ -300,13 +300,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
300
300
  onBlur: c[1] || (c[1] = (V) => e("email")),
301
301
  onInput: c[2] || (c[2] = (V) => e("email"))
302
302
  }, null, 8, ["modelValue", "error"]),
303
- $(u(pe), {
303
+ x(u(pe), {
304
304
  class: "icon-locked",
305
305
  onClick: c[3] || (c[3] = (V) => C.$emit("edit", "email"))
306
306
  })
307
307
  ])) : D("", !0),
308
308
  C.showCode ? (w(), I("div", pt, [
309
- $(u(J), {
309
+ x(u(J), {
310
310
  modelValue: u(T),
311
311
  "onUpdate:modelValue": c[4] || (c[4] = (V) => te(T) ? T.value = V : null),
312
312
  size: "large",
@@ -318,7 +318,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
318
318
  onBlur: c[5] || (c[5] = (V) => e("code"))
319
319
  }, null, 8, ["modelValue", "error"])
320
320
  ])) : D("", !0),
321
- $(M, {
321
+ x(M, {
322
322
  loading: C.loading,
323
323
  "rate-limit-text": C.rateLimitText,
324
324
  "is-final-limit": C.isFinalLimit,
@@ -327,10 +327,10 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
327
327
  ]);
328
328
  };
329
329
  }
330
- }), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, gt = {
330
+ }), Et = /* @__PURE__ */ He(ft, [["__scopeId", "data-v-fa4de20f"]]), wt = { class: "dialogDefaultContainerInsideContent" }, Ct = { class: "dialogDefaultContainerTextHint" }, yt = {
331
331
  key: 0,
332
332
  class: "input-wrapper"
333
- }, yt = {
333
+ }, gt = {
334
334
  key: 1,
335
335
  class: "input-wrapper"
336
336
  }, ht = {
@@ -352,7 +352,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
352
352
  },
353
353
  emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
354
354
  setup(q, { emit: W }) {
355
- const v = q, s = W, m = x(!1), e = x(""), n = Z({
355
+ const v = q, s = W, m = $(!1), e = $(""), n = Z({
356
356
  touched: { email: !1, code: !1 },
357
357
  emailModel: "",
358
358
  codeModel: ""
@@ -375,8 +375,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
375
375
  e.value = "Это не похоже на e-mail";
376
376
  return;
377
377
  }
378
- const i = await $e(n.emailModel), { data: g } = i.data;
379
- if (!(((a = g.data[0]) == null ? void 0 : a.available) ?? !1)) {
378
+ const i = await xe(n.emailModel), { data: y } = i.data;
379
+ if (!(((a = y.data[0]) == null ? void 0 : a.available) ?? !1)) {
380
380
  e.value = "Такой email уже используется";
381
381
  return;
382
382
  }
@@ -388,8 +388,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
388
388
  let U = "";
389
389
  const C = (a) => {
390
390
  const i = a.target;
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 }));
391
+ let y = i.value.replace(/\D/g, "");
392
+ y.length < 4 && s("on-clear-code-error"), 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 }));
393
393
  }, c = () => {
394
394
  s("on-send-code-again", { email: n.emailModel });
395
395
  }, { emailModel: M, codeModel: V, touched: P } = ce(n), A = b(() => {
@@ -401,11 +401,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
401
401
  return v.emailError || "";
402
402
  }), p = b(() => v.isNotMatchCode ? "Неверный код" : P.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
403
403
  return (a, i) => {
404
- const g = ve;
404
+ const y = ve;
405
405
  return w(), I("div", wt, [
406
406
  B("div", Ct, ee(m.value ? "Введите код подтверждения" : a.hintText), 1),
407
- a.showEmail ? (w(), I("div", gt, [
408
- $(u(J), {
407
+ a.showEmail ? (w(), I("div", yt, [
408
+ x(u(J), {
409
409
  modelValue: u(M),
410
410
  "onUpdate:modelValue": i[0] || (i[0] = (z) => te(M) ? M.value = z : null),
411
411
  size: "large",
@@ -416,13 +416,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
416
416
  onBlur: i[1] || (i[1] = (z) => h("email")),
417
417
  onInput: r
418
418
  }, null, 8, ["modelValue", "error"]),
419
- $(u(pe), {
419
+ x(u(pe), {
420
420
  class: "icon-locked",
421
421
  onClick: i[2] || (i[2] = (z) => a.$emit("edit", "email"))
422
422
  })
423
423
  ])) : D("", !0),
424
- m.value ? D("", !0) : (w(), I("div", yt, [
425
- $(u(se), {
424
+ m.value ? D("", !0) : (w(), I("div", gt, [
425
+ x(u(se), {
426
426
  style: { width: "100%" },
427
427
  disabled: O.value,
428
428
  onClick: L
@@ -435,7 +435,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
435
435
  }, 8, ["disabled"])
436
436
  ])),
437
437
  m.value ? (w(), I("div", ht, [
438
- $(u(J), {
438
+ x(u(J), {
439
439
  modelValue: u(V),
440
440
  "onUpdate:modelValue": i[3] || (i[3] = (z) => te(V) ? V.value = z : null),
441
441
  size: "large",
@@ -448,7 +448,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
448
448
  }, null, 8, ["modelValue", "error"])
449
449
  ])) : D("", !0),
450
450
  m.value ? (w(), I("div", Tt, [
451
- $(g, {
451
+ x(y, {
452
452
  loading: a.loading,
453
453
  "rate-limit-text": a.rateLimitText,
454
454
  "is-final-limit": a.isFinalLimit,
@@ -458,13 +458,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
458
458
  ]);
459
459
  };
460
460
  }
461
- }), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" }, xt = {
461
+ }), Vt = { class: "text-center w-full" }, bt = { class: "dialogTitle" }, $t = {
462
462
  key: 0,
463
463
  class: "dialogDefaultContainer"
464
- }, $t = {
464
+ }, xt = {
465
465
  key: 1,
466
466
  class: "dialogDefaultContainer"
467
- }, xe = 3, Pt = /* @__PURE__ */ ie({
467
+ }, $e = 3, Pt = /* @__PURE__ */ ie({
468
468
  __name: "ProfileEmailDialog",
469
469
  props: {
470
470
  modelValue: { type: Boolean },
@@ -477,13 +477,13 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
477
477
  },
478
478
  emits: ["update:modelValue", "submit-email", "edit", "close", "notify", "clean-input-errors", "on-update-jwt", "update-email-field", "on-password-error", "on-toast"],
479
479
  setup(q, { emit: W }) {
480
- const v = q, s = W, m = x(v.modelValue), e = Z({
480
+ const v = q, s = W, m = $(v.modelValue), e = Z({
481
481
  oldEmail: v.initialEmail,
482
482
  newEmail: "",
483
483
  code: "",
484
484
  addEmail: "",
485
485
  addCode: ""
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));
486
+ }), n = Z({ email: !1, code: !1 }), h = $(F.OLD), d = $(null), r = $(!1), T = $(!1), O = $(!1), L = $(_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($(v.mode ?? "edit")), { showRateLimitToast: i } = We(s), y = b(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), z = b(() => n.code && !e.code.trim() ? "Введите код" : ""), de = b(() => V.value ? "Повторить" : `${M.value}`), j = $($e), ke = b(() => j.value === 0), Ie = (l) => new Promise((t) => setTimeout(t, l));
487
487
  Y(
488
488
  () => v.modelValue,
489
489
  (l) => m.value = l
@@ -548,36 +548,36 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
548
548
  }
549
549
  const Ce = async (l, t) => {
550
550
  var o, f, E, S, N, le, oe, k, K;
551
- if (!e.oldEmail && t === R.OLD) throw new Error("oldEmail пустой — модель потерялась");
551
+ if (!e.oldEmail && t === F.OLD) throw new Error("oldEmail пустой — модель потерялась");
552
552
  try {
553
553
  r.value = !0;
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");
556
- const F = await H("/users/profile/change/email/match-code", {
557
- email: t === R.NEW ? e.newEmail : e.oldEmail,
554
+ const g = await ue();
555
+ 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");
556
+ const R = await H("/users/profile/change/email/match-code", {
557
+ email: t === F.NEW ? e.newEmail : e.oldEmail,
558
558
  sessionId: d.value,
559
559
  code: l,
560
560
  step: t
561
- }), 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;
562
- if (!(F.data.data.success ?? F.data.success)) {
561
+ }), Q = ((o = R.data) == null ? void 0 : o.nextStep) ?? ((E = (f = R.data) == null ? void 0 : f.data) == null ? void 0 : E.nextStep) ?? null, Ue = ((N = (S = R.data) == null ? void 0 : S.data) == null ? void 0 : N.rateLimit) ?? ((le = R.data) == null ? void 0 : le.rateLimit) ?? null;
562
+ if (!(R.data.data.success ?? R.data.success)) {
563
563
  i(Ue), T.value = !0;
564
564
  return;
565
565
  }
566
566
  if (Q) {
567
- if (h.value = Q, h.value === R.NEW) {
567
+ if (h.value = Q, h.value === F.NEW) {
568
568
  const X = await ue();
569
569
  e.oldEmail = (X == null ? void 0 : X.oldValue) ?? e.oldEmail, e.newEmail = (X == null ? void 0 : X.newValue) ?? e.newEmail, e.code = "";
570
570
  }
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"));
571
+ h.value === F.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"));
572
572
  }
573
- return 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) {
577
- console.debug("rate-limit debug status and exists rateLimit: ", F), i(F), T.value = !0;
573
+ return R;
574
+ } catch (g) {
575
+ const R = (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;
576
+ if (console.error("rate-limit debug error: ", g), Q === 429 && R) {
577
+ i(R), T.value = !0;
578
578
  return;
579
579
  }
580
- throw y;
580
+ throw g;
581
581
  } finally {
582
582
  r.value = !1;
583
583
  }
@@ -595,14 +595,14 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
595
595
  }
596
596
  };
597
597
  async function Le({ code: l }) {
598
- await Ce(l, R.OLD);
598
+ await Ce(l, F.OLD);
599
599
  }
600
- function ge(l) {
600
+ function ye(l) {
601
601
  }
602
602
  async function Pe({ code: l }) {
603
- await Ce(l, R.NEW);
603
+ await Ce(l, F.NEW);
604
604
  }
605
- const ye = async ({
605
+ const ge = async ({
606
606
  value: l,
607
607
  field: t = "email",
608
608
  offLoading: o = !0
@@ -616,7 +616,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
616
616
  provider: v.provider
617
617
  }), N = (f = S.data) == null ? void 0 : f.tooManyRequests;
618
618
  if (S.status === 403 && N) {
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;
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 ?? $e) : V.value = !0;
620
620
  return;
621
621
  }
622
622
  return S;
@@ -637,9 +637,9 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
637
637
  code: e.addCode
638
638
  }), K = ((l = k.data) == null ? void 0 : l.nextStep) ?? ((o = (t = k.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
639
639
  L.value = K ?? L.value;
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;
640
+ 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;
641
641
  if (!(k.data.data.success ?? k.data.success)) {
642
- i(y), O.value = !0;
642
+ i(g), O.value = !0;
643
643
  return;
644
644
  }
645
645
  } catch (k) {
@@ -658,7 +658,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
658
658
  }
659
659
  r.value = !0;
660
660
  try {
661
- await H("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), L.value = R.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
661
+ await H("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), L.value = F.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
662
662
  } finally {
663
663
  r.value = !1;
664
664
  }
@@ -692,7 +692,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
692
692
  }, {
693
693
  header: G(() => [
694
694
  B("div", Vt, [
695
- $(u(Ge), {
695
+ x(u(Ge), {
696
696
  "slot-left": !1,
697
697
  size: "small",
698
698
  borded: !0,
@@ -702,7 +702,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
702
702
  B("span", bt, ee(C.value), 1)
703
703
  ]),
704
704
  "right-button": G(() => [
705
- $(u(Ye), {
705
+ x(u(Ye), {
706
706
  class: "cross",
707
707
  onClick: re
708
708
  })
@@ -713,16 +713,16 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
713
713
  ]),
714
714
  default: G(() => [
715
715
  B("div", null, [
716
- u(p) ? (w(), I("div", xt, [
716
+ u(p) ? (w(), I("div", $t, [
717
717
  r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
718
- h.value === u(R).OLD ? (w(), _(Et, {
718
+ h.value === u(F).OLD ? (w(), _(Et, {
719
719
  key: 1,
720
720
  email: e.oldEmail,
721
721
  "onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
722
722
  code: e.code,
723
723
  "onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
724
724
  "hint-text": l.hintText,
725
- "email-error": g.value,
725
+ "email-error": y.value,
726
726
  "code-error": z.value,
727
727
  "rate-limit-text": de.value,
728
728
  "is-final-limit": j.value === 0,
@@ -730,11 +730,11 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
730
730
  loading: r.value,
731
731
  onEdit: fe,
732
732
  onOnMatchCode: Le,
733
- onOnMatchCodeError: ge,
733
+ onOnMatchCodeError: ye,
734
734
  onSendCode: t[2] || (t[2] = (o) => ae({ value: e.oldEmail })),
735
735
  onOnSendCodeAgain: t[3] || (t[3] = (o) => ae({ value: e.oldEmail })),
736
736
  onOnClearCodeError: t[4] || (t[4] = (o) => T.value = !1)
737
- }, 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, {
737
+ }, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : h.value === u(F).NEW ? (w(), _(Mt, {
738
738
  key: 2,
739
739
  email: e.newEmail,
740
740
  "onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
@@ -743,7 +743,7 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
743
743
  code: e.code,
744
744
  "onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
745
745
  "hint-text": "Введите новый адрес вашей почты",
746
- "email-error": g.value,
746
+ "email-error": y.value,
747
747
  "code-error": z.value,
748
748
  "rate-limit-text": de.value,
749
749
  "is-final-limit": j.value === 0,
@@ -751,12 +751,12 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
751
751
  loading: r.value,
752
752
  onEdit: fe,
753
753
  onOnMatchCode: Pe,
754
- onOnMatchCodeError: ge,
754
+ onOnMatchCodeError: ye,
755
755
  onOnSendCode: t[8] || (t[8] = (o) => ae({ value: e.newEmail })),
756
756
  onOnSendCodeAgain: t[9] || (t[9] = (o) => ae({ value: e.newEmail })),
757
757
  onOnClearCodeError: t[10] || (t[10] = (o) => T.value = !1)
758
758
  }, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : D("", !0)
759
- ])) : (w(), I("div", $t, [
759
+ ])) : (w(), I("div", xt, [
760
760
  r.value ? (w(), _(Te, { key: 0 })) : D("", !0),
761
761
  U.value ? (w(), _(ut, {
762
762
  key: 2,
@@ -778,8 +778,8 @@ const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dial
778
778
  "is-final-limit": ke.value,
779
779
  "is-not-match-code": O.value,
780
780
  loading: r.value,
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" })),
781
+ onOnSendCode: t[14] || (t[14] = (o) => ge({ value: e.addEmail, field: "email" })),
782
+ onOnSendCodeAgain: t[15] || (t[15] = (o) => ge({ value: e.addEmail, field: "email" })),
783
783
  onOnMatchCode: De,
784
784
  onOnMatchCodeError: Ne,
785
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-B03tgxbV.js";
2
+ import { C as I, p as D, g as Ve } from "./index-Dt-xD4lU.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) => {