@opengis/surveyor 0.0.14 → 0.0.16

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 (48) hide show
  1. package/dist/chunks/AppealStatusBadge-7KruOSVI.js +295 -0
  2. package/dist/chunks/ApplicationGeometryExportModal-DJbnKPm6.js +1245 -0
  3. package/dist/chunks/{BaseModal-SjP521X9.js → BaseModal-BJxKuONh.js} +1 -1
  4. package/dist/chunks/{RegistryFormModal-DhzEpxys.js → RegistryFormModal-BmBsUOF3.js} +1 -1
  5. package/dist/chunks/SurveyorTeleport-Cd6D92mo.js +30 -0
  6. package/dist/chunks/{applications-D6pHAQaK.js → applications-B6GAxopO.js} +16 -19
  7. package/dist/chunks/card-B113dNzv.js +1327 -0
  8. package/dist/chunks/card-COmcUdms.js +639 -0
  9. package/dist/chunks/{card-BBx1zR0E.js → card-Deae73xd.js} +2 -2
  10. package/dist/chunks/{certificates-DtfZTFN9.js → certificates-DHf1zGQs.js} +18 -8
  11. package/dist/chunks/{create-Cgeu7aKO.js → create-BVPqfJOb.js} +10 -10
  12. package/dist/chunks/{map-DkKsEnCM.js → map-BZi4eVl3.js} +893 -897
  13. package/dist/chunks/{map-layers-BmuIMLHa.js → map-layers-CKZK50de.js} +2 -2
  14. package/dist/chunks/{organizations-BO1dIl7v.js → organizations-DYGfYfHS.js} +2 -2
  15. package/dist/chunks/{requests-rWq8ok3C.js → requests-D1ix8U5f.js} +1 -1
  16. package/dist/chunks/requests-v1jHarHb.js +303 -0
  17. package/dist/chunks/{users-DOiQeVwn.js → users-frk3gmmd.js} +1 -1
  18. package/dist/index.css +1 -1
  19. package/dist/index.js +21 -21
  20. package/package.json +1 -1
  21. package/server/modules/surveyor/route.ts +13 -12
  22. package/server/modules/surveyor/services/applicationTile.ts +3 -3
  23. package/server/modules/surveyor/services/cancelApplication.ts +2 -1
  24. package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +1 -1
  25. package/server/modules/surveyor/services/completeApplication.ts +1 -1
  26. package/server/modules/surveyor/services/identifyApplications.ts +2 -2
  27. package/server/modules/surveyor/services/issueSourceData.ts +1 -1
  28. package/server/modules/surveyor/services/registerSurveyor.ts +1 -1
  29. package/server/modules/surveyor/services/resendRegistration.ts +1 -1
  30. package/server/modules/surveyor/services/searchApplications.ts +2 -2
  31. package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +1 -1
  32. package/server/modules/surveyor/services/updateSurveyorStatus.ts +1 -1
  33. package/server/modules/surveyor/services/verifyApplication.ts +1 -1
  34. package/server/modules/surveyor/utils/shared.ts +28 -6
  35. package/server/resources/surveyor-admin/application_comments.ts +1 -1
  36. package/server/resources/surveyor-admin/application_status_history.ts +1 -1
  37. package/server/resources/surveyor-admin/applications.ts +12 -11
  38. package/server/resources/surveyor-admin/certificates.ts +26 -26
  39. package/server/resources/surveyor-admin/map_layers.ts +1 -1
  40. package/server/resources/surveyor-admin/organizations.ts +1 -1
  41. package/server/resources/surveyor-admin/surveyors.ts +1 -1
  42. package/server/suggests/index.ts +18 -1
  43. package/dist/chunks/AppealStatusBadge-Ct3EcB4_.js +0 -185
  44. package/dist/chunks/ApplicationHistorySection-D7KPV2cX.js +0 -788
  45. package/dist/chunks/SurveyorTeleport-CnSF0Ptl.js +0 -23
  46. package/dist/chunks/card-Bj4zFzbe.js +0 -1193
  47. package/dist/chunks/card-C-ohjNkC.js +0 -609
  48. package/dist/chunks/requests-BZ2jrt5J.js +0 -234
@@ -1,788 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import { a as t, c as n, i as r, n as i, r as a, t as o, u as s } from "./appealMapLayers-CQMK3rrz.js";
3
- import { t as c } from "./application_status-BhNGiY2I.js";
4
- import { a as l, d as u, i as d, l as f, r as p, s as m, t as ee, u as h } from "./mapLayersApi-CBLcbADa.js";
5
- import { i as g, n as te, t as _ } from "./geometry-DyhIVRcw.js";
6
- import { t as ne } from "./MapLayerMenu-AUeTqgEp.js";
7
- import { Fragment as v, computed as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, normalizeClass as E, onMounted as re, onUnmounted as ie, openBlock as D, ref as O, renderList as k, shallowRef as ae, toDisplayString as A, vModelText as j, watch as M, withDirectives as N, withKeys as P, withModifiers as F } from "vue";
8
- import { ChevronDown as I, Crosshair as oe, History as L, MapPin as se, MapPinned as ce, MessageSquare as R, Send as z, ZoomIn as le, ZoomOut as ue } from "lucide-vue-next";
9
- //#region shared/map/components/AppealDetailMap.vue?vue&type=script&setup=true&lang.ts
10
- var B = "appeal-map-popup-style", V = /*@__PURE__*/ T({
11
- __name: "AppealDetailMap",
12
- props: {
13
- geom: {
14
- type: null,
15
- required: !0
16
- },
17
- address: {
18
- type: [String, null],
19
- required: !1
20
- },
21
- area: {
22
- type: [
23
- String,
24
- Number,
25
- null
26
- ],
27
- required: !1
28
- },
29
- location: {
30
- type: [String, null],
31
- required: !1
32
- },
33
- expanded: {
34
- type: Boolean,
35
- required: !1,
36
- default: !1
37
- },
38
- variant: {
39
- type: String,
40
- required: !1,
41
- default: "embedded"
42
- }
43
- },
44
- setup(e, { expose: c }) {
45
- c();
46
- let v = e, b = r, x = i, S = a, C = [30.5234, 50.4501], w = {
47
- padding: 30,
48
- maxZoom: 17
49
- }, T = O(null), E = O(null), D = ae(null), k = O(""), A = O(!0), j = O(o), N = O([]), P = O(n), F = O([]);
50
- function I(e) {
51
- return j.value.find((t) => t.id === e) ?? j.value[0] ?? o[0];
52
- }
53
- function L(e) {
54
- return e.kind === "applications";
55
- }
56
- function R() {
57
- let e = t.find(L);
58
- if (!e) throw Error("Static applications overlay is missing");
59
- let n = typeof window < "u" ? window.location.origin : "";
60
- return {
61
- ...e,
62
- tiles: e.tiles.map((e) => e.startsWith("/") ? `${n}${e}` : e)
63
- };
64
- }
65
- async function z() {
66
- let e = await ee("application-card");
67
- j.value = e.baseLayers, P.value = e.defaultBaseId;
68
- let t = e.overlays.filter((e) => e.kind !== "geometry" && e.kind !== "applications"), n = e.overlays.find(L) ?? R(), r = {
69
- id: n.id,
70
- label: n.label,
71
- kind: "applications",
72
- tiles: n.tiles,
73
- sourceLayer: n.sourceLayer,
74
- opacity: n.opacity,
75
- hasFilters: n.hasFilters,
76
- defaultVisible: !1
77
- };
78
- N.value = [r, ...t], F.value = N.value.filter((e) => e.defaultVisible).map((e) => e.id);
79
- }
80
- let V = null, H, U = null, W = null, G = !1, K = y(() => g(v.geom)), q = y(() => K.value ? te(K.value) : null), J = y(() => q.value ? _(q.value) : null), de = y(() => v.variant === "panel" ? "relative min-h-[320px] w-full flex-1" : ["relative w-full transition-all duration-300", v.expanded ? "h-[520px]" : "h-[340px]"]);
81
- function fe() {
82
- return {
83
- type: "FeatureCollection",
84
- features: K.value ? [{
85
- type: "Feature",
86
- geometry: K.value,
87
- properties: {}
88
- }] : []
89
- };
90
- }
91
- function Y(e) {
92
- q.value && e.fitBounds(q.value, {
93
- ...w,
94
- duration: 500
95
- });
96
- }
97
- function X(e, t) {
98
- let n = fe(), r = e.getSource(b);
99
- r?.setData ? r.setData(n) : (e.addSource(b, {
100
- type: "geojson",
101
- data: n
102
- }), e.addLayer({
103
- id: x,
104
- type: "fill",
105
- source: b,
106
- paint: {
107
- "fill-color": "#3b82f6",
108
- "fill-opacity": .35
109
- }
110
- }), e.addLayer({
111
- id: S,
112
- type: "line",
113
- source: b,
114
- paint: {
115
- "line-color": "#2563eb",
116
- "line-width": 3
117
- }
118
- })), he(e, t), Q(e, t);
119
- }
120
- function Z(e, t) {
121
- let n = e.trim(), r = n.match(/^(.+?)\s*\(([^)]+)\)\s*,?\s*(.*)$/);
122
- if (r) {
123
- let e = r[1].trim(), t = r[2].trim();
124
- return {
125
- title: [e, r[3].trim()].filter(Boolean).join(" "),
126
- subtitle: t
127
- };
128
- }
129
- let i = n.split(",").map((e) => e.trim()).filter(Boolean);
130
- if (i.length >= 2) {
131
- let e = i[i.length - 1], n = i.slice(0, -1).join(", "), r = /^\d+[a-zA-Zа-яА-ЯіїєґІЇЄҐ]?(?:[/-]\d+)?$/.test(e), a = r ? `${n}, ${e}` : n, o = t?.trim();
132
- return o && !a.includes(o) ? {
133
- title: r ? a : [n, e].filter(Boolean).join(" "),
134
- subtitle: o
135
- } : r ? {
136
- title: a,
137
- subtitle: ""
138
- } : {
139
- title: n,
140
- subtitle: e
141
- };
142
- }
143
- return {
144
- title: n,
145
- subtitle: t?.trim() || ""
146
- };
147
- }
148
- function pe() {
149
- let e = v.address?.trim(), t = v.location?.trim(), n = !!(e && e !== "—"), r = !!(t && t !== "—");
150
- return !n && !r ? null : n ? Z(e, r ? t : void 0) : {
151
- title: t,
152
- subtitle: ""
153
- };
154
- }
155
- function me() {
156
- let e = document.createElement("div");
157
- return e.className = "appeal-map-pin", e.innerHTML = "\n <svg width=\"28\" height=\"36\" viewBox=\"0 0 28 36\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M14 0C6.268 0 0 6.268 0 14c0 10.5 14 22 14 22s14-11.5 14-22C28 6.268 21.732 0 14 0z\" fill=\"#2563EB\"/>\n <circle cx=\"14\" cy=\"14\" r=\"5.5\" fill=\"white\"/>\n </svg>\n ", e;
158
- }
159
- function he(e, t) {
160
- W?.remove(), W = null, J.value && (W = new t.Marker({
161
- element: me(),
162
- anchor: "bottom"
163
- }).setLngLat(J.value).addTo(e));
164
- }
165
- function ge() {
166
- let e = document.getElementById(B) ?? document.createElement("style");
167
- e.id = B, e.textContent = "\n.appeal-map-popup .maplibregl-popup-content {\n min-width: 0;\n padding: 8px 8px 8px 10px !important;\n margin: 0;\n border: 1px solid #e2e8f0 !important;\n border-radius: 14px !important;\n background: #fff !important;\n box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06) !important;\n}\n.appeal-map-popup .maplibregl-popup-tip {\n width: 0 !important;\n height: 0 !important;\n border: 8px solid transparent !important;\n}\n.appeal-map-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n border-top-color: #fff !important;\n border-bottom-width: 0 !important;\n}\n.appeal-map-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n border-bottom-color: #fff !important;\n border-top-width: 0 !important;\n}\n.appeal-map-popup-body {\n position: relative;\n display: block;\n max-width: 260px;\n margin: 0 !important;\n padding: 2px 28px 2px 2px !important;\n text-align: left;\n}\n.appeal-map-popup-text {\n min-width: 0;\n margin: 0 !important;\n padding: 2px 0 !important;\n}\n.appeal-map-popup-title {\n margin: 0 !important;\n padding: 0 !important;\n font-size: 13px !important;\n font-weight: 600 !important;\n line-height: 1.35 !important;\n color: #0f172a !important;\n}\n.appeal-map-popup-subtitle {\n margin: 2px 0 0 !important;\n padding: 0 !important;\n font-size: 12px !important;\n font-weight: 400 !important;\n line-height: 1.35 !important;\n color: #64748b !important;\n}\n.appeal-map-popup-close,\n.appeal-map-popup-close:focus,\n.appeal-map-popup-close:focus-visible,\n.appeal-map-popup-close:active {\n position: absolute !important;\n top: -6px !important;\n right: -6px !important;\n display: flex !important;\n align-items: center;\n justify-content: center;\n width: 20px !important;\n height: 20px !important;\n padding: 0 !important;\n margin: 0 !important;\n border: 0 !important;\n border-radius: 6px !important;\n background: transparent !important;\n color: #94a3b8 !important;\n opacity: 1 !important;\n outline: none !important;\n outline-offset: 0 !important;\n box-shadow: none !important;\n appearance: none !important;\n -webkit-appearance: none !important;\n cursor: pointer !important;\n}\n.appeal-map-popup-close::-moz-focus-inner {\n border: 0 !important;\n padding: 0 !important;\n}\n.appeal-map-popup-close svg {\n display: block;\n width: 12px !important;\n height: 12px !important;\n}\n.appeal-map-popup-close:hover {\n background: #f1f5f9 !important;\n color: #334155 !important;\n}\n", e.parentNode || document.head.appendChild(e);
168
- }
169
- function Q(e, t) {
170
- ge(), U?.remove(), U = null;
171
- let n = pe();
172
- if (!J.value || !n) return;
173
- let { title: r, subtitle: i } = n, a = document.createElement("div");
174
- a.className = "appeal-map-popup-body";
175
- let o = document.createElement("div");
176
- o.className = "appeal-map-popup-text";
177
- let s = document.createElement("p");
178
- if (s.className = "appeal-map-popup-title", s.textContent = r, o.appendChild(s), i) {
179
- let e = document.createElement("p");
180
- e.className = "appeal-map-popup-subtitle", e.textContent = i, o.appendChild(e);
181
- }
182
- let c = document.createElement("button");
183
- c.type = "button", c.className = "appeal-map-popup-close", c.setAttribute("aria-label", "Закрити"), c.style.setProperty("outline", "none", "important"), c.style.setProperty("border", "0", "important"), c.style.setProperty("box-shadow", "none", "important"), c.innerHTML = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/></svg>", c.addEventListener("click", (e) => {
184
- e.preventDefault(), e.stopPropagation(), U?.remove();
185
- }), a.append(o, c), U = new t.Popup({
186
- closeButton: !1,
187
- closeOnClick: !1,
188
- offset: 42,
189
- maxWidth: "280px",
190
- className: "appeal-map-popup",
191
- anchor: "bottom"
192
- }).setLngLat(J.value).setDOMContent(a).addTo(e);
193
- }
194
- function _e(e) {
195
- l(e, I(P.value), d(e, N.value, [x]));
196
- }
197
- function ve(e) {
198
- m(e, N.value, F.value, x);
199
- }
200
- function ye(e) {
201
- P.value !== e && (P.value = e);
202
- }
203
- function be(e) {
204
- let t = F.value;
205
- F.value = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
206
- }
207
- function xe() {
208
- let e = V, t = E.value, n = T.value;
209
- if (!e || !t || !n || D.value || n.clientWidth === 0 || n.clientHeight === 0) return;
210
- let r = new e.Map({
211
- container: t,
212
- style: s(I(P.value)),
213
- ...q.value ? {
214
- bounds: q.value,
215
- fitBoundsOptions: w
216
- } : {
217
- center: C,
218
- zoom: 16
219
- },
220
- attributionControl: !1,
221
- locale: h
222
- });
223
- r.on("load", () => {
224
- r.resize(), X(r, e), ve(r), A.value = !1;
225
- }), r.on("error", (e) => {
226
- console.warn("[AppealDetailMap]", e?.error ?? e);
227
- }), D.value = r;
228
- }
229
- function Se() {
230
- D.value?.zoomIn({ duration: 250 });
231
- }
232
- function Ce() {
233
- D.value?.zoomOut({ duration: 250 });
234
- }
235
- function we() {
236
- let e = D.value;
237
- e && Y(e);
238
- }
239
- function Te() {
240
- let e = D.value, t = V;
241
- if (!e || !t) return;
242
- let n = () => {
243
- X(e, t), Y(e);
244
- };
245
- e.isStyleLoaded() ? n() : e.once("load", n);
246
- }
247
- M(() => [
248
- K.value,
249
- v.address,
250
- v.location
251
- ], Te), M(P, () => {
252
- let e = D.value;
253
- if (!e) return;
254
- let t = () => _e(e);
255
- e.isStyleLoaded() ? t() : e.once("load", t);
256
- }), M(F, () => {
257
- let e = D.value;
258
- e?.isStyleLoaded() && p(e, N.value, F.value);
259
- }), re(async () => {
260
- try {
261
- let [e] = await Promise.all([u(), z()]);
262
- V = e;
263
- } catch (e) {
264
- console.error(e), A.value = !1, k.value = f;
265
- return;
266
- }
267
- !G && T.value && (H = new ResizeObserver(() => {
268
- D.value ? D.value.resize() : xe();
269
- }), H.observe(T.value));
270
- }), ie(() => {
271
- G = !0, H?.disconnect(), U?.remove(), U = null, W?.remove(), W = null, D.value?.remove(), D.value = null;
272
- });
273
- let $ = {
274
- props: v,
275
- POLYGON_SOURCE_ID: b,
276
- POLYGON_FILL_ID: x,
277
- POLYGON_LINE_ID: S,
278
- FALLBACK_CENTER: C,
279
- FIT_OPTIONS: w,
280
- mapAreaRef: T,
281
- containerRef: E,
282
- mapRef: D,
283
- mapLoadError: k,
284
- mapLoading: A,
285
- baseLayers: j,
286
- overlayLayers: N,
287
- activeBaseId: P,
288
- activeOverlayIds: F,
289
- baseLayer: I,
290
- isApplications: L,
291
- fallbackApplicationsOverlay: R,
292
- loadLayerSettings: z,
293
- get ml() {
294
- return V;
295
- },
296
- set ml(e) {
297
- V = e;
298
- },
299
- get resizeObserver() {
300
- return H;
301
- },
302
- set resizeObserver(e) {
303
- H = e;
304
- },
305
- get addressPopup() {
306
- return U;
307
- },
308
- set addressPopup(e) {
309
- U = e;
310
- },
311
- get addressMarker() {
312
- return W;
313
- },
314
- set addressMarker(e) {
315
- W = e;
316
- },
317
- get disposed() {
318
- return G;
319
- },
320
- set disposed(e) {
321
- G = e;
322
- },
323
- geometry: K,
324
- bounds: q,
325
- center: J,
326
- mapAreaClass: de,
327
- buildGeoJson: fe,
328
- fitToGeometry: Y,
329
- ensureLayers: X,
330
- splitAddressLabel: Z,
331
- resolvePopupText: pe,
332
- createPinElement: me,
333
- showAddressMarker: he,
334
- POPUP_STYLE_ID: B,
335
- ensurePopupStyles: ge,
336
- showAddressPopup: Q,
337
- remountBasemap: _e,
338
- remountOverlays: ve,
339
- selectBase: ye,
340
- toggleOverlay: be,
341
- initMap: xe,
342
- zoomIn: Se,
343
- zoomOut: Ce,
344
- resetView: we,
345
- refreshLayers: Te,
346
- get Crosshair() {
347
- return oe;
348
- },
349
- get MapPin() {
350
- return se;
351
- },
352
- get MapPinned() {
353
- return ce;
354
- },
355
- get ZoomIn() {
356
- return le;
357
- },
358
- get ZoomOut() {
359
- return ue;
360
- },
361
- MapLayerMenu: ne
362
- };
363
- return Object.defineProperty($, "__isScriptSetup", {
364
- enumerable: !1,
365
- value: !0
366
- }), $;
367
- }
368
- }), H = {
369
- key: 0,
370
- class: "flex shrink-0 items-center justify-between border-b border-slate-100 px-5 py-3.5"
371
- }, U = { class: "flex items-center gap-2.5" }, W = {
372
- ref: "containerRef",
373
- class: "absolute inset-0 h-full w-full"
374
- }, G = {
375
- key: 0,
376
- class: "absolute inset-0 z-[5] flex items-center justify-center bg-white/90 px-4 text-center text-sm text-red-600"
377
- }, K = {
378
- key: 1,
379
- class: "absolute inset-0 z-[5] flex items-center justify-center bg-white/80 text-sm text-slate-500"
380
- }, q = { class: "absolute right-3 top-3 z-10 flex flex-col gap-1.5" }, J = {
381
- key: 1,
382
- class: "flex shrink-0 items-center gap-2 border-t border-slate-100 px-5 py-2.5 text-xs text-slate-400"
383
- }, de = { class: "break-words" };
384
- function fe(e, t, n, r, i, a) {
385
- return D(), x("div", { class: E(n.variant === "panel" ? "flex h-full flex-col rounded-xl border border-slate-200 bg-white shadow-card" : void 0) }, [
386
- n.variant === "panel" ? (D(), x("header", H, [S("div", U, [w(r.MapPinned, {
387
- class: "h-[18px] w-[18px] text-brand-600",
388
- "stroke-width": 2,
389
- "aria-hidden": "true"
390
- }), t[0] ||= S("h2", { class: "text-[15px] font-semibold text-slate-800" }, "Інтерактивна карта", -1)]), t[1] ||= S("span", { class: "rounded-full bg-slate-100 px-2.5 py-1 text-xs font-medium text-slate-500" }, " Межі заявки ", -1)])) : b("", !0),
391
- S("div", {
392
- ref: "mapAreaRef",
393
- class: E(r.mapAreaClass)
394
- }, [
395
- S("div", W, null, 512),
396
- r.mapLoadError ? (D(), x("p", G, A(r.mapLoadError), 1)) : r.mapLoading ? (D(), x("p", K, " Завантаження карти… ")) : b("", !0),
397
- w(r.MapLayerMenu, {
398
- "base-id": r.activeBaseId,
399
- "active-overlay-ids": r.activeOverlayIds,
400
- "base-layers": r.baseLayers,
401
- overlays: r.overlayLayers,
402
- onSelectBase: r.selectBase,
403
- onToggleOverlay: r.toggleOverlay
404
- }, null, 8, [
405
- "base-id",
406
- "active-overlay-ids",
407
- "base-layers",
408
- "overlays"
409
- ]),
410
- S("div", q, [
411
- S("button", {
412
- type: "button",
413
- title: "Збільшити",
414
- "aria-label": "Збільшити",
415
- class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-card transition-colors hover:bg-brand-50 hover:text-brand-600",
416
- onClick: r.zoomIn
417
- }, [w(r.ZoomIn, {
418
- class: "h-4 w-4",
419
- "stroke-width": 2,
420
- "aria-hidden": "true"
421
- })]),
422
- S("button", {
423
- type: "button",
424
- title: "Зменшити",
425
- "aria-label": "Зменшити",
426
- class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-card transition-colors hover:bg-brand-50 hover:text-brand-600",
427
- onClick: r.zoomOut
428
- }, [w(r.ZoomOut, {
429
- class: "h-4 w-4",
430
- "stroke-width": 2,
431
- "aria-hidden": "true"
432
- })]),
433
- S("button", {
434
- type: "button",
435
- title: "Відновити масштаб",
436
- "aria-label": "Відновити масштаб",
437
- class: "flex h-9 w-9 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 shadow-card transition-colors hover:bg-brand-50 hover:text-brand-600",
438
- onClick: r.resetView
439
- }, [w(r.Crosshair, {
440
- class: "h-4 w-4",
441
- "stroke-width": 2,
442
- "aria-hidden": "true"
443
- })])
444
- ])
445
- ], 2),
446
- n.variant === "panel" ? (D(), x("footer", J, [
447
- w(r.MapPin, {
448
- class: "h-3 w-3 shrink-0",
449
- "stroke-width": 2,
450
- "aria-hidden": "true"
451
- }),
452
- S("span", null, "Площа ділянки: " + A(n.area ?? "—") + " га", 1),
453
- t[2] ||= S("span", { class: "text-slate-300" }, "·", -1),
454
- S("span", de, A(n.location), 1)
455
- ])) : b("", !0)
456
- ], 2);
457
- }
458
- var Y = /*#__PURE__*/ e(V, [
459
- ["render", fe],
460
- ["__scopeId", "data-v-ded53fc4"],
461
- ["__file", "C:/softpro/surveyor/shared/map/components/AppealDetailMap.vue"]
462
- ]);
463
- //#endregion
464
- //#region shared/comments/applicationNotesApi.ts
465
- function X(e, t, n) {
466
- return `/api/resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${n}`;
467
- }
468
- async function Z(e) {
469
- let t = await e.text();
470
- try {
471
- let n = JSON.parse(t);
472
- return (typeof n.error == "object" ? n.error?.message : void 0) || n.message || n.detail || t || `HTTP ${e.status}`;
473
- } catch {
474
- return t || `HTTP ${e.status}`;
475
- }
476
- }
477
- async function pe(e, t) {
478
- let n = "".replace(/\/$/, ""), r = await fetch(`${n}${X(e, t, "comments")}`, { credentials: "include" });
479
- if (!r.ok) throw Error(await Z(r));
480
- return [...(await r.json()).rows ?? []].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? "")));
481
- }
482
- async function me(e, t, n) {
483
- let r = n.trim();
484
- if (!r) throw Error("Введіть текст коментаря");
485
- let i = "".replace(/\/$/, ""), a = await fetch(`${i}${X(e, t, "notes")}`, {
486
- method: "POST",
487
- credentials: "include",
488
- headers: { "Content-Type": "application/json" },
489
- body: JSON.stringify({ body: r })
490
- });
491
- if (!a.ok) throw Error(await Z(a));
492
- return a.json();
493
- }
494
- //#endregion
495
- //#region shared/comments/noteDisplay.ts
496
- function he(e) {
497
- return e.split(/\s+/).map((e) => e[0]).filter(Boolean).join("").slice(0, 2).toUpperCase();
498
- }
499
- function ge(e) {
500
- if (!e) return "";
501
- let t = e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/);
502
- if (t) return `${t[3]}.${t[2]}.${t[1]} ${t[4]}:${t[5]}`;
503
- let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
504
- return n ? `${n[3]}.${n[2]}.${n[1]}` : e;
505
- }
506
- var Q = {
507
- name: "Невідомий користувач",
508
- initials: "НК"
509
- };
510
- function _e(e) {
511
- let t = e.created_by?.trim();
512
- return t ? {
513
- name: "Користувач",
514
- initials: t.slice(0, 2).toUpperCase()
515
- } : Q;
516
- }
517
- //#endregion
518
- //#region shared/comments/ApplicationCommentsSection.vue?vue&type=script&setup=true&lang.ts
519
- var ve = /*@__PURE__*/ T({
520
- __name: "ApplicationCommentsSection",
521
- props: {
522
- applicationId: {
523
- type: String,
524
- required: !0
525
- },
526
- resource: {
527
- type: String,
528
- required: !0
529
- },
530
- variant: {
531
- type: String,
532
- required: !1,
533
- default: "cabinet"
534
- },
535
- currentAuthor: {
536
- type: Object,
537
- required: !0
538
- },
539
- resolveAuthor: {
540
- type: Function,
541
- required: !1
542
- }
543
- },
544
- setup(e, { expose: t }) {
545
- t();
546
- let n = e, r = O([]), i = O({}), a = O(!0), o = O(""), s = O(""), c = O(!1), l = O(""), u = y(() => n.variant === "admin"), d = y(() => u.value ? "rounded-2xl border border-slate-200 bg-white shadow-card" : "overflow-hidden rounded-2xl border border-gray-200 bg-white"), f = y(() => u.value ? "flex items-center gap-2.5 border-b border-slate-100 px-5 py-3.5" : "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3"), p = y(() => u.value ? "text-[15px] font-semibold text-slate-800" : "text-xs font-semibold uppercase tracking-wider text-gray-500"), m = y(() => (u.value, "flex flex-col gap-4 p-5"));
547
- function ee(e) {
548
- return i.value[e.note_id] ?? n.resolveAuthor?.(e) ?? _e(e);
549
- }
550
- async function h() {
551
- if (n.applicationId) {
552
- a.value = !0, o.value = "";
553
- try {
554
- r.value = await pe(n.resource, n.applicationId), i.value = {};
555
- } catch (e) {
556
- r.value = [], o.value = e instanceof Error ? e.message : "Не вдалося завантажити коментарі";
557
- } finally {
558
- a.value = !1;
559
- }
560
- }
561
- }
562
- async function g() {
563
- let e = s.value.trim();
564
- if (e && !c.value && n.applicationId) {
565
- c.value = !0, l.value = "";
566
- try {
567
- let t = await me(n.resource, n.applicationId, e);
568
- i.value = {
569
- ...i.value,
570
- [t.note_id]: n.currentAuthor
571
- }, r.value = [...r.value, t].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? ""))), s.value = "";
572
- } catch (e) {
573
- l.value = e instanceof Error ? e.message : "Не вдалося надіслати коментар";
574
- } finally {
575
- c.value = !1;
576
- }
577
- }
578
- }
579
- function te(e) {
580
- e.preventDefault(), g();
581
- }
582
- M(() => n.applicationId, () => {
583
- h();
584
- }, { immediate: !0 });
585
- let _ = {
586
- props: n,
587
- notes: r,
588
- localAuthors: i,
589
- loading: a,
590
- loadError: o,
591
- draft: s,
592
- sending: c,
593
- sendError: l,
594
- isAdmin: u,
595
- sectionClass: d,
596
- headerClass: f,
597
- titleClass: p,
598
- bodyClass: m,
599
- authorFor: ee,
600
- loadNotes: h,
601
- submit: g,
602
- onSubmit: te,
603
- get MessageSquare() {
604
- return R;
605
- },
606
- get Send() {
607
- return z;
608
- },
609
- get formatNoteDateTime() {
610
- return ge;
611
- }
612
- };
613
- return Object.defineProperty(_, "__isScriptSetup", {
614
- enumerable: !1,
615
- value: !0
616
- }), _;
617
- }
618
- }), ye = {
619
- key: 1,
620
- class: "text-center text-sm text-red-600"
621
- }, be = {
622
- key: 1,
623
- class: "flex flex-col gap-4"
624
- }, xe = { class: "min-w-0 flex-1" }, Se = { class: "flex flex-wrap items-baseline justify-between gap-x-2" }, Ce = { class: "text-[14px] font-semibold text-slate-800" }, we = { class: "text-xs text-slate-400" }, Te = {
625
- key: 0,
626
- class: "mb-1.5 text-xs font-medium text-brand-600"
627
- }, $ = { class: "whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600" }, Ee = {
628
- key: 1,
629
- class: "rounded-xl bg-gray-50 px-4 py-3"
630
- }, De = { class: "mb-1 flex items-center justify-between gap-2" }, Oe = { class: "text-xs font-semibold text-gray-800" }, ke = { class: "text-xs text-gray-400" }, Ae = {
631
- key: 0,
632
- class: "mb-1 text-xs font-medium text-[#2663EB]"
633
- }, je = { class: "whitespace-pre-wrap text-sm text-gray-700" }, Me = { class: "relative min-w-0 flex-1" }, Ne = [
634
- "disabled",
635
- "placeholder",
636
- "onKeydown"
637
- ], Pe = ["disabled"], Fe = ["disabled"], Ie = {
638
- key: 2,
639
- class: "text-xs text-red-600"
640
- };
641
- function Le(e, t, n, r, i, a) {
642
- return D(), x("section", { class: E(r.sectionClass) }, [S("header", { class: E(r.headerClass) }, [w(r.MessageSquare, {
643
- class: E(["shrink-0", r.isAdmin ? "h-[18px] w-[18px] text-brand-600" : "h-3.5 w-3.5 text-gray-400"]),
644
- "stroke-width": 2,
645
- "aria-hidden": "true"
646
- }, null, 8, ["class"]), S("h2", { class: E(r.titleClass) }, "Коментарі", 2)], 2), S("div", { class: E(r.bodyClass) }, [r.loading ? (D(), x("p", {
647
- key: 0,
648
- class: E(["text-center text-sm", r.isAdmin ? "text-slate-400" : "text-gray-400"])
649
- }, " Завантаження… ", 2)) : r.loadError ? (D(), x("p", ye, A(r.loadError), 1)) : (D(), x(v, { key: 2 }, [
650
- r.notes.length === 0 ? (D(), x("p", {
651
- key: 0,
652
- class: E(["text-center text-sm italic", r.isAdmin ? "py-2 text-slate-400" : "py-4 text-gray-400"])
653
- }, " Коментарів ще немає ", 2)) : (D(), x("ul", be, [(D(!0), x(v, null, k(r.notes, (e) => (D(), x("li", {
654
- key: e.note_id,
655
- class: "flex gap-3"
656
- }, [S("div", { class: E(["flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold", r.isAdmin ? "bg-brand-100 text-brand-700" : "bg-[#2663EB] text-white text-xs"]) }, A(r.authorFor(e).initials), 3), S("div", xe, [r.isAdmin ? (D(), x(v, { key: 0 }, [
657
- S("div", Se, [S("span", Ce, A(r.authorFor(e).name), 1), S("time", we, A(r.formatNoteDateTime(e.created_at)), 1)]),
658
- r.authorFor(e).role ? (D(), x("p", Te, A(r.authorFor(e).role), 1)) : b("", !0),
659
- S("p", $, A(e.body), 1)
660
- ], 64)) : (D(), x("div", Ee, [
661
- S("div", De, [S("span", Oe, A(r.authorFor(e).name), 1), S("time", ke, A(r.formatNoteDateTime(e.created_at)), 1)]),
662
- r.authorFor(e).role ? (D(), x("p", Ae, A(r.authorFor(e).role), 1)) : b("", !0),
663
- S("p", je, A(e.body), 1)
664
- ]))])]))), 128))])),
665
- S("form", {
666
- class: E(["flex items-start gap-3 border-t pt-4", r.isAdmin ? "border-slate-100" : "border-gray-100"]),
667
- onSubmit: r.onSubmit
668
- }, [
669
- S("div", { class: E(["mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-xs font-semibold", r.isAdmin ? "bg-brand-100 text-brand-700" : "bg-[#2663EB] text-white"]) }, A(n.currentAuthor.initials), 3),
670
- S("div", Me, [N(S("textarea", {
671
- "onUpdate:modelValue": t[0] ||= (e) => r.draft = e,
672
- rows: "3",
673
- disabled: r.sending,
674
- placeholder: r.isAdmin ? "Додати коментар…" : "Напишіть коментар...",
675
- class: E(["w-full resize-none rounded-xl border px-4 py-3 text-sm transition-colors focus:outline-none focus:ring-2 disabled:opacity-60", r.isAdmin ? "border-slate-200 bg-slate-50 text-slate-700 placeholder:text-slate-400 focus:border-brand-400 focus:bg-white focus:ring-brand-400/30" : "border-gray-200 pr-12 text-gray-900 placeholder:text-gray-400 focus:border-[#2663EB] focus:ring-[#2663EB]/20"]),
676
- onKeydown: P(F(r.submit, ["exact", "prevent"]), ["enter"])
677
- }, null, 42, Ne), [[j, r.draft]]), r.isAdmin ? b("", !0) : (D(), x("button", {
678
- key: 0,
679
- type: "submit",
680
- disabled: !r.draft.trim() || r.sending,
681
- class: "absolute bottom-3 right-3 rounded-lg bg-[#2663EB] p-1.5 text-white transition-all hover:bg-[#1d52cc] active:scale-95 disabled:cursor-not-allowed disabled:opacity-40",
682
- "aria-label": "Надіслати"
683
- }, [w(r.Send, {
684
- class: "h-3.5 w-3.5",
685
- "stroke-width": 2
686
- })], 8, Pe))]),
687
- r.isAdmin ? (D(), x("button", {
688
- key: 0,
689
- type: "submit",
690
- disabled: !r.draft.trim() || r.sending,
691
- class: "inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-medium text-white shadow-card transition-all hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-40"
692
- }, [w(r.Send, {
693
- class: "h-3.5 w-3.5",
694
- "stroke-width": 2
695
- }), C(" " + A(r.sending ? "Надсилання…" : "Надіслати"), 1)], 8, Fe)) : b("", !0)
696
- ], 34),
697
- r.sendError ? (D(), x("p", Ie, A(r.sendError), 1)) : b("", !0)
698
- ], 64))], 2)], 2);
699
- }
700
- var Re = /*#__PURE__*/ e(ve, [["render", Le], ["__file", "C:/softpro/surveyor/shared/comments/ApplicationCommentsSection.vue"]]), ze = /*@__PURE__*/ T({
701
- __name: "ApplicationHistorySection",
702
- props: {
703
- items: {
704
- type: [Array, null],
705
- required: !1,
706
- default: () => []
707
- },
708
- variant: {
709
- type: String,
710
- required: !1,
711
- default: "cabinet"
712
- }
713
- },
714
- setup(e, { expose: t }) {
715
- t();
716
- let n = e, r = O(!0), i = y(() => n.variant === "admin"), a = y(() => [...n.items ?? []].sort((e, t) => String(e.created_at ?? "").localeCompare(String(t.created_at ?? "")))), o = y(() => i.value ? "rounded-xl border border-slate-200 bg-white shadow-card" : "overflow-hidden rounded-2xl border border-gray-200 bg-white"), s = y(() => i.value ? "flex items-center gap-2.5 border-b border-slate-100 px-5 py-3.5" : "flex items-center gap-2 border-b border-gray-100 bg-gray-50/60 px-5 py-3"), l = y(() => i.value ? "text-[15px] font-semibold text-slate-800" : "text-xs font-semibold uppercase tracking-wider text-gray-500"), u = y(() => i.value ? "px-5 py-4" : "p-5");
717
- function d(e, t) {
718
- return t?.text?.trim() || (e ? c.items.find((t) => t.code === e)?.name ?? e : "");
719
- }
720
- function f(e) {
721
- let t = d(e.status_from, e.status_from_data), n = d(e.status_to, e.status_to_data) || "—";
722
- return t ? `${t} → ${n}` : n;
723
- }
724
- function p(e) {
725
- if (!e) return "";
726
- let t = e.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/);
727
- if (t) return `${t[3]}.${t[2]}.${t[1]} ${t[4]}:${t[5]}`;
728
- let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
729
- return n ? `${n[3]}.${n[2]}.${n[1]}` : e;
730
- }
731
- let m = {
732
- props: n,
733
- open: r,
734
- isAdmin: i,
735
- events: a,
736
- sectionClass: o,
737
- headerClass: s,
738
- titleClass: l,
739
- bodyClass: u,
740
- statusLabel: d,
741
- historyTitle: f,
742
- formatDateTime: p,
743
- get ChevronDown() {
744
- return I;
745
- },
746
- get History() {
747
- return L;
748
- }
749
- };
750
- return Object.defineProperty(m, "__isScriptSetup", {
751
- enumerable: !1,
752
- value: !0
753
- }), m;
754
- }
755
- }), Be = {
756
- key: 0,
757
- class: "relative list-none"
758
- }, Ve = { class: "relative z-10 mt-1 shrink-0" }, He = { class: "min-w-0 flex-1" }, Ue = { class: "flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1" };
759
- function We(e, t, n, r, i, a) {
760
- return D(), x("section", { class: E(r.sectionClass) }, [S("header", { class: E(r.headerClass) }, [w(r.History, {
761
- class: E(["shrink-0", r.isAdmin ? "h-[18px] w-[18px] text-brand-600" : "h-3.5 w-3.5 text-gray-400"]),
762
- "stroke-width": 2,
763
- "aria-hidden": "true"
764
- }, null, 8, ["class"]), S("h2", { class: E(r.titleClass) }, "Історія", 2)], 2), S("div", { class: E(r.bodyClass) }, [S("button", {
765
- type: "button",
766
- class: E(["mb-3 flex w-full items-center justify-between text-xs font-medium transition-colors", r.isAdmin ? "text-slate-500 hover:text-brand-600" : "text-gray-500 hover:text-[#2663EB]"]),
767
- onClick: t[0] ||= (e) => r.open = !r.open
768
- }, [S("span", null, A(r.open ? "Згорнути" : `Розгорнути (${r.events.length} подій)`), 1), w(r.ChevronDown, {
769
- class: E(["h-4 w-4 transition-transform", r.open ? "" : "rotate-180"]),
770
- "aria-hidden": "true"
771
- }, null, 8, ["class"])], 2), r.open && r.events.length ? (D(), x("ol", Be, [t[1] ||= S("div", { class: "absolute bottom-2 left-[7px] top-2 w-px bg-slate-200" }, null, -1), (D(!0), x(v, null, k(r.events, (e, t) => (D(), x("li", {
772
- key: e.history_id,
773
- class: "relative flex gap-4 pb-6 last:pb-0"
774
- }, [S("div", Ve, [S("span", { class: E(["block h-[15px] w-[15px] rounded-full border-2 border-white", t === r.events.length - 1 ? "bg-brand-500" : "bg-slate-300"]) }, null, 2)]), S("div", He, [
775
- S("div", Ue, [S("p", { class: E(["text-[14px] font-semibold", r.isAdmin ? "text-slate-800" : "text-gray-900"]) }, A(r.historyTitle(e)), 3), S("time", { class: E(["text-xs", r.isAdmin ? "text-slate-400" : "text-gray-400"]) }, A(r.formatDateTime(e.created_at) || "—"), 3)]),
776
- e.reason ? (D(), x("p", {
777
- key: 0,
778
- class: E(["mt-1 text-[13px] leading-relaxed", r.isAdmin ? "text-slate-600" : "text-gray-600"])
779
- }, A(e.reason), 3)) : b("", !0),
780
- S("p", { class: E(["mt-1 text-xs", r.isAdmin ? "text-slate-400" : "text-gray-400"]) }, A(e.changed_by_data?.text || "—"), 3)
781
- ])]))), 128))])) : r.events.length ? b("", !0) : (D(), x("p", {
782
- key: 1,
783
- class: E(["text-sm", r.isAdmin ? "text-slate-400" : "text-gray-400"])
784
- }, " Історія відсутня. ", 2))], 2)], 2);
785
- }
786
- var Ge = /*#__PURE__*/ e(ze, [["render", We], ["__file", "C:/softpro/surveyor/shared/history/ApplicationHistorySection.vue"]]);
787
- //#endregion
788
- export { Y as a, Q as i, Re as n, he as r, Ge as t };