@yourgoods/ui-smart 0.53.7 → 0.53.9

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