@yourgoods/ui-smart 0.53.30 → 0.53.32

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 oe, ref as T, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as y, createElementVNode as x, createCommentVNode as D, toDisplayString as _, createVNode as $, unref as u, isRef as ee, withCtx as G, createTextVNode as ie, Fragment as Ae, createBlock as H, resolveDynamicComponent as he, onMounted as Fe } from "vue";
2
- import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-TLAOlytL.js";
3
- import { C as F, _ as He, B as qe, p as W, g as je } from "./index-DGkhZigd.js";
2
+ import { _ as ve, c as ke, u as Re, a as ze, P as Me, b as We } from "./useRateLimitToast-BmKeReLb.js";
3
+ import { C as F, _ as He, B as qe, p as W, g as je } from "./index-CwO8NHzD.js";
4
4
  import { PInput as J, IconMailMd as pe, PButton as ne, IconEyeMd as Ve, IconEyeClosedMd as be, PDialog as Ge, PTopBar as Ye, IconCrossMd as Je } from "@profeat/ui-kit";
5
5
  const Ke = { class: "dialogDefaultContainerInsideContent" }, Qe = { class: "dialogDefaultContainerTextHint" }, Xe = {
6
6
  key: 0,
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
2
- import { C as I, p as D, g as Ve } from "./index-DGkhZigd.js";
2
+ import { C as I, p as D, g as Ve } from "./index-CwO8NHzD.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
1
  import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
2
- import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-TLAOlytL.js";
2
+ import { _ as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-BmKeReLb.js";
3
3
  import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
- import { C as j, t as De, p as te, g as Ae } from "./index-DGkhZigd.js";
4
+ import { C as j, t as De, p as te, g as Ae } from "./index-CwO8NHzD.js";
5
5
  const _e = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -1,13 +1,13 @@
1
- import { ref as y, shallowRef as Re, defineComponent as X, defineAsyncComponent as Z, watch as ge, createBlock as x, createCommentVNode as I, unref as p, openBlock as b, resolveDynamicComponent as _e, mergeProps as Oe, computed as A, reactive as H, onMounted as Ge, createElementBlock as U, Fragment as ve, createVNode as w, createElementVNode as Q, withCtx as R, toDisplayString as _, createTextVNode as ee, Teleport as pe, Transition as je, withDirectives as qe, vShow as Je } from "vue";
2
- import We from "axios";
3
- import { PInputFileUploader as Ye, PInput as O, IconFilledEditMd as W, PButton as fe, PImageCropper as Xe, PToast as Ke, PTeleportContainer as he, PToastContainer as Ze, IconPhoneMd as He, IconMailMd as Qe } from "@profeat/ui-kit";
4
- function et(l, s = 2) {
1
+ import { ref as y, shallowRef as je, defineComponent as X, defineAsyncComponent as Z, watch as we, createBlock as $, createCommentVNode as I, unref as p, openBlock as P, resolveDynamicComponent as qe, mergeProps as Je, computed as F, reactive as H, onMounted as We, createElementBlock as V, Fragment as be, createVNode as w, createElementVNode as Q, withCtx as R, toDisplayString as _, createTextVNode as ee, Teleport as pe, Transition as Ye, withDirectives as Xe, vShow as Ke } from "vue";
2
+ import Ze from "axios";
3
+ import { PInputFileUploader as He, PInput as O, IconFilledEditMd as W, PButton as fe, PImageCropper as Qe, PToast as ea, PTeleportContainer as Pe, PToastContainer as aa, IconPhoneMd as ta, IconMailMd as oa } from "@profeat/ui-kit";
4
+ function na(l, s = 2) {
5
5
  if (l === 0)
6
6
  return "0 B";
7
- const a = 1024, o = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], u = Math.floor(Math.log(l) / Math.log(a));
8
- return `${Number.parseFloat((l / a ** u).toFixed(s))} ${o[u]}`;
7
+ const t = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], i = Math.floor(Math.log(l) / Math.log(t));
8
+ return `${Number.parseFloat((l / t ** i).toFixed(s))} ${n[i]}`;
9
9
  }
10
- const tt = {
10
+ const ra = {
11
11
  "image/jpeg": "JPEG",
12
12
  "image/png": "PNG",
13
13
  "application/pdf": "PDF",
@@ -15,67 +15,67 @@ const tt = {
15
15
  "application/zip": "ZIP Archive"
16
16
  // ...
17
17
  };
18
- function at(l) {
18
+ function la(l) {
19
19
  return l.map((s) => {
20
- var a;
21
- return tt[s] || ((a = s.split("/")[1]) == null ? void 0 : a.toUpperCase());
20
+ var t;
21
+ return ra[s] || ((t = s.split("/")[1]) == null ? void 0 : t.toUpperCase());
22
22
  });
23
23
  }
24
- const xt = {
24
+ const $a = {
25
25
  OLD: "old",
26
26
  NEW: "new",
27
27
  COMPLETED: "completed"
28
- }, zt = {
28
+ }, za = {
29
29
  VERIFY_EMAIL: "verify-email"
30
30
  };
31
- let ae = null;
32
- function ot(l, s, a) {
33
- ae = We.create({
31
+ let te = null;
32
+ function sa(l, s, t) {
33
+ te = Ze.create({
34
34
  baseURL: s,
35
35
  headers: {
36
36
  Authorization: `Bearer ${l}`,
37
- "x-throttler-prefix": a ?? "throttler_profile_edit"
37
+ "x-throttler-prefix": t ?? "throttler_profile_edit"
38
38
  // здесь можно словить баг, который может быть сложно отследить, если будет передаваться пустой прелфикс
39
39
  // 'Content-Type': 'application/json',
40
40
  },
41
- validateStatus: (o) => o >= 200 && o < 300
41
+ validateStatus: (n) => n >= 200 && n < 300
42
42
  });
43
43
  }
44
44
  function ne() {
45
- if (!ae)
45
+ if (!te)
46
46
  throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
47
- return ae;
47
+ return te;
48
48
  }
49
- async function oe(l, s, a) {
50
- return ne().post(l, s, a);
49
+ async function oe(l, s, t) {
50
+ return ne().post(l, s, t);
51
51
  }
52
- async function nt(l, s) {
52
+ async function ia(l, s) {
53
53
  return ne().get(l, s);
54
54
  }
55
- async function rt(l, s) {
55
+ async function ua(l, s) {
56
56
  return ne().delete(l, s);
57
57
  }
58
- async function lt(l) {
58
+ async function da(l) {
59
59
  const s = await oe("/users/profile/me", l);
60
60
  if (s.status !== 200 && s.status !== 201 || !s.data)
61
61
  throw new Error("Ошибка при получении профиля пользователя");
62
62
  return s.data;
63
63
  }
64
- const Y = y(null), te = Re(null);
64
+ const Y = y(null), ae = je(null);
65
65
  function re() {
66
66
  return {
67
67
  currentDialog: Y,
68
- dialogPayload: te,
69
- openDialog: (o, u) => {
70
- Y.value = o, te.value = u ?? null;
68
+ dialogPayload: ae,
69
+ openDialog: (n, i) => {
70
+ Y.value = n, ae.value = i ?? null;
71
71
  },
72
72
  closeDialog: () => {
73
- Y.value = null, te.value = null;
73
+ Y.value = null, ae.value = null;
74
74
  },
75
- isDialogOpen: (o) => Y.value === o
75
+ isDialogOpen: (n) => Y.value === n
76
76
  };
77
77
  }
78
- const st = {
78
+ const ma = {
79
79
  ru: {
80
80
  Имя: "Имя",
81
81
  Фамилия: "Фамилия",
@@ -208,7 +208,7 @@ const st = {
208
208
  "Введите новый номер телефона": "Enter a new phone number",
209
209
  "Телефон успешно изменен": "Phone number successfully changed"
210
210
  }
211
- }, it = /* @__PURE__ */ X({
211
+ }, ca = /* @__PURE__ */ X({
212
212
  __name: "DialogManager",
213
213
  props: {
214
214
  language: {},
@@ -217,53 +217,53 @@ const st = {
217
217
  },
218
218
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
219
219
  setup(l, { emit: s }) {
220
- const a = s, o = y(!0), { currentDialog: u, dialogPayload: v, closeDialog: B } = re(), d = {
221
- email: Z(() => import("./ProfileEmailDialog-LCVrvwnP.js")),
222
- phone: Z(() => import("./ProfilePhoneDialog-Adf9uije.js")),
223
- password: Z(() => import("./ProfilePasswordDialog-BruPsgfm.js"))
224
- }, m = ({ email: E }) => {
225
- a("update-email-field", E);
226
- }, c = ({ phone: E }) => {
227
- a("update-phone-field", E);
220
+ const t = s, n = y(!0), { currentDialog: i, dialogPayload: g, closeDialog: A } = re(), u = {
221
+ email: Z(() => import("./ProfileEmailDialog-e6stiNdn.js")),
222
+ phone: Z(() => import("./ProfilePhoneDialog-D0EHkYqh.js")),
223
+ password: Z(() => import("./ProfilePasswordDialog-D4oYXwwt.js"))
224
+ }, d = ({ email: E }) => {
225
+ t("update-email-field", E);
226
+ }, m = ({ phone: E }) => {
227
+ t("update-phone-field", E);
228
228
  };
229
- return ge(u, (E) => {
230
- o.value = !!E;
231
- }), (E, f) => p(u) ? (b(), x(_e(d[p(u)]), Oe({
229
+ return we(i, (E) => {
230
+ n.value = !!E;
231
+ }), (E, f) => p(i) ? (P(), $(qe(u[p(i)]), Je({
232
232
  key: 0,
233
- modelValue: o.value,
234
- "onUpdate:modelValue": f[0] || (f[0] = (h) => o.value = h),
233
+ modelValue: n.value,
234
+ "onUpdate:modelValue": f[0] || (f[0] = (h) => n.value = h),
235
235
  language: E.language,
236
236
  provider: E.provider,
237
237
  "disable-add-phone": E.disableAddPhone
238
- }, p(v), {
239
- onClose: p(B),
240
- onCleanInputErrors: f[1] || (f[1] = (h) => a("clean-input-errors")),
241
- onOnUpdateJwt: f[2] || (f[2] = (h, i, n) => a("on-update-jwt", h, i, n)),
242
- onSubmitEmail: m,
243
- onSubmitPhone: c,
244
- onOnPasswordError: f[3] || (f[3] = (h, i) => a("on-password-error", h, i)),
245
- onOnToast: f[4] || (f[4] = (h) => a("on-toast", h))
238
+ }, p(g), {
239
+ onClose: p(A),
240
+ onCleanInputErrors: f[1] || (f[1] = (h) => t("clean-input-errors")),
241
+ onOnUpdateJwt: f[2] || (f[2] = (h, N, o) => t("on-update-jwt", h, N, o)),
242
+ onSubmitEmail: d,
243
+ onSubmitPhone: m,
244
+ onOnPasswordError: f[3] || (f[3] = (h, N) => t("on-password-error", h, N)),
245
+ onOnToast: f[4] || (f[4] = (h) => t("on-toast", h))
246
246
  }), null, 16, ["modelValue", "language", "provider", "disable-add-phone", "onClose"])) : I("", !0);
247
247
  }
248
- }), ut = { class: "base-container" }, dt = {
248
+ }), pa = { class: "base-container" }, fa = {
249
249
  key: 0,
250
250
  style: { color: "#E46060" }
251
- }, mt = { key: 1 }, ct = {
251
+ }, ga = { key: 1 }, va = {
252
252
  key: 1,
253
253
  class: "input-wrapper"
254
- }, pt = {
254
+ }, ha = {
255
255
  key: 2,
256
256
  class: "input-wrapper"
257
- }, ft = {
257
+ }, ya = {
258
258
  key: 3,
259
259
  class: "input-wrapper"
260
- }, gt = {
260
+ }, wa = {
261
261
  key: 4,
262
262
  class: "input-wrapper"
263
- }, vt = { class: "buttons-container" }, ht = {
263
+ }, ba = { class: "buttons-container" }, Pa = {
264
264
  key: 0,
265
265
  class: "centered-overlay"
266
- }, yt = { class: "toastWrapper" }, wt = /* @__PURE__ */ X({
266
+ }, Ea = { class: "toastWrapper" }, Na = /* @__PURE__ */ X({
267
267
  __name: "PEditUserContact",
268
268
  props: {
269
269
  language: {},
@@ -278,7 +278,7 @@ const st = {
278
278
  },
279
279
  emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
280
280
  setup(l, { emit: s }) {
281
- const a = l, o = s, u = A(() => a.language ?? "ru"), v = (e) => st[u.value][e] || e, { openDialog: B } = re(), d = H({ firstName: "", lastName: "" }), m = y({ firstName: "", lastName: "" }), c = H({ firstName: !1, lastName: !1, email: !1, phone: !1 }), E = y(""), f = y(""), h = y(""), i = y(!1), n = H({
281
+ const t = l, n = s, i = F(() => t.language ?? "ru"), g = (e) => ma[i.value][e] || e, { openDialog: A } = re(), u = H({ firstName: "", lastName: "" }), d = y({ firstName: "", lastName: "" }), m = H({ firstName: !1, lastName: !1, email: !1, phone: !1 }), E = y(""), f = y(""), h = y(""), N = y(!1), o = H({
282
282
  value: null,
283
283
  loading: !1,
284
284
  accept: ["image/png", "image/jpeg"],
@@ -286,334 +286,334 @@ const st = {
286
286
  // 10 MB
287
287
  imageBinary: null,
288
288
  imageContent: ""
289
- }), g = y(""), C = y(!1), D = y(!0), V = y(!0), F = y(void 0), S = y(""), P = A(() => se(d.firstName, c.firstName)), M = A(() => se(d.lastName, c.lastName)), $ = A(() => c.email && !f.value.trim() ? "Введите e-mail" : ""), z = A(() => c.phone && !h.value.trim() ? "Введите номер телефона" : ""), L = (e) => a.fields.some((t) => t.key === e), le = (e) => e && e.trim() ? "edit" : "bind", K = () => setTimeout(() => {
289
+ }), v = y(""), c = y(!1), b = y(!0), U = y(!0), D = y(void 0), S = y(""), C = F(() => se(u.firstName, m.firstName)), z = F(() => se(u.lastName, m.lastName)), x = F(() => m.email && !f.value.trim() ? "Введите e-mail" : ""), M = F(() => m.phone && !h.value.trim() ? "Введите номер телефона" : ""), L = (e) => t.fields.some((a) => a.key === e), le = (e) => e && e.trim() ? "edit" : "bind", K = () => setTimeout(() => {
290
290
  var e;
291
291
  return (e = document.activeElement) == null ? void 0 : e.blur();
292
- }, 0), we = A(() => !!(f.value && f.value.trim() !== "")), be = A(() => n.imageContent ? v("Загрузить другое фото") : v("Загрузить фото")), se = (e, t) => {
293
- if (!t) return "";
292
+ }, 0), Ne = F(() => !!(f.value && f.value.trim() !== "")), Ce = F(() => o.imageContent ? g("Загрузить другое фото") : g("Загрузить фото")), se = (e, a) => {
293
+ if (!a) return "";
294
294
  const r = e.trim();
295
295
  return r ? r.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
296
- }, Ee = (e) => B("email", { mode: e ? "edit" : "bind", initialEmail: e }), Pe = () => {
297
- K(), c.email = !1, V.value = !1, o("open-email-dialog", f.value, le(f.value)), Ee(f.value);
298
- }, Ne = () => {
299
- K(), c.phone = !1, D.value = !1, o("open-phone-dialog", h.value, le(h.value));
300
- }, Ce = async (e, t, r) => {
301
- e === "email" && r && (f.value = r), e === "phone" && r && (h.value = r), o("on-update-jwt");
302
- }, ke = (e) => {
296
+ }, ke = (e) => A("email", { mode: e ? "edit" : "bind", initialEmail: e }), Te = () => {
297
+ K(), m.email = !1, U.value = !1, n("open-email-dialog", f.value, le(f.value)), ke(f.value);
298
+ }, De = () => {
299
+ K(), m.phone = !1, b.value = !1, n("open-phone-dialog", h.value, le(h.value));
300
+ }, Be = async (e, a, r) => {
301
+ e === "email" && r && (f.value = r), e === "phone" && r && (h.value = r), n("on-update-jwt");
302
+ }, Ie = (e) => {
303
303
  h.value = e;
304
- }, Te = (e) => {
304
+ }, Ue = (e) => {
305
305
  f.value = e;
306
- }, Ie = (e, t) => {
307
- C.value = !0, o("on-password-error", e, t);
308
- }, Ue = () => {
309
- D.value = !1, V.value = !1;
306
+ }, Ve = (e, a) => {
307
+ c.value = !0, n("on-password-error", e, a);
308
+ }, Ae = () => {
309
+ b.value = !1, U.value = !1;
310
310
  }, G = (e) => {
311
- C.value = !0, F.value = e.color ?? "", S.value = e.text ?? "";
311
+ c.value = !0, D.value = e.color ?? "", S.value = e.text ?? "";
312
312
  }, j = (e) => {
313
- if (c[e] = !0, e === "firstName" || e === "lastName") {
314
- const t = d[e];
315
- t.length > 40 && (d[e] = t.slice(0, 40));
313
+ if (m[e] = !0, e === "firstName" || e === "lastName") {
314
+ const a = u[e];
315
+ a.length > 40 && (u[e] = a.slice(0, 40));
316
316
  }
317
- }, Be = (e) => {
317
+ }, Fe = (e) => {
318
318
  var q, J;
319
- if (g.value = "", !e) {
319
+ if (v.value = "", !e) {
320
320
  ie();
321
321
  return;
322
322
  }
323
- const t = ((q = e.fileBinary) == null ? void 0 : q.type) ?? "", r = ((J = e.fileBinary) == null ? void 0 : J.size) ?? 0, T = !["image/png", "image/jpeg"].includes(t), k = r > n.uploadLimit;
324
- if (T || k) {
325
- g.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ie();
323
+ const a = ((q = e.fileBinary) == null ? void 0 : q.type) ?? "", r = ((J = e.fileBinary) == null ? void 0 : J.size) ?? 0, B = !["image/png", "image/jpeg"].includes(a), T = r > o.uploadLimit;
324
+ if (B || T) {
325
+ v.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ie();
326
326
  return;
327
327
  }
328
- n.value = e, n.imageBinary = e.fileBinary ?? null, n.imageContent = e.fileContent ?? "", i.value = !0;
328
+ o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", N.value = !0;
329
329
  }, ie = () => {
330
- n.value = null, n.imageBinary = null, n.imageContent = "", i.value = !1;
331
- }, De = async () => {
330
+ o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
331
+ }, Se = async () => {
332
332
  try {
333
- const t = (await rt("/users/profile/delete/avatar")).data;
334
- return (t == null ? void 0 : t.success) === !0;
333
+ const a = (await ua("/users/profile/delete/avatar")).data;
334
+ return (a == null ? void 0 : a.success) === !0;
335
335
  } catch (e) {
336
336
  return console.error("Ошибка при удалении аватара:", e), !1;
337
337
  }
338
- }, Ve = () => {
339
- g.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", n.value = null, n.imageBinary = null, n.imageContent = "", i.value = !1;
340
- }, ue = async (e, t, r = "image/png") => {
338
+ }, Me = () => {
339
+ v.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
340
+ }, ue = async (e, a, r = "image/png") => {
341
341
  if (!e) return null;
342
- const T = await (await fetch(e)).blob();
343
- return new File([T], t, { type: r });
344
- }, Ae = () => {
345
- n.value = null, n.imageBinary = null, n.imageContent = "", i.value = !1;
346
- }, Fe = async (e) => {
347
- i.value = !1;
348
- const t = n.imageContent;
349
- if (n.imageContent = e, !n.imageBinary) return;
342
+ const B = await (await fetch(e)).blob();
343
+ return new File([B], a, { type: r });
344
+ }, xe = () => {
345
+ o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
346
+ }, $e = async (e) => {
347
+ N.value = !1;
348
+ const a = o.imageContent;
349
+ if (o.imageContent = e, !o.imageBinary) return;
350
350
  const r = await ue(
351
351
  e,
352
- n.imageBinary.name,
353
- n.imageBinary.type || "image/png"
352
+ o.imageBinary.name,
353
+ o.imageBinary.type || "image/png"
354
354
  );
355
355
  if (!r) {
356
- n.imageContent = t;
356
+ o.imageContent = a;
357
357
  return;
358
358
  }
359
359
  try {
360
- n.loading = !0;
361
- const N = new FormData();
362
- N.append("file", r), await oe(`/users/profile/avatar/${E.value}`, N, { headers: { "Content-Type": void 0 } });
363
- } catch (N) {
364
- console.error(N), G({
360
+ o.loading = !0;
361
+ const k = new FormData();
362
+ k.append("file", r), await oe(`/users/profile/avatar/${E.value}`, k, { headers: { "Content-Type": void 0 } });
363
+ } catch (k) {
364
+ console.error(k), G({
365
365
  color: "error",
366
- text: v("Не удалось сохранить изменения. Попробуйте позже")
367
- }), n.imageContent = t;
366
+ text: g("Не удалось сохранить изменения. Попробуйте позже")
367
+ }), o.imageContent = a;
368
368
  } finally {
369
- n.loading = !1;
369
+ o.loading = !1;
370
370
  }
371
- }, Se = async (e) => {
372
- n.imageContent = e ?? "", n.imageBinary && (n.imageBinary = await ue(
371
+ }, ze = async (e) => {
372
+ o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await ue(
373
373
  e ?? "",
374
- n.imageBinary.name,
375
- n.imageBinary.type || "image/png"
374
+ o.imageBinary.name,
375
+ o.imageBinary.type || "image/png"
376
376
  ));
377
377
  }, de = y(!1), me = async (e) => {
378
- var r, N;
379
- const t = (r = d[e]) == null ? void 0 : r.trim();
380
- if (t)
378
+ var r, k;
379
+ const a = (r = u[e]) == null ? void 0 : r.trim();
380
+ if (a)
381
381
  try {
382
382
  de.value = !0;
383
- const k = (N = (await oe("/users/profile/update-name", { [e]: t })).data) == null ? void 0 : N.data;
384
- k != null && k.user && (d.firstName = k.user.firstName ?? d.firstName, d.lastName = k.user.lastName ?? d.lastName, m.value = {
385
- firstName: d.firstName,
386
- lastName: d.lastName
383
+ const T = (k = (await oe("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : k.data;
384
+ T != null && T.user && (u.firstName = T.user.firstName ?? u.firstName, u.lastName = T.user.lastName ?? u.lastName, d.value = {
385
+ firstName: u.firstName,
386
+ lastName: u.lastName
387
387
  });
388
- } catch (T) {
389
- throw T;
388
+ } catch (B) {
389
+ throw B;
390
390
  } finally {
391
391
  de.value = !1;
392
392
  }
393
- }, Me = async () => {
393
+ }, Le = async () => {
394
394
  var e;
395
- if (!a.accessToken)
395
+ if (!t.accessToken)
396
396
  throw console.error("Access token не передан в props"), new Error("Access token is required");
397
397
  try {
398
- const r = (e = (await lt({
399
- accessToken: a.accessToken,
400
- refreshToken: a.refreshToken ?? "",
398
+ const r = (e = (await da({
399
+ accessToken: t.accessToken,
400
+ refreshToken: t.refreshToken ?? "",
401
401
  excludeFields: []
402
402
  })).data) == null ? void 0 : e.user;
403
403
  if (!r)
404
404
  throw console.error("Данные пользователя отсутствуют в ответе сервера"), new Error("User data is missing from the response");
405
405
  const {
406
- userId: N,
407
- privateFirstName: T,
408
- privateLastName: k,
406
+ userId: k,
407
+ privateFirstName: B,
408
+ privateLastName: T,
409
409
  email: q,
410
410
  phoneNumber: J
411
411
  } = r;
412
- E.value = N ?? "", d.firstName = T ?? "", d.lastName = k ?? "", f.value = q ?? "", h.value = J ?? "", n.imageContent = await $e(), m.value = {
413
- firstName: T ?? "",
414
- lastName: k ?? ""
412
+ E.value = k ?? "", u.firstName = B ?? "", u.lastName = T ?? "", f.value = q ?? "", h.value = J ?? "", o.imageContent = await Re(), d.value = {
413
+ firstName: B ?? "",
414
+ lastName: T ?? ""
415
415
  };
416
- } catch (t) {
417
- console.error("Критическая ошибка при загрузке профиля:", t);
416
+ } catch (a) {
417
+ console.error("Критическая ошибка при загрузке профиля:", a);
418
418
  }
419
- }, $e = async () => {
419
+ }, Re = async () => {
420
420
  var e;
421
421
  try {
422
- const r = (e = (await nt("/users/profile/avatar")).data) == null ? void 0 : e.data;
423
- return r ? xe(r) : "";
424
- } catch (t) {
425
- return console.error("Ошибка при загрузке метаданных аватара:", t), "";
422
+ const r = (e = (await ia("/users/profile/avatar")).data) == null ? void 0 : e.data;
423
+ return r ? _e(r) : "";
424
+ } catch (a) {
425
+ return console.error("Ошибка при загрузке метаданных аватара:", a), "";
426
426
  }
427
427
  };
428
- function xe(e) {
428
+ function _e(e) {
429
429
  if (!e)
430
430
  return "";
431
431
  try {
432
- return new URL(e.key, a.awsStorageUrl).toString();
433
- } catch (t) {
434
- return console.error("Ошибка при составлении URL аватара:", t), "";
432
+ return new URL(e.key, t.awsStorageUrl).toString();
433
+ } catch (a) {
434
+ return console.error("Ошибка при составлении URL аватара:", a), "";
435
435
  }
436
436
  }
437
- const ce = A(() => {
438
- if (!m.value.firstName && !m.value.lastName)
437
+ const ce = F(() => {
438
+ if (!d.value.firstName && !d.value.lastName)
439
439
  return !1;
440
- const e = d.firstName.trim(), t = d.lastName.trim(), r = m.value.firstName.trim(), N = m.value.lastName.trim(), T = e !== r || t !== N, k = e.length >= 2 && t.length >= 2;
441
- return T && k;
442
- }), ze = async () => {
440
+ const e = u.firstName.trim(), a = u.lastName.trim(), r = d.value.firstName.trim(), k = d.value.lastName.trim(), B = e !== r || a !== k, T = e.length >= 2 && a.length >= 2;
441
+ return B && T;
442
+ }), Oe = async () => {
443
443
  if (ce.value)
444
444
  try {
445
- await Promise.all([me("firstName"), me("lastName")]), o("on-update-jwt"), G({ color: "success", text: "Изменения сохранены" });
445
+ await Promise.all([me("firstName"), me("lastName")]), n("on-update-jwt"), G({ color: "success", text: "Изменения сохранены" });
446
446
  } catch (e) {
447
447
  console.error(e), G({
448
448
  color: "error",
449
- text: v("Не удалось сохранить изменения. Попробуйте позже")
449
+ text: g("Не удалось сохранить изменения. Попробуйте позже")
450
450
  });
451
451
  }
452
- }, Le = () => {
453
- K(), o("open-password-dialog");
452
+ }, Ge = () => {
453
+ K(), n("open-password-dialog");
454
454
  };
455
- return Ge(async () => {
456
- if (!a.accessToken) throw new Error("Access token не передан в props");
457
- if (!a.requestUrl) throw new Error("auth-backend url не передан в props");
458
- ot(a.accessToken, a.requestUrl, a.throttlerPrefix), await Me();
459
- }), (e, t) => (b(), U(ve, null, [
460
- w(it, {
461
- language: u.value,
455
+ return We(async () => {
456
+ if (!t.accessToken) throw new Error("Access token не передан в props");
457
+ if (!t.requestUrl) throw new Error("auth-backend url не передан в props");
458
+ sa(t.accessToken, t.requestUrl, t.throttlerPrefix), await Le();
459
+ }), (e, a) => (P(), V(be, null, [
460
+ w(ca, {
461
+ language: i.value,
462
462
  provider: e.provider,
463
463
  "disable-add-phone": e.disableAddPhone,
464
- onCleanInputErrors: Ue,
465
- onOnUpdateJwt: Ce,
466
- onUpdatePhoneField: ke,
467
- onUpdateEmailField: Te,
468
- onOnPasswordError: Ie,
464
+ onCleanInputErrors: Ae,
465
+ onOnUpdateJwt: Be,
466
+ onUpdatePhoneField: Ie,
467
+ onUpdateEmailField: Ue,
468
+ onOnPasswordError: Ve,
469
469
  onOnToast: G
470
470
  }, null, 8, ["language", "provider", "disable-add-phone"]),
471
- Q("div", ut, [
472
- L("avatar") ? (b(), x(p(Ye), {
471
+ Q("div", pa, [
472
+ L("avatar") ? (P(), $(p(He), {
473
473
  key: 0,
474
- modelValue: n.value,
474
+ modelValue: o.value,
475
475
  "onUpdate:modelValue": [
476
- t[0] || (t[0] = (r) => n.value = r),
477
- t[1] || (t[1] = (r) => Be(r))
476
+ a[0] || (a[0] = (r) => o.value = r),
477
+ a[1] || (a[1] = (r) => Fe(r))
478
478
  ],
479
479
  type: "img",
480
480
  class: "avatar-input",
481
- src: n.imageContent,
482
- loading: n.loading,
483
- label: v("Загрузить фото"),
484
- "upload-limit": n.uploadLimit,
481
+ src: o.imageContent,
482
+ loading: o.loading,
483
+ label: g("Загрузить фото"),
484
+ "upload-limit": o.uploadLimit,
485
485
  accept: "image/jpeg, image/png",
486
- onDelete: De,
487
- "onChange:error": Ve
486
+ onDelete: Se,
487
+ "onChange:error": Me
488
488
  }, {
489
489
  afterLoadLabel: R(() => [
490
- ee(_(be.value), 1)
490
+ ee(_(Ce.value), 1)
491
491
  ]),
492
492
  subtext: R(() => [
493
- g.value ? (b(), U("span", dt, _(g.value), 1)) : (b(), U("span", mt, _(`${v("Формат")} ${p(at)(n.accept).join(", ")} ${v("до")} ${p(et)(n.uploadLimit)}`), 1))
493
+ v.value ? (P(), V("span", fa, _(v.value), 1)) : (P(), V("span", ga, _(`${g("Формат")} ${p(la)(o.accept).join(", ")} ${g("до")} ${p(na)(o.uploadLimit)}`), 1))
494
494
  ]),
495
495
  _: 1
496
496
  }, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : I("", !0),
497
- L("firstName") ? (b(), U("div", ct, [
497
+ L("firstName") ? (P(), V("div", va, [
498
498
  w(p(O), {
499
- modelValue: d.firstName,
500
- "onUpdate:modelValue": t[2] || (t[2] = (r) => d.firstName = r),
499
+ modelValue: u.firstName,
500
+ "onUpdate:modelValue": a[2] || (a[2] = (r) => u.firstName = r),
501
501
  size: "large",
502
- label: v("Имя"),
503
- error: P.value,
504
- onBlur: t[3] || (t[3] = (r) => c.firstName = !0),
505
- onInput: t[4] || (t[4] = (r) => j("firstName"))
502
+ label: g("Имя"),
503
+ error: C.value,
504
+ onBlur: a[3] || (a[3] = (r) => m.firstName = !0),
505
+ onInput: a[4] || (a[4] = (r) => j("firstName"))
506
506
  }, null, 8, ["modelValue", "label", "error"]),
507
507
  w(p(W), { class: "icon-locked" })
508
508
  ])) : I("", !0),
509
- L("lastName") ? (b(), U("div", pt, [
509
+ L("lastName") ? (P(), V("div", ha, [
510
510
  w(p(O), {
511
- modelValue: d.lastName,
512
- "onUpdate:modelValue": t[5] || (t[5] = (r) => d.lastName = r),
511
+ modelValue: u.lastName,
512
+ "onUpdate:modelValue": a[5] || (a[5] = (r) => u.lastName = r),
513
513
  size: "large",
514
- label: v("Фамилия"),
515
- error: M.value,
516
- onBlur: t[6] || (t[6] = (r) => c.lastName = !0),
517
- onInput: t[7] || (t[7] = (r) => j("lastName"))
514
+ label: g("Фамилия"),
515
+ error: z.value,
516
+ onBlur: a[6] || (a[6] = (r) => m.lastName = !0),
517
+ onInput: a[7] || (a[7] = (r) => j("lastName"))
518
518
  }, null, 8, ["modelValue", "label", "error"]),
519
519
  w(p(W), { class: "icon-locked" })
520
520
  ])) : I("", !0),
521
- L("email") ? (b(), U("div", ft, [
521
+ L("email") ? (P(), V("div", ya, [
522
522
  w(p(O), {
523
523
  modelValue: f.value,
524
- "onUpdate:modelValue": t[8] || (t[8] = (r) => f.value = r),
524
+ "onUpdate:modelValue": a[8] || (a[8] = (r) => f.value = r),
525
525
  size: "large",
526
526
  "text-size": "medium",
527
527
  label: "E-mail",
528
528
  type: "email",
529
529
  readonly: "",
530
530
  style: { cursor: "pointer" },
531
- error: $.value && V.value,
532
- onBlur: t[9] || (t[9] = (r) => c.email = !0),
533
- onInput: t[10] || (t[10] = (r) => j("email")),
534
- onClick: Pe
531
+ error: x.value && U.value,
532
+ onBlur: a[9] || (a[9] = (r) => m.email = !0),
533
+ onInput: a[10] || (a[10] = (r) => j("email")),
534
+ onClick: Te
535
535
  }, null, 8, ["modelValue", "error"]),
536
536
  w(p(W), { class: "icon-locked" })
537
537
  ])) : I("", !0),
538
- L("phone") ? (b(), U("div", gt, [
538
+ L("phone") ? (P(), V("div", wa, [
539
539
  w(p(O), {
540
540
  modelValue: h.value,
541
- "onUpdate:modelValue": t[11] || (t[11] = (r) => h.value = r),
541
+ "onUpdate:modelValue": a[11] || (a[11] = (r) => h.value = r),
542
542
  size: "large",
543
543
  "text-size": "medium",
544
- label: v("Номер телефона"),
544
+ label: g("Номер телефона"),
545
545
  type: "tel",
546
546
  readonly: "",
547
547
  style: { cursor: "pointer" },
548
- error: z.value && D.value,
549
- onBlur: t[12] || (t[12] = (r) => c.phone = !0),
550
- onInput: t[13] || (t[13] = (r) => j("phone")),
551
- onClick: Ne
548
+ error: M.value && b.value,
549
+ onBlur: a[12] || (a[12] = (r) => m.phone = !0),
550
+ onInput: a[13] || (a[13] = (r) => j("phone")),
551
+ onClick: De
552
552
  }, null, 8, ["modelValue", "label", "error"]),
553
553
  w(p(W), { class: "icon-locked" })
554
554
  ])) : I("", !0),
555
- Q("div", vt, [
556
- we.value ? (b(), x(p(fe), {
555
+ Q("div", ba, [
556
+ Ne.value ? (P(), $(p(fe), {
557
557
  key: 0,
558
558
  color: "secondary",
559
- onClick: Le
559
+ onClick: Ge
560
560
  }, {
561
561
  default: R(() => [
562
- ee(_(v("Сменить пароль")), 1)
562
+ ee(_(g("Сменить пароль")), 1)
563
563
  ]),
564
564
  _: 1
565
565
  })) : I("", !0),
566
566
  w(p(fe), {
567
567
  disabled: !ce.value,
568
- onClick: ze
568
+ onClick: Oe
569
569
  }, {
570
570
  default: R(() => [
571
- ee(_(v("Сохранить")), 1)
571
+ ee(_(g("Сохранить")), 1)
572
572
  ]),
573
573
  _: 1
574
574
  }, 8, ["disabled"])
575
575
  ])
576
576
  ]),
577
- i.value ? (b(), x(pe, {
577
+ N.value ? (P(), $(pe, {
578
578
  key: 0,
579
579
  to: "body"
580
580
  }, [
581
- i.value ? (b(), U("div", ht, [
582
- w(p(Xe), {
581
+ N.value ? (P(), V("div", Pa, [
582
+ w(p(Qe), {
583
583
  "circle-mode": !0,
584
- "model-value": n.imageContent,
585
- onClose: Ae,
586
- onSave: t[14] || (t[14] = (r) => Fe(r)),
587
- "onUpdate:modelValue": t[15] || (t[15] = (r) => Se(r))
584
+ "model-value": o.imageContent,
585
+ onClose: xe,
586
+ onSave: a[14] || (a[14] = (r) => $e(r)),
587
+ "onUpdate:modelValue": a[15] || (a[15] = (r) => ze(r))
588
588
  }, null, 8, ["model-value"])
589
589
  ])) : I("", !0)
590
590
  ])) : I("", !0),
591
- (b(), x(pe, { to: "#toast-root" }, [
592
- Q("div", yt, [
593
- w(je, { name: "list" }, {
591
+ (P(), $(pe, { to: "#toast-root" }, [
592
+ Q("div", Ea, [
593
+ w(Ye, { name: "list" }, {
594
594
  default: R(() => [
595
- qe(w(p(Ke), {
595
+ Xe(w(p(ea), {
596
596
  class: "toast",
597
- color: F.value,
597
+ color: D.value,
598
598
  text: S.value,
599
- onClose: t[16] || (t[16] = (r) => C.value = !1)
599
+ onClose: a[16] || (a[16] = (r) => c.value = !1)
600
600
  }, null, 8, ["color", "text"]), [
601
- [Je, C.value]
601
+ [Ke, c.value]
602
602
  ])
603
603
  ]),
604
604
  _: 1
605
605
  })
606
606
  ])
607
607
  ])),
608
- w(p(he))
608
+ w(p(Pe))
609
609
  ], 64));
610
610
  }
611
- }), ye = (l, s) => {
612
- const a = l.__vccOpts || l;
613
- for (const [o, u] of s)
614
- a[o] = u;
615
- return a;
616
- }, bt = /* @__PURE__ */ ye(wt, [["__scopeId", "data-v-a56fcdbb"]]), Lt = /* @__PURE__ */ X({
611
+ }), Ee = (l, s) => {
612
+ const t = l.__vccOpts || l;
613
+ for (const [n, i] of s)
614
+ t[n] = i;
615
+ return t;
616
+ }, Ca = /* @__PURE__ */ Ee(Na, [["__scopeId", "data-v-a56fcdbb"]]), La = /* @__PURE__ */ X({
617
617
  __name: "index",
618
618
  props: {
619
619
  throttlerPrefix: {},
@@ -628,66 +628,66 @@ const st = {
628
628
  },
629
629
  emits: ["on-update-jwt", "update-tokens"],
630
630
  setup(l, { emit: s }) {
631
- const a = s, { openDialog: o } = re(), u = (m, c) => {
632
- o("email", { initialEmail: m, mode: c });
633
- }, v = (m, c) => {
634
- o("phone", { initialPhone: m, mode: c });
635
- }, B = () => {
636
- o("password");
637
- }, d = (m, c, E) => {
638
- a("on-update-jwt", m, c, E);
631
+ const t = s, { openDialog: n } = re(), i = (d, m) => {
632
+ n("email", { initialEmail: d, mode: m });
633
+ }, g = (d, m) => {
634
+ n("phone", { initialPhone: d, mode: m });
635
+ }, A = () => {
636
+ n("password");
637
+ }, u = (d, m, E) => {
638
+ t("on-update-jwt", d, m, E);
639
639
  };
640
- return (m, c) => (b(), U(ve, null, [
641
- w(p(Ze)),
642
- w(bt, {
643
- "throttler-prefix": m.throttlerPrefix,
644
- provider: m.provider,
645
- "request-url": m.requestUrl,
646
- language: m.language,
647
- fields: m.fields,
648
- "access-token": m.accessToken,
649
- "refresh-token": m.refreshToken,
650
- "aws-storage-url": m.awsStorageUrl,
651
- "disable-add-phone": m.disableAddPhone,
652
- onOpenEmailDialog: u,
653
- onOpenPhoneDialog: v,
654
- onOpenPasswordDialog: B,
655
- onOnUpdateJwt: d
640
+ return (d, m) => (P(), V(be, null, [
641
+ w(p(aa)),
642
+ w(Ca, {
643
+ "throttler-prefix": d.throttlerPrefix,
644
+ provider: d.provider,
645
+ "request-url": d.requestUrl,
646
+ language: d.language,
647
+ fields: d.fields,
648
+ "access-token": d.accessToken,
649
+ "refresh-token": d.refreshToken,
650
+ "aws-storage-url": d.awsStorageUrl,
651
+ "disable-add-phone": d.disableAddPhone,
652
+ onOpenEmailDialog: i,
653
+ onOpenPhoneDialog: g,
654
+ onOpenPasswordDialog: A,
655
+ onOnUpdateJwt: u
656
656
  }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "disable-add-phone"]),
657
- w(p(he))
657
+ w(p(Pe))
658
658
  ], 64));
659
659
  }
660
- }), Et = 10, Pt = 10, Nt = 15;
661
- function Ct(l, s, a) {
662
- let o = l.replace(/[^\d+]/g, "").replace(/(?!^)\+/g, "");
663
- return a != null && a.startsWith("ru") && o.startsWith("8") ? o = `+7${o.slice(1)}` : s && o && !o.startsWith("+") && (o = `+${o}`), o;
660
+ }), ka = 10, Ta = 10, Da = 15;
661
+ function ge(l, s, t) {
662
+ let n = l.replace(/[^\d+]/g, "").replace(/(?!^)\+/g, "");
663
+ return t != null && t.startsWith("ru") && n.startsWith("8") ? n = `+7${n.slice(1)}` : s && n && !n.startsWith("+") && (n = `+${n}`), n;
664
664
  }
665
- function kt(l) {
665
+ function ve(l) {
666
666
  return l.startsWith("+") ? l.slice(1).replace(/\D/g, "") : l.replace(/\D/g, "");
667
667
  }
668
- function Tt(l, s = Et, a = Nt) {
668
+ function he(l, s = ka, t = Da) {
669
669
  if (!l.startsWith("+"))
670
670
  return !1;
671
- const o = l.slice(1);
672
- return !(!/^\d+$/.test(o) || o.length < s || o.length > a);
671
+ const n = l.slice(1);
672
+ return !(!/^\d+$/.test(n) || n.length < s || n.length > t);
673
673
  }
674
- function It(l) {
674
+ function Ba(l) {
675
675
  return !/^\+?\d*$/.test(l);
676
676
  }
677
- function Ut(l, s) {
678
- let a = 0, o = !1;
679
- return l.split("").filter((u, v) => u === "+" ? v !== 0 || o ? !1 : (o = !0, !0) : /\d/.test(u) ? (a++, a <= s) : !1).join("");
677
+ function Ia(l, s) {
678
+ let t = 0, n = !1;
679
+ return l.split("").filter((i, g) => i === "+" ? g !== 0 || n ? !1 : (n = !0, !0) : /\d/.test(i) ? (t++, t <= s) : !1).join("");
680
680
  }
681
- const Bt = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
682
- function Dt(l) {
683
- return Bt.test(l);
681
+ const Ua = /^[\w.%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;
682
+ function ye(l) {
683
+ return Ua.test(l);
684
684
  }
685
- function Vt(l, s) {
686
- var o, u;
687
- const a = l.trim();
688
- return (o = s.phone) != null && o.enabled && /\d/.test(a) && !a.includes("@") ? "phone" : (u = s.email) != null && u.enabled ? "email" : null;
685
+ function Va(l, s) {
686
+ var n, i;
687
+ const t = l.trim();
688
+ return (n = s.phone) != null && n.enabled && /\d/.test(t) && !t.includes("@") ? "phone" : (i = s.email) != null && i.enabled ? "email" : null;
689
689
  }
690
- const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
690
+ const Aa = { class: "smart-input" }, Fa = /* @__PURE__ */ X({
691
691
  __name: "index",
692
692
  props: {
693
693
  modelValue: {},
@@ -701,107 +701,132 @@ const At = { class: "smart-input" }, Ft = /* @__PURE__ */ X({
701
701
  },
702
702
  emits: ["update:modelValue", "validity-change", "type-change"],
703
703
  setup(l, { emit: s }) {
704
- const a = l, o = s, u = A(() => {
705
- var i, n, g, C, D, V, F, S, P, M, $;
704
+ const t = l, n = s, i = F(() => {
705
+ var o, v, c, b, U, D, S, C, z, x, M;
706
706
  return {
707
- mode: ((i = a.config) == null ? void 0 : i.mode) ?? "auto",
707
+ mode: ((o = t.config) == null ? void 0 : o.mode) ?? "auto",
708
708
  phone: {
709
- enabled: ((g = (n = a.config) == null ? void 0 : n.phone) == null ? void 0 : g.enabled) ?? !0,
710
- minDigits: ((D = (C = a.config) == null ? void 0 : C.phone) == null ? void 0 : D.minDigits) ?? 10,
711
- maxDigits: ((F = (V = a.config) == null ? void 0 : V.phone) == null ? void 0 : F.maxDigits) ?? 15,
712
- autoPlus: ((P = (S = a.config) == null ? void 0 : S.phone) == null ? void 0 : P.autoPlus) ?? !0
709
+ enabled: ((c = (v = t.config) == null ? void 0 : v.phone) == null ? void 0 : c.enabled) ?? !0,
710
+ minDigits: ((U = (b = t.config) == null ? void 0 : b.phone) == null ? void 0 : U.minDigits) ?? 10,
711
+ maxDigits: ((S = (D = t.config) == null ? void 0 : D.phone) == null ? void 0 : S.maxDigits) ?? 15,
712
+ autoPlus: ((z = (C = t.config) == null ? void 0 : C.phone) == null ? void 0 : z.autoPlus) ?? !0
713
713
  },
714
714
  email: {
715
- enabled: (($ = (M = a.config) == null ? void 0 : M.email) == null ? void 0 : $.enabled) ?? !0
715
+ enabled: ((M = (x = t.config) == null ? void 0 : x.email) == null ? void 0 : M.enabled) ?? !0
716
716
  }
717
717
  };
718
- }), v = y(null), B = y(""), d = y(a.modelValue ?? ""), m = y(null), c = y("");
719
- ge(() => a.modelValue, (i) => {
720
- i !== void 0 && (d.value = i, B.value = i);
718
+ }), g = y(null), A = y(""), u = y(t.modelValue ?? ""), d = y(null), m = y("");
719
+ we(() => t.modelValue, (o) => {
720
+ o !== void 0 && (u.value = o, A.value = o);
721
721
  });
722
- function E(i) {
723
- var D, V, F, S;
724
- const g = i.target.value;
725
- if (g.trim() === "") {
726
- m.value = null, c.value = "", o("type-change", null), o("update:modelValue", ""), o("validity-change", !1);
722
+ function E(o) {
723
+ var U, D, S;
724
+ m.value = "";
725
+ const c = o.target.value;
726
+ if (c.trim() === "") {
727
+ d.value = null, m.value = "", n("type-change", null), n("update:modelValue", ""), n("validity-change", !1);
727
728
  return;
728
729
  }
729
- const C = u.value.mode === "auto" ? Vt(g, u.value) : u.value.mode;
730
- if (m.value = C, o("type-change", C), C === "email") {
731
- const P = Dt(g);
732
- c.value = g.length === 0 || P ? "" : ((D = a.errorMessages) == null ? void 0 : D.invalidEmail) ?? "Это не похоже на email", d.value = g, B.value = g, o("update:modelValue", g), o("validity-change", P);
730
+ const b = i.value.mode === "auto" ? Va(c, i.value) : i.value.mode;
731
+ if (d.value = b, n("type-change", b), b === "email") {
732
+ const C = ye(c);
733
+ m.value = c.length === 0 || C ? "" : ((U = t.errorMessages) == null ? void 0 : U.invalidEmail) ?? "Это не похоже на email", u.value = c, A.value = c, n("update:modelValue", c), n("validity-change", C);
733
734
  return;
734
735
  }
735
- if (C === "phone") {
736
- const P = Ct(
737
- g,
738
- u.value.phone.autoPlus,
739
- a.locale
740
- ), M = kt(P);
741
- if (M.length > u.value.phone.maxDigits) {
742
- const z = Ut(g, u.value.phone.maxDigits);
743
- d.value = z, o("update:modelValue", z), h(z);
744
- return;
745
- }
746
- if (d.value = g, It(g)) {
747
- c.value = ((V = a.errorMessages) == null ? void 0 : V.invalidPhoneChars) ?? "Допустимы только цифры и знак +", o("validity-change", !1);
736
+ if (b === "phone") {
737
+ const C = ge(
738
+ c,
739
+ i.value.phone.autoPlus,
740
+ t.locale
741
+ );
742
+ if (ve(C).length > i.value.phone.maxDigits) {
743
+ const M = Ia(c, i.value.phone.maxDigits);
744
+ u.value = M, n("update:modelValue", M), N(M);
748
745
  return;
749
746
  }
750
- if (d.value = P, o("update:modelValue", P), B.value = P, M.length < Pt) {
751
- c.value = ((F = a.errorMessages) == null ? void 0 : F.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", !1);
747
+ if (u.value = c, Ba(c)) {
748
+ m.value = ((D = t.errorMessages) == null ? void 0 : D.invalidPhoneChars) ?? "Допустимы только цифры и знак +", n("validity-change", !1);
752
749
  return;
753
750
  }
754
- const $ = Tt(
755
- P,
756
- u.value.phone.minDigits,
757
- u.value.phone.maxDigits
751
+ u.value = C, n("update:modelValue", C), A.value = C;
752
+ const x = he(
753
+ C,
754
+ i.value.phone.minDigits,
755
+ i.value.phone.maxDigits
758
756
  );
759
- c.value = $ ? "" : ((S = a.errorMessages) == null ? void 0 : S.invalidPhoneLength) ?? "Это не похоже на номер телефона", o("validity-change", $);
757
+ m.value = x ? "" : ((S = t.errorMessages) == null ? void 0 : S.invalidPhoneLength) ?? "Это не похоже на номер телефона", n("validity-change", x);
760
758
  }
761
759
  }
762
760
  function f() {
763
- var n;
764
- const i = (n = v.value) == null ? void 0 : n.$el;
765
- return i ? i.querySelector("input") : null;
761
+ var o, v, c;
762
+ if (d.value) {
763
+ if (d.value === "phone") {
764
+ const b = ge(
765
+ u.value,
766
+ i.value.phone.autoPlus,
767
+ t.locale
768
+ );
769
+ if (ve(b).length < Ta) {
770
+ m.value = ((o = t.errorMessages) == null ? void 0 : o.invalidPhoneLength) ?? "Это не похоже на номер телефона", n("validity-change", !1);
771
+ return;
772
+ }
773
+ const D = he(
774
+ b,
775
+ i.value.phone.minDigits,
776
+ i.value.phone.maxDigits
777
+ );
778
+ m.value = D ? "" : ((v = t.errorMessages) == null ? void 0 : v.invalidPhoneLength) ?? "Это не похоже на номер телефона", n("validity-change", D);
779
+ }
780
+ if (d.value === "email") {
781
+ const b = ye(u.value);
782
+ m.value = b ? "" : ((c = t.errorMessages) == null ? void 0 : c.invalidEmail) ?? "Это не похоже на email", n("validity-change", b);
783
+ }
784
+ }
785
+ }
786
+ function h() {
787
+ var v;
788
+ const o = (v = g.value) == null ? void 0 : v.$el;
789
+ return o ? o.querySelector("input") : null;
766
790
  }
767
- function h(i) {
768
- const n = f();
769
- if (!n) return;
770
- const g = n.selectionStart ?? i.length;
771
- n.value = i, requestAnimationFrame(() => {
772
- n.setSelectionRange(g, g);
791
+ function N(o) {
792
+ const v = h();
793
+ if (!v) return;
794
+ const c = v.selectionStart ?? o.length;
795
+ v.value = o, requestAnimationFrame(() => {
796
+ v.setSelectionRange(c, c);
773
797
  });
774
798
  }
775
- return (i, n) => (b(), U("div", At, [
799
+ return (o, v) => (P(), V("div", Aa, [
776
800
  w(p(O), {
777
801
  ref_key: "inputRef",
778
- ref: v,
779
- "model-value": d.value,
780
- readonly: i.disabled,
781
- error: c.value,
782
- type: i.type ?? "text",
783
- size: i.size ?? "large",
784
- label: i.label ?? "Email или телефон",
785
- onInput: E
802
+ ref: g,
803
+ "model-value": u.value,
804
+ readonly: o.disabled,
805
+ error: m.value,
806
+ type: o.type ?? "text",
807
+ size: o.size ?? "large",
808
+ label: o.label ?? "Email или телефон",
809
+ onInput: E,
810
+ onBlur: f
786
811
  }, null, 8, ["model-value", "readonly", "error", "type", "size", "label"]),
787
- m.value === "phone" ? (b(), x(p(He), {
812
+ d.value === "phone" ? (P(), $(p(ta), {
788
813
  key: 0,
789
814
  class: "smart-input__icon"
790
815
  })) : I("", !0),
791
- m.value === "email" ? (b(), x(p(Qe), {
816
+ d.value === "email" ? (P(), $(p(oa), {
792
817
  key: 1,
793
818
  class: "smart-input__icon"
794
819
  })) : I("", !0)
795
820
  ]));
796
821
  }
797
- }), Rt = /* @__PURE__ */ ye(Ft, [["__scopeId", "data-v-9c03c5a0"]]);
822
+ }), Ra = /* @__PURE__ */ Ee(Fa, [["__scopeId", "data-v-f73f455c"]]);
798
823
  export {
799
- zt as B,
800
- xt as C,
801
- ye as _,
802
- Lt as a,
803
- nt as g,
804
- Rt as i,
824
+ za as B,
825
+ $a as C,
826
+ Ee as _,
827
+ La as a,
828
+ ia as g,
829
+ Ra as i,
805
830
  oe as p,
806
- st as t
831
+ ma as t
807
832
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-9c03c5a0]{position:relative;width:100%}.smart-input__icon[data-v-9c03c5a0]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.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:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;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, i as r } from "./index-DGkhZigd.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-input[data-v-a56fcdbb] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-a56fcdbb] .p-input-file:hover .overlay{visibility:visible}.smart-input[data-v-f73f455c]{position:relative;width:100%}.smart-input__icon[data-v-f73f455c]{position:absolute;top:16px;right:16px;pointer-events:none;opacity:.5}.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:100%;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;max-width:100%;word-wrap:break-word;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, i as r } from "./index-CwO8NHzD.js";
3
3
  export {
4
4
  o as PEditUserContact,
5
5
  r as PEmailOrPhoneInput
@@ -1,6 +1,6 @@
1
1
  import { ref as n, defineComponent as L, createElementBlock as p, openBlock as v, normalizeClass as c, createVNode as w, unref as _, computed as T, renderSlot as d, createCommentVNode as h, createElementVNode as i, toDisplayString as y, createTextVNode as f } from "vue";
2
2
  import { PLoader as $ } from "@profeat/ui-kit";
3
- import { _ as b, g as C, p as R } from "./index-DGkhZigd.js";
3
+ import { _ as b, g as C, p as R } from "./index-CwO8NHzD.js";
4
4
  function g(s) {
5
5
  const e = Math.floor(s / 60), a = s % 60;
6
6
  return `${String(e).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.53.30",
3
+ "version": "0.53.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",