@opengis/surveyor 0.0.0-stage → 0.0.1
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.
- package/README.md +46 -3
- package/README.npm.md +51 -0
- package/dist/chunks/AppIcon-C-4QykTP.js +85 -0
- package/dist/chunks/AppealDetailField-DNRGpnyD.js +58 -0
- package/dist/chunks/AppealStatusBadge-CefimzY3.js +132 -0
- package/dist/chunks/AppealStatusBadge-Cu-UzdzA.js +171 -0
- package/dist/chunks/ApplicationHistorySection-PwToBfej.js +769 -0
- package/dist/chunks/BaseModal-DrTTkLmR.js +85 -0
- package/dist/chunks/FormFilePicker-CKVdZJU9.js +76 -0
- package/dist/chunks/MapLayerMenu-AUeTqgEp.js +145 -0
- package/dist/chunks/RegistryForm-pvIcFR-V.js +99 -0
- package/dist/chunks/RegistryFormModal-BjGu7Upv.js +85 -0
- package/dist/chunks/RegistryToolbar-CiUgsjpU.js +452 -0
- package/dist/chunks/UserAccessBadge-DyZDv7Oo.js +44 -0
- package/dist/chunks/UserTypeBadge-LvnMuKGo.js +188 -0
- package/dist/chunks/VerifiedBadge-B6droMOf.js +34 -0
- package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chunks/account-types-Br7gx_D_.js +35 -0
- package/dist/chunks/account_types-DLL1w122.js +25 -0
- package/dist/chunks/appealMapLayers-CQMK3rrz.js +115 -0
- package/dist/chunks/application_status-BhNGiY2I.js +45 -0
- package/dist/chunks/applications-CsCsndMV.js +132 -0
- package/dist/chunks/buildSchema-nkA4Y0YG.js +37 -0
- package/dist/chunks/card--DHsMNBd.js +330 -0
- package/dist/chunks/card-9LaB42Ol.js +538 -0
- package/dist/chunks/card-BZn5CDw9.js +739 -0
- package/dist/chunks/card-CNqXSyqX.js +297 -0
- package/dist/chunks/card-CgGOgGyd.js +973 -0
- package/dist/chunks/card-DCyBFoDZ.js +607 -0
- package/dist/chunks/certificates-DueBDDvc.js +424 -0
- package/dist/chunks/create-l28e-bWl.js +1033 -0
- package/dist/chunks/filterQuery-B9XNx1f1.js +99 -0
- package/dist/chunks/form-CdGS1nVO.js +315 -0
- package/dist/chunks/form-QTkkzwbC.js +89 -0
- package/dist/chunks/geometry-DyhIVRcw.js +67 -0
- package/dist/chunks/map-BW3iOhQg.js +2763 -0
- package/dist/chunks/map-layers-qxWjos2V.js +400 -0
- package/dist/chunks/mapLayersApi-CWoQ2be-.js +251 -0
- package/dist/chunks/organizations-BtuMZ5s_.js +14 -0
- package/dist/chunks/organizations-CZOINYMq.js +476 -0
- package/dist/chunks/profile-CuxlkEev.js +243 -0
- package/dist/chunks/profile-DxZHxGum.js +164 -0
- package/dist/chunks/requests-Bt8fEdRc.js +530 -0
- package/dist/chunks/requests-DQJIhz00.js +232 -0
- package/dist/chunks/resendSurveyorRegistration-DopjOHaM.js +27 -0
- package/dist/chunks/resources-Cl_EvaIy.js +129 -0
- package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist/chunks/surveyorAccount-BceNQypZ.js +78 -0
- package/dist/chunks/users-DlaogjC_.js +291 -0
- package/dist/chunks/work_types-Hwme-FEX.js +34 -0
- package/dist/index.css +3 -0
- package/dist/index.js +259 -0
- package/migrations/20260924120000_surveyor_schema.sql +450 -0
- package/migrations/20261008170000_address_lookup.sql +20 -0
- package/migrations/20261016120000_map_layers.sql +156 -0
- package/migrations/20261016150000_password_reset.sql +15 -0
- package/migrations/20261016170000_address_lookup_format.sql +37 -0
- package/migrations/20261016180000_settlement_lookup.sql +16 -0
- package/migrations/20261019170000_actor_lookup.sql +15 -0
- package/package.json +75 -4
- package/plugin.js +10 -0
- package/server/app.ts +50 -0
- package/server/dictionaries/index.ts +17 -0
- package/server/dictionaries/surveyor/account_types.ts +12 -0
- package/server/dictionaries/surveyor/application_status.ts +16 -0
- package/server/dictionaries/surveyor/map_layer_components.ts +11 -0
- package/server/dictionaries/surveyor/map_layer_groups.ts +10 -0
- package/server/dictionaries/surveyor/map_layer_types.ts +11 -0
- package/server/dictionaries/surveyor/work_types.ts +15 -0
- package/server/dictionaries/surveyor/yes_no.ts +11 -0
- package/server/embed.ts +49 -0
- package/server/fastify.d.ts +12 -0
- package/server/index.ts +23 -0
- package/server/modules/surveyor/route.ts +410 -0
- package/server/modules/surveyor/schema.ts +439 -0
- package/server/modules/surveyor/services/applicationTile.ts +53 -0
- package/server/modules/surveyor/services/cancelApplication.ts +74 -0
- package/server/modules/surveyor/services/changeSurveyorPassword.ts +52 -0
- package/server/modules/surveyor/services/changeSurveyorPasswordByAdmin.ts +41 -0
- package/server/modules/surveyor/services/completeApplication.ts +46 -0
- package/server/modules/surveyor/services/completeSurveyorRegistration.ts +48 -0
- package/server/modules/surveyor/services/createApplication.ts +169 -0
- package/server/modules/surveyor/services/geometryExport.ts +34 -0
- package/server/modules/surveyor/services/geometryImport.ts +66 -0
- package/server/modules/surveyor/services/getSurveyorUser.ts +56 -0
- package/server/modules/surveyor/services/identifyApplications.ts +82 -0
- package/server/modules/surveyor/services/issueSourceData.ts +55 -0
- package/server/modules/surveyor/services/loginSurveyor.ts +67 -0
- package/server/modules/surveyor/services/mapLayers.ts +61 -0
- package/server/modules/surveyor/services/rasterExport.ts +15 -0
- package/server/modules/surveyor/services/registerSurveyor.ts +161 -0
- package/server/modules/surveyor/services/requestPasswordReset.ts +49 -0
- package/server/modules/surveyor/services/resendRegistration.ts +42 -0
- package/server/modules/surveyor/services/resetSurveyorPassword.ts +53 -0
- package/server/modules/surveyor/services/searchApplications.ts +63 -0
- package/server/modules/surveyor/services/submitSurvey.ts +70 -0
- package/server/modules/surveyor/services/updateSurveyorAccountStatus.ts +52 -0
- package/server/modules/surveyor/services/updateSurveyorStatus.ts +53 -0
- package/server/modules/surveyor/services/vectorExport.ts +86 -0
- package/server/modules/surveyor/services/verifyApplication.ts +59 -0
- package/server/modules/surveyor/utils/accessibleApplication.ts +37 -0
- package/server/modules/surveyor/utils/application.ts +68 -0
- package/server/modules/surveyor/utils/export.ts +39 -0
- package/server/modules/surveyor/utils/firstBoundary.ts +48 -0
- package/server/modules/surveyor/utils/mail.ts +161 -0
- package/server/modules/surveyor/utils/permissions.ts +29 -0
- package/server/modules/surveyor/utils/registration.ts +33 -0
- package/server/modules/surveyor/utils/shared.ts +305 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_admin_password.pt.hbs +79 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_password_reset.pt.hbs +79 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_registration.pt.hbs +80 -0
- package/server/modules/surveyor/utils/templates/ds.surveyor_send_mail.pt.hbs +79 -0
- package/server/modules/surveyor/utils/vectorLayer.ts +41 -0
- package/server/plugins/convertVector.ts +74 -0
- package/server/plugins/proto/convertVector.proto +21 -0
- package/server/plugins/swagger.ts +54 -0
- package/server/plugins/vite.dev.ts +52 -0
- package/server/plugins/vite.prod.ts +55 -0
- package/server/resources/helpers/actor_lookup.ts +5 -0
- package/server/resources/helpers/address_lookup.ts +8 -0
- package/server/resources/helpers/settlement_lookup.ts +7 -0
- package/server/resources/helpers/user_lookup.ts +5 -0
- package/server/resources/index.ts +30 -0
- package/server/resources/surveyor-admin/application_comments.ts +24 -0
- package/server/resources/surveyor-admin/application_status_history.ts +46 -0
- package/server/resources/surveyor-admin/applications.ts +125 -0
- package/server/resources/surveyor-admin/certificates.ts +87 -0
- package/server/resources/surveyor-admin/map_layers.ts +69 -0
- package/server/resources/surveyor-admin/organization_surveyors.ts +32 -0
- package/server/resources/surveyor-admin/organizations.ts +61 -0
- package/server/resources/surveyor-admin/surveyors.ts +71 -0
- package/server/resources/surveyor-user/application_status_history.ts +52 -0
- package/server/resources/surveyor-user/applications.ts +131 -0
- package/server/resources/surveyor-user/certificates.ts +67 -0
- package/server/resources/surveyor-user/organizations.ts +40 -0
- package/server/resources/surveyor-user/surveyors.ts +69 -0
- package/server/tsconfig.json +3 -0
- package/surveyor-types.d.ts +30 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { i as e } from "./resources-Cl_EvaIy.js";
|
|
2
|
+
//#region admin/src/utils/filterQuery.ts
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
let n = e[t];
|
|
5
|
+
return Array.isArray(n) ? n[0] ?? "" : n ?? "";
|
|
6
|
+
}
|
|
7
|
+
function n(e, t) {
|
|
8
|
+
let n = e[t];
|
|
9
|
+
return Array.isArray(n) ? n.map((e) => String(e ?? "").trim()).filter(Boolean) : n == null || n === "" ? [] : String(n).split(",").map((e) => e.trim()).filter(Boolean);
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
12
|
+
let t = [];
|
|
13
|
+
for (let [n, r] of Object.entries(e)) {
|
|
14
|
+
if (r == null || r === "") continue;
|
|
15
|
+
let e = Array.isArray(r) ? r.map((e) => String(e ?? "").trim()).filter(Boolean).join(",") : String(r).trim();
|
|
16
|
+
e && t.push(`${n}=${e}`);
|
|
17
|
+
}
|
|
18
|
+
return t.join("|");
|
|
19
|
+
}
|
|
20
|
+
function i(e, t = []) {
|
|
21
|
+
let n = {};
|
|
22
|
+
if (!e.trim()) return n;
|
|
23
|
+
for (let r of e.split("|")) {
|
|
24
|
+
let e = r.indexOf("=");
|
|
25
|
+
if (e <= 0) continue;
|
|
26
|
+
let i = r.slice(0, e), a = r.slice(e + 1);
|
|
27
|
+
i && a && (n[i] = t.includes(i) && a.includes(",") ? a.split(",").map((e) => e.trim()).filter(Boolean) : a);
|
|
28
|
+
}
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
function a(e, t = "period") {
|
|
32
|
+
let n = e[t], r = Array.isArray(n) ? n.map((e) => String(e ?? "").trim()) : typeof n == "string" ? n.split(",").map((e) => e.trim()) : [];
|
|
33
|
+
return {
|
|
34
|
+
from: r[0] ?? "",
|
|
35
|
+
to: r[1] ?? ""
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function o(e) {
|
|
39
|
+
let t = {}, r = n(e, "status");
|
|
40
|
+
r.length === 1 ? t.status = r[0] : r.length > 1 && (t.status = { in: r.join(",") });
|
|
41
|
+
let i = n(e, "year");
|
|
42
|
+
return i.length === 1 && (t.created_at = {
|
|
43
|
+
gte: `${i[0]}-01-01`,
|
|
44
|
+
lte: `${i[0]}-12-31`
|
|
45
|
+
}), Object.keys(t).length ? t : void 0;
|
|
46
|
+
}
|
|
47
|
+
function s(e, t = "verified") {
|
|
48
|
+
let r = n(e, t);
|
|
49
|
+
if (r.length === 1) {
|
|
50
|
+
if (r[0] === "verified") return !0;
|
|
51
|
+
if (r[0] === "unverified") return !1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function c(e) {
|
|
55
|
+
let t = {}, n = s(e, "verified");
|
|
56
|
+
return n !== void 0 && (t.isvalid = n), Object.keys(t).length ? t : void 0;
|
|
57
|
+
}
|
|
58
|
+
function l(e) {
|
|
59
|
+
let t = {}, n = s(e, "verified");
|
|
60
|
+
n !== void 0 && (t.verified = n);
|
|
61
|
+
let { from: r, to: i } = a(e, "createdAt");
|
|
62
|
+
return (r || i) && (t.created_at = {}, r && (t.created_at.gte = r), i && (t.created_at.lte = i)), Object.keys(t).length ? t : void 0;
|
|
63
|
+
}
|
|
64
|
+
function u(e) {
|
|
65
|
+
let n = {}, r = t(e, "layer_group");
|
|
66
|
+
r && (n.layer_group = r);
|
|
67
|
+
let i = t(e, "layer_type");
|
|
68
|
+
i && (n.layer_type = i);
|
|
69
|
+
let a = t(e, "enabled");
|
|
70
|
+
return (a === "true" || a === "false") && (n.enabled = a === "true"), Object.keys(n).length ? n : void 0;
|
|
71
|
+
}
|
|
72
|
+
function d(e) {}
|
|
73
|
+
var f = "00000000-0000-0000-0000-000000000000";
|
|
74
|
+
function p(e, t, n) {
|
|
75
|
+
if (n.length === 0) {
|
|
76
|
+
e[t] = f;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
e[t] = n.length === 1 ? n[0] : { in: n.join(",") };
|
|
80
|
+
}
|
|
81
|
+
async function m(t) {
|
|
82
|
+
let r = {}, i = !1, a = n(t, "type");
|
|
83
|
+
if (a.length > 0) {
|
|
84
|
+
i = !0;
|
|
85
|
+
let t = a.length === 1 ? { certificate_type: a[0] } : { certificate_type: { in: a.join(",") } }, n = ((await e("certificates", {
|
|
86
|
+
page: 1,
|
|
87
|
+
limit: 5e3,
|
|
88
|
+
filters: t
|
|
89
|
+
})).rows ?? []).map((e) => e.certificate_id).filter(Boolean);
|
|
90
|
+
if (p(r, "certificate_id", n), n.length === 0) return r;
|
|
91
|
+
}
|
|
92
|
+
let o = n(t, "organization");
|
|
93
|
+
return o.length > 0 && (i = !0, p(r, "org_ids", o)), i ? r : void 0;
|
|
94
|
+
}
|
|
95
|
+
function h(e) {
|
|
96
|
+
return Object.values(e).some((e) => e == null || e === "" ? !1 : !Array.isArray(e) || e.some((e) => e != null && String(e).trim() !== ""));
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { d as a, m as c, l as i, r as l, c as n, i as o, u as r, h as s, o as t };
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { o as e, t } from "./resources-Cl_EvaIy.js";
|
|
2
|
+
//#region admin/src/static/registry/map-layers/resource.ts
|
|
3
|
+
var n = "map_layers", r = [{
|
|
4
|
+
id: "base",
|
|
5
|
+
text: "Базовий шар"
|
|
6
|
+
}, {
|
|
7
|
+
id: "overlay",
|
|
8
|
+
text: "Додатковий шар"
|
|
9
|
+
}], i = [
|
|
10
|
+
{
|
|
11
|
+
id: "raster",
|
|
12
|
+
text: "Растрові тайли"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "vector",
|
|
16
|
+
text: "Векторні тайли"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "applications",
|
|
20
|
+
text: "Заявки"
|
|
21
|
+
}
|
|
22
|
+
], a = [
|
|
23
|
+
{
|
|
24
|
+
id: "map",
|
|
25
|
+
text: "Карта"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "application-form",
|
|
29
|
+
text: "Форма окреслення геометрії"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "application-card",
|
|
33
|
+
text: "Картка заявки"
|
|
34
|
+
}
|
|
35
|
+
], o = [{
|
|
36
|
+
id: "xyz",
|
|
37
|
+
text: "XYZ"
|
|
38
|
+
}, {
|
|
39
|
+
id: "tms",
|
|
40
|
+
text: "TMS"
|
|
41
|
+
}];
|
|
42
|
+
function s(e, t) {
|
|
43
|
+
return e.find((e) => e.id === t)?.text ?? (t ? String(t) : "—");
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region admin/src/static/registry/map-layers/form.ts
|
|
47
|
+
var c = [
|
|
48
|
+
"layer_group",
|
|
49
|
+
"==",
|
|
50
|
+
"overlay"
|
|
51
|
+
], l = [c, [
|
|
52
|
+
"layer_type",
|
|
53
|
+
"==",
|
|
54
|
+
"vector"
|
|
55
|
+
]];
|
|
56
|
+
function u(e) {
|
|
57
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
58
|
+
}
|
|
59
|
+
function d(e) {
|
|
60
|
+
return e == null ? "" : String(e).trim();
|
|
61
|
+
}
|
|
62
|
+
function f(e) {
|
|
63
|
+
return d(e) || null;
|
|
64
|
+
}
|
|
65
|
+
function p(e) {
|
|
66
|
+
if (e === "" || e == null) return null;
|
|
67
|
+
let t = Number(e);
|
|
68
|
+
return Number.isFinite(t) ? t : null;
|
|
69
|
+
}
|
|
70
|
+
function m(e) {
|
|
71
|
+
return Array.isArray(e) ? e.map(d).filter(Boolean) : [];
|
|
72
|
+
}
|
|
73
|
+
function h(e) {
|
|
74
|
+
let t = e.layer_group === "base", n = t ? "raster" : d(e.layer_type) || "raster", r = p(e.opacity_percent), i = f(e.legend_color), a = n === "vector" ? {
|
|
75
|
+
fillColor: f(e.fill_color) ?? "#f97316",
|
|
76
|
+
fillOpacity: p(e.fill_opacity) ?? .25,
|
|
77
|
+
lineColor: f(e.line_color) ?? "#ea580c",
|
|
78
|
+
lineWidth: p(e.line_width) ?? 1.5
|
|
79
|
+
} : null;
|
|
80
|
+
return {
|
|
81
|
+
code: d(e.code),
|
|
82
|
+
name: d(e.name),
|
|
83
|
+
layer_group: e.layer_group,
|
|
84
|
+
layer_type: n,
|
|
85
|
+
components: m(e.components),
|
|
86
|
+
tiles: m(e.tiles),
|
|
87
|
+
scheme: d(e.scheme) || "xyz",
|
|
88
|
+
source_layer: n === "raster" ? null : f(e.source_layer),
|
|
89
|
+
attribution: f(e.attribution),
|
|
90
|
+
minzoom: p(e.minzoom),
|
|
91
|
+
maxzoom: p(e.maxzoom),
|
|
92
|
+
opacity: r == null ? 1 : Math.min(Math.max(r, 0), 100) / 100,
|
|
93
|
+
style: a,
|
|
94
|
+
legend: !t && i ? { color: i } : null,
|
|
95
|
+
preview: t ? f(e.preview) : null,
|
|
96
|
+
sort_order: p(e.sort_order) ?? 0,
|
|
97
|
+
is_default: !!e.is_default,
|
|
98
|
+
has_filters: !t && !!e.has_filters,
|
|
99
|
+
enabled: !!e.enabled
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
var g = {
|
|
103
|
+
resource: n,
|
|
104
|
+
emptyValues: () => ({
|
|
105
|
+
name: "",
|
|
106
|
+
code: "",
|
|
107
|
+
layer_group: "overlay",
|
|
108
|
+
layer_type: "raster",
|
|
109
|
+
components: a.map((e) => e.id),
|
|
110
|
+
tiles: [],
|
|
111
|
+
scheme: "xyz",
|
|
112
|
+
source_layer: "",
|
|
113
|
+
attribution: "",
|
|
114
|
+
minzoom: "",
|
|
115
|
+
maxzoom: "",
|
|
116
|
+
opacity_percent: 100,
|
|
117
|
+
legend_color: "",
|
|
118
|
+
fill_color: "#f97316",
|
|
119
|
+
fill_opacity: .25,
|
|
120
|
+
line_color: "#ea580c",
|
|
121
|
+
line_width: 1.5,
|
|
122
|
+
preview: "",
|
|
123
|
+
sort_order: 0,
|
|
124
|
+
is_default: !1,
|
|
125
|
+
has_filters: !1,
|
|
126
|
+
enabled: !0
|
|
127
|
+
}),
|
|
128
|
+
recordToValues: (e) => {
|
|
129
|
+
let t = u(e.style), n = u(e.legend);
|
|
130
|
+
return {
|
|
131
|
+
name: d(e.name),
|
|
132
|
+
code: d(e.code),
|
|
133
|
+
layer_group: e.layer_group ?? "overlay",
|
|
134
|
+
layer_type: e.layer_type ?? "raster",
|
|
135
|
+
components: m(e.components),
|
|
136
|
+
tiles: m(e.tiles),
|
|
137
|
+
scheme: e.scheme ?? "xyz",
|
|
138
|
+
source_layer: d(e.source_layer),
|
|
139
|
+
attribution: d(e.attribution),
|
|
140
|
+
minzoom: e.minzoom ?? "",
|
|
141
|
+
maxzoom: e.maxzoom ?? "",
|
|
142
|
+
opacity_percent: Math.round(Number(e.opacity ?? 1) * 100),
|
|
143
|
+
legend_color: d(n.color),
|
|
144
|
+
fill_color: d(t.fillColor) || "#f97316",
|
|
145
|
+
fill_opacity: t.fillOpacity ?? .25,
|
|
146
|
+
line_color: d(t.lineColor) || "#ea580c",
|
|
147
|
+
line_width: t.lineWidth ?? 1.5,
|
|
148
|
+
preview: d(e.preview),
|
|
149
|
+
sort_order: e.sort_order ?? 0,
|
|
150
|
+
is_default: !!e.is_default,
|
|
151
|
+
has_filters: !!e.has_filters,
|
|
152
|
+
enabled: e.enabled !== !1
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
save: async (r, i) => {
|
|
156
|
+
let a = h(i);
|
|
157
|
+
return r ? e(n, r, a) : t(n, a);
|
|
158
|
+
},
|
|
159
|
+
fields: {
|
|
160
|
+
name: {
|
|
161
|
+
component: "text",
|
|
162
|
+
label: "Назва шару",
|
|
163
|
+
col: 8,
|
|
164
|
+
validators: ["required"]
|
|
165
|
+
},
|
|
166
|
+
code: {
|
|
167
|
+
component: "text",
|
|
168
|
+
label: "Код",
|
|
169
|
+
col: 4,
|
|
170
|
+
validators: ["required"],
|
|
171
|
+
placeholder: "red-lines",
|
|
172
|
+
info: "Латиниця, цифри, «-» та «_». Використовується frontend як ідентифікатор шару"
|
|
173
|
+
},
|
|
174
|
+
layer_group: {
|
|
175
|
+
component: "select",
|
|
176
|
+
label: "Група",
|
|
177
|
+
col: 6,
|
|
178
|
+
validators: ["required"],
|
|
179
|
+
options: r
|
|
180
|
+
},
|
|
181
|
+
layer_type: {
|
|
182
|
+
component: "select",
|
|
183
|
+
label: "Тип джерела",
|
|
184
|
+
col: 6,
|
|
185
|
+
options: i,
|
|
186
|
+
conditions: c,
|
|
187
|
+
info: "Базовий шар завжди растровий"
|
|
188
|
+
},
|
|
189
|
+
components: {
|
|
190
|
+
component: "checkbox",
|
|
191
|
+
label: "Де використовується",
|
|
192
|
+
col: 12,
|
|
193
|
+
options: a
|
|
194
|
+
},
|
|
195
|
+
tiles: {
|
|
196
|
+
component: "array",
|
|
197
|
+
label: "URL тайлів",
|
|
198
|
+
col: 12,
|
|
199
|
+
placeholder: "https://…/{z}/{x}/{y}.png",
|
|
200
|
+
info: "Шаблон з {z}, {x}, {y}. Відносний шлях (/api/…) доповнюється адресою API",
|
|
201
|
+
props: (e) => ({
|
|
202
|
+
isAdded: !0,
|
|
203
|
+
limit: 1,
|
|
204
|
+
count: Math.max(1, m(e.tiles).length)
|
|
205
|
+
})
|
|
206
|
+
},
|
|
207
|
+
scheme: {
|
|
208
|
+
component: "select",
|
|
209
|
+
label: "Схема тайлів",
|
|
210
|
+
col: 4,
|
|
211
|
+
options: o
|
|
212
|
+
},
|
|
213
|
+
minzoom: {
|
|
214
|
+
component: "number",
|
|
215
|
+
label: "Мін. масштаб",
|
|
216
|
+
col: 4
|
|
217
|
+
},
|
|
218
|
+
maxzoom: {
|
|
219
|
+
component: "number",
|
|
220
|
+
label: "Макс. масштаб",
|
|
221
|
+
col: 4
|
|
222
|
+
},
|
|
223
|
+
source_layer: {
|
|
224
|
+
component: "text",
|
|
225
|
+
label: "Шар у векторних тайлах (source-layer)",
|
|
226
|
+
col: 6,
|
|
227
|
+
conditions: [c, [
|
|
228
|
+
"layer_type",
|
|
229
|
+
"!=",
|
|
230
|
+
"raster"
|
|
231
|
+
]]
|
|
232
|
+
},
|
|
233
|
+
attribution: {
|
|
234
|
+
component: "text",
|
|
235
|
+
label: "Атрибуція",
|
|
236
|
+
col: 6,
|
|
237
|
+
placeholder: "© OpenStreetMap"
|
|
238
|
+
},
|
|
239
|
+
opacity_percent: {
|
|
240
|
+
component: "number",
|
|
241
|
+
label: "Непрозорість, %",
|
|
242
|
+
col: 4,
|
|
243
|
+
conditions: c
|
|
244
|
+
},
|
|
245
|
+
legend_color: {
|
|
246
|
+
component: "color",
|
|
247
|
+
label: "Колір легенди",
|
|
248
|
+
col: 4,
|
|
249
|
+
conditions: c
|
|
250
|
+
},
|
|
251
|
+
fill_color: {
|
|
252
|
+
component: "color",
|
|
253
|
+
label: "Колір заливки",
|
|
254
|
+
col: 3,
|
|
255
|
+
conditions: l
|
|
256
|
+
},
|
|
257
|
+
fill_opacity: {
|
|
258
|
+
component: "number",
|
|
259
|
+
label: "Непрозорість заливки (0–1)",
|
|
260
|
+
col: 3,
|
|
261
|
+
conditions: l
|
|
262
|
+
},
|
|
263
|
+
line_color: {
|
|
264
|
+
component: "color",
|
|
265
|
+
label: "Колір лінії",
|
|
266
|
+
col: 3,
|
|
267
|
+
conditions: l
|
|
268
|
+
},
|
|
269
|
+
line_width: {
|
|
270
|
+
component: "number",
|
|
271
|
+
label: "Товщина лінії, px",
|
|
272
|
+
col: 3,
|
|
273
|
+
conditions: l
|
|
274
|
+
},
|
|
275
|
+
preview: {
|
|
276
|
+
component: "text",
|
|
277
|
+
label: "URL прев'ю",
|
|
278
|
+
col: 12,
|
|
279
|
+
conditions: [
|
|
280
|
+
"layer_group",
|
|
281
|
+
"==",
|
|
282
|
+
"base"
|
|
283
|
+
],
|
|
284
|
+
info: "Якщо порожньо, прев'ю береться з першого URL тайлів"
|
|
285
|
+
},
|
|
286
|
+
sort_order: {
|
|
287
|
+
component: "number",
|
|
288
|
+
label: "Порядок",
|
|
289
|
+
col: 4,
|
|
290
|
+
info: "Менше значення — вище у списку і поверх на карті"
|
|
291
|
+
},
|
|
292
|
+
is_default: {
|
|
293
|
+
component: "switcher",
|
|
294
|
+
label: "За замовчуванням",
|
|
295
|
+
col: 4,
|
|
296
|
+
view: "checkbox",
|
|
297
|
+
info: "Для базового шару — активна підложка (лише одна), для додаткового — увімкнений при відкритті"
|
|
298
|
+
},
|
|
299
|
+
has_filters: {
|
|
300
|
+
component: "switcher",
|
|
301
|
+
label: "Має фільтри",
|
|
302
|
+
col: 4,
|
|
303
|
+
view: "checkbox",
|
|
304
|
+
conditions: c
|
|
305
|
+
},
|
|
306
|
+
enabled: {
|
|
307
|
+
component: "switcher",
|
|
308
|
+
label: "Увімкнено",
|
|
309
|
+
col: 4,
|
|
310
|
+
view: "checkbox"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
//#endregion
|
|
315
|
+
export { o as a, i, a as n, s as o, r, n as s, g as t };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { o as e, t } from "./resources-Cl_EvaIy.js";
|
|
2
|
+
//#region admin/src/static/registry/organizations/resource.ts
|
|
3
|
+
var n = "organizations";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region admin/src/static/registry/organizations/form.ts
|
|
6
|
+
function r(e) {
|
|
7
|
+
if (typeof e != "string") return null;
|
|
8
|
+
let t = e.trim();
|
|
9
|
+
if (!t) return null;
|
|
10
|
+
if (!t.startsWith("/api/file/")) return t;
|
|
11
|
+
let n = decodeURIComponent(t.slice(10).split(/[?#]/)[0] ?? "").split(".")[0];
|
|
12
|
+
if (!n) return null;
|
|
13
|
+
try {
|
|
14
|
+
let e = n.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - n.length % 4) % 4), t = new TextDecoder().decode(Uint8Array.from(atob(e), (e) => e.charCodeAt(0)));
|
|
15
|
+
return t.includes("/") ? t : null;
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function i(e, t) {
|
|
21
|
+
let n = {
|
|
22
|
+
...e,
|
|
23
|
+
verified: !!e.verified
|
|
24
|
+
};
|
|
25
|
+
return t?.includeScanPath === !1 ? delete n.scan_path : n.scan_path = r(e.scan_path), n;
|
|
26
|
+
}
|
|
27
|
+
var a = {
|
|
28
|
+
resource: n,
|
|
29
|
+
emptyValues: () => ({
|
|
30
|
+
name: "",
|
|
31
|
+
verified: !1,
|
|
32
|
+
legal_address: "",
|
|
33
|
+
phone: "",
|
|
34
|
+
email: "",
|
|
35
|
+
scan_path: ""
|
|
36
|
+
}),
|
|
37
|
+
recordToValues: (e) => ({
|
|
38
|
+
name: String(e.name ?? ""),
|
|
39
|
+
verified: !!e.verified,
|
|
40
|
+
legal_address: String(e.legal_address ?? ""),
|
|
41
|
+
phone: String(e.phone ?? ""),
|
|
42
|
+
email: String(e.email ?? ""),
|
|
43
|
+
scan_path: e.scan_path ?? ""
|
|
44
|
+
}),
|
|
45
|
+
save: async (a, o, s) => {
|
|
46
|
+
if (a) {
|
|
47
|
+
let t = r(o.scan_path) === r(s?.scan_path);
|
|
48
|
+
return e(n, a, i(o, { includeScanPath: !t }));
|
|
49
|
+
}
|
|
50
|
+
return t(n, i(o));
|
|
51
|
+
},
|
|
52
|
+
fields: {
|
|
53
|
+
name: {
|
|
54
|
+
component: "text",
|
|
55
|
+
label: "Назва організації",
|
|
56
|
+
col: 12,
|
|
57
|
+
validators: ["required"]
|
|
58
|
+
},
|
|
59
|
+
verified: {
|
|
60
|
+
component: "switcher",
|
|
61
|
+
label: "Верифіковано",
|
|
62
|
+
col: 12,
|
|
63
|
+
view: "checkbox",
|
|
64
|
+
info: "При натисканні «Так» дані позначаються як верифіковані"
|
|
65
|
+
},
|
|
66
|
+
legal_address: {
|
|
67
|
+
component: "text",
|
|
68
|
+
label: "Юридична адреса",
|
|
69
|
+
col: 12
|
|
70
|
+
},
|
|
71
|
+
phone: {
|
|
72
|
+
component: "text",
|
|
73
|
+
label: "Телефон організації",
|
|
74
|
+
col: 12
|
|
75
|
+
},
|
|
76
|
+
email: {
|
|
77
|
+
component: "email",
|
|
78
|
+
label: "Email організації",
|
|
79
|
+
col: 12
|
|
80
|
+
},
|
|
81
|
+
scan_path: {
|
|
82
|
+
component: "file",
|
|
83
|
+
label: "Скан копія",
|
|
84
|
+
col: 12
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { n, a as t };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region shared/map/lib/geometry.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = s(typeof e == "string" ? o(e) : e);
|
|
4
|
+
if (!t || typeof t != "object") return null;
|
|
5
|
+
let { type: n, coordinates: r } = t;
|
|
6
|
+
if (n === "Polygon") {
|
|
7
|
+
let e = a(r);
|
|
8
|
+
return e ? {
|
|
9
|
+
type: n,
|
|
10
|
+
coordinates: e
|
|
11
|
+
} : null;
|
|
12
|
+
}
|
|
13
|
+
if (n === "MultiPolygon" && Array.isArray(r)) {
|
|
14
|
+
let e = r.map(a).filter((e) => e !== null);
|
|
15
|
+
return e.length ? {
|
|
16
|
+
type: n,
|
|
17
|
+
coordinates: e
|
|
18
|
+
} : null;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function t(t) {
|
|
23
|
+
return e(t) !== null;
|
|
24
|
+
}
|
|
25
|
+
function n(e) {
|
|
26
|
+
let t = e.type === "Polygon" ? [e.coordinates] : e.coordinates, n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
27
|
+
for (let [e] of t) for (let [t, o] of e) n = Math.min(n, t), r = Math.min(r, o), i = Math.max(i, t), a = Math.max(a, o);
|
|
28
|
+
return [[n, r], [i, a]];
|
|
29
|
+
}
|
|
30
|
+
function r([[e, t], [n, r]]) {
|
|
31
|
+
return [(e + n) / 2, (t + r) / 2];
|
|
32
|
+
}
|
|
33
|
+
function i(e) {
|
|
34
|
+
if (!Array.isArray(e)) return null;
|
|
35
|
+
let t = [];
|
|
36
|
+
for (let n of e) {
|
|
37
|
+
if (!Array.isArray(n) || n.length < 2) continue;
|
|
38
|
+
let e = Number(n[0]), r = Number(n[1]);
|
|
39
|
+
Number.isFinite(e) && Number.isFinite(r) && t.push([e, r]);
|
|
40
|
+
}
|
|
41
|
+
if (t.length > 1) {
|
|
42
|
+
let [e, n] = t[0], [r, i] = t[t.length - 1];
|
|
43
|
+
(e !== r || n !== i) && t.push([e, n]);
|
|
44
|
+
}
|
|
45
|
+
return t.length >= 4 ? t : null;
|
|
46
|
+
}
|
|
47
|
+
function a(e) {
|
|
48
|
+
if (!Array.isArray(e)) return null;
|
|
49
|
+
let [t, ...n] = e.map(i);
|
|
50
|
+
return t ? [t, ...n.filter((e) => e !== null)] : null;
|
|
51
|
+
}
|
|
52
|
+
function o(e) {
|
|
53
|
+
let t = e.trim();
|
|
54
|
+
if (!t.startsWith("{") && !t.startsWith("[")) return null;
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(t);
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function s(e) {
|
|
62
|
+
if (!e || typeof e != "object") return e;
|
|
63
|
+
let t = e;
|
|
64
|
+
return t.type === "Feature" && t.geometry ? s(t.geometry) : t.type === "FeatureCollection" && Array.isArray(t.features) && t.features.length ? s(t.features[0]) : !t.type && t.geometry && typeof t.geometry == "object" ? s(t.geometry) : e;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { e as i, n, t as r, r as t };
|