@yourgoods/ui-smart 0.21.0 → 0.23.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-CF0qx7i_.js";
3
+ import { C as O, _ as ze, B as We, p as R, g as He } from "./index-Du1aTQoC.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-Du1aTQoC.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-CF0qx7i_.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-Du1aTQoC.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,39 @@ 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
+ console.debug(o);
205
+ const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
206
+ if (console.debug("global middle check onSendCode: ", {
207
+ errorData: $,
208
+ message: B,
209
+ phoneTakenError: v
210
+ }), B) {
211
+ const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
208
212
  "телефон должен быть в формате",
209
213
  "valid phone number",
210
214
  "phone must be a valid phone number",
@@ -213,18 +217,24 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
213
217
  "newValue must be a valid phone number",
214
218
  "addValue must be a valid phone number",
215
219
  "addPhone must be a valid phone number"
216
- ].some(
217
- (ee) => le.includes(ee)
218
- )) {
219
- m.value = "Это не похоже на номер телефона";
220
+ ], q = Q.some(
221
+ (ee) => ne.includes(ee)
222
+ );
223
+ if (console.debug("global end check onSendCode: ", {
224
+ errorMessage: j,
225
+ lowerCaseError: ne,
226
+ phoneValidationKeywords: Q,
227
+ hasPhoneError: q
228
+ }), q) {
229
+ v.value = "Это не похоже на номер телефона";
220
230
  return;
221
231
  }
222
232
  }
223
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), m.value = "Произошла ошибка сервера. Попробуйте позже.";
233
+ console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
224
234
  }
225
235
  };
226
236
  let e = D("");
227
- const S = (l) => {
237
+ const T = (l) => {
228
238
  u("on-clear-code-error");
229
239
  const n = l.target;
230
240
  let o = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
@@ -233,42 +243,42 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
233
243
  u("on-send-code-again", { phone: g.phoneModel });
234
244
  }, y = () => {
235
245
  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 : "Введите код" : "");
246
+ }, { 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
247
  return (l, n) => (p(), b("div", so, [
238
248
  U("div", io, [
239
- U("div", ro, H(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
249
+ U("div", ro, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
240
250
  c.value ? (p(), b("div", uo, [
241
- l.isTg ? (p(), G(r(ye), { key: 0 })) : (p(), G(r(ie), {
251
+ l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
242
252
  key: 1,
243
253
  style: { "margin-left": "5px" }
244
254
  })),
245
- oe(" " + H(l.isTg ? "Telegram" : "СМС"), 1)
255
+ oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
246
256
  ])) : E("", !0)
247
257
  ]),
248
258
  l.showPhone ? (p(), b("div", co, [
249
- T(r(de), {
259
+ S(r(de), {
250
260
  modelValue: r(M),
251
261
  "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
252
262
  size: "large",
253
263
  "text-size": "medium",
254
264
  label: "Телефон",
255
265
  type: "tel",
256
- error: v.value,
257
- onBlur: n[1] || (n[1] = (o) => B("phone")),
258
- onInput: n[2] || (n[2] = (o) => B("phone"))
266
+ error: m.value,
267
+ onBlur: n[1] || (n[1] = (o) => L("phone")),
268
+ onInput: n[2] || (n[2] = (o) => L("phone"))
259
269
  }, null, 8, ["modelValue", "error"]),
260
- T(r(De), {
270
+ S(r(De), {
261
271
  class: "icon-locked",
262
272
  onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
263
273
  })
264
274
  ])) : E("", !0),
265
275
  c.value ? E("", !0) : (p(), b("div", po, [
266
- T(r(Ae), {
276
+ S(r(Ae), {
267
277
  style: { width: "100%" },
268
- disabled: !K.value,
269
- onClick: J
278
+ disabled: !J.value,
279
+ onClick: Y
270
280
  }, {
271
- default: Z(() => n[6] || (n[6] = [
281
+ default: _(() => n[6] || (n[6] = [
272
282
  oe(" Отправить код ")
273
283
  ])),
274
284
  _: 1,
@@ -276,33 +286,33 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
276
286
  }, 8, ["disabled"])
277
287
  ])),
278
288
  c.value ? (p(), b("div", ho, [
279
- T(r(de), {
289
+ S(r(de), {
280
290
  modelValue: r(d),
281
291
  "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
282
292
  size: "large",
283
293
  "text-size": "medium",
284
294
  label: "Код",
285
295
  type: "text",
286
- error: Q.value,
287
- onInput: S,
288
- onBlur: n[5] || (n[5] = (o) => B("code"))
296
+ error: Z.value,
297
+ onInput: T,
298
+ onBlur: n[5] || (n[5] = (o) => L("code"))
289
299
  }, null, 8, ["modelValue", "error"])
290
300
  ])) : E("", !0),
291
301
  !l.loading && c.value ? (p(), b("div", vo, [
292
- T(ge, {
302
+ S(ge, {
293
303
  loading: l.loading,
294
304
  "rate-limit-text": l.rateLimitText,
295
305
  "is-final-limit": l.isFinalLimit,
296
306
  "on-send-again": C
297
307
  }, {
298
- extra: Z(() => [
308
+ extra: _(() => [
299
309
  l.isTg ? (p(), b("span", {
300
310
  key: 0,
301
311
  class: "dialogDefaultContainerSendCodeBySmsText",
302
312
  onClick: y
303
313
  }, [
304
- oe(H(l.sendCodeBySmsText) + " ", 1),
305
- T(r(ie), { style: { "margin-left": "5px" } })
314
+ oe(G(l.sendCodeBySmsText) + " ", 1),
315
+ S(r(ie), { style: { "margin-left": "5px" } })
306
316
  ])) : E("", !0)
307
317
  ]),
308
318
  _: 1
@@ -319,7 +329,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
319
329
  }, bo = {
320
330
  key: 2,
321
331
  class: "input-wrapper"
322
- }, To = { key: 3 }, So = /* @__PURE__ */ ce({
332
+ }, So = { key: 3 }, To = /* @__PURE__ */ ce({
323
333
  __name: "AddNewPhoneContent",
324
334
  props: {
325
335
  phone: {},
@@ -337,7 +347,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
337
347
  },
338
348
  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
349
  setup(R, { emit: x }) {
340
- const k = R, u = x, c = D(!1), m = D(""), g = pe({
350
+ const k = R, u = x, c = D(!1), v = D(""), g = pe({
341
351
  touched: { phone: !1, code: !1 },
342
352
  phoneModel: "",
343
353
  codeModel: ""
@@ -345,38 +355,38 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
345
355
  te(
346
356
  () => g.phoneModel,
347
357
  (l) => {
348
- u("update:phone", l), m.value = "";
358
+ u("update:phone", l), v.value = "";
349
359
  }
350
360
  ), te(
351
361
  () => g.codeModel,
352
362
  (l) => u("update:code", l)
353
363
  );
354
- const B = (l) => g.touched[l] = !0, K = z(() => {
364
+ const L = (l) => g.touched[l] = !0, J = z(() => {
355
365
  const n = g.phoneModel.trim().replace(/[()\-\s]/g, "");
356
366
  return /^\+?\d{10,15}$/.test(n);
357
- }), J = async () => {
367
+ }), Y = async () => {
358
368
  var l, n;
359
369
  try {
360
- if (B("phone"), !K.value) {
361
- m.value = "Это не похоже на номер телефона";
370
+ if (L("phone"), !J.value) {
371
+ v.value = "Это не похоже на номер телефона";
362
372
  return;
363
373
  }
364
374
  const {
365
- data: { data: o, success: I, message: L }
375
+ data: { data: o, success: $, message: B }
366
376
  } = await Oe(void 0, F(g.phoneModel));
367
377
  if (!(((l = o == null ? void 0 : o[0]) == null ? void 0 : l.available) ?? !1)) {
368
- m.value = "Такой номер уже используется";
378
+ v.value = "Такой номер уже используется";
369
379
  return;
370
380
  }
371
- m.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
381
+ v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
372
382
  } catch (o) {
373
- const I = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, L = I == null ? void 0 : I.message;
383
+ const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
374
384
  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(), _ = [
385
+ errorData: $,
386
+ message: B,
387
+ phoneTakenError: v
388
+ }), B) {
389
+ const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
380
390
  "телефон должен быть в формате",
381
391
  "valid phone number",
382
392
  "phone must be a valid phone number",
@@ -385,24 +395,24 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
385
395
  "newValue must be a valid phone number",
386
396
  "addValue must be a valid phone number",
387
397
  "addPhone must be a valid phone number"
388
- ], Y = _.some(
389
- (ee) => le.includes(ee)
398
+ ], q = Q.some(
399
+ (ee) => ne.includes(ee)
390
400
  );
391
401
  if (console.debug("global end check onSendCode: ", {
392
- errorMessage: X,
393
- lowerCaseError: le,
394
- phoneValidationKeywords: _,
395
- hasPhoneError: Y
396
- }), Y) {
397
- m.value = "Это не похоже на номер телефона";
402
+ errorMessage: j,
403
+ lowerCaseError: ne,
404
+ phoneValidationKeywords: Q,
405
+ hasPhoneError: q
406
+ }), q) {
407
+ v.value = "Это не похоже на номер телефона";
398
408
  return;
399
409
  }
400
410
  }
401
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), m.value = "Произошла ошибка сервера. Попробуйте позже";
411
+ console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
402
412
  }
403
413
  };
404
414
  let e = "";
405
- const S = (l) => {
415
+ const T = (l) => {
406
416
  u("on-clear-code-error");
407
417
  const n = l.target;
408
418
  let o = n.value.replace(/\D/g, "");
@@ -411,42 +421,42 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
411
421
  u("on-send-code-again", { phone: g.phoneModel });
412
422
  }, y = () => {
413
423
  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 : "Введите код" : "");
424
+ }, { 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
425
  return (l, n) => (p(), b("div", fo, [
416
426
  U("div", go, [
417
- U("div", yo, H(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
427
+ U("div", yo, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
418
428
  U("div", Co, [
419
- l.isTg ? (p(), G(r(ye), { key: 0 })) : (p(), G(r(ie), {
429
+ l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
420
430
  key: 1,
421
431
  style: { "margin-left": "5px" }
422
432
  })),
423
- oe(" " + H(l.isTg ? "Telegram" : "СМС"), 1)
433
+ oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
424
434
  ])
425
435
  ]),
426
436
  l.showPhone ? (p(), b("div", wo, [
427
- T(r(de), {
437
+ S(r(de), {
428
438
  modelValue: r(M),
429
439
  "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
430
440
  size: "large",
431
441
  "text-size": "medium",
432
442
  label: "Телефон",
433
443
  type: "tel",
434
- error: v.value,
435
- onBlur: n[1] || (n[1] = (o) => B("phone")),
436
- onInput: n[2] || (n[2] = (o) => B("phone"))
444
+ error: m.value,
445
+ onBlur: n[1] || (n[1] = (o) => L("phone")),
446
+ onInput: n[2] || (n[2] = (o) => L("phone"))
437
447
  }, null, 8, ["modelValue", "error"]),
438
- T(r(De), {
448
+ S(r(De), {
439
449
  class: "icon-locked",
440
450
  onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
441
451
  })
442
452
  ])) : E("", !0),
443
453
  c.value ? E("", !0) : (p(), b("div", Po, [
444
- T(r(Ae), {
454
+ S(r(Ae), {
445
455
  style: { width: "100%" },
446
- disabled: !K.value,
447
- onClick: J
456
+ disabled: !J.value,
457
+ onClick: Y
448
458
  }, {
449
- default: Z(() => n[6] || (n[6] = [
459
+ default: _(() => n[6] || (n[6] = [
450
460
  oe(" Отправить код ")
451
461
  ])),
452
462
  _: 1,
@@ -454,33 +464,33 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
454
464
  }, 8, ["disabled"])
455
465
  ])),
456
466
  c.value ? (p(), b("div", bo, [
457
- T(r(de), {
467
+ S(r(de), {
458
468
  modelValue: r(d),
459
469
  "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
460
470
  size: "large",
461
471
  "text-size": "medium",
462
472
  label: "Код",
463
473
  type: "text",
464
- error: Q.value,
465
- onInput: S,
466
- onBlur: n[5] || (n[5] = (o) => B("code"))
474
+ error: Z.value,
475
+ onInput: T,
476
+ onBlur: n[5] || (n[5] = (o) => L("code"))
467
477
  }, null, 8, ["modelValue", "error"])
468
478
  ])) : E("", !0),
469
- c.value ? (p(), b("div", To, [
470
- T(ge, {
479
+ c.value ? (p(), b("div", So, [
480
+ S(ge, {
471
481
  loading: l.loading,
472
482
  "rate-limit-text": l.rateLimitText,
473
483
  "is-final-limit": l.isFinalLimit,
474
484
  "on-send-again": C
475
485
  }, {
476
- extra: Z(() => [
486
+ extra: _(() => [
477
487
  l.isTg ? (p(), b("span", {
478
488
  key: 0,
479
489
  class: "dialogDefaultContainerSendCodeBySmsText",
480
490
  onClick: y
481
491
  }, [
482
- oe(H(l.sendCodeBySmsText) + " ", 1),
483
- T(r(ie), { style: { "margin-left": "5px" } })
492
+ oe(G(l.sendCodeBySmsText) + " ", 1),
493
+ S(r(ie), { style: { "margin-left": "5px" } })
484
494
  ])) : E("", !0)
485
495
  ]),
486
496
  _: 1
@@ -507,34 +517,34 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
507
517
  },
508
518
  emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
509
519
  setup(R, { expose: x, emit: k }) {
510
- const u = R, c = k, m = D(u.modelValue);
520
+ const u = R, c = k, v = D(u.modelValue);
511
521
  te(
512
522
  () => 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({
523
+ (s) => v.value = s
524
+ ), te(v, (s) => c("update:modelValue", s));
525
+ 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
526
  oldPhone: u.initialPhone ?? "",
517
527
  newPhone: "",
518
528
  code: "",
519
529
  addPhone: "",
520
530
  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));
531
+ }), 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
532
  async function he(s = "email") {
523
533
  var t;
524
534
  return (t = (await Le("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : t.data;
525
535
  }
526
536
  async function Ce(s = "phone") {
527
537
  var V;
528
- const t = (V = (await ae("/users/profile/session/create-if-not-exists", {
538
+ const t = (V = (await le("/users/profile/session/create-if-not-exists", {
529
539
  field: s,
530
540
  oldValue: F(u.initialPhone)
531
541
  })).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) ?? "";
542
+ 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
543
  }
534
544
  async function ze() {
535
545
  try {
536
546
  const s = await he("phone");
537
- C.value = s.sessionId, S.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
547
+ C.value = s.sessionId, T.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
538
548
  } catch {
539
549
  await Ce("phone");
540
550
  }
@@ -542,7 +552,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
542
552
  async function we(s, a = !1) {
543
553
  var t;
544
554
  try {
545
- const V = await ae(
555
+ const V = await le(
546
556
  "/users/profile/check-throttler",
547
557
  {
548
558
  method: "sms",
@@ -551,22 +561,22 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
551
561
  },
552
562
  {
553
563
  headers: {
554
- "x-only-sms": v.value ?? !1
564
+ "x-only-sms": m.value ?? !1
555
565
  }
556
566
  }
557
567
  );
558
568
  await Ne(1e3);
559
569
  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;
570
+ 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
571
  } catch {
562
572
  return null;
563
573
  }
564
574
  }
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, $;
575
+ const ve = async ({ phone: s }) => (m.value = !0, await ae({ value: s, isOnlySms: !0 })), ae = async ({ value: s, isOnlySms: a, offLoading: t } = {}) => {
576
+ var V, w, A, N, W, I;
567
577
  y.value = !0;
568
578
  try {
569
- const f = s ?? e.oldPhone, i = await ae(
579
+ const f = s ?? e.oldPhone, i = await le(
570
580
  "/users/profile/phone/contact/send-code",
571
581
  {
572
582
  sessionId: C.value,
@@ -584,57 +594,57 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
584
594
  );
585
595
  console.debug("response sendContactCode: ", i);
586
596
  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)) {
597
+ 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
598
  console.debug("sendContactCode IN обработка 403 tooManyRequests", i);
589
- const O = (j = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : j.type;
599
+ const O = (W = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : W.type;
590
600
  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;
601
+ const H = i.data.tooManyRequests;
602
+ 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
603
  }
594
604
  return console.debug("sendContactCode after обработка 403 tooManyRequests", i), await we(f), i;
595
605
  } catch (f) {
596
- const i = ($ = f == null ? void 0 : f.data) == null ? void 0 : $.tooManyRequests;
606
+ const i = (I = f == null ? void 0 : f.data) == null ? void 0 : I.tooManyRequests;
597
607
  if ((f == null ? void 0 : f.status) === 403 && i) {
598
608
  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;
609
+ return P > 0 ? (Z(P), o.value = O.total, $.value = O.total - O.available, q.value = O.available ?? re) : n.value = !0, f;
600
610
  }
601
611
  throw f;
602
612
  } finally {
603
613
  y.value = !1, t && (y.value = !1);
604
614
  }
605
615
  }, Pe = async (s, a) => {
606
- var t, V, w, A, N, j, $, f;
616
+ var t, V, w, A, N, W, I, f;
607
617
  y.value = !0;
608
618
  try {
609
619
  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),
620
+ C.value = i.sessionId, T.value = i.step, e.oldPhone = i.oldValue ?? e.oldPhone, e.newPhone = i.newValue ?? e.newPhone;
621
+ const P = await le("/users/profile/change/phone/match-code", {
622
+ phone: a === K.NEW ? F(e.newPhone) : F(e.oldPhone),
613
623
  sessionId: C.value,
614
624
  code: s,
615
625
  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) {
626
+ }), 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);
627
+ if (B(H), !Re) {
618
628
  M.value = !0;
619
629
  return;
620
630
  }
621
631
  if (!O) return P;
622
- if (S.value = O, O === W.NEW) {
632
+ if (T.value = O, O === K.NEW) {
623
633
  const $e = await he("phone");
624
634
  e.oldPhone = $e.oldValue ?? e.oldPhone, e.newPhone = $e.newValue ?? e.newPhone, e.code = "";
625
635
  }
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;
636
+ 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
637
  } finally {
628
638
  y.value = !1;
629
639
  }
630
- }, be = ({ code: s }) => Pe(s, W.OLD);
631
- function Te(s) {
640
+ }, be = ({ code: s }) => Pe(s, K.OLD);
641
+ function Se(s) {
632
642
  }
633
- const Se = ({ code: s }) => Pe(s, W.NEW);
643
+ const Te = ({ code: s }) => Pe(s, K.NEW);
634
644
  function Me(s) {
635
645
  }
636
646
  const ue = () => {
637
- c("close"), m.value = !1;
647
+ c("close"), v.value = !1;
638
648
  };
639
649
  async function xe(s = "phone") {
640
650
  var t;
@@ -649,7 +659,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
649
659
  y.value = !0;
650
660
  try {
651
661
  if (!C.value) {
652
- const N = await ae("/users/profile/session/bind/create", {
662
+ const N = await le("/users/profile/session/bind/create", {
653
663
  field: a,
654
664
  newValue: F(s || e.addPhone)
655
665
  });
@@ -663,7 +673,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
663
673
  async function Fe() {
664
674
  try {
665
675
  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 });
676
+ C.value = s.sessionId, T.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
667
677
  } catch {
668
678
  await Ve({ field: "phone", value: e.addPhone });
669
679
  }
@@ -679,11 +689,11 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
679
689
  try {
680
690
  if (!C.value)
681
691
  throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
682
- const j = s ?? e.addPhone, $ = await ae(
692
+ const W = s ?? e.addPhone, I = await le(
683
693
  `/users/profile/bind/contact/send-code/${a}`,
684
694
  {
685
695
  sessionId: C.value,
686
- phone: F(j),
696
+ phone: F(W),
687
697
  provider: u.provider,
688
698
  isOnlySms: t ?? !1
689
699
  },
@@ -692,36 +702,36 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
692
702
  "x-only-sms": t ?? !1
693
703
  }
694
704
  }
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) {
705
+ ), f = (A = (w = I == null ? void 0 : I.data) == null ? void 0 : w.data) == null ? void 0 : A.deliveryType;
706
+ (f === "tg" || f === "sms") && (d.value = f, f === "tg" && (m.value = !1));
707
+ const i = (N = I.data) == null ? void 0 : N.tooManyRequests;
708
+ if (I.status === 403 && i) {
699
709
  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, $;
710
+ 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
711
  }
702
- const P = await we(j);
703
- return P && P.restTimeSec > 0 ? (Q(P.restTimeSec), n.value = !1) : n.value = !0, $;
712
+ const P = await we(W);
713
+ return P && P.restTimeSec > 0 ? (Z(P.restTimeSec), n.value = !1) : n.value = !0, I;
704
714
  } finally {
705
715
  V && (y.value = !1);
706
716
  }
707
717
  }, ke = async ({ code: s }) => {
708
- var a, t, V, w, A, N, j, $;
718
+ var a, t, V, w, A, N, W, I;
709
719
  y.value = !0;
710
720
  try {
711
721
  if (!C.value) {
712
- const q = await xe("phone");
713
- C.value = q.sessionId, e.addPhone = q.newValue ?? e.addPhone;
722
+ const H = await xe("phone");
723
+ C.value = H.sessionId, e.addPhone = H.newValue ?? e.addPhone;
714
724
  }
715
- const f = await ae("/users/profile/bind/phone/match-code", {
725
+ const f = await le("/users/profile/bind/phone/match-code", {
716
726
  phone: F(e.addPhone),
717
727
  sessionId: C.value,
718
728
  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) {
729
+ }), 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);
730
+ if (B(P), !O) {
721
731
  M.value = !0;
722
732
  return;
723
733
  }
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;
734
+ 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
735
  } finally {
726
736
  y.value = !1;
727
737
  }
@@ -729,35 +739,35 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
729
739
  };
730
740
  return Ue(async () => {
731
741
  y.value = !0;
732
- const s = await le("phone");
742
+ const s = await ne("phone");
733
743
  if (u.mode === "bind" && s === "bind") {
734
744
  await Fe(), y.value = !1;
735
745
  return;
736
746
  }
737
- await ze(), await ne({});
747
+ await ze(), await ae({});
738
748
  }), x({
739
- localVisible: m,
749
+ localVisible: v,
740
750
  form: e,
741
- currentStep: S,
751
+ currentStep: T,
742
752
  loading: y,
743
- rateLimitText: _,
753
+ rateLimitText: Q,
744
754
  isAvailable: ee,
745
- title: K,
746
- hintText: J,
755
+ title: J,
756
+ hintText: Y,
747
757
  handleClose: ue,
748
- sendContactCode: ne,
758
+ sendContactCode: ae,
749
759
  sendBindContactCode: me,
750
760
  handleOldCodeSuccess: be,
751
- handleOldCodeError: Te,
752
- handleNewCodeSuccess: Se,
761
+ handleOldCodeError: Se,
762
+ handleNewCodeSuccess: Te,
753
763
  handleNewCodeError: Me,
754
764
  matchBindCode: ke,
755
765
  matchBindCodeError: Ee
756
766
  }), (s, a) => (p(), b(je, null, [
757
- T(r(Ge), {
758
- modelValue: m.value,
767
+ S(r(Ge), {
768
+ modelValue: v.value,
759
769
  "onUpdate:modelValue": [
760
- a[15] || (a[15] = (t) => m.value = t),
770
+ a[15] || (a[15] = (t) => v.value = t),
761
771
  ue
762
772
  ],
763
773
  width: "small",
@@ -765,19 +775,19 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
765
775
  "close-on-click-outside": !0,
766
776
  "onClick:outside": ue
767
777
  }, {
768
- header: Z(() => [
778
+ header: _(() => [
769
779
  U("div", Mo, [
770
- T(r(Je), {
780
+ S(r(Je), {
771
781
  "slot-left": !1,
772
782
  size: "small",
773
783
  borded: !0,
774
784
  "no-padding": !1
775
785
  }, {
776
- title: Z(() => [
777
- U("span", xo, H(r(X) ? K.value : "Добавление номера телефона"), 1)
786
+ title: _(() => [
787
+ U("span", xo, G(r(j) ? J.value : "Добавление номера телефона"), 1)
778
788
  ]),
779
- "right-button": Z(() => [
780
- T(r(Qe), {
789
+ "right-button": _(() => [
790
+ S(r(Qe), {
781
791
  class: "cross",
782
792
  onClick: ue
783
793
  })
@@ -786,26 +796,26 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
786
796
  })
787
797
  ])
788
798
  ]),
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, {
799
+ default: _(() => [
800
+ r(j) ? (p(), b("div", Vo, [
801
+ y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
802
+ T.value === r(K).OLD ? (p(), X(lo, {
793
803
  key: 1,
794
804
  phone: e.oldPhone,
795
805
  "onUpdate:phone": a[0] || (a[0] = (t) => e.oldPhone = t),
796
806
  code: e.code,
797
807
  "onUpdate:code": a[1] || (a[1] = (t) => e.code = t),
798
- "rate-limit-text": _.value,
808
+ "rate-limit-text": Q.value,
799
809
  "is-final-limit": ee.value,
800
810
  "is-not-match-code": M.value,
801
811
  loading: y.value,
802
812
  "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 })),
813
+ onOnSendCode: a[2] || (a[2] = (t) => ae({ value: e.oldPhone })),
814
+ onOnSendCodeAgain: a[3] || (a[3] = (t) => ae({ value: e.oldPhone, isOnlySms: !h.value && m.value })),
805
815
  onOnSendOnlySms: ve,
806
816
  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, {
817
+ onOnMatchCodeError: Se
818
+ }, 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
819
  key: 2,
810
820
  phone: e.newPhone,
811
821
  "onUpdate:phone": a[4] || (a[4] = (t) => e.newPhone = t),
@@ -813,38 +823,38 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
813
823
  "onUpdate:oldPhone": a[5] || (a[5] = (t) => e.oldPhone = t),
814
824
  code: e.code,
815
825
  "onUpdate:code": a[6] || (a[6] = (t) => e.code = t),
816
- "hint-text": J.value,
817
- "rate-limit-text": _.value,
826
+ "hint-text": Y.value,
827
+ "rate-limit-text": Q.value,
818
828
  "is-final-limit": ee.value,
819
829
  "is-not-match-code": M.value,
820
830
  loading: y.value,
821
831
  "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 })),
832
+ onOnSendCode: a[7] || (a[7] = (t) => ae({ value: e.newPhone })),
833
+ onOnSendCodeAgain: a[8] || (a[8] = (t) => ae({ value: e.newPhone, isOnlySms: !h.value && m.value })),
824
834
  onOnSendOnlySms: ve,
825
- onOnMatchCode: Se,
835
+ onOnMatchCode: Te,
826
836
  onOnMatchCodeError: Me,
827
837
  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)
838
+ }, 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, [
839
+ U("p", null, G(L("Телефон успешно изменен")), 1)
830
840
  ])) : E("", !0)
831
841
  ])) : (p(), b("div", Eo, [
832
- y.value ? (p(), G(Be, { key: 0 })) : E("", !0),
833
- T(So, {
842
+ y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
843
+ S(To, {
834
844
  phone: e.addPhone,
835
845
  "onUpdate:phone": a[10] || (a[10] = (t) => e.addPhone = t),
836
846
  oldPhone: e.oldPhone,
837
847
  "onUpdate:oldPhone": a[11] || (a[11] = (t) => e.oldPhone = t),
838
848
  code: e.addCode,
839
849
  "onUpdate:code": a[12] || (a[12] = (t) => e.addCode = t),
840
- "hint-text": r(X) ? J.value : "Чтобы продолжить, введите новый номер",
841
- "rate-limit-text": _.value,
850
+ "hint-text": r(j) ? Y.value : "Чтобы продолжить, введите новый номер",
851
+ "rate-limit-text": Q.value,
842
852
  "is-final-limit": ee.value,
843
853
  "is-not-match-code": M.value,
844
854
  loading: y.value,
845
855
  "is-tg": h.value,
846
856
  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 })),
857
+ onOnSendCodeAgain: a[14] || (a[14] = (t) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && m.value })),
848
858
  onOnSendOnlySms: ve,
849
859
  onOnMatchCode: ke,
850
860
  onOnMatchCodeError: Ee
@@ -853,7 +863,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
853
863
  ]),
854
864
  _: 1
855
865
  }, 8, ["modelValue"]),
856
- T(r(Xe))
866
+ S(r(Xe))
857
867
  ], 64));
858
868
  }
859
869
  });
@@ -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-CPVQCZFW.js")),
217
+ phone: J(() => import("./ProfilePhoneDialog-Zze9Yipg.js")),
218
+ password: J(() => import("./ProfilePasswordDialog-3Ob3HwjU.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-Du1aTQoC.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-Du1aTQoC.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.23.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",