@opengis/surveyor 0.0.8 → 0.0.10

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.
Files changed (68) hide show
  1. package/README.md +4 -3
  2. package/dist/chunks/{AppIcon-CO70tpMX.js → AppIcon-Di5F4Bu_.js} +1 -1
  3. package/dist/chunks/{AppealDetailField-DNRGpnyD.js → AppealDetailField-DNpsGpPY.js} +2 -2
  4. package/dist/chunks/{AppealStatusBadge-Cu-UzdzA.js → AppealStatusBadge-MP1qD952.js} +1 -1
  5. package/dist/chunks/{AppealStatusBadge-BlAaNUSK.js → AppealStatusBadge-z77wwkFD.js} +2 -2
  6. package/dist/chunks/{ApplicationHistorySection-Cwq0-Frd.js → ApplicationHistorySection-DIoFZwH6.js} +4 -4
  7. package/dist/chunks/{BaseModal-SQXvRRNW.js → BaseModal-DP_ilBdg.js} +21 -11
  8. package/dist/chunks/{FormFilePicker-DxPQlxgy.js → FormFilePicker-D5fAUE0Z.js} +2 -2
  9. package/dist/chunks/{MapLayerMenu-AUeTqgEp.js → MapLayerMenu-CI5cbLEC.js} +1 -1
  10. package/dist/chunks/{RegistryForm-wG-c8GKf.js → RegistryForm-DbCxZsr0.js} +1 -1
  11. package/dist/chunks/{RegistryFormModal-R_iZYqGE.js → RegistryFormModal-D_KLGj2d.js} +3 -3
  12. package/dist/chunks/{RegistryToolbar-322DKUXi.js → RegistryToolbar-DvbrASlj.js} +6 -6
  13. package/dist/chunks/{SurveyorTeleport-CnSF0Ptl.js → SurveyorTeleport-D6-KXe_5.js} +1 -1
  14. package/dist/chunks/{UserAccessBadge-DyZDv7Oo.js → UserAccessBadge-B5Q1LvNv.js} +1 -1
  15. package/dist/chunks/{UserTypeBadge-LvnMuKGo.js → UserTypeBadge-CuAMctTK.js} +1 -1
  16. package/dist/chunks/{VerifiedBadge-bk0n-rlC.js → VerifiedBadge-D6L7mCdp.js} +2 -2
  17. package/dist/chunks/{card-CWqi1K-x.js → card--XUb1kFK.js} +4 -4
  18. package/dist/chunks/{card-C3y-j2TA.js → card-BrjnXf1N.js} +6 -6
  19. package/dist/chunks/{card-6z-m7UkM.js → card-BsTSF6aL.js} +10 -10
  20. package/dist/chunks/{card-Dlp8_KhV.js → card-CI7ntIHf.js} +5 -5
  21. package/dist/chunks/{card-DWpAv92l.js → card-Cu8QOSIw.js} +4 -4
  22. package/dist/chunks/{card-X9UVFgdR.js → card-ylC5NYbz.js} +241 -208
  23. package/dist/chunks/certificates-BnseQylH.js +209 -0
  24. package/dist/chunks/certificates-aJ-hvaP-.js +236 -0
  25. package/dist/chunks/{create-CAVC1qXJ.js → create-Bi7-j9Ri.js} +413 -413
  26. package/dist/chunks/{forgot-DoG6vXhq.js → forgot-DnixBqdc.js} +2 -2
  27. package/dist/chunks/{login-BWGylcSU.js → login-BWCQdEkv.js} +2 -2
  28. package/dist/chunks/map-CwsVIW79.js +2872 -0
  29. package/dist/chunks/{map-layers-sT-gTiD_.js → map-layers-BLiEYC4C.js} +5 -5
  30. package/dist/chunks/{organizations-ByVE2f0c.js → organizations-mc6FlSwe.js} +6 -6
  31. package/dist/chunks/{profile-CkwMFh82.js → profile-F7mr0poI.js} +3 -3
  32. package/dist/chunks/{registration-3GLgq-ae.js → registration-BRF4985_.js} +2 -2
  33. package/dist/chunks/{requests-BTpLXrNj.js → requests-7pD2ckdx.js} +4 -4
  34. package/dist/chunks/{requests-rWq8ok3C.js → requests-BCJN-CNx.js} +5 -5
  35. package/dist/chunks/{reset-CP9LsLkC.js → reset-OZCgLi6f.js} +2 -2
  36. package/dist/chunks/{useEntityPath-C5Owtidc.js → useEntityPath-8s0Y1tjA.js} +1 -1
  37. package/dist/chunks/{users-U1P6xCP4.js → users-CAEjpaI1.js} +6 -6
  38. package/dist/index.css +1 -1
  39. package/dist/index.js +40 -40
  40. package/migrations/20261016120000_map_layers.sql +156 -156
  41. package/migrations/20261016150000_password_reset.sql +15 -15
  42. package/migrations/20261016180000_settlement_lookup.sql +16 -16
  43. package/package.json +1 -1
  44. package/server/dictionaries/index.ts +17 -17
  45. package/server/dictionaries/surveyor/map_layer_components.ts +11 -11
  46. package/server/dictionaries/surveyor/map_layer_groups.ts +10 -10
  47. package/server/dictionaries/surveyor/map_layer_types.ts +11 -11
  48. package/server/modules/surveyor/route.ts +4 -2
  49. package/server/modules/surveyor/schema.ts +18 -1
  50. package/server/modules/surveyor/services/applicationTile.ts +36 -8
  51. package/server/modules/surveyor/services/createApplication.ts +2 -3
  52. package/server/modules/surveyor/services/mapLayers.ts +61 -61
  53. package/server/modules/surveyor/services/registerSurveyor.ts +3 -4
  54. package/server/modules/surveyor/services/requestPasswordReset.ts +1 -0
  55. package/server/modules/surveyor/services/resetSurveyorPassword.ts +1 -0
  56. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -52
  57. package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -53
  58. package/server/modules/surveyor/utils/certificateStatus.ts +15 -0
  59. package/server/modules/surveyor/utils/mail.ts +49 -20
  60. package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -79
  61. package/server/resources/helpers/settlement_lookup.ts +7 -7
  62. package/server/resources/surveyor-admin/certificates.ts +27 -1
  63. package/server/resources/surveyor-admin/map_layers.ts +69 -69
  64. package/server/resources/surveyor-admin/organization_surveyors.ts +31 -31
  65. package/server/resources/surveyor-admin/organizations.ts +61 -61
  66. package/server/resources/surveyor-user/applications.ts +1 -1
  67. package/dist/chunks/certificates-Cwch72-o.js +0 -425
  68. package/dist/chunks/map-UTBxwT7-.js +0 -2776
@@ -1,20 +1,48 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { n as t, t as n } from "./useEntityPath-C5Owtidc.js";
3
- import { a as r, i, o as a } from "./resources-2e8RFqWR.js";
4
- import { t as o } from "./VerifiedBadge-bk0n-rlC.js";
5
- import { t as s } from "./UserAccessBadge-DyZDv7Oo.js";
6
- import { n as c, t as l } from "./AppealDetailField-DNRGpnyD.js";
7
- import { i as u, r as d, t as f } from "./surveyorAccount-C7UiiIYg.js";
8
- import { t as p } from "./SurveyorTeleport-CnSF0Ptl.js";
9
- import { t as m } from "./BaseModal-SQXvRRNW.js";
10
- import { t as h } from "./RegistryForm-wG-c8GKf.js";
2
+ import { n as t, t as n } from "./useEntityPath-8s0Y1tjA.js";
3
+ import { a as r, o as i } from "./resources-2e8RFqWR.js";
4
+ import { t as a } from "./VerifiedBadge-D6L7mCdp.js";
5
+ import { t as o } from "./UserAccessBadge-B5Q1LvNv.js";
6
+ import { n as s, t as c } from "./AppealDetailField-DNpsGpPY.js";
7
+ import { i as l, r as u, t as d } from "./surveyorAccount-C7UiiIYg.js";
8
+ import { t as f } from "./SurveyorTeleport-D6-KXe_5.js";
9
+ import { t as p } from "./BaseModal-DP_ilBdg.js";
10
+ import { t as m } from "./RegistryForm-DbCxZsr0.js";
11
+ import { n as h } from "./certificates-BnseQylH.js";
11
12
  import { n as g, t as _ } from "./resendSurveyorRegistration-BHTTVIw1.js";
12
13
  import { t as v } from "./form-DDjELqZ9.js";
13
14
  import { Fragment as y, computed as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createSlots as w, createTextVNode as T, createVNode as E, defineComponent as D, normalizeClass as O, normalizeStyle as k, onMounted as ee, onUnmounted as te, openBlock as A, ref as j, renderList as M, toDisplayString as N, vModelText as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
14
- import { RouterLink as z, useRoute as ne, useRouter as B } from "vue-router";
15
- import { confirm as V, notify as H } from "@opengis/core";
16
- //#region admin/src/pages/organizations/components/OrganizationUsers.vue?vue&type=script&setup=true&lang.ts
17
- var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", U = /*@__PURE__*/ D({
15
+ import { RouterLink as z, useRoute as B, useRouter as V } from "vue-router";
16
+ import { confirm as ne, notify as H } from "@opengis/core";
17
+ //#region admin/src/components/ui/ValidityBadge.vue?vue&type=script&setup=true&lang.ts
18
+ var U = /*@__PURE__*/ D({
19
+ __name: "ValidityBadge",
20
+ props: { validity: {
21
+ type: [String, null],
22
+ required: !1
23
+ } },
24
+ setup(e, { expose: t }) {
25
+ t();
26
+ let n = e, r = {
27
+ props: n,
28
+ config: b(() => h[n.validity ?? ""] ?? h.no_data)
29
+ };
30
+ return Object.defineProperty(r, "__isScriptSetup", {
31
+ enumerable: !1,
32
+ value: !0
33
+ }), r;
34
+ }
35
+ });
36
+ //#endregion
37
+ //#region admin/src/components/ui/ValidityBadge.vue
38
+ function W(e, t, n, r, i, a) {
39
+ return A(), S("span", { class: O(["inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium", [
40
+ r.config.bg,
41
+ r.config.text,
42
+ r.config.border
43
+ ]]) }, [C("span", { class: O(["h-1.5 w-1.5 rounded-full", r.config.dot]) }, null, 2), T(" " + N(r.config.label), 1)], 2);
44
+ }
45
+ var re = /*#__PURE__*/ e(U, [["render", W], ["__file", "D:/softpro/surveyor/admin/src/components/ui/ValidityBadge.vue"]]), ie = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-700 outline-none transition-colors focus:border-brand-400 focus:ring-1 focus:ring-brand-400", G = /*@__PURE__*/ D({
18
46
  __name: "OrganizationUsers",
19
47
  props: {
20
48
  orgId: {
@@ -31,133 +59,128 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
31
59
  }
32
60
  },
33
61
  emits: ["changed"],
34
- setup(e, { expose: n, emit: o }) {
62
+ setup(e, { expose: n, emit: a }) {
35
63
  n();
36
- let c = e, l = o, h = j(null), v = j({
64
+ let s = e, c = a, m = j(null), v = j({
37
65
  top: "0px",
38
66
  left: "0px"
39
- }), y = j(null), x = j(null), S = j(!1), C = j(null), w = j(""), T = j(""), E = j([]), D = j(!1), O = j(null), k = j(null), A = j(""), M = j(""), N = j({
67
+ }), y = j(null), x = j(null), S = j(!1), C = j(null), w = j(""), T = j(""), E = j([]), D = j(!1), O = j(null), k = j(""), A = j(""), M = j({
40
68
  last_name: "",
41
69
  first_name: "",
42
70
  middle_name: "",
43
71
  phone: ""
44
- }), P = 0, F = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : "");
45
- function I(e) {
72
+ }), N = 0, P = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : ""), F = b(() => O.value?.certificate_status === "valid"), I = b(() => h[O.value?.certificate_status ?? ""]?.label ?? ""), L = b(() => O.value?.account_registered_at ? O.value : null);
73
+ function R(e) {
46
74
  return [
47
75
  e.last_name,
48
76
  e.first_name,
49
77
  e.middle_name
50
78
  ].filter(Boolean).join(" ") || "—";
51
79
  }
52
- function L(e) {
80
+ function z(e) {
53
81
  let t = e.certificate_id_data?.text;
54
82
  return t ? `№ ${t}` : "—";
55
83
  }
56
- function R(e) {
84
+ function B(e) {
57
85
  let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
58
86
  return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
59
87
  }
60
- function z(e) {
88
+ function V(e) {
61
89
  return e.membership_enabled !== !1;
62
90
  }
63
- function ne(e, t) {
64
- if (h.value === e) {
65
- h.value = null;
91
+ function U(e, t) {
92
+ if (m.value === e) {
93
+ m.value = null;
66
94
  return;
67
95
  }
68
- let n = t.currentTarget.getBoundingClientRect(), r = c.users.find((t) => t.surveyor_id === e), i = (2 + (r && _(r) ? 1 : 0) + (r && f(r) ? 1 : 0)) * 44 + 8, a = window.innerHeight - n.bottom < i + 8 ? n.top - i - 4 : n.bottom + 4, o = Math.min(Math.max(8, n.right - 256), window.innerWidth - 256 - 8);
96
+ let n = t.currentTarget.getBoundingClientRect(), r = s.users.find((t) => t.surveyor_id === e), i = (2 + (r && _(r) ? 1 : 0) + (r && d(r) ? 1 : 0)) * 44 + 8, a = window.innerHeight - n.bottom < i + 8 ? n.top - i - 4 : n.bottom + 4, o = Math.min(Math.max(8, n.right - 256), window.innerWidth - 256 - 8);
69
97
  v.value = {
70
98
  top: `${a}px`,
71
99
  left: `${o}px`
72
- }, h.value = e;
100
+ }, m.value = e;
73
101
  }
74
- function B(e) {
102
+ function W(e) {
75
103
  let t = e?.target;
76
- t instanceof Element && t.closest("[data-user-menu]") || (h.value = null);
104
+ t instanceof Element && t.closest("[data-user-menu]") || (m.value = null);
77
105
  }
78
- function U() {
106
+ function G() {
79
107
  y.value = null, x.value = null, w.value = "";
80
108
  }
81
- function W() {
82
- T.value = "", E.value = [], q.value = !1, O.value = null, k.value = null, A.value = "", M.value = "", w.value = "", y.value = "add";
109
+ function K() {
110
+ T.value = "", E.value = [], Y.value = !1, O.value = null, k.value = "", A.value = "", w.value = "", y.value = "add";
83
111
  }
84
- function G(e) {
85
- h.value = null, x.value = e, N.value = {
112
+ function q(e) {
113
+ m.value = null, x.value = e, M.value = {
86
114
  last_name: e.last_name ?? "",
87
115
  first_name: e.first_name ?? "",
88
116
  middle_name: e.middle_name ?? "",
89
117
  phone: e.phone ?? ""
90
118
  }, w.value = "", y.value = "edit";
91
119
  }
92
- function K(e, t) {
120
+ function J(e, t) {
93
121
  w.value = e instanceof Error ? e.message : t;
94
122
  }
95
- let q = j(!1), J = 0;
96
- async function Y() {
97
- let e = T.value.trim(), t = ++J;
98
- if (O.value = null, k.value = null, q.value = e.length >= 2, e.length < 2) {
123
+ let Y = j(!1), X = 0;
124
+ async function Z() {
125
+ let e = T.value.trim(), t = ++X;
126
+ if (O.value = null, Y.value = e.length >= 2, e.length < 2) {
99
127
  E.value = [], D.value = !1;
100
128
  return;
101
129
  }
102
130
  D.value = !0;
103
131
  try {
104
132
  let n = await r(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
105
- if (t !== J) return;
133
+ if (t !== X) return;
106
134
  E.value = (n.data ?? []).map((e) => ({
107
135
  ...e,
108
136
  certificate_id: e.id
109
137
  }));
110
138
  } catch (e) {
111
- if (t !== J) return;
112
- E.value = [], K(e, "Не вдалося знайти сертифікати");
139
+ if (t !== X) return;
140
+ E.value = [], J(e, "Не вдалося знайти сертифікати");
113
141
  } finally {
114
- t === J && (D.value = !1);
142
+ t === X && (D.value = !1);
115
143
  }
116
144
  }
117
- function X() {
118
- window.clearTimeout(P), P = window.setTimeout(() => void Y(), 300);
145
+ function ae() {
146
+ window.clearTimeout(N), N = window.setTimeout(() => void Z(), 300);
119
147
  }
120
- async function Z(e) {
121
- O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "", A.value = e.surveyor_email ?? "", M.value = e.surveyor_phone ?? "", k.value = null, w.value = "";
122
- try {
123
- let t = await i("surveyors", {
124
- page: 1,
125
- limit: 1,
126
- filters: { certificate_id: e.certificate_id }
127
- });
128
- k.value = t.rows[0] ?? null, k.value?.registered_at ? M.value = "" : k.value && (A.value = k.value.email || A.value, M.value = k.value.phone || M.value);
129
- } catch (e) {
130
- K(e, "Не вдалося перевірити сертифікат");
131
- }
148
+ function oe(e) {
149
+ O.value = e, E.value = [], T.value = e.text?.trim() || e.number_certificate || "", k.value = e.account_email || e.surveyor_email || "", A.value = e.account_registered_at ? "" : e.account_phone || e.surveyor_phone || "", w.value = "";
132
150
  }
133
- async function Q() {
134
- if (!O.value || S.value) return;
135
- if (k.value && c.users.some((e) => e.surveyor_id === k.value?.surveyor_id)) {
151
+ async function se() {
152
+ let e = O.value;
153
+ if (!e || S.value) return;
154
+ if (!F.value) {
155
+ w.value = "Додати користувача можна лише за дійсним сертифікатом";
156
+ return;
157
+ }
158
+ if (e.account_id && s.users.some((t) => t.surveyor_id === e.account_id)) {
136
159
  w.value = "Цей користувач уже є в організації";
137
160
  return;
138
161
  }
139
- let e = A.value.trim().toLowerCase();
140
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
162
+ let t = k.value.trim().toLowerCase();
163
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)) {
141
164
  w.value = "Вкажіть коректний email";
142
165
  return;
143
166
  }
144
- let t = k.value?.registered_at ? k.value : null;
145
- if (t && e !== (t.email ?? "").trim().toLowerCase()) {
167
+ let n = L.value;
168
+ if (n && t !== (n.account_email ?? "").trim().toLowerCase()) {
146
169
  w.value = "Email не збігається з email облікового запису цього сертифіката";
147
170
  return;
148
171
  }
149
172
  S.value = !0, w.value = "";
150
173
  try {
151
- let n = await r("/api/surveyor/surveyors", {
174
+ let i = await r("/api/surveyor/surveyors", {
152
175
  method: "POST",
153
176
  body: JSON.stringify({
154
- organization_id: c.orgId,
155
- certificate_id: O.value.certificate_id,
156
- email: e,
157
- ...t ? {} : { phone: M.value.trim() }
177
+ organization_id: s.orgId,
178
+ certificate_id: e.certificate_id,
179
+ email: t,
180
+ ...n ? {} : { phone: A.value.trim() }
158
181
  })
159
182
  });
160
- H(n.registration_status === "attached" ? {
183
+ H(i.registration_status === "attached" ? {
161
184
  type: "success",
162
185
  title: "Користувача додано",
163
186
  message: "Наявний обліковий запис прикріплено до організації"
@@ -165,16 +188,16 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
165
188
  type: "success",
166
189
  title: "Користувача додано",
167
190
  message: "На email надіслано лист для завершення реєстрації"
168
- }), U(), l("changed");
191
+ }), G(), c("changed");
169
192
  } catch (e) {
170
- K(e, "Не вдалося додати користувача");
193
+ J(e, "Не вдалося додати користувача");
171
194
  } finally {
172
195
  S.value = !1;
173
196
  }
174
197
  }
175
- async function ie(e) {
198
+ async function ce(e) {
176
199
  if (!C.value) {
177
- h.value = null, C.value = e.surveyor_id;
200
+ m.value = null, C.value = e.surveyor_id;
178
201
  try {
179
202
  await g(e.surveyor_id);
180
203
  } finally {
@@ -182,37 +205,37 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
182
205
  }
183
206
  }
184
207
  }
185
- function ae(e) {
186
- f(e) && (h.value = null, V({
208
+ function le(e) {
209
+ d(e) && (m.value = null, ne({
187
210
  title: "Зміна пароля",
188
211
  type: "warning",
189
- message: `Згенерувати новий пароль для «${I(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
212
+ message: `Згенерувати новий пароль для «${R(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
190
213
  confirmButtonText: "Згенерувати",
191
214
  cancelButtonText: "Скасувати",
192
- onConfirm: () => d(e.surveyor_id)
215
+ onConfirm: () => u(e.surveyor_id)
193
216
  }));
194
217
  }
195
- function oe(e) {
196
- h.value = null;
197
- let t = !z(e);
198
- V({
218
+ function ue(e) {
219
+ m.value = null;
220
+ let t = !V(e);
221
+ ne({
199
222
  title: t ? "Активація" : "Деактивація",
200
223
  type: t ? "warning" : "error",
201
- message: t ? `Активувати користувача «${I(e)}»?` : `Деактивувати користувача «${I(e)}» в організації «${c.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
224
+ message: t ? `Активувати користувача «${R(e)}»?` : `Деактивувати користувача «${R(e)}» в організації «${s.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
202
225
  confirmButtonText: t ? "Активувати" : "Деактивувати",
203
226
  cancelButtonText: "Скасувати",
204
227
  onConfirm: async () => {
205
- await u(e.surveyor_id, c.orgId, t) && l("changed");
228
+ await l(e.surveyor_id, s.orgId, t) && c("changed");
206
229
  }
207
230
  });
208
231
  }
209
- async function se() {
232
+ async function Q() {
210
233
  if (!x.value || S.value) return;
211
234
  let e = {
212
- last_name: N.value.last_name.trim(),
213
- first_name: N.value.first_name.trim(),
214
- middle_name: N.value.middle_name.trim(),
215
- phone: N.value.phone.trim()
235
+ last_name: M.value.last_name.trim(),
236
+ first_name: M.value.first_name.trim(),
237
+ middle_name: M.value.middle_name.trim(),
238
+ phone: M.value.phone.trim()
216
239
  };
217
240
  if (!e.last_name || !e.first_name) {
218
241
  w.value = "Прізвище та імʼя обовʼязкові";
@@ -220,23 +243,23 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
220
243
  }
221
244
  S.value = !0, w.value = "";
222
245
  try {
223
- await a("surveyors", x.value.surveyor_id, e), U(), l("changed");
246
+ await i("surveyors", x.value.surveyor_id, e), G(), c("changed");
224
247
  } catch (e) {
225
- K(e, "Не вдалося зберегти користувача");
248
+ J(e, "Не вдалося зберегти користувача");
226
249
  } finally {
227
250
  S.value = !1;
228
251
  }
229
252
  }
230
253
  ee(() => {
231
- document.addEventListener("click", B), window.addEventListener("resize", B), window.addEventListener("scroll", B, !0);
254
+ document.addEventListener("click", W), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0);
232
255
  }), te(() => {
233
- window.clearTimeout(P), document.removeEventListener("click", B), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0);
256
+ window.clearTimeout(N), document.removeEventListener("click", W), window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
234
257
  });
235
258
  let $ = {
236
- props: c,
237
- emit: l,
238
- fieldClass: re,
239
- openMenuId: h,
259
+ props: s,
260
+ emit: c,
261
+ fieldClass: ie,
262
+ openMenuId: m,
240
263
  menuStyle: v,
241
264
  dialog: y,
242
265
  activeUser: x,
@@ -247,51 +270,54 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
247
270
  certificates: E,
248
271
  certificatesLoading: D,
249
272
  selectedCertificate: O,
250
- existingSurveyor: k,
251
- addEmail: A,
252
- addPhone: M,
253
- editDraft: N,
273
+ addEmail: k,
274
+ addPhone: A,
275
+ editDraft: M,
254
276
  get searchTimer() {
255
- return P;
277
+ return N;
256
278
  },
257
279
  set searchTimer(e) {
258
- P = e;
280
+ N = e;
259
281
  },
260
- dialogTitle: F,
261
- personName: I,
262
- certificateLabel: L,
263
- certificatePerson: R,
264
- membershipEnabled: z,
265
- toggleMenu: ne,
266
- closeMenu: B,
267
- closeDialog: U,
268
- openAdd: W,
269
- openEdit: G,
270
- fail: K,
271
- searched: q,
282
+ dialogTitle: P,
283
+ selectedAvailable: F,
284
+ selectedStatusLabel: I,
285
+ registeredAccount: L,
286
+ personName: R,
287
+ certificateLabel: z,
288
+ certificatePerson: B,
289
+ membershipEnabled: V,
290
+ toggleMenu: U,
291
+ closeMenu: W,
292
+ closeDialog: G,
293
+ openAdd: K,
294
+ openEdit: q,
295
+ fail: J,
296
+ searched: Y,
272
297
  get searchSeq() {
273
- return J;
298
+ return X;
274
299
  },
275
300
  set searchSeq(e) {
276
- J = e;
301
+ X = e;
277
302
  },
278
- searchCertificates: Y,
279
- onCertificateInput: X,
280
- chooseCertificate: Z,
281
- submitAdd: Q,
282
- resendRegistrationInvite: ie,
283
- resetPassword: ae,
284
- toggleAccess: oe,
285
- submitEdit: se,
303
+ searchCertificates: Z,
304
+ onCertificateInput: ae,
305
+ chooseCertificate: oe,
306
+ submitAdd: se,
307
+ resendRegistrationInvite: ce,
308
+ resetPassword: le,
309
+ toggleAccess: ue,
310
+ submitEdit: Q,
286
311
  AppIcon: t,
287
- SurveyorTeleport: p,
288
- BaseModal: m,
289
- UserAccessBadge: s,
312
+ SurveyorTeleport: f,
313
+ BaseModal: p,
314
+ UserAccessBadge: o,
315
+ ValidityBadge: re,
290
316
  get canResendSurveyorRegistration() {
291
317
  return _;
292
318
  },
293
319
  get canResetSurveyorPassword() {
294
- return f;
320
+ return d;
295
321
  }
296
322
  };
297
323
  return Object.defineProperty($, "__isScriptSetup", {
@@ -299,44 +325,47 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
299
325
  value: !0
300
326
  }), $;
301
327
  }
302
- }), W = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, G = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, K = { class: "flex items-center gap-2.5" }, q = { class: "text-brand-600" }, J = { class: "overflow-x-auto" }, Y = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, X = { class: "divide-y divide-slate-100" }, Z = { class: "px-5 py-3.5" }, Q = { class: "font-semibold text-slate-800" }, ie = {
328
+ }), K = { class: "rounded-xl border border-slate-200 bg-white shadow-card" }, q = { class: "flex items-center justify-between gap-2.5 border-b border-slate-100 px-5 py-3.5" }, J = { class: "flex items-center gap-2.5" }, Y = { class: "text-brand-600" }, X = { class: "overflow-x-auto" }, Z = { class: "w-full min-w-[1080px] table-fixed text-left text-[13px]" }, ae = { class: "divide-y divide-slate-100" }, oe = { class: "px-5 py-3.5" }, se = { class: "font-semibold text-slate-800" }, ce = {
303
329
  key: 0,
304
330
  class: "mt-1 text-xs text-slate-400"
305
- }, ae = { class: "px-5 py-3.5 leading-snug text-slate-600" }, oe = { class: "px-5 py-3.5 leading-snug text-slate-600" }, se = { class: "px-5 py-3.5 text-slate-600" }, $ = { class: "px-5 py-3.5" }, ce = { class: "px-5 py-3.5 text-center" }, le = [
331
+ }, le = { class: "px-5 py-3.5 leading-snug text-slate-600" }, ue = { class: "px-5 py-3.5 leading-snug text-slate-600" }, Q = { class: "px-5 py-3.5 text-slate-600" }, $ = { class: "px-5 py-3.5" }, de = { class: "px-5 py-3.5 text-center" }, fe = [
306
332
  "aria-label",
307
333
  "aria-expanded",
308
334
  "onClick"
309
- ], ue = ["onClick"], de = ["disabled", "onClick"], fe = ["onClick"], pe = ["onClick"], me = { key: 0 }, he = {
335
+ ], pe = ["onClick"], me = ["disabled", "onClick"], he = ["onClick"], ge = ["onClick"], _e = { key: 0 }, ve = {
310
336
  key: 0,
311
337
  class: "space-y-4"
312
- }, ge = { class: "block" }, _e = {
338
+ }, ye = { class: "block" }, be = {
313
339
  key: 0,
314
340
  class: "text-xs text-slate-400"
315
- }, ve = {
341
+ }, xe = {
316
342
  key: 1,
317
343
  class: "max-h-48 overflow-y-auto rounded-lg border border-slate-200"
318
- }, ye = ["onClick"], be = { class: "font-medium text-slate-800" }, xe = { class: "text-xs text-slate-500" }, Se = {
344
+ }, Se = ["onClick"], Ce = { class: "flex min-w-0 flex-col" }, we = { class: "font-medium text-slate-800" }, Te = { class: "truncate text-xs text-slate-500" }, Ee = {
319
345
  key: 2,
320
346
  class: "text-sm text-slate-500"
321
- }, Ce = {
347
+ }, De = {
348
+ key: 3,
349
+ class: "rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700"
350
+ }, Oe = {
322
351
  key: 0,
323
352
  class: "rounded-lg bg-amber-50 px-3 py-2 text-sm text-amber-800"
324
- }, we = { class: "block" }, Te = {
353
+ }, ke = { class: "block" }, Ae = {
325
354
  key: 1,
326
355
  class: "block"
327
- }, Ee = {
356
+ }, je = {
328
357
  key: 2,
329
358
  class: "text-xs text-slate-400"
330
- }, De = {
359
+ }, Me = {
331
360
  key: 1,
332
361
  class: "grid grid-cols-1 gap-4 sm:grid-cols-2"
333
- }, Oe = { class: "block" }, ke = { class: "block" }, Ae = { class: "block sm:col-span-2" }, je = { class: "block sm:col-span-2" }, Me = {
362
+ }, Ne = { class: "block" }, Pe = { class: "block" }, Fe = { class: "block sm:col-span-2" }, Ie = { class: "block sm:col-span-2" }, Le = {
334
363
  key: 2,
335
364
  class: "mt-3 text-sm text-red-600"
336
- }, Ne = { class: "flex justify-end gap-3" }, Pe = ["disabled"], Fe = ["disabled"];
337
- function Ie(e, t, n, r, i, a) {
338
- return A(), S("section", W, [
339
- C("header", G, [C("div", K, [C("span", q, [E(r.AppIcon, {
365
+ }, Re = { class: "flex justify-end gap-3" }, ze = ["disabled"], Be = ["disabled"];
366
+ function Ve(e, t, n, r, i, a) {
367
+ return A(), S("section", K, [
368
+ C("header", q, [C("div", J, [C("span", Y, [E(r.AppIcon, {
340
369
  name: "users",
341
370
  class: "h-[18px] w-[18px]"
342
371
  })]), t[9] ||= C("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Користувачі", -1)]), C("button", {
@@ -347,7 +376,7 @@ function Ie(e, t, n, r, i, a) {
347
376
  name: "plus",
348
377
  class: "h-3.5 w-3.5"
349
378
  }), t[10] ||= T(" Додати користувача ", -1)])]),
350
- C("div", J, [C("table", Y, [
379
+ C("div", X, [C("table", Z, [
351
380
  t[14] ||= C("colgroup", null, [
352
381
  C("col", { class: "w-[24%]" }),
353
382
  C("col", { class: "w-[17%]" }),
@@ -364,19 +393,19 @@ function Ie(e, t, n, r, i, a) {
364
393
  C("th", { class: "px-5 py-3" }, "Статус"),
365
394
  C("th", { class: "px-5 py-3 text-center" }, "Дії")
366
395
  ])], -1),
367
- C("tbody", X, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
396
+ C("tbody", ae, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
368
397
  key: e.surveyor_id,
369
398
  class: "align-top transition-colors hover:bg-brand-50/40"
370
399
  }, [
371
- C("td", Z, [C("p", Q, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ie, "Реєстрацію не завершено"))]),
372
- C("td", ae, N(r.certificateLabel(e)), 1),
373
- C("td", oe, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
374
- C("td", se, N(n.orgName), 1),
400
+ C("td", oe, [C("p", se, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ce, "Реєстрацію не завершено"))]),
401
+ C("td", le, N(r.certificateLabel(e)), 1),
402
+ C("td", ue, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
403
+ C("td", Q, N(n.orgName), 1),
375
404
  C("td", $, [E(r.UserAccessBadge, {
376
405
  "account-blocked": e.enabled === !1,
377
406
  "membership-disabled": !r.membershipEnabled(e)
378
407
  }, null, 8, ["account-blocked", "membership-disabled"])]),
379
- C("td", ce, [C("button", {
408
+ C("td", de, [C("button", {
380
409
  type: "button",
381
410
  "data-user-menu": "",
382
411
  class: "inline-flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-brand-50 hover:text-brand-700",
@@ -386,7 +415,7 @@ function Ie(e, t, n, r, i, a) {
386
415
  }, [E(r.AppIcon, {
387
416
  name: "more-vertical",
388
417
  class: "h-4 w-4"
389
- })], 8, le), E(r.SurveyorTeleport, null, {
418
+ })], 8, fe), E(r.SurveyorTeleport, null, {
390
419
  default: I(() => [r.openMenuId === e.surveyor_id ? (A(), S("div", {
391
420
  key: 0,
392
421
  "data-user-menu": "",
@@ -400,7 +429,7 @@ function Ie(e, t, n, r, i, a) {
400
429
  }, [E(r.AppIcon, {
401
430
  name: "pencil",
402
431
  class: "h-4 w-4 text-slate-400"
403
- }), t[11] ||= T(" Редагувати ", -1)], 8, ue),
432
+ }), t[11] ||= T(" Редагувати ", -1)], 8, pe),
404
433
  r.canResendSurveyorRegistration(e) ? (A(), S("button", {
405
434
  key: 0,
406
435
  type: "button",
@@ -410,7 +439,7 @@ function Ie(e, t, n, r, i, a) {
410
439
  }, [E(r.AppIcon, {
411
440
  name: "send",
412
441
  class: "h-4 w-4 shrink-0 text-slate-400"
413
- }), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, de)) : x("", !0),
442
+ }), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, me)) : x("", !0),
414
443
  r.canResetSurveyorPassword(e) ? (A(), S("button", {
415
444
  key: 1,
416
445
  type: "button",
@@ -419,7 +448,7 @@ function Ie(e, t, n, r, i, a) {
419
448
  }, [E(r.AppIcon, {
420
449
  name: "key-round",
421
450
  class: "h-4 w-4 shrink-0 text-slate-400"
422
- }), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, fe)) : x("", !0),
451
+ }), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, he)) : x("", !0),
423
452
  C("button", {
424
453
  type: "button",
425
454
  class: O(["flex w-full items-center gap-2 px-3 py-2.5 text-sm transition-colors", r.membershipEnabled(e) ? "text-red-600 hover:bg-red-50" : "text-slate-700 hover:bg-slate-50"]),
@@ -427,11 +456,11 @@ function Ie(e, t, n, r, i, a) {
427
456
  }, [E(r.AppIcon, {
428
457
  name: r.membershipEnabled(e) ? "user-x" : "power",
429
458
  class: O(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
430
- }, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, pe)
459
+ }, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, ge)
431
460
  ], 4)) : x("", !0)]),
432
461
  _: 2
433
462
  }, 1024)])
434
- ]))), 128)), n.users.length === 0 ? (A(), S("tr", me, [...t[13] ||= [C("td", {
463
+ ]))), 128)), n.users.length === 0 ? (A(), S("tr", _e, [...t[13] ||= [C("td", {
435
464
  colspan: "6",
436
465
  class: "px-5 py-12 text-center text-sm text-slate-400"
437
466
  }, " Користувачів не знайдено. ", -1)]])) : x("", !0)])
@@ -440,81 +469,85 @@ function Ie(e, t, n, r, i, a) {
440
469
  "model-value": r.dialog !== null,
441
470
  title: r.dialogTitle,
442
471
  width: "max-w-lg",
472
+ "close-on-backdrop": !1,
443
473
  "onUpdate:modelValue": t[8] ||= (e) => {
444
474
  e || r.closeDialog();
445
475
  }
446
476
  }, {
447
- footer: I(() => [C("div", Ne, [C("button", {
477
+ footer: I(() => [C("div", Re, [C("button", {
448
478
  type: "button",
449
479
  class: "rounded-lg px-4 py-2.5 text-sm font-medium text-slate-600 hover:bg-slate-100",
450
480
  disabled: r.saving,
451
481
  onClick: r.closeDialog
452
- }, " Скасувати ", 8, Pe), C("button", {
482
+ }, " Скасувати ", 8, ze), C("button", {
453
483
  type: "button",
454
484
  class: "rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-700 disabled:opacity-60",
455
- disabled: r.saving || r.dialog === "add" && !r.selectedCertificate,
485
+ disabled: r.saving || r.dialog === "add" && !r.selectedAvailable,
456
486
  onClick: t[7] ||= (e) => r.dialog === "add" ? r.submitAdd() : r.submitEdit()
457
- }, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9, Fe)])]),
458
- default: I(() => [r.dialog === "add" ? (A(), S("div", he, [
459
- C("label", ge, [t[16] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(C("input", {
487
+ }, N(r.saving ? "Збереження…" : r.dialog === "add" ? "Додати" : "Зберегти"), 9, Be)])]),
488
+ default: I(() => [r.dialog === "add" ? (A(), S("div", ve, [
489
+ C("label", ye, [t[16] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Сертифікат", -1), L(C("input", {
460
490
  "onUpdate:modelValue": t[0] ||= (e) => r.certificateQuery = e,
461
491
  type: "text",
462
492
  class: O(r.fieldClass),
463
493
  placeholder: "Номер або прізвище",
464
494
  onInput: r.onCertificateInput
465
495
  }, null, 544), [[P, r.certificateQuery]])]),
466
- r.certificatesLoading ? (A(), S("p", _e, "Пошук…")) : r.certificates.length ? (A(), S("ul", ve, [(A(!0), S(y, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
496
+ r.certificatesLoading ? (A(), S("p", be, "Пошук…")) : r.certificates.length ? (A(), S("ul", xe, [(A(!0), S(y, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
467
497
  type: "button",
468
- class: "flex w-full flex-col px-3 py-2 text-left text-sm hover:bg-slate-50",
498
+ class: "flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm hover:bg-slate-50",
469
499
  onClick: (t) => r.chooseCertificate(e)
470
- }, [C("span", be, "№ " + N(e.number_certificate || "—"), 1), C("span", xe, N(r.certificatePerson(e)), 1)], 8, ye)]))), 128))])) : r.searched && !r.selectedCertificate ? (A(), S("p", Se, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : x("", !0),
471
- r.selectedCertificate ? (A(), S(y, { key: 3 }, [
472
- r.existingSurveyor?.registered_at ? (A(), S("p", Ce, " Обліковий запис уже є: " + N(r.personName(r.existingSurveyor)) + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
473
- C("label", we, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
500
+ }, [C("span", Ce, [C("span", we, "№ " + N(e.number_certificate || "—"), 1), C("span", Te, N(r.certificatePerson(e)), 1)]), E(r.ValidityBadge, {
501
+ class: "shrink-0",
502
+ validity: e.certificate_status
503
+ }, null, 8, ["validity"])], 8, Se)]))), 128))])) : r.searched && !r.selectedCertificate ? (A(), S("p", Ee, "Сертифікат не знайдено. Нового користувача можна додати лише за сертифікатом з реєстру.")) : x("", !0),
504
+ r.selectedCertificate && !r.selectedAvailable ? (A(), S("p", De, " Сертифікат має статус «" + N(r.selectedStatusLabel || "Невідомий") + "». Додати користувача можна лише за дійсним сертифікатом. ", 1)) : r.selectedCertificate ? (A(), S(y, { key: 4 }, [
505
+ r.registeredAccount ? (A(), S("p", Oe, " Обліковий запис уже є: " + N(r.registeredAccount.account_name || "—") + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
506
+ C("label", ke, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
474
507
  "onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
475
508
  type: "email",
476
509
  class: O(r.fieldClass),
477
510
  placeholder: "user@example.com"
478
511
  }, null, 512), [[P, r.addEmail]])]),
479
- r.existingSurveyor?.registered_at ? x("", !0) : (A(), S("label", Te, [t[18] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
512
+ r.registeredAccount ? x("", !0) : (A(), S("label", Ae, [t[18] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
480
513
  "onUpdate:modelValue": t[2] ||= (e) => r.addPhone = e,
481
514
  type: "text",
482
515
  class: O(r.fieldClass),
483
516
  placeholder: "+380…"
484
517
  }, null, 512), [[P, r.addPhone]])])),
485
- r.existingSurveyor?.registered_at ? x("", !0) : (A(), S("p", Ee, "На email надійде лист для завершення реєстрації."))
518
+ r.registeredAccount ? x("", !0) : (A(), S("p", je, "На email надійде лист для завершення реєстрації."))
486
519
  ], 64)) : x("", !0)
487
- ])) : r.dialog === "edit" ? (A(), S("div", De, [
488
- C("label", Oe, [t[19] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(C("input", {
520
+ ])) : r.dialog === "edit" ? (A(), S("div", Me, [
521
+ C("label", Ne, [t[19] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Прізвище", -1), L(C("input", {
489
522
  "onUpdate:modelValue": t[3] ||= (e) => r.editDraft.last_name = e,
490
523
  type: "text",
491
524
  class: O(r.fieldClass)
492
525
  }, null, 512), [[P, r.editDraft.last_name]])]),
493
- C("label", ke, [t[20] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(C("input", {
526
+ C("label", Pe, [t[20] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Імʼя", -1), L(C("input", {
494
527
  "onUpdate:modelValue": t[4] ||= (e) => r.editDraft.first_name = e,
495
528
  type: "text",
496
529
  class: O(r.fieldClass)
497
530
  }, null, 512), [[P, r.editDraft.first_name]])]),
498
- C("label", Ae, [t[21] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(C("input", {
531
+ C("label", Fe, [t[21] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "По батькові", -1), L(C("input", {
499
532
  "onUpdate:modelValue": t[5] ||= (e) => r.editDraft.middle_name = e,
500
533
  type: "text",
501
534
  class: O(r.fieldClass)
502
535
  }, null, 512), [[P, r.editDraft.middle_name]])]),
503
- C("label", je, [t[22] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
536
+ C("label", Ie, [t[22] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Телефон", -1), L(C("input", {
504
537
  "onUpdate:modelValue": t[6] ||= (e) => r.editDraft.phone = e,
505
538
  type: "text",
506
539
  class: O(r.fieldClass)
507
540
  }, null, 512), [[P, r.editDraft.phone]])])
508
- ])) : x("", !0), r.formError ? (A(), S("p", Me, N(r.formError), 1)) : x("", !0)]),
541
+ ])) : x("", !0), r.formError ? (A(), S("p", Le, N(r.formError), 1)) : x("", !0)]),
509
542
  _: 1
510
543
  }, 8, ["model-value", "title"])
511
544
  ]);
512
545
  }
513
- var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Re = /*@__PURE__*/ D({
546
+ var He = /*#__PURE__*/ e(G, [["render", Ve], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Ue = /*@__PURE__*/ D({
514
547
  __name: "card",
515
548
  setup(e, { expose: i }) {
516
549
  i();
517
- let a = ne(), { listPath: s } = n(), u = B(), d = j(null), f = j(!1), p = j(""), m = j(null), g = b(() => a.query.edit === "1"), _ = b(() => d.value?.surveyors ?? []), y = b(() => {
550
+ let o = B(), { listPath: l } = n(), u = V(), d = j(null), f = j(!1), p = j(""), h = j(null), g = b(() => o.query.edit === "1"), _ = b(() => d.value?.surveyors ?? []), y = b(() => {
518
551
  let e = d.value;
519
552
  return e ? {
520
553
  ...e,
@@ -535,12 +568,12 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
535
568
  }
536
569
  function C() {
537
570
  u.replace({ query: {
538
- ...a.query,
571
+ ...o.query,
539
572
  edit: "1"
540
573
  } });
541
574
  }
542
575
  function w() {
543
- let e = { ...a.query };
576
+ let e = { ...o.query };
544
577
  delete e.edit, u.replace({ query: e });
545
578
  }
546
579
  async function T() {
@@ -580,17 +613,17 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
580
613
  });
581
614
  }
582
615
  }
583
- F(() => String(a.params.id), (e) => {
616
+ F(() => String(o.params.id), (e) => {
584
617
  e && D(e);
585
618
  }, { immediate: !0 });
586
619
  let k = {
587
- route: a,
588
- listPath: s,
620
+ route: o,
621
+ listPath: l,
589
622
  router: u,
590
623
  organization: d,
591
624
  loading: f,
592
625
  error: p,
593
- formRef: m,
626
+ formRef: h,
594
627
  editing: g,
595
628
  users: _,
596
629
  editRecord: y,
@@ -606,11 +639,11 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
606
639
  get RouterLink() {
607
640
  return z;
608
641
  },
609
- RegistryForm: h,
610
- VerifiedBadge: o,
611
- AppealDetailSection: c,
612
- AppealDetailField: l,
613
- OrganizationUsers: Le,
642
+ RegistryForm: m,
643
+ VerifiedBadge: a,
644
+ AppealDetailSection: s,
645
+ AppealDetailField: c,
646
+ OrganizationUsers: He,
614
647
  get organizationForm() {
615
648
  return v;
616
649
  }
@@ -620,21 +653,21 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
620
653
  value: !0
621
654
  }), k;
622
655
  }
623
- }), ze = {
656
+ }), We = {
624
657
  key: 0,
625
658
  class: "px-4 py-16 text-center text-sm text-slate-400"
626
- }, Be = {
659
+ }, Ge = {
627
660
  key: 1,
628
661
  class: "pl-0"
629
- }, Ve = { class: "mb-6" }, He = { class: "mb-4 flex items-center gap-1.5 text-sm" }, Ue = { class: "font-medium text-slate-700" }, We = { class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" }, Ge = { class: "text-xl font-bold tracking-tight text-slate-900" }, Ke = { class: "flex flex-col gap-5" }, qe = {
662
+ }, Ke = { class: "mb-6" }, qe = { class: "mb-4 flex items-center gap-1.5 text-sm" }, Je = { class: "font-medium text-slate-700" }, Ye = { class: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" }, Xe = { class: "text-xl font-bold tracking-tight text-slate-900" }, Ze = { class: "flex flex-col gap-5" }, Qe = {
630
663
  key: 0,
631
664
  class: "rounded-xl border border-slate-200 bg-white p-5 shadow-card"
632
- }, Je = { class: "mt-4 flex justify-end gap-3 border-t border-slate-100 pt-4" }, Ye = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, Xe = { class: "flex items-center gap-2" }, Ze = ["href"], Qe = ["href"], $e = { class: "mt-1 text-xs text-slate-400" }, et = {
665
+ }, $e = { class: "mt-4 flex justify-end gap-3 border-t border-slate-100 pt-4" }, et = { class: "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2" }, tt = { class: "flex items-center gap-2" }, nt = ["href"], rt = ["href"], it = { class: "mt-1 text-xs text-slate-400" }, at = {
633
666
  key: 2,
634
667
  class: "rounded-xl border border-slate-200 bg-white px-6 py-16 text-center shadow-card"
635
- }, tt = { class: "text-sm text-slate-500" };
636
- function nt(e, t, n, r, i, a) {
637
- return r.loading ? (A(), S("div", ze, " Завантаження… ")) : r.organization ? (A(), S("div", Be, [C("header", Ve, [C("nav", He, [
668
+ }, ot = { class: "text-sm text-slate-500" };
669
+ function st(e, t, n, r, i, a) {
670
+ return r.loading ? (A(), S("div", We, " Завантаження… ")) : r.organization ? (A(), S("div", Ge, [C("header", Ke, [C("nav", qe, [
638
671
  E(r.RouterLink, {
639
672
  to: r.listPath,
640
673
  class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
@@ -646,8 +679,8 @@ function nt(e, t, n, r, i, a) {
646
679
  _: 1
647
680
  }, 8, ["to"]),
648
681
  t[2] ||= C("span", { class: "text-slate-300" }, "/", -1),
649
- C("span", Ue, N(r.organization.name), 1)
650
- ]), C("div", We, [C("h1", Ge, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
682
+ C("span", Je, N(r.organization.name), 1)
683
+ ]), C("div", Ye, [C("h1", Xe, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
651
684
  key: 0,
652
685
  type: "button",
653
686
  class: "inline-flex h-10 items-center gap-2 rounded-lg border border-slate-200 bg-white px-4 text-sm font-semibold text-slate-700 transition-colors hover:border-brand-300 hover:text-brand-700",
@@ -655,14 +688,14 @@ function nt(e, t, n, r, i, a) {
655
688
  }, [E(r.AppIcon, {
656
689
  name: "pencil",
657
690
  class: "h-4 w-4"
658
- }), t[3] ||= T(" Редагувати ", -1)]))])]), C("div", Ke, [r.editing ? (A(), S("div", qe, [E(r.RegistryForm, {
691
+ }), t[3] ||= T(" Редагувати ", -1)]))])]), C("div", Ze, [r.editing ? (A(), S("div", Qe, [E(r.RegistryForm, {
659
692
  ref: "formRef",
660
693
  config: r.organizationForm,
661
694
  record: r.editRecord,
662
695
  "hide-actions": "",
663
696
  onSaved: r.onFormSaved,
664
697
  onCancel: r.cancelEdit
665
- }, null, 8, ["config", "record"]), C("div", Je, [C("button", {
698
+ }, null, 8, ["config", "record"]), C("div", $e, [C("button", {
666
699
  type: "button",
667
700
  class: "inline-flex h-10 items-center rounded-lg bg-slate-100 px-4 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-200",
668
701
  onClick: r.cancelEdit
@@ -675,7 +708,7 @@ function nt(e, t, n, r, i, a) {
675
708
  name: "building-2",
676
709
  class: "h-[18px] w-[18px]"
677
710
  })]),
678
- default: I(() => [C("dl", Ye, [
711
+ default: I(() => [C("dl", et, [
679
712
  C("div", null, [t[4] ||= C("dt", { class: "mb-1 text-xs font-medium text-slate-500" }, "Верифіковано", -1), C("dd", null, [E(r.VerifiedBadge, { verified: !!r.organization.verified }, null, 8, ["verified"])])]),
680
713
  E(r.AppealDetailField, { label: "Організація яка звернулась" }, {
681
714
  default: I(() => [T(N(r.organization.name), 1)]),
@@ -703,17 +736,17 @@ function nt(e, t, n, r, i, a) {
703
736
  name: "file-check-2",
704
737
  class: "h-[18px] w-[18px]"
705
738
  })]),
706
- default: I(() => [C("div", null, [t[7] ||= C("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), C("p", $e, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
739
+ default: I(() => [C("div", null, [t[7] ||= C("p", { class: "text-sm font-semibold text-slate-800" }, "Скан копія", -1), C("p", it, N(r.organization.scan_path ? r.fileName(r.organization.scan_path) : "—"), 1)])]),
707
740
  _: 2
708
741
  }, [r.organization.scan_path ? {
709
742
  name: "actions",
710
- fn: I(() => [C("div", Xe, [C("a", {
743
+ fn: I(() => [C("div", tt, [C("a", {
711
744
  href: r.fileUrl(r.organization.scan_path, !0),
712
745
  class: "inline-flex h-8 items-center gap-1.5 rounded-lg border border-slate-200 px-2.5 text-[13px] font-medium text-slate-600 transition-colors hover:border-brand-300 hover:bg-brand-50 hover:text-brand-700"
713
746
  }, [E(r.AppIcon, {
714
747
  name: "download",
715
748
  class: "h-3.5 w-3.5"
716
- }), t[5] ||= T(" Завантажити ", -1)], 8, Ze), C("a", {
749
+ }), t[5] ||= T(" Завантажити ", -1)], 8, nt), C("a", {
717
750
  href: r.fileUrl(r.organization.scan_path),
718
751
  target: "_blank",
719
752
  rel: "noopener",
@@ -721,7 +754,7 @@ function nt(e, t, n, r, i, a) {
721
754
  }, [E(r.AppIcon, {
722
755
  name: "eye",
723
756
  class: "h-3.5 w-3.5"
724
- }), t[6] ||= T(" Перегляд ", -1)], 8, Qe)])]),
757
+ }), t[6] ||= T(" Перегляд ", -1)], 8, rt)])]),
725
758
  key: "0"
726
759
  } : void 0]), 1024)], 64)), E(r.OrganizationUsers, {
727
760
  "org-id": r.organization.org_id,
@@ -732,7 +765,7 @@ function nt(e, t, n, r, i, a) {
732
765
  "org-id",
733
766
  "org-name",
734
767
  "users"
735
- ])])])) : (A(), S("div", et, [C("p", tt, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
768
+ ])])])) : (A(), S("div", at, [C("p", ot, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
736
769
  to: r.listPath,
737
770
  class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
738
771
  }, {
@@ -740,6 +773,6 @@ function nt(e, t, n, r, i, a) {
740
773
  _: 1
741
774
  }, 8, ["to"])]));
742
775
  }
743
- var rt = /*#__PURE__*/ e(Re, [["render", nt], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
776
+ var ct = /*#__PURE__*/ e(Ue, [["render", st], ["__file", "D:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
744
777
  //#endregion
745
- export { rt as default };
778
+ export { ct as default };