@yourgoods/ui-smart 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as Z, ref as V, reactive as J, watch as G, computed as M, toRefs as se, createElementBlock as S, openBlock as C, createElementVNode as B, createCommentVNode as N, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as j, createTextVNode as te, Fragment as Oe, createBlock as z, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
- import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-6pDxUqBV.js";
3
- import { C as O, _ as ze, B as We, p as R, g as He } from "./index-B7D53Hrl.js";
2
+ import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-DwCwxVot.js";
3
+ import { C as O, _ as ze, B as We, p as R, g as He } from "./index-BrTdCrUe.js";
4
4
  import { PInput as Y, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as Ge } from "@profeat/ui-kit";
5
5
  const Ye = { class: "dialogDefaultContainerInsideContent" }, _e = { class: "dialogDefaultContainerTextHint" }, Je = {
6
6
  key: 0,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
2
- import { C as I, p as D, g as Ve } from "./index-B7D53Hrl.js";
2
+ import { C as I, p as D, g as Ve } from "./index-BrTdCrUe.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 b, openBlock as p, createElementVNode as U, defineComponent as ce, reactive as pe, watch as te, ref as D, toRefs as fe, computed as z, createCommentVNode as E, createVNode as T, toDisplayString as H, createBlock as G, createTextVNode as oe, unref as r, isRef as se, withCtx as Z, onMounted as Ue, Fragment as je } from "vue";
2
- import { T as ge, c as Oe, a as qe, u as We, P as Be, b as He } from "./useRateLimitToast-6pDxUqBV.js";
1
+ import { createElementBlock as b, openBlock as p, createElementVNode as U, defineComponent as ce, reactive as pe, watch as te, ref as D, toRefs as fe, computed as z, createCommentVNode as E, createVNode as S, toDisplayString as G, createBlock as X, createTextVNode as oe, unref as r, isRef as se, withCtx as _, onMounted as Ue, Fragment as je } from "vue";
2
+ import { T as ge, c as Oe, a as qe, u as We, P as Be, b as He } from "./useRateLimitToast-DwCwxVot.js";
3
3
  import { IconTelegramSm as ye, PInput as de, IconPhoneMd as Ke, IconMailMd as De, PButton as Ae, PDialog as Ge, PTopBar as Je, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
4
- import { C as W, t as Ie, p as ae, g as Le } from "./index-B7D53Hrl.js";
4
+ import { C as K, t as Ie, p as le, g as Le } from "./index-BrTdCrUe.js";
5
5
  const Ye = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -55,74 +55,74 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
55
55
  () => c.codeModel,
56
56
  (d) => u("update:code", d)
57
57
  );
58
- const m = (d) => {
58
+ const v = (d) => {
59
59
  c.touched[d] = !0;
60
60
  };
61
61
  let g = D("");
62
- const B = (d) => {
62
+ const L = (d) => {
63
63
  u("on-clear-code-error");
64
64
  const h = d.target;
65
- let v = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
66
- v.length > 4 && (v = v.slice(0, 4)), S.value = v, h && h.value !== v && (h.value = v), v.length === 4 && v !== g.value && (g.value = v, u("on-match-code", { phone: e.value, code: v }));
67
- }, K = () => u("on-send-code-again", { phone: c.phoneModel }), J = () => {
65
+ let m = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
66
+ m.length > 4 && (m = m.slice(0, 4)), T.value = m, h && h.value !== m && (h.value = m), m.length === 4 && m !== g.value && (g.value = m, u("on-match-code", { phone: e.value, code: m }));
67
+ }, J = () => u("on-send-code-again", { phone: c.phoneModel }), Y = () => {
68
68
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: c.phoneModel });
69
- }, { phoneModel: e, codeModel: S, touched: C } = fe(c), y = z(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), M = z(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? S.value.trim() ? k.codeError ?? null : "Введите код" : "");
69
+ }, { phoneModel: e, codeModel: T, touched: C } = fe(c), y = z(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), M = z(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? T.value.trim() ? k.codeError ?? null : "Введите код" : "");
70
70
  return (d, h) => (p(), b("div", _e, [
71
71
  U("div", eo, [
72
- U("div", oo, H(d.hintText), 1),
72
+ U("div", oo, G(d.hintText), 1),
73
73
  U("div", to, [
74
- d.isTg ? (p(), G(r(ye), { key: 0 })) : (p(), G(r(ie), {
74
+ d.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
75
75
  key: 1,
76
76
  style: { "margin-left": "5px" }
77
77
  })),
78
- oe(" " + H(d.isTg ? "Telegram" : "СМС"), 1)
78
+ oe(" " + G(d.isTg ? "Telegram" : "СМС"), 1)
79
79
  ])
80
80
  ]),
81
81
  d.showPhone ? (p(), b("div", no, [
82
- T(r(de), {
82
+ S(r(de), {
83
83
  modelValue: r(e),
84
- "onUpdate:modelValue": h[0] || (h[0] = (v) => se(e) ? e.value = v : null),
84
+ "onUpdate:modelValue": h[0] || (h[0] = (m) => se(e) ? e.value = m : null),
85
85
  size: "large",
86
86
  "text-size": "medium",
87
87
  label: "Телефон",
88
88
  type: "tel",
89
89
  error: y.value,
90
90
  disabled: !0,
91
- onBlur: h[1] || (h[1] = (v) => m("phone")),
92
- onInput: h[2] || (h[2] = (v) => m("phone"))
91
+ onBlur: h[1] || (h[1] = (m) => v("phone")),
92
+ onInput: h[2] || (h[2] = (m) => v("phone"))
93
93
  }, null, 8, ["modelValue", "error"]),
94
- T(r(Ke), {
94
+ S(r(Ke), {
95
95
  class: "icon-locked",
96
- onClick: h[3] || (h[3] = (v) => d.$emit("edit", "phone"))
96
+ onClick: h[3] || (h[3] = (m) => d.$emit("edit", "phone"))
97
97
  })
98
98
  ])) : E("", !0),
99
99
  d.showCode ? (p(), b("div", ao, [
100
- T(r(de), {
101
- modelValue: r(S),
102
- "onUpdate:modelValue": h[4] || (h[4] = (v) => se(S) ? S.value = v : null),
100
+ S(r(de), {
101
+ modelValue: r(T),
102
+ "onUpdate:modelValue": h[4] || (h[4] = (m) => se(T) ? T.value = m : null),
103
103
  size: "large",
104
104
  "text-size": "medium",
105
105
  label: "Код",
106
106
  type: "text",
107
107
  error: M.value,
108
- onInput: B,
109
- onBlur: h[5] || (h[5] = (v) => m("code"))
108
+ onInput: L,
109
+ onBlur: h[5] || (h[5] = (m) => v("code"))
110
110
  }, null, 8, ["modelValue", "error"])
111
111
  ])) : E("", !0),
112
- T(ge, {
112
+ S(ge, {
113
113
  loading: d.loading,
114
114
  "rate-limit-text": d.rateLimitText,
115
115
  "is-final-limit": d.isFinalLimit,
116
- "on-send-again": K
116
+ "on-send-again": J
117
117
  }, {
118
- extra: Z(() => [
118
+ extra: _(() => [
119
119
  d.isTg ? (p(), b("span", {
120
120
  key: 0,
121
121
  class: "dialogDefaultContainerSendCodeBySmsText",
122
- onClick: J
122
+ onClick: Y
123
123
  }, [
124
- oe(H(d.sendCodeBySmsText) + " ", 1),
125
- T(r(ie), { style: { "margin-left": "5px" } })
124
+ oe(G(d.sendCodeBySmsText) + " ", 1),
125
+ S(r(ie), { style: { "margin-left": "5px" } })
126
126
  ])) : E("", !0)
127
127
  ]),
128
128
  _: 1
@@ -168,7 +168,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
168
168
  },
169
169
  emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
170
170
  setup(R, { emit: x }) {
171
- const k = R, u = x, c = D(!1), m = D(""), g = pe({
171
+ const k = R, u = x, c = D(!1), v = D(""), g = pe({
172
172
  touched: { phone: !1, code: !1 },
173
173
  phoneModel: "",
174
174
  codeModel: ""
@@ -176,35 +176,38 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
176
176
  te(
177
177
  () => g.phoneModel,
178
178
  (l) => {
179
- u("update:phone", l), m.value = "";
179
+ u("update:phone", l), v.value = "";
180
180
  }
181
181
  ), te(
182
182
  () => g.codeModel,
183
183
  (l) => u("update:code", l)
184
184
  );
185
- const B = (l) => g.touched[l] = !0, K = z(() => {
185
+ const L = (l) => g.touched[l] = !0, J = z(() => {
186
186
  const n = g.phoneModel.trim().replace(/[()\-\s]/g, "");
187
187
  return /^\+?\d{10,15}$/.test(n);
188
- }), J = async () => {
188
+ }), Y = async () => {
189
189
  var l, n;
190
190
  try {
191
- if (B("phone"), !K.value) {
192
- m.value = "Это не похоже на номер телефона";
191
+ if (L("phone"), !J.value) {
192
+ v.value = "Это не похоже на номер телефона";
193
193
  return;
194
194
  }
195
195
  const {
196
- data: { data: o, success: I, message: L }
196
+ data: { data: o, success: $, message: B }
197
197
  } = await Oe(void 0, F(g.phoneModel));
198
198
  if (!(((l = o == null ? void 0 : o[0]) == null ? void 0 : l.available) ?? !1)) {
199
- m.value = "Такой номер уже используется";
199
+ v.value = "Такой номер уже используется";
200
200
  return;
201
201
  }
202
- m.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
202
+ v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
203
203
  } catch (o) {
204
- const I = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, L = I == null ? void 0 : I.message;
205
- if (L) {
206
- const le = (Array.isArray(L) ? L.join(" ") : String(L)).toLowerCase();
207
- if ([
204
+ const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
205
+ if (console.debug("global middle check onSendCode: ", {
206
+ errorData: $,
207
+ message: B,
208
+ phoneTakenError: v
209
+ }), B) {
210
+ const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
208
211
  "телефон должен быть в формате",
209
212
  "valid phone number",
210
213
  "phone must be a valid phone number",
@@ -213,18 +216,24 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
213
216
  "newValue must be a valid phone number",
214
217
  "addValue must be a valid phone number",
215
218
  "addPhone must be a valid phone number"
216
- ].some(
217
- (ee) => le.includes(ee)
218
- )) {
219
- m.value = "Это не похоже на номер телефона";
219
+ ], q = Q.some(
220
+ (ee) => ne.includes(ee)
221
+ );
222
+ if (console.debug("global end check onSendCode: ", {
223
+ errorMessage: j,
224
+ lowerCaseError: ne,
225
+ phoneValidationKeywords: Q,
226
+ hasPhoneError: q
227
+ }), q) {
228
+ v.value = "Это не похоже на номер телефона";
220
229
  return;
221
230
  }
222
231
  }
223
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), m.value = "Произошла ошибка сервера. Попробуйте позже.";
232
+ console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
224
233
  }
225
234
  };
226
235
  let e = D("");
227
- const S = (l) => {
236
+ const T = (l) => {
228
237
  u("on-clear-code-error");
229
238
  const n = l.target;
230
239
  let o = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
@@ -233,42 +242,42 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
233
242
  u("on-send-code-again", { phone: g.phoneModel });
234
243
  }, y = () => {
235
244
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: g.phoneModel });
236
- }, { phoneModel: M, codeModel: d, touched: h } = fe(g), v = z(() => m.value ? m.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Q = z(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
245
+ }, { phoneModel: M, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Z = z(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
237
246
  return (l, n) => (p(), b("div", so, [
238
247
  U("div", io, [
239
- U("div", ro, H(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
248
+ U("div", ro, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
240
249
  c.value ? (p(), b("div", uo, [
241
- l.isTg ? (p(), G(r(ye), { key: 0 })) : (p(), G(r(ie), {
250
+ l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
242
251
  key: 1,
243
252
  style: { "margin-left": "5px" }
244
253
  })),
245
- oe(" " + H(l.isTg ? "Telegram" : "СМС"), 1)
254
+ oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
246
255
  ])) : E("", !0)
247
256
  ]),
248
257
  l.showPhone ? (p(), b("div", co, [
249
- T(r(de), {
258
+ S(r(de), {
250
259
  modelValue: r(M),
251
260
  "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
252
261
  size: "large",
253
262
  "text-size": "medium",
254
263
  label: "Телефон",
255
264
  type: "tel",
256
- error: v.value,
257
- onBlur: n[1] || (n[1] = (o) => B("phone")),
258
- onInput: n[2] || (n[2] = (o) => B("phone"))
265
+ error: m.value,
266
+ onBlur: n[1] || (n[1] = (o) => L("phone")),
267
+ onInput: n[2] || (n[2] = (o) => L("phone"))
259
268
  }, null, 8, ["modelValue", "error"]),
260
- T(r(De), {
269
+ S(r(De), {
261
270
  class: "icon-locked",
262
271
  onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
263
272
  })
264
273
  ])) : E("", !0),
265
274
  c.value ? E("", !0) : (p(), b("div", po, [
266
- T(r(Ae), {
275
+ S(r(Ae), {
267
276
  style: { width: "100%" },
268
- disabled: !K.value,
269
- onClick: J
277
+ disabled: !J.value,
278
+ onClick: Y
270
279
  }, {
271
- default: Z(() => n[6] || (n[6] = [
280
+ default: _(() => n[6] || (n[6] = [
272
281
  oe(" Отправить код ")
273
282
  ])),
274
283
  _: 1,
@@ -276,33 +285,33 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
276
285
  }, 8, ["disabled"])
277
286
  ])),
278
287
  c.value ? (p(), b("div", ho, [
279
- T(r(de), {
288
+ S(r(de), {
280
289
  modelValue: r(d),
281
290
  "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
282
291
  size: "large",
283
292
  "text-size": "medium",
284
293
  label: "Код",
285
294
  type: "text",
286
- error: Q.value,
287
- onInput: S,
288
- onBlur: n[5] || (n[5] = (o) => B("code"))
295
+ error: Z.value,
296
+ onInput: T,
297
+ onBlur: n[5] || (n[5] = (o) => L("code"))
289
298
  }, null, 8, ["modelValue", "error"])
290
299
  ])) : E("", !0),
291
300
  !l.loading && c.value ? (p(), b("div", vo, [
292
- T(ge, {
301
+ S(ge, {
293
302
  loading: l.loading,
294
303
  "rate-limit-text": l.rateLimitText,
295
304
  "is-final-limit": l.isFinalLimit,
296
305
  "on-send-again": C
297
306
  }, {
298
- extra: Z(() => [
307
+ extra: _(() => [
299
308
  l.isTg ? (p(), b("span", {
300
309
  key: 0,
301
310
  class: "dialogDefaultContainerSendCodeBySmsText",
302
311
  onClick: y
303
312
  }, [
304
- oe(H(l.sendCodeBySmsText) + " ", 1),
305
- T(r(ie), { style: { "margin-left": "5px" } })
313
+ oe(G(l.sendCodeBySmsText) + " ", 1),
314
+ S(r(ie), { style: { "margin-left": "5px" } })
306
315
  ])) : E("", !0)
307
316
  ]),
308
317
  _: 1
@@ -319,7 +328,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
319
328
  }, bo = {
320
329
  key: 2,
321
330
  class: "input-wrapper"
322
- }, To = { key: 3 }, So = /* @__PURE__ */ ce({
331
+ }, So = { key: 3 }, To = /* @__PURE__ */ ce({
323
332
  __name: "AddNewPhoneContent",
324
333
  props: {
325
334
  phone: {},
@@ -337,7 +346,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
337
346
  },
338
347
  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"],
339
348
  setup(R, { emit: x }) {
340
- const k = R, u = x, c = D(!1), m = D(""), g = pe({
349
+ const k = R, u = x, c = D(!1), v = D(""), g = pe({
341
350
  touched: { phone: !1, code: !1 },
342
351
  phoneModel: "",
343
352
  codeModel: ""
@@ -345,38 +354,38 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
345
354
  te(
346
355
  () => g.phoneModel,
347
356
  (l) => {
348
- u("update:phone", l), m.value = "";
357
+ u("update:phone", l), v.value = "";
349
358
  }
350
359
  ), te(
351
360
  () => g.codeModel,
352
361
  (l) => u("update:code", l)
353
362
  );
354
- const B = (l) => g.touched[l] = !0, K = z(() => {
363
+ const L = (l) => g.touched[l] = !0, J = z(() => {
355
364
  const n = g.phoneModel.trim().replace(/[()\-\s]/g, "");
356
365
  return /^\+?\d{10,15}$/.test(n);
357
- }), J = async () => {
366
+ }), Y = async () => {
358
367
  var l, n;
359
368
  try {
360
- if (B("phone"), !K.value) {
361
- m.value = "Это не похоже на номер телефона";
369
+ if (L("phone"), !J.value) {
370
+ v.value = "Это не похоже на номер телефона";
362
371
  return;
363
372
  }
364
373
  const {
365
- data: { data: o, success: I, message: L }
374
+ data: { data: o, success: $, message: B }
366
375
  } = await Oe(void 0, F(g.phoneModel));
367
376
  if (!(((l = o == null ? void 0 : o[0]) == null ? void 0 : l.available) ?? !1)) {
368
- m.value = "Такой номер уже используется";
377
+ v.value = "Такой номер уже используется";
369
378
  return;
370
379
  }
371
- m.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
380
+ v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
372
381
  } catch (o) {
373
- const I = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, L = I == null ? void 0 : I.message;
382
+ const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
374
383
  if (console.debug("global middle check onSendCode: ", {
375
- errorData: I,
376
- message: L,
377
- phoneTakenError: m
378
- }), L) {
379
- const X = Array.isArray(L) ? L.join(" ") : String(L), le = X.toLowerCase(), _ = [
384
+ errorData: $,
385
+ message: B,
386
+ phoneTakenError: v
387
+ }), B) {
388
+ const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
380
389
  "телефон должен быть в формате",
381
390
  "valid phone number",
382
391
  "phone must be a valid phone number",
@@ -385,24 +394,24 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
385
394
  "newValue must be a valid phone number",
386
395
  "addValue must be a valid phone number",
387
396
  "addPhone must be a valid phone number"
388
- ], Y = _.some(
389
- (ee) => le.includes(ee)
397
+ ], q = Q.some(
398
+ (ee) => ne.includes(ee)
390
399
  );
391
400
  if (console.debug("global end check onSendCode: ", {
392
- errorMessage: X,
393
- lowerCaseError: le,
394
- phoneValidationKeywords: _,
395
- hasPhoneError: Y
396
- }), Y) {
397
- m.value = "Это не похоже на номер телефона";
401
+ errorMessage: j,
402
+ lowerCaseError: ne,
403
+ phoneValidationKeywords: Q,
404
+ hasPhoneError: q
405
+ }), q) {
406
+ v.value = "Это не похоже на номер телефона";
398
407
  return;
399
408
  }
400
409
  }
401
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), m.value = "Произошла ошибка сервера. Попробуйте позже";
410
+ console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
402
411
  }
403
412
  };
404
413
  let e = "";
405
- const S = (l) => {
414
+ const T = (l) => {
406
415
  u("on-clear-code-error");
407
416
  const n = l.target;
408
417
  let o = n.value.replace(/\D/g, "");
@@ -411,42 +420,42 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
411
420
  u("on-send-code-again", { phone: g.phoneModel });
412
421
  }, y = () => {
413
422
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: g.phoneModel });
414
- }, { phoneModel: M, codeModel: d, touched: h } = fe(g), v = z(() => m.value ? m.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Q = z(() => k.isNotMatchCode ? "Неверный код" : g.touched.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
423
+ }, { phoneModel: M, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Z = z(() => k.isNotMatchCode ? "Неверный код" : g.touched.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
415
424
  return (l, n) => (p(), b("div", fo, [
416
425
  U("div", go, [
417
- U("div", yo, H(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
426
+ U("div", yo, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
418
427
  U("div", Co, [
419
- l.isTg ? (p(), G(r(ye), { key: 0 })) : (p(), G(r(ie), {
428
+ l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
420
429
  key: 1,
421
430
  style: { "margin-left": "5px" }
422
431
  })),
423
- oe(" " + H(l.isTg ? "Telegram" : "СМС"), 1)
432
+ oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
424
433
  ])
425
434
  ]),
426
435
  l.showPhone ? (p(), b("div", wo, [
427
- T(r(de), {
436
+ S(r(de), {
428
437
  modelValue: r(M),
429
438
  "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
430
439
  size: "large",
431
440
  "text-size": "medium",
432
441
  label: "Телефон",
433
442
  type: "tel",
434
- error: v.value,
435
- onBlur: n[1] || (n[1] = (o) => B("phone")),
436
- onInput: n[2] || (n[2] = (o) => B("phone"))
443
+ error: m.value,
444
+ onBlur: n[1] || (n[1] = (o) => L("phone")),
445
+ onInput: n[2] || (n[2] = (o) => L("phone"))
437
446
  }, null, 8, ["modelValue", "error"]),
438
- T(r(De), {
447
+ S(r(De), {
439
448
  class: "icon-locked",
440
449
  onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
441
450
  })
442
451
  ])) : E("", !0),
443
452
  c.value ? E("", !0) : (p(), b("div", Po, [
444
- T(r(Ae), {
453
+ S(r(Ae), {
445
454
  style: { width: "100%" },
446
- disabled: !K.value,
447
- onClick: J
455
+ disabled: !J.value,
456
+ onClick: Y
448
457
  }, {
449
- default: Z(() => n[6] || (n[6] = [
458
+ default: _(() => n[6] || (n[6] = [
450
459
  oe(" Отправить код ")
451
460
  ])),
452
461
  _: 1,
@@ -454,33 +463,33 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
454
463
  }, 8, ["disabled"])
455
464
  ])),
456
465
  c.value ? (p(), b("div", bo, [
457
- T(r(de), {
466
+ S(r(de), {
458
467
  modelValue: r(d),
459
468
  "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
460
469
  size: "large",
461
470
  "text-size": "medium",
462
471
  label: "Код",
463
472
  type: "text",
464
- error: Q.value,
465
- onInput: S,
466
- onBlur: n[5] || (n[5] = (o) => B("code"))
473
+ error: Z.value,
474
+ onInput: T,
475
+ onBlur: n[5] || (n[5] = (o) => L("code"))
467
476
  }, null, 8, ["modelValue", "error"])
468
477
  ])) : E("", !0),
469
- c.value ? (p(), b("div", To, [
470
- T(ge, {
478
+ c.value ? (p(), b("div", So, [
479
+ S(ge, {
471
480
  loading: l.loading,
472
481
  "rate-limit-text": l.rateLimitText,
473
482
  "is-final-limit": l.isFinalLimit,
474
483
  "on-send-again": C
475
484
  }, {
476
- extra: Z(() => [
485
+ extra: _(() => [
477
486
  l.isTg ? (p(), b("span", {
478
487
  key: 0,
479
488
  class: "dialogDefaultContainerSendCodeBySmsText",
480
489
  onClick: y
481
490
  }, [
482
- oe(H(l.sendCodeBySmsText) + " ", 1),
483
- T(r(ie), { style: { "margin-left": "5px" } })
491
+ oe(G(l.sendCodeBySmsText) + " ", 1),
492
+ S(r(ie), { style: { "margin-left": "5px" } })
484
493
  ])) : E("", !0)
485
494
  ]),
486
495
  _: 1
@@ -507,34 +516,34 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
507
516
  },
508
517
  emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
509
518
  setup(R, { expose: x, emit: k }) {
510
- const u = R, c = k, m = D(u.modelValue);
519
+ const u = R, c = k, v = D(u.modelValue);
511
520
  te(
512
521
  () => u.modelValue,
513
- (s) => m.value = s
514
- ), te(m, (s) => c("update:modelValue", s));
515
- const g = z(() => u.language ?? "ru"), B = (s) => Ie[g.value] && Ie[g.value][s] || (u.title ?? s), K = z(() => u.title ?? B("Смена номера телефона")), J = z(() => u.hintText ?? B("Чтобы продолжить, введите новый номер")), e = pe({
522
+ (s) => v.value = s
523
+ ), te(v, (s) => c("update:modelValue", s));
524
+ const g = z(() => u.language ?? "ru"), L = (s) => Ie[g.value] && Ie[g.value][s] || (u.title ?? s), J = z(() => u.title ?? L("Смена номера телефона")), Y = z(() => u.hintText ?? L("Чтобы продолжить, введите новый номер")), e = pe({
516
525
  oldPhone: u.initialPhone ?? "",
517
526
  newPhone: "",
518
527
  code: "",
519
528
  addPhone: "",
520
529
  addCode: ""
521
- }), S = D(W.OLD), C = D(null), y = D(!1), M = D(!1), d = D("tg"), h = z(() => d.value === "tg"), v = D(!1), { startTimer: Q, remainingSeconds: l, isAvailableForSendAgain: n, totalRateAttempts: o, currentRateAttempt: I } = qe(), { showRateLimitToast: L } = He(c), { isEditFlow: X, getFlow: le } = We(D(u.mode)), _ = z(() => n.value ? "Повторить" : `${l.value}`), Y = D(re), ee = z(() => Y.value === 0), Ne = (s) => new Promise((a) => setTimeout(a, s));
530
+ }), T = D(K.OLD), C = D(null), y = D(!1), M = D(!1), d = D("tg"), h = z(() => d.value === "tg"), m = D(!1), { startTimer: Z, remainingSeconds: l, isAvailableForSendAgain: n, totalRateAttempts: o, currentRateAttempt: $ } = qe(), { showRateLimitToast: B } = He(c), { isEditFlow: j, getFlow: ne } = We(D(u.mode)), Q = z(() => n.value ? "Повторить" : `${l.value}`), q = D(re), ee = z(() => q.value === 0), Ne = (s) => new Promise((a) => setTimeout(a, s));
522
531
  async function he(s = "email") {
523
532
  var t;
524
533
  return (t = (await Le("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : t.data;
525
534
  }
526
535
  async function Ce(s = "phone") {
527
536
  var V;
528
- const t = (V = (await ae("/users/profile/session/create-if-not-exists", {
537
+ const t = (V = (await le("/users/profile/session/create-if-not-exists", {
529
538
  field: s,
530
539
  oldValue: F(u.initialPhone)
531
540
  })).data) == null ? void 0 : V.data;
532
- C.value = (t == null ? void 0 : t.sessionId) ?? null, S.value = (t == null ? void 0 : t.step) ?? W.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
541
+ C.value = (t == null ? void 0 : t.sessionId) ?? null, T.value = (t == null ? void 0 : t.step) ?? K.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
533
542
  }
534
543
  async function ze() {
535
544
  try {
536
545
  const s = await he("phone");
537
- C.value = s.sessionId, S.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
546
+ C.value = s.sessionId, T.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
538
547
  } catch {
539
548
  await Ce("phone");
540
549
  }
@@ -542,7 +551,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
542
551
  async function we(s, a = !1) {
543
552
  var t;
544
553
  try {
545
- const V = await ae(
554
+ const V = await le(
546
555
  "/users/profile/check-throttler",
547
556
  {
548
557
  method: "sms",
@@ -551,22 +560,22 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
551
560
  },
552
561
  {
553
562
  headers: {
554
- "x-only-sms": v.value ?? !1
563
+ "x-only-sms": m.value ?? !1
555
564
  }
556
565
  }
557
566
  );
558
567
  await Ne(1e3);
559
568
  const w = (t = V.data) == null ? void 0 : t.data;
560
- return w ? (w.restTimeSec > 0 ? (Q(w.restTimeSec), n.value = !1, o.value = w.attempts.total, I.value = w.attempts.total - w.attempts.available, Y.value = w.attempts.available ?? re) : n.value = !0, w) : null;
569
+ return w ? (w.restTimeSec > 0 ? (Z(w.restTimeSec), n.value = !1, o.value = w.attempts.total, $.value = w.attempts.total - w.attempts.available, q.value = w.attempts.available ?? re) : n.value = !0, w) : null;
561
570
  } catch {
562
571
  return null;
563
572
  }
564
573
  }
565
- const ve = async ({ phone: s }) => (v.value = !0, await ne({ value: s, isOnlySms: !0 })), ne = async ({ value: s, isOnlySms: a, offLoading: t } = {}) => {
566
- var V, w, A, N, j, $;
574
+ const ve = async ({ phone: s }) => (m.value = !0, await ae({ value: s, isOnlySms: !0 })), ae = async ({ value: s, isOnlySms: a, offLoading: t } = {}) => {
575
+ var V, w, A, N, W, I;
567
576
  y.value = !0;
568
577
  try {
569
- const f = s ?? e.oldPhone, i = await ae(
578
+ const f = s ?? e.oldPhone, i = await le(
570
579
  "/users/profile/phone/contact/send-code",
571
580
  {
572
581
  sessionId: C.value,
@@ -584,57 +593,57 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
584
593
  );
585
594
  console.debug("response sendContactCode: ", i);
586
595
  const P = (w = (V = i == null ? void 0 : i.data) == null ? void 0 : V.data) == null ? void 0 : w.deliveryType;
587
- if ((P === "tg" || P === "sms") && (d.value = P, P === "tg" && (v.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", i), (i == null ? void 0 : i.status) === 403 && ((A = i.data) != null && A.tooManyRequests)) {
596
+ if ((P === "tg" || P === "sms") && (d.value = P, P === "tg" && (m.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", i), (i == null ? void 0 : i.status) === 403 && ((A = i.data) != null && A.tooManyRequests)) {
588
597
  console.debug("sendContactCode IN обработка 403 tooManyRequests", i);
589
- const O = (j = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : j.type;
598
+ const O = (W = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : W.type;
590
599
  d.value = O;
591
- const q = i.data.tooManyRequests;
592
- return q.restTimeSec > 0 ? (Q(q.restTimeSec), o.value = q.attempts.total, I.value = q.attempts.total - q.attempts.available, Y.value = q.attempts.available ?? re) : n.value = !0, i;
600
+ const H = i.data.tooManyRequests;
601
+ return H.restTimeSec > 0 ? (Z(H.restTimeSec), o.value = H.attempts.total, $.value = H.attempts.total - H.attempts.available, q.value = H.attempts.available ?? re) : n.value = !0, i;
593
602
  }
594
603
  return console.debug("sendContactCode after обработка 403 tooManyRequests", i), await we(f), i;
595
604
  } catch (f) {
596
- const i = ($ = f == null ? void 0 : f.data) == null ? void 0 : $.tooManyRequests;
605
+ const i = (I = f == null ? void 0 : f.data) == null ? void 0 : I.tooManyRequests;
597
606
  if ((f == null ? void 0 : f.status) === 403 && i) {
598
607
  const { restTimeSec: P, attempts: O } = i;
599
- return P > 0 ? (Q(P), o.value = O.total, I.value = O.total - O.available, Y.value = O.available ?? re) : n.value = !0, f;
608
+ return P > 0 ? (Z(P), o.value = O.total, $.value = O.total - O.available, q.value = O.available ?? re) : n.value = !0, f;
600
609
  }
601
610
  throw f;
602
611
  } finally {
603
612
  y.value = !1, t && (y.value = !1);
604
613
  }
605
614
  }, Pe = async (s, a) => {
606
- var t, V, w, A, N, j, $, f;
615
+ var t, V, w, A, N, W, I, f;
607
616
  y.value = !0;
608
617
  try {
609
618
  const i = await he("phone");
610
- C.value = i.sessionId, S.value = i.step, e.oldPhone = i.oldValue ?? e.oldPhone, e.newPhone = i.newValue ?? e.newPhone;
611
- const P = await ae("/users/profile/change/phone/match-code", {
612
- phone: a === W.NEW ? F(e.newPhone) : F(e.oldPhone),
619
+ C.value = i.sessionId, T.value = i.step, e.oldPhone = i.oldValue ?? e.oldPhone, e.newPhone = i.newValue ?? e.newPhone;
620
+ const P = await le("/users/profile/change/phone/match-code", {
621
+ phone: a === K.NEW ? F(e.newPhone) : F(e.oldPhone),
613
622
  sessionId: C.value,
614
623
  code: s,
615
624
  step: a
616
- }), O = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), q = ((N = (A = P.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((j = P.data) == null ? void 0 : j.rateLimit) ?? null, Re = (($ = P.data) == null ? void 0 : $.data.success) ?? ((f = P.data) == null ? void 0 : f.success);
617
- if (L(q), !Re) {
625
+ }), O = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), H = ((N = (A = P.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((W = P.data) == null ? void 0 : W.rateLimit) ?? null, Re = ((I = P.data) == null ? void 0 : I.data.success) ?? ((f = P.data) == null ? void 0 : f.success);
626
+ if (B(H), !Re) {
618
627
  M.value = !0;
619
628
  return;
620
629
  }
621
630
  if (!O) return P;
622
- if (S.value = O, O === W.NEW) {
631
+ if (T.value = O, O === K.NEW) {
623
632
  const $e = await he("phone");
624
633
  e.oldPhone = $e.oldValue ?? e.oldPhone, e.newPhone = $e.newValue ?? e.newPhone, e.code = "";
625
634
  }
626
- return O === W.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: s }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), P;
635
+ return O === K.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: s }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), P;
627
636
  } finally {
628
637
  y.value = !1;
629
638
  }
630
- }, be = ({ code: s }) => Pe(s, W.OLD);
631
- function Te(s) {
639
+ }, be = ({ code: s }) => Pe(s, K.OLD);
640
+ function Se(s) {
632
641
  }
633
- const Se = ({ code: s }) => Pe(s, W.NEW);
642
+ const Te = ({ code: s }) => Pe(s, K.NEW);
634
643
  function Me(s) {
635
644
  }
636
645
  const ue = () => {
637
- c("close"), m.value = !1;
646
+ c("close"), v.value = !1;
638
647
  };
639
648
  async function xe(s = "phone") {
640
649
  var t;
@@ -649,7 +658,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
649
658
  y.value = !0;
650
659
  try {
651
660
  if (!C.value) {
652
- const N = await ae("/users/profile/session/bind/create", {
661
+ const N = await le("/users/profile/session/bind/create", {
653
662
  field: a,
654
663
  newValue: F(s || e.addPhone)
655
664
  });
@@ -663,7 +672,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
663
672
  async function Fe() {
664
673
  try {
665
674
  const s = await xe("phone");
666
- C.value = s.sessionId, S.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
675
+ C.value = s.sessionId, T.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
667
676
  } catch {
668
677
  await Ve({ field: "phone", value: e.addPhone });
669
678
  }
@@ -679,11 +688,11 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
679
688
  try {
680
689
  if (!C.value)
681
690
  throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
682
- const j = s ?? e.addPhone, $ = await ae(
691
+ const W = s ?? e.addPhone, I = await le(
683
692
  `/users/profile/bind/contact/send-code/${a}`,
684
693
  {
685
694
  sessionId: C.value,
686
- phone: F(j),
695
+ phone: F(W),
687
696
  provider: u.provider,
688
697
  isOnlySms: t ?? !1
689
698
  },
@@ -692,36 +701,36 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
692
701
  "x-only-sms": t ?? !1
693
702
  }
694
703
  }
695
- ), f = (A = (w = $ == null ? void 0 : $.data) == null ? void 0 : w.data) == null ? void 0 : A.deliveryType;
696
- (f === "tg" || f === "sms") && (d.value = f, f === "tg" && (v.value = !1));
697
- const i = (N = $.data) == null ? void 0 : N.tooManyRequests;
698
- if ($.status === 403 && i) {
704
+ ), f = (A = (w = I == null ? void 0 : I.data) == null ? void 0 : w.data) == null ? void 0 : A.deliveryType;
705
+ (f === "tg" || f === "sms") && (d.value = f, f === "tg" && (m.value = !1));
706
+ const i = (N = I.data) == null ? void 0 : N.tooManyRequests;
707
+ if (I.status === 403 && i) {
699
708
  const O = i == null ? void 0 : i.type;
700
- return d.value = O, i.restTimeSec > 0 ? (Q(i.restTimeSec), o.value = i.attempts.total, I.value = i.attempts.total - i.attempts.available, Y.value = i.attempts.available ?? re) : n.value = !0, $;
709
+ return d.value = O, i.restTimeSec > 0 ? (Z(i.restTimeSec), o.value = i.attempts.total, $.value = i.attempts.total - i.attempts.available, q.value = i.attempts.available ?? re) : n.value = !0, I;
701
710
  }
702
- const P = await we(j);
703
- return P && P.restTimeSec > 0 ? (Q(P.restTimeSec), n.value = !1) : n.value = !0, $;
711
+ const P = await we(W);
712
+ return P && P.restTimeSec > 0 ? (Z(P.restTimeSec), n.value = !1) : n.value = !0, I;
704
713
  } finally {
705
714
  V && (y.value = !1);
706
715
  }
707
716
  }, ke = async ({ code: s }) => {
708
- var a, t, V, w, A, N, j, $;
717
+ var a, t, V, w, A, N, W, I;
709
718
  y.value = !0;
710
719
  try {
711
720
  if (!C.value) {
712
- const q = await xe("phone");
713
- C.value = q.sessionId, e.addPhone = q.newValue ?? e.addPhone;
721
+ const H = await xe("phone");
722
+ C.value = H.sessionId, e.addPhone = H.newValue ?? e.addPhone;
714
723
  }
715
- const f = await ae("/users/profile/bind/phone/match-code", {
724
+ const f = await le("/users/profile/bind/phone/match-code", {
716
725
  phone: F(e.addPhone),
717
726
  sessionId: C.value,
718
727
  code: s
719
- }), i = ((a = f.data) == null ? void 0 : a.nextStep) ?? ((V = (t = f.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((A = (w = f.data) == null ? void 0 : w.data) == null ? void 0 : A.rateLimit) ?? ((N = f.data) == null ? void 0 : N.rateLimit) ?? null, O = ((j = f.data) == null ? void 0 : j.data.success) ?? (($ = f.data) == null ? void 0 : $.success);
720
- if (L(P), !O) {
728
+ }), i = ((a = f.data) == null ? void 0 : a.nextStep) ?? ((V = (t = f.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((A = (w = f.data) == null ? void 0 : w.data) == null ? void 0 : A.rateLimit) ?? ((N = f.data) == null ? void 0 : N.rateLimit) ?? null, O = ((W = f.data) == null ? void 0 : W.data.success) ?? ((I = f.data) == null ? void 0 : I.success);
729
+ if (B(P), !O) {
721
730
  M.value = !0;
722
731
  return;
723
732
  }
724
- return i && i === W.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: s }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), f;
733
+ return i && i === K.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: s }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), f;
725
734
  } finally {
726
735
  y.value = !1;
727
736
  }
@@ -729,35 +738,35 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
729
738
  };
730
739
  return Ue(async () => {
731
740
  y.value = !0;
732
- const s = await le("phone");
741
+ const s = await ne("phone");
733
742
  if (u.mode === "bind" && s === "bind") {
734
743
  await Fe(), y.value = !1;
735
744
  return;
736
745
  }
737
- await ze(), await ne({});
746
+ await ze(), await ae({});
738
747
  }), x({
739
- localVisible: m,
748
+ localVisible: v,
740
749
  form: e,
741
- currentStep: S,
750
+ currentStep: T,
742
751
  loading: y,
743
- rateLimitText: _,
752
+ rateLimitText: Q,
744
753
  isAvailable: ee,
745
- title: K,
746
- hintText: J,
754
+ title: J,
755
+ hintText: Y,
747
756
  handleClose: ue,
748
- sendContactCode: ne,
757
+ sendContactCode: ae,
749
758
  sendBindContactCode: me,
750
759
  handleOldCodeSuccess: be,
751
- handleOldCodeError: Te,
752
- handleNewCodeSuccess: Se,
760
+ handleOldCodeError: Se,
761
+ handleNewCodeSuccess: Te,
753
762
  handleNewCodeError: Me,
754
763
  matchBindCode: ke,
755
764
  matchBindCodeError: Ee
756
765
  }), (s, a) => (p(), b(je, null, [
757
- T(r(Ge), {
758
- modelValue: m.value,
766
+ S(r(Ge), {
767
+ modelValue: v.value,
759
768
  "onUpdate:modelValue": [
760
- a[15] || (a[15] = (t) => m.value = t),
769
+ a[15] || (a[15] = (t) => v.value = t),
761
770
  ue
762
771
  ],
763
772
  width: "small",
@@ -765,19 +774,19 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
765
774
  "close-on-click-outside": !0,
766
775
  "onClick:outside": ue
767
776
  }, {
768
- header: Z(() => [
777
+ header: _(() => [
769
778
  U("div", Mo, [
770
- T(r(Je), {
779
+ S(r(Je), {
771
780
  "slot-left": !1,
772
781
  size: "small",
773
782
  borded: !0,
774
783
  "no-padding": !1
775
784
  }, {
776
- title: Z(() => [
777
- U("span", xo, H(r(X) ? K.value : "Добавление номера телефона"), 1)
785
+ title: _(() => [
786
+ U("span", xo, G(r(j) ? J.value : "Добавление номера телефона"), 1)
778
787
  ]),
779
- "right-button": Z(() => [
780
- T(r(Qe), {
788
+ "right-button": _(() => [
789
+ S(r(Qe), {
781
790
  class: "cross",
782
791
  onClick: ue
783
792
  })
@@ -786,26 +795,26 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
786
795
  })
787
796
  ])
788
797
  ]),
789
- default: Z(() => [
790
- r(X) ? (p(), b("div", Vo, [
791
- y.value ? (p(), G(Be, { key: 0 })) : E("", !0),
792
- S.value === r(W).OLD ? (p(), G(lo, {
798
+ default: _(() => [
799
+ r(j) ? (p(), b("div", Vo, [
800
+ y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
801
+ T.value === r(K).OLD ? (p(), X(lo, {
793
802
  key: 1,
794
803
  phone: e.oldPhone,
795
804
  "onUpdate:phone": a[0] || (a[0] = (t) => e.oldPhone = t),
796
805
  code: e.code,
797
806
  "onUpdate:code": a[1] || (a[1] = (t) => e.code = t),
798
- "rate-limit-text": _.value,
807
+ "rate-limit-text": Q.value,
799
808
  "is-final-limit": ee.value,
800
809
  "is-not-match-code": M.value,
801
810
  loading: y.value,
802
811
  "is-tg": h.value,
803
- onOnSendCode: a[2] || (a[2] = (t) => ne({ value: e.oldPhone })),
804
- onOnSendCodeAgain: a[3] || (a[3] = (t) => ne({ value: e.oldPhone, isOnlySms: !h.value && v.value })),
812
+ onOnSendCode: a[2] || (a[2] = (t) => ae({ value: e.oldPhone })),
813
+ onOnSendCodeAgain: a[3] || (a[3] = (t) => ae({ value: e.oldPhone, isOnlySms: !h.value && m.value })),
805
814
  onOnSendOnlySms: ve,
806
815
  onOnMatchCode: be,
807
- onOnMatchCodeError: Te
808
- }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : S.value === r(W).NEW ? (p(), G(mo, {
816
+ onOnMatchCodeError: Se
817
+ }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : T.value === r(K).NEW ? (p(), X(mo, {
809
818
  key: 2,
810
819
  phone: e.newPhone,
811
820
  "onUpdate:phone": a[4] || (a[4] = (t) => e.newPhone = t),
@@ -813,38 +822,38 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
813
822
  "onUpdate:oldPhone": a[5] || (a[5] = (t) => e.oldPhone = t),
814
823
  code: e.code,
815
824
  "onUpdate:code": a[6] || (a[6] = (t) => e.code = t),
816
- "hint-text": J.value,
817
- "rate-limit-text": _.value,
825
+ "hint-text": Y.value,
826
+ "rate-limit-text": Q.value,
818
827
  "is-final-limit": ee.value,
819
828
  "is-not-match-code": M.value,
820
829
  loading: y.value,
821
830
  "is-tg": h.value,
822
- onOnSendCode: a[7] || (a[7] = (t) => ne({ value: e.newPhone })),
823
- onOnSendCodeAgain: a[8] || (a[8] = (t) => ne({ value: e.newPhone, isOnlySms: !h.value && v.value })),
831
+ onOnSendCode: a[7] || (a[7] = (t) => ae({ value: e.newPhone })),
832
+ onOnSendCodeAgain: a[8] || (a[8] = (t) => ae({ value: e.newPhone, isOnlySms: !h.value && m.value })),
824
833
  onOnSendOnlySms: ve,
825
- onOnMatchCode: Se,
834
+ onOnMatchCode: Te,
826
835
  onOnMatchCodeError: Me,
827
836
  onOnClearCodeError: a[9] || (a[9] = (t) => M.value = !1)
828
- }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : S.value === r(W).COMPLETED ? (p(), b("div", ko, [
829
- U("p", null, H(B("Телефон успешно изменен")), 1)
837
+ }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : T.value === r(K).COMPLETED ? (p(), b("div", ko, [
838
+ U("p", null, G(L("Телефон успешно изменен")), 1)
830
839
  ])) : E("", !0)
831
840
  ])) : (p(), b("div", Eo, [
832
- y.value ? (p(), G(Be, { key: 0 })) : E("", !0),
833
- T(So, {
841
+ y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
842
+ S(To, {
834
843
  phone: e.addPhone,
835
844
  "onUpdate:phone": a[10] || (a[10] = (t) => e.addPhone = t),
836
845
  oldPhone: e.oldPhone,
837
846
  "onUpdate:oldPhone": a[11] || (a[11] = (t) => e.oldPhone = t),
838
847
  code: e.addCode,
839
848
  "onUpdate:code": a[12] || (a[12] = (t) => e.addCode = t),
840
- "hint-text": r(X) ? J.value : "Чтобы продолжить, введите новый номер",
841
- "rate-limit-text": _.value,
849
+ "hint-text": r(j) ? Y.value : "Чтобы продолжить, введите новый номер",
850
+ "rate-limit-text": Q.value,
842
851
  "is-final-limit": ee.value,
843
852
  "is-not-match-code": M.value,
844
853
  loading: y.value,
845
854
  "is-tg": h.value,
846
855
  onOnSendCode: a[13] || (a[13] = (t) => me({ value: e.addPhone, field: "phone" })),
847
- onOnSendCodeAgain: a[14] || (a[14] = (t) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && v.value })),
856
+ onOnSendCodeAgain: a[14] || (a[14] = (t) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && m.value })),
848
857
  onOnSendOnlySms: ve,
849
858
  onOnMatchCode: ke,
850
859
  onOnMatchCodeError: Ee
@@ -853,7 +862,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
853
862
  ]),
854
863
  _: 1
855
864
  }, 8, ["modelValue"]),
856
- T(r(Xe))
865
+ S(r(Xe))
857
866
  ], 64));
858
867
  }
859
868
  });
@@ -213,9 +213,9 @@ const Ze = {
213
213
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
214
214
  setup(m, { emit: r }) {
215
215
  const n = r, s = h(!0), { currentDialog: g, dialogPayload: v, closeDialog: U } = H(), l = {
216
- email: J(() => import("./ProfileEmailDialog-CJLV7SDo.js")),
217
- phone: J(() => import("./ProfilePhoneDialog-DwkvuAoY.js")),
218
- password: J(() => import("./ProfilePasswordDialog-oJXqLFQM.js"))
216
+ email: J(() => import("./ProfileEmailDialog-AcPtImzL.js")),
217
+ phone: J(() => import("./ProfilePhoneDialog-BMasSboX.js")),
218
+ password: J(() => import("./ProfilePasswordDialog-CkWFh3ZH.js"))
219
219
  }, d = ({ email: y }) => {
220
220
  n("update-email-field", y);
221
221
  }, p = ({ phone: y }) => {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-wrapper[data-v-c43c8b01] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-c43c8b01]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-c43c8b01] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-c43c8b01]:hover .wide-img .overlay{opacity:1!important}.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(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { a as o } from "./index-B7D53Hrl.js";
2
+ import { a as o } from "./index-BrTdCrUe.js";
3
3
  export {
4
4
  o as PEditUserContact
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
2
2
  import { PLoader as w } from "@profeat/ui-kit";
3
- import { _ as g, g as R, p as h } from "./index-B7D53Hrl.js";
3
+ import { _ as g, g as R, p as h } from "./index-BrTdCrUe.js";
4
4
  function C(e) {
5
5
  const t = Math.floor(e / 60), a = e % 60;
6
6
  return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",