@opengis/surveyor 0.0.1 → 0.0.3

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 (46) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +175 -33
  3. package/dist/chunks/BaseModal-SQXvRRNW.js +90 -0
  4. package/dist/chunks/{RegistryForm-pvIcFR-V.js → RegistryForm-wG-c8GKf.js} +1 -1
  5. package/dist/chunks/{RegistryFormModal-BjGu7Upv.js → RegistryFormModal-R_iZYqGE.js} +2 -2
  6. package/dist/chunks/{RegistryToolbar-CiUgsjpU.js → RegistryToolbar-322DKUXi.js} +3 -3
  7. package/dist/chunks/SurveyorTeleport-CnSF0Ptl.js +23 -0
  8. package/dist/chunks/{VerifiedBadge-B6droMOf.js → VerifiedBadge-bk0n-rlC.js} +1 -1
  9. package/dist/chunks/{buildSchema-nkA4Y0YG.js → buildSchema-CccjX9TJ.js} +1 -1
  10. package/dist/chunks/card-B_SfARf7.js +1190 -0
  11. package/dist/chunks/card-C3y-j2TA.js +298 -0
  12. package/dist/chunks/{card--DHsMNBd.js → card-CWqi1K-x.js} +107 -106
  13. package/dist/chunks/card-DWpAv92l.js +539 -0
  14. package/dist/chunks/{card-BZn5CDw9.js → card-X9UVFgdR.js} +254 -248
  15. package/dist/chunks/{certificates-DueBDDvc.js → certificates-Cwch72-o.js} +131 -130
  16. package/dist/chunks/{create-l28e-bWl.js → create-DTP9x2uS.js} +278 -265
  17. package/dist/chunks/dom-BSjFG3O0.js +7 -0
  18. package/dist/chunks/{filterQuery-B9XNx1f1.js → filterQuery-CvfZrkTC.js} +1 -1
  19. package/dist/chunks/{form-CdGS1nVO.js → form-Bh6i5n1U.js} +1 -1
  20. package/dist/chunks/{form-QTkkzwbC.js → form-DDjELqZ9.js} +1 -1
  21. package/dist/chunks/{map-layers-qxWjos2V.js → map-layers-sT-gTiD_.js} +130 -125
  22. package/dist/chunks/{map-BW3iOhQg.js → map-qXQe_qam.js} +643 -630
  23. package/dist/chunks/{organizations-CZOINYMq.js → organizations-ByVE2f0c.js} +129 -124
  24. package/dist/chunks/requests-BTpLXrNj.js +233 -0
  25. package/dist/chunks/{resendSurveyorRegistration-DopjOHaM.js → resendSurveyorRegistration-BHTTVIw1.js} +1 -1
  26. package/dist/chunks/{resources-Cl_EvaIy.js → resources-2e8RFqWR.js} +1 -1
  27. package/dist/chunks/{surveyorAccount-BceNQypZ.js → surveyorAccount-C7UiiIYg.js} +1 -1
  28. package/dist/chunks/useEntityPath-C5Owtidc.js +98 -0
  29. package/dist/chunks/{users-DlaogjC_.js → users-U1P6xCP4.js} +106 -100
  30. package/dist/index.css +1 -1
  31. package/dist/index.js +215 -98
  32. package/package.json +83 -77
  33. package/plugin.d.ts +15 -0
  34. package/plugin.js +8 -10
  35. package/server/app.ts +2 -1
  36. package/server/resources/surveyor-admin/application_comments.ts +3 -3
  37. package/server/suggests/index.ts +17 -0
  38. package/surveyor-types.d.ts +5 -0
  39. package/README.npm.md +0 -51
  40. package/dist/chunks/AppIcon-C-4QykTP.js +0 -85
  41. package/dist/chunks/BaseModal-DrTTkLmR.js +0 -85
  42. package/dist/chunks/card-9LaB42Ol.js +0 -538
  43. package/dist/chunks/card-CNqXSyqX.js +0 -297
  44. package/dist/chunks/card-CgGOgGyd.js +0 -973
  45. package/dist/chunks/requests-DQJIhz00.js +0 -232
  46. package/server/embed.ts +0 -49
@@ -1,17 +1,18 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { t } from "./AppIcon-C-4QykTP.js";
3
- import { a as n, i as r, o as i } from "./resources-Cl_EvaIy.js";
4
- import { t as a } from "./VerifiedBadge-B6droMOf.js";
5
- import { t as o } from "./UserAccessBadge-DyZDv7Oo.js";
6
- import { n as s, t as c } from "./AppealDetailField-DNRGpnyD.js";
7
- import { i as l, r as u, t as d } from "./surveyorAccount-BceNQypZ.js";
8
- import { t as f } from "./BaseModal-DrTTkLmR.js";
9
- import { t as p } from "./RegistryForm-pvIcFR-V.js";
10
- import { n as m, t as h } from "./resendSurveyorRegistration-DopjOHaM.js";
11
- import { t as g } from "./form-QTkkzwbC.js";
12
- import { Fragment as _, Teleport as v, computed as y, createBlock 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";
13
- import { RouterLink as z, useRoute as B, useRouter as V } from "vue-router";
14
- import { confirm as ne, notify as H } from "@opengis/core";
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";
11
+ import { n as g, t as _ } from "./resendSurveyorRegistration-BHTTVIw1.js";
12
+ import { t as v } from "./form-DDjELqZ9.js";
13
+ 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";
15
16
  //#region admin/src/pages/organizations/components/OrganizationUsers.vue?vue&type=script&setup=true&lang.ts
16
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({
17
18
  __name: "OrganizationUsers",
@@ -30,133 +31,133 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
30
31
  }
31
32
  },
32
33
  emits: ["changed"],
33
- setup(e, { expose: a, emit: s }) {
34
- a();
35
- let c = e, p = s, g = j(null), _ = j({
34
+ setup(e, { expose: n, emit: o }) {
35
+ n();
36
+ let c = e, l = o, h = j(null), v = j({
36
37
  top: "0px",
37
38
  left: "0px"
38
- }), v = j(null), b = j(null), x = j(!1), S = j(null), C = j(""), w = j(""), T = j([]), E = j(!1), D = j(null), O = j(null), k = j(""), A = j(""), M = j({
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({
39
40
  last_name: "",
40
41
  first_name: "",
41
42
  middle_name: "",
42
43
  phone: ""
43
- }), N = 0, P = y(() => v.value === "add" ? "Додати користувача" : v.value === "edit" ? "Редагувати користувача" : "");
44
- function F(e) {
44
+ }), P = 0, F = b(() => y.value === "add" ? "Додати користувача" : y.value === "edit" ? "Редагувати користувача" : "");
45
+ function I(e) {
45
46
  return [
46
47
  e.last_name,
47
48
  e.first_name,
48
49
  e.middle_name
49
50
  ].filter(Boolean).join(" ") || "—";
50
51
  }
51
- function I(e) {
52
+ function L(e) {
52
53
  let t = e.certificate_id_data?.text;
53
54
  return t ? `№ ${t}` : "—";
54
55
  }
55
- function L(e) {
56
+ function R(e) {
56
57
  let t = e.text?.trim() ?? "", n = e.number_certificate?.trim();
57
58
  return n && t.endsWith(n) ? t.slice(0, -n.length).trim() || "—" : t || "—";
58
59
  }
59
- function R(e) {
60
+ function z(e) {
60
61
  return e.membership_enabled !== !1;
61
62
  }
62
- function z(e, t) {
63
- if (g.value === e) {
64
- g.value = null;
63
+ function ne(e, t) {
64
+ if (h.value === e) {
65
+ h.value = null;
65
66
  return;
66
67
  }
67
- let n = t.currentTarget.getBoundingClientRect(), r = c.users.find((t) => t.surveyor_id === e), i = (2 + (r && h(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);
68
- _.value = {
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);
69
+ v.value = {
69
70
  top: `${a}px`,
70
71
  left: `${o}px`
71
- }, g.value = e;
72
+ }, h.value = e;
72
73
  }
73
74
  function B(e) {
74
75
  let t = e?.target;
75
- t instanceof Element && t.closest("[data-user-menu]") || (g.value = null);
76
- }
77
- function V() {
78
- v.value = null, b.value = null, C.value = "";
76
+ t instanceof Element && t.closest("[data-user-menu]") || (h.value = null);
79
77
  }
80
78
  function U() {
81
- w.value = "", T.value = [], K.value = !1, D.value = null, O.value = null, k.value = "", A.value = "", C.value = "", v.value = "add";
79
+ y.value = null, x.value = null, w.value = "";
80
+ }
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";
82
83
  }
83
- function W(e) {
84
- g.value = null, b.value = e, M.value = {
84
+ function G(e) {
85
+ h.value = null, x.value = e, N.value = {
85
86
  last_name: e.last_name ?? "",
86
87
  first_name: e.first_name ?? "",
87
88
  middle_name: e.middle_name ?? "",
88
89
  phone: e.phone ?? ""
89
- }, C.value = "", v.value = "edit";
90
+ }, w.value = "", y.value = "edit";
90
91
  }
91
- function G(e, t) {
92
- C.value = e instanceof Error ? e.message : t;
92
+ function K(e, t) {
93
+ w.value = e instanceof Error ? e.message : t;
93
94
  }
94
- let K = j(!1), q = 0;
95
- async function J() {
96
- let e = w.value.trim(), t = ++q;
97
- if (D.value = null, O.value = null, K.value = e.length >= 2, e.length < 2) {
98
- T.value = [], E.value = !1;
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) {
99
+ E.value = [], D.value = !1;
99
100
  return;
100
101
  }
101
- E.value = !0;
102
+ D.value = !0;
102
103
  try {
103
- let r = await n(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
104
- if (t !== q) return;
105
- T.value = (r.data ?? []).map((e) => ({
104
+ let n = await r(`/api/resource/certificates/list?search=${encodeURIComponent(e)}`);
105
+ if (t !== J) return;
106
+ E.value = (n.data ?? []).map((e) => ({
106
107
  ...e,
107
108
  certificate_id: e.id
108
109
  }));
109
110
  } catch (e) {
110
- if (t !== q) return;
111
- T.value = [], G(e, "Не вдалося знайти сертифікати");
111
+ if (t !== J) return;
112
+ E.value = [], K(e, "Не вдалося знайти сертифікати");
112
113
  } finally {
113
- t === q && (E.value = !1);
114
+ t === J && (D.value = !1);
114
115
  }
115
116
  }
116
- function Y() {
117
- window.clearTimeout(N), N = window.setTimeout(() => void J(), 300);
117
+ function X() {
118
+ window.clearTimeout(P), P = window.setTimeout(() => void Y(), 300);
118
119
  }
119
- async function X(e) {
120
- D.value = e, T.value = [], w.value = e.text?.trim() || e.number_certificate || "", k.value = e.surveyor_email ?? "", A.value = e.surveyor_phone ?? "", O.value = null, C.value = "";
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 = "";
121
122
  try {
122
- let t = await r("surveyors", {
123
+ let t = await i("surveyors", {
123
124
  page: 1,
124
125
  limit: 1,
125
126
  filters: { certificate_id: e.certificate_id }
126
127
  });
127
- O.value = t.rows[0] ?? null, O.value?.registered_at ? A.value = "" : O.value && (k.value = O.value.email || k.value, A.value = O.value.phone || A.value);
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);
128
129
  } catch (e) {
129
- G(e, "Не вдалося перевірити сертифікат");
130
+ K(e, "Не вдалося перевірити сертифікат");
130
131
  }
131
132
  }
132
- async function Z() {
133
- if (!D.value || x.value) return;
134
- if (O.value && c.users.some((e) => e.surveyor_id === O.value?.surveyor_id)) {
135
- C.value = "Цей користувач уже є в організації";
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)) {
136
+ w.value = "Цей користувач уже є в організації";
136
137
  return;
137
138
  }
138
- let e = k.value.trim().toLowerCase();
139
+ let e = A.value.trim().toLowerCase();
139
140
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
140
- C.value = "Вкажіть коректний email";
141
+ w.value = "Вкажіть коректний email";
141
142
  return;
142
143
  }
143
- let t = O.value?.registered_at ? O.value : null;
144
+ let t = k.value?.registered_at ? k.value : null;
144
145
  if (t && e !== (t.email ?? "").trim().toLowerCase()) {
145
- C.value = "Email не збігається з email облікового запису цього сертифіката";
146
+ w.value = "Email не збігається з email облікового запису цього сертифіката";
146
147
  return;
147
148
  }
148
- x.value = !0, C.value = "";
149
+ S.value = !0, w.value = "";
149
150
  try {
150
- let r = await n("/api/surveyor/surveyors", {
151
+ let n = await r("/api/surveyor/surveyors", {
151
152
  method: "POST",
152
153
  body: JSON.stringify({
153
154
  organization_id: c.orgId,
154
- certificate_id: D.value.certificate_id,
155
+ certificate_id: O.value.certificate_id,
155
156
  email: e,
156
- ...t ? {} : { phone: A.value.trim() }
157
+ ...t ? {} : { phone: M.value.trim() }
157
158
  })
158
159
  });
159
- H(r.registration_status === "attached" ? {
160
+ H(n.registration_status === "attached" ? {
160
161
  type: "success",
161
162
  title: "Користувача додано",
162
163
  message: "Наявний обліковий запис прикріплено до організації"
@@ -164,132 +165,133 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
164
165
  type: "success",
165
166
  title: "Користувача додано",
166
167
  message: "На email надіслано лист для завершення реєстрації"
167
- }), V(), p("changed");
168
+ }), U(), l("changed");
168
169
  } catch (e) {
169
- G(e, "Не вдалося додати користувача");
170
+ K(e, "Не вдалося додати користувача");
170
171
  } finally {
171
- x.value = !1;
172
+ S.value = !1;
172
173
  }
173
174
  }
174
- async function Q(e) {
175
- if (!S.value) {
176
- g.value = null, S.value = e.surveyor_id;
175
+ async function ie(e) {
176
+ if (!C.value) {
177
+ h.value = null, C.value = e.surveyor_id;
177
178
  try {
178
- await m(e.surveyor_id);
179
+ await g(e.surveyor_id);
179
180
  } finally {
180
- S.value = null;
181
+ C.value = null;
181
182
  }
182
183
  }
183
184
  }
184
- function ie(e) {
185
- d(e) && (g.value = null, ne({
185
+ function ae(e) {
186
+ f(e) && (h.value = null, V({
186
187
  title: "Зміна пароля",
187
188
  type: "warning",
188
- message: `Згенерувати новий пароль для «${F(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
189
+ message: `Згенерувати новий пароль для «${I(e)}»? Поточний пароль перестане діяти, новий буде надіслано на email.`,
189
190
  confirmButtonText: "Згенерувати",
190
191
  cancelButtonText: "Скасувати",
191
- onConfirm: () => u(e.surveyor_id)
192
+ onConfirm: () => d(e.surveyor_id)
192
193
  }));
193
194
  }
194
- function ae(e) {
195
- g.value = null;
196
- let t = !R(e);
197
- ne({
195
+ function oe(e) {
196
+ h.value = null;
197
+ let t = !z(e);
198
+ V({
198
199
  title: t ? "Активація" : "Деактивація",
199
200
  type: t ? "warning" : "error",
200
- message: t ? `Активувати користувача «${F(e)}»?` : `Деактивувати користувача «${F(e)}» в організації «${c.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
201
+ message: t ? `Активувати користувача «${I(e)}»?` : `Деактивувати користувача «${I(e)}» в організації «${c.orgName}»? Доступ до заявок цієї організації буде вимкнено.`,
201
202
  confirmButtonText: t ? "Активувати" : "Деактивувати",
202
203
  cancelButtonText: "Скасувати",
203
204
  onConfirm: async () => {
204
- await l(e.surveyor_id, c.orgId, t) && p("changed");
205
+ await u(e.surveyor_id, c.orgId, t) && l("changed");
205
206
  }
206
207
  });
207
208
  }
208
- async function oe() {
209
- if (!b.value || x.value) return;
209
+ async function se() {
210
+ if (!x.value || S.value) return;
210
211
  let e = {
211
- last_name: M.value.last_name.trim(),
212
- first_name: M.value.first_name.trim(),
213
- middle_name: M.value.middle_name.trim(),
214
- phone: M.value.phone.trim()
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()
215
216
  };
216
217
  if (!e.last_name || !e.first_name) {
217
- C.value = "Прізвище та імʼя обовʼязкові";
218
+ w.value = "Прізвище та імʼя обовʼязкові";
218
219
  return;
219
220
  }
220
- x.value = !0, C.value = "";
221
+ S.value = !0, w.value = "";
221
222
  try {
222
- await i("surveyors", b.value.surveyor_id, e), V(), p("changed");
223
+ await a("surveyors", x.value.surveyor_id, e), U(), l("changed");
223
224
  } catch (e) {
224
- G(e, "Не вдалося зберегти користувача");
225
+ K(e, "Не вдалося зберегти користувача");
225
226
  } finally {
226
- x.value = !1;
227
+ S.value = !1;
227
228
  }
228
229
  }
229
230
  ee(() => {
230
231
  document.addEventListener("click", B), window.addEventListener("resize", B), window.addEventListener("scroll", B, !0);
231
232
  }), te(() => {
232
- window.clearTimeout(N), document.removeEventListener("click", B), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0);
233
+ window.clearTimeout(P), document.removeEventListener("click", B), window.removeEventListener("resize", B), window.removeEventListener("scroll", B, !0);
233
234
  });
234
235
  let $ = {
235
236
  props: c,
236
- emit: p,
237
+ emit: l,
237
238
  fieldClass: re,
238
- openMenuId: g,
239
- menuStyle: _,
240
- dialog: v,
241
- activeUser: b,
242
- saving: x,
243
- resendingId: S,
244
- formError: C,
245
- certificateQuery: w,
246
- certificates: T,
247
- certificatesLoading: E,
248
- selectedCertificate: D,
249
- existingSurveyor: O,
250
- addEmail: k,
251
- addPhone: A,
252
- editDraft: M,
239
+ openMenuId: h,
240
+ menuStyle: v,
241
+ dialog: y,
242
+ activeUser: x,
243
+ saving: S,
244
+ resendingId: C,
245
+ formError: w,
246
+ certificateQuery: T,
247
+ certificates: E,
248
+ certificatesLoading: D,
249
+ selectedCertificate: O,
250
+ existingSurveyor: k,
251
+ addEmail: A,
252
+ addPhone: M,
253
+ editDraft: N,
253
254
  get searchTimer() {
254
- return N;
255
+ return P;
255
256
  },
256
257
  set searchTimer(e) {
257
- N = e;
258
+ P = e;
258
259
  },
259
- dialogTitle: P,
260
- personName: F,
261
- certificateLabel: I,
262
- certificatePerson: L,
263
- membershipEnabled: R,
264
- toggleMenu: z,
260
+ dialogTitle: F,
261
+ personName: I,
262
+ certificateLabel: L,
263
+ certificatePerson: R,
264
+ membershipEnabled: z,
265
+ toggleMenu: ne,
265
266
  closeMenu: B,
266
- closeDialog: V,
267
- openAdd: U,
268
- openEdit: W,
269
- fail: G,
270
- searched: K,
267
+ closeDialog: U,
268
+ openAdd: W,
269
+ openEdit: G,
270
+ fail: K,
271
+ searched: q,
271
272
  get searchSeq() {
272
- return q;
273
+ return J;
273
274
  },
274
275
  set searchSeq(e) {
275
- q = e;
276
+ J = e;
276
277
  },
277
- searchCertificates: J,
278
- onCertificateInput: Y,
279
- chooseCertificate: X,
280
- submitAdd: Z,
281
- resendRegistrationInvite: Q,
282
- resetPassword: ie,
283
- toggleAccess: ae,
284
- submitEdit: oe,
278
+ searchCertificates: Y,
279
+ onCertificateInput: X,
280
+ chooseCertificate: Z,
281
+ submitAdd: Q,
282
+ resendRegistrationInvite: ie,
283
+ resetPassword: ae,
284
+ toggleAccess: oe,
285
+ submitEdit: se,
285
286
  AppIcon: t,
286
- BaseModal: f,
287
- UserAccessBadge: o,
287
+ SurveyorTeleport: p,
288
+ BaseModal: m,
289
+ UserAccessBadge: s,
288
290
  get canResendSurveyorRegistration() {
289
- return h;
291
+ return _;
290
292
  },
291
293
  get canResetSurveyorPassword() {
292
- return d;
294
+ return f;
293
295
  }
294
296
  };
295
297
  return Object.defineProperty($, "__isScriptSetup", {
@@ -300,7 +302,7 @@ var re = "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm t
300
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 = {
301
303
  key: 0,
302
304
  class: "mt-1 text-xs text-slate-400"
303
- }, ae = { class: "px-5 py-3.5 leading-snug text-slate-600" }, oe = { class: "px-5 py-3.5 leading-snug text-slate-600" }, $ = { class: "px-5 py-3.5 text-slate-600" }, se = { class: "px-5 py-3.5" }, ce = { class: "px-5 py-3.5 text-center" }, le = [
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 = [
304
306
  "aria-label",
305
307
  "aria-expanded",
306
308
  "onClick"
@@ -362,15 +364,15 @@ function Ie(e, t, n, r, i, a) {
362
364
  C("th", { class: "px-5 py-3" }, "Статус"),
363
365
  C("th", { class: "px-5 py-3 text-center" }, "Дії")
364
366
  ])], -1),
365
- C("tbody", X, [(A(!0), S(_, null, M(n.users, (e) => (A(), S("tr", {
367
+ C("tbody", X, [(A(!0), S(y, null, M(n.users, (e) => (A(), S("tr", {
366
368
  key: e.surveyor_id,
367
369
  class: "align-top transition-colors hover:bg-brand-50/40"
368
370
  }, [
369
371
  C("td", Z, [C("p", Q, N(r.personName(e)), 1), e.registered_at ? x("", !0) : (A(), S("p", ie, "Реєстрацію не завершено"))]),
370
372
  C("td", ae, N(r.certificateLabel(e)), 1),
371
373
  C("td", oe, [C("p", null, N(e.email || "—"), 1), C("p", null, N(e.phone || "—"), 1)]),
372
- C("td", $, N(n.orgName), 1),
373
- C("td", se, [E(r.UserAccessBadge, {
374
+ C("td", se, N(n.orgName), 1),
375
+ C("td", $, [E(r.UserAccessBadge, {
374
376
  "account-blocked": e.enabled === !1,
375
377
  "membership-disabled": !r.membershipEnabled(e)
376
378
  }, null, 8, ["account-blocked", "membership-disabled"])]),
@@ -384,48 +386,51 @@ function Ie(e, t, n, r, i, a) {
384
386
  }, [E(r.AppIcon, {
385
387
  name: "more-vertical",
386
388
  class: "h-4 w-4"
387
- })], 8, le), (A(), b(v, { to: "body" }, [r.openMenuId === e.surveyor_id ? (A(), S("div", {
388
- key: 0,
389
- "data-user-menu": "",
390
- class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
391
- style: k(r.menuStyle)
392
- }, [
393
- C("button", {
394
- type: "button",
395
- class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
396
- onClick: (t) => r.openEdit(e)
397
- }, [E(r.AppIcon, {
398
- name: "pencil",
399
- class: "h-4 w-4 text-slate-400"
400
- }), t[11] ||= T(" Редагувати ", -1)], 8, ue),
401
- r.canResendSurveyorRegistration(e) ? (A(), S("button", {
389
+ })], 8, le), E(r.SurveyorTeleport, null, {
390
+ default: I(() => [r.openMenuId === e.surveyor_id ? (A(), S("div", {
402
391
  key: 0,
403
- type: "button",
404
- class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
405
- disabled: r.resendingId === e.surveyor_id,
406
- onClick: (t) => r.resendRegistrationInvite(e)
407
- }, [E(r.AppIcon, {
408
- name: "send",
409
- class: "h-4 w-4 shrink-0 text-slate-400"
410
- }), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, de)) : x("", !0),
411
- r.canResetSurveyorPassword(e) ? (A(), S("button", {
412
- key: 1,
413
- type: "button",
414
- class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
415
- onClick: (t) => r.resetPassword(e)
416
- }, [E(r.AppIcon, {
417
- name: "key-round",
418
- class: "h-4 w-4 shrink-0 text-slate-400"
419
- }), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, fe)) : x("", !0),
420
- C("button", {
421
- type: "button",
422
- 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"]),
423
- onClick: (t) => r.toggleAccess(e)
424
- }, [E(r.AppIcon, {
425
- name: r.membershipEnabled(e) ? "user-x" : "power",
426
- class: O(["h-4 w-4 shrink-0", r.membershipEnabled(e) ? "" : "text-slate-400"])
427
- }, null, 8, ["name", "class"]), T(" " + N(r.membershipEnabled(e) ? "Деактивувати" : "Активувати"), 1)], 10, pe)
428
- ], 4)) : x("", !0)]))])
392
+ "data-user-menu": "",
393
+ class: "fixed z-50 w-64 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 text-left shadow-card-hover",
394
+ style: k(r.menuStyle)
395
+ }, [
396
+ C("button", {
397
+ type: "button",
398
+ class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
399
+ onClick: (t) => r.openEdit(e)
400
+ }, [E(r.AppIcon, {
401
+ name: "pencil",
402
+ class: "h-4 w-4 text-slate-400"
403
+ }), t[11] ||= T(" Редагувати ", -1)], 8, ue),
404
+ r.canResendSurveyorRegistration(e) ? (A(), S("button", {
405
+ key: 0,
406
+ type: "button",
407
+ class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-60",
408
+ disabled: r.resendingId === e.surveyor_id,
409
+ onClick: (t) => r.resendRegistrationInvite(e)
410
+ }, [E(r.AppIcon, {
411
+ name: "send",
412
+ class: "h-4 w-4 shrink-0 text-slate-400"
413
+ }), T(" " + N(r.resendingId === e.surveyor_id ? "Надсилання…" : "Надіслати лист повторно"), 1)], 8, de)) : x("", !0),
414
+ r.canResetSurveyorPassword(e) ? (A(), S("button", {
415
+ key: 1,
416
+ type: "button",
417
+ class: "flex w-full items-center gap-2 px-3 py-2.5 text-sm text-slate-700 transition-colors hover:bg-slate-50",
418
+ onClick: (t) => r.resetPassword(e)
419
+ }, [E(r.AppIcon, {
420
+ name: "key-round",
421
+ class: "h-4 w-4 shrink-0 text-slate-400"
422
+ }), t[12] ||= T(" Згенерувати новий пароль ", -1)], 8, fe)) : x("", !0),
423
+ C("button", {
424
+ type: "button",
425
+ 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"]),
426
+ onClick: (t) => r.toggleAccess(e)
427
+ }, [E(r.AppIcon, {
428
+ name: r.membershipEnabled(e) ? "user-x" : "power",
429
+ 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)
431
+ ], 4)) : x("", !0)]),
432
+ _: 2
433
+ }, 1024)])
429
434
  ]))), 128)), n.users.length === 0 ? (A(), S("tr", me, [...t[13] ||= [C("td", {
430
435
  colspan: "6",
431
436
  class: "px-5 py-12 text-center text-sm text-slate-400"
@@ -458,12 +463,12 @@ function Ie(e, t, n, r, i, a) {
458
463
  placeholder: "Номер або прізвище",
459
464
  onInput: r.onCertificateInput
460
465
  }, null, 544), [[P, r.certificateQuery]])]),
461
- r.certificatesLoading ? (A(), S("p", _e, "Пошук…")) : r.certificates.length ? (A(), S("ul", ve, [(A(!0), S(_, null, M(r.certificates, (e) => (A(), S("li", { key: e.certificate_id }, [C("button", {
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", {
462
467
  type: "button",
463
468
  class: "flex w-full flex-col px-3 py-2 text-left text-sm hover:bg-slate-50",
464
469
  onClick: (t) => r.chooseCertificate(e)
465
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),
466
- r.selectedCertificate ? (A(), S(_, { key: 3 }, [
471
+ r.selectedCertificate ? (A(), S(y, { key: 3 }, [
467
472
  r.existingSurveyor?.registered_at ? (A(), S("p", Ce, " Обліковий запис уже є: " + N(r.personName(r.existingSurveyor)) + ". Його буде прикріплено до організації, якщо email збігається з email облікового запису. ", 1)) : x("", !0),
468
473
  C("label", we, [t[17] ||= C("span", { class: "mb-1 block text-xs font-medium text-slate-500" }, "Email", -1), L(C("input", {
469
474
  "onUpdate:modelValue": t[1] ||= (e) => r.addEmail = e,
@@ -507,16 +512,16 @@ function Ie(e, t, n, r, i, a) {
507
512
  }
508
513
  var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/components/OrganizationUsers.vue"]]), Re = /*@__PURE__*/ D({
509
514
  __name: "card",
510
- setup(e, { expose: r }) {
511
- r();
512
- let i = B(), o = V(), l = j(null), u = j(!1), d = j(""), f = j(null), m = y(() => i.query.edit === "1"), h = y(() => l.value?.surveyors ?? []), _ = y(() => {
513
- let e = l.value;
515
+ setup(e, { expose: i }) {
516
+ 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(() => {
518
+ let e = d.value;
514
519
  return e ? {
515
520
  ...e,
516
521
  id: e.org_id
517
522
  } : null;
518
523
  });
519
- function v(e) {
524
+ function x(e) {
520
525
  let t = e.split(".")[0] ?? "", n = t.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - t.length % 4) % 4);
521
526
  try {
522
527
  return atob(n).split(/[/\\]/).pop() || "Скан-копія";
@@ -524,24 +529,24 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
524
529
  return "Скан-копія";
525
530
  }
526
531
  }
527
- function b(e, t = !1) {
532
+ function S(e, t = !1) {
528
533
  let n = `/api/file/${encodeURIComponent(e)}`;
529
534
  return t ? `${n}?download=true` : n;
530
535
  }
531
- function x() {
532
- o.replace({ query: {
533
- ...i.query,
536
+ function C() {
537
+ u.replace({ query: {
538
+ ...a.query,
534
539
  edit: "1"
535
540
  } });
536
541
  }
537
- function S() {
538
- let e = { ...i.query };
539
- delete e.edit, o.replace({ query: e });
542
+ function w() {
543
+ let e = { ...a.query };
544
+ delete e.edit, u.replace({ query: e });
540
545
  }
541
- async function C() {
542
- let e = l.value?.org_id;
543
- if (S(), e) try {
544
- await w(e);
546
+ async function T() {
547
+ let e = d.value?.org_id;
548
+ if (w(), e) try {
549
+ await E(e);
545
550
  } catch (e) {
546
551
  H({
547
552
  type: "error",
@@ -550,23 +555,23 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
550
555
  });
551
556
  }
552
557
  }
553
- async function w(e) {
554
- l.value = await n(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
558
+ async function E(e) {
559
+ d.value = await r(`/api/resource/organizations/${encodeURIComponent(e)}?include=surveyors&limit=100`);
555
560
  }
556
- async function T(e) {
557
- u.value = !0, d.value = "", l.value = null;
561
+ async function D(e) {
562
+ f.value = !0, p.value = "", d.value = null;
558
563
  try {
559
- await w(e);
564
+ await E(e);
560
565
  } catch (e) {
561
- l.value = null, d.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
566
+ d.value = null, p.value = e instanceof Error ? e.message : "Не вдалося завантажити організацію";
562
567
  } finally {
563
- u.value = !1;
568
+ f.value = !1;
564
569
  }
565
570
  }
566
- async function E() {
567
- let e = l.value?.org_id;
571
+ async function O() {
572
+ let e = d.value?.org_id;
568
573
  if (e) try {
569
- await w(e);
574
+ await E(e);
570
575
  } catch (e) {
571
576
  H({
572
577
  type: "error",
@@ -575,44 +580,45 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
575
580
  });
576
581
  }
577
582
  }
578
- F(() => String(i.params.id), (e) => {
579
- e && T(e);
583
+ F(() => String(a.params.id), (e) => {
584
+ e && D(e);
580
585
  }, { immediate: !0 });
581
- let D = {
582
- route: i,
583
- router: o,
584
- organization: l,
585
- loading: u,
586
- error: d,
587
- formRef: f,
588
- editing: m,
589
- users: h,
590
- editRecord: _,
591
- fileName: v,
592
- fileUrl: b,
593
- startEdit: x,
594
- cancelEdit: S,
595
- onFormSaved: C,
596
- fetchOrganization: w,
597
- loadOrganization: T,
598
- refreshOrganization: E,
586
+ let k = {
587
+ route: a,
588
+ listPath: s,
589
+ router: u,
590
+ organization: d,
591
+ loading: f,
592
+ error: p,
593
+ formRef: m,
594
+ editing: g,
595
+ users: _,
596
+ editRecord: y,
597
+ fileName: x,
598
+ fileUrl: S,
599
+ startEdit: C,
600
+ cancelEdit: w,
601
+ onFormSaved: T,
602
+ fetchOrganization: E,
603
+ loadOrganization: D,
604
+ refreshOrganization: O,
599
605
  AppIcon: t,
600
606
  get RouterLink() {
601
607
  return z;
602
608
  },
603
- RegistryForm: p,
604
- VerifiedBadge: a,
605
- AppealDetailSection: s,
606
- AppealDetailField: c,
609
+ RegistryForm: h,
610
+ VerifiedBadge: o,
611
+ AppealDetailSection: c,
612
+ AppealDetailField: l,
607
613
  OrganizationUsers: Le,
608
614
  get organizationForm() {
609
- return g;
615
+ return v;
610
616
  }
611
617
  };
612
- return Object.defineProperty(D, "__isScriptSetup", {
618
+ return Object.defineProperty(k, "__isScriptSetup", {
613
619
  enumerable: !1,
614
620
  value: !0
615
- }), D;
621
+ }), k;
616
622
  }
617
623
  }), ze = {
618
624
  key: 0,
@@ -630,7 +636,7 @@ var Le = /*#__PURE__*/ e(U, [["render", Ie], ["__file", "C:/softpro/surveyor/adm
630
636
  function nt(e, t, n, r, i, a) {
631
637
  return r.loading ? (A(), S("div", ze, " Завантаження… ")) : r.organization ? (A(), S("div", Be, [C("header", Ve, [C("nav", He, [
632
638
  E(r.RouterLink, {
633
- to: "/organizations",
639
+ to: r.listPath,
634
640
  class: "flex items-center gap-1 text-slate-400 transition-colors hover:text-brand-600"
635
641
  }, {
636
642
  default: I(() => [E(r.AppIcon, {
@@ -638,7 +644,7 @@ function nt(e, t, n, r, i, a) {
638
644
  class: "h-3.5 w-3.5"
639
645
  }), t[1] ||= T(" Організації ", -1)]),
640
646
  _: 1
641
- }),
647
+ }, 8, ["to"]),
642
648
  t[2] ||= C("span", { class: "text-slate-300" }, "/", -1),
643
649
  C("span", Ue, N(r.organization.name), 1)
644
650
  ]), C("div", We, [C("h1", Ge, N(r.organization.name), 1), r.editing ? x("", !0) : (A(), S("button", {
@@ -664,7 +670,7 @@ function nt(e, t, n, r, i, a) {
664
670
  type: "button",
665
671
  class: "inline-flex h-10 items-center rounded-lg bg-brand-600 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-700",
666
672
  onClick: t[0] ||= (e) => r.formRef?.submit()
667
- }, " Зберегти зміни ")])])) : (A(), S(_, { key: 1 }, [E(r.AppealDetailSection, { title: "Інформація про організацію" }, {
673
+ }, " Зберегти зміни ")])])) : (A(), S(y, { key: 1 }, [E(r.AppealDetailSection, { title: "Інформація про організацію" }, {
668
674
  icon: I(() => [E(r.AppIcon, {
669
675
  name: "building-2",
670
676
  class: "h-[18px] w-[18px]"
@@ -727,12 +733,12 @@ function nt(e, t, n, r, i, a) {
727
733
  "org-name",
728
734
  "users"
729
735
  ])])])) : (A(), S("div", et, [C("p", tt, N(r.error || "Організацію не знайдено."), 1), E(r.RouterLink, {
730
- to: "/organizations",
736
+ to: r.listPath,
731
737
  class: "mt-3 inline-block text-sm font-medium text-brand-600 hover:text-brand-700"
732
738
  }, {
733
739
  default: I(() => [...t[8] ||= [T(" Повернутися до реєстру ", -1)]]),
734
740
  _: 1
735
- })]));
741
+ }, 8, ["to"])]));
736
742
  }
737
743
  var rt = /*#__PURE__*/ e(Re, [["render", nt], ["__file", "C:/softpro/surveyor/admin/src/pages/organizations/card.vue"]]);
738
744
  //#endregion