@ogc-maps/storybook-components 0.9.0 → 0.10.0

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 (61) hide show
  1. package/dist/{CollapsibleControl-CGRNPpCw.js → CollapsibleControl-qo9daiD8.js} +5 -5
  2. package/dist/ExportButton-BsNrOvRE.js +25 -0
  3. package/dist/Legend-BLWBzD7Y.js +275 -0
  4. package/dist/SearchPanel-4Y12jfuP.js +401 -0
  5. package/dist/components/CollapsibleControl/index.js +1 -1
  6. package/dist/components/ExportButton/ExportButton.d.ts +2 -8
  7. package/dist/components/ExportButton/ExportButton.d.ts.map +1 -1
  8. package/dist/components/ExportButton/index.d.ts +1 -1
  9. package/dist/components/ExportButton/index.d.ts.map +1 -1
  10. package/dist/components/ExportButton/index.js +1 -1
  11. package/dist/components/ExportModal/ExportModal.d.ts +29 -0
  12. package/dist/components/ExportModal/ExportModal.d.ts.map +1 -0
  13. package/dist/components/ExportModal/index.d.ts +3 -0
  14. package/dist/components/ExportModal/index.d.ts.map +1 -0
  15. package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
  16. package/dist/components/Legend/Legend.d.ts.map +1 -1
  17. package/dist/components/Legend/index.js +1 -1
  18. package/dist/components/MeasurePanel/MeasurePanel.d.ts +13 -0
  19. package/dist/components/MeasurePanel/MeasurePanel.d.ts.map +1 -0
  20. package/dist/components/MeasurePanel/index.d.ts +3 -0
  21. package/dist/components/MeasurePanel/index.d.ts.map +1 -0
  22. package/dist/components/SearchFieldEditor/SearchFieldEditor.d.ts.map +1 -1
  23. package/dist/components/SearchPanel/NumberInput.d.ts.map +1 -1
  24. package/dist/components/SearchPanel/SearchPanel.d.ts +2 -1
  25. package/dist/components/SearchPanel/SearchPanel.d.ts.map +1 -1
  26. package/dist/components/SearchPanel/index.js +1 -1
  27. package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts.map +1 -1
  28. package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
  29. package/dist/components/index.d.ts +5 -1
  30. package/dist/components/index.d.ts.map +1 -1
  31. package/dist/geo-CIJBPCVe.js +1038 -0
  32. package/dist/hooks/index.d.ts +5 -0
  33. package/dist/hooks/index.d.ts.map +1 -1
  34. package/dist/hooks/index.js +40 -35
  35. package/dist/hooks/useExport.d.ts +22 -0
  36. package/dist/hooks/useExport.d.ts.map +1 -0
  37. package/dist/hooks/useMeasure.d.ts +15 -0
  38. package/dist/hooks/useMeasure.d.ts.map +1 -0
  39. package/dist/{index-UmK2u6Yd.js → index-DA_GGs_P.js} +296 -291
  40. package/dist/main.js +1370 -1031
  41. package/dist/schemas/config.d.ts +131 -0
  42. package/dist/schemas/config.d.ts.map +1 -1
  43. package/dist/schemas/index.js +1 -1
  44. package/dist/style.css +1 -1
  45. package/dist/types/index.js +1 -1
  46. package/dist/utils/cql2.d.ts.map +1 -1
  47. package/dist/utils/csvExport.d.ts.map +1 -1
  48. package/dist/utils/download.d.ts +2 -0
  49. package/dist/utils/download.d.ts.map +1 -0
  50. package/dist/utils/expressionColors.d.ts.map +1 -1
  51. package/dist/utils/geo.d.ts +3 -0
  52. package/dist/utils/geo.d.ts.map +1 -0
  53. package/dist/utils/index.d.ts +1 -0
  54. package/dist/utils/index.d.ts.map +1 -1
  55. package/dist/utils/measure.d.ts +49 -0
  56. package/dist/utils/measure.d.ts.map +1 -0
  57. package/package.json +6 -3
  58. package/dist/ExportButton-CLsWoW4m.js +0 -77
  59. package/dist/Legend-CwaZA84A.js +0 -273
  60. package/dist/SearchPanel-DtLXMoVs.js +0 -363
  61. package/dist/cql2-DOJnQwcv.js +0 -440
package/dist/main.js CHANGED
@@ -1,21 +1,230 @@
1
- import { B as rt } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
- import { C as nt } from "./CollapsibleControl-CGRNPpCw.js";
3
- import { C as pt, f as ut, a as mt } from "./CoordinateDisplay-PxPmVjpm.js";
4
- import { E as ct } from "./ExportButton-CLsWoW4m.js";
5
- import { F as ht } from "./FeatureDetailPanel-CkFpdEKW.js";
6
- import { F as bt } from "./FeatureTooltip-Db1LgLQV.js";
7
- import { L as ft } from "./LayerPanel-SCdJ8948.js";
8
- import { L as wt } from "./Legend-CwaZA84A.js";
9
- import { S as Nt } from "./SearchPanel-DtLXMoVs.js";
10
- import { jsxs as l, jsx as a, Fragment as q } from "react/jsx-runtime";
11
- import { useId as Ie, useState as A, useRef as ue, useMemo as Ee, useCallback as We, useEffect as X } from "react";
12
- import { LuInfo as ze } from "react-icons/lu";
13
- import { J as Fe, j as Pe, i as se, L as Ve, g as _e } from "./cql2-DOJnQwcv.js";
14
- import { a as Ct, b as St, M as Dt, e as Tt, N as Lt, f as At, c as It, d as Et, h as Ft, O as Pt, P as Mt, k as Ot, l as jt, m as $t, n as Rt, o as Bt, p as qt, q as Ut, r as Gt, s as Wt, t as zt, u as Vt, v as _t, w as Yt, x as Xt, y as Ht, z as Jt, A as Kt, Q as Qt, B as Zt, C as ei, D as ai, E as ti, F as ii, G as ri, H as li, I as ni, K as oi } from "./cql2-DOJnQwcv.js";
15
- import { s as Ye } from "./index-UmK2u6Yd.js";
16
- import { B as ui, C as mi, a as si, b as ci, D as di, F as hi, c as gi, d as bi, e as yi, G as fi, L as xi, f as wi, g as vi, h as Ni, i as ki, j as Ci, M as Si, N as Di, O as Ti, P as Li, k as Ai, S as Ii, l as Ei, m as Fi, n as Pi, o as Mi, p as Oi, q as ji, r as $i, T as Ri, U as Bi, V as qi, v as Ui } from "./index-UmK2u6Yd.js";
17
- import './style.css';function Xe({ text: e, id: t }) {
18
- const i = Ie(), r = t ?? i;
1
+ import { B as Nt } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
+ import { C as kt } from "./CollapsibleControl-qo9daiD8.js";
3
+ import { C as St, f as Tt, a as Dt } from "./CoordinateDisplay-PxPmVjpm.js";
4
+ import { E as At } from "./ExportButton-BsNrOvRE.js";
5
+ import { jsx as a, jsxs as l, Fragment as U } from "react/jsx-runtime";
6
+ import { useState as S, useEffect as V, useId as Re, useRef as ie, useMemo as Be, useCallback as Je } from "react";
7
+ import { F as It } from "./FeatureDetailPanel-CkFpdEKW.js";
8
+ import { F as Mt } from "./FeatureTooltip-Db1LgLQV.js";
9
+ import { L as Ot } from "./LayerPanel-SCdJ8948.js";
10
+ import { L as $t } from "./Legend-BLWBzD7Y.js";
11
+ import { LuRuler as Ke, LuPentagon as Qe, LuTrash2 as Ze, LuInfo as ea } from "react-icons/lu";
12
+ import { U as aa, R as ta, S as fe, O as Ue, m as qe, l as be, Q as ia, j as ra } from "./geo-CIJBPCVe.js";
13
+ import { a as Bt, b as Ut, c as qt, T as zt, V as Gt, W as Wt, X as Vt, Y as _t, Z as Yt, d as Xt, _ as Ht, e as Jt, f as Kt, g as Qt, h as Zt, i as ei, k as ai, $ as ti, a0 as ii, n as ri, o as li, p as ni, q as pi, r as oi, s as ui, t as mi, u as si, v as ci, w as di, x as hi, y as gi, z as bi, A as yi, B as fi, C as xi, D as wi, a1 as Ni, E as vi, F as ki, G as Ci, H as Si, I as Ti, J as Di, K as Li, L as Ai, M as Ei, N as Ii, P as Fi } from "./geo-CIJBPCVe.js";
14
+ import { S as Pi } from "./SearchPanel-4Y12jfuP.js";
15
+ import { s as la } from "./index-DA_GGs_P.js";
16
+ import { B as ji, C as $i, a as Ri, b as Bi, D as Ui, F as qi, c as zi, d as Gi, e as Wi, G as Vi, L as _i, f as Yi, g as Xi, h as Hi, i as Ji, j as Ki, M as Qi, N as Zi, O as er, P as ar, k as tr, S as ir, l as rr, m as lr, n as nr, o as pr, p as or, q as ur, r as mr, T as sr, U as cr, V as dr, v as hr } from "./index-DA_GGs_P.js";
17
+ import './style.css';function nt({
18
+ open: e,
19
+ layers: t,
20
+ availableFormats: i,
21
+ hasActiveFilter: r,
22
+ loading: n = !1,
23
+ progress: o,
24
+ error: p,
25
+ onExport: x,
26
+ onClose: s
27
+ }) {
28
+ const [g, y] = S(""), [w, c] = S(""), [u, d] = S(!0);
29
+ if (V(() => {
30
+ e && (y(t.length === 1 ? t[0].id : ""), c(i.length > 0 ? i[0].id : ""), d(!0));
31
+ }, [e, t, i]), !e) return null;
32
+ const N = t.find((m) => m.id === g), v = i.find((m) => m.id === w), T = N != null && r(N.id), E = N != null && v != null && !n, j = () => {
33
+ !N || !v || x({
34
+ layer: N,
35
+ format: v,
36
+ filtered: T ? u : !1
37
+ });
38
+ };
39
+ return /* @__PURE__ */ a(
40
+ "div",
41
+ {
42
+ className: "mapui:fixed mapui:inset-0 mapui:z-50 mapui:flex mapui:items-center mapui:justify-center mapui:bg-black/50",
43
+ role: "dialog",
44
+ "aria-modal": "true",
45
+ "aria-labelledby": "export-modal-title",
46
+ children: /* @__PURE__ */ l("div", { className: "mapui:w-full mapui:max-w-md mapui:rounded-lg mapui:bg-white mapui:p-6 mapui:shadow-xl", children: [
47
+ /* @__PURE__ */ a(
48
+ "h2",
49
+ {
50
+ id: "export-modal-title",
51
+ className: "mapui:m-0 mapui:mb-4 mapui:text-base mapui:font-semibold mapui:text-gray-900",
52
+ children: "Export Data"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ l("div", { className: "mapui:mb-4", children: [
56
+ /* @__PURE__ */ a(
57
+ "label",
58
+ {
59
+ htmlFor: "export-layer-select",
60
+ className: "mapui:mb-1 mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-700",
61
+ children: "Layer"
62
+ }
63
+ ),
64
+ t.length === 1 ? /* @__PURE__ */ a("div", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-700", children: t[0].label }) : /* @__PURE__ */ l(
65
+ "select",
66
+ {
67
+ id: "export-layer-select",
68
+ value: g,
69
+ onChange: (m) => y(m.target.value),
70
+ className: "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-700",
71
+ children: [
72
+ /* @__PURE__ */ a("option", { value: "", disabled: !0, children: "Select a layer..." }),
73
+ t.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.label }, m.id))
74
+ ]
75
+ }
76
+ )
77
+ ] }),
78
+ /* @__PURE__ */ l("fieldset", { className: "mapui:mb-4", children: [
79
+ /* @__PURE__ */ a("legend", { className: "mapui:mb-1 mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Format" }),
80
+ /* @__PURE__ */ a("div", { className: "mapui:space-y-1", children: i.map((m) => /* @__PURE__ */ l(
81
+ "label",
82
+ {
83
+ className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2 mapui:rounded mapui:px-2 mapui:py-1.5 hover:mapui:bg-gray-50",
84
+ children: [
85
+ /* @__PURE__ */ a(
86
+ "input",
87
+ {
88
+ type: "radio",
89
+ name: "export-format",
90
+ value: m.id,
91
+ checked: w === m.id,
92
+ onChange: () => c(m.id),
93
+ className: "mapui:accent-blue-600"
94
+ }
95
+ ),
96
+ /* @__PURE__ */ l("span", { className: "mapui:text-sm mapui:text-gray-700", children: [
97
+ m.label,
98
+ m.description && /* @__PURE__ */ l("span", { className: "mapui:ml-1 mapui:text-gray-400", children: [
99
+ "— ",
100
+ m.description
101
+ ] })
102
+ ] })
103
+ ]
104
+ },
105
+ m.id
106
+ )) })
107
+ ] }),
108
+ T && /* @__PURE__ */ l("label", { className: "mapui:mb-4 mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2", children: [
109
+ /* @__PURE__ */ a(
110
+ "input",
111
+ {
112
+ type: "checkbox",
113
+ checked: u,
114
+ onChange: (m) => d(m.target.checked),
115
+ className: "mapui:accent-blue-600"
116
+ }
117
+ ),
118
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: "Apply current filters" })
119
+ ] }),
120
+ n && o && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-blue-600", children: o }),
121
+ p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-red-600", children: p }),
122
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:justify-end mapui:gap-2", children: [
123
+ /* @__PURE__ */ a(
124
+ "button",
125
+ {
126
+ type: "button",
127
+ onClick: s,
128
+ disabled: n,
129
+ className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-50",
130
+ children: "Cancel"
131
+ }
132
+ ),
133
+ /* @__PURE__ */ a(
134
+ "button",
135
+ {
136
+ type: "button",
137
+ onClick: j,
138
+ disabled: !E,
139
+ className: [
140
+ "mapui:rounded mapui:border mapui:border-transparent mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-white",
141
+ E ? "mapui:cursor-pointer mapui:bg-blue-600 hover:mapui:bg-blue-700" : "mapui:cursor-not-allowed mapui:bg-blue-400"
142
+ ].join(" "),
143
+ children: n ? "Exporting..." : "Export"
144
+ }
145
+ )
146
+ ] })
147
+ ] })
148
+ }
149
+ );
150
+ }
151
+ const na = [
152
+ { mode: "distance", icon: Ke, label: "Distance" },
153
+ { mode: "area", icon: Qe, label: "Area" }
154
+ ];
155
+ function pa(e, t) {
156
+ return e ? t === 0 ? "Click on the map to start measuring" : e === "distance" ? "Click to add points, double-click to finish" : t < 3 ? "Click to add points (min 3 for area)" : "Click to add points, double-click to close" : "Select a measurement mode";
157
+ }
158
+ function pt({
159
+ mode: e,
160
+ onModeChange: t,
161
+ points: i,
162
+ measurement: r,
163
+ unit: n,
164
+ onUnitChange: o,
165
+ onClear: p,
166
+ className: x
167
+ }) {
168
+ const s = e ? aa[e] : [];
169
+ return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${x ?? ""}`, children: [
170
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: na.map(({ mode: g, icon: y, label: w }) => {
171
+ const c = e === g;
172
+ return /* @__PURE__ */ l(
173
+ "button",
174
+ {
175
+ type: "button",
176
+ onClick: () => t(c ? null : g),
177
+ "aria-label": w,
178
+ "aria-pressed": c,
179
+ className: [
180
+ "mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:transition-colors",
181
+ c ? "mapui:bg-blue-600 mapui:text-white" : "mapui:bg-gray-100 mapui:text-gray-700 hover:mapui:bg-gray-200"
182
+ ].join(" "),
183
+ children: [
184
+ /* @__PURE__ */ a(y, { size: 16 }),
185
+ w
186
+ ]
187
+ },
188
+ g
189
+ );
190
+ }) }),
191
+ e && /* @__PURE__ */ l(U, { children: [
192
+ /* @__PURE__ */ a("div", { className: "mapui:text-center", children: /* @__PURE__ */ a("div", { className: "mapui:text-2xl mapui:font-semibold mapui:text-gray-900", children: r ? ta(r) : "—" }) }),
193
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: s.map((g) => {
194
+ const y = n === g;
195
+ return /* @__PURE__ */ a(
196
+ "button",
197
+ {
198
+ type: "button",
199
+ onClick: () => o(g),
200
+ "aria-label": `Unit: ${fe[g]}`,
201
+ className: [
202
+ "mapui:flex-1 mapui:rounded mapui:px-2 mapui:py-1 mapui:text-xs mapui:font-medium mapui:transition-colors",
203
+ y ? "mapui:bg-blue-100 mapui:text-blue-700" : "mapui:bg-gray-50 mapui:text-gray-500 hover:mapui:bg-gray-100"
204
+ ].join(" "),
205
+ children: fe[g]
206
+ },
207
+ g
208
+ );
209
+ }) }),
210
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children: pa(e, i.length) }),
211
+ i.length > 0 && /* @__PURE__ */ l(
212
+ "button",
213
+ {
214
+ type: "button",
215
+ onClick: p,
216
+ className: "mapui:flex mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
217
+ children: [
218
+ /* @__PURE__ */ a(Ze, { size: 14 }),
219
+ "Clear"
220
+ ]
221
+ }
222
+ )
223
+ ] })
224
+ ] });
225
+ }
226
+ function oa({ text: e, id: t }) {
227
+ const i = Re(), r = t ?? i;
19
228
  return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
20
229
  /* @__PURE__ */ a(
21
230
  "span",
@@ -24,7 +233,7 @@ import './style.css';function Xe({ text: e, id: t }) {
24
233
  "aria-label": "Info",
25
234
  "aria-describedby": r,
26
235
  className: "mapui:inline-flex mapui:items-center mapui:text-gray-400 mapui:cursor-default hover:mapui:text-gray-600 focus:mapui:text-gray-600 focus:mapui:outline-none",
27
- children: /* @__PURE__ */ a(ze, { className: "mapui:h-3.5 mapui:w-3.5" })
236
+ children: /* @__PURE__ */ a(ea, { className: "mapui:h-3.5 mapui:w-3.5" })
28
237
  }
29
238
  ),
30
239
  /* @__PURE__ */ l(
@@ -41,20 +250,20 @@ import './style.css';function Xe({ text: e, id: t }) {
41
250
  )
42
251
  ] });
43
252
  }
44
- function D({ label: e, error: t, required: i, description: r, htmlFor: n, children: p }) {
253
+ function C({ label: e, error: t, required: i, description: r, htmlFor: n, children: o }) {
45
254
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
46
255
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
47
256
  /* @__PURE__ */ l("label", { htmlFor: n, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
48
257
  e,
49
258
  i && /* @__PURE__ */ a("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
50
259
  ] }),
51
- r && /* @__PURE__ */ a(Xe, { text: r })
260
+ r && /* @__PURE__ */ a(oa, { text: r })
52
261
  ] }),
53
- p,
262
+ o,
54
263
  t && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: t })
55
264
  ] });
56
265
  }
57
- function Y({ value: e, onChange: t, label: i }) {
266
+ function H({ value: e, onChange: t, label: i }) {
58
267
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
59
268
  /* @__PURE__ */ a(
60
269
  "input",
@@ -69,7 +278,7 @@ function Y({ value: e, onChange: t, label: i }) {
69
278
  /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-600", children: e })
70
279
  ] });
71
280
  }
72
- function Z({
281
+ function re({
73
282
  open: e,
74
283
  title: t,
75
284
  description: i,
@@ -125,19 +334,19 @@ function Z({
125
334
  }
126
335
  ) : null;
127
336
  }
128
- function _({
337
+ function X({
129
338
  title: e,
130
339
  children: t,
131
340
  defaultOpen: i = !1,
132
341
  badge: r
133
342
  }) {
134
- const [n, p] = A(i);
343
+ const [n, o] = S(i);
135
344
  return /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-200", children: [
136
345
  /* @__PURE__ */ l(
137
346
  "button",
138
347
  {
139
348
  type: "button",
140
- onClick: () => p((o) => !o),
349
+ onClick: () => o((p) => !p),
141
350
  className: "mapui:flex mapui:w-full mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:rounded mapui:border-none mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-100",
142
351
  children: [
143
352
  /* @__PURE__ */ l("span", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
@@ -151,36 +360,36 @@ function _({
151
360
  n && /* @__PURE__ */ a("div", { className: "mapui:p-3", children: t })
152
361
  ] });
153
362
  }
154
- const H = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
155
- function ce({
363
+ const Z = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
364
+ function xe({
156
365
  value: e,
157
366
  onChange: t,
158
367
  onTestConnection: i,
159
368
  testStatus: r = "idle",
160
369
  testError: n
161
370
  }) {
162
- const p = (o) => t({ ...e, ...o });
371
+ const o = (p) => t({ ...e, ...p });
163
372
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
164
- /* @__PURE__ */ a(D, { label: "ID", required: !0, children: /* @__PURE__ */ a(
373
+ /* @__PURE__ */ a(C, { label: "ID", required: !0, children: /* @__PURE__ */ a(
165
374
  "input",
166
375
  {
167
376
  type: "text",
168
377
  value: e.id,
169
- onChange: (o) => p({ id: o.target.value }),
378
+ onChange: (p) => o({ id: p.target.value }),
170
379
  placeholder: "my-source",
171
- className: H
380
+ className: Z
172
381
  }
173
382
  ) }),
174
- /* @__PURE__ */ l(D, { label: "URL", required: !0, children: [
383
+ /* @__PURE__ */ l(C, { label: "URL", required: !0, children: [
175
384
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
176
385
  /* @__PURE__ */ a(
177
386
  "input",
178
387
  {
179
388
  type: "url",
180
389
  value: e.url,
181
- onChange: (o) => p({ url: o.target.value }),
390
+ onChange: (p) => o({ url: p.target.value }),
182
391
  placeholder: "https://example.com/ogcapi",
183
- className: `${H} mapui:flex-1`
392
+ className: `${Z} mapui:flex-1`
184
393
  }
185
394
  ),
186
395
  i && /* @__PURE__ */ a(
@@ -197,49 +406,49 @@ function ce({
197
406
  r === "success" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-green-600", children: "Connection successful" }),
198
407
  r === "error" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-600", children: n ?? "Connection failed" })
199
408
  ] }),
200
- /* @__PURE__ */ a(D, { label: "Label", children: /* @__PURE__ */ a(
409
+ /* @__PURE__ */ a(C, { label: "Label", children: /* @__PURE__ */ a(
201
410
  "input",
202
411
  {
203
412
  type: "text",
204
413
  value: e.label ?? "",
205
- onChange: (o) => p({ label: o.target.value || void 0 }),
414
+ onChange: (p) => o({ label: p.target.value || void 0 }),
206
415
  placeholder: "My OGC API Source",
207
- className: H
416
+ className: Z
208
417
  }
209
418
  ) }),
210
- /* @__PURE__ */ a(D, { label: "Tile Matrix Set ID", children: /* @__PURE__ */ a(
419
+ /* @__PURE__ */ a(C, { label: "Tile Matrix Set ID", children: /* @__PURE__ */ a(
211
420
  "input",
212
421
  {
213
422
  type: "text",
214
423
  value: e.tileMatrixSetId ?? "WebMercatorQuad",
215
- onChange: (o) => p({ tileMatrixSetId: o.target.value || void 0 }),
424
+ onChange: (p) => o({ tileMatrixSetId: p.target.value || void 0 }),
216
425
  placeholder: "WebMercatorQuad",
217
- className: H
426
+ className: Z
218
427
  }
219
428
  ) })
220
429
  ] });
221
430
  }
222
- const ee = () => ({
431
+ const le = () => ({
223
432
  id: "",
224
433
  url: "",
225
434
  label: void 0,
226
435
  tileMatrixSetId: "WebMercatorQuad"
227
436
  });
228
- function Va({ sources: e, onChange: t }) {
229
- const [i, r] = A(null), [n, p] = A(null), [o, b] = A(!1), [m, w] = A(ee()), [d, f] = A({}), [c, u] = A({}), [s, v] = A(null), N = async (C, L) => {
230
- f((E) => ({ ...E, [C]: "loading" }));
437
+ function ot({ sources: e, onChange: t }) {
438
+ const [i, r] = S(null), [n, o] = S(null), [p, x] = S(!1), [s, g] = S(le()), [y, w] = S({}), [c, u] = S({}), [d, N] = S(null), v = async (m, I) => {
439
+ w((M) => ({ ...M, [m]: "loading" }));
231
440
  try {
232
- const E = await fetch(`${L}/conformance`);
233
- E.ok ? f((y) => ({ ...y, [C]: "success" })) : (f((y) => ({ ...y, [C]: "error" })), u((y) => ({ ...y, [C]: `HTTP ${E.status}` })));
234
- } catch (E) {
235
- f((y) => ({ ...y, [C]: "error" })), u((y) => ({ ...y, [C]: E instanceof Error ? E.message : "Network error" }));
441
+ const M = await fetch(`${I}/conformance`);
442
+ M.ok ? w((h) => ({ ...h, [m]: "success" })) : (w((h) => ({ ...h, [m]: "error" })), u((h) => ({ ...h, [m]: `HTTP ${M.status}` })));
443
+ } catch (M) {
444
+ w((h) => ({ ...h, [m]: "error" })), u((h) => ({ ...h, [m]: M instanceof Error ? M.message : "Network error" }));
236
445
  }
237
- }, S = () => {
238
- n && (t(e.map((C) => C.id === i ? n : C)), r(null), p(null));
239
- }, x = () => {
240
- t([...e, m]), b(!1), w(ee());
241
- }, P = (C) => {
242
- t(e.filter((L) => L.id !== C)), v(null);
446
+ }, T = () => {
447
+ n && (t(e.map((m) => m.id === i ? n : m)), r(null), o(null));
448
+ }, E = () => {
449
+ t([...e, s]), x(!1), g(le());
450
+ }, j = (m) => {
451
+ t(e.filter((I) => I.id !== m)), N(null);
243
452
  };
244
453
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
245
454
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -249,27 +458,27 @@ function Va({ sources: e, onChange: t }) {
249
458
  {
250
459
  type: "button",
251
460
  onClick: () => {
252
- b(!0), w(ee());
461
+ x(!0), g(le());
253
462
  },
254
463
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
255
464
  children: "+ Add Source"
256
465
  }
257
466
  )
258
467
  ] }),
259
- e.length === 0 && !o && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
260
- /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((C) => /* @__PURE__ */ a(
468
+ e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
469
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((m) => /* @__PURE__ */ a(
261
470
  "li",
262
471
  {
263
472
  className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white mapui:p-3",
264
- children: i === C.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
473
+ children: i === m.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
265
474
  /* @__PURE__ */ a(
266
- ce,
475
+ xe,
267
476
  {
268
- value: n ?? C,
269
- onChange: p,
270
- onTestConnection: (L) => N(`edit-${C.id}`, L),
271
- testStatus: d[`edit-${C.id}`],
272
- testError: c[`edit-${C.id}`]
477
+ value: n ?? m,
478
+ onChange: o,
479
+ onTestConnection: (I) => v(`edit-${m.id}`, I),
480
+ testStatus: y[`edit-${m.id}`],
481
+ testError: c[`edit-${m.id}`]
273
482
  }
274
483
  ),
275
484
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
@@ -277,7 +486,7 @@ function Va({ sources: e, onChange: t }) {
277
486
  "button",
278
487
  {
279
488
  type: "button",
280
- onClick: S,
489
+ onClick: T,
281
490
  disabled: !(n != null && n.id) || !(n != null && n.url),
282
491
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
283
492
  children: "Save"
@@ -288,7 +497,7 @@ function Va({ sources: e, onChange: t }) {
288
497
  {
289
498
  type: "button",
290
499
  onClick: () => {
291
- r(null), p(null);
500
+ r(null), o(null);
292
501
  },
293
502
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
294
503
  children: "Cancel"
@@ -297,11 +506,11 @@ function Va({ sources: e, onChange: t }) {
297
506
  ] })
298
507
  ] }) : /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-start mapui:justify-between mapui:gap-2", children: [
299
508
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
300
- /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: C.label ?? C.id }),
301
- /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: C.url }),
302
- C.tileMatrixSetId && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-gray-400", children: [
509
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: m.label ?? m.id }),
510
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: m.url }),
511
+ m.tileMatrixSetId && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-gray-400", children: [
303
512
  "TMS: ",
304
- C.tileMatrixSetId
513
+ m.tileMatrixSetId
305
514
  ] })
306
515
  ] }),
307
516
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
@@ -310,7 +519,7 @@ function Va({ sources: e, onChange: t }) {
310
519
  {
311
520
  type: "button",
312
521
  onClick: () => {
313
- r(C.id), p(C);
522
+ r(m.id), o(m);
314
523
  },
315
524
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
316
525
  children: "Edit"
@@ -320,7 +529,7 @@ function Va({ sources: e, onChange: t }) {
320
529
  "button",
321
530
  {
322
531
  type: "button",
323
- onClick: () => v(C.id),
532
+ onClick: () => N(m.id),
324
533
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
325
534
  children: "Remove"
326
535
  }
@@ -328,17 +537,17 @@ function Va({ sources: e, onChange: t }) {
328
537
  ] })
329
538
  ] })
330
539
  },
331
- C.id
540
+ m.id
332
541
  )) }),
333
- o && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
542
+ p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
334
543
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
335
544
  /* @__PURE__ */ a(
336
- ce,
545
+ xe,
337
546
  {
338
- value: m,
339
- onChange: w,
340
- onTestConnection: (C) => N("new", C),
341
- testStatus: d.new,
547
+ value: s,
548
+ onChange: g,
549
+ onTestConnection: (m) => v("new", m),
550
+ testStatus: y.new,
342
551
  testError: c.new
343
552
  }
344
553
  ),
@@ -347,8 +556,8 @@ function Va({ sources: e, onChange: t }) {
347
556
  "button",
348
557
  {
349
558
  type: "button",
350
- onClick: x,
351
- disabled: !m.id || !m.url,
559
+ onClick: E,
560
+ disabled: !s.id || !s.url,
352
561
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
353
562
  children: "Save"
354
563
  }
@@ -357,7 +566,7 @@ function Va({ sources: e, onChange: t }) {
357
566
  "button",
358
567
  {
359
568
  type: "button",
360
- onClick: () => b(!1),
569
+ onClick: () => x(!1),
361
570
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
362
571
  children: "Cancel"
363
572
  }
@@ -365,32 +574,32 @@ function Va({ sources: e, onChange: t }) {
365
574
  ] })
366
575
  ] }),
367
576
  /* @__PURE__ */ a(
368
- Z,
577
+ re,
369
578
  {
370
- open: s !== null,
579
+ open: d !== null,
371
580
  title: "Remove Source",
372
581
  description: "Are you sure you want to remove this source? Any layers using it will be affected.",
373
- onConfirm: () => s && P(s),
374
- onCancel: () => v(null)
582
+ onConfirm: () => d && j(d),
583
+ onCancel: () => N(null)
375
584
  }
376
585
  )
377
586
  ] });
378
587
  }
379
- function _a({
588
+ function ut({
380
589
  sourceUrl: e,
381
590
  selectedCollectionIds: t,
382
591
  onSelect: i,
383
592
  onDeselect: r
384
593
  }) {
385
- const { collections: n, loading: p, error: o } = Fe(e || null);
386
- return p ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
594
+ const { collections: n, loading: o, error: p } = Ue(e || null);
595
+ return o ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
387
596
  /* @__PURE__ */ a("span", { className: "mapui:inline-block mapui:h-4 mapui:w-4 mapui:animate-spin mapui:rounded-full mapui:border-2 mapui:border-gray-300 mapui:border-t-blue-600" }),
388
597
  "Loading collections…"
389
- ] }) : o ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
598
+ ] }) : p ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
390
599
  "Failed to load collections: ",
391
- o.message
392
- ] }) : n.length === 0 ? /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: n.map((b) => {
393
- const m = t.includes(b.id);
600
+ p.message
601
+ ] }) : n.length === 0 ? /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: n.map((x) => {
602
+ const s = t.includes(x.id);
394
603
  return /* @__PURE__ */ l(
395
604
  "li",
396
605
  {
@@ -400,63 +609,63 @@ function _a({
400
609
  "input",
401
610
  {
402
611
  type: "checkbox",
403
- id: `collection-${b.id}`,
404
- checked: m,
405
- onChange: () => m ? r(b.id) : i(b.id),
612
+ id: `collection-${x.id}`,
613
+ checked: s,
614
+ onChange: () => s ? r(x.id) : i(x.id),
406
615
  className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
407
616
  }
408
617
  ),
409
618
  /* @__PURE__ */ l(
410
619
  "label",
411
620
  {
412
- htmlFor: `collection-${b.id}`,
621
+ htmlFor: `collection-${x.id}`,
413
622
  className: "mapui:flex mapui:cursor-pointer mapui:flex-col mapui:gap-0.5",
414
623
  children: [
415
- /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: b.title ?? b.id }),
416
- /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: b.id }),
417
- b.description && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: b.description })
624
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: x.title ?? x.id }),
625
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: x.id }),
626
+ x.description && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: x.description })
418
627
  ]
419
628
  }
420
629
  )
421
630
  ]
422
631
  },
423
- b.id
632
+ x.id
424
633
  );
425
634
  }) });
426
635
  }
427
- function He({ value: e, onChange: t, availableIcons: i }) {
428
- const [r, n] = A(!1), [p, o] = A(-1), b = ue(null), m = Ie(), w = p >= 0 ? `${m}-option-${p}` : void 0, d = Ee(() => {
636
+ function ua({ value: e, onChange: t, availableIcons: i }) {
637
+ const [r, n] = S(!1), [o, p] = S(-1), x = ie(null), s = Re(), g = o >= 0 ? `${s}-option-${o}` : void 0, y = Be(() => {
429
638
  if (!i || i.length === 0) return [];
430
639
  if (!e) return i;
431
- const N = e.toLowerCase();
432
- return i.filter((S) => S.toLowerCase().includes(N));
433
- }, [i, e]), f = r && d.length > 0, c = We(
434
- (N) => {
435
- t(N), n(!1), o(-1);
640
+ const v = e.toLowerCase();
641
+ return i.filter((T) => T.toLowerCase().includes(v));
642
+ }, [i, e]), w = r && y.length > 0, c = Je(
643
+ (v) => {
644
+ t(v), n(!1), p(-1);
436
645
  },
437
646
  [t]
438
- ), u = (N) => {
439
- t(N.target.value), n(!0), o(-1);
440
- }, s = (N) => {
441
- f && (N.key === "ArrowDown" ? (N.preventDefault(), o((S) => Math.min(S + 1, d.length - 1))) : N.key === "ArrowUp" ? (N.preventDefault(), o((S) => Math.max(S - 1, 0))) : N.key === "Enter" && p >= 0 ? (N.preventDefault(), c(d[p])) : N.key === "Escape" && (n(!1), o(-1)));
647
+ ), u = (v) => {
648
+ t(v.target.value), n(!0), p(-1);
649
+ }, d = (v) => {
650
+ w && (v.key === "ArrowDown" ? (v.preventDefault(), p((T) => Math.min(T + 1, y.length - 1))) : v.key === "ArrowUp" ? (v.preventDefault(), p((T) => Math.max(T - 1, 0))) : v.key === "Enter" && o >= 0 ? (v.preventDefault(), c(y[o])) : v.key === "Escape" && (n(!1), p(-1)));
442
651
  };
443
- X(() => {
444
- const N = (S) => {
445
- b.current && !b.current.contains(S.target) && (n(!1), o(-1));
652
+ V(() => {
653
+ const v = (T) => {
654
+ x.current && !x.current.contains(T.target) && (n(!1), p(-1));
446
655
  };
447
- return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
656
+ return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
448
657
  }, []);
449
- const v = "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
658
+ const N = "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
450
659
  return !i || i.length === 0 ? /* @__PURE__ */ a(
451
660
  "input",
452
661
  {
453
662
  type: "text",
454
663
  value: e,
455
- onChange: (N) => t(N.target.value || ""),
664
+ onChange: (v) => t(v.target.value || ""),
456
665
  placeholder: "icon-name",
457
- className: v
666
+ className: N
458
667
  }
459
- ) : /* @__PURE__ */ l("div", { ref: b, className: "mapui:relative", children: [
668
+ ) : /* @__PURE__ */ l("div", { ref: x, className: "mapui:relative", children: [
460
669
  /* @__PURE__ */ a(
461
670
  "input",
462
671
  {
@@ -464,41 +673,41 @@ function He({ value: e, onChange: t, availableIcons: i }) {
464
673
  value: e,
465
674
  placeholder: "Search icons…",
466
675
  role: "combobox",
467
- "aria-expanded": f,
676
+ "aria-expanded": w,
468
677
  "aria-autocomplete": "list",
469
- "aria-controls": m,
470
- "aria-activedescendant": w,
678
+ "aria-controls": s,
679
+ "aria-activedescendant": g,
471
680
  onChange: u,
472
681
  onFocus: () => n(!0),
473
- onKeyDown: s,
474
- className: v
682
+ onKeyDown: d,
683
+ className: N
475
684
  }
476
685
  ),
477
- f && /* @__PURE__ */ a(
686
+ w && /* @__PURE__ */ a(
478
687
  "ul",
479
688
  {
480
- id: m,
689
+ id: s,
481
690
  role: "listbox",
482
691
  className: "mapui:absolute mapui:z-10 mapui:mt-1 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:shadow-lg mapui:max-h-48 mapui:overflow-y-auto mapui:p-0 mapui:m-0 mapui:list-none",
483
- children: d.map((N, S) => /* @__PURE__ */ a(
692
+ children: y.map((v, T) => /* @__PURE__ */ a(
484
693
  "li",
485
694
  {
486
- id: `${m}-option-${S}`,
695
+ id: `${s}-option-${T}`,
487
696
  role: "option",
488
- "aria-selected": S === p,
489
- onMouseDown: (x) => {
490
- x.preventDefault(), c(N);
697
+ "aria-selected": T === o,
698
+ onMouseDown: (E) => {
699
+ E.preventDefault(), c(v);
491
700
  },
492
- className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${S === p ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
493
- children: N
701
+ className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${T === o ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
702
+ children: v
494
703
  },
495
- `${S}-${N}`
704
+ `${T}-${v}`
496
705
  ))
497
706
  }
498
707
  )
499
708
  ] });
500
709
  }
501
- const de = [
710
+ const we = [
502
711
  "#4e79a7",
503
712
  "#f28e2b",
504
713
  "#e15759",
@@ -510,205 +719,254 @@ const de = [
510
719
  "#9c755f",
511
720
  "#bab0ac"
512
721
  ];
513
- function ae(e) {
514
- return de[e % de.length];
722
+ function ne(e) {
723
+ return we[e % we.length];
515
724
  }
516
- function Je(e) {
725
+ function ma(e) {
517
726
  return e[0] === "interpolate" ? "interpolate" : "match";
518
727
  }
519
- function Ke(e) {
728
+ function sa(e) {
520
729
  const t = Array.isArray(e[1]) ? e[1][1] ?? "" : "", i = e[e.length - 1] ?? "#000000", r = [];
521
730
  for (let n = 2; n < e.length - 1; n += 2)
522
731
  r.push({ value: String(e[n] ?? ""), color: e[n + 1] ?? "#000000" });
523
732
  return { property: t, pairs: r, fallback: i };
524
733
  }
525
- function he(e, t, i) {
734
+ function Ne(e, t, i) {
526
735
  const r = ["match", ["get", e]];
527
736
  for (const n of t)
528
737
  r.push(n.value, n.color);
529
738
  return r.push(i), r;
530
739
  }
531
- function Qe(e) {
532
- const t = Array.isArray(e[2]) ? e[2][1] ?? "" : "", i = [];
533
- for (let r = 3; r < e.length; r += 2)
534
- i.push({ stop: Number(e[r] ?? 0), color: e[r + 1] ?? "#000000" });
535
- return { property: t, stops: i };
536
- }
537
- function ge(e, t) {
538
- const i = ["interpolate", ["linear"], ["get", e]];
740
+ function pe(e) {
741
+ const t = e[2];
742
+ let i = "";
743
+ Array.isArray(t) && (t[0] === "to-number" && Array.isArray(t[1]) ? i = t[1][1] ?? "" : i = t[1] ?? "");
744
+ const r = [];
745
+ for (let n = 3; n < e.length; n += 2)
746
+ r.push({ stop: Number(e[n] ?? 0), color: e[n + 1] ?? "#000000" });
747
+ return { property: i, stops: r };
748
+ }
749
+ function ve(e, t) {
750
+ const i = ["interpolate", ["linear"], ["to-number", ["get", e]]];
539
751
  for (const r of t)
540
752
  i.push(r.stop, r.color);
541
753
  return i;
542
754
  }
543
- const J = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", te = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50", be = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50";
544
- function Ze({
755
+ function ke(e) {
756
+ return e.map((t) => ({ stopText: String(t.stop), color: t.color }));
757
+ }
758
+ function ca(e) {
759
+ return e.map((t, i) => {
760
+ if (t.stopText.trim() === "") return "Value required";
761
+ const r = parseFloat(t.stopText);
762
+ if (isNaN(r)) return "Must be a number";
763
+ if (i > 0) {
764
+ const n = parseFloat(e[i - 1].stopText);
765
+ if (!isNaN(n) && r <= n) return "Must be greater than previous stop";
766
+ }
767
+ return "";
768
+ });
769
+ }
770
+ function da(e) {
771
+ const t = [];
772
+ for (const i of e) {
773
+ const r = parseFloat(i.stopText);
774
+ if (isNaN(r)) return null;
775
+ t.push({ stop: r, color: i.color });
776
+ }
777
+ return t;
778
+ }
779
+ const ee = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", oe = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50", Ce = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50";
780
+ function ha({
545
781
  value: e,
546
782
  onChange: t,
547
783
  availableProperties: i = [],
548
784
  onFetchDistinctValues: r
549
785
  }) {
550
- const [n, p] = A(() => Je(e)), [o, b] = A(!1), m = Ke(e), w = Qe(e), d = n === "match" ? m.property : "", f = n === "match" ? m.pairs : [], c = n === "match" ? m.fallback : "#000000", u = n === "interpolate" ? w.property : "", s = n === "interpolate" ? w.stops : [], v = i.filter(
551
- (h) => !h.type || h.type === "string"
552
- ), N = i.filter(
553
- (h) => h.type === "number" || h.type === "integer"
554
- ), S = (h, T, I) => {
555
- t(he(h, T, I));
556
- }, x = (h) => {
557
- S(h, f, c);
558
- }, P = (h) => {
559
- S(d, f, h);
560
- }, C = (h, T) => {
561
- const I = f.map((F, j) => j === h ? { ...F, value: T } : F);
562
- S(d, I, c);
563
- }, L = (h, T) => {
564
- const I = f.map((F, j) => j === h ? { ...F, color: T } : F);
565
- S(d, I, c);
566
- }, E = (h) => {
567
- const T = f.filter((I, F) => F !== h);
568
- S(d, T, c);
569
- }, y = () => {
570
- const h = [...f, { value: "", color: ae(f.length) }];
571
- S(d, h, c);
572
- }, $ = async () => {
573
- if (!(!r || !d)) {
574
- b(!0);
786
+ const [n, o] = S(() => ma(e)), [p, x] = S(!1), s = sa(e), g = n === "match" ? s.property : "", y = n === "match" ? s.pairs : [], w = n === "match" ? s.fallback : "#000000", [c, u] = S(() => {
787
+ const b = pe(e);
788
+ return ke(b.stops);
789
+ }), [d, N] = S(() => n === "interpolate" ? pe(e).property : ""), [v, T] = S([]), E = ie(e);
790
+ V(() => {
791
+ if (E.current !== e && n === "interpolate") {
792
+ const b = pe(e);
793
+ u(ke(b.stops)), N(b.property), T([]);
794
+ }
795
+ E.current = e;
796
+ }, [e, n]);
797
+ const j = i.filter(
798
+ (b) => !b.type || b.type === "string"
799
+ ), m = i.filter(
800
+ (b) => b.type === "number" || b.type === "integer"
801
+ ), I = (b, D, A) => {
802
+ t(Ne(b, D, A));
803
+ }, M = (b) => {
804
+ I(b, y, w);
805
+ }, h = (b) => {
806
+ I(g, y, b);
807
+ }, F = (b, D) => {
808
+ const A = y.map((L, B) => B === b ? { ...L, value: D } : L);
809
+ I(g, A, w);
810
+ }, P = (b, D) => {
811
+ const A = y.map((L, B) => B === b ? { ...L, color: D } : L);
812
+ I(g, A, w);
813
+ }, f = (b) => {
814
+ const D = y.filter((A, L) => L !== b);
815
+ I(g, D, w);
816
+ }, k = () => {
817
+ const b = [...y, { value: "", color: ne(y.length) }];
818
+ I(g, b, w);
819
+ }, O = async () => {
820
+ if (!(!r || !g)) {
821
+ x(!0);
575
822
  try {
576
- const T = (await r(d)).map((I, F) => ({
577
- value: I,
578
- color: ae(F)
823
+ const D = (await r(g)).map((A, L) => ({
824
+ value: A,
825
+ color: ne(L)
579
826
  }));
580
- S(d, T, c);
827
+ I(g, D, w);
581
828
  } finally {
582
- b(!1);
829
+ x(!1);
583
830
  }
584
831
  }
585
- }, M = (h, T) => {
586
- t(ge(h, T));
587
- }, g = (h) => {
588
- M(h, s);
589
- }, k = (h, T) => {
590
- const I = s.map((F, j) => j === h ? { ...F, stop: T } : F);
591
- M(u, I);
592
- }, O = (h, T) => {
593
- const I = s.map((F, j) => j === h ? { ...F, color: T } : F);
594
- M(u, I);
595
- }, U = (h) => {
596
- const T = s.filter((I, F) => F !== h);
597
- M(u, T);
598
- }, G = () => {
599
- var I;
600
- const h = ((I = s[s.length - 1]) == null ? void 0 : I.stop) ?? 0, T = [...s, { stop: h + 10, color: ae(s.length) }];
601
- M(u, T);
602
- }, B = (h) => {
603
- p(h), t(h === "match" ? he("", [], "#000000") : ge("", []));
832
+ }, R = (b, D) => {
833
+ const A = ca(D);
834
+ if (T(A), b && D.length >= 2 && A.every((L) => !L)) {
835
+ const L = da(D);
836
+ L && t(ve(b, L));
837
+ }
838
+ }, G = (b) => {
839
+ N(b), R(b, c);
840
+ }, q = (b, D) => {
841
+ const A = c.map((L, B) => B === b ? { ...L, stopText: D } : L);
842
+ u(A), R(d, A);
843
+ }, z = (b, D) => {
844
+ const A = c.map((L, B) => B === b ? { ...L, color: D } : L);
845
+ u(A), R(d, A);
846
+ }, J = (b) => {
847
+ const D = c.filter((A, L) => L !== b);
848
+ u(D), R(d, D);
849
+ }, K = () => {
850
+ var B;
851
+ const b = ((B = c[c.length - 1]) == null ? void 0 : B.stopText) ?? "0", D = parseFloat(b), A = isNaN(D) ? 0 : D + 10, L = [...c, { stopText: String(A), color: ne(c.length) }];
852
+ u(L), R(d, L);
853
+ }, Q = (b) => {
854
+ o(b), b === "match" ? t(Ne("", [], "#000000")) : (u([]), N(""), T([]), t(ve("", [])));
604
855
  };
605
856
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
606
- /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((h) => /* @__PURE__ */ a(
857
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((b) => /* @__PURE__ */ a(
607
858
  "button",
608
859
  {
609
860
  type: "button",
610
- onClick: () => B(h),
861
+ onClick: () => Q(b),
611
862
  className: [
612
863
  "mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-xs mapui:capitalize mapui:outline-none",
613
864
  "focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
614
- n === h ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
865
+ n === b ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
615
866
  ].join(" "),
616
- children: h === "match" ? "Categorical" : "Gradient"
867
+ children: b === "match" ? "Categorical" : "Gradient"
617
868
  },
618
- h
869
+ b
619
870
  )) }),
620
- n === "match" && /* @__PURE__ */ l(q, { children: [
871
+ n === "match" && /* @__PURE__ */ l(U, { children: [
621
872
  /* @__PURE__ */ l(
622
873
  "select",
623
874
  {
624
- value: d,
625
- onChange: (h) => x(h.target.value),
626
- className: J,
875
+ value: g,
876
+ onChange: (b) => M(b.target.value),
877
+ className: ee,
627
878
  children: [
628
879
  /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
629
- v.map((h) => /* @__PURE__ */ a("option", { value: h.name, children: h.title ?? h.name }, h.name))
880
+ j.map((b) => /* @__PURE__ */ a("option", { value: b.name, children: b.title ?? b.name }, b.name))
630
881
  ]
631
882
  }
632
883
  ),
633
- f.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: f.map((h, T) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
884
+ y.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: y.map((b, D) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
634
885
  /* @__PURE__ */ a(
635
886
  "input",
636
887
  {
637
888
  type: "text",
638
- value: h.value,
639
- onChange: (I) => C(T, I.target.value),
889
+ value: b.value,
890
+ onChange: (A) => F(D, A.target.value),
640
891
  placeholder: "value",
641
- className: `${J} mapui:flex-1`
892
+ className: `${ee} mapui:flex-1`
642
893
  }
643
894
  ),
644
895
  /* @__PURE__ */ a(
645
- Y,
896
+ H,
646
897
  {
647
- value: h.color,
648
- onChange: (I) => L(T, I),
649
- label: `Color for "${h.value}"`
898
+ value: b.color,
899
+ onChange: (A) => P(D, A),
900
+ label: `Color for "${b.value}"`
650
901
  }
651
902
  ),
652
- /* @__PURE__ */ a("button", { type: "button", onClick: () => E(T), className: be, children: "×" })
653
- ] }, T)) }),
903
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => f(D), className: Ce, children: "×" })
904
+ ] }, D)) }),
654
905
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
655
906
  /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500 mapui:shrink-0", children: "Fallback:" }),
656
- /* @__PURE__ */ a(Y, { value: c, onChange: P, label: "Fallback color" })
907
+ /* @__PURE__ */ a(H, { value: w, onChange: h, label: "Fallback color" })
657
908
  ] }),
658
909
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
659
- /* @__PURE__ */ a("button", { type: "button", onClick: y, className: te, children: "+ Add value" }),
660
- r && d && /* @__PURE__ */ a(
910
+ /* @__PURE__ */ a("button", { type: "button", onClick: k, className: oe, children: "+ Add value" }),
911
+ r && g && /* @__PURE__ */ a(
661
912
  "button",
662
913
  {
663
914
  type: "button",
664
- onClick: $,
665
- disabled: o,
666
- className: te,
667
- children: o ? "Loading…" : "Auto-populate"
915
+ onClick: O,
916
+ disabled: p,
917
+ className: oe,
918
+ children: p ? "Loading…" : "Auto-populate"
668
919
  }
669
920
  )
670
921
  ] })
671
922
  ] }),
672
- n === "interpolate" && /* @__PURE__ */ l(q, { children: [
923
+ n === "interpolate" && /* @__PURE__ */ l(U, { children: [
673
924
  /* @__PURE__ */ l(
674
925
  "select",
675
926
  {
676
- value: u,
677
- onChange: (h) => g(h.target.value),
678
- className: J,
927
+ value: d,
928
+ onChange: (b) => G(b.target.value),
929
+ className: ee,
679
930
  children: [
680
931
  /* @__PURE__ */ a("option", { value: "", children: "Select a numeric property…" }),
681
- N.map((h) => /* @__PURE__ */ a("option", { value: h.name, children: h.title ?? h.name }, h.name))
932
+ m.map((b) => /* @__PURE__ */ a("option", { value: b.name, children: b.title ?? b.name }, b.name))
682
933
  ]
683
934
  }
684
935
  ),
685
- s.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: s.map((h, T) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
686
- /* @__PURE__ */ a(
687
- "input",
688
- {
689
- type: "number",
690
- value: h.stop,
691
- onChange: (I) => k(T, parseFloat(I.target.value) || 0),
692
- placeholder: "stop",
693
- className: `${J} mapui:w-24`
694
- }
695
- ),
696
- /* @__PURE__ */ a(
697
- Y,
698
- {
699
- value: h.color,
700
- onChange: (I) => O(T, I),
701
- label: `Color at stop ${h.stop}`
702
- }
703
- ),
704
- /* @__PURE__ */ a("button", { type: "button", onClick: () => U(T), className: be, children: "×" })
705
- ] }, T)) }),
706
- /* @__PURE__ */ a("button", { type: "button", onClick: G, className: te, children: "+ Add stop" })
936
+ c.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: c.map((b, D) => {
937
+ const A = v[D];
938
+ return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
939
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
940
+ /* @__PURE__ */ a(
941
+ "input",
942
+ {
943
+ type: "text",
944
+ inputMode: "numeric",
945
+ value: b.stopText,
946
+ onChange: (L) => q(D, L.target.value),
947
+ placeholder: "stop",
948
+ className: `${ee} mapui:w-24`
949
+ }
950
+ ),
951
+ /* @__PURE__ */ a(
952
+ H,
953
+ {
954
+ value: b.color,
955
+ onChange: (L) => z(D, L),
956
+ label: `Color at stop ${b.stopText}`
957
+ }
958
+ ),
959
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => J(D), className: Ce, children: "×" })
960
+ ] }),
961
+ A && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-500", children: A })
962
+ ] }, D);
963
+ }) }),
964
+ /* @__PURE__ */ a("button", { type: "button", onClick: K, className: oe, children: "+ Add stop" })
707
965
  ] })
708
966
  ] });
709
967
  }
710
- const z = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
711
- function ea({
968
+ const _ = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
969
+ function ga({
712
970
  value: e,
713
971
  onChange: t
714
972
  }) {
@@ -721,7 +979,7 @@ function ea({
721
979
  step: 0.5,
722
980
  value: i,
723
981
  onChange: (n) => t([parseFloat(n.target.value) || 0, r]),
724
- className: `${z} mapui:w-20`,
982
+ className: `${_} mapui:w-20`,
725
983
  "aria-label": "X",
726
984
  placeholder: "X"
727
985
  }
@@ -733,14 +991,14 @@ function ea({
733
991
  step: 0.5,
734
992
  value: r,
735
993
  onChange: (n) => t([i, parseFloat(n.target.value) || 0]),
736
- className: `${z} mapui:w-20`,
994
+ className: `${_} mapui:w-20`,
737
995
  "aria-label": "Y",
738
996
  placeholder: "Y"
739
997
  }
740
998
  )
741
999
  ] });
742
1000
  }
743
- function aa({
1001
+ function ba({
744
1002
  value: e,
745
1003
  onChange: t
746
1004
  }) {
@@ -761,45 +1019,45 @@ function aa({
761
1019
  /* @__PURE__ */ a("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children: i.toFixed(2) })
762
1020
  ] });
763
1021
  }
764
- function ye({
1022
+ function Se({
765
1023
  def: e,
766
1024
  value: t,
767
1025
  onChange: i,
768
1026
  availableIcons: r,
769
1027
  availableProperties: n,
770
- onFetchDistinctValues: p
1028
+ onFetchDistinctValues: o
771
1029
  }) {
772
- var o, b;
1030
+ var p, x;
773
1031
  switch (e.widget) {
774
1032
  case "color": {
775
- const m = Array.isArray(t), w = m ? t[t.length - 1] ?? "#000000" : "#000000";
1033
+ const s = Array.isArray(t), g = s ? t[t.length - 1] ?? "#000000" : "#000000";
776
1034
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:w-full", children: [
777
1035
  /* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-end", children: /* @__PURE__ */ a(
778
1036
  "button",
779
1037
  {
780
1038
  type: "button",
781
- title: m ? "Switch to static color" : "Switch to data-driven color",
1039
+ title: s ? "Switch to static color" : "Switch to data-driven color",
782
1040
  onClick: () => {
783
- i(m ? w : ["match", ["get", ""], w]);
1041
+ i(s ? g : ["match", ["get", ""], g]);
784
1042
  },
785
1043
  className: [
786
1044
  "mapui:cursor-pointer mapui:rounded mapui:border mapui:px-1.5 mapui:py-0.5 mapui:font-mono mapui:text-xs mapui:outline-none",
787
1045
  "focus:mapui:ring-1 focus:mapui:ring-blue-400",
788
- m ? "mapui:border-blue-400 mapui:bg-blue-50 mapui:text-blue-700" : "mapui:border-gray-300 mapui:bg-white mapui:text-gray-500 hover:mapui:border-blue-400 hover:mapui:text-blue-600"
1046
+ s ? "mapui:border-blue-400 mapui:bg-blue-50 mapui:text-blue-700" : "mapui:border-gray-300 mapui:bg-white mapui:text-gray-500 hover:mapui:border-blue-400 hover:mapui:text-blue-600"
789
1047
  ].join(" "),
790
1048
  children: "fx"
791
1049
  }
792
1050
  ) }),
793
- m ? /* @__PURE__ */ a(
794
- Ze,
1051
+ s ? /* @__PURE__ */ a(
1052
+ ha,
795
1053
  {
796
1054
  value: t,
797
- onChange: (d) => i(d),
1055
+ onChange: (y) => i(y),
798
1056
  availableProperties: n,
799
- onFetchDistinctValues: p
1057
+ onFetchDistinctValues: o
800
1058
  }
801
1059
  ) : /* @__PURE__ */ a(
802
- Y,
1060
+ H,
803
1061
  {
804
1062
  value: t ?? "#000000",
805
1063
  onChange: i,
@@ -810,7 +1068,7 @@ function ye({
810
1068
  }
811
1069
  case "opacity":
812
1070
  return /* @__PURE__ */ a(
813
- aa,
1071
+ ba,
814
1072
  {
815
1073
  value: t,
816
1074
  onChange: i
@@ -825,8 +1083,8 @@ function ye({
825
1083
  max: e.max,
826
1084
  step: e.step ?? 1,
827
1085
  value: t ?? e.min ?? 0,
828
- onChange: (m) => i(parseFloat(m.target.value) || 0),
829
- className: z
1086
+ onChange: (s) => i(parseFloat(s.target.value) || 0),
1087
+ className: _
830
1088
  }
831
1089
  );
832
1090
  case "boolean":
@@ -835,7 +1093,7 @@ function ye({
835
1093
  {
836
1094
  type: "checkbox",
837
1095
  checked: t ?? !1,
838
- onChange: (m) => i(m.target.checked),
1096
+ onChange: (s) => i(s.target.checked),
839
1097
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
840
1098
  }
841
1099
  );
@@ -843,15 +1101,15 @@ function ye({
843
1101
  return /* @__PURE__ */ a(
844
1102
  "select",
845
1103
  {
846
- value: t ?? ((o = e.options) == null ? void 0 : o[0]) ?? "",
847
- onChange: (m) => i(m.target.value),
848
- className: z,
849
- children: (b = e.options) == null ? void 0 : b.map((m) => /* @__PURE__ */ a("option", { value: m, children: m }, m))
1104
+ value: t ?? ((p = e.options) == null ? void 0 : p[0]) ?? "",
1105
+ onChange: (s) => i(s.target.value),
1106
+ className: _,
1107
+ children: (x = e.options) == null ? void 0 : x.map((s) => /* @__PURE__ */ a("option", { value: s, children: s }, s))
850
1108
  }
851
1109
  );
852
1110
  case "translate":
853
1111
  return /* @__PURE__ */ a(
854
- ea,
1112
+ ga,
855
1113
  {
856
1114
  value: t,
857
1115
  onChange: i
@@ -859,28 +1117,28 @@ function ye({
859
1117
  );
860
1118
  case "dasharray":
861
1119
  case "stringArray": {
862
- const m = t, w = m ? m.join(", ") : "";
1120
+ const s = t, g = s ? s.join(", ") : "";
863
1121
  return /* @__PURE__ */ a(
864
1122
  "input",
865
1123
  {
866
1124
  type: "text",
867
- value: w,
868
- onChange: (d) => {
869
- const f = d.target.value.trim();
870
- if (!f) {
1125
+ value: g,
1126
+ onChange: (y) => {
1127
+ const w = y.target.value.trim();
1128
+ if (!w) {
871
1129
  i(void 0);
872
1130
  return;
873
1131
  }
874
1132
  if (e.widget === "dasharray") {
875
- const c = f.split(",").map((u) => parseFloat(u.trim())).filter((u) => !isNaN(u));
1133
+ const c = w.split(",").map((u) => parseFloat(u.trim())).filter((u) => !isNaN(u));
876
1134
  i(c.length > 0 ? c : void 0);
877
1135
  } else {
878
- const c = f.split(",").map((u) => u.trim()).filter(Boolean);
1136
+ const c = w.split(",").map((u) => u.trim()).filter(Boolean);
879
1137
  i(c.length > 0 ? c : void 0);
880
1138
  }
881
1139
  },
882
1140
  placeholder: e.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
883
- className: z
1141
+ className: _
884
1142
  }
885
1143
  );
886
1144
  }
@@ -890,16 +1148,16 @@ function ye({
890
1148
  {
891
1149
  type: "text",
892
1150
  value: t ?? "",
893
- onChange: (m) => i(m.target.value || void 0),
894
- className: z
1151
+ onChange: (s) => i(s.target.value || void 0),
1152
+ className: _
895
1153
  }
896
1154
  );
897
1155
  case "icon-image":
898
1156
  return /* @__PURE__ */ a(
899
- He,
1157
+ ua,
900
1158
  {
901
1159
  value: t ?? "",
902
- onChange: (m) => i(m ?? void 0),
1160
+ onChange: (s) => i(s ?? void 0),
903
1161
  availableIcons: r
904
1162
  }
905
1163
  );
@@ -907,90 +1165,90 @@ function ye({
907
1165
  return null;
908
1166
  }
909
1167
  }
910
- function ta({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues: p }) {
911
- const o = e.enableDefault !== void 0, b = t !== void 0;
912
- if (o && e.widget === "boolean") {
913
- const m = !e.enableDefault;
914
- return /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
1168
+ function ya({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues: o }) {
1169
+ const p = e.enableDefault !== void 0, x = t !== void 0;
1170
+ if (p && e.widget === "boolean") {
1171
+ const s = !e.enableDefault;
1172
+ return /* @__PURE__ */ a(C, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
915
1173
  "input",
916
1174
  {
917
1175
  type: "checkbox",
918
- checked: t === m,
919
- onChange: (w) => {
920
- i(e.key, w.target.checked ? m : void 0);
1176
+ checked: t === s,
1177
+ onChange: (g) => {
1178
+ i(e.key, g.target.checked ? s : void 0);
921
1179
  },
922
1180
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
923
1181
  }
924
1182
  ) });
925
1183
  }
926
- return o ? /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1184
+ return p ? /* @__PURE__ */ a(C, { label: e.label, description: e.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
927
1185
  /* @__PURE__ */ a(
928
1186
  "input",
929
1187
  {
930
1188
  type: "checkbox",
931
- checked: b,
932
- onChange: (m) => {
933
- i(e.key, m.target.checked ? e.enableDefault : void 0);
1189
+ checked: x,
1190
+ onChange: (s) => {
1191
+ i(e.key, s.target.checked ? e.enableDefault : void 0);
934
1192
  },
935
1193
  className: "mapui:h-4 mapui:w-4 mapui:shrink-0 mapui:accent-blue-600"
936
1194
  }
937
1195
  ),
938
- b && /* @__PURE__ */ a(
939
- ye,
1196
+ x && /* @__PURE__ */ a(
1197
+ Se,
940
1198
  {
941
1199
  def: e,
942
1200
  value: t,
943
- onChange: (m) => i(e.key, m),
1201
+ onChange: (s) => i(e.key, s),
944
1202
  availableIcons: r,
945
1203
  availableProperties: n,
946
- onFetchDistinctValues: p
1204
+ onFetchDistinctValues: o
947
1205
  }
948
1206
  )
949
- ] }) }) : /* @__PURE__ */ a(D, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
950
- ye,
1207
+ ] }) }) : /* @__PURE__ */ a(C, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
1208
+ Se,
951
1209
  {
952
1210
  def: e,
953
1211
  value: t,
954
- onChange: (m) => i(e.key, m),
1212
+ onChange: (s) => i(e.key, s),
955
1213
  availableIcons: r,
956
1214
  availableProperties: n,
957
- onFetchDistinctValues: p
1215
+ onFetchDistinctValues: o
958
1216
  }
959
1217
  ) });
960
1218
  }
961
- function fe({
1219
+ function Te({
962
1220
  title: e,
963
1221
  properties: t,
964
1222
  values: i,
965
1223
  onChange: r,
966
1224
  defaultOpen: n = !1,
967
- availableIcons: p,
968
- availableProperties: o,
969
- onFetchDistinctValues: b
1225
+ availableIcons: o,
1226
+ availableProperties: p,
1227
+ onFetchDistinctValues: x
970
1228
  }) {
971
- const m = t.filter(
972
- (w) => w.enableDefault !== void 0 && i[w.key] !== void 0
1229
+ const s = t.filter(
1230
+ (g) => g.enableDefault !== void 0 && i[g.key] !== void 0
973
1231
  ).length;
974
- return /* @__PURE__ */ a(_, { title: e, defaultOpen: n, badge: m || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: t.map((w) => /* @__PURE__ */ a(
975
- ta,
1232
+ return /* @__PURE__ */ a(X, { title: e, defaultOpen: n, badge: s || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: t.map((g) => /* @__PURE__ */ a(
1233
+ ya,
976
1234
  {
977
- def: w,
978
- value: i[w.key],
1235
+ def: g,
1236
+ value: i[g.key],
979
1237
  onChange: r,
980
- availableIcons: p,
981
- availableProperties: o,
982
- onFetchDistinctValues: b
1238
+ availableIcons: o,
1239
+ availableProperties: p,
1240
+ onFetchDistinctValues: x
983
1241
  },
984
- w.key
1242
+ g.key
985
1243
  )) }) });
986
1244
  }
987
1245
  function W(e) {
988
1246
  return Array.isArray(e);
989
1247
  }
990
- function ia(e) {
1248
+ function fa(e) {
991
1249
  return e[0] === "match" ? "match" : e[0] === "interpolate" ? "interpolate" : null;
992
1250
  }
993
- function Me(e) {
1251
+ function ze(e) {
994
1252
  if (e[0] === "match") {
995
1253
  const t = [];
996
1254
  for (let r = 3; r < e.length; r += 2)
@@ -1006,12 +1264,12 @@ function Me(e) {
1006
1264
  }
1007
1265
  return [];
1008
1266
  }
1009
- function ra(e) {
1267
+ function xa(e) {
1010
1268
  if (e[0] === "match") {
1011
1269
  const t = [];
1012
1270
  for (let r = 2; r < e.length - 1; r += 2) {
1013
- const n = String(e[r]), p = e[r + 1];
1014
- typeof p == "string" && t.push({ label: n, color: p });
1271
+ const n = String(e[r]), o = e[r + 1];
1272
+ typeof o == "string" && t.push({ label: n, color: o });
1015
1273
  }
1016
1274
  const i = e[e.length - 1];
1017
1275
  return typeof i == "string" && t.push({ label: "Other", color: i }), t;
@@ -1026,11 +1284,16 @@ function ra(e) {
1026
1284
  }
1027
1285
  return [];
1028
1286
  }
1029
- function la(e) {
1287
+ function wa(e) {
1030
1288
  const t = e[0] === "match" ? e[1] : e[0] === "interpolate" ? e[2] : null;
1031
- return Array.isArray(t) && t[0] === "get" && typeof t[1] == "string" ? t[1] : null;
1289
+ if (Array.isArray(t)) {
1290
+ if (t[0] === "get" && typeof t[1] == "string") return t[1];
1291
+ if (t[0] === "to-number" && Array.isArray(t[1]) && t[1][0] === "get")
1292
+ return t[1][1] ?? null;
1293
+ }
1294
+ return null;
1032
1295
  }
1033
- function na(e) {
1296
+ function Na(e) {
1034
1297
  switch (e.type) {
1035
1298
  case "fill":
1036
1299
  return e.paint["fill-color"] ?? "#000000";
@@ -1042,7 +1305,7 @@ function na(e) {
1042
1305
  return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
1043
1306
  }
1044
1307
  }
1045
- function oa(e) {
1308
+ function va(e) {
1046
1309
  switch (e.type) {
1047
1310
  case "fill":
1048
1311
  return "square";
@@ -1053,8 +1316,8 @@ function oa(e) {
1053
1316
  return "circle";
1054
1317
  }
1055
1318
  }
1056
- function ie({ expr: e, height: t }) {
1057
- const i = Me(e);
1319
+ function ue({ expr: e, height: t }) {
1320
+ const i = ze(e);
1058
1321
  if (i.length === 0)
1059
1322
  return /* @__PURE__ */ a(
1060
1323
  "div",
@@ -1063,7 +1326,7 @@ function ie({ expr: e, height: t }) {
1063
1326
  title: "Expression (no preview)"
1064
1327
  }
1065
1328
  );
1066
- const r = e[0] === "interpolate", n = r ? `linear-gradient(to right, ${i.join(", ")})` : i.map((p, o) => `${p} ${o / i.length * 100}% ${(o + 1) / i.length * 100}%`).join(", ");
1329
+ const r = e[0] === "interpolate", n = r ? `linear-gradient(to right, ${i.join(", ")})` : i.map((o, p) => `${o} ${p / i.length * 100}% ${(p + 1) / i.length * 100}%`).join(", ");
1067
1330
  return /* @__PURE__ */ a(
1068
1331
  "div",
1069
1332
  {
@@ -1077,10 +1340,10 @@ function ie({ expr: e, height: t }) {
1077
1340
  }
1078
1341
  );
1079
1342
  }
1080
- function xe(e, t) {
1081
- return typeof e == "string" ? e : W(e) ? Me(e)[0] ?? t : t;
1343
+ function De(e, t) {
1344
+ return typeof e == "string" ? e : W(e) ? ze(e)[0] ?? t : t;
1082
1345
  }
1083
- function pa({ style: e }) {
1346
+ function ka({ style: e }) {
1084
1347
  if (e.type === "fill") {
1085
1348
  const r = e.paint["fill-color"];
1086
1349
  return /* @__PURE__ */ a(
@@ -1088,7 +1351,7 @@ function pa({ style: e }) {
1088
1351
  {
1089
1352
  className: "mapui:h-8 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:overflow-hidden",
1090
1353
  "aria-label": "Style preview",
1091
- children: W(r) ? /* @__PURE__ */ a(ie, { expr: r, height: 32 }) : /* @__PURE__ */ a(
1354
+ children: W(r) ? /* @__PURE__ */ a(ue, { expr: r, height: 32 }) : /* @__PURE__ */ a(
1092
1355
  "div",
1093
1356
  {
1094
1357
  style: {
@@ -1110,7 +1373,7 @@ function pa({ style: e }) {
1110
1373
  {
1111
1374
  className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:rounded mapui:border mapui:border-gray-200 mapui:px-2",
1112
1375
  "aria-label": "Style preview",
1113
- children: W(r) ? /* @__PURE__ */ a(ie, { expr: r, height: e.paint["line-width"] }) : /* @__PURE__ */ a(
1376
+ children: W(r) ? /* @__PURE__ */ a(ue, { expr: r, height: e.paint["line-width"] }) : /* @__PURE__ */ a(
1114
1377
  "div",
1115
1378
  {
1116
1379
  style: {
@@ -1131,7 +1394,7 @@ function pa({ style: e }) {
1131
1394
  {
1132
1395
  className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
1133
1396
  "aria-label": "Style preview",
1134
- children: W(r) ? /* @__PURE__ */ a("div", { style: { width: n, height: n, borderRadius: "50%", overflow: "hidden" }, children: /* @__PURE__ */ a(ie, { expr: r, height: n }) }) : /* @__PURE__ */ a(
1397
+ children: W(r) ? /* @__PURE__ */ a("div", { style: { width: n, height: n, borderRadius: "50%", overflow: "hidden" }, children: /* @__PURE__ */ a(ue, { expr: r, height: n }) }) : /* @__PURE__ */ a(
1135
1398
  "div",
1136
1399
  {
1137
1400
  style: {
@@ -1147,7 +1410,7 @@ function pa({ style: e }) {
1147
1410
  }
1148
1411
  );
1149
1412
  }
1150
- const t = xe(e.paint["text-color"], "#333333"), i = xe(e.paint["icon-color"], "#333333");
1413
+ const t = De(e.paint["text-color"], "#333333"), i = De(e.paint["icon-color"], "#333333");
1151
1414
  return /* @__PURE__ */ a(
1152
1415
  "div",
1153
1416
  {
@@ -1167,7 +1430,7 @@ function pa({ style: e }) {
1167
1430
  }
1168
1431
  );
1169
1432
  }
1170
- const ua = [
1433
+ const Ca = [
1171
1434
  // Appearance (paint)
1172
1435
  { key: "fill-color", label: "Fill Color", widget: "color", group: "Appearance", category: "paint" },
1173
1436
  { key: "fill-opacity", label: "Fill Opacity", widget: "opacity", group: "Appearance", category: "paint" },
@@ -1179,7 +1442,7 @@ const ua = [
1179
1442
  { key: "fill-translate-anchor", label: "Translate Anchor", widget: "enum", group: "Transform", category: "paint", options: ["map", "viewport"], enableDefault: "map", description: '"map" moves the fill with the map when panning; "viewport" keeps the offset fixed on screen.' },
1180
1443
  // Sorting (layout)
1181
1444
  { key: "fill-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
1182
- ], ma = [
1445
+ ], Sa = [
1183
1446
  // Appearance (paint)
1184
1447
  { key: "line-color", label: "Line Color", widget: "color", group: "Appearance", category: "paint" },
1185
1448
  { key: "line-width", label: "Line Width", widget: "number", group: "Appearance", category: "paint", min: 0, step: 0.5 },
@@ -1200,7 +1463,7 @@ const ua = [
1200
1463
  { key: "line-round-limit", label: "Round Limit", widget: "number", group: "Cap & Join", category: "layout", step: 0.1, enableDefault: 1.05, description: 'When line-join is "round", angles sharper than this threshold (in radians) are bevelled instead of rounded.' },
1201
1464
  // Sorting (layout)
1202
1465
  { key: "line-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
1203
- ], sa = [
1466
+ ], Ta = [
1204
1467
  // Appearance (paint)
1205
1468
  { key: "circle-color", label: "Circle Color", widget: "color", group: "Appearance", category: "paint" },
1206
1469
  { key: "circle-radius", label: "Radius", widget: "number", group: "Appearance", category: "paint", min: 0, step: 1 },
@@ -1218,7 +1481,7 @@ const ua = [
1218
1481
  { key: "circle-pitch-alignment", label: "Pitch Alignment", widget: "enum", group: "Alignment", category: "paint", options: ["map", "viewport"], enableDefault: "viewport", description: '"map" orients circles flat on the map surface; "viewport" keeps circles facing the screen (default).' },
1219
1482
  // Sorting (layout)
1220
1483
  { key: "circle-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
1221
- ], ca = [
1484
+ ], Da = [
1222
1485
  // Icon Appearance (paint)
1223
1486
  { key: "icon-color", label: "Icon Color", widget: "color", group: "Icon Appearance", category: "paint", enableDefault: "#000000" },
1224
1487
  { key: "icon-opacity", label: "Icon Opacity", widget: "opacity", group: "Icon Appearance", category: "paint", enableDefault: 1 },
@@ -1267,194 +1530,194 @@ const ua = [
1267
1530
  { key: "symbol-avoid-edges", label: "Avoid Edges", widget: "boolean", group: "Placement", category: "layout", enableDefault: !1, description: "When enabled, symbols near tile edges are hidden to avoid being clipped or doubled at tile boundaries." },
1268
1531
  { key: "symbol-sort-key", label: "Sort Key", widget: "number", group: "Placement", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are prioritised in collision detection and drawn on top within this layer." },
1269
1532
  { key: "symbol-z-order", label: "Z-Order", widget: "enum", group: "Placement", category: "layout", options: ["auto", "viewport-y", "source"], enableDefault: "auto", description: '"viewport-y" renders symbols in top-to-bottom screen order (closer = higher); "source" preserves data source order; "auto" uses "viewport-y" when sort-key is unset.' }
1270
- ], da = {
1271
- fill: ua,
1272
- line: ma,
1273
- circle: sa,
1274
- symbol: ca
1533
+ ], La = {
1534
+ fill: Ca,
1535
+ line: Sa,
1536
+ circle: Ta,
1537
+ symbol: Da
1275
1538
  };
1276
- function ha(e) {
1277
- return da[e] ?? [];
1539
+ function Aa(e) {
1540
+ return La[e] ?? [];
1278
1541
  }
1279
- function we(e) {
1542
+ function Le(e) {
1280
1543
  const t = {};
1281
1544
  for (const i of e)
1282
1545
  t[i.group] || (t[i.group] = []), t[i.group].push(i);
1283
1546
  return t;
1284
1547
  }
1285
- const me = {
1548
+ const ge = {
1286
1549
  type: "fill",
1287
1550
  paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 }
1288
- }, ga = {
1551
+ }, Ea = {
1289
1552
  type: "line",
1290
1553
  paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
1291
- }, Oe = {
1554
+ }, Ge = {
1292
1555
  type: "circle",
1293
1556
  paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
1294
- }, ba = {
1557
+ }, Ia = {
1295
1558
  type: "symbol",
1296
1559
  paint: { "text-color": "#333333" },
1297
1560
  layout: { "text-field": "{name}", "text-size": 14 }
1298
- }, ya = {
1561
+ }, Fa = {
1299
1562
  layout: { "icon-image": "" }
1300
1563
  };
1301
- function ve(e) {
1564
+ function Ae(e) {
1302
1565
  if (e.type !== "symbol") return "text";
1303
1566
  const t = e.layout ?? {}, i = "icon-image" in t, r = "text-field" in t;
1304
1567
  return i && r ? "both" : i ? "icon" : "text";
1305
1568
  }
1306
- const fa = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", K = {
1569
+ const Ma = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", ae = {
1307
1570
  fill: "Fill",
1308
1571
  line: "Line",
1309
1572
  circle: "Circle",
1310
1573
  symbol: "Symbol"
1311
- }, xa = ["text", "icon", "both"];
1312
- function wa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties: p, onFetchDistinctValues: o }) {
1313
- const b = r ?? (i ? [i] : []), [m, w] = A(() => ve(e));
1314
- X(() => {
1315
- w(ve(e));
1574
+ }, Pa = ["text", "icon", "both"];
1575
+ function Oa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties: o, onFetchDistinctValues: p }) {
1576
+ const x = r ?? (i ? [i] : []), [s, g] = S(() => Ae(e));
1577
+ V(() => {
1578
+ g(Ae(e));
1316
1579
  }, [e.type]);
1317
- const d = (y) => {
1318
- t(y === "fill" ? me : y === "line" ? ga : y === "circle" ? Oe : ba);
1319
- }, f = (y) => {
1320
- if (y === m) return;
1321
- const $ = e.paint ?? {}, M = e.layout ?? {};
1322
- let g = { ...$ }, k = { ...M };
1323
- y === "icon" ? (g = Object.fromEntries(Object.entries(g).filter(([O]) => !O.startsWith("text-"))), k = Object.fromEntries(Object.entries(k).filter(([O]) => !O.startsWith("text-"))), "icon-image" in k || (k["icon-image"] = ya.layout["icon-image"])) : y === "text" && (g = Object.fromEntries(Object.entries(g).filter(([O]) => !O.startsWith("icon-"))), k = Object.fromEntries(Object.entries(k).filter(([O]) => !O.startsWith("icon-"))), "text-field" in k || (k["text-field"] = "{name}"), "text-size" in k || (k["text-size"] = 14), "text-color" in g || (g["text-color"] = "#333333")), w(y), t({
1580
+ const y = (h) => {
1581
+ t(h === "fill" ? ge : h === "line" ? Ea : h === "circle" ? Ge : Ia);
1582
+ }, w = (h) => {
1583
+ if (h === s) return;
1584
+ const F = e.paint ?? {}, P = e.layout ?? {};
1585
+ let f = { ...F }, k = { ...P };
1586
+ h === "icon" ? (f = Object.fromEntries(Object.entries(f).filter(([O]) => !O.startsWith("text-"))), k = Object.fromEntries(Object.entries(k).filter(([O]) => !O.startsWith("text-"))), "icon-image" in k || (k["icon-image"] = Fa.layout["icon-image"])) : h === "text" && (f = Object.fromEntries(Object.entries(f).filter(([O]) => !O.startsWith("icon-"))), k = Object.fromEntries(Object.entries(k).filter(([O]) => !O.startsWith("icon-"))), "text-field" in k || (k["text-field"] = "{name}"), "text-size" in k || (k["text-size"] = 14), "text-color" in f || (f["text-color"] = "#333333")), g(h), t({
1324
1587
  ...e,
1325
- paint: g,
1588
+ paint: f,
1326
1589
  layout: Object.keys(k).length > 0 ? k : void 0
1327
1590
  });
1328
- }, c = (y, $) => {
1329
- const M = { ...e.paint, [y]: $ };
1330
- for (const g of Object.keys(M))
1331
- M[g] === void 0 && delete M[g];
1332
- t({ ...e, paint: M });
1333
- }, u = (y, $) => {
1334
- const g = { ...e.layout ?? {}, [y]: $ };
1335
- for (const k of Object.keys(g))
1336
- g[k] === void 0 && delete g[k];
1591
+ }, c = (h, F) => {
1592
+ const P = { ...e.paint, [h]: F };
1593
+ for (const f of Object.keys(P))
1594
+ P[f] === void 0 && delete P[f];
1595
+ t({ ...e, paint: P });
1596
+ }, u = (h, F) => {
1597
+ const f = { ...e.layout ?? {}, [h]: F };
1598
+ for (const k of Object.keys(f))
1599
+ f[k] === void 0 && delete f[k];
1337
1600
  t({
1338
1601
  ...e,
1339
- layout: Object.keys(g).length > 0 ? g : void 0
1602
+ layout: Object.keys(f).length > 0 ? f : void 0
1340
1603
  });
1341
1604
  };
1342
- let s = ha(e.type);
1343
- e.type === "symbol" && (m === "text" ? s = s.filter((y) => !y.key.startsWith("icon-")) : m === "icon" && (s = s.filter((y) => !y.key.startsWith("text-"))));
1344
- const v = s.filter((y) => y.category === "paint"), N = s.filter((y) => y.category === "layout"), S = we(v), x = we(N), P = e.paint, C = e.layout ?? {}, L = Object.keys(S), E = Object.keys(x);
1605
+ let d = Aa(e.type);
1606
+ e.type === "symbol" && (s === "text" ? d = d.filter((h) => !h.key.startsWith("icon-")) : s === "icon" && (d = d.filter((h) => !h.key.startsWith("text-"))));
1607
+ const N = d.filter((h) => h.category === "paint"), v = d.filter((h) => h.category === "layout"), T = Le(N), E = Le(v), j = e.paint, m = e.layout ?? {}, I = Object.keys(T), M = Object.keys(E);
1345
1608
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1346
- b.length > 0 && !b.includes(e.type) && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-blue-800", children: [
1609
+ x.length > 0 && !x.includes(e.type) && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-blue-800", children: [
1347
1610
  /* @__PURE__ */ l("span", { children: [
1348
1611
  "Detected geometry is suitable for",
1349
1612
  " ",
1350
- b.map((y, $) => /* @__PURE__ */ l("span", { children: [
1351
- $ > 0 && ($ === b.length - 1 ? " or " : ", "),
1352
- /* @__PURE__ */ a("strong", { children: K[y] })
1353
- ] }, y)),
1613
+ x.map((h, F) => /* @__PURE__ */ l("span", { children: [
1614
+ F > 0 && (F === x.length - 1 ? " or " : ", "),
1615
+ /* @__PURE__ */ a("strong", { children: ae[h] })
1616
+ ] }, h)),
1354
1617
  " ",
1355
1618
  "style."
1356
1619
  ] }),
1357
- /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: b.map((y) => /* @__PURE__ */ a(
1620
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: x.map((h) => /* @__PURE__ */ a(
1358
1621
  "button",
1359
1622
  {
1360
1623
  type: "button",
1361
- onClick: () => d(y),
1624
+ onClick: () => y(h),
1362
1625
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-400 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-blue-700 hover:mapui:bg-blue-100",
1363
- children: K[y]
1626
+ children: ae[h]
1364
1627
  },
1365
- y
1628
+ h
1366
1629
  )) })
1367
1630
  ] }),
1368
- /* @__PURE__ */ a(D, { label: "Style Type", children: /* @__PURE__ */ a(
1631
+ /* @__PURE__ */ a(C, { label: "Style Type", children: /* @__PURE__ */ a(
1369
1632
  "select",
1370
1633
  {
1371
1634
  value: e.type,
1372
- onChange: (y) => d(y.target.value),
1373
- className: fa,
1374
- children: Object.keys(K).map((y) => /* @__PURE__ */ a("option", { value: y, children: K[y] }, y))
1635
+ onChange: (h) => y(h.target.value),
1636
+ className: Ma,
1637
+ children: Object.keys(ae).map((h) => /* @__PURE__ */ a("option", { value: h, children: ae[h] }, h))
1375
1638
  }
1376
1639
  ) }),
1377
- e.type === "symbol" && /* @__PURE__ */ a(D, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: xa.map((y) => /* @__PURE__ */ a(
1640
+ e.type === "symbol" && /* @__PURE__ */ a(C, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: Pa.map((h) => /* @__PURE__ */ a(
1378
1641
  "button",
1379
1642
  {
1380
1643
  type: "button",
1381
- onClick: () => f(y),
1644
+ onClick: () => w(h),
1382
1645
  className: [
1383
1646
  "mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-sm mapui:capitalize mapui:outline-none",
1384
1647
  "focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
1385
- m === y ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
1648
+ s === h ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
1386
1649
  ].join(" "),
1387
- children: y === "both" ? "Both" : y.charAt(0).toUpperCase() + y.slice(1)
1650
+ children: h === "both" ? "Both" : h.charAt(0).toUpperCase() + h.slice(1)
1388
1651
  },
1389
- y
1652
+ h
1390
1653
  )) }) }),
1391
1654
  /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
1392
1655
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
1393
- /* @__PURE__ */ a(pa, { style: e })
1656
+ /* @__PURE__ */ a(ka, { style: e })
1394
1657
  ] }),
1395
- E.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1658
+ M.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1396
1659
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
1397
- E.map((y, $) => /* @__PURE__ */ a(
1398
- fe,
1660
+ M.map((h, F) => /* @__PURE__ */ a(
1661
+ Te,
1399
1662
  {
1400
- title: y,
1401
- properties: x[y],
1402
- values: C,
1663
+ title: h,
1664
+ properties: E[h],
1665
+ values: m,
1403
1666
  onChange: u,
1404
- defaultOpen: $ === 0,
1667
+ defaultOpen: F === 0,
1405
1668
  availableIcons: n,
1406
- availableProperties: p,
1407
- onFetchDistinctValues: o
1669
+ availableProperties: o,
1670
+ onFetchDistinctValues: p
1408
1671
  },
1409
- y
1672
+ h
1410
1673
  ))
1411
1674
  ] }),
1412
- L.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1675
+ I.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1413
1676
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
1414
- L.map((y) => /* @__PURE__ */ a(
1415
- fe,
1677
+ I.map((h) => /* @__PURE__ */ a(
1678
+ Te,
1416
1679
  {
1417
- title: y,
1418
- properties: S[y],
1419
- values: P,
1680
+ title: h,
1681
+ properties: T[h],
1682
+ values: j,
1420
1683
  onChange: c,
1421
1684
  defaultOpen: !1,
1422
1685
  availableIcons: n,
1423
- availableProperties: p,
1424
- onFetchDistinctValues: o
1686
+ availableProperties: o,
1687
+ onFetchDistinctValues: p
1425
1688
  },
1426
- y
1689
+ h
1427
1690
  ))
1428
1691
  ] })
1429
1692
  ] });
1430
1693
  }
1431
- const Ne = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1432
- function va({ value: e, onChange: t }) {
1694
+ const Ee = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1695
+ function ja({ value: e, onChange: t }) {
1433
1696
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1434
- /* @__PURE__ */ a(D, { label: "Label", children: /* @__PURE__ */ a(
1697
+ /* @__PURE__ */ a(C, { label: "Label", children: /* @__PURE__ */ a(
1435
1698
  "input",
1436
1699
  {
1437
1700
  type: "text",
1438
1701
  value: e.label,
1439
1702
  onChange: (i) => t({ ...e, label: i.target.value }),
1440
1703
  placeholder: "Legend entry label",
1441
- className: Ne
1704
+ className: Ee
1442
1705
  }
1443
1706
  ) }),
1444
- /* @__PURE__ */ a(D, { label: "Color", children: /* @__PURE__ */ a(
1445
- Y,
1707
+ /* @__PURE__ */ a(C, { label: "Color", children: /* @__PURE__ */ a(
1708
+ H,
1446
1709
  {
1447
1710
  value: e.color,
1448
1711
  onChange: (i) => t({ ...e, color: i }),
1449
1712
  label: "Entry color"
1450
1713
  }
1451
1714
  ) }),
1452
- /* @__PURE__ */ a(D, { label: "Shape", children: /* @__PURE__ */ l(
1715
+ /* @__PURE__ */ a(C, { label: "Shape", children: /* @__PURE__ */ l(
1453
1716
  "select",
1454
1717
  {
1455
1718
  value: e.shape ?? "square",
1456
1719
  onChange: (i) => t({ ...e, shape: i.target.value }),
1457
- className: Ne,
1720
+ className: Ee,
1458
1721
  children: [
1459
1722
  /* @__PURE__ */ a("option", { value: "square", children: "Square" }),
1460
1723
  /* @__PURE__ */ a("option", { value: "circle", children: "Circle" }),
@@ -1464,43 +1727,43 @@ function va({ value: e, onChange: t }) {
1464
1727
  ) })
1465
1728
  ] });
1466
1729
  }
1467
- const ke = () => ({ label: "", color: "#4a90d9", shape: "square" }), re = 8, Ce = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1468
- function Na({ value: e, onChange: t, styles: i }) {
1469
- const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", p = Ee(() => {
1730
+ const Ie = () => ({ label: "", color: "#4a90d9", shape: "square" }), me = 8, Fe = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
1731
+ function $a({ value: e, onChange: t, styles: i }) {
1732
+ const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", o = Be(() => {
1470
1733
  if (!i || i.length === 0) return null;
1471
1734
  const c = [];
1472
- let u = "simple", s = null;
1473
- for (const v of i) {
1474
- const N = na(v), S = oa(v);
1475
- if (W(N)) {
1476
- const x = ia(N);
1477
- if (!x) continue;
1478
- const P = ra(N).map((C) => ({ label: C.label, color: C.color, shape: S }));
1479
- c.push(...P), x === "interpolate" ? (u = "gradient", s || (s = la(N))) : u === "simple" && (u = "categorical");
1480
- } else typeof N == "string" && c.push({ label: v.type, color: N, shape: S });
1735
+ let u = "simple", d = null;
1736
+ for (const N of i) {
1737
+ const v = Na(N), T = va(N);
1738
+ if (W(v)) {
1739
+ const E = fa(v);
1740
+ if (!E) continue;
1741
+ const j = xa(v).map((m) => ({ label: m.label, color: m.color, shape: T }));
1742
+ c.push(...j), E === "interpolate" ? (u = "gradient", d || (d = wa(v))) : u === "simple" && (u = "categorical");
1743
+ } else typeof v == "string" && c.length === 0 && c.push({ label: N.type, color: v, shape: T });
1481
1744
  }
1482
- return c.length === 0 ? null : { entries: c, mode: u, property: s };
1483
- }, [i]), o = () => {
1484
- t({ ...e, entries: [...r, ke()] });
1485
- }, b = (c, u) => {
1486
- const s = r.map((v, N) => N === c ? u : v);
1487
- t({ ...e, entries: s });
1488
- }, m = (c) => {
1489
- const u = r.filter((s, v) => v !== c);
1745
+ return c.length === 0 ? null : { entries: c, mode: u, property: d };
1746
+ }, [i]), p = () => {
1747
+ t({ ...e, entries: [...r, Ie()] });
1748
+ }, x = (c, u) => {
1749
+ const d = r.map((N, v) => v === c ? u : N);
1750
+ t({ ...e, entries: d });
1751
+ }, s = (c) => {
1752
+ const u = r.filter((d, N) => N !== c);
1490
1753
  t(u.length > 0 ? { ...e, entries: u } : void 0);
1491
- }, w = (c) => {
1492
- t(c ? { entries: [ke()] } : void 0);
1493
- }, d = () => {
1494
- p && t({
1495
- entries: p.entries,
1496
- displayMode: p.mode,
1497
- ...p.mode === "gradient" && p.property ? { gradientProperty: p.property } : {},
1498
- ...p.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
1754
+ }, g = (c) => {
1755
+ t(c ? { entries: [Ie()] } : void 0);
1756
+ }, y = () => {
1757
+ o && t({
1758
+ entries: o.entries,
1759
+ displayMode: o.mode,
1760
+ ...o.mode === "gradient" && o.property ? { gradientProperty: o.property } : {},
1761
+ ...o.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
1499
1762
  });
1500
- }, f = (c) => {
1763
+ }, w = (c) => {
1501
1764
  if (!e) return;
1502
1765
  const u = { ...e, displayMode: c };
1503
- c !== "categorical" && delete u.showLabelsCollapsed, c !== "categorical" && delete u.showColorBar, c !== "gradient" && delete u.gradientProperty, c === "simple" && delete u.showDisclosureArrow, t(u);
1766
+ c !== "categorical" && delete u.showLabelsCollapsed, c !== "categorical" && c !== "gradient" && delete u.showColorBar, c !== "gradient" && delete u.gradientProperty, c === "simple" && delete u.showDisclosureArrow, t(u);
1504
1767
  };
1505
1768
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1506
1769
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
@@ -1510,16 +1773,16 @@ function Na({ value: e, onChange: t, styles: i }) {
1510
1773
  type: "checkbox",
1511
1774
  id: "legend-enabled",
1512
1775
  checked: e !== void 0,
1513
- onChange: (c) => w(c.target.checked),
1776
+ onChange: (c) => g(c.target.checked),
1514
1777
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1515
1778
  }
1516
1779
  ),
1517
1780
  /* @__PURE__ */ a("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
1518
1781
  ] }),
1519
- e === void 0 && p && p.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
1520
- /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: p.mode !== "simple" ? `This layer uses data-driven colors (${p.entries.length} ${p.entries.length === 1 ? "category" : "categories"})` : `This layer has ${p.entries.length} style ${p.entries.length === 1 ? "color" : "colors"}` }),
1782
+ e === void 0 && o && o.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
1783
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: o.mode !== "simple" ? `This layer uses data-driven colors (${o.entries.length} ${o.entries.length === 1 ? "category" : "categories"})` : `This layer has ${o.entries.length} style ${o.entries.length === 1 ? "color" : "colors"}` }),
1521
1784
  /* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
1522
- p.entries.slice(0, re).map((c, u) => /* @__PURE__ */ l(
1785
+ o.entries.slice(0, me).map((c, u) => /* @__PURE__ */ l(
1523
1786
  "div",
1524
1787
  {
1525
1788
  className: "mapui:flex mapui:items-center mapui:gap-1",
@@ -1537,9 +1800,9 @@ function Na({ value: e, onChange: t, styles: i }) {
1537
1800
  },
1538
1801
  `${c.label}-${u}`
1539
1802
  )),
1540
- p.entries.length > re && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
1803
+ o.entries.length > me && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
1541
1804
  "+",
1542
- p.entries.length - re,
1805
+ o.entries.length - me,
1543
1806
  " more"
1544
1807
  ] })
1545
1808
  ] }),
@@ -1547,13 +1810,13 @@ function Na({ value: e, onChange: t, styles: i }) {
1547
1810
  "button",
1548
1811
  {
1549
1812
  type: "button",
1550
- onClick: d,
1813
+ onClick: y,
1551
1814
  className: "mapui:mt-2 mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-100",
1552
1815
  children: "Generate from Style"
1553
1816
  }
1554
1817
  )
1555
1818
  ] }),
1556
- e !== void 0 && /* @__PURE__ */ l(q, { children: [
1819
+ e !== void 0 && /* @__PURE__ */ l(U, { children: [
1557
1820
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1558
1821
  /* @__PURE__ */ a("label", { htmlFor: "legend-display-mode", className: "mapui:text-sm mapui:text-gray-700", children: "Display Mode" }),
1559
1822
  /* @__PURE__ */ l(
@@ -1561,8 +1824,8 @@ function Na({ value: e, onChange: t, styles: i }) {
1561
1824
  {
1562
1825
  id: "legend-display-mode",
1563
1826
  value: n,
1564
- onChange: (c) => f(c.target.value),
1565
- className: Ce,
1827
+ onChange: (c) => w(c.target.value),
1828
+ className: Fe,
1566
1829
  children: [
1567
1830
  /* @__PURE__ */ a("option", { value: "simple", children: "Simple" }),
1568
1831
  /* @__PURE__ */ a("option", { value: "categorical", children: "Categorical" }),
@@ -1584,7 +1847,7 @@ function Na({ value: e, onChange: t, styles: i }) {
1584
1847
  ),
1585
1848
  /* @__PURE__ */ a("label", { htmlFor: "legend-show-labels-collapsed", className: "mapui:text-sm mapui:text-gray-700", children: "Show labels in collapsed view" })
1586
1849
  ] }),
1587
- n === "categorical" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1850
+ (n === "categorical" || n === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1588
1851
  /* @__PURE__ */ a(
1589
1852
  "input",
1590
1853
  {
@@ -1611,7 +1874,7 @@ function Na({ value: e, onChange: t, styles: i }) {
1611
1874
  /* @__PURE__ */ a("label", { htmlFor: "legend-show-disclosure-arrow", className: "mapui:text-sm mapui:text-gray-700", children: "Show disclosure arrow" })
1612
1875
  ] }),
1613
1876
  n === "gradient" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1614
- /* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Property" }),
1877
+ /* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Label" }),
1615
1878
  /* @__PURE__ */ a(
1616
1879
  "input",
1617
1880
  {
@@ -1619,8 +1882,8 @@ function Na({ value: e, onChange: t, styles: i }) {
1619
1882
  id: "legend-gradient-property",
1620
1883
  value: e.gradientProperty ?? "",
1621
1884
  onChange: (c) => t({ ...e, gradientProperty: c.target.value || void 0 }),
1622
- placeholder: "e.g. POP_EST",
1623
- className: Ce
1885
+ placeholder: "e.g. Population",
1886
+ className: Fe
1624
1887
  }
1625
1888
  )
1626
1889
  ] }),
@@ -1638,17 +1901,17 @@ function Na({ value: e, onChange: t, styles: i }) {
1638
1901
  "button",
1639
1902
  {
1640
1903
  type: "button",
1641
- onClick: () => m(u),
1904
+ onClick: () => s(u),
1642
1905
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1643
1906
  children: "Remove"
1644
1907
  }
1645
1908
  )
1646
1909
  ] }),
1647
1910
  /* @__PURE__ */ a(
1648
- va,
1911
+ ja,
1649
1912
  {
1650
1913
  value: c,
1651
- onChange: (s) => b(u, s)
1914
+ onChange: (d) => x(u, d)
1652
1915
  }
1653
1916
  )
1654
1917
  ]
@@ -1660,20 +1923,20 @@ function Na({ value: e, onChange: t, styles: i }) {
1660
1923
  "button",
1661
1924
  {
1662
1925
  type: "button",
1663
- onClick: o,
1926
+ onClick: p,
1664
1927
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
1665
1928
  children: "+ Add Entry"
1666
1929
  }
1667
1930
  ),
1668
- p && p.entries.length > 0 && /* @__PURE__ */ l(
1931
+ o && o.entries.length > 0 && /* @__PURE__ */ l(
1669
1932
  "button",
1670
1933
  {
1671
1934
  type: "button",
1672
- onClick: d,
1935
+ onClick: y,
1673
1936
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-50",
1674
1937
  children: [
1675
1938
  "Populate from Style (",
1676
- p.entries.length,
1939
+ o.entries.length,
1677
1940
  " entries)"
1678
1941
  ]
1679
1942
  }
@@ -1682,47 +1945,47 @@ function Na({ value: e, onChange: t, styles: i }) {
1682
1945
  ] })
1683
1946
  ] });
1684
1947
  }
1685
- function Se({
1948
+ function Me({
1686
1949
  options: e,
1687
1950
  onChange: t,
1688
1951
  placeholder: i,
1689
1952
  className: r
1690
1953
  }) {
1691
- const [n, p] = A(() => (e == null ? void 0 : e.join(", ")) ?? "");
1692
- return X(() => {
1693
- p((e == null ? void 0 : e.join(", ")) ?? "");
1954
+ const [n, o] = S(() => (e == null ? void 0 : e.join(", ")) ?? "");
1955
+ return V(() => {
1956
+ o((e == null ? void 0 : e.join(", ")) ?? "");
1694
1957
  }, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
1695
1958
  "input",
1696
1959
  {
1697
1960
  type: "text",
1698
1961
  value: n,
1699
- onChange: (b) => p(b.target.value),
1962
+ onChange: (x) => o(x.target.value),
1700
1963
  onBlur: () => {
1701
- const b = n.trim(), m = b ? b.split(",").map((w) => w.trim()).filter(Boolean) : void 0;
1702
- t(m), p((m == null ? void 0 : m.join(", ")) ?? "");
1964
+ const x = n.trim(), s = x ? x.split(",").map((g) => g.trim()).filter(Boolean) : void 0;
1965
+ t(s), o((s == null ? void 0 : s.join(", ")) ?? "");
1703
1966
  },
1704
1967
  placeholder: i,
1705
1968
  className: r
1706
1969
  }
1707
1970
  );
1708
1971
  }
1709
- const R = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", ka = {
1972
+ const $ = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", Ra = {
1710
1973
  text: { type: "text", property: "", label: "", autocomplete: !1 },
1711
1974
  number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
1712
1975
  datetime: { type: "datetime", property: "", label: "", range: !1 },
1713
1976
  select: { type: "select", property: "", label: "" }
1714
1977
  };
1715
- function Ca({ value: e, onChange: t, availableProperties: i }) {
1716
- const r = (o) => {
1717
- t({ ...ka[o], property: e.property, label: e.label });
1718
- }, n = (o) => t({ ...e, ...o }), p = i && i.length > 0;
1978
+ function Ba({ value: e, onChange: t, availableProperties: i }) {
1979
+ const r = (p) => {
1980
+ t({ ...Ra[p], property: e.property, label: e.label });
1981
+ }, n = (p) => t({ ...e, ...p }), o = i && i.length > 0;
1719
1982
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1720
- /* @__PURE__ */ a(D, { label: "Field Type", children: /* @__PURE__ */ l(
1983
+ /* @__PURE__ */ a(C, { label: "Field Type", children: /* @__PURE__ */ l(
1721
1984
  "select",
1722
1985
  {
1723
1986
  value: e.type,
1724
- onChange: (o) => r(o.target.value),
1725
- className: R,
1987
+ onChange: (p) => r(p.target.value),
1988
+ className: $,
1726
1989
  children: [
1727
1990
  /* @__PURE__ */ a("option", { value: "text", children: "Text" }),
1728
1991
  /* @__PURE__ */ a("option", { value: "number", children: "Number" }),
@@ -1731,15 +1994,15 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1731
1994
  ]
1732
1995
  }
1733
1996
  ) }),
1734
- /* @__PURE__ */ a(D, { label: "Property", required: !0, children: p ? /* @__PURE__ */ l(
1997
+ /* @__PURE__ */ a(C, { label: "Property", required: !0, children: o ? /* @__PURE__ */ l(
1735
1998
  "select",
1736
1999
  {
1737
2000
  value: e.property,
1738
- onChange: (o) => n({ property: o.target.value }),
1739
- className: R,
2001
+ onChange: (p) => n({ property: p.target.value }),
2002
+ className: $,
1740
2003
  children: [
1741
2004
  /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
1742
- i.map((o) => /* @__PURE__ */ a("option", { value: o.name, children: o.title ?? o.name }, o.name))
2005
+ i.map((p) => /* @__PURE__ */ a("option", { value: p.name, children: p.title ?? p.name }, p.name))
1743
2006
  ]
1744
2007
  }
1745
2008
  ) : /* @__PURE__ */ a(
@@ -1747,32 +2010,32 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1747
2010
  {
1748
2011
  type: "text",
1749
2012
  value: e.property,
1750
- onChange: (o) => n({ property: o.target.value }),
2013
+ onChange: (p) => n({ property: p.target.value }),
1751
2014
  placeholder: "e.g. name",
1752
- className: R
2015
+ className: $
1753
2016
  }
1754
2017
  ) }),
1755
- /* @__PURE__ */ a(D, { label: "Label", children: /* @__PURE__ */ a(
2018
+ /* @__PURE__ */ a(C, { label: "Label", children: /* @__PURE__ */ a(
1756
2019
  "input",
1757
2020
  {
1758
2021
  type: "text",
1759
2022
  value: e.label,
1760
- onChange: (o) => n({ label: o.target.value }),
2023
+ onChange: (p) => n({ label: p.target.value }),
1761
2024
  placeholder: "Display label",
1762
- className: R
2025
+ className: $
1763
2026
  }
1764
2027
  ) }),
1765
- /* @__PURE__ */ a(D, { label: "Placeholder", children: /* @__PURE__ */ a(
2028
+ /* @__PURE__ */ a(C, { label: "Placeholder", children: /* @__PURE__ */ a(
1766
2029
  "input",
1767
2030
  {
1768
2031
  type: "text",
1769
2032
  value: e.placeholder ?? "",
1770
- onChange: (o) => n({ placeholder: o.target.value || void 0 }),
2033
+ onChange: (p) => n({ placeholder: p.target.value || void 0 }),
1771
2034
  placeholder: "Input placeholder text",
1772
- className: R
2035
+ className: $
1773
2036
  }
1774
2037
  ) }),
1775
- e.type === "text" && /* @__PURE__ */ l(q, { children: [
2038
+ e.type === "text" && /* @__PURE__ */ l(U, { children: [
1776
2039
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1777
2040
  /* @__PURE__ */ a(
1778
2041
  "input",
@@ -1780,7 +2043,7 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1780
2043
  type: "checkbox",
1781
2044
  id: "text-autocomplete",
1782
2045
  checked: e.autocomplete ?? !1,
1783
- onChange: (o) => t({ ...e, autocomplete: o.target.checked }),
2046
+ onChange: (p) => t({ ...e, autocomplete: p.target.checked }),
1784
2047
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1785
2048
  }
1786
2049
  ),
@@ -1793,47 +2056,60 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1793
2056
  type: "checkbox",
1794
2057
  id: "text-prefetch",
1795
2058
  checked: e.prefetch ?? !1,
1796
- onChange: (o) => t({ ...e, prefetch: o.target.checked }),
2059
+ onChange: (p) => t({ ...e, prefetch: p.target.checked }),
1797
2060
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1798
2061
  }
1799
2062
  ),
1800
2063
  /* @__PURE__ */ a("label", { htmlFor: "text-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1801
2064
  ] }),
1802
- /* @__PURE__ */ a(D, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
1803
- Se,
2065
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
2066
+ /* @__PURE__ */ a(
2067
+ "input",
2068
+ {
2069
+ type: "checkbox",
2070
+ id: "text-zoomTo",
2071
+ checked: e.zoomTo ?? !1,
2072
+ onChange: (p) => t({ ...e, zoomTo: p.target.checked }),
2073
+ className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
2074
+ }
2075
+ ),
2076
+ /* @__PURE__ */ a("label", { htmlFor: "text-zoomTo", className: "mapui:text-sm mapui:text-gray-700", children: "Zoom to Result" })
2077
+ ] }),
2078
+ /* @__PURE__ */ a(C, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
2079
+ Me,
1804
2080
  {
1805
2081
  options: e.options,
1806
- onChange: (o) => t({ ...e, options: o }),
2082
+ onChange: (p) => t({ ...e, options: p }),
1807
2083
  placeholder: "option1, option2",
1808
- className: R
2084
+ className: $
1809
2085
  }
1810
2086
  ) })
1811
2087
  ] }),
1812
- e.type === "number" && /* @__PURE__ */ l(q, { children: [
1813
- /* @__PURE__ */ a(D, { label: "Input Mode", children: /* @__PURE__ */ l(
2088
+ e.type === "number" && /* @__PURE__ */ l(U, { children: [
2089
+ /* @__PURE__ */ a(C, { label: "Input Mode", children: /* @__PURE__ */ l(
1814
2090
  "select",
1815
2091
  {
1816
2092
  value: e.inputMode ?? "input",
1817
- onChange: (o) => t({
2093
+ onChange: (p) => t({
1818
2094
  ...e,
1819
- inputMode: o.target.value
2095
+ inputMode: p.target.value
1820
2096
  }),
1821
- className: R,
2097
+ className: $,
1822
2098
  children: [
1823
2099
  /* @__PURE__ */ a("option", { value: "input", children: "Input" }),
1824
2100
  /* @__PURE__ */ a("option", { value: "slider", children: "Slider" })
1825
2101
  ]
1826
2102
  }
1827
2103
  ) }),
1828
- /* @__PURE__ */ a(D, { label: "Operator", children: /* @__PURE__ */ l(
2104
+ /* @__PURE__ */ a(C, { label: "Operator", children: /* @__PURE__ */ l(
1829
2105
  "select",
1830
2106
  {
1831
2107
  value: e.operator ?? "eq",
1832
- onChange: (o) => t({
2108
+ onChange: (p) => t({
1833
2109
  ...e,
1834
- operator: o.target.value
2110
+ operator: p.target.value
1835
2111
  }),
1836
- className: R,
2112
+ className: $,
1837
2113
  children: [
1838
2114
  /* @__PURE__ */ a("option", { value: "eq", children: "Equal (=)" }),
1839
2115
  /* @__PURE__ */ a("option", { value: "gt", children: "Greater Than (>)" }),
@@ -1844,41 +2120,69 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1844
2120
  ]
1845
2121
  }
1846
2122
  ) }),
2123
+ /* @__PURE__ */ a(C, { label: "Operator Labels", children: /* @__PURE__ */ l(
2124
+ "select",
2125
+ {
2126
+ value: e.operatorLabelStyle ?? "symbol",
2127
+ onChange: (p) => t({
2128
+ ...e,
2129
+ operatorLabelStyle: p.target.value
2130
+ }),
2131
+ className: $,
2132
+ children: [
2133
+ /* @__PURE__ */ a("option", { value: "symbol", children: "Symbols (=, >, <)" }),
2134
+ /* @__PURE__ */ a("option", { value: "word", children: "Words (equal to, greater than)" })
2135
+ ]
2136
+ }
2137
+ ) }),
2138
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
2139
+ /* @__PURE__ */ a(
2140
+ "input",
2141
+ {
2142
+ type: "checkbox",
2143
+ id: "number-show-range",
2144
+ checked: e.showRange ?? !1,
2145
+ onChange: (p) => t({ ...e, showRange: p.target.checked }),
2146
+ className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
2147
+ }
2148
+ ),
2149
+ /* @__PURE__ */ a("label", { htmlFor: "number-show-range", className: "mapui:text-sm mapui:text-gray-700", children: "Show Range on Slider" })
2150
+ ] }),
1847
2151
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-3 mapui:gap-2", children: [
1848
- /* @__PURE__ */ a(D, { label: "Min", children: /* @__PURE__ */ a(
2152
+ /* @__PURE__ */ a(C, { label: "Min", children: /* @__PURE__ */ a(
1849
2153
  "input",
1850
2154
  {
1851
2155
  type: "number",
1852
2156
  value: e.min ?? "",
1853
- onChange: (o) => t({
2157
+ onChange: (p) => t({
1854
2158
  ...e,
1855
- min: o.target.value ? parseFloat(o.target.value) : void 0
2159
+ min: p.target.value ? parseFloat(p.target.value) : void 0
1856
2160
  }),
1857
- className: R
2161
+ className: $
1858
2162
  }
1859
2163
  ) }),
1860
- /* @__PURE__ */ a(D, { label: "Max", children: /* @__PURE__ */ a(
2164
+ /* @__PURE__ */ a(C, { label: "Max", children: /* @__PURE__ */ a(
1861
2165
  "input",
1862
2166
  {
1863
2167
  type: "number",
1864
2168
  value: e.max ?? "",
1865
- onChange: (o) => t({
2169
+ onChange: (p) => t({
1866
2170
  ...e,
1867
- max: o.target.value ? parseFloat(o.target.value) : void 0
2171
+ max: p.target.value ? parseFloat(p.target.value) : void 0
1868
2172
  }),
1869
- className: R
2173
+ className: $
1870
2174
  }
1871
2175
  ) }),
1872
- /* @__PURE__ */ a(D, { label: "Step", children: /* @__PURE__ */ a(
2176
+ /* @__PURE__ */ a(C, { label: "Step", children: /* @__PURE__ */ a(
1873
2177
  "input",
1874
2178
  {
1875
2179
  type: "number",
1876
2180
  value: e.step ?? "",
1877
- onChange: (o) => t({
2181
+ onChange: (p) => t({
1878
2182
  ...e,
1879
- step: o.target.value ? parseFloat(o.target.value) : void 0
2183
+ step: p.target.value ? parseFloat(p.target.value) : void 0
1880
2184
  }),
1881
- className: R
2185
+ className: $
1882
2186
  }
1883
2187
  ) })
1884
2188
  ] })
@@ -1890,13 +2194,13 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1890
2194
  type: "checkbox",
1891
2195
  id: "datetime-range",
1892
2196
  checked: e.range ?? !1,
1893
- onChange: (o) => t({ ...e, range: o.target.checked }),
2197
+ onChange: (p) => t({ ...e, range: p.target.checked }),
1894
2198
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1895
2199
  }
1896
2200
  ),
1897
2201
  /* @__PURE__ */ a("label", { htmlFor: "datetime-range", className: "mapui:text-sm mapui:text-gray-700", children: "Date Range" })
1898
2202
  ] }),
1899
- e.type === "select" && /* @__PURE__ */ l(q, { children: [
2203
+ e.type === "select" && /* @__PURE__ */ l(U, { children: [
1900
2204
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1901
2205
  /* @__PURE__ */ a(
1902
2206
  "input",
@@ -1904,58 +2208,71 @@ function Ca({ value: e, onChange: t, availableProperties: i }) {
1904
2208
  type: "checkbox",
1905
2209
  id: "select-prefetch",
1906
2210
  checked: e.prefetch ?? !1,
1907
- onChange: (o) => t({ ...e, prefetch: o.target.checked }),
2211
+ onChange: (p) => t({ ...e, prefetch: p.target.checked }),
1908
2212
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1909
2213
  }
1910
2214
  ),
1911
2215
  /* @__PURE__ */ a("label", { htmlFor: "select-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1912
2216
  ] }),
1913
- /* @__PURE__ */ a(D, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
1914
- Se,
2217
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
2218
+ /* @__PURE__ */ a(
2219
+ "input",
2220
+ {
2221
+ type: "checkbox",
2222
+ id: "select-zoomTo",
2223
+ checked: e.zoomTo ?? !1,
2224
+ onChange: (p) => t({ ...e, zoomTo: p.target.checked }),
2225
+ className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
2226
+ }
2227
+ ),
2228
+ /* @__PURE__ */ a("label", { htmlFor: "select-zoomTo", className: "mapui:text-sm mapui:text-gray-700", children: "Zoom to Result" })
2229
+ ] }),
2230
+ /* @__PURE__ */ a(C, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
2231
+ Me,
1915
2232
  {
1916
2233
  options: e.options,
1917
- onChange: (o) => t({ ...e, options: o }),
2234
+ onChange: (p) => t({ ...e, options: p }),
1918
2235
  placeholder: "option1, option2",
1919
- className: R
2236
+ className: $
1920
2237
  }
1921
2238
  ) })
1922
2239
  ] })
1923
2240
  ] });
1924
2241
  }
1925
- const Sa = () => ({
2242
+ const Ua = () => ({
1926
2243
  type: "text",
1927
2244
  property: "",
1928
2245
  label: "",
1929
2246
  autocomplete: !1
1930
2247
  });
1931
- function Da({ fields: e, onChange: t, availableProperties: i }) {
1932
- const [r, n] = A(null), p = () => {
1933
- const d = [...e, Sa()];
1934
- t(d), n(d.length - 1);
1935
- }, o = (d, f) => {
1936
- t(e.map((c, u) => u === d ? f : c));
1937
- }, b = (d) => {
1938
- t(e.filter((f, c) => c !== d)), n(null);
1939
- }, m = (d) => {
1940
- if (d === 0) return;
1941
- const f = [...e];
1942
- [f[d - 1], f[d]] = [f[d], f[d - 1]], t(f), n(d - 1);
1943
- }, w = (d) => {
1944
- if (d === e.length - 1) return;
1945
- const f = [...e];
1946
- [f[d], f[d + 1]] = [f[d + 1], f[d]], t(f), n(d + 1);
2248
+ function qa({ fields: e, onChange: t, availableProperties: i }) {
2249
+ const [r, n] = S(null), o = () => {
2250
+ const y = [...e, Ua()];
2251
+ t(y), n(y.length - 1);
2252
+ }, p = (y, w) => {
2253
+ t(e.map((c, u) => u === y ? w : c));
2254
+ }, x = (y) => {
2255
+ t(e.filter((w, c) => c !== y)), n(null);
2256
+ }, s = (y) => {
2257
+ if (y === 0) return;
2258
+ const w = [...e];
2259
+ [w[y - 1], w[y]] = [w[y], w[y - 1]], t(w), n(y - 1);
2260
+ }, g = (y) => {
2261
+ if (y === e.length - 1) return;
2262
+ const w = [...e];
2263
+ [w[y], w[y + 1]] = [w[y + 1], w[y]], t(w), n(y + 1);
1947
2264
  };
1948
2265
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1949
2266
  e.length === 0 && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
1950
- /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((d, f) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
2267
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((y, w) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
1951
2268
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
1952
2269
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
1953
2270
  /* @__PURE__ */ a(
1954
2271
  "button",
1955
2272
  {
1956
2273
  type: "button",
1957
- onClick: () => m(f),
1958
- disabled: f === 0,
2274
+ onClick: () => s(w),
2275
+ disabled: w === 0,
1959
2276
  "aria-label": "Move up",
1960
2277
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1961
2278
  children: "▲"
@@ -1965,8 +2282,8 @@ function Da({ fields: e, onChange: t, availableProperties: i }) {
1965
2282
  "button",
1966
2283
  {
1967
2284
  type: "button",
1968
- onClick: () => w(f),
1969
- disabled: f === e.length - 1,
2285
+ onClick: () => g(w),
2286
+ disabled: w === e.length - 1,
1970
2287
  "aria-label": "Move down",
1971
2288
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
1972
2289
  children: "▼"
@@ -1977,11 +2294,11 @@ function Da({ fields: e, onChange: t, availableProperties: i }) {
1977
2294
  "button",
1978
2295
  {
1979
2296
  type: "button",
1980
- onClick: () => n(r === f ? null : f),
2297
+ onClick: () => n(r === w ? null : w),
1981
2298
  className: "mapui:flex-1 mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:text-left mapui:text-sm mapui:font-medium mapui:text-gray-800",
1982
2299
  children: [
1983
- /* @__PURE__ */ a("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: d.type }),
1984
- d.label || d.property || "Untitled field"
2300
+ /* @__PURE__ */ a("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: y.type }),
2301
+ y.label || y.property || "Untitled field"
1985
2302
  ]
1986
2303
  }
1987
2304
  ),
@@ -1989,41 +2306,41 @@ function Da({ fields: e, onChange: t, availableProperties: i }) {
1989
2306
  "button",
1990
2307
  {
1991
2308
  type: "button",
1992
- onClick: () => b(f),
2309
+ onClick: () => x(w),
1993
2310
  "aria-label": "Remove field",
1994
2311
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
1995
2312
  children: "Remove"
1996
2313
  }
1997
2314
  )
1998
2315
  ] }),
1999
- r === f && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
2000
- Ca,
2316
+ r === w && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
2317
+ Ba,
2001
2318
  {
2002
- value: d,
2003
- onChange: (c) => o(f, c),
2319
+ value: y,
2320
+ onChange: (c) => p(w, c),
2004
2321
  availableProperties: i
2005
2322
  }
2006
2323
  ) })
2007
- ] }, f)) }),
2324
+ ] }, w)) }),
2008
2325
  /* @__PURE__ */ a(
2009
2326
  "button",
2010
2327
  {
2011
2328
  type: "button",
2012
- onClick: p,
2329
+ onClick: o,
2013
2330
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
2014
2331
  children: "+ Add Search Field"
2015
2332
  }
2016
2333
  )
2017
2334
  ] });
2018
2335
  }
2019
- function Ta(e) {
2336
+ function za(e) {
2020
2337
  return Object.entries(e).map(([t, i]) => ({
2021
2338
  key: t,
2022
2339
  label: i.label ?? "",
2023
2340
  visible: i.visible ?? !0
2024
2341
  }));
2025
2342
  }
2026
- function La(e) {
2343
+ function Ga(e) {
2027
2344
  const t = {};
2028
2345
  for (const i of e)
2029
2346
  t[i.key] = {
@@ -2032,36 +2349,36 @@ function La(e) {
2032
2349
  };
2033
2350
  return t;
2034
2351
  }
2035
- const le = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2036
- function Aa({ value: e, onChange: t, availableProperties: i }) {
2037
- const r = Ta(e), n = i && i.length > 0, p = (u) => t(La(u)), o = () => {
2038
- p([...r, { key: "", label: "", visible: !0 }]);
2039
- }, b = (u) => {
2040
- p(r.filter((s, v) => v !== u));
2041
- }, m = (u, s) => {
2042
- p(r.map((v, N) => N === u ? { ...v, ...s } : v));
2043
- }, w = (u, s) => {
2044
- const v = i == null ? void 0 : i.find((S) => S.name === s), N = (v == null ? void 0 : v.title) ?? r[u].label;
2045
- p(r.map((S, x) => x === u ? { ...S, key: s, label: N } : S));
2046
- }, d = (u) => {
2352
+ const se = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2353
+ function Wa({ value: e, onChange: t, availableProperties: i }) {
2354
+ const r = za(e), n = i && i.length > 0, o = (u) => t(Ga(u)), p = () => {
2355
+ o([...r, { key: "", label: "", visible: !0 }]);
2356
+ }, x = (u) => {
2357
+ o(r.filter((d, N) => N !== u));
2358
+ }, s = (u, d) => {
2359
+ o(r.map((N, v) => v === u ? { ...N, ...d } : N));
2360
+ }, g = (u, d) => {
2361
+ const N = i == null ? void 0 : i.find((T) => T.name === d), v = (N == null ? void 0 : N.title) ?? r[u].label;
2362
+ o(r.map((T, E) => E === u ? { ...T, key: d, label: v } : T));
2363
+ }, y = (u) => {
2047
2364
  if (u === 0) return;
2048
- const s = [...r];
2049
- [s[u - 1], s[u]] = [s[u], s[u - 1]], p(s);
2050
- }, f = (u) => {
2365
+ const d = [...r];
2366
+ [d[u - 1], d[u]] = [d[u], d[u - 1]], o(d);
2367
+ }, w = (u) => {
2051
2368
  if (u === r.length - 1) return;
2052
- const s = [...r];
2053
- [s[u], s[u + 1]] = [s[u + 1], s[u]], p(s);
2369
+ const d = [...r];
2370
+ [d[u], d[u + 1]] = [d[u + 1], d[u]], o(d);
2054
2371
  }, c = () => {
2055
2372
  if (!i) return;
2056
- const u = i.map((s) => ({
2057
- key: s.name,
2058
- label: s.title ?? "",
2373
+ const u = i.map((d) => ({
2374
+ key: d.name,
2375
+ label: d.title ?? "",
2059
2376
  visible: !0
2060
2377
  }));
2061
- p(u);
2378
+ o(u);
2062
2379
  };
2063
2380
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
2064
- r.length === 0 ? /* @__PURE__ */ l(q, { children: [
2381
+ r.length === 0 ? /* @__PURE__ */ l(U, { children: [
2065
2382
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No property display rules configured. All properties will be shown." }),
2066
2383
  n && /* @__PURE__ */ a(
2067
2384
  "button",
@@ -2072,20 +2389,20 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2072
2389
  children: "Populate from API metadata"
2073
2390
  }
2074
2391
  )
2075
- ] }) : /* @__PURE__ */ l(q, { children: [
2392
+ ] }) : /* @__PURE__ */ l(U, { children: [
2076
2393
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:items-center mapui:gap-2 mapui:px-8", style: { gridTemplateColumns: "1fr 1fr auto" }, children: [
2077
- /* @__PURE__ */ a(D, { label: "Property Key", children: /* @__PURE__ */ a("span", {}) }),
2078
- /* @__PURE__ */ a(D, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
2394
+ /* @__PURE__ */ a(C, { label: "Property Key", children: /* @__PURE__ */ a("span", {}) }),
2395
+ /* @__PURE__ */ a(C, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
2079
2396
  /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
2080
2397
  ] }),
2081
- /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((u, s) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
2398
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((u, d) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
2082
2399
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
2083
2400
  /* @__PURE__ */ a(
2084
2401
  "button",
2085
2402
  {
2086
2403
  type: "button",
2087
- onClick: () => d(s),
2088
- disabled: s === 0,
2404
+ onClick: () => y(d),
2405
+ disabled: d === 0,
2089
2406
  "aria-label": "Move up",
2090
2407
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
2091
2408
  children: "▲"
@@ -2095,8 +2412,8 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2095
2412
  "button",
2096
2413
  {
2097
2414
  type: "button",
2098
- onClick: () => f(s),
2099
- disabled: s === r.length - 1,
2415
+ onClick: () => w(d),
2416
+ disabled: d === r.length - 1,
2100
2417
  "aria-label": "Move down",
2101
2418
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
2102
2419
  children: "▼"
@@ -2108,12 +2425,12 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2108
2425
  "select",
2109
2426
  {
2110
2427
  value: u.key,
2111
- onChange: (v) => w(s, v.target.value),
2428
+ onChange: (N) => g(d, N.target.value),
2112
2429
  "aria-label": "Property key",
2113
- className: le,
2430
+ className: se,
2114
2431
  children: [
2115
2432
  /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
2116
- i.map((v) => /* @__PURE__ */ a("option", { value: v.name, children: v.title ?? v.name }, v.name))
2433
+ i.map((N) => /* @__PURE__ */ a("option", { value: N.name, children: N.title ?? N.name }, N.name))
2117
2434
  ]
2118
2435
  }
2119
2436
  ) : /* @__PURE__ */ a(
@@ -2121,10 +2438,10 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2121
2438
  {
2122
2439
  type: "text",
2123
2440
  value: u.key,
2124
- onChange: (v) => m(s, { key: v.target.value }),
2441
+ onChange: (N) => s(d, { key: N.target.value }),
2125
2442
  placeholder: "property_name",
2126
2443
  "aria-label": "Property key",
2127
- className: le
2444
+ className: se
2128
2445
  }
2129
2446
  ),
2130
2447
  /* @__PURE__ */ a(
@@ -2132,10 +2449,10 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2132
2449
  {
2133
2450
  type: "text",
2134
2451
  value: u.label,
2135
- onChange: (v) => m(s, { label: v.target.value }),
2452
+ onChange: (N) => s(d, { label: N.target.value }),
2136
2453
  placeholder: "Friendly name",
2137
2454
  "aria-label": "Display label",
2138
- className: le
2455
+ className: se
2139
2456
  }
2140
2457
  ),
2141
2458
  /* @__PURE__ */ a(
@@ -2143,7 +2460,7 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2143
2460
  {
2144
2461
  type: "checkbox",
2145
2462
  checked: u.visible,
2146
- onChange: (v) => m(s, { visible: v.target.checked }),
2463
+ onChange: (N) => s(d, { visible: N.target.checked }),
2147
2464
  "aria-label": "Visible",
2148
2465
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
2149
2466
  }
@@ -2152,60 +2469,60 @@ function Aa({ value: e, onChange: t, availableProperties: i }) {
2152
2469
  "button",
2153
2470
  {
2154
2471
  type: "button",
2155
- onClick: () => b(s),
2472
+ onClick: () => x(d),
2156
2473
  "aria-label": "Remove property",
2157
2474
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
2158
2475
  children: "Remove"
2159
2476
  }
2160
2477
  )
2161
2478
  ] })
2162
- ] }, s)) })
2479
+ ] }, d)) })
2163
2480
  ] }),
2164
2481
  /* @__PURE__ */ a(
2165
2482
  "button",
2166
2483
  {
2167
2484
  type: "button",
2168
- onClick: o,
2485
+ onClick: p,
2169
2486
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
2170
2487
  children: "+ Add Property"
2171
2488
  }
2172
2489
  )
2173
2490
  ] });
2174
2491
  }
2175
- const je = /geojson\.org\/schema\/(\w+)\.json/;
2176
- function Ia(e) {
2177
- return !!e.$ref && je.test(e.$ref);
2492
+ const We = /geojson\.org\/schema\/(\w+)\.json/;
2493
+ function Va(e) {
2494
+ return !!e.$ref && We.test(e.$ref);
2178
2495
  }
2179
- function $e(e) {
2180
- const t = je.exec(e);
2496
+ function Ve(e) {
2497
+ const t = We.exec(e);
2181
2498
  return t ? t[1] : null;
2182
2499
  }
2183
- function Re(e) {
2500
+ function _e(e) {
2184
2501
  const t = e.toLowerCase();
2185
2502
  return t.includes("polygon") ? "fill" : t.includes("linestring") ? "line" : t.includes("point") ? "circle" : null;
2186
2503
  }
2187
- function Be(e) {
2504
+ function ye(e) {
2188
2505
  const t = e.toLowerCase();
2189
- return t.includes("polygon") ? ["fill"] : t.includes("linestring") ? ["line"] : t.includes("point") ? ["circle", "symbol"] : [];
2506
+ return t.includes("polygon") ? ["fill", "line"] : t.includes("linestring") ? ["line"] : t.includes("point") ? ["circle", "symbol"] : [];
2190
2507
  }
2191
- function Ea(e) {
2508
+ function _a(e) {
2192
2509
  for (const t of Object.values(e.properties))
2193
2510
  if (t.$ref) {
2194
- const i = $e(t.$ref);
2195
- if (i) return Re(i);
2511
+ const i = Ve(t.$ref);
2512
+ if (i) return _e(i);
2196
2513
  }
2197
2514
  return null;
2198
2515
  }
2199
- function qe(e) {
2516
+ function Ye(e) {
2200
2517
  for (const t of Object.values(e.properties))
2201
2518
  if (t.$ref) {
2202
- const i = $e(t.$ref);
2203
- if (i) return Be(i);
2519
+ const i = Ve(t.$ref);
2520
+ if (i) return ye(i);
2204
2521
  }
2205
2522
  return [];
2206
2523
  }
2207
- function Fa(e) {
2208
- return Object.entries(e.properties).filter(([, t]) => !Ia(t)).map(([t, i]) => ({
2524
+ function Ya(e) {
2525
+ return Object.entries(e.properties).filter(([, t]) => !Va(t)).map(([t, i]) => ({
2209
2526
  name: t,
2210
2527
  title: i.title,
2211
2528
  type: i.type,
@@ -2215,18 +2532,18 @@ function Fa(e) {
2215
2532
  maximum: i.maximum
2216
2533
  }));
2217
2534
  }
2218
- function Ue(e) {
2535
+ function Xe(e) {
2219
2536
  var i;
2220
2537
  const t = /* @__PURE__ */ new Set();
2221
2538
  for (const r of e)
2222
2539
  (i = r.geometry) != null && i.type && t.add(r.geometry.type);
2223
2540
  return Array.from(t);
2224
2541
  }
2225
- function Pa(e) {
2542
+ function Xa(e) {
2226
2543
  const t = /* @__PURE__ */ new Set();
2227
2544
  for (const n of e) {
2228
- const p = n.toLowerCase();
2229
- p.includes("polygon") ? t.add("polygon") : p.includes("linestring") ? t.add("line") : p.includes("point") && t.add("point");
2545
+ const o = n.toLowerCase();
2546
+ o.includes("polygon") ? t.add("polygon") : o.includes("linestring") ? t.add("line") : o.includes("point") && t.add("point");
2230
2547
  }
2231
2548
  const i = t.size > 1, r = [];
2232
2549
  return t.has("polygon") && r.push({
@@ -2243,132 +2560,138 @@ function Pa(e) {
2243
2560
  ...i ? { geometryFilter: ["Point", "MultiPoint"] } : {}
2244
2561
  }), r;
2245
2562
  }
2246
- async function Ya(e, t) {
2563
+ async function mt(e, t) {
2247
2564
  var i, r;
2248
2565
  try {
2249
- const n = await Pe(e, t), p = Ea(n);
2250
- if (p) return p;
2566
+ const n = await qe(e, t), o = _a(n);
2567
+ if (o) return o;
2251
2568
  } catch {
2252
2569
  }
2253
2570
  try {
2254
- const p = (r = (i = (await se(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
2255
- if (typeof p == "string") return Re(p);
2571
+ const o = (r = (i = (await be(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
2572
+ if (typeof o == "string") return _e(o);
2256
2573
  } catch {
2257
2574
  }
2258
2575
  return null;
2259
2576
  }
2260
- async function Xa(e, t) {
2577
+ async function st(e, t) {
2261
2578
  try {
2262
- const i = await Pe(e, t), r = qe(i);
2579
+ const i = await qe(e, t), r = Ye(i);
2263
2580
  if (r.length > 0) return r;
2264
2581
  } catch {
2265
2582
  }
2266
2583
  try {
2267
- const i = await se(e, t, { limit: 20 }), r = Ue(i.features), n = /* @__PURE__ */ new Set();
2268
- for (const p of r)
2269
- for (const o of Be(p))
2270
- n.add(o);
2584
+ const i = await be(e, t, { limit: 20 }), r = Xe(i.features), n = /* @__PURE__ */ new Set();
2585
+ for (const o of r)
2586
+ for (const p of ye(o))
2587
+ n.add(p);
2271
2588
  return Array.from(n);
2272
2589
  } catch {
2273
2590
  }
2274
2591
  return [];
2275
2592
  }
2276
- function Ha(e) {
2593
+ function ct(e) {
2277
2594
  return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (t) => t.toUpperCase());
2278
2595
  }
2279
- function Ma(e, t, i) {
2596
+ function Ha(e, t, i) {
2280
2597
  const r = [...e ?? []];
2281
2598
  return r[t] = i, r;
2282
2599
  }
2283
- function Oa(e, t) {
2600
+ function Ja(e, t) {
2284
2601
  return (e ?? []).filter((i, r) => r !== t);
2285
2602
  }
2286
- const V = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2287
- function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
2288
- var S;
2289
- const n = (x) => t({ ...e, ...x }), p = ue(e);
2290
- p.current = e;
2291
- const o = ue(t);
2292
- o.current = t;
2293
- const b = i.find((x) => x.id === e.sourceId), m = (b == null ? void 0 : b.url) ?? null, w = e.collection || null, { collections: d, loading: f } = Fe(m), { queryables: c, loading: u } = Ve(m, w), s = c ? Fa(c) : [], [v, N] = A([]);
2294
- return X(() => {
2603
+ const Y = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2604
+ function Pe({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
2605
+ var j;
2606
+ const n = (m) => t({ ...e, ...m }), o = ie(e);
2607
+ o.current = e;
2608
+ const p = ie(t);
2609
+ p.current = t;
2610
+ const x = i.find((m) => m.id === e.sourceId), s = (x == null ? void 0 : x.url) ?? null, g = e.collection || null, { collections: y, loading: w } = Ue(s), { queryables: c, loading: u } = ia(s, g), d = c ? Ya(c) : [], [N, v] = S([]), [T, E] = S([]);
2611
+ return V(() => {
2295
2612
  if (!c) {
2296
- N([]);
2613
+ v([]), E([]);
2297
2614
  return;
2298
2615
  }
2299
- const x = (L) => {
2300
- var y;
2301
- const E = Pa(L);
2302
- N(E), E.length > 0 && !((y = p.current.styles) != null && y.length) && o.current({ ...p.current, styles: E });
2303
- }, P = qe(c);
2304
- if (P.length > 0) {
2305
- const L = [];
2306
- for (const E of P)
2307
- E === "fill" ? L.push("Polygon") : E === "line" ? L.push("LineString") : (E === "circle" || E === "symbol") && L.push("Point");
2308
- x(L);
2616
+ const m = (h, F) => {
2617
+ var f;
2618
+ const P = Xa(h);
2619
+ v(P), E(F), P.length > 0 && !((f = o.current.styles) != null && f.length) && p.current({ ...o.current, styles: P });
2620
+ }, I = Ye(c);
2621
+ if (I.length > 0) {
2622
+ const h = [];
2623
+ for (const F of I)
2624
+ F === "fill" ? h.push("Polygon") : F === "line" ? h.push("LineString") : (F === "circle" || F === "symbol") && h.push("Point");
2625
+ m(h, I);
2309
2626
  return;
2310
2627
  }
2311
- if (!m || !w) {
2312
- N([]);
2628
+ if (!s || !g) {
2629
+ v([]), E([]);
2313
2630
  return;
2314
2631
  }
2315
- let C = !1;
2316
- return se(m, w, { limit: 20 }).then((L) => {
2317
- if (C) return;
2318
- const E = Ue(L.features);
2319
- E.length > 0 ? x(E) : N([]);
2632
+ let M = !1;
2633
+ return be(s, g, { limit: 20 }).then((h) => {
2634
+ if (M) return;
2635
+ const F = Xe(h.features);
2636
+ if (F.length > 0) {
2637
+ const P = /* @__PURE__ */ new Set();
2638
+ for (const f of F)
2639
+ for (const k of ye(f)) P.add(k);
2640
+ m(F, Array.from(P));
2641
+ } else
2642
+ v([]), E([]);
2320
2643
  }).catch(() => {
2321
- C || N([]);
2644
+ M || (v([]), E([]));
2322
2645
  }), () => {
2323
- C = !0;
2646
+ M = !0;
2324
2647
  };
2325
- }, [c, m, w]), X(() => {
2326
- N([]);
2327
- }, [m, w]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2648
+ }, [c, s, g]), V(() => {
2649
+ v([]), E([]);
2650
+ }, [s, g]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2328
2651
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
2329
- /* @__PURE__ */ a(D, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
2652
+ /* @__PURE__ */ a(C, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
2330
2653
  "input",
2331
2654
  {
2332
2655
  type: "text",
2333
2656
  value: e.id,
2334
- onChange: (x) => n({ id: x.target.value }),
2657
+ onChange: (m) => n({ id: m.target.value }),
2335
2658
  placeholder: "my-layer",
2336
- className: V
2659
+ className: Y
2337
2660
  }
2338
2661
  ) }),
2339
- /* @__PURE__ */ a(D, { label: "Label", children: /* @__PURE__ */ a(
2662
+ /* @__PURE__ */ a(C, { label: "Label", children: /* @__PURE__ */ a(
2340
2663
  "input",
2341
2664
  {
2342
2665
  type: "text",
2343
2666
  value: e.label,
2344
- onChange: (x) => n({ label: x.target.value }),
2667
+ onChange: (m) => n({ label: m.target.value }),
2345
2668
  placeholder: "My Layer",
2346
- className: V
2669
+ className: Y
2347
2670
  }
2348
2671
  ) })
2349
2672
  ] }),
2350
- /* @__PURE__ */ a(D, { label: "Source", required: !0, children: /* @__PURE__ */ l(
2673
+ /* @__PURE__ */ a(C, { label: "Source", required: !0, children: /* @__PURE__ */ l(
2351
2674
  "select",
2352
2675
  {
2353
2676
  value: e.sourceId,
2354
- onChange: (x) => n({ sourceId: x.target.value }),
2355
- className: V,
2677
+ onChange: (m) => n({ sourceId: m.target.value }),
2678
+ className: Y,
2356
2679
  children: [
2357
2680
  /* @__PURE__ */ a("option", { value: "", children: "Select a source…" }),
2358
- i.map((x) => /* @__PURE__ */ a("option", { value: x.id, children: x.label ?? x.id }, x.id))
2681
+ i.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.label ?? m.id }, m.id))
2359
2682
  ]
2360
2683
  }
2361
2684
  ) }),
2362
- /* @__PURE__ */ l(D, { label: "Collection", required: !0, children: [
2363
- d.length > 0 ? /* @__PURE__ */ l(
2685
+ /* @__PURE__ */ l(C, { label: "Collection", required: !0, children: [
2686
+ y.length > 0 ? /* @__PURE__ */ l(
2364
2687
  "select",
2365
2688
  {
2366
2689
  value: e.collection,
2367
- onChange: (x) => n({ collection: x.target.value }),
2368
- className: V,
2690
+ onChange: (m) => n({ collection: m.target.value }),
2691
+ className: Y,
2369
2692
  children: [
2370
2693
  /* @__PURE__ */ a("option", { value: "", children: "Select a collection…" }),
2371
- d.map((x) => /* @__PURE__ */ a("option", { value: x.id, children: x.title ?? x.id }, x.id))
2694
+ y.map((m) => /* @__PURE__ */ a("option", { value: m.id, children: m.title ?? m.id }, m.id))
2372
2695
  ]
2373
2696
  }
2374
2697
  ) : /* @__PURE__ */ a(
@@ -2376,27 +2699,27 @@ function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
2376
2699
  {
2377
2700
  type: "text",
2378
2701
  value: e.collection,
2379
- onChange: (x) => n({ collection: x.target.value }),
2380
- placeholder: f ? "Loading collections…" : "collection-id",
2381
- className: V
2702
+ onChange: (m) => n({ collection: m.target.value }),
2703
+ placeholder: w ? "Loading collections…" : "collection-id",
2704
+ className: Y
2382
2705
  }
2383
2706
  ),
2384
2707
  u && /* @__PURE__ */ a("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
2385
2708
  ] }),
2386
- /* @__PURE__ */ a(D, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((x) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
2709
+ /* @__PURE__ */ a(C, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((m) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
2387
2710
  /* @__PURE__ */ a(
2388
2711
  "input",
2389
2712
  {
2390
2713
  type: "radio",
2391
2714
  name: `data-mode-${e.id}`,
2392
- value: x,
2393
- checked: e.dataMode === x,
2394
- onChange: () => n({ dataMode: x }),
2715
+ value: m,
2716
+ checked: e.dataMode === m,
2717
+ onChange: () => n({ dataMode: m }),
2395
2718
  className: "mapui:accent-blue-600"
2396
2719
  }
2397
2720
  ),
2398
- /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: x })
2399
- ] }, x)) }) }),
2721
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: m })
2722
+ ] }, m)) }) }),
2400
2723
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
2401
2724
  /* @__PURE__ */ a(
2402
2725
  "input",
@@ -2404,83 +2727,83 @@ function De({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
2404
2727
  type: "checkbox",
2405
2728
  id: "layer-visible",
2406
2729
  checked: e.visible,
2407
- onChange: (x) => n({ visible: x.target.checked }),
2730
+ onChange: (m) => n({ visible: m.target.checked }),
2408
2731
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
2409
2732
  }
2410
2733
  ),
2411
2734
  /* @__PURE__ */ a("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
2412
2735
  ] }),
2413
- /* @__PURE__ */ a(_, { title: "Style", children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-4", children: [
2414
- (e.styles ?? [me]).map((x, P) => {
2415
- var C;
2736
+ /* @__PURE__ */ a(X, { title: "Style", children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-4", children: [
2737
+ (e.styles ?? [ge]).map((m, I) => {
2738
+ var M;
2416
2739
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
2417
- x.geometryFilter && x.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: x.geometryFilter.map((L) => /* @__PURE__ */ a(
2740
+ m.geometryFilter && m.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: m.geometryFilter.map((h) => /* @__PURE__ */ a(
2418
2741
  "span",
2419
2742
  {
2420
2743
  className: "mapui:rounded mapui:bg-indigo-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-indigo-700",
2421
- children: L
2744
+ children: h
2422
2745
  },
2423
- L
2746
+ h
2424
2747
  )) }),
2425
2748
  /* @__PURE__ */ a(
2426
- wa,
2749
+ Oa,
2427
2750
  {
2428
- value: x,
2429
- onChange: (L) => n({ styles: Ma(e.styles, P, L) }),
2430
- suggestedTypes: v.map((L) => L.type),
2751
+ value: m,
2752
+ onChange: (h) => n({ styles: Ha(e.styles, I, h) }),
2753
+ suggestedTypes: T,
2431
2754
  availableIcons: r,
2432
- availableProperties: s,
2433
- onFetchDistinctValues: m && w ? (L) => _e(m, w, L, { limit: 1e3 }) : void 0
2755
+ availableProperties: d,
2756
+ onFetchDistinctValues: s && g ? (h) => ra(s, g, h, { limit: 1e3 }) : void 0
2434
2757
  }
2435
2758
  ),
2436
- (((C = e.styles) == null ? void 0 : C.length) ?? 0) > 1 && /* @__PURE__ */ a(
2759
+ (((M = e.styles) == null ? void 0 : M.length) ?? 0) > 0 && /* @__PURE__ */ a(
2437
2760
  "button",
2438
2761
  {
2439
2762
  type: "button",
2440
- onClick: () => n({ styles: Oa(e.styles, P) }),
2763
+ onClick: () => n({ styles: Ja(e.styles, I) }),
2441
2764
  className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
2442
2765
  children: "Remove style"
2443
2766
  }
2444
2767
  )
2445
- ] }, P);
2768
+ ] }, I);
2446
2769
  }),
2447
2770
  /* @__PURE__ */ a(
2448
2771
  "button",
2449
2772
  {
2450
2773
  type: "button",
2451
- onClick: () => n({ styles: [...e.styles ?? [me], Oe] }),
2774
+ onClick: () => n({ styles: [...e.styles ?? [ge], Ge] }),
2452
2775
  className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
2453
2776
  children: "+ Add style"
2454
2777
  }
2455
2778
  )
2456
2779
  ] }) }),
2457
- /* @__PURE__ */ a(_, { title: "Legend", children: /* @__PURE__ */ a(
2458
- Na,
2780
+ /* @__PURE__ */ a(X, { title: "Legend", children: /* @__PURE__ */ a(
2781
+ $a,
2459
2782
  {
2460
2783
  value: e.legend,
2461
- onChange: (x) => n({ legend: x }),
2784
+ onChange: (m) => n({ legend: m }),
2462
2785
  styles: e.styles
2463
2786
  }
2464
2787
  ) }),
2465
- /* @__PURE__ */ a(_, { title: "Search Fields", children: /* @__PURE__ */ a(
2466
- Da,
2788
+ /* @__PURE__ */ a(X, { title: "Search Fields", children: /* @__PURE__ */ a(
2789
+ qa,
2467
2790
  {
2468
- fields: ((S = e.search) == null ? void 0 : S.fields) ?? [],
2469
- onChange: (x) => n({ search: x.length > 0 ? { fields: x } : void 0 }),
2470
- availableProperties: s
2791
+ fields: ((j = e.search) == null ? void 0 : j.fields) ?? [],
2792
+ onChange: (m) => n({ search: m.length > 0 ? { fields: m } : void 0 }),
2793
+ availableProperties: d
2471
2794
  }
2472
2795
  ) }),
2473
- /* @__PURE__ */ a(_, { title: "Property Display", children: /* @__PURE__ */ a(
2474
- Aa,
2796
+ /* @__PURE__ */ a(X, { title: "Property Display", children: /* @__PURE__ */ a(
2797
+ Wa,
2475
2798
  {
2476
2799
  value: e.propertyDisplay ?? {},
2477
- onChange: (x) => n({ propertyDisplay: Object.keys(x).length > 0 ? x : void 0 }),
2478
- availableProperties: s
2800
+ onChange: (m) => n({ propertyDisplay: Object.keys(m).length > 0 ? m : void 0 }),
2801
+ availableProperties: d
2479
2802
  }
2480
2803
  ) })
2481
2804
  ] });
2482
2805
  }
2483
- const ne = () => ({
2806
+ const ce = () => ({
2484
2807
  id: "",
2485
2808
  sourceId: "",
2486
2809
  collection: "",
@@ -2488,37 +2811,37 @@ const ne = () => ({
2488
2811
  visible: !0,
2489
2812
  dataMode: "vector-tiles"
2490
2813
  });
2491
- function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r }) {
2492
- const [n, p] = A(null), [o, b] = A(!1), [m, w] = A(ne()), [d, f] = A(null), [c, u] = A(null), [s, v] = A(null), N = () => {
2493
- t([...e, m]), b(!1), w(ne());
2494
- }, S = (g) => {
2495
- t(e.map((k) => k.id === n ? g : k));
2496
- }, x = (g) => {
2497
- t(e.filter((k) => k.id !== g)), f(null), n === g && p(null);
2498
- }, P = (g) => {
2499
- if (g === 0) return;
2814
+ function dt({ layers: e, onChange: t, availableSources: i, availableIcons: r }) {
2815
+ const [n, o] = S(null), [p, x] = S(!1), [s, g] = S(ce()), [y, w] = S(null), [c, u] = S(null), [d, N] = S(null), v = () => {
2816
+ t([...e, s]), x(!1), g(ce());
2817
+ }, T = (f) => {
2818
+ t(e.map((k) => k.id === n ? f : k));
2819
+ }, E = (f) => {
2820
+ t(e.filter((k) => k.id !== f)), w(null), n === f && o(null);
2821
+ }, j = (f) => {
2822
+ if (f === 0) return;
2500
2823
  const k = [...e];
2501
- [k[g - 1], k[g]] = [k[g], k[g - 1]], t(k);
2502
- }, C = (g) => {
2503
- if (g === e.length - 1) return;
2824
+ [k[f - 1], k[f]] = [k[f], k[f - 1]], t(k);
2825
+ }, m = (f) => {
2826
+ if (f === e.length - 1) return;
2504
2827
  const k = [...e];
2505
- [k[g], k[g + 1]] = [k[g + 1], k[g]], t(k);
2506
- }, L = (g, k) => {
2507
- u(k), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", k);
2508
- }, E = (g, k) => {
2509
- g.preventDefault(), g.dataTransfer.dropEffect = "move", v(k);
2510
- }, y = () => {
2511
- v(null);
2512
- }, $ = (g, k) => {
2513
- g.preventDefault(), v(null);
2828
+ [k[f], k[f + 1]] = [k[f + 1], k[f]], t(k);
2829
+ }, I = (f, k) => {
2830
+ u(k), f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", k);
2831
+ }, M = (f, k) => {
2832
+ f.preventDefault(), f.dataTransfer.dropEffect = "move", N(k);
2833
+ }, h = () => {
2834
+ N(null);
2835
+ }, F = (f, k) => {
2836
+ f.preventDefault(), N(null);
2514
2837
  const O = c;
2515
2838
  if (u(null), !O || O === k) return;
2516
- const U = e.findIndex((h) => h.id === O), G = e.findIndex((h) => h.id === k);
2517
- if (U === -1 || G === -1) return;
2518
- const B = [...e];
2519
- B.splice(U, 1), B.splice(G, 0, e[U]), t(B);
2520
- }, M = () => {
2521
- u(null), v(null);
2839
+ const R = e.findIndex((z) => z.id === O), G = e.findIndex((z) => z.id === k);
2840
+ if (R === -1 || G === -1) return;
2841
+ const q = [...e];
2842
+ q.splice(R, 1), q.splice(G, 0, e[R]), t(q);
2843
+ }, P = () => {
2844
+ u(null), N(null);
2522
2845
  };
2523
2846
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2524
2847
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -2528,29 +2851,29 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2528
2851
  {
2529
2852
  type: "button",
2530
2853
  onClick: () => {
2531
- b(!0), w(ne());
2854
+ x(!0), g(ce());
2532
2855
  },
2533
2856
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
2534
2857
  children: "+ Add Layer"
2535
2858
  }
2536
2859
  )
2537
2860
  ] }),
2538
- e.length === 0 && !o && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
2539
- /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((g, k) => {
2540
- var B, h, T, I, F;
2541
- const O = c === g.id, U = s === g.id, G = n === g.id;
2861
+ e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
2862
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((f, k) => {
2863
+ var q, z, J, K, Q;
2864
+ const O = c === f.id, R = d === f.id, G = n === f.id;
2542
2865
  return /* @__PURE__ */ l(
2543
2866
  "li",
2544
2867
  {
2545
2868
  draggable: !G,
2546
- onDragStart: G ? void 0 : (j) => L(j, g.id),
2547
- onDragOver: (j) => E(j, g.id),
2548
- onDragLeave: y,
2549
- onDrop: (j) => $(j, g.id),
2550
- onDragEnd: M,
2869
+ onDragStart: G ? void 0 : (b) => I(b, f.id),
2870
+ onDragOver: (b) => M(b, f.id),
2871
+ onDragLeave: h,
2872
+ onDrop: (b) => F(b, f.id),
2873
+ onDragEnd: P,
2551
2874
  className: [
2552
2875
  "mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
2553
- U ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
2876
+ R ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
2554
2877
  O ? "mapui:opacity-50" : "mapui:opacity-100"
2555
2878
  ].join(" "),
2556
2879
  children: [
@@ -2561,7 +2884,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2561
2884
  "button",
2562
2885
  {
2563
2886
  type: "button",
2564
- onClick: () => P(k),
2887
+ onClick: () => j(k),
2565
2888
  disabled: k === 0,
2566
2889
  "aria-label": "Move layer up",
2567
2890
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
@@ -2572,7 +2895,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2572
2895
  "button",
2573
2896
  {
2574
2897
  type: "button",
2575
- onClick: () => C(k),
2898
+ onClick: () => m(k),
2576
2899
  disabled: k === e.length - 1,
2577
2900
  "aria-label": "Move layer down",
2578
2901
  className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
@@ -2589,18 +2912,18 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2589
2912
  }
2590
2913
  ),
2591
2914
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
2592
- /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: g.label || g.id }),
2593
- /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: g.collection }),
2915
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: f.label || f.id }),
2916
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: f.collection }),
2594
2917
  /* @__PURE__ */ l("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
2595
- /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: g.dataMode }),
2596
- (((B = g.styles) == null ? void 0 : B.length) ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: g.styles.map((j) => j.type).join(" · ") }),
2597
- g.visible === !1 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
2598
- (((T = (h = g.search) == null ? void 0 : h.fields) == null ? void 0 : T.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
2599
- g.search.fields.length,
2918
+ /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: f.dataMode }),
2919
+ (((q = f.styles) == null ? void 0 : q.length) ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: f.styles.map((b) => b.type).join(" · ") }),
2920
+ f.visible === !1 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
2921
+ (((J = (z = f.search) == null ? void 0 : z.fields) == null ? void 0 : J.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
2922
+ f.search.fields.length,
2600
2923
  " search fields"
2601
2924
  ] }),
2602
- (((F = (I = g.legend) == null ? void 0 : I.entries) == null ? void 0 : F.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
2603
- g.legend.entries.length,
2925
+ (((Q = (K = f.legend) == null ? void 0 : K.entries) == null ? void 0 : Q.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
2926
+ f.legend.entries.length,
2604
2927
  " legend entries"
2605
2928
  ] })
2606
2929
  ] })
@@ -2611,43 +2934,43 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2611
2934
  "button",
2612
2935
  {
2613
2936
  type: "button",
2614
- onClick: () => p(n === g.id ? null : g.id),
2937
+ onClick: () => o(n === f.id ? null : f.id),
2615
2938
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
2616
- children: n === g.id ? "Close" : "Edit"
2939
+ children: n === f.id ? "Close" : "Edit"
2617
2940
  }
2618
2941
  ),
2619
2942
  /* @__PURE__ */ a(
2620
2943
  "button",
2621
2944
  {
2622
2945
  type: "button",
2623
- onClick: () => f(g.id),
2946
+ onClick: () => w(f.id),
2624
2947
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
2625
2948
  children: "Remove"
2626
2949
  }
2627
2950
  )
2628
2951
  ] })
2629
2952
  ] }),
2630
- n === g.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
2631
- De,
2953
+ n === f.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
2954
+ Pe,
2632
2955
  {
2633
- value: g,
2634
- onChange: S,
2956
+ value: f,
2957
+ onChange: T,
2635
2958
  availableSources: i,
2636
2959
  availableIcons: r
2637
2960
  }
2638
2961
  ) })
2639
2962
  ]
2640
2963
  },
2641
- g.id
2964
+ f.id
2642
2965
  );
2643
2966
  }) }),
2644
- o && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2967
+ p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2645
2968
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
2646
2969
  /* @__PURE__ */ a(
2647
- De,
2970
+ Pe,
2648
2971
  {
2649
- value: m,
2650
- onChange: w,
2972
+ value: s,
2973
+ onChange: g,
2651
2974
  availableSources: i,
2652
2975
  availableIcons: r
2653
2976
  }
@@ -2657,8 +2980,8 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2657
2980
  "button",
2658
2981
  {
2659
2982
  type: "button",
2660
- onClick: N,
2661
- disabled: !m.id || !m.sourceId || !m.collection,
2983
+ onClick: v,
2984
+ disabled: !s.id || !s.sourceId || !s.collection,
2662
2985
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
2663
2986
  children: "Save"
2664
2987
  }
@@ -2667,7 +2990,7 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2667
2990
  "button",
2668
2991
  {
2669
2992
  type: "button",
2670
- onClick: () => b(!1),
2993
+ onClick: () => x(!1),
2671
2994
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
2672
2995
  children: "Cancel"
2673
2996
  }
@@ -2675,52 +2998,52 @@ function Ja({ layers: e, onChange: t, availableSources: i, availableIcons: r })
2675
2998
  ] })
2676
2999
  ] }),
2677
3000
  /* @__PURE__ */ a(
2678
- Z,
3001
+ re,
2679
3002
  {
2680
- open: d !== null,
3003
+ open: y !== null,
2681
3004
  title: "Remove Layer",
2682
3005
  description: "Are you sure you want to remove this layer from the configuration?",
2683
- onConfirm: () => d && x(d),
2684
- onCancel: () => f(null)
3006
+ onConfirm: () => y && E(y),
3007
+ onCancel: () => w(null)
2685
3008
  }
2686
3009
  )
2687
3010
  ] });
2688
3011
  }
2689
- const Q = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2690
- function Te({ value: e, onChange: t }) {
3012
+ const te = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
3013
+ function Oe({ value: e, onChange: t }) {
2691
3014
  const i = (r) => t({ ...e, ...r });
2692
3015
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2693
- /* @__PURE__ */ a(D, { label: "ID", required: !0, children: /* @__PURE__ */ a(
3016
+ /* @__PURE__ */ a(C, { label: "ID", required: !0, children: /* @__PURE__ */ a(
2694
3017
  "input",
2695
3018
  {
2696
3019
  type: "text",
2697
3020
  value: e.id,
2698
3021
  onChange: (r) => i({ id: r.target.value }),
2699
3022
  placeholder: "osm",
2700
- className: Q
3023
+ className: te
2701
3024
  }
2702
3025
  ) }),
2703
- /* @__PURE__ */ a(D, { label: "Label", children: /* @__PURE__ */ a(
3026
+ /* @__PURE__ */ a(C, { label: "Label", children: /* @__PURE__ */ a(
2704
3027
  "input",
2705
3028
  {
2706
3029
  type: "text",
2707
3030
  value: e.label,
2708
3031
  onChange: (r) => i({ label: r.target.value }),
2709
3032
  placeholder: "OpenStreetMap",
2710
- className: Q
3033
+ className: te
2711
3034
  }
2712
3035
  ) }),
2713
- /* @__PURE__ */ a(D, { label: "Style URL", required: !0, children: /* @__PURE__ */ a(
3036
+ /* @__PURE__ */ a(C, { label: "Style URL", required: !0, children: /* @__PURE__ */ a(
2714
3037
  "input",
2715
3038
  {
2716
3039
  type: "url",
2717
3040
  value: e.url,
2718
3041
  onChange: (r) => i({ url: r.target.value }),
2719
3042
  placeholder: "https://example.com/style.json",
2720
- className: Q
3043
+ className: te
2721
3044
  }
2722
3045
  ) }),
2723
- /* @__PURE__ */ l(D, { label: "Thumbnail URL (optional)", children: [
3046
+ /* @__PURE__ */ l(C, { label: "Thumbnail URL (optional)", children: [
2724
3047
  /* @__PURE__ */ a(
2725
3048
  "input",
2726
3049
  {
@@ -2728,7 +3051,7 @@ function Te({ value: e, onChange: t }) {
2728
3051
  value: e.thumbnail ?? "",
2729
3052
  onChange: (r) => i({ thumbnail: r.target.value || void 0 }),
2730
3053
  placeholder: "https://example.com/thumbnail.png",
2731
- className: Q
3054
+ className: te
2732
3055
  }
2733
3056
  ),
2734
3057
  e.thumbnail && /* @__PURE__ */ a(
@@ -2742,14 +3065,14 @@ function Te({ value: e, onChange: t }) {
2742
3065
  ] })
2743
3066
  ] });
2744
3067
  }
2745
- const oe = () => ({ id: "", label: "", url: "" });
2746
- function Ka({ basemaps: e, onChange: t }) {
2747
- const [i, r] = A(null), [n, p] = A(!1), [o, b] = A(oe()), [m, w] = A(null), d = (u) => {
2748
- t(e.map((s) => s.id === i ? u : s));
2749
- }, f = () => {
2750
- t([...e, o]), p(!1), b(oe());
3068
+ const de = () => ({ id: "", label: "", url: "" });
3069
+ function ht({ basemaps: e, onChange: t }) {
3070
+ const [i, r] = S(null), [n, o] = S(!1), [p, x] = S(de()), [s, g] = S(null), y = (u) => {
3071
+ t(e.map((d) => d.id === i ? u : d));
3072
+ }, w = () => {
3073
+ t([...e, p]), o(!1), x(de());
2751
3074
  }, c = (u) => {
2752
- t(e.filter((s) => s.id !== u)), w(null);
3075
+ t(e.filter((d) => d.id !== u)), g(null);
2753
3076
  };
2754
3077
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2755
3078
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -2759,7 +3082,7 @@ function Ka({ basemaps: e, onChange: t }) {
2759
3082
  {
2760
3083
  type: "button",
2761
3084
  onClick: () => {
2762
- p(!0), b(oe());
3085
+ o(!0), x(de());
2763
3086
  },
2764
3087
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
2765
3088
  children: "+ Add Basemap"
@@ -2799,28 +3122,28 @@ function Ka({ basemaps: e, onChange: t }) {
2799
3122
  "button",
2800
3123
  {
2801
3124
  type: "button",
2802
- onClick: () => w(u.id),
3125
+ onClick: () => g(u.id),
2803
3126
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
2804
3127
  children: "Remove"
2805
3128
  }
2806
3129
  )
2807
3130
  ] })
2808
3131
  ] }),
2809
- i === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Te, { value: u, onChange: d }) })
3132
+ i === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Oe, { value: u, onChange: y }) })
2810
3133
  ]
2811
3134
  },
2812
3135
  u.id
2813
3136
  )) }),
2814
3137
  n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2815
3138
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
2816
- /* @__PURE__ */ a(Te, { value: o, onChange: b }),
3139
+ /* @__PURE__ */ a(Oe, { value: p, onChange: x }),
2817
3140
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
2818
3141
  /* @__PURE__ */ a(
2819
3142
  "button",
2820
3143
  {
2821
3144
  type: "button",
2822
- onClick: f,
2823
- disabled: !o.id || !o.url,
3145
+ onClick: w,
3146
+ disabled: !p.id || !p.url,
2824
3147
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
2825
3148
  children: "Save"
2826
3149
  }
@@ -2829,7 +3152,7 @@ function Ka({ basemaps: e, onChange: t }) {
2829
3152
  "button",
2830
3153
  {
2831
3154
  type: "button",
2832
- onClick: () => p(!1),
3155
+ onClick: () => o(!1),
2833
3156
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
2834
3157
  children: "Cancel"
2835
3158
  }
@@ -2837,32 +3160,32 @@ function Ka({ basemaps: e, onChange: t }) {
2837
3160
  ] })
2838
3161
  ] }),
2839
3162
  /* @__PURE__ */ a(
2840
- Z,
3163
+ re,
2841
3164
  {
2842
- open: m !== null,
3165
+ open: s !== null,
2843
3166
  title: "Remove Basemap",
2844
3167
  description: "Are you sure you want to remove this basemap from the configuration?",
2845
- onConfirm: () => m && c(m),
2846
- onCancel: () => w(null)
3168
+ onConfirm: () => s && c(s),
3169
+ onCancel: () => g(null)
2847
3170
  }
2848
3171
  )
2849
3172
  ] });
2850
3173
  }
2851
- const Le = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
2852
- function Ae({ value: e, onChange: t }) {
3174
+ const je = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
3175
+ function $e({ value: e, onChange: t }) {
2853
3176
  const i = (r) => t({ ...e, ...r });
2854
3177
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2855
- /* @__PURE__ */ a(D, { label: "ID", required: !0, children: /* @__PURE__ */ a(
3178
+ /* @__PURE__ */ a(C, { label: "ID", required: !0, children: /* @__PURE__ */ a(
2856
3179
  "input",
2857
3180
  {
2858
3181
  type: "text",
2859
3182
  value: e.id,
2860
3183
  onChange: (r) => i({ id: r.target.value }),
2861
3184
  placeholder: "my-sprites",
2862
- className: Le
3185
+ className: je
2863
3186
  }
2864
3187
  ) }),
2865
- /* @__PURE__ */ l(D, { label: "Sprite URL", required: !0, children: [
3188
+ /* @__PURE__ */ l(C, { label: "Sprite URL", required: !0, children: [
2866
3189
  /* @__PURE__ */ a(
2867
3190
  "input",
2868
3191
  {
@@ -2870,7 +3193,7 @@ function Ae({ value: e, onChange: t }) {
2870
3193
  value: e.url,
2871
3194
  onChange: (r) => i({ url: r.target.value }),
2872
3195
  placeholder: "https://example.com/sprites/sprite",
2873
- className: Le
3196
+ className: je
2874
3197
  }
2875
3198
  ),
2876
3199
  /* @__PURE__ */ l("p", { className: "mapui:mt-1 mapui:text-xs mapui:text-gray-400", children: [
@@ -2883,21 +3206,21 @@ function Ae({ value: e, onChange: t }) {
2883
3206
  ] })
2884
3207
  ] });
2885
3208
  }
2886
- const pe = () => ({ id: "", url: "" }), ja = (e) => {
3209
+ const he = () => ({ id: "", url: "" }), Ka = (e) => {
2887
3210
  try {
2888
3211
  return new URL(e), !0;
2889
3212
  } catch {
2890
3213
  return !1;
2891
3214
  }
2892
3215
  };
2893
- function Qa({ sprites: e, onChange: t }) {
2894
- const [i, r] = A(null), [n, p] = A(!1), [o, b] = A(pe()), [m, w] = A(null), d = (u) => {
2895
- t(e.map((s, v) => v === i ? u : s));
2896
- }, f = () => {
2897
- t([...e, o]), p(!1), b(pe());
3216
+ function gt({ sprites: e, onChange: t }) {
3217
+ const [i, r] = S(null), [n, o] = S(!1), [p, x] = S(he()), [s, g] = S(null), y = (u) => {
3218
+ t(e.map((d, N) => N === i ? u : d));
3219
+ }, w = () => {
3220
+ t([...e, p]), o(!1), x(he());
2898
3221
  }, c = (u) => {
2899
- const s = e.findIndex((v) => v.id === u);
2900
- t(e.filter((v) => v.id !== u)), i !== null && (s === i ? r(null) : s < i && r(i - 1)), w(null);
3222
+ const d = e.findIndex((N) => N.id === u);
3223
+ t(e.filter((N) => N.id !== u)), i !== null && (d === i ? r(null) : d < i && r(i - 1)), g(null);
2901
3224
  };
2902
3225
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2903
3226
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
@@ -2907,7 +3230,7 @@ function Qa({ sprites: e, onChange: t }) {
2907
3230
  {
2908
3231
  type: "button",
2909
3232
  onClick: () => {
2910
- p(!0), b(pe());
3233
+ o(!0), x(he());
2911
3234
  },
2912
3235
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
2913
3236
  children: "+ Add Sprite Sheet"
@@ -2915,7 +3238,7 @@ function Qa({ sprites: e, onChange: t }) {
2915
3238
  )
2916
3239
  ] }),
2917
3240
  e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No custom sprite sheets. Basemap icons are available automatically." }),
2918
- /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((u, s) => /* @__PURE__ */ l(
3241
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((u, d) => /* @__PURE__ */ l(
2919
3242
  "li",
2920
3243
  {
2921
3244
  className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
@@ -2930,37 +3253,37 @@ function Qa({ sprites: e, onChange: t }) {
2930
3253
  "button",
2931
3254
  {
2932
3255
  type: "button",
2933
- onClick: () => r(i === s ? null : s),
3256
+ onClick: () => r(i === d ? null : d),
2934
3257
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
2935
- children: i === s ? "Close" : "Edit"
3258
+ children: i === d ? "Close" : "Edit"
2936
3259
  }
2937
3260
  ),
2938
3261
  /* @__PURE__ */ a(
2939
3262
  "button",
2940
3263
  {
2941
3264
  type: "button",
2942
- onClick: () => w(u.id),
3265
+ onClick: () => g(u.id),
2943
3266
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
2944
3267
  children: "Remove"
2945
3268
  }
2946
3269
  )
2947
3270
  ] })
2948
3271
  ] }),
2949
- i === s && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Ae, { value: u, onChange: d }) })
3272
+ i === d && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a($e, { value: u, onChange: y }) })
2950
3273
  ]
2951
3274
  },
2952
- s
3275
+ d
2953
3276
  )) }),
2954
3277
  n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2955
3278
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
2956
- /* @__PURE__ */ a(Ae, { value: o, onChange: b }),
3279
+ /* @__PURE__ */ a($e, { value: p, onChange: x }),
2957
3280
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
2958
3281
  /* @__PURE__ */ a(
2959
3282
  "button",
2960
3283
  {
2961
3284
  type: "button",
2962
- onClick: f,
2963
- disabled: !o.id || !o.url || !ja(o.url) || e.some((u) => u.id === o.id),
3285
+ onClick: w,
3286
+ disabled: !p.id || !p.url || !Ka(p.url) || e.some((u) => u.id === p.id),
2964
3287
  className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
2965
3288
  children: "Save"
2966
3289
  }
@@ -2969,7 +3292,7 @@ function Qa({ sprites: e, onChange: t }) {
2969
3292
  "button",
2970
3293
  {
2971
3294
  type: "button",
2972
- onClick: () => p(!1),
3295
+ onClick: () => o(!1),
2973
3296
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
2974
3297
  children: "Cancel"
2975
3298
  }
@@ -2977,18 +3300,18 @@ function Qa({ sprites: e, onChange: t }) {
2977
3300
  ] })
2978
3301
  ] }),
2979
3302
  /* @__PURE__ */ a(
2980
- Z,
3303
+ re,
2981
3304
  {
2982
- open: m !== null,
3305
+ open: s !== null,
2983
3306
  title: "Remove Sprite Sheet",
2984
3307
  description: "Are you sure you want to remove this sprite sheet from the configuration?",
2985
- onConfirm: () => m && c(m),
2986
- onCancel: () => w(null)
3308
+ onConfirm: () => s && c(s),
3309
+ onCancel: () => g(null)
2987
3310
  }
2988
3311
  )
2989
3312
  ] });
2990
3313
  }
2991
- const $a = [
3314
+ const Qa = [
2992
3315
  { key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
2993
3316
  { key: "showLegend", label: "Legend", description: "Map legend" },
2994
3317
  { key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
@@ -2997,16 +3320,17 @@ const $a = [
2997
3320
  { key: "showFeatureDetail", label: "Feature Detail Panel", description: "Inspect feature properties" },
2998
3321
  { key: "showFeatureTooltip", label: "Feature Tooltip", description: "Hover tooltip on features" },
2999
3322
  { key: "showExportButton", label: "Export Button", description: "Export data as CSV" },
3000
- { key: "showLegendOpacity", label: "Legend Opacity", description: "Expand legend with opacity sliders" }
3323
+ { key: "showLegendOpacity", label: "Legend Opacity", description: "Expand legend with opacity sliders" },
3324
+ { key: "showMeasureTool", label: "Measure Tool", description: "Measure distances and areas on the map" }
3001
3325
  ];
3002
- function Za({ value: e, onChange: t }) {
3326
+ function bt({ value: e, onChange: t }) {
3003
3327
  const i = (r, n) => {
3004
3328
  t({ ...e, [r]: n });
3005
3329
  };
3006
3330
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
3007
3331
  /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-2 mapui:text-xs mapui:text-gray-500", children: "Enable or disable UI panels and controls." }),
3008
- /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: $a.map(({ key: r, label: n, description: p }) => {
3009
- const o = e[r];
3332
+ /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: Qa.map(({ key: r, label: n, description: o }) => {
3333
+ const p = e[r];
3010
3334
  return /* @__PURE__ */ l(
3011
3335
  "label",
3012
3336
  {
@@ -3014,15 +3338,15 @@ function Za({ value: e, onChange: t }) {
3014
3338
  children: [
3015
3339
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
3016
3340
  /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: n }),
3017
- /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: p })
3341
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: o })
3018
3342
  ] }),
3019
3343
  /* @__PURE__ */ l("div", { className: "mapui:relative mapui:flex mapui:shrink-0 mapui:items-center", children: [
3020
3344
  /* @__PURE__ */ a(
3021
3345
  "input",
3022
3346
  {
3023
3347
  type: "checkbox",
3024
- checked: o,
3025
- onChange: (b) => i(r, b.target.checked),
3348
+ checked: p,
3349
+ onChange: (x) => i(r, x.target.checked),
3026
3350
  className: "mapui:sr-only",
3027
3351
  "aria-label": n
3028
3352
  }
@@ -3032,14 +3356,14 @@ function Za({ value: e, onChange: t }) {
3032
3356
  {
3033
3357
  className: [
3034
3358
  "mapui:relative mapui:h-5 mapui:w-9 mapui:rounded-full mapui:transition-colors",
3035
- o ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
3359
+ p ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
3036
3360
  ].join(" "),
3037
3361
  children: /* @__PURE__ */ a(
3038
3362
  "div",
3039
3363
  {
3040
3364
  className: [
3041
3365
  "mapui:absolute mapui:top-0.5 mapui:h-4 mapui:w-4 mapui:rounded-full mapui:bg-white mapui:shadow mapui:transition-transform",
3042
- o ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
3366
+ p ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
3043
3367
  ].join(" ")
3044
3368
  }
3045
3369
  )
@@ -3053,46 +3377,46 @@ function Za({ value: e, onChange: t }) {
3053
3377
  }) })
3054
3378
  ] });
3055
3379
  }
3056
- const Ge = [
3380
+ const He = [
3057
3381
  { key: "latitude", label: "Latitude", min: -90, max: 90, step: 1e-6, placeholder: "0" },
3058
3382
  { key: "longitude", label: "Longitude", min: -180, max: 180, step: 1e-6, placeholder: "0" },
3059
3383
  { key: "zoom", label: "Zoom", min: 0, max: 24, step: 0.1, placeholder: "2" },
3060
3384
  { key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
3061
3385
  { key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
3062
3386
  ];
3063
- function Ra(e, t) {
3064
- const i = Ge.find((r) => r.key === e);
3387
+ function Za(e, t) {
3388
+ const i = He.find((r) => r.key === e);
3065
3389
  if (i) {
3066
3390
  if (isNaN(t)) return "Must be a number";
3067
3391
  if (t < i.min) return `Must be at least ${i.min}`;
3068
3392
  if (t > i.max) return `Must be at most ${i.max}`;
3069
3393
  }
3070
3394
  }
3071
- const Ba = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
3072
- function et({ value: e, onChange: t }) {
3395
+ const et = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
3396
+ function yt({ value: e, onChange: t }) {
3073
3397
  const i = (r, n) => {
3074
- const p = parseFloat(n);
3075
- t({ ...e, [r]: isNaN(p) ? 0 : p });
3398
+ const o = parseFloat(n);
3399
+ t({ ...e, [r]: isNaN(o) ? 0 : o });
3076
3400
  };
3077
- return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min: p, max: o, step: b, placeholder: m }) => {
3078
- const w = Ra(r, e[r]);
3079
- return /* @__PURE__ */ a(D, { label: n, error: w, children: /* @__PURE__ */ a(
3401
+ return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: He.map(({ key: r, label: n, min: o, max: p, step: x, placeholder: s }) => {
3402
+ const g = Za(r, e[r]);
3403
+ return /* @__PURE__ */ a(C, { label: n, error: g, children: /* @__PURE__ */ a(
3080
3404
  "input",
3081
3405
  {
3082
3406
  type: "number",
3083
- min: p,
3084
- max: o,
3085
- step: b,
3407
+ min: o,
3408
+ max: p,
3409
+ step: x,
3086
3410
  value: e[r],
3087
- placeholder: m,
3088
- onChange: (d) => i(r, d.target.value),
3089
- className: `${Ba} ${w ? "mapui:border-red-400" : ""}`
3411
+ placeholder: s,
3412
+ onChange: (y) => i(r, y.target.value),
3413
+ className: `${et} ${g ? "mapui:border-red-400" : ""}`
3090
3414
  }
3091
3415
  ) }, r);
3092
3416
  }) });
3093
3417
  }
3094
- function at({ config: e }) {
3095
- const t = Ye(e);
3418
+ function ft({ config: e }) {
3419
+ const t = la(e);
3096
3420
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
3097
3421
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
3098
3422
  /* @__PURE__ */ a(
@@ -3118,137 +3442,152 @@ function at({ config: e }) {
3118
3442
  ] });
3119
3443
  }
3120
3444
  export {
3121
- ui as BasemapConfigSchema,
3122
- Te as BasemapEditor,
3123
- Ka as BasemapList,
3124
- rt as BasemapSwitcher,
3125
- mi as CircleLayoutSchema,
3126
- si as CirclePaintSchema,
3127
- ci as CircleStyleSchema,
3128
- nt as CollapsibleControl,
3129
- _a as CollectionBrowser,
3130
- Y as ColorPicker,
3131
- at as ConfigPreview,
3132
- Z as ConfirmDialog,
3133
- pt as CoordinateDisplay,
3134
- di as DatetimeSearchFieldSchema,
3135
- ct as ExportButton,
3136
- ht as FeatureDetailPanel,
3137
- bt as FeatureTooltip,
3138
- hi as FillLayoutSchema,
3139
- gi as FillPaintSchema,
3140
- bi as FillStyleSchema,
3141
- yi as FilterConfigSchema,
3142
- D as FormField,
3143
- fi as GeometryTypeSchema,
3144
- xi as LayerConfigSchema,
3145
- De as LayerEditor,
3146
- Ja as LayerList,
3147
- ft as LayerPanel,
3148
- wt as Legend,
3149
- wi as LegendConfigSchema,
3150
- Na as LegendEditor,
3151
- va as LegendEntryEditor,
3152
- vi as LegendEntrySchema,
3153
- Ni as LineLayoutSchema,
3154
- ki as LinePaintSchema,
3155
- Ci as LineStyleSchema,
3156
- Si as MapConfigSchema,
3157
- Di as NumberSearchFieldSchema,
3158
- Ti as OgcApiSourceSchema,
3159
- Li as PropertyDisplayConfigSchema,
3160
- Aa as PropertyDisplayEditor,
3161
- Ai as PropertyDisplaySchema,
3162
- Ii as SearchConfigSchema,
3163
- Ca as SearchFieldEditor,
3164
- Da as SearchFieldList,
3165
- Ei as SearchFieldSchema,
3166
- Nt as SearchPanel,
3167
- Fi as SelectSearchFieldSchema,
3168
- ce as SourceEditor,
3169
- Va as SourceList,
3170
- Ae as SpriteSourceEditor,
3171
- Qa as SpriteSourceList,
3172
- Pi as SpriteSourceSchema,
3173
- Mi as StyleConfigSchema,
3174
- wa as StyleEditor,
3175
- Oi as SymbolLayoutSchema,
3176
- ji as SymbolPaintSchema,
3177
- $i as SymbolStyleSchema,
3178
- Ri as TextSearchFieldSchema,
3179
- Za as UIConfigEditor,
3180
- Bi as UIConfigSchema,
3181
- qi as ViewConfigSchema,
3182
- et as ViewEditor,
3183
- Ct as and,
3184
- St as between,
3185
- Pa as buildDefaultStylesForGeometryTypes,
3186
- Oe as defaultCircle,
3187
- me as defaultFill,
3188
- ga as defaultLine,
3189
- ba as defaultSymbol,
3190
- qe as detectGeometryStyleTypesFromQueryables,
3191
- Ea as detectGeometryTypeFromQueryables,
3192
- Ue as detectGeometryTypesFromFeatures,
3193
- Ya as detectStyleTypeForCollection,
3194
- Xa as detectStyleTypesForCollection,
3195
- Dt as downloadCsv,
3196
- Tt as eq,
3197
- Me as expressionColors,
3198
- ra as expressionEntries,
3199
- la as expressionPropertyName,
3200
- ia as expressionType,
3201
- $e as extractGeometryType,
3202
- Lt as featuresToCsv,
3203
- At as fetchCollectionDetail,
3204
- It as fetchCollections,
3205
- Et as fetchConformance,
3206
- _e as fetchDistinctValues,
3207
- Ft as fetchFeatureCount,
3208
- se as fetchFeatures,
3209
- Pe as fetchQueryables,
3210
- Pt as fetchSpriteNames,
3211
- Mt as fetchSpriteUrlFromStyle,
3212
- Ot as fetchTileJson,
3213
- ut as formatDMS,
3214
- mt as formatDecimal,
3215
- jt as fromSimpleFilters,
3216
- $t as fromStructuredFilters,
3217
- Re as geometryTypeToStyleType,
3218
- Be as geometryTypeToStyleTypes,
3219
- ae as getColorFromPalette,
3220
- Rt as getCql2FilteredVectorTileUrl,
3221
- Bt as getFilteredVectorTileUrl,
3222
- na as getPrimaryColor,
3223
- oa as getShapeForStyleType,
3224
- qt as getTileJsonUrl,
3225
- Ut as getVectorTileUrl,
3226
- Gt as gt,
3227
- Wt as gte,
3228
- Ha as humanizePropertyName,
3229
- zt as inList,
3445
+ ji as BasemapConfigSchema,
3446
+ Oe as BasemapEditor,
3447
+ ht as BasemapList,
3448
+ Nt as BasemapSwitcher,
3449
+ $i as CircleLayoutSchema,
3450
+ Ri as CirclePaintSchema,
3451
+ Bi as CircleStyleSchema,
3452
+ kt as CollapsibleControl,
3453
+ ut as CollectionBrowser,
3454
+ H as ColorPicker,
3455
+ ft as ConfigPreview,
3456
+ re as ConfirmDialog,
3457
+ St as CoordinateDisplay,
3458
+ Ui as DatetimeSearchFieldSchema,
3459
+ At as ExportButton,
3460
+ nt as ExportModal,
3461
+ It as FeatureDetailPanel,
3462
+ Mt as FeatureTooltip,
3463
+ qi as FillLayoutSchema,
3464
+ zi as FillPaintSchema,
3465
+ Gi as FillStyleSchema,
3466
+ Wi as FilterConfigSchema,
3467
+ C as FormField,
3468
+ Vi as GeometryTypeSchema,
3469
+ _i as LayerConfigSchema,
3470
+ Pe as LayerEditor,
3471
+ dt as LayerList,
3472
+ Ot as LayerPanel,
3473
+ $t as Legend,
3474
+ Yi as LegendConfigSchema,
3475
+ $a as LegendEditor,
3476
+ ja as LegendEntryEditor,
3477
+ Xi as LegendEntrySchema,
3478
+ Hi as LineLayoutSchema,
3479
+ Ji as LinePaintSchema,
3480
+ Ki as LineStyleSchema,
3481
+ Qi as MapConfigSchema,
3482
+ pt as MeasurePanel,
3483
+ Zi as NumberSearchFieldSchema,
3484
+ er as OgcApiSourceSchema,
3485
+ ar as PropertyDisplayConfigSchema,
3486
+ Wa as PropertyDisplayEditor,
3487
+ tr as PropertyDisplaySchema,
3488
+ ir as SearchConfigSchema,
3489
+ Ba as SearchFieldEditor,
3490
+ qa as SearchFieldList,
3491
+ rr as SearchFieldSchema,
3492
+ Pi as SearchPanel,
3493
+ lr as SelectSearchFieldSchema,
3494
+ xe as SourceEditor,
3495
+ ot as SourceList,
3496
+ $e as SpriteSourceEditor,
3497
+ gt as SpriteSourceList,
3498
+ nr as SpriteSourceSchema,
3499
+ pr as StyleConfigSchema,
3500
+ Oa as StyleEditor,
3501
+ or as SymbolLayoutSchema,
3502
+ ur as SymbolPaintSchema,
3503
+ mr as SymbolStyleSchema,
3504
+ sr as TextSearchFieldSchema,
3505
+ bt as UIConfigEditor,
3506
+ cr as UIConfigSchema,
3507
+ aa as UNITS_FOR_MODE,
3508
+ fe as UNIT_LABELS,
3509
+ dr as ViewConfigSchema,
3510
+ yt as ViewEditor,
3511
+ Bt as and,
3512
+ Ut as bboxFromGeometry,
3513
+ qt as between,
3514
+ Xa as buildDefaultStylesForGeometryTypes,
3515
+ zt as buildMeasureGeometryData,
3516
+ Gt as buildMeasurePointsData,
3517
+ Wt as calculateArea,
3518
+ Vt as calculateDistance,
3519
+ _t as calculateMeasurement,
3520
+ Ge as defaultCircle,
3521
+ ge as defaultFill,
3522
+ Ea as defaultLine,
3523
+ Ia as defaultSymbol,
3524
+ Yt as defaultUnitForMode,
3525
+ Ye as detectGeometryStyleTypesFromQueryables,
3526
+ _a as detectGeometryTypeFromQueryables,
3527
+ Xe as detectGeometryTypesFromFeatures,
3528
+ mt as detectStyleTypeForCollection,
3529
+ st as detectStyleTypesForCollection,
3530
+ Xt as downloadBlob,
3531
+ Ht as downloadCsv,
3532
+ Jt as eq,
3533
+ ze as expressionColors,
3534
+ xa as expressionEntries,
3535
+ wa as expressionPropertyName,
3536
+ fa as expressionType,
3537
+ Ve as extractGeometryType,
3538
+ Kt as featuresToCsv,
3539
+ Qt as fetchCollectionDetail,
3540
+ Zt as fetchCollections,
3541
+ ei as fetchConformance,
3542
+ ra as fetchDistinctValues,
3543
+ ai as fetchFeatureCount,
3544
+ be as fetchFeatures,
3545
+ qe as fetchQueryables,
3546
+ ti as fetchSpriteNames,
3547
+ ii as fetchSpriteUrlFromStyle,
3548
+ ri as fetchTileJson,
3549
+ Tt as formatDMS,
3550
+ Dt as formatDecimal,
3551
+ ta as formatMeasurement,
3552
+ li as fromSimpleFilters,
3553
+ ni as fromStructuredFilters,
3554
+ _e as geometryTypeToStyleType,
3555
+ ye as geometryTypeToStyleTypes,
3556
+ ne as getColorFromPalette,
3557
+ pi as getCql2FilteredVectorTileUrl,
3558
+ oi as getFilteredVectorTileUrl,
3559
+ Na as getPrimaryColor,
3560
+ va as getShapeForStyleType,
3561
+ ui as getTileJsonUrl,
3562
+ mi as getVectorTileUrl,
3563
+ si as gt,
3564
+ ci as gte,
3565
+ ct as humanizePropertyName,
3566
+ di as inList,
3230
3567
  W as isExpression,
3231
- Ia as isGeometryProperty,
3232
- Vt as isNull,
3233
- _t as like,
3234
- Yt as lt,
3235
- Xt as lte,
3236
- Ht as neq,
3237
- Jt as not,
3238
- Kt as or,
3239
- Qt as resolveAvailableIcons,
3240
- Zt as resolvePropertyDisplay,
3241
- ei as resolveStyleWithSprites,
3242
- Ye as safeValidateMapConfig,
3243
- ai as serializeCql2,
3244
- ti as tAfter,
3245
- ii as tBefore,
3246
- ri as tDuring,
3247
- Fa as toAvailableProperties,
3248
- li as useCsvExport,
3249
- ni as useOgcCollectionDetail,
3250
- Fe as useOgcCollections,
3251
- oi as useOgcFeatures,
3252
- Ve as useOgcQueryables,
3253
- Ui as validateMapConfig
3568
+ Va as isGeometryProperty,
3569
+ hi as isNull,
3570
+ gi as like,
3571
+ bi as lt,
3572
+ yi as lte,
3573
+ fi as neq,
3574
+ xi as not,
3575
+ wi as or,
3576
+ Ni as resolveAvailableIcons,
3577
+ vi as resolvePropertyDisplay,
3578
+ ki as resolveStyleWithSprites,
3579
+ la as safeValidateMapConfig,
3580
+ Ci as serializeCql2,
3581
+ Si as tAfter,
3582
+ Ti as tBefore,
3583
+ Di as tDuring,
3584
+ Ya as toAvailableProperties,
3585
+ Li as useCsvExport,
3586
+ Ai as useExport,
3587
+ Ei as useMeasure,
3588
+ Ii as useOgcCollectionDetail,
3589
+ Ue as useOgcCollections,
3590
+ Fi as useOgcFeatures,
3591
+ ia as useOgcQueryables,
3592
+ hr as validateMapConfig
3254
3593
  };