@thibezer/ui-components-kit 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +210 -0
- package/README.md +1 -1
- package/dist/camadas.cjs +1 -311
- package/dist/camadas.js +148 -3248
- package/dist/canvas.cjs +82 -82
- package/dist/canvas.js +2964 -3442
- package/dist/components/ui-barra-ferramentas/paleta-ajuste.d.ts +43 -0
- package/dist/components/ui-barra-ferramentas/paleta-excesso.d.ts +8 -0
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +15 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +47 -6
- package/dist/components/ui-canvas-prancha/index.d.ts +13 -0
- package/dist/components/ui-canvas-prancha/prancha-acessibilidade.d.ts +5 -0
- package/dist/components/ui-canvas-prancha/prancha-atributos-sync.d.ts +14 -0
- package/dist/components/ui-canvas-prancha/prancha-bus.d.ts +5 -0
- package/dist/components/ui-canvas-prancha/prancha-comandos-organizacao.d.ts +45 -0
- package/dist/components/ui-canvas-prancha/prancha-comandos-pathfinder.d.ts +3 -0
- package/dist/components/ui-canvas-prancha/prancha-comandos-propriedades.d.ts +12 -0
- package/dist/components/ui-canvas-prancha/prancha-comandos.d.ts +27 -0
- package/dist/components/ui-canvas-prancha/prancha-controlador.d.ts +122 -0
- package/dist/components/ui-canvas-prancha/prancha-cores.d.ts +23 -0
- package/dist/components/ui-canvas-prancha/prancha-documento.d.ts +59 -0
- package/dist/components/ui-canvas-prancha/prancha-estado-ui.d.ts +45 -0
- package/dist/components/ui-canvas-prancha/prancha-ferramentas-edicao.d.ts +7 -0
- package/dist/components/ui-canvas-prancha/prancha-ferramentas.d.ts +38 -0
- package/dist/components/ui-canvas-prancha/prancha-gestos.d.ts +88 -0
- package/dist/components/ui-canvas-prancha/prancha-interacao.d.ts +31 -0
- package/dist/components/ui-canvas-prancha/prancha-medidor-texto.d.ts +6 -0
- package/dist/components/ui-canvas-prancha/prancha-paineis.d.ts +29 -0
- package/dist/components/ui-canvas-prancha/prancha-painel-camadas.d.ts +52 -0
- package/dist/components/ui-canvas-prancha/prancha-painel-propriedades.d.ts +50 -0
- package/dist/components/ui-canvas-prancha/prancha-paleta.d.ts +13 -0
- package/dist/components/ui-canvas-prancha/prancha-pintura.d.ts +55 -0
- package/dist/components/ui-canvas-prancha/prancha-reguas.d.ts +26 -0
- package/dist/components/ui-canvas-prancha/prancha-render.d.ts +35 -0
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +12 -0
- package/dist/components/ui-canvas-prancha/prancha-template.d.ts +1 -0
- package/dist/components/ui-canvas-prancha/prancha-vista.d.ts +31 -0
- package/dist/components/ui-canvas-prancha/tipos.d.ts +138 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +158 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha.d.ts +119 -0
- package/dist/components/ui-editor-prancha/editor-tipos.d.ts +12 -0
- package/dist/components/ui-editor-prancha/index.d.ts +2 -0
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +60 -0
- package/dist/cores-utils-BmkzhA1v.cjs +1 -0
- package/dist/cores-utils-BrdynxRd.js +54 -0
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +12 -11
- package/dist/custom-elements.json +21776 -11591
- package/dist/data.cjs +1 -1
- package/dist/data.js +99 -98
- package/dist/feature_caixa-2Sxv3tGa.js +824 -0
- package/dist/feature_caixa-4M4MkFH7.cjs +1 -0
- package/dist/feature_caixa-CnYPKVFS.cjs +1 -0
- package/dist/feature_caixa-DCs9ZeSk.js +1038 -0
- package/dist/feature_desenho-BH-E1Q9Q.cjs +1 -0
- package/dist/feature_desenho-BVHivWIB.js +222 -0
- package/dist/feature_historico-BAIYk1Me.cjs +3 -0
- package/dist/feature_historico-C4h9y5fu.js +3039 -0
- package/dist/geometria-px-Cyi_oPD6.cjs +1 -0
- package/dist/geometria-px-DKrWq_XY.js +639 -0
- package/dist/geometria-px-DUs5FgLE.js +639 -0
- package/dist/gerencigeo-canvas/booleanas/classificacao.d.ts +41 -0
- package/dist/gerencigeo-canvas/booleanas/index.d.ts +10 -0
- package/dist/gerencigeo-canvas/booleanas/montagem.d.ts +23 -0
- package/dist/gerencigeo-canvas/booleanas/segmentos.d.ts +38 -0
- package/dist/gerencigeo-canvas/booleanas/tipos.d.ts +44 -0
- package/dist/gerencigeo-canvas/espaco/espaco_geografico.d.ts +2 -0
- package/dist/gerencigeo-canvas/espaco/espaco_matriz.d.ts +58 -0
- package/dist/gerencigeo-canvas/espaco/espaco_plano.d.ts +13 -0
- package/dist/gerencigeo-canvas/espaco/espaco_tipos.d.ts +35 -0
- package/dist/gerencigeo-canvas/espaco/index.d.ts +4 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +12 -8
- package/dist/gerencigeo-canvas/feature_amostra.d.ts +2 -1
- package/dist/gerencigeo-canvas/feature_caixa.d.ts +3 -2
- package/dist/gerencigeo-canvas/feature_curvas.d.ts +9 -2
- package/dist/gerencigeo-canvas/feature_desenho.d.ts +23 -2
- package/dist/gerencigeo-canvas/feature_edicao_nos.d.ts +68 -0
- package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +28 -8
- package/dist/gerencigeo-canvas/feature_editor_painel_no.d.ts +40 -0
- package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +46 -0
- package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -3
- package/dist/gerencigeo-canvas/feature_historico.d.ts +41 -0
- package/dist/gerencigeo-canvas/feature_indice.d.ts +10 -2
- package/dist/gerencigeo-canvas/feature_metricas.d.ts +15 -4
- package/dist/gerencigeo-canvas/feature_types.d.ts +14 -2
- package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +2 -0
- package/dist/gerencigeo-canvas/prancha/ajuste_caixa.d.ts +32 -0
- package/dist/gerencigeo-canvas/prancha/aparencia_estilo.d.ts +86 -0
- package/dist/gerencigeo-canvas/prancha/aparencia_lote.d.ts +49 -0
- package/dist/gerencigeo-canvas/prancha/camadas.d.ts +14 -0
- package/dist/gerencigeo-canvas/prancha/cantos_vivos.d.ts +18 -0
- package/dist/gerencigeo-canvas/prancha/elemento_consulta.d.ts +63 -0
- package/dist/gerencigeo-canvas/prancha/elemento_criacao.d.ts +27 -0
- package/dist/gerencigeo-canvas/prancha/elemento_edicao.d.ts +24 -0
- package/dist/gerencigeo-canvas/prancha/elemento_geometria.d.ts +60 -0
- package/dist/gerencigeo-canvas/prancha/elemento_predefinicoes.d.ts +88 -0
- package/dist/gerencigeo-canvas/prancha/elemento_snap.d.ts +39 -0
- package/dist/gerencigeo-canvas/prancha/elemento_transformacao.d.ts +65 -0
- package/dist/gerencigeo-canvas/prancha/elemento_validacao.d.ts +27 -0
- package/dist/gerencigeo-canvas/prancha/envelope_visual.d.ts +12 -0
- package/dist/gerencigeo-canvas/prancha/exportar_svg.d.ts +18 -0
- package/dist/gerencigeo-canvas/prancha/guias_inteligentes.d.ts +21 -0
- package/dist/gerencigeo-canvas/prancha/index.d.ts +28 -0
- package/dist/gerencigeo-canvas/prancha/operacoes_caminho.d.ts +35 -0
- package/dist/gerencigeo-canvas/prancha/organizacao.d.ts +46 -0
- package/dist/gerencigeo-canvas/prancha/pathfinder.d.ts +17 -0
- package/dist/gerencigeo-canvas/prancha/pintura_canvas.d.ts +118 -0
- package/dist/gerencigeo-canvas/prancha/pintura_contexto.d.ts +54 -0
- package/dist/gerencigeo-canvas/prancha/pintura_formas.d.ts +32 -0
- package/dist/gerencigeo-canvas/prancha/pintura_gradiente_faixas.d.ts +21 -0
- package/dist/gerencigeo-canvas/prancha/pintura_plano.d.ts +126 -0
- package/dist/gerencigeo-canvas/prancha/propriedades.d.ts +15 -0
- package/dist/gerencigeo-canvas/prancha/tipos.d.ts +228 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +252 -248
- package/dist/motor.cjs +1 -1
- package/dist/motor.js +822 -57
- package/dist/prancha-nucleo.cjs +1 -0
- package/dist/prancha-nucleo.d.ts +3 -0
- package/dist/prancha-nucleo.js +302 -0
- package/dist/prancha-paleta-BZ-9QDgh.js +5276 -0
- package/dist/prancha-paleta-Bb24vP71.cjs +17 -0
- package/dist/prancha.cjs +1 -0
- package/dist/prancha.d.ts +13 -0
- package/dist/prancha.js +231 -0
- package/dist/register.cjs +1 -1
- package/dist/register.js +10 -6
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +90 -89
- package/dist/tipos-elementos.d.ts +73 -1
- package/dist/tipos-react.d.ts +4 -0
- package/dist/tipos-vue.d.ts +73 -1
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-camadas-DoHPnbQm.js +3133 -0
- package/dist/ui-camadas-Vx7wYD4D.cjs +311 -0
- package/dist/ui-controle-cores-BcH9k2Fa.js +292 -0
- package/dist/ui-controle-cores-CvSTP6gJ.cjs +32 -0
- package/dist/ui-editor-prancha-CIngI6yI.js +2886 -0
- package/dist/ui-editor-prancha-DorSe6sC.cjs +31 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-paleta-ferramentas-DebHYiwd.js +1615 -0
- package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +22 -0
- package/dist/ui-seletor-cor-0RLjcME6.cjs +83 -0
- package/dist/ui-seletor-cor-Cd8jkzXG.js +354 -0
- package/dist/ui-tabela-CXxqbwXv.cjs +7 -0
- package/dist/ui-tabela-Cd0vOwnT.js +1459 -0
- package/dist/ui-tabela-propriedades-D96Djx-q.cjs +136 -0
- package/dist/ui-tabela-propriedades-ahQhQauu.js +2329 -0
- package/package.json +11 -1
package/dist/camadas.js
CHANGED
|
@@ -1,3289 +1,189 @@
|
|
|
1
|
-
var za = Object.defineProperty;
|
|
2
|
-
var Pa = (e, t, a) => t in e ? za(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
-
var I = (e, t, a) => Pa(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
1
|
/* empty css */
|
|
5
|
-
import { d as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { f as Ra } from "./alvo-digitavel-CzCvNVQ3.js";
|
|
11
|
-
import { UIMapaBase as Fr, UISeletorMapaBase as $r } from "./seletor-mapa-base.js";
|
|
12
|
-
const b = {
|
|
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
|
-
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
|
15
|
-
<polyline points="2 17 12 22 22 17"></polyline>
|
|
16
|
-
<polyline points="2 12 12 17 22 12"></polyline>
|
|
17
|
-
</svg>`,
|
|
18
|
-
inspecao: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
19
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
20
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
21
|
-
</svg>`,
|
|
22
|
-
equipe: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
23
|
-
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
24
|
-
<circle cx="9" cy="7" r="4"></circle>
|
|
25
|
-
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
26
|
-
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
27
|
-
</svg>`,
|
|
28
|
-
olhoAberto: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
29
|
-
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
30
|
-
<circle cx="12" cy="12" r="3"></circle>
|
|
31
|
-
</svg>`,
|
|
32
|
-
olhoFechado: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
33
|
-
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
|
|
34
|
-
<line x1="1" y1="1" x2="23" y2="23"></line>
|
|
35
|
-
</svg>`,
|
|
36
|
-
cadeadoTrancado: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
37
|
-
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
38
|
-
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
39
|
-
</svg>`,
|
|
40
|
-
cadeadoAberto: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
41
|
-
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
42
|
-
<path d="M7 11V7a5 5 0 0 1 9.9-1"></path>
|
|
43
|
-
</svg>`,
|
|
44
|
-
chevronDir: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
45
|
-
<polyline points="9 18 15 12 9 6"></polyline>
|
|
46
|
-
</svg>`,
|
|
47
|
-
dragHandle: `<svg viewBox="5 3 14 18" width="7" height="9" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
48
|
-
<line x1="8" y1="6" x2="8" y2="6.01"></line>
|
|
49
|
-
<line x1="16" y1="6" x2="16" y2="6.01"></line>
|
|
50
|
-
<line x1="8" y1="12" x2="8" y2="12.01"></line>
|
|
51
|
-
<line x1="16" y1="12" x2="16" y2="12.01"></line>
|
|
52
|
-
<line x1="8" y1="18" x2="8" y2="18.01"></line>
|
|
53
|
-
<line x1="16" y1="18" x2="16" y2="18.01"></line>
|
|
54
|
-
</svg>`,
|
|
55
|
-
alvoEnquadrar: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
56
|
-
<circle cx="12" cy="12" r="10"></circle>
|
|
57
|
-
<line x1="12" y1="2" x2="12" y2="6"></line>
|
|
58
|
-
<line x1="12" y1="18" x2="12" y2="22"></line>
|
|
59
|
-
<line x1="2" y1="12" x2="6" y2="12"></line>
|
|
60
|
-
<line x1="18" y1="12" x2="22" y2="12"></line>
|
|
61
|
-
</svg>`,
|
|
62
|
-
engrenagem: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
63
|
-
<circle cx="12" cy="12" r="3"></circle>
|
|
64
|
-
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
65
|
-
</svg>`,
|
|
66
|
-
mais: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
67
|
-
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
68
|
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
69
|
-
</svg>`,
|
|
70
|
-
lixeira: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
71
|
-
<polyline points="3 6 5 6 21 6"></polyline>
|
|
72
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
73
|
-
</svg>`,
|
|
74
|
-
fechar: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
75
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
76
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
77
|
-
</svg>`,
|
|
78
|
-
busca: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
79
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
80
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
81
|
-
</svg>`,
|
|
82
|
-
recolherPainel: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
83
|
-
<polyline points="13 17 18 12 13 7"></polyline>
|
|
84
|
-
<polyline points="6 17 11 12 6 7"></polyline>
|
|
85
|
-
</svg>`,
|
|
86
|
-
expandirPainel: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
87
|
-
<polyline points="11 17 6 12 11 7"></polyline>
|
|
88
|
-
<polyline points="18 17 13 12 18 7"></polyline>
|
|
89
|
-
</svg>`,
|
|
90
|
-
reguaMetrica: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
91
|
-
<path d="M21.3 15.3l-9.6-9.6a1 1 0 0 0-1.4 0l-7 7a1 1 0 0 0 0 1.4l9.6 9.6a1 1 0 0 0 1.4 0l7-7a1 1 0 0 0 0-1.4z"></path>
|
|
92
|
-
<line x1="14.5" y1="8.5" x2="12" y2="11"></line>
|
|
93
|
-
<line x1="10.5" y1="12.5" x2="8" y2="15"></line>
|
|
94
|
-
</svg>`,
|
|
95
|
-
moverPasta: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
96
|
-
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
|
|
97
|
-
</svg>`,
|
|
98
|
-
mapa: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
99
|
-
<polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon>
|
|
100
|
-
<line x1="8" y1="2" x2="8" y2="18"></line>
|
|
101
|
-
<line x1="16" y1="6" x2="16" y2="22"></line>
|
|
102
|
-
</svg>`,
|
|
103
|
-
gradeCad: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
104
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
105
|
-
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
106
|
-
<line x1="3" y1="15" x2="21" y2="15"></line>
|
|
107
|
-
<line x1="9" y1="3" x2="9" y2="21"></line>
|
|
108
|
-
<line x1="15" y1="3" x2="15" y2="21"></line>
|
|
109
|
-
</svg>`
|
|
110
|
-
}, X = 6378137;
|
|
111
|
-
function ja(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]))
|
|
2
|
+
import { C as R, I as B, L as D, M as q, U as N, a as k, b as z, c as O, d as T, e as U, f as _, g as $, h as G, i as j, j as H, l as w, m as V, n as J, k as K, o as Q, r as W, p as X, q as Y, s as Z, t as aa, u as ra, v as ta, w as ea, x as ia } from "./ui-camadas-DoHPnbQm.js";
|
|
3
|
+
import { UIMapaBase as oa, UISeletorMapaBase as sa } from "./seletor-mapa-base.js";
|
|
4
|
+
const m = 6378137;
|
|
5
|
+
function b(a, r) {
|
|
6
|
+
if (!Array.isArray(a) || !Array.isArray(r) || a.length < 2 || r.length < 2 || !Number.isFinite(a[0]) || !Number.isFinite(a[1]) || !Number.isFinite(r[0]) || !Number.isFinite(r[1]))
|
|
113
7
|
return 0;
|
|
114
|
-
const
|
|
8
|
+
const e = a[0] * Math.PI / 180, t = a[1] * Math.PI / 180, i = r[0] * Math.PI / 180, o = r[1] * Math.PI / 180, s = i - e, c = o - t, d = Math.min(
|
|
115
9
|
1,
|
|
116
10
|
Math.max(
|
|
117
11
|
0,
|
|
118
|
-
Math.sin(
|
|
12
|
+
Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e) * Math.cos(i) * Math.sin(c / 2) * Math.sin(c / 2)
|
|
119
13
|
)
|
|
120
|
-
),
|
|
121
|
-
return Number.isFinite(
|
|
122
|
-
}
|
|
123
|
-
function Ue(e) {
|
|
124
|
-
if (!Array.isArray(e) || e.length < 2) return 0;
|
|
125
|
-
if (Array.isArray(e[0]) && Array.isArray(e[0][0]))
|
|
126
|
-
return e.reduce((a, r) => a + Ue(r), 0);
|
|
127
|
-
let t = 0;
|
|
128
|
-
for (let a = 0; a < e.length - 1; a++) {
|
|
129
|
-
const r = e[a], i = e[a + 1];
|
|
130
|
-
Array.isArray(r) && Array.isArray(i) && r.length >= 2 && i.length >= 2 && (t += ja([r[0], r[1]], [i[0], i[1]]));
|
|
131
|
-
}
|
|
132
|
-
return t;
|
|
14
|
+
), u = m * 2 * Math.atan2(Math.sqrt(d), Math.sqrt(1 - d));
|
|
15
|
+
return Number.isFinite(u) ? u : 0;
|
|
133
16
|
}
|
|
134
|
-
function
|
|
135
|
-
if (!Array.isArray(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const c = e[p];
|
|
139
|
-
Array.isArray(c) && c.length >= 2 && Number.isFinite(c[0]) && Number.isFinite(c[1]) && t.push([c[0], c[1]]);
|
|
140
|
-
}
|
|
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
|
-
if (a < 3) return 0;
|
|
17
|
+
function y(a) {
|
|
18
|
+
if (!Array.isArray(a) || a.length < 2) return 0;
|
|
19
|
+
if (Array.isArray(a[0]) && Array.isArray(a[0][0]))
|
|
20
|
+
return a.reduce((e, t) => e + y(t), 0);
|
|
144
21
|
let r = 0;
|
|
145
|
-
for (let
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
let l = 0;
|
|
149
|
-
for (let p = 0; p < a; p++) {
|
|
150
|
-
const c = t[p], f = t[(p + 1) % a], m = (c[1] - d) * n * X * o, h = (c[0] - s) * n * X, v = (f[1] - d) * n * X * o, g = (f[0] - s) * n * X;
|
|
151
|
-
l += m * g - v * h;
|
|
22
|
+
for (let e = 0; e < a.length - 1; e++) {
|
|
23
|
+
const t = a[e], i = a[e + 1];
|
|
24
|
+
Array.isArray(t) && Array.isArray(i) && t.length >= 2 && i.length >= 2 && (r += b([t[0], t[1]], [i[0], i[1]]));
|
|
152
25
|
}
|
|
153
|
-
|
|
154
|
-
return Number.isFinite(u) ? u : 0;
|
|
26
|
+
return r;
|
|
155
27
|
}
|
|
156
|
-
function
|
|
157
|
-
if (!Array.isArray(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
28
|
+
function g(a) {
|
|
29
|
+
if (!Array.isArray(a)) return 0;
|
|
30
|
+
const r = [];
|
|
31
|
+
for (let n = 0; n < a.length; n++) {
|
|
32
|
+
const l = a[n];
|
|
33
|
+
Array.isArray(l) && l.length >= 2 && Number.isFinite(l[0]) && Number.isFinite(l[1]) && r.push([l[0], l[1]]);
|
|
34
|
+
}
|
|
35
|
+
r.length > 3 && r[0][0] === r[r.length - 1][0] && r[0][1] === r[r.length - 1][1] && r.pop();
|
|
36
|
+
const e = r.length;
|
|
37
|
+
if (e < 3) return 0;
|
|
38
|
+
let t = 0;
|
|
39
|
+
for (let n = 0; n < e; n++)
|
|
40
|
+
t += r[n][0];
|
|
41
|
+
const i = t / e * Math.PI / 180, o = Math.cos(i), s = Math.PI / 180, c = r[0][0], d = r[0][1];
|
|
42
|
+
let u = 0;
|
|
43
|
+
for (let n = 0; n < e; n++) {
|
|
44
|
+
const l = r[n], h = r[(n + 1) % e], M = (l[1] - d) * s * m * o, v = (l[0] - c) * s * m, P = (h[1] - d) * s * m * o, I = (h[0] - c) * s * m;
|
|
45
|
+
u += M * I - P * v;
|
|
46
|
+
}
|
|
47
|
+
const p = Math.abs(u) / 2;
|
|
48
|
+
return Number.isFinite(p) ? p : 0;
|
|
49
|
+
}
|
|
50
|
+
function A(a) {
|
|
51
|
+
if (!Array.isArray(a) || a.length === 0) return 0;
|
|
52
|
+
if (Array.isArray(a[0]) && typeof a[0][0] == "number")
|
|
53
|
+
return g(a);
|
|
54
|
+
if (Array.isArray(a[0]) && Array.isArray(a[0][0])) {
|
|
55
|
+
if (Array.isArray(a[0][0][0]))
|
|
56
|
+
return a.reduce((t, i) => t + A(i), 0);
|
|
57
|
+
const r = g(a[0]);
|
|
58
|
+
let e = 0;
|
|
59
|
+
for (let t = 1; t < a.length; t++)
|
|
60
|
+
e += g(a[t]);
|
|
61
|
+
return Math.max(0, r - e);
|
|
168
62
|
}
|
|
169
63
|
return 0;
|
|
170
64
|
}
|
|
171
|
-
function
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
(
|
|
65
|
+
function F(a) {
|
|
66
|
+
if (!a || a.length === 0) return "";
|
|
67
|
+
const r = a.filter(
|
|
68
|
+
(t) => t.type === "Polygon" || t.type === "MultiPolygon" || t.geometryType === "Polygon"
|
|
175
69
|
);
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
(i, o) => i + (
|
|
70
|
+
if (r.length > 0) {
|
|
71
|
+
const t = r.reduce(
|
|
72
|
+
(i, o) => i + (A(o.coordinates) || 0),
|
|
179
73
|
0
|
|
180
74
|
);
|
|
181
|
-
return
|
|
75
|
+
return t >= 1e4 ? `${(t / 1e4).toLocaleString("pt-BR", {
|
|
182
76
|
minimumFractionDigits: 1,
|
|
183
77
|
maximumFractionDigits: 2
|
|
184
|
-
})} ha` : `${Math.round(
|
|
78
|
+
})} ha` : `${Math.round(t).toLocaleString("pt-BR")} m²`;
|
|
185
79
|
}
|
|
186
|
-
const
|
|
187
|
-
(
|
|
80
|
+
const e = a.filter(
|
|
81
|
+
(t) => t.type === "LineString" || t.type === "MultiLineString" || t.geometryType === "LineString"
|
|
188
82
|
);
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
(i, o) => i + (
|
|
83
|
+
if (e.length > 0) {
|
|
84
|
+
const t = e.reduce(
|
|
85
|
+
(i, o) => i + (y(o.coordinates) || 0),
|
|
192
86
|
0
|
|
193
87
|
);
|
|
194
|
-
return
|
|
88
|
+
return t >= 1e3 ? `${(t / 1e3).toLocaleString("pt-BR", {
|
|
195
89
|
minimumFractionDigits: 1,
|
|
196
90
|
maximumFractionDigits: 2
|
|
197
|
-
})} km` : `${Math.round(
|
|
91
|
+
})} km` : `${Math.round(t).toLocaleString("pt-BR")} m`;
|
|
198
92
|
}
|
|
199
93
|
return "";
|
|
200
94
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
const Na = /^(#(?:[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 K(e, t = "#00E08A") {
|
|
206
|
-
if (!e || typeof e != "string") return t;
|
|
207
|
-
const a = e.trim();
|
|
208
|
-
return Na.test(a) ? a : t;
|
|
209
|
-
}
|
|
210
|
-
function xe(e) {
|
|
211
|
-
return Math.max(0, Math.min(255, Math.round(e))).toString(16).padStart(2, "0");
|
|
212
|
-
}
|
|
213
|
-
function Ha(e, t, a) {
|
|
214
|
-
const r = t / 100, i = a / 100, o = (d) => (d + e / 30) % 12, n = r * Math.min(i, 1 - i), s = (d) => i - n * Math.max(-1, Math.min(o(d) - 3, Math.min(9 - o(d), 1)));
|
|
215
|
-
return [s(0) * 255, s(8) * 255, s(4) * 255];
|
|
216
|
-
}
|
|
217
|
-
function Ga(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
|
-
return o.length <= 4 ? `#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}` : `#${o.slice(0, 6)}`;
|
|
223
|
-
}
|
|
224
|
-
const i = /^(rgb|hsl)a?\(([^)]+)\)$/.exec(a);
|
|
225
|
-
if (i) {
|
|
226
|
-
const o = i[2].split(/[\s,/]+/).filter(Boolean).map((n) => parseFloat(n));
|
|
227
|
-
if (o.length >= 3 && o.slice(0, 3).every((n) => !isNaN(n))) {
|
|
228
|
-
const [n, s, d] = o, [l, u, p] = i[1] === "rgb" ? [n, s, d] : Ha(n, s, d);
|
|
229
|
-
return `#${xe(l)}${xe(u)}${xe(p)}`;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return t;
|
|
233
|
-
}
|
|
234
|
-
function D(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
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
function Ke(e, t = 80) {
|
|
241
|
-
let a = null;
|
|
242
|
-
return (...r) => {
|
|
243
|
-
a && clearTimeout(a), a = setTimeout(() => {
|
|
244
|
-
e(...r), a = null;
|
|
245
|
-
}, t);
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
function T(e, t) {
|
|
249
|
-
e.setAttribute("title", t), e.setAttribute("aria-label", t);
|
|
250
|
-
}
|
|
251
|
-
const Qe = [
|
|
252
|
-
{
|
|
253
|
-
id: "none",
|
|
254
|
-
nome: "Sem Mapa",
|
|
255
|
-
descricao: "Tela CAD neutra com grade quadriculada"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
id: "google_satelite_puro",
|
|
259
|
-
nome: "Google Puro",
|
|
260
|
-
descricao: "Satélite limpo sem ruas ou rótulos",
|
|
261
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
id: "google_satelite",
|
|
265
|
-
nome: "Google Híbrido",
|
|
266
|
-
descricao: "Satélite com nomes de ruas e divisas",
|
|
267
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
id: "satelite",
|
|
271
|
-
nome: "Esri Satélite",
|
|
272
|
-
descricao: "Imagens orbitais de alta resolução",
|
|
273
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=160&auto=format&fit=crop&q=80"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: "osm",
|
|
277
|
-
nome: "OpenStreetMap",
|
|
278
|
-
descricao: "Mapa viário e urbano colaborativo",
|
|
279
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=160&auto=format&fit=crop&q=80"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
id: "topografia",
|
|
283
|
-
nome: "Topografia",
|
|
284
|
-
descricao: "Curvas de nível e relevo sombreado",
|
|
285
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=160&auto=format&fit=crop&q=80"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
id: "dark",
|
|
289
|
-
nome: "Dark Canvas",
|
|
290
|
-
descricao: "Mapa escuro de alto contraste para CAD",
|
|
291
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=160&auto=format&fit=crop&q=80"
|
|
292
|
-
}
|
|
293
|
-
];
|
|
294
|
-
function Xe(e, t) {
|
|
295
|
-
const a = Array.isArray(e) ? e.find((r) => r.id === t) : void 0;
|
|
296
|
-
return a && typeof a.nome == "string" ? a.nome : "";
|
|
297
|
-
}
|
|
298
|
-
function Va(e = Qe, t = "satelite", a = !1) {
|
|
299
|
-
if (!e || e.length === 0) return "";
|
|
300
|
-
const r = e.map((i) => {
|
|
301
|
-
const o = t === i.id, n = M(i.id), s = M(i.nome), d = M(i.descricao || i.nome);
|
|
302
|
-
let l = "";
|
|
303
|
-
return i.thumbnailUrl ? l = `<img class="ui-basemap-preview" src="${M(i.thumbnailUrl)}" alt="" loading="lazy" referrerpolicy="no-referrer" data-basemap-thumb />` : l = `<div class="ui-basemap-preview-none">${b.gradeCad}</div>`, `
|
|
304
|
-
<div class="ui-basemap-card ${o ? "active" : ""}" data-basemap-id="${n}" role="button" tabindex="0" aria-pressed="${o}" title="${d}">
|
|
305
|
-
${l}
|
|
306
|
-
<span>${s}</span>
|
|
307
|
-
</div>
|
|
308
|
-
`;
|
|
309
|
-
}).join("");
|
|
310
|
-
return `
|
|
311
|
-
<div class="ui-basemap-section ${a ? "recolhido" : ""}" part="mapas-base">
|
|
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
|
-
<span class="ui-basemap-title">Mapa Base</span>
|
|
314
|
-
<span class="ui-basemap-atual" data-basemap-atual>${M(Xe(e, t))}</span>
|
|
315
|
-
<span class="ui-chevron-icon ${a ? "" : "open"}">${b.chevronDir}</span>
|
|
316
|
-
</button>
|
|
317
|
-
${a ? "" : `<div class="ui-basemap-grid" id="ui-basemap-grid">
|
|
318
|
-
${r}
|
|
319
|
-
</div>`}
|
|
320
|
-
</div>
|
|
321
|
-
`;
|
|
322
|
-
}
|
|
323
|
-
function pe(e) {
|
|
324
|
-
if (!Array.isArray(e) || e.length === 0) return [];
|
|
325
|
-
const t = e.filter((l) => !!(l && typeof l == "object" && l.id)), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
326
|
-
t.forEach((l, u) => {
|
|
327
|
-
a.set(l.id, l), r.set(l.id, u);
|
|
328
|
-
});
|
|
329
|
-
const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
330
|
-
for (const l of t) {
|
|
331
|
-
if (o.has(l.id)) continue;
|
|
332
|
-
const u = [], p = /* @__PURE__ */ new Map();
|
|
333
|
-
let c = l;
|
|
334
|
-
for (; c && c.parentId && a.has(c.parentId) && c.parentId !== c.id; ) {
|
|
335
|
-
if (p.has(c.id)) {
|
|
336
|
-
const f = p.get(c.id), m = u.slice(f);
|
|
337
|
-
let h = m[0];
|
|
338
|
-
for (const v of m)
|
|
339
|
-
(r.get(v) ?? 1 / 0) < (r.get(h) ?? 1 / 0) && (h = v);
|
|
340
|
-
i.add(h);
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
if (o.has(c.id)) break;
|
|
344
|
-
p.set(c.id, u.length), u.push(c.id), c = a.get(c.parentId);
|
|
345
|
-
}
|
|
346
|
-
for (const f of u) o.add(f);
|
|
347
|
-
}
|
|
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
|
-
});
|
|
352
|
-
function d(l, u, p) {
|
|
353
|
-
const c = new Set(p);
|
|
354
|
-
c.add(l.id);
|
|
355
|
-
const m = (n.get(l.id) || (Array.isArray(l.children) ? l.children : [])).filter(
|
|
356
|
-
(h) => !!(h && typeof h == "object" && h.id && !c.has(h.id))
|
|
357
|
-
);
|
|
358
|
-
return {
|
|
359
|
-
camada: l,
|
|
360
|
-
depth: u,
|
|
361
|
-
subcamadas: m.map((h) => d(h, u + 1, c))
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
return s.map((l) => d(l, 0, /* @__PURE__ */ new Set()));
|
|
365
|
-
}
|
|
366
|
-
function _a(e, t) {
|
|
367
|
-
const a = /* @__PURE__ */ new Set();
|
|
368
|
-
if (!t || !Array.isArray(e)) return a;
|
|
369
|
-
const r = /* @__PURE__ */ new Map();
|
|
370
|
-
for (const o of e)
|
|
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
|
-
for (; i.length > 0; ) {
|
|
374
|
-
const o = i.pop();
|
|
375
|
-
if (a.has(o)) continue;
|
|
376
|
-
a.add(o);
|
|
377
|
-
const n = r.get(o);
|
|
378
|
-
if (n)
|
|
379
|
-
for (const s of n)
|
|
380
|
-
a.has(s) || i.push(s);
|
|
381
|
-
}
|
|
382
|
-
return a;
|
|
383
|
-
}
|
|
384
|
-
function ae(e, t, a) {
|
|
385
|
-
if (!a || !Array.isArray(t) || t.length === 0) return [];
|
|
386
|
-
const r = _a(e, a);
|
|
387
|
-
return t.filter((i) => !!(i && i.layerId && r.has(i.layerId)));
|
|
388
|
-
}
|
|
389
|
-
function fe(e) {
|
|
390
|
-
const t = /* @__PURE__ */ new Map();
|
|
391
|
-
e.forEach((r) => r && r.id && t.set(r.id, r));
|
|
392
|
-
const a = /* @__PURE__ */ new Map();
|
|
393
|
-
for (const r of t.values()) {
|
|
394
|
-
let i = !1, o = !1;
|
|
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
|
-
}
|
|
401
|
-
return a;
|
|
402
|
-
}
|
|
403
|
-
function de(e) {
|
|
404
|
-
const t = fe(e);
|
|
405
|
-
return new Set(
|
|
406
|
-
e.filter((a) => {
|
|
407
|
-
var r;
|
|
408
|
-
return a && (a.locked === !0 || ((r = t.get(a.id)) == null ? void 0 : r.travadaPorAncestral) === !0);
|
|
409
|
-
}).map((a) => a.id)
|
|
410
|
-
);
|
|
411
|
-
}
|
|
412
|
-
function We(e) {
|
|
413
|
-
const t = pe(e), a = de(e), r = (i) => {
|
|
414
|
-
const o = i.camada, n = i.depth, s = i.subcamadas, d = n > 0 ? " ".repeat(n) + "↳ " : s.length > 0 || o.isGroup ? "📁 " : "", l = a.has(o.id), u = `<option value="${M(o.id)}"${l ? " disabled" : ""}>${d}${M(o.name)}${l ? " 🔒" : ""}</option>`, p = s.map((c) => r(c)).join("");
|
|
415
|
-
return u + p;
|
|
416
|
-
};
|
|
417
|
-
return t.map((i) => r(i)).join("");
|
|
418
|
-
}
|
|
419
|
-
function Je(e, t) {
|
|
420
|
-
return t > 0 ? {
|
|
421
|
-
icone: b.alvoEnquadrar,
|
|
422
|
-
texto: `${t} ${t > 1 ? "selecionados" : "selecionado"}`
|
|
423
|
-
} : {
|
|
424
|
-
icone: b.camadas,
|
|
425
|
-
texto: `${e} ${e > 1 ? "camadas" : "camada"}`
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
function Ua(e, t, a) {
|
|
429
|
-
const r = t.filter((d) => a.has(d.id)), i = r.length > 0, o = i ? r.length : e.length, n = Je(e.length, r.length), s = We(e);
|
|
430
|
-
return `
|
|
431
|
-
<div class="ui-tree-footer ${i ? "tem-selecao" : "sem-selecao"}" part="rodape">
|
|
432
|
-
<div class="ui-footer-left">
|
|
433
|
-
<span class="ui-footer-count" id="footer-count">${o}</span>
|
|
434
|
-
<span class="ui-footer-label" id="footer-label" role="img" title="${n.texto}" aria-label="${n.texto}">${n.icone}</span>
|
|
435
|
-
</div>
|
|
436
|
-
|
|
437
|
-
<!-- Criação de camadas/grupos quando não há nada selecionado -->
|
|
438
|
-
<div class="ui-footer-actions-gerais" style="display: ${i ? "none" : "flex"};">
|
|
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}
|
|
441
|
-
<span>Grupo</span>
|
|
442
|
-
</button>
|
|
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}
|
|
445
|
-
<span>Camada</span>
|
|
446
|
-
</button>
|
|
447
|
-
</div>
|
|
448
|
-
|
|
449
|
-
<!-- Ações em massa ativadas quando há seleção -->
|
|
450
|
-
<div class="ui-footer-right ui-footer-bulk-actions" style="display: ${i ? "flex" : "none"};">
|
|
451
|
-
<div class="ui-footer-move-wrapper ${i ? "" : "disabled"}" title="Mover selecionados para outra camada">
|
|
452
|
-
<select id="select-footer-move" aria-label="Mover selecionados para outra camada" class="ui-footer-select" ${i ? "" : "disabled"}>
|
|
453
|
-
<option value="" disabled selected>Mover para...</option>
|
|
454
|
-
${s}
|
|
455
|
-
</select>
|
|
456
|
-
</div>
|
|
457
|
-
|
|
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}
|
|
460
|
-
</button>
|
|
461
|
-
</div>
|
|
462
|
-
</div>
|
|
463
|
-
`;
|
|
464
|
-
}
|
|
465
|
-
const we = 64;
|
|
466
|
-
function De(e) {
|
|
467
|
-
return Array.isArray(e) && e.length >= 2 && Number.isFinite(e[0]) && Number.isFinite(e[1]);
|
|
468
|
-
}
|
|
469
|
-
function Ze(e) {
|
|
470
|
-
return !Array.isArray(e) || e.length === 0 ? [] : De(e[0]) ? [e.filter(De)] : e.flatMap(Ze);
|
|
471
|
-
}
|
|
472
|
-
function Te(e) {
|
|
473
|
-
if (e.length <= we) return e;
|
|
474
|
-
const t = e.length / we, a = [];
|
|
475
|
-
for (let r = 0; r < we; r++) a.push(e[Math.floor(r * t)]);
|
|
476
|
-
return a.push(e[e.length - 1]), a;
|
|
477
|
-
}
|
|
478
|
-
function Ya(e, t, a) {
|
|
479
|
-
const r = Ze(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 [F, B] of S)
|
|
484
|
-
B < i && (i = B), B > o && (o = B), -F < n && (n = -F), -F > s && (s = -F);
|
|
485
|
-
const d = 16, l = 2, u = d - l * 2, p = o - i, c = s - n, f = Math.max(p, c), m = f > 0 ? u / f : 0, h = l + (u - p * m) / 2, v = l + (u - c * m) / 2, g = (S) => Math.round(S * 100) / 100, w = ([S, F]) => `${g(h + (F - i) * m)},${g(v + (-S - n) * m)}`, k = e === "polygon" || e === "multipolygon", L = e === "linestring" || e === "multilinestring", A = (S) => `<svg viewBox="0 0 ${d} ${d}" width="100%" height="100%" aria-hidden="true">${S}</svg>`;
|
|
486
|
-
if (k) {
|
|
487
|
-
const S = r.filter((F) => F.length >= 3).map((F) => `M${Te(F).map(w).join("L")}Z`).join("");
|
|
488
|
-
return S ? A(
|
|
489
|
-
`<path d="${S}" fill="${a}" fill-opacity="0.45" fill-rule="evenodd" stroke="${a}" stroke-width="1.2" stroke-linejoin="round"/>`
|
|
490
|
-
) : "";
|
|
491
|
-
}
|
|
492
|
-
if (L) {
|
|
493
|
-
const S = r.filter((F) => F.length >= 2).map((F) => `M${Te(F).map(w).join("L")}`).join("");
|
|
494
|
-
return S ? A(
|
|
495
|
-
`<path d="${S}" fill="none" stroke="${a}" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>`
|
|
496
|
-
) : "";
|
|
497
|
-
}
|
|
498
|
-
return "";
|
|
499
|
-
}
|
|
500
|
-
function ea(e, t, a) {
|
|
501
|
-
const r = K(t, "#00E08A"), i = (e || "").toLowerCase(), o = a !== void 0 ? Ya(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
|
-
}
|
|
504
|
-
function aa(e, t, a) {
|
|
505
|
-
return {
|
|
506
|
-
camadaIdSeguro: M(e.id),
|
|
507
|
-
corCamada: K(e.color, "#00E08A"),
|
|
508
|
-
profundidade: t,
|
|
509
|
-
esmaecida: e.visible === !1 || (a == null ? void 0 : a.ocultaPorAncestral) === !0,
|
|
510
|
-
travadaPelaCamada: e.locked === !0 || (a == null ? void 0 : a.travadaPorAncestral) === !0
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
const Ae = (e, t, a) => `${e} ${e === 1 ? t : a}`;
|
|
514
|
-
function ta(e, t, a) {
|
|
515
|
-
return a === 0 ? Ae(e, "feição", "feições") : `${Ae(e, "feição", "feições")} no grupo (${t} nesta camada) · ${Ae(a, "subcamada", "subcamadas")}`;
|
|
516
|
-
}
|
|
517
|
-
function ra(e, t, a, r) {
|
|
518
|
-
return e === 0 && r ? "" : `<span class="ui-count-chip" title="${ta(e, t, a)}">${e}</span>`;
|
|
519
|
-
}
|
|
520
|
-
function ia(e, t) {
|
|
521
|
-
const a = t - e;
|
|
95
|
+
function f(a) {
|
|
96
|
+
var r;
|
|
522
97
|
return {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function Qa(e, t) {
|
|
539
|
-
return Ka.every((a) => e[a] === t[a]);
|
|
540
|
-
}
|
|
541
|
-
function sa(e, t, a, r) {
|
|
542
|
-
const { camadaIdSeguro: i, corCamada: o, profundidade: n } = t, s = M(e.id), d = M(e.name || "Feição"), l = K(e.color, o), u = e.visible !== !1, p = t.travadaPelaCamada, c = e.locked === !0 || p, f = p ? "Bloqueada pela camada" : c ? "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
|
-
return `
|
|
544
|
-
<div class="ui-feat-row ${a ? "selected-row" : ""} ${u ? "" : "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="${u ? "Ocultar Feição" : "Exibir Feição"}" title="${u ? "Ocultar Feição" : "Exibir Feição"}">
|
|
546
|
-
${u ? b.olhoAberto : b.olhoFechado}
|
|
547
|
-
</div>
|
|
548
|
-
|
|
549
|
-
<div class="ui-col ui-col-lock ${c ? "" : "ui-lock-open"}" data-feat-lock="${s}" ${p ? 'data-locked-by-layer="true"' : ""} role="button" tabindex="0" aria-label="${f}" title="${f}">
|
|
550
|
-
${c ? b.cadeadoTrancado : b.cadeadoAberto}
|
|
551
|
-
</div>
|
|
552
|
-
|
|
553
|
-
<div class="ui-col ui-col-colorbar" style="background: ${o};"></div>
|
|
554
|
-
<div class="ui-col ui-col-thumb">
|
|
555
|
-
<div class="ui-thumb-box">${ea(e.type || e.geometryType, l, e.coordinates)}</div>
|
|
556
|
-
</div>
|
|
557
|
-
|
|
558
|
-
<div class="ui-col ui-col-name" data-feat-name-trigger="${s}" title="Duplo clique para renomear">
|
|
559
|
-
${r ? `<input type="text" class="ui-inline-rename-input" data-inline-feat-input="${s}" value="${d}" />` : `<span class="ui-name-text">${d}</span>${m}`}
|
|
560
|
-
</div>
|
|
561
|
-
|
|
562
|
-
<div class="ui-col ui-col-actions">
|
|
563
|
-
<button class="ui-micro-btn" data-feat-fit="${s}" title="Enquadrar no mapa" aria-label="Enquadrar feição no mapa">${b.alvoEnquadrar}</button>
|
|
564
|
-
</div>
|
|
565
|
-
|
|
566
|
-
<div class="ui-col ui-col-target" data-feat-target="${s}" role="button" tabindex="0" aria-label="Selecionar feição" title="Selecionar feição">
|
|
567
|
-
<div class="ui-target-circle ${a ? "selected" : ""}"></div>
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
`;
|
|
571
|
-
}
|
|
572
|
-
const Se = 80;
|
|
573
|
-
function W(e, t) {
|
|
574
|
-
const a = (t || "").trim().toLowerCase();
|
|
575
|
-
return a ? e.filter(
|
|
576
|
-
(r) => (r.name || "").toLowerCase().includes(a) || (r.category || "").toLowerCase().includes(a) || (r.type || "").toLowerCase().includes(a)
|
|
577
|
-
) : e;
|
|
578
|
-
}
|
|
579
|
-
function la(e, t, a) {
|
|
580
|
-
var c, f;
|
|
581
|
-
const r = (a || "").trim().toLowerCase();
|
|
582
|
-
if (!r) return null;
|
|
583
|
-
const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
584
|
-
for (const m of e)
|
|
585
|
-
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));
|
|
586
|
-
const n = /* @__PURE__ */ new Map();
|
|
587
|
-
for (const m of t) {
|
|
588
|
-
const h = m.layerId || "";
|
|
589
|
-
n.has(h) || n.set(h, []), n.get(h).push(m);
|
|
590
|
-
}
|
|
591
|
-
const s = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
592
|
-
for (const m of e)
|
|
593
|
-
(typeof m.name == "string" ? m.name.toLowerCase() : "").includes(r) ? (s.add(m.id), d.add(m.id)) : W(n.get(m.id) || [], r).length > 0 && d.add(m.id);
|
|
594
|
-
const l = new Set(d);
|
|
595
|
-
for (const m of d) {
|
|
596
|
-
const h = /* @__PURE__ */ new Set([m]);
|
|
597
|
-
let v = (c = i.get(m)) == null ? void 0 : c.parentId;
|
|
598
|
-
for (; v && i.has(v) && !h.has(v); )
|
|
599
|
-
h.add(v), l.add(v), v = (f = i.get(v)) == null ? void 0 : f.parentId;
|
|
600
|
-
}
|
|
601
|
-
const u = [...s];
|
|
602
|
-
for (; u.length > 0; ) {
|
|
603
|
-
const m = u.pop();
|
|
604
|
-
for (const h of o.get(m) || [])
|
|
605
|
-
l.has(h) || (l.add(h), u.push(h));
|
|
606
|
-
}
|
|
607
|
-
const p = /* @__PURE__ */ new Map();
|
|
608
|
-
for (const m of l) {
|
|
609
|
-
const h = n.get(m) || [];
|
|
610
|
-
p.set(m, s.has(m) ? h : W(h, r));
|
|
611
|
-
}
|
|
612
|
-
return { camadasVisiveis: l, feicoesPorCamada: p };
|
|
613
|
-
}
|
|
614
|
-
function da(e, t, a, r = "", i = Se, o) {
|
|
615
|
-
const n = la(e, t, r), s = [], d = /* @__PURE__ */ new Map();
|
|
616
|
-
for (let p = 0; p < t.length; p++) {
|
|
617
|
-
const c = t[p];
|
|
618
|
-
if (!c || !c.id) continue;
|
|
619
|
-
const f = c.layerId || "";
|
|
620
|
-
d.has(f) || d.set(f, []), d.get(f).push(c);
|
|
621
|
-
}
|
|
622
|
-
const l = pe(e);
|
|
623
|
-
function u(p) {
|
|
624
|
-
const c = p.camada;
|
|
625
|
-
if (n && !n.camadasVisiveis.has(c.id) || !(n ? !0 : a.has(c.id))) return;
|
|
626
|
-
for (const g of p.subcamadas)
|
|
627
|
-
u(g);
|
|
628
|
-
const m = n ? n.feicoesPorCamada.get(c.id) || [] : d.get(c.id) || [], h = (o == null ? void 0 : o.get(c.id)) ?? i, v = m.slice(0, h);
|
|
629
|
-
for (let g = 0; g < v.length; g++)
|
|
630
|
-
s.push(v[g].id);
|
|
631
|
-
}
|
|
632
|
-
for (const p of l)
|
|
633
|
-
u(p);
|
|
634
|
-
return s;
|
|
635
|
-
}
|
|
636
|
-
function Xa(e, t, a, r, i, o) {
|
|
637
|
-
if (!e.includes(r)) return null;
|
|
638
|
-
const n = new Set(t);
|
|
639
|
-
let s = a;
|
|
640
|
-
if (o && a && e.includes(a)) {
|
|
641
|
-
const d = e.indexOf(a), l = e.indexOf(r), u = Math.min(d, l), p = Math.max(d, l);
|
|
642
|
-
i || n.clear();
|
|
643
|
-
for (let c = u; c <= p; c++)
|
|
644
|
-
n.add(e[c]);
|
|
645
|
-
} else i ? (n.has(r) ? n.delete(r) : n.add(r), s = r) : (n.clear(), n.add(r), s = r);
|
|
646
|
-
return { selecionados: n, ultimoClicadoId: s };
|
|
647
|
-
}
|
|
648
|
-
function Fe(e, t) {
|
|
649
|
-
if (e.size === 0) return;
|
|
650
|
-
const a = new Set(t.map((r) => r.id));
|
|
651
|
-
for (const r of e)
|
|
652
|
-
a.has(r) || e.delete(r);
|
|
653
|
-
}
|
|
654
|
-
function N(e, t, a) {
|
|
655
|
-
const r = /* @__PURE__ */ new Set();
|
|
656
|
-
let i = e.find((o) => o.id === t);
|
|
657
|
-
for (; i && i.parentId; ) {
|
|
658
|
-
if (r.has(i.id) || (r.add(i.id), i.parentId === a)) return !0;
|
|
659
|
-
i = e.find((o) => o.id === (i == null ? void 0 : i.parentId));
|
|
660
|
-
}
|
|
661
|
-
return !1;
|
|
662
|
-
}
|
|
663
|
-
function Ee(e) {
|
|
664
|
-
return Number.isFinite(e) ? e < 0.25 ? "acima" : e > 0.75 ? "abaixo" : "dentro" : "dentro";
|
|
665
|
-
}
|
|
666
|
-
function Oe(e, t, a, r) {
|
|
667
|
-
if (!t || !a || t === a) return null;
|
|
668
|
-
const i = e.find((l) => l.id === t), o = e.find((l) => l.id === a);
|
|
669
|
-
if (!i || !o) return null;
|
|
670
|
-
const n = i.parentId !== void 0 ? i.parentId : null;
|
|
671
|
-
if (r === "dentro")
|
|
672
|
-
return N(e, o.id, i.id) ? null : (i.parentId = o.id, { tipo: "hierarquia", camada: i, novoParentId: o.id, parentAnteriorId: n });
|
|
673
|
-
if (N(e, o.id, i.id)) return null;
|
|
674
|
-
const s = e.findIndex((l) => l.id === t);
|
|
675
|
-
e.splice(s, 1);
|
|
676
|
-
const d = e.findIndex((l) => l.id === a);
|
|
677
|
-
return d === -1 ? e.push(i) : e.splice(r === "acima" ? d : d + 1, 0, i), i.parentId = o.parentId ?? null, { tipo: "ordem", camada: i, parentAnteriorId: n, novoParentId: i.parentId };
|
|
678
|
-
}
|
|
679
|
-
function Wa(e, t, a, r) {
|
|
680
|
-
const i = e.find((s) => s.id === a), o = t.find((s) => s.id === r);
|
|
681
|
-
if (!i || !o || i.layerId === r) return null;
|
|
682
|
-
const n = i.layerId;
|
|
683
|
-
return i.layerId = r, { feicao: i, camadaOrigemId: n, camadaDestinoId: r, mudouDeCamada: !0 };
|
|
684
|
-
}
|
|
685
|
-
function Ja(e, t, a, r) {
|
|
686
|
-
if (!t || !a || t === a) return null;
|
|
687
|
-
const i = e.findIndex((p) => p.id === t);
|
|
688
|
-
if (i === -1) return null;
|
|
689
|
-
const o = e.find((p) => p.id === a);
|
|
690
|
-
if (!o) return null;
|
|
691
|
-
const [n] = e.splice(i, 1), s = n.layerId, d = o.layerId, l = s !== d;
|
|
692
|
-
l && (n.layerId = d);
|
|
693
|
-
const u = e.findIndex((p) => p.id === a);
|
|
694
|
-
return u === -1 ? e.push(n) : e.splice(r ? u : u + 1, 0, n), { feicao: n, camadaOrigemId: s, camadaDestinoId: d, mudouDeCamada: l };
|
|
695
|
-
}
|
|
696
|
-
function R(e) {
|
|
697
|
-
return `L:${e}`;
|
|
698
|
-
}
|
|
699
|
-
function O(e) {
|
|
700
|
-
return `F:${e}`;
|
|
701
|
-
}
|
|
702
|
-
function Za(e, t, a) {
|
|
703
|
-
if (!a || a.length === 0)
|
|
704
|
-
return [
|
|
705
|
-
...e.map((s) => ({ tipo: "layer", nodo: s })),
|
|
706
|
-
...t.map((s) => ({ tipo: "feature", feicao: s }))
|
|
707
|
-
];
|
|
708
|
-
const r = new Map(e.map((s) => [s.camada.id, s])), i = new Map(t.map((s) => [s.id, s])), o = /* @__PURE__ */ new Set(), n = [];
|
|
709
|
-
for (const s of a)
|
|
710
|
-
if (!o.has(s)) {
|
|
711
|
-
if (s.startsWith("L:")) {
|
|
712
|
-
const d = s.slice(2), l = r.get(d);
|
|
713
|
-
l && (o.add(s), n.push({ tipo: "layer", nodo: l }));
|
|
714
|
-
} else if (s.startsWith("F:")) {
|
|
715
|
-
const d = s.slice(2), l = i.get(d);
|
|
716
|
-
l && (o.add(s), n.push({ tipo: "feature", feicao: l }));
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
for (const s of e) {
|
|
720
|
-
const d = R(s.camada.id);
|
|
721
|
-
o.has(d) || (o.add(d), n.push({ tipo: "layer", nodo: s }));
|
|
722
|
-
}
|
|
723
|
-
for (const s of t) {
|
|
724
|
-
const d = O(s.id);
|
|
725
|
-
o.has(d) || (o.add(d), n.push({ tipo: "feature", feicao: s }));
|
|
726
|
-
}
|
|
727
|
-
return n;
|
|
728
|
-
}
|
|
729
|
-
function me(e, t, a, r) {
|
|
730
|
-
const i = a.filter((u) => u.parentId === t).map((u) => u.id), o = r.filter((u) => u.layerId === t).map((u) => u.id), n = /* @__PURE__ */ new Set([
|
|
731
|
-
...i.map(R),
|
|
732
|
-
...o.map(O)
|
|
733
|
-
]), s = e.get(t), d = [], l = /* @__PURE__ */ new Set();
|
|
734
|
-
if (s)
|
|
735
|
-
for (const u of s)
|
|
736
|
-
n.has(u) && !l.has(u) && (l.add(u), d.push(u));
|
|
737
|
-
for (const u of i) {
|
|
738
|
-
const p = R(u);
|
|
739
|
-
l.has(p) || (l.add(p), d.push(p));
|
|
740
|
-
}
|
|
741
|
-
for (const u of o) {
|
|
742
|
-
const p = O(u);
|
|
743
|
-
l.has(p) || (l.add(p), d.push(p));
|
|
744
|
-
}
|
|
745
|
-
return d;
|
|
746
|
-
}
|
|
747
|
-
function ge(e, t, a, r) {
|
|
748
|
-
const i = e.filter((n) => n !== t), o = i.indexOf(a);
|
|
749
|
-
o === -1 ? i.push(t) : i.splice(r ? o : o + 1, 0, t), e.length = 0, e.push(...i);
|
|
750
|
-
}
|
|
751
|
-
function _(e, t, a) {
|
|
752
|
-
if (!t) return;
|
|
753
|
-
const r = e.get(t);
|
|
754
|
-
if (!r) return;
|
|
755
|
-
const i = r.filter((o) => o !== a);
|
|
756
|
-
i.length === 0 ? e.delete(t) : e.set(t, i);
|
|
757
|
-
}
|
|
758
|
-
function et(e, t) {
|
|
759
|
-
const a = t.filter((n) => n.startsWith("L:")).map((n) => n.slice(2));
|
|
760
|
-
if (a.length < 2) return;
|
|
761
|
-
const r = new Set(a), i = [], o = /* @__PURE__ */ new Map();
|
|
762
|
-
for (let n = 0; n < e.length; n++)
|
|
763
|
-
r.has(e[n].id) && (i.push(n), o.set(e[n].id, e[n]));
|
|
764
|
-
if (i.length === a.length)
|
|
765
|
-
for (let n = 0; n < i.length; n++) {
|
|
766
|
-
const s = o.get(a[n]);
|
|
767
|
-
s && (e[i[n]] = s);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
function at(e, t) {
|
|
771
|
-
const a = t.filter((n) => n.startsWith("F:")).map((n) => n.slice(2));
|
|
772
|
-
if (a.length < 2) return;
|
|
773
|
-
const r = new Set(a), i = [], o = /* @__PURE__ */ new Map();
|
|
774
|
-
for (let n = 0; n < e.length; n++)
|
|
775
|
-
r.has(e[n].id) && (i.push(n), o.set(e[n].id, e[n]));
|
|
776
|
-
if (i.length === a.length)
|
|
777
|
-
for (let n = 0; n < i.length; n++) {
|
|
778
|
-
const s = o.get(a[n]);
|
|
779
|
-
s && (e[i[n]] = s);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
function Re(e, t, a, r, i, o) {
|
|
783
|
-
if (!r || !i) return null;
|
|
784
|
-
const n = e.find((p) => p.id === r), s = t.find((p) => p.id === i);
|
|
785
|
-
if (!n || !s || !s.layerId) return null;
|
|
786
|
-
const d = s.layerId;
|
|
787
|
-
if (d === r || N(e, d, r)) return null;
|
|
788
|
-
const l = n.parentId !== void 0 ? n.parentId : null;
|
|
789
|
-
l && l !== d && _(a, l, R(r)), n.parentId = d;
|
|
790
|
-
const u = me(a, d, e, t);
|
|
791
|
-
return ge(u, R(r), O(i), o), a.set(d, u), et(e, u), {
|
|
792
|
-
tipo: l !== d ? "hierarquia" : "ordem",
|
|
793
|
-
camada: n,
|
|
794
|
-
parentAnteriorId: l,
|
|
795
|
-
novoParentId: d
|
|
796
|
-
};
|
|
797
|
-
}
|
|
798
|
-
function tt(e, t, a, r, i, o) {
|
|
799
|
-
if (!r || !i) return null;
|
|
800
|
-
const n = t.find((c) => c.id === r), s = e.find((c) => c.id === i);
|
|
801
|
-
if (!n || !s || !s.parentId) return null;
|
|
802
|
-
const d = s.parentId, l = n.layerId, u = l !== d;
|
|
803
|
-
u && (_(a, l, O(r)), n.layerId = d);
|
|
804
|
-
const p = me(a, d, e, t);
|
|
805
|
-
return ge(p, O(r), R(i), o), a.set(d, p), at(t, p), { feicao: n, camadaOrigemId: l, camadaDestinoId: d, mudouDeCamada: u };
|
|
806
|
-
}
|
|
807
|
-
function je(e, t, a, r, i, o, n, s) {
|
|
808
|
-
const d = R(r);
|
|
809
|
-
if (n && (n !== s || o === "dentro") && _(a, n, d), o !== "dentro" && s && a.has(s)) {
|
|
810
|
-
const l = me(a, s, e, t);
|
|
811
|
-
ge(l, d, R(i), o === "acima"), a.set(s, l);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
function rt(e, t, a, r, i, o, n, s) {
|
|
815
|
-
const d = O(r);
|
|
816
|
-
if (n && n !== s && _(a, n, d), s && a.has(s)) {
|
|
817
|
-
const l = me(a, s, e, t);
|
|
818
|
-
ge(l, d, O(i), o), a.set(s, l);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
function it(e, t, a, r) {
|
|
822
|
-
const i = O(t);
|
|
823
|
-
if (_(e, a, i), r && e.has(r)) {
|
|
824
|
-
const o = e.get(r);
|
|
825
|
-
o.includes(i) || o.push(i);
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
function ot(e) {
|
|
829
|
-
const {
|
|
830
|
-
camadas: t,
|
|
831
|
-
feicoes: a,
|
|
832
|
-
camadaAtivaId: r,
|
|
833
|
-
expandedLayers: i,
|
|
834
|
-
selectedFeatureIds: o,
|
|
835
|
-
activeSettingsLayerId: n,
|
|
836
|
-
editingLayerId: s,
|
|
837
|
-
editingFeatureId: d,
|
|
838
|
-
searchQuery: l,
|
|
839
|
-
titulo: u = "CAMADAS",
|
|
840
|
-
mostrarBusca: p = !0,
|
|
841
|
-
limitesPorCamada: c,
|
|
842
|
-
limiteFeicoesPorCamada: f = Se,
|
|
843
|
-
mostrarBotaoColapsar: m = !1,
|
|
844
|
-
ordemFilhosPorPai: h
|
|
845
|
-
} = e, v = (l || "").trim().toLowerCase(), g = la(t, a, v), w = /* @__PURE__ */ new Map();
|
|
846
|
-
for (let x = 0; x < a.length; x++) {
|
|
847
|
-
const y = a[x];
|
|
848
|
-
if (!y || !y.id) continue;
|
|
849
|
-
const z = y.layerId || "";
|
|
850
|
-
w.has(z) || w.set(z, []), w.get(z).push(y);
|
|
851
|
-
}
|
|
852
|
-
const k = fe(t), L = t.every((x) => x.visible !== !1), A = t.length > 0 && t.every((x) => i.has(x.id)), S = p ? `
|
|
853
|
-
<div class="ui-tree-search-wrapper" part="busca">
|
|
854
|
-
<span class="ui-tree-search-icon">${b.busca}</span>
|
|
855
|
-
<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="${M(
|
|
856
|
-
l
|
|
857
|
-
)}" />
|
|
858
|
-
${l ? `<button class="ui-tree-search-clear" id="btn-clear-layer-search" title="Limpar busca" aria-label="Limpar busca">${b.fechar}</button>` : ""}
|
|
859
|
-
</div>
|
|
860
|
-
` : "", F = `
|
|
861
|
-
<div class="ui-tree-toolbar" part="toolbar">
|
|
862
|
-
<div class="ui-tree-title-group">
|
|
863
|
-
<span class="ui-tree-section-title">${M(u || "CAMADAS")}</span>
|
|
864
|
-
<span class="ui-tree-count-badge">${t.length}</span>
|
|
865
|
-
</div>
|
|
866
|
-
<div class="ui-tree-actions">
|
|
867
|
-
<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"}">
|
|
868
|
-
${L ? b.olhoAberto : b.olhoFechado}
|
|
869
|
-
</button>
|
|
870
|
-
<button id="btn-toggle-all-expand" class="ui-tree-action-btn" aria-label="${A ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}" title="${A ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}">
|
|
871
|
-
<span class="ui-chevron-icon ${A ? "open" : ""}">${b.chevronDir}</span>
|
|
872
|
-
</button>
|
|
873
|
-
${m ? `<button id="btn-colapsar" class="ui-camadas-btn-colapsar" title="Recolher painel" aria-label="Recolher painel">${b.recolherPainel}</button>` : ""}
|
|
874
|
-
</div>
|
|
875
|
-
</div>
|
|
876
|
-
${S}
|
|
877
|
-
`, B = (x) => {
|
|
878
|
-
const y = x.camada;
|
|
879
|
-
if (g && !g.camadasVisiveis.has(y.id)) return "";
|
|
880
|
-
const z = x.depth, U = x.subcamadas, Me = g ? U.filter(($) => g.camadasVisiveis.has($.camada.id)) : U, te = !!(y.isGroup || U.length > 0), C = M(y.id), re = M(y.name || (te ? "Novo Grupo" : "Camada")), H = K(y.color, "#00E08A"), ie = y.visible !== !1, oe = y.locked === !0, ne = v ? !0 : i.has(y.id), he = n === y.id, ve = r === y.id, G = k.get(y.id), xa = (G == null ? void 0 : G.ocultaPorAncestral) === !0, wa = (G == null ? void 0 : G.travadaPorAncestral) === !0, j = g ? g.feicoesPorCamada.get(y.id) || [] : w.get(y.id) || [], se = g ? j : ae(t, a, y.id), ze = se.length > 0 && se.every(($) => o.has($.id)), Aa = !ze && se.some(($) => o.has($.id)), be = (c == null ? void 0 : c.get(y.id)) ?? f, Ea = j.slice(0, be), Ia = j.length > be, ka = aa(y, z, G), La = ($) => sa($, ka, o.has($.id), d === $.id), Ca = Ia ? oa(C, be, j.length) : "", Pe = Number(y.opacity ?? 1), Be = Number.isFinite(Pe) ? Math.min(1, Math.max(0, Pe)) : 1, Sa = Math.round(Be * 100), Fa = t.filter(($) => $.id !== y.id && !N(t, $.id, y.id)).map(
|
|
881
|
-
($) => `<option value="${M($.id)}" ${y.parentId === $.id ? "selected" : ""}>${$.isGroup ? "📁 " : ""}${M($.name)}</option>`
|
|
882
|
-
).join(""), $a = he ? `
|
|
883
|
-
<div class="ui-layer-settings-drawer" id="settings-drawer-${C}" part="drawer" style="--drawer-cor-camada: ${H};">
|
|
884
|
-
<div class="ui-drawer-header">
|
|
885
|
-
<div class="ui-drawer-header-left">
|
|
886
|
-
<span class="ui-drawer-icon">${b.engrenagem}</span>
|
|
887
|
-
<span class="ui-drawer-title">Configurações da Camada</span>
|
|
888
|
-
<span class="ui-drawer-layer-chip" title="${re}">${re}</span>
|
|
889
|
-
</div>
|
|
890
|
-
<button type="button" class="ui-drawer-btn-fechar" data-layer-settings-close="${C}" title="Fechar configurações (Esc)" aria-label="Fechar configurações">
|
|
891
|
-
${b.fechar}
|
|
892
|
-
</button>
|
|
893
|
-
</div>
|
|
894
|
-
|
|
895
|
-
<div class="ui-drawer-body">
|
|
896
|
-
<!-- Cor da Camada -->
|
|
897
|
-
<div class="ui-drawer-row">
|
|
898
|
-
<div class="ui-drawer-row-label">
|
|
899
|
-
<span>Cor do Vetor</span>
|
|
900
|
-
</div>
|
|
901
|
-
<div class="ui-drawer-color-group">
|
|
902
|
-
<label class="ui-drawer-color-pill" title="Clique para alterar a cor da camada">
|
|
903
|
-
<span class="ui-drawer-color-sample" id="sample-color-${C}" style="background-color: ${H};"></span>
|
|
904
|
-
<span class="ui-drawer-color-hex" id="hex-color-${C}">${H.toUpperCase()}</span>
|
|
905
|
-
<input type="color" aria-label="Cor da camada" data-layer-color-picker="${C}" value="${Ga(H, "#00e08a")}" class="ui-drawer-color-native" />
|
|
906
|
-
</label>
|
|
907
|
-
</div>
|
|
908
|
-
</div>
|
|
909
|
-
|
|
910
|
-
<!-- Opacidade da Camada -->
|
|
911
|
-
<div class="ui-drawer-row">
|
|
912
|
-
<div class="ui-drawer-row-label">
|
|
913
|
-
<span>Opacidade</span>
|
|
914
|
-
<span class="ui-drawer-badge" id="badge-op-${C}">${Sa}%</span>
|
|
915
|
-
</div>
|
|
916
|
-
<div class="ui-drawer-slider-container">
|
|
917
|
-
<input type="range" aria-label="Opacidade da camada" min="0.05" max="1" step="0.05" value="${Number(Be) || 0}" data-layer-opacity-slider="${C}" class="ui-drawer-slider" />
|
|
918
|
-
</div>
|
|
919
|
-
</div>
|
|
920
|
-
|
|
921
|
-
<!-- Hierarquia / Grupo Pai -->
|
|
922
|
-
<div class="ui-drawer-row">
|
|
923
|
-
<div class="ui-drawer-row-label">
|
|
924
|
-
<span>Pertence ao Grupo</span>
|
|
925
|
-
</div>
|
|
926
|
-
<div class="ui-drawer-select-wrapper">
|
|
927
|
-
<select class="ui-drawer-select" data-layer-parent-select="${C}" aria-label="Grupo pai da camada">
|
|
928
|
-
<option value="" ${y.parentId ? "" : "selected"}>(Nenhum - Nível Principal)</option>
|
|
929
|
-
${Fa}
|
|
930
|
-
</select>
|
|
931
|
-
</div>
|
|
932
|
-
</div>
|
|
933
|
-
</div>
|
|
934
|
-
|
|
935
|
-
<div class="ui-drawer-footer">
|
|
936
|
-
<div class="ui-drawer-meta-info">
|
|
937
|
-
<span>${U.length > 0 ? `${U.length} subcamadas · ` : ""}${j.length} ${j.length === 1 ? "feição" : "feições"}</span>
|
|
938
|
-
</div>
|
|
939
|
-
<div class="ui-drawer-actions">
|
|
940
|
-
<button type="button" class="ui-drawer-btn-sublayer" data-add-sublayer="${C}" title="Adicionar nova camada dentro desta">
|
|
941
|
-
${b.mais} Subcamada
|
|
942
|
-
</button>
|
|
943
|
-
<button type="button" class="ui-drawer-btn-danger" data-delete-layer="${C}" title="Excluir esta camada e suas feições">
|
|
944
|
-
${b.lixeira}
|
|
945
|
-
<span class="ui-btn-label">Excluir</span>
|
|
946
|
-
</button>
|
|
947
|
-
</div>
|
|
948
|
-
</div>
|
|
949
|
-
</div>
|
|
950
|
-
` : "", Ma = Za(
|
|
951
|
-
Me,
|
|
952
|
-
Ea,
|
|
953
|
-
h == null ? void 0 : h.get(y.id)
|
|
954
|
-
).map(($) => $.tipo === "layer" ? B($.nodo) : La($.feicao)).join("");
|
|
955
|
-
return `
|
|
956
|
-
<div class="ui-layer-group ${z > 0 ? "is-sublayer-group" : ""}" data-layer-id="${C}" data-layer-depth="${z}" role="treeitem" aria-level="${z + 1}" aria-expanded="${ne}" part="grupo" style="--layer-active-color: ${H};">
|
|
957
|
-
<div class="ui-layer-row ${ie ? "" : "hidden-layer"} ${ve ? "active-drawing-layer" : ""} ${z > 0 ? "is-sublayer" : ""} ${te ? "is-group-row" : ""} ${xa ? "herdado-oculto" : ""} ${wa ? "herdado-travado" : ""}" data-layer-row="${C}" data-layer-id="${C}" tabindex="-1" draggable="true" part="${ve ? "camada camada-ativa" : "camada"}" ${ve ? 'aria-current="true"' : ""} style="--layer-depth: ${z};">
|
|
958
|
-
<div class="ui-col ui-col-drag" title="Arrastar para reordenar Z-Index">${b.dragHandle}</div>
|
|
959
|
-
|
|
960
|
-
<div class="ui-col ui-col-eye" data-layer-eye="${C}" role="button" tabindex="0" aria-label="${ie ? "Ocultar Camada" : "Exibir Camada"}" title="${ie ? "Ocultar Camada" : "Exibir Camada"}">
|
|
961
|
-
${ie ? b.olhoAberto : b.olhoFechado}
|
|
962
|
-
</div>
|
|
963
|
-
|
|
964
|
-
<div class="ui-col ui-col-lock ${oe ? "" : "ui-lock-open"}" data-layer-lock="${C}" role="button" tabindex="0" aria-label="${oe ? "Desbloquear Camada" : "Bloquear Camada"}" title="${oe ? "Desbloquear Camada" : "Bloquear Camada"}">
|
|
965
|
-
${oe ? b.cadeadoTrancado : b.cadeadoAberto}
|
|
966
|
-
</div>
|
|
967
|
-
|
|
968
|
-
<div class="ui-col ui-col-colorbar ui-col-colorbar-editavel" data-layer-color="${C}" role="button" tabindex="0" style="background: ${H};" aria-label="Alterar cor da camada" title="Alterar cor da camada (usada no destaque de seleção)"></div>
|
|
969
|
-
|
|
970
|
-
<div class="ui-col ui-col-chevron" data-layer-expand="${C}" role="button" tabindex="0" aria-label="${ne ? "Recolher grupo" : "Expandir grupo"}">
|
|
971
|
-
<span class="ui-chevron-icon ${ne ? "open" : ""}">${b.chevronDir}</span>
|
|
972
|
-
</div>
|
|
973
|
-
|
|
974
|
-
<div class="ui-col ui-col-name" data-layer-name-trigger="${C}" title="Clique para ativar camada de desenho | Duplo clique para renomear">
|
|
975
|
-
${s === y.id ? `<input type="text" class="ui-inline-rename-input" data-inline-layer-input="${C}" value="${re}" />` : `<span class="ui-name-text">${re}</span>
|
|
976
|
-
${ra(se.length, j.length, U.length, te)}`}
|
|
977
|
-
</div>
|
|
978
|
-
|
|
979
|
-
<div class="ui-col ui-col-actions">
|
|
980
|
-
<button class="ui-micro-btn" data-layer-fit="${C}" title="Enquadrar camada no mapa" aria-label="Enquadrar camada no mapa">${b.alvoEnquadrar}</button>
|
|
981
|
-
<button class="ui-micro-btn ${he ? "active" : ""}" data-layer-settings="${C}" title="Ajustar cor, hierarquia, opacidade e excluir" aria-label="Configurações da camada" aria-expanded="${he}">${b.engrenagem}</button>
|
|
982
|
-
</div>
|
|
983
|
-
|
|
984
|
-
<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">
|
|
985
|
-
<div class="ui-target-circle ${ze ? "selected" : Aa ? "partial" : ""}"></div>
|
|
986
|
-
</div>
|
|
987
|
-
</div>
|
|
988
|
-
|
|
989
|
-
${$a}
|
|
990
|
-
|
|
991
|
-
<div class="ui-children-container ${z > 0 ? "is-subchildren" : ""}" role="group" style="--parent-depth: ${z}; --parent-layer-color: ${H}; display: ${ne ? "block" : "none"};">
|
|
992
|
-
${Ma}
|
|
993
|
-
${Ca}
|
|
994
|
-
${Me.length === 0 && j.length === 0 ? na(te) : ""}
|
|
995
|
-
</div>
|
|
996
|
-
</div>
|
|
997
|
-
`;
|
|
998
|
-
}, E = pe(t), P = g && g.camadasVisiveis.size === 0 ? `<div class="ui-search-empty" role="status">Nenhum resultado para “${M((l || "").trim())}”</div>` : E.map((x) => B(x)).join("");
|
|
999
|
-
return `
|
|
1000
|
-
${F}
|
|
1001
|
-
<div class="ui-panel-box">
|
|
1002
|
-
<div class="ui-layer-tree" id="ui-layer-tree-mount" role="tree" aria-label="Camadas e feições" aria-multiselectable="true" part="arvore">
|
|
1003
|
-
${P}
|
|
1004
|
-
</div>
|
|
1005
|
-
</div>
|
|
1006
|
-
`;
|
|
1007
|
-
}
|
|
1008
|
-
function nt(e) {
|
|
1009
|
-
return [
|
|
1010
|
-
{
|
|
1011
|
-
gatilho: "data-layer-name-trigger",
|
|
1012
|
-
input: "data-inline-layer-input",
|
|
1013
|
-
linha: "data-layer-row",
|
|
1014
|
-
marcarEditando: (t) => {
|
|
1015
|
-
e.editingLayerId = t;
|
|
1016
|
-
},
|
|
1017
|
-
aplicar: (t, a) => {
|
|
1018
|
-
const r = e.camadas.find((i) => i.id === t);
|
|
1019
|
-
return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { camadaId: t, novoNome: a, camada: r }, salvar: !0 });
|
|
1020
|
-
},
|
|
1021
|
-
emitir: (t) => e.dispararEvento("ui-camada-renomeada", t)
|
|
1022
|
-
},
|
|
1023
|
-
{
|
|
1024
|
-
gatilho: "data-feat-name-trigger",
|
|
1025
|
-
input: "data-inline-feat-input",
|
|
1026
|
-
linha: "data-feat-row",
|
|
1027
|
-
marcarEditando: (t) => {
|
|
1028
|
-
e.editingFeatureId = t;
|
|
1029
|
-
},
|
|
1030
|
-
aplicar: (t, a) => {
|
|
1031
|
-
const r = e.feicoes.find((i) => i.id === t);
|
|
1032
|
-
return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { feicaoId: t, novoNome: a, feicao: r }, salvar: !1 });
|
|
1033
|
-
},
|
|
1034
|
-
emitir: (t) => e.dispararEvento("ui-feicao-renomeada", t)
|
|
1035
|
-
}
|
|
1036
|
-
];
|
|
1037
|
-
}
|
|
1038
|
-
function Ne(e, t, a = t) {
|
|
1039
|
-
for (const r of nt(e))
|
|
1040
|
-
a.querySelectorAll(`[${r.gatilho}]`).forEach((i) => {
|
|
1041
|
-
i.addEventListener("dblclick", (o) => {
|
|
1042
|
-
o.stopPropagation();
|
|
1043
|
-
const n = i.getAttribute(r.gatilho);
|
|
1044
|
-
if (!n) return;
|
|
1045
|
-
r.marcarEditando(n), e.solicitarRenderizacao();
|
|
1046
|
-
const s = D(t, r.input, n);
|
|
1047
|
-
if (!s) return;
|
|
1048
|
-
s.focus(), s.select();
|
|
1049
|
-
let d = !1;
|
|
1050
|
-
const l = (u, p = !1) => {
|
|
1051
|
-
var c, f;
|
|
1052
|
-
if (!d) {
|
|
1053
|
-
if (d = !0, r.marcarEditando(null), u) {
|
|
1054
|
-
const m = r.aplicar(n, s.value.trim());
|
|
1055
|
-
m && (m.salvar && ((c = e.salvarLembrancaEstado) == null || c.call(e)), r.emitir(m.detalhe));
|
|
1056
|
-
}
|
|
1057
|
-
e.solicitarRenderizacao(), p && ((f = D(t, r.linha, n)) == null || f.focus());
|
|
1058
|
-
}
|
|
1059
|
-
};
|
|
1060
|
-
s.addEventListener("keydown", (u) => {
|
|
1061
|
-
u.key === "Enter" ? (u.preventDefault(), l(!0, !0)) : u.key === "Escape" && (u.preventDefault(), l(!1, !0));
|
|
1062
|
-
}), s.addEventListener("blur", () => l(!0));
|
|
1063
|
-
});
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
const st = ["dragging", "drop-above", "drop-below", "drop-into"];
|
|
1067
|
-
class lt {
|
|
1068
|
-
constructor(t, a) {
|
|
1069
|
-
I(this, "host");
|
|
1070
|
-
I(this, "shadow");
|
|
1071
|
-
/** Cancela um arraste por toque em andamento (remove os ouvintes de `window`). */
|
|
1072
|
-
I(this, "cancelarToque", null);
|
|
1073
|
-
/**
|
|
1074
|
-
* Arraste HTML5 em andamento. Fica no gerenciador (e não numa closure de `bindDragAndDrop`) para que linhas
|
|
1075
|
-
* ligadas depois, na atualização incremental, enxerguem o arraste iniciado numa linha mais antiga.
|
|
1076
|
-
*/
|
|
1077
|
-
I(this, "arraste", {
|
|
1078
|
-
tipo: null,
|
|
1079
|
-
camadaId: null,
|
|
1080
|
-
feicaoId: null
|
|
1081
|
-
});
|
|
1082
|
-
this.host = t, this.shadow = a;
|
|
1083
|
-
}
|
|
1084
|
-
bindAll() {
|
|
1085
|
-
this.bindInlineRename(), this.bindDragAndDrop(), this.bindTouchDragAndDrop();
|
|
1086
|
-
}
|
|
1087
|
-
/** Solta o que ficou em `window` (arraste por toque interrompido pela desconexão do componente). */
|
|
1088
|
-
destruir() {
|
|
1089
|
-
var t;
|
|
1090
|
-
(t = this.cancelarToque) == null || t.call(this), this.cancelarToque = null;
|
|
1091
|
-
}
|
|
1092
|
-
bindInlineRename() {
|
|
1093
|
-
Ne(this.host, this.shadow);
|
|
1094
|
-
}
|
|
1095
|
-
limparClassesDeArraste() {
|
|
1096
|
-
this.shadow.querySelectorAll(".ui-layer-row, .ui-feat-row, .ui-layer-group").forEach((t) => {
|
|
1097
|
-
t.classList.remove(...st);
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
/** Depois de qualquer mudança na ordem/hierarquia de camadas. */
|
|
1101
|
-
aposReordenarCamadas() {
|
|
1102
|
-
var t, a;
|
|
1103
|
-
(a = (t = this.host).salvarLembrancaEstado) == null || a.call(t), this.host.dispararEvento("ui-camadas-reordenadas", { camadas: [...this.host.camadas] }), this.host.solicitarRenderizacao();
|
|
1104
|
-
}
|
|
1105
|
-
emitirFeicaoMovida(t) {
|
|
1106
|
-
this.host.dispararEvento("ui-feicao-movida", {
|
|
1107
|
-
feicaoId: t.feicao.id,
|
|
1108
|
-
camadaOrigemId: t.camadaOrigemId,
|
|
1109
|
-
camadaDestinoId: t.camadaDestinoId,
|
|
1110
|
-
feicao: t.feicao,
|
|
1111
|
-
feicoes: [...this.host.feicoes]
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
/** Camada travada (ou sob grupo travado) ou feição individualmente travada não pode ser movida entre camadas. */
|
|
1115
|
-
trocaEntreCamadasTravada(t, a) {
|
|
1116
|
-
const r = this.host.feicoes.find((n) => n.id === t), i = r == null ? void 0 : r.layerId;
|
|
1117
|
-
if (!a || i === a) return !1;
|
|
1118
|
-
if ((r == null ? void 0 : r.locked) === !0) return !0;
|
|
1119
|
-
const o = de(this.host.camadas);
|
|
1120
|
-
return o.has(a) || !!i && o.has(i);
|
|
1121
|
-
}
|
|
1122
|
-
arrasteBloqueado(t) {
|
|
1123
|
-
return !!t.closest("input, button, select") || !!this.host.editingLayerId || !!this.host.editingFeatureId;
|
|
1124
|
-
}
|
|
1125
|
-
/** Render completo: zera o arraste e liga camadas e feições do painel todo. */
|
|
1126
|
-
bindDragAndDrop() {
|
|
1127
|
-
this.arraste = { tipo: null, camadaId: null, feicaoId: null }, this.vincularArrasteCamadas(this.shadow), this.vincularArrasteFeicoes(this.shadow);
|
|
1128
|
-
}
|
|
1129
|
-
/** Atualização incremental: liga renomear e arraste só nas linhas de feição novas dentro de `raiz`. */
|
|
1130
|
-
bindLinhasFeicao(t) {
|
|
1131
|
-
Ne(this.host, this.shadow, t), this.vincularArrasteFeicoes(t);
|
|
1132
|
-
}
|
|
1133
|
-
vincularArrasteCamadas(t) {
|
|
1134
|
-
t.querySelectorAll('.ui-layer-row[draggable="true"]').forEach((a) => {
|
|
1135
|
-
const r = a.getAttribute("data-layer-id");
|
|
1136
|
-
r && (a.addEventListener("dragstart", (i) => {
|
|
1137
|
-
const o = i;
|
|
1138
|
-
if (this.arrasteBloqueado(o.target)) {
|
|
1139
|
-
o.preventDefault();
|
|
1140
|
-
return;
|
|
1141
|
-
}
|
|
1142
|
-
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");
|
|
1143
|
-
}), a.addEventListener("dragover", (i) => {
|
|
1144
|
-
const o = i;
|
|
1145
|
-
if (o.preventDefault(), o.stopPropagation(), o.dataTransfer && (o.dataTransfer.dropEffect = "move"), this.arraste.tipo === "layer") {
|
|
1146
|
-
if (this.arraste.camadaId === r) return;
|
|
1147
|
-
const n = a.getBoundingClientRect(), s = Ee((o.clientY - n.top) / n.height);
|
|
1148
|
-
a.classList.toggle("drop-above", s === "acima"), a.classList.toggle("drop-below", s === "abaixo"), a.classList.toggle("drop-into", s === "dentro");
|
|
1149
|
-
} else if (this.arraste.tipo === "feature") {
|
|
1150
|
-
const n = this.host.camadas.find((s) => s.id === r);
|
|
1151
|
-
if (n != null && n.parentId) {
|
|
1152
|
-
const s = a.getBoundingClientRect(), d = s.height > 0 ? Ee((o.clientY - s.top) / s.height) : "dentro";
|
|
1153
|
-
a.classList.toggle("drop-above", d === "acima"), a.classList.toggle("drop-below", d === "abaixo"), a.classList.toggle("drop-into", d === "dentro");
|
|
1154
|
-
} else
|
|
1155
|
-
a.classList.remove("drop-above", "drop-below"), a.classList.add("drop-into");
|
|
1156
|
-
}
|
|
1157
|
-
}), a.addEventListener("dragleave", (i) => {
|
|
1158
|
-
const o = i.relatedTarget;
|
|
1159
|
-
o && a.contains(o) || a.classList.remove("drop-above", "drop-below", "drop-into");
|
|
1160
|
-
}), a.addEventListener("drop", (i) => {
|
|
1161
|
-
var s, d, l, u, p;
|
|
1162
|
-
const o = i;
|
|
1163
|
-
o.preventDefault(), o.stopPropagation();
|
|
1164
|
-
const n = a.classList.contains("drop-into") ? "dentro" : a.classList.contains("drop-above") ? "acima" : "abaixo";
|
|
1165
|
-
if (this.limparClassesDeArraste(), this.arraste.tipo === "layer") {
|
|
1166
|
-
if (!this.arraste.camadaId || this.arraste.camadaId === r || !this.host.camadas.some((f) => f.id === this.arraste.camadaId) || !this.host.camadas.some((f) => f.id === r)) return;
|
|
1167
|
-
const c = Oe(this.host.camadas, this.arraste.camadaId, r, n);
|
|
1168
|
-
c && this.host.ordemFilhosPorPai && je(
|
|
1169
|
-
this.host.camadas,
|
|
1170
|
-
this.host.feicoes,
|
|
1171
|
-
this.host.ordemFilhosPorPai,
|
|
1172
|
-
this.arraste.camadaId,
|
|
1173
|
-
r,
|
|
1174
|
-
n,
|
|
1175
|
-
c.parentAnteriorId,
|
|
1176
|
-
c.novoParentId
|
|
1177
|
-
), (c == null ? void 0 : c.tipo) === "hierarquia" ? ((s = this.host.expandedLayers) == null || s.add(c.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1178
|
-
camadaId: c.camada.id,
|
|
1179
|
-
novoParentId: c.novoParentId,
|
|
1180
|
-
parentAnteriorId: c.parentAnteriorId,
|
|
1181
|
-
camada: c.camada
|
|
1182
|
-
})) : c && c.parentAnteriorId !== c.novoParentId && this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1183
|
-
camadaId: c.camada.id,
|
|
1184
|
-
novoParentId: c.novoParentId,
|
|
1185
|
-
parentAnteriorId: c.parentAnteriorId,
|
|
1186
|
-
camada: c.camada
|
|
1187
|
-
}), this.aposReordenarCamadas();
|
|
1188
|
-
} else if (this.arraste.tipo === "feature") {
|
|
1189
|
-
if (!this.arraste.feicaoId) return;
|
|
1190
|
-
const c = this.host.camadas.find((f) => f.id === r);
|
|
1191
|
-
if (c != null && c.parentId && (n === "acima" || n === "abaixo")) {
|
|
1192
|
-
if (this.trocaEntreCamadasTravada(this.arraste.feicaoId, c.parentId) || !this.host.ordemFilhosPorPai) return;
|
|
1193
|
-
const f = tt(
|
|
1194
|
-
this.host.camadas,
|
|
1195
|
-
this.host.feicoes,
|
|
1196
|
-
this.host.ordemFilhosPorPai,
|
|
1197
|
-
this.arraste.feicaoId,
|
|
1198
|
-
r,
|
|
1199
|
-
n === "acima"
|
|
1200
|
-
);
|
|
1201
|
-
if (!f) return;
|
|
1202
|
-
this.host.dispararEvento("ui-feicoes-reordenadas", { feicoes: [...this.host.feicoes] }), f.mudouDeCamada && this.emitirFeicaoMovida(f), (l = (d = this.host).salvarLembrancaEstado) == null || l.call(d), this.host.solicitarRenderizacao();
|
|
1203
|
-
} else {
|
|
1204
|
-
if (this.trocaEntreCamadasTravada(this.arraste.feicaoId, r)) return;
|
|
1205
|
-
const f = Wa(this.host.feicoes, this.host.camadas, this.arraste.feicaoId, r);
|
|
1206
|
-
f && (this.host.ordemFilhosPorPai && it(
|
|
1207
|
-
this.host.ordemFilhosPorPai,
|
|
1208
|
-
f.feicao.id,
|
|
1209
|
-
f.camadaOrigemId,
|
|
1210
|
-
f.camadaDestinoId
|
|
1211
|
-
), this.emitirFeicaoMovida(f), (p = (u = this.host).salvarLembrancaEstado) == null || p.call(u), this.host.solicitarRenderizacao());
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
}), a.addEventListener("dragend", () => {
|
|
1215
|
-
this.arraste.tipo = null, this.arraste.camadaId = null, this.arraste.feicaoId = null, this.limparClassesDeArraste();
|
|
1216
|
-
}));
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
vincularArrasteFeicoes(t) {
|
|
1220
|
-
t.querySelectorAll('.ui-feat-row[draggable="true"]').forEach((a) => {
|
|
1221
|
-
const r = a.getAttribute("data-feat-row"), i = a.getAttribute("data-feat-layer");
|
|
1222
|
-
r && (a.addEventListener("dragstart", (o) => {
|
|
1223
|
-
const n = o;
|
|
1224
|
-
if (this.arrasteBloqueado(n.target)) {
|
|
1225
|
-
n.preventDefault();
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
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");
|
|
1229
|
-
}), a.addEventListener("dragover", (o) => {
|
|
1230
|
-
const n = o, s = this.arraste.tipo === "feature" && this.arraste.feicaoId !== r, d = this.arraste.tipo === "layer" && !!this.arraste.camadaId && !!i && this.arraste.camadaId !== i && !N(this.host.camadas, i, this.arraste.camadaId);
|
|
1231
|
-
if (!s && !d) return;
|
|
1232
|
-
n.preventDefault(), n.stopPropagation(), n.dataTransfer && (n.dataTransfer.dropEffect = "move");
|
|
1233
|
-
const l = a.getBoundingClientRect(), u = n.clientY - l.top < l.height / 2;
|
|
1234
|
-
a.classList.toggle("drop-above", u), a.classList.toggle("drop-below", !u);
|
|
1235
|
-
}), a.addEventListener("dragleave", (o) => {
|
|
1236
|
-
const n = o.relatedTarget;
|
|
1237
|
-
n && a.contains(n) || a.classList.remove("drop-above", "drop-below");
|
|
1238
|
-
}), a.addEventListener("drop", (o) => {
|
|
1239
|
-
var l, u, p;
|
|
1240
|
-
const n = o, s = a.getBoundingClientRect(), d = a.classList.contains("drop-above") ? !0 : a.classList.contains("drop-below") ? !1 : s.height > 0 && n.clientY - s.top < s.height / 2;
|
|
1241
|
-
if (this.arraste.tipo === "feature") {
|
|
1242
|
-
if (!this.arraste.feicaoId || this.arraste.feicaoId === r || (n.preventDefault(), n.stopPropagation(), this.limparClassesDeArraste(), this.trocaEntreCamadasTravada(this.arraste.feicaoId, i))) return;
|
|
1243
|
-
const c = Ja(this.host.feicoes, this.arraste.feicaoId, r, d);
|
|
1244
|
-
if (!c) return;
|
|
1245
|
-
this.host.ordemFilhosPorPai && rt(
|
|
1246
|
-
this.host.camadas,
|
|
1247
|
-
this.host.feicoes,
|
|
1248
|
-
this.host.ordemFilhosPorPai,
|
|
1249
|
-
this.arraste.feicaoId,
|
|
1250
|
-
r,
|
|
1251
|
-
d,
|
|
1252
|
-
c.camadaOrigemId,
|
|
1253
|
-
c.camadaDestinoId
|
|
1254
|
-
), this.host.dispararEvento("ui-feicoes-reordenadas", { feicoes: [...this.host.feicoes] }), c.mudouDeCamada && this.emitirFeicaoMovida(c), (u = (l = this.host).salvarLembrancaEstado) == null || u.call(l), this.host.solicitarRenderizacao();
|
|
1255
|
-
} else if (this.arraste.tipo === "layer") {
|
|
1256
|
-
if (!this.arraste.camadaId || !i || !this.host.ordemFilhosPorPai) return;
|
|
1257
|
-
n.preventDefault(), n.stopPropagation(), this.limparClassesDeArraste();
|
|
1258
|
-
const c = Re(
|
|
1259
|
-
this.host.camadas,
|
|
1260
|
-
this.host.feicoes,
|
|
1261
|
-
this.host.ordemFilhosPorPai,
|
|
1262
|
-
this.arraste.camadaId,
|
|
1263
|
-
r,
|
|
1264
|
-
d
|
|
1265
|
-
);
|
|
1266
|
-
if (!c) return;
|
|
1267
|
-
c.parentAnteriorId !== c.novoParentId && c.novoParentId && ((p = this.host.expandedLayers) == null || p.add(c.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1268
|
-
camadaId: c.camada.id,
|
|
1269
|
-
novoParentId: c.novoParentId,
|
|
1270
|
-
parentAnteriorId: c.parentAnteriorId,
|
|
1271
|
-
camada: c.camada
|
|
1272
|
-
})), this.aposReordenarCamadas();
|
|
1273
|
-
}
|
|
1274
|
-
}), a.addEventListener("dragend", (o) => {
|
|
1275
|
-
o.stopPropagation(), this.arraste.tipo = null, this.arraste.feicaoId = null, this.arraste.camadaId = null, this.limparClassesDeArraste();
|
|
1276
|
-
}));
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
/**
|
|
1280
|
-
* Suporte a arraste por toque e ponteiro no handle (.ui-col-drag) para tablets e mobile.
|
|
1281
|
-
* Suporta tanto reordenação (acima/abaixo) quanto aninhamento hierárquico (drop-into),
|
|
1282
|
-
* mantendo paridade total com o Drag & Drop HTML5.
|
|
1283
|
-
* Os ouvintes de `window` existem só durante o gesto e são soltos em `destruir()`.
|
|
1284
|
-
*/
|
|
1285
|
-
bindTouchDragAndDrop() {
|
|
1286
|
-
this.shadow.querySelectorAll(".ui-layer-row .ui-col-drag").forEach((t) => {
|
|
1287
|
-
const a = t.closest(".ui-layer-row");
|
|
1288
|
-
if (!a) return;
|
|
1289
|
-
const r = a.getAttribute("data-layer-id");
|
|
1290
|
-
r && t.addEventListener("pointerdown", (i) => {
|
|
1291
|
-
var p;
|
|
1292
|
-
const o = i;
|
|
1293
|
-
if (o.pointerType === "mouse" && o.button !== 0 || this.host.editingLayerId || this.host.editingFeatureId) return;
|
|
1294
|
-
(p = this.cancelarToque) == null || p.call(this);
|
|
1295
|
-
let n = null, s = "abaixo";
|
|
1296
|
-
const d = (c) => {
|
|
1297
|
-
c.preventDefault(), a.classList.add("dragging");
|
|
1298
|
-
const f = this.shadow.elementFromPoint(c.clientX, c.clientY), m = f ? f.closest(".ui-layer-row, .ui-feat-row") : null;
|
|
1299
|
-
if (n && n !== m && n.classList.remove("drop-above", "drop-below", "drop-into"), m && m !== a)
|
|
1300
|
-
if (m.classList.contains("ui-feat-row")) {
|
|
1301
|
-
const v = m.getAttribute("data-feat-layer");
|
|
1302
|
-
if (!v || v === r || N(this.host.camadas, v, r)) {
|
|
1303
|
-
n = null;
|
|
1304
|
-
return;
|
|
1305
|
-
}
|
|
1306
|
-
n = m;
|
|
1307
|
-
const g = m.getBoundingClientRect(), w = g.height > 0 && c.clientY - g.top < g.height / 2;
|
|
1308
|
-
s = w ? "acima" : "abaixo", m.classList.toggle("drop-above", w), m.classList.toggle("drop-below", !w), m.classList.remove("drop-into");
|
|
1309
|
-
} else {
|
|
1310
|
-
n = m;
|
|
1311
|
-
const v = m.getBoundingClientRect();
|
|
1312
|
-
s = v.height > 0 ? Ee((c.clientY - v.top) / v.height) : "abaixo", m.classList.toggle("drop-above", s === "acima"), m.classList.toggle("drop-below", s === "abaixo"), m.classList.toggle("drop-into", s === "dentro");
|
|
1313
|
-
}
|
|
1314
|
-
else
|
|
1315
|
-
n = null;
|
|
1316
|
-
}, l = () => {
|
|
1317
|
-
window.removeEventListener("pointermove", d), window.removeEventListener("pointerup", u), window.removeEventListener("pointercancel", u), this.cancelarToque = null;
|
|
1318
|
-
}, u = () => {
|
|
1319
|
-
var h, v;
|
|
1320
|
-
l();
|
|
1321
|
-
const c = n == null ? void 0 : n.getAttribute("data-layer-id"), f = n == null ? void 0 : n.getAttribute("data-feat-row");
|
|
1322
|
-
if (this.limparClassesDeArraste(), f && this.host.ordemFilhosPorPai) {
|
|
1323
|
-
const g = Re(
|
|
1324
|
-
this.host.camadas,
|
|
1325
|
-
this.host.feicoes,
|
|
1326
|
-
this.host.ordemFilhosPorPai,
|
|
1327
|
-
r,
|
|
1328
|
-
f,
|
|
1329
|
-
s === "acima"
|
|
1330
|
-
);
|
|
1331
|
-
if (!g) return;
|
|
1332
|
-
g.parentAnteriorId !== g.novoParentId && g.novoParentId && ((h = this.host.expandedLayers) == null || h.add(g.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1333
|
-
camadaId: g.camada.id,
|
|
1334
|
-
novoParentId: g.novoParentId,
|
|
1335
|
-
parentAnteriorId: g.parentAnteriorId,
|
|
1336
|
-
camada: g.camada
|
|
1337
|
-
})), this.aposReordenarCamadas();
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
if (!c || c === r) return;
|
|
1341
|
-
const m = Oe(this.host.camadas, r, c, s);
|
|
1342
|
-
m && (this.host.ordemFilhosPorPai && je(
|
|
1343
|
-
this.host.camadas,
|
|
1344
|
-
this.host.feicoes,
|
|
1345
|
-
this.host.ordemFilhosPorPai,
|
|
1346
|
-
r,
|
|
1347
|
-
c,
|
|
1348
|
-
s,
|
|
1349
|
-
m.parentAnteriorId,
|
|
1350
|
-
m.novoParentId
|
|
1351
|
-
), m.tipo === "hierarquia" ? ((v = this.host.expandedLayers) == null || v.add(m.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1352
|
-
camadaId: m.camada.id,
|
|
1353
|
-
novoParentId: m.novoParentId,
|
|
1354
|
-
parentAnteriorId: m.parentAnteriorId,
|
|
1355
|
-
camada: m.camada
|
|
1356
|
-
})) : m.parentAnteriorId !== m.novoParentId && this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1357
|
-
camadaId: m.camada.id,
|
|
1358
|
-
novoParentId: m.novoParentId,
|
|
1359
|
-
parentAnteriorId: m.parentAnteriorId,
|
|
1360
|
-
camada: m.camada
|
|
1361
|
-
}), this.aposReordenarCamadas());
|
|
1362
|
-
};
|
|
1363
|
-
this.cancelarToque = () => {
|
|
1364
|
-
l(), this.limparClassesDeArraste();
|
|
1365
|
-
}, window.addEventListener("pointermove", d, { passive: !1 }), window.addEventListener("pointerup", u), window.addEventListener("pointercancel", u);
|
|
1366
|
-
});
|
|
1367
|
-
});
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
const dt = "ui_camadas_estado_";
|
|
1371
|
-
function ct(e, t) {
|
|
1372
|
-
const a = (e || t || "default").trim();
|
|
1373
|
-
return `${dt}${a}`;
|
|
1374
|
-
}
|
|
1375
|
-
function le(e) {
|
|
1376
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
1377
|
-
}
|
|
1378
|
-
function Q(e) {
|
|
1379
|
-
return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
|
|
1380
|
-
}
|
|
1381
|
-
function He(e) {
|
|
1382
|
-
if (!le(e)) return;
|
|
1383
|
-
const t = {};
|
|
1384
|
-
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;
|
|
1385
|
-
}
|
|
1386
|
-
function ut(e) {
|
|
1387
|
-
if (!le(e)) return null;
|
|
1388
|
-
const t = {};
|
|
1389
|
-
if (le(e.camadasOverrides))
|
|
1390
|
-
for (const [r, i] of Object.entries(e.camadasOverrides)) {
|
|
1391
|
-
const o = He(i);
|
|
1392
|
-
if (!o) continue;
|
|
1393
|
-
const n = He(i.origem);
|
|
1394
|
-
t[r] = n ? { ...o, origem: n } : o;
|
|
1395
|
-
}
|
|
1396
|
-
const a = e.altura;
|
|
1397
|
-
return {
|
|
1398
|
-
versao: typeof e.versao == "number" ? e.versao : 1,
|
|
1399
|
-
expandedLayerIds: Q(e.expandedLayerIds),
|
|
1400
|
-
collapsedLayerIds: Q(e.collapsedLayerIds),
|
|
1401
|
-
camadaAtivaId: typeof e.camadaAtivaId == "string" ? e.camadaAtivaId : null,
|
|
1402
|
-
painelColapsado: typeof e.painelColapsado == "boolean" ? e.painelColapsado : void 0,
|
|
1403
|
-
ordemCamadasIds: Q(e.ordemCamadasIds),
|
|
1404
|
-
ordemOrigemIds: Array.isArray(e.ordemOrigemIds) ? Q(e.ordemOrigemIds) : void 0,
|
|
1405
|
-
ordemFilhosPorPai: (() => {
|
|
1406
|
-
if (!le(e.ordemFilhosPorPai)) return;
|
|
1407
|
-
const r = {};
|
|
1408
|
-
for (const [i, o] of Object.entries(e.ordemFilhosPorPai)) {
|
|
1409
|
-
const n = Q(o);
|
|
1410
|
-
n.length > 0 && (r[i] = n);
|
|
1411
|
-
}
|
|
1412
|
-
return Object.keys(r).length > 0 ? r : void 0;
|
|
1413
|
-
})(),
|
|
1414
|
-
mapaBaseAtivo: typeof e.mapaBaseAtivo == "string" ? e.mapaBaseAtivo : void 0,
|
|
1415
|
-
densidade: e.densidade === "compacto" || e.densidade === "normal" ? e.densidade : void 0,
|
|
1416
|
-
altura: typeof a == "number" && Number.isFinite(a) && a > 0 ? a : null,
|
|
1417
|
-
camadasOverrides: t,
|
|
1418
|
-
ultimaAtualizacao: typeof e.ultimaAtualizacao == "number" ? e.ultimaAtualizacao : void 0
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
function ke(e) {
|
|
1422
|
-
if (typeof window > "u" || typeof localStorage > "u")
|
|
1423
|
-
return null;
|
|
1424
|
-
try {
|
|
1425
|
-
const t = localStorage.getItem(e);
|
|
1426
|
-
return t ? ut(JSON.parse(t)) : null;
|
|
1427
|
-
} catch (t) {
|
|
1428
|
-
console.warn(`[UI-Camadas] Não foi possível carregar o estado persistido (${e}):`, t);
|
|
1429
|
-
}
|
|
1430
|
-
return null;
|
|
1431
|
-
}
|
|
1432
|
-
function pt(e, t) {
|
|
1433
|
-
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
1434
|
-
try {
|
|
1435
|
-
localStorage.setItem(e, JSON.stringify(t));
|
|
1436
|
-
} catch (a) {
|
|
1437
|
-
console.warn(`[UI-Camadas] Não foi possível salvar o estado persistido (${e}):`, a);
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
function ft(e) {
|
|
1441
|
-
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
1442
|
-
try {
|
|
1443
|
-
localStorage.removeItem(e);
|
|
1444
|
-
} catch {
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
function ca(e) {
|
|
1448
|
-
return {
|
|
1449
|
-
name: e.name,
|
|
1450
|
-
visible: e.visible !== !1,
|
|
1451
|
-
locked: !!e.locked,
|
|
1452
|
-
opacity: typeof e.opacity == "number" ? e.opacity : 1,
|
|
1453
|
-
color: e.color || "#00E08A",
|
|
1454
|
-
parentId: e.parentId !== void 0 ? e.parentId : null
|
|
1455
|
-
};
|
|
1456
|
-
}
|
|
1457
|
-
function mt(e, t, a, r) {
|
|
1458
|
-
var p;
|
|
1459
|
-
if (!Array.isArray(e)) return;
|
|
1460
|
-
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;
|
|
1461
|
-
for (let c = 0; c < e.length; c++) {
|
|
1462
|
-
const f = e[c], m = i[f.id];
|
|
1463
|
-
if (r == null || r.set(f.id, ca(f)), m) {
|
|
1464
|
-
const h = m.origem, v = (g) => {
|
|
1465
|
-
var k;
|
|
1466
|
-
const w = (k = r == null ? void 0 : r.get(f.id)) == null ? void 0 : k[g];
|
|
1467
|
-
return h !== void 0 && h[g] !== w;
|
|
1468
|
-
};
|
|
1469
|
-
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);
|
|
1470
|
-
}
|
|
1471
|
-
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);
|
|
1472
|
-
}
|
|
1473
|
-
for (let c = 0; c < e.length; c++) {
|
|
1474
|
-
const f = e[c];
|
|
1475
|
-
f.parentId && (f.parentId === f.id || N(e, f.parentId, f.id)) && (f.parentId = ((p = r == null ? void 0 : r.get(f.id)) == null ? void 0 : p.parentId) ?? null);
|
|
1476
|
-
}
|
|
1477
|
-
const d = new Set(e.map((c) => c.id)), l = t == null ? void 0 : t.ordemOrigemIds;
|
|
1478
|
-
if (!(Array.isArray(l) && (() => {
|
|
1479
|
-
const c = new Set(l), f = (m) => m.filter((h) => d.has(h) && c.has(h)).join("|");
|
|
1480
|
-
return f(l) !== f(e.map((m) => m.id));
|
|
1481
|
-
})()) && Array.isArray(t == null ? void 0 : t.ordemCamadasIds) && t.ordemCamadasIds.length > 0) {
|
|
1482
|
-
const c = /* @__PURE__ */ new Map();
|
|
1483
|
-
t.ordemCamadasIds.forEach((f, m) => c.set(f, m)), e.sort((f, m) => {
|
|
1484
|
-
const h = c.has(f.id) ? c.get(f.id) : 9999, v = c.has(m.id) ? c.get(m.id) : 9999;
|
|
1485
|
-
return h - v;
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
function gt(e) {
|
|
1490
|
-
const { estadoAnterior: t, camadas: a, expandedLayers: r } = e;
|
|
1491
|
-
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;
|
|
1492
|
-
const d = {
|
|
1493
|
-
...(t == null ? void 0 : t.camadasOverrides) || {}
|
|
1494
|
-
};
|
|
1495
|
-
a.length > 0 && (i = [], o = [], n = a.map((u) => u.id), s = e.origensCamadas ? [...e.origensCamadas.keys()] : n, a.forEach((u) => {
|
|
1496
|
-
var p, c;
|
|
1497
|
-
r.has(u.id) ? i.push(u.id) : o.push(u.id), d[u.id] = {
|
|
1498
|
-
name: u.name,
|
|
1499
|
-
visible: u.visible !== !1,
|
|
1500
|
-
locked: !!u.locked,
|
|
1501
|
-
opacity: typeof u.opacity == "number" ? u.opacity : 1,
|
|
1502
|
-
color: u.color || "#00E08A",
|
|
1503
|
-
parentId: u.parentId !== void 0 ? u.parentId : null,
|
|
1504
|
-
origem: ((p = e.origensCamadas) == null ? void 0 : p.get(u.id)) ?? ((c = d[u.id]) == null ? void 0 : c.origem)
|
|
1505
|
-
};
|
|
1506
|
-
}));
|
|
1507
|
-
for (const u of e.camadasRemovidas ?? []) delete d[u];
|
|
1508
|
-
let l;
|
|
1509
|
-
return e.ordemFilhosPorPai && e.ordemFilhosPorPai.size > 0 ? (l = {}, e.ordemFilhosPorPai.forEach((u, p) => {
|
|
1510
|
-
u.length > 0 && (l[p] = [...u]);
|
|
1511
|
-
}), Object.keys(l).length === 0 && (l = void 0)) : !a.length && (t != null && t.ordemFilhosPorPai) && (l = t.ordemFilhosPorPai), {
|
|
1512
|
-
versao: 1,
|
|
1513
|
-
expandedLayerIds: i,
|
|
1514
|
-
collapsedLayerIds: o,
|
|
1515
|
-
camadaAtivaId: e.camadaAtivaId,
|
|
1516
|
-
painelColapsado: e.painelColapsado,
|
|
1517
|
-
ordemCamadasIds: n,
|
|
1518
|
-
ordemOrigemIds: s,
|
|
1519
|
-
ordemFilhosPorPai: l,
|
|
1520
|
-
mapaBaseAtivo: e.mapaBaseAtivo,
|
|
1521
|
-
densidade: e.densidade,
|
|
1522
|
-
altura: e.altura,
|
|
1523
|
-
camadasOverrides: d,
|
|
1524
|
-
ultimaAtualizacao: Date.now()
|
|
1525
|
-
};
|
|
1526
|
-
}
|
|
1527
|
-
const ht = `: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-indent-nivel: 16px;--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}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=esquerda]{border-left:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=direita]{border-right:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=ambas]{border-left:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent));border-right:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}.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:none;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));border-radius:0;margin:0 calc(-1 * var(--camada-respiro)) calc(-1 * var(--camada-respiro));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: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-feat-row .ui-col-thumb{margin-left:calc(var(--layer-depth, 0) * var(--camada-indent-nivel, 16px))}.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-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)}`;
|
|
1528
|
-
function vt(e, t) {
|
|
1529
|
-
t.querySelectorAll("[data-layer-row]").forEach((r) => {
|
|
1530
|
-
const o = r.getAttribute("data-layer-row") === e.camadaAtivaId;
|
|
1531
|
-
r.classList.toggle("active-drawing-layer", o), _e(r, "camada-ativa", o), o ? r.setAttribute("aria-current", "true") : r.removeAttribute("aria-current");
|
|
1532
|
-
});
|
|
1533
|
-
}
|
|
1534
|
-
function bt(e, t) {
|
|
1535
|
-
t.querySelectorAll(".ui-feat-row").forEach((a) => {
|
|
1536
|
-
const r = a.getAttribute("data-feat-row"), i = r ? e.selectedFeatureIds.has(r) : !1;
|
|
1537
|
-
a.classList.toggle("selected-row", i), _e(a, "feicao-selecionada", i), a.setAttribute("aria-selected", String(i));
|
|
1538
|
-
const o = a.querySelector(".ui-target-circle");
|
|
1539
|
-
o && o.classList.toggle("selected", i);
|
|
1540
|
-
}), t.querySelectorAll(".ui-layer-group").forEach((a) => {
|
|
1541
|
-
const r = a.getAttribute("data-layer-id"), i = ae(e.camadas, e.feicoes, r ?? ""), o = W(i, e.searchQuery);
|
|
1542
|
-
ua(a.querySelector(".ui-layer-row .ui-target-circle"), o, e.selectedFeatureIds);
|
|
1543
|
-
}), pa(e, t);
|
|
1544
|
-
}
|
|
1545
|
-
function ua(e, t, a) {
|
|
1546
|
-
if (!e) return;
|
|
1547
|
-
if (t.length === 0) {
|
|
1548
|
-
e.classList.remove("selected", "partial");
|
|
1549
|
-
return;
|
|
1550
|
-
}
|
|
1551
|
-
const r = t.every((o) => a.has(o.id)), i = !r && t.some((o) => a.has(o.id));
|
|
1552
|
-
e.classList.toggle("selected", r), e.classList.toggle("partial", i);
|
|
1553
|
-
}
|
|
1554
|
-
function pa(e, t) {
|
|
1555
|
-
const a = e.feicoes.filter((p) => e.selectedFeatureIds.has(p.id)), r = a.length > 0, i = t.getElementById("footer-count"), o = t.getElementById("footer-label");
|
|
1556
|
-
if (i && (i.textContent = String(r ? a.length : e.camadas.length)), o) {
|
|
1557
|
-
const p = Je(e.camadas.length, a.length);
|
|
1558
|
-
o.innerHTML = p.icone, o.title = p.texto, o.setAttribute("aria-label", p.texto);
|
|
1559
|
-
}
|
|
1560
|
-
const n = t.querySelector(".ui-tree-footer");
|
|
1561
|
-
n && (n.classList.toggle("tem-selecao", r), n.classList.toggle("sem-selecao", !r));
|
|
1562
|
-
const s = t.querySelector(".ui-footer-actions-gerais");
|
|
1563
|
-
s && (s.style.display = r ? "none" : "flex");
|
|
1564
|
-
const d = t.querySelector(".ui-footer-bulk-actions");
|
|
1565
|
-
d && (d.style.display = r ? "flex" : "none"), ["btn-footer-del"].forEach((p) => {
|
|
1566
|
-
const c = t.getElementById(p);
|
|
1567
|
-
c && (c.disabled = !r, c.classList.toggle("disabled", !r));
|
|
1568
|
-
});
|
|
1569
|
-
const l = t.querySelector(".ui-footer-move-wrapper");
|
|
1570
|
-
l && l.classList.toggle("disabled", !r);
|
|
1571
|
-
const u = t.getElementById("select-footer-move");
|
|
1572
|
-
u && (u.disabled = !r);
|
|
1573
|
-
}
|
|
1574
|
-
function Ge(e, t) {
|
|
1575
|
-
const a = fe(e.camadas), r = new Map(e.camadas.map((n) => [n.id, n]));
|
|
1576
|
-
t.querySelectorAll(".ui-layer-row").forEach((n) => {
|
|
1577
|
-
const s = a.get(n.getAttribute("data-layer-row") || "");
|
|
1578
|
-
n.classList.toggle("herdado-oculto", (s == null ? void 0 : s.ocultaPorAncestral) === !0), n.classList.toggle("herdado-travado", (s == null ? void 0 : s.travadaPorAncestral) === !0);
|
|
1579
|
-
});
|
|
1580
|
-
const i = new Map(e.feicoes.map((n) => [n.id, n]));
|
|
1581
|
-
t.querySelectorAll(".ui-feat-row").forEach((n) => {
|
|
1582
|
-
const s = n.getAttribute("data-feat-layer") || "", d = r.get(s), l = a.get(s);
|
|
1583
|
-
n.classList.toggle("herdado-oculto", (d == null ? void 0 : d.visible) === !1 || (l == null ? void 0 : l.ocultaPorAncestral) === !0);
|
|
1584
|
-
const u = n.querySelector("[data-feat-lock]"), p = i.get(n.getAttribute("data-feat-row") || "");
|
|
1585
|
-
if (!u || !p) return;
|
|
1586
|
-
const c = (d == null ? void 0 : d.locked) === !0 || (l == null ? void 0 : l.travadaPorAncestral) === !0, f = p.locked === !0 || c;
|
|
1587
|
-
u.innerHTML = f ? b.cadeadoTrancado : b.cadeadoAberto, u.classList.toggle("ui-lock-open", !f), c ? u.setAttribute("data-locked-by-layer", "true") : u.removeAttribute("data-locked-by-layer"), T(
|
|
1588
|
-
u,
|
|
1589
|
-
c ? "Bloqueada pela camada" : f ? "Desbloquear Feição" : "Bloquear Feição"
|
|
1590
|
-
);
|
|
1591
|
-
});
|
|
1592
|
-
const o = t.getElementById("select-footer-move");
|
|
1593
|
-
o && (o.innerHTML = `<option value="" disabled selected>Mover para...</option>${We(e.camadas)}`);
|
|
1594
|
-
}
|
|
1595
|
-
function yt(e, t) {
|
|
1596
|
-
t.querySelectorAll("[data-layer-row]").forEach((i) => {
|
|
1597
|
-
i.addEventListener("click", (o) => {
|
|
1598
|
-
if (o.target.closest(
|
|
1599
|
-
"[data-layer-eye], [data-layer-lock], [data-layer-expand], [data-layer-target], [data-layer-fit], [data-layer-settings], [data-layer-color], input, button"
|
|
1600
|
-
))
|
|
1601
|
-
return;
|
|
1602
|
-
const s = i.getAttribute("data-layer-row");
|
|
1603
|
-
s && e.definirCamadaAtiva(s, !0);
|
|
1604
|
-
});
|
|
1605
|
-
}), t.querySelectorAll("[data-layer-expand]").forEach((i) => {
|
|
1606
|
-
i.addEventListener("click", (o) => {
|
|
1607
|
-
o.stopPropagation();
|
|
1608
|
-
const n = i.getAttribute("data-layer-expand");
|
|
1609
|
-
if (!n) return;
|
|
1610
|
-
e.expandedLayers.has(n) ? e.expandedLayers.delete(n) : e.expandedLayers.add(n);
|
|
1611
|
-
const s = i.closest(".ui-layer-group"), d = i.querySelector(".ui-chevron-icon"), l = e.expandedLayers.has(n);
|
|
1612
|
-
if (d && d.classList.toggle("open", l), s) {
|
|
1613
|
-
s.setAttribute("aria-expanded", String(l));
|
|
1614
|
-
const u = s.querySelector(".ui-children-container");
|
|
1615
|
-
u && (u.style.display = l ? "block" : "none");
|
|
1616
|
-
}
|
|
1617
|
-
T(i, l ? "Recolher grupo" : "Expandir grupo"), xt(e, t), e.salvarLembrancaEstado();
|
|
1618
|
-
});
|
|
1619
|
-
}), t.querySelectorAll("[data-layer-eye]").forEach((i) => {
|
|
1620
|
-
i.addEventListener("click", (o) => {
|
|
1621
|
-
o.stopPropagation();
|
|
1622
|
-
const n = i.getAttribute("data-layer-eye"), s = e.camadas.find((d) => d.id === n);
|
|
1623
|
-
if (s) {
|
|
1624
|
-
s.visible = s.visible === !1;
|
|
1625
|
-
const d = s.visible !== !1;
|
|
1626
|
-
i.innerHTML = d ? b.olhoAberto : b.olhoFechado, T(i, d ? "Ocultar Camada" : "Exibir Camada");
|
|
1627
|
-
const l = i.closest(".ui-layer-row");
|
|
1628
|
-
l && l.classList.toggle("hidden-layer", !d), wt(e, t), Ge(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-visibilidade", {
|
|
1629
|
-
camadaId: s.id,
|
|
1630
|
-
visivel: d
|
|
1631
|
-
});
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
}), t.querySelectorAll("[data-layer-lock]").forEach((i) => {
|
|
1635
|
-
i.addEventListener("click", (o) => {
|
|
1636
|
-
o.stopPropagation();
|
|
1637
|
-
const n = i.getAttribute("data-layer-lock"), s = e.camadas.find((d) => d.id === n);
|
|
1638
|
-
s && (s.locked = !s.locked, i.innerHTML = s.locked ? b.cadeadoTrancado : b.cadeadoAberto, i.classList.toggle("ui-lock-open", !s.locked), T(i, s.locked ? "Desbloquear Camada" : "Bloquear Camada"), Ge(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-bloqueio", {
|
|
1639
|
-
camadaId: s.id,
|
|
1640
|
-
bloqueado: s.locked
|
|
1641
|
-
}));
|
|
1642
|
-
});
|
|
1643
|
-
}), t.querySelectorAll("[data-layer-fit]").forEach((i) => {
|
|
1644
|
-
i.addEventListener("click", (o) => {
|
|
1645
|
-
o.stopPropagation();
|
|
1646
|
-
const n = i.getAttribute("data-layer-fit");
|
|
1647
|
-
n && e.dispararEvento("ui-camada-enquadrar", { camadaId: n });
|
|
1648
|
-
});
|
|
1649
|
-
}), t.querySelectorAll("[data-layer-settings]").forEach((i) => {
|
|
1650
|
-
i.addEventListener("click", (o) => {
|
|
1651
|
-
o.stopPropagation();
|
|
1652
|
-
const n = i.getAttribute("data-layer-settings");
|
|
1653
|
-
e.activeSettingsLayerId = e.activeSettingsLayerId === n ? null : n, e.solicitarRenderizacao();
|
|
1654
|
-
});
|
|
1655
|
-
}), t.querySelectorAll("[data-layer-settings-close]").forEach((i) => {
|
|
1656
|
-
i.addEventListener("click", (o) => {
|
|
1657
|
-
o.stopPropagation(), e.activeSettingsLayerId = null, e.solicitarRenderizacao();
|
|
1658
|
-
});
|
|
1659
|
-
});
|
|
1660
|
-
const a = (i, o, n) => {
|
|
1661
|
-
const s = e.camadas.find((f) => f.id === i);
|
|
1662
|
-
if (!s) return;
|
|
1663
|
-
const d = K(o, s.color || "#00E08A");
|
|
1664
|
-
s.color = d;
|
|
1665
|
-
const l = t.getElementById(`sample-color-${i}`);
|
|
1666
|
-
l && (l.style.backgroundColor = d);
|
|
1667
|
-
const u = t.getElementById(`hex-color-${i}`);
|
|
1668
|
-
u && (u.textContent = d.toUpperCase());
|
|
1669
|
-
const p = t.getElementById(`settings-drawer-${i}`);
|
|
1670
|
-
p && p.style.setProperty("--drawer-cor-camada", d);
|
|
1671
|
-
const c = D(t, "data-layer-row", i);
|
|
1672
|
-
if (c) {
|
|
1673
|
-
const f = c.closest(".ui-layer-group");
|
|
1674
|
-
f == null || f.style.setProperty("--layer-active-color", d);
|
|
1675
|
-
const m = f == null ? void 0 : f.querySelector(":scope > .ui-children-container");
|
|
1676
|
-
m == null || m.style.setProperty("--parent-layer-color", d);
|
|
1677
|
-
const h = c.querySelector(".ui-col-colorbar");
|
|
1678
|
-
h && (h.style.backgroundColor = d);
|
|
1679
|
-
const v = new Map(e.feicoes.map((g) => [g.id, g]));
|
|
1680
|
-
f == null || f.querySelectorAll(".ui-feat-row").forEach((g) => {
|
|
1681
|
-
if (g.getAttribute("data-feat-layer") !== i) return;
|
|
1682
|
-
const w = g.querySelector(".ui-col-colorbar");
|
|
1683
|
-
w && (w.style.backgroundColor = d);
|
|
1684
|
-
const k = v.get(g.getAttribute("data-feat-row") || "");
|
|
1685
|
-
if (!k || k.color) return;
|
|
1686
|
-
const L = g.querySelector(".ui-thumb-box");
|
|
1687
|
-
L && (L.innerHTML = ea(k.type || k.geometryType, d, k.coordinates));
|
|
1688
|
-
});
|
|
1689
|
-
}
|
|
1690
|
-
n ? e.salvarLembrancaEstado() : e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-cor", { camadaId: s.id, cor: d });
|
|
1691
|
-
};
|
|
1692
|
-
t.querySelectorAll("[data-layer-color-picker]").forEach((i) => {
|
|
1693
|
-
const o = i, n = (s) => (d) => {
|
|
1694
|
-
const l = o.getAttribute("data-layer-color-picker");
|
|
1695
|
-
if (!l) return;
|
|
1696
|
-
const u = d.target.value;
|
|
1697
|
-
a(l, u, s);
|
|
1698
|
-
};
|
|
1699
|
-
o.addEventListener("input", n(!1)), o.addEventListener("change", n(!0));
|
|
1700
|
-
}), t.querySelectorAll("[data-layer-color]").forEach((i) => {
|
|
1701
|
-
const o = (n) => {
|
|
1702
|
-
n.stopPropagation();
|
|
1703
|
-
const s = i.getAttribute("data-layer-color"), d = e.camadas.find((l) => l.id === s);
|
|
1704
|
-
!s || !d || Oa({
|
|
1705
|
-
ancora: i,
|
|
1706
|
-
titulo: `Cor · ${d.name || "Camada"}`,
|
|
1707
|
-
modo: "simples",
|
|
1708
|
-
cor: K(d.color, "#00E08A"),
|
|
1709
|
-
mostrarOpacidade: !1,
|
|
1710
|
-
aoAlterar: (l) => a(s, l.cor, !1),
|
|
1711
|
-
aoConfirmar: (l) => a(s, l.cor, !0),
|
|
1712
|
-
aoCancelar: (l) => a(s, l.cor, !0)
|
|
1713
|
-
});
|
|
1714
|
-
};
|
|
1715
|
-
i.addEventListener("click", o), i.addEventListener("keydown", (n) => {
|
|
1716
|
-
const s = n.key;
|
|
1717
|
-
(s === "Enter" || s === " ") && (n.preventDefault(), o(n));
|
|
1718
|
-
});
|
|
1719
|
-
});
|
|
1720
|
-
const r = (i, o) => {
|
|
1721
|
-
const n = e.camadas.find((l) => l.id === i);
|
|
1722
|
-
if (!n) return;
|
|
1723
|
-
n.opacity = o;
|
|
1724
|
-
const s = t.getElementById(`badge-op-${i}`);
|
|
1725
|
-
s && (s.textContent = `${Math.round(o * 100)}%`);
|
|
1726
|
-
const d = D(t, "data-layer-opacity-slider", i);
|
|
1727
|
-
d && parseFloat(d.value) !== o && (d.value = String(o)), e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-opacidade", { camadaId: n.id, opacidade: o });
|
|
1728
|
-
};
|
|
1729
|
-
t.querySelectorAll("[data-layer-opacity-slider]").forEach((i) => {
|
|
1730
|
-
i.addEventListener("input", (o) => {
|
|
1731
|
-
const n = i.getAttribute("data-layer-opacity-slider");
|
|
1732
|
-
if (!n) return;
|
|
1733
|
-
const s = parseFloat(o.target.value);
|
|
1734
|
-
Number.isFinite(s) && r(n, Math.min(1, Math.max(0, s)));
|
|
1735
|
-
});
|
|
1736
|
-
}), t.querySelectorAll("[data-delete-layer]").forEach((i) => {
|
|
1737
|
-
let o = null;
|
|
1738
|
-
const n = () => {
|
|
1739
|
-
o && (clearTimeout(o), o = null), i.classList.remove("confirming");
|
|
1740
|
-
const s = i.querySelector(".ui-btn-label");
|
|
1741
|
-
s && (s.textContent = "Excluir");
|
|
1742
|
-
};
|
|
1743
|
-
i.addEventListener("ui-cancelar-confirmacao", n), i.addEventListener("click", (s) => {
|
|
1744
|
-
s.stopPropagation();
|
|
1745
|
-
const d = i.getAttribute("data-delete-layer");
|
|
1746
|
-
if (!d) return;
|
|
1747
|
-
if (i.classList.contains("confirming")) {
|
|
1748
|
-
n(), e.dispararEvento("ui-camada-excluida", { camadaId: d });
|
|
1749
|
-
const u = e.selectedFeatureIds.size;
|
|
1750
|
-
e.camadas.forEach((p) => {
|
|
1751
|
-
p.parentId === d && (p.parentId = null);
|
|
1752
|
-
}), e.removerCamada(d), e.selectedFeatureIds.size !== u && e.notificarMudancaSelecao();
|
|
1753
|
-
} else {
|
|
1754
|
-
i.classList.add("confirming");
|
|
1755
|
-
const u = i.querySelector(".ui-btn-label");
|
|
1756
|
-
u && (u.textContent = "Confirmar Exclusão?"), o = setTimeout(n, 3500);
|
|
1757
|
-
}
|
|
1758
|
-
});
|
|
1759
|
-
}), t.querySelectorAll("[data-layer-parent-select]").forEach((i) => {
|
|
1760
|
-
i.addEventListener("change", (o) => {
|
|
1761
|
-
const n = o.target, s = n.getAttribute("data-layer-parent-select"), d = n.value || null, l = e.camadas.find((u) => u.id === s);
|
|
1762
|
-
if (l) {
|
|
1763
|
-
if (d && (d === l.id || N(e.camadas, d, l.id))) {
|
|
1764
|
-
n.value = l.parentId || "";
|
|
1765
|
-
return;
|
|
1766
|
-
}
|
|
1767
|
-
const u = l.parentId ?? null;
|
|
1768
|
-
l.parentId = d, d && e.expandedLayers.add(d), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1769
|
-
camadaId: l.id,
|
|
1770
|
-
novoParentId: d,
|
|
1771
|
-
parentAnteriorId: u,
|
|
1772
|
-
camada: l
|
|
1773
|
-
}), e.solicitarRenderizacao();
|
|
1774
|
-
}
|
|
1775
|
-
});
|
|
1776
|
-
}), t.querySelectorAll("[data-add-sublayer]").forEach((i) => {
|
|
1777
|
-
i.addEventListener("click", (o) => {
|
|
1778
|
-
o.stopPropagation();
|
|
1779
|
-
const n = i.getAttribute("data-add-sublayer");
|
|
1780
|
-
e.dispararEvento("ui-camada-adicionar", { parentId: n });
|
|
1781
|
-
});
|
|
1782
|
-
}), fa(e, t), t.querySelectorAll("[data-layer-target]").forEach((i) => {
|
|
1783
|
-
i.addEventListener("click", (o) => {
|
|
1784
|
-
o.stopPropagation();
|
|
1785
|
-
const n = o, s = i.getAttribute("data-layer-target");
|
|
1786
|
-
if (!s) return;
|
|
1787
|
-
const d = ae(e.camadas, e.feicoes, s), l = W(d, e.searchQuery);
|
|
1788
|
-
if (l.length === 0) return;
|
|
1789
|
-
l.every((p) => e.selectedFeatureIds.has(p.id)) ? l.forEach((p) => e.selectedFeatureIds.delete(p.id)) : (!n.ctrlKey && !n.metaKey && e.selectedFeatureIds.clear(), l.forEach((p) => e.selectedFeatureIds.add(p.id))), e.lastClickedFeatureId = l[l.length - 1].id, e.sincronizarSelecaoDOM(), e.notificarMudancaSelecao();
|
|
1790
|
-
});
|
|
1791
|
-
});
|
|
1792
|
-
}
|
|
1793
|
-
function fa(e, t) {
|
|
1794
|
-
t.querySelectorAll("[data-layer-show-more]").forEach((a) => {
|
|
1795
|
-
a.addEventListener("click", (r) => {
|
|
1796
|
-
r.stopPropagation();
|
|
1797
|
-
const i = a.getAttribute("data-layer-show-more");
|
|
1798
|
-
i && e.incrementarLimiteFeicoes(i);
|
|
1799
|
-
});
|
|
1800
|
-
});
|
|
1801
|
-
}
|
|
1802
|
-
function xt(e, t) {
|
|
1803
|
-
const a = t.getElementById("btn-toggle-all-expand");
|
|
1804
|
-
if (!a) return;
|
|
1805
|
-
const r = e.camadas.length > 0 && e.camadas.every((o) => e.expandedLayers.has(o.id)), i = a.querySelector(".ui-chevron-icon");
|
|
1806
|
-
i && i.classList.toggle("open", r), T(
|
|
1807
|
-
a,
|
|
1808
|
-
r ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"
|
|
1809
|
-
);
|
|
1810
|
-
}
|
|
1811
|
-
function wt(e, t) {
|
|
1812
|
-
const a = t.getElementById("btn-toggle-all-vis");
|
|
1813
|
-
if (!a) return;
|
|
1814
|
-
const r = e.camadas.every((i) => i.visible !== !1);
|
|
1815
|
-
a.innerHTML = r ? b.olhoAberto : b.olhoFechado, T(a, r ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas");
|
|
1816
|
-
}
|
|
1817
|
-
function At(e, t) {
|
|
1818
|
-
const a = t.getElementById("select-footer-move");
|
|
1819
|
-
a && a.addEventListener("change", (n) => {
|
|
1820
|
-
const s = n.target.value;
|
|
1821
|
-
if (!s) return;
|
|
1822
|
-
const d = de(e.camadas);
|
|
1823
|
-
if (d.has(s)) {
|
|
1824
|
-
a.value = "";
|
|
1825
|
-
return;
|
|
1826
|
-
}
|
|
1827
|
-
const l = e.feicoes.filter(
|
|
1828
|
-
(p) => e.selectedFeatureIds.has(p.id) && !d.has(p.layerId) && p.locked !== !0
|
|
1829
|
-
);
|
|
1830
|
-
if (l.length === 0) {
|
|
1831
|
-
a.value = "";
|
|
1832
|
-
return;
|
|
1833
|
-
}
|
|
1834
|
-
const u = new Map(l.map((p) => [p.id, p.layerId]));
|
|
1835
|
-
l.forEach((p) => p.layerId = s), l.forEach((p) => {
|
|
1836
|
-
u.get(p.id) !== s && e.dispararEvento("ui-feicao-movida", {
|
|
1837
|
-
feicaoId: p.id,
|
|
1838
|
-
camadaOrigemId: u.get(p.id),
|
|
1839
|
-
camadaDestinoId: s,
|
|
1840
|
-
feicao: p
|
|
1841
|
-
});
|
|
1842
|
-
}), e.dispararEvento("ui-acao-massa", {
|
|
1843
|
-
acao: "mover",
|
|
1844
|
-
feicoesIds: l.map((p) => p.id),
|
|
1845
|
-
feicoes: l,
|
|
1846
|
-
valor: s
|
|
1847
|
-
}), e.solicitarRenderizacao();
|
|
1848
|
-
});
|
|
1849
|
-
const r = t.getElementById("btn-footer-new-layer");
|
|
1850
|
-
r && r.addEventListener("click", () => {
|
|
1851
|
-
e.dispararEvento("ui-camada-adicionar", {});
|
|
1852
|
-
});
|
|
1853
|
-
const i = t.getElementById("btn-footer-new-group");
|
|
1854
|
-
i && i.addEventListener("click", () => {
|
|
1855
|
-
e.dispararEvento("ui-camada-grupo-adicionar", { isGroup: !0 });
|
|
1856
|
-
});
|
|
1857
|
-
const o = t.getElementById("btn-footer-del");
|
|
1858
|
-
if (o) {
|
|
1859
|
-
let n = null;
|
|
1860
|
-
const s = "Excluir selecionados", d = () => {
|
|
1861
|
-
n && (clearTimeout(n), n = null), o.classList.remove("confirming"), T(o, s);
|
|
1862
|
-
};
|
|
1863
|
-
o.addEventListener("ui-cancelar-confirmacao", d), o.addEventListener("click", () => {
|
|
1864
|
-
const l = de(e.camadas), u = e.feicoes.filter(
|
|
1865
|
-
(f) => e.selectedFeatureIds.has(f.id) && !l.has(f.layerId) && f.locked !== !0
|
|
1866
|
-
);
|
|
1867
|
-
if (u.length === 0) return;
|
|
1868
|
-
const p = u.map((f) => f.id);
|
|
1869
|
-
if (!o.classList.contains("confirming")) {
|
|
1870
|
-
o.classList.add("confirming"), T(o, `Clique novamente para excluir ${p.length} selecionado(s)`), n = setTimeout(d, 3500);
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
d();
|
|
1874
|
-
const c = new Set(p);
|
|
1875
|
-
e.feicoes = e.feicoes.filter((f) => !c.has(f.id)), p.forEach((f) => e.selectedFeatureIds.delete(f)), e.lastClickedFeatureId && c.has(e.lastClickedFeatureId) && (e.lastClickedFeatureId = null), e.dispararEvento("ui-acao-massa", {
|
|
1876
|
-
acao: "excluir",
|
|
1877
|
-
feicoesIds: p,
|
|
1878
|
-
feicoes: u
|
|
1879
|
-
}), e.notificarMudancaSelecao(), e.solicitarRenderizacao();
|
|
1880
|
-
});
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
const Et = [
|
|
1884
|
-
{ tipo: "olho", atributo: "data-layer-eye", entidade: "camada" },
|
|
1885
|
-
{ tipo: "olho", atributo: "data-feat-eye", entidade: "feicao" },
|
|
1886
|
-
{ tipo: "cadeado", atributo: "data-layer-lock", entidade: "camada" },
|
|
1887
|
-
{ tipo: "cadeado", atributo: "data-feat-lock", entidade: "feicao" },
|
|
1888
|
-
{ tipo: "selecao", atributo: "data-layer-target", entidade: "camada" },
|
|
1889
|
-
{ tipo: "selecao", atributo: "data-feat-target", entidade: "feicao" }
|
|
1890
|
-
], Le = {
|
|
1891
|
-
olho: "[data-layer-eye], [data-feat-eye]",
|
|
1892
|
-
cadeado: "[data-layer-lock], [data-feat-lock]",
|
|
1893
|
-
selecao: "[data-layer-target], [data-feat-target]"
|
|
1894
|
-
}, It = 3;
|
|
1895
|
-
function kt(e) {
|
|
1896
|
-
return Et.find((t) => e.hasAttribute(t.atributo)) ?? null;
|
|
1897
|
-
}
|
|
1898
|
-
function Ie(e, t) {
|
|
1899
|
-
const a = kt(t);
|
|
1900
|
-
if (!a) return null;
|
|
1901
|
-
const r = t.getAttribute(a.atributo);
|
|
1902
|
-
if (!r) return null;
|
|
1903
|
-
if (a.tipo === "olho") {
|
|
1904
|
-
const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
|
|
1905
|
-
return o ? o.visible !== !1 : null;
|
|
1906
|
-
}
|
|
1907
|
-
if (a.tipo === "cadeado") {
|
|
1908
|
-
if (t.hasAttribute("data-locked-by-layer")) return null;
|
|
1909
|
-
const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
|
|
1910
|
-
return o ? o.locked === !0 : null;
|
|
1911
|
-
}
|
|
1912
|
-
if (a.entidade === "feicao") return e.selectedFeatureIds.has(r);
|
|
1913
|
-
const i = W(
|
|
1914
|
-
ae(e.camadas, e.feicoes, r),
|
|
1915
|
-
e.searchQuery
|
|
1916
|
-
);
|
|
1917
|
-
return i.length === 0 ? null : i.every((o) => e.selectedFeatureIds.has(o.id));
|
|
1918
|
-
}
|
|
1919
|
-
function Ve(e, t, a = !1) {
|
|
1920
|
-
e.dispatchEvent(
|
|
1921
|
-
new MouseEvent("click", {
|
|
1922
|
-
bubbles: !0,
|
|
1923
|
-
cancelable: !0,
|
|
1924
|
-
ctrlKey: t,
|
|
1925
|
-
shiftKey: a
|
|
1926
|
-
})
|
|
1927
|
-
);
|
|
1928
|
-
}
|
|
1929
|
-
let q = null;
|
|
1930
|
-
function Lt(e) {
|
|
1931
|
-
(q == null ? void 0 : q.host) === e && q.cancelar();
|
|
1932
|
-
}
|
|
1933
|
-
function ma(e, t, a = t) {
|
|
1934
|
-
Object.keys(Le).forEach((r) => {
|
|
1935
|
-
a.querySelectorAll(Le[r]).forEach((i) => {
|
|
1936
|
-
i.addEventListener("pointerdown", (o) => Ct(e, t, r, i, o));
|
|
1937
|
-
});
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
function Ct(e, t, a, r, i) {
|
|
1941
|
-
if (i.pointerType === "mouse" && i.button !== 0 || e.editingLayerId || e.editingFeatureId || Ie(e, r) === null) return;
|
|
1942
|
-
q == null || q.cancelar();
|
|
1943
|
-
const o = Le[a], n = i.ctrlKey || i.metaKey, s = i.shiftKey;
|
|
1944
|
-
let d = !1, l = !1, u = i.clientY;
|
|
1945
|
-
const p = /* @__PURE__ */ new Set([r]), c = (A) => {
|
|
1946
|
-
A.preventDefault(), A.stopImmediatePropagation();
|
|
1947
|
-
}, f = (A) => {
|
|
1948
|
-
A.stopPropagation(), A.preventDefault();
|
|
1949
|
-
}, m = (A) => A.preventDefault(), h = (A) => {
|
|
1950
|
-
p.has(A) || (p.add(A), Ie(e, A) !== l && Ve(A, a === "selecao"));
|
|
1951
|
-
}, v = () => {
|
|
1952
|
-
d = !0, Ve(r, n, s), l = Ie(e, r) === !0, t.addEventListener("selectstart", m), document.body.style.userSelect = "none";
|
|
1953
|
-
}, g = (A) => {
|
|
1954
|
-
var E, P;
|
|
1955
|
-
if (!d) {
|
|
1956
|
-
if (Math.hypot(A.clientX - i.clientX, A.clientY - i.clientY) < It) return;
|
|
1957
|
-
const x = (E = t.elementFromPoint(A.clientX, A.clientY)) == null ? void 0 : E.closest(o);
|
|
1958
|
-
if (!x || x === r) return;
|
|
1959
|
-
v();
|
|
1960
|
-
}
|
|
1961
|
-
A.preventDefault();
|
|
1962
|
-
const S = Math.min(u, A.clientY), F = Math.max(u, A.clientY);
|
|
1963
|
-
t.querySelectorAll(o).forEach((x) => {
|
|
1964
|
-
const y = x.getBoundingClientRect();
|
|
1965
|
-
if (y.height === 0) return;
|
|
1966
|
-
const z = y.top + y.height / 2;
|
|
1967
|
-
z >= S && z <= F && h(x);
|
|
1968
|
-
});
|
|
1969
|
-
const B = (P = t.elementFromPoint(A.clientX, A.clientY)) == null ? void 0 : P.closest(o);
|
|
1970
|
-
B && h(B), u = A.clientY;
|
|
1971
|
-
}, w = (A = !1) => {
|
|
1972
|
-
(q == null ? void 0 : q.cancelar) === L && (q = null), window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", k), window.removeEventListener("pointercancel", k), window.removeEventListener("dragstart", c, !0), t.removeEventListener("selectstart", m), d && (document.body.style.userSelect = "", A || (window.addEventListener("click", f, { capture: !0, once: !0 }), setTimeout(() => window.removeEventListener("click", f, !0), 0)));
|
|
1973
|
-
}, k = () => w(), L = () => w(!0);
|
|
1974
|
-
q = { host: e, cancelar: L }, window.addEventListener("dragstart", c, !0), window.addEventListener("pointermove", g, { passive: !1 }), window.addEventListener("pointerup", k), window.addEventListener("pointercancel", k);
|
|
1975
|
-
}
|
|
1976
|
-
function St(e, t) {
|
|
1977
|
-
const a = t.getElementById("btn-toggle-all-vis");
|
|
1978
|
-
a && a.addEventListener("click", () => e.alternarVisibilidadeTodas(!0));
|
|
1979
|
-
const r = t.getElementById("btn-toggle-all-expand");
|
|
1980
|
-
r && r.addEventListener("click", (o) => {
|
|
1981
|
-
o.stopPropagation(), e.camadas.length > 0 && e.camadas.every((s) => e.expandedLayers.has(s.id)) ? e.colapsarTodas() : e.expandirTodas();
|
|
1982
|
-
});
|
|
1983
|
-
const i = t.getElementById("btn-colapsar");
|
|
1984
|
-
i && i.addEventListener("click", () => e.colapsar(!0)), Ft(e, t);
|
|
1985
|
-
}
|
|
1986
|
-
function Ft(e, t) {
|
|
1987
|
-
const a = t.getElementById("input-layer-search"), r = t.getElementById("btn-clear-layer-search"), i = () => {
|
|
1988
|
-
var o;
|
|
1989
|
-
e.searchQuery = "", e.solicitarRenderizacao(), (o = t.getElementById("input-layer-search")) == null || o.focus();
|
|
1990
|
-
};
|
|
1991
|
-
if (a) {
|
|
1992
|
-
const o = Ke(() => e.solicitarRenderizacao(), 75);
|
|
1993
|
-
a.addEventListener("input", (n) => {
|
|
1994
|
-
e.searchQuery = n.target.value, o();
|
|
1995
|
-
}), a.addEventListener("keydown", (n) => {
|
|
1996
|
-
n.key === "Escape" && e.searchQuery && (n.preventDefault(), i());
|
|
1997
|
-
});
|
|
1998
|
-
}
|
|
1999
|
-
r && r.addEventListener("click", i);
|
|
2000
|
-
}
|
|
2001
|
-
function ga(e, t) {
|
|
2002
|
-
t.querySelectorAll("[data-feat-select]").forEach((a) => {
|
|
2003
|
-
a.addEventListener("click", (r) => {
|
|
2004
|
-
if (e.editingFeatureId) return;
|
|
2005
|
-
const i = r;
|
|
2006
|
-
if (i.target.closest(
|
|
2007
|
-
"[data-feat-eye], [data-feat-lock], [data-feat-fit], [data-feat-target], input, button"
|
|
2008
|
-
))
|
|
2009
|
-
return;
|
|
2010
|
-
const n = a.getAttribute("data-feat-select");
|
|
2011
|
-
n && e.selecionarFeicao(n, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
2012
|
-
});
|
|
2013
|
-
}), t.querySelectorAll("[data-feat-target]").forEach((a) => {
|
|
2014
|
-
a.addEventListener("click", (r) => {
|
|
2015
|
-
r.stopPropagation();
|
|
2016
|
-
const i = r, o = a.getAttribute("data-feat-target");
|
|
2017
|
-
o && e.selecionarFeicao(o, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
2018
|
-
});
|
|
2019
|
-
}), t.querySelectorAll("[data-feat-eye]").forEach((a) => {
|
|
2020
|
-
a.addEventListener("click", (r) => {
|
|
2021
|
-
r.stopPropagation();
|
|
2022
|
-
const i = a.getAttribute("data-feat-eye"), o = e.feicoes.find((n) => n.id === i);
|
|
2023
|
-
if (o) {
|
|
2024
|
-
o.visible = o.visible === !1;
|
|
2025
|
-
const n = o.visible !== !1;
|
|
2026
|
-
a.innerHTML = n ? b.olhoAberto : b.olhoFechado, T(a, n ? "Ocultar Feição" : "Exibir Feição");
|
|
2027
|
-
const s = a.closest(".ui-feat-row");
|
|
2028
|
-
s && s.classList.toggle("hidden-row", !n), e.dispararEvento("ui-feicao-visibilidade", {
|
|
2029
|
-
feicaoId: o.id,
|
|
2030
|
-
visivel: n
|
|
2031
|
-
});
|
|
2032
|
-
}
|
|
2033
|
-
});
|
|
2034
|
-
}), t.querySelectorAll("[data-feat-lock]").forEach((a) => {
|
|
2035
|
-
a.addEventListener("click", (r) => {
|
|
2036
|
-
if (r.stopPropagation(), a.hasAttribute("data-locked-by-layer")) return;
|
|
2037
|
-
const i = a.getAttribute("data-feat-lock"), o = e.feicoes.find((n) => n.id === i);
|
|
2038
|
-
o && (o.locked = !o.locked, a.innerHTML = o.locked ? b.cadeadoTrancado : b.cadeadoAberto, a.classList.toggle("ui-lock-open", !o.locked), T(a, o.locked ? "Desbloquear Feição" : "Bloquear Feição"), e.dispararEvento("ui-feicao-bloqueio", {
|
|
2039
|
-
feicaoId: o.id,
|
|
2040
|
-
bloqueado: o.locked
|
|
2041
|
-
}));
|
|
2042
|
-
});
|
|
2043
|
-
}), t.querySelectorAll("[data-feat-fit]").forEach((a) => {
|
|
2044
|
-
a.addEventListener("click", (r) => {
|
|
2045
|
-
r.stopPropagation();
|
|
2046
|
-
const i = a.getAttribute("data-feat-fit");
|
|
2047
|
-
i && e.dispararEvento("ui-feicao-enquadrar", { feicaoId: i });
|
|
2048
|
-
});
|
|
2049
|
-
});
|
|
2050
|
-
}
|
|
2051
|
-
function $t(e, t) {
|
|
2052
|
-
var a;
|
|
2053
|
-
(a = t.querySelector("[data-basemap-toggle]")) == null || a.addEventListener("click", () => {
|
|
2054
|
-
e.alternarMapasBaseRecolhido(!0);
|
|
2055
|
-
}), t.querySelectorAll("[data-basemap-id]").forEach((r) => {
|
|
2056
|
-
r.addEventListener("click", () => {
|
|
2057
|
-
const i = r.getAttribute("data-basemap-id");
|
|
2058
|
-
i && e.selecionarMapaBase(i, !0);
|
|
2059
|
-
});
|
|
2060
|
-
});
|
|
2061
|
-
}
|
|
2062
|
-
function Mt(e, t) {
|
|
2063
|
-
St(e, t), yt(e, t), ga(e, t), $t(e, t), At(e, t), ma(e, t);
|
|
2064
|
-
}
|
|
2065
|
-
function zt(e) {
|
|
2066
|
-
if (!e.arvoreRenderizada) return { incremental: !1, motivo: "arvore-nao-renderizada" };
|
|
2067
|
-
if (e.buscaAtiva) return { incremental: !1, motivo: "busca-ativa" };
|
|
2068
|
-
if (e.editandoCamada || e.editandoFeicao) return { incremental: !1, motivo: "edicao-inline" };
|
|
2069
|
-
for (const t of e.camadasAfetadas) {
|
|
2070
|
-
if (!t.existeNoModelo) return { incremental: !1, motivo: "camada-orfa" };
|
|
2071
|
-
if (!t.renderizadaNoDom) return { incremental: !1, motivo: "camada-fora-do-dom" };
|
|
2072
|
-
if (t.drawerAberto) return { incremental: !1, motivo: "drawer-aberto" };
|
|
2073
|
-
}
|
|
2074
|
-
return e.idsDuplicados ? { incremental: !1, motivo: "ids-duplicados" } : { incremental: !0 };
|
|
2075
|
-
}
|
|
2076
|
-
function ha(e, t = /* @__PURE__ */ new Map()) {
|
|
2077
|
-
for (const a of e)
|
|
2078
|
-
t.set(a.camada.id, a), ha(a.subcamadas, t);
|
|
2079
|
-
return t;
|
|
2080
|
-
}
|
|
2081
|
-
function Pt(e) {
|
|
2082
|
-
const t = /* @__PURE__ */ new Map();
|
|
2083
|
-
for (let a = 0; a < e.length; a++) {
|
|
2084
|
-
const r = e[a];
|
|
2085
|
-
if (!r || !r.id) continue;
|
|
2086
|
-
const i = r.layerId || "", o = t.get(i);
|
|
2087
|
-
o ? o.push(r) : t.set(i, [r]);
|
|
2088
|
-
}
|
|
2089
|
-
return t;
|
|
2090
|
-
}
|
|
2091
|
-
function J(e, t) {
|
|
2092
|
-
for (let a = e.firstElementChild; a; a = a.nextElementSibling)
|
|
2093
|
-
if (a.classList.contains(t)) return a;
|
|
2094
|
-
return null;
|
|
2095
|
-
}
|
|
2096
|
-
function Bt(e) {
|
|
2097
|
-
const t = /* @__PURE__ */ new Map(), a = (r) => {
|
|
2098
|
-
for (let i = r.firstElementChild; i; i = i.nextElementSibling) {
|
|
2099
|
-
if (!i.classList.contains("ui-layer-group")) continue;
|
|
2100
|
-
const o = i.getAttribute("data-layer-id");
|
|
2101
|
-
o !== null && t.set(o, i);
|
|
2102
|
-
const n = J(i, "ui-children-container");
|
|
2103
|
-
n && a(n);
|
|
2104
|
-
}
|
|
2105
|
-
};
|
|
2106
|
-
return a(e), t;
|
|
2107
|
-
}
|
|
2108
|
-
function qt(e) {
|
|
2109
|
-
if (!e || e.length < 2) return !1;
|
|
2110
|
-
const t = /* @__PURE__ */ new Set();
|
|
2111
|
-
for (const a of e) {
|
|
2112
|
-
if (t.has(a.id)) return !0;
|
|
2113
|
-
t.add(a.id);
|
|
2114
|
-
}
|
|
2115
|
-
return !1;
|
|
2116
|
-
}
|
|
2117
|
-
function Dt(e, t) {
|
|
2118
|
-
var i;
|
|
2119
|
-
const a = new Map(t.map((o) => [o.id, o])), r = /* @__PURE__ */ new Set();
|
|
2120
|
-
for (const o of e) {
|
|
2121
|
-
let n = o;
|
|
2122
|
-
for (; n && a.has(n) && !r.has(n); )
|
|
2123
|
-
r.add(n), n = (i = a.get(n)) == null ? void 0 : i.parentId;
|
|
2124
|
-
}
|
|
2125
|
-
return r;
|
|
2126
|
-
}
|
|
2127
|
-
function ce(e) {
|
|
2128
|
-
const t = document.createElement("template");
|
|
2129
|
-
return t.innerHTML = e, { modelo: t, elementos: Array.from(t.content.children) };
|
|
2130
|
-
}
|
|
2131
|
-
function ue(e) {
|
|
2132
|
-
var a;
|
|
2133
|
-
const t = e.nextSibling;
|
|
2134
|
-
t && t.nodeType === 3 && !(t.textContent ?? "").trim() && ((a = t.parentNode) == null || a.removeChild(t)), e.remove();
|
|
2135
|
-
}
|
|
2136
|
-
function Tt(e, t) {
|
|
2137
|
-
if (!e || !t.contains(e)) return null;
|
|
2138
|
-
const a = Array.from(e.attributes).find((r) => r.name.startsWith("data-") && r.value !== "");
|
|
2139
|
-
return a ? { nome: a.name, valor: a.value } : null;
|
|
2140
|
-
}
|
|
2141
|
-
function Ot(e, t) {
|
|
2142
|
-
var F, B;
|
|
2143
|
-
const { host: a, shadow: r, mudanca: i } = e;
|
|
2144
|
-
if ((B = (F = a.ordemFilhosPorPai) == null ? void 0 : F.get(t)) != null && B.length) return !1;
|
|
2145
|
-
const o = e.grupos.get(t), n = e.nodos.get(t), s = o ? J(o, "ui-children-container") : null;
|
|
2146
|
-
if (!o || !n || !s) return !1;
|
|
2147
|
-
const d = n.camada, l = e.porCamada.get(t) ?? [], u = a.expandedFeatureLimits.get(t) ?? Se, p = l.slice(0, u), c = new Set(p.map((E) => E.id)), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = r.activeElement;
|
|
2148
|
-
let v = null;
|
|
2149
|
-
for (let E = s.firstElementChild, P; E; E = P) {
|
|
2150
|
-
P = E.nextElementSibling;
|
|
2151
|
-
const x = E.getAttribute("data-feat-row");
|
|
2152
|
-
if (x === null) {
|
|
2153
|
-
!v && !E.classList.contains("ui-layer-group") && (v = E);
|
|
2154
|
-
continue;
|
|
2155
|
-
}
|
|
2156
|
-
const y = i.idsAlterados.has(x) && c.has(x) && !f.has(x);
|
|
2157
|
-
!c.has(x) || f.has(x) || y ? (y && m.set(x, { tabindex: E.getAttribute("tabindex"), foco: Tt(h, E) }), ue(E)) : (f.set(x, E), v || (v = E));
|
|
2158
|
-
}
|
|
2159
|
-
const g = aa(d, n.depth, e.herdado.get(t)), w = p.filter((E) => !f.has(E.id));
|
|
2160
|
-
let k = [];
|
|
2161
|
-
if (w.length > 0) {
|
|
2162
|
-
const E = w.map(
|
|
2163
|
-
(y) => sa(y, g, a.selectedFeatureIds.has(y.id), a.editingFeatureId === y.id)
|
|
2164
|
-
).join(""), { modelo: P, elementos: x } = ce(E);
|
|
2165
|
-
if (x.length !== w.length) return !1;
|
|
2166
|
-
e.ligar(P.content), k = x;
|
|
2167
|
-
}
|
|
2168
|
-
let L = v, A = 0;
|
|
2169
|
-
const S = /* @__PURE__ */ new Map();
|
|
2170
|
-
for (const E of p) {
|
|
2171
|
-
const P = f.get(E.id);
|
|
2172
|
-
if (P)
|
|
2173
|
-
P === L ? L = P.nextElementSibling : s.insertBefore(P, L);
|
|
2174
|
-
else {
|
|
2175
|
-
const x = k[A++];
|
|
2176
|
-
s.insertBefore(x, L), S.set(E.id, x);
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
return m.forEach((E, P) => {
|
|
2180
|
-
const x = S.get(P);
|
|
2181
|
-
if (!x || (E.tabindex !== null && x.setAttribute("tabindex", E.tabindex), !E.foco)) return;
|
|
2182
|
-
const y = x.getAttribute(E.foco.nome) === E.foco.valor ? x : Array.from(x.querySelectorAll(`[${E.foco.nome}]`)).find(
|
|
2183
|
-
(z) => z.getAttribute(E.foco.nome) === E.foco.valor
|
|
2184
|
-
);
|
|
2185
|
-
y == null || y.focus({ preventScroll: !0 });
|
|
2186
|
-
}), Rt(e, s, n, u, l.length);
|
|
2187
|
-
}
|
|
2188
|
-
function Rt(e, t, a, r, i) {
|
|
2189
|
-
const o = M(a.camada.id), n = !!(a.camada.isGroup || a.subcamadas.length > 0), s = i > r, d = a.subcamadas.length === 0 && i === 0, l = J(t, "ui-truncate-notice"), u = J(t, "ui-empty-row");
|
|
2190
|
-
if (u && !d && ue(u), l && !s && ue(l), s)
|
|
2191
|
-
if (l) {
|
|
2192
|
-
const p = ia(r, i), c = l.querySelector("span"), f = l.querySelector(".ui-truncate-more-btn");
|
|
2193
|
-
if (!c || !f) return !1;
|
|
2194
|
-
c.textContent !== p.resumo && (c.textContent = p.resumo), f.textContent !== p.botao && (f.textContent = p.botao);
|
|
2195
|
-
} else {
|
|
2196
|
-
const { modelo: p, elementos: c } = ce(oa(o, r, i));
|
|
2197
|
-
if (c.length !== 1) return !1;
|
|
2198
|
-
e.ligar(p.content), t.appendChild(c[0]);
|
|
2199
|
-
}
|
|
2200
|
-
if (d && !u) {
|
|
2201
|
-
const { elementos: p } = ce(na(n));
|
|
2202
|
-
if (p.length !== 1) return !1;
|
|
2203
|
-
t.appendChild(p[0]);
|
|
2204
|
-
}
|
|
2205
|
-
return !0;
|
|
2206
|
-
}
|
|
2207
|
-
function jt(e, t) {
|
|
2208
|
-
const a = e.grupos.get(t), r = e.nodos.get(t), i = a ? J(a, "ui-layer-row") : null, o = i == null ? void 0 : i.querySelector(".ui-col-name");
|
|
2209
|
-
if (!a || !r || !i || !o) return !1;
|
|
2210
|
-
const { host: n } = e, s = ae(n.camadas, n.feicoes, t), d = (e.porCamada.get(t) ?? []).length, l = r.subcamadas.length, u = !!(r.camada.isGroup || l > 0), p = o.querySelector(".ui-count-chip");
|
|
2211
|
-
if (p)
|
|
2212
|
-
if (s.length === 0 && u)
|
|
2213
|
-
ue(p);
|
|
2214
|
-
else {
|
|
2215
|
-
const c = String(s.length), f = ta(s.length, d, l);
|
|
2216
|
-
p.textContent !== c && (p.textContent = c), p.getAttribute("title") !== f && p.setAttribute("title", f);
|
|
2217
|
-
}
|
|
2218
|
-
else {
|
|
2219
|
-
const c = ra(s.length, d, l, u);
|
|
2220
|
-
if (c) {
|
|
2221
|
-
const { elementos: f } = ce(c);
|
|
2222
|
-
if (f.length !== 1) return !1;
|
|
2223
|
-
o.appendChild(f[0]);
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
return ua(i.querySelector(".ui-target-circle"), s, n.selectedFeatureIds), !0;
|
|
2227
|
-
}
|
|
2228
|
-
function Nt(e, t, a, r) {
|
|
2229
|
-
const i = t.getElementById("ui-layer-tree-mount"), o = ha(pe(e.camadas)), n = i ? Bt(i) : /* @__PURE__ */ new Map(), s = Pt(e.feicoes), d = a.camadas === "todas" ? Array.from(o.keys()) : Array.from(a.camadas), l = d.map((c) => ({
|
|
2230
|
-
existeNoModelo: o.has(c),
|
|
2231
|
-
renderizadaNoDom: n.has(c),
|
|
2232
|
-
drawerAberto: e.activeSettingsLayerId === c
|
|
2233
|
-
}));
|
|
2234
|
-
if (!zt({
|
|
2235
|
-
arvoreRenderizada: i !== null,
|
|
2236
|
-
buscaAtiva: (e.searchQuery || "").trim() !== "",
|
|
2237
|
-
editandoCamada: e.editingLayerId !== null,
|
|
2238
|
-
editandoFeicao: e.editingFeatureId !== null,
|
|
2239
|
-
idsDuplicados: d.some((c) => qt(s.get(c))),
|
|
2240
|
-
camadasAfetadas: l
|
|
2241
|
-
}).incremental) return !1;
|
|
2242
|
-
const p = {
|
|
2243
|
-
host: e,
|
|
2244
|
-
shadow: t,
|
|
2245
|
-
mudanca: a,
|
|
2246
|
-
porCamada: s,
|
|
2247
|
-
nodos: o,
|
|
2248
|
-
grupos: n,
|
|
2249
|
-
herdado: fe(e.camadas),
|
|
2250
|
-
ligar: r
|
|
2251
|
-
};
|
|
2252
|
-
for (const c of d)
|
|
2253
|
-
if (!Ot(p, c)) return !1;
|
|
2254
|
-
for (const c of Dt(d, e.camadas))
|
|
2255
|
-
if (!jt(p, c)) return !1;
|
|
2256
|
-
return (a.selecaoAfetada || e.selectedFeatureIds.size > 0) && pa(e, t), !0;
|
|
2257
|
-
}
|
|
2258
|
-
function Ht(e) {
|
|
2259
|
-
if (!e.isConnected) return;
|
|
2260
|
-
const t = document.createElement("div");
|
|
2261
|
-
t.className = "ui-basemap-preview-none", t.innerHTML = b.gradeCad, e.replaceWith(t);
|
|
2262
|
-
}
|
|
2263
|
-
function Gt(e, t, a, r) {
|
|
2264
|
-
var h, v;
|
|
2265
|
-
const i = ot({
|
|
2266
|
-
camadas: e.camadas,
|
|
2267
|
-
feicoes: e.feicoes,
|
|
2268
|
-
camadaAtivaId: e.camadaAtivaId,
|
|
2269
|
-
expandedLayers: e.expandedLayers,
|
|
2270
|
-
selectedFeatureIds: e.selectedFeatureIds,
|
|
2271
|
-
activeSettingsLayerId: e.activeSettingsLayerId,
|
|
2272
|
-
editingLayerId: e.editingLayerId,
|
|
2273
|
-
editingFeatureId: e.editingFeatureId,
|
|
2274
|
-
searchQuery: e.searchQuery,
|
|
2275
|
-
titulo: e.titulo,
|
|
2276
|
-
mostrarBusca: e.mostrarBusca,
|
|
2277
|
-
limitesPorCamada: e.expandedFeatureLimits,
|
|
2278
|
-
mostrarBotaoColapsar: e.flutuante && e.getAttribute("colapsavel") !== "false",
|
|
2279
|
-
ordemFilhosPorPai: e.ordemFilhosPorPai
|
|
2280
|
-
}), o = e.mostrarMapasBase ? Va(e.mapasBase, e.mapaBaseAtivo, e.mapasBaseRecolhido) : "", n = e.mostrarRodape ? Ua(e.camadas, e.feicoes, e.selectedFeatureIds) : "", s = t.getElementById("ui-layer-tree-mount"), d = a.scrollTop, l = s ? s.scrollTop : 0, u = t.activeElement, p = u && a.contains(u) ? u.id : "", c = u && !p && a.contains(u) ? Array.from(u.attributes).find((g) => g.name.startsWith("data-") && g.value !== "") : void 0, f = u && "selectionStart" in u ? u.selectionStart : null;
|
|
2281
|
-
a.innerHTML = `
|
|
2282
|
-
${i}
|
|
2283
|
-
${n}
|
|
2284
|
-
${o}
|
|
2285
|
-
`, a.scrollTop = d;
|
|
2286
|
-
const m = t.getElementById("ui-layer-tree-mount");
|
|
2287
|
-
if (m && (m.scrollTop = l), p) {
|
|
2288
|
-
const g = t.getElementById(p);
|
|
2289
|
-
if (g && (g.focus({ preventScroll: !0 }), f !== null && typeof g.setSelectionRange == "function"))
|
|
2290
|
-
try {
|
|
2291
|
-
g.setSelectionRange(f, f);
|
|
2292
|
-
} catch {
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
!p && c && ((h = D(a, c.name, c.value)) == null || h.focus({ preventScroll: !0 })), (v = t.querySelector("[data-layer-row], [data-feat-row]")) == null || v.setAttribute("tabindex", "0"), a.querySelectorAll("img[data-basemap-thumb]").forEach((g) => {
|
|
2296
|
-
const w = () => Ht(g);
|
|
2297
|
-
g.addEventListener("error", w, { once: !0 }), g.complete && g.naturalWidth === 0 && g.getAttribute("src") && w();
|
|
2298
|
-
}), Mt(e, t), r.bindAll();
|
|
2299
|
-
}
|
|
2300
|
-
function Vt(e, t, a, r) {
|
|
2301
|
-
try {
|
|
2302
|
-
return Nt(e, t, r, (i) => {
|
|
2303
|
-
ga(e, i), fa(e, i), ma(e, t, i), a.bindLinhasFeicao(i);
|
|
2304
|
-
});
|
|
2305
|
-
} catch (i) {
|
|
2306
|
-
return console.warn("[UI-Camadas] atualização incremental falhou; redesenhando o painel.", i), !1;
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
const _t = '[role="button"][tabindex]', Z = "[data-layer-row], [data-feat-row]", Ut = ["color", "range", "checkbox", "radio", "button"];
|
|
2310
|
-
function va(e) {
|
|
2311
|
-
return !e || !(e instanceof Element) || e instanceof HTMLInputElement && Ut.includes(e.type) ? !1 : Ra({ composedPath: () => [e] });
|
|
2312
|
-
}
|
|
2313
|
-
function Yt(e) {
|
|
2314
|
-
return Array.from(e.querySelectorAll(Z)).filter((t) => {
|
|
2315
|
-
const a = t.closest(".ui-children-container");
|
|
2316
|
-
return !(a && a.style.display === "none") && !t.classList.contains("ui-search-hidden");
|
|
2317
|
-
});
|
|
2318
|
-
}
|
|
2319
|
-
function V(e, t) {
|
|
2320
|
-
t && (e.querySelectorAll(Z).forEach((a) => a.setAttribute("tabindex", "-1")), t.setAttribute("tabindex", "0"), t.focus());
|
|
2321
|
-
}
|
|
2322
|
-
function Kt(e, t) {
|
|
2323
|
-
e.dispatchEvent(
|
|
2324
|
-
new MouseEvent("click", {
|
|
2325
|
-
bubbles: !0,
|
|
2326
|
-
ctrlKey: t.ctrlKey || t.metaKey,
|
|
2327
|
-
shiftKey: t.shiftKey
|
|
2328
|
-
})
|
|
2329
|
-
);
|
|
2330
|
-
}
|
|
2331
|
-
function Qt(e, t, a) {
|
|
2332
|
-
var i;
|
|
2333
|
-
if (va(a.composedPath()[0])) return;
|
|
2334
|
-
const r = t.querySelector(".confirming");
|
|
2335
|
-
if (r) {
|
|
2336
|
-
a.preventDefault(), r.dispatchEvent(new Event("ui-cancelar-confirmacao")), r.classList.remove("confirming");
|
|
2337
|
-
return;
|
|
2338
|
-
}
|
|
2339
|
-
if (e.activeSettingsLayerId) {
|
|
2340
|
-
a.preventDefault();
|
|
2341
|
-
const o = e.activeSettingsLayerId;
|
|
2342
|
-
e.activeSettingsLayerId = null, e.solicitarRenderizacao(), (i = D(t, "data-layer-settings", o)) == null || i.focus();
|
|
2343
|
-
return;
|
|
2344
|
-
}
|
|
2345
|
-
e.selectedFeatureIds.size > 0 && (a.preventDefault(), e.limparSelecao(!0));
|
|
2346
|
-
}
|
|
2347
|
-
function Xt(e, t, a, r) {
|
|
2348
|
-
var s, d, l;
|
|
2349
|
-
const i = r.composedPath()[0];
|
|
2350
|
-
if (!(i instanceof HTMLElement) || va(i)) return;
|
|
2351
|
-
if ((r.key === "Enter" || r.key === " ") && i.matches(_t)) {
|
|
2352
|
-
r.preventDefault(), i.click();
|
|
2353
|
-
return;
|
|
2354
|
-
}
|
|
2355
|
-
if (!i.matches(Z)) return;
|
|
2356
|
-
const o = Yt(t), n = o.indexOf(i);
|
|
2357
|
-
if (r.key === "F2") {
|
|
2358
|
-
r.preventDefault();
|
|
2359
|
-
const u = i.getAttribute("data-layer-row"), p = i.getAttribute("data-feat-row"), c = u ? D(i, "data-layer-name-trigger", u) : p ? D(i, "data-feat-name-trigger", p) : null;
|
|
2360
|
-
c && c.dispatchEvent(new MouseEvent("dblclick", { bubbles: !0 }));
|
|
2361
|
-
return;
|
|
2362
|
-
}
|
|
2363
|
-
if ((r.ctrlKey || r.metaKey) && (r.key === "a" || r.key === "A")) {
|
|
2364
|
-
r.preventDefault();
|
|
2365
|
-
const u = da(
|
|
2366
|
-
e.camadas,
|
|
2367
|
-
e.feicoes,
|
|
2368
|
-
e.expandedLayers,
|
|
2369
|
-
e.searchQuery,
|
|
2370
|
-
void 0,
|
|
2371
|
-
e.expandedFeatureLimits
|
|
2372
|
-
);
|
|
2373
|
-
u.length > 0 && e.selecionarFeicoes(u, !0);
|
|
2374
|
-
return;
|
|
2375
|
-
}
|
|
2376
|
-
if (r.key === "Delete") {
|
|
2377
|
-
const u = a.getElementById("btn-footer-del");
|
|
2378
|
-
if (u && !u.hasAttribute("disabled") && e.selectedFeatureIds.size > 0) {
|
|
2379
|
-
r.preventDefault(), u.click();
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
switch (r.key) {
|
|
2384
|
-
case "ArrowDown":
|
|
2385
|
-
r.preventDefault(), V(t, o[Math.min(o.length - 1, n + 1)]);
|
|
2386
|
-
break;
|
|
2387
|
-
case "ArrowUp":
|
|
2388
|
-
r.preventDefault(), V(t, o[Math.max(0, n - 1)]);
|
|
2389
|
-
break;
|
|
2390
|
-
case "Home":
|
|
2391
|
-
r.preventDefault(), V(t, o[0]);
|
|
2392
|
-
break;
|
|
2393
|
-
case "End":
|
|
2394
|
-
r.preventDefault(), V(t, o[o.length - 1]);
|
|
2395
|
-
break;
|
|
2396
|
-
case "ArrowRight": {
|
|
2397
|
-
const u = i.getAttribute("data-layer-row");
|
|
2398
|
-
if (!u) return;
|
|
2399
|
-
const p = i.closest(".ui-layer-group");
|
|
2400
|
-
(p == null ? void 0 : p.getAttribute("aria-expanded")) === "true" ? n + 1 < o.length && (p != null && p.contains(o[n + 1])) && (r.preventDefault(), V(t, o[n + 1])) : (r.preventDefault(), (s = D(a, "data-layer-expand", u)) == null || s.click());
|
|
2401
|
-
break;
|
|
2402
|
-
}
|
|
2403
|
-
case "ArrowLeft": {
|
|
2404
|
-
const u = i.getAttribute("data-layer-row");
|
|
2405
|
-
if (u) {
|
|
2406
|
-
const f = i.closest(".ui-layer-group");
|
|
2407
|
-
if ((f == null ? void 0 : f.getAttribute("aria-expanded")) === "true")
|
|
2408
|
-
r.preventDefault(), (d = D(a, "data-layer-expand", u)) == null || d.click();
|
|
2409
|
-
else {
|
|
2410
|
-
const h = (l = f == null ? void 0 : f.parentElement) == null ? void 0 : l.closest(".ui-layer-group"), v = h == null ? void 0 : h.getAttribute("data-layer-id"), g = v ? D(t, "data-layer-row", v) : null;
|
|
2411
|
-
g && (r.preventDefault(), V(t, g));
|
|
2412
|
-
}
|
|
2413
|
-
return;
|
|
2414
|
-
}
|
|
2415
|
-
const p = i.getAttribute("data-feat-layer"), c = p ? D(t, "data-layer-row", p) : null;
|
|
2416
|
-
c && (r.preventDefault(), V(t, c));
|
|
2417
|
-
break;
|
|
2418
|
-
}
|
|
2419
|
-
case "Enter":
|
|
2420
|
-
case " ":
|
|
2421
|
-
r.preventDefault(), Kt(i, r);
|
|
2422
|
-
break;
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2425
|
-
function Wt(e, t, a, r, i) {
|
|
2426
|
-
i.add(t, "keydown", (o) => {
|
|
2427
|
-
o.key === "Escape" && Qt(e, a, o);
|
|
2428
|
-
}), i.add(r, "keydown", (o) => Xt(e, r, a, o)), i.add(r, "focusin", (o) => {
|
|
2429
|
-
const n = o.composedPath()[0];
|
|
2430
|
-
n instanceof HTMLElement && n.matches(Z) && (r.querySelectorAll(Z).forEach((s) => s.setAttribute("tabindex", "-1")), n.setAttribute("tabindex", "0"));
|
|
2431
|
-
});
|
|
2432
|
-
}
|
|
2433
|
-
function Jt(e, t, a, r, i) {
|
|
2434
|
-
const o = da(
|
|
2435
|
-
e.camadas,
|
|
2436
|
-
e.feicoes,
|
|
2437
|
-
e.expandedLayers,
|
|
2438
|
-
e.searchQuery,
|
|
2439
|
-
void 0,
|
|
2440
|
-
e.expandedFeatureLimits
|
|
2441
|
-
), n = !r && !o.includes(t) && e.feicoes.some((d) => d.id === t), s = Xa(
|
|
2442
|
-
n ? [...o, t] : o,
|
|
2443
|
-
e.selectedFeatureIds,
|
|
2444
|
-
e.lastClickedFeatureId,
|
|
2445
|
-
t,
|
|
2446
|
-
a,
|
|
2447
|
-
r
|
|
2448
|
-
);
|
|
2449
|
-
s && (e.selectedFeatureIds = s.selecionados, e.lastClickedFeatureId = s.ultimoClicadoId, e.sincronizarSelecaoDOM(), i && e.notificarMudancaSelecao());
|
|
2450
|
-
}
|
|
2451
|
-
function Zt(e, t, a) {
|
|
2452
|
-
const r = t || [];
|
|
2453
|
-
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());
|
|
2454
|
-
}
|
|
2455
|
-
function er(e, t) {
|
|
2456
|
-
e.selectedFeatureIds.size !== 0 && (e.selectedFeatureIds.clear(), e.lastClickedFeatureId = null, e.sincronizarSelecaoDOM(), t && e.notificarMudancaSelecao());
|
|
2457
|
-
}
|
|
2458
|
-
function ar(e) {
|
|
2459
|
-
const t = e.feicoes.filter((a) => e.selectedFeatureIds.has(a.id));
|
|
2460
|
-
e.dispararEvento("ui-feicoes-selecionadas", {
|
|
2461
|
-
feicoesIds: Array.from(e.selectedFeatureIds),
|
|
2462
|
-
feicoes: t
|
|
2463
|
-
}), 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 });
|
|
2464
|
-
}
|
|
2465
|
-
class tr {
|
|
2466
|
-
constructor(t) {
|
|
2467
|
-
I(this, "origens", /* @__PURE__ */ new Map());
|
|
2468
|
-
I(this, "removidas", /* @__PURE__ */ new Set());
|
|
2469
|
-
I(this, "salvarComDebounce", Ke(() => this.salvar(), 200));
|
|
2470
|
-
this.instantaneo = t;
|
|
2471
|
-
}
|
|
2472
|
-
chaveAtual() {
|
|
2473
|
-
const t = this.instantaneo();
|
|
2474
|
-
return ct(t.storageKey, t.id);
|
|
2475
|
-
}
|
|
2476
|
-
carregar() {
|
|
2477
|
-
return ke(this.chaveAtual());
|
|
2478
|
-
}
|
|
2479
|
-
/** Versão com debounce, para interações contínuas (seletor de cor, slider de opacidade). */
|
|
2480
|
-
agendar() {
|
|
2481
|
-
this.salvarComDebounce();
|
|
2482
|
-
}
|
|
2483
|
-
salvar() {
|
|
2484
|
-
const t = this.instantaneo();
|
|
2485
|
-
if (!t.persistir || !t.conectado) return;
|
|
2486
|
-
const a = this.chaveAtual(), r = gt({
|
|
2487
|
-
estadoAnterior: ke(a),
|
|
2488
|
-
origensCamadas: this.origens,
|
|
2489
|
-
camadas: t.camadas,
|
|
2490
|
-
expandedLayers: t.expandedLayers,
|
|
2491
|
-
camadaAtivaId: t.camadaAtivaId,
|
|
2492
|
-
painelColapsado: t.painelColapsado,
|
|
2493
|
-
mapaBaseAtivo: t.mapaBaseAtivo,
|
|
2494
|
-
densidade: t.densidade,
|
|
2495
|
-
altura: t.altura,
|
|
2496
|
-
camadasRemovidas: this.removidas,
|
|
2497
|
-
ordemFilhosPorPai: t.ordemFilhosPorPai
|
|
2498
|
-
});
|
|
2499
|
-
this.removidas.clear(), pt(a, r);
|
|
2500
|
-
}
|
|
2501
|
-
limpar() {
|
|
2502
|
-
ft(this.chaveAtual());
|
|
2503
|
-
}
|
|
2504
|
-
// --- Origens (como a camada chegou do consumidor) e remoções ---
|
|
2505
|
-
limparOrigens() {
|
|
2506
|
-
this.origens.clear();
|
|
2507
|
-
}
|
|
2508
|
-
registrarOrigem(t) {
|
|
2509
|
-
this.origens.set(t.id, ca(t));
|
|
2510
|
-
}
|
|
2511
|
-
esquecerCamada(t) {
|
|
2512
|
-
this.origens.delete(t), this.removidas.add(t);
|
|
2513
|
-
}
|
|
2514
|
-
/** Aplica por cima de `camadas` o que foi lembrado (expansão, visibilidade, travas, opacidade, cor, ordem). */
|
|
2515
|
-
reidratar(t, a, r, i) {
|
|
2516
|
-
if (mt(t, a, r, this.origens), i && (i.clear(), a != null && a.ordemFilhosPorPai))
|
|
2517
|
-
for (const [o, n] of Object.entries(a.ordemFilhosPorPai))
|
|
2518
|
-
Array.isArray(n) && n.length > 0 && i.set(o, [...n]);
|
|
2519
|
-
}
|
|
2520
|
-
}
|
|
2521
|
-
function $e(e, t = null, a = /* @__PURE__ */ new Set()) {
|
|
2522
|
-
const r = [];
|
|
2523
|
-
if (!Array.isArray(e)) return r;
|
|
2524
|
-
for (const i of e) {
|
|
2525
|
-
if (!i || typeof i != "object" || !i.id) continue;
|
|
2526
|
-
const o = String(i.id);
|
|
2527
|
-
if (a.has(o)) continue;
|
|
2528
|
-
a.add(o);
|
|
2529
|
-
const n = { ...i, id: o };
|
|
2530
|
-
delete n.children, t && n.parentId === void 0 && (n.parentId = t), r.push(n), Array.isArray(i.children) && i.children.length > 0 && r.push(...$e(i.children, o, a));
|
|
2531
|
-
}
|
|
2532
|
-
return r;
|
|
2533
|
-
}
|
|
2534
|
-
function ba(e) {
|
|
2535
|
-
const t = e.lastClickedFeatureId;
|
|
2536
|
-
t && !e.feicoes.some((a) => a.id === t) && (e.lastClickedFeatureId = null);
|
|
2537
|
-
}
|
|
2538
|
-
function ya(e) {
|
|
2539
|
-
if (!Array.isArray(e)) return [];
|
|
2540
|
-
const t = /* @__PURE__ */ new Set(), a = [];
|
|
2541
|
-
for (const r of e) {
|
|
2542
|
-
if (!r || typeof r != "object" || !r.id) continue;
|
|
2543
|
-
const i = String(r.id);
|
|
2544
|
-
t.has(i) || (t.add(i), a.push({ ...r, id: i }));
|
|
2545
|
-
}
|
|
2546
|
-
return a;
|
|
2547
|
-
}
|
|
2548
|
-
function rr(e, t, a) {
|
|
2549
|
-
if (e.camadas = Array.isArray(t) ? $e(t) : [], e.lembranca.limparOrigens(), e.persistir) {
|
|
2550
|
-
const o = e.lembranca.carregar();
|
|
2551
|
-
e.lembranca.reidratar(e.camadas, o, e.expandedLayers, e.ordemFilhosPorPai), o != null && o.camadaAtivaId && e.camadas.some((n) => n.id === o.camadaAtivaId) && (e.camadaAtivaId = o.camadaAtivaId);
|
|
2552
|
-
} else
|
|
2553
|
-
e.camadas.forEach((o) => {
|
|
2554
|
-
e.lembranca.registrarOrigem(o), e.expandedLayers.has(o.id) || e.expandedLayers.add(o.id);
|
|
2555
|
-
});
|
|
2556
|
-
if (Array.isArray(a)) {
|
|
2557
|
-
e.feicoes = ya(a);
|
|
2558
|
-
const o = new Set(e.camadas.map((s) => s.id)), n = e.feicoes.filter((s) => s.layerId && !o.has(s.layerId));
|
|
2559
|
-
n.length > 0 && console.warn(
|
|
2560
|
-
`[UI-Camadas] ${n.length} feição(ões) possuem 'layerId' não cadastrado nas camadas:`,
|
|
2561
|
-
n.map((s) => ({ id: s.id, nome: s.name, layerId: s.layerId }))
|
|
2562
|
-
), Fe(e.selectedFeatureIds, e.feicoes), ba(e);
|
|
2563
|
-
}
|
|
2564
|
-
const r = new Set(e.camadas.map((o) => o.id));
|
|
2565
|
-
if (e.activeSettingsLayerId && !r.has(e.activeSettingsLayerId) && (e.activeSettingsLayerId = null), e.editingLayerId && !r.has(e.editingLayerId) && (e.editingLayerId = null), e.expandedFeatureLimits)
|
|
2566
|
-
for (const o of e.expandedFeatureLimits.keys())
|
|
2567
|
-
r.has(o) || e.expandedFeatureLimits.delete(o);
|
|
2568
|
-
const i = e.getAttribute("camada-ativa");
|
|
2569
|
-
e.camadas.length > 0 && (!i || !r.has(i)) && (e.camadaAtivaId = e.camadas[0].id), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2570
|
-
}
|
|
2571
|
-
function ir(e, t) {
|
|
2572
|
-
const a = new Map(e.map((i) => [i.id, i])), r = /* @__PURE__ */ new Set();
|
|
2573
|
-
for (const i of t) {
|
|
2574
|
-
const o = a.get(i.id);
|
|
2575
|
-
(!o || !Qa(o, i)) && r.add(i.id);
|
|
2576
|
-
}
|
|
2577
|
-
return r;
|
|
2578
|
-
}
|
|
2579
|
-
function or(e, t) {
|
|
2580
|
-
const a = e.feicoes;
|
|
2581
|
-
e.feicoes = ya(t);
|
|
2582
|
-
const r = e.selectedFeatureIds.size;
|
|
2583
|
-
Fe(e.selectedFeatureIds, e.feicoes), ba(e), e.editingFeatureId && !e.feicoes.some((i) => i.id === e.editingFeatureId) && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
|
|
2584
|
-
camadas: "todas",
|
|
2585
|
-
idsAlterados: ir(a, e.feicoes),
|
|
2586
|
-
selecaoAfetada: e.selectedFeatureIds.size !== r
|
|
2587
|
-
});
|
|
2588
|
-
}
|
|
2589
|
-
function nr(e, t) {
|
|
2590
|
-
if (!t || !t.id) return;
|
|
2591
|
-
if (e.camadas.some((r) => r.id === t.id)) {
|
|
2592
|
-
console.warn(`[UI-Camadas] adicionarCamada ignorado: já existe uma camada com id '${t.id}'.`);
|
|
2593
|
-
return;
|
|
2594
|
-
}
|
|
2595
|
-
const a = new Set(e.camadas.map((r) => r.id));
|
|
2596
|
-
for (const r of $e([t])) {
|
|
2597
|
-
if (a.has(r.id)) {
|
|
2598
|
-
console.warn(`[UI-Camadas] adicionarCamada: subcamada '${r.id}' ignorada, o id já existe.`);
|
|
2599
|
-
continue;
|
|
2600
|
-
}
|
|
2601
|
-
a.add(r.id), e.camadas.push(r), e.lembranca.registrarOrigem(r), e.expandedLayers.add(r.id), r.parentId && e.expandedLayers.add(r.parentId);
|
|
2602
|
-
}
|
|
2603
|
-
e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2604
|
-
}
|
|
2605
|
-
function sr(e, t) {
|
|
2606
|
-
var r, i;
|
|
2607
|
-
const a = e.camadas.find((o) => o.id === t);
|
|
2608
|
-
e.camadas.forEach((o) => {
|
|
2609
|
-
o.parentId === t && (o.parentId = null);
|
|
2610
|
-
}), e.camadas = e.camadas.filter((o) => o.id !== t), e.feicoes = e.feicoes.filter((o) => o.layerId !== t), e.ordemFilhosPorPai && (e.ordemFilhosPorPai.delete(t), a != null && a.parentId && _(e.ordemFilhosPorPai, a.parentId, R(t))), e.lembranca.esquecerCamada(t), e.expandedLayers.delete(t), (r = e.expandedFeatureLimits) == null || r.delete(t), e.activeSettingsLayerId === t && (e.activeSettingsLayerId = null), e.editingLayerId === t && (e.editingLayerId = null), e.editingFeatureId && !e.feicoes.some((o) => o.id === e.editingFeatureId) && (e.editingFeatureId = null), Fe(e.selectedFeatureIds, e.feicoes), e.selectedFeatureIds.size === 0 && (e.lastClickedFeatureId = null), e.camadaAtivaId === t && (e.camadaAtivaId = ((i = e.camadas[0]) == null ? void 0 : i.id) ?? null), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2611
|
-
}
|
|
2612
|
-
function lr(e, t) {
|
|
2613
|
-
if (!(!t || !t.id)) {
|
|
2614
|
-
if (e.feicoes.some((a) => a.id === t.id)) {
|
|
2615
|
-
console.warn(`[UI-Camadas] adicionarFeicao ignorado: já existe uma feição com id '${t.id}'.`);
|
|
2616
|
-
return;
|
|
2617
|
-
}
|
|
2618
|
-
e.feicoes.push({ ...t }), e.solicitarAtualizacaoFeicoes({
|
|
2619
|
-
camadas: /* @__PURE__ */ new Set([t.layerId || ""]),
|
|
2620
|
-
idsAlterados: /* @__PURE__ */ new Set(),
|
|
2621
|
-
selecaoAfetada: e.selectedFeatureIds.has(t.id)
|
|
2622
|
-
});
|
|
2623
|
-
}
|
|
2624
|
-
}
|
|
2625
|
-
function dr(e, t) {
|
|
2626
|
-
if (!t || typeof t != "object" || !t.id) return;
|
|
2627
|
-
const a = e.feicoes.findIndex((r) => r.id === t.id);
|
|
2628
|
-
if (a !== -1) {
|
|
2629
|
-
const r = e.feicoes[a].layerId || "";
|
|
2630
|
-
e.feicoes[a] = { ...e.feicoes[a], ...t }, e.solicitarAtualizacaoFeicoes({
|
|
2631
|
-
camadas: /* @__PURE__ */ new Set([r, e.feicoes[a].layerId || ""]),
|
|
2632
|
-
idsAlterados: /* @__PURE__ */ new Set([t.id]),
|
|
2633
|
-
selecaoAfetada: !1
|
|
2634
|
-
});
|
|
2635
|
-
}
|
|
2636
|
-
}
|
|
2637
|
-
function cr(e, t) {
|
|
2638
|
-
const a = e.feicoes.find((i) => i.id === t);
|
|
2639
|
-
e.feicoes = e.feicoes.filter((i) => i.id !== t), a != null && a.layerId && e.ordemFilhosPorPai && _(e.ordemFilhosPorPai, a.layerId, O(t));
|
|
2640
|
-
const r = e.selectedFeatureIds.delete(t);
|
|
2641
|
-
e.lastClickedFeatureId === t && (e.lastClickedFeatureId = null), e.editingFeatureId === t && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
|
|
2642
|
-
camadas: new Set(a ? [a.layerId || ""] : []),
|
|
2643
|
-
idsAlterados: /* @__PURE__ */ new Set(),
|
|
2644
|
-
selecaoAfetada: r
|
|
2645
|
-
});
|
|
2646
|
-
}
|
|
2647
|
-
function ur(e) {
|
|
2648
|
-
function r() {
|
|
2649
|
-
return e.getMinAltura ? e.getMinAltura() : 140;
|
|
2650
|
-
}
|
|
2651
|
-
function i() {
|
|
2652
|
-
return e.getMaxAltura ? e.getMaxAltura() : 1600;
|
|
2653
|
-
}
|
|
2654
|
-
function o(l, u = !1) {
|
|
2655
|
-
if (l == null || l === "") {
|
|
2656
|
-
e.hostElement.style.removeProperty("height"), e.hostElement.style.removeProperty("--ui-camadas-altura"), u && e.hostElement.dispatchEvent(
|
|
2657
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2658
|
-
bubbles: !0,
|
|
2659
|
-
composed: !0,
|
|
2660
|
-
detail: { altura: null }
|
|
2661
|
-
})
|
|
2662
|
-
);
|
|
2663
|
-
return;
|
|
2664
|
-
}
|
|
2665
|
-
const p = typeof l == "number" ? l : parseFloat(String(l));
|
|
2666
|
-
if (isNaN(p)) return;
|
|
2667
|
-
const c = Math.max(r(), Math.min(i(), Math.round(p)));
|
|
2668
|
-
e.hostElement.style.height = `${c}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${c}px`), u && e.hostElement.dispatchEvent(
|
|
2669
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2670
|
-
bubbles: !0,
|
|
2671
|
-
composed: !0,
|
|
2672
|
-
detail: { altura: c }
|
|
2673
|
-
})
|
|
2674
|
-
);
|
|
2675
|
-
}
|
|
2676
|
-
let n = null;
|
|
2677
|
-
function s() {
|
|
2678
|
-
if (!e.resizerElement) return;
|
|
2679
|
-
let l = !1, u = 0, p = 0;
|
|
2680
|
-
const c = (m) => {
|
|
2681
|
-
if (m.button !== 0) return;
|
|
2682
|
-
m.preventDefault(), m.stopPropagation(), l = !0, u = m.clientY, p = e.hostElement.getBoundingClientRect().height, e.resizerElement.classList.add("ui-camadas-resizer--ativo"), e.hostElement.classList.add("ui-camadas--redimensionando");
|
|
2683
|
-
try {
|
|
2684
|
-
e.resizerElement.setPointerCapture(m.pointerId);
|
|
2685
|
-
} catch {
|
|
2686
|
-
}
|
|
2687
|
-
const h = (w) => {
|
|
2688
|
-
if (!l) return;
|
|
2689
|
-
w.preventDefault();
|
|
2690
|
-
const k = w.clientY - u, L = Math.max(r(), Math.min(i(), Math.round(p + k)));
|
|
2691
|
-
e.hostElement.style.height = `${L}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${L}px`), e.onRedimensionando && e.onRedimensionando(L), e.hostElement.dispatchEvent(
|
|
2692
|
-
new CustomEvent("ui-redimensionando-altura", {
|
|
2693
|
-
bubbles: !0,
|
|
2694
|
-
composed: !0,
|
|
2695
|
-
detail: { altura: L }
|
|
2696
|
-
})
|
|
2697
|
-
);
|
|
2698
|
-
}, v = () => {
|
|
2699
|
-
var w;
|
|
2700
|
-
l = !1, n = null, window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g), (w = e.resizerElement) == null || w.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
2701
|
-
}, g = (w) => {
|
|
2702
|
-
if (!l) return;
|
|
2703
|
-
l = !1, e.resizerElement.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
2704
|
-
try {
|
|
2705
|
-
e.resizerElement.hasPointerCapture(w.pointerId) && e.resizerElement.releasePointerCapture(w.pointerId);
|
|
2706
|
-
} catch {
|
|
2707
|
-
}
|
|
2708
|
-
window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g);
|
|
2709
|
-
const k = e.hostElement.getBoundingClientRect().height, L = Math.round(k);
|
|
2710
|
-
e.onAlturaAlterada && e.onAlturaAlterada(L), e.hostElement.dispatchEvent(
|
|
2711
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2712
|
-
bubbles: !0,
|
|
2713
|
-
composed: !0,
|
|
2714
|
-
detail: { altura: L }
|
|
2715
|
-
})
|
|
2716
|
-
);
|
|
2717
|
-
};
|
|
2718
|
-
n = v, window.addEventListener("pointermove", h), window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g);
|
|
2719
|
-
}, f = (m) => {
|
|
2720
|
-
m.preventDefault(), m.stopPropagation(), o(null, !0), e.onAlturaAlterada && e.onAlturaAlterada(null);
|
|
2721
|
-
};
|
|
2722
|
-
e.listeners.add(e.resizerElement, "pointerdown", c), e.listeners.add(e.resizerElement, "dblclick", f);
|
|
2723
|
-
}
|
|
2724
|
-
function d() {
|
|
2725
|
-
n == null || n(), e.listeners.cleanup();
|
|
2726
|
-
}
|
|
2727
|
-
return {
|
|
2728
|
-
init: s,
|
|
2729
|
-
definirAltura: o,
|
|
2730
|
-
destruir: d
|
|
2731
|
-
};
|
|
2732
|
-
}
|
|
2733
|
-
const Y = class Y extends Ba {
|
|
2734
|
-
constructor() {
|
|
2735
|
-
super();
|
|
2736
|
-
I(this, "shadow");
|
|
2737
|
-
I(this, "listeners", new Ta());
|
|
2738
|
-
I(this, "dragDropManager");
|
|
2739
|
-
I(this, "resizerController");
|
|
2740
|
-
I(this, "bordaResizeObserver", null);
|
|
2741
|
-
I(this, "alturaCustomizada", null);
|
|
2742
|
-
I(this, "conectado", !1);
|
|
2743
|
-
I(this, "profundidadeLote", 0);
|
|
2744
|
-
I(this, "renderPendente", !1);
|
|
2745
|
-
/** Mudança de feições à espera do `render()` (consumida nele): permite atualizar só as linhas afetadas. */
|
|
2746
|
-
I(this, "mudancaFeicoes", null);
|
|
2747
|
-
/** @internal */
|
|
2748
|
-
I(this, "lembranca", new tr(() => ({
|
|
2749
|
-
persistir: this.persistir,
|
|
2750
|
-
conectado: this.conectado,
|
|
2751
|
-
storageKey: this.storageKey,
|
|
2752
|
-
id: this.id,
|
|
2753
|
-
camadas: this.camadas,
|
|
2754
|
-
expandedLayers: this.expandedLayers,
|
|
2755
|
-
camadaAtivaId: this.camadaAtivaId,
|
|
2756
|
-
painelColapsado: this.colapsado,
|
|
2757
|
-
mapaBaseAtivo: this.mapaBaseAtivo,
|
|
2758
|
-
densidade: this.densidade,
|
|
2759
|
-
altura: this.alturaCustomizada,
|
|
2760
|
-
ordemFilhosPorPai: this.ordemFilhosPorPai
|
|
2761
|
-
})));
|
|
2762
|
-
// Estado interno
|
|
2763
|
-
I(this, "camadas", []);
|
|
2764
|
-
I(this, "feicoes", []);
|
|
2765
|
-
I(this, "mapasBase", [...Qe]);
|
|
2766
|
-
I(this, "expandedLayers", /* @__PURE__ */ new Set());
|
|
2767
|
-
I(this, "expandedFeatureLimits", /* @__PURE__ */ new Map());
|
|
2768
|
-
I(this, "ordemFilhosPorPai", /* @__PURE__ */ new Map());
|
|
2769
|
-
I(this, "selectedFeatureIds", /* @__PURE__ */ new Set());
|
|
2770
|
-
I(this, "lastClickedFeatureId", null);
|
|
2771
|
-
I(this, "activeSettingsLayerId", null);
|
|
2772
|
-
I(this, "editingLayerId", null);
|
|
2773
|
-
I(this, "editingFeatureId", null);
|
|
2774
|
-
I(this, "searchQuery", "");
|
|
2775
|
-
I(this, "corpoElement");
|
|
2776
|
-
I(this, "btnExpandirFlutuante");
|
|
2777
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
|
|
2778
|
-
<style>${ht}</style>
|
|
2779
|
-
<div class="ui-camadas-container" id="panel-container" part="base" role="region" aria-label="Painel de Camadas">
|
|
2780
|
-
<div class="ui-camadas-corpo" id="painel-corpo" part="corpo"></div>
|
|
2781
|
-
<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">
|
|
2782
|
-
<span class="ui-camadas-resizer-grip"></span>
|
|
2783
|
-
</div>
|
|
2784
|
-
</div>
|
|
2785
|
-
<button class="ui-camadas-toggle-flutuante" id="btn-expandir-flutuante" part="botao-expandir" title="Expandir Painel de Camadas" aria-label="Expandir Painel de Camadas">
|
|
2786
|
-
${b.camadas}
|
|
2787
|
-
</button>
|
|
2788
|
-
`, this.corpoElement = this.shadow.getElementById("painel-corpo"), this.btnExpandirFlutuante = this.shadow.getElementById("btn-expandir-flutuante"), this.dragDropManager = new lt(this, this.shadow);
|
|
2789
|
-
const a = this.shadow.getElementById("resizer-altura");
|
|
2790
|
-
this.resizerController = ur({
|
|
2791
|
-
hostElement: this,
|
|
2792
|
-
resizerElement: a,
|
|
2793
|
-
listeners: this.listeners,
|
|
2794
|
-
getMinAltura: () => {
|
|
2795
|
-
const r = this.getAttribute("min-altura");
|
|
2796
|
-
return r && parseFloat(r) || 140;
|
|
2797
|
-
},
|
|
2798
|
-
getMaxAltura: () => {
|
|
2799
|
-
const r = this.getAttribute("max-altura");
|
|
2800
|
-
return r && parseFloat(r) || 1600;
|
|
2801
|
-
},
|
|
2802
|
-
onAlturaAlterada: (r) => {
|
|
2803
|
-
this.alturaCustomizada = r, this.salvarLembrancaEstado();
|
|
2804
|
-
}
|
|
2805
|
-
});
|
|
2806
|
-
}
|
|
2807
|
-
static get observedAttributes() {
|
|
2808
|
-
return [
|
|
2809
|
-
"titulo",
|
|
2810
|
-
"mapa-base-ativo",
|
|
2811
|
-
"camada-ativa",
|
|
2812
|
-
"aba-ativa",
|
|
2813
|
-
"colapsavel",
|
|
2814
|
-
"colapsado",
|
|
2815
|
-
"flutuante",
|
|
2816
|
-
"mostrar-mapas-base",
|
|
2817
|
-
"mapas-base-recolhido",
|
|
2818
|
-
"mostrar-rodape",
|
|
2819
|
-
"mostrar-busca",
|
|
2820
|
-
"densidade",
|
|
2821
|
-
"persistir",
|
|
2822
|
-
"storage-key",
|
|
2823
|
-
"redimensionavel",
|
|
2824
|
-
"redimensionavel-altura",
|
|
2825
|
-
"altura",
|
|
2826
|
-
"min-altura",
|
|
2827
|
-
"max-altura",
|
|
2828
|
-
"borda-canvas",
|
|
2829
|
-
...qa
|
|
2830
|
-
];
|
|
2831
|
-
}
|
|
2832
|
-
connectedCallback() {
|
|
2833
|
-
var a;
|
|
2834
|
-
if (this.persistir) {
|
|
2835
|
-
const r = ke(this.obterChaveStorageAtual());
|
|
2836
|
-
r && (r.painelColapsado === !0 && !this.hasAttribute("colapsado") && (this.colapsado = !0), r.camadaAtivaId && !this.getAttribute("camada-ativa") && (this.camadaAtivaId = r.camadaAtivaId), r.mapaBaseAtivo && !this.getAttribute("mapa-base-ativo") && (this.mapaBaseAtivo = r.mapaBaseAtivo), r.densidade && !this.getAttribute("densidade") && (this.densidade = r.densidade), typeof r.altura == "number" && !this.getAttribute("altura") && !this.style.height && (this.resizerController.definirAltura(r.altura, !1), this.alturaCustomizada = r.altura));
|
|
2837
|
-
}
|
|
2838
|
-
this.hasAttribute("altura") && this.resizerController.definirAltura(this.getAttribute("altura"), !1), this.persistir && !this.storageKey && !this.id && (Y.instanciasChavePadrao.size > 0 && console.warn(
|
|
2839
|
-
"[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."
|
|
2840
|
-
), Y.instanciasChavePadrao.add(this)), this.resizerController.init(), qe(this, this.shadow.getElementById("panel-container")), this.atualizarBordaCanvas(), typeof window < "u" && this.listeners.add(window, "resize", () => this.atualizarBordaCanvas()), typeof ResizeObserver < "u" && ((a = this.bordaResizeObserver) == null || a.disconnect(), this.bordaResizeObserver = new ResizeObserver(() => this.atualizarBordaCanvas()), this.bordaResizeObserver.observe(this)), this.render(), this.conectarEventosGerais(), Wt(this, this, this.shadow, this.corpoElement, this.listeners), this.conectado = !0, this.camadas.length > 0 && this.salvarLembrancaEstado();
|
|
2841
|
-
}
|
|
2842
|
-
disconnectedCallback() {
|
|
2843
|
-
var a, r, i;
|
|
2844
|
-
this.conectado = !1, Y.instanciasChavePadrao.delete(this), (a = this.bordaResizeObserver) == null || a.disconnect(), this.bordaResizeObserver = null, (r = this.resizerController) == null || r.destruir(), (i = this.dragDropManager) == null || i.destruir(), Lt(this), this.listeners.cleanup();
|
|
2845
|
-
}
|
|
2846
|
-
attributeChangedCallback(a, r, i) {
|
|
2847
|
-
var o, n;
|
|
2848
|
-
if (r !== i) {
|
|
2849
|
-
if (Da(a)) {
|
|
2850
|
-
qe(this, this.shadow.getElementById("panel-container"));
|
|
2851
|
-
return;
|
|
2852
|
-
}
|
|
2853
|
-
a === "colapsado" ? this.salvarLembrancaEstado() : a === "camada-ativa" ? (this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado()) : a === "densidade" ? this.salvarLembrancaEstado() : a === "mapa-base-ativo" ? i && this.marcarMapaBaseAtivoNoDOM(i) : a === "titulo" || a === "mostrar-mapas-base" || a === "mapas-base-recolhido" || a === "mostrar-rodape" || a === "mostrar-busca" || a === "colapsavel" || a === "flutuante" ? this.solicitarRenderizacao() : a === "altura" ? (o = this.resizerController) == null || o.definirAltura(i, !1) : a === "min-altura" || a === "max-altura" ? this.alturaCustomizada !== null && ((n = this.resizerController) == null || n.definirAltura(this.alturaCustomizada, !1)) : a === "borda-canvas" && this.atualizarBordaCanvas();
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
/**
|
|
2857
|
-
* Define em qual lado do painel aparece a faixinha fina de separação com o canvas:
|
|
2858
|
-
* nunca na borda encostada na tela, sempre no lado voltado ao canvas (ou ambos se solto).
|
|
2859
|
-
*/
|
|
2860
|
-
atualizarBordaCanvas() {
|
|
2861
|
-
const a = this.shadow.getElementById("panel-container");
|
|
2862
|
-
if (!a) return;
|
|
2863
|
-
const r = this.getAttribute("borda-canvas");
|
|
2864
|
-
if (r === "esquerda" || r === "direita" || r === "ambas" || r === "nenhuma") {
|
|
2865
|
-
a.setAttribute("data-borda-canvas", r);
|
|
2866
|
-
return;
|
|
2867
|
-
}
|
|
2868
|
-
let i = "esquerda";
|
|
2869
|
-
if (typeof window < "u" && typeof this.getBoundingClientRect == "function") {
|
|
2870
|
-
const o = this.getBoundingClientRect(), n = window.innerWidth || 0;
|
|
2871
|
-
if (o.width > 0 && n > 0) {
|
|
2872
|
-
const s = o.left <= 2, d = n - o.right <= 2;
|
|
2873
|
-
d && !s ? i = "esquerda" : s && !d ? i = "direita" : s && d ? i = "nenhuma" : i = "ambas";
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
a.setAttribute("data-borda-canvas", i);
|
|
2877
|
-
}
|
|
2878
|
-
// --- Getters e Setters de Propriedades Reativas ---
|
|
2879
|
-
get titulo() {
|
|
2880
|
-
return this.getAttribute("titulo") || "Camadas";
|
|
2881
|
-
}
|
|
2882
|
-
set titulo(a) {
|
|
2883
|
-
this.setAttribute("titulo", a);
|
|
2884
|
-
}
|
|
2885
|
-
get camadaAtivaId() {
|
|
2886
|
-
var a;
|
|
2887
|
-
return this.getAttribute("camada-ativa") || (((a = this.camadas[0]) == null ? void 0 : a.id) ?? null);
|
|
2888
|
-
}
|
|
2889
|
-
set camadaAtivaId(a) {
|
|
2890
|
-
a ? this.setAttribute("camada-ativa", a) : this.removeAttribute("camada-ativa");
|
|
2891
|
-
}
|
|
2892
|
-
get mapaBaseAtivo() {
|
|
2893
|
-
return this.getAttribute("mapa-base-ativo") || "satelite";
|
|
2894
|
-
}
|
|
2895
|
-
set mapaBaseAtivo(a) {
|
|
2896
|
-
this.setAttribute("mapa-base-ativo", a);
|
|
2897
|
-
}
|
|
2898
|
-
selecionarMapaBase(a, r = !1) {
|
|
2899
|
-
!a || this.mapaBaseAtivo === a || (this.mapaBaseAtivo = a, this.marcarMapaBaseAtivoNoDOM(a), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-mapa-base-alterado", { mapaBaseId: a }));
|
|
2900
|
-
}
|
|
2901
|
-
marcarMapaBaseAtivoNoDOM(a) {
|
|
2902
|
-
this.shadow.querySelectorAll("[data-basemap-id]").forEach((i) => {
|
|
2903
|
-
const o = i.getAttribute("data-basemap-id") === a;
|
|
2904
|
-
i.classList.toggle("active", o), i.setAttribute("aria-pressed", String(o));
|
|
2905
|
-
});
|
|
2906
|
-
const r = this.shadow.querySelector("[data-basemap-atual]");
|
|
2907
|
-
r && (r.textContent = Xe(this.mapasBase, a));
|
|
2908
|
-
}
|
|
2909
|
-
/** Seção "Mapa Base" recolhida (só o cabeçalho com o mapa ativo). Atributo `mapas-base-recolhido`. */
|
|
2910
|
-
get mapasBaseRecolhido() {
|
|
2911
|
-
return this.hasAttribute("mapas-base-recolhido");
|
|
2912
|
-
}
|
|
2913
|
-
set mapasBaseRecolhido(a) {
|
|
2914
|
-
a ? this.setAttribute("mapas-base-recolhido", "") : this.removeAttribute("mapas-base-recolhido");
|
|
2915
|
-
}
|
|
2916
|
-
/** Alterna a seção de mapas base; com `emitirEvento`, dispara `ui-mapas-base-recolhimento`. */
|
|
2917
|
-
alternarMapasBaseRecolhido(a = !1) {
|
|
2918
|
-
this.mapasBaseRecolhido = !this.mapasBaseRecolhido, a && this.dispararEvento("ui-mapas-base-recolhimento", { recolhido: this.mapasBaseRecolhido });
|
|
2919
|
-
}
|
|
2920
|
-
get abaAtiva() {
|
|
2921
|
-
return this.getAttribute("aba-ativa") || "camadas";
|
|
2922
|
-
}
|
|
2923
|
-
set abaAtiva(a) {
|
|
2924
|
-
this.setAttribute("aba-ativa", a);
|
|
2925
|
-
}
|
|
2926
|
-
get colapsado() {
|
|
2927
|
-
return this.hasAttribute("colapsado");
|
|
2928
|
-
}
|
|
2929
|
-
set colapsado(a) {
|
|
2930
|
-
a ? this.setAttribute("colapsado", "") : this.removeAttribute("colapsado");
|
|
2931
|
-
}
|
|
2932
|
-
get colapsavel() {
|
|
2933
|
-
return this.getAttribute("colapsavel") !== "false";
|
|
2934
|
-
}
|
|
2935
|
-
set colapsavel(a) {
|
|
2936
|
-
this.setAttribute("colapsavel", String(a));
|
|
2937
|
-
}
|
|
2938
|
-
get flutuante() {
|
|
2939
|
-
return this.hasAttribute("flutuante");
|
|
2940
|
-
}
|
|
2941
|
-
set flutuante(a) {
|
|
2942
|
-
a ? this.setAttribute("flutuante", "") : this.removeAttribute("flutuante");
|
|
2943
|
-
}
|
|
2944
|
-
get densidade() {
|
|
2945
|
-
return this.getAttribute("densidade") || "normal";
|
|
2946
|
-
}
|
|
2947
|
-
set densidade(a) {
|
|
2948
|
-
this.setAttribute("densidade", a);
|
|
2949
|
-
}
|
|
2950
|
-
get mostrarMapasBase() {
|
|
2951
|
-
return this.getAttribute("mostrar-mapas-base") !== "false";
|
|
2952
|
-
}
|
|
2953
|
-
set mostrarMapasBase(a) {
|
|
2954
|
-
this.setAttribute("mostrar-mapas-base", String(a));
|
|
2955
|
-
}
|
|
2956
|
-
get mostrarRodape() {
|
|
2957
|
-
return this.getAttribute("mostrar-rodape") !== "false";
|
|
2958
|
-
}
|
|
2959
|
-
set mostrarRodape(a) {
|
|
2960
|
-
this.setAttribute("mostrar-rodape", String(a));
|
|
2961
|
-
}
|
|
2962
|
-
get mostrarBusca() {
|
|
2963
|
-
return this.getAttribute("mostrar-busca") !== "false";
|
|
2964
|
-
}
|
|
2965
|
-
set mostrarBusca(a) {
|
|
2966
|
-
this.setAttribute("mostrar-busca", String(a));
|
|
2967
|
-
}
|
|
2968
|
-
get persistir() {
|
|
2969
|
-
return this.getAttribute("persistir") !== "false";
|
|
2970
|
-
}
|
|
2971
|
-
set persistir(a) {
|
|
2972
|
-
this.setAttribute("persistir", String(a));
|
|
2973
|
-
}
|
|
2974
|
-
get storageKey() {
|
|
2975
|
-
return this.getAttribute("storage-key");
|
|
2976
|
-
}
|
|
2977
|
-
set storageKey(a) {
|
|
2978
|
-
a ? this.setAttribute("storage-key", a) : this.removeAttribute("storage-key");
|
|
2979
|
-
}
|
|
2980
|
-
get redimensionavel() {
|
|
2981
|
-
return this.hasAttribute("redimensionavel") || this.hasAttribute("redimensionavel-altura");
|
|
2982
|
-
}
|
|
2983
|
-
set redimensionavel(a) {
|
|
2984
|
-
a ? this.setAttribute("redimensionavel", "") : (this.removeAttribute("redimensionavel"), this.removeAttribute("redimensionavel-altura"));
|
|
2985
|
-
}
|
|
2986
|
-
get altura() {
|
|
2987
|
-
return this.getAttribute("altura") || this.style.height || null;
|
|
2988
|
-
}
|
|
2989
|
-
set altura(a) {
|
|
2990
|
-
a != null ? (this.setAttribute("altura", String(a)), this.definirAltura(a)) : (this.removeAttribute("altura"), this.definirAltura(null));
|
|
2991
|
-
}
|
|
2992
|
-
definirAltura(a, r = !0) {
|
|
2993
|
-
var o;
|
|
2994
|
-
(o = this.resizerController) == null || o.definirAltura(a, !1);
|
|
2995
|
-
const i = a !== null ? parseFloat(String(a)) : null;
|
|
2996
|
-
this.alturaCustomizada = isNaN(i) ? null : i, r && this.salvarLembrancaEstado();
|
|
2997
|
-
}
|
|
2998
|
-
// --- Gerenciamento de Persistência / Lembrança ---
|
|
2999
|
-
obterChaveStorageAtual() {
|
|
3000
|
-
return this.lembranca.chaveAtual();
|
|
3001
|
-
}
|
|
3002
|
-
/** Versão com debounce, para interações contínuas (seletor de cor, slider de opacidade). */
|
|
3003
|
-
agendarSalvarLembranca() {
|
|
3004
|
-
this.lembranca.agendar();
|
|
3005
|
-
}
|
|
3006
|
-
salvarLembrancaEstado() {
|
|
3007
|
-
this.lembranca.salvar();
|
|
3008
|
-
}
|
|
3009
|
-
limparLembranca() {
|
|
3010
|
-
this.expandedFeatureLimits.clear(), this.ordemFilhosPorPai.clear(), this.lembranca.limpar();
|
|
3011
|
-
}
|
|
3012
|
-
// --- API Pública de Alta Ergonomia ---
|
|
3013
|
-
//
|
|
3014
|
-
// Contrato de eventos: toda mutação feita pelo aplicativo consumidor (propriedades,
|
|
3015
|
-
// atributos e métodos públicos) atualiza apenas o DOM interno, sem disparar eventos.
|
|
3016
|
-
// Eventos saem do componente somente em resposta a uma interação física do usuário
|
|
3017
|
-
// (clique, drag-and-drop, teclado). Métodos que aceitam `emitirEvento` permitem
|
|
3018
|
-
// optar explicitamente pela emissão quando necessário.
|
|
3019
|
-
/** Atalho reativo para `definirCamadas()` — não dispara eventos. */
|
|
3020
|
-
get layers() {
|
|
3021
|
-
return this.camadas;
|
|
3022
|
-
}
|
|
3023
|
-
set layers(a) {
|
|
3024
|
-
this.definirCamadas(a);
|
|
3025
|
-
}
|
|
3026
|
-
/** Atalho reativo para `definirFeicoes()` — não dispara eventos. */
|
|
3027
|
-
get features() {
|
|
3028
|
-
return this.feicoes;
|
|
3029
|
-
}
|
|
3030
|
-
set features(a) {
|
|
3031
|
-
this.definirFeicoes(a);
|
|
3032
|
-
}
|
|
3033
|
-
/** Atalho reativo para `definirMapasBase()` — não dispara eventos. */
|
|
3034
|
-
get basemaps() {
|
|
3035
|
-
return this.mapasBase;
|
|
3036
|
-
}
|
|
3037
|
-
set basemaps(a) {
|
|
3038
|
-
this.definirMapasBase(a);
|
|
3039
|
-
}
|
|
3040
|
-
definirCamadas(a, r) {
|
|
3041
|
-
rr(this, a, r);
|
|
3042
|
-
}
|
|
3043
|
-
definirFeicoes(a) {
|
|
3044
|
-
or(this, a);
|
|
3045
|
-
}
|
|
3046
|
-
definirMapasBase(a) {
|
|
3047
|
-
this.mapasBase = Array.isArray(a) ? [...a] : [], this.solicitarRenderizacao();
|
|
3048
|
-
}
|
|
3049
|
-
definirCamadaAtiva(a, r = !1) {
|
|
3050
|
-
!a || this.camadaAtivaId === a || (this.camadaAtivaId = a, this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-camada-selecionada", {
|
|
3051
|
-
camadaId: a,
|
|
3052
|
-
camada: this.camadas.find((i) => i.id === a)
|
|
3053
|
-
}));
|
|
3054
|
-
}
|
|
3055
|
-
obterCamada(a) {
|
|
3056
|
-
return this.camadas.find((r) => r.id === a);
|
|
3057
|
-
}
|
|
3058
|
-
obterCamadaAtiva() {
|
|
3059
|
-
return this.camadas.find((a) => a.id === this.camadaAtivaId);
|
|
3060
|
-
}
|
|
3061
|
-
obterFeicao(a) {
|
|
3062
|
-
return this.feicoes.find((r) => r.id === a);
|
|
3063
|
-
}
|
|
3064
|
-
obterFeicoesSelecionadas() {
|
|
3065
|
-
return this.feicoes.filter((a) => this.selectedFeatureIds.has(a.id));
|
|
3066
|
-
}
|
|
3067
|
-
adicionarCamada(a) {
|
|
3068
|
-
nr(this, a);
|
|
3069
|
-
}
|
|
3070
|
-
removerCamada(a) {
|
|
3071
|
-
sr(this, a);
|
|
3072
|
-
}
|
|
3073
|
-
adicionarFeicao(a) {
|
|
3074
|
-
lr(this, a);
|
|
3075
|
-
}
|
|
3076
|
-
atualizarFeicao(a) {
|
|
3077
|
-
dr(this, a);
|
|
3078
|
-
}
|
|
3079
|
-
removerFeicao(a) {
|
|
3080
|
-
cr(this, a);
|
|
3081
|
-
}
|
|
3082
|
-
selecionarFeicao(a, r = !1, i = !1, o = !1) {
|
|
3083
|
-
Jt(this, a, r, i, o);
|
|
3084
|
-
}
|
|
3085
|
-
selecionarFeicoes(a, r = !1) {
|
|
3086
|
-
Zt(this, a, r);
|
|
3087
|
-
}
|
|
3088
|
-
limparSelecao(a = !1) {
|
|
3089
|
-
er(this, a);
|
|
3090
|
-
}
|
|
3091
|
-
expandirTodas() {
|
|
3092
|
-
this.expandedLayers = new Set(this.camadas.map((a) => a.id)), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3093
|
-
}
|
|
3094
|
-
colapsarTodas() {
|
|
3095
|
-
this.expandedLayers.clear(), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3096
|
-
}
|
|
3097
|
-
alternarExpansao(a) {
|
|
3098
|
-
a && (this.expandedLayers.has(a) ? this.expandedLayers.delete(a) : this.expandedLayers.add(a), this.salvarLembrancaEstado(), this.solicitarRenderizacao());
|
|
3099
|
-
}
|
|
3100
|
-
incrementarLimiteFeicoes(a) {
|
|
3101
|
-
if (!a) return;
|
|
3102
|
-
const r = this.expandedFeatureLimits.get(a) ?? 80;
|
|
3103
|
-
this.expandedFeatureLimits.set(a, r + 80), this.solicitarRenderizacao();
|
|
3104
|
-
}
|
|
3105
|
-
alternarVisibilidadeTodas(a = !1) {
|
|
3106
|
-
const i = !this.camadas.some((o) => o.visible !== !1);
|
|
3107
|
-
this.camadas.forEach((o) => {
|
|
3108
|
-
o.visible = i, a && this.dispararEvento("ui-camada-visibilidade", { camadaId: o.id, visivel: i });
|
|
3109
|
-
}), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3110
|
-
}
|
|
3111
|
-
colapsar(a = !1) {
|
|
3112
|
-
this.definirColapso(!0, a);
|
|
3113
|
-
}
|
|
3114
|
-
expandir(a = !1) {
|
|
3115
|
-
this.definirColapso(!1, a);
|
|
3116
|
-
}
|
|
3117
|
-
alternarColapso(a = !1) {
|
|
3118
|
-
this.definirColapso(!this.colapsado, a);
|
|
3119
|
-
}
|
|
3120
|
-
definirColapso(a, r) {
|
|
3121
|
-
this.colapsado !== a && (this.colapsado = a, r && this.dispararEvento("ui-colapso-alterado", { colapsado: a }));
|
|
3122
|
-
}
|
|
3123
|
-
// --- Renderização e Ciclo de Vida ---
|
|
3124
|
-
solicitarRenderizacao() {
|
|
3125
|
-
if (this.profundidadeLote > 0) {
|
|
3126
|
-
this.renderPendente = !0;
|
|
3127
|
-
return;
|
|
3128
|
-
}
|
|
3129
|
-
this.render();
|
|
3130
|
-
}
|
|
3131
|
-
/**
|
|
3132
|
-
* Caminho das mutações de feição: o DOM fica atualizado na volta da chamada, mas só as linhas afetadas são
|
|
3133
|
-
* refeitas quando possível. Em `emLote` vale o adiamento de sempre (uma renderização completa no fim).
|
|
3134
|
-
* Qualquer caso que o caminho incremental não garanta (busca, edição inline, drawer, camada fora da árvore…)
|
|
3135
|
-
* cai no render completo.
|
|
3136
|
-
*/
|
|
3137
|
-
solicitarAtualizacaoFeicoes(a) {
|
|
3138
|
-
if (this.profundidadeLote > 0) {
|
|
3139
|
-
this.renderPendente = !0;
|
|
3140
|
-
return;
|
|
3141
|
-
}
|
|
3142
|
-
this.mudancaFeicoes = a, this.render();
|
|
3143
|
-
}
|
|
3144
|
-
/**
|
|
3145
|
-
* Agrupa várias mutações (`adicionarFeicao` em laço, por exemplo) em uma só renderização, ao fim de `fn`.
|
|
3146
|
-
* Mesmo com a atualização incremental, é a forma ideal para cargas grandes: o DOM é refeito uma só vez.
|
|
3147
|
-
*/
|
|
3148
|
-
emLote(a) {
|
|
3149
|
-
this.profundidadeLote++;
|
|
3150
|
-
try {
|
|
3151
|
-
a();
|
|
3152
|
-
} finally {
|
|
3153
|
-
this.profundidadeLote--, this.profundidadeLote === 0 && this.renderPendente && (this.renderPendente = !1, this.render());
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
3156
|
-
dispararEvento(a, r) {
|
|
3157
|
-
this.dispatchEvent(
|
|
3158
|
-
new CustomEvent(a, {
|
|
3159
|
-
detail: r,
|
|
3160
|
-
bubbles: !0,
|
|
3161
|
-
composed: !0
|
|
3162
|
-
})
|
|
3163
|
-
);
|
|
3164
|
-
}
|
|
3165
|
-
render() {
|
|
3166
|
-
const a = this.mudancaFeicoes;
|
|
3167
|
-
this.mudancaFeicoes = null, this.corpoElement && (a && Vt(this, this.shadow, this.dragDropManager, a) || Gt(this, this.shadow, this.corpoElement, this.dragDropManager));
|
|
3168
|
-
}
|
|
3169
|
-
// --- Conexão de Eventos ---
|
|
3170
|
-
conectarEventosGerais() {
|
|
3171
|
-
this.listeners.add(this.btnExpandirFlutuante, "click", () => this.expandir(!0));
|
|
3172
|
-
}
|
|
3173
|
-
// --- Sincronização de DOM (delegada) ---
|
|
3174
|
-
sincronizarCamadaAtivaDOM() {
|
|
3175
|
-
vt(this, this.shadow);
|
|
3176
|
-
}
|
|
3177
|
-
sincronizarSelecaoDOM() {
|
|
3178
|
-
bt(this, this.shadow);
|
|
3179
|
-
}
|
|
3180
|
-
// --- Auxiliares Internos ---
|
|
3181
|
-
notificarMudancaSelecao() {
|
|
3182
|
-
ar(this);
|
|
3183
|
-
}
|
|
3184
|
-
};
|
|
3185
|
-
/** Painéis conectados sem `id` nem `storage-key`: dividem a mesma chave de persistência. */
|
|
3186
|
-
I(Y, "instanciasChavePadrao", /* @__PURE__ */ new Set());
|
|
3187
|
-
let ee = Y;
|
|
3188
|
-
class pr extends ee {
|
|
3189
|
-
}
|
|
3190
|
-
class fr extends ee {
|
|
3191
|
-
}
|
|
3192
|
-
Ce("ui-camadas", ee);
|
|
3193
|
-
Ce("ui-painel-camadas", pr);
|
|
3194
|
-
Ce("ui-layer-panel", fr);
|
|
3195
|
-
function Ir(e) {
|
|
3196
|
-
var t;
|
|
3197
|
-
return {
|
|
3198
|
-
id: e.id,
|
|
3199
|
-
name: e.nome || e.id,
|
|
3200
|
-
color: ((t = e.estilo) == null ? void 0 : t.corPrimaria) || "#00E08A",
|
|
3201
|
-
visible: e.visivel !== !1,
|
|
3202
|
-
locked: e.bloqueada === !0,
|
|
3203
|
-
opacity: typeof e.opacidade == "number" ? e.opacidade : 1,
|
|
3204
|
-
order: e.zIndex,
|
|
3205
|
-
description: e.categoria ? `Categoria: ${e.categoria}` : void 0,
|
|
3206
|
-
categoria: e.categoria,
|
|
3207
|
-
tipo: e.tipo,
|
|
3208
|
-
estilo: e.estilo,
|
|
3209
|
-
dados: e.dados
|
|
3210
|
-
};
|
|
3211
|
-
}
|
|
3212
|
-
function kr(e, t = "levantamento", a = "feicoes") {
|
|
98
|
+
id: a.id,
|
|
99
|
+
name: a.nome || a.id,
|
|
100
|
+
color: ((r = a.estilo) == null ? void 0 : r.corPrimaria) || "#00E08A",
|
|
101
|
+
visible: a.visivel !== !1,
|
|
102
|
+
locked: a.bloqueada === !0,
|
|
103
|
+
opacity: typeof a.opacidade == "number" ? a.opacidade : 1,
|
|
104
|
+
order: a.zIndex,
|
|
105
|
+
description: a.categoria ? `Categoria: ${a.categoria}` : void 0,
|
|
106
|
+
categoria: a.categoria,
|
|
107
|
+
tipo: a.tipo,
|
|
108
|
+
estilo: a.estilo,
|
|
109
|
+
dados: a.dados
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function L(a, r = "levantamento", e = "feicoes") {
|
|
3213
113
|
return {
|
|
3214
|
-
id:
|
|
3215
|
-
nome:
|
|
3216
|
-
categoria:
|
|
3217
|
-
tipo:
|
|
3218
|
-
visivel:
|
|
3219
|
-
opacidade: typeof
|
|
3220
|
-
zIndex: typeof
|
|
3221
|
-
bloqueada:
|
|
114
|
+
id: a.id,
|
|
115
|
+
nome: a.name,
|
|
116
|
+
categoria: a.categoria || r,
|
|
117
|
+
tipo: a.tipo || e,
|
|
118
|
+
visivel: a.visible !== !1,
|
|
119
|
+
opacidade: typeof a.opacity == "number" ? a.opacity : 1,
|
|
120
|
+
zIndex: typeof a.order == "number" ? a.order : 500,
|
|
121
|
+
bloqueada: a.locked === !0,
|
|
3222
122
|
interativo: !0,
|
|
3223
123
|
estilo: {
|
|
3224
|
-
corPrimaria:
|
|
124
|
+
corPrimaria: a.color || "#00E08A",
|
|
3225
125
|
scaleMode: "screen",
|
|
3226
|
-
...typeof
|
|
126
|
+
...typeof a.estilo == "object" && a.estilo !== null ? a.estilo : {}
|
|
3227
127
|
},
|
|
3228
|
-
dados: typeof
|
|
128
|
+
dados: typeof a.dados == "object" && a.dados !== null ? a.dados : void 0
|
|
3229
129
|
};
|
|
3230
130
|
}
|
|
3231
|
-
function
|
|
3232
|
-
var o,
|
|
3233
|
-
const
|
|
131
|
+
function S(a, r = "") {
|
|
132
|
+
var o, s, c, d;
|
|
133
|
+
const e = ((o = a.geometria) == null ? void 0 : o.tipo) || ((s = a.geometria) == null ? void 0 : s.type) || a.tipo || a.type || "Polygon", t = ((c = a.geometria) == null ? void 0 : c.coordenadas) || ((d = a.geometria) == null ? void 0 : d.coordinates) || a.coordinates, i = a.cor || a.color;
|
|
3234
134
|
return {
|
|
3235
|
-
id: String(
|
|
3236
|
-
name:
|
|
3237
|
-
layerId:
|
|
3238
|
-
type:
|
|
3239
|
-
geometryType:
|
|
3240
|
-
coordinates:
|
|
135
|
+
id: String(a.id),
|
|
136
|
+
name: a.nome || a.name || `Feição ${a.id}`,
|
|
137
|
+
layerId: a.layerId || a.camadaId || r,
|
|
138
|
+
type: e,
|
|
139
|
+
geometryType: e,
|
|
140
|
+
coordinates: t,
|
|
3241
141
|
color: i,
|
|
3242
|
-
visible:
|
|
3243
|
-
locked:
|
|
3244
|
-
status:
|
|
3245
|
-
category:
|
|
3246
|
-
properties:
|
|
142
|
+
visible: a.visivel !== void 0 ? a.visivel : a.visible !== !1,
|
|
143
|
+
locked: a.bloqueada !== void 0 ? a.bloqueada : a.locked === !0,
|
|
144
|
+
status: a.status || "oficial",
|
|
145
|
+
category: a.categoria || a.category,
|
|
146
|
+
properties: a.propriedades || a.properties || {}
|
|
3247
147
|
};
|
|
3248
148
|
}
|
|
3249
149
|
export {
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
150
|
+
R as CamadasDragDropManager,
|
|
151
|
+
B as ICONES,
|
|
152
|
+
D as LIMITE_FEICOES_POR_CAMADA,
|
|
153
|
+
q as MAPAS_BASE_PADRAO,
|
|
154
|
+
N as UICamadas,
|
|
155
|
+
k as UILayerPanel,
|
|
156
|
+
oa as UIMapaBase,
|
|
157
|
+
z as UIPainelCamadas,
|
|
158
|
+
sa as UISeletorMapaBase,
|
|
159
|
+
g as calcularAreaAnelSimples,
|
|
160
|
+
A as calcularAreaPoligono,
|
|
161
|
+
y as calcularComprimentoLinha,
|
|
162
|
+
b as calcularDistanciaPontos,
|
|
163
|
+
O as calcularSelecaoFeicao,
|
|
164
|
+
T as carregarEstadoPersistido,
|
|
165
|
+
U as construirHierarquiaCamadas,
|
|
166
|
+
L as converterCamadaItemParaCanvasLayer,
|
|
167
|
+
f as converterCanvasLayerParaCamadaItem,
|
|
168
|
+
S as converterFeicaoParaItem,
|
|
169
|
+
_ as escapeHtml,
|
|
170
|
+
$ as filtrarCamadasPorBusca,
|
|
171
|
+
G as filtrarFeicoesPorBusca,
|
|
172
|
+
F as formatarMetricaFeicoes,
|
|
173
|
+
j as formatarOpcoesCamadasHierarquicas,
|
|
174
|
+
H as gerarChaveStorage,
|
|
175
|
+
w as limparEstadoPersistido,
|
|
176
|
+
V as montarEstadoPersistido,
|
|
177
|
+
J as nomeDoMapaBase,
|
|
178
|
+
K as normalizarEstadoPersistido,
|
|
179
|
+
Q as obterIdsVisiveisFeicoes,
|
|
180
|
+
W as reidratarCamadasComOverrides,
|
|
181
|
+
X as removerSelecoesInvalidas,
|
|
182
|
+
Y as renderizarArvoreCamadas,
|
|
183
|
+
Z as renderizarGridMapasBase,
|
|
184
|
+
aa as renderizarRodapeAcoes,
|
|
185
|
+
ra as renderizarThumbGeometria,
|
|
186
|
+
ta as rotuloRodape,
|
|
187
|
+
ea as salvarEstadoPersistido,
|
|
188
|
+
ia as snapshotCamada
|
|
3289
189
|
};
|