@thibezer/ui-components-kit 2.17.0 → 2.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/camadas.js CHANGED
@@ -1,15 +1,15 @@
1
- var xa = Object.defineProperty;
2
- var wa = (e, r, a) => r in e ? xa(e, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[r] = a;
3
- var A = (e, r, a) => wa(e, typeof r != "symbol" ? r + "" : r, a);
1
+ var Ia = Object.defineProperty;
2
+ var ka = (e, t, a) => t in e ? Ia(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
+ var A = (e, t, a) => ka(e, typeof t != "symbol" ? t + "" : t, a);
4
4
  /* empty css */
5
- import { d as ye, S as Aa } from "./ssr-safe-5cWfJP-s.js";
6
- import { A as Ea, a as Se, e as ka } from "./degrade-gDa5sW__.js";
7
- import { L as Ia } from "./listener-bag-DQgv7OON.js";
8
- import { a as De } from "./parts-CaoQiCfI.js";
9
- import { a as Ca } from "./ui-seletor-cor-FYtRccnK.js";
10
- import { f as La } from "./alvo-digitavel-CzCvNVQ3.js";
11
- import { UIMapaBase as gt, UISeletorMapaBase as vt } from "./seletor-mapa-base.js";
12
- const b = {
5
+ import { d as xe, S as La } from "./ssr-safe-5cWfJP-s.js";
6
+ import { A as Ca, a as Se, e as Sa } from "./degrade-gDa5sW__.js";
7
+ import { L as $a } from "./listener-bag-DQgv7OON.js";
8
+ import { a as Te } from "./parts-CaoQiCfI.js";
9
+ import { a as Fa } from "./ui-seletor-cor-DFIQ1sin.js";
10
+ import { f as Ma } from "./alvo-digitavel-CzCvNVQ3.js";
11
+ import { UIMapaBase as mr, UISeletorMapaBase as gr } from "./seletor-mapa-base.js";
12
+ const y = {
13
13
  camadas: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
14
14
  <polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
15
15
  <polyline points="2 17 12 22 22 17"></polyline>
@@ -107,148 +107,148 @@ const b = {
107
107
  <line x1="9" y1="3" x2="9" y2="21"></line>
108
108
  <line x1="15" y1="3" x2="15" y2="21"></line>
109
109
  </svg>`
110
- }, _ = 6378137;
111
- function Sa(e, r) {
112
- if (!Array.isArray(e) || !Array.isArray(r) || e.length < 2 || r.length < 2 || !Number.isFinite(e[0]) || !Number.isFinite(e[1]) || !Number.isFinite(r[0]) || !Number.isFinite(r[1]))
110
+ }, U = 6378137;
111
+ function za(e, t) {
112
+ if (!Array.isArray(e) || !Array.isArray(t) || e.length < 2 || t.length < 2 || !Number.isFinite(e[0]) || !Number.isFinite(e[1]) || !Number.isFinite(t[0]) || !Number.isFinite(t[1]))
113
113
  return 0;
114
- const a = e[0] * Math.PI / 180, t = e[1] * Math.PI / 180, i = r[0] * Math.PI / 180, o = r[1] * Math.PI / 180, n = i - a, l = o - t, c = Math.min(
114
+ const a = e[0] * Math.PI / 180, r = e[1] * Math.PI / 180, i = t[0] * Math.PI / 180, o = t[1] * Math.PI / 180, n = i - a, s = o - r, c = Math.min(
115
115
  1,
116
116
  Math.max(
117
117
  0,
118
- Math.sin(n / 2) * Math.sin(n / 2) + Math.cos(a) * Math.cos(i) * Math.sin(l / 2) * Math.sin(l / 2)
118
+ Math.sin(n / 2) * Math.sin(n / 2) + Math.cos(a) * Math.cos(i) * Math.sin(s / 2) * Math.sin(s / 2)
119
119
  )
120
- ), s = _ * 2 * Math.atan2(Math.sqrt(c), Math.sqrt(1 - c));
121
- return Number.isFinite(s) ? s : 0;
120
+ ), l = U * 2 * Math.atan2(Math.sqrt(c), Math.sqrt(1 - c));
121
+ return Number.isFinite(l) ? l : 0;
122
122
  }
123
- function Pe(e) {
123
+ function Re(e) {
124
124
  if (!Array.isArray(e) || e.length < 2) return 0;
125
125
  if (Array.isArray(e[0]) && Array.isArray(e[0][0]))
126
- return e.reduce((a, t) => a + Pe(t), 0);
127
- let r = 0;
126
+ return e.reduce((a, r) => a + Re(r), 0);
127
+ let t = 0;
128
128
  for (let a = 0; a < e.length - 1; a++) {
129
- const t = e[a], i = e[a + 1];
130
- Array.isArray(t) && Array.isArray(i) && t.length >= 2 && i.length >= 2 && (r += Sa([t[0], t[1]], [i[0], i[1]]));
129
+ const r = e[a], i = e[a + 1];
130
+ Array.isArray(r) && Array.isArray(i) && r.length >= 2 && i.length >= 2 && (t += za([r[0], r[1]], [i[0], i[1]]));
131
131
  }
132
- return r;
132
+ return t;
133
133
  }
134
- function ue(e) {
134
+ function pe(e) {
135
135
  if (!Array.isArray(e)) return 0;
136
- const r = [];
137
- for (let u = 0; u < e.length; u++) {
138
- const d = e[u];
139
- Array.isArray(d) && d.length >= 2 && Number.isFinite(d[0]) && Number.isFinite(d[1]) && r.push([d[0], d[1]]);
136
+ const t = [];
137
+ for (let d = 0; d < e.length; d++) {
138
+ const u = e[d];
139
+ Array.isArray(u) && u.length >= 2 && Number.isFinite(u[0]) && Number.isFinite(u[1]) && t.push([u[0], u[1]]);
140
140
  }
141
- r.length > 3 && r[0][0] === r[r.length - 1][0] && r[0][1] === r[r.length - 1][1] && r.pop();
142
- const a = r.length;
141
+ t.length > 3 && t[0][0] === t[t.length - 1][0] && t[0][1] === t[t.length - 1][1] && t.pop();
142
+ const a = t.length;
143
143
  if (a < 3) return 0;
144
- let t = 0;
145
- for (let u = 0; u < a; u++)
146
- t += r[u][0];
147
- const i = t / a * Math.PI / 180, o = Math.cos(i), n = Math.PI / 180, l = r[0][0], c = r[0][1];
148
- let s = 0;
149
- for (let u = 0; u < a; u++) {
150
- const d = r[u], m = r[(u + 1) % a], f = (d[1] - c) * n * _ * o, g = (d[0] - l) * n * _, v = (m[1] - c) * n * _ * o, y = (m[0] - l) * n * _;
151
- s += f * y - v * g;
152
- }
153
- const p = Math.abs(s) / 2;
144
+ let r = 0;
145
+ for (let d = 0; d < a; d++)
146
+ r += t[d][0];
147
+ const i = r / a * Math.PI / 180, o = Math.cos(i), n = Math.PI / 180, s = t[0][0], c = t[0][1];
148
+ let l = 0;
149
+ for (let d = 0; d < a; d++) {
150
+ const u = t[d], f = t[(d + 1) % a], m = (u[1] - c) * n * U * o, g = (u[0] - s) * n * U, v = (f[1] - c) * n * U * o, b = (f[0] - s) * n * U;
151
+ l += m * b - v * g;
152
+ }
153
+ const p = Math.abs(l) / 2;
154
154
  return Number.isFinite(p) ? p : 0;
155
155
  }
156
- function Te(e) {
156
+ function Oe(e) {
157
157
  if (!Array.isArray(e) || e.length === 0) return 0;
158
158
  if (Array.isArray(e[0]) && typeof e[0][0] == "number")
159
- return ue(e);
159
+ return pe(e);
160
160
  if (Array.isArray(e[0]) && Array.isArray(e[0][0])) {
161
161
  if (Array.isArray(e[0][0][0]))
162
- return e.reduce((t, i) => t + Te(i), 0);
163
- const r = ue(e[0]);
162
+ return e.reduce((r, i) => r + Oe(i), 0);
163
+ const t = pe(e[0]);
164
164
  let a = 0;
165
- for (let t = 1; t < e.length; t++)
166
- a += ue(e[t]);
167
- return Math.max(0, r - a);
165
+ for (let r = 1; r < e.length; r++)
166
+ a += pe(e[r]);
167
+ return Math.max(0, t - a);
168
168
  }
169
169
  return 0;
170
170
  }
171
- function ct(e) {
171
+ function lr(e) {
172
172
  if (!e || e.length === 0) return "";
173
- const r = e.filter(
174
- (t) => t.type === "Polygon" || t.type === "MultiPolygon" || t.geometryType === "Polygon"
173
+ const t = e.filter(
174
+ (r) => r.type === "Polygon" || r.type === "MultiPolygon" || r.geometryType === "Polygon"
175
175
  );
176
- if (r.length > 0) {
177
- const t = r.reduce(
178
- (i, o) => i + (Te(o.coordinates) || 0),
176
+ if (t.length > 0) {
177
+ const r = t.reduce(
178
+ (i, o) => i + (Oe(o.coordinates) || 0),
179
179
  0
180
180
  );
181
- return t >= 1e4 ? `${(t / 1e4).toLocaleString("pt-BR", {
181
+ return r >= 1e4 ? `${(r / 1e4).toLocaleString("pt-BR", {
182
182
  minimumFractionDigits: 1,
183
183
  maximumFractionDigits: 2
184
- })} ha` : `${Math.round(t).toLocaleString("pt-BR")} m²`;
184
+ })} ha` : `${Math.round(r).toLocaleString("pt-BR")} m²`;
185
185
  }
186
186
  const a = e.filter(
187
- (t) => t.type === "LineString" || t.type === "MultiLineString" || t.geometryType === "LineString"
187
+ (r) => r.type === "LineString" || r.type === "MultiLineString" || r.geometryType === "LineString"
188
188
  );
189
189
  if (a.length > 0) {
190
- const t = a.reduce(
191
- (i, o) => i + (Pe(o.coordinates) || 0),
190
+ const r = a.reduce(
191
+ (i, o) => i + (Re(o.coordinates) || 0),
192
192
  0
193
193
  );
194
- return t >= 1e3 ? `${(t / 1e3).toLocaleString("pt-BR", {
194
+ return r >= 1e3 ? `${(r / 1e3).toLocaleString("pt-BR", {
195
195
  minimumFractionDigits: 1,
196
196
  maximumFractionDigits: 2
197
- })} km` : `${Math.round(t).toLocaleString("pt-BR")} m`;
197
+ })} km` : `${Math.round(r).toLocaleString("pt-BR")} m`;
198
198
  }
199
199
  return "";
200
200
  }
201
201
  function z(e) {
202
202
  return e == null ? "" : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
203
203
  }
204
- const $a = /^(#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\(\s*[\w.%\s,/+-]+\)|[a-z]{3,30})$/i;
205
- function H(e, r = "#00E08A") {
206
- if (!e || typeof e != "string") return r;
204
+ const Ba = /^(#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\(\s*[\w.%\s,/+-]+\)|[a-z]{3,30})$/i;
205
+ function G(e, t = "#00E08A") {
206
+ if (!e || typeof e != "string") return t;
207
207
  const a = e.trim();
208
- return $a.test(a) ? a : r;
208
+ return Ba.test(a) ? a : t;
209
209
  }
210
- function pe(e) {
210
+ function fe(e) {
211
211
  return Math.max(0, Math.min(255, Math.round(e))).toString(16).padStart(2, "0");
212
212
  }
213
- function Ma(e, r, a) {
214
- const t = r / 100, i = a / 100, o = (c) => (c + e / 30) % 12, n = t * Math.min(i, 1 - i), l = (c) => i - n * Math.max(-1, Math.min(o(c) - 3, Math.min(9 - o(c), 1)));
215
- return [l(0) * 255, l(8) * 255, l(4) * 255];
213
+ function qa(e, t, a) {
214
+ const r = t / 100, i = a / 100, o = (c) => (c + e / 30) % 12, n = r * Math.min(i, 1 - i), s = (c) => i - n * Math.max(-1, Math.min(o(c) - 3, Math.min(9 - o(c), 1)));
215
+ return [s(0) * 255, s(8) * 255, s(4) * 255];
216
216
  }
217
- function Fa(e, r = "#000000") {
218
- if (!e || typeof e != "string") return r;
219
- const a = e.trim().toLowerCase(), t = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(a);
220
- if (t) {
221
- const o = t[1];
217
+ function Pa(e, t = "#000000") {
218
+ if (!e || typeof e != "string") return t;
219
+ const a = e.trim().toLowerCase(), r = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(a);
220
+ if (r) {
221
+ const o = r[1];
222
222
  return o.length <= 4 ? `#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}` : `#${o.slice(0, 6)}`;
223
223
  }
224
224
  const i = /^(rgb|hsl)a?\(([^)]+)\)$/.exec(a);
225
225
  if (i) {
226
226
  const o = i[2].split(/[\s,/]+/).filter(Boolean).map((n) => parseFloat(n));
227
227
  if (o.length >= 3 && o.slice(0, 3).every((n) => !isNaN(n))) {
228
- const [n, l, c] = o, [s, p, u] = i[1] === "rgb" ? [n, l, c] : Ma(n, l, c);
229
- return `#${pe(s)}${pe(p)}${pe(u)}`;
228
+ const [n, s, c] = o, [l, p, d] = i[1] === "rgb" ? [n, s, c] : qa(n, s, c);
229
+ return `#${fe(l)}${fe(p)}${fe(d)}`;
230
230
  }
231
231
  }
232
- return r;
232
+ return t;
233
233
  }
234
- function T(e, r, a) {
235
- const t = e.querySelectorAll(`[${r}]`);
236
- for (let i = 0; i < t.length; i++)
237
- if (t[i].getAttribute(r) === a) return t[i];
234
+ function P(e, t, a) {
235
+ const r = e.querySelectorAll(`[${t}]`);
236
+ for (let i = 0; i < r.length; i++)
237
+ if (r[i].getAttribute(t) === a) return r[i];
238
238
  return null;
239
239
  }
240
- function Re(e, r = 80) {
240
+ function je(e, t = 80) {
241
241
  let a = null;
242
- return (...t) => {
242
+ return (...r) => {
243
243
  a && clearTimeout(a), a = setTimeout(() => {
244
- e(...t), a = null;
245
- }, r);
244
+ e(...r), a = null;
245
+ }, t);
246
246
  };
247
247
  }
248
- function D(e, r) {
249
- e.setAttribute("title", r), e.setAttribute("aria-label", r);
248
+ function D(e, t) {
249
+ e.setAttribute("title", t), e.setAttribute("aria-label", t);
250
250
  }
251
- const Oe = [
251
+ const Ne = [
252
252
  {
253
253
  id: "none",
254
254
  nome: "Sem Mapa",
@@ -291,19 +291,19 @@ const Oe = [
291
291
  thumbnailUrl: "https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=160&auto=format&fit=crop&q=80"
292
292
  }
293
293
  ];
294
- function je(e, r) {
295
- const a = Array.isArray(e) ? e.find((t) => t.id === r) : void 0;
294
+ function He(e, t) {
295
+ const a = Array.isArray(e) ? e.find((r) => r.id === t) : void 0;
296
296
  return a && typeof a.nome == "string" ? a.nome : "";
297
297
  }
298
- function za(e = Oe, r = "satelite", a = !1) {
298
+ function Da(e = Ne, t = "satelite", a = !1) {
299
299
  if (!e || e.length === 0) return "";
300
- const t = e.map((i) => {
301
- const o = r === i.id, n = z(i.id), l = z(i.nome), c = z(i.descricao || i.nome);
302
- let s = "";
303
- return i.thumbnailUrl ? s = `<img class="ui-basemap-preview" src="${z(i.thumbnailUrl)}" alt="" loading="lazy" referrerpolicy="no-referrer" data-basemap-thumb />` : s = `<div class="ui-basemap-preview-none">${b.gradeCad}</div>`, `
300
+ const r = e.map((i) => {
301
+ const o = t === i.id, n = z(i.id), s = z(i.nome), c = z(i.descricao || i.nome);
302
+ let l = "";
303
+ return i.thumbnailUrl ? l = `<img class="ui-basemap-preview" src="${z(i.thumbnailUrl)}" alt="" loading="lazy" referrerpolicy="no-referrer" data-basemap-thumb />` : l = `<div class="ui-basemap-preview-none">${y.gradeCad}</div>`, `
304
304
  <div class="ui-basemap-card ${o ? "active" : ""}" data-basemap-id="${n}" role="button" tabindex="0" aria-pressed="${o}" title="${c}">
305
- ${s}
306
- <span>${l}</span>
305
+ ${l}
306
+ <span>${s}</span>
307
307
  </div>
308
308
  `;
309
309
  }).join("");
@@ -311,122 +311,122 @@ function za(e = Oe, r = "satelite", a = !1) {
311
311
  <div class="ui-basemap-section ${a ? "recolhido" : ""}" part="mapas-base">
312
312
  <button type="button" class="ui-basemap-toggle" data-basemap-toggle="alternar" aria-expanded="${!a}" aria-controls="ui-basemap-grid" title="${a ? "Mostrar mapas base" : "Recolher mapas base"}">
313
313
  <span class="ui-basemap-title">Mapa Base</span>
314
- <span class="ui-basemap-atual" data-basemap-atual>${z(je(e, r))}</span>
315
- <span class="ui-chevron-icon ${a ? "" : "open"}">${b.chevronDir}</span>
314
+ <span class="ui-basemap-atual" data-basemap-atual>${z(He(e, t))}</span>
315
+ <span class="ui-chevron-icon ${a ? "" : "open"}">${y.chevronDir}</span>
316
316
  </button>
317
317
  ${a ? "" : `<div class="ui-basemap-grid" id="ui-basemap-grid">
318
- ${t}
318
+ ${r}
319
319
  </div>`}
320
320
  </div>
321
321
  `;
322
322
  }
323
- function ne(e) {
323
+ function se(e) {
324
324
  if (!Array.isArray(e) || e.length === 0) return [];
325
- const r = e.filter((s) => !!(s && typeof s == "object" && s.id)), a = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
326
- r.forEach((s, p) => {
327
- a.set(s.id, s), t.set(s.id, p);
325
+ const t = e.filter((l) => !!(l && typeof l == "object" && l.id)), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
326
+ t.forEach((l, p) => {
327
+ a.set(l.id, l), r.set(l.id, p);
328
328
  });
329
329
  const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
330
- for (const s of r) {
331
- if (o.has(s.id)) continue;
332
- const p = [], u = /* @__PURE__ */ new Map();
333
- let d = s;
334
- for (; d && d.parentId && a.has(d.parentId) && d.parentId !== d.id; ) {
335
- if (u.has(d.id)) {
336
- const m = u.get(d.id), f = p.slice(m);
337
- let g = f[0];
338
- for (const v of f)
339
- (t.get(v) ?? 1 / 0) < (t.get(g) ?? 1 / 0) && (g = v);
330
+ for (const l of t) {
331
+ if (o.has(l.id)) continue;
332
+ const p = [], d = /* @__PURE__ */ new Map();
333
+ let u = l;
334
+ for (; u && u.parentId && a.has(u.parentId) && u.parentId !== u.id; ) {
335
+ if (d.has(u.id)) {
336
+ const f = d.get(u.id), m = p.slice(f);
337
+ let g = m[0];
338
+ for (const v of m)
339
+ (r.get(v) ?? 1 / 0) < (r.get(g) ?? 1 / 0) && (g = v);
340
340
  i.add(g);
341
341
  break;
342
342
  }
343
- if (o.has(d.id)) break;
344
- u.set(d.id, p.length), p.push(d.id), d = a.get(d.parentId);
343
+ if (o.has(u.id)) break;
344
+ d.set(u.id, p.length), p.push(u.id), u = a.get(u.parentId);
345
345
  }
346
- for (const m of p) o.add(m);
346
+ for (const f of p) o.add(f);
347
347
  }
348
- const n = /* @__PURE__ */ new Map(), l = [];
349
- r.forEach((s) => {
350
- !i.has(s.id) && !!(s.parentId && a.has(s.parentId) && s.parentId !== s.id) && s.parentId ? (n.has(s.parentId) || n.set(s.parentId, []), n.get(s.parentId).push(s)) : l.push(s);
348
+ const n = /* @__PURE__ */ new Map(), s = [];
349
+ t.forEach((l) => {
350
+ !i.has(l.id) && !!(l.parentId && a.has(l.parentId) && l.parentId !== l.id) && l.parentId ? (n.has(l.parentId) || n.set(l.parentId, []), n.get(l.parentId).push(l)) : s.push(l);
351
351
  });
352
- function c(s, p, u) {
353
- const d = new Set(u);
354
- d.add(s.id);
355
- const f = (n.get(s.id) || (Array.isArray(s.children) ? s.children : [])).filter(
356
- (g) => !!(g && typeof g == "object" && g.id && !d.has(g.id))
352
+ function c(l, p, d) {
353
+ const u = new Set(d);
354
+ u.add(l.id);
355
+ const m = (n.get(l.id) || (Array.isArray(l.children) ? l.children : [])).filter(
356
+ (g) => !!(g && typeof g == "object" && g.id && !u.has(g.id))
357
357
  );
358
358
  return {
359
- camada: s,
359
+ camada: l,
360
360
  depth: p,
361
- subcamadas: f.map((g) => c(g, p + 1, d))
361
+ subcamadas: m.map((g) => c(g, p + 1, u))
362
362
  };
363
363
  }
364
- return l.map((s) => c(s, 0, /* @__PURE__ */ new Set()));
364
+ return s.map((l) => c(l, 0, /* @__PURE__ */ new Set()));
365
365
  }
366
- function Ba(e, r) {
366
+ function Ta(e, t) {
367
367
  const a = /* @__PURE__ */ new Set();
368
- if (!r || !Array.isArray(e)) return a;
369
- const t = /* @__PURE__ */ new Map();
368
+ if (!t || !Array.isArray(e)) return a;
369
+ const r = /* @__PURE__ */ new Map();
370
370
  for (const o of e)
371
- !o || typeof o != "object" || !o.id || o.parentId && o.parentId !== o.id && (t.has(o.parentId) || t.set(o.parentId, []), t.get(o.parentId).push(o.id));
372
- const i = [r];
371
+ !o || typeof o != "object" || !o.id || o.parentId && o.parentId !== o.id && (r.has(o.parentId) || r.set(o.parentId, []), r.get(o.parentId).push(o.id));
372
+ const i = [t];
373
373
  for (; i.length > 0; ) {
374
374
  const o = i.pop();
375
375
  if (a.has(o)) continue;
376
376
  a.add(o);
377
- const n = t.get(o);
377
+ const n = r.get(o);
378
378
  if (n)
379
- for (const l of n)
380
- a.has(l) || i.push(l);
379
+ for (const s of n)
380
+ a.has(s) || i.push(s);
381
381
  }
382
382
  return a;
383
383
  }
384
- function Q(e, r, a) {
385
- if (!a || !Array.isArray(r) || r.length === 0) return [];
386
- const t = Ba(e, a);
387
- return r.filter((i) => !!(i && i.layerId && t.has(i.layerId)));
384
+ function W(e, t, a) {
385
+ if (!a || !Array.isArray(t) || t.length === 0) return [];
386
+ const r = Ta(e, a);
387
+ return t.filter((i) => !!(i && i.layerId && r.has(i.layerId)));
388
388
  }
389
- function se(e) {
390
- const r = /* @__PURE__ */ new Map();
391
- e.forEach((t) => t && t.id && r.set(t.id, t));
389
+ function le(e) {
390
+ const t = /* @__PURE__ */ new Map();
391
+ e.forEach((r) => r && r.id && t.set(r.id, r));
392
392
  const a = /* @__PURE__ */ new Map();
393
- for (const t of r.values()) {
393
+ for (const r of t.values()) {
394
394
  let i = !1, o = !1;
395
- const n = /* @__PURE__ */ new Set([t.id]);
396
- let l = t.parentId ? r.get(t.parentId) : void 0;
397
- for (; l && !n.has(l.id); )
398
- n.add(l.id), l.visible === !1 && (i = !0), l.locked === !0 && (o = !0), l = l.parentId ? r.get(l.parentId) : void 0;
399
- a.set(t.id, { ocultaPorAncestral: i, travadaPorAncestral: o });
395
+ const n = /* @__PURE__ */ new Set([r.id]);
396
+ let s = r.parentId ? t.get(r.parentId) : void 0;
397
+ for (; s && !n.has(s.id); )
398
+ n.add(s.id), s.visible === !1 && (i = !0), s.locked === !0 && (o = !0), s = s.parentId ? t.get(s.parentId) : void 0;
399
+ a.set(r.id, { ocultaPorAncestral: i, travadaPorAncestral: o });
400
400
  }
401
401
  return a;
402
402
  }
403
- function xe(e) {
404
- const r = se(e);
403
+ function ie(e) {
404
+ const t = le(e);
405
405
  return new Set(
406
406
  e.filter((a) => {
407
- var t;
408
- return a && (a.locked === !0 || ((t = r.get(a.id)) == null ? void 0 : t.travadaPorAncestral) === !0);
407
+ var r;
408
+ return a && (a.locked === !0 || ((r = t.get(a.id)) == null ? void 0 : r.travadaPorAncestral) === !0);
409
409
  }).map((a) => a.id)
410
410
  );
411
411
  }
412
- function qa(e) {
413
- const r = ne(e), a = xe(e), t = (i) => {
414
- const o = i.camada, n = i.depth, l = i.subcamadas, c = n > 0 ? "&nbsp;&nbsp;".repeat(n) + "↳ " : l.length > 0 || o.isGroup ? "📁 " : "", s = a.has(o.id), p = `<option value="${z(o.id)}"${s ? " disabled" : ""}>${c}${z(o.name)}${s ? " 🔒" : ""}</option>`, u = l.map((d) => t(d)).join("");
415
- return p + u;
412
+ function Ge(e) {
413
+ const t = se(e), a = ie(e), r = (i) => {
414
+ const o = i.camada, n = i.depth, s = i.subcamadas, c = n > 0 ? "&nbsp;&nbsp;".repeat(n) + "↳ " : s.length > 0 || o.isGroup ? "📁 " : "", l = a.has(o.id), p = `<option value="${z(o.id)}"${l ? " disabled" : ""}>${c}${z(o.name)}${l ? " 🔒" : ""}</option>`, d = s.map((u) => r(u)).join("");
415
+ return p + d;
416
416
  };
417
- return r.map((i) => t(i)).join("");
417
+ return t.map((i) => r(i)).join("");
418
418
  }
419
- function Ne(e, r) {
420
- return r > 0 ? {
421
- icone: b.alvoEnquadrar,
422
- texto: `${r} ${r > 1 ? "selecionados" : "selecionado"}`
419
+ function _e(e, t) {
420
+ return t > 0 ? {
421
+ icone: y.alvoEnquadrar,
422
+ texto: `${t} ${t > 1 ? "selecionados" : "selecionado"}`
423
423
  } : {
424
- icone: b.camadas,
424
+ icone: y.camadas,
425
425
  texto: `${e} ${e > 1 ? "camadas" : "camada"}`
426
426
  };
427
427
  }
428
- function Da(e, r, a) {
429
- const t = r.filter((c) => a.has(c.id)), i = t.length > 0, o = i ? t.length : e.length, n = Ne(e.length, t.length), l = qa(e);
428
+ function Ra(e, t, a) {
429
+ const r = t.filter((c) => a.has(c.id)), i = r.length > 0, o = i ? r.length : e.length, n = _e(e.length, r.length), s = Ge(e);
430
430
  return `
431
431
  <div class="ui-tree-footer ${i ? "tem-selecao" : "sem-selecao"}" part="rodape">
432
432
  <div class="ui-footer-left">
@@ -437,11 +437,11 @@ function Da(e, r, a) {
437
437
  <!-- Criação de camadas/grupos quando não há nada selecionado -->
438
438
  <div class="ui-footer-actions-gerais" style="display: ${i ? "none" : "flex"};">
439
439
  <button class="ui-footer-chip-btn" id="btn-footer-new-group" title="Criar Nova Pasta/Grupo de Camadas" aria-label="Criar Grupo de Camadas">
440
- ${b.moverPasta}
440
+ ${y.moverPasta}
441
441
  <span>Grupo</span>
442
442
  </button>
443
443
  <button class="ui-footer-chip-btn primario" id="btn-footer-new-layer" title="Criar Nova Camada Vetorial" aria-label="Criar Nova Camada">
444
- ${b.mais}
444
+ ${y.mais}
445
445
  <span>Camada</span>
446
446
  </button>
447
447
  </div>
@@ -451,321 +451,314 @@ function Da(e, r, a) {
451
451
  <div class="ui-footer-move-wrapper ${i ? "" : "disabled"}" title="Mover selecionados para outra camada">
452
452
  <select id="select-footer-move" aria-label="Mover selecionados para outra camada" class="ui-footer-select" ${i ? "" : "disabled"}>
453
453
  <option value="" disabled selected>Mover para...</option>
454
- ${l}
454
+ ${s}
455
455
  </select>
456
456
  </div>
457
457
 
458
458
  <button class="ui-footer-btn btn-danger-footer ${i ? "" : "disabled"}" id="btn-footer-del" title="Excluir selecionados" aria-label="Excluir selecionados" ${i ? "" : "disabled"}>
459
- ${b.lixeira}
459
+ ${y.lixeira}
460
460
  </button>
461
461
  </div>
462
462
  </div>
463
463
  `;
464
464
  }
465
- const fe = 64;
465
+ const me = 64;
466
466
  function $e(e) {
467
467
  return Array.isArray(e) && e.length >= 2 && Number.isFinite(e[0]) && Number.isFinite(e[1]);
468
468
  }
469
- function He(e) {
470
- return !Array.isArray(e) || e.length === 0 ? [] : $e(e[0]) ? [e.filter($e)] : e.flatMap(He);
469
+ function Ue(e) {
470
+ return !Array.isArray(e) || e.length === 0 ? [] : $e(e[0]) ? [e.filter($e)] : e.flatMap(Ue);
471
471
  }
472
- function Me(e) {
473
- if (e.length <= fe) return e;
474
- const r = e.length / fe, a = [];
475
- for (let t = 0; t < fe; t++) a.push(e[Math.floor(t * r)]);
472
+ function Fe(e) {
473
+ if (e.length <= me) return e;
474
+ const t = e.length / me, a = [];
475
+ for (let r = 0; r < me; r++) a.push(e[Math.floor(r * t)]);
476
476
  return a.push(e[e.length - 1]), a;
477
477
  }
478
- function Pa(e, r, a) {
479
- const t = He(r).filter((L) => L.length > 0);
480
- if (t.length === 0) return "";
481
- let i = 1 / 0, o = -1 / 0, n = 1 / 0, l = -1 / 0;
482
- for (const L of t)
483
- for (const [h, $] of L)
484
- $ < i && (i = $), $ > o && (o = $), -h < n && (n = -h), -h > l && (l = -h);
485
- const c = 16, s = 2, p = c - s * 2, u = o - i, d = l - n, m = Math.max(u, d), f = m > 0 ? p / m : 0, g = s + (p - u * f) / 2, v = s + (p - d * f) / 2, y = (L) => Math.round(L * 100) / 100, k = ([L, h]) => `${y(g + (h - i) * f)},${y(v + (-L - n) * f)}`, M = e === "polygon" || e === "multipolygon", S = e === "linestring" || e === "multilinestring", w = (L) => `<svg viewBox="0 0 ${c} ${c}" width="100%" height="100%" aria-hidden="true">${L}</svg>`;
486
- if (M) {
487
- const L = t.filter((h) => h.length >= 3).map((h) => `M${Me(h).map(k).join("L")}Z`).join("");
488
- return L ? w(
489
- `<path d="${L}" fill="${a}" fill-opacity="0.45" fill-rule="evenodd" stroke="${a}" stroke-width="1.2" stroke-linejoin="round"/>`
478
+ function Oa(e, t, a) {
479
+ const r = Ue(t).filter((S) => S.length > 0);
480
+ if (r.length === 0) return "";
481
+ let i = 1 / 0, o = -1 / 0, n = 1 / 0, s = -1 / 0;
482
+ for (const S of r)
483
+ for (const [h, F] of S)
484
+ F < i && (i = F), F > o && (o = F), -h < n && (n = -h), -h > s && (s = -h);
485
+ const c = 16, l = 2, p = c - l * 2, d = o - i, u = s - n, f = Math.max(d, u), m = f > 0 ? p / f : 0, g = l + (p - d * m) / 2, v = l + (p - u * m) / 2, b = (S) => Math.round(S * 100) / 100, E = ([S, h]) => `${b(g + (h - i) * m)},${b(v + (-S - n) * m)}`, L = e === "polygon" || e === "multipolygon", $ = e === "linestring" || e === "multilinestring", w = (S) => `<svg viewBox="0 0 ${c} ${c}" width="100%" height="100%" aria-hidden="true">${S}</svg>`;
486
+ if (L) {
487
+ const S = r.filter((h) => h.length >= 3).map((h) => `M${Fe(h).map(E).join("L")}Z`).join("");
488
+ return S ? w(
489
+ `<path d="${S}" fill="${a}" fill-opacity="0.45" fill-rule="evenodd" stroke="${a}" stroke-width="1.2" stroke-linejoin="round"/>`
490
490
  ) : "";
491
491
  }
492
- if (S) {
493
- const L = t.filter((h) => h.length >= 2).map((h) => `M${Me(h).map(k).join("L")}`).join("");
494
- return L ? w(
495
- `<path d="${L}" fill="none" stroke="${a}" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>`
492
+ if ($) {
493
+ const S = r.filter((h) => h.length >= 2).map((h) => `M${Fe(h).map(E).join("L")}`).join("");
494
+ return S ? w(
495
+ `<path d="${S}" fill="none" stroke="${a}" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>`
496
496
  ) : "";
497
497
  }
498
498
  return "";
499
499
  }
500
- function Ta(e, r, a) {
501
- const t = H(r, "#00E08A"), i = (e || "").toLowerCase(), o = a !== void 0 ? Pa(i, a, t) : "";
502
- return o || (i === "polygon" || i === "multipolygon" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polygon points="2,14 14,14 12,2 4,4" fill="${t}" fill-opacity="0.45" stroke="${t}" stroke-width="1.5"/></svg>` : i === "linestring" || i === "multilinestring" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polyline points="2,13 8,3 14,10" fill="none" stroke="${t}" stroke-width="2"/></svg>` : i === "text" ? `<svg viewBox="0 0 16 16" width="11" height="11"><text x="8" y="12" font-size="12" font-weight="bold" fill="${t}" text-anchor="middle" font-family="sans-serif">T</text></svg>` : `<svg viewBox="0 0 16 16" width="11" height="11"><circle cx="8" cy="8" r="4.2" fill="${t}" stroke="#ffffff" stroke-width="1.2"/></svg>`);
500
+ function Ve(e, t, a) {
501
+ const r = G(t, "#00E08A"), i = (e || "").toLowerCase(), o = a !== void 0 ? Oa(i, a, r) : "";
502
+ return o || (i === "polygon" || i === "multipolygon" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polygon points="2,14 14,14 12,2 4,4" fill="${r}" fill-opacity="0.45" stroke="${r}" stroke-width="1.5"/></svg>` : i === "linestring" || i === "multilinestring" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polyline points="2,13 8,3 14,10" fill="none" stroke="${r}" stroke-width="2"/></svg>` : i === "text" ? `<svg viewBox="0 0 16 16" width="11" height="11"><text x="8" y="12" font-size="12" font-weight="bold" fill="${r}" text-anchor="middle" font-family="sans-serif">T</text></svg>` : `<svg viewBox="0 0 16 16" width="11" height="11"><circle cx="8" cy="8" r="4.2" fill="${r}" stroke="#ffffff" stroke-width="1.2"/></svg>`);
503
503
  }
504
- function Ge(e, r, a) {
504
+ function Ye(e, t, a) {
505
505
  return {
506
506
  camadaIdSeguro: z(e.id),
507
- corCamada: H(e.color, "#00E08A"),
508
- profundidade: r,
507
+ corCamada: G(e.color, "#00E08A"),
508
+ profundidade: t,
509
509
  esmaecida: e.visible === !1 || (a == null ? void 0 : a.ocultaPorAncestral) === !0,
510
510
  travadaPelaCamada: e.locked === !0 || (a == null ? void 0 : a.travadaPorAncestral) === !0
511
511
  };
512
512
  }
513
- const me = (e, r, a) => `${e} ${e === 1 ? r : a}`;
514
- function _e(e, r, a) {
515
- return a === 0 ? me(e, "feição", "feições") : `${me(e, "feição", "feições")} no grupo (${r} nesta camada) · ${me(a, "subcamada", "subcamadas")}`;
513
+ const ge = (e, t, a) => `${e} ${e === 1 ? t : a}`;
514
+ function Ke(e, t, a) {
515
+ return a === 0 ? ge(e, "feição", "feições") : `${ge(e, "feição", "feições")} no grupo (${t} nesta camada) · ${ge(a, "subcamada", "subcamadas")}`;
516
516
  }
517
- function Ue(e, r, a, t) {
518
- return e === 0 && t ? "" : `<span class="ui-count-chip" title="${_e(e, r, a)}">${e}</span>`;
517
+ function Qe(e, t, a, r) {
518
+ return e === 0 && r ? "" : `<span class="ui-count-chip" title="${Ke(e, t, a)}">${e}</span>`;
519
519
  }
520
- function Ve(e, r) {
521
- const a = r - e;
520
+ function Xe(e, t) {
521
+ const a = t - e;
522
522
  return {
523
- resumo: `Exibindo ${e} de ${r} feições. Use a busca acima para filtrar.`,
523
+ resumo: `Exibindo ${e} de ${t} feições. Use a busca acima para filtrar.`,
524
524
  botao: `Mostrar mais (+${Math.min(80, a)})`
525
525
  };
526
526
  }
527
- function Ye(e, r, a) {
528
- const t = Ve(r, a);
527
+ function We(e, t, a) {
528
+ const r = Xe(t, a);
529
529
  return `<div class="ui-truncate-notice" role="note">
530
- <span>${t.resumo}</span>
531
- <button type="button" class="ui-truncate-more-btn" data-layer-show-more="${e}">${t.botao}</button>
530
+ <span>${r.resumo}</span>
531
+ <button type="button" class="ui-truncate-more-btn" data-layer-show-more="${e}">${r.botao}</button>
532
532
  </div>`;
533
533
  }
534
- function Ke(e) {
534
+ function Je(e) {
535
535
  return `<div class="ui-empty-row"><span>${e ? "Grupo vazio (adicione subcamadas ou feições)" : "Camada vazia"}</span></div>`;
536
536
  }
537
- const Ra = ["name", "color", "visible", "locked", "status", "type", "geometryType", "coordinates", "layerId"];
538
- function Oa(e, r) {
539
- return Ra.every((a) => e[a] === r[a]);
537
+ const ja = ["name", "color", "visible", "locked", "status", "type", "geometryType", "coordinates", "layerId"];
538
+ function Na(e, t) {
539
+ return ja.every((a) => e[a] === t[a]);
540
540
  }
541
- function Qe(e, r, a, t) {
542
- const { camadaIdSeguro: i, corCamada: o, profundidade: n } = r, l = z(e.id), c = z(e.name || "Feição"), s = H(e.color, o), p = e.visible !== !1, u = r.travadaPelaCamada, d = e.locked === !0 || u, m = u ? "Bloqueada pela camada" : d ? "Desbloquear Feição" : "Bloquear Feição", f = e.status === "previa" ? '<span class="ui-previa-dot" title="Geometria prévia" aria-label="Geometria prévia"></span>' : "";
541
+ function Ze(e, t, a, r) {
542
+ const { camadaIdSeguro: i, corCamada: o, profundidade: n } = t, s = z(e.id), c = z(e.name || "Feição"), l = G(e.color, o), p = e.visible !== !1, d = t.travadaPelaCamada, u = e.locked === !0 || d, f = d ? "Bloqueada pela camada" : u ? "Desbloquear Feição" : "Bloquear Feição", m = e.status === "previa" ? '<span class="ui-previa-dot" title="Geometria prévia" aria-label="Geometria prévia"></span>' : "";
543
543
  return `
544
- <div class="ui-feat-row ${a ? "selected-row" : ""} ${p ? "" : "hidden-row"} ${r.esmaecida ? "herdado-oculto" : ""}" data-feat-row="${l}" data-feat-select="${l}" data-feat-layer="${i}" role="treeitem" aria-level="${n + 2}" aria-selected="${a}" tabindex="-1" draggable="true" part="${a ? "feicao feicao-selecionada" : "feicao"}" style="--layer-depth: ${n + 1};" title="Clique para selecionar | Arraste para reordenar">
545
- <div class="ui-col ui-col-eye" data-feat-eye="${l}" role="button" tabindex="0" aria-label="${p ? "Ocultar Feição" : "Exibir Feição"}" title="${p ? "Ocultar Feição" : "Exibir Feição"}">
546
- ${p ? b.olhoAberto : b.olhoFechado}
544
+ <div class="ui-feat-row ${a ? "selected-row" : ""} ${p ? "" : "hidden-row"} ${t.esmaecida ? "herdado-oculto" : ""}" data-feat-row="${s}" data-feat-select="${s}" data-feat-layer="${i}" role="treeitem" aria-level="${n + 2}" aria-selected="${a}" tabindex="-1" draggable="true" part="${a ? "feicao feicao-selecionada" : "feicao"}" style="--layer-depth: ${n + 1};" title="Clique para selecionar | Arraste para reordenar">
545
+ <div class="ui-col ui-col-eye" data-feat-eye="${s}" role="button" tabindex="0" aria-label="${p ? "Ocultar Feição" : "Exibir Feição"}" title="${p ? "Ocultar Feição" : "Exibir Feição"}">
546
+ ${p ? y.olhoAberto : y.olhoFechado}
547
547
  </div>
548
548
 
549
- <div class="ui-col ui-col-lock ${d ? "" : "ui-lock-open"}" data-feat-lock="${l}" ${u ? 'data-locked-by-layer="true"' : ""} role="button" tabindex="0" aria-label="${m}" title="${m}">
550
- ${d ? b.cadeadoTrancado : b.cadeadoAberto}
549
+ <div class="ui-col ui-col-lock ${u ? "" : "ui-lock-open"}" data-feat-lock="${s}" ${d ? 'data-locked-by-layer="true"' : ""} role="button" tabindex="0" aria-label="${f}" title="${f}">
550
+ ${u ? y.cadeadoTrancado : y.cadeadoAberto}
551
551
  </div>
552
552
 
553
- <div class="ui-col ui-col-colorbar" style="background: ${s};"></div>
553
+ <div class="ui-col ui-col-colorbar" style="background: ${l};"></div>
554
554
  <div class="ui-col ui-col-branch"><span style="opacity: 0.35;">└─</span></div>
555
555
  <div class="ui-col ui-col-thumb">
556
- <div class="ui-thumb-box">${Ta(e.type || e.geometryType, s, e.coordinates)}</div>
556
+ <div class="ui-thumb-box">${Ve(e.type || e.geometryType, l, e.coordinates)}</div>
557
557
  </div>
558
558
 
559
- <div class="ui-col ui-col-name" data-feat-name-trigger="${l}" title="Duplo clique para renomear">
560
- ${t ? `<input type="text" class="ui-inline-rename-input" data-inline-feat-input="${l}" value="${c}" />` : `<span class="ui-name-text">${c}</span>${f}`}
559
+ <div class="ui-col ui-col-name" data-feat-name-trigger="${s}" title="Duplo clique para renomear">
560
+ ${r ? `<input type="text" class="ui-inline-rename-input" data-inline-feat-input="${s}" value="${c}" />` : `<span class="ui-name-text">${c}</span>${m}`}
561
561
  </div>
562
562
 
563
563
  <div class="ui-col ui-col-actions">
564
- <button class="ui-micro-btn" data-feat-fit="${l}" title="Enquadrar no mapa" aria-label="Enquadrar feição no mapa">${b.alvoEnquadrar}</button>
564
+ <button class="ui-micro-btn" data-feat-fit="${s}" title="Enquadrar no mapa" aria-label="Enquadrar feição no mapa">${y.alvoEnquadrar}</button>
565
565
  </div>
566
566
 
567
- <div class="ui-col ui-col-target" data-feat-target="${l}" role="button" tabindex="0" aria-label="Selecionar feição" title="Selecionar feição">
567
+ <div class="ui-col ui-col-target" data-feat-target="${s}" role="button" tabindex="0" aria-label="Selecionar feição" title="Selecionar feição">
568
568
  <div class="ui-target-circle ${a ? "selected" : ""}"></div>
569
569
  </div>
570
570
  </div>
571
571
  `;
572
572
  }
573
573
  const we = 80;
574
- function te(e, r) {
575
- const a = (r || "").trim().toLowerCase();
574
+ function V(e, t) {
575
+ const a = (t || "").trim().toLowerCase();
576
576
  return a ? e.filter(
577
- (t) => (t.name || "").toLowerCase().includes(a) || (t.category || "").toLowerCase().includes(a) || (t.type || "").toLowerCase().includes(a)
577
+ (r) => (r.name || "").toLowerCase().includes(a) || (r.category || "").toLowerCase().includes(a) || (r.type || "").toLowerCase().includes(a)
578
578
  ) : e;
579
579
  }
580
- function Xe(e, r, a) {
581
- var d, m;
582
- const t = (a || "").trim().toLowerCase();
583
- if (!t) return null;
580
+ function ea(e, t, a) {
581
+ var u, f;
582
+ const r = (a || "").trim().toLowerCase();
583
+ if (!r) return null;
584
584
  const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
585
- for (const f of e)
586
- i.set(f.id, f), f.parentId && f.parentId !== f.id && (o.has(f.parentId) || o.set(f.parentId, []), o.get(f.parentId).push(f.id));
585
+ for (const m of e)
586
+ i.set(m.id, m), m.parentId && m.parentId !== m.id && (o.has(m.parentId) || o.set(m.parentId, []), o.get(m.parentId).push(m.id));
587
587
  const n = /* @__PURE__ */ new Map();
588
- for (const f of r) {
589
- const g = f.layerId || "";
590
- n.has(g) || n.set(g, []), n.get(g).push(f);
591
- }
592
- const l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
593
- for (const f of e)
594
- (typeof f.name == "string" ? f.name.toLowerCase() : "").includes(t) ? (l.add(f.id), c.add(f.id)) : te(n.get(f.id) || [], t).length > 0 && c.add(f.id);
595
- const s = new Set(c);
596
- for (const f of c) {
597
- const g = /* @__PURE__ */ new Set([f]);
598
- let v = (d = i.get(f)) == null ? void 0 : d.parentId;
588
+ for (const m of t) {
589
+ const g = m.layerId || "";
590
+ n.has(g) || n.set(g, []), n.get(g).push(m);
591
+ }
592
+ const s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
593
+ for (const m of e)
594
+ (typeof m.name == "string" ? m.name.toLowerCase() : "").includes(r) ? (s.add(m.id), c.add(m.id)) : V(n.get(m.id) || [], r).length > 0 && c.add(m.id);
595
+ const l = new Set(c);
596
+ for (const m of c) {
597
+ const g = /* @__PURE__ */ new Set([m]);
598
+ let v = (u = i.get(m)) == null ? void 0 : u.parentId;
599
599
  for (; v && i.has(v) && !g.has(v); )
600
- g.add(v), s.add(v), v = (m = i.get(v)) == null ? void 0 : m.parentId;
600
+ g.add(v), l.add(v), v = (f = i.get(v)) == null ? void 0 : f.parentId;
601
601
  }
602
- const p = [...l];
602
+ const p = [...s];
603
603
  for (; p.length > 0; ) {
604
- const f = p.pop();
605
- for (const g of o.get(f) || [])
606
- s.has(g) || (s.add(g), p.push(g));
607
- }
608
- const u = /* @__PURE__ */ new Map();
609
- for (const f of s) {
610
- const g = n.get(f) || [];
611
- u.set(f, l.has(f) ? g : te(g, t));
612
- }
613
- return { camadasVisiveis: s, feicoesPorCamada: u };
614
- }
615
- function We(e, r, a, t = "", i = we, o) {
616
- const n = Xe(e, r, t), l = [], c = /* @__PURE__ */ new Map();
617
- for (let u = 0; u < r.length; u++) {
618
- const d = r[u];
619
- if (!d || !d.id) continue;
620
- const m = d.layerId || "";
621
- c.has(m) || c.set(m, []), c.get(m).push(d);
622
- }
623
- const s = ne(e);
624
- function p(u) {
625
- const d = u.camada;
626
- if (n && !n.camadasVisiveis.has(d.id) || !(n ? !0 : a.has(d.id))) return;
627
- for (const y of u.subcamadas)
628
- p(y);
629
- const f = n ? n.feicoesPorCamada.get(d.id) || [] : c.get(d.id) || [], g = (o == null ? void 0 : o.get(d.id)) ?? i, v = f.slice(0, g);
630
- for (let y = 0; y < v.length; y++)
631
- l.push(v[y].id);
632
- }
633
- for (const u of s)
634
- p(u);
635
- return l;
636
- }
637
- function ja(e, r, a, t, i, o) {
638
- if (!e.includes(t)) return null;
639
- const n = new Set(r);
640
- let l = a;
604
+ const m = p.pop();
605
+ for (const g of o.get(m) || [])
606
+ l.has(g) || (l.add(g), p.push(g));
607
+ }
608
+ const d = /* @__PURE__ */ new Map();
609
+ for (const m of l) {
610
+ const g = n.get(m) || [];
611
+ d.set(m, s.has(m) ? g : V(g, r));
612
+ }
613
+ return { camadasVisiveis: l, feicoesPorCamada: d };
614
+ }
615
+ function aa(e, t, a, r = "", i = we, o) {
616
+ const n = ea(e, t, r), s = [], c = /* @__PURE__ */ new Map();
617
+ for (let d = 0; d < t.length; d++) {
618
+ const u = t[d];
619
+ if (!u || !u.id) continue;
620
+ const f = u.layerId || "";
621
+ c.has(f) || c.set(f, []), c.get(f).push(u);
622
+ }
623
+ const l = se(e);
624
+ function p(d) {
625
+ const u = d.camada;
626
+ if (n && !n.camadasVisiveis.has(u.id) || !(n ? !0 : a.has(u.id))) return;
627
+ for (const b of d.subcamadas)
628
+ p(b);
629
+ const m = n ? n.feicoesPorCamada.get(u.id) || [] : c.get(u.id) || [], g = (o == null ? void 0 : o.get(u.id)) ?? i, v = m.slice(0, g);
630
+ for (let b = 0; b < v.length; b++)
631
+ s.push(v[b].id);
632
+ }
633
+ for (const d of l)
634
+ p(d);
635
+ return s;
636
+ }
637
+ function Ha(e, t, a, r, i, o) {
638
+ if (!e.includes(r)) return null;
639
+ const n = new Set(t);
640
+ let s = a;
641
641
  if (o && a && e.includes(a)) {
642
- const c = e.indexOf(a), s = e.indexOf(t), p = Math.min(c, s), u = Math.max(c, s);
642
+ const c = e.indexOf(a), l = e.indexOf(r), p = Math.min(c, l), d = Math.max(c, l);
643
643
  i || n.clear();
644
- for (let d = p; d <= u; d++)
645
- n.add(e[d]);
646
- } else i ? (n.has(t) ? n.delete(t) : n.add(t), l = t) : (n.clear(), n.add(t), l = t);
647
- return { selecionados: n, ultimoClicadoId: l };
644
+ for (let u = p; u <= d; u++)
645
+ n.add(e[u]);
646
+ } else i ? (n.has(r) ? n.delete(r) : n.add(r), s = r) : (n.clear(), n.add(r), s = r);
647
+ return { selecionados: n, ultimoClicadoId: s };
648
648
  }
649
- function Ae(e, r) {
649
+ function Ae(e, t) {
650
650
  if (e.size === 0) return;
651
- const a = new Set(r.map((t) => t.id));
652
- for (const t of e)
653
- a.has(t) || e.delete(t);
651
+ const a = new Set(t.map((r) => r.id));
652
+ for (const r of e)
653
+ a.has(r) || e.delete(r);
654
654
  }
655
- function U(e, r, a) {
656
- const t = /* @__PURE__ */ new Set();
657
- let i = e.find((o) => o.id === r);
655
+ function Y(e, t, a) {
656
+ const r = /* @__PURE__ */ new Set();
657
+ let i = e.find((o) => o.id === t);
658
658
  for (; i && i.parentId; ) {
659
- if (t.has(i.id) || (t.add(i.id), i.parentId === a)) return !0;
659
+ if (r.has(i.id) || (r.add(i.id), i.parentId === a)) return !0;
660
660
  i = e.find((o) => o.id === (i == null ? void 0 : i.parentId));
661
661
  }
662
662
  return !1;
663
663
  }
664
- function Na(e) {
664
+ function Me(e) {
665
665
  return Number.isFinite(e) ? e < 0.25 ? "acima" : e > 0.75 ? "abaixo" : "dentro" : "dentro";
666
666
  }
667
- function Ha(e, r, a, t) {
668
- if (!r || !a || r === a) return null;
669
- const i = e.find((s) => s.id === r), o = e.find((s) => s.id === a);
667
+ function ze(e, t, a, r) {
668
+ if (!t || !a || t === a) return null;
669
+ const i = e.find((l) => l.id === t), o = e.find((l) => l.id === a);
670
670
  if (!i || !o) return null;
671
671
  const n = i.parentId !== void 0 ? i.parentId : null;
672
- if (t === "dentro")
673
- return U(e, o.id, i.id) ? null : (i.parentId = o.id, { tipo: "hierarquia", camada: i, novoParentId: o.id, parentAnteriorId: n });
674
- if (U(e, o.id, i.id)) return null;
675
- const l = e.findIndex((s) => s.id === r);
676
- e.splice(l, 1);
677
- const c = e.findIndex((s) => s.id === a);
678
- return c === -1 ? e.push(i) : e.splice(t === "acima" ? c : c + 1, 0, i), i.parentId = o.parentId ?? null, { tipo: "ordem", camada: i, parentAnteriorId: n, novoParentId: i.parentId };
679
- }
680
- function Ga(e, r, a, t) {
681
- if (!r || !a || r === a) return !1;
682
- const i = e.findIndex((l) => l.id === r);
683
- if (i === -1) return !1;
684
- const [o] = e.splice(i, 1), n = e.findIndex((l) => l.id === a);
685
- return n === -1 ? e.push(o) : e.splice(t ? n : n + 1, 0, o), !0;
686
- }
687
- function _a(e, r, a, t) {
688
- const i = e.find((l) => l.id === a), o = r.find((l) => l.id === t);
689
- if (!i || !o || i.layerId === t) return null;
672
+ if (r === "dentro")
673
+ return Y(e, o.id, i.id) ? null : (i.parentId = o.id, { tipo: "hierarquia", camada: i, novoParentId: o.id, parentAnteriorId: n });
674
+ if (Y(e, o.id, i.id)) return null;
675
+ const s = e.findIndex((l) => l.id === t);
676
+ e.splice(s, 1);
677
+ const c = e.findIndex((l) => l.id === a);
678
+ return c === -1 ? e.push(i) : e.splice(r === "acima" ? c : c + 1, 0, i), i.parentId = o.parentId ?? null, { tipo: "ordem", camada: i, parentAnteriorId: n, novoParentId: i.parentId };
679
+ }
680
+ function Ga(e, t, a, r) {
681
+ const i = e.find((s) => s.id === a), o = t.find((s) => s.id === r);
682
+ if (!i || !o || i.layerId === r) return null;
690
683
  const n = i.layerId;
691
- return i.layerId = t, { feicao: i, camadaOrigemId: n, camadaDestinoId: t, mudouDeCamada: !0 };
684
+ return i.layerId = r, { feicao: i, camadaOrigemId: n, camadaDestinoId: r, mudouDeCamada: !0 };
692
685
  }
693
- function Ua(e, r, a, t) {
694
- if (!r || !a || r === a) return null;
695
- const i = e.findIndex((u) => u.id === r);
686
+ function _a(e, t, a, r) {
687
+ if (!t || !a || t === a) return null;
688
+ const i = e.findIndex((d) => d.id === t);
696
689
  if (i === -1) return null;
697
- const o = e.find((u) => u.id === a);
690
+ const o = e.find((d) => d.id === a);
698
691
  if (!o) return null;
699
- const [n] = e.splice(i, 1), l = n.layerId, c = o.layerId, s = l !== c;
700
- s && (n.layerId = c);
701
- const p = e.findIndex((u) => u.id === a);
702
- return p === -1 ? e.push(n) : e.splice(t ? p : p + 1, 0, n), { feicao: n, camadaOrigemId: l, camadaDestinoId: c, mudouDeCamada: s };
692
+ const [n] = e.splice(i, 1), s = n.layerId, c = o.layerId, l = s !== c;
693
+ l && (n.layerId = c);
694
+ const p = e.findIndex((d) => d.id === a);
695
+ return p === -1 ? e.push(n) : e.splice(r ? p : p + 1, 0, n), { feicao: n, camadaOrigemId: s, camadaDestinoId: c, mudouDeCamada: l };
703
696
  }
704
- function Va(e) {
697
+ function Ua(e) {
705
698
  const {
706
- camadas: r,
699
+ camadas: t,
707
700
  feicoes: a,
708
- camadaAtivaId: t,
701
+ camadaAtivaId: r,
709
702
  expandedLayers: i,
710
703
  selectedFeatureIds: o,
711
704
  activeSettingsLayerId: n,
712
- editingLayerId: l,
705
+ editingLayerId: s,
713
706
  editingFeatureId: c,
714
- searchQuery: s,
707
+ searchQuery: l,
715
708
  titulo: p = "CAMADAS",
716
- mostrarBusca: u = !0,
717
- limitesPorCamada: d,
718
- limiteFeicoesPorCamada: m = we,
719
- mostrarBotaoColapsar: f = !1
720
- } = e, g = (s || "").trim().toLowerCase(), v = Xe(r, a, g), y = /* @__PURE__ */ new Map();
721
- for (let E = 0; E < a.length; E++) {
722
- const x = a[E];
709
+ mostrarBusca: d = !0,
710
+ limitesPorCamada: u,
711
+ limiteFeicoesPorCamada: f = we,
712
+ mostrarBotaoColapsar: m = !1
713
+ } = e, g = (l || "").trim().toLowerCase(), v = ea(t, a, g), b = /* @__PURE__ */ new Map();
714
+ for (let I = 0; I < a.length; I++) {
715
+ const x = a[I];
723
716
  if (!x || !x.id) continue;
724
717
  const B = x.layerId || "";
725
- y.has(B) || y.set(B, []), y.get(B).push(x);
718
+ b.has(B) || b.set(B, []), b.get(B).push(x);
726
719
  }
727
- const k = se(r), M = r.every((E) => E.visible !== !1), S = r.length > 0 && r.every((E) => i.has(E.id)), w = u ? `
720
+ const E = le(t), L = t.every((I) => I.visible !== !1), $ = t.length > 0 && t.every((I) => i.has(I.id)), w = d ? `
728
721
  <div class="ui-tree-search-wrapper" part="busca">
729
- <span class="ui-tree-search-icon">${b.busca}</span>
722
+ <span class="ui-tree-search-icon">${y.busca}</span>
730
723
  <input type="text" class="ui-tree-search-input" id="input-layer-search" aria-label="Buscar camada ou feição" placeholder="Buscar camada ou feição..." value="${z(
731
- s
724
+ l
732
725
  )}" />
733
- ${s ? `<button class="ui-tree-search-clear" id="btn-clear-layer-search" title="Limpar busca" aria-label="Limpar busca">${b.fechar}</button>` : ""}
726
+ ${l ? `<button class="ui-tree-search-clear" id="btn-clear-layer-search" title="Limpar busca" aria-label="Limpar busca">${y.fechar}</button>` : ""}
734
727
  </div>
735
- ` : "", L = `
728
+ ` : "", S = `
736
729
  <div class="ui-tree-toolbar" part="toolbar">
737
730
  <div class="ui-tree-title-group">
738
731
  <span class="ui-tree-section-title">${z(p || "CAMADAS")}</span>
739
- <span class="ui-tree-count-badge">${r.length}</span>
732
+ <span class="ui-tree-count-badge">${t.length}</span>
740
733
  </div>
741
734
  <div class="ui-tree-actions">
742
- <button id="btn-toggle-all-vis" class="ui-tree-action-btn" title="${M ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}" aria-label="${M ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}">
743
- ${M ? b.olhoAberto : b.olhoFechado}
735
+ <button id="btn-toggle-all-vis" class="ui-tree-action-btn" title="${L ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}" aria-label="${L ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}">
736
+ ${L ? y.olhoAberto : y.olhoFechado}
744
737
  </button>
745
- <button id="btn-toggle-all-expand" class="ui-tree-action-btn" aria-label="${S ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}" title="${S ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}">
746
- <span class="ui-chevron-icon ${S ? "open" : ""}">${b.chevronDir}</span>
738
+ <button id="btn-toggle-all-expand" class="ui-tree-action-btn" aria-label="${$ ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}" title="${$ ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}">
739
+ <span class="ui-chevron-icon ${$ ? "open" : ""}">${y.chevronDir}</span>
747
740
  </button>
748
- ${f ? `<button id="btn-colapsar" class="ui-camadas-btn-colapsar" title="Recolher painel" aria-label="Recolher painel">${b.recolherPainel}</button>` : ""}
741
+ ${m ? `<button id="btn-colapsar" class="ui-camadas-btn-colapsar" title="Recolher painel" aria-label="Recolher painel">${y.recolherPainel}</button>` : ""}
749
742
  </div>
750
743
  </div>
751
744
  ${w}
752
- `, h = (E) => {
753
- const x = E.camada;
745
+ `, h = (I) => {
746
+ const x = I.camada;
754
747
  if (v && !v.camadasVisiveis.has(x.id)) return "";
755
- const B = E.depth, P = E.subcamadas, ke = v ? P.filter((F) => v.camadasVisiveis.has(F.camada.id)) : P, G = !!(x.isGroup || P.length > 0), C = z(x.id), X = z(x.name || (G ? "Novo Grupo" : "Camada")), j = H(x.color, "#00E08A"), W = x.visible !== !1, J = x.locked === !0, Z = g ? !0 : i.has(x.id), le = n === x.id, ce = t === x.id, O = k.get(x.id), la = (O == null ? void 0 : O.ocultaPorAncestral) === !0, ca = (O == null ? void 0 : O.travadaPorAncestral) === !0, R = v ? v.feicoesPorCamada.get(x.id) || [] : y.get(x.id) || [], ee = v ? R : Q(r, a, x.id), Ie = ee.length > 0 && ee.every((F) => o.has(F.id)), da = !Ie && ee.some((F) => o.has(F.id)), de = (d == null ? void 0 : d.get(x.id)) ?? m, ua = R.slice(0, de), pa = R.length > de, fa = Ge(x, B, O), ma = ua.map(
756
- (F) => Qe(F, fa, o.has(F.id), c === F.id)
757
- ).join(""), ga = pa ? Ye(C, de, R.length) : "", Ce = Number(x.opacity ?? 1), Le = Number.isFinite(Ce) ? Math.min(1, Math.max(0, Ce)) : 1, va = Math.round(Le * 100), ha = r.filter((F) => F.id !== x.id && !U(r, F.id, x.id)).map(
758
- (F) => `<option value="${z(F.id)}" ${x.parentId === F.id ? "selected" : ""}>${F.isGroup ? "📁 " : ""}${z(F.name)}</option>`
759
- ).join(""), ba = le ? `
760
- <div class="ui-layer-settings-drawer" id="settings-drawer-${C}" part="drawer" style="--drawer-cor-camada: ${j};">
748
+ const B = I.depth, T = I.subcamadas, Ie = v ? T.filter((M) => v.camadasVisiveis.has(M.camada.id)) : T, _ = !!(x.isGroup || T.length > 0), C = z(x.id), J = z(x.name || (_ ? "Novo Grupo" : "Camada")), N = G(x.color, "#00E08A"), Z = x.visible !== !1, ee = x.locked === !0, ae = g ? !0 : i.has(x.id), ce = n === x.id, de = r === x.id, O = E.get(x.id), pa = (O == null ? void 0 : O.ocultaPorAncestral) === !0, fa = (O == null ? void 0 : O.travadaPorAncestral) === !0, R = v ? v.feicoesPorCamada.get(x.id) || [] : b.get(x.id) || [], te = v ? R : W(t, a, x.id), ke = te.length > 0 && te.every((M) => o.has(M.id)), ma = !ke && te.some((M) => o.has(M.id)), ue = (u == null ? void 0 : u.get(x.id)) ?? f, ga = R.slice(0, ue), va = R.length > ue, ba = Ye(x, B, O), ha = ga.map(
749
+ (M) => Ze(M, ba, o.has(M.id), c === M.id)
750
+ ).join(""), ya = va ? We(C, ue, R.length) : "", Le = Number(x.opacity ?? 1), Ce = Number.isFinite(Le) ? Math.min(1, Math.max(0, Le)) : 1, xa = Math.round(Ce * 100), wa = t.filter((M) => M.id !== x.id && !Y(t, M.id, x.id)).map(
751
+ (M) => `<option value="${z(M.id)}" ${x.parentId === M.id ? "selected" : ""}>${M.isGroup ? "📁 " : ""}${z(M.name)}</option>`
752
+ ).join(""), Aa = ce ? `
753
+ <div class="ui-layer-settings-drawer" id="settings-drawer-${C}" part="drawer" style="--drawer-cor-camada: ${N};">
761
754
  <div class="ui-drawer-header">
762
755
  <div class="ui-drawer-header-left">
763
- <span class="ui-drawer-icon">${b.engrenagem}</span>
756
+ <span class="ui-drawer-icon">${y.engrenagem}</span>
764
757
  <span class="ui-drawer-title">Configurações da Camada</span>
765
- <span class="ui-drawer-layer-chip" title="${X}">${X}</span>
758
+ <span class="ui-drawer-layer-chip" title="${J}">${J}</span>
766
759
  </div>
767
760
  <button type="button" class="ui-drawer-btn-fechar" data-layer-settings-close="${C}" title="Fechar configurações (Esc)" aria-label="Fechar configurações">
768
- ${b.fechar}
761
+ ${y.fechar}
769
762
  </button>
770
763
  </div>
771
764
 
@@ -777,9 +770,9 @@ function Va(e) {
777
770
  </div>
778
771
  <div class="ui-drawer-color-group">
779
772
  <label class="ui-drawer-color-pill" title="Clique para alterar a cor da camada">
780
- <span class="ui-drawer-color-sample" id="sample-color-${C}" style="background-color: ${j};"></span>
781
- <span class="ui-drawer-color-hex" id="hex-color-${C}">${j.toUpperCase()}</span>
782
- <input type="color" aria-label="Cor da camada" data-layer-color-picker="${C}" value="${Fa(j, "#00e08a")}" class="ui-drawer-color-native" />
773
+ <span class="ui-drawer-color-sample" id="sample-color-${C}" style="background-color: ${N};"></span>
774
+ <span class="ui-drawer-color-hex" id="hex-color-${C}">${N.toUpperCase()}</span>
775
+ <input type="color" aria-label="Cor da camada" data-layer-color-picker="${C}" value="${Pa(N, "#00e08a")}" class="ui-drawer-color-native" />
783
776
  </label>
784
777
  </div>
785
778
  </div>
@@ -788,10 +781,10 @@ function Va(e) {
788
781
  <div class="ui-drawer-row">
789
782
  <div class="ui-drawer-row-label">
790
783
  <span>Opacidade</span>
791
- <span class="ui-drawer-badge" id="badge-op-${C}">${va}%</span>
784
+ <span class="ui-drawer-badge" id="badge-op-${C}">${xa}%</span>
792
785
  </div>
793
786
  <div class="ui-drawer-slider-container">
794
- <input type="range" aria-label="Opacidade da camada" min="0.05" max="1" step="0.05" value="${Number(Le) || 0}" data-layer-opacity-slider="${C}" class="ui-drawer-slider" />
787
+ <input type="range" aria-label="Opacidade da camada" min="0.05" max="1" step="0.05" value="${Number(Ce) || 0}" data-layer-opacity-slider="${C}" class="ui-drawer-slider" />
795
788
  </div>
796
789
  </div>
797
790
 
@@ -803,7 +796,7 @@ function Va(e) {
803
796
  <div class="ui-drawer-select-wrapper">
804
797
  <select class="ui-drawer-select" data-layer-parent-select="${C}" aria-label="Grupo pai da camada">
805
798
  <option value="" ${x.parentId ? "" : "selected"}>(Nenhum - Nível Principal)</option>
806
- ${ha}
799
+ ${wa}
807
800
  </select>
808
801
  </div>
809
802
  </div>
@@ -811,136 +804,136 @@ function Va(e) {
811
804
 
812
805
  <div class="ui-drawer-footer">
813
806
  <div class="ui-drawer-meta-info">
814
- <span>${P.length > 0 ? `${P.length} subcamadas · ` : ""}${R.length} ${R.length === 1 ? "feição" : "feições"}</span>
807
+ <span>${T.length > 0 ? `${T.length} subcamadas · ` : ""}${R.length} ${R.length === 1 ? "feição" : "feições"}</span>
815
808
  </div>
816
809
  <div class="ui-drawer-actions">
817
810
  <button type="button" class="ui-drawer-btn-sublayer" data-add-sublayer="${C}" title="Adicionar nova camada dentro desta">
818
- ${b.mais} Subcamada
811
+ ${y.mais} Subcamada
819
812
  </button>
820
813
  <button type="button" class="ui-drawer-btn-danger" data-delete-layer="${C}" title="Excluir esta camada e suas feições">
821
- ${b.lixeira}
814
+ ${y.lixeira}
822
815
  <span class="ui-btn-label">Excluir</span>
823
816
  </button>
824
817
  </div>
825
818
  </div>
826
819
  </div>
827
- ` : "", ya = ke.map((F) => h(F)).join("");
820
+ ` : "", Ea = Ie.map((M) => h(M)).join("");
828
821
  return `
829
- <div class="ui-layer-group ${B > 0 ? "is-sublayer-group" : ""}" data-layer-id="${C}" data-layer-depth="${B}" role="treeitem" aria-level="${B + 1}" aria-expanded="${Z}" part="grupo" style="--layer-active-color: ${j};">
830
- <div class="ui-layer-row ${W ? "" : "hidden-layer"} ${ce ? "active-drawing-layer" : ""} ${B > 0 ? "is-sublayer" : ""} ${G ? "is-group-row" : ""} ${la ? "herdado-oculto" : ""} ${ca ? "herdado-travado" : ""}" data-layer-row="${C}" data-layer-id="${C}" tabindex="-1" draggable="true" part="${ce ? "camada camada-ativa" : "camada"}" ${ce ? 'aria-current="true"' : ""} style="--layer-depth: ${B};">
831
- <div class="ui-col ui-col-drag" title="Arrastar para reordenar Z-Index">${b.dragHandle}</div>
822
+ <div class="ui-layer-group ${B > 0 ? "is-sublayer-group" : ""}" data-layer-id="${C}" data-layer-depth="${B}" role="treeitem" aria-level="${B + 1}" aria-expanded="${ae}" part="grupo" style="--layer-active-color: ${N};">
823
+ <div class="ui-layer-row ${Z ? "" : "hidden-layer"} ${de ? "active-drawing-layer" : ""} ${B > 0 ? "is-sublayer" : ""} ${_ ? "is-group-row" : ""} ${pa ? "herdado-oculto" : ""} ${fa ? "herdado-travado" : ""}" data-layer-row="${C}" data-layer-id="${C}" tabindex="-1" draggable="true" part="${de ? "camada camada-ativa" : "camada"}" ${de ? 'aria-current="true"' : ""} style="--layer-depth: ${B};">
824
+ <div class="ui-col ui-col-drag" title="Arrastar para reordenar Z-Index">${y.dragHandle}</div>
832
825
 
833
- <div class="ui-col ui-col-eye" data-layer-eye="${C}" role="button" tabindex="0" aria-label="${W ? "Ocultar Camada" : "Exibir Camada"}" title="${W ? "Ocultar Camada" : "Exibir Camada"}">
834
- ${W ? b.olhoAberto : b.olhoFechado}
826
+ <div class="ui-col ui-col-eye" data-layer-eye="${C}" role="button" tabindex="0" aria-label="${Z ? "Ocultar Camada" : "Exibir Camada"}" title="${Z ? "Ocultar Camada" : "Exibir Camada"}">
827
+ ${Z ? y.olhoAberto : y.olhoFechado}
835
828
  </div>
836
829
 
837
- <div class="ui-col ui-col-lock ${J ? "" : "ui-lock-open"}" data-layer-lock="${C}" role="button" tabindex="0" aria-label="${J ? "Desbloquear Camada" : "Bloquear Camada"}" title="${J ? "Desbloquear Camada" : "Bloquear Camada"}">
838
- ${J ? b.cadeadoTrancado : b.cadeadoAberto}
830
+ <div class="ui-col ui-col-lock ${ee ? "" : "ui-lock-open"}" data-layer-lock="${C}" role="button" tabindex="0" aria-label="${ee ? "Desbloquear Camada" : "Bloquear Camada"}" title="${ee ? "Desbloquear Camada" : "Bloquear Camada"}">
831
+ ${ee ? y.cadeadoTrancado : y.cadeadoAberto}
839
832
  </div>
840
833
 
841
- <div class="ui-col ui-col-colorbar ui-col-colorbar-editavel" data-layer-color="${C}" role="button" tabindex="0" style="background: ${j};" aria-label="Alterar cor da camada" title="Alterar cor da camada (usada no destaque de seleção)"></div>
834
+ <div class="ui-col ui-col-colorbar ui-col-colorbar-editavel" data-layer-color="${C}" role="button" tabindex="0" style="background: ${N};" aria-label="Alterar cor da camada" title="Alterar cor da camada (usada no destaque de seleção)"></div>
842
835
 
843
- <div class="ui-col ui-col-chevron" data-layer-expand="${C}" role="button" tabindex="0" aria-label="${Z ? "Recolher grupo" : "Expandir grupo"}">
844
- <span class="ui-chevron-icon ${Z ? "open" : ""}">${b.chevronDir}</span>
836
+ <div class="ui-col ui-col-chevron" data-layer-expand="${C}" role="button" tabindex="0" aria-label="${ae ? "Recolher grupo" : "Expandir grupo"}">
837
+ <span class="ui-chevron-icon ${ae ? "open" : ""}">${y.chevronDir}</span>
845
838
  </div>
846
839
 
847
840
  <div class="ui-col ui-col-name" data-layer-name-trigger="${C}" title="Clique para ativar camada de desenho | Duplo clique para renomear">
848
- ${l === x.id ? `<input type="text" class="ui-inline-rename-input" data-inline-layer-input="${C}" value="${X}" />` : `${G ? `<span class="ui-group-folder-icon" title="Grupo/Pasta">${b.moverPasta}</span>` : ""}
849
- <span class="ui-name-text">${X}</span>
850
- ${Ue(ee.length, R.length, P.length, G)}`}
841
+ ${s === x.id ? `<input type="text" class="ui-inline-rename-input" data-inline-layer-input="${C}" value="${J}" />` : `${_ ? `<span class="ui-group-folder-icon" title="Grupo/Pasta">${y.moverPasta}</span>` : ""}
842
+ <span class="ui-name-text">${J}</span>
843
+ ${Qe(te.length, R.length, T.length, _)}`}
851
844
  </div>
852
845
 
853
846
  <div class="ui-col ui-col-actions">
854
- <button class="ui-micro-btn" data-layer-fit="${C}" title="Enquadrar camada no mapa" aria-label="Enquadrar camada no mapa">${b.alvoEnquadrar}</button>
855
- <button class="ui-micro-btn ${le ? "active" : ""}" data-layer-settings="${C}" title="Ajustar cor, hierarquia, opacidade e excluir" aria-label="Configurações da camada" aria-expanded="${le}">${b.engrenagem}</button>
847
+ <button class="ui-micro-btn" data-layer-fit="${C}" title="Enquadrar camada no mapa" aria-label="Enquadrar camada no mapa">${y.alvoEnquadrar}</button>
848
+ <button class="ui-micro-btn ${ce ? "active" : ""}" data-layer-settings="${C}" title="Ajustar cor, hierarquia, opacidade e excluir" aria-label="Configurações da camada" aria-expanded="${ce}">${y.engrenagem}</button>
856
849
  </div>
857
850
 
858
851
  <div class="ui-col ui-col-target" data-layer-target="${C}" role="button" tabindex="0" aria-label="Selecionar todas as feições deste grupo" title="Selecionar todas as feições deste grupo">
859
- <div class="ui-target-circle ${Ie ? "selected" : da ? "partial" : ""}"></div>
852
+ <div class="ui-target-circle ${ke ? "selected" : ma ? "partial" : ""}"></div>
860
853
  </div>
861
854
  </div>
862
855
 
863
- ${ba}
856
+ ${Aa}
864
857
 
865
- <div class="ui-children-container ${B > 0 ? "is-subchildren" : ""}" role="group" style="display: ${Z ? "block" : "none"};">
858
+ <div class="ui-children-container ${B > 0 ? "is-subchildren" : ""}" role="group" style="display: ${ae ? "block" : "none"};">
859
+ ${Ea}
860
+ ${ha}
866
861
  ${ya}
867
- ${ma}
868
- ${ga}
869
- ${ke.length === 0 && R.length === 0 ? Ke(G) : ""}
862
+ ${Ie.length === 0 && R.length === 0 ? Je(_) : ""}
870
863
  </div>
871
864
  </div>
872
865
  `;
873
- }, $ = ne(r), I = v && v.camadasVisiveis.size === 0 ? `<div class="ui-search-empty" role="status">Nenhum resultado para “${z((s || "").trim())}”</div>` : $.map((E) => h(E)).join("");
866
+ }, F = se(t), k = v && v.camadasVisiveis.size === 0 ? `<div class="ui-search-empty" role="status">Nenhum resultado para “${z((l || "").trim())}”</div>` : F.map((I) => h(I)).join("");
874
867
  return `
875
- ${L}
868
+ ${S}
876
869
  <div class="ui-panel-box">
877
870
  <div class="ui-layer-tree" id="ui-layer-tree-mount" role="tree" aria-label="Camadas e feições" aria-multiselectable="true" part="arvore">
878
- ${I}
871
+ ${k}
879
872
  </div>
880
873
  </div>
881
874
  `;
882
875
  }
883
- function Ya(e) {
876
+ function Va(e) {
884
877
  return [
885
878
  {
886
879
  gatilho: "data-layer-name-trigger",
887
880
  input: "data-inline-layer-input",
888
881
  linha: "data-layer-row",
889
- marcarEditando: (r) => {
890
- e.editingLayerId = r;
882
+ marcarEditando: (t) => {
883
+ e.editingLayerId = t;
891
884
  },
892
- aplicar: (r, a) => {
893
- const t = e.camadas.find((i) => i.id === r);
894
- return !a || !t || t.name === a ? null : (t.name = a, { detalhe: { camadaId: r, novoNome: a, camada: t }, salvar: !0 });
885
+ aplicar: (t, a) => {
886
+ const r = e.camadas.find((i) => i.id === t);
887
+ return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { camadaId: t, novoNome: a, camada: r }, salvar: !0 });
895
888
  },
896
- emitir: (r) => e.dispararEvento("ui-camada-renomeada", r)
889
+ emitir: (t) => e.dispararEvento("ui-camada-renomeada", t)
897
890
  },
898
891
  {
899
892
  gatilho: "data-feat-name-trigger",
900
893
  input: "data-inline-feat-input",
901
894
  linha: "data-feat-row",
902
- marcarEditando: (r) => {
903
- e.editingFeatureId = r;
895
+ marcarEditando: (t) => {
896
+ e.editingFeatureId = t;
904
897
  },
905
- aplicar: (r, a) => {
906
- const t = e.feicoes.find((i) => i.id === r);
907
- return !a || !t || t.name === a ? null : (t.name = a, { detalhe: { feicaoId: r, novoNome: a, feicao: t }, salvar: !1 });
898
+ aplicar: (t, a) => {
899
+ const r = e.feicoes.find((i) => i.id === t);
900
+ return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { feicaoId: t, novoNome: a, feicao: r }, salvar: !1 });
908
901
  },
909
- emitir: (r) => e.dispararEvento("ui-feicao-renomeada", r)
902
+ emitir: (t) => e.dispararEvento("ui-feicao-renomeada", t)
910
903
  }
911
904
  ];
912
905
  }
913
- function Fe(e, r, a = r) {
914
- for (const t of Ya(e))
915
- a.querySelectorAll(`[${t.gatilho}]`).forEach((i) => {
906
+ function Be(e, t, a = t) {
907
+ for (const r of Va(e))
908
+ a.querySelectorAll(`[${r.gatilho}]`).forEach((i) => {
916
909
  i.addEventListener("dblclick", (o) => {
917
910
  o.stopPropagation();
918
- const n = i.getAttribute(t.gatilho);
911
+ const n = i.getAttribute(r.gatilho);
919
912
  if (!n) return;
920
- t.marcarEditando(n), e.solicitarRenderizacao();
921
- const l = T(r, t.input, n);
922
- if (!l) return;
923
- l.focus(), l.select();
913
+ r.marcarEditando(n), e.solicitarRenderizacao();
914
+ const s = P(t, r.input, n);
915
+ if (!s) return;
916
+ s.focus(), s.select();
924
917
  let c = !1;
925
- const s = (p, u = !1) => {
926
- var d, m;
918
+ const l = (p, d = !1) => {
919
+ var u, f;
927
920
  if (!c) {
928
- if (c = !0, t.marcarEditando(null), p) {
929
- const f = t.aplicar(n, l.value.trim());
930
- f && (f.salvar && ((d = e.salvarLembrancaEstado) == null || d.call(e)), t.emitir(f.detalhe));
921
+ if (c = !0, r.marcarEditando(null), p) {
922
+ const m = r.aplicar(n, s.value.trim());
923
+ m && (m.salvar && ((u = e.salvarLembrancaEstado) == null || u.call(e)), r.emitir(m.detalhe));
931
924
  }
932
- e.solicitarRenderizacao(), u && ((m = T(r, t.linha, n)) == null || m.focus());
925
+ e.solicitarRenderizacao(), d && ((f = P(t, r.linha, n)) == null || f.focus());
933
926
  }
934
927
  };
935
- l.addEventListener("keydown", (p) => {
936
- p.key === "Enter" ? (p.preventDefault(), s(!0, !0)) : p.key === "Escape" && (p.preventDefault(), s(!1, !0));
937
- }), l.addEventListener("blur", () => s(!0));
928
+ s.addEventListener("keydown", (p) => {
929
+ p.key === "Enter" ? (p.preventDefault(), l(!0, !0)) : p.key === "Escape" && (p.preventDefault(), l(!1, !0));
930
+ }), s.addEventListener("blur", () => l(!0));
938
931
  });
939
932
  });
940
933
  }
941
- const Ka = ["dragging", "drop-above", "drop-below", "drop-into"];
942
- class Qa {
943
- constructor(r, a) {
934
+ const Ya = ["dragging", "drop-above", "drop-below", "drop-into"];
935
+ class Ka {
936
+ constructor(t, a) {
944
937
  A(this, "host");
945
938
  A(this, "shadow");
946
939
  /** Cancela um arraste por toque em andamento (remove os ouvintes de `window`). */
@@ -954,85 +947,85 @@ class Qa {
954
947
  camadaId: null,
955
948
  feicaoId: null
956
949
  });
957
- this.host = r, this.shadow = a;
950
+ this.host = t, this.shadow = a;
958
951
  }
959
952
  bindAll() {
960
953
  this.bindInlineRename(), this.bindDragAndDrop(), this.bindTouchDragAndDrop();
961
954
  }
962
955
  /** Solta o que ficou em `window` (arraste por toque interrompido pela desconexão do componente). */
963
956
  destruir() {
964
- var r;
965
- (r = this.cancelarToque) == null || r.call(this), this.cancelarToque = null;
957
+ var t;
958
+ (t = this.cancelarToque) == null || t.call(this), this.cancelarToque = null;
966
959
  }
967
960
  bindInlineRename() {
968
- Fe(this.host, this.shadow);
961
+ Be(this.host, this.shadow);
969
962
  }
970
963
  limparClassesDeArraste() {
971
- this.shadow.querySelectorAll(".ui-layer-row, .ui-feat-row, .ui-layer-group").forEach((r) => {
972
- r.classList.remove(...Ka);
964
+ this.shadow.querySelectorAll(".ui-layer-row, .ui-feat-row, .ui-layer-group").forEach((t) => {
965
+ t.classList.remove(...Ya);
973
966
  });
974
967
  }
975
968
  /** Depois de qualquer mudança na ordem/hierarquia de camadas. */
976
969
  aposReordenarCamadas() {
977
- var r, a;
978
- (a = (r = this.host).salvarLembrancaEstado) == null || a.call(r), this.host.dispararEvento("ui-camadas-reordenadas", { camadas: [...this.host.camadas] }), this.host.solicitarRenderizacao();
970
+ var t, a;
971
+ (a = (t = this.host).salvarLembrancaEstado) == null || a.call(t), this.host.dispararEvento("ui-camadas-reordenadas", { camadas: [...this.host.camadas] }), this.host.solicitarRenderizacao();
979
972
  }
980
- emitirFeicaoMovida(r) {
973
+ emitirFeicaoMovida(t) {
981
974
  this.host.dispararEvento("ui-feicao-movida", {
982
- feicaoId: r.feicao.id,
983
- camadaOrigemId: r.camadaOrigemId,
984
- camadaDestinoId: r.camadaDestinoId,
985
- feicao: r.feicao
975
+ feicaoId: t.feicao.id,
976
+ camadaOrigemId: t.camadaOrigemId,
977
+ camadaDestinoId: t.camadaDestinoId,
978
+ feicao: t.feicao
986
979
  });
987
980
  }
988
- /** Camada travada (ou sob grupo travado) não recebe nem perde feições pelo arraste. */
989
- trocaEntreCamadasTravada(r, a) {
990
- var o;
991
- const t = (o = this.host.feicoes.find((n) => n.id === r)) == null ? void 0 : o.layerId;
992
- if (!a || t === a) return !1;
993
- const i = xe(this.host.camadas);
994
- return i.has(a) || !!t && i.has(t);
981
+ /** Camada travada (ou sob grupo travado) ou feição individualmente travada não pode ser movida entre camadas. */
982
+ trocaEntreCamadasTravada(t, a) {
983
+ const r = this.host.feicoes.find((n) => n.id === t), i = r == null ? void 0 : r.layerId;
984
+ if (!a || i === a) return !1;
985
+ if ((r == null ? void 0 : r.locked) === !0) return !0;
986
+ const o = ie(this.host.camadas);
987
+ return o.has(a) || !!i && o.has(i);
995
988
  }
996
- arrasteBloqueado(r) {
997
- return !!r.closest("input, button, select") || !!this.host.editingLayerId || !!this.host.editingFeatureId;
989
+ arrasteBloqueado(t) {
990
+ return !!t.closest("input, button, select") || !!this.host.editingLayerId || !!this.host.editingFeatureId;
998
991
  }
999
992
  /** Render completo: zera o arraste e liga camadas e feições do painel todo. */
1000
993
  bindDragAndDrop() {
1001
994
  this.arraste = { tipo: null, camadaId: null, feicaoId: null }, this.vincularArrasteCamadas(this.shadow), this.vincularArrasteFeicoes(this.shadow);
1002
995
  }
1003
996
  /** Atualização incremental: liga renomear e arraste só nas linhas de feição novas dentro de `raiz`. */
1004
- bindLinhasFeicao(r) {
1005
- Fe(this.host, this.shadow, r), this.vincularArrasteFeicoes(r);
997
+ bindLinhasFeicao(t) {
998
+ Be(this.host, this.shadow, t), this.vincularArrasteFeicoes(t);
1006
999
  }
1007
- vincularArrasteCamadas(r) {
1008
- r.querySelectorAll('.ui-layer-row[draggable="true"]').forEach((a) => {
1009
- const t = a.getAttribute("data-layer-id");
1010
- t && (a.addEventListener("dragstart", (i) => {
1000
+ vincularArrasteCamadas(t) {
1001
+ t.querySelectorAll('.ui-layer-row[draggable="true"]').forEach((a) => {
1002
+ const r = a.getAttribute("data-layer-id");
1003
+ r && (a.addEventListener("dragstart", (i) => {
1011
1004
  const o = i;
1012
1005
  if (this.arrasteBloqueado(o.target)) {
1013
1006
  o.preventDefault();
1014
1007
  return;
1015
1008
  }
1016
- this.arraste.tipo = "layer", this.arraste.camadaId = t, o.dataTransfer && (o.dataTransfer.setData("text/plain", JSON.stringify({ type: "layer", id: t })), o.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
1009
+ this.arraste.tipo = "layer", this.arraste.camadaId = r, o.dataTransfer && (o.dataTransfer.setData("text/plain", JSON.stringify({ type: "layer", id: r })), o.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
1017
1010
  }), a.addEventListener("dragover", (i) => {
1018
1011
  const o = i;
1019
1012
  if (o.preventDefault(), o.stopPropagation(), o.dataTransfer && (o.dataTransfer.dropEffect = "move"), this.arraste.tipo === "layer") {
1020
- if (this.arraste.camadaId === t) return;
1021
- const n = a.getBoundingClientRect(), l = Na((o.clientY - n.top) / n.height);
1022
- a.classList.toggle("drop-above", l === "acima"), a.classList.toggle("drop-below", l === "abaixo"), a.classList.toggle("drop-into", l === "dentro");
1013
+ if (this.arraste.camadaId === r) return;
1014
+ const n = a.getBoundingClientRect(), s = Me((o.clientY - n.top) / n.height);
1015
+ a.classList.toggle("drop-above", s === "acima"), a.classList.toggle("drop-below", s === "abaixo"), a.classList.toggle("drop-into", s === "dentro");
1023
1016
  } else this.arraste.tipo === "feature" && a.classList.add("drop-into");
1024
1017
  }), a.addEventListener("dragleave", (i) => {
1025
1018
  const o = i.relatedTarget;
1026
1019
  o && a.contains(o) || a.classList.remove("drop-above", "drop-below", "drop-into");
1027
1020
  }), a.addEventListener("drop", (i) => {
1028
- var l;
1021
+ var s;
1029
1022
  const o = i;
1030
1023
  o.preventDefault(), o.stopPropagation();
1031
1024
  const n = a.classList.contains("drop-into") ? "dentro" : a.classList.contains("drop-above") ? "acima" : "abaixo";
1032
1025
  if (this.limparClassesDeArraste(), this.arraste.tipo === "layer") {
1033
- if (!this.arraste.camadaId || this.arraste.camadaId === t || !this.host.camadas.some((s) => s.id === this.arraste.camadaId) || !this.host.camadas.some((s) => s.id === t)) return;
1034
- const c = Ha(this.host.camadas, this.arraste.camadaId, t, n);
1035
- (c == null ? void 0 : c.tipo) === "hierarquia" ? ((l = this.host.expandedLayers) == null || l.add(c.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
1026
+ if (!this.arraste.camadaId || this.arraste.camadaId === r || !this.host.camadas.some((l) => l.id === this.arraste.camadaId) || !this.host.camadas.some((l) => l.id === r)) return;
1027
+ const c = ze(this.host.camadas, this.arraste.camadaId, r, n);
1028
+ (c == null ? void 0 : c.tipo) === "hierarquia" ? ((s = this.host.expandedLayers) == null || s.add(c.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
1036
1029
  camadaId: c.camada.id,
1037
1030
  novoParentId: c.novoParentId,
1038
1031
  parentAnteriorId: c.parentAnteriorId,
@@ -1044,8 +1037,8 @@ class Qa {
1044
1037
  camada: c.camada
1045
1038
  }), this.aposReordenarCamadas();
1046
1039
  } else if (this.arraste.tipo === "feature") {
1047
- if (!this.arraste.feicaoId || this.trocaEntreCamadasTravada(this.arraste.feicaoId, t)) return;
1048
- const c = _a(this.host.feicoes, this.host.camadas, this.arraste.feicaoId, t);
1040
+ if (!this.arraste.feicaoId || this.trocaEntreCamadasTravada(this.arraste.feicaoId, r)) return;
1041
+ const c = Ga(this.host.feicoes, this.host.camadas, this.arraste.feicaoId, r);
1049
1042
  c && (this.emitirFeicaoMovida(c), this.host.solicitarRenderizacao());
1050
1043
  }
1051
1044
  }), a.addEventListener("dragend", () => {
@@ -1053,32 +1046,32 @@ class Qa {
1053
1046
  }));
1054
1047
  });
1055
1048
  }
1056
- vincularArrasteFeicoes(r) {
1057
- r.querySelectorAll('.ui-feat-row[draggable="true"]').forEach((a) => {
1058
- const t = a.getAttribute("data-feat-row"), i = a.getAttribute("data-feat-layer");
1059
- t && (a.addEventListener("dragstart", (o) => {
1049
+ vincularArrasteFeicoes(t) {
1050
+ t.querySelectorAll('.ui-feat-row[draggable="true"]').forEach((a) => {
1051
+ const r = a.getAttribute("data-feat-row"), i = a.getAttribute("data-feat-layer");
1052
+ r && (a.addEventListener("dragstart", (o) => {
1060
1053
  const n = o;
1061
1054
  if (this.arrasteBloqueado(n.target)) {
1062
1055
  n.preventDefault();
1063
1056
  return;
1064
1057
  }
1065
- n.stopPropagation(), this.arraste.tipo = "feature", this.arraste.feicaoId = t, this.arraste.camadaId = i, n.dataTransfer && (n.dataTransfer.setData("text/plain", JSON.stringify({ type: "feature", id: t, layerId: i })), n.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
1058
+ n.stopPropagation(), this.arraste.tipo = "feature", this.arraste.feicaoId = r, this.arraste.camadaId = i, n.dataTransfer && (n.dataTransfer.setData("text/plain", JSON.stringify({ type: "feature", id: r, layerId: i })), n.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
1066
1059
  }), a.addEventListener("dragover", (o) => {
1067
1060
  const n = o;
1068
- if (this.arraste.tipo !== "feature" || this.arraste.feicaoId === t) return;
1061
+ if (this.arraste.tipo !== "feature" || this.arraste.feicaoId === r) return;
1069
1062
  n.preventDefault(), n.stopPropagation(), n.dataTransfer && (n.dataTransfer.dropEffect = "move");
1070
- const l = a.getBoundingClientRect(), c = n.clientY - l.top < l.height / 2;
1063
+ const s = a.getBoundingClientRect(), c = n.clientY - s.top < s.height / 2;
1071
1064
  a.classList.toggle("drop-above", c), a.classList.toggle("drop-below", !c);
1072
1065
  }), a.addEventListener("dragleave", (o) => {
1073
1066
  const n = o.relatedTarget;
1074
1067
  n && a.contains(n) || a.classList.remove("drop-above", "drop-below");
1075
1068
  }), a.addEventListener("drop", (o) => {
1076
1069
  const n = o;
1077
- if (this.arraste.tipo !== "feature" || !this.arraste.feicaoId || this.arraste.feicaoId === t) return;
1070
+ if (this.arraste.tipo !== "feature" || !this.arraste.feicaoId || this.arraste.feicaoId === r) return;
1078
1071
  n.preventDefault(), n.stopPropagation();
1079
- const l = a.classList.contains("drop-above");
1072
+ const s = a.classList.contains("drop-above");
1080
1073
  if (this.limparClassesDeArraste(), this.trocaEntreCamadasTravada(this.arraste.feicaoId, i)) return;
1081
- const c = Ua(this.host.feicoes, this.arraste.feicaoId, t, l);
1074
+ const c = _a(this.host.feicoes, this.arraste.feicaoId, r, s);
1082
1075
  c && (c.mudouDeCamada && this.emitirFeicaoMovida(c), this.host.dispararEvento("ui-feicoes-reordenadas", { feicoes: [...this.host.feicoes] }), this.host.solicitarRenderizacao());
1083
1076
  }), a.addEventListener("dragend", (o) => {
1084
1077
  o.stopPropagation(), this.arraste.tipo = null, this.arraste.feicaoId = null, this.arraste.camadaId = null, this.limparClassesDeArraste();
@@ -1087,81 +1080,96 @@ class Qa {
1087
1080
  }
1088
1081
  /**
1089
1082
  * Suporte a arraste por toque e ponteiro no handle (.ui-col-drag) para tablets e mobile.
1083
+ * Suporta tanto reordenação (acima/abaixo) quanto aninhamento hierárquico (drop-into),
1084
+ * mantendo paridade total com o Drag & Drop HTML5.
1090
1085
  * Os ouvintes de `window` existem só durante o gesto e são soltos em `destruir()`.
1091
1086
  */
1092
1087
  bindTouchDragAndDrop() {
1093
- this.shadow.querySelectorAll(".ui-layer-row .ui-col-drag").forEach((r) => {
1094
- const a = r.closest(".ui-layer-row");
1088
+ this.shadow.querySelectorAll(".ui-layer-row .ui-col-drag").forEach((t) => {
1089
+ const a = t.closest(".ui-layer-row");
1095
1090
  if (!a) return;
1096
- const t = a.getAttribute("data-layer-id");
1097
- t && r.addEventListener("pointerdown", (i) => {
1098
- var u;
1091
+ const r = a.getAttribute("data-layer-id");
1092
+ r && t.addEventListener("pointerdown", (i) => {
1093
+ var d;
1099
1094
  const o = i;
1100
1095
  if (o.pointerType === "mouse" && o.button !== 0 || this.host.editingLayerId || this.host.editingFeatureId) return;
1101
- (u = this.cancelarToque) == null || u.call(this);
1102
- let n = null, l = !1;
1103
- const c = (d) => {
1104
- d.preventDefault(), a.classList.add("dragging");
1105
- const m = this.shadow.elementFromPoint(d.clientX, d.clientY), f = m ? m.closest(".ui-layer-row") : null;
1106
- if (n && n !== f && n.classList.remove("drop-above", "drop-below"), f && f !== a) {
1107
- n = f;
1108
- const g = f.getBoundingClientRect();
1109
- l = d.clientY - g.top < g.height / 2, f.classList.toggle("drop-above", l), f.classList.toggle("drop-below", !l);
1096
+ (d = this.cancelarToque) == null || d.call(this);
1097
+ let n = null, s = "abaixo";
1098
+ const c = (u) => {
1099
+ u.preventDefault(), a.classList.add("dragging");
1100
+ const f = this.shadow.elementFromPoint(u.clientX, u.clientY), m = f ? f.closest(".ui-layer-row") : null;
1101
+ if (n && n !== m && n.classList.remove("drop-above", "drop-below", "drop-into"), m && m !== a) {
1102
+ n = m;
1103
+ const g = m.getBoundingClientRect();
1104
+ s = g.height > 0 ? Me((u.clientY - g.top) / g.height) : "abaixo", m.classList.toggle("drop-above", s === "acima"), m.classList.toggle("drop-below", s === "abaixo"), m.classList.toggle("drop-into", s === "dentro");
1110
1105
  } else
1111
1106
  n = null;
1112
- }, s = () => {
1107
+ }, l = () => {
1113
1108
  window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", p), window.removeEventListener("pointercancel", p), this.cancelarToque = null;
1114
1109
  }, p = () => {
1115
- s();
1116
- const d = n == null ? void 0 : n.getAttribute("data-layer-id");
1117
- this.limparClassesDeArraste(), d && Ga(this.host.camadas, t, d, l) && this.aposReordenarCamadas();
1110
+ var m;
1111
+ l();
1112
+ const u = n == null ? void 0 : n.getAttribute("data-layer-id");
1113
+ if (this.limparClassesDeArraste(), !u || u === r) return;
1114
+ const f = ze(this.host.camadas, r, u, s);
1115
+ f && (f.tipo === "hierarquia" ? ((m = this.host.expandedLayers) == null || m.add(f.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
1116
+ camadaId: f.camada.id,
1117
+ novoParentId: f.novoParentId,
1118
+ parentAnteriorId: f.parentAnteriorId,
1119
+ camada: f.camada
1120
+ })) : f.parentAnteriorId !== f.novoParentId && this.host.dispararEvento("ui-camada-mover-hierarquia", {
1121
+ camadaId: f.camada.id,
1122
+ novoParentId: f.novoParentId,
1123
+ parentAnteriorId: f.parentAnteriorId,
1124
+ camada: f.camada
1125
+ }), this.aposReordenarCamadas());
1118
1126
  };
1119
1127
  this.cancelarToque = () => {
1120
- s(), this.limparClassesDeArraste();
1128
+ l(), this.limparClassesDeArraste();
1121
1129
  }, window.addEventListener("pointermove", c, { passive: !1 }), window.addEventListener("pointerup", p), window.addEventListener("pointercancel", p);
1122
1130
  });
1123
1131
  });
1124
1132
  }
1125
1133
  }
1126
- const Xa = "ui_camadas_estado_";
1127
- function Wa(e, r) {
1128
- const a = (e || r || "default").trim();
1129
- return `${Xa}${a}`;
1134
+ const Qa = "ui_camadas_estado_";
1135
+ function Xa(e, t) {
1136
+ const a = (e || t || "default").trim();
1137
+ return `${Qa}${a}`;
1130
1138
  }
1131
- function ve(e) {
1139
+ function be(e) {
1132
1140
  return !!e && typeof e == "object" && !Array.isArray(e);
1133
1141
  }
1134
- function ae(e) {
1135
- return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
1142
+ function re(e) {
1143
+ return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
1136
1144
  }
1137
- function ze(e) {
1138
- if (!ve(e)) return;
1139
- const r = {};
1140
- return typeof e.name == "string" && (r.name = e.name), typeof e.visible == "boolean" && (r.visible = e.visible), typeof e.locked == "boolean" && (r.locked = e.locked), typeof e.opacity == "number" && Number.isFinite(e.opacity) && e.opacity >= 0 && e.opacity <= 1 && (r.opacity = e.opacity), typeof e.color == "string" && (r.color = e.color), (typeof e.parentId == "string" || e.parentId === null) && (r.parentId = e.parentId), r;
1145
+ function qe(e) {
1146
+ if (!be(e)) return;
1147
+ const t = {};
1148
+ return typeof e.name == "string" && (t.name = e.name), typeof e.visible == "boolean" && (t.visible = e.visible), typeof e.locked == "boolean" && (t.locked = e.locked), typeof e.opacity == "number" && Number.isFinite(e.opacity) && e.opacity >= 0 && e.opacity <= 1 && (t.opacity = e.opacity), typeof e.color == "string" && (t.color = e.color), (typeof e.parentId == "string" || e.parentId === null) && (t.parentId = e.parentId), t;
1141
1149
  }
1142
- function Ja(e) {
1143
- if (!ve(e)) return null;
1144
- const r = {};
1145
- if (ve(e.camadasOverrides))
1146
- for (const [t, i] of Object.entries(e.camadasOverrides)) {
1147
- const o = ze(i);
1150
+ function Wa(e) {
1151
+ if (!be(e)) return null;
1152
+ const t = {};
1153
+ if (be(e.camadasOverrides))
1154
+ for (const [r, i] of Object.entries(e.camadasOverrides)) {
1155
+ const o = qe(i);
1148
1156
  if (!o) continue;
1149
- const n = ze(i.origem);
1150
- r[t] = n ? { ...o, origem: n } : o;
1157
+ const n = qe(i.origem);
1158
+ t[r] = n ? { ...o, origem: n } : o;
1151
1159
  }
1152
1160
  const a = e.altura;
1153
1161
  return {
1154
1162
  versao: typeof e.versao == "number" ? e.versao : 1,
1155
- expandedLayerIds: ae(e.expandedLayerIds),
1156
- collapsedLayerIds: ae(e.collapsedLayerIds),
1163
+ expandedLayerIds: re(e.expandedLayerIds),
1164
+ collapsedLayerIds: re(e.collapsedLayerIds),
1157
1165
  camadaAtivaId: typeof e.camadaAtivaId == "string" ? e.camadaAtivaId : null,
1158
1166
  painelColapsado: typeof e.painelColapsado == "boolean" ? e.painelColapsado : void 0,
1159
- ordemCamadasIds: ae(e.ordemCamadasIds),
1160
- ordemOrigemIds: Array.isArray(e.ordemOrigemIds) ? ae(e.ordemOrigemIds) : void 0,
1167
+ ordemCamadasIds: re(e.ordemCamadasIds),
1168
+ ordemOrigemIds: Array.isArray(e.ordemOrigemIds) ? re(e.ordemOrigemIds) : void 0,
1161
1169
  mapaBaseAtivo: typeof e.mapaBaseAtivo == "string" ? e.mapaBaseAtivo : void 0,
1162
1170
  densidade: e.densidade === "compacto" || e.densidade === "normal" ? e.densidade : void 0,
1163
1171
  altura: typeof a == "number" && Number.isFinite(a) && a > 0 ? a : null,
1164
- camadasOverrides: r,
1172
+ camadasOverrides: t,
1165
1173
  ultimaAtualizacao: typeof e.ultimaAtualizacao == "number" ? e.ultimaAtualizacao : void 0
1166
1174
  };
1167
1175
  }
@@ -1169,29 +1177,29 @@ function he(e) {
1169
1177
  if (typeof window > "u" || typeof localStorage > "u")
1170
1178
  return null;
1171
1179
  try {
1172
- const r = localStorage.getItem(e);
1173
- return r ? Ja(JSON.parse(r)) : null;
1174
- } catch (r) {
1175
- console.warn(`[UI-Camadas] Não foi possível carregar o estado persistido (${e}):`, r);
1180
+ const t = localStorage.getItem(e);
1181
+ return t ? Wa(JSON.parse(t)) : null;
1182
+ } catch (t) {
1183
+ console.warn(`[UI-Camadas] Não foi possível carregar o estado persistido (${e}):`, t);
1176
1184
  }
1177
1185
  return null;
1178
1186
  }
1179
- function Za(e, r) {
1187
+ function Ja(e, t) {
1180
1188
  if (!(typeof window > "u" || typeof localStorage > "u"))
1181
1189
  try {
1182
- localStorage.setItem(e, JSON.stringify(r));
1190
+ localStorage.setItem(e, JSON.stringify(t));
1183
1191
  } catch (a) {
1184
1192
  console.warn(`[UI-Camadas] Não foi possível salvar o estado persistido (${e}):`, a);
1185
1193
  }
1186
1194
  }
1187
- function er(e) {
1195
+ function Za(e) {
1188
1196
  if (!(typeof window > "u" || typeof localStorage > "u"))
1189
1197
  try {
1190
1198
  localStorage.removeItem(e);
1191
1199
  } catch {
1192
1200
  }
1193
1201
  }
1194
- function Je(e) {
1202
+ function ta(e) {
1195
1203
  return {
1196
1204
  name: e.name,
1197
1205
  visible: e.visible !== !1,
@@ -1201,57 +1209,57 @@ function Je(e) {
1201
1209
  parentId: e.parentId !== void 0 ? e.parentId : null
1202
1210
  };
1203
1211
  }
1204
- function ar(e, r, a, t) {
1205
- var u;
1212
+ function et(e, t, a, r) {
1213
+ var d;
1206
1214
  if (!Array.isArray(e)) return;
1207
- const i = (r == null ? void 0 : r.camadasOverrides) || {}, o = new Set((r == null ? void 0 : r.expandedLayerIds) || []), n = new Set((r == null ? void 0 : r.collapsedLayerIds) || []), l = o.size > 0 || n.size > 0;
1208
- for (let d = 0; d < e.length; d++) {
1209
- const m = e[d], f = i[m.id];
1210
- if (t == null || t.set(m.id, Je(m)), f) {
1211
- const g = f.origem, v = (y) => {
1212
- var M;
1213
- const k = (M = t == null ? void 0 : t.get(m.id)) == null ? void 0 : M[y];
1214
- return g !== void 0 && g[y] !== k;
1215
+ const i = (t == null ? void 0 : t.camadasOverrides) || {}, o = new Set((t == null ? void 0 : t.expandedLayerIds) || []), n = new Set((t == null ? void 0 : t.collapsedLayerIds) || []), s = o.size > 0 || n.size > 0;
1216
+ for (let u = 0; u < e.length; u++) {
1217
+ const f = e[u], m = i[f.id];
1218
+ if (r == null || r.set(f.id, ta(f)), m) {
1219
+ const g = m.origem, v = (b) => {
1220
+ var L;
1221
+ const E = (L = r == null ? void 0 : r.get(f.id)) == null ? void 0 : L[b];
1222
+ return g !== void 0 && g[b] !== E;
1215
1223
  };
1216
- typeof f.name == "string" && f.name.trim() && !v("name") && (m.name = f.name), typeof f.visible == "boolean" && !v("visible") && (m.visible = f.visible), typeof f.locked == "boolean" && !v("locked") && (m.locked = f.locked), typeof f.opacity == "number" && !v("opacity") && (m.opacity = f.opacity), typeof f.color == "string" && !v("color") && (m.color = f.color), f.parentId !== void 0 && !v("parentId") && (m.parentId = f.parentId);
1224
+ typeof m.name == "string" && m.name.trim() && !v("name") && (f.name = m.name), typeof m.visible == "boolean" && !v("visible") && (f.visible = m.visible), typeof m.locked == "boolean" && !v("locked") && (f.locked = m.locked), typeof m.opacity == "number" && !v("opacity") && (f.opacity = m.opacity), typeof m.color == "string" && !v("color") && (f.color = m.color), m.parentId !== void 0 && !v("parentId") && (f.parentId = m.parentId);
1217
1225
  }
1218
- l ? o.has(m.id) ? a.add(m.id) : n.has(m.id) ? a.delete(m.id) : a.add(m.id) : a.add(m.id);
1226
+ s ? o.has(f.id) ? a.add(f.id) : n.has(f.id) ? a.delete(f.id) : a.add(f.id) : a.add(f.id);
1219
1227
  }
1220
- for (let d = 0; d < e.length; d++) {
1221
- const m = e[d];
1222
- m.parentId && (m.parentId === m.id || U(e, m.parentId, m.id)) && (m.parentId = ((u = t == null ? void 0 : t.get(m.id)) == null ? void 0 : u.parentId) ?? null);
1223
- }
1224
- const c = new Set(e.map((d) => d.id)), s = r == null ? void 0 : r.ordemOrigemIds;
1225
- if (!(Array.isArray(s) && (() => {
1226
- const d = new Set(s), m = (f) => f.filter((g) => c.has(g) && d.has(g)).join("|");
1227
- return m(s) !== m(e.map((f) => f.id));
1228
- })()) && Array.isArray(r == null ? void 0 : r.ordemCamadasIds) && r.ordemCamadasIds.length > 0) {
1229
- const d = /* @__PURE__ */ new Map();
1230
- r.ordemCamadasIds.forEach((m, f) => d.set(m, f)), e.sort((m, f) => {
1231
- const g = d.has(m.id) ? d.get(m.id) : 9999, v = d.has(f.id) ? d.get(f.id) : 9999;
1228
+ for (let u = 0; u < e.length; u++) {
1229
+ const f = e[u];
1230
+ f.parentId && (f.parentId === f.id || Y(e, f.parentId, f.id)) && (f.parentId = ((d = r == null ? void 0 : r.get(f.id)) == null ? void 0 : d.parentId) ?? null);
1231
+ }
1232
+ const c = new Set(e.map((u) => u.id)), l = t == null ? void 0 : t.ordemOrigemIds;
1233
+ if (!(Array.isArray(l) && (() => {
1234
+ const u = new Set(l), f = (m) => m.filter((g) => c.has(g) && u.has(g)).join("|");
1235
+ return f(l) !== f(e.map((m) => m.id));
1236
+ })()) && Array.isArray(t == null ? void 0 : t.ordemCamadasIds) && t.ordemCamadasIds.length > 0) {
1237
+ const u = /* @__PURE__ */ new Map();
1238
+ t.ordemCamadasIds.forEach((f, m) => u.set(f, m)), e.sort((f, m) => {
1239
+ const g = u.has(f.id) ? u.get(f.id) : 9999, v = u.has(m.id) ? u.get(m.id) : 9999;
1232
1240
  return g - v;
1233
1241
  });
1234
1242
  }
1235
1243
  }
1236
- function rr(e) {
1237
- const { estadoAnterior: r, camadas: a, expandedLayers: t } = e;
1238
- let i = (r == null ? void 0 : r.expandedLayerIds) || [], o = (r == null ? void 0 : r.collapsedLayerIds) || [], n = (r == null ? void 0 : r.ordemCamadasIds) || [], l = r == null ? void 0 : r.ordemOrigemIds;
1244
+ function at(e) {
1245
+ const { estadoAnterior: t, camadas: a, expandedLayers: r } = e;
1246
+ let i = (t == null ? void 0 : t.expandedLayerIds) || [], o = (t == null ? void 0 : t.collapsedLayerIds) || [], n = (t == null ? void 0 : t.ordemCamadasIds) || [], s = t == null ? void 0 : t.ordemOrigemIds;
1239
1247
  const c = {
1240
- ...(r == null ? void 0 : r.camadasOverrides) || {}
1248
+ ...(t == null ? void 0 : t.camadasOverrides) || {}
1241
1249
  };
1242
- a.length > 0 && (i = [], o = [], n = a.map((s) => s.id), l = e.origensCamadas ? [...e.origensCamadas.keys()] : n, a.forEach((s) => {
1243
- var p, u;
1244
- t.has(s.id) ? i.push(s.id) : o.push(s.id), c[s.id] = {
1245
- name: s.name,
1246
- visible: s.visible !== !1,
1247
- locked: !!s.locked,
1248
- opacity: typeof s.opacity == "number" ? s.opacity : 1,
1249
- color: s.color || "#00E08A",
1250
- parentId: s.parentId !== void 0 ? s.parentId : null,
1251
- origem: ((p = e.origensCamadas) == null ? void 0 : p.get(s.id)) ?? ((u = c[s.id]) == null ? void 0 : u.origem)
1250
+ a.length > 0 && (i = [], o = [], n = a.map((l) => l.id), s = e.origensCamadas ? [...e.origensCamadas.keys()] : n, a.forEach((l) => {
1251
+ var p, d;
1252
+ r.has(l.id) ? i.push(l.id) : o.push(l.id), c[l.id] = {
1253
+ name: l.name,
1254
+ visible: l.visible !== !1,
1255
+ locked: !!l.locked,
1256
+ opacity: typeof l.opacity == "number" ? l.opacity : 1,
1257
+ color: l.color || "#00E08A",
1258
+ parentId: l.parentId !== void 0 ? l.parentId : null,
1259
+ origem: ((p = e.origensCamadas) == null ? void 0 : p.get(l.id)) ?? ((d = c[l.id]) == null ? void 0 : d.origem)
1252
1260
  };
1253
1261
  }));
1254
- for (const s of e.camadasRemovidas ?? []) delete c[s];
1262
+ for (const l of e.camadasRemovidas ?? []) delete c[l];
1255
1263
  return {
1256
1264
  versao: 1,
1257
1265
  expandedLayerIds: i,
@@ -1259,7 +1267,7 @@ function rr(e) {
1259
1267
  camadaAtivaId: e.camadaAtivaId,
1260
1268
  painelColapsado: e.painelColapsado,
1261
1269
  ordemCamadasIds: n,
1262
- ordemOrigemIds: l,
1270
+ ordemOrigemIds: s,
1263
1271
  mapaBaseAtivo: e.mapaBaseAtivo,
1264
1272
  densidade: e.densidade,
1265
1273
  altura: e.altura,
@@ -1267,460 +1275,483 @@ function rr(e) {
1267
1275
  ultimaAtualizacao: Date.now()
1268
1276
  };
1269
1277
  }
1270
- const tr = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:inherit;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;width:100%;height:var(--ui-camadas-altura, 100%);min-height:var(--ui-camadas-min-altura, 140px);position:relative;--camada-respiro: 8px;--camada-barra-altura: 28px;--camada-linha-altura: 25px;--camada-thumb-tamanho: 20px;--camada-transicao: .16s cubic-bezier(.16, 1, .3, 1)}:host([densidade="compacto"]){--camada-linha-altura: 22px;--camada-thumb-tamanho: 17px;font-size:10px}:host([flutuante]){position:absolute;top:10px;right:10px;bottom:46px;z-index:var(--ui-z-workspace-hud, 500);width:auto;height:var(--ui-camadas-altura, auto)}*,*:before,*:after{box-sizing:border-box}:host(:not([flutuante])) .ui-camadas-container{max-width:100%;min-width:0;border:none;box-shadow:none;border-radius:0;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.ui-camadas-container{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;width:100%;max-width:380px;min-width:270px;background:var(--ui-degrade-interno, var(--ui-camadas-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);box-shadow:var(--ui-sombra-lg, 0 10px 30px -4px rgba(0, 0, 0, .5)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);overflow:hidden;position:relative;transition:transform .24s cubic-bezier(.16,1,.3,1),opacity .2s ease;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}:host([colapsado]) .ui-camadas-container{transform:translate(calc(100% + 24px));opacity:0;pointer-events:none}.ui-camadas-toggle-flutuante{display:none;position:absolute;top:10px;right:10px;z-index:calc(var(--ui-z-workspace-hud, 500) - 1);background:var(--ui-camadas-toggle-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 6px);color:var(--ui-cor-texto, #ffffff);width:34px;height:34px;cursor:pointer;align-items:center;justify-content:center;box-shadow:var(--ui-sombra-md, 0 8px 20px rgba(0, 0, 0, .45));transition:all var(--camada-transicao)}:host([colapsado][flutuante]) .ui-camadas-toggle-flutuante{display:flex}.ui-camadas-toggle-flutuante:hover{border-color:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-primaria, #00E08A);transform:scale(1.08);box-shadow:0 0 14px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-camadas-header{height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);max-height:var(--camada-barra-altura);display:flex;align-items:center;justify-content:space-between;padding:0 5px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));background:var(--ui-cor-fundo-elevado, rgba(0, 0, 0, .28));gap:4px}.ui-camadas-tabs{display:flex;gap:3px;flex:1}.ui-camadas-tab-btn{flex:1;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);height:24px;padding:0 6px;font-size:11px;font-weight:500;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;transition:all var(--camada-transicao)}.ui-camadas-tab-btn:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .07))}.ui-camadas-tab-btn.active{color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent);font-weight:600}.ui-camadas-btn-colapsar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;cursor:pointer;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--camada-transicao)}.ui-camadas-btn-colapsar:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-camadas-corpo{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 var(--camada-respiro) var(--camada-respiro);display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent) transparent}.ui-camadas-corpo::-webkit-scrollbar{width:4px}.ui-camadas-corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-camadas-corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent)}.ui-tree-toolbar{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro));padding:0 var(--camada-respiro);gap:8px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .06))}.ui-tree-title-group{display:flex;align-items:center;gap:5px}.ui-tree-section-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-tree-count-badge{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);color:var(--ui-cor-texto-secundario, #888899);padding:1px 5px;border-radius:8px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent)}.ui-tree-actions{display:flex;align-items:center;gap:3px}.ui-tree-action-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);border-radius:var(--ui-raio-sm, 4px);width:24px;height:24px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-tree-action-btn:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-tree-btn-new{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);border:none;color:var(--ui-cor-primaria, #00E08A);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 8px;font-size:10px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-tree-btn-new:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-tree-search-wrapper{position:relative;display:flex;align-items:center;margin:1px 0}.ui-tree-search-icon{position:absolute;left:8px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;display:flex;align-items:center}.ui-tree-search-input{width:100%;height:25px;background:var(--ui-cor-fundo, #0a0a0c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));border-radius:var(--ui-raio-borda, 5px);padding:0 24px 0 26px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;outline:none;transition:border-color var(--camada-transicao),box-shadow var(--camada-transicao)}.ui-tree-search-input:focus{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-tree-search-clear{position:absolute;right:5px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;width:18px;height:18px;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:all var(--camada-transicao)}.ui-tree-search-clear:hover{color:var(--ui-cor-texto, #ffffff);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-panel-box{background:var(--ui-cor-fundo, #0c0c0f);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));border-radius:var(--ui-raio-borda, 6px);overflow:hidden;display:flex;flex-direction:column;flex:1 1 0%;min-height:140px}.ui-search-empty{padding:14px 10px;text-align:center;font-size:11px;color:var(--ui-cor-texto-secundario, #888899);overflow-wrap:anywhere}.ui-layer-tree{flex:1 1 0%;min-height:40px;overflow-y:auto;overflow-x:hidden}.ui-layer-group{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .04));transition:background var(--camada-transicao)}.ui-layer-group.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A);outline-offset:-1.5px}.ui-layer-row,.ui-feat-row{display:flex;align-items:center;height:var(--camada-linha-altura);min-height:var(--camada-linha-altura);max-height:var(--camada-linha-altura);padding:0 4px;-webkit-user-select:none;user-select:none;cursor:default;transition:background .1s ease;position:relative}.ui-layer-row{background:var(--ui-cor-fundo-elevado, #18181d);font-weight:600;cursor:pointer;border-left:3px solid transparent}.ui-layer-row:hover{background:var(--ui-cor-hover-menu, #22222a)}.ui-layer-row.active-drawing-layer{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 18%,var(--ui-cor-fundo-elevado, #18181d))!important;border-left:3px solid var(--layer-active-color, var(--ui-cor-primaria, #00E08A))!important;box-shadow:inset 0 0 12px color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 10%,transparent)}.ui-layer-row.active-drawing-layer .ui-name-text{color:var(--ui-cor-texto, #e1e1e6);font-weight:700}.ui-feat-row{border-left:3px solid transparent;padding-left:13px;background:var(--ui-cor-fundo, #101014);font-weight:400;cursor:pointer}.ui-feat-row:hover{background:var(--ui-cor-hover-menu, #19191f)}.ui-feat-row.selected-row{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 20%,var(--ui-cor-fundo, #101014))!important;outline:1px solid color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 55%,transparent)!important;outline-offset:-1px}.ui-layer-row.hidden-layer,.ui-feat-row.hidden-row{opacity:.52}.ui-layer-row.hidden-layer .ui-col-eye,.ui-feat-row.hidden-row .ui-col-eye{color:var(--ui-cor-texto-alerta, #ffb86c);opacity:.95}.ui-layer-row.dragging,.ui-feat-row.dragging{opacity:.35;background:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 16%,transparent)!important}.ui-layer-row.drop-above:before,.ui-feat-row.drop-above:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-below:after,.ui-feat-row.drop-below:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 16%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A)!important;outline-offset:-2px;border-radius:var(--ui-raio-sm, 4px)}.ui-layer-row.is-sublayer{background:color-mix(in srgb,var(--ui-cor-fundo-elevado, #18181d) 70%,transparent)}.ui-group-folder-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-alerta, #ffb86c);margin-right:4px;flex-shrink:0}.ui-col{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--camada-linha-altura)}.ui-col-drag{width:8px;margin-right:1px;cursor:grab;color:var(--ui-cor-texto-secundario, #888899);opacity:.35;touch-action:none;transition:opacity var(--camada-transicao),color var(--camada-transicao)}.ui-layer-row:hover .ui-col-drag,.ui-feat-row:hover .ui-col-drag{opacity:.9;color:var(--ui-cor-primaria, #00E08A)}.ui-col-drag:active{cursor:grabbing}.ui-col-eye{width:20px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-eye:hover{color:var(--ui-cor-primaria, #00E08A)}.ui-col-lock{width:18px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-lock:hover{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-col-colorbar{width:3.5px;height:16px;margin:0 3px 0 2px;border-radius:1.5px;flex-shrink:0}.ui-col-colorbar-editavel{position:relative;width:5px;height:18px;cursor:pointer}.ui-col-colorbar-editavel:before{content:"";position:absolute;top:-3px;right:-4px;bottom:-3px;left:-4px}.ui-col-colorbar-editavel:hover,.ui-col-colorbar-editavel:focus-visible{filter:brightness(1.3);outline:none}.ui-col-chevron,.ui-col-branch{margin-left:calc(var(--layer-depth, 0) * 12px)}.ui-col-chevron{width:14px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);display:flex;align-items:center;justify-content:center}.ui-chevron-icon{display:inline-flex;align-items:center;justify-content:center;transition:transform var(--camada-transicao)}.ui-chevron-icon.open{transform:rotate(90deg)}.ui-col-branch{width:14px;display:flex;align-items:center;justify-content:center;color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 22%,transparent);font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)}.ui-col-thumb{width:calc(var(--camada-thumb-tamanho) + 3px);margin-right:4px;display:flex;align-items:center;justify-content:center}.ui-thumb-box{width:var(--camada-thumb-tamanho);height:var(--camada-thumb-tamanho);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-radius:3px;background:var(--ui-cor-fundo, #0d0d10);box-sizing:border-box;overflow:hidden;display:flex;align-items:center;justify-content:center}.ui-col-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;color:var(--ui-cor-texto, #e1e1e6);padding-left:2px;padding-right:4px;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;text-align:left;gap:4px}.ui-name-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-count-chip{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #888899);font-weight:400;padding:0 2px;flex-shrink:0}.ui-col-actions{display:flex;align-items:center;gap:2px;opacity:0;transition:opacity var(--camada-transicao)}.ui-layer-row:hover .ui-col-actions,.ui-feat-row:hover .ui-col-actions{opacity:1}.ui-micro-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:18px;height:18px;padding:0;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-micro-btn:hover{color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-micro-btn.active{color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-col-target{width:22px;cursor:pointer}.ui-target-circle{width:11px;height:11px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent);background:transparent;transition:all .12s ease}.ui-col-target:hover .ui-target-circle{border-color:var(--ui-cor-texto-info, #33b5ff);transform:scale(1.18)}.ui-target-circle.selected{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));box-shadow:inset 0 0 0 2px var(--ui-cor-superficie, #141418)}.ui-target-circle.partial{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 40%,transparent)}.ui-inline-rename-input{width:100%;height:20px;background:var(--ui-cor-fundo, #0d0d10);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-primaria, #00E08A);border-radius:3px;font-size:10.5px;padding:0 4px;outline:none;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 40%,transparent)}.ui-layer-settings-drawer{background:linear-gradient(180deg,var(--ui-cor-fundo-elevado, #17171e) 0%,var(--ui-cor-superficie, #0f0f13) 100%);padding:10px 14px 12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent);border-left:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;flex-direction:column;gap:10px;box-shadow:inset 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent),0 6px 16px #00000073;animation:drawerSlideDown .18s cubic-bezier(.16,1,.3,1);position:relative;z-index:10}@keyframes drawerSlideDown{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.ui-drawer-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:6px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-header-left{display:flex;align-items:center;gap:7px;min-width:0}.ui-drawer-icon{color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;align-items:center;flex-shrink:0}.ui-drawer-title{font-size:10.5px;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}.ui-drawer-layer-chip{font-size:9.5px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-drawer-btn-fechar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:20px;height:20px;padding:0;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-drawer-btn-fechar:hover{color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-body{display:flex;flex-direction:column;gap:10px}.ui-drawer-row{display:flex;flex-direction:column;gap:5px}.ui-drawer-row-label{display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--ui-cor-texto-secundario, #888899)}.ui-drawer-color-group{display:flex;align-items:center;justify-content:space-between;gap:8px}.ui-drawer-color-pill{position:relative;display:inline-flex;align-items:center;gap:6px;padding:3px 8px 3px 5px;background:var(--ui-cor-fundo, #0b0b0d);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);border-radius:var(--ui-raio-sm, 4px);cursor:pointer;transition:all var(--camada-transicao);-webkit-user-select:none;user-select:none}.ui-drawer-color-pill:hover{border-color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-drawer-color-sample{width:14px;height:14px;border-radius:3px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 35%,transparent);box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .5));flex-shrink:0;transition:background-color .1s ease}.ui-drawer-color-hex{font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);letter-spacing:.5px}.ui-drawer-color-native{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.ui-drawer-badge{font-size:9.5px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider-container{display:flex;flex-direction:column;gap:4px}.ui-drawer-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:5px;background:linear-gradient(90deg,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent) 0%,var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A)) 100%);border-radius:3px;outline:none;margin:3px 0;cursor:pointer;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer;transition:transform .12s ease}.ui-drawer-slider::-webkit-slider-thumb:hover{transform:scale(1.22)}.ui-drawer-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer}.ui-drawer-footer{display:flex;align-items:center;justify-content:space-between;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-meta-info{font-size:9.5px;color:var(--ui-cor-texto-secundario, #888899);font-style:italic}.ui-drawer-actions{display:flex;align-items:center;gap:6px}.ui-drawer-btn-danger{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 10px;font-size:10px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:all var(--camada-transicao)}.ui-drawer-btn-danger:hover{background:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 45%,transparent);transform:translateY(-.5px)}.ui-drawer-btn-danger.confirming{background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-hover, #b71c1c);animation:pulseDanger 1.2s infinite}@keyframes pulseDanger{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.ui-previa-dot{width:6px;height:6px;margin-left:4px;border-radius:50%;flex-shrink:0;background:var(--ui-cor-texto-alerta, #ffb86c);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 25%,transparent)}.ui-tree-footer{height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);background:var(--ui-cor-fundo-elevado, #121216);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:space-between;padding:0 var(--camada-respiro);gap:6px;box-sizing:border-box;overflow:hidden;position:relative;flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro))}.ui-footer-left{display:flex;align-items:center;gap:5px;white-space:nowrap;min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.ui-footer-count{font-size:11px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-primaria, #00E08A);flex-shrink:0}.ui-footer-label{display:inline-flex;align-items:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-footer-actions-gerais{display:flex;align-items:center;gap:4px;flex-shrink:0}.ui-footer-chip-btn{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto-secundario, #a0a0b0);font-size:10px;font-weight:600;height:22px;padding:0 8px;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-footer-chip-btn:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #ffffff)}.ui-footer-chip-btn.primario{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-footer-chip-btn.primario:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-footer-right{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0}.ui-footer-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all var(--camada-transicao);flex-shrink:0}.ui-footer-btn:hover:not(.disabled){color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-btn.disabled{opacity:.25;cursor:not-allowed}.ui-footer-btn.btn-danger-footer:hover:not(.disabled){color:#f55;background:#ff555526}.ui-footer-btn.confirming{background:#f55!important;color:#fff!important}.ui-footer-move-wrapper{position:relative;display:flex;align-items:center;flex:1 1 auto;min-width:0}.ui-footer-select{-moz-appearance:none;appearance:none;-webkit-appearance:none;--_chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background:var(--_chevron) right 6px center / 10px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto, #e1e1e6);border-radius:var(--ui-raio-sm, 4px);font:inherit;font-size:10px;font-weight:500;height:22px;padding:0 22px 0 8px;cursor:pointer;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-footer-select:hover:not(:disabled){background:var(--_chevron) right 6px center / 10px no-repeat,var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-select:focus-visible{outline:1px solid var(--ui-cor-primaria, #00E08A)}.ui-tree-btn-group{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto-secundario, #a0a0b0);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 7px;font-size:10px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-tree-btn-group:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #ffffff)}.ui-drawer-btn-sublayer{background:#ffffff0f;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);font-size:10.5px;font-weight:500;padding:4px 8px;border-radius:4px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-drawer-btn-sublayer:hover{background:#ffffff1f;color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-drawer-select-wrapper{display:flex;align-items:center}.ui-drawer-select{background:var(--ui-cor-fundo, #16161c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .15));color:var(--ui-cor-texto, #e1e1e6);border-radius:4px;font-size:10.5px;height:24px;padding:0 6px;cursor:pointer;max-width:140px}.ui-basemap-section{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.ui-basemap-toggle{display:flex;align-items:center;gap:6px;width:100%;padding:2px;background:transparent;border:0;border-radius:var(--ui-raio-sm, 4px);font:inherit;color:inherit;cursor:pointer;text-align:left}.ui-basemap-toggle:hover .ui-basemap-title{color:var(--ui-cor-texto, #e1e1e6)}.ui-basemap-toggle:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}.ui-basemap-atual{flex:1 1 auto;min-width:0;font-size:10px;color:var(--ui-cor-primaria, #00E08A);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}.ui-basemap-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px}.ui-basemap-section{container-type:inline-size}@container (min-width: 260px){.ui-basemap-grid{grid-template-columns:repeat(3,1fr)}}@container (min-width: 340px){.ui-basemap-grid{grid-template-columns:repeat(4,1fr)}}.ui-basemap-card{display:flex;flex-direction:column;align-items:center;gap:2px;padding:3px;border-radius:var(--ui-raio-borda, 5px);background:var(--ui-cor-fundo, #101014);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:pointer;transition:all var(--camada-transicao);text-align:center;overflow:hidden}.ui-basemap-card:hover{border-color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-fundo-elevado, #17171c)}.ui-basemap-card.active{border-color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);color:var(--ui-cor-primaria, #00E08A);font-weight:600;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-basemap-preview{width:100%;height:22px;border-radius:3px;object-fit:cover;opacity:.85;transition:opacity var(--camada-transicao)}.ui-basemap-preview-none{width:100%;height:22px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);border-radius:3px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-card:hover .ui-basemap-preview,.ui-basemap-card.active .ui-basemap-preview{opacity:1}.ui-basemap-card span{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.ui-layer-row.herdado-oculto,.ui-feat-row.herdado-oculto{opacity:.52}.ui-layer-row.herdado-travado .ui-col-lock.ui-lock-open{color:var(--ui-cor-texto-secundario, #888899);opacity:.7}.ui-search-hidden{display:none!important}.ui-empty-row{height:22px;display:flex;align-items:center;padding-left:36px;font-size:10px;color:var(--ui-cor-texto-secundario, #666677);font-style:italic;background:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}.ui-camadas-resizer-altura{display:none;flex-shrink:0;width:100%;height:9px;background:var(--ui-cor-superficie, #141417);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:ns-resize;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;touch-action:none;transition:background .15s ease,border-color .15s ease;position:relative;z-index:10}:host([redimensionavel]) .ui-camadas-resizer-altura,:host([redimensionavel-altura]) .ui-camadas-resizer-altura{display:flex}.ui-camadas-resizer-altura:hover,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A)}.ui-camadas-resizer-grip{width:32px;height:3px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 22%,transparent);transition:all .15s ease}.ui-camadas-resizer-altura:hover .ui-camadas-resizer-grip,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo .ui-camadas-resizer-grip{background:var(--ui-cor-primaria, #00E08A);width:46px;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 45%,transparent)}:host(.ui-camadas--redimensionando){-webkit-user-select:none!important;user-select:none!important;cursor:ns-resize!important}:host(.ui-camadas--redimensionando) *{-webkit-user-select:none!important;user-select:none!important}.ui-col-lock.ui-lock-open{opacity:.28}.ui-col-lock.ui-lock-open:hover,.ui-col-lock.ui-lock-open:focus-visible{opacity:.8}.ui-col-lock[data-locked-by-layer]{cursor:not-allowed}.ui-col[role=button]:focus-visible,.ui-basemap-card:focus-visible,.ui-feat-row:focus-visible,.ui-layer-row:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-footer-btn.confirming{color:var(--ui-cor-botao-destrutivo-texto, #ffffff);background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);width:auto;padding:0 6px}.ui-truncate-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;margin:4px 8px 6px;background:color-mix(in srgb,var(--ui-cor-superficie-elevada, #1c1c21) 70%,transparent);border:1px dashed var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);font-size:10px;color:var(--ui-cor-texto-secundario, #9ca3af)}.ui-truncate-notice span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-truncate-more-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:var(--ui-cor-superficie, #27272a);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 4px);color:var(--ui-cor-primaria, #00E08A);font-size:10px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all var(--camada-transicao)}.ui-truncate-more-btn:hover{background:var(--ui-cor-superficie-hover, #3f3f46);border-color:var(--ui-cor-primaria, #00E08A)}.ui-truncate-more-btn:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-camadas-container[data-degrade]:not([data-degrade=false]){--ui-camadas-fundo: var(--ui-gradiente-superficie);--ui-camadas-toggle-fundo: var(--ui-gradiente-superficie)}`;
1271
- function ir(e, r) {
1272
- r.querySelectorAll("[data-layer-row]").forEach((t) => {
1273
- const o = t.getAttribute("data-layer-row") === e.camadaAtivaId;
1274
- t.classList.toggle("active-drawing-layer", o), De(t, "camada-ativa", o), o ? t.setAttribute("aria-current", "true") : t.removeAttribute("aria-current");
1278
+ const tt = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:inherit;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;width:100%;height:var(--ui-camadas-altura, 100%);min-height:var(--ui-camadas-min-altura, 140px);position:relative;--camada-respiro: 8px;--camada-barra-altura: 28px;--camada-linha-altura: 25px;--camada-thumb-tamanho: 20px;--camada-transicao: .16s cubic-bezier(.16, 1, .3, 1)}:host([densidade="compacto"]){--camada-linha-altura: 22px;--camada-thumb-tamanho: 17px;font-size:10px}:host([flutuante]){position:absolute;top:10px;right:10px;bottom:46px;z-index:var(--ui-z-workspace-hud, 500);width:auto;height:var(--ui-camadas-altura, auto)}*,*:before,*:after{box-sizing:border-box}:host(:not([flutuante])) .ui-camadas-container{max-width:100%;min-width:0;border:none;box-shadow:none;border-radius:0;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.ui-camadas-container{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;width:100%;max-width:380px;min-width:270px;background:var(--ui-degrade-interno, var(--ui-camadas-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);box-shadow:var(--ui-sombra-lg, 0 10px 30px -4px rgba(0, 0, 0, .5)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);overflow:hidden;position:relative;transition:transform .24s cubic-bezier(.16,1,.3,1),opacity .2s ease;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}:host([colapsado]) .ui-camadas-container{transform:translate(calc(100% + 24px));opacity:0;pointer-events:none}.ui-camadas-toggle-flutuante{display:none;position:absolute;top:10px;right:10px;z-index:calc(var(--ui-z-workspace-hud, 500) - 1);background:var(--ui-camadas-toggle-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 6px);color:var(--ui-cor-texto, #ffffff);width:34px;height:34px;cursor:pointer;align-items:center;justify-content:center;box-shadow:var(--ui-sombra-md, 0 8px 20px rgba(0, 0, 0, .45));transition:all var(--camada-transicao)}:host([colapsado][flutuante]) .ui-camadas-toggle-flutuante{display:flex}.ui-camadas-toggle-flutuante:hover{border-color:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-primaria, #00E08A);transform:scale(1.08);box-shadow:0 0 14px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-camadas-btn-colapsar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;cursor:pointer;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--camada-transicao)}.ui-camadas-btn-colapsar:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-camadas-corpo{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 var(--camada-respiro) var(--camada-respiro);display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent) transparent}.ui-camadas-corpo::-webkit-scrollbar{width:4px}.ui-camadas-corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-camadas-corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent)}.ui-tree-toolbar{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro));padding:0 var(--camada-respiro);gap:8px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .06))}.ui-tree-title-group{display:flex;align-items:center;gap:5px}.ui-tree-section-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-tree-count-badge{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);color:var(--ui-cor-texto-secundario, #888899);padding:1px 5px;border-radius:8px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent)}.ui-tree-actions{display:flex;align-items:center;gap:3px}.ui-tree-action-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);border-radius:var(--ui-raio-sm, 4px);width:24px;height:24px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-tree-action-btn:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-tree-btn-new{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);border:none;color:var(--ui-cor-primaria, #00E08A);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 8px;font-size:10px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-tree-btn-new:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-tree-search-wrapper{position:relative;display:flex;align-items:center;margin:1px 0}.ui-tree-search-icon{position:absolute;left:8px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;display:flex;align-items:center}.ui-tree-search-input{width:100%;height:25px;background:var(--ui-cor-fundo, #0a0a0c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));border-radius:var(--ui-raio-borda, 5px);padding:0 24px 0 26px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;outline:none;transition:border-color var(--camada-transicao),box-shadow var(--camada-transicao)}.ui-tree-search-input:focus{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-tree-search-clear{position:absolute;right:5px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;width:18px;height:18px;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:all var(--camada-transicao)}.ui-tree-search-clear:hover{color:var(--ui-cor-texto, #ffffff);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-panel-box{background:var(--ui-cor-fundo, #0c0c0f);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));border-radius:var(--ui-raio-borda, 6px);overflow:hidden;display:flex;flex-direction:column;flex:1 1 0%;min-height:140px}.ui-search-empty{padding:14px 10px;text-align:center;font-size:11px;color:var(--ui-cor-texto-secundario, #888899);overflow-wrap:anywhere}.ui-layer-tree{flex:1 1 0%;min-height:40px;overflow-y:auto;overflow-x:hidden}.ui-layer-group{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .04));transition:background var(--camada-transicao)}.ui-layer-group.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A);outline-offset:-1.5px}.ui-layer-row,.ui-feat-row{display:flex;align-items:center;height:var(--camada-linha-altura);min-height:var(--camada-linha-altura);max-height:var(--camada-linha-altura);padding:0 4px;-webkit-user-select:none;user-select:none;cursor:default;transition:background .1s ease;position:relative}.ui-layer-row{background:var(--ui-cor-fundo-elevado, #18181d);font-weight:600;cursor:pointer;border-left:3px solid transparent}.ui-layer-row:hover{background:var(--ui-cor-hover-menu, #22222a)}.ui-layer-row.active-drawing-layer{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 18%,var(--ui-cor-fundo-elevado, #18181d))!important;border-left:3px solid var(--layer-active-color, var(--ui-cor-primaria, #00E08A))!important;box-shadow:inset 0 0 12px color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 10%,transparent)}.ui-layer-row.active-drawing-layer .ui-name-text{color:var(--ui-cor-texto, #e1e1e6);font-weight:700}.ui-feat-row{border-left:3px solid transparent;padding-left:13px;background:var(--ui-cor-fundo, #101014);font-weight:400;cursor:pointer}.ui-feat-row:hover{background:var(--ui-cor-hover-menu, #19191f)}.ui-feat-row.selected-row{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 20%,var(--ui-cor-fundo, #101014))!important;outline:1px solid color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 55%,transparent)!important;outline-offset:-1px}.ui-layer-row.hidden-layer,.ui-feat-row.hidden-row{opacity:.52}.ui-layer-row.hidden-layer .ui-col-eye,.ui-feat-row.hidden-row .ui-col-eye{color:var(--ui-cor-texto-alerta, #ffb86c);opacity:.95}.ui-layer-row.dragging,.ui-feat-row.dragging{opacity:.35;background:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 16%,transparent)!important}.ui-layer-row.drop-above:before,.ui-feat-row.drop-above:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-below:after,.ui-feat-row.drop-below:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 16%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A)!important;outline-offset:-2px;border-radius:var(--ui-raio-sm, 4px)}.ui-layer-row.is-sublayer{background:color-mix(in srgb,var(--ui-cor-fundo-elevado, #18181d) 70%,transparent)}.ui-group-folder-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-alerta, #ffb86c);margin-right:4px;flex-shrink:0}.ui-col{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--camada-linha-altura)}.ui-col-drag{width:8px;margin-right:1px;cursor:grab;color:var(--ui-cor-texto-secundario, #888899);opacity:.35;touch-action:none;transition:opacity var(--camada-transicao),color var(--camada-transicao)}.ui-layer-row:hover .ui-col-drag,.ui-feat-row:hover .ui-col-drag{opacity:.9;color:var(--ui-cor-primaria, #00E08A)}.ui-col-drag:active{cursor:grabbing}.ui-col-eye{width:20px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-eye:hover{color:var(--ui-cor-primaria, #00E08A)}.ui-col-lock{width:18px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-lock:hover{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-col-colorbar{width:3.5px;height:16px;margin:0 3px 0 2px;border-radius:1.5px;flex-shrink:0}.ui-col-colorbar-editavel{position:relative;width:5px;height:18px;cursor:pointer}.ui-col-colorbar-editavel:before{content:"";position:absolute;top:-3px;right:-4px;bottom:-3px;left:-4px}.ui-col-colorbar-editavel:hover,.ui-col-colorbar-editavel:focus-visible{filter:brightness(1.3);outline:none}.ui-col-chevron,.ui-col-branch{margin-left:calc(var(--layer-depth, 0) * 12px)}.ui-col-chevron{width:14px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);display:flex;align-items:center;justify-content:center}.ui-chevron-icon{display:inline-flex;align-items:center;justify-content:center;transition:transform var(--camada-transicao)}.ui-chevron-icon.open{transform:rotate(90deg)}.ui-col-branch{width:14px;display:flex;align-items:center;justify-content:center;color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 22%,transparent);font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)}.ui-col-thumb{width:calc(var(--camada-thumb-tamanho) + 3px);margin-right:4px;display:flex;align-items:center;justify-content:center}.ui-thumb-box{width:var(--camada-thumb-tamanho);height:var(--camada-thumb-tamanho);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-radius:3px;background:var(--ui-cor-fundo, #0d0d10);box-sizing:border-box;overflow:hidden;display:flex;align-items:center;justify-content:center}.ui-col-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;color:var(--ui-cor-texto, #e1e1e6);padding-left:2px;padding-right:4px;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;text-align:left;gap:4px}.ui-name-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-count-chip{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #888899);font-weight:400;padding:0 2px;flex-shrink:0}.ui-col-actions{display:flex;align-items:center;gap:2px;opacity:0;transition:opacity var(--camada-transicao)}.ui-layer-row:hover .ui-col-actions,.ui-feat-row:hover .ui-col-actions,.ui-layer-row:focus-within .ui-col-actions,.ui-feat-row:focus-within .ui-col-actions,.ui-col-actions:has(.ui-micro-btn.active){opacity:1}.ui-micro-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:18px;height:18px;padding:0;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-micro-btn:hover{color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-micro-btn.active{color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-col-target{width:22px;cursor:pointer}.ui-target-circle{width:11px;height:11px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent);background:transparent;transition:all .12s ease}.ui-col-target:hover .ui-target-circle{border-color:var(--ui-cor-texto-info, #33b5ff);transform:scale(1.18)}.ui-target-circle.selected{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));box-shadow:inset 0 0 0 2px var(--ui-cor-superficie, #141418)}.ui-target-circle.partial{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 40%,transparent)}.ui-inline-rename-input{width:100%;height:20px;background:var(--ui-cor-fundo, #0d0d10);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-primaria, #00E08A);border-radius:3px;font-size:10.5px;padding:0 4px;outline:none;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 40%,transparent)}.ui-layer-settings-drawer{background:linear-gradient(180deg,var(--ui-cor-fundo-elevado, #17171e) 0%,var(--ui-cor-superficie, #0f0f13) 100%);padding:10px 14px 12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent);border-left:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;flex-direction:column;gap:10px;box-shadow:inset 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent),0 6px 16px #00000073;animation:drawerSlideDown .18s cubic-bezier(.16,1,.3,1);position:relative;z-index:10}@keyframes drawerSlideDown{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.ui-drawer-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:6px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-header-left{display:flex;align-items:center;gap:7px;min-width:0}.ui-drawer-icon{color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;align-items:center;flex-shrink:0}.ui-drawer-title{font-size:10.5px;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}.ui-drawer-layer-chip{font-size:9.5px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-drawer-btn-fechar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:20px;height:20px;padding:0;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-drawer-btn-fechar:hover{color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-body{display:flex;flex-direction:column;gap:10px}.ui-drawer-row{display:flex;flex-direction:column;gap:5px}.ui-drawer-row-label{display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--ui-cor-texto-secundario, #888899)}.ui-drawer-color-group{display:flex;align-items:center;justify-content:space-between;gap:8px}.ui-drawer-color-pill{position:relative;display:inline-flex;align-items:center;gap:6px;padding:3px 8px 3px 5px;background:var(--ui-cor-fundo, #0b0b0d);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);border-radius:var(--ui-raio-sm, 4px);cursor:pointer;transition:all var(--camada-transicao);-webkit-user-select:none;user-select:none}.ui-drawer-color-pill:hover{border-color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-drawer-color-sample{width:14px;height:14px;border-radius:3px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 35%,transparent);box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .5));flex-shrink:0;transition:background-color .1s ease}.ui-drawer-color-hex{font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);letter-spacing:.5px}.ui-drawer-color-native{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.ui-drawer-badge{font-size:9.5px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider-container{display:flex;flex-direction:column;gap:4px}.ui-drawer-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:5px;background:linear-gradient(90deg,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent) 0%,var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A)) 100%);border-radius:3px;outline:none;margin:3px 0;cursor:pointer;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer;transition:transform .12s ease}.ui-drawer-slider::-webkit-slider-thumb:hover{transform:scale(1.22)}.ui-drawer-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer}.ui-drawer-footer{display:flex;align-items:center;justify-content:space-between;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-meta-info{font-size:9.5px;color:var(--ui-cor-texto-secundario, #888899);font-style:italic}.ui-drawer-actions{display:flex;align-items:center;gap:6px}.ui-drawer-btn-danger{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 10px;font-size:10px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:all var(--camada-transicao)}.ui-drawer-btn-danger:hover{background:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 45%,transparent);transform:translateY(-.5px)}.ui-drawer-btn-danger.confirming{background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-hover, #b71c1c);animation:pulseDanger 1.2s infinite}@keyframes pulseDanger{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.ui-previa-dot{width:6px;height:6px;margin-left:4px;border-radius:50%;flex-shrink:0;background:var(--ui-cor-texto-alerta, #ffb86c);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 25%,transparent)}.ui-tree-footer{height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);background:var(--ui-cor-fundo-elevado, #121216);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:space-between;padding:0 var(--camada-respiro);gap:6px;box-sizing:border-box;overflow:hidden;position:relative;flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro))}.ui-footer-left{display:flex;align-items:center;gap:5px;white-space:nowrap;min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.ui-footer-count{font-size:11px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-primaria, #00E08A);flex-shrink:0}.ui-footer-label{display:inline-flex;align-items:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-footer-actions-gerais{display:flex;align-items:center;gap:4px;flex-shrink:0}.ui-footer-chip-btn{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto-secundario, #a0a0b0);font-size:10px;font-weight:600;height:22px;padding:0 8px;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-footer-chip-btn:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #ffffff)}.ui-footer-chip-btn.primario{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-footer-chip-btn.primario:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-footer-right{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0}.ui-footer-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all var(--camada-transicao);flex-shrink:0}.ui-footer-btn:hover:not(.disabled){color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-btn.disabled{opacity:.25;cursor:not-allowed}.ui-footer-btn.btn-danger-footer:hover:not(.disabled){color:var(--ui-cor-texto-erro, #ff5555);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent)}.ui-footer-btn.confirming{background:var(--ui-cor-botao-destrutivo-hover, #b71c1c)!important;color:var(--ui-cor-botao-destrutivo-texto, #ffffff)!important}.ui-footer-move-wrapper{position:relative;display:flex;align-items:center;flex:1 1 auto;min-width:0}.ui-footer-select{-moz-appearance:none;appearance:none;-webkit-appearance:none;--_chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background:var(--_chevron) right 6px center / 10px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto, #e1e1e6);border-radius:var(--ui-raio-sm, 4px);font:inherit;font-size:10px;font-weight:500;height:22px;padding:0 22px 0 8px;cursor:pointer;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-footer-select:hover:not(:disabled){background:var(--_chevron) right 6px center / 10px no-repeat,var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-select:focus-visible{outline:1px solid var(--ui-cor-primaria, #00E08A)}.ui-drawer-btn-sublayer{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);font-size:10.5px;font-weight:500;padding:4px 8px;border-radius:4px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-drawer-btn-sublayer:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-drawer-select-wrapper{display:flex;align-items:center}.ui-drawer-select{background:var(--ui-cor-fundo, #16161c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .15));color:var(--ui-cor-texto, #e1e1e6);border-radius:4px;font-size:10.5px;height:24px;padding:0 6px;cursor:pointer;max-width:140px}.ui-basemap-section{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.ui-basemap-toggle{display:flex;align-items:center;gap:6px;width:100%;padding:2px;background:transparent;border:0;border-radius:var(--ui-raio-sm, 4px);font:inherit;color:inherit;cursor:pointer;text-align:left}.ui-basemap-toggle:hover .ui-basemap-title{color:var(--ui-cor-texto, #e1e1e6)}.ui-basemap-toggle:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}.ui-basemap-atual{flex:1 1 auto;min-width:0;font-size:10px;color:var(--ui-cor-primaria, #00E08A);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}.ui-basemap-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px}.ui-basemap-section{container-type:inline-size}@container (min-width: 260px){.ui-basemap-grid{grid-template-columns:repeat(3,1fr)}}@container (min-width: 340px){.ui-basemap-grid{grid-template-columns:repeat(4,1fr)}}.ui-basemap-card{display:flex;flex-direction:column;align-items:center;gap:2px;padding:3px;border-radius:var(--ui-raio-borda, 5px);background:var(--ui-cor-fundo, #101014);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:pointer;transition:all var(--camada-transicao);text-align:center;overflow:hidden}.ui-basemap-card:hover{border-color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-fundo-elevado, #17171c)}.ui-basemap-card.active{border-color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);color:var(--ui-cor-primaria, #00E08A);font-weight:600;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-basemap-preview{width:100%;height:22px;border-radius:3px;object-fit:cover;opacity:.85;transition:opacity var(--camada-transicao)}.ui-basemap-preview-none{width:100%;height:22px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);border-radius:3px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-card:hover .ui-basemap-preview,.ui-basemap-card.active .ui-basemap-preview{opacity:1}.ui-basemap-card span{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.ui-layer-row.herdado-oculto,.ui-feat-row.herdado-oculto{opacity:.52}.ui-layer-row.herdado-travado .ui-col-lock.ui-lock-open{color:var(--ui-cor-texto-secundario, #888899);opacity:.7}.ui-search-hidden{display:none!important}.ui-empty-row{height:22px;display:flex;align-items:center;padding-left:36px;font-size:10px;color:var(--ui-cor-texto-secundario, #666677);font-style:italic;background:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}.ui-camadas-resizer-altura{display:none;flex-shrink:0;width:100%;height:9px;background:var(--ui-cor-superficie, #141417);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:ns-resize;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;touch-action:none;transition:background .15s ease,border-color .15s ease;position:relative;z-index:10}:host([redimensionavel]) .ui-camadas-resizer-altura,:host([redimensionavel-altura]) .ui-camadas-resizer-altura{display:flex}.ui-camadas-resizer-altura:hover,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A)}.ui-camadas-resizer-grip{width:32px;height:3px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 22%,transparent);transition:all .15s ease}.ui-camadas-resizer-altura:hover .ui-camadas-resizer-grip,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo .ui-camadas-resizer-grip{background:var(--ui-cor-primaria, #00E08A);width:46px;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 45%,transparent)}:host(.ui-camadas--redimensionando){-webkit-user-select:none!important;user-select:none!important;cursor:ns-resize!important}:host(.ui-camadas--redimensionando) *{-webkit-user-select:none!important;user-select:none!important}.ui-col-lock.ui-lock-open{opacity:.28}.ui-col-lock.ui-lock-open:hover,.ui-col-lock.ui-lock-open:focus-visible{opacity:.8}.ui-col-lock[data-locked-by-layer]{cursor:not-allowed}.ui-col[role=button]:focus-visible,.ui-basemap-card:focus-visible,.ui-feat-row:focus-visible,.ui-layer-row:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-footer-btn.confirming{color:var(--ui-cor-botao-destrutivo-texto, #ffffff);background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);width:auto;padding:0 6px}.ui-truncate-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;margin:4px 8px 6px;background:color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 70%,transparent);border:1px dashed var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);font-size:10px;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-truncate-notice span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-truncate-more-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 4px);color:var(--ui-cor-primaria, #00E08A);font-size:10px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all var(--camada-transicao)}.ui-truncate-more-btn:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));border-color:var(--ui-cor-primaria, #00E08A)}.ui-truncate-more-btn:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-camadas-container[data-degrade]:not([data-degrade=false]){--ui-camadas-fundo: var(--ui-gradiente-superficie);--ui-camadas-toggle-fundo: var(--ui-gradiente-superficie)}`;
1279
+ function rt(e, t) {
1280
+ t.querySelectorAll("[data-layer-row]").forEach((r) => {
1281
+ const o = r.getAttribute("data-layer-row") === e.camadaAtivaId;
1282
+ r.classList.toggle("active-drawing-layer", o), Te(r, "camada-ativa", o), o ? r.setAttribute("aria-current", "true") : r.removeAttribute("aria-current");
1275
1283
  });
1276
1284
  }
1277
- function or(e, r) {
1278
- r.querySelectorAll(".ui-feat-row").forEach((a) => {
1279
- const t = a.getAttribute("data-feat-row"), i = t ? e.selectedFeatureIds.has(t) : !1;
1280
- a.classList.toggle("selected-row", i), De(a, "feicao-selecionada", i), a.setAttribute("aria-selected", String(i));
1285
+ function it(e, t) {
1286
+ t.querySelectorAll(".ui-feat-row").forEach((a) => {
1287
+ const r = a.getAttribute("data-feat-row"), i = r ? e.selectedFeatureIds.has(r) : !1;
1288
+ a.classList.toggle("selected-row", i), Te(a, "feicao-selecionada", i), a.setAttribute("aria-selected", String(i));
1281
1289
  const o = a.querySelector(".ui-target-circle");
1282
1290
  o && o.classList.toggle("selected", i);
1283
- }), r.querySelectorAll(".ui-layer-group").forEach((a) => {
1284
- const t = a.getAttribute("data-layer-id"), i = Q(e.camadas, e.feicoes, t ?? "");
1285
- Ze(a.querySelector(".ui-layer-row .ui-target-circle"), i, e.selectedFeatureIds);
1286
- }), ea(e, r);
1291
+ }), t.querySelectorAll(".ui-layer-group").forEach((a) => {
1292
+ const r = a.getAttribute("data-layer-id"), i = W(e.camadas, e.feicoes, r ?? ""), o = V(i, e.searchQuery);
1293
+ ra(a.querySelector(".ui-layer-row .ui-target-circle"), o, e.selectedFeatureIds);
1294
+ }), ia(e, t);
1287
1295
  }
1288
- function Ze(e, r, a) {
1296
+ function ra(e, t, a) {
1289
1297
  if (!e) return;
1290
- if (r.length === 0) {
1298
+ if (t.length === 0) {
1291
1299
  e.classList.remove("selected", "partial");
1292
1300
  return;
1293
1301
  }
1294
- const t = r.every((o) => a.has(o.id)), i = !t && r.some((o) => a.has(o.id));
1295
- e.classList.toggle("selected", t), e.classList.toggle("partial", i);
1296
- }
1297
- function ea(e, r) {
1298
- const a = e.feicoes.filter((u) => e.selectedFeatureIds.has(u.id)), t = a.length > 0, i = r.getElementById("footer-count"), o = r.getElementById("footer-label");
1299
- if (i && (i.textContent = String(t ? a.length : e.camadas.length)), o) {
1300
- const u = Ne(e.camadas.length, a.length);
1301
- o.innerHTML = u.icone, o.title = u.texto, o.setAttribute("aria-label", u.texto);
1302
- }
1303
- const n = r.querySelector(".ui-tree-footer");
1304
- n && (n.classList.toggle("tem-selecao", t), n.classList.toggle("sem-selecao", !t));
1305
- const l = r.querySelector(".ui-footer-actions-gerais");
1306
- l && (l.style.display = t ? "none" : "flex");
1307
- const c = r.querySelector(".ui-footer-bulk-actions");
1308
- c && (c.style.display = t ? "flex" : "none"), ["btn-footer-del"].forEach((u) => {
1309
- const d = r.getElementById(u);
1310
- d && (d.disabled = !t, d.classList.toggle("disabled", !t));
1302
+ const r = t.every((o) => a.has(o.id)), i = !r && t.some((o) => a.has(o.id));
1303
+ e.classList.toggle("selected", r), e.classList.toggle("partial", i);
1304
+ }
1305
+ function ia(e, t) {
1306
+ const a = e.feicoes.filter((d) => e.selectedFeatureIds.has(d.id)), r = a.length > 0, i = t.getElementById("footer-count"), o = t.getElementById("footer-label");
1307
+ if (i && (i.textContent = String(r ? a.length : e.camadas.length)), o) {
1308
+ const d = _e(e.camadas.length, a.length);
1309
+ o.innerHTML = d.icone, o.title = d.texto, o.setAttribute("aria-label", d.texto);
1310
+ }
1311
+ const n = t.querySelector(".ui-tree-footer");
1312
+ n && (n.classList.toggle("tem-selecao", r), n.classList.toggle("sem-selecao", !r));
1313
+ const s = t.querySelector(".ui-footer-actions-gerais");
1314
+ s && (s.style.display = r ? "none" : "flex");
1315
+ const c = t.querySelector(".ui-footer-bulk-actions");
1316
+ c && (c.style.display = r ? "flex" : "none"), ["btn-footer-del"].forEach((d) => {
1317
+ const u = t.getElementById(d);
1318
+ u && (u.disabled = !r, u.classList.toggle("disabled", !r));
1311
1319
  });
1312
- const s = r.querySelector(".ui-footer-move-wrapper");
1313
- s && s.classList.toggle("disabled", !t);
1314
- const p = r.getElementById("select-footer-move");
1315
- p && (p.disabled = !t);
1316
- }
1317
- function Be(e, r) {
1318
- const a = se(e.camadas), t = new Map(e.camadas.map((o) => [o.id, o]));
1319
- r.querySelectorAll(".ui-layer-row").forEach((o) => {
1320
- const n = a.get(o.getAttribute("data-layer-row") || "");
1321
- o.classList.toggle("herdado-oculto", (n == null ? void 0 : n.ocultaPorAncestral) === !0), o.classList.toggle("herdado-travado", (n == null ? void 0 : n.travadaPorAncestral) === !0);
1320
+ const l = t.querySelector(".ui-footer-move-wrapper");
1321
+ l && l.classList.toggle("disabled", !r);
1322
+ const p = t.getElementById("select-footer-move");
1323
+ p && (p.disabled = !r);
1324
+ }
1325
+ function Pe(e, t) {
1326
+ const a = le(e.camadas), r = new Map(e.camadas.map((n) => [n.id, n]));
1327
+ t.querySelectorAll(".ui-layer-row").forEach((n) => {
1328
+ const s = a.get(n.getAttribute("data-layer-row") || "");
1329
+ n.classList.toggle("herdado-oculto", (s == null ? void 0 : s.ocultaPorAncestral) === !0), n.classList.toggle("herdado-travado", (s == null ? void 0 : s.travadaPorAncestral) === !0);
1322
1330
  });
1323
- const i = new Map(e.feicoes.map((o) => [o.id, o]));
1324
- r.querySelectorAll(".ui-feat-row").forEach((o) => {
1325
- const n = o.getAttribute("data-feat-layer") || "", l = t.get(n), c = a.get(n);
1326
- o.classList.toggle("herdado-oculto", (l == null ? void 0 : l.visible) === !1 || (c == null ? void 0 : c.ocultaPorAncestral) === !0);
1327
- const s = o.querySelector("[data-feat-lock]"), p = i.get(o.getAttribute("data-feat-row") || "");
1328
- if (!s || !p) return;
1329
- const u = (l == null ? void 0 : l.locked) === !0 || (c == null ? void 0 : c.travadaPorAncestral) === !0, d = p.locked === !0 || u;
1330
- s.innerHTML = d ? b.cadeadoTrancado : b.cadeadoAberto, s.classList.toggle("ui-lock-open", !d), u ? s.setAttribute("data-locked-by-layer", "true") : s.removeAttribute("data-locked-by-layer"), D(
1331
- s,
1332
- u ? "Bloqueada pela camada" : d ? "Desbloquear Feição" : "Bloquear Feição"
1331
+ const i = new Map(e.feicoes.map((n) => [n.id, n]));
1332
+ t.querySelectorAll(".ui-feat-row").forEach((n) => {
1333
+ const s = n.getAttribute("data-feat-layer") || "", c = r.get(s), l = a.get(s);
1334
+ n.classList.toggle("herdado-oculto", (c == null ? void 0 : c.visible) === !1 || (l == null ? void 0 : l.ocultaPorAncestral) === !0);
1335
+ const p = n.querySelector("[data-feat-lock]"), d = i.get(n.getAttribute("data-feat-row") || "");
1336
+ if (!p || !d) return;
1337
+ const u = (c == null ? void 0 : c.locked) === !0 || (l == null ? void 0 : l.travadaPorAncestral) === !0, f = d.locked === !0 || u;
1338
+ p.innerHTML = f ? y.cadeadoTrancado : y.cadeadoAberto, p.classList.toggle("ui-lock-open", !f), u ? p.setAttribute("data-locked-by-layer", "true") : p.removeAttribute("data-locked-by-layer"), D(
1339
+ p,
1340
+ u ? "Bloqueada pela camada" : f ? "Desbloquear Feição" : "Bloquear Feição"
1333
1341
  );
1334
1342
  });
1343
+ const o = t.getElementById("select-footer-move");
1344
+ o && (o.innerHTML = `<option value="" disabled selected>Mover para...</option>${Ge(e.camadas)}`);
1335
1345
  }
1336
- function nr(e, r) {
1337
- r.querySelectorAll("[data-layer-row]").forEach((i) => {
1346
+ function ot(e, t) {
1347
+ t.querySelectorAll("[data-layer-row]").forEach((i) => {
1338
1348
  i.addEventListener("click", (o) => {
1339
1349
  if (o.target.closest(
1340
1350
  "[data-layer-eye], [data-layer-lock], [data-layer-expand], [data-layer-target], [data-layer-fit], [data-layer-settings], [data-layer-color], input, button"
1341
1351
  ))
1342
1352
  return;
1343
- const l = i.getAttribute("data-layer-row");
1344
- l && e.definirCamadaAtiva(l, !0);
1353
+ const s = i.getAttribute("data-layer-row");
1354
+ s && e.definirCamadaAtiva(s, !0);
1345
1355
  });
1346
- }), r.querySelectorAll("[data-layer-expand]").forEach((i) => {
1356
+ }), t.querySelectorAll("[data-layer-expand]").forEach((i) => {
1347
1357
  i.addEventListener("click", (o) => {
1348
1358
  o.stopPropagation();
1349
1359
  const n = i.getAttribute("data-layer-expand");
1350
1360
  if (!n) return;
1351
1361
  e.expandedLayers.has(n) ? e.expandedLayers.delete(n) : e.expandedLayers.add(n);
1352
- const l = i.closest(".ui-layer-group"), c = i.querySelector(".ui-chevron-icon"), s = e.expandedLayers.has(n);
1353
- if (c && c.classList.toggle("open", s), l) {
1354
- l.setAttribute("aria-expanded", String(s));
1355
- const p = l.querySelector(".ui-children-container");
1356
- p && (p.style.display = s ? "block" : "none");
1362
+ const s = i.closest(".ui-layer-group"), c = i.querySelector(".ui-chevron-icon"), l = e.expandedLayers.has(n);
1363
+ if (c && c.classList.toggle("open", l), s) {
1364
+ s.setAttribute("aria-expanded", String(l));
1365
+ const p = s.querySelector(".ui-children-container");
1366
+ p && (p.style.display = l ? "block" : "none");
1357
1367
  }
1358
- D(i, s ? "Recolher grupo" : "Expandir grupo"), sr(e, r), e.salvarLembrancaEstado();
1368
+ D(i, l ? "Recolher grupo" : "Expandir grupo"), nt(e, t), e.salvarLembrancaEstado();
1359
1369
  });
1360
- }), r.querySelectorAll("[data-layer-eye]").forEach((i) => {
1370
+ }), t.querySelectorAll("[data-layer-eye]").forEach((i) => {
1361
1371
  i.addEventListener("click", (o) => {
1362
1372
  o.stopPropagation();
1363
- const n = i.getAttribute("data-layer-eye"), l = e.camadas.find((c) => c.id === n);
1364
- if (l) {
1365
- l.visible = l.visible === !1;
1366
- const c = l.visible !== !1;
1367
- i.innerHTML = c ? b.olhoAberto : b.olhoFechado, D(i, c ? "Ocultar Camada" : "Exibir Camada");
1368
- const s = i.closest(".ui-layer-row");
1369
- s && s.classList.toggle("hidden-layer", !c), lr(e, r), Be(e, r), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-visibilidade", {
1370
- camadaId: l.id,
1373
+ const n = i.getAttribute("data-layer-eye"), s = e.camadas.find((c) => c.id === n);
1374
+ if (s) {
1375
+ s.visible = s.visible === !1;
1376
+ const c = s.visible !== !1;
1377
+ i.innerHTML = c ? y.olhoAberto : y.olhoFechado, D(i, c ? "Ocultar Camada" : "Exibir Camada");
1378
+ const l = i.closest(".ui-layer-row");
1379
+ l && l.classList.toggle("hidden-layer", !c), st(e, t), Pe(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-visibilidade", {
1380
+ camadaId: s.id,
1371
1381
  visivel: c
1372
1382
  });
1373
1383
  }
1374
1384
  });
1375
- }), r.querySelectorAll("[data-layer-lock]").forEach((i) => {
1385
+ }), t.querySelectorAll("[data-layer-lock]").forEach((i) => {
1376
1386
  i.addEventListener("click", (o) => {
1377
1387
  o.stopPropagation();
1378
- const n = i.getAttribute("data-layer-lock"), l = e.camadas.find((c) => c.id === n);
1379
- l && (l.locked = !l.locked, i.innerHTML = l.locked ? b.cadeadoTrancado : b.cadeadoAberto, i.classList.toggle("ui-lock-open", !l.locked), D(i, l.locked ? "Desbloquear Camada" : "Bloquear Camada"), Be(e, r), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-bloqueio", {
1380
- camadaId: l.id,
1381
- bloqueado: l.locked
1388
+ const n = i.getAttribute("data-layer-lock"), s = e.camadas.find((c) => c.id === n);
1389
+ s && (s.locked = !s.locked, i.innerHTML = s.locked ? y.cadeadoTrancado : y.cadeadoAberto, i.classList.toggle("ui-lock-open", !s.locked), D(i, s.locked ? "Desbloquear Camada" : "Bloquear Camada"), Pe(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-bloqueio", {
1390
+ camadaId: s.id,
1391
+ bloqueado: s.locked
1382
1392
  }));
1383
1393
  });
1384
- }), r.querySelectorAll("[data-layer-fit]").forEach((i) => {
1394
+ }), t.querySelectorAll("[data-layer-fit]").forEach((i) => {
1385
1395
  i.addEventListener("click", (o) => {
1386
1396
  o.stopPropagation();
1387
1397
  const n = i.getAttribute("data-layer-fit");
1388
1398
  n && e.dispararEvento("ui-camada-enquadrar", { camadaId: n });
1389
1399
  });
1390
- }), r.querySelectorAll("[data-layer-settings]").forEach((i) => {
1400
+ }), t.querySelectorAll("[data-layer-settings]").forEach((i) => {
1391
1401
  i.addEventListener("click", (o) => {
1392
1402
  o.stopPropagation();
1393
1403
  const n = i.getAttribute("data-layer-settings");
1394
1404
  e.activeSettingsLayerId = e.activeSettingsLayerId === n ? null : n, e.solicitarRenderizacao();
1395
1405
  });
1396
- }), r.querySelectorAll("[data-layer-settings-close]").forEach((i) => {
1406
+ }), t.querySelectorAll("[data-layer-settings-close]").forEach((i) => {
1397
1407
  i.addEventListener("click", (o) => {
1398
1408
  o.stopPropagation(), e.activeSettingsLayerId = null, e.solicitarRenderizacao();
1399
1409
  });
1400
1410
  });
1401
1411
  const a = (i, o, n) => {
1402
- var m;
1403
- const l = e.camadas.find((f) => f.id === i);
1404
- if (!l) return;
1405
- const c = H(o, l.color || "#00E08A");
1406
- l.color = c;
1407
- const s = r.getElementById(`sample-color-${i}`);
1408
- s && (s.style.backgroundColor = c);
1409
- const p = r.getElementById(`hex-color-${i}`);
1412
+ const s = e.camadas.find((f) => f.id === i);
1413
+ if (!s) return;
1414
+ const c = G(o, s.color || "#00E08A");
1415
+ s.color = c;
1416
+ const l = t.getElementById(`sample-color-${i}`);
1417
+ l && (l.style.backgroundColor = c);
1418
+ const p = t.getElementById(`hex-color-${i}`);
1410
1419
  p && (p.textContent = c.toUpperCase());
1411
- const u = r.getElementById(`settings-drawer-${i}`);
1412
- u && u.style.setProperty("--drawer-cor-camada", c);
1413
- const d = T(r, "data-layer-row", i);
1414
- if (d) {
1415
- (m = d.closest(".ui-layer-group")) == null || m.style.setProperty("--layer-active-color", c);
1416
- const f = d.querySelector(".ui-col-colorbar");
1417
- f && (f.style.backgroundColor = c);
1420
+ const d = t.getElementById(`settings-drawer-${i}`);
1421
+ d && d.style.setProperty("--drawer-cor-camada", c);
1422
+ const u = P(t, "data-layer-row", i);
1423
+ if (u) {
1424
+ const f = u.closest(".ui-layer-group");
1425
+ f == null || f.style.setProperty("--layer-active-color", c);
1426
+ const m = u.querySelector(".ui-col-colorbar");
1427
+ m && (m.style.backgroundColor = c);
1428
+ const g = new Map(e.feicoes.map((v) => [v.id, v]));
1429
+ f == null || f.querySelectorAll(".ui-feat-row").forEach((v) => {
1430
+ if (v.getAttribute("data-feat-layer") !== i) return;
1431
+ const b = g.get(v.getAttribute("data-feat-row") || "");
1432
+ if (!b || b.color) return;
1433
+ const E = v.querySelector(".ui-col-colorbar");
1434
+ E && (E.style.backgroundColor = c);
1435
+ const L = v.querySelector(".ui-thumb-box");
1436
+ L && (L.innerHTML = Ve(b.type || b.geometryType, c, b.coordinates));
1437
+ });
1418
1438
  }
1419
- n ? e.salvarLembrancaEstado() : e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-cor", { camadaId: l.id, cor: c });
1439
+ n ? e.salvarLembrancaEstado() : e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-cor", { camadaId: s.id, cor: c });
1420
1440
  };
1421
- r.querySelectorAll("[data-layer-color-picker]").forEach((i) => {
1422
- const o = i, n = (l) => (c) => {
1423
- const s = o.getAttribute("data-layer-color-picker");
1424
- if (!s) return;
1441
+ t.querySelectorAll("[data-layer-color-picker]").forEach((i) => {
1442
+ const o = i, n = (s) => (c) => {
1443
+ const l = o.getAttribute("data-layer-color-picker");
1444
+ if (!l) return;
1425
1445
  const p = c.target.value;
1426
- a(s, p, l);
1446
+ a(l, p, s);
1427
1447
  };
1428
1448
  o.addEventListener("input", n(!1)), o.addEventListener("change", n(!0));
1429
- }), r.querySelectorAll("[data-layer-color]").forEach((i) => {
1449
+ }), t.querySelectorAll("[data-layer-color]").forEach((i) => {
1430
1450
  const o = (n) => {
1431
1451
  n.stopPropagation();
1432
- const l = i.getAttribute("data-layer-color"), c = e.camadas.find((s) => s.id === l);
1433
- !l || !c || Ca({
1452
+ const s = i.getAttribute("data-layer-color"), c = e.camadas.find((l) => l.id === s);
1453
+ !s || !c || Fa({
1434
1454
  ancora: i,
1435
1455
  titulo: `Cor · ${c.name || "Camada"}`,
1436
1456
  modo: "simples",
1437
- cor: H(c.color, "#00E08A"),
1457
+ cor: G(c.color, "#00E08A"),
1438
1458
  mostrarOpacidade: !1,
1439
- aoAlterar: (s) => a(l, s.cor, !1),
1440
- aoConfirmar: (s) => a(l, s.cor, !0),
1441
- aoCancelar: (s) => a(l, s.cor, !0)
1459
+ aoAlterar: (l) => a(s, l.cor, !1),
1460
+ aoConfirmar: (l) => a(s, l.cor, !0),
1461
+ aoCancelar: (l) => a(s, l.cor, !0)
1442
1462
  });
1443
1463
  };
1444
1464
  i.addEventListener("click", o), i.addEventListener("keydown", (n) => {
1445
- const l = n.key;
1446
- (l === "Enter" || l === " ") && (n.preventDefault(), o(n));
1465
+ const s = n.key;
1466
+ (s === "Enter" || s === " ") && (n.preventDefault(), o(n));
1447
1467
  });
1448
1468
  });
1449
- const t = (i, o) => {
1450
- const n = e.camadas.find((s) => s.id === i);
1469
+ const r = (i, o) => {
1470
+ const n = e.camadas.find((l) => l.id === i);
1451
1471
  if (!n) return;
1452
1472
  n.opacity = o;
1453
- const l = r.getElementById(`badge-op-${i}`);
1454
- l && (l.textContent = `${Math.round(o * 100)}%`);
1455
- const c = T(r, "data-layer-opacity-slider", i);
1473
+ const s = t.getElementById(`badge-op-${i}`);
1474
+ s && (s.textContent = `${Math.round(o * 100)}%`);
1475
+ const c = P(t, "data-layer-opacity-slider", i);
1456
1476
  c && parseFloat(c.value) !== o && (c.value = String(o)), e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-opacidade", { camadaId: n.id, opacidade: o });
1457
1477
  };
1458
- r.querySelectorAll("[data-layer-opacity-slider]").forEach((i) => {
1478
+ t.querySelectorAll("[data-layer-opacity-slider]").forEach((i) => {
1459
1479
  i.addEventListener("input", (o) => {
1460
1480
  const n = i.getAttribute("data-layer-opacity-slider");
1461
1481
  if (!n) return;
1462
- const l = parseFloat(o.target.value);
1463
- Number.isFinite(l) && t(n, Math.min(1, Math.max(0, l)));
1482
+ const s = parseFloat(o.target.value);
1483
+ Number.isFinite(s) && r(n, Math.min(1, Math.max(0, s)));
1464
1484
  });
1465
- }), r.querySelectorAll("[data-delete-layer]").forEach((i) => {
1485
+ }), t.querySelectorAll("[data-delete-layer]").forEach((i) => {
1466
1486
  let o = null;
1467
- i.addEventListener("click", (n) => {
1468
- n.stopPropagation();
1469
- const l = i.getAttribute("data-delete-layer");
1470
- if (!l) return;
1487
+ const n = () => {
1488
+ o && (clearTimeout(o), o = null), i.classList.remove("confirming");
1489
+ const s = i.querySelector(".ui-btn-label");
1490
+ s && (s.textContent = "Excluir");
1491
+ };
1492
+ i.addEventListener("ui-cancelar-confirmacao", n), i.addEventListener("click", (s) => {
1493
+ s.stopPropagation();
1494
+ const c = i.getAttribute("data-delete-layer");
1495
+ if (!c) return;
1471
1496
  if (i.classList.contains("confirming")) {
1472
- o && clearTimeout(o), e.dispararEvento("ui-camada-excluida", { camadaId: l });
1473
- const s = e.selectedFeatureIds.size;
1474
- e.camadas.forEach((p) => {
1475
- p.parentId === l && (p.parentId = null);
1476
- }), e.removerCamada(l), e.selectedFeatureIds.size !== s && e.notificarMudancaSelecao();
1497
+ n(), e.dispararEvento("ui-camada-excluida", { camadaId: c });
1498
+ const p = e.selectedFeatureIds.size;
1499
+ e.camadas.forEach((d) => {
1500
+ d.parentId === c && (d.parentId = null);
1501
+ }), e.removerCamada(c), e.selectedFeatureIds.size !== p && e.notificarMudancaSelecao();
1477
1502
  } else {
1478
1503
  i.classList.add("confirming");
1479
- const s = i.querySelector(".ui-btn-label");
1480
- s && (s.textContent = "Confirmar Exclusão?"), o = setTimeout(() => {
1481
- i.classList.remove("confirming"), s && (s.textContent = "Excluir");
1482
- }, 3500);
1504
+ const p = i.querySelector(".ui-btn-label");
1505
+ p && (p.textContent = "Confirmar Exclusão?"), o = setTimeout(n, 3500);
1483
1506
  }
1484
1507
  });
1485
- }), r.querySelectorAll("[data-layer-parent-select]").forEach((i) => {
1508
+ }), t.querySelectorAll("[data-layer-parent-select]").forEach((i) => {
1486
1509
  i.addEventListener("change", (o) => {
1487
- const n = o.target, l = n.getAttribute("data-layer-parent-select"), c = n.value || null, s = e.camadas.find((p) => p.id === l);
1488
- if (s) {
1489
- if (c && (c === s.id || U(e.camadas, c, s.id))) {
1490
- n.value = s.parentId || "";
1510
+ const n = o.target, s = n.getAttribute("data-layer-parent-select"), c = n.value || null, l = e.camadas.find((p) => p.id === s);
1511
+ if (l) {
1512
+ if (c && (c === l.id || Y(e.camadas, c, l.id))) {
1513
+ n.value = l.parentId || "";
1491
1514
  return;
1492
1515
  }
1493
- const p = s.parentId ?? null;
1494
- s.parentId = c, c && e.expandedLayers.add(c), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-mover-hierarquia", {
1495
- camadaId: s.id,
1516
+ const p = l.parentId ?? null;
1517
+ l.parentId = c, c && e.expandedLayers.add(c), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-mover-hierarquia", {
1518
+ camadaId: l.id,
1496
1519
  novoParentId: c,
1497
1520
  parentAnteriorId: p,
1498
- camada: s
1521
+ camada: l
1499
1522
  }), e.solicitarRenderizacao();
1500
1523
  }
1501
1524
  });
1502
- }), r.querySelectorAll("[data-add-sublayer]").forEach((i) => {
1525
+ }), t.querySelectorAll("[data-add-sublayer]").forEach((i) => {
1503
1526
  i.addEventListener("click", (o) => {
1504
1527
  o.stopPropagation();
1505
1528
  const n = i.getAttribute("data-add-sublayer");
1506
1529
  e.dispararEvento("ui-camada-adicionar", { parentId: n });
1507
1530
  });
1508
- }), aa(e, r), r.querySelectorAll("[data-layer-target]").forEach((i) => {
1531
+ }), oa(e, t), t.querySelectorAll("[data-layer-target]").forEach((i) => {
1509
1532
  i.addEventListener("click", (o) => {
1510
1533
  o.stopPropagation();
1511
- const n = o, l = i.getAttribute("data-layer-target");
1512
- if (!l) return;
1513
- const c = Q(e.camadas, e.feicoes, l), s = te(c, e.searchQuery);
1514
- if (s.length === 0) return;
1515
- s.every((u) => e.selectedFeatureIds.has(u.id)) ? s.forEach((u) => e.selectedFeatureIds.delete(u.id)) : (!n.ctrlKey && !n.metaKey && e.selectedFeatureIds.clear(), s.forEach((u) => e.selectedFeatureIds.add(u.id))), e.lastClickedFeatureId = s[s.length - 1].id, e.sincronizarSelecaoDOM(), e.notificarMudancaSelecao();
1534
+ const n = o, s = i.getAttribute("data-layer-target");
1535
+ if (!s) return;
1536
+ const c = W(e.camadas, e.feicoes, s), l = V(c, e.searchQuery);
1537
+ if (l.length === 0) return;
1538
+ l.every((d) => e.selectedFeatureIds.has(d.id)) ? l.forEach((d) => e.selectedFeatureIds.delete(d.id)) : (!n.ctrlKey && !n.metaKey && e.selectedFeatureIds.clear(), l.forEach((d) => e.selectedFeatureIds.add(d.id))), e.lastClickedFeatureId = l[l.length - 1].id, e.sincronizarSelecaoDOM(), e.notificarMudancaSelecao();
1516
1539
  });
1517
1540
  });
1518
1541
  }
1519
- function aa(e, r) {
1520
- r.querySelectorAll("[data-layer-show-more]").forEach((a) => {
1521
- a.addEventListener("click", (t) => {
1522
- t.stopPropagation();
1542
+ function oa(e, t) {
1543
+ t.querySelectorAll("[data-layer-show-more]").forEach((a) => {
1544
+ a.addEventListener("click", (r) => {
1545
+ r.stopPropagation();
1523
1546
  const i = a.getAttribute("data-layer-show-more");
1524
1547
  i && e.incrementarLimiteFeicoes(i);
1525
1548
  });
1526
1549
  });
1527
1550
  }
1528
- function sr(e, r) {
1529
- const a = r.getElementById("btn-toggle-all-expand");
1551
+ function nt(e, t) {
1552
+ const a = t.getElementById("btn-toggle-all-expand");
1530
1553
  if (!a) return;
1531
- const t = e.camadas.length > 0 && e.camadas.every((o) => e.expandedLayers.has(o.id)), i = a.querySelector(".ui-chevron-icon");
1532
- i && i.classList.toggle("open", t), D(
1554
+ const r = e.camadas.length > 0 && e.camadas.every((o) => e.expandedLayers.has(o.id)), i = a.querySelector(".ui-chevron-icon");
1555
+ i && i.classList.toggle("open", r), D(
1533
1556
  a,
1534
- t ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"
1557
+ r ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"
1535
1558
  );
1536
1559
  }
1537
- function lr(e, r) {
1538
- const a = r.getElementById("btn-toggle-all-vis");
1560
+ function st(e, t) {
1561
+ const a = t.getElementById("btn-toggle-all-vis");
1539
1562
  if (!a) return;
1540
- const t = e.camadas.every((i) => i.visible !== !1);
1541
- a.innerHTML = t ? b.olhoAberto : b.olhoFechado, D(a, t ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas");
1563
+ const r = e.camadas.every((i) => i.visible !== !1);
1564
+ a.innerHTML = r ? y.olhoAberto : y.olhoFechado, D(a, r ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas");
1542
1565
  }
1543
- function cr(e, r) {
1544
- const a = r.getElementById("select-footer-move");
1566
+ function lt(e, t) {
1567
+ const a = t.getElementById("select-footer-move");
1545
1568
  a && a.addEventListener("change", (n) => {
1546
- const l = n.target.value;
1547
- if (!l) return;
1548
- const c = xe(e.camadas);
1549
- if (c.has(l)) {
1569
+ const s = n.target.value;
1570
+ if (!s) return;
1571
+ const c = ie(e.camadas);
1572
+ if (c.has(s)) {
1573
+ a.value = "";
1574
+ return;
1575
+ }
1576
+ const l = e.feicoes.filter(
1577
+ (d) => e.selectedFeatureIds.has(d.id) && !c.has(d.layerId) && d.locked !== !0
1578
+ );
1579
+ if (l.length === 0) {
1550
1580
  a.value = "";
1551
1581
  return;
1552
1582
  }
1553
- const s = e.feicoes.filter((u) => e.selectedFeatureIds.has(u.id) && !c.has(u.layerId));
1554
- if (s.length === 0) return;
1555
- const p = new Map(s.map((u) => [u.id, u.layerId]));
1556
- s.forEach((u) => u.layerId = l), s.forEach((u) => {
1557
- p.get(u.id) !== l && e.dispararEvento("ui-feicao-movida", {
1558
- feicaoId: u.id,
1559
- camadaOrigemId: p.get(u.id),
1560
- camadaDestinoId: l,
1561
- feicao: u
1583
+ const p = new Map(l.map((d) => [d.id, d.layerId]));
1584
+ l.forEach((d) => d.layerId = s), l.forEach((d) => {
1585
+ p.get(d.id) !== s && e.dispararEvento("ui-feicao-movida", {
1586
+ feicaoId: d.id,
1587
+ camadaOrigemId: p.get(d.id),
1588
+ camadaDestinoId: s,
1589
+ feicao: d
1562
1590
  });
1563
1591
  }), e.dispararEvento("ui-acao-massa", {
1564
1592
  acao: "mover",
1565
- feicoesIds: s.map((u) => u.id),
1566
- feicoes: s,
1567
- valor: l
1593
+ feicoesIds: l.map((d) => d.id),
1594
+ feicoes: l,
1595
+ valor: s
1568
1596
  }), e.solicitarRenderizacao();
1569
1597
  });
1570
- const t = r.getElementById("btn-footer-new-layer");
1571
- t && t.addEventListener("click", () => {
1598
+ const r = t.getElementById("btn-footer-new-layer");
1599
+ r && r.addEventListener("click", () => {
1572
1600
  e.dispararEvento("ui-camada-adicionar", {});
1573
1601
  });
1574
- const i = r.getElementById("btn-footer-new-group");
1602
+ const i = t.getElementById("btn-footer-new-group");
1575
1603
  i && i.addEventListener("click", () => {
1576
1604
  e.dispararEvento("ui-camada-grupo-adicionar", { isGroup: !0 });
1577
1605
  });
1578
- const o = r.getElementById("btn-footer-del");
1606
+ const o = t.getElementById("btn-footer-del");
1579
1607
  if (o) {
1580
1608
  let n = null;
1581
- const l = "Excluir selecionados";
1582
- o.addEventListener("click", () => {
1583
- const c = Array.from(e.selectedFeatureIds);
1584
- if (c.length === 0) return;
1609
+ const s = "Excluir selecionados", c = () => {
1610
+ n && (clearTimeout(n), n = null), o.classList.remove("confirming"), D(o, s);
1611
+ };
1612
+ o.addEventListener("ui-cancelar-confirmacao", c), o.addEventListener("click", () => {
1613
+ const l = ie(e.camadas), p = e.feicoes.filter(
1614
+ (f) => e.selectedFeatureIds.has(f.id) && !l.has(f.layerId) && f.locked !== !0
1615
+ );
1616
+ if (p.length === 0) return;
1617
+ const d = p.map((f) => f.id);
1585
1618
  if (!o.classList.contains("confirming")) {
1586
- o.classList.add("confirming"), D(o, `Clique novamente para excluir ${c.length} selecionado(s)`), n = setTimeout(() => {
1587
- o.classList.remove("confirming"), D(o, l);
1588
- }, 3500);
1619
+ o.classList.add("confirming"), D(o, `Clique novamente para excluir ${d.length} selecionado(s)`), n = setTimeout(c, 3500);
1589
1620
  return;
1590
1621
  }
1591
- n && clearTimeout(n);
1592
- const s = e.feicoes.filter((p) => e.selectedFeatureIds.has(p.id));
1593
- e.feicoes = e.feicoes.filter((p) => !e.selectedFeatureIds.has(p.id)), e.selectedFeatureIds.clear(), e.lastClickedFeatureId = null, e.dispararEvento("ui-acao-massa", {
1622
+ c();
1623
+ const u = new Set(d);
1624
+ e.feicoes = e.feicoes.filter((f) => !u.has(f.id)), d.forEach((f) => e.selectedFeatureIds.delete(f)), e.lastClickedFeatureId && u.has(e.lastClickedFeatureId) && (e.lastClickedFeatureId = null), e.dispararEvento("ui-acao-massa", {
1594
1625
  acao: "excluir",
1595
- feicoesIds: c,
1596
- feicoes: s
1626
+ feicoesIds: d,
1627
+ feicoes: p
1597
1628
  }), e.notificarMudancaSelecao(), e.solicitarRenderizacao();
1598
1629
  });
1599
1630
  }
1600
1631
  }
1601
- const dr = [
1632
+ const ct = [
1602
1633
  { tipo: "olho", atributo: "data-layer-eye", entidade: "camada" },
1603
1634
  { tipo: "olho", atributo: "data-feat-eye", entidade: "feicao" },
1604
1635
  { tipo: "cadeado", atributo: "data-layer-lock", entidade: "camada" },
1605
1636
  { tipo: "cadeado", atributo: "data-feat-lock", entidade: "feicao" },
1606
1637
  { tipo: "selecao", atributo: "data-layer-target", entidade: "camada" },
1607
1638
  { tipo: "selecao", atributo: "data-feat-target", entidade: "feicao" }
1608
- ], be = {
1639
+ ], ye = {
1609
1640
  olho: "[data-layer-eye], [data-feat-eye]",
1610
1641
  cadeado: "[data-layer-lock], [data-feat-lock]",
1611
1642
  selecao: "[data-layer-target], [data-feat-target]"
1612
- }, ur = 3;
1613
- function pr(e) {
1614
- return dr.find((r) => e.hasAttribute(r.atributo)) ?? null;
1643
+ }, dt = 3;
1644
+ function ut(e) {
1645
+ return ct.find((t) => e.hasAttribute(t.atributo)) ?? null;
1615
1646
  }
1616
- function ge(e, r) {
1617
- const a = pr(r);
1647
+ function ve(e, t) {
1648
+ const a = ut(t);
1618
1649
  if (!a) return null;
1619
- const t = r.getAttribute(a.atributo);
1620
- if (!t) return null;
1650
+ const r = t.getAttribute(a.atributo);
1651
+ if (!r) return null;
1621
1652
  if (a.tipo === "olho") {
1622
- const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === t) : e.feicoes.find((n) => n.id === t);
1653
+ const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
1623
1654
  return o ? o.visible !== !1 : null;
1624
1655
  }
1625
1656
  if (a.tipo === "cadeado") {
1626
- if (r.hasAttribute("data-locked-by-layer")) return null;
1627
- const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === t) : e.feicoes.find((n) => n.id === t);
1657
+ if (t.hasAttribute("data-locked-by-layer")) return null;
1658
+ const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
1628
1659
  return o ? o.locked === !0 : null;
1629
1660
  }
1630
- if (a.entidade === "feicao") return e.selectedFeatureIds.has(t);
1631
- const i = te(
1632
- Q(e.camadas, e.feicoes, t),
1661
+ if (a.entidade === "feicao") return e.selectedFeatureIds.has(r);
1662
+ const i = V(
1663
+ W(e.camadas, e.feicoes, r),
1633
1664
  e.searchQuery
1634
1665
  );
1635
1666
  return i.length === 0 ? null : i.every((o) => e.selectedFeatureIds.has(o.id));
1636
1667
  }
1637
- function qe(e, r, a = !1) {
1668
+ function De(e, t, a = !1) {
1638
1669
  e.dispatchEvent(
1639
1670
  new MouseEvent("click", {
1640
1671
  bubbles: !0,
1641
1672
  cancelable: !0,
1642
- ctrlKey: r,
1673
+ ctrlKey: t,
1643
1674
  shiftKey: a
1644
1675
  })
1645
1676
  );
1646
1677
  }
1647
1678
  let q = null;
1648
- function fr(e) {
1679
+ function pt(e) {
1649
1680
  (q == null ? void 0 : q.host) === e && q.cancelar();
1650
1681
  }
1651
- function ra(e, r, a = r) {
1652
- Object.keys(be).forEach((t) => {
1653
- a.querySelectorAll(be[t]).forEach((i) => {
1654
- i.addEventListener("pointerdown", (o) => mr(e, r, t, i, o));
1682
+ function na(e, t, a = t) {
1683
+ Object.keys(ye).forEach((r) => {
1684
+ a.querySelectorAll(ye[r]).forEach((i) => {
1685
+ i.addEventListener("pointerdown", (o) => ft(e, t, r, i, o));
1655
1686
  });
1656
1687
  });
1657
1688
  }
1658
- function mr(e, r, a, t, i) {
1659
- if (i.pointerType === "mouse" && i.button !== 0 || e.editingLayerId || e.editingFeatureId || ge(e, t) === null) return;
1689
+ function ft(e, t, a, r, i) {
1690
+ if (i.pointerType === "mouse" && i.button !== 0 || e.editingLayerId || e.editingFeatureId || ve(e, r) === null) return;
1660
1691
  q == null || q.cancelar();
1661
- const o = be[a], n = i.ctrlKey || i.metaKey, l = i.shiftKey;
1662
- let c = !1, s = !1, p = i.clientY;
1663
- const u = /* @__PURE__ */ new Set([t]), d = (w) => {
1692
+ const o = ye[a], n = i.ctrlKey || i.metaKey, s = i.shiftKey;
1693
+ let c = !1, l = !1, p = i.clientY;
1694
+ const d = /* @__PURE__ */ new Set([r]), u = (w) => {
1664
1695
  w.preventDefault(), w.stopImmediatePropagation();
1665
- }, m = (w) => {
1696
+ }, f = (w) => {
1666
1697
  w.stopPropagation(), w.preventDefault();
1667
- }, f = (w) => w.preventDefault(), g = (w) => {
1668
- u.has(w) || (u.add(w), ge(e, w) !== s && qe(w, a === "selecao"));
1698
+ }, m = (w) => w.preventDefault(), g = (w) => {
1699
+ d.has(w) || (d.add(w), ve(e, w) !== l && De(w, a === "selecao"));
1669
1700
  }, v = () => {
1670
- c = !0, qe(t, n, l), s = ge(e, t) === !0, r.addEventListener("selectstart", f), document.body.style.userSelect = "none";
1671
- }, y = (w) => {
1672
- var I, E;
1701
+ c = !0, De(r, n, s), l = ve(e, r) === !0, t.addEventListener("selectstart", m), document.body.style.userSelect = "none";
1702
+ }, b = (w) => {
1703
+ var k, I;
1673
1704
  if (!c) {
1674
- if (Math.hypot(w.clientX - i.clientX, w.clientY - i.clientY) < ur) return;
1675
- const x = (I = r.elementFromPoint(w.clientX, w.clientY)) == null ? void 0 : I.closest(o);
1676
- if (!x || x === t) return;
1705
+ if (Math.hypot(w.clientX - i.clientX, w.clientY - i.clientY) < dt) return;
1706
+ const x = (k = t.elementFromPoint(w.clientX, w.clientY)) == null ? void 0 : k.closest(o);
1707
+ if (!x || x === r) return;
1677
1708
  v();
1678
1709
  }
1679
1710
  w.preventDefault();
1680
- const L = Math.min(p, w.clientY), h = Math.max(p, w.clientY);
1681
- r.querySelectorAll(o).forEach((x) => {
1711
+ const S = Math.min(p, w.clientY), h = Math.max(p, w.clientY);
1712
+ t.querySelectorAll(o).forEach((x) => {
1682
1713
  const B = x.getBoundingClientRect();
1683
1714
  if (B.height === 0) return;
1684
- const P = B.top + B.height / 2;
1685
- P >= L && P <= h && g(x);
1715
+ const T = B.top + B.height / 2;
1716
+ T >= S && T <= h && g(x);
1686
1717
  });
1687
- const $ = (E = r.elementFromPoint(w.clientX, w.clientY)) == null ? void 0 : E.closest(o);
1688
- $ && g($), p = w.clientY;
1689
- }, k = (w = !1) => {
1690
- (q == null ? void 0 : q.cancelar) === S && (q = null), window.removeEventListener("pointermove", y), window.removeEventListener("pointerup", M), window.removeEventListener("pointercancel", M), window.removeEventListener("dragstart", d, !0), r.removeEventListener("selectstart", f), c && (document.body.style.userSelect = "", w || (window.addEventListener("click", m, { capture: !0, once: !0 }), setTimeout(() => window.removeEventListener("click", m, !0), 0)));
1691
- }, M = () => k(), S = () => k(!0);
1692
- q = { host: e, cancelar: S }, window.addEventListener("dragstart", d, !0), window.addEventListener("pointermove", y, { passive: !1 }), window.addEventListener("pointerup", M), window.addEventListener("pointercancel", M);
1693
- }
1694
- function gr(e, r) {
1695
- const a = r.getElementById("btn-toggle-all-vis");
1718
+ const F = (I = t.elementFromPoint(w.clientX, w.clientY)) == null ? void 0 : I.closest(o);
1719
+ F && g(F), p = w.clientY;
1720
+ }, E = (w = !1) => {
1721
+ (q == null ? void 0 : q.cancelar) === $ && (q = null), window.removeEventListener("pointermove", b), window.removeEventListener("pointerup", L), window.removeEventListener("pointercancel", L), window.removeEventListener("dragstart", u, !0), t.removeEventListener("selectstart", m), c && (document.body.style.userSelect = "", w || (window.addEventListener("click", f, { capture: !0, once: !0 }), setTimeout(() => window.removeEventListener("click", f, !0), 0)));
1722
+ }, L = () => E(), $ = () => E(!0);
1723
+ q = { host: e, cancelar: $ }, window.addEventListener("dragstart", u, !0), window.addEventListener("pointermove", b, { passive: !1 }), window.addEventListener("pointerup", L), window.addEventListener("pointercancel", L);
1724
+ }
1725
+ function mt(e, t) {
1726
+ const a = t.getElementById("btn-toggle-all-vis");
1696
1727
  a && a.addEventListener("click", () => e.alternarVisibilidadeTodas(!0));
1697
- const t = r.getElementById("btn-toggle-all-expand");
1698
- t && t.addEventListener("click", (o) => {
1699
- o.stopPropagation(), e.camadas.length > 0 && e.camadas.every((l) => e.expandedLayers.has(l.id)) ? e.colapsarTodas() : e.expandirTodas();
1728
+ const r = t.getElementById("btn-toggle-all-expand");
1729
+ r && r.addEventListener("click", (o) => {
1730
+ o.stopPropagation(), e.camadas.length > 0 && e.camadas.every((s) => e.expandedLayers.has(s.id)) ? e.colapsarTodas() : e.expandirTodas();
1700
1731
  });
1701
- const i = r.getElementById("btn-colapsar");
1702
- i && i.addEventListener("click", () => e.colapsar(!0)), vr(e, r);
1732
+ const i = t.getElementById("btn-colapsar");
1733
+ i && i.addEventListener("click", () => e.colapsar(!0)), gt(e, t);
1703
1734
  }
1704
- function vr(e, r) {
1705
- const a = r.getElementById("input-layer-search"), t = r.getElementById("btn-clear-layer-search"), i = () => {
1735
+ function gt(e, t) {
1736
+ const a = t.getElementById("input-layer-search"), r = t.getElementById("btn-clear-layer-search"), i = () => {
1706
1737
  var o;
1707
- e.searchQuery = "", e.solicitarRenderizacao(), (o = r.getElementById("input-layer-search")) == null || o.focus();
1738
+ e.searchQuery = "", e.solicitarRenderizacao(), (o = t.getElementById("input-layer-search")) == null || o.focus();
1708
1739
  };
1709
1740
  if (a) {
1710
- const o = Re(() => e.solicitarRenderizacao(), 75);
1741
+ const o = je(() => e.solicitarRenderizacao(), 75);
1711
1742
  a.addEventListener("input", (n) => {
1712
1743
  e.searchQuery = n.target.value, o();
1713
1744
  }), a.addEventListener("keydown", (n) => {
1714
1745
  n.key === "Escape" && e.searchQuery && (n.preventDefault(), i());
1715
1746
  });
1716
1747
  }
1717
- t && t.addEventListener("click", i);
1748
+ r && r.addEventListener("click", i);
1718
1749
  }
1719
- function ta(e, r) {
1720
- r.querySelectorAll("[data-feat-select]").forEach((a) => {
1721
- a.addEventListener("click", (t) => {
1750
+ function sa(e, t) {
1751
+ t.querySelectorAll("[data-feat-select]").forEach((a) => {
1752
+ a.addEventListener("click", (r) => {
1722
1753
  if (e.editingFeatureId) return;
1723
- const i = t;
1754
+ const i = r;
1724
1755
  if (i.target.closest(
1725
1756
  "[data-feat-eye], [data-feat-lock], [data-feat-fit], [data-feat-target], input, button"
1726
1757
  ))
@@ -1728,264 +1759,255 @@ function ta(e, r) {
1728
1759
  const n = a.getAttribute("data-feat-select");
1729
1760
  n && e.selecionarFeicao(n, i.ctrlKey || i.metaKey, i.shiftKey, !0);
1730
1761
  });
1731
- }), r.querySelectorAll("[data-feat-target]").forEach((a) => {
1732
- a.addEventListener("click", (t) => {
1733
- t.stopPropagation();
1734
- const i = t, o = a.getAttribute("data-feat-target");
1762
+ }), t.querySelectorAll("[data-feat-target]").forEach((a) => {
1763
+ a.addEventListener("click", (r) => {
1764
+ r.stopPropagation();
1765
+ const i = r, o = a.getAttribute("data-feat-target");
1735
1766
  o && e.selecionarFeicao(o, i.ctrlKey || i.metaKey, i.shiftKey, !0);
1736
1767
  });
1737
- }), r.querySelectorAll("[data-feat-eye]").forEach((a) => {
1738
- a.addEventListener("click", (t) => {
1739
- t.stopPropagation();
1768
+ }), t.querySelectorAll("[data-feat-eye]").forEach((a) => {
1769
+ a.addEventListener("click", (r) => {
1770
+ r.stopPropagation();
1740
1771
  const i = a.getAttribute("data-feat-eye"), o = e.feicoes.find((n) => n.id === i);
1741
1772
  if (o) {
1742
1773
  o.visible = o.visible === !1;
1743
1774
  const n = o.visible !== !1;
1744
- a.innerHTML = n ? b.olhoAberto : b.olhoFechado, D(a, n ? "Ocultar Feição" : "Exibir Feição");
1745
- const l = a.closest(".ui-feat-row");
1746
- l && l.classList.toggle("hidden-row", !n), e.dispararEvento("ui-feicao-visibilidade", {
1775
+ a.innerHTML = n ? y.olhoAberto : y.olhoFechado, D(a, n ? "Ocultar Feição" : "Exibir Feição");
1776
+ const s = a.closest(".ui-feat-row");
1777
+ s && s.classList.toggle("hidden-row", !n), e.dispararEvento("ui-feicao-visibilidade", {
1747
1778
  feicaoId: o.id,
1748
1779
  visivel: n
1749
1780
  });
1750
1781
  }
1751
1782
  });
1752
- }), r.querySelectorAll("[data-feat-lock]").forEach((a) => {
1753
- a.addEventListener("click", (t) => {
1754
- if (t.stopPropagation(), a.hasAttribute("data-locked-by-layer")) return;
1783
+ }), t.querySelectorAll("[data-feat-lock]").forEach((a) => {
1784
+ a.addEventListener("click", (r) => {
1785
+ if (r.stopPropagation(), a.hasAttribute("data-locked-by-layer")) return;
1755
1786
  const i = a.getAttribute("data-feat-lock"), o = e.feicoes.find((n) => n.id === i);
1756
- o && (o.locked = !o.locked, a.innerHTML = o.locked ? b.cadeadoTrancado : b.cadeadoAberto, a.classList.toggle("ui-lock-open", !o.locked), D(a, o.locked ? "Desbloquear Feição" : "Bloquear Feição"), e.dispararEvento("ui-feicao-bloqueio", {
1787
+ o && (o.locked = !o.locked, a.innerHTML = o.locked ? y.cadeadoTrancado : y.cadeadoAberto, a.classList.toggle("ui-lock-open", !o.locked), D(a, o.locked ? "Desbloquear Feição" : "Bloquear Feição"), e.dispararEvento("ui-feicao-bloqueio", {
1757
1788
  feicaoId: o.id,
1758
1789
  bloqueado: o.locked
1759
1790
  }));
1760
1791
  });
1761
- }), r.querySelectorAll("[data-feat-fit]").forEach((a) => {
1762
- a.addEventListener("click", (t) => {
1763
- t.stopPropagation();
1792
+ }), t.querySelectorAll("[data-feat-fit]").forEach((a) => {
1793
+ a.addEventListener("click", (r) => {
1794
+ r.stopPropagation();
1764
1795
  const i = a.getAttribute("data-feat-fit");
1765
1796
  i && e.dispararEvento("ui-feicao-enquadrar", { feicaoId: i });
1766
1797
  });
1767
1798
  });
1768
1799
  }
1769
- function hr(e, r) {
1800
+ function vt(e, t) {
1770
1801
  var a;
1771
- r.querySelectorAll("[data-basemap-thumb]").forEach((t) => {
1772
- t.addEventListener(
1773
- "error",
1774
- () => {
1775
- const i = document.createElement("div");
1776
- i.className = "ui-basemap-preview-none", i.innerHTML = b.mapa, t.replaceWith(i);
1777
- },
1778
- { once: !0 }
1779
- );
1780
- }), (a = r.querySelector("[data-basemap-toggle]")) == null || a.addEventListener("click", () => {
1802
+ (a = t.querySelector("[data-basemap-toggle]")) == null || a.addEventListener("click", () => {
1781
1803
  e.alternarMapasBaseRecolhido(!0);
1782
- }), r.querySelectorAll("[data-basemap-id]").forEach((t) => {
1783
- t.addEventListener("click", () => {
1784
- const i = t.getAttribute("data-basemap-id");
1804
+ }), t.querySelectorAll("[data-basemap-id]").forEach((r) => {
1805
+ r.addEventListener("click", () => {
1806
+ const i = r.getAttribute("data-basemap-id");
1785
1807
  i && e.selecionarMapaBase(i, !0);
1786
1808
  });
1787
1809
  });
1788
1810
  }
1789
- function br(e, r) {
1790
- gr(e, r), nr(e, r), ta(e, r), hr(e, r), cr(e, r), ra(e, r);
1811
+ function bt(e, t) {
1812
+ mt(e, t), ot(e, t), sa(e, t), vt(e, t), lt(e, t), na(e, t);
1791
1813
  }
1792
- function yr(e) {
1814
+ function ht(e) {
1793
1815
  if (!e.arvoreRenderizada) return { incremental: !1, motivo: "arvore-nao-renderizada" };
1794
1816
  if (e.buscaAtiva) return { incremental: !1, motivo: "busca-ativa" };
1795
1817
  if (e.editandoCamada || e.editandoFeicao) return { incremental: !1, motivo: "edicao-inline" };
1796
- for (const r of e.camadasAfetadas) {
1797
- if (!r.existeNoModelo) return { incremental: !1, motivo: "camada-orfa" };
1798
- if (!r.renderizadaNoDom) return { incremental: !1, motivo: "camada-fora-do-dom" };
1799
- if (r.drawerAberto) return { incremental: !1, motivo: "drawer-aberto" };
1818
+ for (const t of e.camadasAfetadas) {
1819
+ if (!t.existeNoModelo) return { incremental: !1, motivo: "camada-orfa" };
1820
+ if (!t.renderizadaNoDom) return { incremental: !1, motivo: "camada-fora-do-dom" };
1821
+ if (t.drawerAberto) return { incremental: !1, motivo: "drawer-aberto" };
1800
1822
  }
1801
1823
  return e.idsDuplicados ? { incremental: !1, motivo: "ids-duplicados" } : { incremental: !0 };
1802
1824
  }
1803
- function ia(e, r = /* @__PURE__ */ new Map()) {
1825
+ function la(e, t = /* @__PURE__ */ new Map()) {
1804
1826
  for (const a of e)
1805
- r.set(a.camada.id, a), ia(a.subcamadas, r);
1806
- return r;
1827
+ t.set(a.camada.id, a), la(a.subcamadas, t);
1828
+ return t;
1807
1829
  }
1808
- function xr(e) {
1809
- const r = /* @__PURE__ */ new Map();
1830
+ function yt(e) {
1831
+ const t = /* @__PURE__ */ new Map();
1810
1832
  for (let a = 0; a < e.length; a++) {
1811
- const t = e[a];
1812
- if (!t || !t.id) continue;
1813
- const i = t.layerId || "", o = r.get(i);
1814
- o ? o.push(t) : r.set(i, [t]);
1833
+ const r = e[a];
1834
+ if (!r || !r.id) continue;
1835
+ const i = r.layerId || "", o = t.get(i);
1836
+ o ? o.push(r) : t.set(i, [r]);
1815
1837
  }
1816
- return r;
1838
+ return t;
1817
1839
  }
1818
- function V(e, r) {
1840
+ function K(e, t) {
1819
1841
  for (let a = e.firstElementChild; a; a = a.nextElementSibling)
1820
- if (a.classList.contains(r)) return a;
1842
+ if (a.classList.contains(t)) return a;
1821
1843
  return null;
1822
1844
  }
1823
- function wr(e) {
1824
- const r = /* @__PURE__ */ new Map(), a = (t) => {
1825
- for (let i = t.firstElementChild; i && i.classList.contains("ui-layer-group"); i = i.nextElementSibling) {
1845
+ function xt(e) {
1846
+ const t = /* @__PURE__ */ new Map(), a = (r) => {
1847
+ for (let i = r.firstElementChild; i && i.classList.contains("ui-layer-group"); i = i.nextElementSibling) {
1826
1848
  const o = i.getAttribute("data-layer-id");
1827
- o !== null && r.set(o, i);
1828
- const n = V(i, "ui-children-container");
1849
+ o !== null && t.set(o, i);
1850
+ const n = K(i, "ui-children-container");
1829
1851
  n && a(n);
1830
1852
  }
1831
1853
  };
1832
- return a(e), r;
1854
+ return a(e), t;
1833
1855
  }
1834
- function Ar(e) {
1856
+ function wt(e) {
1835
1857
  if (!e || e.length < 2) return !1;
1836
- const r = /* @__PURE__ */ new Set();
1858
+ const t = /* @__PURE__ */ new Set();
1837
1859
  for (const a of e) {
1838
- if (r.has(a.id)) return !0;
1839
- r.add(a.id);
1860
+ if (t.has(a.id)) return !0;
1861
+ t.add(a.id);
1840
1862
  }
1841
1863
  return !1;
1842
1864
  }
1843
- function Er(e, r) {
1865
+ function At(e, t) {
1844
1866
  var i;
1845
- const a = new Map(r.map((o) => [o.id, o])), t = /* @__PURE__ */ new Set();
1867
+ const a = new Map(t.map((o) => [o.id, o])), r = /* @__PURE__ */ new Set();
1846
1868
  for (const o of e) {
1847
1869
  let n = o;
1848
- for (; n && a.has(n) && !t.has(n); )
1849
- t.add(n), n = (i = a.get(n)) == null ? void 0 : i.parentId;
1870
+ for (; n && a.has(n) && !r.has(n); )
1871
+ r.add(n), n = (i = a.get(n)) == null ? void 0 : i.parentId;
1850
1872
  }
1851
- return t;
1852
- }
1853
- function ie(e) {
1854
- const r = document.createElement("template");
1855
- return r.innerHTML = e, { modelo: r, elementos: Array.from(r.content.children) };
1873
+ return r;
1856
1874
  }
1857
1875
  function oe(e) {
1876
+ const t = document.createElement("template");
1877
+ return t.innerHTML = e, { modelo: t, elementos: Array.from(t.content.children) };
1878
+ }
1879
+ function ne(e) {
1858
1880
  var a;
1859
- const r = e.nextSibling;
1860
- r && r.nodeType === 3 && !(r.textContent ?? "").trim() && ((a = r.parentNode) == null || a.removeChild(r)), e.remove();
1881
+ const t = e.nextSibling;
1882
+ t && t.nodeType === 3 && !(t.textContent ?? "").trim() && ((a = t.parentNode) == null || a.removeChild(t)), e.remove();
1861
1883
  }
1862
- function kr(e, r) {
1863
- if (!e || !r.contains(e)) return null;
1864
- const a = Array.from(e.attributes).find((t) => t.name.startsWith("data-") && t.value !== "");
1884
+ function Et(e, t) {
1885
+ if (!e || !t.contains(e)) return null;
1886
+ const a = Array.from(e.attributes).find((r) => r.name.startsWith("data-") && r.value !== "");
1865
1887
  return a ? { nome: a.name, valor: a.value } : null;
1866
1888
  }
1867
- function Ir(e, r) {
1868
- const { host: a, shadow: t, mudanca: i } = e, o = e.grupos.get(r), n = e.nodos.get(r), l = o ? V(o, "ui-children-container") : null;
1869
- if (!o || !n || !l) return !1;
1870
- const c = n.camada, s = e.porCamada.get(r) ?? [], p = a.expandedFeatureLimits.get(r) ?? we, u = s.slice(0, p), d = new Set(u.map((h) => h.id)), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), g = t.activeElement;
1889
+ function It(e, t) {
1890
+ const { host: a, shadow: r, mudanca: i } = e, o = e.grupos.get(t), n = e.nodos.get(t), s = o ? K(o, "ui-children-container") : null;
1891
+ if (!o || !n || !s) return !1;
1892
+ const c = n.camada, l = e.porCamada.get(t) ?? [], p = a.expandedFeatureLimits.get(t) ?? we, d = l.slice(0, p), u = new Set(d.map((h) => h.id)), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), g = r.activeElement;
1871
1893
  let v = null;
1872
- for (let h = l.firstElementChild, $; h; h = $) {
1873
- $ = h.nextElementSibling;
1874
- const I = h.getAttribute("data-feat-row");
1875
- if (I === null) {
1894
+ for (let h = s.firstElementChild, F; h; h = F) {
1895
+ F = h.nextElementSibling;
1896
+ const k = h.getAttribute("data-feat-row");
1897
+ if (k === null) {
1876
1898
  !v && !h.classList.contains("ui-layer-group") && (v = h);
1877
1899
  continue;
1878
1900
  }
1879
- const E = i.idsAlterados.has(I) && d.has(I) && !m.has(I);
1880
- !d.has(I) || m.has(I) || E ? (E && f.set(I, { tabindex: h.getAttribute("tabindex"), foco: kr(g, h) }), oe(h)) : (m.set(I, h), v || (v = h));
1881
- }
1882
- const y = Ge(c, n.depth, e.herdado.get(r)), k = u.filter((h) => !m.has(h.id));
1883
- let M = [];
1884
- if (k.length > 0) {
1885
- const h = k.map(
1886
- (E) => Qe(E, y, a.selectedFeatureIds.has(E.id), a.editingFeatureId === E.id)
1887
- ).join(""), { modelo: $, elementos: I } = ie(h);
1888
- if (I.length !== k.length) return !1;
1889
- e.ligar($.content), M = I;
1890
- }
1891
- let S = v, w = 0;
1892
- const L = /* @__PURE__ */ new Map();
1893
- for (const h of u) {
1894
- const $ = m.get(h.id);
1895
- if ($)
1896
- $ === S ? S = $.nextElementSibling : l.insertBefore($, S);
1901
+ const I = i.idsAlterados.has(k) && u.has(k) && !f.has(k);
1902
+ !u.has(k) || f.has(k) || I ? (I && m.set(k, { tabindex: h.getAttribute("tabindex"), foco: Et(g, h) }), ne(h)) : (f.set(k, h), v || (v = h));
1903
+ }
1904
+ const b = Ye(c, n.depth, e.herdado.get(t)), E = d.filter((h) => !f.has(h.id));
1905
+ let L = [];
1906
+ if (E.length > 0) {
1907
+ const h = E.map(
1908
+ (I) => Ze(I, b, a.selectedFeatureIds.has(I.id), a.editingFeatureId === I.id)
1909
+ ).join(""), { modelo: F, elementos: k } = oe(h);
1910
+ if (k.length !== E.length) return !1;
1911
+ e.ligar(F.content), L = k;
1912
+ }
1913
+ let $ = v, w = 0;
1914
+ const S = /* @__PURE__ */ new Map();
1915
+ for (const h of d) {
1916
+ const F = f.get(h.id);
1917
+ if (F)
1918
+ F === $ ? $ = F.nextElementSibling : s.insertBefore(F, $);
1897
1919
  else {
1898
- const I = M[w++];
1899
- l.insertBefore(I, S), L.set(h.id, I);
1920
+ const k = L[w++];
1921
+ s.insertBefore(k, $), S.set(h.id, k);
1900
1922
  }
1901
1923
  }
1902
- return f.forEach((h, $) => {
1903
- const I = L.get($);
1904
- if (!I || (h.tabindex !== null && I.setAttribute("tabindex", h.tabindex), !h.foco)) return;
1905
- const E = I.getAttribute(h.foco.nome) === h.foco.valor ? I : Array.from(I.querySelectorAll(`[${h.foco.nome}]`)).find(
1924
+ return m.forEach((h, F) => {
1925
+ const k = S.get(F);
1926
+ if (!k || (h.tabindex !== null && k.setAttribute("tabindex", h.tabindex), !h.foco)) return;
1927
+ const I = k.getAttribute(h.foco.nome) === h.foco.valor ? k : Array.from(k.querySelectorAll(`[${h.foco.nome}]`)).find(
1906
1928
  (x) => x.getAttribute(h.foco.nome) === h.foco.valor
1907
1929
  );
1908
- E == null || E.focus({ preventScroll: !0 });
1909
- }), Cr(e, l, n, p, s.length);
1910
- }
1911
- function Cr(e, r, a, t, i) {
1912
- const o = z(a.camada.id), n = !!(a.camada.isGroup || a.subcamadas.length > 0), l = i > t, c = a.subcamadas.length === 0 && i === 0, s = V(r, "ui-truncate-notice"), p = V(r, "ui-empty-row");
1913
- if (p && !c && oe(p), s && !l && oe(s), l)
1914
- if (s) {
1915
- const u = Ve(t, i), d = s.querySelector("span"), m = s.querySelector(".ui-truncate-more-btn");
1916
- if (!d || !m) return !1;
1917
- d.textContent !== u.resumo && (d.textContent = u.resumo), m.textContent !== u.botao && (m.textContent = u.botao);
1930
+ I == null || I.focus({ preventScroll: !0 });
1931
+ }), kt(e, s, n, p, l.length);
1932
+ }
1933
+ function kt(e, t, a, r, i) {
1934
+ const o = z(a.camada.id), n = !!(a.camada.isGroup || a.subcamadas.length > 0), s = i > r, c = a.subcamadas.length === 0 && i === 0, l = K(t, "ui-truncate-notice"), p = K(t, "ui-empty-row");
1935
+ if (p && !c && ne(p), l && !s && ne(l), s)
1936
+ if (l) {
1937
+ const d = Xe(r, i), u = l.querySelector("span"), f = l.querySelector(".ui-truncate-more-btn");
1938
+ if (!u || !f) return !1;
1939
+ u.textContent !== d.resumo && (u.textContent = d.resumo), f.textContent !== d.botao && (f.textContent = d.botao);
1918
1940
  } else {
1919
- const { modelo: u, elementos: d } = ie(Ye(o, t, i));
1920
- if (d.length !== 1) return !1;
1921
- e.ligar(u.content), r.appendChild(d[0]);
1941
+ const { modelo: d, elementos: u } = oe(We(o, r, i));
1942
+ if (u.length !== 1) return !1;
1943
+ e.ligar(d.content), t.appendChild(u[0]);
1922
1944
  }
1923
1945
  if (c && !p) {
1924
- const { elementos: u } = ie(Ke(n));
1925
- if (u.length !== 1) return !1;
1926
- r.appendChild(u[0]);
1946
+ const { elementos: d } = oe(Je(n));
1947
+ if (d.length !== 1) return !1;
1948
+ t.appendChild(d[0]);
1927
1949
  }
1928
1950
  return !0;
1929
1951
  }
1930
- function Lr(e, r) {
1931
- const a = e.grupos.get(r), t = e.nodos.get(r), i = a ? V(a, "ui-layer-row") : null, o = i == null ? void 0 : i.querySelector(".ui-col-name");
1932
- if (!a || !t || !i || !o) return !1;
1933
- const { host: n } = e, l = Q(n.camadas, n.feicoes, r), c = (e.porCamada.get(r) ?? []).length, s = t.subcamadas.length, p = !!(t.camada.isGroup || s > 0), u = o.querySelector(".ui-count-chip");
1934
- if (u)
1935
- if (l.length === 0 && p)
1936
- oe(u);
1952
+ function Lt(e, t) {
1953
+ const a = e.grupos.get(t), r = e.nodos.get(t), i = a ? K(a, "ui-layer-row") : null, o = i == null ? void 0 : i.querySelector(".ui-col-name");
1954
+ if (!a || !r || !i || !o) return !1;
1955
+ const { host: n } = e, s = W(n.camadas, n.feicoes, t), c = (e.porCamada.get(t) ?? []).length, l = r.subcamadas.length, p = !!(r.camada.isGroup || l > 0), d = o.querySelector(".ui-count-chip");
1956
+ if (d)
1957
+ if (s.length === 0 && p)
1958
+ ne(d);
1937
1959
  else {
1938
- const d = String(l.length), m = _e(l.length, c, s);
1939
- u.textContent !== d && (u.textContent = d), u.getAttribute("title") !== m && u.setAttribute("title", m);
1960
+ const u = String(s.length), f = Ke(s.length, c, l);
1961
+ d.textContent !== u && (d.textContent = u), d.getAttribute("title") !== f && d.setAttribute("title", f);
1940
1962
  }
1941
1963
  else {
1942
- const d = Ue(l.length, c, s, p);
1943
- if (d) {
1944
- const { elementos: m } = ie(d);
1945
- if (m.length !== 1) return !1;
1946
- o.appendChild(m[0]);
1964
+ const u = Qe(s.length, c, l, p);
1965
+ if (u) {
1966
+ const { elementos: f } = oe(u);
1967
+ if (f.length !== 1) return !1;
1968
+ o.appendChild(f[0]);
1947
1969
  }
1948
1970
  }
1949
- return Ze(i.querySelector(".ui-target-circle"), l, n.selectedFeatureIds), !0;
1971
+ return ra(i.querySelector(".ui-target-circle"), s, n.selectedFeatureIds), !0;
1950
1972
  }
1951
- function Sr(e, r, a, t) {
1952
- const i = r.getElementById("ui-layer-tree-mount"), o = ia(ne(e.camadas)), n = i ? wr(i) : /* @__PURE__ */ new Map(), l = xr(e.feicoes), c = a.camadas === "todas" ? Array.from(o.keys()) : Array.from(a.camadas), s = c.map((d) => ({
1953
- existeNoModelo: o.has(d),
1954
- renderizadaNoDom: n.has(d),
1955
- drawerAberto: e.activeSettingsLayerId === d
1973
+ function Ct(e, t, a, r) {
1974
+ const i = t.getElementById("ui-layer-tree-mount"), o = la(se(e.camadas)), n = i ? xt(i) : /* @__PURE__ */ new Map(), s = yt(e.feicoes), c = a.camadas === "todas" ? Array.from(o.keys()) : Array.from(a.camadas), l = c.map((u) => ({
1975
+ existeNoModelo: o.has(u),
1976
+ renderizadaNoDom: n.has(u),
1977
+ drawerAberto: e.activeSettingsLayerId === u
1956
1978
  }));
1957
- if (!yr({
1979
+ if (!ht({
1958
1980
  arvoreRenderizada: i !== null,
1959
1981
  buscaAtiva: (e.searchQuery || "").trim() !== "",
1960
1982
  editandoCamada: e.editingLayerId !== null,
1961
1983
  editandoFeicao: e.editingFeatureId !== null,
1962
- idsDuplicados: c.some((d) => Ar(l.get(d))),
1963
- camadasAfetadas: s
1984
+ idsDuplicados: c.some((u) => wt(s.get(u))),
1985
+ camadasAfetadas: l
1964
1986
  }).incremental) return !1;
1965
- const u = {
1987
+ const d = {
1966
1988
  host: e,
1967
- shadow: r,
1989
+ shadow: t,
1968
1990
  mudanca: a,
1969
- porCamada: l,
1991
+ porCamada: s,
1970
1992
  nodos: o,
1971
1993
  grupos: n,
1972
- herdado: se(e.camadas),
1973
- ligar: t
1994
+ herdado: le(e.camadas),
1995
+ ligar: r
1974
1996
  };
1975
- for (const d of c)
1976
- if (!Ir(u, d)) return !1;
1977
- for (const d of Er(c, e.camadas))
1978
- if (!Lr(u, d)) return !1;
1979
- return (a.selecaoAfetada || e.selectedFeatureIds.size > 0) && ea(e, r), !0;
1997
+ for (const u of c)
1998
+ if (!It(d, u)) return !1;
1999
+ for (const u of At(c, e.camadas))
2000
+ if (!Lt(d, u)) return !1;
2001
+ return (a.selecaoAfetada || e.selectedFeatureIds.size > 0) && ia(e, t), !0;
1980
2002
  }
1981
- function $r(e) {
2003
+ function St(e) {
1982
2004
  if (!e.isConnected) return;
1983
- const r = document.createElement("div");
1984
- r.className = "ui-basemap-preview-none", r.innerHTML = b.gradeCad, e.replaceWith(r);
2005
+ const t = document.createElement("div");
2006
+ t.className = "ui-basemap-preview-none", t.innerHTML = y.gradeCad, e.replaceWith(t);
1985
2007
  }
1986
- function Mr(e, r, a, t) {
2008
+ function $t(e, t, a, r) {
1987
2009
  var g, v;
1988
- const i = Va({
2010
+ const i = Ua({
1989
2011
  camadas: e.camadas,
1990
2012
  feicoes: e.feicoes,
1991
2013
  camadaAtivaId: e.camadaAtivaId,
@@ -1999,92 +2021,92 @@ function Mr(e, r, a, t) {
1999
2021
  mostrarBusca: e.mostrarBusca,
2000
2022
  limitesPorCamada: e.expandedFeatureLimits,
2001
2023
  mostrarBotaoColapsar: e.flutuante && e.getAttribute("colapsavel") !== "false"
2002
- }), o = e.mostrarMapasBase ? za(e.mapasBase, e.mapaBaseAtivo, e.mapasBaseRecolhido) : "", n = e.mostrarRodape ? Da(e.camadas, e.feicoes, e.selectedFeatureIds) : "", l = r.getElementById("ui-layer-tree-mount"), c = a.scrollTop, s = l ? l.scrollTop : 0, p = r.activeElement, u = p && a.contains(p) ? p.id : "", d = p && !u && a.contains(p) ? Array.from(p.attributes).find((y) => y.name.startsWith("data-") && y.value !== "") : void 0, m = p && "selectionStart" in p ? p.selectionStart : null;
2024
+ }), o = e.mostrarMapasBase ? Da(e.mapasBase, e.mapaBaseAtivo, e.mapasBaseRecolhido) : "", n = e.mostrarRodape ? Ra(e.camadas, e.feicoes, e.selectedFeatureIds) : "", s = t.getElementById("ui-layer-tree-mount"), c = a.scrollTop, l = s ? s.scrollTop : 0, p = t.activeElement, d = p && a.contains(p) ? p.id : "", u = p && !d && a.contains(p) ? Array.from(p.attributes).find((b) => b.name.startsWith("data-") && b.value !== "") : void 0, f = p && "selectionStart" in p ? p.selectionStart : null;
2003
2025
  a.innerHTML = `
2004
2026
  ${i}
2005
2027
  ${n}
2006
2028
  ${o}
2007
2029
  `, a.scrollTop = c;
2008
- const f = r.getElementById("ui-layer-tree-mount");
2009
- if (f && (f.scrollTop = s), u) {
2010
- const y = r.getElementById(u);
2011
- if (y && (y.focus({ preventScroll: !0 }), m !== null && typeof y.setSelectionRange == "function"))
2030
+ const m = t.getElementById("ui-layer-tree-mount");
2031
+ if (m && (m.scrollTop = l), d) {
2032
+ const b = t.getElementById(d);
2033
+ if (b && (b.focus({ preventScroll: !0 }), f !== null && typeof b.setSelectionRange == "function"))
2012
2034
  try {
2013
- y.setSelectionRange(m, m);
2035
+ b.setSelectionRange(f, f);
2014
2036
  } catch {
2015
2037
  }
2016
2038
  }
2017
- !u && d && ((g = T(a, d.name, d.value)) == null || g.focus({ preventScroll: !0 })), (v = r.querySelector("[data-layer-row], [data-feat-row]")) == null || v.setAttribute("tabindex", "0"), a.querySelectorAll("img[data-basemap-thumb]").forEach((y) => {
2018
- const k = () => $r(y);
2019
- y.addEventListener("error", k, { once: !0 }), y.complete && y.naturalWidth === 0 && y.getAttribute("src") && k();
2020
- }), br(e, r), t.bindAll();
2039
+ !d && u && ((g = P(a, u.name, u.value)) == null || g.focus({ preventScroll: !0 })), (v = t.querySelector("[data-layer-row], [data-feat-row]")) == null || v.setAttribute("tabindex", "0"), a.querySelectorAll("img[data-basemap-thumb]").forEach((b) => {
2040
+ const E = () => St(b);
2041
+ b.addEventListener("error", E, { once: !0 }), b.complete && b.naturalWidth === 0 && b.getAttribute("src") && E();
2042
+ }), bt(e, t), r.bindAll();
2021
2043
  }
2022
- function Fr(e, r, a, t) {
2044
+ function Ft(e, t, a, r) {
2023
2045
  try {
2024
- return Sr(e, r, t, (i) => {
2025
- ta(e, i), aa(e, i), ra(e, r, i), a.bindLinhasFeicao(i);
2046
+ return Ct(e, t, r, (i) => {
2047
+ sa(e, i), oa(e, i), na(e, t, i), a.bindLinhasFeicao(i);
2026
2048
  });
2027
2049
  } catch (i) {
2028
2050
  return console.warn("[UI-Camadas] atualização incremental falhou; redesenhando o painel.", i), !1;
2029
2051
  }
2030
2052
  }
2031
- const zr = '[role="button"][tabindex]', Y = "[data-layer-row], [data-feat-row]", Br = ["color", "range", "checkbox", "radio", "button"];
2032
- function oa(e) {
2033
- return !e || !(e instanceof Element) || e instanceof HTMLInputElement && Br.includes(e.type) ? !1 : La({ composedPath: () => [e] });
2053
+ const Mt = '[role="button"][tabindex]', Q = "[data-layer-row], [data-feat-row]", zt = ["color", "range", "checkbox", "radio", "button"];
2054
+ function ca(e) {
2055
+ return !e || !(e instanceof Element) || e instanceof HTMLInputElement && zt.includes(e.type) ? !1 : Ma({ composedPath: () => [e] });
2034
2056
  }
2035
- function qr(e) {
2036
- return Array.from(e.querySelectorAll(Y)).filter((r) => {
2037
- const a = r.closest(".ui-children-container");
2038
- return !(a && a.style.display === "none") && !r.classList.contains("ui-search-hidden");
2057
+ function Bt(e) {
2058
+ return Array.from(e.querySelectorAll(Q)).filter((t) => {
2059
+ const a = t.closest(".ui-children-container");
2060
+ return !(a && a.style.display === "none") && !t.classList.contains("ui-search-hidden");
2039
2061
  });
2040
2062
  }
2041
- function re(e, r) {
2042
- r && (e.querySelectorAll(Y).forEach((a) => a.setAttribute("tabindex", "-1")), r.setAttribute("tabindex", "0"), r.focus());
2063
+ function j(e, t) {
2064
+ t && (e.querySelectorAll(Q).forEach((a) => a.setAttribute("tabindex", "-1")), t.setAttribute("tabindex", "0"), t.focus());
2043
2065
  }
2044
- function Dr(e, r) {
2066
+ function qt(e, t) {
2045
2067
  e.dispatchEvent(
2046
2068
  new MouseEvent("click", {
2047
2069
  bubbles: !0,
2048
- ctrlKey: r.ctrlKey || r.metaKey,
2049
- shiftKey: r.shiftKey
2070
+ ctrlKey: t.ctrlKey || t.metaKey,
2071
+ shiftKey: t.shiftKey
2050
2072
  })
2051
2073
  );
2052
2074
  }
2053
- function Pr(e, r, a) {
2075
+ function Pt(e, t, a) {
2054
2076
  var i;
2055
- if (oa(a.composedPath()[0])) return;
2056
- const t = r.querySelector(".confirming");
2057
- if (t) {
2058
- a.preventDefault(), t.classList.remove("confirming");
2077
+ if (ca(a.composedPath()[0])) return;
2078
+ const r = t.querySelector(".confirming");
2079
+ if (r) {
2080
+ a.preventDefault(), r.dispatchEvent(new Event("ui-cancelar-confirmacao")), r.classList.remove("confirming");
2059
2081
  return;
2060
2082
  }
2061
2083
  if (e.activeSettingsLayerId) {
2062
2084
  a.preventDefault();
2063
2085
  const o = e.activeSettingsLayerId;
2064
- e.activeSettingsLayerId = null, e.solicitarRenderizacao(), (i = T(r, "data-layer-settings", o)) == null || i.focus();
2086
+ e.activeSettingsLayerId = null, e.solicitarRenderizacao(), (i = P(t, "data-layer-settings", o)) == null || i.focus();
2065
2087
  return;
2066
2088
  }
2067
2089
  e.selectedFeatureIds.size > 0 && (a.preventDefault(), e.limparSelecao(!0));
2068
2090
  }
2069
- function Tr(e, r, a, t) {
2070
- var l;
2071
- const i = t.composedPath()[0];
2072
- if (!(i instanceof HTMLElement) || oa(i)) return;
2073
- if ((t.key === "Enter" || t.key === " ") && i.matches(zr)) {
2074
- t.preventDefault(), i.click();
2091
+ function Dt(e, t, a, r) {
2092
+ var s, c, l;
2093
+ const i = r.composedPath()[0];
2094
+ if (!(i instanceof HTMLElement) || ca(i)) return;
2095
+ if ((r.key === "Enter" || r.key === " ") && i.matches(Mt)) {
2096
+ r.preventDefault(), i.click();
2075
2097
  return;
2076
2098
  }
2077
- if (!i.matches(Y)) return;
2078
- const o = qr(r), n = o.indexOf(i);
2079
- if (t.key === "F2") {
2080
- t.preventDefault();
2081
- const c = i.getAttribute("data-layer-row"), s = i.getAttribute("data-feat-row"), p = c ? T(i, "data-layer-name-trigger", c) : s ? T(i, "data-feat-name-trigger", s) : null;
2082
- p && p.dispatchEvent(new MouseEvent("dblclick", { bubbles: !0 }));
2099
+ if (!i.matches(Q)) return;
2100
+ const o = Bt(t), n = o.indexOf(i);
2101
+ if (r.key === "F2") {
2102
+ r.preventDefault();
2103
+ const p = i.getAttribute("data-layer-row"), d = i.getAttribute("data-feat-row"), u = p ? P(i, "data-layer-name-trigger", p) : d ? P(i, "data-feat-name-trigger", d) : null;
2104
+ u && u.dispatchEvent(new MouseEvent("dblclick", { bubbles: !0 }));
2083
2105
  return;
2084
2106
  }
2085
- if ((t.ctrlKey || t.metaKey) && (t.key === "a" || t.key === "A")) {
2086
- t.preventDefault();
2087
- const c = We(
2107
+ if ((r.ctrlKey || r.metaKey) && (r.key === "a" || r.key === "A")) {
2108
+ r.preventDefault();
2109
+ const p = aa(
2088
2110
  e.camadas,
2089
2111
  e.feicoes,
2090
2112
  e.expandedLayers,
@@ -2092,86 +2114,108 @@ function Tr(e, r, a, t) {
2092
2114
  void 0,
2093
2115
  e.expandedFeatureLimits
2094
2116
  );
2095
- c.length > 0 && e.selecionarFeicoes(c, !0);
2117
+ p.length > 0 && e.selecionarFeicoes(p, !0);
2096
2118
  return;
2097
2119
  }
2098
- if (t.key === "Delete") {
2099
- const c = a.getElementById("btn-footer-del");
2100
- if (c && !c.hasAttribute("disabled") && e.selectedFeatureIds.size > 0) {
2101
- t.preventDefault(), c.click();
2120
+ if (r.key === "Delete") {
2121
+ const p = a.getElementById("btn-footer-del");
2122
+ if (p && !p.hasAttribute("disabled") && e.selectedFeatureIds.size > 0) {
2123
+ r.preventDefault(), p.click();
2102
2124
  return;
2103
2125
  }
2104
2126
  }
2105
- switch (t.key) {
2127
+ switch (r.key) {
2106
2128
  case "ArrowDown":
2107
- t.preventDefault(), re(r, o[Math.min(o.length - 1, n + 1)]);
2129
+ r.preventDefault(), j(t, o[Math.min(o.length - 1, n + 1)]);
2108
2130
  break;
2109
2131
  case "ArrowUp":
2110
- t.preventDefault(), re(r, o[Math.max(0, n - 1)]);
2132
+ r.preventDefault(), j(t, o[Math.max(0, n - 1)]);
2111
2133
  break;
2112
2134
  case "Home":
2113
- t.preventDefault(), re(r, o[0]);
2135
+ r.preventDefault(), j(t, o[0]);
2114
2136
  break;
2115
2137
  case "End":
2116
- t.preventDefault(), re(r, o[o.length - 1]);
2138
+ r.preventDefault(), j(t, o[o.length - 1]);
2139
+ break;
2140
+ case "ArrowRight": {
2141
+ const p = i.getAttribute("data-layer-row");
2142
+ if (!p) return;
2143
+ const d = i.closest(".ui-layer-group");
2144
+ (d == null ? void 0 : d.getAttribute("aria-expanded")) === "true" ? n + 1 < o.length && (d != null && d.contains(o[n + 1])) && (r.preventDefault(), j(t, o[n + 1])) : (r.preventDefault(), (s = P(a, "data-layer-expand", p)) == null || s.click());
2117
2145
  break;
2118
- case "ArrowRight":
2146
+ }
2119
2147
  case "ArrowLeft": {
2120
- const c = i.getAttribute("data-layer-row");
2121
- if (!c) return;
2122
- const s = i.closest(".ui-layer-group"), p = (s == null ? void 0 : s.getAttribute("aria-expanded")) === "true";
2123
- t.key === "ArrowRight" !== p && (t.preventDefault(), (l = T(a, "data-layer-expand", c)) == null || l.click());
2148
+ const p = i.getAttribute("data-layer-row");
2149
+ if (p) {
2150
+ const f = i.closest(".ui-layer-group");
2151
+ if ((f == null ? void 0 : f.getAttribute("aria-expanded")) === "true")
2152
+ r.preventDefault(), (c = P(a, "data-layer-expand", p)) == null || c.click();
2153
+ else {
2154
+ const g = (l = f == null ? void 0 : f.parentElement) == null ? void 0 : l.closest(".ui-layer-group"), v = g == null ? void 0 : g.getAttribute("data-layer-id"), b = v ? P(t, "data-layer-row", v) : null;
2155
+ b && (r.preventDefault(), j(t, b));
2156
+ }
2157
+ return;
2158
+ }
2159
+ const d = i.getAttribute("data-feat-layer"), u = d ? P(t, "data-layer-row", d) : null;
2160
+ u && (r.preventDefault(), j(t, u));
2124
2161
  break;
2125
2162
  }
2126
2163
  case "Enter":
2127
2164
  case " ":
2128
- t.preventDefault(), Dr(i, t);
2165
+ r.preventDefault(), qt(i, r);
2129
2166
  break;
2130
2167
  }
2131
2168
  }
2132
- function Rr(e, r, a, t, i) {
2133
- i.add(r, "keydown", (o) => {
2134
- o.key === "Escape" && Pr(e, a, o);
2135
- }), i.add(t, "keydown", (o) => Tr(e, t, a, o)), i.add(t, "focusin", (o) => {
2169
+ function Tt(e, t, a, r, i) {
2170
+ i.add(t, "keydown", (o) => {
2171
+ o.key === "Escape" && Pt(e, a, o);
2172
+ }), i.add(r, "keydown", (o) => Dt(e, r, a, o)), i.add(r, "focusin", (o) => {
2136
2173
  const n = o.composedPath()[0];
2137
- n instanceof HTMLElement && n.matches(Y) && (t.querySelectorAll(Y).forEach((l) => l.setAttribute("tabindex", "-1")), n.setAttribute("tabindex", "0"));
2174
+ n instanceof HTMLElement && n.matches(Q) && (r.querySelectorAll(Q).forEach((s) => s.setAttribute("tabindex", "-1")), n.setAttribute("tabindex", "0"));
2138
2175
  });
2139
2176
  }
2140
- function Or(e, r, a, t, i) {
2141
- const o = We(e.camadas, e.feicoes, e.expandedLayers, e.searchQuery), n = !t && !o.includes(r) && e.feicoes.some((c) => c.id === r), l = ja(
2142
- n ? [...o, r] : o,
2177
+ function Rt(e, t, a, r, i) {
2178
+ const o = aa(
2179
+ e.camadas,
2180
+ e.feicoes,
2181
+ e.expandedLayers,
2182
+ e.searchQuery,
2183
+ void 0,
2184
+ e.expandedFeatureLimits
2185
+ ), n = !r && !o.includes(t) && e.feicoes.some((c) => c.id === t), s = Ha(
2186
+ n ? [...o, t] : o,
2143
2187
  e.selectedFeatureIds,
2144
2188
  e.lastClickedFeatureId,
2145
- r,
2189
+ t,
2146
2190
  a,
2147
- t
2191
+ r
2148
2192
  );
2149
- l && (e.selectedFeatureIds = l.selecionados, e.lastClickedFeatureId = l.ultimoClicadoId, e.sincronizarSelecaoDOM(), i && e.notificarMudancaSelecao());
2193
+ s && (e.selectedFeatureIds = s.selecionados, e.lastClickedFeatureId = s.ultimoClicadoId, e.sincronizarSelecaoDOM(), i && e.notificarMudancaSelecao());
2150
2194
  }
2151
- function jr(e, r, a) {
2152
- const t = r || [];
2153
- t.length === e.selectedFeatureIds.size && t.every((n) => e.selectedFeatureIds.has(n)) || (e.selectedFeatureIds.clear(), t.forEach((n) => e.selectedFeatureIds.add(n)), e.lastClickedFeatureId = t.length > 0 ? t[t.length - 1] : null, e.sincronizarSelecaoDOM(), a && e.notificarMudancaSelecao());
2195
+ function Ot(e, t, a) {
2196
+ const r = t || [];
2197
+ r.length === e.selectedFeatureIds.size && r.every((n) => e.selectedFeatureIds.has(n)) || (e.selectedFeatureIds.clear(), r.forEach((n) => e.selectedFeatureIds.add(n)), e.lastClickedFeatureId = r.length > 0 ? r[r.length - 1] : null, e.sincronizarSelecaoDOM(), a && e.notificarMudancaSelecao());
2154
2198
  }
2155
- function Nr(e, r) {
2156
- e.selectedFeatureIds.size !== 0 && (e.selectedFeatureIds.clear(), e.lastClickedFeatureId = null, e.sincronizarSelecaoDOM(), r && e.notificarMudancaSelecao());
2199
+ function jt(e, t) {
2200
+ e.selectedFeatureIds.size !== 0 && (e.selectedFeatureIds.clear(), e.lastClickedFeatureId = null, e.sincronizarSelecaoDOM(), t && e.notificarMudancaSelecao());
2157
2201
  }
2158
- function Hr(e) {
2159
- const r = e.feicoes.filter((a) => e.selectedFeatureIds.has(a.id));
2202
+ function Nt(e) {
2203
+ const t = e.feicoes.filter((a) => e.selectedFeatureIds.has(a.id));
2160
2204
  e.dispararEvento("ui-feicoes-selecionadas", {
2161
2205
  feicoesIds: Array.from(e.selectedFeatureIds),
2162
- feicoes: r
2163
- }), r.length === 1 ? e.dispararEvento("ui-feicao-selecionada", { feicaoId: r[0].id, feicao: r[0] }) : r.length === 0 && e.dispararEvento("ui-feicao-selecionada", { feicaoId: null, feicao: null });
2206
+ feicoes: t
2207
+ }), t.length === 1 ? e.dispararEvento("ui-feicao-selecionada", { feicaoId: t[0].id, feicao: t[0] }) : t.length === 0 && e.dispararEvento("ui-feicao-selecionada", { feicaoId: null, feicao: null });
2164
2208
  }
2165
- class Gr {
2166
- constructor(r) {
2209
+ class Ht {
2210
+ constructor(t) {
2167
2211
  A(this, "origens", /* @__PURE__ */ new Map());
2168
2212
  A(this, "removidas", /* @__PURE__ */ new Set());
2169
- A(this, "salvarComDebounce", Re(() => this.salvar(), 200));
2170
- this.instantaneo = r;
2213
+ A(this, "salvarComDebounce", je(() => this.salvar(), 200));
2214
+ this.instantaneo = t;
2171
2215
  }
2172
2216
  chaveAtual() {
2173
- const r = this.instantaneo();
2174
- return Wa(r.storageKey, r.id);
2217
+ const t = this.instantaneo();
2218
+ return Xa(t.storageKey, t.id);
2175
2219
  }
2176
2220
  carregar() {
2177
2221
  return he(this.chaveAtual());
@@ -2181,170 +2225,174 @@ class Gr {
2181
2225
  this.salvarComDebounce();
2182
2226
  }
2183
2227
  salvar() {
2184
- const r = this.instantaneo();
2185
- if (!r.persistir || !r.conectado) return;
2186
- const a = this.chaveAtual(), t = rr({
2228
+ const t = this.instantaneo();
2229
+ if (!t.persistir || !t.conectado) return;
2230
+ const a = this.chaveAtual(), r = at({
2187
2231
  estadoAnterior: he(a),
2188
2232
  origensCamadas: this.origens,
2189
- camadas: r.camadas,
2190
- expandedLayers: r.expandedLayers,
2191
- camadaAtivaId: r.camadaAtivaId,
2192
- painelColapsado: r.painelColapsado,
2193
- mapaBaseAtivo: r.mapaBaseAtivo,
2194
- densidade: r.densidade,
2195
- altura: r.altura,
2233
+ camadas: t.camadas,
2234
+ expandedLayers: t.expandedLayers,
2235
+ camadaAtivaId: t.camadaAtivaId,
2236
+ painelColapsado: t.painelColapsado,
2237
+ mapaBaseAtivo: t.mapaBaseAtivo,
2238
+ densidade: t.densidade,
2239
+ altura: t.altura,
2196
2240
  camadasRemovidas: this.removidas
2197
2241
  });
2198
- this.removidas.clear(), Za(a, t);
2242
+ this.removidas.clear(), Ja(a, r);
2199
2243
  }
2200
2244
  limpar() {
2201
- er(this.chaveAtual());
2245
+ Za(this.chaveAtual());
2202
2246
  }
2203
2247
  // --- Origens (como a camada chegou do consumidor) e remoções ---
2204
2248
  limparOrigens() {
2205
2249
  this.origens.clear();
2206
2250
  }
2207
- registrarOrigem(r) {
2208
- this.origens.set(r.id, Je(r));
2251
+ registrarOrigem(t) {
2252
+ this.origens.set(t.id, ta(t));
2209
2253
  }
2210
- esquecerCamada(r) {
2211
- this.origens.delete(r), this.removidas.add(r);
2254
+ esquecerCamada(t) {
2255
+ this.origens.delete(t), this.removidas.add(t);
2212
2256
  }
2213
2257
  /** Aplica por cima de `camadas` o que foi lembrado (expansão, visibilidade, travas, opacidade, cor, ordem). */
2214
- reidratar(r, a, t) {
2215
- ar(r, a, t, this.origens);
2258
+ reidratar(t, a, r) {
2259
+ et(t, a, r, this.origens);
2216
2260
  }
2217
2261
  }
2218
- function Ee(e, r = null, a = /* @__PURE__ */ new Set()) {
2219
- const t = [];
2220
- if (!Array.isArray(e)) return t;
2262
+ function Ee(e, t = null, a = /* @__PURE__ */ new Set()) {
2263
+ const r = [];
2264
+ if (!Array.isArray(e)) return r;
2221
2265
  for (const i of e) {
2222
2266
  if (!i || typeof i != "object" || !i.id) continue;
2223
2267
  const o = String(i.id);
2224
2268
  if (a.has(o)) continue;
2225
2269
  a.add(o);
2226
2270
  const n = { ...i, id: o };
2227
- delete n.children, r && n.parentId === void 0 && (n.parentId = r), t.push(n), Array.isArray(i.children) && i.children.length > 0 && t.push(...Ee(i.children, o, a));
2271
+ delete n.children, t && n.parentId === void 0 && (n.parentId = t), r.push(n), Array.isArray(i.children) && i.children.length > 0 && r.push(...Ee(i.children, o, a));
2228
2272
  }
2229
- return t;
2273
+ return r;
2230
2274
  }
2231
- function na(e) {
2232
- const r = e.lastClickedFeatureId;
2233
- r && !e.feicoes.some((a) => a.id === r) && (e.lastClickedFeatureId = null);
2275
+ function da(e) {
2276
+ const t = e.lastClickedFeatureId;
2277
+ t && !e.feicoes.some((a) => a.id === t) && (e.lastClickedFeatureId = null);
2234
2278
  }
2235
- function sa(e) {
2279
+ function ua(e) {
2236
2280
  if (!Array.isArray(e)) return [];
2237
- const r = /* @__PURE__ */ new Set(), a = [];
2238
- for (const t of e) {
2239
- if (!t || typeof t != "object" || !t.id) continue;
2240
- const i = String(t.id);
2241
- r.has(i) || (r.add(i), a.push({ ...t, id: i }));
2281
+ const t = /* @__PURE__ */ new Set(), a = [];
2282
+ for (const r of e) {
2283
+ if (!r || typeof r != "object" || !r.id) continue;
2284
+ const i = String(r.id);
2285
+ t.has(i) || (t.add(i), a.push({ ...r, id: i }));
2242
2286
  }
2243
2287
  return a;
2244
2288
  }
2245
- function _r(e, r, a) {
2246
- if (e.camadas = Array.isArray(r) ? Ee(r) : [], e.lembranca.limparOrigens(), e.persistir) {
2247
- const i = e.lembranca.carregar();
2248
- e.lembranca.reidratar(e.camadas, i, e.expandedLayers), i != null && i.camadaAtivaId && e.camadas.some((o) => o.id === i.camadaAtivaId) && (e.camadaAtivaId = i.camadaAtivaId);
2289
+ function Gt(e, t, a) {
2290
+ if (e.camadas = Array.isArray(t) ? Ee(t) : [], e.lembranca.limparOrigens(), e.persistir) {
2291
+ const o = e.lembranca.carregar();
2292
+ e.lembranca.reidratar(e.camadas, o, e.expandedLayers), o != null && o.camadaAtivaId && e.camadas.some((n) => n.id === o.camadaAtivaId) && (e.camadaAtivaId = o.camadaAtivaId);
2249
2293
  } else
2250
- e.camadas.forEach((i) => {
2251
- e.lembranca.registrarOrigem(i), e.expandedLayers.has(i.id) || e.expandedLayers.add(i.id);
2294
+ e.camadas.forEach((o) => {
2295
+ e.lembranca.registrarOrigem(o), e.expandedLayers.has(o.id) || e.expandedLayers.add(o.id);
2252
2296
  });
2253
2297
  if (Array.isArray(a)) {
2254
- e.feicoes = sa(a);
2255
- const i = new Set(e.camadas.map((n) => n.id)), o = e.feicoes.filter((n) => n.layerId && !i.has(n.layerId));
2256
- o.length > 0 && console.warn(
2257
- `[UI-Camadas] ${o.length} feição(ões) possuem 'layerId' não cadastrado nas camadas:`,
2258
- o.map((n) => ({ id: n.id, nome: n.name, layerId: n.layerId }))
2259
- ), Ae(e.selectedFeatureIds, e.feicoes), na(e);
2260
- }
2261
- const t = e.getAttribute("camada-ativa");
2262
- e.camadas.length > 0 && (!t || !e.camadas.some((i) => i.id === t)) && (e.camadaAtivaId = e.camadas[0].id), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
2263
- }
2264
- function Ur(e, r) {
2265
- const a = new Map(e.map((i) => [i.id, i])), t = /* @__PURE__ */ new Set();
2266
- for (const i of r) {
2298
+ e.feicoes = ua(a);
2299
+ const o = new Set(e.camadas.map((s) => s.id)), n = e.feicoes.filter((s) => s.layerId && !o.has(s.layerId));
2300
+ n.length > 0 && console.warn(
2301
+ `[UI-Camadas] ${n.length} feição(ões) possuem 'layerId' não cadastrado nas camadas:`,
2302
+ n.map((s) => ({ id: s.id, nome: s.name, layerId: s.layerId }))
2303
+ ), Ae(e.selectedFeatureIds, e.feicoes), da(e);
2304
+ }
2305
+ const r = new Set(e.camadas.map((o) => o.id));
2306
+ if (e.activeSettingsLayerId && !r.has(e.activeSettingsLayerId) && (e.activeSettingsLayerId = null), e.editingLayerId && !r.has(e.editingLayerId) && (e.editingLayerId = null), e.expandedFeatureLimits)
2307
+ for (const o of e.expandedFeatureLimits.keys())
2308
+ r.has(o) || e.expandedFeatureLimits.delete(o);
2309
+ const i = e.getAttribute("camada-ativa");
2310
+ e.camadas.length > 0 && (!i || !r.has(i)) && (e.camadaAtivaId = e.camadas[0].id), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
2311
+ }
2312
+ function _t(e, t) {
2313
+ const a = new Map(e.map((i) => [i.id, i])), r = /* @__PURE__ */ new Set();
2314
+ for (const i of t) {
2267
2315
  const o = a.get(i.id);
2268
- (!o || !Oa(o, i)) && t.add(i.id);
2316
+ (!o || !Na(o, i)) && r.add(i.id);
2269
2317
  }
2270
- return t;
2318
+ return r;
2271
2319
  }
2272
- function Vr(e, r) {
2320
+ function Ut(e, t) {
2273
2321
  const a = e.feicoes;
2274
- e.feicoes = sa(r);
2275
- const t = e.selectedFeatureIds.size;
2276
- Ae(e.selectedFeatureIds, e.feicoes), na(e), e.solicitarAtualizacaoFeicoes({
2322
+ e.feicoes = ua(t);
2323
+ const r = e.selectedFeatureIds.size;
2324
+ Ae(e.selectedFeatureIds, e.feicoes), da(e), e.editingFeatureId && !e.feicoes.some((i) => i.id === e.editingFeatureId) && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
2277
2325
  camadas: "todas",
2278
- idsAlterados: Ur(a, e.feicoes),
2279
- selecaoAfetada: e.selectedFeatureIds.size !== t
2326
+ idsAlterados: _t(a, e.feicoes),
2327
+ selecaoAfetada: e.selectedFeatureIds.size !== r
2280
2328
  });
2281
2329
  }
2282
- function Yr(e, r) {
2283
- if (!r || !r.id) return;
2284
- if (e.camadas.some((t) => t.id === r.id)) {
2285
- console.warn(`[UI-Camadas] adicionarCamada ignorado: já existe uma camada com id '${r.id}'.`);
2330
+ function Vt(e, t) {
2331
+ if (!t || !t.id) return;
2332
+ if (e.camadas.some((r) => r.id === t.id)) {
2333
+ console.warn(`[UI-Camadas] adicionarCamada ignorado: já existe uma camada com id '${t.id}'.`);
2286
2334
  return;
2287
2335
  }
2288
- const a = new Set(e.camadas.map((t) => t.id));
2289
- for (const t of Ee([r])) {
2290
- if (a.has(t.id)) {
2291
- console.warn(`[UI-Camadas] adicionarCamada: subcamada '${t.id}' ignorada, o id já existe.`);
2336
+ const a = new Set(e.camadas.map((r) => r.id));
2337
+ for (const r of Ee([t])) {
2338
+ if (a.has(r.id)) {
2339
+ console.warn(`[UI-Camadas] adicionarCamada: subcamada '${r.id}' ignorada, o id já existe.`);
2292
2340
  continue;
2293
2341
  }
2294
- a.add(t.id), e.camadas.push(t), e.lembranca.registrarOrigem(t), e.expandedLayers.add(t.id), t.parentId && e.expandedLayers.add(t.parentId);
2342
+ a.add(r.id), e.camadas.push(r), e.lembranca.registrarOrigem(r), e.expandedLayers.add(r.id), r.parentId && e.expandedLayers.add(r.parentId);
2295
2343
  }
2296
2344
  e.salvarLembrancaEstado(), e.solicitarRenderizacao();
2297
2345
  }
2298
- function Kr(e, r) {
2299
- var a;
2300
- e.camadas.forEach((t) => {
2301
- t.parentId === r && (t.parentId = null);
2302
- }), e.camadas = e.camadas.filter((t) => t.id !== r), e.feicoes = e.feicoes.filter((t) => t.layerId !== r), e.lembranca.esquecerCamada(r), e.expandedLayers.delete(r), e.activeSettingsLayerId === r && (e.activeSettingsLayerId = null), Ae(e.selectedFeatureIds, e.feicoes), e.selectedFeatureIds.size === 0 && (e.lastClickedFeatureId = null), e.camadaAtivaId === r && (e.camadaAtivaId = ((a = e.camadas[0]) == null ? void 0 : a.id) ?? null), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
2303
- }
2304
- function Qr(e, r) {
2305
- if (!(!r || !r.id)) {
2306
- if (e.feicoes.some((a) => a.id === r.id)) {
2307
- console.warn(`[UI-Camadas] adicionarFeicao ignorado: já existe uma feição com id '${r.id}'.`);
2346
+ function Yt(e, t) {
2347
+ var a, r;
2348
+ e.camadas.forEach((i) => {
2349
+ i.parentId === t && (i.parentId = null);
2350
+ }), e.camadas = e.camadas.filter((i) => i.id !== t), e.feicoes = e.feicoes.filter((i) => i.layerId !== t), e.lembranca.esquecerCamada(t), e.expandedLayers.delete(t), (a = e.expandedFeatureLimits) == null || a.delete(t), e.activeSettingsLayerId === t && (e.activeSettingsLayerId = null), e.editingLayerId === t && (e.editingLayerId = null), e.editingFeatureId && !e.feicoes.some((i) => i.id === e.editingFeatureId) && (e.editingFeatureId = null), Ae(e.selectedFeatureIds, e.feicoes), e.selectedFeatureIds.size === 0 && (e.lastClickedFeatureId = null), e.camadaAtivaId === t && (e.camadaAtivaId = ((r = e.camadas[0]) == null ? void 0 : r.id) ?? null), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
2351
+ }
2352
+ function Kt(e, t) {
2353
+ if (!(!t || !t.id)) {
2354
+ if (e.feicoes.some((a) => a.id === t.id)) {
2355
+ console.warn(`[UI-Camadas] adicionarFeicao ignorado: já existe uma feição com id '${t.id}'.`);
2308
2356
  return;
2309
2357
  }
2310
- e.feicoes.push({ ...r }), e.solicitarAtualizacaoFeicoes({
2311
- camadas: /* @__PURE__ */ new Set([r.layerId || ""]),
2358
+ e.feicoes.push({ ...t }), e.solicitarAtualizacaoFeicoes({
2359
+ camadas: /* @__PURE__ */ new Set([t.layerId || ""]),
2312
2360
  idsAlterados: /* @__PURE__ */ new Set(),
2313
- selecaoAfetada: e.selectedFeatureIds.has(r.id)
2361
+ selecaoAfetada: e.selectedFeatureIds.has(t.id)
2314
2362
  });
2315
2363
  }
2316
2364
  }
2317
- function Xr(e, r) {
2318
- if (!r || typeof r != "object" || !r.id) return;
2319
- const a = e.feicoes.findIndex((t) => t.id === r.id);
2365
+ function Qt(e, t) {
2366
+ if (!t || typeof t != "object" || !t.id) return;
2367
+ const a = e.feicoes.findIndex((r) => r.id === t.id);
2320
2368
  if (a !== -1) {
2321
- const t = e.feicoes[a].layerId || "";
2322
- e.feicoes[a] = { ...e.feicoes[a], ...r }, e.solicitarAtualizacaoFeicoes({
2323
- camadas: /* @__PURE__ */ new Set([t, e.feicoes[a].layerId || ""]),
2324
- idsAlterados: /* @__PURE__ */ new Set([r.id]),
2369
+ const r = e.feicoes[a].layerId || "";
2370
+ e.feicoes[a] = { ...e.feicoes[a], ...t }, e.solicitarAtualizacaoFeicoes({
2371
+ camadas: /* @__PURE__ */ new Set([r, e.feicoes[a].layerId || ""]),
2372
+ idsAlterados: /* @__PURE__ */ new Set([t.id]),
2325
2373
  selecaoAfetada: !1
2326
2374
  });
2327
2375
  }
2328
2376
  }
2329
- function Wr(e, r) {
2330
- const a = e.feicoes.find((i) => i.id === r);
2331
- e.feicoes = e.feicoes.filter((i) => i.id !== r);
2332
- const t = e.selectedFeatureIds.delete(r);
2333
- e.lastClickedFeatureId === r && (e.lastClickedFeatureId = null), e.solicitarAtualizacaoFeicoes({
2377
+ function Xt(e, t) {
2378
+ const a = e.feicoes.find((i) => i.id === t);
2379
+ e.feicoes = e.feicoes.filter((i) => i.id !== t);
2380
+ const r = e.selectedFeatureIds.delete(t);
2381
+ e.lastClickedFeatureId === t && (e.lastClickedFeatureId = null), e.editingFeatureId === t && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
2334
2382
  camadas: new Set(a ? [a.layerId || ""] : []),
2335
2383
  idsAlterados: /* @__PURE__ */ new Set(),
2336
- selecaoAfetada: t
2384
+ selecaoAfetada: r
2337
2385
  });
2338
2386
  }
2339
- function Jr(e) {
2340
- function t() {
2387
+ function Wt(e) {
2388
+ function r() {
2341
2389
  return e.getMinAltura ? e.getMinAltura() : 140;
2342
2390
  }
2343
2391
  function i() {
2344
2392
  return e.getMaxAltura ? e.getMaxAltura() : 1600;
2345
2393
  }
2346
- function o(s, p = !1) {
2347
- if (s == null || s === "") {
2394
+ function o(l, p = !1) {
2395
+ if (l == null || l === "") {
2348
2396
  e.hostElement.style.removeProperty("height"), e.hostElement.style.removeProperty("--ui-camadas-altura"), p && e.hostElement.dispatchEvent(
2349
2397
  new CustomEvent("ui-redimensionar-altura", {
2350
2398
  bubbles: !0,
@@ -2354,79 +2402,79 @@ function Jr(e) {
2354
2402
  );
2355
2403
  return;
2356
2404
  }
2357
- const u = typeof s == "number" ? s : parseFloat(String(s));
2358
- if (isNaN(u)) return;
2359
- const d = Math.max(t(), Math.min(i(), Math.round(u)));
2360
- e.hostElement.style.height = `${d}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${d}px`), p && e.hostElement.dispatchEvent(
2405
+ const d = typeof l == "number" ? l : parseFloat(String(l));
2406
+ if (isNaN(d)) return;
2407
+ const u = Math.max(r(), Math.min(i(), Math.round(d)));
2408
+ e.hostElement.style.height = `${u}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${u}px`), p && e.hostElement.dispatchEvent(
2361
2409
  new CustomEvent("ui-redimensionar-altura", {
2362
2410
  bubbles: !0,
2363
2411
  composed: !0,
2364
- detail: { altura: d }
2412
+ detail: { altura: u }
2365
2413
  })
2366
2414
  );
2367
2415
  }
2368
2416
  let n = null;
2369
- function l() {
2417
+ function s() {
2370
2418
  if (!e.resizerElement) return;
2371
- let s = !1, p = 0, u = 0;
2372
- const d = (f) => {
2373
- if (f.button !== 0) return;
2374
- f.preventDefault(), f.stopPropagation(), s = !0, p = f.clientY, u = e.hostElement.getBoundingClientRect().height, e.resizerElement.classList.add("ui-camadas-resizer--ativo"), e.hostElement.classList.add("ui-camadas--redimensionando");
2419
+ let l = !1, p = 0, d = 0;
2420
+ const u = (m) => {
2421
+ if (m.button !== 0) return;
2422
+ m.preventDefault(), m.stopPropagation(), l = !0, p = m.clientY, d = e.hostElement.getBoundingClientRect().height, e.resizerElement.classList.add("ui-camadas-resizer--ativo"), e.hostElement.classList.add("ui-camadas--redimensionando");
2375
2423
  try {
2376
- e.resizerElement.setPointerCapture(f.pointerId);
2424
+ e.resizerElement.setPointerCapture(m.pointerId);
2377
2425
  } catch {
2378
2426
  }
2379
- const g = (k) => {
2380
- if (!s) return;
2381
- k.preventDefault();
2382
- const M = k.clientY - p, S = Math.max(t(), Math.min(i(), Math.round(u + M)));
2383
- e.hostElement.style.height = `${S}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${S}px`), e.onRedimensionando && e.onRedimensionando(S), e.hostElement.dispatchEvent(
2427
+ const g = (E) => {
2428
+ if (!l) return;
2429
+ E.preventDefault();
2430
+ const L = E.clientY - p, $ = Math.max(r(), Math.min(i(), Math.round(d + L)));
2431
+ e.hostElement.style.height = `${$}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${$}px`), e.onRedimensionando && e.onRedimensionando($), e.hostElement.dispatchEvent(
2384
2432
  new CustomEvent("ui-redimensionando-altura", {
2385
2433
  bubbles: !0,
2386
2434
  composed: !0,
2387
- detail: { altura: S }
2435
+ detail: { altura: $ }
2388
2436
  })
2389
2437
  );
2390
2438
  }, v = () => {
2391
- var k;
2392
- s = !1, n = null, window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y), (k = e.resizerElement) == null || k.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
2393
- }, y = (k) => {
2394
- if (!s) return;
2395
- s = !1, e.resizerElement.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
2439
+ var E;
2440
+ l = !1, n = null, window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", b), window.removeEventListener("pointercancel", b), (E = e.resizerElement) == null || E.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
2441
+ }, b = (E) => {
2442
+ if (!l) return;
2443
+ l = !1, e.resizerElement.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
2396
2444
  try {
2397
- e.resizerElement.hasPointerCapture(k.pointerId) && e.resizerElement.releasePointerCapture(k.pointerId);
2445
+ e.resizerElement.hasPointerCapture(E.pointerId) && e.resizerElement.releasePointerCapture(E.pointerId);
2398
2446
  } catch {
2399
2447
  }
2400
- window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y);
2401
- const M = e.hostElement.getBoundingClientRect().height, S = Math.round(M);
2402
- e.onAlturaAlterada && e.onAlturaAlterada(S), e.hostElement.dispatchEvent(
2448
+ window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", b), window.removeEventListener("pointercancel", b);
2449
+ const L = e.hostElement.getBoundingClientRect().height, $ = Math.round(L);
2450
+ e.onAlturaAlterada && e.onAlturaAlterada($), e.hostElement.dispatchEvent(
2403
2451
  new CustomEvent("ui-redimensionar-altura", {
2404
2452
  bubbles: !0,
2405
2453
  composed: !0,
2406
- detail: { altura: S }
2454
+ detail: { altura: $ }
2407
2455
  })
2408
2456
  );
2409
2457
  };
2410
- n = v, window.addEventListener("pointermove", g), window.addEventListener("pointerup", y), window.addEventListener("pointercancel", y);
2411
- }, m = (f) => {
2412
- f.preventDefault(), f.stopPropagation(), o(null, !0), e.onAlturaAlterada && e.onAlturaAlterada(null);
2458
+ n = v, window.addEventListener("pointermove", g), window.addEventListener("pointerup", b), window.addEventListener("pointercancel", b);
2459
+ }, f = (m) => {
2460
+ m.preventDefault(), m.stopPropagation(), o(null, !0), e.onAlturaAlterada && e.onAlturaAlterada(null);
2413
2461
  };
2414
- e.listeners.add(e.resizerElement, "pointerdown", d), e.listeners.add(e.resizerElement, "dblclick", m);
2462
+ e.listeners.add(e.resizerElement, "pointerdown", u), e.listeners.add(e.resizerElement, "dblclick", f);
2415
2463
  }
2416
2464
  function c() {
2417
2465
  n == null || n(), e.listeners.cleanup();
2418
2466
  }
2419
2467
  return {
2420
- init: l,
2468
+ init: s,
2421
2469
  definirAltura: o,
2422
2470
  destruir: c
2423
2471
  };
2424
2472
  }
2425
- const N = class N extends Aa {
2473
+ const H = class H extends La {
2426
2474
  constructor() {
2427
2475
  super();
2428
2476
  A(this, "shadow");
2429
- A(this, "listeners", new Ia());
2477
+ A(this, "listeners", new $a());
2430
2478
  A(this, "dragDropManager");
2431
2479
  A(this, "resizerController");
2432
2480
  A(this, "alturaCustomizada", null);
@@ -2436,7 +2484,7 @@ const N = class N extends Aa {
2436
2484
  /** Mudança de feições à espera do `render()` (consumida nele): permite atualizar só as linhas afetadas. */
2437
2485
  A(this, "mudancaFeicoes", null);
2438
2486
  /** @internal */
2439
- A(this, "lembranca", new Gr(() => ({
2487
+ A(this, "lembranca", new Ht(() => ({
2440
2488
  persistir: this.persistir,
2441
2489
  conectado: this.conectado,
2442
2490
  storageKey: this.storageKey,
@@ -2452,7 +2500,7 @@ const N = class N extends Aa {
2452
2500
  // Estado interno
2453
2501
  A(this, "camadas", []);
2454
2502
  A(this, "feicoes", []);
2455
- A(this, "mapasBase", [...Oe]);
2503
+ A(this, "mapasBase", [...Ne]);
2456
2504
  A(this, "expandedLayers", /* @__PURE__ */ new Set());
2457
2505
  A(this, "expandedFeatureLimits", /* @__PURE__ */ new Map());
2458
2506
  A(this, "selectedFeatureIds", /* @__PURE__ */ new Set());
@@ -2464,7 +2512,7 @@ const N = class N extends Aa {
2464
2512
  A(this, "corpoElement");
2465
2513
  A(this, "btnExpandirFlutuante");
2466
2514
  this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
2467
- <style>${tr}</style>
2515
+ <style>${tt}</style>
2468
2516
  <div class="ui-camadas-container" id="panel-container" part="base" role="region" aria-label="Painel de Camadas">
2469
2517
  <div class="ui-camadas-corpo" id="painel-corpo" part="corpo"></div>
2470
2518
  <div class="ui-camadas-resizer-altura" id="resizer-altura" part="resizer" title="Arraste para redimensionar a altura (duplo-clique para resetar)" aria-label="Redimensionar altura">
@@ -2472,24 +2520,24 @@ const N = class N extends Aa {
2472
2520
  </div>
2473
2521
  </div>
2474
2522
  <button class="ui-camadas-toggle-flutuante" id="btn-expandir-flutuante" part="botao-expandir" title="Expandir Painel de Camadas" aria-label="Expandir Painel de Camadas">
2475
- ${b.camadas}
2523
+ ${y.camadas}
2476
2524
  </button>
2477
- `, this.corpoElement = this.shadow.getElementById("painel-corpo"), this.btnExpandirFlutuante = this.shadow.getElementById("btn-expandir-flutuante"), this.dragDropManager = new Qa(this, this.shadow);
2525
+ `, this.corpoElement = this.shadow.getElementById("painel-corpo"), this.btnExpandirFlutuante = this.shadow.getElementById("btn-expandir-flutuante"), this.dragDropManager = new Ka(this, this.shadow);
2478
2526
  const a = this.shadow.getElementById("resizer-altura");
2479
- this.resizerController = Jr({
2527
+ this.resizerController = Wt({
2480
2528
  hostElement: this,
2481
2529
  resizerElement: a,
2482
2530
  listeners: this.listeners,
2483
2531
  getMinAltura: () => {
2484
- const t = this.getAttribute("min-altura");
2485
- return t && parseFloat(t) || 140;
2532
+ const r = this.getAttribute("min-altura");
2533
+ return r && parseFloat(r) || 140;
2486
2534
  },
2487
2535
  getMaxAltura: () => {
2488
- const t = this.getAttribute("max-altura");
2489
- return t && parseFloat(t) || 1600;
2536
+ const r = this.getAttribute("max-altura");
2537
+ return r && parseFloat(r) || 1600;
2490
2538
  },
2491
- onAlturaAlterada: (t) => {
2492
- this.alturaCustomizada = t, this.salvarLembrancaEstado();
2539
+ onAlturaAlterada: (r) => {
2540
+ this.alturaCustomizada = r, this.salvarLembrancaEstado();
2493
2541
  }
2494
2542
  });
2495
2543
  }
@@ -2514,7 +2562,7 @@ const N = class N extends Aa {
2514
2562
  "altura",
2515
2563
  "min-altura",
2516
2564
  "max-altura",
2517
- ...Ea
2565
+ ...Ca
2518
2566
  ];
2519
2567
  }
2520
2568
  connectedCallback() {
@@ -2522,18 +2570,18 @@ const N = class N extends Aa {
2522
2570
  const a = he(this.obterChaveStorageAtual());
2523
2571
  a && (a.painelColapsado === !0 && !this.hasAttribute("colapsado") && (this.colapsado = !0), a.camadaAtivaId && !this.getAttribute("camada-ativa") && (this.camadaAtivaId = a.camadaAtivaId), a.mapaBaseAtivo && !this.getAttribute("mapa-base-ativo") && (this.mapaBaseAtivo = a.mapaBaseAtivo), a.densidade && !this.getAttribute("densidade") && (this.densidade = a.densidade), typeof a.altura == "number" && !this.getAttribute("altura") && !this.style.height && (this.resizerController.definirAltura(a.altura, !1), this.alturaCustomizada = a.altura));
2524
2572
  }
2525
- this.hasAttribute("altura") && this.resizerController.definirAltura(this.getAttribute("altura"), !1), this.persistir && !this.storageKey && !this.id && (N.instanciasChavePadrao.size > 0 && console.warn(
2573
+ this.hasAttribute("altura") && this.resizerController.definirAltura(this.getAttribute("altura"), !1), this.persistir && !this.storageKey && !this.id && (H.instanciasChavePadrao.size > 0 && console.warn(
2526
2574
  "[UI-Camadas] Mais de um painel sem 'id' nem 'storage-key' divide a mesma chave de persistência e um sobrescreve o estado do outro. Defina 'storage-key' (ou 'id') em cada um."
2527
- ), N.instanciasChavePadrao.add(this)), this.resizerController.init(), Se(this, this.shadow.getElementById("panel-container")), this.render(), this.conectarEventosGerais(), Rr(this, this, this.shadow, this.corpoElement, this.listeners), this.conectado = !0, this.camadas.length > 0 && this.salvarLembrancaEstado();
2575
+ ), H.instanciasChavePadrao.add(this)), this.resizerController.init(), Se(this, this.shadow.getElementById("panel-container")), this.render(), this.conectarEventosGerais(), Tt(this, this, this.shadow, this.corpoElement, this.listeners), this.conectado = !0, this.camadas.length > 0 && this.salvarLembrancaEstado();
2528
2576
  }
2529
2577
  disconnectedCallback() {
2530
- var a, t;
2531
- this.conectado = !1, N.instanciasChavePadrao.delete(this), (a = this.resizerController) == null || a.destruir(), (t = this.dragDropManager) == null || t.destruir(), fr(this), this.listeners.cleanup();
2578
+ var a, r;
2579
+ this.conectado = !1, H.instanciasChavePadrao.delete(this), (a = this.resizerController) == null || a.destruir(), (r = this.dragDropManager) == null || r.destruir(), pt(this), this.listeners.cleanup();
2532
2580
  }
2533
- attributeChangedCallback(a, t, i) {
2581
+ attributeChangedCallback(a, r, i) {
2534
2582
  var o, n;
2535
- if (t !== i) {
2536
- if (ka(a)) {
2583
+ if (r !== i) {
2584
+ if (Sa(a)) {
2537
2585
  Se(this, this.shadow.getElementById("panel-container"));
2538
2586
  return;
2539
2587
  }
@@ -2560,16 +2608,16 @@ const N = class N extends Aa {
2560
2608
  set mapaBaseAtivo(a) {
2561
2609
  this.setAttribute("mapa-base-ativo", a);
2562
2610
  }
2563
- selecionarMapaBase(a, t = !1) {
2564
- !a || this.mapaBaseAtivo === a || (this.mapaBaseAtivo = a, this.marcarMapaBaseAtivoNoDOM(a), this.salvarLembrancaEstado(), t && this.dispararEvento("ui-mapa-base-alterado", { mapaBaseId: a }));
2611
+ selecionarMapaBase(a, r = !1) {
2612
+ !a || this.mapaBaseAtivo === a || (this.mapaBaseAtivo = a, this.marcarMapaBaseAtivoNoDOM(a), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-mapa-base-alterado", { mapaBaseId: a }));
2565
2613
  }
2566
2614
  marcarMapaBaseAtivoNoDOM(a) {
2567
2615
  this.shadow.querySelectorAll("[data-basemap-id]").forEach((i) => {
2568
2616
  const o = i.getAttribute("data-basemap-id") === a;
2569
2617
  i.classList.toggle("active", o), i.setAttribute("aria-pressed", String(o));
2570
2618
  });
2571
- const t = this.shadow.querySelector("[data-basemap-atual]");
2572
- t && (t.textContent = je(this.mapasBase, a));
2619
+ const r = this.shadow.querySelector("[data-basemap-atual]");
2620
+ r && (r.textContent = He(this.mapasBase, a));
2573
2621
  }
2574
2622
  /** Seção "Mapa Base" recolhida (só o cabeçalho com o mapa ativo). Atributo `mapas-base-recolhido`. */
2575
2623
  get mapasBaseRecolhido() {
@@ -2654,11 +2702,11 @@ const N = class N extends Aa {
2654
2702
  set altura(a) {
2655
2703
  a != null ? (this.setAttribute("altura", String(a)), this.definirAltura(a)) : (this.removeAttribute("altura"), this.definirAltura(null));
2656
2704
  }
2657
- definirAltura(a, t = !0) {
2705
+ definirAltura(a, r = !0) {
2658
2706
  var o;
2659
2707
  (o = this.resizerController) == null || o.definirAltura(a, !1);
2660
2708
  const i = a !== null ? parseFloat(String(a)) : null;
2661
- this.alturaCustomizada = isNaN(i) ? null : i, t && this.salvarLembrancaEstado();
2709
+ this.alturaCustomizada = isNaN(i) ? null : i, r && this.salvarLembrancaEstado();
2662
2710
  }
2663
2711
  // --- Gerenciamento de Persistência / Lembrança ---
2664
2712
  obterChaveStorageAtual() {
@@ -2702,56 +2750,56 @@ const N = class N extends Aa {
2702
2750
  set basemaps(a) {
2703
2751
  this.definirMapasBase(a);
2704
2752
  }
2705
- definirCamadas(a, t) {
2706
- _r(this, a, t);
2753
+ definirCamadas(a, r) {
2754
+ Gt(this, a, r);
2707
2755
  }
2708
2756
  definirFeicoes(a) {
2709
- Vr(this, a);
2757
+ Ut(this, a);
2710
2758
  }
2711
2759
  definirMapasBase(a) {
2712
2760
  this.mapasBase = Array.isArray(a) ? [...a] : [], this.solicitarRenderizacao();
2713
2761
  }
2714
- definirCamadaAtiva(a, t = !1) {
2715
- !a || this.camadaAtivaId === a || (this.camadaAtivaId = a, this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado(), t && this.dispararEvento("ui-camada-selecionada", {
2762
+ definirCamadaAtiva(a, r = !1) {
2763
+ !a || this.camadaAtivaId === a || (this.camadaAtivaId = a, this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-camada-selecionada", {
2716
2764
  camadaId: a,
2717
2765
  camada: this.camadas.find((i) => i.id === a)
2718
2766
  }));
2719
2767
  }
2720
2768
  obterCamada(a) {
2721
- return this.camadas.find((t) => t.id === a);
2769
+ return this.camadas.find((r) => r.id === a);
2722
2770
  }
2723
2771
  obterCamadaAtiva() {
2724
2772
  return this.camadas.find((a) => a.id === this.camadaAtivaId);
2725
2773
  }
2726
2774
  obterFeicao(a) {
2727
- return this.feicoes.find((t) => t.id === a);
2775
+ return this.feicoes.find((r) => r.id === a);
2728
2776
  }
2729
2777
  obterFeicoesSelecionadas() {
2730
2778
  return this.feicoes.filter((a) => this.selectedFeatureIds.has(a.id));
2731
2779
  }
2732
2780
  adicionarCamada(a) {
2733
- Yr(this, a);
2781
+ Vt(this, a);
2734
2782
  }
2735
2783
  removerCamada(a) {
2736
- Kr(this, a);
2784
+ Yt(this, a);
2737
2785
  }
2738
2786
  adicionarFeicao(a) {
2739
- Qr(this, a);
2787
+ Kt(this, a);
2740
2788
  }
2741
2789
  atualizarFeicao(a) {
2742
- Xr(this, a);
2790
+ Qt(this, a);
2743
2791
  }
2744
2792
  removerFeicao(a) {
2745
- Wr(this, a);
2793
+ Xt(this, a);
2746
2794
  }
2747
- selecionarFeicao(a, t = !1, i = !1, o = !1) {
2748
- Or(this, a, t, i, o);
2795
+ selecionarFeicao(a, r = !1, i = !1, o = !1) {
2796
+ Rt(this, a, r, i, o);
2749
2797
  }
2750
- selecionarFeicoes(a, t = !1) {
2751
- jr(this, a, t);
2798
+ selecionarFeicoes(a, r = !1) {
2799
+ Ot(this, a, r);
2752
2800
  }
2753
2801
  limparSelecao(a = !1) {
2754
- Nr(this, a);
2802
+ jt(this, a);
2755
2803
  }
2756
2804
  expandirTodas() {
2757
2805
  this.expandedLayers = new Set(this.camadas.map((a) => a.id)), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
@@ -2764,8 +2812,8 @@ const N = class N extends Aa {
2764
2812
  }
2765
2813
  incrementarLimiteFeicoes(a) {
2766
2814
  if (!a) return;
2767
- const t = this.expandedFeatureLimits.get(a) ?? 80;
2768
- this.expandedFeatureLimits.set(a, t + 80), this.solicitarRenderizacao();
2815
+ const r = this.expandedFeatureLimits.get(a) ?? 80;
2816
+ this.expandedFeatureLimits.set(a, r + 80), this.solicitarRenderizacao();
2769
2817
  }
2770
2818
  alternarVisibilidadeTodas(a = !1) {
2771
2819
  const i = !this.camadas.some((o) => o.visible !== !1);
@@ -2782,8 +2830,8 @@ const N = class N extends Aa {
2782
2830
  alternarColapso(a = !1) {
2783
2831
  this.definirColapso(!this.colapsado, a);
2784
2832
  }
2785
- definirColapso(a, t) {
2786
- this.colapsado !== a && (this.colapsado = a, t && this.dispararEvento("ui-colapso-alterado", { colapsado: a }));
2833
+ definirColapso(a, r) {
2834
+ this.colapsado !== a && (this.colapsado = a, r && this.dispararEvento("ui-colapso-alterado", { colapsado: a }));
2787
2835
  }
2788
2836
  // --- Renderização e Ciclo de Vida ---
2789
2837
  solicitarRenderizacao() {
@@ -2818,10 +2866,10 @@ const N = class N extends Aa {
2818
2866
  this.profundidadeLote--, this.profundidadeLote === 0 && this.renderPendente && (this.renderPendente = !1, this.render());
2819
2867
  }
2820
2868
  }
2821
- dispararEvento(a, t) {
2869
+ dispararEvento(a, r) {
2822
2870
  this.dispatchEvent(
2823
2871
  new CustomEvent(a, {
2824
- detail: t,
2872
+ detail: r,
2825
2873
  bubbles: !0,
2826
2874
  composed: !0
2827
2875
  })
@@ -2829,7 +2877,7 @@ const N = class N extends Aa {
2829
2877
  }
2830
2878
  render() {
2831
2879
  const a = this.mudancaFeicoes;
2832
- this.mudancaFeicoes = null, this.corpoElement && (a && Fr(this, this.shadow, this.dragDropManager, a) || Mr(this, this.shadow, this.corpoElement, this.dragDropManager));
2880
+ this.mudancaFeicoes = null, this.corpoElement && (a && Ft(this, this.shadow, this.dragDropManager, a) || $t(this, this.shadow, this.corpoElement, this.dragDropManager));
2833
2881
  }
2834
2882
  // --- Conexão de Eventos ---
2835
2883
  conectarEventosGerais() {
@@ -2837,32 +2885,32 @@ const N = class N extends Aa {
2837
2885
  }
2838
2886
  // --- Sincronização de DOM (delegada) ---
2839
2887
  sincronizarCamadaAtivaDOM() {
2840
- ir(this, this.shadow);
2888
+ rt(this, this.shadow);
2841
2889
  }
2842
2890
  sincronizarSelecaoDOM() {
2843
- or(this, this.shadow);
2891
+ it(this, this.shadow);
2844
2892
  }
2845
2893
  // --- Auxiliares Internos ---
2846
2894
  notificarMudancaSelecao() {
2847
- Hr(this);
2895
+ Nt(this);
2848
2896
  }
2849
2897
  };
2850
2898
  /** Painéis conectados sem `id` nem `storage-key`: dividem a mesma chave de persistência. */
2851
- A(N, "instanciasChavePadrao", /* @__PURE__ */ new Set());
2852
- let K = N;
2853
- class Zr extends K {
2899
+ A(H, "instanciasChavePadrao", /* @__PURE__ */ new Set());
2900
+ let X = H;
2901
+ class Jt extends X {
2854
2902
  }
2855
- class et extends K {
2903
+ class Zt extends X {
2856
2904
  }
2857
- ye("ui-camadas", K);
2858
- ye("ui-painel-camadas", Zr);
2859
- ye("ui-layer-panel", et);
2860
- function dt(e) {
2861
- var r;
2905
+ xe("ui-camadas", X);
2906
+ xe("ui-painel-camadas", Jt);
2907
+ xe("ui-layer-panel", Zt);
2908
+ function cr(e) {
2909
+ var t;
2862
2910
  return {
2863
2911
  id: e.id,
2864
2912
  name: e.nome || e.id,
2865
- color: ((r = e.estilo) == null ? void 0 : r.corPrimaria) || "#00E08A",
2913
+ color: ((t = e.estilo) == null ? void 0 : t.corPrimaria) || "#00E08A",
2866
2914
  visible: e.visivel !== !1,
2867
2915
  locked: e.bloqueada === !0,
2868
2916
  opacity: typeof e.opacidade == "number" ? e.opacidade : 1,
@@ -2874,11 +2922,11 @@ function dt(e) {
2874
2922
  dados: e.dados
2875
2923
  };
2876
2924
  }
2877
- function ut(e, r = "levantamento", a = "feicoes") {
2925
+ function dr(e, t = "levantamento", a = "feicoes") {
2878
2926
  return {
2879
2927
  id: e.id,
2880
2928
  nome: e.name,
2881
- categoria: e.categoria || r,
2929
+ categoria: e.categoria || t,
2882
2930
  tipo: e.tipo || a,
2883
2931
  visivel: e.visible !== !1,
2884
2932
  opacidade: typeof e.opacity == "number" ? e.opacity : 1,
@@ -2893,16 +2941,16 @@ function ut(e, r = "levantamento", a = "feicoes") {
2893
2941
  dados: typeof e.dados == "object" && e.dados !== null ? e.dados : void 0
2894
2942
  };
2895
2943
  }
2896
- function pt(e, r = "") {
2897
- var o, n, l, c;
2898
- const a = ((o = e.geometria) == null ? void 0 : o.tipo) || ((n = e.geometria) == null ? void 0 : n.type) || e.tipo || e.type || "Polygon", t = ((l = e.geometria) == null ? void 0 : l.coordenadas) || ((c = e.geometria) == null ? void 0 : c.coordinates) || e.coordinates, i = e.cor || e.color;
2944
+ function ur(e, t = "") {
2945
+ var o, n, s, c;
2946
+ const a = ((o = e.geometria) == null ? void 0 : o.tipo) || ((n = e.geometria) == null ? void 0 : n.type) || e.tipo || e.type || "Polygon", r = ((s = e.geometria) == null ? void 0 : s.coordenadas) || ((c = e.geometria) == null ? void 0 : c.coordinates) || e.coordinates, i = e.cor || e.color;
2899
2947
  return {
2900
2948
  id: String(e.id),
2901
2949
  name: e.nome || e.name || `Feição ${e.id}`,
2902
- layerId: e.layerId || e.camadaId || r,
2950
+ layerId: e.layerId || e.camadaId || t,
2903
2951
  type: a,
2904
2952
  geometryType: a,
2905
- coordinates: t,
2953
+ coordinates: r,
2906
2954
  color: i,
2907
2955
  visible: e.visivel !== void 0 ? e.visivel : e.visible !== !1,
2908
2956
  locked: e.bloqueada !== void 0 ? e.bloqueada : e.locked === !0,
@@ -2912,43 +2960,43 @@ function pt(e, r = "") {
2912
2960
  };
2913
2961
  }
2914
2962
  export {
2915
- Qa as CamadasDragDropManager,
2916
- b as ICONES,
2963
+ Ka as CamadasDragDropManager,
2964
+ y as ICONES,
2917
2965
  we as LIMITE_FEICOES_POR_CAMADA,
2918
- Oe as MAPAS_BASE_PADRAO,
2919
- K as UICamadas,
2920
- et as UILayerPanel,
2921
- gt as UIMapaBase,
2922
- Zr as UIPainelCamadas,
2923
- vt as UISeletorMapaBase,
2924
- ue as calcularAreaAnelSimples,
2925
- Te as calcularAreaPoligono,
2926
- Pe as calcularComprimentoLinha,
2927
- Sa as calcularDistanciaPontos,
2928
- ja as calcularSelecaoFeicao,
2966
+ Ne as MAPAS_BASE_PADRAO,
2967
+ X as UICamadas,
2968
+ Zt as UILayerPanel,
2969
+ mr as UIMapaBase,
2970
+ Jt as UIPainelCamadas,
2971
+ gr as UISeletorMapaBase,
2972
+ pe as calcularAreaAnelSimples,
2973
+ Oe as calcularAreaPoligono,
2974
+ Re as calcularComprimentoLinha,
2975
+ za as calcularDistanciaPontos,
2976
+ Ha as calcularSelecaoFeicao,
2929
2977
  he as carregarEstadoPersistido,
2930
- ne as construirHierarquiaCamadas,
2931
- ut as converterCamadaItemParaCanvasLayer,
2932
- dt as converterCanvasLayerParaCamadaItem,
2933
- pt as converterFeicaoParaItem,
2978
+ se as construirHierarquiaCamadas,
2979
+ dr as converterCamadaItemParaCanvasLayer,
2980
+ cr as converterCanvasLayerParaCamadaItem,
2981
+ ur as converterFeicaoParaItem,
2934
2982
  z as escapeHtml,
2935
- Xe as filtrarCamadasPorBusca,
2936
- te as filtrarFeicoesPorBusca,
2937
- ct as formatarMetricaFeicoes,
2938
- qa as formatarOpcoesCamadasHierarquicas,
2939
- Wa as gerarChaveStorage,
2940
- er as limparEstadoPersistido,
2941
- rr as montarEstadoPersistido,
2942
- je as nomeDoMapaBase,
2943
- Ja as normalizarEstadoPersistido,
2944
- We as obterIdsVisiveisFeicoes,
2945
- ar as reidratarCamadasComOverrides,
2983
+ ea as filtrarCamadasPorBusca,
2984
+ V as filtrarFeicoesPorBusca,
2985
+ lr as formatarMetricaFeicoes,
2986
+ Ge as formatarOpcoesCamadasHierarquicas,
2987
+ Xa as gerarChaveStorage,
2988
+ Za as limparEstadoPersistido,
2989
+ at as montarEstadoPersistido,
2990
+ He as nomeDoMapaBase,
2991
+ Wa as normalizarEstadoPersistido,
2992
+ aa as obterIdsVisiveisFeicoes,
2993
+ et as reidratarCamadasComOverrides,
2946
2994
  Ae as removerSelecoesInvalidas,
2947
- Va as renderizarArvoreCamadas,
2948
- za as renderizarGridMapasBase,
2949
- Da as renderizarRodapeAcoes,
2950
- Ta as renderizarThumbGeometria,
2951
- Ne as rotuloRodape,
2952
- Za as salvarEstadoPersistido,
2953
- Je as snapshotCamada
2995
+ Ua as renderizarArvoreCamadas,
2996
+ Da as renderizarGridMapasBase,
2997
+ Ra as renderizarRodapeAcoes,
2998
+ Ve as renderizarThumbGeometria,
2999
+ _e as rotuloRodape,
3000
+ Ja as salvarEstadoPersistido,
3001
+ ta as snapshotCamada
2954
3002
  };